fix(dashboard): correlate exact-review queue failures - #1322
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 10:37 AM ET / 14:37 UTC. ClawSweeper reviewWhat this changesAdds an opaque trace ID and fixed failure categories to private dashboard Worker and Exact Review Queue logs while retaining sanitized public queue-error responses. Merge readinessKeep open for normal maintainer merge review. The introduced patch is a bounded private-observability change with no supported correctness or security finding, and its supplied Worker-to-Durable-Object proof covers the central failure-correlation behavior. Priority: P2 Review scores
Verification
How this fits togetherThe dashboard Worker sends scheduled and webhook-driven review operations to the Exact Review Queue Durable Object, which persists queue state and exports canonical records. This change correlates failures across that internal boundary without adding record or request content to public responses or logs. flowchart LR
A[Scheduled and webhook requests] --> B[Dashboard Worker]
B --> C[Queue request wrapper]
C --> D[Exact Review Queue]
D --> E[Canonical record export]
C --> F[Bounded Worker failure log]
D --> G[Bounded queue failure log]
C --> H[Sanitized public error response]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the bounded correlation and consistency classification, then observe the first deployment’s private failure metadata to confirm the intended categories without changing public queue behavior. Do we have a high-confidence way to reproduce the issue? Yes. The supplied controlled Worker-to-Durable-Object scenario removes canonical content during record export and observes the correlated sanitized failure path; current source also directly establishes the new bounded logging route. Is this the best way to solve the issue? Yes. A generated opaque ID plus strict endpoint templates and typed consistency errors is a narrow way to diagnose the ambiguous internal failure without exposing record data or altering public error handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ce333f9cf9df. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
181cd6f to
279512f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
Summary
ExactReviewQueuerequests and private failure logsqueue.fetchcall through the same privacy-bounded wrapperProblem
Scheduled state setup can fail with the public, sanitized
exact_review_queue_unavailableresponse. That response is intentionally content-free, but the Worker and Durable Object logs previously had no bounded correlation key and could not distinguish an export consistency failure from a generic handler or platform failure.The recurrence after #1299 therefore remained ambiguous between record-state inconsistency, a Worker/DO exception, and platform availability or capacity.
Implementation
x-clawsweeper-exact-review-tracerecord_export_consistencyNo response body, request body, repository/item identity, exception message, filesystem path, stack text, or record content is added to logs.
Validation
Exact base:
ce333f9cf9dfb8a29d20ca966b9db4ee78ca1676Exact head:
279512f1631467955258264cf28e3607845481capnpm run build:allpnpm run check:dashboard-strictpnpm run lint:dashboardpnpm run check:dashboard-queue-boundarynode --test test/dashboard-worker-queue-runtime.test.ts— 149/149 passed, including the static bounded-log-call guard that caught and drove the follow-up repairnode --test test/dashboard-worker-durable-object-error.test.ts test/record-export-bounds.test.ts— 12/12 passednode --test --test-concurrency=1 test/dashboard-worker-command-intake.test.ts test/dashboard-worker-webhook-ingress.test.ts test/dashboard-worker-publication-lifecycle.test.ts test/dashboard-worker-queue-policy.test.ts— 112/112 passednode --test test/dashboard-worker-queue-runtime.test.ts test/dashboard-worker-bay-records-routes.test.ts test/dashboard-worker-observability.test.ts test/dashboard-worker-status-privacy.test.ts test/dashboard-worker-dashboard-status.test.ts— 367/367 passed after rebasing onto fix(dashboard): make telemetry coverage explicit #1301pnpm run test:unit— 314/314 passedgit diff --checkRebase integration:
ce333f9cf9dfb8a29d20ca966b9db4ee78ca1676/telemetry-reconciliationroute to the fixed endpoint map astelemetry_reconciliation, including a query-string redaction assertiongit range-diff 206fe726bbadaae32dcb9822a2511a351a5c9317..181cd6f5c46ac1de48b9da030002e62ebe5782d2 ce333f9cf9dfb8a29d20ca966b9db4ee78ca1676..279512f1631467955258264cf28e3607845481cashows the three reviewed patches unchanged, plus only the bounded fix(dashboard): make telemetry coverage explicit #1301 integration commitpnpm checkformatter gate reports the existing checkout-wide CRLF baseline across 776 files; the scoped formatter, strict compilation, lint, queue-boundary, build, focused tests, integrated tests, andgit diff --checkpassCodex review loop:
origin/mainafter the fix(dashboard): make telemetry coverage explicit #1301 integration: clean; no actionable regressionsLocal ClawSweeper
review --local-rangeat the exact head completed with high confidence, found the patch correct, cleared security review, and returned no code comments. Its sole pre-PR gate was attaching an executed Worker-to-Durable-Object trace; that evidence is below.Real Behavior Proof
Claim: a controlled record-export consistency failure produces the same opaque trace ID at the Durable Object and Worker boundaries, returns only the unchanged public error, and retains no fixture content or coordinates in the logged metadata.
Exercised surface: dashboard Worker route plus SQLite-backed
ExactReviewQueueDurable Object using the real request wrapper and record-export store.Scenario: initialize a signed export, seed a canonical record, remove its required canonical content row, then call the signed
/internal/state/records/exportWorker route. The same suite also covers invalid byte metadata, malformed base64 chunks, invalid UTF-8, and missing canonical chunks.Environment and command:
Observed redacted artifact:
{ "responseStatus": 500, "responseBody": { "error": "exact_review_queue_unavailable" }, "traceId": "<uuid-v4>", "durableObject": { "phase": "fetch", "trace_id": "<same-uuid-v4>", "endpoint": "records_export", "failure_category": "record_export_consistency", "location": null }, "worker": { "trace_id": "<same-uuid-v4>", "endpoint": "records_export", "phase": "request", "transport": "throw", "upstream_status": null, "remote": false, "retryable": false, "overloaded": false, "failure_category": "request_exception" }, "pairedTraceId": true, "contentRedacted": true }Result: 161/161 focused and queue-runtime tests passed in the container.
build:all, strict dashboard compilation, dashboard lint, and the queue-boundary check also passed. The lease auto-stopped after success. Range-diff proves those three container-proven patches are unchanged after the rebase; the fourth commit only adds the #1301 endpoint to the fixed map and is covered by the post-rebase deterministic and integrated tests above.Limits: this is controlled local-container proof with the in-repository Memory Durable Object and SQLite implementation. It proves response stability, correlation, classification, and redaction for the patch-equivalent runtime changes; a fresh post-rebase container lease was unavailable because the local Docker Desktop Linux daemon was not running. The bounded rebase-only endpoint-map addition is instead covered by deterministic and integrated tests. This proof does not claim production Cloudflare availability, CPU-limit behavior, capacity, or repair of existing production Durable Object state.
Risks and rollout
The new metadata should distinguish a consistency failure from a structured 5xx, malformed 5xx, remote exception, retryable platform exception, or overload without exposing request content.
Links