Repository navigation
fix: surface direct publication rejection detail - #1091
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 2:43 AM ET / 06:43 UTC. ClawSweeper reviewWhat this changesThe PR returns sanitized direct-publication validation details from the dashboard Worker and includes them in fallback reasons so batch failures receive distinct diagnostic fingerprints. Merge readiness✅ Ready for maintainer review Keep open: current main still returns only the opaque invalid-plan code, while this focused PR preserves that classification and adds a sanitized diagnostic detail with sufficient real-behavior proof. No actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe repair publisher sends signed direct-publication plans to the dashboard Worker’s ExactReviewQueue Durable Object. Rejected plans enter the fallback/batch path, where their reason is logged and fingerprinted for operations. flowchart LR
A[Repair publisher] --> B[Signed publication request]
B --> C[Dashboard Worker]
C --> D[ExactReviewQueue validation]
D -->|accepted| E[Canonical record publication]
D -->|rejected| F[Sanitized detail response]
F --> G[Fallback batch]
G --> H[Diagnostic fingerprint]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Preserve the stable HTTP error and fallback classification while exposing only the bounded, sanitized validation detail for operational diagnosis. Do we have a high-confidence way to reproduce the issue? Yes: on current main, a signed invalid direct-publication plan reaches the documented catch path and returns the opaque HTTP 400 response; the branch supplies a concrete real Worker/Durable Object after-fix exercise. Is this the best way to solve the issue? Yes: reusing the existing bounded sanitizer and retaining the stable error/classification is the narrowest maintainable way to distinguish validation failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 621b297eadd5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…sede proven-stale tuple rows (#1152) Root-causes and fixes the tuple_protocol_invalid dead-letter class (30 rows), closing the DLQ's last unexplained residue. Fingerprint archaeology: the dominant 21-row class hashed to a generic invalid_direct_publication_plan opacity bucket - 19 rows are debris of the mixed-case slug bug already fixed in #1100 (steipete/CodexBar targets), two lost their pre-#1091 detail and stay honestly unclassified. The live 4-row class is "conflicting direct publication retry": guarded apply refreshes current_item_*/apply_checked_at after canonical acceptance, so publication retries see byte-conflicts against their own accepted plan (hit both pre- and post-#1143 items, including re_review command results - NOT a protocol-v2 command bug). Live fix: an actively owned batch resumes from its terminal canonical receipt instead of conflicting with itself; strict direct-publication conflict and fence checks preserved. Stale tuple rows now pass through the #1148 six-way evidence-gated supersede (newer-head completed record required); current-head rows stay recoverable so they republish after this fix; workflow_cancelled remains excluded. Proof: red reproduced the HTTP 400 conflict and the supersede exclusion; green 176/176 focused scenarios; full gate 3396/0; Crabbox local-container receipt at this head (docs/proof/tuple-protocol-rootcause/). Verdict clean (Findings: None, Security: None) on 5b67ae2.
Summary
detailwhile preservingerror: "invalid_direct_publication_plan",fallback_required: true, HTTP 400, and every acceptance/classification branchdetailto the client-visible fallback reason so workflow logs identify the actual validation failure and batch dead-letter fingerprints split by that failureThis is diagnosability-only. It does not change retry/permanence classification, which plans are accepted or rejected, or attempt to fix the underlying CodexBar rejection.
Measured production evidence
tuple_protocol_invalidgrew from 177 to 191 over about six hours. Of 189 reconciler inventory rows, 178 shared fingerprint18100482292fa5b48fd215110a0be3a7d261257e337fdd57b748bee5482efac9, exactlysha256("Error:invalid_direct_publication_plan"); 170 belonged to the legitimate generic-fallback targetsteipete/CodexBar.steipete/CodexBar#2797failed three times at batch revision 14 on the same morning. Workflow run https://github.com/openclaw/clawsweeper/actions/runs/31357238996 shows review publication succeeded and only canonical record publication failed with the opaque code.OpenClaw Bay impact
No Bay change is needed. This enriches an internal publication rejection response and its downstream diagnostic fingerprint. It does not alter Bay's public observer data contract, lifecycle state, or controls.
pr-behavior-proof
Claim: The real Worker and
ExactReviewQueueDurable Object preserve the existing HTTP 400 classification while returning a sanitized validation-specificdetail; structurally different invalid plans return different details.Exercised surface: Built dashboard Worker, signed
/internal/exact-review/publication-resultsHTTP route, real local Wrangler runtime, realExactReviewQueueDurable Object, and persisted local SQLite initialization.Scenario/fixture: The proof first initializes the Durable Object, kills Wrangler's full process tree, verifies the persisted
exact_review_direct_publication_planstable, and restarts. It then posts one plan with revision zero and one plan whose canonical record path targets the wrong item.Command/environment: Node 24.19.0 and Wrangler 4.107.0 on macOS:
bash docs/proof/direct-publication-reject-detail/run-proof.sh.Observable result:
PROOF_RC=0. Both requests returned HTTP 400 witherror=invalid_direct_publication_planandfallback_required=true. Details wereinvalid direct publication revisionanddirect publication path is outside steipete-CodexBar#2797: records/steipete-CodexBar/items/2798.md; the proof asserted they differ.Container reproduction: Passed against pushed head
9bf0f83c5f35620580fc15c20354011adc624323from the clean--fresh-pr openclaw/clawsweeper#1091checkout. Crabbox 0.39.0 used providerlocal-container, image/typenode:24-bookworm/node_24-bookworm, and OrbStack-backed Docker 29.4.0. Leasecbx_9840d67674b6(amber-prawn-86a1) completed with verbatimPROOF_RC=0, exit 0, sync 17.849s, command 16.946s, total 34.796s, andleaseStopped: true.Artifacts/trace: The proof harness is in
docs/proof/direct-publication-reject-detail/; its ignored local artifact directory captures both request/response bodies, a runtime transcript, build/install logs, and a redacted Wrangler log.Limits: Local-only synthetic plans and a disposable HMAC secret; no production deployment or mutation. This proves rejection diagnosability, not the underlying CodexBar cause, retry budget behavior, or production traffic volume.
Validation
pnpm run build:allpnpm run test:no-buildpnpm run lintpnpm run format:checkpnpm run check:dashboard-queue-boundaryorigin/main: clean, no accepted/actionable findings