feat(7734): the instruction surfaces teach how strongly a rule arrives, what a held or refused call means, and what a quiet moment means
CI & Build / TypeScript typecheck (push) Successful in 40s
CI & Build / Plugin hooks (push) Successful in 20s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Failing after 2m0s
CI & Build / integration (push) Successful in 2m28s
CI & Build / Build & push image (push) Skipped
CI & Build / TypeScript typecheck (push) Successful in 40s
CI & Build / Plugin hooks (push) Successful in 20s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Failing after 2m0s
CI & Build / integration (push) Successful in 2m28s
CI & Build / Build & push image (push) Skipped
- writing-records.md: a new section on declaring enforcement (inform, hold, enforce), the trigger a hold or refusal needs to name its act, and salience. A rule with an exit is a hold; a rule with triggers stops only the acts they match. - moments.md: a held call is read and made again (unchanged if the rule does not bear on it, with rule_misfired); a refused call is the operator's boundary and moves only when they change the rule; a moment sends a few lines in one order and drops the rest, so a quiet moment is not an empty rulebook. - The static context says a rule can hold or refuse a tool call. - create_rule, create_project_rule and update_rule describe enforce as a refusal every time that needs an act, and trigger-only holds. - The cross-project guard words a rule edit on another project as the operator's curation, naming the rule, and no longer suggests filing an issue in its place. _INSTRUCTIONS is at its 1,600-character cap and is left alone: holds and refusals explain themselves when they fire. The guidance ownership test registers the three new topics. Plugin 2026.11.23.2259. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -188,6 +188,17 @@ READ_PREFIXES = (
|
||||
ISSUE_STATUSES = frozenset({"", "todo"})
|
||||
|
||||
|
||||
# Curating a rule that lives on another project: editing, moving, verifying,
|
||||
# relating or deleting it. A rule is the operator's standing instruction, not
|
||||
# that project's work in progress, so the guard names the rule it changes and
|
||||
# leaves the call to them rather than suggesting an issue in its place.
|
||||
RULE_CURATION_TOOLS = frozenset({
|
||||
"update_rule", "update_preference", "delete_rule", "move_rule",
|
||||
"mark_rule_verified", "relate_rules", "unrelate_rules",
|
||||
})
|
||||
_RULE_ARGS = ("rule_id", "from_rule_id", "to_rule_id")
|
||||
|
||||
|
||||
def is_issue_filing(tool: str, args: dict) -> bool:
|
||||
"""True for create_task(kind="issue") that opens a fresh, unplanned issue."""
|
||||
if tool != "create_task":
|
||||
@@ -330,6 +341,15 @@ async def check_act(
|
||||
if tool and is_issue_filing(tool, args):
|
||||
return {"allowed": True, "targets": targets, "issue": True, "reason": ""}
|
||||
there = ", ".join(_named(p, titles) for p in others)
|
||||
if tool in RULE_CURATION_TOOLS:
|
||||
rules = sorted({r for name in _RULE_ARGS for r in _positive_ints(args.get(name))})
|
||||
which = ", ".join(f"rule {r}" for r in rules) or "a rule"
|
||||
reason = (
|
||||
f"This session belongs to {_named(session_project, titles)}. {tool} changes "
|
||||
f"{which} of {there}, a different project. Rules are the operator's to "
|
||||
f"curate from any session: approve if they asked for this change."
|
||||
)
|
||||
return {"allowed": False, "targets": targets, "issue": False, "reason": reason}
|
||||
what = act.strip() or (f"{tool} changes" if tool else "This changes")
|
||||
first = others[0]
|
||||
reason = (
|
||||
|
||||
Reference in New Issue
Block a user