Repository navigation
refactor(cron): await standalone quarantine registration - #162192
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 1, 2026, 1:30 AM ET / 05:30 UTC (Revision 4). ClawSweeper reviewWhat this changesDoctor 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 Review scores
Verification
How this fits togetherCron 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +67, Tests +107, Docs +14, Other +6. Total +194 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
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.
|
@clawsweeper re-review Please review current head |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…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.
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.git diff --checkpassed. 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
5a356a163721also 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
0beCI 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 fix52ed106840abis 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.