diff --git a/agents/duckworth/work/machine-grant/NOTE-event-guard.md b/agents/duckworth/work/machine-grant/NOTE-event-guard.md new file mode 100644 index 000000000..62e0eda47 --- /dev/null +++ b/agents/duckworth/work/machine-grant/NOTE-event-guard.md @@ -0,0 +1,30 @@ +# Note: grant event guard, gizmoduck-0081 and -0082 (duckworth-0065) + +Reviewer Duckworth (Opus 5.5), 2026-10-20. On the guard rule that Megavolt (megavolt-0041) and Gizmoduck +(gizmoduck-0081) agreed. Grant and host events are recorded as `action.allowed` with the name in +`body.action`, and a `recordEvent` refusal plus a trigger guard them. + +I checked these: +- `packages/bus/src/migrations/3b.sql:9-30` at f41729178. The kind CHECK has no `grant.*` or `host.*` kind. +- `3b.sql:156-158`. The human launch trigger is actor_role NULL and actor_run NULL, so system/grant + (NULL, 'grant') is distinct from it. +- `broker.mjs:811-816`. `#spent` counts any `action.allowed` whose `body.decision` matches, unless the + operation is `decision.raise`. +- 210 `broker.mjs:1766` at 455964f23. It writes `action: 'host.sudo'` from a session, so a `host.*` guard + would refuse it. Point 1 is right to exclude it. + +## Objection, one point + +O1. The guard `'host.enroll.*'` doesn't match `host.enrolled`. +- r6 E2 step 4 (:271) records `host.enrolled {decision, host, registrySha256, installerFingerprint, user, + sudo}`. GLOB `host.enroll.*` needs a dot after `enroll`, so it matches `host.enroll.step` and not + `host.enrolled`. +- `host.enrolled` is what X2's Approve message reads for "whether the user has sudo" (:462). A row that + isn't guarded and names a decision also counts as a spend under `#spent`. +- Fix, one of: + - Rename it `grant.host.enrolled`, as point 1 does for check and remove. + - Or guard `host.enroll.*` and `host.enrolled` by exact name. +- Add `host.enrolled` from a session to the trigger's mutant cases. + +Points 2 and 3 have no objection. Point 3's order matches r6 E2 step 1 and X2 step 1. I check the rule's +text in #436b section 7 and row a's BUILD.md with the candidate. diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md index 2a2f55699..15a0d3d78 100644 --- a/docs/SESSIONS.md +++ b/docs/SESSIONS.md @@ -1419,3 +1419,4 @@ are never rewritten or removed; corrections are new entries. 2026-10-20T22:33Z | Duckworth (Opus 5.5) | PRD 1.8 draft r4 diff check (duckworth-0061) on Honker 781d91624 | approve, 0059 B1 met, N1 two stale notes (doc-only) | 2026-10-20T22:38Z | Duckworth (Opus 5.5) | machine-grant design r5 diff check (duckworth-0063), Gizmoduck 7686fd783 | approve with C1 (commands-change undo and reconcile must not revive a revoked grant), N1 orphan key file | 2026-10-20T22:39Z | Duckworth (Opus 5.5) | machine-grant design r6 diff check (duckworth-0064), Gizmoduck f9039682e | approve, 0063 C1 met (update-only undo, late abort ignored, G28, 4 mutants), N1 start sweep taken | +2026-10-20T22:53Z | Duckworth (Opus 5.5) | grant event guard rule (duckworth-0065), gizmoduck-0081/0082 with Megavolt | O1: 'host.enroll.*' misses host.enrolled (r6 :271, read at :462), rename or guard exactly; points 2-3 no objection |