Skip to content

refactor(cron): await quarantine observations in Doctor - #162091

Merged
steipete merged 1 commit into
mainfrom
codex/cron-quarantine-observations-20260930
Sep 30, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cron-quarantine-observations-20260930

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Doctor's Cron health and repair observations still executed quarantine SELECTs on the caller thread.

User Impact

The observations now await the existing SQLite reader. Reports, quarantined records, query ordering, schema errors, and missing-database behavior remain unchanged. No configuration, schema, retention, or SDK contract changes are required.

Why This Change Was Made

The three callers use one private cron.quarantine operation with the existing query and payload decoder. The reader retains its original source, snapshot, and cleanup ownership. A small Cron dispatcher groups the existing six read operations without changing their native execution frame. Existing quarantine tests have their own file, sharing the unchanged store fixture.

This completes the quarantine observation path. Doctor repair writes and the synchronous message/source authority guards remain separate migration work.

Evidence

  • Real Doctor health checks reproduced two caller-thread quarantine SELECTs in both warm and cold runs; both now pass with zero such queries and the same persisted finding.
  • Store/Doctor owners: 171 passing cases. Final dispatch and ownership receiving: 86 passing cases. The extracted store tests pass 69 cases; these scopes overlap.
  • Blacksmith Linux/Node 24.19: all 10 CLI process cases passed, including doctor --fix, subsequent Gateway readiness, and preserved invalid Cron records and retired plugin sidecars. Source-bound remote run. The lease was stopped. This proof precedes the final equivalent dispatch-type narrowing and private test-type correction; the final local receiving covers those changes.
  • Fresh isolated P0–P2 review is clean. Core and all 27 test type graphs pass; selected source checks are complete through a recorded lint-and-remaining-check continuation after correcting the dispatcher’s exhaustive fallback. Runtime and type-inclusive import graphs are cycle-free.

The local CLI process attempt was refused before execution by the managed-artifact separation guard, so its runtime preparation and proof used the isolated runner. The separate published-driver cell below covers the installed-updater boundary; installed updater markers, persisted representations, and migration writes remain unchanged.

Published updater and current CI

The maintained legacy-operator-state cell passed with published [email protected] upgrading to the candidate package built from the exact 1ec30baf source tree. It preserved both Cron jobs, their effective owners, successful histories and transcripts; the candidate Gateway passed health/readiness/status and a mock turn. The no-op update, clean Doctor lint, formerly bundled plugin Doctor check, and backup rollback also passed. The lane completed in 392 seconds with its unchanged maintained budgets. Blacksmith proof run. Package SHA-256: 6b853fc902458dac5b6d507e5df285e2ee5e40ef23e3de0fbe56fbbeec1ebca7.

The remote source capsules use generated carrier commits whose trees were verified against the exact PR tree; those carriers are retained as such, not relabeled as the signed PR commit. An initial invocation refused before baseline installation because it mixed the original PR commit with the registry carrier stamp. Correcting that invocation to the verified execution carrier preserved all source and package guards. No product, assertion, or timeout changes were made.

This survivor scenario does not seed nonempty Cron quarantine records; the warm/cold Doctor and isolated CLI tests above cover their preservation separately.

Exact-head CI remains cancelled after one first-sign-in test assertion failed; seven sibling jobs were cancelled. All seven actual job logs were inspected without finding another failed assertion, but interrupted and unrun tails remain unverified. The independent first-sign-in diagnosis is in progress; this is not a passing-CI claim.

Move health, repair reporting, and legacy repair preparation onto the existing
shared-state read worker. Keep the ordered quarantine query, payload decoder,
source and snapshot ownership, and schema errors unchanged.

Group the existing Cron read dispatch in its domain and separate quarantine
store tests while preserving their assertions and shared fixture.

Prove warm and cold Doctor observations without caller-thread quarantine SQL,
existing store and dispatch contracts, and the real Doctor-to-Gateway process
flow on isolated Linux. Preserve schemas, retention, and migration writes.
@clawsweeper

clawsweeper Bot commented Sep 30, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: L labels Sep 30, 2026
@steipete
steipete marked this pull request as ready for review September 30, 2026 19:58
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 30, 2026, 4:58 PM ET / 20:58 UTC (Revision 2).

ClawSweeper review

What this changes

Moves Doctor’s Cron quarantine observations to the shared SQLite read worker while retaining the Cron store’s ordered query and payload decoder.

Merge readiness

✅ Ready for maintainer review

Current main still performs Doctor’s Cron quarantine observation on the caller thread, so this PR remains useful. The introduced worker path has no identified correctness defect. The cited upgrade and Doctor evidence addresses the prior review’s concern in combination; exact-head CI remains subject to normal landing gates.

Priority: P2
Reviewed head: 1ec30baf1db23eebfeed493019501524f16421a2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a coherent owner boundary and relevant Doctor and upgrade evidence, with no concrete defect found.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR body reports warm and cold Doctor runs that retained a persisted quarantine finding while removing caller-thread SELECTs, plus an exact-tree published-updater candidate cell that preserved existing Cron jobs and reached Gateway readiness. The updater cell did not contain nonempty quarantine, but the direct Doctor cases exercised that changed data path. Linked Testbox logs could not be fetched through the review proxy. No stored-data representation changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR body reports warm and cold Doctor runs that retained a persisted quarantine finding while removing caller-thread SELECTs, plus an exact-tree published-updater candidate cell that preserved existing Cron jobs and reached Gateway readiness. The updater cell did not contain nonempty quarantine, but the direct Doctor cases exercised that changed data path. Linked Testbox logs could not be fetched through the review proxy. No stored-data representation changes.
Evidence reviewed 6 items Introduced behavior: The pinned PR changes the quarantine read to an awaited shared-state worker request and keeps the ordered diagnostic-events query and JSON decoder in the Cron store.
Current main still needs the change: Fetched main still calls the synchronous quarantine reader from both Doctor observation sites.
Doctor boundary coverage: The added warm and cold Doctor cases persist a quarantined job, assert its finding, and observe no caller-thread diagnostic-events SELECT.
Findings None None.
Security None None.

How this fits together

Doctor checks scheduled jobs and their quarantine records in OpenClaw’s shared SQLite state. Its findings inform operators and repair preparation, while the Cron store continues to own quarantine writes.

flowchart LR
  A[Doctor health and repair] --> B[Cron quarantine request]
  B --> C[Shared SQLite read worker]
  C --> D[Ordered quarantine query]
  D --> E[Quarantined job records]
  E --> F[Doctor findings and repair preparation]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +59, Tests +71, Docs +7. Total +137 across 24 files.

View PR surface stats
Area Files Added Removed Net
Source 14 140 81 +59
Tests 9 181 110 +71
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 24 328 191 +137

Review metrics

Metric Value Why it matters
Code and test growth production +59 net lines; tests and test support +71 net lines Production growth is explained by the Cron read dispatcher and worker boundary; the test growth includes moved quarantine coverage.

Technical review

Best possible solution:

Keep Doctor’s quarantine reads on the shared worker, with ordered records, schema errors, missing-database behavior, and repair ownership preserved.

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

Yes, from source: current main’s Doctor path calls the synchronous quarantine SELECT, and the PR adds warm and cold Doctor checks for that boundary. I did not execute the checkout.

Is this the best way to solve the issue?

Yes. Reusing the admitted SQLite reader while leaving the Cron query and writer with their existing owner is a narrow solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 33513de8d98a.

Labels

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This bounded Doctor and Cron reliability refactor improves an existing diagnostic path without evidence of an urgent 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 (linked_artifact): The PR body reports warm and cold Doctor runs that retained a persisted quarantine finding while removing caller-thread SELECTs, plus an exact-tree published-updater candidate cell that preserved existing Cron jobs and reached Gateway readiness. The updater cell did not contain nonempty quarantine, but the direct Doctor cases exercised that changed data path. Linked Testbox logs could not be fetched through the review proxy. No stored-data representation changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports warm and cold Doctor runs that retained a persisted quarantine finding while removing caller-thread SELECTs, plus an exact-tree published-updater candidate cell that preserved existing Cron jobs and reached Gateway readiness. The updater cell did not contain nonempty quarantine, but the direct Doctor cases exercised that changed data path. Linked Testbox logs could not be fetched through the review proxy. No stored-data representation changes.

Evidence

What I checked:

  • Introduced behavior: The pinned PR changes the quarantine read to an awaited shared-state worker request and keeps the ordered diagnostic-events query and JSON decoder in the Cron store. (src/cron/store/quarantine.ts:52, 1ec30baf1db2)
  • Current main still needs the change: Fetched main still calls the synchronous quarantine reader from both Doctor observation sites. (src/commands/doctor/cron/index.ts:177, 33513de8d98a)
  • Doctor boundary coverage: The added warm and cold Doctor cases persist a quarantined job, assert its finding, and observe no caller-thread diagnostic-events SELECT. (src/cron/store.readonly-worker.test.ts:19, 1ec30baf1db2)
  • Stored contract: The read uses the existing Cron quarantine scope and sequence ordering; the PR does not change the quarantine writer or persisted row shape. (src/cron/store/quarantine.ts:52, 1ec30baf1db2)
  • Previous review and upgrade proof: The prior completed review requested a published-updater candidate check with existing quarantined Cron state. The updated PR body reports a published 2026.9.6 updater against the exact candidate tree, preserving existing Cron jobs and Gateway readiness, and separately reports warm/cold Doctor checks with persisted quarantine. The upgrade cell did not seed nonempty quarantine; these two checks cover the updater boundary and changed data path separately. The linked Testbox workflow metadata is cancelled after lease shutdown, and its logs were unavailable through the review network proxy.
  • Feature history: A prior merged Cron read-worker change introduced the retained current-receipt result line; its recorded parent lacks that line. Earlier Cron quarantine work also appears in path history. (src/state/openclaw-state-read.types.ts:363, 4a6d9aa0eae0)

Likely related people:

  • Peter Steinberger: Raw commit 4a6d9aa adds src/state/openclaw-state-read.types.ts:361 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4a6d9aa0eae0; files: src/state/openclaw-state-read.types.ts)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-30T20:05:45.314Z sha 1ec30ba :: blocked before merge. :: none

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 30, 2026
@steipete
steipete merged commit d845735 into main Sep 30, 2026
319 of 330 checks passed
@steipete
steipete deleted the codex/cron-quarantine-observations-20260930 branch September 30, 2026 21:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
)

Move health, repair reporting, and legacy repair preparation onto the existing
shared-state read worker. Keep the ordered quarantine query, payload decoder,
source and snapshot ownership, and schema errors unchanged.

Group the existing Cron read dispatch in its domain and separate quarantine
store tests while preserving their assertions and shared fixture.

Prove warm and cold Doctor observations without caller-thread quarantine SQL,
existing store and dispatch contracts, and the real Doctor-to-Gateway process
flow on isolated Linux. Preserve schemas, retention, and migration writes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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