diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index f433d4f..22ae5e5 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -22,10 +22,10 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - `.voidbot/` owns archives, artifacts, logs, status files, and backups. - `owner_codex` and `local_llm` are the active reply lanes. - The ordinary bot/worker/provider/RAG/Postgres/Qdrant foundation still deserves to survive. -- The moderation/mood/private-self-state foundation has been cut back to the typed store boundary. Treat it as incomplete until the scheduled phase machine and memory maintenance are rebuilt on that boundary. +- The moderation/mood/private-self-state foundation now runs on the typed store boundary. Treat it as live but still under watch until ordinary unattended rumination and sleep cycles have shown they do not produce duplicate speech, stale short-term residue, or ungrounded memory writes. - CultCache-backed self-state uses the `.cc` extension. The active store path is `.voidbot/private/void-self-state.cc`. - The smallest coherent target is one polymorphic CultCache-backed state authority with typed document kinds plus typed mutation tools: agents propose small operations, and the state service validates/applies them. Whole-state JSON editing is rejected as a durable mutation path. -- Commit-one boundary naming is now in code at `packages/core/src/void-self-state-domain.ts`: it declares the global typed document kinds and strict operation payload schemas. Runtime behavior has not moved yet. +- The typed boundary is in code at `packages/core/src/void-self-state-domain.ts`: it declares the global document kinds and strict operation payload schemas used by the live runners. - Read-only projection is now owned by `packages/core/src/void-self-state-projection.ts`. `loadVoidSelfState` is a thin loader that reads typed `.cc` documents and delegates the agent-facing summary plus nap/reply-mode projection to that module. - Typed operations are applied through `packages/core/src/void-self-state-service.ts` and `scripts/void-self-state.mjs apply-operation`. The service now writes typed documents only; it no longer registers, reads, updates, or mirrors the old moderation monolith during routine operations. - `scripts/export-recent-repo-activity.mjs` reads repo cursors from the typed `.cc` store. Legacy `.json` cursor arguments are only mapped to a sibling `.cc` path when needed by old invocation surfaces. @@ -45,7 +45,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - Agency has a typed pressure surface now: `upsert_agency_pressure` / `retire_agency_pressure` own discomforts, active tensions, self-advocacy requests, and world-advocacy requests. Candidate interventions are possible speech/actions emerging from pressure, not the pressure itself. `npm run moderation:agency-pressure:fixture` verifies the pressure enters `.cc`, renders in self-state summary, and affects mood speaking pressure. - Most of the deterministic legacy translation and retention code is recent compensator cruft from failed attempts to manually clean an exploded state file. Do not preserve it as an earned organ. Architect the state boundary so that bad state cannot enter, and keep only narrow historical migrations for old debris. - The desired agency shape is typed state operations plus derived/model-owned policy, not a permanent sermon generator in maintenance code. -- Sleep/distillation now has a runner boundary and prompt contract, but the substantive model behavior still needs live exercising. The invariant is fixed: concrete subject, claim/question, anchors, live tension, and future-action implication survive compression. Bulk can die. Meaning does not get put through the office shredder and called a dream. +- Sleep/distillation now has a runner boundary, prompt contract, fixture coverage, and one live-state pass. The invariant is fixed: concrete subject, claim/question, anchors, live tension, and future-action implication survive compression. Bulk can die. Meaning does not get put through the office shredder and called a dream. - Typed memory operations now enforce the first ingress wall for the next brain: rumination can only use `record_short_term_memory`, while sleep maintenance promotes with `apply_memory_distillation` or drops residue with `prune_short_term_memories`. Memory writes require a concrete target, claim or question, tension, action implication, and anchors unless the operation explicitly tags `anchor:missing`. This does not fix old state. It prevents new summary-only mush from being accepted as memory. - The owner Codex lane is no longer one swollen file; orchestration, runtime/parsing, rendering, and shared helpers are split under `packages/providers/src/owner-codex-*.ts`. - The local Ollama lane is no longer one swollen file; orchestration stays in `packages/providers/src/local-llm-provider.ts` while prompt/rendering, tool-loop helpers, and shared types/constants live under `packages/providers/src/local-llm-*.ts`. @@ -61,7 +61,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - Source repo discovery now reconciles automatically during `npm run stack:start` and through the watchdog path, so new repos under `SOURCE_REPO_ROOT` stop waiting for manual hook folklore before they get indexed. - Bot-directed prompts now stay in the raw Discord archive but are excluded from default semantic history indexing and lexical fallback, so repeated summons stop teaching the bot its own call-and-response loops. - Source-grounding hints are advisory now; the owner and local lanes can decide when repo or lore tool use is actually warranted instead of obeying a lexical front-door veto. -- The old 15-minute local scheduled task `Void Moderator Rumination` is disabled. Its replacement script restores rumination against `.voidbot/private/void-self-state.cc` without reviving the legacy projection path. The prompt lives in `prompts/void-moderator-rumination.md`; treat that file as a sensitive behavior surface, not incidental script text. +- The 15-minute local scheduled task `Void Moderator Rumination` is enabled against `.voidbot/private/void-self-state.cc` without reviving the legacy projection path. The prompt lives in `prompts/void-moderator-rumination.md`; treat that file as a sensitive behavior surface, not incidental script text. - The moderation loop now uses the typed context packet from `scripts/run-void-moderator-rumination.ps1`; legacy Ghostlight-shaped JSON runtime fields are not the active memory surface. - Repo-weather sweeps are now incremental rather than a rolling four-day scrapbook. `scripts/export-recent-repo-activity.mjs` advances repo activity through the typed `update_repo_activity_cursor` operation, so already-injected commits stop coming back as "news" on every heartbeat unless someone explicitly opts into `--stateless`. - Novelty still needs two bars, not one: a thought can be new to the room while still being stale to Void. The replacement design should derive that judgment from typed memory/incubation state and model reasoning, not from the deleted compensator stack. @@ -73,12 +73,12 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - The repo-weather sermon machine got a leash too. The prompt now tells Void to lead with particulars from each repo before declaring a shared law; if the convergence only exists at slogan altitude, it should keep the reports split and spare the room the faux-cosmic glue. - The moderation loop now treats direct asks to Void as persistent room obligations in typed `void.moderation_cursor.openCases`. A reviewed message is not automatically a handled message: if someone hands Void the floor, that obligation should survive cursor advancement and block optional repo-weather until Void actually answers or explicitly retires it. - If quiet-room repo weather starts repeating itself, the intended correction is not a pile of extra cooldown law. The loop should treat that as a cue to go deeper into archive history, repo docs, diffs, or lore until it finds a better branch or honestly has nothing new to say. -- The old 5-minute scheduled task `Void Mood Drift` is disabled. Its replacement script updates only typed scheduled-runtime sleep cycle and speaking pressure in `.voidbot/private/void-self-state.cc`. +- The 5-minute scheduled task `Void Mood Drift` is enabled. It updates only typed scheduled-runtime sleep cycle and speaking pressure in `.voidbot/private/void-self-state.cc`, and invokes typed memory maintenance during sleep. - CultCache files use `.cc`. Do not document or create new self-state paths with `.msgpack`; that extension was an implementation-shaped lie. - Repeated empty-room bookkeeping is low-signal. Refrains like `no new messages / no smoke / no post` should not become durable memory. - Quiet-room exploration should now prefer underworked terrain when the usual seam is saturated. `bridge.source_coverage` and `bridge.refractory_topics` exist to push the next pass toward less-chewed repo families, archive years, or channels instead of rewarding repetition with another supposedly ripe synthesis. - During naps, the moderation loop is supposed to turn inward: distill/prune memories against active goals through typed memory operations, refresh typed scheduled runtime, and only break the nap for real smoke or an unusually novel thought worth muttering into the room. -- Sleep is meant to be lossy about bulk, not about meaning. The next architecture pass must rebuild sleep/distillation so concrete repo-bound or room-bound meanings do not collapse into abstraction sludge. +- Sleep is meant to be lossy about bulk, not about meaning. The live sleep path now preserves concrete repo-bound or room-bound meaning through typed distillation; keep inspecting ordinary cycles for abstraction sludge. - Awake rumination is now supposed to do the actual philosophy from those surviving seams. The moderation doctrine tells quiet runs to begin with seam-thinking when incubation is live: ask what principle the seam is circling, what tension keeps it honest, and what embodiment consequence would cash it out before reaching for more retrieval. - Identity crystallization is still desired, but the old hard-wired path is gone. Rebuild it as model-owned judgment crossing typed self-profile, thought-memory, and candidate-intervention operations. - Crystallization is not meant to be mute. When rebuilt, it should queue typed candidate interventions when a first-person share is warranted. @@ -100,10 +100,9 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou ## Likely Next Bounded Move -- Stop feature work on moderation, mood, agency, and public-lane behavior until the private-state boundary is rebuilt. - First bounded move after the current commit: let the enabled loop run under ordinary scheduling, then inspect the next unattended awake rumination and sleep cycle for duplicate speech, stale short-term residue, or ungrounded memory writes before calling the system broadly stable. - Next cuts should delete unstable foundations early: do not revive `legacyJsonPath`, working projections, top-level mirror fields, or cleanup code that only compensated for those broken boundaries. -- Rebuild sleep/distillation before trusting it again. Fixture check: a memory like `AquariumSynthCSharp: Workflow cannot own the body` must survive sleep with its concrete subject, claim, anchor, tension, and implication intact. +- Keep sleep/distillation under watch. Fixture check: a memory like `AquariumSynthCSharp: Workflow cannot own the body` must survive sleep with its concrete subject, claim, anchor, tension, and implication intact. - Do not build adapters around the JSON projection. That is how the heap learned to stand upright and ask for snacks. ## Important Paths diff --git a/notes/voidbot-current-system-map.md b/notes/voidbot-current-system-map.md index ef27be1..31f774c 100644 --- a/notes/voidbot-current-system-map.md +++ b/notes/voidbot-current-system-map.md @@ -190,7 +190,7 @@ Within the Postgres path, the implementation is split on purpose now too: ## Flow 5: Scheduled Moderation Rumination -1. The Windows scheduled task `Void Moderator Rumination` is disabled. +1. The Windows scheduled task `Void Moderator Rumination` is enabled. 2. `scripts/run-void-moderator-rumination.ps1` reads `.voidbot/private/void-self-state.cc`, polls `node scripts/export-recent-discord-history.mjs`, and gathers read-only repo activity with `node scripts/export-recent-repo-activity.mjs --read-only`. 3. The runner writes a bounded context packet at `.voidbot/status/moderation-rumination-context.json`; the prompt-facing packet projects recent timing as relative phrases instead of raw timestamps. 4. The runner loads `prompts/void-moderator-rumination.md`, substitutes the context/state/output paths, and sends that prompt to Codex. @@ -200,9 +200,9 @@ Within the Postgres path, the implementation is split on purpose now too: 8. The runner writes `.voidbot/status/moderation-rumination.json` and `.voidbot/logs/moderation-rumination.log`. 9. It intentionally does not materialize `.json`, load `.msgpack`, read the legacy moderation monolith, or let the child edit state directly. -## Flow 6: Mood Rebuild Stub +## Flow 6: Mood And Sleep Runtime -1. The Windows scheduled task `Void Mood Drift` is disabled. +1. The Windows scheduled task `Void Mood Drift` is enabled. 2. `scripts/simulate-void-mood.mjs` reads typed documents from `.voidbot/private/void-self-state.cc`. 3. It updates `void.scheduled_runtime.sleepCycle` and `void.scheduled_runtime.speakingPressure` through `update_sleep_cycle` and `update_speaking_pressure` operations. 4. It writes `.voidbot/status/void-mood-drift.json`. diff --git a/notes/voidbot-implementation-plan.md b/notes/voidbot-implementation-plan.md index a00b562..16a3f46 100644 --- a/notes/voidbot-implementation-plan.md +++ b/notes/voidbot-implementation-plan.md @@ -4,11 +4,11 @@ This is the current forward plan for the next larger organs. It is not a changel ## Current Aim -Stop feature work on moderation, mood, and self-state until the state boundary is rebuilt. The live product goal still stands: Void should answer Discord, remember useful social/project context, retrieve GameCult history/source/lore, and run an unattended moderation/participation loop. The old implementation reached that goal through JSON projection edits, legacy mirrors, and a swollen memory organ; that path is now offline. Most of the deterministic cleanup code is recent compensator cruft: it accumulated because the live state had exploded into nonsense, and repeated "clean this file" passes preserved the mess by adding machinery around it. +The typed moderation, mood, sleep, agency, and private self-state boundary is live. The current goal is to let ordinary scheduling run, inspect the next unattended awake rumination and sleep cycle, and harden only the seams that show concrete failure. Void should answer Discord, remember useful social/project context, retrieve GameCult history/source/lore, and run an unattended moderation/participation loop without reviving JSON projection edits, legacy mirrors, or the swollen memory organ. -The next priority is to rebuild the scheduled loop and memory maintenance on the typed CultCache `.cc` state boundary so the compensator pile is unnecessary. Agents and scheduled workers should mutate typed CultCache-backed state through explicit tools/APIs, not by editing a whole-state JSON working copy. Sleep and memory distillation must also be redesigned from first principles so they preserve meaning-bearing claims/anchors/tensions instead of collapsing them into generic slogan paste. +The next priority is observational hardening of the enabled typed loop. Agents and scheduled workers mutate typed CultCache-backed state through explicit operations, not by editing a whole-state JSON working copy. Sleep and memory distillation now preserve meaning-bearing claims/anchors/tensions in fixture and live-state passes; keep checking ordinary cycles for abstraction sludge, duplicate speech, stale residue, or self-orbiting memories. -The center of the next pass is prevention, not legacy repair. The old brain can be treated as evidence of a failed boundary. The new brain should reject malformed memory at ingress so the runtime never needs a permanent cleanup bureaucracy to recover basic meaning. +The center remains prevention, not legacy repair. The old brain is evidence of a failed boundary. The new brain rejects malformed memory at ingress so the runtime does not need a permanent cleanup bureaucracy to recover basic meaning. ## Smallest Coherent Architecture @@ -178,19 +178,18 @@ The runner can hand these to a CLI/MCP tool. The store decides what survives. - The bot/worker/provider/RAG/Postgres/Qdrant shape is basically sound. - Source archive sharding is sound. - Interaction memory being Postgres-backed is sound. -- The private moderation/self-state foundation is not sound: - - the active `.cc` store is typed, but the real phase machine is not rebuilt yet - - the old scheduled tasks are disabled instead of replaced with full typed behavior - - legacy projection/mirror state may still exist on disk as failed-boundary residue and must not become source material for the rebuild +- The private moderation/self-state foundation is live on typed `.cc` state: + - the enabled moderation and mood scheduled tasks use typed runners + - legacy projection/mirror state may still exist on disk as failed-boundary residue and must not become source material - the old memory organ and legacy moderation-state wrapper have been removed from the codebase; their translation, retention/compaction, identity crystallization, candidate intervention, and value-pressure behavior must not be revived as compatibility scaffolding -- the scheduled moderation runner has a typed rumination contract again: bounded context in, reviewed prompt template, typed operation payloads out, parent-owned cursor/receipt recording +- the scheduled moderation runner has a typed rumination contract: bounded context in, reviewed prompt template, typed operation payloads out, parent-owned cursor/receipt recording - recent event timing in that bounded context now crosses a projection boundary first, so the child sees "5 minutes ago" language while the parent keeps exact timestamps for bookkeeping - the old memory-organ script family, legacy moderation state template, and legacy context exporter have now been deleted instead of preserved as forensic bait - deterministic cleanup is mostly recent scar tissue from failed manual cleanup passes; it should stay deleted rather than be ported unless a future typed operation protects a real invariant in the new model - hard-wired agency policy is mostly current scaffolding, not the final authority; identity, advocacy, and speech candidates should emerge from typed memory/state operations plus model-owned judgment under validation -- sleep/distillation now has a typed maintenance runner and reviewed prompt boundary wired into the sleep phase; it still needs real model-pass hardening before the old scheduled task should be re-enabled unattended +- sleep/distillation has a typed maintenance runner, reviewed prompt boundary, fixture coverage, and one live-state pass proving short-term residue can become durable memory without losing meaning -Verdict: stop feature work and rebuild this foundation. The rest of the machine can keep running, but moderation/mood/self-state work should cut toward typed state tools before adding new behavior. +Verdict: the foundation is coherent enough for cautious live operation. Do not add behavior by widening prompts or reviving compensators; harden only failures observed in ordinary scheduled cycles. ## Migration Plan @@ -239,9 +238,9 @@ Verdict: stop feature work and rebuild this foundation. The rest of the machine ### Commit 6.5: Keep Old Scripts Offline - `Void Mood Drift` has been deliberately reinstalled after the typed sleep-maintenance fixture passed. It runs `scripts/run-void-mood-drift.ps1`, which calls the typed `scripts/simulate-void-mood.mjs` path. -- Re-enable `Void Moderator Rumination` only after typed operation quality and parent-owned speech closure have passed. The runner now has both a model-branch fixture and a parent-owned speech fixture; the first live scheduled pass still needs inspection before the loop is treated as stable. +- `Void Moderator Rumination` is re-enabled after typed operation quality, parent-owned speech closure, and an observed live scheduled pass. The runner has model-branch, parent-owned speech, and nap-skip fixtures. - Do not reinstall or re-enable deleted legacy scripts as compatibility surfaces. -- Verification: scheduled-task query shows mood enabled with Last Result `0`, moderation disabled, and rebuilt direct dry runs operate only on `.voidbot/private/void-self-state.cc`. +- Verification: scheduled-task query shows mood and moderation enabled with Last Result `0`, and rebuilt direct dry runs operate only on `.voidbot/private/void-self-state.cc`. ### Commit 7: Harden Scheduled Runner As A Phase Machine diff --git a/state/map.yaml b/state/map.yaml index c654344..51fef34 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -56,7 +56,7 @@ data_flow: active_subgoals: - Make the new project-state surfaces the default continuity path for nontrivial VoidBot work. - - Rebuild the moderation/self-state foundation so canonical CultCache `.cc` documents are mutated only through typed operations, never through an editable JSON working projection. + - Keep the rebuilt moderation/self-state foundation on canonical CultCache `.cc` typed operations, never an editable JSON working projection. - Keep the typed moderation and mood scheduled tasks enabled after the first observed live rumination pass and a manual live sleep-maintenance pass both completed cleanly; the next work is ordinary hardening, not keeping legacy scaffolding alive. - Keep legacy moderation mirrors, whole-state projection commits, and deleted memory-organ compensators from re-entering the active path before adding more moderation, mood, agency, or public-lane behavior. - Keep public-lane limits, moderation, and provider behavior constrained enough that one 4060 Ti box does not get flayed for sport. @@ -130,7 +130,7 @@ landed_baseline: - State storage is now split into a thin factory plus per-domain Postgres/file store modules and bootstrap/migration helpers instead of one persistence omnibus. - Source archive storage is now sharded by repo behind a manifest plus per-repo shard directory instead of one giant `source-documents.json` blob. - Source repo indexing now reconciles automatically during stack startup and watchdog runs, refreshing hooks, indexing newly discovered repos, and pruning stale repo shards when repos disappear from `SOURCE_REPO_ROOT`. - - The old `Void Moderator Rumination` and `Void Mood Drift` scheduled tasks are disabled. Their replacement entry scripts are typed-only: moderation now builds a bounded context packet with prompt-facing relative chronology, runs the reviewed rumination prompt from `prompts/void-moderator-rumination.md`, and applies typed operation payloads; mood updates typed sleep/speaking pressure in `.voidbot/private/void-self-state.cc`. + - The typed `Void Moderator Rumination` and `Void Mood Drift` scheduled tasks are enabled. Moderation builds a bounded context packet with prompt-facing relative chronology, runs the reviewed rumination prompt from `prompts/void-moderator-rumination.md`, applies typed operation payloads, and skips during naps when there is no room debt; mood updates typed sleep/speaking pressure and invokes memory maintenance during sleep. - The active self-state service no longer registers, reads, or writes the legacy moderation document during routine operations. - 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`.