Plan VoidBot routine adoption
This commit is contained in:
parent
577617e927
commit
fb2fa89e86
3 changed files with 150 additions and 0 deletions
148
notes/voidbot-routine-adoption-plan.md
Normal file
148
notes/voidbot-routine-adoption-plan.md
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
# VoidBot Routine Adoption Plan
|
||||
|
||||
VoidBot has grown the reference agent routine Epiphany should steal without
|
||||
cosplaying as a Discord moderator. The useful organs are:
|
||||
|
||||
- heartbeat turns that choose work, rumination, or sleep/consolidation
|
||||
- cooldown that starts after a heartbeat turn completes, not when it launches
|
||||
- nap windows for memory consolidation, pruning, dream residue, and incubation
|
||||
- canonical MessagePack state through a CultCache-style typed document store
|
||||
- editable JSON working projections that strip or preserve large vector payloads
|
||||
deliberately
|
||||
- code-owned schemas instead of schema drift hiding in loose files
|
||||
- semantic memory vectors in Qdrant with source hashes and compact dimensions
|
||||
- memory resonance, incubation queues, analytic/associative thought lanes, and a
|
||||
bridge that decides speech, draft, hold, or silence
|
||||
|
||||
## Target Shape
|
||||
|
||||
Epiphany should treat this as a shared agent routine substrate, not as another
|
||||
specialist lane. The substrate owns scheduling, persistence, and memory
|
||||
maintenance; the coordinator owns authority.
|
||||
|
||||
```text
|
||||
coordinator pressure / user objective / swarm messages
|
||||
-> heartbeat scheduler
|
||||
-> work turn | rumination turn | sleep turn
|
||||
-> typed state read through CultCache-compatible store
|
||||
-> optional Qdrant memory recall / resonance
|
||||
-> bounded result, selfPatch, statePatch, dream, or callback
|
||||
-> completion receipt starts cooldown
|
||||
-> canonical MessagePack write + JSON working projection
|
||||
```
|
||||
|
||||
## Scheduler Contract
|
||||
|
||||
Heartbeat state keeps:
|
||||
|
||||
- participant identity, role, speed, load, status, readiness, reaction bias, and
|
||||
pending turn
|
||||
- pacing policy with work recovery, idle recovery, sleep multiplier, and
|
||||
completion-gated cooldown
|
||||
- sleep cycle state: enabled, cadence, nap duration, current nap, next nap,
|
||||
dream count, active dream themes, and last distillation summary
|
||||
- history of work, rumination, sleep, completion, and refused-repeat events
|
||||
|
||||
Turn kinds:
|
||||
|
||||
- `work`: coordinator-approved lane work, specialist result, Face surface, or
|
||||
implementation continuation.
|
||||
- `rumination`: role-local memory hygiene, selfPatch, stale habit detection, or
|
||||
low-pressure thought incubation.
|
||||
- `sleep`: inward maintenance. The agent should distill/prune memory, strengthen
|
||||
resonance clusters, update incubation, write or refresh dreams, and speak only
|
||||
through Face if something genuinely needs to surface.
|
||||
|
||||
No lane may receive another heartbeat while `pending_turn.status == running`.
|
||||
The completion receipt is the only normal path that starts cooldown. This is the
|
||||
part that keeps the heart from turning into a tiny manager with a stopwatch and
|
||||
no shame.
|
||||
|
||||
## Persistence Contract
|
||||
|
||||
Epiphany needs a Rust version of the CultCache contract because the app-server
|
||||
and `epiphany-core` are Rust and should not route core state through a Node
|
||||
helper just to persist its own mind.
|
||||
|
||||
Minimum Rust surface:
|
||||
|
||||
- `DocumentType<T>`: type id plus serde/schema metadata.
|
||||
- `CultCacheEnvelope`: `{ key, type, payload, stored_at }`.
|
||||
- `BackingStore`: `pull_all`, `push`, `delete`, optional `push_all`.
|
||||
- `SingleFileMessagePackBackingStore`: atomic whole-file MessagePack store with
|
||||
external lock expectation.
|
||||
- `CultCache`: register types, load stores, validate payloads through typed
|
||||
serde structs, get/get_required/get_all/put/update/delete/snapshot.
|
||||
- JSON working projection helpers for operator inspection and manual review.
|
||||
|
||||
The schema should live in annotated Rust structs using serde plus generated JSON
|
||||
Schema where useful. MessagePack is canonical. JSON is the window, not the
|
||||
house.
|
||||
|
||||
Initial document types:
|
||||
|
||||
- `epiphany.thread_state`
|
||||
- `epiphany.role_agent_state`
|
||||
- `epiphany.heartbeat_state`
|
||||
- `epiphany.face_state`
|
||||
- `epiphany.swarm_message`
|
||||
- later: planning, graph checkpoint, memory resonance, incubation, dreams
|
||||
|
||||
## Vector Memory Contract
|
||||
|
||||
Epiphany already has Qdrant/Ollama retrieval for workspace source. Extend that
|
||||
pattern to agent memory:
|
||||
|
||||
- collection namespace: `epiphany_memory_<instance_id>`
|
||||
- point id: stable memory id or hash of document type/key/path
|
||||
- vector model: default `qwen3-embedding:0.6b`
|
||||
- payload: agent id, role id, memory kind, source hash, schema version, summary,
|
||||
salience, confidence, updated time, source refs
|
||||
- canonical MessagePack state stores vector metadata and optionally compact
|
||||
inline vectors; Qdrant stores the retrieval vector
|
||||
- JSON working views may strip vector values while preserving metadata
|
||||
|
||||
Memory resonance is not proof. It is "these things rhyme" evidence for
|
||||
rumination, Face surfacing, and sleep consolidation.
|
||||
|
||||
## Migration Slices
|
||||
|
||||
1. **Contract extraction**
|
||||
- Add Rust CultCache-compatible module in `epiphany-core`.
|
||||
- Add fixtures proving MessagePack round-trip, typed serde/schema validation,
|
||||
and JSON working projection.
|
||||
|
||||
2. **Heartbeat state migration**
|
||||
- Move `state/agent-heartbeats.json` into a typed MessagePack document with a
|
||||
JSON working projection.
|
||||
- Add `sleep_cycle`, `memory_resonance`, and `incubation` fields.
|
||||
- Keep the current CLI contract stable while the backing store changes.
|
||||
|
||||
3. **Role memory migration**
|
||||
- Store each Ghostlight-shaped role dossier as `epiphany.role_agent_state`.
|
||||
- Keep per-role JSON projections for human inspection and git review.
|
||||
- Attach semantic vector metadata to episodic, semantic, relationship, goal,
|
||||
value, musing, and dream entries.
|
||||
|
||||
4. **Memory organ**
|
||||
- Add a bounded memory maintenance command that embeds missing memory vectors,
|
||||
refreshes Qdrant points, builds resonance edges/clusters, updates
|
||||
incubation, and writes dream residue during sleep turns.
|
||||
|
||||
5. **Coordinator integration**
|
||||
- Coordinator sees heartbeat sleep state, pending turns, resonance summaries,
|
||||
and memory maintenance results.
|
||||
- Coordinator may route work, accept/refuse selfPatch, or let the swarm sleep.
|
||||
|
||||
6. **Aquarium visibility**
|
||||
- Expose sleep state, dreams, resonance clusters, incubating thoughts, and
|
||||
pending turns as inspectable Aquarium surfaces.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- Do not replace CRRC compaction yet.
|
||||
- Do not make Qdrant canonical truth.
|
||||
- Do not let sleep turns edit implementation code.
|
||||
- Do not auto-accept specialist findings because a dream sounded good.
|
||||
- Do not build a general database shrine before the typed MessagePack seam
|
||||
proves it deserves to live.
|
||||
|
|
@ -80,3 +80,4 @@
|
|||
{"ts": "2026-05-05T13:30:33+00:00", "type": "documentation", "status": "ok", "note": "Amended the pseudo-Epiphany migration prompt so sandbox runs produce reviewable typed-state seed candidates for planning roadmaps, backlog, objective drafts, graph/model candidates, evidence, and checkpoints in addition to role self-memory patches."}
|
||||
{"ts": "2026-05-05T15:10:00+00:00", "type": "architecture", "status": "ok", "note": "Persisted swarm-boundary doctrine into root prompt surfaces: Epiphany instances may expose their own internals richly, but cannot inspect/edit other workspaces; cross-agent blockers travel coordinator-to-coordinator through visible swarm messages; humans converse through Face while sub-agents communicate through typed coordinator lanes. API contracts must mirror those user-story contracts."}
|
||||
{"ts": "2026-05-06T00:08:00+00:00", "type": "implementation", "status": "ok", "note": "Heartbeat pacing now supports deferred turn completion: `tick --defer-completion` leaves a lane in-flight and `complete --role ...` starts cooldown only after the heartbeat turn finishes. Idle/no-work heartbeats use a sleep multiplier so the swarm continues slow rumination and memory distillation without waking every lane at work tempo."}
|
||||
{"ts": "2026-05-06T00:25:00+00:00", "type": "architecture", "status": "ok", "note": "VoidBot's new routine should become the reference Epiphany agent substrate: work/rumination/sleep heartbeats, completion-gated cooldown, typed MessagePack persistence through a Rust CultCache-compatible contract, JSON working projections, Qdrant-backed memory vectors, resonance/incubation/dream organs, and Aquarium-visible internals. Captured the migration plan in notes/voidbot-routine-adoption-plan.md."}
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ accepted_design:
|
|||
- Epiphany prompt surfaces now carry a shared Ghostlight-derived persistent memory projection before lane-specific text: prompt is not memory, durable typed state is the mind, personality and protected values are first-class salience handles, and every lane is explicitly responsible for making its own memory/model/prompt/evidence habit sharper or naming the needed repair. Each lane also states that self-improvement in its own role language: Imagination selects futures, Body clarifies anatomy, Eyes sees earlier, Hands touches source more precisely, Soul becomes harder to fool, Life loses less continuity, Self routes repair, and Face becomes clearer at turning inner weather into useful social presence.
|
||||
- Specialist self-memory now has a bounded Ghostlight-shaped persistence surface under `state/agents`: Imagination, Body, Eyes, Hands, Soul, Life, Self, and Face each have an individual role dossier for identity, personality, semantic/episodic/relationship memory, goals, and values. These files are lane memory only; project truth remains in authoritative `EpiphanyThreadState`.
|
||||
- `state/agent-heartbeats.json` and `tools/epiphany_agent_heartbeat.py` are the first Ghostlight-derived heartbeat initiative seam. The harness sets a target heartbeat rate; participants carry initiative speed, next-ready time, reaction bias, interrupt threshold, current load, status, and constraints; pending coordinator work can pull its owning lane through a reaction window; otherwise the earliest ready active lane wins the slot. If the winner has no routeable work, it ruminates on role quality and may apply a bounded selfPatch through the normal coordinator-reviewed memory rules. Face can win `surfaceAgentThoughts` or `discordAquariumChat` work slots.
|
||||
- VoidBot's current routine is the reference for the next Epiphany heartbeat/state substrate: work, rumination, and sleep turns; completion-gated cooldown; MessagePack canonical state through a CultCache-compatible typed store; JSON working projections; Qdrant-backed memory vectors; resonance/incubation/dream state; and Aquarium-visible internals. See `notes/voidbot-routine-adoption-plan.md`.
|
||||
- `state/face-discord.json` and `tools/epiphany_face_discord.py` are the first Face Discord boundary. Face may interact only through #aquarium; missing or mismatched channel configuration produces candidate chat artifacts instead of posting elsewhere.
|
||||
- `tools/epiphany_agent_heartbeat.py status`, the `heartbeat` block in `tools/epiphany_mvp_status.py`, and GUI actions `heartbeatStatus` / `runHeartbeat` are the first operator API surface for heartbeat initiative state and outputs. `runHeartbeat` advances one slot and emits a Discord-independent Face bubble artifact.
|
||||
- `tools/epiphany_face_discord.py bubble`, the `face` block in `tools/epiphany_mvp_status.py`, and GUI action `faceBubble` are the first Aquarium bubble surface. Face can open a local chat bubble artifact even when Discord channel id/token configuration is absent.
|
||||
|
|
|
|||
Reference in a new issue