Files
ECC/scripts/lib
CarbonPyramid 03b1a80838 feat(hooks): context-gate conflict management + inferred-window softening
Conflict management (the gate previously had none):
- New scripts/lib/context-gate-state.js — single source of truth for gate
  thresholds plus isGateEnabled/isGateActive; context-gate.js now imports
  from it (public exports unchanged).
- suggest-compact defers to the gate: both the context-size and tool-count
  /compact suggestions stay silent at/above the gate threshold. The gate
  orders checkpoint-and-restart there; suggesting the lossy /compact path
  in the same band was a contradictory instruction. The transcript-reading
  gate check on the count path only runs when a count message would fire.
- ecc-context-monitor defers to the gate: the context warnings (including
  the critical 'ask the user / do NOT write handoff files' text, which
  directly contradicted the gate's checkpoint order) are suppressed inside
  the gate band; cost/scope/loop warnings unaffected.
- Header + hooks/README.md now state the real auto-compact interaction:
  with auto-compact ON, compaction (~83.5% used per ecc-statusline's
  16.5% buffer) precedes the 90% gate, so autoCompactEnabled:false (or a
  raised window) is required for the gate to be reachable — the previous
  'safe with auto-compact left on' claim was wrong.

Inferred-window softening (review feedback):
- When the window size is inferred (unrecognized model), the gate fires as
  a strong recommendation instead of an order and flags the inference plus
  the ECC_CONTEXT_WINDOW_TOKENS override, so a possibly-wrong 200k
  denominator never forces a restart on a larger-window model. Known
  models keep the mandatory wording.

Tests: inferred-softening case; gate-deference pairs for both advisory
hooks; ecc-context-monitor test summary switched to the parseable
'Passed:/Failed:' tokens run-all.js requires.
2026-09-13 16:13:27 -05:00
..