diag: expand dogfood logging — lighter scrub + always-log failures + wrapper catch-all
All checks were successful
build-apk / build-and-publish (push) Successful in 8m2s

Pairs with strawcore's new extractor instrumentation to make "Send logs to Kayos"
actually diagnosable. Today's bot-wall outage produced a log dump that was 90%
framework noise, one mangled strawcore line, and zero failure signal.

- LogDump: split the scrubber into a FULL profile (share-sheet export + on-screen
  error strings — unchanged, still over-redacts) and a lighter DOGFOOD profile
  (the logs.sulkta.com ingest path, our own infra) that KEEPS bare YouTube ids
  (video/channel/playlist/youtu.be — the triage signal) while still scrubbing
  every real credential: signed googlevideo URLs, bearer/cookie/token headers,
  sig/pot/n/cpn params, URL queries, emails, high-entropy tokens (visitorData),
  and IPs. LogShipper uses the dogfood profile.
- Fixed the IPv6-compressed regex that mangled Rust module paths
  (`strawcore::stream` -> `strawcor<ip>stream`) and, as a bonus, a latent
  false-negative where `::1` was never scrubbed.
- Always-log extraction + playback failures (strawLogI) so a user-visible failure
  always lands in the ring.
- Wrapper (rust/strawcore): one catch-all WARN in run_extract that traces EVERY
  extraction failure system-wide, and raise android_logger Info->Debug so the
  extractor's DEBUG tier is live in the dogfood build.
- Added a JVM unit test for the scrubber (not yet wired into CI — the repo has no
  test source set; follow-up).
This commit is contained in:
Cobb 2026-08-06 08:17:15 -07:00
parent 06e27775fe
commit 4d3ddf502f
9 changed files with 225 additions and 31 deletions

View file

@ -33,7 +33,11 @@ pub fn init_logging() {
ONCE.call_once(|| {
android_logger::init_once(
android_logger::Config::default()
.with_max_level(log::LevelFilter::Info)
// Debug (not Info) so the extractor's DEBUG tier — per-request
// HTTP breadcrumbs, cache/lexer-fallback internals — is live in
// this dogfood/debug build. WARN/INFO were already emitted; this
// unlocks the chatty diagnostics behind them.
.with_max_level(log::LevelFilter::Debug)
.with_tag("strawcore"),
);
log::info!("strawcore initialized");

View file

@ -122,7 +122,10 @@ pub(crate) async fn run_extract<T, E, F>(what: &'static str, f: F) -> Result<T,
where
F: FnOnce() -> Result<T, E> + Send + 'static,
T: Send + 'static,
E: Send + 'static,
// `Display` so the single catch-all below can log the error. Every caller
// passes a core `ExtractionError`, whose Display is already URL/token
// scrubbed at the source (exceptions.rs choke points), so this is safe.
E: std::fmt::Display + Send + 'static,
StrawcoreError: From<E>,
{
match tokio::time::timeout(EXTRACT_TIMEOUT, tokio::task::spawn_blocking(f)).await {
@ -136,7 +139,14 @@ where
msg: format!("join: {join}"),
}),
// Blocking task returned; propagate its own error via the existing
// `From<ExtractionError>` mapping.
Ok(Ok(inner)) => inner.map_err(StrawcoreError::from),
// `From<ExtractionError>` mapping. This is the single catch-all for
// EVERY extraction failure system-wide (incl. the bot-wall) — one WARN
// here means no failure path is silent. Display strings are scrubbed
// at the source, so this never leaks a stream URL or token.
Ok(Ok(Ok(v))) => Ok(v),
Ok(Ok(Err(err))) => {
log::warn!("strawcore::{what} failed: {err}");
Err(StrawcoreError::from(err))
}
}
}