3 Commits
Author SHA1 Message Date
lotherk 00bedb4e32 swarm: the socket exists only with --swarm, and only while a member runs
Two things were wrong with .splinter-swarm.sock. Every chat bound it, wanted
or not, so a shared working directory collected a leftover from every session
and the next start that found one sat on "[swarm locked]" because nobody
answered on it. And the master removed the file on its way out even when a
member was still running, which left that member on a path that was gone.

Now the fleet is opt-in. Without --swarm nothing binds or joins the file;
with it, the file lives exactly as long as the fleet does, whatever order the
members leave in.

- main.c: --swarm is a flag; eo.swarm requires it (plus --chat, no --serve,
  no --daemon, no A2A/MCP/delegate).
- swarm.c: join_or_bind() is the one place that decides master or slave, used
  at startup and again on takeover. A slave whose master says "bye" or whose
  connection just ends (SIGKILL) takes the fleet over: bind, or join whoever
  was faster. A leftover file with no listener is removed there and rebound,
  because a refused connect is proof nobody answers.
- master_close() removes the file only when it is the last member. The peer
  check reads the sockets instead of trusting the cached flag: a peer that
  exited is only visible as EOF on read.
- swarm_emergency_unlink() (SIGTERM/SIGHUP) keeps the file while a peer is
  live. A handler may not walk the peer table, so the master keeps a
  sig_atomic_t count of live peers for it.

Tests, all against the real binary and the real signal path:
- test_swarm.c: master leaves first, survivor takes over and the file stays;
  hard-killed master (EOF, no bye), survivor cleans the leftover up; the
  signal cleanup alone leaves the file for a live member; an unowned file is
  still never deleted. Mutation-checked: forcing master_close to always
  unlink, and dropping the peer count from swarm_emergency_unlink, each turn
  the suite red.
- test_swarm_socket.sh (new, in make check): through tmux, --chat without
  --swarm creates no file at all; --chat --swarm creates one that accepts a
  member and is gone after Ctrl-D and after SIGTERM; two members share one
  file that outlives the master and goes with the last one; a SIGTERM-killed
  master does not take the fleet from the survivor. Mutation-checked: making
  the fleet unconditional (the old eo.swarm line) turns it red.

make check: all tests passed. check_asan.sh: all 46 test binaries clean.
2026-11-23 20:19:33 +00:00
lotherk 4cbd57d829 tree: lcm keeps the task, and the in-flight work it sits in
Everything that was uncommitted in the shared tree, in one commit because the
changes are interleaved across the same files (lcm, engine, frontend, locales).

lcm: a continuation prompt is not the task. After /resume the newest user
message is "Continue with the task ...", and pinning it kept the keystroke
while the question it continues was cut away -- measured: a resumed session
woke up with the prompt, one tool call and its error, and no task at all. The
pin now skips the harness's own continuation prompts, so the real question is
pinned again. test_compactor drives it: with the skip disabled the task is
lost (red), with it the task comes back after the summary (green).

engine: /self-check and the exact tool-argument parse are in a1794fb; this
commit carries the tests for them (a failed tool observation must appear in
the self-check prompt; mcp_parse_exact rejects two objects in one string) and
the i18n keys the new code uses: cmd.script.*, main.no_profile, tg.busy,
tg.interview.running, ui.agent_busy in all three catalogues.

The rest is the in-flight work from the shared session: engine/frontend,
plugins, telegram/a2a, and their tests.

make check: all tests passed; check_i18n ok, 204 keys in 3 catalogues.
2026-11-18 23:03:09 +00:00
lotherk 0576d21924 open points: tables, counted site, and the tests the list asked for
Markdown tables are drawn as columns now (src/md.c, test_md, and a case in
test_ui.sh that checks the screen). The site counts lines, tools, tests,
plugins and palettes from the tree instead of naming them; the binary-size
figure is gone because it aged with every build.

The delegate panel cycle has a test (host + tasks plugin, widget says
delegate:panel exit 0), and the turn loop is driven with lcm at 8 KiB and
32 KiB budgets, so compaction is measured rather than claimed.

swarm, provstate and planner get smoke tests. TODO.md is rewritten against
the tree: the step limit was the old default (8 -> 150), skills and memory
were already built, and the open points are claude exit 2, a real Telegram
approval, A2A, the npm leftovers and the scheduler/job tests.
2026-11-09 22:46:25 +00:00