Skip to content

fix: use server-issued census observation windows - #2174

Merged
obviyus merged 4 commits into
mainfrom
openclaw/coverage-observation-window-fix
Nov 11, 2026
Merged

obviyus merged 4 commits into
mainfrom
openclaw/coverage-observation-window-fix

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Contributor

TL;DR

Fix Coverage census timestamp-window rejection using bounded, stored server-issued query windows—not another diagnostics layer, clock tolerance, credential change or budget increase.

Observed boundary / causal limit

Base 066e625998e61b8045704618e21d3ab9d73d7329, after #2173. Natural producer https://github.com/openclaw/clawsweeper/actions/runs/42282518998 succeeded but its preserved 29 diagnostic lines contain 28 accept/unclassified/checkpoint/observation_window and one separate query/read_failed. Last progress: 25 queries / 56 accepted / 4 failed. Exact exception: census observation window conflict.

Source inspection found live producer Date.now/new Date, not a frozen override. The old protocol compared producer query-completion time with an independent DO pass-start/receipt clock. A successful 300 ms query with the producer 500 ms behind reproduces that exact fault; an ahead producer reproduces start/invalid_checkpoint. The actual live direction/offset remains unmeasured. The separate query failure and every persisted read_failed reason are not claimed fixed; deployment success is not qualified Coverage recovery.

Authority / compatibility

  • Signed prepare reserves the unchanged five-minute lease before the count read. Start echoes its stored random metadata witness and conservative pre-query lower bound. No old data is stamped fresh and no GitHub query/rate-budget increase.
  • Next issues a stored per-assignment/per-attempt witness; negotiated pages explicitly use observedAt:null plus that server-bounded interval.
  • Exact stored ID/start/attempt, generation/revision/pass/cursor CAS, pass-start/receipt bounds, future identity checks, two stable witnesses, max-update/drift, labels/PR-head/reopen, receipts, promotion and capacity fences remain intact. Updates inside a query interval are valid, not updates past receipt.
  • Metadata freshness is bounded conservatively from query start; completed witness end is DO receipt—not an atomic GitHub as-of snapshot. Coverage fields/math/UI and persisted reason clearing are unchanged; only qualified promotion clears failure reasons.
  • Old client/new Worker stays strict legacy. New client/old Worker falls back only on explicit prepare-route 404; auth/lease/checkpoint failures cannot downgrade. The atomic lease mode requires a witness even for persisted legacy-shaped in-flight pages before next issues one.

Current pr-behavior-proof

Current GitHub-observed head: 6d5c05fae858d664ddd116167fdf063a82d6393e; tree 0f29198cac1b75f3c6907c07394cf9b098f550ad; clean index/worktree. Local and full committed merge-base-to-HEAD reviews were repeated for the upgrade repair and again after the managed publisher appended its marker; equal trees alone were not treated as equivalent review inputs.

Surface / clocks: actual runReviewCoverageCensus → HMAC-signed HTTP Worker → ExactReviewQueue → real workerd SQLite, with independent producer/server clocks advancing at request I/O. Fixture-only clock setup precedes the untouched signed route; production correctly strips arbitrary forwarded headers. SQL and signed authority are not mocked.

Provider: local Linux Miniflare/workerd SQLite, expressly selected for this task; isolated run native-Pjnu24, native image/hosted lease N/A. Node v26.12.1; Miniflare 5.20260911.0-alpha; workerd 1.20260911.1; esbuild 0.28.1.

node docs/proof/ui-live-coverage/coverage-observation-window.mjs 066e625998e61b8045704618e21d3ab9d73d7329
node docs/proof/ui-live-coverage/coverage-accept-operations.mjs c1d3aebd59790a33e7fc18e61631c06bc5b0761c

The canonical pre-existing proof retains its original pre-instrumentation base/expectations. The new temporal/upgrade proof compares against deployed merged-2173 066e625....

Temporal red/green: baseline exact observation_window behind-clock and invalid start ahead-clock; candidate succeeds at ±500 ms and ±120 seconds through both witnesses. Fleet: 145 repositories / 8,149 identities / 40 invocations / 217 queries / 736 accepted / zero failed. Both old/new rolling pairs pass. A real two-second query permits an update inside its interval without falsely placing it at query start. Advanced epochs, forged/future/stale windows, future identities, wrong pass/revision/generation/cursor, previous epochs, downgrade, HMAC/method and changed-receipt replay stay closed. Identical receipt replay remains idempotent; 25,000 identities remain capacity-blocked at the unchanged 20,000 bound.

Accepted data-model blocker / Rank-up move resolved: #2174 (comment) requested native same-store upgrade compatibility proof. The deployed base Worker now creates 100 persisted legacy-v2 identities, c100 continuation cursor, generation/pass and durable receipt. Its workerd process is disposed; candidate workerd reopens the same actual SQLite files and DO identity with exact table/KV/alarm state unchanged. The lease expires only by advancing the independent clock—no reset. Negotiation retains generation and cursor; continuation promotes all 102 identities, with 5 queries / 5 accepted / zero failed. Old-attempt and cross-mode in-flight pages reject before any new assignment window; the old durable receipt still replays idempotently.

That new same-store scenario was RED in both focused tests and real signed native workerd: a negotiated lease could otherwise accept a legacy-shaped page before next issued a window. The minimal correction passes the atomic control's negotiated mode into page acceptance. Both are now GREEN. Pinned v5 disk persistence uses resourcePersistencePath; the ignored legacy durableObjectsPersist key is not used as cold-restart evidence. Actual SQLite files and full before/after snapshots are retained.

Artifact: .openclaw/tmp/observation-window-fix/native-Pjnu24/result.json; SHA-256 1c1c39bf6f8c264f68dbd76fe98d238220282d573309bc7a3430d03b62c9e810. Includes exact head/tree/clean status, runtime/bundle hashes, signed clock traces and cold-restart snapshots. Contract: docs/proof/ui-live-coverage/coverage-observation-window.md. Both native proofs pass on this actual head. All 58 non-census SQL tables, KV and null alarm remain unchanged; no R2 binding / zero outbound network. Synthetic secrets/identities only. No canonical state, Store, deploy, dispatch or production writes. Coverage/Bay's changed producer boundary has current proof; its UI/math is unaffected.

Limits: cached engine differs from hosted Cloudflare; no measured live offset, hosted recovery or arbitrary historical schema-upgrade claim. The compatibility proof is specifically deployed legacy v2 → negotiated windows in the same store. Natural qualified recovery still needs monitoring after separately approved landing.

Validation / finding disposition

No merge/automerge, production mutation, Store write, workflow dispatch, reset, raw push or publisher rebinding. Future landing still requires Martin's explicit approval in the current conversation.

Worked on by

roboclaw-bot and others added 2 commits November 6, 2026 20:20
Replace cross-host completion-clock comparisons for negotiated census producers with stored metadata and per-assignment observation windows. Preserve strict legacy fallback, lease/checkpoint/identity fences, stable witnesses, and capacity bounds. Include signed native temporal red/green and rolling-compatibility proof.

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: 9c3c62ec-951b-43b0-98f9-511dba1829cf
@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.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 6, 2026 20:35
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed clawsweeper:intake:bug 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 replaces cross-host census timestamps with negotiated, stored server-issued observation windows.

Example: A successful 300 ms census query runs with the producer clock 500 ms behind the server.

  • Before: The server rejects the page with census observation window conflict.
  • After: The server accepts the page using its stored query window while retaining lease, checkpoint, and future-identity checks.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused protocol repair with meaningful native production-path evidence, resolved upgrade compatibility, and successful current-head CI.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Supplied native Linux Miniflare/workerd results exercise the real producer, signed Worker route, queue, and SQLite owner with independent advancing clocks; they report successful two-witness qualification, forbidden-window and expired-attempt rejection, and same-store legacy-v2 continuation to 102 identities. The committed harness matches these scenarios. Bulk artifacts remain local and were not independently opened; hosted recovery and the live clock offset are expressly outside the claim.
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 can remain Unknown because successful census queries fail independent-clock timestamp checks.
Reason: The maintainer-directed repair addresses a demonstrated protocol failure without expanding budgets, changing coverage math, or claiming to fix unrelated query failures.

Merge readiness

✅ Ready for maintainer review

This PR addresses a current census clock-boundary failure; the prior upgrade blocker is resolved, and no actionable introduced defect was found.

Priority: P2
Reviewed head: 6d5c05fae858d664ddd116167fdf063a82d6393e

Before merge

None.

Findings

None.

Agent review details

How this fits together

The scheduled coverage producer reads GitHub metadata and identities, sends signed census requests to the Worker, and advances a derived SQLite inventory used by coverage projections.

flowchart LR
  A[Scheduled producer] --> B[GitHub count and identity reads]
  A --> C[Signed Worker routes]
  C --> D[ExactReviewQueue]
  D --> E[Census SQLite owner]
  E --> F[Coverage projections]
Loading

Technical review

Best possible solution:

Retain the server-owned observation windows and atomic acceptance fences, then monitor qualified census recovery after approved landing.

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

Pinned main compares producer timestamps against server pass-start and receipt times; the supplied controlled runtime results reproduce rejection with a 500 ms offset, but the live offset remains unmeasured.

Is this the best way to solve the issue?

Server-owned intervals remove the independent-clock comparison at its existing owner while preserving legacy compatibility, conservative freshness, checkpoint checks, and bounded storage.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Census observation and checkpoint semantics changes intended behavior with a stated reason (2eb2e94: Require bounded, current observations and two stable witnesses before promoting resumable census data.)
  • Coverage failure classification keeps the original intent (fix: expose closed Coverage acceptance operation faults #2173: Expose closed operation and fault diagnostics while preserving original exceptions and acceptance rules.)
  • Scheduled fanout count collection keeps the original intent (8dd687f: Prioritize untracked review coverage using current open-item counts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • roboclaw-bot: Raw commit 2eb2e94 adds dashboard/review-coverage-census.ts:828 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: dashboard/review-coverage-census.ts)
  • Peter Steinberger: Raw commit 8dd687f adds src/repair/target-fanout.ts:138 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 8dd687f59bf2; 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 versus validation scope Production +219/-32; tests +208; proof code and documentation +897 Most growth exercises temporal faults, rolling compatibility, authority rejection, and same-store continuation rather than adding runtime machinery.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: Clock-boundary rejection prevents observational coverage qualification while scheduled fanout remains nonblocking.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 (1 earlier review cycle)
  • reviewed 2026-11-06T20:49:10.198Z sha afd19eb :: blocked before merge. :: none

Reviewed November 6, 2026, 4:10 PM ET / 21:10 UTC (Revision 2).

roboclaw-bot and others added 2 commits November 6, 2026 20:56
Add real workerd cold-restart proof that persisted deployed legacy-v2 checkpoints, cursors, identities and receipts load unchanged and safely continue through negotiated windows. Require the atomic lease mode before accepting any page, including legacy-shaped in-flight data before next issues a witness. Resolves the accepted data-model compatibility proof blocker without state reset or weakened legacy guards.

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: 281f1b7a-6346-42af-b919-9fd25dd6b736
@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. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 6, 2026
@obviyus
obviyus merged commit 1f655fb into main Nov 11, 2026
35 checks passed
@obviyus
obviyus deleted the openclaw/coverage-observation-window-fix branch November 11, 2026 06:24
obviyus added a commit that referenced this pull request Nov 14, 2026
* fix(review): qualify exact push relay rejection fixture

* fix: report the real checkout inspection failure reason

- Lead the read-only checkout inspection failure message with the runner error when present.
- Keep a redacted 2000-character stdout/stderr tail as context; keep stderr || stdout when no error.
- OpenClaw prints a plugin trust warning to stderr on every run, which hid every inspection reason.
- Add runner tests for OpenClaw and Codex inspection failures.

* fix: qualify the historical OCE harness origin fixture (#2197)

* test: clear dashboard token watchdog after completion (#2196)

Co-authored-by: Ryan Saari <[email protected]>

* fix: qualify exact OCE 5398 JDBC fixture revisions (#2198)

* fix(dashboard): normalize dashboard strict paths to POSIX slashes (#2177)

* fix: use server-issued census observation windows (#2174)

* fix: bound census observations with server-issued query windows

Replace cross-host completion-clock comparisons for negotiated census producers with stored metadata and per-assignment observation windows. Preserve strict legacy fallback, lease/checkpoint/identity fences, stable witnesses, and capacity bounds. Include signed native temporal red/green and rolling-compatibility proof.

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

* fix: use server-issued census observation windows

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 9c3c62ec-951b-43b0-98f9-511dba1829cf

* fix: preserve negotiated census authority across legacy upgrades

Add real workerd cold-restart proof that persisted deployed legacy-v2 checkpoints, cursors, identities and receipts load unchanged and safely continue through negotiated windows. Require the atomic lease mode before accepting any page, including legacy-shaped in-flight data before next issues a witness. Resolves the accepted data-model compatibility proof blocker without state reset or weakened legacy guards.

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

* Publish openclaw/coverage-observation-window-fix

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 281f1b7a-6346-42af-b919-9fd25dd6b736

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* fix(test): normalize test runner paths to POSIX slashes (#2176)

* fix: terminal acknowledgement test passes on a timeout instead of the real retry failure (#2199)

* test: exercise terminal acknowledgement retries without delay

* test: use the real retry helper with Retry-After: 0

The retry helper honors Retry-After, so the fixture no longer needs a
patched copy of the helper and request builder. The unchanged workflow
step and helper now run all six attempts without waiting.

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

* improve: shorten reservation workflow test runtime (#2200)

* test: avoid reservation fixture retry waits

* test: record reservation retry waits with a PATH sleep shim

Replace the BASH_ENV sleep function and the hand-maintained per-scenario
attempt table with a sleep shim on the step's PATH. Every recorded delay
is still checked against the workflow's 2n + 0..3 backoff, and the
service-unavailable scenario must record all four waits.

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(review): stop demanding proof for speculative races and in-flight revocation (#2202)

* fix(review): stop demanding proof for speculative races and in-flight revocation

Authority-chain review now triggers only on changed authorization
decisions; revocation applies to the next request; unproven authority is
no longer a merge gate. P3 findings are advisory, speculative race
machinery without recorded buy-in and preemptive single-use helpers become
findings, and AGENTS.md adopts the matching design rules.

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

* fix(review): keep advisory P3 findings out of the merge readiness gate

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

* fix(review): keep P3-only incorrect verdicts and queued repairs advisory

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

---------

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

* fix: reuse reviewed test credentials after surrounding edits (#2201)

Approve exact previously reviewed synthetic Raw/RawV2 value pairs while retaining detector, decoder, native metadata, verification, and completion checks. Remove hostname-based exemptions and keep normalized Postgres findings blocking.

Validation: full pnpm check, 32 focused tests, 28 native proof cases in an isolated UTM guest, and a clean final committed whole-branch Codex review. The maintainer explicitly waived the hosted ClawSweeper review and approved this merge in the task conversation.

* feat(review): read durable Gitcrawl cluster service context

* fix(review): validate service tokens without control regex

* fix: allow service-backed review-start reservations

* style: format service review-start reservation proof

* fix: allow service-backed review artifact publication

* feat: prepare service context before applying decisions

* fix: preserve parent identity during apply preparation

* fix: wire apply preparation to the shared relation policy

* test: cover service-backed apply and authority drift

* test: hold paired closes without prepared service context

* test: align service apply fixtures with live revision guards

* docs: explain apply preparation failure ownership

* fix: enforce apply retry guards without mutation receipts

* style: format service freshness assertion

* test: exercise service retries with a current review lease

* fix: refresh apply authority after ambiguous writes

* style: format service lease regression fixture

* test: reject exact-event retries after lease revocation

* style: format exact-event retry assertion

---------

Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Free Wortley <[email protected]>
Co-authored-by: Ryan S <[email protected]>
Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: Saiyam Jain <[email protected]>
Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: obviyus <[email protected]>
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.

2 participants