Make sleep own durable memory promotion

This commit is contained in:
Meta Vens 2026-05-17 12:25:08 +01:00
commit 5df282e6b4
13 changed files with 130 additions and 44 deletions

View file

@ -111,3 +111,5 @@
{"ts":"2026-05-17T08:01:06Z","type":"implementation","status":"ok","note":"Deleted the old memory-organ script family, legacy moderation-state template, legacy moderation context exporter, and legacy moderation-state store wrapper. Active code no longer references moderation-agent-state JSON/MessagePack or moderation_runtime; typed rumination and mood smokes pass, and runner operation application now uses operation files instead of inline PowerShell JSON."}
{"ts":"2026-05-17T08:43:39Z","type":"implementation","status":"ok","note":"Added the first typed memory-maintenance replacement runner. scripts/run-void-memory-maintenance.ps1 builds a bounded typed-state context, loads prompts/void-memory-maintenance.md, permits only memory/incubation/candidate operations, and applies them through scripts/void-self-state.mjs using operation files. Build and -SkipModel smoke pass; context has no ISO timestamp leaks. Next proof is a real model-pass fixture for meaning-preserving distillation."}
{"ts":"2026-05-17T11:09:32Z","type":"implementation","status":"ok","note":"Sleep now owns memory distillation. simulate-void-mood.mjs invokes typed memory maintenance once per nap, can skip it for smoke, and records the result in mood status. run-void-memory-maintenance.ps1 marks sleep-mode pressure with sleepDirective.forceDistillation and fails real sleep passes that return no operations while memory pressure exists. Fixture smoke confirmed napping context with two concrete AquariumSynthCSharp memories sets forceDistillation=true without leaking raw timestamps."}
{"ts":"2026-05-17T11:16:42Z","type":"implementation","status":"ok","note":"Made sleep distillation a state invariant instead of a prompt preference. Typed thought memory now has shortTerm plus durable memories; rumination may only emit record_short_term_memory, while durable promotion happens through sleep-owned apply_memory_distillation. Sleep maintenance now fails a real pass if short-term memories remain afterward. Fixture smoke verified record_short_term_memory creates only short-term state and apply_memory_distillation promotes it while clearing the source."}
{"ts":"2026-05-17T11:24:20Z","type":"implementation","status":"ok","note":"Closed the durable-memory side door: removed append_distilled_memory from the typed operation schema/service, kept rumination limited to record_short_term_memory, and verified direct durable append is rejected while sleep-owned apply_memory_distillation promotes and clears short-term sources."}

View file

@ -67,7 +67,7 @@ accepted_design:
- Bot, worker, providers, and RAG remain the main structural seams.
- State storage stays intentionally split: Postgres for operational state, Qdrant for vectors, `.voidbot/` for archives, artifacts, logs, and backup material.
- Private Void self-state lives behind one polymorphic CultCache-backed `.cc` authority with typed document kinds for self profile, moderation cursor/open obligations, speech receipts, thought memory/incubation, scheduled runtime, and candidate interventions. Do not mistake typed document ownership for separate physical stores.
- Agents and scheduled runners should cross the private-state boundary with small typed mutation operations such as cursor updates, open-case upserts, receipt records, memory appends, incubation merges, and candidate-intervention changes.
- Agents and scheduled runners should cross the private-state boundary with small typed mutation operations such as cursor updates, open-case upserts, receipt records, short-term memory records, sleep-owned distillations, incubation merges, and candidate-intervention changes.
- JSON may be used for operation payloads or debug exports, but not as an editable working projection of canonical self-state.
- Deterministic cleanup code should not become a permanent organ just because recent manual cleanup requests accidentally produced compensators. The desired architecture prevents bad state from entering, then uses narrow migrations for historical debris.
- `owner_codex` and `local_llm` remain distinct lanes with different tool-execution and safety posture.
@ -135,6 +135,7 @@ landed_baseline:
- The old memory-organ cleanup/vector-incubation/agency stack, legacy state template, legacy moderation context exporter, legacy moderation-state store, and JSON projection paths are deleted or offline; replacements must be typed-operation native.
- Memory maintenance now has a typed runner boundary: `scripts/run-void-memory-maintenance.ps1` builds prompt-facing typed context, loads `prompts/void-memory-maintenance.md`, rejects non-maintenance operations, and applies allowed memory/incubation/candidate proposals through `scripts/void-self-state.mjs`.
- Sleep is the forcing function for memory distillation. `scripts/simulate-void-mood.mjs` invokes typed memory maintenance once per nap, and a real sleep pass with memory pressure must return at least one operation instead of letting yesterday's rumination residue linger.
- Rumination writes short-term memory only through `record_short_term_memory`. Durable memory is sleep-owned: short-term residue must be promoted with `apply_memory_distillation`, merged into incubation and pruned, or pruned outright before sleep completes.
- Memory cleanup now has to be meaningfully destructive. Sleep-side consolidation should translate old thought fossils into the live claim/question/fascination surface, drop templated slogan-slop, trim repo/archive/runtime residue down to a small recent evidence surface, and keep the freshest surviving records instead of accidentally embalming the oldest ones after a sort.
- Durably weird semantic kinds are guilty until proven useful. `recent-preoccupation`, `quiet-room-status`, person-singleton labels, and `live seam` boilerplate are state poison, not doctrine; typed memory ingress should reject or avoid them instead of relying on cleanup to mop later.