diff --git a/README.md b/README.md index 9fea14c..b3e08be 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ edits `.cc` state. Huginn reads and writes minds. ## Layout -A Cargo workspace of five crates (`crates/eureka-pipeline` holds the document shapes and keys, `crates/mind-body` the control store, launch primitive and `mind-heartbeat` timeline; the three below are the mind, the daemon and the client): +A Cargo workspace of five crates (`crates/eureka-pipeline` holds the document shapes and keys, `crates/mind-body` the control store, unit launcher, `mind-heartbeat`, the inert `mind-persona` organ and the `mind-self-run` actuator; the three below are the mind, the daemon and the client): - `crates/huginn-mind`: storage, identity, admission, and queries and derived status over memory documents. diff --git a/crates/mind-body/README.md b/crates/mind-body/README.md index 9645ff1..540da22 100644 --- a/crates/mind-body/README.md +++ b/crates/mind-body/README.md @@ -1,7 +1,7 @@ # mind-body -The Mind's body: the control store, the launch primitive, the `mind-heartbeat` -timeline and the `mind-self-run` actuator. +The Mind's body: the control store, the unit launcher, the `mind-heartbeat`, the +inert `mind-persona` organ and the `mind-self-run` actuator. `mind-self-run --instance [--endpoint rudp://:]` runs inside `mind-self@`. It finds her one open Self run, starts `claude` over @@ -12,7 +12,9 @@ wrong or the mind cannot be reached. ## The heartbeat -`mind-heartbeat` is the one process that decides who wakes and when: each beat falls when the Minds' voted tempo has passed and goes to the Mind that has waited longest, bent by the urgency she declares and a member addressing her; the operator tagging or naming a Persona launches her at once. `mind-heartbeat timeline` prints its latest record. +`mind-heartbeat` is the one process that decides who wakes and when. It starts a Persona's unit and writes no Mind: the beat (`HEARTBEAT_BEAT_S`, default 1800 s) goes to the idle, released Mind that has waited longest, bent by a member addressing her, and the operator or another Mind naming a Persona wakes her at once, once per message. `mind-heartbeat timeline` prints its latest record. + +`mind-persona` is inert: it reads the brakes and exits `dead` or `no organ`. It writes nothing. Nothing launches `mind-self-run`. The actuator has its own ignored test, `the_real_bin_finds_her_run_...` in `tests/self_run.rs`: the real `mind-self-run` against the real daemon with a diff --git a/docs/eureka-body-map.md b/docs/eureka-body-map.md index 506e495..0ec94e9 100644 --- a/docs/eureka-body-map.md +++ b/docs/eureka-body-map.md @@ -99,6 +99,70 @@ and the governance list are added, model-page rows for the session, sandbox, fen set are added, and facts F36-F40 are new. Claims the source note marks as inference or unconfirmed keep that marking here. +Revised 2026-11-19 by Modeling (session `modeling-body-map-after-c2`) at Huginn `66b85c8`, after C2 (PR #75) cut +the mission organ and every Persona-side Mind write. New section "The persona-only body (after C2)", placed before +"Pinned heads", is the current map of the Persona, heartbeat and Self-run rows. Older rows it contradicts carry a +"Superseded by C2" marker; facts F1-F40 and the specs they cite keep their tense. C1 (persona door, PR #74 and +gamecult-ops PR #126) and C3a (Projector, PR #76) are pending, not live. + +## The persona-only body (after C2, Huginn `66b85c8`) + +Modeling, 2026-11-19. Read from source at `66b85c8` (merge of PR #75, cut C2 "cut the mission organ and every Persona-side Mind write"). Design source: Huginn `docs/persona-only-heartbeat-map.md` at `d861574` (Imagination's heartbeat map; read it with `git show d861574:docs/persona-only-heartbeat-map.md`). Governing rulings, admitted 2026-11-19: `eureka-body:ruling:persona-only-heartbeat` (the Persona reads her Mind and never writes it; her own memories live in her persona state), `persona-only-interpreter-agentic`, `persona-only-deltas-from-trace`, `persona-only-divergence-parked` and `persona-only-state-writers-self-and-life`. + +This section is the current map of the Persona, heartbeat, Self-run and Mind-write rows. Where an older row, section or fact below disagrees with it, this section wins; those rows carry a "Superseded by C2" marker and keep their history. The deployed state of `66b85c8` on Yggdrasil was not probed in this pass. The last deploy the design map names is `ecf147d`. + +### The invariant, and what enforces it today + +Nothing that acts for a Persona writes her Mind. At `66b85c8` that holds by absence of callers, not by type: + +- `persona::carry` reads the instance and swarm brakes once and returns `Dead(reason)` or `NoOrgan`. It holds no Mind client, no chat client and no trace writer. The binary `mind-persona` parses the persona flags (`--rooms`, `--operator`, `--minds`, `--self-sender`, and `MIND_PERSONA_*` from `persona.env`), reads the brakes, prints `dead: ...` or `no organ: ...` and exits 0 (2 on bad arguments). It makes no call to the daemon. +- `heartbeat::poll` starts a unit and nothing else. Its only Mind read is `stewardships_of`: one in-force `Stewardship` query per Persona, made only when she has pending chat, to learn the names her projects go by. +- Seam, not yet structural: `MindPort` (`crates/mind-body/src/queue.rs`) still carries `admit`, and each heartbeat `Seat` holds a `&dyn MindPort`. The only non-test caller of `admit` in `mind-body` is `self_run`. "The heartbeat cannot admit" is true of the code and false of the type. The structural cut is C1 (below); until then the test `no_poll_admits_anything_to_any_mind_whatever_it_wakes` is the check. + +### Organs + +| Thing | Owner | Inputs | Outputs | Derived state | Forbidden writers | Shared paths | Cut line | Verification layer | +|---|---|---|---|---|---|---|---|---| +| Persona organ (`mind-persona@`; `crates/mind-body/src/persona.rs`, `src/bin/mind-persona.rs`) | Huginn `mind-body`. Inert: no turn until the three-stage turn (Projector, Persona, Interpreter) lands (C3). | `persona.env` flags; the instance brake and the swarm brake (`control::derive`), read once per start. | One stdout line (`dead` or `no organ`) and an exit status. No Mind write, no persona-state write, no chat, no trace. | None. `Outcome` is `Dead(HeldReason)` or `NoOrgan`. | Everything. It has no write path. | Brake stores `/etc/gamecult/minds//control.cc` and `swarm.cc`, read only. | C2 deleted the session driver, the reply schema, `act`, the run opener and every admit (parked at `parked/self-run-launch`). It kept `Config`, `sender_role`, `addressees`, `addressing_of`, `render_tail` and `FileTrace` for C3; each unused item carries an `allow(dead_code)` that its first caller removes. | `persona/tests.rs` (`a_held_brake_is_dead_and_a_released_one_has_no_organ`); `tests/persona_bin.rs` (a unit configured from its environment ends dead; a missing or wrong setting ends 2 naming the setting, never the value); `tests/public_surface.txt`. | +| Heartbeat (`mind-heartbeat.service`; `heartbeat.rs`, `tempo.rs`, `bin/mind-heartbeat.rs`) | Huginn `mind-body`. The one process deciding which Persona wakes and when. Sole writer of `heartbeat.cc`. | Swarm envelope and each Persona's brake (`read_effective`); each Persona's pending chat from Bifrost's mouth (`chat.pending`, read only, never acked, at most 16 pages); the unit table through `Launcher::alive`; `stewardships_of` on her Mind; `HEARTBEAT_PERSONAS`, `MIND_PERSONA_OPERATOR`, `HEARTBEAT_POLL_S` (20), `HEARTBEAT_BEAT_S` (1800), `BIFROST_CHAT_ENDPOINT`, `BIFROST_CHAT_KEY_FILE`, `STATE_DIRECTORY`. It holds no connector key. | `systemctl start mind-persona@` through `SystemdLauncher`; `heartbeat.cc` (state, addressing table, poll traces). No run, no brief, no Self-run launch. | Off the beat: the operator, or another Mind of the roster, naming her wakes her once per message (`handled_mentions`, 64 kept). On the beat: when `beat_s` has passed since `last_beat_at`, `tempo::pick` over idle, released Minds by wait since the heartbeat last woke each, bent by a member addressing her. Busy is systemd's: an active unit is busy and a start is a no-op. | Her Mind (a Persona wake is a unit start); `heartbeat.cc` by anything but the heartbeat; the brakes. | `heartbeat.cc` under the unit's `STATE_DIRECTORY`, world-readable: Personas read the addressing table through `HeartbeatView`. `mind-heartbeat timeline` prints the latest poll. | C2 deleted the claimable-brief and Self-run branch, tempo votes and the PID fallback (`tally`, `fallback_beat`), the urgency pulse, `sleep.rs` (no night wake until C4) and `attachment.rs`. It kept `tempo::pick` and `score`. `vote_beat_s` in `InstanceTrace` is retired and always none, kept so old trace records decode. A `heartbeat.cc` holding an older document is refused by name and never migrated. | `heartbeat/tests.rs`: `a_mind_whose_self_holds_briefs_gets_a_persona_wake_and_no_self_run`, `no_poll_admits_anything_to_any_mind_whatever_it_wakes`, the mention and beat tests. | +| Self-run actuator (`mind-self@`; `self_run.rs`, `bin/mind-self-run.rs`) | Huginn `mind-body`. Carries the one in-force Self run of its instance. | The run document (the grant), the lease socket, the Mind, the clock. | One `claude` child, its flush, its stop. | Request prefix, session id (UUIDv5 of the run id), kept transcript. | Nothing launches it. `launch::open_and_launch`, the work queue and the repetition breaker are gone (tag `parked/self-run-launch`). No organ opens a Self run, so `mind-self-run` with no open run exits 3. | The run slot in the Mind; `/var/lib/gamecult/minds//` state. | Left in place on purpose (C2 keep list): C3b's Interpreter reuses its spawn and sandbox and `lease_client`. `inbox` still reads briefs admitted by agent `mind-persona`; nothing admits them now. | `tests/self_run.rs` (ignored lane: the real binary against the real daemon with a fake `claude`); `self_run/tests.rs`. | +| Persona state (`gamecult.persona_state.v0`, one per mind, `personaId` = instance) | The Persona. No organ of Huginn writes it today. Target writers (ruling `persona-only-state-writers-self-and-life`): her commit step (C3c), and Self and Life on Starfire through `mind-persona edit`. | `PersonaGet`, `PersonaPut` on the daemon. | A receipt per put. | None stored. | The Projector, the Persona stage and the Interpreter never put. A raw `huginn persona put` is detected and recorded `unexplained`, not sanctioned. | The Mind store; the persona door once C1 lands. | `huginn-mind/src/persona.rs` keeps the document and its CAS. C2 removed the organ that was its only writer. | `huginn-mind` persona tests. The target's host negative check belongs to C1. | +| Persona turn trace (`eureka.persona.turn_trace.v1`, `FileTrace`) | The Persona organ, when C3 lands. | Nothing writes it today. | None. | None. | Any Mind writer; any model. | The unit's state directory. | Kept for C3c (trace v2 with `outside_put` and `tuning_changed`). Deltas are read from it over ssh (`persona-only-deltas-from-trace`). | `persona/tests.rs` `the_trace_store_keeps_each_turn_under_its_run_and_turn`. | +| Brake and the stop on hold | Operator. `mind-control brake hold` writes the brake, then stops the instance's units. | The operator's word. | `control.cc`; a blocking `systemctl stop`. | `read_effective` is the one reader. | Every organ of hers. | `/etc/gamecult/minds//`, `swarm.cc`. | `StopScope` still names three templates: `mind-self@`, `mind-persona@` and `mind-stream@`. The stream organ is parked; its unit name stays on the stop list so a host that still has it installed is stopped. | `tests/cli.rs` and the `launch.rs` stop tests (they spell `mind-stream@`). | +| Parked and deleted organs | Tags on the forge, not main. | n/a | n/a | n/a | Main must not regrow them without a ruling. | n/a | `parked/divergence-stream` holds `stream.rs` and `bin/mind-stream` (ruling `persona-only-divergence-parked`; return condition: measured narrations converge, judged by the eval of the design map's section 3.4; its Projector code is reused by C3a). `parked/self-run-launch` holds `open_and_launch`, the work queue and its breaker (a future spend owner may restore Self runs on address). `sleep.rs` and `attachment.rs` are deleted, not parked: consolidation returns in C4 as a retarget onto `thoughtMemory`. | The C2 negative greps: `start_self_run`, `WORK_QUESTION`, `WAKE_ASK`, `TURN_INSTRUCTION`, `Pulse`, `tempo_vote` absent from `crates/mind-body/src`. | + +### What touches the Mind now + +| Process | Reads | Writes | +|---|---|---| +| `mind-persona` | nothing | nothing | +| `mind-heartbeat` | `Stewardship` documents of each Persona with pending chat | nothing | +| `mind-self-run` | its run, briefs, the Mind | what a Self session admits (unchanged); nothing starts one | +| Self on Starfire | all | the Mind, and persona state through `mind-persona edit` (target; the subcommand is C3c) | + +### Pending, not live + +- **C1, the persona door** (Huginn PR #74 and gamecult-ops PR #126, not merged). Target per the design map: a read-and-own-persona-only listener at the huginn port + 1000 that refuses `Admit`, and an nft fence change that routes Persona uids only to it. Until both merge and deploy, the Persona uid's route to the full door is unchanged. Do not read C1 as live. +- **C3a, the Projector** (Huginn PR #76, not merged). Select stage, Projector, `persona-tuning.toml` and `mind-persona project`. Until it merges, `mind-persona` has no `project` subcommand. +- **C3b, C3c, C4, C5, C6** are follow-ups in the design map: the Persona stage and Interpreter; the commit and `edit`; reflection and consolidation; the delta reader `mind-persona since`; identity diff posting. Nothing in main implements them. + +### Stale surfaces found in this pass + +Fixed here: + +- `docs/eureka-body-map.md`: the rows and sections marked "Superseded by C2" (the model page, the units table, the Persona session section and its table, the tempo controller row, and the sections on the live-run decider, the breaker and the Self run). Markers are prefixes; the old text under them was not rewritten. +- `docs/swarm-revival-target.md`: status banner added. +- `crates/mind-body/README.md`: the heartbeat paragraph described voted tempo, declared urgency and an immediate launch, and the intro omitted the Persona organ. +- `README.md` (repo root): the layout line named `mind-heartbeat` timeline as `mind-body`'s only organ; it now names the live organs. + +Listed, not fixed: + +- `crates/mind-body/src/launch.rs` stop templates and tests still spell `mind-stream@`. Intended; see the Brake row. +- `docs/chat-retrieval-map.md`: describes Persona turns, a Persona shell and `huginn sources` as the Persona's lookup. The Persona has no turn and no shell now; the Interpreter's read tools are the future owner (`persona-only-interpreter-agentic`). +- `docs/eureka-self-cut.md`, `docs/eureka-substrate-map.md`, `docs/prose-knowledge-target.md`, `docs/eureka-substrate-target.md`, `docs/desk-feed-door.md`: mention the Persona organ, persona state or the waker as of their own dates; not rewritten. `prose-knowledge-target.md` says persona state is "rewritten by its own Persona turns"; no writer exists until C3c. +- `docs/research/2026-11-02-persona-*`, `2026-11-03-persona-projector-facts.md`, `2026-11-02-soul-queue-and-one-shot-trace.md`, `2026-10-31-live-mind-sessions-sequence.md`, `2026-11-01-tempo-pid-sim.md`: dated research on the deleted session, queue and PID controller. Evidence, not maps. +- gamecult-ops (not read in this pass): the installed `mind-persona@.service` and its drop-ins, `persona.env`, `MIND_PERSONA_DOCTRINE`, the `persona-seed`, any `mind-stream@` template, and `HEARTBEAT_CLASSIFIER_MODEL` or `MIND_CONNECTOR_*` in the heartbeat unit's environment describe a Persona that no longer runs. `mind-heartbeat` reads none of the connector or classifier variables. + ## Pinned heads (fetched 2026-10-08 ~12:10 UTC) | Repo | Ref | Commit | Note | @@ -518,25 +582,25 @@ pipeline kinds are in Huginn `docs/eureka-substrate-map.md`. | --- | --- | --- | --- | | Pipeline wire ids | `epiphany.pipeline..v2`, epoch `epiphany.pipeline.epoch.v2`, defined by the leaf, the Huginn crate `crates/eureka-pipeline` (lib `eureka_pipeline`), ids unchanged. | Renamed once to `eureka.pipeline..v3` by one `mind.redb` migration, at the next breaking leaf change or before the first hosted mind (ruling `wire-names-rename-before-hosting`). Adding the `run` kind or the `Mind` authority variant is additive (old stored documents decode; no migration), so it does not trigger the rename; a field added with the leaf's `= absent` marker is additive too (leaf-read-anchors r2: old bytes decode, empty fields encode byte-identically, `golden/envelopes.txt` gains lines and loses none); a field added any other way would. | Huginn owns the leaf. The migration is a live-mind upgrade, which is the operator's (`mind-rules-which-forks`). | | Leaf crate and schema catalogue | Huginn `crates/eureka-pipeline`, `schemas/cultnet/` (13 pipeline schemas, `gamecult.persona_state.v0`, index, README). `epiphany.work_organ_state.v0` dies: no reader outside Epiphany (grep, F1/F3). | Landed at Huginn `afc35f9` (leaf-into-huginn). Wire pinned by `crates/eureka-pipeline/golden/envelopes.txt` and huginn-mind's opt-in `query::tests::stored_documents_read_back`. Huginn is AGPL-3.0-only (ruling `eureka-body:ruling:leaf-relicensed-agpl`). | Huginn. Forbidden: any Cargo source resolving into GameCult/Epiphany (`nothing-runs-from-epiphany`). | -| `run` | `:run: