- test_moment_delivery: the route/hook name check runs the hook with the
rule, opened and shape ledgers filled and checks every key it sends is read
by the route; "leaves Grimoire's own tools alone" runs it with a listed
Grimoire tool and sees no ask.
- test_gate_stop_hooks: the action hook run twice on one checkpoint rule
holds once, and books the rule on the session ledger after the stop. This
replaces two line-window checks in test_pre_act_checkpoint.
- The write hook never stopping a write: the two string guards (one per test
file) are one, which now also forbids the shared deny helper, the call the
old permissionDecision check could not see.
- route_query_args (tests/helpers.py) reads the query keys a route takes from
its AST, shared by both route/hook contract tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The end-of-turn reply hold was the one gate the gate_stops table left out.
The server applies the per-session cap before anything holds and the Stop
hook blocks on every reason it is given, so the hook reports each held rule
after blocking, as the tool-call gates do: gate `reply`, tool `reply`, and
where the rule was reached (`rule_at`, new beside `rule_ids` in the
/reply-rules answer: the moment it is mounted on, or `reply_rule` for the
backstop). A section hold names no rule and stays counted by report_check.
Opening the rule clears the stop, and rule_misfired marks it, unchanged.
The readout, the telemetry docstring and the Settings panel name the new gate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rule set to enforce or hold, the act checkpoint and the project fence
stopped work and left no record. The hook that makes each stop now reports
it to POST /api/plugin/gate-stop; the hook decides, not the server, because
the per-rule and per-session caps are kept in the plugin.
- gate_stops table (migration 0138): gate, outcome (stopped / let_through /
asked), rule, where it was reached, tool, target project, call id.
- An open of the rule stamps the stop as cleared (rule-opened). A fenced
call that then runs stamps ran: grimoire_fence_ran.sh, a PostToolUse on
the fenced tools, matches the call id the fence left pending. That is
the operator's yes.
- A hold or checkpoint the spent session budget lets through is reported
as let_through; the per-rule once is not.
- The readout: by gate and by rule, stops, cleared by a read, misfired
(rule_misfired after it), let through by the cap, ran. In
retrieval_telemetry as `gates`, at /api/retrieval/gate-stops, and on the
Moments settings page ("When a rule stopped the work").
- act_decision carries `at`, the moment the deciding rule was reached at.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>