Bug: checkCoverage flagged anomaly when "recent commits > 0 AND episodes == 0".
Two design flaws, proven in this project:
- Wrong unit: commits = work-unit (one turn → many commits via subagent
workflow); episodes = turn-unit. A 1023-vs-19 ratio is not anomalous, it's
expected.
- Wrong window: the 14-day commit window predated the Stop-hook's existence
(registered 2026-05-19). For 13 of 14 days the hook didn't exist — 889
commits were structurally impossible to mirror as episodes.
Result: the C5 indicator was either always-red (flagging the hook's birth
as anomaly) or always-green (any episode count vs huge commit count = ok).
Either way uninformative.
Fix:
- checkCoverage(episodeCount, hookRegistered) — drops the commit param.
Warn iff hook is registered AND 0 episodes this month → the hook is
silently failing. If the hook isn't registered, 0 episodes is correct.
- runCoverageChecker derives hookRegistered from settings.json
(isObserverStopRegistered helper) and passes it to checkCoverage.
No more git execFileSync — pure fs.
Tests rewritten under the new contract: 7/7 (was 6, +1 drift-hazard guard
ensuring detail strings never mention "commit"). 15/15 coverage tests green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>