…self-identifying markers
The in-turn compaction-stats block (build_inturn_stats + gross-error guard +
COMPACTION_STATS_* WARNINGs) ran for EVERY LCM compress() call — including
no-ops — while the announce formatter default-denies non-rendering statuses
(noop/idle/running/bypassed; conditional statuses failing the post<pre render
check). Result: ~100% kept_tail APPROX_ATTRIBUTION and TAG_MISSING WARNINGs
fired for announces that never render — pure log noise that polluted the
daily compaction-stats watcher report (measured 2026-07-02: every real-session
degrade marker in apollo's agent.log rode an 'LCM compression no-op' line).
Fix: _inturn_stats_render_eligible() mirrors the formatter's own gating by
consuming the SAME allow-list objects (single source of truth, no copied
literals) + the conditional token check, applied on the exact variables the
announce call passes as pre_tokens/post_tokens. LCM-scoped: the built-in path
keeps its sid-rotation gating and may not expose _last_compression_status.
Also (D-4): every compaction-stats marker now carries session=<id>, plus
src=test under pytest (PYTEST_CURRENT_TEST), so the log watcher can attribute
markers by the line's own fields instead of fragile proximity joins — pytest
writing through the live logging config previously inflated production counts.
Tests: 13 new (gate predicate matrix vs the real formatter as oracle; drift
guards asserting the gate uses the formatter's allow-list objects and the
announce-call token variables; stats=None render tolerance; marker session/
src=test fields incl. from a threading.Thread worker — the measured polluter's
shape; throttle unaffected). Spec (4 Opus review passes):
plans/2026-07-02_inturn-noop-gate-multipass-provenance-SPEC.md v0.5, PR-A.
Problem
The in-turn compaction-stats block runs for EVERY LCM
compress()call — including no-ops — while the announce formatter default-denies non-rendering statuses. Result:COMPACTION_STATS_APPROX_ATTRIBUTION(at ~100% kept_tail) andTAG_MISSINGWARNINGs fire for announces that never render. Measured 2026-07-02: every real-session degrade marker in apollo's agent.log rode anLCM compression no-opline — pure log noise polluting the daily compaction-stats watcher report.Fix
_inturn_stats_render_eligible()mirrors the formatter's own gating by consuming the SAME allow-list objects + the conditional post<pre token check, applied to the exact variables the announce call passes aspre_tokens/post_tokens. LCM-scoped (built-in path unchanged — it keeps sid-rotation gating and may not expose_last_compression_status).session=<id>+src=testunder pytest, so log consumers attribute markers by the line's own fields (pytest writing through the live logging config previously inflated production counts).Tests
13 new: gate matrix vs the real formatter as oracle; drift guards (gate uses the formatter's allow-list objects + the announce-call token variables — source-structure);
stats=Nonerender tolerance; marker fields incl. from athreading.Threadworker (the measured polluter's shape); throttle unaffected.Spec:
plans/2026-07-02_inturn-noop-gate-multipass-provenance-SPEC.mdv0.5 — 4 Opus review passes (BLOCK → AWC → BLOCK → AWC/zero-blockers). PR-A of the pair; PR-B (multi-pass provenance shadow) stacks on this.