Gate stops are recorded: every time a rule, the checkpoint, the fence or the reply hold stops work #235

Merged
bvandeusen merged 9 commits from dev into main 2026-11-27 23:46:05 -05:00
Owner

#8141 "A tool call Grimoire holds, refuses or fences leaves no record".

  • New gate_stops table (migration 0138). The hooks report each stop, and the outcome that follows it: cleared by a read, ran, or misfired.
  • Covers enforce, hold, checkpoint, fence and the end-of-reply hold.
  • Readout: /api/retrieval/gate-stops, the gates block in retrieval_telemetry, and the panel in Settings → Moments.
  • Plugin 2026.11.27.1932.

CI green on dev (run 11112, 1e5f95b).

🤖 Generated with Claude Code

#8141 "A tool call Grimoire holds, refuses or fences leaves no record". - New `gate_stops` table (migration 0138). The hooks report each stop, and the outcome that follows it: cleared by a read, ran, or misfired. - Covers enforce, hold, checkpoint, fence and the end-of-reply hold. - Readout: `/api/retrieval/gate-stops`, the `gates` block in retrieval_telemetry, and the panel in Settings → Moments. - Plugin 2026.11.27.1932. CI green on dev (run 11112, 1e5f95b). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 9 commits 2026-11-27 23:46:01 -05:00
The after phase answers `left`, the asked lines still unjudged; the Stop hook
carries them as `earlier=` into the next checks, each up to two more asks, and
the note names them apart from the last turn's writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(8140): family triggers open only records that can carry an idea, and enter_project names a project's unevaluated candidates
CI & Build / Python lint (push) Successful in 7s
CI & Build / TypeScript typecheck (push) Successful in 43s
CI & Build / Plugin hooks (push) Successful in 49s
CI & Build / Python tests (push) Failing after 2m12s
CI & Build / integration (push) Successful in 2m41s
CI & Build / Build & push image (push) Skipped
de55b73075
Tasks, non-knowledge kinds and records titled for their own project are never
opened as candidates by the citation or repeat trigger; a lineage word inside
a quoted title no longer reads as lineage. The family line counts and names
this project's own candidates that only the system has decided on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(8139): the carried lines go to the after phase without a trailing newline
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 2m3s
CI & Build / integration (push) Successful in 2m8s
CI & Build / Build & push image (push) Successful in 26s
2903b090a1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(fence): the cross-project permission prompt says what changes and where first, in plain words
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Plugin hooks (push) Successful in 15s
CI & Build / Python tests (push) Successful in 2m2s
CI & Build / integration (push) Successful in 2m40s
CI & Build / Build & push image (push) Successful in 25s
706f49a12a
The first line names the act and the project it lands in against the one the
session works in; the second says when to approve; the agent's issue-filing
call moves to a last line in parentheses. Tool names are spelled out and
project ids dropped from the operator's text.

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>
chore(plugin): mint the version for the gate-stop hooks
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Plugin hooks (push) Successful in 15s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Failing after 1m50s
CI & Build / integration (push) Successful in 2m17s
CI & Build / Build & push image (push) Skipped
4ed9cd7d41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(8141): the gate-stops readout is one of the retrieval endpoints
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 15s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 2m14s
CI & Build / integration (push) Successful in 2m18s
CI & Build / Build & push image (push) Successful in 44s
9b781d57de
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
82ffd9a235
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>
test(8141): the rewrite test counts reply requests, not the gate report beside them
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 34s
CI & Build / Python tests (push) Successful in 2m13s
CI & Build / integration (push) Successful in 2m29s
CI & Build / Build & push image (push) Successful in 32s
1e5f95bce2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bvandeusen merged commit d54a6a9492 into main 2026-11-27 23:46:05 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledGrimoire#235