Skip to content

fix: surface direct publication rejection detail - #1091

Merged
steipete merged 1 commit into
mainfrom
steipete/surface-direct-publication-reject-detail
Aug 10, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/surface-direct-publication-reject-detail

Conversation

@steipete

@steipete steipete commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • return the existing sanitized direct-publication validation reason as detail while preserving error: "invalid_direct_publication_plan", fallback_required: true, HTTP 400, and every acceptance/classification branch
  • append detail to the client-visible fallback reason so workflow logs identify the actual validation failure and batch dead-letter fingerprints split by that failure
  • cover Worker redaction, client surfacing, downstream SHA-256 fingerprint separation, and the real local Worker/Durable Object HTTP contract

This 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_invalid grew from 177 to 191 over about six hours. Of 189 reconciler inventory rows, 178 shared fingerprint 18100482292fa5b48fd215110a0be3a7d261257e337fdd57b748bee5482efac9, exactly sha256("Error:invalid_direct_publication_plan"); 170 belonged to the legitimate generic-fallback target steipete/CodexBar. steipete/CodexBar#2797 failed 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 ExactReviewQueue Durable Object preserve the existing HTTP 400 classification while returning a sanitized validation-specific detail; structurally different invalid plans return different details.

Exercised surface: Built dashboard Worker, signed /internal/exact-review/publication-results HTTP route, real local Wrangler runtime, real ExactReviewQueue Durable 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_plans table, 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 with error=invalid_direct_publication_plan and fallback_required=true. Details were invalid direct publication revision and direct publication path is outside steipete-CodexBar#2797: records/steipete-CodexBar/items/2798.md; the proof asserted they differ.

Container reproduction: Passed against pushed head 9bf0f83c5f35620580fc15c20354011adc624323 from the clean --fresh-pr openclaw/clawsweeper#1091 checkout. Crabbox 0.39.0 used provider local-container, image/type node:24-bookworm / node_24-bookworm, and OrbStack-backed Docker 29.4.0. Lease cbx_9840d67674b6 (amber-prawn-86a1) completed with verbatim PROOF_RC=0, exit 0, sync 17.849s, command 16.946s, total 34.796s, and leaseStopped: 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:all
  • pnpm run test:no-build
  • pnpm run lint
  • pnpm run format:check
  • pnpm run check:dashboard-queue-boundary
  • focused Worker/client/batch tests: 338 passed
  • pre-commit local autoreview: clean, no accepted/actionable findings
  • committed branch autoreview against origin/main: clean, no accepted/actionable findings

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 2:43 AM ET / 06:43 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 9bf0f83c5f35620580fc15c20354011adc624323

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with concrete runtime proof and regression coverage; no material blocker was found.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides after-fix real local Wrangler and Durable Object HTTP evidence, including preserved 400 classification and distinct sanitized details from two invalid plans.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides after-fix real local Wrangler and Durable Object HTTP evidence, including preserved 400 classification and distinct sanitized details from two invalid plans.
Evidence reviewed 5 items Current-main baseline: Current main catches direct-plan validation errors but returns only error and fallback_required, so the underlying rejection reason remains unavailable to the publisher.
Narrow implementation and regression coverage: The branch derives detail through the existing sanitization helper, returns it only on invalid-plan responses, and appends it to the fallback reason; focused Worker, publisher, and batch-fingerprint tests cover the behavior.
Sanitization boundary: The existing sanitizer redacts URL credentials, known token forms, bearer credentials, control characters, and bounds output to 500 characters before the Worker returns the new detail.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Runtime, test, and proof delta runtime +6/-2, tests +138, proof/docs +267 The production behavior change is small; most of the branch is targeted regression coverage and an executable real-behavior proof.

Technical review

Best 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.

Labels

Label changes:

  • add P2: The patch improves diagnosis of bounded publication failures without evidence of an immediate user-facing outage.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix real local Wrangler and Durable Object HTTP evidence, including preserved 400 classification and distinct sanitized details from two invalid plans.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides after-fix real local Wrangler and Durable Object HTTP evidence, including preserved 400 classification and distinct sanitized details from two invalid plans.

Label justifications:

  • P2: The patch improves diagnosis of bounded publication failures without evidence of an immediate user-facing outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides after-fix real local Wrangler and Durable Object HTTP evidence, including preserved 400 classification and distinct sanitized details from two invalid plans.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix real local Wrangler and Durable Object HTTP evidence, including preserved 400 classification and distinct sanitized details from two invalid plans.

Evidence

What I checked:

  • Current-main baseline: Current main catches direct-plan validation errors but returns only error and fallback_required, so the underlying rejection reason remains unavailable to the publisher. (dashboard/exact-review-queue.ts:2633, 621b297eadd5)
  • Narrow implementation and regression coverage: The branch derives detail through the existing sanitization helper, returns it only on invalid-plan responses, and appends it to the fallback reason; focused Worker, publisher, and batch-fingerprint tests cover the behavior. (src/repair/exact-review-direct-publication.ts:122, 9bf0f83c5f35)
  • Sanitization boundary: The existing sanitizer redacts URL credentials, known token forms, bearer credentials, control characters, and bounds output to 500 characters before the Worker returns the new detail. (dashboard/error-safety.ts:10, 621b297eadd5)
  • Feature-history routing: Recent history assigns the current queue path and direct-publication helper to Peter Steinberger, including the current-main observability refactor and the prior direct-publication update. (dashboard/exact-review-queue.ts:2633, 4d48e9918b9b)
  • After-fix behavior proof: The PR body records a Crabbox local-container run against the pushed head through real Wrangler HTTP and a Durable Object: both invalid plans returned HTTP 400 with unchanged classification and distinct sanitized details. (docs/proof/direct-publication-reject-detail/run-proof.sh:135, 9bf0f83c5f35)

Likely related people:

  • steipete: Git history attributes the current queue path and the most recent direct-publication helper change to Peter Steinberger, corresponding to the steipete account. (role: recent direct-publication owner; confidence: high; commits: 621b297eadd5, 4d48e9918b9b, 9bf0f83c5f35; files: dashboard/exact-review-queue.ts, src/repair/exact-review-direct-publication.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit e699e83 into main Aug 10, 2026
19 checks passed
@steipete
steipete deleted the steipete/surface-direct-publication-reject-detail branch August 10, 2026 06:46
steipete added a commit that referenced this pull request Aug 13, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant