Repository navigation
refactor: build exact-review lifecycle receipts with the typed queue request command - #1802
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe review workflow builds lifecycle receipts—records of publication and routing—with the existing typed command instead of six copied inline builders. Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this is a useful, bounded consolidation that current main does not contain. No actionable correctness or security defect was identified. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherClawSweeper’s review workflow sends publication, routing, and terminal outcomes to its durable review queue. These receipts let the queue track completion and subsequent finalization. flowchart TD
A[Review publication result] --> B[Workflow selects lifecycle outcome]
B --> C[Typed request command]
D[Target revision and workflow run] --> C
C --> E[Signed HTTP transport]
E --> F[Durable review queue]
F --> G[Lifecycle completion and finalization]
Technical reviewBest possible solution: Keep lifecycle serialization in the existing typed command while retaining the queue and signed transport as their current owners. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing behavior rather than reporting a runtime bug; supplied base/head comparisons exercise the lifecycle handoff. Is this the best way to solve the issue? Yes: extending the existing serializer removes copied request construction without introducing a parallel transport or changing lifecycle ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ef0a6bf91f8b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 9, 2026, 5:05 AM ET / 09:05 UTC. |
What
Second lane for the typed queue request command (after #1796): exact-review lifecycle receipts built after checkout.
src/repair/exact-review-queue-request.tsgetslifecycle <router-receipt|canonical-receipt|terminal-disposition>. It readsTARGET_REPO,ITEM_NUMBER,FENCE_KEYandREVISIONand validates them. It accepts only the values the queue accepts: router outcomedurable|not_required(optional; the queue reads a missing outcome asdurable), canonical outcomeaccepted|deduped|superseded, and the terminal kinds the workflow sends (requeue|target_missing|target_closed|guarded_open|policy_noop). A receipt id is--receipt-id-prefix+:<run id>:<run attempt>. Invalid input prints no body and exits 1. The heartbeat path now shares the same run-id/run-attempt reader.setup-pnpm build:all):event-review-apply/ "Finalize direct exact review lifecycle": router receipt + terminal disposition. The receipt prefix choice (router-direct,-proof,-not-required) moved from the inline Node builder to three shell lines beside the call. The classifier is unchanged.event-review-publish: "Record fallback canonical…", "Queue deferred exact verdict router", "Record deferred close-proof…", "Record no-router…".scripts/e2e/manual-review-publication.mjs: the per-item work dir now linksdistbesidescripts, as a built checkout has them.event-review-publishruns before checkout (it sources$RUNNER_TEMP/control-plane-curl.sh), so it has nodist. It keeps its 2 inline builders until the pre-checkout bootstrap slice (audit finding 4). Every other lane (claim, complete, enqueue, terminal finalization) also has at least one pre-checkout step; this lane had the fewest.Copy counts (inline lifecycle body builders in
sweep.yml):node -elifecycle buildersWhy
agent://SlopWorkflows/report finding 2: the queue protocol is hand-copied in YAML. These six builders spelled the same lifecycle identity six times, two different ways (template literals in five,
+concatenation in one), and checked onlyREVISIONandFENCE_KEY.Proof
origin/main:sweep.ymland executed as-is. The new body comes from the built command with the same env:control_plane_signed_poststubbed to record URL + body. This covers the new shell prefix choice:node:24-bookworm, Wrangler 4.107.0, stock gh 2.98.0,MANUAL_PUBLICATION_PROVIDER=local-smoke).scripts/e2e/manual-review-publication.mjs run <head> <source-id>runs the checked-in "Finalize direct exact review lifecycle" step against a local worker. I ran it on main (373cf3e) and on this branch (b2e0346). Both traces hold the same request, and both returned 200:The rest of the lifecycle checks in the driver (canonical record lines, the allowed PR effects, which assert this exact router-receipt body) pass on both. Both runs then fail later, at the same point, in the unrelated batch lane (
prepare-exact-review-batch.mjsoutage scenario: expectedstate_contention, gotunknown_failure, manual-review-publication.mjs:1480/1482). That failure exists on main as well; this PR does not touch that lane.test/repair/exact-review-queue-request.test.tsruns the built command for every lifecycle body and every rejection.test/sweep-workflow.test.tspins each migrated step to its command call.pnpm run check: 6966 pass, 2 fail. Both failures are the knowncommand-proof-consumer120s/180s timeouts under load; the file passes alone (29/29).codex review --base origin/main: "No actionable defects found." Saved real reports re-rendered withrender-comments.mjs(prompt-rest, prompt-lean, prompt-dump, async-proof/{base,branch}, retire-proof/166090): 6/6 byte-identical.Codex dispositions
codex review --base origin/main: no findings.Merge Danger
event-review-apply, and the four receipt steps after publication inevent-review-publish. All of them run aftersetup-pnpmwithbuild:all, so the command is present. If the command rejected input, the step would fail before any request, which matches what the old builders did on a badREVISION/FENCE_KEY. The queue's lifecycle reconciliation is unchanged.