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
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:
@@ -32,6 +32,29 @@ from typing import Any
|
||||
ENFORCEMENT_RANK = {"enforce": 0, "hold": 1, "inform": 2}
|
||||
SALIENCE_RANK = {"high": 0, "normal": 1, "low": 2}
|
||||
|
||||
|
||||
def force(rule: Any) -> str:
|
||||
"""What this rule does when it arrives: `enforce`, `hold` or `inform`.
|
||||
|
||||
A preference is always `inform`, whatever the field says: it records how
|
||||
work is liked, and claims no force that could stop it.
|
||||
"""
|
||||
if getattr(rule, "kind", None) == "preference":
|
||||
return "inform"
|
||||
value = getattr(rule, "enforcement", None)
|
||||
return value if value in ENFORCEMENT_RANK else "inform"
|
||||
|
||||
|
||||
def holds(rule: Any) -> bool:
|
||||
"""Whether this rule may make a reply or an act wait for one read.
|
||||
|
||||
Only a rule declared `hold` or `enforce` may. Every other rule is a line
|
||||
beside the work: holding the work on a rule nobody declared as one that
|
||||
holds made each reply after a write cost a rewrite, for rules that asked
|
||||
only to be read.
|
||||
"""
|
||||
return force(rule) in ("enforce", "hold")
|
||||
|
||||
# How narrowly a rule was reached, larger is narrower.
|
||||
BY_RESEMBLANCE = 0
|
||||
BY_MOUNT = 1
|
||||
|
||||
Reference in New Issue
Block a user