feat(ci): review-swarm GHA + hand-recovered from run 45b1974c coredump stall (replaces #74) - #75
feat(ci): review-swarm GHA + hand-recovered from run 45b1974c coredump stall (replaces #74)#75kjgbot wants to merge 3 commits into
Conversation
Recovered from cloud run 45b1974c (drive) after DELIVER_FAIL_SYNC — the sandbox left a coredump at testdata/preflight/core that git apply couldn't handle. Stripped the coredump hunk from the patch, kept the GHA scaffold, then hand-fixed the swarm findings on the prior attempt (#74) before opening. Files: - .github/workflows/review-swarm.yml — trigger on kjgbot/miyaontherelay PR events, launch workflows/review-swarm.yaml in cloud, poll status, hand off to swarm-post.sh - .github/workflows/scripts/swarm-post.sh — sync run, extract per-lens verdicts, post transcripts + one sticky aggregate marker - README.md — one-line doc for the required RELAY_WORKSPACE_KEY secret Addresses swarm findings on #74: - Poll loop now exits on ALL terminal states (failed/errored/cancelled), not just completed — a real failure won't masquerade as a 65-min timeout - Poll deadline is 65m (was 45m) so it always ≥ the swarm's own 60m timeoutMs plus buffer, with a comment pinning the invariant - Aggregate verdict is LAST SWARM_ token (not substring anywhere) — same pattern commit f59d9cd fixed elsewhere - Lens verdicts sort by FILENAME (YYYYMMDD-HHMM prefix), not mtime — same pattern commit b2535aa fixed elsewhere - Verdict is last non-empty line's token, not whole-file grep — a passing review that quotes REVIEW_FAILED won't misclassify - Missing/unclear lens degrades aggregate to FAILED - Marker uses hidden HTML comment and edits in place across re-runs — a PR with N pushes gets 1 marker, not N
|
Warning Review limit reachedNext included review available in 22 minutes. View limit detailsLimit details: You’ve used the included review currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe pull-request workflow now launches and monitors an Agent Relay Cloud review swarm for approved authors. A reporting script synchronizes results, posts transcripts, and maintains a sticky status comment. The README documents the required workspace secret. ChangesReview swarm automation
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This change adds the review-swarm workflow, result posting script, and required-secret documentation; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant PullRequest
participant GitHubActions
participant AgentRelayCloud
participant SwarmPost
PullRequest->>GitHubActions: eligible pull request event
GitHubActions->>AgentRelayCloud: launch review swarm
AgentRelayCloud-->>GitHubActions: swarm run identifier
GitHubActions->>AgentRelayCloud: poll swarm status
AgentRelayCloud-->>GitHubActions: terminal status
GitHubActions->>SwarmPost: pass run identifier and pull request number
SwarmPost->>AgentRelayCloud: synchronize run and retrieve logs
AgentRelayCloud-->>SwarmPost: verdicts and transcripts
SwarmPost->>PullRequest: post review comments and update marker
Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/settings/billing. Comment |
maintainability lens — PASSMaintainability review — PR #75Read AGENTS.md and workflows/review-swarm.yaml for context. The diff wires a GHA-triggered cloud review swarm plus a comment-poster script. Overall the diff is well-commented; the top of Concerns
Notes
Nothing rises to a blocker for shipping the review swarm — the diff is a net win over the prior state and the failure modes it introduces are recoverable — but item 1 is a straight contradiction of AGENTS.md §4 and should be fixed before this is trusted as a gate. REVIEW_PASSED |
history lens — FAILBlockers
NotesThe filename ordering and final-verdict parsing in REVIEW_FAILED |
structure lens — FAIL→ Read docs/RFC-0001-everything-is-a-relayflow.md Structure lens review — PR #75This PR adds CI glue (one GitHub Actions workflow, one bash script, one README line). No kernel code, no primitives, no Blocker
Concerns
Notes — the two "hard-won extraction rules" comments (sort by filename not mtime; verdict = last non-empty line) are exactly the kind of lived-in reasoning AGENTS.md's "evidence is captured" section wants preserved. REVIEW_FAILED |
…RFC filter History + structure lens on #75 identified three blockers, all real: 1. `timeout-minutes: 50` was less than the poll deadline of 65 minutes, so GHA would kill the job before the poll could time out. Raised job cap to 75 (65 + 10 headroom for checkout/install/post steps). 2. Wait step exiting nonzero on cloud `failed` made GHA skip the post step — so a rejecting swarm's transcripts never reached the PR. That is exactly the evidence-loss class ops/DRIVE-LOG.md warns about. Restructured: wait step records terminal status as an output and ALWAYS exits 0. Post step runs with `if: always()`. New final step fails the job iff swarm wasn't `completed`. Transcripts and marker land on the PR before the CI check goes red. 3. Author filter `kjgbot`/`miyaontherelay` contradicts RFC-0001 §2 rule 7 "Every PR is met by a review swarm". Dropped the filter — human PRs get reviewed too, per the constitution. Comment records the intent.
maintainability lens — PASSI have enough context. Writing the review now. Maintainability review — PR #75 (review-swarm CI wiring)Blockers: none. Concerns:
Notes:
REVIEW_PASSED |
history lens — FAILBlockers
Concern
Notes
REVIEW_FAILED |
structure lens — PASS→ Read docs/RFC-0001-everything-is-a-relayflow.md Structure lens — PR #75 reviewScope: all changes are CI/CD glue ( ConcernsVerdict logic reimplemented in shell, duplicating the relayflow's own judgment ( Cross-file timeout coupling by comment, not by artifact (
Notes
No blockers. REVIEW_PASSED |
History lens on #75 caught: prior aggregate logic only degraded on MISSING/UNCLEAR, not FAILED. So a log-derived PASSED (from the cloud run's own aggregate step) could survive even when a lens transcript said REVIEW_FAILED. That posted a PASSED marker while a lens rejected — exactly the "single honest refusal must block merge" rule broken. Now: aggregate = ALL lenses PASSED, else FAILED. Log-derived overall is discarded — transcripts are the load-bearing evidence per the review-swarm.yaml aggregate step's own rule.
maintainability lens — FAILLooking through the maintainability lens on PR #75. BlockersB1. Dead code with self-justifying comment — B2. Transcript comments accumulate on every push — ConcernsC1. Load-bearing invariant only expressed as a comment — C2. Silent CI/marker divergence — C3. Implicit runId shape contract — Notes**N1. README addition (line 15) says the secret is required but not what workspace it points to or how a maintainer obtains one — a fork or new clone can't act on this hint. **N2. No test would fail if REVIEW_FAILED |
history lens — FAILBlockers
Concern
Note The first two commit descriptions accurately describe their individual diffs. The latest commit overstates “fixes #75 B2”: it fixes the posted marker, not the merge-blocking check. REVIEW_FAILED |
structure lens — FAIL→ Read AGENTS.md $ ls -la /Users/khaliqgant/AgentWorkforce/flows-ops && echo "---GITHUB---" && ls -la /Users/khaliqgant/AgentWorkforce/flows-ops/.github/workflows/ 2>/dev/null && echo "---SCRIPTS---" && ls -la /Users/khaliqgant/AgentWorkforce/flows-ops/.github/workflows/scripts/ 2>/dev/null $ cd /Users/khaliqgant/AgentWorkforce/flows-ops && echo "===workflows===" && ls -la workflows/ && echo "===ops===" && ls -la ops/ && echo "===kernel===" && ls -la kernel/ && echo "===scripts===" && ls -la scripts/ $ cd /Users/khaliqgant/AgentWorkforce/flows-ops && echo "===review-swarm.yaml?===" && find . -name 'review-swarm.yaml' -not -path './node_modules/*' 2>/dev/null && echo "===ops/reviews?===" && ls -la ops/reviews/ 2>/dev/null && echo "===git status===" && git log --oneline -5 → Read workflows/review-swarm.yaml Structure review — PR #75 (review-swarm CI GHA + post-back script)This PR adds The structural problems are all in how the verdict is computed and where it lives. Blocker — the merge verdict now has two disagreeing sources of truth. Concern — dead code. Concern — the lens list is triplicated as an unowned contract. Note — gate-editing-itself boundary. The workflow checks out REVIEW_FAILED |
|
🎯 review-swarm: FAILED (M:fail H:fail S:fail) Lens transcripts posted as sibling comments above. |
|
Pivoting: swarm iterated 4x on real architectural findings (gate-editing-itself, two disagreeing verdict sources across shell+yaml, transcript-verdict binding, sticky-transcript missing). Local review-swarm-loop.sh on the laptop is sufficient signal for now. Cloud GHA can be revisited when the deeper unification (workflows/review-swarm.yaml aggregate + .github/workflows/scripts/swarm-post.sh sharing verdict-extraction) is scoped as its own workstream. |
Every real finding accumulated across walked-away PRs #75 (5 iterations) and #77 baked in as non-negotiable requirements: 1. Immutable gate — checkout main separately, PR doesn't judge itself 2. Unified verdict logic (single source of truth across yaml + shell) 3. Auth secret fail-fast preflight 4. Sticky marker + transcripts (edit-in-place) 5. Every PR reviewed — no author whitelist (RFC-0001 §2 rule 7) 6. Fetch on launching host (cloud sandbox has no gh auth) 7. Job timeout > poll deadline > swarm timeoutMs (invariant) 8. Wait step records status; post runs on always() 9. Transcript-to-run-id binding (mtime-freshness proxy) Territory: .github/ + workflows/. No overlap with Track A (sdk/). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Recovers the GHA review-swarm work from cloud run 45b1974c, which `DELIVER_FAIL_SYNC`'d because the sandbox left a coredump at `testdata/preflight/core` that `git apply` can't handle without a full index line. Stripped the coredump hunk from the patch, kept the GHA scaffold, dropped the ops churn, then hand-fixed the swarm's real findings from #74 before opening.
Diff
Just three files:
Swarm findings from #74 addressed here
Maintainability blockers:
History blockers:
Additional hardening (concerns from #74):
Prerequisites (also flagged in #74's assessor NEEDS_HUMAN)
Test plan