Repository navigation
fix: reconcile reads canonical records with operator auth - #1149
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 8:28 PM ET / August 13, 2026, 00:28 UTC. ClawSweeper reviewWhat this changesThe PR lets the exact-review operator credential read active canonical item records while retaining webhook-only access to closed records, plans, and decision packets. Regression provenancePossible regression — probable (reproduction; reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open: current main still rejects the operator-signed canonical item read, and this PR repairs that bounded mismatch. The prior P1 is resolved by restricting fallback authentication to Likely related people: steipete (recent area contributor; high confidence). Priority: P2 Review scores
Verification
How this fits togetherExact-review reconciliation reads canonical records from the dashboard Worker before resolving stale review jobs. The Worker authenticates the signed request and forwards permitted reads to the Durable Object record store. flowchart LR
A[Reconciliation worker] --> B[Signed item-record request]
B --> C[Dashboard Worker]
C --> D{Record collection}
D -->|Active items| E[Webhook or operator authentication]
D -->|Other collections| F[Webhook authentication]
E --> G[Canonical record store]
F --> G
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the item-only operator fallback and merge the repair after the current review and normal status checks are ready for maintainer approval. Do we have a high-confidence way to reproduce the issue? Yes: source shows reconciliation signs an active-item canonical-record GET with the operator credential while current main accepts that route only with the webhook credential. Is this the best way to solve the issue? Yes: reusing the existing signed route and allowing the operator credential only for the sole consuming collection is the narrowest maintainable repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae36d608d017. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
|
@clawsweeper re-review The main PR body now records the requested finding disposition and Rank-up exception against the explicit work-order authorization boundary. The head and frozen proof are unchanged. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
#1163) Quota campaign PR 3/5: content-addressed R2 cache for exact-review bundles - repeat artifact downloads stop hitting GitHub entirely. Design: on first successful GitHub artifact download the validated bundle is stored at immutable R2 key artifacts/exact-review/v1/<sha256> via the existing state-blob transport; a queue receipt binds the digest to producer run/attempt, artifact name, canonical item key, lease revision, and protocol version. Retries look up the receipt, fetch from R2, and verify the digest before use; any absence, corruption, or lease-revision mismatch falls back to GitHub (artifacts remain the authority - R2 is strictly a cache). New endpoints (/artifact-cache/receipt/lookup|store) authenticate with the publisher-scoped webhook secret; the operator secret keeps its admin-only scope per the #1149 least-privilege doctrine. Retention: 30 days with bounded incremental pruning (128 rows/objects per pass). Counted proof: repeat downloads for the same publication tuple go 1 -> 0 GitHub requests; missing-object and lease-mismatch cases each correctly fall back with 1. Targets the repository_actions:artifact_download class (12.8k cumulative + ~6k circuit-skips, 36% measured repeat floor). Phase B (producer uploads R2 directly, GitHub becomes disaster fallback) follows once this proves out in production. Proof: real R2 semantics in the container, full gate green + dashboard-strict, Crabbox local-container receipt at this exact head, machine-verified SHA provenance. Verdict clean (no findings, proof sufficient) on 8be2e61.
Related: #1148
What Problem This Solves
Fixes an issue where exact-review dead-letter reconciliation classified every checked head mismatch as unproven when it tried to read the completed canonical review with its operator credential. Production run 31651591787 hit this for all ten checked targets because the existing canonical-record GET accepted only the separately configured webhook credential.
Why This Change Was Made
The existing read-only canonical-record route now verifies the webhook secret first and falls back to the exact-review operator secret only for the
itemscollection, which is the sole collection read by reconciliation.closed,plans, anddecision-packetsremain webhook-secret-only. Missing required configuration still returns 503, invalid signatures still return 401, and the operator script and workflows remain unchanged.The operational-cursor GET/PUT route remains webhook-only because its current client explicitly uses that credential and no operator-secret consumer exists.
User Impact
Operators can reconcile stale head-mismatch dead letters using completed canonical-review evidence instead of receiving false 401 failures and leaving every checked target as
head_mismatch_unproven, without gaining read access to unrelated canonical collections.OpenClaw Bay Impact
OpenClaw Bay is unaffected. This changes authentication on one existing internal read-only route and does not alter queue lifecycle state, telemetry, dashboard data contracts, or Bay's observer-only boundary.
Documentation Lifecycle
The
docs/proof/operator-record-read-auth/package is historical, frozen evidence for this change. It is not an active runbook or operational source of truth.Finding Disposition
items;closed,plans, anddecision-packetsretain webhook-only authentication.Evidence
provider=local-containerreceipt: leasecbx_23906feb2769(pearl-shrimp-a24f), imagenode:24-bookworm, exit 0, lease auto-stopped.items/closed/plans/decision-packets=200/401/401/401; webhook =200/200/200/200; garbage =401/401/401/401.pnpm run check:dashboard-strictpassed without addingdashboard/worker.tsto the strict list.pnpm run checkpassed in the same container: 3,401 tests, 3,393 passed, eight platform skips, zero failures.autoreview --mode branch --base origin/main --max-priority P1: no accepted/actionable findings.06561bd4ee433cc3318a0ffd91d29ed29d9856d7. The frozen receipt committed in that push exercises executable head1855dfbb0c0d0b66978a99b20756845e3d6fa131; the final commit only records the generated proof artifacts.Real Behavior Proof
Claim: The production canonical-record GET accepts the exact-review operator credential only for active item records, preserves webhook access to all four canonical collections, and rejects invalid credentials everywhere.
Exercised surface: Two sequential real
wrangler dev --localWorkers over loopback HTTP, using the production router and SQLite-backed ExactReviewQueue Durable Object.Scenario: The proof publishes valid synthetic open and closed canonical tuples to merge-base and candidate Workers configured with distinct webhook and operator values. It signs GETs for
items,closed,plans, anddecision-packetswith the operator value, webhook value, and garbage. Between boots it kills the complete Wrangler process tree, requires/api/healthto stop responding, and reuses the same port with separate persistence.Command and environment: Docker-backed Crabbox
provider=local-container, imagenode:24-bookworm, leasecbx_23906feb2769(pearl-shrimp-a24f), tested executable head1855dfbb0c0d0b66978a99b20756845e3d6fa131, baseae36d608d01701af7e06c313be96689068b5c890. The exact command is frozen indocs/proof/operator-record-read-auth/receipt.json.Observable result: The candidate returned operator
200/401/401/401, webhook200/200/200/200, and garbage401/401/401/401foritems/closed/plans/decision-packets. The merge base remained webhook-only. Both process-tree shutdown checks observed the health endpoint down. The focused router test, dashboard-strict gate, and full repository gate passed in the same lease. Crabbox exited 0 and reportedleaseStopped=true.Artifact or trace:
docs/proof/operator-record-read-auth/behavior-report.json,container-transcript.txt,container-stderr.txt, andreceipt.json. TruffleHog 3.96.0 found zero verified or unknown secrets in the captured logs.Limits: Credentials and record content are synthetic. The proof exercises the real local Worker, router, HMAC verification, and Durable Object record store; it does not deploy, read production state, mutate GitHub beyond this PR update, or broaden cursor authentication.