agent: code-atomiser-fix — drop lumotia_live custom target in live.rs (Obs-1, Obs-2)
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled

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) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 18:15:08 +01:00
parent 12b413d645
commit d1391b34ac

View File

@@ -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")
);
}
}