feat(reconsolidation): mutate memories on retrieval, gated against distortion#27
Merged
Merged
Conversation
…stortion Adds a `drift` salience signal. When an entry is genuinely used this turn (the Tier-2 / `used_helpfully` moment), the Librarian may reconsolidate it — integrate a new qualifier from the use-context, sharpen it, or, if it has grown mixed-topic, split it into linked entries. Guards against the Bridge & Paller (2012) distortion mode: a Scholar claim-preservation gate (veto if the load-bearing claim weakens or it is mere churn) plus a `reconsolidated` / `last_reconsolidated` counter so the Scholar tightens on much-churned entries. Size is managed structurally by the Librarian's reactive split, not a per-entry char cap: growth only happens on use, and use is the same moment the Librarian reads the full entry and can decompose it — so an entry cannot silently balloon without the curator being right there able to split it. - _schemas: add `drift` to the salience-signal enum - librarian_prompt: drift classification — integrate / sharpen / split-on-sprawl - scholar_prompt: drift review block — claim-preservation, split-not-cram - scholar_executor: increment + stamp the reconsolidation counters on drift updates; preserve them across ordinary rewrites - tests: reconsolidation counter bookkeeping - README: flip the reconsolidation roadmap row to shipped, cite Bridge & Paller (2012); drop the stale double-install blockquotes from quick start Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the reconsolidation pathway from the README roadmap: retrieved memories become labile and are re-stored mutated. Adds a
driftsalience signal so that when an entry is genuinely used this turn (the Tier-2 /used_helpfullymoment), the Librarian may reconsolidate it.The design is built to harness the update half of reconsolidation while defending against the distortion half — Bridge & Paller (2012), "every retrieval is a partial re-write that measurably distorts." (Now cited in the README references.)
How it works
read_entryreturns it untruncated) and may propose adriftupdate_entry.reconsolidated/last_reconsolidatedcounter — tracks cumulative mutation so the Scholar tightens on much-churned entries. Preserved across ordinary rewrites; incremented + stamped on drift updates.Design notes
An earlier iteration used a deterministic non-growth size cap; it was removed because (a) the corpus already holds 24 KB entries, so a flat cap would brick the biggest ones, and (b) growth and split-opportunity share the same use-trigger, so the curator-driven split is sufficient. The residual risk is prompt-quality ("does the split instruction fire reliably"), which is tunable and observable via the counter. An optional deterministic size→split backstop is left as a documented TODO.
Files
_schemas.py—driftadded to the salience-signal enumlibrarian_prompt.py— drift classification (integrate / sharpen / split-on-sprawl)scholar_prompt.py— drift review block (claim-preservation, split-not-cram)scholar_executor.py— reconsolidation counter bookkeepingtests/test_scholar_executor.py— counter testsREADME.md— roadmap row flipped to shipped + Bridge & Paller reference; stale double-install quick-start blockquotes removedVerification
ruff + pyright (source) clean, duplicate-code gate passes, full daemon suite 662 passed, coverage 90.45%.
🤖 Generated with Claude Code