Repository navigation
refactor: sign workflow control-plane requests in one helper - #1794
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 workflows use one shared helper to sign requests to the control plane, the service that coordinates review jobs, while preserving request and retry behavior. Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this is a narrow, useful refactor that current main does not contain. No actionable patch defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGitHub Actions sends signed requests to ClawSweeper’s control plane to enqueue reviews, record publication receipts, and reconcile completed runs. The shared shell helper sends those requests through the existing bounded retry client. flowchart TD
A[GitHub Actions workflow] --> B[Request URL and JSON body]
B --> C[Shared signing helper]
D[Existing webhook secret] --> C
C --> E[Existing retry client]
E --> F[Control plane]
F --> G[Response and exit status]
Technical reviewBest possible solution: Keep signing beside the existing retry client and preserve the workflow payloads and response contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing behavior rather than fixing a reported runtime failure. Is this the best way to solve the issue? Yes: adding signing to the existing retry helper removes duplication without creating a competing client or changing endpoint contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f80d0f1c3a9d. 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, 4:00 AM ET / 08:00 UTC. |
What
One owner for signing control-plane requests in workflow shell steps.
scripts/control-plane-curl.shgetscontrol_plane_signed_post <url> <body> [curl options...]. It computesx-clawsweeper-exact-review-signature: sha256=<hex HMAC-SHA256 of the exact body, keyed by CLAWSWEEPER_WEBHOOK_SECRET>, setscontent-type: application/json, sends the body with--data-binary, and goes throughcontrol_plane_curl, so the retry policy is unchanged. The URL stays the last curl argument.signature="$(PAYLOAD=... node -e 'createHmac(...)')"+ 5-line curl block in.github/workflowsnow calls the helper.RUNNER_TEMPraw download, fallback), so pre-checkout jobs need no new download.--data-binaryinstead of--data).docs/scheduler.mddocuments the helper.Copy counts (HMAC one-liners in
.github/workflows):sweep.yml"sha256="+…instead of a template literal)exact-review-reconcile-run.ymlscripts/control-plane-curl.shNot changed: the scheduled
sweepjob inexact-review-reconcile.ymlis a Node program that signs inside its ownfetchclient. It is audit finding 8(b) and moves with the queue-client slices.docs/proof/**stays frozen.Why
agent://SlopWorkflows/report finding 3: the signing line was copied verbatim about 11 times (actually 14) with drift already present (
sweep.yml"Record deferred close-proof" used string concatenation). A signing-format change was a 14-site edit. Finding 2 asks for this to ship before the typed queue client.Proof
$, backtick, quote, backslash, unicode; payloads with quotes, backslash,$HOME, emoji, and{}), curl replaced by an argv recorder:Both old variants (template literal and
"sha256="+…) produce the same value.sweep.ymlform (--data "$payload") and the helper send identical requests on the wire (method, URL, content type, signature, body hex):Lane through its e2e harness:
scripts/e2e/apply-drift-refresh.ts(viatest/apply-drift-refresh.test.ts) runs the reallegacy-event-queue-intakeshell with the realcontrol-plane-curl.sh; its curl stub verifies the HMAC of the received--data-binarybody before it enqueues into the dashboard harness. Green.test/repair/exact-review-reconcile-workflow.test.tsrunsexact-review-reconcile-run.ymlagainst an HTTP server that rejects a bad signature with 401. Green.pnpm run check: 6964 pass, 0 fail, 37 skipped. The run exits 1 only on the knowncoverage file is emptyflake after all tests pass.codex review --base origin/main: "No actionable defects found."Saved real reports re-rendered with
render-comments.mjs(prompt-rest, prompt-lean, prompt-dump, async-proof/{base,branch}, retire-proof/166090): 6/6 byte-identical (nosrcchange).Codex dispositions
codex review --base origin/main: no findings.Merge Danger
sweep.yml(legacy intake enqueue, direct lifecycle receipts, publication enqueue, publisher lifecycle receipts, drift requeue, command-ack failed/observed) and the event reconcile. A broken helper would turn these calls into 401s/failures. The proofs above show identical bytes on the wire, and pre-checkout jobs load the helper from the same pinned file that they already source.