A program in ~/.splinter/commands now replies in the Telegram chat with
its output; the TUI keeps feeding the same output to the model as
context. A slash command that is neither a plugin command nor a program
answers with 'unknown command' plus the live command list instead of
being sent to the model.
test_gateway.sh runs /hello and /nosuch and checks that neither starts a
model turn. README, PLUGINS.md, TODO and the site follow.
setMyCommands is built at startup from /start, /help, every command a
loaded plugin registers and every program in ~/.splinter/commands whose
name is a valid Telegram command. /start and /help list the same live
set in the chat; a name Telegram cannot take (a dot, upper case, over 32
characters) stays usable in the chat but cannot appear in the menu.
The live bot now shows start, help, goal, recap and the local uptime
script; loading another plugin adds its command without editing the
gateway. test_gateway.sh loads focus and a command script and checks
that both reach the menu.
The gateway registers /start, /help, /goal, /recap and /tasks with
setMyCommands, so Telegram's menu button lists them; /start and /help
answer with the short help text. Descriptions come from the catalogue.
An approval is sent with an inline keyboard now. A callback_query from
an allowed user resolves the ack, answers the button, removes the
keyboard and confirms in the chat; the text form ok <id> / no <id> still
works. tests/fake_telegram.py logs the menu and the markup and drives a
stranger callback (ignored) plus the real one; test_gateway.sh checks
both.
The real round trip is proven: request 548769685 was answered in
Telegram and the write ran. The installed ~/.splinter/bin/tg-ask was a
stale copy without the token path and was replaced by tools/tg-ask.sh.
fake_telegram.py also keeps the markdown-table branch that test_ui.sh
needs.
The diagnostic path for a delegate that fails: the observation carries
the child's exit status, its own error text and the job line, with no
model turn and no transport. On 2026-11-10
'--delegate claude0 -p "sage nur: beta"' answers beta, so the old
exit 2 is not reproducible; TODO moves it to done and keeps the command
as the way to check again.
The A2A server also uses the spec's codes for what it refuses now:
CancelTask -32002 (TaskNotCancelable), push configuration -32003,
SubscribeToTask -32004.
test_delegate_cli.sh covers the run, an unknown id and a missing task;
test_a2a_server.sh covers the cancel and push errors. README, man page,
TODO and the site follow.
The server keeps up to 16 conversations, keyed by contextId and evicted
LRU-style. A message with a known id continues it; without one the server
generates an id and returns it in the task, so callers that send no
context at all do not share a history. The session log still records
every turn.
test_a2a_context.sh uses a fake OpenAI endpoint that answers with the
number of user messages it received: fresh=1, same context=2, another
context=1, and continuing with the generated id reaches 2. README,
PLUGINS.md, TODO, ROADMAP and the site follow.
The server can list the stored tasks now, optionally filtered by
contextId, with the pagination fields the spec requires. The test checks
the stored task and an empty list for another context. Docs and the site
name the method.
SendStreamingMessage on the A2A server answers with SSE now: an initial
task event in WORKING, one artifactUpdate per streamed chunk (a
non-streaming transport sends its whole answer as one chunk), then a
completed statusUpdate. An error becomes an error event; the task is
still stored for GetTask.
test_a2a_server.sh runs the client half against the server half through
the agent card, blocking and streaming, besides the direct curl checks.
README, PLUGINS.md, TODO, ROADMAP and the site follow.
src/a2aserver.c is a minimal HTTP/1.1 + JSON-RPC endpoint:
--a2a-server-listen and --a2a-listen-port. SendMessage runs one turn in
its own conversation (system prompt plus the caller's text) and returns a
completed Task; GetTask returns it from the in-memory store;
GET /.well-known/agent-card.json serves a card with the JSONRPC interface.
Beyond loopback SPLINTER_A2A_SERVER_TOKEN is required and checked as an
Authorization: Bearer header. One request at a time, one connection at a
time, no TLS.
Streaming, CancelTask/SubscribeToTask, file/structured parts, push
notifications and continuation of an interrupted task are refused with a
JSON-RPC error instead of half-answered.
test_a2a_server.sh covers the card, SendMessage, GetTask, the streaming
refusal and the token. README, PLUGINS.md, the man page and the site
follow.
SPLINTER_A2A_CARD names the card; the first send picks the JSONRPC entry
from supportedInterfaces, falls back to the older single url field, and
keeps the discovered URL for the session. SPLINTER_A2A_URL still wins
when both are set. The card fetch uses the same secret handling as a
send: the bearer token goes through curl's stdin.
The fake agent serves both card shapes, and test_a2a.sh covers discovery
with and without supportedInterfaces.
The A2A transport implements send_stream now: SSE events are read as
StreamResponse (task, message, statusUpdate, artifactUpdate), artifact and
message text goes to the screen as it arrives, intermediate status notes
are ignored, and a completed status message is the answer only when no
artifact or direct message text came. Failed/canceled/rejected and
input/auth-required states fail the turn instead of becoming an answer.
One-shot mode already streamed whenever a transport offered it, so the
plain send path was unreachable from the CLI. --no-stream asks for it.
test_a2a.sh covers both SendMessage and SendStreamingMessage; the new
test_a2a_ui.sh drives the UI streaming path through tmux.
README, PLUGINS.md, the man page and the site follow.
plugins/a2a sends one SendMessage over JSON-RPC 2.0 with a text part and
reads either a direct Message or a Task in TASK_STATE_COMPLETED (status
message plus artifact text). Task and context ids are kept for the session;
a terminal task loses its id but keeps the context. Bearer token, timeout
and SPLINTER_A2A_FULL are supported.
Text only. Streaming, file/structured parts, push notifications,
GetTask/CancelTask and agent-card discovery are named as not built, so
nobody assumes otherwise.
tests/fake_a2a.py and tests/test_a2a.sh pin the wire shape, both result
forms, the bearer token and a JSON-RPC error. The site now counts the new
plugin (16) and names the transport; README, PLUGINS.md and ROADMAP follow.
TODO also records the live claude check: both configured accounts are at
their limit, exit 1 with the child's text, claude0 benched and claude1
queued; exit 2 remains unreproduced.
test_jobs drives delegate_submit, jobs, result, due and retry against a fake
ssh, writes a due waiting_poll job and lets sp_delegate_tick retry it, and
loads the scheduler plugin to check its idle widget. The test found a real
bug: tool_delegate_retry parsed id and force into the same sp_buf, and
json_str appends, so force=1 turned job-1 into job-11. force now has its own
buffer.
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.
cli_fallback = claude1, claude0 names cli delegates whose cmd and env=
take over when cli_cmd answers with its limit. The main command is
benched as "cli", a fallback under its own id, on the same bench the
delegation uses (sp_limit_parse, sp_cooldown_until, sp_cooldown_set are
now exported from libsplinter). The session key stays, so claude
resumes the same conversation under the next account. With everyone
benched the turn fails with the first reset, as WAIT_QUOTA ready_at=.
A fallback's env= goes through a 0600 file the shell sources, not a
command line. A delegate's child is benched under the delegate's id
(SPLINTER_CLI_ID), never as "cli".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A parallel child that answers with its limit benches its delegate, like
the single call, and its task is spawned again in the same slot on the
next delegate that fits - the request's tags plus the benched one's -
while the other tasks keep running. A fallback already at its
max_parallel among the running jobs is not taken. The task header says
what happened.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cli transport keys the program's own session on SPLINTER_CLI_SESSION
(the splinter session id, plus ':<delegate>' for a delegate child):
claude gets a derived UUID, --session-id first and --resume after, with
one retry when claude disagrees; opencode gets --session ses_<derived>;
other programs can use {session} and {uuid}. Consecutive calls continue
one conversation and hit the provider cache (measured: 17.6k read, 80
written on the second call).
A delegate whose answer is a limit (429, rate/usage/weekly limit, quota)
is benched until the reset it names - claude's "resets 3am
(Europe/Lisbon)" is read through date(1) - in ~/.splinter/cooldown/<id>,
and the task goes to the next delegate that fits. choose() skips benched
delegates, also when one is asked for by name.
run_child now carries the tail of the child's output in its error and
treats a signal as failure; "exited 1" alone hid every limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
env=NAME=VALUE on a delegate line (repeatable) is set in the child right
before exec and beats what the parent exported, so two delegates can run
the same cli with two accounts. Remotely it goes in front as
`env 'NAME=VALUE'`, quoted like the rest. cli_env = NAME=VALUE does the
same for the main cli transport. A bad name is an error with the line.
Also in this commit, the work in progress from the tree: swarm and
provider state, the provider/scheduler/planner/tmux plugins, the ui test,
whose tmux session name is now per run so parallel runs do not collide.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Telegram gateway
- A tool call of the gateway's own turn that needed consent was either denied
(a daemon has no approval stream) or, with ack channels set, waited for an
"ok <id>" that only the blocked gateway could have read. It now asks in the
chat the turn came from, keeps reading while it waits, resolves answers
(also other processes' and 'splinter --ack'), ignores strangers and tells
everything else to wait. The update offset is shared, so nothing is handled
twice. New cfg flag approve_is_channel: such an approve is asked directly.
- send_message wrote its error through err, and half the callers pass NULL: the
first refused message (too long, bad UTF-8) crashed the gateway. It also
missed '"ok": true' by substring; the reply is parsed now.
- tests/test_gateway.sh drives the real daemon against a fake Bot API and a
fake model (tests/fake_telegram.py), with "ok" and with "no". In make check;
.gitignore no longer hides tests/test_*.sh.
Approvals
- A channel was told "Zustimmung <id>" and nothing else: a phone said yes to a
number. The message now names the tool and its arguments (cut at 300 bytes)
and how to answer, and goes to the channel as "$1", never parsed by sh.
Smaller
- ring: an exit that already streamed text is not retried on the next one
(the operator saw a second answer after half of the first); the header now
says what moves the ring - limits and providers that are down.
- cli: the program's stderr went over the curses screen and the error quoted
stdout. stderr goes to a file and into the error; temp paths are quoted;
the BODY_CAP no-op is gone. (That is the "kaputt" make check used to print.)
- memory: memory_key_env became an env var curl never reads, so no request had
a key. It is "Authorization: Token <key>" now, on curl's stdin. Tested.
- docs/CONFIG.md: the real default path, and the seven keys it did not know
(telegram_allow, memory_url, memory_key_env, skills_dir, env_delegates,
exit, delegate) with the line formats, checked against the parser.
- The no-token message named a config key that does not exist.
Left as it is, on purpose: 'read' stays unrestricted (decision); the fsync per
session line stays (durability over latency).
make check: 26 test binaries and the gateway script, green, also under
ASan/UBSan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A review found the tool classes - the core of the harness - bypassable in
several places where model output was pasted into a shell or trusted as an id.
Each fix below has a test that reproduces the original failure.
No shell for model data
- webfetch put the URL between '...' and ran it through popen: a quote in the
URL ran any command, from a tool that needed no consent. curl is now exec'd
with an argv, http(s) only, HTML stripped in C, stderr off the curses screen.
- webfetch is mutate: with read free, "read a key, fetch evil/?k=..." left the
machine without anybody being asked. websearch stays read (fixed host).
- kids: the parent-approval command got the model's arguments inside '...'
via system(); they are now "$1". The domain check reads the URL with the
same parser as the tool (duplicate keys) and refuses user@host URLs.
- delegate: the two copies of the child argv are one (exec_delegate). The ssh
path exec'd splinter with "ssh" as argv[0]; it now runs ssh and quotes every
word for the remote shell. A single delegate to a host now really runs there.
Approvals (ack)
- The id was the pid: a late yes stayed on disk and approved the next request
unseen. Ids are random, requests 0600 with O_EXCL, deleted when answered or
expired; an answer is refused after expiry; the first answer wins (link(2)).
- An ack dir owned by someone else or writable by others is refused.
- --ack accepted every word but "no" as yes ("nein" approved). Now strict.
- The terminal thread blocked in fgets after a phone answer; it is stoppable.
Secrets
- API key and Telegram token were in curl's argv, readable via ps. src/curl.c
passes URL and auth headers as a -K config on stdin (transport, telegram,
tg-ask.sh; its dead eval fallback is gone).
- 'run' and task_start no longer inherit splinter's keys ("run env"). 'run' got
its own process group, stdin /dev/null and SPLINTER_RUN_TIMEOUT (300 s).
MCP server
- Beyond 127.x it refuses to start without SPLINTER_MCP_TOKEN; connections
must begin with "AUTH <token>". SIGPIPE ignored, idle connections closed.
Crashes
- task_kill sent kill(-0) - SIGTERM to splinter's own process group - because
popen gave no pid. Tasks now have a pid and a process group; integer ids work.
- ui: a 3- or 4-byte UTF-8 character overflowed char[2] on every redraw
(now sp_ui_ascii_char, tested); the scroll offset was taken from one buffer
and applied to another, reading past its end.
Repo
- The test binaries are no longer tracked (.gitignore already said so).
make check: 23 test binaries, green, also under ASan/UBSan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
~/.local/bin/splinter was a shell script that sourced ~/.hermes/.env - another
program's secrets file, which has no business being read here. It is now what
'make install PREFIX=$HOME/.local' puts there: an ELF binary with an rpath of
$ORIGIN/../lib, so it finds libsplinter.so next to itself.
No wrapper, no LD_LIBRARY_PATH, no environment file. Keys come from the
environment the user exports; a delegate names the variable, never the value.
Verified from /tmp with the wrapper and ~/.splinter/env gone:
~/.local/bin/splinter -p 'sage nur: install-ok' -> install-ok
ldd | grep 'not found' -> 0
Also in this round: environment delegates are opt-in (env_delegates), the claude
entry is named after itself instead of its array position, and the docs say how
to install without root.
Approval was a prompt on stdin: the terminal could answer, a phone could not, and
in the TUI the whole path was dead code that failed closed.
Now a request is two files:
~/.splinter/ack/pending/<id> the request (tool, args, why, expiry)
~/.splinter/ack/<id>.answer the answer (yes/no plus who)
The blocked process waits on the file and nothing else. Channels are notifiers -
a command per channel pushes the request out - and whoever reads the reply drops
the answer: the gateway, a phone, a script, another terminal. No second poller,
no lost Telegram updates, no special case per channel.
SPLINTER_ACK_CHANNELS=... comma separated commands, each gets the request
SPLINTER_ACK_TTL=120 seconds; a timeout is a no
splinter --ack <id> yes|no answer from anywhere
splinter --ack-list what is waiting
The terminal is one more channel, not a special case: a thread reads stdin and
drops the answer, while the main path waits on the file like everybody else. Kid
mode uses the same mechanism instead of its own command.
Verified: tests/test_ack.c, 7 checks - request, yes, no, who answered, timeout is
a no, answering a request that does not exist fails, and the pending list shows
the arguments. make check runs it with the other 21.
Skills: ~/.splinter/skills plus any skills_dir from the config. Nothing is
preloaded and the system prompt does not grow - the model asks:
skill_search {query} returns names, one-line descriptions and paths;
skill_load {name} returns the file. Both read-only. A miss says what exists
instead of answering with silence.
Memory: memory_search and memory_add against mem0's REST API. Every request
carries user_id, taken from the account the process runs as ($USER, else the
passwd entry) - deliberately not a config key, because a setting is a thing to
forget and the process already knows who it is. A memory written by root is
invisible to lotherk.
Gateway: it ran without a stream callback, so a provider that only speaks SSE
answered with a stream the non-streaming reader could not parse. It now passes a
no-op callback - nobody to stream to, but the transport takes the streaming path.
tests: test_skills (search, directory form, miss, load, unknown name) and
test_memory (user id from environment and fallback).
Logs: every session keeps ~/.splinter/logs/<id>/session.log (readable, in order,
nothing truncated) and wire.jsonl (request bodies and replies). The agent records
the user's words, the answer, the reasoning, every tool call with arguments,
every observation, failures, and the transport records the wire.
Slash programs: anything executable in ~/.splinter/commands/ becomes /name. It
gets the rest of the line as one argument and its output goes to the *model* as
context, not to the operator as a reply. Two bugs found by trying it: the
directory was derived from --session (so a session elsewhere found nothing), and
the whole slash branch only ran when a plugin host existed, so without plugins
/uptime was never even looked at.
Telegram: a typing thread sends sendChatAction every four seconds while a turn
runs - and only while a turn runs, not while a plugin answers a slash command.
The gateway no longer appends to the session twice (the agent already does).
docs/ROADMAP.md lists what is still open, in the order it should be done.
--daemon long-polls getUpdates, runs one turn per message and replies. The token
comes from ~/.splinter/telegram.token (0600) or SPLINTER_TELEGRAM_TOKEN, never
from an argument: arguments end up in ps and in shell history.
telegram_allow lists who is answered, comma separated, nobody by default - an
empty list is a refusal, not an open door. Unknown senders are logged without
their text.
The loop survives a failed request instead of dying on it, and keeps no state
beyond the session: a restart re-delivers the last update, which costs one
duplicated answer and never a lost message.
test_telegram covers the token paths (file wins, environment as fallback, empty
file is not a token). Verified against api.telegram.org: the token works and
getMe answers hbx_splinter_bot. Sending needs the user to write first - a bot
cannot start a chat, the API says 'chat not found'.
The config moved to ~/.splinter/splinter.conf - next to the sessions, where the
state of this thing already lives - and every *.conf in the directory named after
it is read after it, in name order. A later file overrides an earlier one, an
unknown key is still fatal, and the error now names the file it came from.
plugins/ring is the exit ring: several ways to reach a model, walked in order
when one is rate limited.
exit = go | OpenCode Go | endpoint=... | model=...
exit = groq | Groq free tier | endpoint=... | model=... | key_env=GROQ_KEY
exit = local | kontron, lokal | endpoint=... | model=...
Only pressure moves the ring - 429, 5xx, 'rate limit', 'quota'. A dead host or a
bad key stops the turn, because a ring that treats every failure as 'try the
next one' hides real breakage behind a random provider.
Two things had to be fixed underneath: sp_openai_transport kept its context in a
static variable, so building several transports pointed them all at the last one
(now one heap context per transport), and plugins had no way to read the config
or the registry (sp_host_config, sp_host_registry).
Measured against two fake providers: the first answers 429, the ring moves on and
the second answers 'Antwort vom zweiten Ausgang.'; a dead port does not move it
and the error stands.
Not gettext: this harness is meant to start in ten years, and gettext needs
msgfmt at build time and .mo files at runtime. So catalogues are 'key = text'
files in share/locale, read once at startup.
- language from the config key LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=, else SPLINTER_LOCALE, LC_ALL,
LC_MESSAGES, LANG; regional variants are stripped (de_DE.UTF-8 -> de);
- catalogue search: $SPLINTER_LOCALE_DIR, the executable's own directory (so
works from any cwd), the source tree, /usr/local/share;
- a missing key falls back to English, and a key that exists nowhere is shown as
itself - an empty label hides a bug, a visible key does not;
- UI labels, roles, sidebar headings, status line, command errors and the shell
escape all go through sp_t(); plugins can translate theirs the same way.
test_i18n loads both catalogues from share/locale, checks lookups, the
fallback chain, printf placeholders, and that de.msg covers every key en.msg
has - a translation that silently misses half the UI is worse than none.
Seventeen test binaries green.
The goal is not configuration: it belongs to the conversation in front of you.
So it moved out of the config file and became a command.
- commands are an ABI now: sp_host_add_command / sp_host_command, so the UI
never needs to know a plugin by name. A leading '/' is never sent to the
model; an unknown command lists what exists.
- works in both modes: '/goal <text>' in the TUI and
'splinter -p "/goal ..."' (exit 0 on success, 2 on an unknown command).
- focus registers /goal (set, show when empty of arguments) and /recap (force
a reminder into the next turn, regardless of the five-turn cadence).
Fixed while testing it: the UI only repainted on a keypress, so a plugin widget
that ticks was frozen on screen - the clock showed the time from when the window
opened. The input read now times out after 500 ms and that timeout repaints the
sidebar and status line: clock, focus and cps are alive while you do nothing.
Fifteen test binaries green; test_focus covers the command path too: set, show,
force a recap outside the cadence, refuse an unknown command.
Long conversations drift, and a model ten turns in is deep in a detail while the
reason the session exists has scrolled away. focus puts it back: on every fifth
turn it inserts one system message with the goal and asks whether the last step
was closer to it.
Details that matter and are tested:
- one reminder per turn at most, even if compaction runs twice;
- inserted BEFORE the newest user message, so the model reads goal then request
and answers the request instead of treating the goal as a reply;
- nothing at all without a goal: no goal, no noise;
- the goal comes from the operator (config key goal -> SPLINTER_FOCUS_GOAL),
never from the model, and is truncated with a marker rather than eating the
budget it is meant to protect.
The host now counts turns (sp_host_turn) so a plugin can schedule against them;
that is what makes 'every five' mean five user turns and not five requests.
Sidebar shows the goal and the reminder count. Fourteen test binaries green,
test_focus drives the counter directly: turn 1 silent, turn 2 one reminder
in the right position, a second compaction in the same turn adds none, turn 3
silent, turn 4 the second reminder.
One file, key = value, comments with '#'. /splinter/config (or
~/.config/splinter/config), overridable with SPLINTER_CONFIG or --config,
ignorable with --no-config, generatable with --init-config.
Precedence is command line, then file, then built-in default, and an unknown
key is an error with its line number - a typo that is silently ignored is a
config that lies about what it does. The example file is written and read back
by the test suite, so it cannot rot into something the parser rejects.
What it covers: endpoint, model, api_key_env, transport, cli_cmd, plugin
(repeatable), theme, autonomous, steps, max_bytes, session_dir, system_prompt.
Verified from /tmp with nothing but the word 'splinter': the chat started, the
sidebar showed the configured endpoint, theme, cps and clock widgets, and a
turn against kontron answered 'Ich bin ein grosses Sprachmodell...' with the
session written to /home/lotherk/.splinter.
Thirteen test binaries green (test_config: full file, trimming, unknown key
with line number, missing '=', missing file, example round-trip, env path).
Streaming: the OpenAI transport reads SSE over curl -N and reports deltas as
they arrive. Text goes to the chat pane, a tool-call start to the sidebar, and
a reasoning model's reasoning_content is shown dimmed above the answer instead
of being hidden - which is what made a 143 s turn look like a dead terminal.
Measured against kontron (Qwen3.6-35B, strata-poly): first byte at 11.6 s on a
short question, text growing visibly in the TUI at 7 s and 17 s on a longer one.
test_sse drives the accumulator with recorded lines: plain text, a tool call
split over three chunks, two calls in one turn, a broken data line, keepalives.
Twelve test binaries green.
Defects found while proving it, each fixed or stated:
- typed umlauts were dropped: the input loop accepted ASCII only. Every byte
above 0x1f is kept now and the line is redrawn from the buffer.
- setlocale() was never called, so curses had no encoding at all.
- the vendored NetBSD curses emits Latin-1 bytes for wide characters (ü ->
0xFC) while ncurses passes UTF-8 through; proven with a raw pty dump of both.
The UI therefore transliterates for display (gruen) and the conversation and
session log keep the exact UTF-8. The library defect is written down, not
papered over.
- an answer longer than the screen was skipped by the viewport and the chat
looked empty; draw_history now shows the bottom of the content, including
entries taller than the window.
First run against a real model (Qwen3.6-35B-A3B on kontron, strata-poly)
exposed two things a stub never would:
- our tool schema sent "properties":{}, which tells the model that no
arguments exist. Tools now carry a real JSON schema (echo/command/clock), and
the loop completes a tool round against the 35B: request 1 -> tool_call,
request 2 -> "Das Ergebnis ist: ping".
- an answer longer than the screen was not drawn at all: the entry did not
'fit', so the viewport skipped it and the chat looked empty. draw_history is
now a real viewport (total height, bottom-anchored, entries taller than the
screen start at the offset that puts their end on screen).
Steering: a turn runs on its own thread while the UI keeps reading keys. Enter
queues text the loop picks up at the next step boundary; Ctrl-C cancels; in a
single-step turn the text becomes the next message instead of disappearing.
Curses remains UI-thread-only. A dangling ag->cfg after the turn made a steer
run twice - the caller's config is now restored, and the session log confirms
one user line per steer.
Transports are plugins now (sp_host_add_transport / --transport). plugins/cli
makes any program the model: SPLINTER_CLI_CMD, run through /bin/sh, prompt on
stdin, stdout as the answer, 4 MiB cap, non-zero exit with the program's stderr,
empty output is an error. Verified with sed, with claude -p (2.9 s, answer OK)
and with cat.
Eleven test binaries green, test_cli included.
Compaction is not a flag in the loop; it is a compactor registered by a
plugin and run on the main thread before every request, with the whole
conversation in hand. Returning 1 means changed, 0 nothing to do, -1 failed -
and a failure is counted, not fatal.
lcm: deterministic lossy compression. Over budget, it keeps the leading
system prompt and the last six messages and inserts one system message that
says how many messages went, of which roles, and quotes the head of the
oldest dropped turn. No second model, so a run stays reproducible and costs
nothing extra.
cps: continuous parallel compression. The worker thread decides what would go
from an index it got under a mutex (role, size, 64 bytes of head per message)
and never touches the conversation; the main thread splices the prepared plan
in one pass when the budget is hit. The sidebar line shows applied/prepared
counts or a ready plan, so the claim is visible.
The limit is in both files: they can decide which messages go, not summarise
their text, because the text is not the worker's to read.
Ten test binaries green; test_compactor drives both against their real .so
files, including that lcm leaves the system prompt first, inserts the [lcm]
record at index 1, keeps the tail verbatim, and that cps needs two calls
(prepare, then apply) to change anything.
A plugin is a .so against libsplinter.so, exporting sp_plugin_describe().
The layout changes so there is exactly one copy of each symbol in the
process: all logic lives in libsplinter.so and both the binary and every
plugin link against it. Two copies would have meant two registries.
What the ABI offers:
- tools with the authorization classes the loop already enforces, so the
decision stays in the harness and not in the plugin;
- widgets rendered in the sidebar, one line per widget (name: text);
- a worker thread per widget with tick(), which may block, read files, wait
on sockets - and which cannot touch curses at all;
- sp_host_widget_text() as the only thread-safe write path: the host copies
the string under a mutex, so a stack buffer is safe and the UI never holds
a pointer a worker could free.
Error paths are part of the design: a wrong ABI number is refused with both
numbers in the message, a failed init is reported and skipped, a duplicate
widget name is refused, a tool without a run function is not registered, and
nothing is dlclose()d while a thread might be inside it.
Layout: chat on three quarters, sidebar on one (session, transport, theme,
last-turn numbers, widgets), status bar underneath. The clock example plugin
proves the path end to end - its widget publishes 11:45:23 into the sidebar
from its own thread.
Seven test binaries green; test_plugin loads the real clock.so with dlopen
and checks the worker actually published, plus every refusal above.
Rebuilt from scratch after the previous attempt left no code behind: what
exists here is what compiles and what the tests prove, and nothing else is
claimed.
What is in it:
- a turn loop that refuses an over-budget request before sending it, reports
unknown tools instead of guessing, and honours authorization classes
(read runs, mutate/destructive ask unless --autonomous);
- a registry that is authoritative - the model names a tool, the registry
decides whether it exists;
- an append-only JSONL session (O_APPEND, fsync per record), where a crash can
only truncate the tail and the tail is skipped, not repaired;
- two transports: a deterministic mock (queue of replies, last request kept)
and HTTP via curl(1) with the request body in a temp file;
- two builtins that exist to prove the classes: echo (read) and run
(destructive, reports its exit status as an observation).
Five test binaries, no external framework, no network: mock driver covers the
answer path, a tool round, an unknown tool, a denial, autonomy, a failing tool,
the step limit, the byte budget (asserting that nothing was sent) and a
non-2xx reply.
The wire format is splinter's own line protocol (user/observe out,
answer/tool in); provider adapters translate. That is why the loop is testable
without a model, and why no vendor JSON is parsed in the core.