Skip to content

fix: resume bounded Coverage census across producer runs - #2153

Merged
roboclaw-bot merged 12 commits into
mainfrom
openclaw/coverage-census-progress
Nov 5, 2026
Merged

roboclaw-bot merged 12 commits into
mainfrom
openclaw/coverage-census-progress

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Coverage staying Unknown when a large repository needs multiple bounded producer runs. Follow-up to #2141.

User Impact

Stable/finitely changing populations resume; continuous churn, unsafe/incomplete scans stay Unknown, with qualified peers numeric. Weekly Markdown retains failures. No operator migration. Coverage is observational, not installation/review-admission authority.

Why This Change Was Made

Fair derived generations use purpose-HMAC leases, revision CAS and idempotent receipts. Two complete matching identity/field witnesses +terminal counts qualify. Preserve raw terminal false/non-null pageInfo; internal next=null only. Drift invalidates pending witnesses before metadata replacement; capacity/history cannot invent completeness/zero.

Unchanged caps: 25 identity queries/run,100 nodes/page,10 pages/connection/run,200 control steps/128 cleanup rows,20k IDs,32MiB copies/64MiB resident,64KiB chunks/1.9MB wire,<=100-row reclaim batches. No canonical/admission mutation or rate/schedule tuning. Bay retired; observer-only dashboard/no action controls.

Documentation Impact

Active ownership/proof: docs/live-dashboard.md and docs/proof/review-coverage-census/. Fragments only; release-owned CHANGELOG.md untouched.

Evidence

Full52-file Codex P0-P3 local r14/committed r9: scoped-clean/reporttrue/exit0;18 passes each.

Real Behavior Proof

Claim: CLI -> signed Worker/DO -> APIs -> served Astro/Chromium resumes bounded work and preserves data.

EXACT EXECUTED: head 3e3e582; tree b6e25f222d7f1bf8879cf650f983a51e0953877f; intended base 03e2430. All2010 tracked bytes equal before/final/after; clean tree/index. Not relabeled b7b proof.

Environment: ONE official Crabbox local-container/Podman4CPU10GiB; image sha256:6449e19d8184d84062525b6a7524def03146c2cb04a7f08b076680d0e8e4240a. Node24.22.1/pnpm12.15/jq1.6/Chromium156.0.8078.79. Run run_2d895029121d78bdcb59aee6a8406663; lease cbx_1f7be226b467. Pre-test independent image/resource/bootstrap inspection; labels not proof. Exact source/offline ancestry; project-first workload-user Corepack pin verified.

Recorded commands: pnpm run build; pnpm run build:repair; pnpm run build:dashboard; FULL pnpm run check. Node entrypoints (prefix node docs/proof/review-coverage-census/): runtime.mjs and mode-cadence.mjs (default/--bounded-churn/--two-incomplete), capacity-transition.mjs, byte-pressure.mjs, cleanup-progress.mjs, scheduled-summary.mjs, sticky-drift.mjs, compatibility.mjs --browser;4 prior full/partial browser runs +2 compatibility views.

Terminal: all30 gates exit0; focus661/661,0fail/cancel/skip; FULL6957 total/6935 pass/0fail/cancel/22 ordinary declared opt-in skips, no threshold/trust/skip waiver. Original445-family/schema132/all28 historic failures PASS; old assertions unchanged. Six served-browser PNGs +HTML/text inspected; minor existing caption/sidebar overlap, full captions retained.

Controlled cadence Opportunities VIRTUAL result
Static 15 (4h40) 145/145 numeric
Finite change 22 (7h) 145/145 numeric
Sustained two-repo churn 36 (12h) 143/145; fleet Unknown, peers numeric

Three unchanged opportunities retain windows;6h valid/13h stale/12h interruption, reconstructed DO/lost ACK, corrupt-prefix/post-promotion503, current visibility/private404/rename/cross-signature/anonymous0-ID cases pass. Safe-integer >20k remains metadata-only Unknown/no old denominator/0identity queries/four baseline IDs intact.

Accepted findings

  • P1 ID: FleetCoverage selects root id. Archived a184 compiled INSIDE lease fails before census/start when strict provider omits unrequested id. Current coverage/normal/hot/audit forward exact selected raw/source ID; missing/null/private fail closed. Earlier PUBLIC reads: keys issues,pullRequests -> id,issues,pullRequests, not guest live GitHub.
  • **Compatibility:**03 owners compile inside lease; normal APIs produce2format2 records/2bodies/1admission/1history/v1inventory. SAME KV/SQLite/body adapter: cold/warm/reconstruct/partial/resume/promote/refresh/additive DDL/private builds. Before/upgraded/after digest 0c0bbcc7f013526e64a7976315086debc83af17fe9fe5b52d80d28a2a65bef75. Served1/1 complete vs0/1 blocked retains history2. Legacy-v1 client on CURRENT server, NOT old-binary rollback.
  • Schema/fallback/bytes/cleanup: readiness/error barrier and synchronous no-hook prefix preserved. Staging33553978/33554424B; resident65719198B stay within caps. Atomic105-victim reclaim <=100/batch; rollback/replay/CAS/protected scopes/overcapUnknown pass. Real20k retirement drains in156next+start/max128/final32/0cleanup identity queries, without restamping; healthy/zero peers/no-spin pass.
  • Drift/pending witnesses: signed256->257->256/cleanup256->128->0 stays Unknown until fresh verification. Atomic pending-copy/first-witness invalidation +revision CAS prevents count-return/freed-capacity/reconstruct/ACK/stale-page/cancel/lease/v1 revival. Old payload/window immutable until actual matching passes promote. Exact20k orphans and20k mixed fleet stay bounded.
  • Publication/count/discovery: one anonymous report BEFORE original unknown reject/nonzero (actual compiled Error/undefined/object children). Summary/read/output faults cannot mask it; sanitized stderr/no stdout IDs/secrets/retry/rescan/v1 fallback. Normal/hot/audit add no report GET.

Faithful CLI/API observations:

node dist/repair/target-fanout.js coverage --window-days 7 --publish-url $QUEUE_URL
ordinary fixture: Open=3 Fresh=1 coverage=33.3%
discovery Error/undefined/object: actual exit1; count/identity/control/v1 writes=0
stdout: "Coverage collection/publication unavailable; command failure is retained."
GET /api/review-coverage: exactly1, anonymous/no redirects,64KiB/5s
Census Complete/Total: Unknown (not exposed by aggregate endpoint)
facts unavailable or request14/source7: review metrics=null/Unknown, not zero/mislabeled

Cached failure data keeps old as-of context, not a new publication. Malformed/oversize/real header+body timeouts/null/zero/privacy pass. Fleet aggregate only/no count fallback or invented selected completeness. View-only cardinalities: https://clawsweeper.openclaw.ai/coverage/.

REAL execution 2026-11-05T10:41:36Z–2026-11-05T10:55:29Z; VIRTUAL cadence/as-of separate. Archive SHA256 ae20b78c2816a212fc7e4549f17a0c41a42e6884e511ed5703af33ae5b92c32e; all789 internal hashes/47,386,252B and296 runtime bindings verified.

Limits: controlled GitHub/metadata/SQLite/R2 adapters, NOT deployedCF/live authority/production-store/throughput/current observations; no unconditional busy convergence/binary rollback. Logical bytes, not WAL/page high-water. Apt/npm egress logged, not zero-network; one readonly bootstrap, not zero mounts. New visibility does not withdraw old pages. Download before owned cleanup; owned lease absent/only own targeted. Shared-host churn (3 other IDs in/out,1 state change), not claimed unchanged. Rank-up exception: no private artifact upload.

Current-main composition — observation, NOT executed proof

Main 350cd4e; conflict-free common03 composition 06c9b712fbc7828b90f482736c9e4ca293b70ab5. All112 main-only/49 candidate-only blob+mode entries exact; both queue/Worker/docs payloads retained; owner lint0, no semantic collision identified. No checkout/refs/source change. Composition only, NOT current-main runtime/CI/mergeability approval; executed proof stays3e3e/base03. Hosted/native gates separate.

Credits

Requested by @brokemac79; adapted-source credit @vincentkoc. Both credited exactly once in every implementation commit; the bot publisher is not the human requester.

Work sessions

Optional credential-free provenance; access controls intact, no conversation content:
https://team.openclaw.ai/chat/roboclaw/~key/subagent/ed93bda0-4062-4899-a29e-e13a8efd2e36

Worked on by

roboclaw-bot and others added 5 commits November 5, 2026 01:03
Persist coverage-only generations and fair checkpoints in the existing queue storage owner. Reconcile observational membership witnesses without resetting prefixes, preserve unknown and as-of semantics, bound capacity transitions, and route existing coverage publication opportunities through one resumable budget. Add raw GitHub pagination, CLI cadence, corruption, replay, capacity and production-sized behavior proof coverage.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Keep census store construction side-effect-free and run its idempotent DDL through the established initialization/error path. Gate fetch and alarm access on successful readiness, preserve structured failure logging, and exercise cold, delayed, failed and warm state with unchanged canonical/admission data.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Invoke fallback storage initialization directly within the shared guarded initializer so existing schema and migration prefixes execute before the first real asynchronous suspension. Retain census schema isolation, readiness and error logging; cover immediate migration compatibility without changing existing lifecycle assertions.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Before accepting pressured pages, atomically reclaim bounded batches of unseen older-pass staging rows in the same repository and generation. Preserve current-pass and complete evidence, keep all quotas unchanged, and prove finite replacement/growth convergence at the real byte cap with rollback and replay safety.

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: 12ec0682-7f47-4e90-9846-b0090d61ff03
@clawsweeper

clawsweeper Bot commented Nov 5, 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. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR persists bounded Coverage census progress across producer runs and publishes verified collection windows and aggregate summaries.

Example: A repository has 4,865 open issues and 2,881 open pull requests.

  • Before: Each invocation restarts collection and reaches the ten-page connection limit, leaving Coverage Unknown.
  • After: Accepted pages survive subsequent invocations, and two matching complete sweeps qualify numeric coverage.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch addresses the demonstrated failure without an established actionable defect; confidence is limited by controlled, predominantly in-process runtime evidence.
Proof confidence 🦐 gold shrimp (3/6) Sufficient (terminal): Supplied terminal observations exercise the actual CLI, signed Worker, queue census owner, and API projections in local-container run run_2d895029121d78bdcb59aee6a8406663, lease cbx_1f7be226b467. They cover resumable collection, reconstruction, lost acknowledgements, drift, rejected signatures, revoked visibility, anonymous output, and same-storage upgrade preservation. The reported executing source matches the reviewed tree. The archive and browser captures are not publicly linked, so no independent media inspection or deployed Cloudflare result is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Coverage stays Unknown indefinitely when a repository's open items exceed one bounded collection invocation.
Reason: The failure is source-established, and the host-established maintainer direction preserves observational coverage and the observer-only dashboard.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still restarts bounded census collection, leaving large repositories Unknown indefinitely. This PR addresses that failure, resolves the earlier repository-ID finding, and introduces no new actionable defect established by this review.

Priority: P2
Reviewed head: 8885b6e219379e5566d0c09d4e0658b79ec8d13e

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied execution uses controlled GitHub and storage adapters; deployed Cloudflare execution and independently viewable browser captures are not established.
Agent review details

How this fits together

Scheduled producers read GitHub observations, submit signed checkpoints to the queue Durable Object, and expose qualified results through Coverage APIs, dashboard builds, and Markdown summaries.

flowchart LR
  A[Scheduled producer] --> B[GitHub observations]
  B --> C[Signed checkpoint routes]
  C --> D[Queue census storage]
  D --> E[Coverage projection]
  E --> F[Visibility verified dashboard]
  E --> G[Anonymous Markdown summary]
Loading

Technical review

Best possible solution:

Keep one resumable census owner in the existing queue, preserving bounded work, verified witnesses, and independent disclosure authorization.

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

Current-main source deterministically restarts each connection and rejects collection after ten pages, establishing the failure for more than 1,000 open items in one connection without executing target code.

Is this the best way to solve the issue?

Persistent checkpoints address the restart cause under the existing storage owner; two matching sweeps preserve completeness, while the explicit legacy protocol remains separate.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Current-main failure remains: The collector initializes each connection cursor locally and rejects its eleventh page; it cannot retain an accepted prefix for another invocation. (src/repair/target-fanout.ts:1149, 350cd4e3723f)
  • Earlier finding resolved: FleetCoverage explicitly selects the repository ID consumed by v2 publication; selection-faithful fixtures cover coverage, normal, hot, and audit modes. (src/repair/target-fanout.ts:1055, 8885b6e21937)
  • Derived storage and promotion: Separate coverage_census tables hold checkpoints, revision checks, receipts, and bounded identity copies; promotion requires matching complete sweep witnesses. (dashboard/review-coverage-census.ts:89, 8885b6e21937)
  • Control authorization: The Worker verifies a method/path/purpose-bound HMAC before forwarding fixed census routes; storage admission additionally checks lease, generation, revision, and cursor. (dashboard/worker.ts:5575, 8885b6e21937)
  • Supplied runtime and compatibility evidence: The body supplies controlled CLI/Worker/SQLite observations for static and changing populations, failure reporting, revoked visibility, and predecessor-produced state preservation. Provider local-container, run run_2d895029121d78bdcb59aee6a8406663, lease cbx_1f7be226b467; deployed Cloudflare behavior is expressly excluded. (docs/proof/review-coverage-census/compatibility.mjs:402, 8885b6e21937)
  • Executed source correspondence: The reported executing commit and reviewed head have identical tree b6e25f222d7f1bf8879cf650f983a51e0953877f; their comparison contains no source changes. (8885b6e21937)

Likely related people:

  • RoboClaw: Raw commit 940ad52 adds src/review-coverage.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 940ad52249d6; files: src/review-coverage.ts)
  • Ayaan Zaidi: Raw commit a985ae7 adds dashboard/exact-review-queue.ts:1020 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a985ae79aec2; files: dashboard/exact-review-queue.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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Large-repository Coverage remains Unknown despite repeated producer opportunities; the affected surface is observational reporting.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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 (2 earlier review cycles)
  • reviewed 2026-11-05T03:48:22.556Z sha a184ef1 :: blocked before merge. :: [P1] [P1] Select the repository ID before requiring it in v2 publication
  • reviewed 2026-11-05T12:00:46.703Z sha 8885b6e :: needs maintainer review before merge. :: none

Reviewed November 5, 2026, 7:27 AM ET / 12:27 UTC (Revision 3).

roboclaw-bot and others added 7 commits November 5, 2026 05:13
Select the stable GraphQL repository ID required by v2 intake. Make count fixtures selection-faithful so unrequested identity fields are absent, cover the real CLI modes and missing/private identities, and prove predecessor-produced canonical and v1 coverage state remains compatible through same-storage upgrade and reconstruction.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Report removable orphan work through the existing bounded control loop instead of ending after one cleanup batch. Preserve all cleanup, query and timing limits and qualified windows. Correct the compatibility browser replay handoff and cover the actual preload plus 20,000-row retirement, interrupted cleanup and freshness behavior.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Render the requested coverage window from one bounded credential-free public aggregate read after the existing-budget publication. Keep diagnostics separate, preserve Unknown and observed-zero distinctions, reject mismatched or unsafe payloads, and retain legacy output without identity rescans or private candidate disclosure.

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: 1db728fe-1127-4228-b627-76b5161906c5
Separate count/census publication from bounded aggregate reporting so the weekly job still emits truthful as-of or Unknown Markdown before retaining its original rejection and nonzero exit. Sanitize explicit coverage CLI diagnostics and prove actual compiled-entry failure exits without extra census queries or fallback.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Persist drift while cleanup defers refresh, atomically invalidate active and pending promotion certificates, and require fresh matching verification before restoring coverage. Keep discovery failures inside bounded reporting while preserving original failure exits. Exercise signed state lifecycles, shared-copy capacity and actual CLI negative outcomes.

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: c62672c0-9132-4df2-bc04-15b179e1ba2a
@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 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. 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 rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Nov 5, 2026
@clawsweeper clawsweeper Bot removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 5, 2026
@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 5, 2026
@roboclaw-bot
roboclaw-bot merged commit 09be10a into main Nov 5, 2026
46 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/coverage-census-progress branch November 5, 2026 12:33
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: 🦐 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant