Skip to content

fix: preserve and classify Coverage census failures - #2169

Merged
roboclaw-bot merged 4 commits into
mainfrom
openclaw/coverage-census-recovery
Nov 6, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
openclaw/coverage-census-recovery

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Coverage can report census_read_failed while a green scheduled fanout hides the failing checkpoint behind coverage_checkpoint_rejected. A second failure while recording a read error can also replace the original error.

This is a diagnostic-stage correction, not a claimed fix for the underlying production census failure. It makes a natural collection failure actionable without changing credentials, permissions, budgets, schedules or census acceptance rules.

User Impact

Operators receive closed phase/category and bounded progress counters. Coverage remains Unknown when evidence is incomplete; no zero or percentage is fabricated. Scheduled fanout remains nonblocking. Caller-owned control/transport errors retain their original identity, constructor and message; only operational output is sanitized.

Why This Change Was Made

A successful producer logged a checkpoint rejection: https://github.com/openclaw/clawsweeper/actions/runs/42187041617 . Later observations showed partial recovery, not uniform permanent failure. Both credential roles succeeded in the earlier diagnostic: https://github.com/openclaw/clawsweeper/actions/runs/42130178102 . No authentication cause is assumed.

Changes

  • Add allowlisted start/next/query/accept/fail categories and bounded progress without logging response text, SQL, repository identities, cursors, credentials, headers or stacks.
  • Keep diagnostic metadata in a private WeakMap rather than wrapping or mutating caller-owned errors. Preserve baseline control-created Error/SyntaxError/message contracts, including lost-ACK recovery.
  • Render closed diagnostics at normal-review, hot-intake and audit warning edges. Isolate observer exceptions and caller-owned getters.
  • Keep the original query failure as the primary cause if its failure checkpoint rejects. Authentication, signature/path/method admission, retries, fail-closed projection and nonblocking fanout are unchanged.

Documentation Impact

Updated the existing live-dashboard guide and one changelog fragment; no release-owned CHANGELOG.md change. OpenClaw Bay is not affected: private diagnostics/stderr change, not public dashboard actions or contracts.

Real Behavior Proof

Claim: the actual producer and signed Worker control path retain the primary query failure, preserve control-error compatibility and emit only closed operational diagnostics.

Executed source: aa40059; tree 506700889663ae454d7f7b13be569ead05bff0ae; pinned base b5cb826. Published head 76f1356 adds empty publisher bookkeeping: all 2,057 tracked entries exactly match the executed source. The bookkeeping commit was not falsely presented as the container-executed commit.

Controlled chain: runTargetFanout -> runGh -> runCommand -> actual controlled gh subprocess -> JSON.parse -> real signed loopback HTTP -> actual Worker router -> existing SQLite adapter. Malformed CLI JSON followed by a controlled SQL checkpoint exception produces query/json then fail/unclassified, retains the original SyntaxError cause, and reports Unknown. Canonical records and all non-census SQLite/KV/queue/alarm state match before/after; fixture R2 writes are prohibited.

Fresh isolated proof passed for this corrected source. Official Crabbox local-container/Podman; pinned Node image sha256:6449e19d8184d84062525b6a7524def03146c2cb04a7f08b076680d0e8e4240a; 4 CPU / 10 GiB; Node v24.22.1; strict pnpm12.15.0. Lease cbx_e44039e84ec3; run run_348f8840ae23c1f988c7a44a9aac0d79; wrapper exit 0. Independent actual-container identity/image/resource inspections preceded validation. Main/repair/dashboard builds, the real CLI/control path and 190 tests across 12 whole affected families passed, 0 failed/cancelled/skipped. Real native HTTP disconnect, body-read failure and the unchanged 20-second deadline preserved the exact original thrown error; protocol-generated errors retained baseline constructor/message. All 2,057 source files matched before/final/after. All 89 indexed artifact hashes were independently verified; archive SHA256 2777f421ded81d6f0217fbead913881d6422003e1ac84d68f3a1412368344d4b. Download preceded exact-owned cleanup; actual container absence verified. Dependency installation used network; controlled probes did not contact production. The readonly bootstrap/source transport is not a zero-mount claim.

Commands: pnpm run build; pnpm run build:repair; pnpm run build:dashboard; actual runtime-proof.mjs green; node --test --test-concurrency=1 over the complete census diagnostics/count/modes/scheduled-summary/authority/store/cleanup/sticky-drift/byte-pressure/capacity/schema families. Focused lint, formatting, docs/limits/changelog and diff checks passed. Fresh full local and entire committed-branch Codex reviews covered P0-P3 and supplied unchanged owners: scoped-clean, reports produced, exits 0.

Limits: gh and SQL faults are controlled; SQLite is not deployed Cloudflare/workerd. A host direct-fault attempt was translated by its egress proxy to HTTP 502 and was not counted as native-transport proof; the isolated guest exercised real native failures instead. Retained offline/pre-allocation setup failures are not counted as passes. Old 740f/60-test proof is superseded, not reused. No guards, thresholds or permissions were relaxed. No live census refresh, production state write, real credential test, deployment or merge occurred. Production cause/recovery remains unverified.

Finding Disposition and CI

Current full normal CI passed: https://github.com/openclaw/clawsweeper/actions/runs/42253949500 on published head 76f1356. Actual Node v24.22.1; four test shards: 7,130 total, 7,108 passed, 22 skipped, 0 failed/cancelled. Fast gates, required pnpm check, coverage enforcement and Windows launcher passed. CI checked the synthetic merge bb68741 of this head into main d2194ca; the separate isolated proof binds the unchanged executed source/tree above. The CI gate is satisfied. A fresh current-head/body ClawSweeper review remains required before maintainer look; no review acceptance, merge approval or proof override is claimed.

Credits

Requested by @brokemac79. Existing adapted-source credit to @vincentkoc is retained in the commits. The publisher bot is not the human requester.

Worked on by

roboclaw-bot and others added 2 commits November 6, 2026 08:38
Report closed census phases and bounded progress without exposing request data. Preserve the original read error when failure recording also rejects, and isolate diagnostic observer errors from collection behavior.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: f34de2d9-a63d-42bc-b58c-be0717638bad
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds bounded, privacy-safe census diagnostics and preserves the primary query failure when recording that failure also rejects.

Example: The census gh subprocess returns malformed JSON, then the fail checkpoint encounters a SQL exception.

  • Before: The checkpoint rejection replaces the JSON failure, obscuring the collection problem.
  • After: Diagnostics report query/json and fail/unclassified, retain the original SyntaxError as the cause, and leave Coverage Unknown.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused and compatible, with sufficient controlled production-path evidence and successful current-head checks.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied local-container/Podman observations exercise runTargetFanout through an actual controlled gh subprocess and signed HTTP to the Worker/SQLite owner, showing query/json plus fail/unclassified, preserved primary cause, Unknown reporting and native transport-error compatibility; the executed tree matches the reviewed head, with deployed Cloudflare and production recovery expressly excluded.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators cannot identify the failing census stage when generic checkpoint errors obscure the original collection failure.
Reason: The maintainer-authored direction addresses a concrete diagnostic failure while explicitly leaving production-cause investigation separate.

Merge readiness

✅ Ready for maintainer review

This PR provides useful census failure diagnostics that current main lacks; no concrete introduced defect or unresolved contributor blocker was found.

Priority: P2
Reviewed head: 76f13564dc1f7b5c87b72a2f7f20bea65cf10381

Before merge

None.

Findings

None.

Agent review details

How this fits together

Scheduled target fanout collects GitHub census pages and sends signed checkpoints to the Worker and existing queue storage; this change adds private response metadata and sanitized operational warnings.

flowchart LR
  A[Scheduled target fanout] --> B[GitHub census query]
  B --> C[Census producer]
  C --> D[Signed Worker route]
  D --> E[Queue census storage]
  E --> C
  C --> F[Closed operational diagnostics]
Loading

Technical review

Best possible solution:

Keep the focused diagnostics change and use its classified output to investigate the separate production census failure.

Do we have a high-confidence way to reproduce the issue?

The original source directly shows a query exception being discarded and replaced if fail rejects; supplied controlled runtime observations exercise that sequence, but this review ran no target code.

Is this the best way to solve the issue?

The patch uses the existing producer and storage owners, shares only the closed diagnostic vocabulary, and preserves retry and exception contracts without adding persisted state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d2194cade55f.

Provenance checked

  • Collector failure and lost-ACK handling keeps the original intent (2eb2e94: Bounded collection must fail closed and recover uncertain acceptance through receipts without advancing twice.)
  • Private checkpoint rejection responses keeps the original intent (2eb2e94: The signed control route returns a generic rejection while the existing census owner enforces lease and checkpoint validity.)
  • Scheduled fanout warnings keeps the original intent (2eb2e94: Observational publication failure must not block scheduled fanout.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • roboclaw-bot: Raw commit 2eb2e94 adds src/repair/review-coverage-census.ts:141 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2eb2e949045e; files: src/repair/review-coverage-census.ts)
  • Vincent Koc: Raw commit 7fd8583 adds src/repair/target-fanout.ts:725 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 7fd85834e904; files: src/repair/target-fanout.ts)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production and regression coverage Production +233/-48 lines; tests +508/-0 lines The tests exercise exception compatibility, privacy, observer isolation and failure recovery across the affected boundaries.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: The change improves diagnosis of observational Coverage failures without changing review admission or blocking scheduled work.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-06T15:49:44.471Z sha 0b78193 :: needs maintainer review before merge. :: none

Reviewed November 6, 2026, 11:55 AM ET / 16:55 UTC (Revision 2).

roboclaw-bot and others added 2 commits November 6, 2026 16:12
Preserve caller-owned control failures and baseline protocol exceptions while associating closed diagnostics privately. Render safe diagnostics at every nonblocking fanout warning. Cover the 16 original CI regressions plus transport, body, abort, cancellation, accessor, and privacy contracts without weakening existing recovery assertions.

Co-authored-by: brokemac79 <[email protected]>

Co-authored-by: Vincent Koc <[email protected]>
Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 8c5f08c8-a7b7-4f3f-95ce-198255e19994
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 6, 2026 16:50
@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 6, 2026
@roboclaw-bot
roboclaw-bot merged commit c1d3aeb into main Nov 6, 2026
40 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/coverage-census-recovery branch November 6, 2026 17:17
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