Skip to content

refactor(cron): await standalone quarantine registration - #162192

Merged
steipete merged 5 commits into
mainfrom
codex/cron-quarantine-writes-20260930
Oct 1, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/cron-quarantine-writes-20260930

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Doctor registered standalone legacy Cron quarantine records synchronously on its caller thread while the corresponding observations already used the state worker.

User Impact

Doctor now archives a legacy quarantine file only after durable registration completes. A refused batch leaves the source available for repair. Recovery fields, record order, first quarantine timestamps, and retention stay unchanged; there is no new configuration, schema, or public SDK contract.

Why This Change Was Made

The standalone caller captures and serializes its input, then awaits the existing Cron worker. One database-taking kernel keeps full-store saves atomic inside their existing transaction. Transaction and commit admission retain the original captured maintenance and database authority.

Evidence

The current head incorporates main through a genuine two-parent merge. Its own production delta matches reviewed 0be19ed81077: +165/-91, net +74 lines, including 7 tooling lines; runtime source alone is +158/-91, net +67. Main's delivery-start routing stays intact. The Doctor conflict keeps main's shared setup and local factories, awaits the quarantine seed, and preserves caller-thread SQL observation in the consolidated archive-retry case. The unused extracted factory is removed, and two existing crontab-warning cases now live in their owning warning suite. The existing inventory generator refreshed stale main-intake counts and locations.

Current-source local proof on Darwin / Node 26.10.0:

  • pnpm test src/commands/doctor/cron/index.test.ts src/commands/doctor/cron/legacy-repair.test.ts src/cron/store.quarantine.test.ts src/cron/store.readonly-worker.test.ts --maxWorkers=1: 53 passed, 466.62s wall including cold compilation. This covers the awaited seed, actual Doctor SQL observation, native authority revocation, rejected-batch rollback, retained recovery files, and readonly-worker siblings.
  • pnpm test src/commands/doctor/cron/warnings.test.ts --maxWorkers=1: 12 passed, 74.51s wall including transform. Two cases moved from the preceding run, so these counts overlap. The unchanged surviving Doctor cases reuse their completed proof.
  • Selected changed checks: passed with exit 0, including the commands-doctor and services-cron type graphs, typed lint, all three dead-export scans, formatting, and selected guards. The original line-cap failure was caused by the added SQL observation and fixed by relocating existing warning coverage, without deleting assertions or relaxing the cap. The raw-temp-directory report for the previously reviewed refusal fixture remains warning-only.
  • Inventory generation/check, docs discovery, formatting, and git diff --check passed. Independent P2 reviews passed for the full PR delta, the test relocation, and the generated snapshot. Commit-review mode rejects merge commits; the full PR review used branch mode against the pinned main parent instead.

Retained product proof: the real standalone Doctor SQL assertion failed on original source and passed after the cutover. The earlier final quarantine/Doctor suites passed 82 cases; transaction-entry and pre-commit authority controls failed on the incomplete implementation and passed after its correction. Exact product head 5a356a163721 also passed 10 real Doctor-process cases on Linux and a maintained published-2026.9.6 to candidate legacy-operator-state update cell: 44 phases in 355s, including updater/Cron ownership, Gateway/Doctor checks, and backup rollback. The cell uses synthetic provider traffic and does not seed a nonempty quarantine specimen; the standalone and rejection/recovery tests cover that input. The optional first-hop diagnostic was unavailable. A local post-run source capture failed when the old checkout disappeared; the remote source guard and successful terminal result remain valid. These older package tests are reused for unchanged PR runtime logic, not claimed as a rebuilt current-head package.

Product-head CI passed. The earlier 0be CI attempt was cancelled after the updater module-outcome fixture failed on a missing backup-path helper. All 112 cancelled logs were inspected without another failed verdict; incomplete tails remain unverified. Canonical fixture fix 52ed106840ab is included in this merge's main parent. Historical admin evidence is not reused for the new head; Current-head CI completed successfully, and ClawSweeper completed its exact-head review with no actionable code or security findings.

Other Doctor fingerprint/metadata transaction hooks and synchronous final-effect authority remain separate work. This PR does not claim universal Cron SQL elimination.

Compatibility-proof disposition: the generic ClawSweeper checkbox is satisfied by the published-2026.9.6 upgrade and rollback proof: 44 completed phases in 355 seconds, with the nonempty-quarantine limitation stated above and covered by the direct Doctor/rejection tests. The reviewed cutover preserves the existing scope, identity fields, serialized payload, first timestamp, ordering, and retention; the completed review independently confirms that no schema or stored-data migration is introduced.

@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: M labels Sep 30, 2026
@steipete
steipete marked this pull request as ready for review September 30, 2026 22:52
@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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 1, 2026, 1:30 AM ET / 05:30 UTC (Revision 4).

ClawSweeper review

What this changes

Doctor moves standalone recovery-record registration to the existing Cron database worker and waits for completion before archiving the legacy file.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR remains useful: current main still performs standalone quarantine registration synchronously. The reviewed cutover preserves recovery semantics, and no blocking introduced defect remains.

Priority: P2
Reviewed head: c9fdd3397da4967e11c62b65d814285a3361d502

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported worker cutover with preserved recovery contracts and no blocking review findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Recorded Doctor-process and published-driver update results supplement direct production-path SQL, rejected-batch, and revoked-authority controls. The changed quarantine runtime remains unchanged from the proven product head; later changes reconcile fixtures and inventory. No stored-data model changes require migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded Doctor-process and published-driver update results supplement direct production-path SQL, rejected-batch, and revoked-authority controls. The changed quarantine runtime remains unchanged from the proven product head; later changes reconcile fixtures and inventory. No stored-data model changes require migration.
Evidence reviewed 11 items Pinned introduced changes: Reviewed the pinned merge-base-to-head changes. The actual checkout is the original PR head; the stale test merge was not used to infer removal of current-main behavior.
Captured authority reaches native admission: Registration serializes input before awaiting, retains the original database and maintenance admission, and checks current authority again after settlement. Worker dispatch requests admission after transaction entry and immediately before commit.
Archive ordering and rejected-batch recovery: Doctor awaits standalone registration before reaching archival. The added real-SQLite rejection case verifies rollback of the entire batch, unchanged source bytes, no archive on refusal, and successful subsequent recovery.
Findings None None.
Security None None.

How this fits together

Cron quarantine preserves malformed scheduled jobs for operator recovery. Doctor imports legacy recovery files into SQLite, then archives the source after durable registration succeeds.

flowchart TD
  A[Legacy recovery file] --> B[Doctor repair]
  B --> C[Capture recovery records and authority]
  C --> D[Cron database worker]
  D --> E{Transaction and commit admitted}
  E -->|Yes| F[Durable recovery records]
  F --> G[Archive legacy file]
  E -->|No| H[Keep source and report warning]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +67, Tests +107, Docs +14, Other +6. Total +194 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 7 158 91 +67
Tests 5 147 40 +107
Docs 2 512 498 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 2 7 1 +6
Total 16 824 630 +194

Review metrics

Metric Value Why it matters
Production and test growth runtime +158/-91, net +67; tests +147/-40, net +107; tooling +7 Runtime growth supports captured worker admission and one shared transactional kernel; tests cover refusal, revocation, input capture, and Doctor recovery.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/database-worker-inventory.mjs, migration/backfill/repair: src/commands/doctor/cron/legacy-repair.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Use the existing Cron worker for standalone registration while retaining the shared synchronous kernel inside atomic full-store repairs.

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

Yes: current-main source directly establishes caller-thread standalone registration, and the recorded Doctor SQL control targets that boundary. This review did not execute a reproduction.

Is this the best way to solve the issue?

Yes: the patch extends the existing worker and reuses the persistence kernel without adding a competing store, configuration surface, or migration.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded Cron storage improvement with recovery coverage and no demonstrated urgent user-facing regression.
  • 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. Sufficient (live_output): Recorded Doctor-process and published-driver update results supplement direct production-path SQL, rejected-batch, and revoked-authority controls. The changed quarantine runtime remains unchanged from the proven product head; later changes reconcile fixtures and inventory. No stored-data model changes require migration.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded Doctor-process and published-driver update results supplement direct production-path SQL, rejected-batch, and revoked-authority controls. The changed quarantine runtime remains unchanged from the proven product head; later changes reconcile fixtures and inventory. No stored-data model changes require migration.

Evidence

What I checked:

  • Pinned introduced changes: Reviewed the pinned merge-base-to-head changes. The actual checkout is the original PR head; the stale test merge was not used to infer removal of current-main behavior. (c9fdd3397da4)
  • Captured authority reaches native admission: Registration serializes input before awaiting, retains the original database and maintenance admission, and checks current authority again after settlement. Worker dispatch requests admission after transaction entry and immediately before commit. (src/cron/store/quarantine.ts:34, c9fdd3397da4)
  • Archive ordering and rejected-batch recovery: Doctor awaits standalone registration before reaching archival. The added real-SQLite rejection case verifies rollback of the entire batch, unchanged source bytes, no archive on refusal, and successful subsequent recovery. (src/commands/doctor/cron/legacy-repair.ts:401, c9fdd3397da4)
  • Existing persistence contract retained: The extracted kernel preserves the partition scope, identity hash fields, serialized recovery payload, first timestamp, legacy sequence ordering, and unlimited recovery retention. Full-store saves invoke that kernel inside their existing transaction; no schema or stored-data model changes were introduced. (src/cron/store/quarantine.kernel.ts:24, c9fdd3397da4)
  • Retained production proof and current regression coverage: The captured PR body reports a Doctor caller-thread SQL control failing before the cutover and passing afterward, native transaction-entry and pre-commit revocation controls, 10 real Linux Doctor-process cases, and a published-2026.9.6-to-candidate update cell completing 44 phases in 355 seconds. The update cell did not contain a nonempty quarantine specimen; the production-path quarantine and Doctor tests cover that input, rejection, and recovery. Current-source focused runs report 53 and 12 passing cases with disclosed overlap and wall times. These are contributor-recorded observations; this read-only review executed no tests. (src/cron/store.quarantine.test.ts:32, c9fdd3397da4)
  • Re-review continuity: The preceding completed review had no remaining findings. The quarantine facade, kernel, full-store save integration, and changed Doctor production module are unchanged from that reviewed head. The prior inventory finding is addressed by the generator classification and refreshed snapshot; warning coverage is relocated without dropping assertions. (scripts/database-worker-inventory.mjs:114, c9fdd3397da4)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: 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 (3 earlier review cycles)
  • reviewed 2026-09-30T22:59:03.821Z sha 5a356a1 :: blocked before merge. :: [P2] Regenerate the SQLite worker inventory for the moved queries
  • reviewed 2026-10-01T03:01:08.499Z sha 0be19ed :: blocked before merge. :: none
  • reviewed 2026-10-01T03:27:21.155Z sha 0be19ed :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 1, 2026
@clawsweeper clawsweeper Bot added 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 1, 2026
Merge main while preserving its shared Doctor fixture setup and local job factories. Await the quarantine seed and retain caller-thread SQL observation in the consolidated archive-retry case. Remove the unused extracted test factory. The PR production delta is unchanged.
Move the existing warning cases to their owning suite while preserving their assertions. This leaves room for the quarantine SQL regression under the Doctor fixture line-count ratchet and avoids unnecessary SQLite fixture setup.
Regenerate the existing inventory from the merged source. Keep the quarantine classification and PR production delta unchanged.
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review current head c9fdd3397da4967e11c62b65d814285a3361d502. The automatic enqueue runs failed with control-plane HTTP 500/timeouts; the source proof and merge-resolution details are in the updated PR body.

@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 93636c9 into main Oct 1, 2026
212 of 214 checks passed
@steipete
steipete deleted the codex/cron-quarantine-writes-20260930 branch October 1, 2026 05:35
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

* refactor(cron): await standalone quarantine registration

* docs(db): refresh quarantine worker inventory

* test(cron): colocate legacy crontab warning coverage

Move the existing warning cases to their owning suite while preserving their assertions. This leaves room for the quarantine SQL regression under the Doctor fixture line-count ratchet and avoids unnecessary SQLite fixture setup.

* docs(sqlite): refresh worker inventory after main merge

Regenerate the existing inventory from the merged source. Keep the quarantine classification and PR production delta unchanged.
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. scripts Repository scripts size: M 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