From 7c7ca51cc9f5b5567a2b7d377c914467e98e6233 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 6 Dec 2026 02:56:59 +0100 Subject: [PATCH] docs: add persistent-persona-map authority map and model page --- docs/persistent-persona-map.md | 88 ++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 docs/persistent-persona-map.md diff --git a/docs/persistent-persona-map.md b/docs/persistent-persona-map.md new file mode 100644 index 0000000..97870f3 --- /dev/null +++ b/docs/persistent-persona-map.md @@ -0,0 +1,88 @@ +# Persistent Sandboxed Persona Session — Architecture & Authority Map + +Status: **Imagination architecture map (`eureka-body`, base `f6fc66b`)** +Campaign rulings: `eureka-body:ruling:persistent-persona-session-public-matrix`, `eureka-body:ruling:dual-mode-cli-turn-boundary`, `eureka-body:ruling:identity-write-all-visible`, `eureka-body:ruling:cli-over-mcp-agent-surface`, `eureka-body:ruling:live-mind-sessions`, `eureka-substrate:ruling:recall-lives-in-huginn-no-cli-json`. + +--- + +## 1. Live Body Facts & Mechanism Probes (`2026-12-06`) + +### 1.1 `agy` / Hydrogen CLI Substrate +- **Starfire (`localhost`):** `agy` is **not installed** (`Get-Command agy` empty). Desktop Antigravity `2.38.0` (`C:\Users\Meta\AppData\Local\Programs\antigravity\Antigravity.exe` + `resources\bin\language_server.exe`) and `claude` `2.1.312` (`C:\Users\Meta\AppData\Roaming\npm\claude.ps1`) are present. `C:\Users\Meta\.gemini\antigravity\bin\agentapi.bat` invokes `language_server.exe agentapi`, whose `--help` exposes only `get-conversation-metadata`, `new-conversation`, and `send-message` — desktop agent RPC rather than a headless streaming runner with token telemetry. +- **Yggdrasil (`ssh yggdrasil`):** Neither `agy`, `antigravity`, `gemini`, nor a global `claude` exists on `PATH`. `/opt/` holds `actions-runner`, `claude-code/2.1.312`, `commons`, `containerd`, `gamecult`, `node-v24.14.1-linux-x64`, `rust`, and `venvs`; `/usr/local/bin/huginn` points to `/opt/gamecult/huginn/current` (`f6fc66b7e876b70a0be9c0e0d6b8e894b5df5138`). +- **Antigravity CLI docs (`antigravity.google`, unprobed locally):** Document an `agy` installer (`install.sh`), `-p`, `-c`/`--continue`, `--conversation `, `--output-format text|json|stream-json`, `/compact`, and `hooks.json` (`PreToolUse`, `SessionStart`). Exact headless auth under `mind-`, `stream-json` token-usage payload keys, and auto-compaction suppression hooks remain **unverified until `agy` is installed and probed on Yggdrasil** (first prerequisite step in `eureka-body:follow_up:persistent-persona-hydrogen-prototype`). + +### 1.2 Huginn `persona` CAS & Door Path (`GameCult/Huginn` @ `f6fc66b`) +- `crates/huginn-mind/src/wire.rs:439-453`: `PersonaGet` and `PersonaPut` return `true` from `reaches_persona_door()`, so `--bind` (`10.77.0.1:17872..17879`) and `--persona-bind` (`10.77.0.1:18872..18879`) serve them identically, while `Admit` refuses with `NotThisDoor`. +- `crates/eureka-state/src/lib.rs:120-140`: `HuginnClient::persona_get` and `HuginnClient::persona_put(provenance, state, expected_updated_at)` already exist over CultNet RUDP. +- `crates/huginn-mind/src/persona.rs:122-131`: public `validate_document(instance, state)` enforces schema compliance (`gamecult.persona_state.v0.schema.json`, P1), `personaId == instance` (P2), and `provenance.authority == "canonical"` (P3). Daemon admission (`crates/huginn-mind/src/admission.rs:257-310`) enforces P4 (`expected_updated_at == stored_updated_at`) and P5 (`new updatedAt > stored updatedAt`). +- **Live `eureka` store probe (`10.77.0.1:17872`):** `huginn whoami` reports `documents 26077 receipts 12838`, `persona stored updatedAt=2026-12-02T13:45:15.457852052+00:00`. Live `eureka` `persona_state.v0` holds 5 `values`, 19 `memories` (including 4 legacy privacy-marked entries carrying `extensions.privacy = "private"` and `"private"` tags), 5 `shortTerm` (with `room:#swarm:gamecult.org`), 4 `incubation`, 2 `agencyPressure`, 22 `candidateActions` (`actionType: "custom"`, `customActionType: "intention"`), 9 `socialBonds`, 14 `moodDimensions`, 4 `needs`, 3 `doctrineStances`, `embodiment`, and `privateNotes`. +- **CLI gap:** `crates/eureka-state/src/bin/huginn/main.rs:244-264` implements only `persona get` and whole-doc `persona put` (`eureka-body:follow_up:huginn-cli-persona-verbs` predates `get|put` having landed). No surgical delta verbs (`memory`, `bond`, `mood`, `intention`) or public-Matrix `seed` renderer exist yet. Pre-existing `eureka-body:follow_up:persona-put-records-door` tracks daemon door attribution independently. + +### 1.3 Matrix Mouth & Live Yggdrasil Sandbox/Brake State +- **Matrix mouth CLI surface:** No standalone Matrix CLI (`mind-chat` or `huginn chat send`) exists yet. `huginn chat search|window` (`crates/eureka-state/src/bin/huginn/main.rs:168-171`) queries Huginn's Qdrant chat index only. Live Matrix `/sync`, `pending`, `ack`, `read`, `send` (`v1..v3`), `open_direct`, and attachment fetch exist only behind Bifrost's `persona-matrix-mouth.mjs` RUDP server (`127.0.0.1:17884`, `BIFROST_CHAT_KEY_FILE`) spoken by `crates/mind-body/src/chat_rudp.rs`. +- **Live brakes (`2026-12-06` Yggdrasil read):** `/etc/gamecult/minds/swarm.cc` is **HELD** (`released = false`, `2026-12-02T13:49:10Z`), whereas all eight `/etc/gamecult/minds//control.cc` stores are **RELEASED** (`released = true`: `eureka` at `2026-10-31T10:01:08Z`, seven peers at `2026-12-02T05:12:30Z`). +- **Consequence in Bifrost mouth:** `Bifrost/tools/persona-matrix-mouth.mjs:1276` builds its `brake` reader solely from `/control.cc` and does **not** read `swarm.cc`. Today all eight Matrix accounts stay synced as `unavailable` and buffer deliveries while `swarm.cc` keeps `mind-heartbeat.service` (`heartbeat.rs:21`) and `mind-persona@.service` (`ExecCondition=mind-control --instance %i check`) inert. +- **UID & network fence (`mind-fence.service`, `/etc/gamecult/minds/fence.nft`):** + - `persona` chain (`mind-` UIDs): permits `10.77.0.1` UDP only to that Mind's `--persona-bind` port (`18872..18879`), `127.0.0.1:17884` UDP (Bifrost mouth), `127.0.0.1:4110` TCP (connector), `127.0.0.1:3310` TCP (forge proxy), TCP `80,443`, and public internet; rejects other loopback, RFC1918, Tailscale (`100.64.0.0/10`), link-local, and peer full Huginn doors. + - `box` chain (`mind-%i-box` UIDs behind `mind-box-%i.socket`): permits public internet only; rejects all loopback (`127.0.0.1`), local addresses, Huginn doors, and Bifrost mouth. `crates/mind-body/src/sandbox.rs:35-59` configures `bwrap` (`--ro-bind / /`, private `/tmp` and `/run`, `/etc/gamecult` and `/var/lib` masked by tmpfs, `--unshare-pid`). + +--- + +## 2. Identity / Lifecycle / Authority Table (Persistent Kinds) + +| Persistent Kind & Store | Authoritative Owner | Writers | Lifecycle & Pruning / Rotation | +|---|---|---|---| +| **Canonical Persona State** (`gamecult.persona_state.v0` in Huginn `HuginnPersonaEntry` keyed by ``) | `huginn-mind` (`admission.rs` P1-P5 CAS) | Cut 1: `huginn persona` (`put`, `memory add/retire`, `bond update`, `mood set`, `intention add/drop`), Self/Life puts, legacy `mind-persona` close until retired. | Survives forever across sessions. Every write runs `validate_document` (`P1-P3`) and stamps `updatedAt > stored_updated_at` (`P4-P5`). Delta verbs never mutate identity fields or purge legacy private notes; `huginn persona seed` filters legacy `private`/`room:!` entries read-only at bootstrap. | +| **Persona Session Transcript & Conversation ID** (Prototype: `agy` conversation store + host metadata in `STATE_DIRECTORY`; Legacy: `agent-session.cc`) | Persona host wrapper (`mind-persona-hydrogen@` once built) | Host wrapper on session open, `--conversation` resume, and flush-and-clear rotation; sandboxed `agy` child appends turns. | **Derived cache, never memory.** Reused across incoming messages while cumulative tokens remain below host ceiling (~150k-160k tokens) and idle < sweep bound. At trigger: host asks Persona to commit desired deltas via `huginn persona`, verifies commit, clears/rotates session id, and rebootstraps via `huginn persona seed`. | +| **Matrix Mouth Cursor & In-Flight State** (`state` under `/var/lib/gamecult/bifrost/persona-matrix-mouth`) | `persona-matrix-mouth.service` (`bifrost` user) | Solely `persona-matrix-mouth.mjs` on `/sync`, `ack`, `send`, `openDirect`. | `nextBatch`, `seq`, and pending delivery list persist across restarts. In-memory follow rings/caps reset on restart (fail-safe shortening). Cursor advances only after `ack`. | +| **Driver Chat Backstops & Trace** (`STATE_DIRECTORY`: per-room consecutive Mind-line count, UTC daily turn count, delivered/acked ids) | Persona host wrapper | Host wrapper before turn dispatch and after `mind-chat` send/ack receipts. | Persists per-UTC-day turn count and per-room consecutive Mind-line count across restarts. Kept strictly out of `persona_state.v0` so transport counters never churn `updatedAt`. | +| **Identity-Diff Audit Events** (`identity-write-all-visible`, review room `#operator:gamecult.org`) | Persona host / `mind-persona` ledger + Matrix mouth | Cut 1: **Forbidden** on delta verbs (`memory`, `bond`, `mood`, `intention` never modify identity/values). Legacy: `persona.rs:945-988` `identity_diff` rows in `persona-trace.cc`. | Any future CLI/driver identity delta verb must record a pending diff (`publicName`, `publicDescription`, `presentation`, `values`) and post through the mouth (`MIND_PERSONA_REVIEW_ROOM`) on the same commit path. | +| **Operator Brakes & UID Fence** (`/etc/gamecult/minds/swarm.cc`, `/control.cc`, `fence.nft`) | Operator / `mind-control` + `mind-fence.service` | Root admin only (`UnsafeStore` on non-root/group-writable). | Fail-closed snapshot reads (`control::read_effective`). `swarm.cc` gates legacy fleet (`mind-heartbeat`, `mind-persona@*`); `/control.cc` also gates `persona-matrix-mouth`. | + +--- + +## 3. Coexistence & Future Deletion Line + +### 3.1 Safe 1-Mind Hydrogen Coexistence Under Held `swarm.cc` +1. **Per-Mind mutual exclusion:** `mind-persona@.service` and the future `mind-persona-hydrogen@.service` must never run concurrently on the same `` (they would race on `persona-matrix-mouth` `pending`/`ack` and `persona_state.v0` CAS). While `swarm.cc` stays HELD (`false`), `mind-heartbeat.service` and all eight `mind-persona@*` units remain stopped by `control::read_effective`. +2. **Single-Mind prototype isolation:** Because `persona-matrix-mouth.mjs:1276` checks `/control.cc` (currently `true`) rather than `swarm.cc`, `mind-persona-hydrogen@` can run solely for the selected prototype Mind (`eureka-body:question:persistent-persona-prototype-mind`) under her own `mind-` UID + `mind-fence.service` (with `bwrap` masking `/etc/gamecult` credentials and Matrix mouth access mediated so sandboxed children never read raw credential seeds), reading/writing `persona_state.v0` over her `--persona-bind` port (`18872..18879`) and talking to Matrix over `127.0.0.1:17884`. +3. **Operational note on the 7 peers:** Until `persona-matrix-mouth` also respects `swarm.cc` or the operator holds `/control.cc`, the 7 unattended peers show `unavailable` rather than `offline` on Matrix. Holding the 7 non-prototype `/control.cc` files keeps peers cleanly `offline` during live public-Matrix testing. +4. **Fleet-release safety interlock:** `mind-persona-hydrogen@.service` must declare `Conflicts=mind-persona@%i.service` (and vice versa) before any `swarm.cc` release. + +### 3.2 Retirement Deletion Line (After 1-Mind Prototype Proof) +Tracked by `eureka-body:follow_up:retire-four-stage-persona-pipeline`. Once the 1-Mind Hydrogen session clears live voice and memory-curation checks: +- **Delete:** `crates/mind-body/src/projection.rs` and `crates/mind-body/src/projection/` (`select.rs` including `Scope`/`concerns` privacy-framing, `narrate.rs`, `interpret.rs`, `commit.rs`, `agent/`, `wake.rs`, `harness.rs`, `simulate.rs`, `tuning.rs`, `domain.rs`, `read.rs`, `turn.rs`), `crates/mind-body/src/persona/live.rs`, the 4-stage drain in `crates/mind-body/src/persona.rs`, `mind-persona@.service` (4-stage unit), `mind-heartbeat`'s per-wake `mind-persona@` launcher, and `ghostlight-persona-projection` (plus `toml` if unused) in `crates/mind-body/Cargo.toml`. +- **Keep:** `control.rs`, `sandbox.rs`, `chat_client.rs` & `chat_rudp.rs` (backing `mind-chat`), `cli.rs`, `self_run.rs` / `launch.rs` / `queue.rs`. + +--- + +## 4. Authority Map — Cut 1: `persona-delta-verbs` + +Target spec: `eureka-body:cut_spec:cut-persona-delta-verbs.r1` (`GameCult/Huginn`, base `f6fc66b7e876b70a0be9c0e0d6b8e894b5df5138`, branch `hands/persona-delta-verbs`). + +- **Owner:** `crates/eureka-state/src/bin/huginn/persona.rs` (surgical read-modify-validate-CAS-put client and privacy-stripped `seed` renderer) backed by `crates/huginn-mind/src/admission.rs` (P1-P5 CAS owner). +- **Inputs:** Environment `EUREKA_INSTANCE` + `HUGINN_ENDPOINT`, `--faculty` / `--agent` / `--session` (or `HUGINN_SESSION`), verb CLI flags, and current `gamecult.persona_state.v0` via `HuginnClient::persona_get()`. +- **Outputs:** + - Delta verbs (`memory add`, `memory retire`, `bond update`, `mood set`, `intention add`, `intention drop`): updated canonical `gamecult.persona_state.v0` committed via `HuginnClient::persona_put(..., Some(expected_updated_at))`; stdout `Committed ` (plus `id ` when an entry is created/updated) or `Refused ...` / `absent` (exit 1) / `InvalidInput` (exit 2). + - `huginn persona seed`: deterministic, privacy-stripped plain-text session bootstrap on stdout (exit 0), or `absent` (exit 1). +- **Derived state:** Monotonic `updatedAt` via `stamp_after(Utc::now(), Some(&view.updated_at))` (`P5`), generated item ids (`m-...`/`w-...`/`i-...`/`b-...`), normalized trimmed strings, and rendered `seed` text (derived on read, never stored). +- **Forbidden writers:** + - Cut 1 delta verbs must never modify `publicName`, `publicDescription`, `presentation`, `values`, `privateNotes`, `embodiment`, `voidbotProjection`, or `provenance.authority` (`identity-write-all-visible` holds structurally without mouth coupling). + - Delta verbs forbid explicit `"private"` or `"room:!"` tags on created entries so public-Matrix state stays public by construction. + - `huginn persona seed` writes no state (`PersonaPut` never called), exposes no `--json` flag (`eureka-substrate:ruling:recall-lives-in-huginn-no-cli-json`), and must never emit `privateNotes`, items carrying `extensions.privacy == "private"`, `"private"` tags, or `room:!<...>` tags. + - `crates/eureka-state/src/main.rs` (deprecated MCP server) gains zero delta tools. +- **Shared paths:** + - One CAS helper `mutate_persona(...)` owns `persona_get -> mutate -> stamp_after -> validate_document -> persona_put`, with bounded retry (up to 3 total attempts) solely on `MindRefusal::PersonaStale` (`Unavailable` is never retried, preserving `main.rs:9-10`). + - One predicate `is_private_entry(&Value)` shared across every array filter in `seed` (and nested `lastEvidence` / `evidence`), matching `persona-state-standard.md` and `projection::select::concerns`. +- **Deletion line:** None in Cut 1 (`crates/eureka-state` holds only `persona get|put`). Pipeline teardown waits for `eureka-body:follow_up:retire-four-stage-persona-pipeline`. + +--- + +## 5. Cut Sequence & Citations + +1. **Cut 1 (Ready for Hands now):** `eureka-body:cut_spec:cut-persona-delta-verbs.r1` (`questions: []`). +2. **Operator fork (parallel, does not block Cut 1):** `eureka-body:question:persistent-persona-prototype-mind`. +3. **Cut 2 (Follow-up):** `eureka-body:follow_up:persistent-persona-hydrogen-prototype`. +4. **Cut 3 (Follow-up):** `eureka-body:follow_up:retire-four-stage-persona-pipeline`. +5. **Considered alternatives recorded as `idea`s (`Recorded`):** `eureka-body:idea:persistent-persona-map.seed-strips-stored-private`, `eureka-body:idea:persistent-persona-map.identity-delta-verbs-in-cut1`, `eureka-body:idea:persistent-persona-map.whole-doc-cas-wrapper-script`, `eureka-body:idea:persistent-persona-map.persona-seed-json-flag`.