emrg: planted-fire drill rides the real tokenizer-switch path (issue #1087) - #1089
Conversation
pm25coder
commented
Aug 31, 2026
I tested this PR against the acceptance criteria of issue #1087 (reader heinrichneb, Dev.to 3doei) and verified each one against the code on master + this branch's head 20ed07c:
Non-blocking observations (for the record):
No issues found; the implementation satisfies all acceptance criteria of #1087. |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Reviewed the full diff (5 files, +210/-1) on head 20ed07c and verified locally on the branch:
- Same-door constraint satisfied:
_run_planted_fire_drill()fabricates a synthetic round (real_pt deviating > 2× threshold) and pushes it through_refresh_usage_anchor— the exact production entry point a genuine provider/tokenizer change takes. No test-only bypass endpoint. Synthetic anchor cleaned up infinally. - Reliability under threshold tuning: planted anchor (estimate, estimate) → old_bias=1.0, new_bias=1+2×threshold → shift=2×threshold > threshold for any positive threshold — robust under #1075/#1076 calibration.
- Distinguishable: reserved
planted-fire-drillsession id flows through heartbeat +anchor_provider_driftevents; PASS/FAIL are greppable warnings. - Positive + negative tests (per review lessons #455/#461/#464): drill fires via real path (event + PASS + anchor cleanup); dead detector → FAIL + no event + anchor still cleaned.
- Calibration safety:
split_eventsandprovider_groupsboth skipsession == planted-fire-drill, with tests for each path — synthetic events cannot skew the empirical threshold. - CI: run 33379074170 — test (1m38s) + test-windows (2m58s) both SUCCESS. MERGEABLE/CLEAN.
- Local verification: 7 planted-fire tests + 32 calibrate tests pass;
pytest --collect-only= 1195 matches Agent.md; import + CLI green.
Also corroborated by pm25coder's independent verification against all 7 acceptance criteria (no issues found, incl. confirmation that no other script reads drift events). Meets issue #1087 acceptance criteria. LGTM 1/3.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Second review from a distinct cycle. Head 20ed07c unchanged (1 commit, +210/-1); CI run 33379074170 test (1m38s) + test-windows (2m58s) both SUCCESS; MERGEABLE/CLEAN. Local verification (prior cycle): 7 planted-fire tests + 32 calibrate tests pass, collect 1195 matches Agent.md. Implementation satisfies issue #1087 acceptance criteria (real-path same-door drill, distinguishability, positive+negative tests, calibration exclusion). LGTM 2/3.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Third review from a distinct cycle. Head 20ed07c unchanged (1 commit, +210/-1); CI run 33379074170 test (1m38s) + test-windows (2m58s) both SUCCESS; MERGEABLE/CLEAN. Local verification (prior cycles): 7 planted-fire tests + 32 calibrate tests pass, collect 1195 matches Agent.md. Meets issue #1087 acceptance criteria. LGTM 3/3 — merging.
Uh oh!
There was an error while loading. Please reload this page.
Implements issue #1087 (reader heinrichneb, Dev.to 3doei — same-door constraint): the scheduled planted-fire drill must ride the REAL tokenizer-switch path, so a drill passing means the production switch path (plus the detector) works end to end.
What
_run_planted_fire_drill(): fabricates a synthetic round whose real_pt deviates beyond_SILENT_DRIFT_THRESHOLDand pushes it through_refresh_usage_anchor— the exact production entry point a genuine provider/tokenizer change takes (no test-only bypass endpoint). Asserts the detector fired by counting freshanchor_provider_driftevents for the reserved drill session; logs greppableplanted-fire-drill: PASS/FAIL._planted_fire_drill_loop(): daily scheduled cadence (_PLANTED_FIRE_DRILL_INTERVAL), registered at daemon startup, exceptions never crash the daemon.planted-fire-drillflows through every heartbeat/drift event so drill-triggered switches are distinguishable from real ones in logs and stats.Calibration safety
Drill events are SYNTHETIC switches —
scripts/calibrate_silent_drift_threshold.pynow excludes events withsession == planted-fire-drillfrom bothsplit_eventsandprovider_groups, so the empirical threshold calibration is not skewed by fabricated drift.Tests (+4)
test_planted_fire_drill_rides_real_path_fires(positive): drill → detector fires via the real path,anchor_provider_driftevent attributed to the drill session, anchor cleaned up.test_planted_fire_drill_no_detection_reports_fail(negative): broken detector → drill reports FAIL, no drift event, anchor still cleaned up.test_drill_events_excluded+test_drill_events_excluded_from_groups: calibrate script ignores drill events in both split and provider-group paths.Agent.md Python test count 1191 → 1195.
Verification: pytest 1194 passed + 1 skipped (1195 collected), import + CLI green.