Round 5 review (haelyra): enforcement must be opt-in and the enabled
checkpoint must preserve ownership.
- Add ECC_CONTEXT_GATE_MODE (advisory default | enforce | off) in
context-gate-state.js; isGateEnabled is true only in enforce mode, so a
default install is inert and adds no advisory suppression (suggest-compact
and ecc-context-monitor keep their normal behavior). A mistyped mode falls
back to advisory with a one-time stderr note.
- context-gate.js returns '' before any transcript work unless enforce is
set (no per-prompt checkpoint cost by default).
- In enforce mode the order now targets a collision-safe, identity-bearing
path under the session-handoff dir
(getSessionsDir()/resume/<project>-<sessionId>.md) instead of a fixed
project-root RESUME.md: never collides with an operator file, repeated
fires in one session are idempotent, the resume command is the receipt,
and the order states that observed usage is not itself permission to stop.
- Tests: default-inert, mode resolution, handoff-path/preserve/idempotent,
explicit disable; advisory-hook suppression tests set enforce and add a
default-does-not-suppress case. Bounded reader + threshold tests retained.
- Docs: hooks/README.md, README.md, hooks.metadata.json, header comment.
Full suite 4762/4762 (serial). validate-hooks: 25 matchers.