⨠feat(guard): Guard takes the owner's š on the agent's proposal (#515)
Slice: #515
The shared Guard now takes the owner's š on the agent's proposal, as the work rules do, so one š settles both checks. Alok, 2026-11-20: "Yes, file it", then Decision: #515 as written on #515.
Why. On #512 and #513, Alok's š passed the work rules, but Guard counted only a Decision:, so he wrote one on each as well. The work rules have taken the š since P-20; Guard (P-62) never did, and no record gives a reason.
What changes, in scripts/guard.mjs:
-
approvedAt, for a slice added after its Work item's approval, also counts an owner's š on aProposal:comment on the slice that:- is by an agent the default branch's settings name (
"agent"); - names the slice as the first
#Non its first line; - got the š after the slice joined and after the proposal's last edit.
This is how
thumbsUpinsrc/work.tsreads it, and a test holdsPROPOSALtosrc/work.ts's. - is by an agent the default branch's settings name (
-
The earliest answer across all places, a š included, sets when Guards: counts from.
-
agentsInreads"agent", one login or a list. Settings with none count no š, and a malformed one fails closed. The slice said a missing one fails closed; since onboard always writes it, counting no š instead keeps older settings judged as before, and still grants nothing. -
A proposal GitHub no longer has (404) counts nothing. Any other failure to read reactions fails closed.
-
The refusal now says "nor reacted š to an agent's proposal for it".
The README (Guard and the reaction passage) and docs/decisions.md say so.
Checked:
pnpm checkpasses (output below).- New tests cover:
- a š that passes;
- a š from the agent;
- one before the slice joined;
- one before the proposal's last edit;
- a proposal by someone else;
- one naming another issue first;
- no agents named;
- no š at all;
- the earliest of a š and a
Decision:; - reactions that fail to read;
main's wiring with good, other and malformed agents.
pnpm check: exit 0
pnpm test: tests 2117, pass 2117, fail 0
pnpm test:scripts: tests 115, pass 115, fail 0
guard.mjs | line 100.00 | branch 96.69 | funcs 100.00
After merge: clients get it with the next release. This PR and #514 both append to docs/decisions.md, so the second to merge may need a rebase there.
Guards: scripts/guard.mjs, scripts/guard.test.mjs. scripts/guard.mjs is code-owned by Alok, so this waits for his review.
š¤ Generated with Claude Code
Summary by cubic
Guard now counts the owner's š on an agent's proposal as approval for a slice added after its Work item, so one š settles both Guard and the work rules.
- Reads the settings'
"agent"(one login or a list); none named counts no š, and anything malformed fails closed, as does an agent that is also an owner. - The š counts only on a proposal whose first
#Nis the slice, by a named agent, made after the slice joined and after the proposal's last edit, assrc/work.tsreads it. - Reactions are read only on a proposal that could precede the earliest other answer, so a failed read refuses nothing an earlier
Decision:settled; a deleted proposal counts nothing, other read failures fail closed. - The earliest of a š and a
Decision:sets when Guards: counts from; the refusal offers a š only when the settings name an agent. - Documents the change in the README and
docs/decisions.md;pnpm checkand all tests pass.