Repository navigation
fix(memory): preserve historical dreaming jobs until Doctor repair - #157616
Conversation
Runtime reconciliation preserves historical and ambiguous dreaming rows and manages only canonical declarations. The memory plugin classifies historical jobs, while the cron store owns non-creating inventory, verified backup, current-authority checks and atomic partition-local repair. Preserve survivor IDs, ordering and runtime state; retain custom prompts and foreign declarations. Remove the old core payload migration and runtime adoption path. Published 2026.9.6 updater-child repair, exact backup retention and repeated Doctor idempotence passed, with the landed plugin-inventory handoff repair included in the proof candidate.
|
🦞👀 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 September 25, 2026, 2:23 AM ET / 06:23 UTC (Revision 5). ClawSweeper reviewWhat this changesMemory Core moves historical dreaming-job repair into Doctor, limits runtime reconciliation to declared jobs, adds a host-backed cron repair contract, and adds upgrade coverage and documentation. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open. Current main still uses runtime cleanup for historical dreaming jobs, and the earlier installed run supports this branch’s unchanged repair code. The reconciled head still needs the published-updater upgrade proof identified in the PR body. Priority: P1 Review scores
Verification
How this fits togetherMemory Core schedules dreaming through OpenClaw’s cron store. Doctor reads persisted jobs and repairs recognized historical rows; the Gateway then reconciles the declared dreaming job. flowchart LR
A[Persisted cron jobs] --> B[Memory Core classification]
C[Doctor repair request] --> B
B --> D[Verified SQLite backup]
D --> E[Atomic cron repair]
E --> F[Gateway reconciliation]
F --> G[Declared dreaming job]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +298, Tests +1067, Docs +42, Config +1, Other +880. Total +2288 across 42 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: A published updater should preserve existing cron state and backup, repair only recognized historical dreaming rows, and leave authored jobs intact before the Gateway converges its declared job. Do we have a high-confidence way to reproduce the issue? Yes. Current-main runtime code and the published-9.6 historical-row fixture define a high-confidence path, though this read-only review did not execute it against current main. Is this the best way to solve the issue? Yes. Plugin-owned classification and host-owned backed-up repair follow the existing ownership boundary; the final upgrade path still needs validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0125ffa2849b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
The reported cross-plugin isolation boundary is not part of OpenClaw's native-plugin contract. SECURITY.md places installed/enabled native plugins in the trusted computing base with host privileges, and the execution model gives them the same process-level trust boundary as core. The existing public The existing runtime This capability deliberately delegates historical classification to eligible trusted code. The host restricts eligibility to bundled or verified official installations, requires live offline Doctor authority, revalidates the inspected definitions, verifies a backup, and commits atomically. The Memory Core owner preserves unrelated and ambiguous jobs, covered by the SQLite and packaged updater tests. Another eligible native plugin is not a forbidden principal under the documented model; the review did not identify an untrusted plugin-load, provenance, lease, or row-currentness bypass. Adding a second core classifier for legacy Memory Core rows would split the existing ownership decision. There is no SQLite schema change: no DDL, table/column change, or schema-version bump. This repairs rows in the existing Measured with The published 2026.9.6 updater/backup/idempotence proof passed on its recorded source. A focused repeat on the final prepared head remains required before merge because upstream updater inputs changed during integration. @clawsweeper re-review the updated head with this existing trust contract and the SDK clarification. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The PR now includes the passing published-updater proof for Current head The PR body keeps the unrelated 56 pre-existing docs-anchor failures explicit; no baseline or ignore was changed. The required published-updater cell passed separately. |
|
🦞👀 Re-review progress:
|
Warn about authored cron jobs that retain historical dreaming tags without blocking creation or updates of the canonical dreaming declaration. Keep Doctor responsible for recognized legacy and phase rows. Extend the registered SQLite regression and published-updater scenario to retain an independent authored tagged job through Doctor and real Gateway convergence, then verify a settled plugin reload and preserved history.
|
@clawsweeper re-review The authored-tagged P1 is fixed in The registered SQLite regression fails on the preceding head for both canonical creation and update, then passes with the repair. All 604 focused cases passed. The published This completes the missing authored-tagged stored-state/runtime proof. No schema, retention, or permission contract changed. The PR body contains the current evidence and the separate inherited CI fixes. |
|
🦞👀 Re-review progress:
|
Keep authored tagged jobs from blocking canonical scheduling, preserve Doctor ownership of historical repair, and retain both upgrade scenarios. Record schema and terminal update receipts in the published-driver fixture. The main-integrated schema 18-to-19 upgrade cell remains pending before landing; earlier production regression and package evidence is retained.
|
Merged via squash.
|
main now keeps legacy and ambiguous dreaming cron rows out of runtime reconciliation and repairs them only through `openclaw doctor --fix`; memory-core's disabled branch removes just the canonical declaration. The orphan cleanup follows the same line: it removes only the job with declarationKey memory-core:memory-dreaming-promotion and leaves every historical row in place. dreaming-cron.ts takes main's version (the key now lives in dreaming-cron-contract.ts), so the plugin-sdk re-export of MANAGED_MEMORY_DREAMING_CRON_DECLARATION_KEY is dropped again.
…penclaw#157616) * fix(memory): keep legacy dreaming cron repair in Doctor Runtime reconciliation preserves historical and ambiguous dreaming rows and manages only canonical declarations. The memory plugin classifies historical jobs, while the cron store owns non-creating inventory, verified backup, current-authority checks and atomic partition-local repair. Preserve survivor IDs, ordering and runtime state; retain custom prompts and foreign declarations. Remove the old core payload migration and runtime adoption path. Published 2026.9.6 updater-child repair, exact backup retention and repeated Doctor idempotence passed, with the landed plugin-inventory handoff repair included in the proof candidate. * docs(plugins): clarify trusted Doctor cron repair authority * test: validate dreaming cron through public plugin boundaries * fix(memory): keep authored tags from blocking dreaming Warn about authored cron jobs that retain historical dreaming tags without blocking creation or updates of the canonical dreaming declaration. Keep Doctor responsible for recognized legacy and phase rows. Extend the registered SQLite regression and published-updater scenario to retain an independent authored tagged job through Doctor and real Gateway convergence, then verify a settled plugin reload and preserved history.
What Problem This Solves
Historical dreaming cron jobs could be rewritten or removed during runtime reconciliation, while duplicates in retired cron partitions escaped complete repair. An operator-authored job retaining an old dreaming tag could also prevent canonical dreaming from being scheduled after Doctor preserved that authored job.
User Impact
Runtime manages the canonical dreaming declaration. Recognized historical jobs require
openclaw doctor --fix; authored lookalikes remain intact with an ID-specific warning and do not block canonical scheduling. Doctor repairs each persisted partition independently, preserves survivor identity, ordering, runtime history, and authored controls, and keeps a verified SQLite backup. Repeated repair is a no-op.Why This Change Was Made
Memory Core owns historical classification and survivor selection. The cron store owns non-creating inspection, backup, current-authority checks, and atomic writes. This removes the competing core payload migration and runtime adoption path. Disabling dreaming retires only explicitly declared runtime jobs; Doctor can retire recognized historical rows. This Dreaming repair introduces no schema or retention change.
Doctor follows the existing native-plugin trust model: eligible bundled or verified official plugins run with host privileges and classify their own historical rows. The shared helpers add provenance, offline authority, current-row, backup, and transaction safeguards; they do not introduce per-plugin sandbox isolation.
Evidence
36f9d0bbfc6de9296b970bad319a97fc0494cc83. Its reviewed tree iscfab07ca394a07b5a5e612bfe5a45d48ffd56c39; independent candidate and fixture reviews were clean through P2.dreaming-cron-doctorlane passed in 511 seconds, with cleanup joined. The package SHA-256 is6fd1bb9451c10a3bcc918b0024e1a00d8f43fc9d8ba88bbca9be47ee7ed07fff.[email protected]updater installed the candidate and advanced shared state from schema 18 to 19. Its complete Dreaming receipt records runc2fe6453-725a-4352-a77c-6fb802c39c44assucceeded/finished. Before any standalone Doctor or Gateway, the harness verified that packaged Doctor repaired twelve originals into seven expected rows, retained exact survivor history/order and authored controls, and kept an integrity-checked backup containing all twelve originals. Repeated Doctor changed neither rows nor backups.DREAMING_CRON_PROOFandDREAMING_CRON_RUNTIME_PROOFrecords are retained in the run'sdocker-e2e-dreaming-cron-doctorartifact.This is isolated Linux proof with manual restart mode, not automatic service-supervision proof. Raw SQLite databases and backups were not downloaded for manual inspection. Generic first-hop diagnostics are unavailable and the redacted update-output excerpt is truncated; the complete, source-audited Dreaming-specific updater/Doctor exit, schema, terminal, and runtime assertions passed.
An earlier full docs-anchor audit found 56 pre-existing broken fragments outside the changed pages with unchanged checker inputs; no baseline or ignore was changed. The earlier unrelated UI and VM-loader fixture failures were fixed by
229ab8a1and691d2e5c, both included in the tested head. No local tests, builds, or dependency installs ran on the restricted host.