diff --git a/docs/architecture/voidbot-routine-adoption-plan.md b/docs/architecture/voidbot-routine-adoption-plan.md new file mode 100644 index 0000000..472a211 --- /dev/null +++ b/docs/architecture/voidbot-routine-adoption-plan.md @@ -0,0 +1,151 @@ +# VoidBot Routine Adoption Plan + +VoidBot now has the best live reference for the agent routine Ghostlight needs: +work or rumination on heartbeat, periodic sleep for consolidation, typed +MessagePack persistence through a CultCache-style contract, and vector-backed +memory resonance. Ghostlight should adopt the routine without inheriting +VoidBot's moderation job. + +## Imported Organs + +- **Heartbeat scheduler:** chooses work, rumination, or sleep/consolidation from + readiness, load, status, reaction windows, and pending turns. +- **Completion-gated cooldown:** a participant cannot act again until its + previous heartbeat turn finishes; recovery starts at completion. +- **Sleep cycle:** scheduled naps are not absence. They compress memory, + strengthen useful associations, cool saturated themes, refresh dreams, and + keep direct speech rare. +- **CultCache persistence:** canonical state is MessagePack, routed by typed + document definitions, with JSON working projections for inspection/review. +- **Vector memory:** memories carry semantic vector metadata and Qdrant points + so recall, resonance, incubation, and dreams are grounded in retrievable + structure. +- **Thought organs:** analytic lane, associative lane, bridge, memory resonance, + incubation, and candidate intervention/dream queues. + +## Ghostlight Translation + +Ghostlight's swarm is the cast. The heartbeat initiative system therefore +applies directly to characters taking turns within a scene, not merely to +background maintenance workers. + +There are two scopes using the same timing law: + +- **scene heartbeat:** selects which in-scene character acts, reacts, waits, + hesitates, refuses, speaks, withholds, moves, or uses an object. +- **maintenance heartbeat:** wakes offstage agents, cast records, coordinator + organs, appraisers, mutators, and fixture builders for rumination, sleep + consolidation, or reviewed maintenance. + +The point is one initiative physiology with different arenas, not two unrelated +schedulers wearing each other's hat. + +```text +heartbeat initiative + -> choose scene participant or maintenance organ + -> scene turn | reaction | wait | rumination | sleep + -> read typed state from CultCache-compatible store + -> optional Qdrant recall / memory resonance + -> produce visible action, event, appraisal, mutation, dream, or maintenance receipt + -> completion starts cooldown + -> write canonical MessagePack + JSON working projection +``` + +## Persistence Shape + +Ghostlight can start with the CultCacheTS contract directly for Node-side tools, +but the Python-heavy validator/tooling surface needs a compatible file contract: + +- canonical store: single-file MessagePack envelope array +- envelope: `key`, `type`, `payload`, `storedAt` +- schema owner: code definitions, not hand-edited loose JSON +- working projection: JSON, human-readable, safe for review, optionally stripped + of bulky vector values +- write discipline: use an external lock or one coordinator writer; the + single-file store is not a database wearing a fake mustache + +Initial document types: + +- `ghostlight.agent_state` +- `ghostlight.scene_state` +- `ghostlight.initiative_schedule` +- `ghostlight.scene_heartbeat_state` +- `ghostlight.training_loop_bundle` +- `ghostlight.runtime_heartbeat_state` +- `ghostlight.memory_resonance` +- `ghostlight.sleep_cycle` + +## Memory Vector Shape + +Qdrant becomes the retrieval layer for agent memory, not canonical social truth. + +Each memory-like record should keep: + +- stable memory id +- kind: episodic, semantic, relationship, goal, value, musing, dream, + scene-memory, appraisal, mutation, or lore-grounding +- summary text used for embedding +- source hash +- embedding backend/model/dimensions +- Qdrant point id and collection +- salience/confidence/update time +- source refs into fixtures, lore, or reviewed artifacts + +Ghostlight's existing training docs already point toward retrieval-backed memory. +This plan makes it operational instead of aspirational, the traditional route +by which a research note stops being furniture. + +## Sleep Behavior + +During sleep turns: + +- do not generate ordinary scene turns unless the character is actually in the + scene and selected by the scene heartbeat +- inspect memory resonance clusters and incubation entries +- merge duplicate memories +- prune stale or low-confidence residue +- create or refresh at least one dream only when it compresses a useful seam +- update `sleep_cycle.activeDreamThemes`, `lastDreamAt`, and + `lastDistillationSummary` +- write a maintenance receipt for review + +Dreams are compressed operational memory, not glitter. If a dream survives, the +next waking turn should be more coherent because of it. + +## Migration Slices + +1. **Contract fixture** + - Add a small CultCache-compatible MessagePack fixture and validator. + - Prove Python can read/write the envelope without losing schema shape. + +2. **Runtime heartbeat schema** + - Add `schemas/runtime-heartbeat-state.schema.json`. + - Include pending turn, sleep cycle, rumination, and completion receipts. + +3. **Agent state migration** + - Keep current JSON examples as projections. + - Add canonical MessagePack test store for one small agent-state fixture. + +4. **Memory resonance** + - Add a local memory-organ script that embeds memory summaries, writes Qdrant + points, builds resonance edges/clusters, and writes incubation state. + +5. **Sleep receipt** + - Add a sleep/consolidation artifact schema and validator. + - Require sleep receipts to name pruned/merged/strengthened memories. + +6. **Training-loop integration** + - Promote scene initiative schedules into the same heartbeat contract used + by the swarm. + - Let characters take scene turns through heartbeat initiative, then route + appraisal/mutation/coordinator maintenance through the same completion and + cooldown law. + +## Boundaries + +- Do not make Qdrant canonical truth. +- Do not store raw vector blobs in every human working projection. +- Do not let sleep turns mutate accepted training fixtures without reviewed + maintenance receipts. +- Do not make every Ghostlight character into a background daemon before the + runtime heartbeat store can prove who is awake, asleep, pending, or complete. diff --git a/notes/ghostlight-current-system-map.md b/notes/ghostlight-current-system-map.md index aaa979c..b6b2479 100644 --- a/notes/ghostlight-current-system-map.md +++ b/notes/ghostlight-current-system-map.md @@ -169,6 +169,13 @@ reaction windows; it does not decide what the actor wants or how other participants appraise the event. Every affected participant still appraises and mutates before the scheduler selects the next projected actor. +VoidBot's newer heartbeat routine is the reference shape for turning that seam +into a living swarm routine. For Ghostlight, the swarm is the cast: the same +heartbeat initiative law selects characters taking turns within a scene, while +offstage or maintenance heartbeats handle rumination, sleep consolidation, +memory resonance, and reviewed upkeep. See +`docs/architecture/voidbot-routine-adoption-plan.md`. + ## Pruned Receipts Old prototype fixture receipts and model-runner files have been removed diff --git a/notes/ghostlight-implementation-plan.md b/notes/ghostlight-implementation-plan.md index 6638b1c..192a990 100644 --- a/notes/ghostlight-implementation-plan.md +++ b/notes/ghostlight-implementation-plan.md @@ -43,6 +43,10 @@ not carry live next-action lists. - Training readiness is per organ. A receipt-complete scene loop does not automatically count as branch compiler, IF reviewer, visual artifact, or accepted full-fixture coverage. + - Adopt VoidBot's heartbeat routine as the cast initiative substrate: + characters take scene turns through heartbeat initiative, cooldown starts + after turn completion, and offstage agents use slower rumination/sleep + turns for memory consolidation instead of generating fake scene motion. 4. Keep the Pallas fixture as the current scaffold reference. - Current fixture set: diff --git a/state/evidence.jsonl b/state/evidence.jsonl index c1de2bc..12206f8 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -62,3 +62,4 @@ {"ts": "2026-05-05T00:31:04+00:00", "type": "implementation", "status": "ok", "note": "Enabled Corvid visual replay plan and visual-enabled review receipts. Explicit hatch_3c_state plus a draft Blackbox Aviary 3C scene_set fixed branch spatial leakage; narrative/lore/spatial/visual reviewers now accept the fixture as draft, with visual artifacts recorded as collateral rather than core model training data."} {"ts": "2026-05-05T00:49:06+00:00", "type": "implementation", "status": "ok", "note": "Rebuilt a reusable BFL image batch script after the old runner had been cleaned out. Corvid BFL test generated 16 ignored local images from succinct abstract prompts; one proof prompt moderated until simplified, confirming Flux prompt batches should avoid emotionally loaded/ambiguous safety language and keep one strong visual symbol per frame."} {"ts": "2026-05-05T01:04:51+00:00", "type": "implementation", "status": "ok", "note": "Published Corvid Collective First Exodus to AetheriaLore as a cinematic illustrated Ink page. Site player now supports data-ink-mode=cinematic with section click-through, background image crossfades, animated text transitions, hidden state chips by default, and cohesive branch-card choices."} +{"ts": "2026-05-06T00:25:00+00:00", "type": "architecture", "status": "ok", "note": "VoidBot's new routine should become Ghostlight's cast swarm timing and memory substrate: characters take scene turns through heartbeat initiative, offstage agents use slower rumination/sleep turns for consolidation, canonical state moves toward CultCache-style MessagePack with JSON projections, and memory resonance/incubation/dream state should be backed by Qdrant vectors. Captured the plan in docs/architecture/voidbot-routine-adoption-plan.md."} diff --git a/state/map.yaml b/state/map.yaml index d3ee385..261f102 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -80,6 +80,7 @@ live_architecture: - Actions carry scale, recovery, initiative cost, interruptibility, commitment, and local affordance basis. - Reaction windows are event-triggered opportunities with eligible actors, urgency, expiry, and allowed action scales; they are not automatic responses or hidden-state access. - Coordinator overrides must record a reason before the artifact can claim training value. + - VoidBot's newer heartbeat routine is the reference for turning this seam into the cast swarm's live timing law: characters take scene turns through heartbeat initiative, cooldown begins after turn completion, and offstage agents use slower rumination/sleep turns for memory consolidation, resonance, incubation, and dreams. See `docs/architecture/voidbot-routine-adoption-plan.md`. coordinator: - The coordinator is a trainable soft organ: it stages scenes, chooses next beats and acting agents, invokes specialist machinery, carries unresolved hooks, emits glue prose, and proposes game-engine-shaped state changes. - Future coordinator turns should be sandboxed as their own promptable worker outputs, with exact visible input, raw output, parsed coordinator artifact, review labels, and interventions preserved. Codex acts as meta-coordinator: it scopes, launches, reviews, repairs, and wires Ghostlight organs, but should not silently collapse the trainable coordinator organ back into omniscient chat.