Repository navigation
refactor(memory): simplify provenance and dreaming flows - #131318
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 8:42 PM ET / August 28, 2026, 00:42 UTC. ClawSweeper reviewWhat this changesThe PR removes duplicated memory provenance, dreaming-phase, and indexing plumbing while correcting documentation to describe SQLite-backed dreaming state. Merge readinessKeep open: no introduced correctness or security defect was found, but this unmerged maintainer PR still needs its exact-head CI and promised CLI smoke before normal landing review. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherMemory Core records recall and provenance state for workspace and session content, then uses it during dreaming, search, and forget operations. The refactor stays inside the memory plugin’s state, locking, and index-publication paths. flowchart LR
A[Workspace and session content] --> B[Memory indexing]
B --> C[SQLite-backed provenance state]
C --> D[Light and REM dreaming]
D --> E[Dream diary and reports]
C --> F[Search and forget]
G[Memory plugin configuration] --> B
G --> D
Before merge
Agent review detailsSecurityNone. PR surfaceSource -135, Docs 0, Other -1. Total -136 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single in-plugin storage, phase, and prepared-index paths, then merge after exact-head CI and a narrow built-CLI smoke confirm the behavior-neutral refactor. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR does not claim a new user-visible defect; existing deterministic race tests cover the retained memory-publication invariants. Is this the best way to solve the issue? Yes: removing forwarding-only wrappers and sharing the existing store and phase flow is the cleanest owner-local simplification while retaining the locking and transaction boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4e33639bef29. 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
|
|
Merged via squash.
|
…1318) * refactor(memory): simplify provenance and dreaming flows * chore(memory): prune removed assertion baseline
Related: #130451, #131179, #131248.
What Problem This Solves
Maintainer-requested cleanup of the recent memory provenance work. The deletion safeguards are necessary, but repeated store plumbing, parameter forwarding, and phase orchestration made the surrounding code larger and harder to follow.
Why This Change Was Made
Reuse the existing bounded distinct-value merger, share recall/phase store I/O, remove normalization already performed by the store reader, and centralize light/REM outcome and error handling. Pass each prepared index entry directly into its locked commit and remove the forwarding-only index methods.
The workspace locks, synchronous index transaction, tombstone checks, file-snapshot validation, and shadow-publication revision checks retain their existing scope and order. Retry evidence and consolidation-history cleanup from the newer repairs are untouched.
Production: +291 / −426 (net −135 lines) across seven files. Tests: unchanged. Documentation: two corrected references to SQLite-backed dreaming state.
User Impact
No intended runtime behavior, public API, configuration, schema, retention, or migration change. Dreaming documentation now describes where machine state actually lives.
Evidence
3838707ee977d7a3eb4465ef12465d24f40eb1a2.c5f642a0126de8bb9d4df755e4a3d5943c86e5d3, whose parent is the exact PR head and whose touched sources and dependency manifests match. Providernoneexercises real local FTS and SQLite behavior; this is not live-model proof. No mocks or operator Gateway changes.node scripts/check-changed.mjsrun also passed (completed after merge): production/test extension typechecks, extension/script lint, formatting, boundary/dependency guards, assertion baseline, three unused-export scans, five doctor-contract tests, storage/media/runtime-loader guards, and zero runtime import cycles.The initial broad check caught the obsolete assertion-baseline entry after two casts were removed; the entry is now pruned. The first CLI fixture used an unsupported
memory.search.syncfield and correctly failed config validation; the fixture was corrected before the complete 12-command run. Neither correction changed runtime behavior.