feat(7731): enforced rules refuse the act, only hold rules hold, and the shape question rides the next prompt
CI & Build / TypeScript typecheck (push) Successful in 38s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Python tests (push) Failing after 1m45s
CI & Build / integration (push) Successful in 2m10s
CI & Build / Build & push image (push) Skipped

- A rule set to enforce, reached by a mount or a trigger, refuses the tool
  call in its own words every time (`act_decision`, `/moment` returns
  `decision`, grimoire_moment.sh denies). Opening it does not lift it.
- A rule set to hold denies the call once until read, under the act
  checkpoint's per-rule and per-session guard; file writes are never held.
- The reply hold, the reply backstop and the act checkpoint hold only on rules
  declared hold or enforce (`rule_order.holds`). An inform rule is a line
  beside the work.
- The prompt arm leaves rules that arrive at an act (mounted on a non-reply
  moment, or with a tool/path/command trigger) to that act.
- The end-of-turn shape check no longer blocks: its note is kept for the next
  prompt, carried as `carry` into the one fitted payload, and the stop after
  that prompt records whether the lines were judged (noted /
  judged_after_note / left_after_note).
- Rule editor and list copy say what hold and enforce now do. Plugin
  2026.11.23.0005.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 00:22:56 -05:00
co-authored by Claude Opus 5.5
parent 6b4c24e336
commit 7d46ce0229
23 changed files with 644 additions and 170 deletions
+11 -2
View File
@@ -15,7 +15,8 @@ unchanged.
WHAT THIS PINS, AND WHAT IT DELIBERATELY DOES NOT
Pinned: the four conditions under which an act may be held, the two guards
Pinned: the conditions under which an act may be held — among them that the
rule is declared to hold — the two guards
that stop it recurring, and the shape of the envelope. Not pinned: the bar
itself (a tuning value, and a test asserting 0.80 would fail on every retune
while proving nothing) or the wording of the reason (prose, and it will be
@@ -58,7 +59,8 @@ def hit(score: float, rule_id: int, **attrs):
# `attrs` overrides rather than duplicates: passing `when_to_apply=""` for
# the no-trigger case alongside a hard-coded default is a duplicate keyword
# and a TypeError, not a test.
fields = {"id": rule_id, "title": f"rule {rule_id}", "when_to_apply": TRIGGER}
fields = {"id": rule_id, "title": f"rule {rule_id}", "when_to_apply": TRIGGER,
"enforcement": "hold"}
fields.update(attrs)
return (score, fake_rule(**fields))
@@ -97,6 +99,13 @@ def test_a_preference_never_holds_an_act():
assert hold([hit(0.99, 2, kind="preference")]) == {}
def test_a_rule_set_to_inform_never_holds_an_act():
"""Only a rule declared to hold may stop the work; an `inform` rule asked
to be put beside it, however confident the score."""
assert hold([hit(0.99, 2, enforcement="inform")]) == {}
assert hold([hit(0.99, 2, enforcement="enforce")])["rule_id"] == 2
def test_a_rule_the_session_already_opened_never_holds_an_act():
"""`held` is observable — a PostToolUse hook watches for the `get_rule`
call — so this is a recorded event, not a model's self-report