3.5 KiB
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 reads the brakes and exits dead, or drains: one turn in each room with a waking line (at most three), one put of her state and one trace record per turn, one ack. mind-persona trace --instance <slug> [--last N] prints her trace. 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.
Before the live switch
The Persona turn's reads run live only once the heartbeat switch lands. Simulations and harness runs read fixtures
([domain], [cast.domain]) and need none of this. One gamecult-ops change carries all of it, ruled by Self on
2026-11-20:
- The forge, for persona uids.
mind_fence'spersonachain rejects every local TCP port but 4110, 80 and 443, so a Persona cannot reach the forge's loopback API (http://127.0.0.1:3310), and port 80 only redirects to HTTPS. Her domain digest and herreporeads need an accept for tcp 127.0.0.1:3310 from@persona_uids. Until then a live read fails whole and the packet leaves the section out, as designed. mind-body carries no TLS; the forge is read on loopback. - Web reads (K24). A
webread fetches a page whose address stands in her prose or in what reached her. The persona chain lets public addresses out (it rejects only local, private, link-local and multicast ones), so egress on tcp 80 and 443 to the public internet is already open for persona uids; what is missing is TLS: mind-body carries none, so a livehttpsread fails as "the read failed". A live web read needs either a TLS-capable client in the organ or an egress fetcher on loopback for persona uids (an accept beside 4110 inpersona); it is one ops-and-body decision with the forge accept above. Repo reads use the forge accept above; mind reads use her read door. - Her read door. Each Persona reaches only her own door (
huginnset: uid . port). The digest and her reads use it asHUGINN_ENDPOINT; nothing to change.