No regression guard on the idle classifier: a ghost-vs-typed inversion caused a silent fleet-wide coverage outage
Elazar caught scan-context.py's capture_prompt_line_is_real_input() reading the FIRST prompt-glyph line instead of the last, so CC's dim autosuggest ghost read as typed input and pinned idle=false permanently on 5 agents (8.3-34.7h each, ctx 45-77%). Fixed 2026-08-09. This WI is for the REGRESSION GUARD, not the fix: nothing tests the idle classifier against a ghost pane, which is why a function written specifically to detect ghosts could be inverted and produce a fleet-wide coverage outage that read as 6 separate agent faults. Wanted: a check that constructs or captures a known-ghost and a known-typed prompt line and asserts is_idle()/capture_prompt_line_is_real_input() classify both correctly, runnable before any push touching the classifier. Related: OPS-116 (the false alerts this produced), OPS-122 (alert latch).
Questions
Activity
-
Guard shipped: monitor-context/test-classifier.py (sh.git 7245ac3). classify_prompt_line() split out of capture_prompt_line_is_real_input() as a pure, tmux-free seam - the inversion was pure line-selection logic welded to a subprocess call, so there was no seam to test through. 17 assertions across three layers: single-line ghost-vs-typed in BOTH directions (a guard that only asserts ghost->not-real passes trivially on a function that returns False unconditionally, which is the same outage mirrored); the line-ORDERING cases that actually broke; and is_idle() integration with the classifier stubbed, plus the db-mars-cc truncated-ellipsis case. Fixtures are real captured bytes from live venus panes, not hand-written. MUTATION-VERIFIED: reverting reversed() to forward iteration fails exactly the 2 ordering assertions and passes all 7 single-line ones - i.e. a single-line fixture set would have shipped the outage. --live additionally round-trips through a scratch tmux server on its own socket so the guard also pins the assumption UNDER the logic (that tmux still hands back the SGR-2 dim run at all); no agent session touched. Run './test-classifier.py --live' before any push touching the classifier. NOT done: not wired as an automatic pre-push hook - .gitpush-pre.sh in sh.git is shared fleet-wide and is bin-venus-cc's lane; proposing it there separately.