feat(webui): the Triage session's server side, a sandboxed host, relay, health snapshot and owner-only routes (#1873) #1983

Merged
jason.woltje merged 7 commits from triage-host into refactor 2026-11-16 20:05:52 +00:00
7 Commits
Author SHA1 Message Date
jason.woltje 820f45e474 fix(webui): triage final review, a reply names only a message id the host issued: the relay keeps in_reply_to only when it is an owner message id and drops anything else, so no model-written string reaches the transcript or the GET unchecked; the text cleaner also removes U+061C, U+180E, U+2028, U+2029 and U+FEFF (#1873, lane triage-host) 2026-11-16 14:05:46 -06:00
jason.woltje 2e9a2068bd fix(webui): triage re-check, the organization reads share one deadline, a reply that names its message answers it, every queued message leaves the queue with a host line when the session ends, and a launcher that cannot run is a failed start (#1873, lane triage-host) 2026-11-16 13:23:41 -06:00
jason.woltje fe6c22e0f2 fix(webui): triage-host review, the owner reaches the routes on an organizations Console, a second start answers, an unanswered or undelivered message gets a host line and leaves the queue (#1873, lane triage-host)
P1-1: the organizations branch lets the instance owner's own session through to the two Triage paths;
everyone else still gets this Console's unknown /api/ answer.
P1-2: each start clears turns/, so the runner's numbered turn files do not collide on restart.
P2-1: on exit, a message the session took and never marked read leaves the queue with a host line.
P2-2: member, signed-out, organizations-Console and org-selected route tests.
P3-1: bus-start cards carry --dev-local-owner on a dev local owner Console.
P3-2: a failed start writes a host line; the queue index is guarded.
P3-3: one shared refresh, a unique temp name per write, four organizations read at a time.
P3-4: the restart path waits for stop() inside its two-second exit.
P3-5: ANTHROPIC_API_KEY no longer passes from the route.
2026-11-16 13:23:41 -06:00
jason.woltje 9eed814d3c feat(webui): triage cap, the host holds the route's over-cap answer until its time (at most two days ahead, ISO only) and refuses without asking again; the read shows overCapUntil and a plain cap message (#1873, lane triage-host) 2026-11-16 13:23:41 -06:00
jason.woltje 7ee606cda2 feat(webui): triage routes, GET /api/triage and POST /api/triage/message for the instance owner only; everyone else gets the unknown-route answer, the write needs --send and the same-origin checks, production wires no route so the read says not set (#1873, lane triage-host) 2026-11-16 13:23:41 -06:00
jason.woltje b2d52b57c1 feat(webui): triage host and relay, a sandboxed session on the owner's first message (#1873, lane triage-host)
The Console holds <dataRoot>/triage/ (0700): health/ mounted read-only at
work/health inside the session, agent/ the session's own run directory, and
host/ with the 0600 transcript and the runner's log, never mounted. The seat
package's new hostedBinds and hostedArgv give the session the system part,
the runner's files, the adapter and those two directories, and nothing else
of the data root: no org root, bus socket, config or secrets, and no git
identity. Each source inside agent/ is made fresh at start (rm never follows
a link), and hostedBinds refuses a link in place of any of them.

The spawn environment is PATH (fixed), LANG, LC_ALL, TZ, TERM and the
route's ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY; bwrap
sets HOME and TMPDIR. A route answer whose harnessEnv names MOSAIC_CONFIG,
a MOSAIC_BUS_ variable or a founder credential variable is refused.

The relay is the only broker the runner reaches. It answers the runner's
lifecycle verbs with fixed answers, hands over the owner's messages, and keeps
a message.send only when it is addressed to "human": its text goes to the
transcript with its cards checked. Every other verb, a send to anyone else
and a call without the capability are refused with triage-refused.

The model route is injected; without one nothing launches (triage-no-route),
and a route over its cap refuses with triage-over-cap and its until. The
tests run the session end to end under bwrap with a stub adapter.
2026-11-16 13:23:41 -06:00
jason.woltje cbf1836bd7 feat(webui): triage health snapshot and command cards (#1873, lane triage-host)
The snapshot is one 0600 JSON file with a fixed field list: the Console's
answer, the model proxy unit, the system config check, and each active org's
bus state, last start, processing and org config check. States, times, counts
and codes only; a read that fails or hangs says "not read". The system config
check runs scripts/mosaic-config.mjs validate in a child with stdout ignored and
keeps the exit code and one fixed refusal code; the org config check keeps its
exit code only. Cards are { step, org } with a known step and a registered org;
the server renders the command and drops anything else.
2026-11-16 13:23:41 -06:00