feat(8141): a rule holding the finished reply is recorded as a gate stop too
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 34s
CI & Build / Python tests (push) Failing after 1m49s
CI & Build / integration (push) Successful in 2m4s
CI & Build / Build & push image (push) Skipped

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>
This commit is contained in:
2026-11-27 14:32:46 -05:00
co-authored by Claude Opus 5.5
parent 9b781d57de
commit 82ffd9a235
11 changed files with 85 additions and 18 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "grimoire",
"description": "Grimoire for Claude Code: connects the grimoire MCP server, adds the hooks that deliver live project state and relevant records at the right moment, ships the shared client-neutral Grimoire skills (using-grimoire, writing-plans, reporting-back, systematic-debugging, verification, brainstorming, reusing-code, shape-accounting, family-canon), and syncs your saved Grimoire Processes as skills (/grimoire:sync).",
"version": "2026.11.27.1912",
"version": "2026.11.27.1932",
"author": {
"name": "Bryan Van Deusen"
},
+1 -1
View File
@@ -42,7 +42,7 @@ another one means adding files, not moving or rewriting any.
| `hooks/grimoire_project_fence.sh` | PreToolUse on editor writes, shell commands and Grimoire's tools: `GET /api/plugin/write-scope` for an act aimed at another project, answered `ask` with the reason, and each ask reported to `POST /api/plugin/gate-stop` with the tool call's id; PostToolUse on `enter_project` remembers the project a session without one entered. |
| `hooks/grimoire_fence_ran.sh` | PostToolUse on the tools the fence checks: when the call that ran is the one the fence asked about, `POST /api/plugin/gate-ran`, the operator's yes. Exits at once when no ask is pending. |
| `hooks/grimoire_moment.sh` | PreToolUse on every tool: the rules mounted on the moments the call reaches, `POST /api/plugin/moment`; skips tools `GET /api/plugin/moment-tools` says reach nothing mounted, and Grimoire's own (their responses carry `moment_rules`). Denies the call when the response's `decision` is `enforce` (every time) or `hold` (once per rule and session), and reports each stop, and each hold the session's budget let through, to `POST /api/plugin/gate-stop`. |
| `hooks/grimoire_reply_check.sh` | Stop: sends the finished reply to `POST /api/plugin/reply-rules` — the rules mounted on the reply moments, and the reply against every rule's trigger, and — when the turn closed a task — the completion-section check; holds once per rule, with the reason the server returns, and never holds the rewrite. |
| `hooks/grimoire_reply_check.sh` | Stop: sends the finished reply to `POST /api/plugin/reply-rules` — the rules mounted on the reply moments, and the reply against every rule's trigger, and — when the turn closed a task — the completion-section check; holds once per rule, with the reason the server returns, and never holds the rewrite; reports each rule that held to `POST /api/plugin/gate-stop`. |
| `hooks/grimoire_shape_check.sh` | Stop: sends the definitions the turn wrote (the write hooks' `<sid>.written.ids` ledger) to `GET /api/plugin/shape-check` and keeps the `note` it returns for the next prompt, which `grimoire_autoinject.sh` carries as `carry`, so the agent judges what it built. Never blocks. |
| `hooks/grimoire_record_opened.sh` | PostToolUse on `get_rule`: notes the rule as read in the session ledger and `POST /api/plugin/rule-opened`. |
| `hooks/grimoire_record_outcome.sh` | PostToolUse on `rule_outcome`: notes the rule as acted on, locally, for the session-scoped readout. |
+11
View File
@@ -126,4 +126,15 @@ done
grimoire_json_list "$answer_flat" '.rule_ids' | grimoire_rules_append "$rulefile"
printf '{"decision":"block","reason":"%s"}\n' "$(printf '%s' "$reason" | grimoire_json_escape)"
# Each rule that held the reply, reported as a gate stop with where it was
# reached, as the tool-call gates report theirs. The server already applied
# the per-session cap, so a reason here is a hold. A section hold names no
# rule and is counted by its own check (`report_check`).
i=0
for id in $(grimoire_json_list "$answer_flat" '.rule_ids'); do
grimoire_gate_report "$session_id" reply stopped reply "$id" \
"$(grimoire_json_pick "$answer_flat" ".rule_at[$i]")" "" ""
i=$((i + 1))
done
exit 0