Commit Graph
24 Commits
Author SHA1 Message Date
Konrad 3c5cdaf53a splinter: delegations are tasks too, and the status line is alive
A delegate is work someone else does while we wait, so it belongs in the task
panel with its own clock. The tasks plugin now publishes sp_task_ops through the
host, and delegate.c opens an entry before the call and closes it with status and
rough token count after - 'who is still running' becomes a fact on screen instead
of a guess.

Measured status line, live during a turn:

  splinter 0.1.0  clock: 19:12:56  |  ctx 4.0k  |  12 tok/s  |
  4.0k in / 238 out  |  tasks 0/4          Delphinium 19178ms

Not yet observed: a delegate entry in the panel. Both test configs had no
reachable delegate (one endpoint dead, one with no defers at all), so the cycle
open -> close never ran against a real call. The wiring compiles and the task API
is exercised by task_start/task_list; the delegate half needs one live delegate to
prove.
2026-11-08 19:13:44 +00:00
Konrad 3f65dfdc4c splinter: a status line that plugins can write
New host API for it: sp_host_add_status() takes a named renderer, and
sp_host_status_text() joins the segments with '  |  '. The numbers a plugin shows
come from the harness through struct sp_meter - context used and window, session
tokens, cache hits, tokens per second, running tasks. A plugin that counted for
itself would drift from the harness within one turn.

plugins/status renders clock, ctx with a 24 column bar, cache, tok/s, tokens in and
out, cost and task count. Prices are configuration, not knowledge:

  SPLINTER_CTX_MAX=32768 SPLINTER_PRICE_IN=0.3 SPLINTER_PRICE_OUT=1.2

Without prices the cost segment says nothing instead of inventing a number.

Also fixed: the status.so recipe compiled kids.c, so the plugin that loaded was
the kid mode with a different name - the reason seven status registrations
produced an empty line.

Known open: the segments compose (probe: 'clock: 17:28:14  |  ctx 0/32.8k
[........................] 0%  |  0 in / 0 out  |  $0.0000') but the bar still
draws only the title - not yet isolated.
2026-11-08 17:29:01 +00:00
Konrad c0ec7bacd4 splinter: kid mode enforces the day, and the site speaks Portuguese
The daily budget was advisory: the gate refused tools and a system message asked
the model to close the day, but a chatty model answered anyway. So the core grew a
turn gate - a plugin can now refuse the whole turn before the model is called:

  Fuer heute ist Schluss: 60 von 30 Minuten sind verbraucht. Morgen geht es weiter.

That sentence comes from the plugin, not from a model that was asked to obey. No
model call, no tokens, no way around it by talking.

Also fixed: one-shot mode printed only a newline when the transport streamed
nothing (a turn blocked before the stream), so the answer vanished. It is printed
when no bytes were streamed.

Website: third language, index.pt.html, generated from the same source; the
language bar on all three pages links all three. check_i18n now sees 51 keys in
three catalogues.
2026-11-08 16:02:21 +00:00
Konrad f3174c0296 splinter: kid mode, and Portuguese (Brazil)
Kid mode plugin: a parent approves every action that changes something, a
whitelist lets the harmless ones through, and the model is told to stay
age-appropriate on every request (not once at the start, where it gets buried).

The core grew one hook for it: a gate. A plugin's gate sees tool, class and
arguments before the operator prompt and before the authorization class, and
answers allow, deny with a reason, or no opinion.

  allowed  -> the call runs, the operator is not asked
  denied   -> the model gets 'denied: <reason>' and cannot retry around it
  silence  -> the normal rules apply

	A whitelist entry is '<tool> <glob>' in ~/.splinter/kids/allow:
	run ls*
	read *

	Parents are reached through SPLINTER_KIDS_APPROVE_CMD, which gets the request
	as its argument and answers with its exit status. No channel means no
	mutating work at all - it fails closed, like the operator prompt it replaces.
	A timeout is a no.

	Measured: 'run' was denied with 'ein Erwachsener hat nicht zugestimmt
	(abgelehnt)', the parent channel recorded the request, whitelisted 'ls'
	went through.

	Daily budget: SPLINTER_KIDS_DAILY_MINUTES, counted per step, stored per day in
	~/.splinter/kids/usage, reset at midnight. When it is gone the gate refuses
	every tool including reads.

	pt_BR: a full catalogue (51 keys, 3 languages). Language detection now keeps
	the region - pt_BR and pt are different catalogues and a Brazilian child
	should not be handed European Portuguese - and falls back to the bare
	language before English.
2026-11-08 15:56:20 +00:00
Konrad 41662a7293 splinter: delegates on other hosts, and the first-run interview
A delegate may name a host; the whole invocation then goes through ssh, so
claude, opencode or another splinter run on that machine. delegate and
delegate_parallel both honour it, and the report names the host like any other
model. The environment does not cross the jump: a cli delegate carries its
command explicitly (quoted, because ssh rejoins its arguments into one remote
shell command), and the remote host supplies its own keys.

Proven: a delegate with host=172.25.206.16 ran on olivia and answered through a
provider only reachable over the wireguard link.

--interview asks seven questions once - language, who you are, stack, style,
what never to do, sacred paths - and writes ~/.splinter/profile/<user>.md. Enter
skips a question and the skip is recorded as a skip. Starting the chat without a
profile prints a hint.

Two bugs found while testing: the stdin intake ate the interview's answers before
it could ask, and the question texts carried literal \n because of how the file
was written - both fixed and verified by running the interview with piped
answers and reading the resulting profile.
2026-11-08 14:50:16 +00:00
Konrad e4f25b481f splinter: sessions belong to a directory, and splinter as an MCP server
Every session records the directory it was started in (<id>.meta, cwd=). With
that, '-c' means the last session that happened *here*:

  cd ~/src/splinter && splinter -c

A session from another tree is never silently loaded; if nothing happened in this
directory yet, it says so and exits. Verified in three directories - two report
no session, the one with history resumes.

folder_history gives the model the folder's memory instead of a guess: sessions
started there, newest first, with turn count and the last question.

--mcp-server-listen IP --mcp-listen-port N serves the registry over MCP
(newline-delimited JSON-RPC on TCP): initialize, tools/list, tools/call. Read
tools are served; mutating and destructive ones are refused unless the server was
started with --autonomous - a remote agent does not run shell commands here
because it asked nicely.

Proven with a real client on 127.0.0.1:8097: handshake answers splinter 0.1.0,
tools/list reports 14 tools, tools/call list returns the directory, tools/call run
is refused with the authorization message.
2026-11-08 14:35:29 +00:00
Konrad d8c94edb55 splinter: providers from the environment, prio and max_parallel
OLLAMA_KEY, OLLAMA_KEY_0.._N and CLAUDE_CODE_OAUTH_TOKEN, _0.._N are enough to
fill the harness: every Ollama key becomes a delegate and an exit in the ring,
every Claude token becomes a cli delegate running 'claude -p'. Several keys mean
several accounts; the ring walks them.

That is the workflow the tool exists for - a strong model plans and defines the
work, the local models implement it, delegate is the handover:

  OLLAMA_KEY=... CLAUDE_CODE_OAUTH_TOKEN=... splinter --choose 'plane die arbeit'
  claude-3   score=4   prio=10   task mentions 'plan'
  OLLAMA_KEY=... splinter --choose 'implementier das'
  ollama-2   score=3   prio=0    task mentions 'implement'

Delegates also take prio (tie-break, higher wins) and max_parallel (default 1,
a busy delegate says so instead of queueing silently). kind=cli with cmd=... runs
a program instead of an endpoint.

Keys travel in the environment, never on a command line or into a log.
test_config covers the scan, test_delegate the prio tie-break.
2026-11-08 14:05:48 +00:00
Konrad a720b67cb0 splinter: session logs, slash programs, telegram typing
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.
2026-11-08 13:25:53 +00:00
Konrad 3ae2b8f74d splinter: gateway mode, answers on Telegram
--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'.
2026-11-08 13:00:47 +00:00
Konrad 04420d9f8d splinter: exit ring, config next to the sessions, drop-ins
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.
2026-11-08 12:55:42 +00:00
Konrad 781e7eb514 splinter: delegation to configured models, chosen by splinter
A delegate is a line in the config - id, what it is good at, tags, endpoint,
model. No profiles: a profile is a directory of files, and this needs a line you
can read at 2 a.m.

The delegate tool takes a task and optional tags. The pick is code, not a guess:
requested tag 5, tag in the task 3, description word 1, ties to the earlier
entry. The observation opens with the choice and the reason, and --choose prints
the same decision without running anything:

  coder   7   task mentions 'code'
  quick   5   task mentions 'chat'
  coder   3   task mentions 'refactor'

The child is splinter itself in one-shot mode - same tools, own context, own
endpoint and model. Classed destructive, because it runs a whole agent; the
operator approves the delegation once.

test_delegate pins the decisions, including the two cases that must not pick
anything: no matching tag and no delegates at all.
2026-11-08 12:38:57 +00:00
Konrad e128d679e4 splinter: write and edit show a diff
A mutate tool that says 'wrote 23 bytes' tells the operator nothing. write and
edit now put a one-hunk diff into the observation - common prefix and suffix as
context - so the model sees what it did and the transcript shows it as its own
'anderung:' entry.

One hunk, not a general diff algorithm: a tool changes one place, and the point
is to see which. Verified against kontron: asking for an edit produced

  @@ -1,2 +1,2 @@
   zeile eins
  -zeile zwei
  +zeile zwei geaendert

and the file on disk really was changed.
2026-11-08 12:32:24 +00:00
Konrad be947d61d8 splinter: resume, and an MCP client
--resume loads the newest session in the directory into the conversation and
shows it. The first version opened a fresh id beside the old one and resumed
nothing while claiming to; it now picks the newest sess-*.jsonl before the id is
generated. Verified: a session that was told 'die Zahl ist 4711' and restarted
with --resume answered '4711' when asked.

plugins/mcp speaks MCP over stdio: handshake, tools/list, and each server tool
registered under its published inputSchema - not an empty object, because a tool
whose parameters the model cannot see gets called with nothing.

Two bugs the tests would not have caught without a real server:
 * the reply id was matched with strstr(), and servers that write "id": 1 lost
   the match - the client waited for a reply it already had;
 * tool descriptions pointed into the parsed reply and dangled once it was
   freed, so the request carried garbage bytes and the endpoint answered 500.

Also SPLINTER_DUMP_REQUEST=<path> now keeps the request body; finding that
garbage meant seeing what was actually sent.
2026-11-08 09:49:12 +00:00
Konrad c8b382c84e splinter: file tools, and approval asked on the screen
The harness had echo, run and clock - a chat with a shell. A coding agent needs
to look at a file, change one, find something, list a directory:

  read   (read)   numbered lines, offset/limit, refuses binary, says where it
                  stopped
  search (read)   literal search over a tree, capped at 100 hits
  list   (read)   a directory
  write  (mutate) up to 4 MiB
  edit   (mutate) exactly one occurrence; a non-unique 'old' is an error
  run    (destructive, already there)

Approval was dead code in the chat: ask_operator() read stdin, which a curses
program cannot do without eating its own keystrokes, so with --autonomous off
every mutate tool was silently denied ('fail closed'). The agent now asks through
a callback; the UI puts the question in the prompt line and parks the turn
thread on a condition variable until y or n arrives.

Measured against kontron: prompt appeared 6 s into the turn, 'y' ran the tool and
the answer carried its output; 'n' left the target file absent and the model saw
'error: denied by operator'.

test_builtin covers the refusals, not just the happy path: ambiguous edit writes
nothing, binary read reports instead of spraying, missing arguments say what is
required. README no longer claims there is no tool-call parser and no compaction.
2026-11-08 09:29:48 +00:00
Konrad fd72b688c1 splinter: Ctrl-C actually cancels, and no fixed /tmp
Pressing Ctrl-C killed the harness. cbreak() leaves ISIG on, so the terminal
driver turned the key into SIGINT and the process died before wgetch() could
return 3 - the 'Ctrl-C cancels' line was a claim, and one keystroke disproved it.
raw() hands every byte to the program.

Cancelling a turn also only took effect between steps, so a request in flight
kept running to completion. The transport used popen(), which returns a stream
and not a process id, so there was nothing to kill. It now forks and execs,
keeps the pid, and both the read loop and the streaming loop poll with a 200 ms
timeout and SIGKILL the child when the turn is cancelled. Measured: Ctrl-C during
a streaming request returns to the prompt in 510 ms and the UI survives.

Temp files no longer use a fixed /tmp path: $TMPDIR, then /var/tmp. Three sites,
including the cli plugin, and they carry the conversation, so the path is now a
512-byte buffer built at runtime instead of a literal.
2026-11-08 09:12:23 +00:00
Konrad 554b4c97b8 splinter: tool calls with arguments, newline-aware rows, complete i18n
Four things, three of them reported by the operator.

1. Rows are counted from the real line structure. The old arithmetic
   (strlen/cols) assumed one long line; a model's reasoning is full of '\n', so
   the true height was far larger than the estimate and the text painted over
   the answer below it - 'it just goes anywhere on the screen'. text_rows() and
   row_offset() split on newlines first, then wrap. entry_lines() now measures
   the string that is actually drawn ('role: text'), which also fixes the last
   character of an entry being cut off (a truncated code fence).

2. Tool calls are visible: the agent's tool_begin hook fires before each call,
   the UI drains the list under its lock and writes 'werkzeug: run
   {"command":"echo a"}' into the transcript; the one at the top of the live
   area shows the call while it runs. The reasoning entry is inserted before
   those lines, so the transcript reads du, denkt, werkzeug, modell.

3. The chat pane has a black background, and the status line sits between the
   pane and the prompt, the way Hermes shows it.

4. i18n is complete: every remaining literal in ui.c, main.c and the plugins
   goes through the catalogue, including widget texts and format strings.
   sp_td() carries a compiled-in English default, so a missing catalogue can
   never drop a printf placeholder. tools/check_i18n.py runs in make check and
   fails when a key used in the code is missing from any catalogue, or when a
   catalogue key is used nowhere.

Seventeen test binaries green.
2026-11-08 08:11:09 +00:00
Konrad 8fa3e9d7bb splinter: /goal as a command, and widgets that are actually alive
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.
2026-11-07 20:50:58 +00:00
Konrad 95a57fdbbc splinter: exact token counts from the provider's usage block
The sidebar counted characters and guessed tokens. The provider reports the
real numbers in the final chunk (prompt_tokens/completion_tokens, or
input_tokens/output_tokens), so both the streaming accumulator and the
one-shot reply parser now keep them, the agent sums them per turn, and the
sidebar shows '79 tok (in 344)' instead of an estimate. The estimate stays as
the fallback for endpoints that report nothing, and it is still labelled as
one.
2026-11-07 19:48:32 +00:00
Konrad 5c07b32478 splinter: streaming, thinking, and three defects the real model exposed
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.
2026-11-07 18:55:16 +00:00
Konrad 50bc6751b2 splinter: real-model fixes, steering, cli transport
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.
2026-11-07 15:43:47 +00:00
Konrad b8295ea474 splinter: compaction as plugins (lcm, cps)
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.
2026-11-07 13:44:43 +00:00
Konrad 15581139d5 splinter: conversation, OpenAI adapter, end-to-end over HTTP
Splinter can now talk to a real endpoint: --endpoint plus --model shapes the
whole conversation into one chat/completions request and parses the reply back.

The seam changed from a raw string to the conversation, because a provider
adapter cannot invent history and the loop must not depend on vendor JSON:

- sp_conv: owned messages (role, name, call_id, content, raw tool_calls),
  geometric growth, trim from the front. Copy on push, so a compaction step
  must produce a new array - which is what makes it reviewable.
- sp_openai_request(): conversation + tool table -> JSON body.
- sp_openai_reply(): choices[0].message -> content + calls, and it keeps the
  provider's raw tool_calls array to hand back verbatim next round.
- provider error objects, empty choice lists, non-JSON bodies and empty bodies
  each produce a distinct, quoted error instead of a silent empty answer.
- transport_openai: curl, body through a temp file, status from curl's -w, key
  from the environment only.
- libmcp's JSON parser is vendored and instantiated exactly once (src/json.c);
  two instantiations would be a link error rather than a silent duplicate.

Proven end to end against a local stub speaking the real wire format:
request 1 (1 message, 2 tools, 448 bytes) -> tool_call for echo; splinter ran
the tool, request 2 (3 messages, 682 bytes) -> final text; the session log
holds user, observation, assistant.

Nine test binaries green, including test_openai (request shape, tool_call
parsing, raw array kept, four failing reply shapes) and test_conv.
2026-11-07 13:34:26 +00:00
Konrad e4f910cc4e splinter: plugin ABI, widget sidebar, libsplinter
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.
2026-11-07 11:47:47 +00:00
Konrad 10e59f23ac splinter 0.1.0: loop, registry, session, transports, tests
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.
2026-11-07 08:06:34 +00:00