Huginn/crates/mind-body
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens b90c21e695 Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector
- F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with
  `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's
  policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from
  the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`.
- F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`.
- F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line.
- F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke.
- F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail.
- F8: a test that another seed changes the order.
- F9: `--state` docs say P4 and P5 are not checked.
- Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke
  to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the
  context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms.
- Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap.
- Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
..
fixtures/harness Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector 2026-11-20 03:40:38 +01:00
src Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector 2026-11-20 03:40:38 +01:00
tests Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector 2026-11-20 03:40:38 +01:00
Cargo.toml Projector after Soul: no Mind recall; messages to her always whole; sampled inclusion; effective tuning hash and validation; schema-derived guard; budget edges; read-only organs; grapheme clips 2026-11-19 23:43:50 +01:00
clippy.toml mind-body: the process environment is unreadable by library code, by lint 2026-10-10 20:15:18 +02:00
README.md Body map after C2: the persona-only body, stale rows marked, READMEs corrected 2026-11-19 22:40:02 +01:00

mind-body

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 <slug> [--endpoint rudp://<ip>:<port>] runs inside mind-self@<instance>. It finds her one open Self run, starts claude over stream-json with a fixed argument list, asks for the flush once at the context ceiling and stops a child that outlives the flush (SIGINT, then SIGTERM and SIGKILL). It exits 0 when the child exited 0, 1 otherwise, 3 when she has no single open Self run and 2 when the arguments are wrong or the mind cannot be reached.

The heartbeat

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 fake claude first on PATH. It needs the daemon built beside the binary and a POSIX shell, not root:

cargo build -p huginn-daemon -p mind-body --all-targets   && cargo test -p mind-body --test self_run -- --include-ignored

Mutation testing of the actuator, with the globs that reach the library and the binary: cargo mutants -p mind-body -f "**/src/self_run.rs" -f "**/src/bin/mind-self-run.rs". The binary's mutants are killed only by the lane above.