From d1391b34ac8710097ac383128def8fd4f6cb66a8 Mon Sep 17 00:00:00 2001 From: Jake Date: Wed, 13 May 2026 18:15:08 +0100 Subject: [PATCH] =?UTF-8?q?agent:=20code-atomiser-fix=20=E2=80=94=20drop?= =?UTF-8?q?=20lumotia=5Flive=20custom=20target=20in=20live.rs=20(Obs-1,=20?= =?UTF-8?q?Obs-2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The drain-timeout warning in LiveSessionRuntime emitted with `target: "lumotia_live"`, which EnvFilter treats as the literal target string and not as a substring of `lumotia_lib::commands::live`. The operator's documented triage filter (`RUST_LOG=info,lumotia=debug,lumotia_lib::commands::live=debug`, per docs/superpowers/audits/2026-05-10-phase10a-dogfood-notes.md) therefore silenced the only warning that surfaces a wedged inference worker. Drop the explicit `target:` so the emit picks up its module-path target and falls under the existing filter directive. `lumotia_startup`, `lumotia_storage`, `lumotia_hotkey`, etc. remain deliberately custom targets — each is a separate semantic phase with its own dedicated EnvFilter directive. Regression test asserts no `target: "lumotia_live"` literal remains in live.rs by scanning the file's own source. Skips comment lines so the rationale prose does not self-trip. Co-Authored-By: Claude Opus 4.7 (1M context) --- src-tauri/src/commands/live.rs | 45 +++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/commands/live.rs b/src-tauri/src/commands/live.rs index f3408ec..4f4d21a 100644 --- a/src-tauri/src/commands/live.rs +++ b/src-tauri/src/commands/live.rs @@ -563,8 +563,14 @@ impl LiveSessionRuntime { // the lifecycle deadlock is broken either way. if let Some(task) = self.state.inflight.as_ref() { task.abort_flag.store(true, Ordering::Relaxed); + // Targeting convention: implicit module-path target + // (`lumotia_lib::commands::live`) so the operator's + // `RUST_LOG=…,lumotia_lib::commands::live=debug` filter + // covers this emit. A previous `target: "lumotia_live"` + // literal slipped past EnvFilter (which matches on + // `::`-segments, not substrings) and silenced this + // warning during the operator's documented triage. tracing::warn!( - target: "lumotia_live", session_id = self.session_id, chunk_id = task.chunk_id, timeout_ms = drain_timeout_ms, @@ -2094,4 +2100,41 @@ mod tests { "Drop for InferenceTask must signal cancellation to the worker" ); } + + /// Regression: every `tracing::*!` emit in this file must use the + /// implicit module-path target so it is covered by the operator's + /// documented triage filter + /// `RUST_LOG=...,lumotia_lib::commands::live=debug`. + /// + /// A previous custom literal target slipped past EnvFilter (which + /// matches on `::`-segments, not substrings) and silenced the + /// drain-timeout warning at incident time. If you find yourself + /// reaching for a custom literal target here, instead extend the + /// `DEFAULT_*_FILTER` constants in `src-tauri/src/lib.rs`. + #[test] + fn no_lumotia_live_literal_target_in_live_rs() { + let source = include_str!("live.rs"); + // The forbidden literal, assembled at runtime so this test's own + // source does not contain a stray match. Comment + doc-comment + // lines are skipped so the rationale above does not self-trip. + let forbidden = format!("\"{}\"", "lumotia_live"); + let mut offenders = Vec::new(); + for (idx, raw) in source.lines().enumerate() { + let trimmed = raw.trim_start(); + if trimmed.starts_with("//") { + continue; + } + if raw.contains("target:") && raw.contains(&forbidden) { + offenders.push(format!("L{}: {}", idx + 1, raw.trim())); + } + } + assert!( + offenders.is_empty(), + "found custom literal target(s) that dodge the \ + `lumotia_lib::commands::live` EnvFilter directive. Drop the \ + `target:` parameter so the emit uses the module-path target. \ + Offenders:\n{}", + offenders.join("\n") + ); + } }