Rules carry enforcement (inform/hold/enforce) and salience (migration 0128).
One delivery order for every rule arm (services/rule_order.py).
rule_deliveries records each line shown to a plugin session and whether it was opened (migration 0129); pruned daily after 180 days.
Typed triggers on a rule — tool, path glob, command head, keyword — checked exactly; unscoped or making a mount conditional (migration 0130, backup v29, rule editor).
Lifecycle: one full line, one reminder, then silence per session; hold and opened rules exempt.
Plugin 2026.11.22.2312: hooks send session_id; the opened hook reports every open.
Step 2 of milestone 639 (#7728).
- Rules carry `enforcement` (inform/hold/enforce) and `salience` (migration 0128).
- One delivery order for every rule arm (`services/rule_order.py`).
- `rule_deliveries` records each line shown to a plugin session and whether it was opened (migration 0129); pruned daily after 180 days.
- Typed triggers on a rule — tool, path glob, command head, keyword — checked exactly; unscoped or making a mount conditional (migration 0130, backup v29, rule editor).
- Lifecycle: one full line, one reminder, then silence per session; hold and opened rules exempt.
- Plugin 2026.11.22.2312: hooks send `session_id`; the opened hook reports every open.
CI green on dev at 97d7992 (run 10750).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
A rule now carries what it does when it arrives, declared by its author
rather than guessed from a score: enforce (the act is checked), hold (the
reply or act waits for one read) or inform (a line beside the work, the
default). And a salience, high, normal or low, for ranking among rules of
the same enforcement at a crowded moment. A preference is always inform.
Migration 0128 adds both with CHECKs. Every door carries them: the
service, the MCP create and update tools, REST, backup and restore, and
the rule editor, which also marks holding and enforced rules in the list.
Unknown values are refused rather than mapped. Nothing reads them yet
beyond the record; the ordering function and the lifecycle come next in
this step, and step 5 decides who holds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every rule arm now ranks what it delivers with one function
(services/rule_order.py): enforcement, then salience, then how narrowly
the rule was reached, then first mention before reminder, then the
rule's own open rate at that moment, then similarity. A crowded moment
drops the same rules whichever arm brought them, and a rule that holds
is never cut for a line beside it.
The open rate comes from a new table, rule_deliveries (migration 0129):
one row per rule line a plugin session is shown, full or repeat, with the
open stamped on the latest delivery it followed. The plugin routes bind
the session per request; the prompt, pre-tool and write-path hooks now
send it, and the opened hook reports every open, with its acts only when
no hook had just named the rule. Rows are pruned daily after 180 days.
Also fixes the TypeScript check: the store's list row now carries the
new enforcement field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hook now names its session for the delivery record, and the plugin
blueprint binds it before every handler. The contract test pins both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Triggers (migration 0130, table rule_triggers): a rule can name the act it
applies to, as a tool, a path glob, a command head or a keyword, checked
exactly against the act rather than by resemblance. With no moment a
trigger delivers its rule on any matching act, even one that reaches no
moment; scoped to a moment, it makes the rule's mount there conditional
on the act matching. A triggered line ranks above a mounted one in the
delivery order and names the trigger that fired. Writable through every
MCP and REST rule door, carried by backup (version 29), and edited in the
rule editor under "Acts that trigger it". The plugin's catch-all hook is
told which tools a trigger can reach.
Lifecycle: a rule's life in a session is one full line, one reminder,
then silence. A repeat whose latest delivery in the session was already a
reminder is left out of both rule arms. A rule that holds stays armed
until it is opened, an opened rule keeps its line, and a full delivery
(after a compaction or once the ledger ages it out) re-arms it. Read from
the delivery records, so it needs no new plugin ledger.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The editor styled its trigger list through `.trigger-list .rule-chip`,
which re-spells the shared chip the guard keeps in one stylesheet; the
row now adds its own `.trigger-chip` for layout. The full-export test now
asserts the v29 rule_triggers section is present.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Step 2 of milestone 639 (#7728).
enforcement(inform/hold/enforce) andsalience(migration 0128).services/rule_order.py).rule_deliveriesrecords each line shown to a plugin session and whether it was opened (migration 0129); pruned daily after 180 days.session_id; the opened hook reports every open.CI green on dev at
97d7992(run 10750).🤖 Generated with Claude Code