Repository navigation
feat(skills): gate Ready on agent review and owner approval, and group reviewers in PEW - #1153
Conversation
fd7e0ce to
e5b1c03
Compare
e5b1c03 to
8e856b0
Compare
sbalabanov
left a comment
There was a problem hiding this comment.
[skill-1-reviewer-4] round 1/5: changes needed.
Reviewed 8e856b0 (full diff vs origin/main, focusing on the Review before Ready gate). ./tool/bazel test //.agents/skills/orchestrate-sdlc/... passes all 3 targets (--nocache_test_results). A read-only live render is correct: reviewers are grouped, merged PRs show no CI, and #1153 shows 🧐 agent review 1/5 on both the implementer and reviewer rows with no stale 🙋. The ledger was unchanged.
The watch readiness fence, the merge gate and outreach all require the gate (owner_approved at the current head, or ready), so I found no code path to Ready without an approval record. Four must-fix findings are inline. Three concern how that approval record can be produced. A comment edited by a third party counts. A prompt approval does not name a SHA. The reviewer's satisfaction is inferred from thread state that the implementer controls. The fourth: PEW's head comparison accepts prefixes, including a 1-char head.
Nit not tied to a changed line: workflow.md:39 still lists "readiness" among standing user authorizations ("Standing authorization can cover subsequent updates"), and :97 allows campaign-level autonomous-action authorizations. State that no standing or campaign authorization bypasses Review before Ready, so the two rules cannot be read against each other.
8e856b0 to
5d25b96
Compare
sbalabanov
left a comment
There was a problem hiding this comment.
[skill-1-reviewer-4] round 2/5: changes needed.
Reviewed 5d25b96 (single commit vs origin/main; delta from 8e856b0 checked line by line). All 7 round-1 threads are correctly fixed and stay resolved:
- edited approval comments are excluded (
lastEditedAtnull), with ID/URL/createdAt inref; - a prompt approval binds to a named or last-shown head, must equal the current head, and counts only from the user's own message;
review_verdictdrives the gate, thread state never does, and an unverified cap round escalates;- heads are full 40-char lowercase hex compared with
==; - plus the ready-on-Draft footnote, the ⛔ wording, top-level comments only, "never on GitHub", and authorizations never bypassing the gate.
./tool/bazel test //.agents/skills/orchestrate-sdlc/... passes all 3 targets (--nocache_test_results).
Two new must-fix findings are inline. (1) The verdict rule now contradicts step 4's "unless trivial" re-review exception. (2) The live read-only render fails outright, because the reviewer's GitHub review, now its normal deliverable, has no documented ledger home and was stored as a URL artifact that render_agent_row rejects. With that artifact removed from a copy of the ledger, the render is correct: grouped rows, 🧐 agent review 2/5 on #1153 for both rows, merged #1138 without CI, no stale 🙋. The ledger itself was not modified.
5d25b96 to
9dd3ec4
Compare
sbalabanov
left a comment
There was a problem hiding this comment.
[skill-1-reviewer-4] round 3/5: changes needed.
Reviewed 9dd3ec4 (delta from 5d25b96 checked line by line). All 3 round-2 threads are correctly fixed and stay resolved:
- the trivial-change exception is gone, and every owner-requested push gets a non-counting verdict pass before returning to
owner_review, so steps 2 and 4 now agree; - GitHub reviews live in
review_verdict.refandreview_history, neverartifacts, and PEW links the latest review on the reviewer row; - a round is one reviewer pass over one head, ending in its verdict.
./tool/bazel test //.agents/skills/orchestrate-sdlc/... passes all 3 targets (--nocache_test_results). The live read-only render at this head works again and is correct: reviewer grouped under its implementer, 🧐 agent review 3/5 on #1153 for both rows, the round-2 review linked on the reviewer row, merged #1138 without CI, no stale 🙋. The ledger was unchanged.
One must-fix is inline: the documented shape of owner_approval.ref (comment ID, URL, createdAt) does not match the validator's string-only check, so recording a comment approval that way crashes PEW at the owner gate. It is a one-line doc or validator alignment. Two small nits are also inline.
9dd3ec4 to
fb6cd87
Compare
sbalabanov
left a comment
There was a problem hiding this comment.
[skill-1-reviewer-4] round 4/5: satisfied.
Reviewed fb6cd87 (delta from 9dd3ec4 checked line by line). No must-fix findings.
- Round-3 threads, all correctly fixed:
owner_approval.refis a string (the comment URL or the quoted prompt), andcomment_created_atis its own field. Null counts as absent everywhere, includingref. A null reviewrefrenders no link, and multi-PR reviewer links read#N review. - Docs-to-validator tie, verified by mutation: I edited a copy of the watch.md JSON example and ran
pew_test. An object-shapedref, a 7-char approval head, an unknown gate, and string reply IDs each fail the test; the unmodified example passes. Renaming the heading or dropping the block also fails, becausedocumented_ledgerraises. The data dependency resolves from runfiles under Bazel. The tie covers every field the renderer reads; see the one inline nit for keys it does not read. - Gate safety, re-checked end to end: approval binds to a full 40-char head compared with
==, comes from an unedited top-level owner comment or your own prompt, and recorded agent comment IDs never count. Any push before Ready voids it. Ready, the merge gate, and outreach all require the gate. A round is one verdict on one head, and the gate moves only onsatisfiedfor the current head. Owner-requested pushes get non-counting verdict passes. At the cap the PR escalates. - No internal system names in the diff.
./tool/bazel test //.agents/skills/orchestrate-sdlc/... passes all 3 targets (--nocache_test_results). The live read-only render at this head, on the migrated ledger (outreach, list-shaped reply_ids), validates and is correct: reviewer grouped under its implementer, 🧐 agent review 4/5 on #1153 for both rows, the round-3 review linked on the reviewer row, merged #1138 without CI, no stale 🙋. The ledger was unchanged.
fb6cd87 to
466515b
Compare
466515b to
5080da9
Compare
sbalabanov
left a comment
There was a problem hiding this comment.
[skill-1-reviewer-4] owner-request pass (not counted): satisfied.
Reviewed 5080da9 against fb6cd87. No must-fix findings.
- Pair rows (Option A):
render_group_rowgives one row per implementer plus its bound reviewers. The agent cell reads🔨 impl (model) · 🧐 rev (model) ISSUE.- Links merge with exact-string dedup, and PR numbers are deduplicated in order, so the state cell appears once.
- Activity is
impl next · last time · 🧐 rev last time. Working reviewers lead with🧐 next · last time, then🔨and the implementer's activity, then idle reviewers. - 🙋 stays on each member's own segment. The owner-gate 🙋 goes only to the PR record's
owner, so a reviewer never inherits it. - Unbound reviewers, archived-bound reviewers and lone agents render exactly as before, and the pair ranks by its newest member.
- The table-driven tests cover idle vs working reviewers, several reviewers, link dedup, a null review ref, 🙋 placement, owner-gate marking, unbound/archived-bound reviewers, ranking and name ties.
- SKILL.md matches the code, including the one documented drop: an idle bound reviewer's
next_step. - watch.md: the narrowed sentence (keys the renderer reads; bookkeeping keys documented but unchecked) is accurate. I re-ran the mutation check on a copy: an object-shaped
ref, an emptyreviewsand an unknown verdict in the example each failpew_test, and the unmodified example passes.
./tool/bazel test //.agents/skills/orchestrate-sdlc/... passes all 3 targets (--nocache_test_results). The live read-only render at this head shows one 🔨 skill-1-implementer-2 · 🧐 skill-1-reviewer-4 ⚙️ SKILL-1 row with merged links, #1138 🟣 Merged; #1153 🟡 Draft · ⚪ skipped · 🧐 agent review 4/5, and the working reviewer's segment leading. Merged #1138 shows no CI and there is no stale 🙋. The ledger was unchanged. Two small nits are inline.
5080da9 to
50b50f6
Compare
sbalabanov
left a comment
There was a problem hiding this comment.
[skill-1-reviewer-4] owner-request pass (not counted): satisfied.
Reviewed 50b50f6 against 5080da9. No must-fix findings.
- Link shapes, one code path:
- PRs render as
<url>using GitHub's URL verbatim, or a plain#Nwhen the fetch failed. - Artifacts render as
kind <file:///…>.Path.as_uripercent-encodes spaces, angle brackets,%and|, and the tests cover spaces and angle brackets. - Reviews render as
review <https://…#pullrequestreview-N>. The PR number stays readable in the URL, so dropping the#N reviewlabel resolves my earlier nit. test_links_are_bare_autolinksasserts that no](appears.
- PRs render as
- Escaping rule:
validate_head_recordrejects an httpsrefcontaining whitespace or</>forreview_verdict, everyreview_historyentry andowner_approval, and the documented-fields table covers accepted (%20) and rejected (space,<1>) values. Non-https refs (a quoted prompt) are unaffected and render no link. - The investigator-bound and unknown-bound reviewer cases are back, each expecting its own row.
- SKILL.md (bare autolinks, percent-encoding, the rejected characters) and watch.md (
review_verdict.refconstraint) match the code.
./tool/bazel test //.agents/skills/orchestrate-sdlc/... passes all 3 targets (--nocache_test_results). The live read-only render at this head exits 0, and I checked its output mechanically: 17 <…> spans, every one a valid CommonMark absolute-URI autolink (a scheme of 2 to 32 characters, then no whitespace, controls or <>), no stray </> outside them, and no ](. Rows are correct: the implementer-reviewer pair row with merged links, merged #1138 without CI, and no stale 🙋. The ledger was unchanged. One hardening nit is inline.
50b50f6 to
0a678e8
Compare
sbalabanov
left a comment
There was a problem hiding this comment.
[skill-1-reviewer-4] owner-request pass (not counted): satisfied.
Reviewed 0a678e8 against 50b50f6. No must-fix findings and no nits.
- No fragments: review URLs are no longer rendered. GitHub PR URLs have no fragment, and
Path.as_uripercent-encodes#in artifact paths (new test:/a/v#2.mdbecomes<file:///a/v%232.md>).test_links_are_bare_autolinks_without_fragmentsasserts that no<…>contains#, and the documented-example test asserts thatpullrequestreviewnever appears. - Option A reverted:
render_agent_rowrenders one row per agent again, inagent_display_groupsorder. A bound reviewer sits directly below its implementer and the pair ranks by its newest member. A bound reviewer's links cell drops PR links and shows only its own artifacts, or is empty. Its state and activity cells are unchanged, and it does not inherit the implementer's owner-gate 🙋. Unbound reviewers and reviewers of archived, investigator or unknown agents keep standalone rows with their PR links. SKILL.md matches this, and the hidden-next_stepexception is gone. - Artifacts render as the bare
<file:///…>with no kind prefix, and paths are unchanged. There is no width logic and there are no per-PR rows. - Dropping the ref autolink check is sound: no rendering path reads any
refany more.review_verdict.ref,review_history[].ref,owner_approval.ref(including a quoted-prompt ref) andoutreach[].refappear inpew.pyonly in their string-or-null type checks. The watch.md text no longer claims the constraint. - The watch.md example still ties the docs to the validator. On a copy, an object-shaped approval
refor an unknown gate in the example failspew_test, and the unmodified example passes.
./tool/bazel test //.agents/skills/orchestrate-sdlc/... passes all 3 targets (--nocache_test_results). The live read-only render at this head exits 0, and I checked it mechanically: 16 <…> spans, all valid CommonMark absolute-URI autolinks, none containing #, no stray </>, no ](, and 4 cells in every row. skill-1-reviewer-4's row sits directly below skill-1-implementer-2 with an empty links cell. Merged #1138 shows no CI and there is no stale 🙋. The ledger was unchanged.
7bb32de to
2b298da
Compare
…p reviewers in PEW A PR now leaves Draft only after its bound reviewer is satisfied within a configurable round cap (default 5, escalating to the user at the cap), the implementer records passing local validation, and the owner approves the exact head on the PR or in the prompt. Ready triggers CI and outreach; later feedback and CI failures need no further owner approval. PEW shows the gate state and round count, puts 🙋 on the implementer whenever the gate waits for the owner, and flags Ready without recorded approval. PEW also places each bound reviewer's row directly below its implementer and ranks the pair by its newest member, prints every link as a bare fragment-free autolink, shows a merged PR without CI, and uses 🔨 for implementers. Each author_action carries author_action_at, and PEW flags the 🙋 for re-evaluation when that time is missing or one of the agent's PRs merged or closed after it. The ledger schema is a single example in watch.md that the renderer's validator and tests both enforce. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2b298da to
b9a3b8d
Compare
A PR now leaves Draft only after its bound reviewer agent is satisfied and the owner approves the exact head. PEW shows where each PR stands in that gate, groups each reviewer under its implementer, and prints links as plain autolinks. The campaign ledger's schema is a single example in
watch.mdthat the renderer validates and that its tests check.Changes
Review before Ready (
references/workflow.md,SKILL.md,references/watch.md)gate:agent_review→owner_review→owner_approved→ready, orescalated.review_verdict(satisfiedorchanges_needed).COMMENTreview. Each comment is prefixed with the agent's name, because agents post under the owner's account.parameters.agent_review_rounds(default 5). If the last allowed round ends inchanges_needed, the PR escalates to the user.owner-approved <sha>, or an approval in the user's own prompt message.local_validationmust pass on the head before the owner gate. Marking a PR Ready and then returning it to Draft is forbidden.owner_approvedon the current head. After Ready, feedback and CI failures need no further owner approval.PEW (
scripts/pew.py)Agent / issue-work,PR / state / artifacts,Next step / last action. Each PR's state follows its link, as in<…/pull/N> 🟢 Ready · 🟢 pass, then come the artifacts, separated by;.🧐 agent review N/M,⛔,🙋 owner review,🙋 re-approval, or✅ owner approved.🧐 N passes, M comments, taken fromreview_historyand omitted when there is none.<https://github.com/OWNER/REPO/pull/N>and<file:///abs/path>. File paths are percent-encoded.author_actionsrender as🙋 campaign:footnotes. Anauthor_actiongets a re-evaluate note whenauthor_action_atis missing, or when one of the agent's PRs merged or closed after it.Ledger schema (
references/watch.md,scripts/pew.py)validate_ledgeraccepts exactly those shapes (includingreview_historyentries'reviewerandcomments), treating null the same as absent. Every recorded head must be a full 40-character SHA.pew-testreads the example fromwatch.mdand checks that it validates and renders. A table-driven test checks accepted and rejected values for every documented field.Test Plan
./tool/bazel test //.agents/skills/orchestrate-sdlc/... //.claude/skills/orchestrate-sdlc/...(the second path is the same skill loaded through the.claude/skillssymlink), andmake buildghauthenticated):./tool/bazel run //.agents/skills/orchestrate-sdlc/scripts:pew -- --state <checkout>/.sdlc/campaign.jsonmake lint,make check-gazelleandmake check-tidyon a staged tree.🤖 Generated with Claude Code