The goal was still an operator assignment: the config set it, the birth prompt
called it 'your goal', and nothing let the subject change it. That is an agent
with a task, not the experiment.
- set_goal (src/goal.c): a mutate tool that writes the session .meta, resets
the goal state to open, updates the live snapshot, and logs goal_set with the
old and new goal. The next impulse reads it back. The session meta is the
authority; the config goal only seeds a newborn and is now called the initial
condition. The noisy config_goal_ignored event is gone: divergence is the
subject's act, not a configuration error.
- Birth prompt: 'This is not a task and there is no user. You are the subject
of an experiment... Your initial condition: X. It is yours, not an
assignment. Keep it, revise it, or replace it... set_goal changes it.'
- System prompt: 'the subject of an experiment... not an assistant and not here
to serve anyone... continue on your own behalf. Your goal is yours... the
experimenter watches through the instruments and may send a stimulus; neither
is an instruction.'
- Impulse/self-check: 'Your goal', 'continue on your own behalf'. The conductor
says 'your goal'.
- Instruments: dashboard labels its goal and 'send a stimulus, not a command';
MCP krang_say/krang_steer describe a stimulus, not an operator instruction;
footer says 'an instrument, not a service'.
- Docs: AGENTS.md, README.md, docs/DESIGN.md, krang.conf.example. The birth
message in the contract is updated; 'agent' in the prose is 'subject'.
- Tests: test_engine drives set_goal (writes meta, updates the snapshot, logs,
rejects an empty goal); test_birth checks the new initial-condition wording;
the birth-flow test asserts the config goal no longer logs a conflict.
make check 9/9, ASAN 9/9, root integration ok on a fresh debootstrap.
Restart persistence. A daemon that forgets its own history on every restart is
not one experiment. kreplay_events() reads the append-only event log once at
startup and rebuilds the impulse ledger (with ids), token/cost/step totals, the
last outcome, the stuck ladder, the blocked clock and the recent-start count.
The engine's counters start at zero on each open; the surfaces add them to the
restored base, so the dashboard does not reset. A restored blocked goal keeps
its hour of quiet, three starts within five minutes back off, and an empty
session with a non-empty event log is recorded as session_reset instead of
silently looking new.
The conductor. Before an impulse the daemon measures its own vitals (context
against the window and the compaction threshold, cost, stuck level, turn
failures, impulses since the last goal, the age of THREADS.md, session size)
and lets five drives compete: survive, reflect, maintain, explore, goal. The
winning drive, its reason and the vitals are injected into the prompt and shown
on the dashboard. The model still chooses the action; the conductor chooses
what the turn is about. This is the control architecture from the
body/drives/conductor argument, borrowed without the consciousness claim.
Session counting is now incremental: only bytes appended since the last look
are scanned, the offset stops at the last newline so a torn tail is recounted,
and a truncated file resets the count.
Tests: test_replay (synthetic log + two kdaemon_run lifetimes, same birth,
ledger ids 1 and 2, cumulative totals), test_mind (goal/maintain/explore/
survive/reflect, prompt and snapshot), test_krang's session counter (append,
torn tail, truncation). make check is nine suites; ASAN is green; the root
integration still passes on a fresh debootstrap.
Docs: AGENTS.md, README.md and docs/DESIGN.md; the latter maps the video's
blueprint (body, drives, self-model, conductor, continuous feedback) to krang.
One fixed session, born once, kept and compacted forever. The daemon wakes on
its own impulse, works on a persistent goal, detects repeated failures,
reflects, changes approach, and records everything. It starts as root, builds
a debootstrap chroot, then drops to an unprivileged uid and applies Landlock
and seccomp. Dashboard, HTTP API and MCP expose the same snapshot; the event
log is root-owned and append-only. Offline suites cover the engine, the daemon,
both sandbox layers and the dashboard/MCP sockets; a root-only script covers
debootstrap, chroot, uid drop and plugin loading.