fix(7733): a rule with triggers holds or refuses only the acts they match
CI & Build / TypeScript typecheck (push) Successful in 35s
CI & Build / Plugin hooks (push) Failing after 19s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 2m31s
CI & Build / integration (push) Successful in 2m18s
CI & Build / Build & push image (push) Canceled after 27s

Rules 2, 4, 10 and 153 are set to hold and mounted on work.deliver. A
push to dev therefore stopped four times in a row, once for each of them,
although none of them governs a push to dev: their triggers (git push
origin main, git tag, pytest, pull_request_write) name the acts they do
govern.

A rule that has triggers now stops an act only when one of them matched it.
Reached by its moment alone, it is a line beside the work. A rule with no
triggers still holds wherever it is mounted, because the mount is all that
says where it applies. A mounted rule whose unscoped trigger also matched
now counts as reached by the trigger, so it ranks as triggered and may
stop the act.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 15:53:36 -05:00
co-authored by Claude Opus 5.5
parent e0621713d4
commit 738bd24d6e
4 changed files with 48 additions and 4 deletions
+6
View File
@@ -247,11 +247,15 @@ class Board:
condition this act did not meet: not delivered. `matched` — conditional
mounts this act met: delivered as triggered. `fired` — rules an unscoped
trigger delivers on this act, each with the trigger that fired.
`triggered` — every in-scope rule that has a trigger at all, whether or
not this act met it: such a rule names the acts it governs, so a mount
alone shows it beside the work and only its trigger can stop an act.
"""
gated: set[tuple[int, str]] = field(default_factory=set)
matched: set[tuple[int, str]] = field(default_factory=set)
fired: list[tuple[object, Trigger]] = field(default_factory=list)
triggered: set[int] = field(default_factory=set)
async def board(
@@ -261,6 +265,8 @@ async def board(
"""Check every in-scope trigger against this act (or this text)."""
out = Board()
for rule, triggers in await _in_scope(user_id, project_id):
if triggers:
out.triggered.add(rule.id)
first_unscoped = None
for trig in triggers:
hit = matches(trig, tool, tool_input, text)