3543 Commits
Author SHA1 Message Date
sam 3dcc8da0de fix(runs): find an unattended action's effect under the agent loop's key, which names the agent 2026-11-16 05:19:14 +11:00
sam a2972ac5d6 feat(governance,approvals): people with verified identities, default owner, escalation path and attempts per run; an answer from an unverified identity is refused (#2007) 2026-11-16 05:18:39 +11:00
sam 85e6f8eb40 feat(runs): an action started before a crash is reported unknown on resume and never run again, and the owner is told (archie #2015) 2026-11-16 05:18:05 +11:00
sam 55077620bb feat(judgement,connectors): guard extension contract; every running guard judges with the built-ins and records its name and digest (archie #1986) 2026-11-16 05:17:58 +11:00
sam 400699cfbb feat(runs): a run is pinned to the workflow version it started with and fails clearly when it changed (archie #2014) 2026-11-16 05:04:30 +11:00
sam a0385a56c7 feat(memory,runs,governance): remember each target's incidents, cite them in a run, and propose a root-cause fix after K with one cause (archie #1993) 2026-11-16 05:04:15 +11:00
sam 22aee72679 feat(judgement,approvals,governance,ui): a class earns a raise after N approvals and drops on denial or failure; a freeze holds changing actions (#2004) 2026-11-16 05:03:24 +11:00
sam ff58c8e39b fix(approvals): a request shows the action's exact input, and an answer reads 'via' its channel (archie #1984) 2026-11-16 04:51:22 +11:00
sam 25007e8316 feat(runs): an agent that describes an action without calling it gets one more turn to call it (archie #1999) 2026-11-16 04:39:49 +11:00
sam b9dd744f8c fix(pg): number the action classes migration after the schedules one, so it applies in order (archie #2003) 2026-11-16 04:37:11 +11:00
sam a91df7ec1f feat(judgement,approvals,ui): action classes are records with a level, history and reset; the precedent guard reads the class level (#2003) 2026-11-16 04:35:12 +11:00
sam 5712c9c4e6 feat(events,approvals): triggers fire on an interval, and an expired approval is escalated on every channel (archie #1992) 2026-11-16 04:33:28 +11:00
sam 1f5163092b feat(runs,approvals,ui): a run's trail joins each action's verdicts, approval and effect, and the run view shows them in order (archie #1996) 2026-11-16 04:33:27 +11:00
sam 4e1f1b3c4d feat(connectors): an accepted package can be removed, and a secret engine credentials still use is refused (archie #2013) 2026-11-16 04:31:29 +11:00
sam 1b8eb362d2 fix(prompts): the agent calls a lookup it would recommend instead of ending on it (archie #1999) 2026-11-16 04:24:38 +11:00
sam 7903a0e225 feat(connectors,deliveries,events): channels are connectors that deliver and listen; messages retry from their rows, and answers arrive as events (archie #1984, #1985) 2026-11-16 04:22:52 +11:00
sam 3a700cddfa fix(connectors,runs): an approved action runs as judged however its input was re-encoded, and one that can't be confirmed is reported as unknown (archie #1985, #1990) 2026-11-16 04:08:15 +11:00
sam 0238f247e5 feat(approvals): a held action is asked of a person, and the run waits for the answer (archie #1985, #1999)
An action judgement holds at propose and wait is no longer a dead end. The
new approvals module owns the request: it binds to the decision and the
action's digest, so an answer covers the action the person was shown and
nothing else, and it settles once. The answer wakes the run, which judges the
action again and runs it only as the approval allows: a refusal still refuses,
an altered input runs nothing, and a judgement that came back worse runs
nothing on that approval.

The composer carries the request as a message with the request id and its
deadline, and its answer is a message too, so the trail shows what was asked
and what was answered. A request nobody answers inside its deadline is settled
as expired and nothing runs.

How long a request waits is an organisation setting, edited in the dashboard
and stored in milliseconds, because a Postgres interval scans as text. A run
pins the deadline it started with, like its model.

An agent that proposes the same action twice is asked about it once, and the
notification says when the investigation proposed nothing at all.
2026-11-16 02:21:06 +11:00
sam e594ec3780 chore: cleanup unused files 2026-11-16 02:04:45 +11:00
sam 200c6d0928 fix(prompts): the investigate prompt tells the agent to call the action it recommends (archie #1999)
It also said its tools only read, which stopped being true when actions became tools. Judgement decides whether an action runs, so calling one is the proposal.
2026-11-16 01:39:32 +11:00
sam 0dbf241106 feat(judgement): the weakest-link decision, and executing only what was judged (#1986, #1989, #1990, #1988)
A new judgement module assesses one concrete action: hard rules refuse before
any guard runs; every guard sets a ceiling and the action runs at the lowest;
a guard that fails, panics or gives no ceiling holds it at propose and wait;
an advisory verdict is recorded and sets no ceiling. Reversibility and
Precedent (the fresh-install class default) are the first guards. Every
decision is recorded with its verdicts and class, and the run's trail lists
them. Agent tools now offer connector actions too: each call is assessed and
executed only as decided and only with the judged input, and a held action
comes back to the agent as a failed call naming its level and findings.
Tools gain Resolve, so an MCP server's declared effect reaches judgement.
2026-11-16 01:05:29 +11:00
sam af753290e7 chore(deps): ai-sdk v0.8.0 2026-11-16 00:54:21 +11:00
sam a6644c20cd fix(connectors): accepting a connector writes an empty tool list, not NULL
Since the MCP migration made accepted.tools NOT NULL, the connector and secret
engine accept path never set it, so re-accepting any connector failed with a
not-null violation.
2026-11-16 00:44:02 +11:00
sam 4877362223 fix(runs): a step hands back its value as recorded, so a resumed agent doesn't diverge from its journal (#1977)
Killing the binary mid-investigation and restarting it failed the run: the
first model request after the resume didn't match the recorded one. The tool
schemas pinned in a step reached the live attempt as written but the resume
as stored, and both the v2 encoder (compacting raw JSON) and jsonb (reordering
keys) rewrite them. Step now returns the decoded recorded value on the live
path too, and runs.steps.output is json, which keeps the text as written.
2026-11-16 00:36:19 +11:00
sam 0335872701 docs(deliveries): deliveries is transport; approvals own the request and its answer 2026-11-16 00:28:29 +11:00
sam eb9d470ba8 fix(runs): the forecast figure is in hours, so the model doesn't convert it (archie #2005) 2026-11-16 00:16:14 +11:00
sam a3d32e92e5 feat(runs): the investigate prompt names the labels and the figure (archie #2005)
An alert about a filesystem carries instance and mountpoint, and those are the
labels the forecast query needs, so the prompt names both and gives the query
that answers what an operator asks: the seconds until the disk is full, from
predict_linear and deriv over the same window. A negative figure is the
filesystem not filling, which the prompt says to report as that rather than as
a time.
2026-11-16 00:13:13 +11:00
sam deb3865d75 chore: use generic host names in a deploy comment and test labels 2026-11-16 00:13:04 +11:00
sam 6d97f62929 fix(runs,pg): grant the runtime role on sequences, and read a missing result as null (archie #2005)
Two faults stopped an investigation from finishing on staging.

The runtime role was granted DML on every table but nothing on sequences, so
the first table keyed by a serial (deliveries.messages) failed its insert with
"permission denied for sequence messages_seq_seq", failing the run at its
notification step.

A run that failed has no result, and a step with no output is recorded as NULL;
the rows were read straight into jsontext.Value, which can't hold NULL, so the
trail API answered 500 for exactly the runs and steps that needed reading. The
reads coalesce to JSON null instead.

Verified on staging after deploying: the same run's trail reads back.
2026-11-16 00:09:46 +11:00
sam 18d1e07a21 fix(dashboard): one pattern serves the page and the API catch-all (archie #2005)
The dashboard registered "/api/" and then "GET /", which ServeMux refuses:
"GET /" names fewer methods than "/api/" but a more general path, so a binary
with the dashboard built in panicked on start. Staging went down on the deploy
that first shipped both.

One handler behind one pattern decides instead: an unclaimed /api/ path is a
JSON 404, the page is read-only, and everything else is a route inside the SPA.

The test reproduces the panic against the old routing, and pins what each path
answers.
2026-11-16 00:05:02 +11:00
sam cf249d7643 feat(connectors): MCP servers as a fourth accepted package, with their declared tools offered to agents (archie #2005)
An investigation needs Prometheus's own metrics, and Prometheus publishes an
MCP server, so the connectors module now runs MCP servers as published instead
of wrapping them: a stdio binary in its own user and network namespace with an
egress allow-list, or an HTTP endpoint dialled through declared egress.

Acceptance names the transport, the tools it permits, and the credential slots
that resolve into the server's environment (stdio) or Authorization header
(HTTP). Each permitted tool is declared as a lookup, or as an action with its
effect; a tool the server lists but the acceptance doesn't name is never
offered, and a declared tool the server doesn't list fails the start rather
than going silently missing. Declared tools reach agents beside connector
lookups through the same declaration and the same call path, with the server's
own input schema, under a name no connector can take: an accepted name runs one
package.

A server that fails to start, exits or stops answering is reported by readiness
and reconnected with backoff. Tool calls carry a deadline, results are capped,
and an error result fails its call with the server's own text rather than the
run.

The investigate prompt now asks for a time-until-full figure from
`predict_linear` through the metrics server instead of an estimate from raw
points.

The old core MCP path stays for now: the legacy gateway and task containers
still read config.Tools.MCPServers, so it goes with them.
2026-11-15 23:43:39 +11:00
sam 66220e1752 feat(runs,deliveries): the decision trail, the composer channel, and the dashboard that shows them (#1996, #1984)
GET /api/runs/{id} assembles a run's trail from rows already kept: the event
and trigger that started it, each workflow step, and each model and tool call
from the agent's journal. Investigations end by notifying their findings on
the composer, whose messages are read from a cursor with a live stream that
only says when to read. The binary serves its own SPA entry, archie.html,
calling only the new API. The investigate prompt now treats the event as a
claim to check against what it measures.
2026-11-15 23:36:42 +11:00
sam 93c9eb51f3 fix(deploy): let the staging container confine extensions in user and network namespaces
Docker's default seccomp profile refuses the clone the extension host
confines with, so a connector that declares egress couldn't start. The profile
is Docker's default plus that clone, limited to the user and network
namespace flags.
2026-11-15 22:21:03 +11:00
sam e787a79af4 feat(connectors): credentials sealed with age, and secret engines that resolve them (#1977, #1982)
Credentials are typed (machine, age), write-only through the API and sealed
to the age identity in the bootstrap config. A field holds a value or names a
secret engine key; connectors and engines are accepted with credential slots
that resolve into their Configure secrets. The secret engine contract gains
secrets so an engine can receive its own key.
2026-11-15 22:14:26 +11:00
sam 777b17acf7 chore(deps): pin ai-sdk v0.7.0 2026-11-15 21:59:09 +11:00
sam 02df83ccb7 feat(runs): the in-process agent loop, checkpointed as run steps, and the investigate workflow (#1977, #1889)
The agent model is an organisation setting in the new governance module.
Every model and tool call is a journal step, so a killed run resumes without
repeating either. Agents are offered connector lookups and read-only actions
only, until judgement exists.
2026-11-15 21:49:53 +11:00
sam 68d81fbbd0 refactor: the single binary uses encoding/json/v2 and jsontext (#1977) 2026-11-15 18:11:37 +11:00
sam 75c3d2b096 style(events): gofumpt the event view 2026-11-15 18:07:57 +11:00
sam e898acedc8 fix(events): the events API returns a JSON view, not the row struct (#1980) 2026-11-15 18:07:28 +11:00
sam b89d9e0f05 feat(events): hear Alertmanager through its connector: verified intake, dedupe, links, triggers that start runs (#1980, #1978) 2026-11-15 18:05:38 +11:00
sam 58858f0d92 feat(connectors): the connector contract and its confined extension host (#1979) 2026-11-15 17:24:31 +11:00
sam 8b64ab0afe refactor(runs): Step, Sleep and Wait are generic methods on the run context (#1977) 2026-11-15 17:17:09 +11:00
sam e8366683a9 feat(runs): durable run engine with step checkpoints and lease-fenced writes (#1977) 2026-11-15 17:14:05 +11:00
sam 99a3d675a8 chore(deploy): staging stack for the single binary on nebula (#1998) 2026-11-15 17:05:53 +11:00
sam a69a0ea942 feat(archie): the single binary's skeleton: bootstrap config, migrations under an advisory lock, health (#1977) 2026-11-15 16:59:21 +11:00
sam 9cd31e48ca fix(openshell): sandboxes install scoped npm packages; egress endpoints allow encoded slashes (#1864) 2026-11-15 00:12:07 +11:00
sam 998c72f8d3 fix(agentworker): the agent works from its worktree, so a resumed stage in an OpenShell sandbox finds the repository 2026-11-15 00:07:29 +11:00
sam 7a311a3c74 fix(taskactions): a person's own action no longer reads 'no authorising principal'; delegated ones say on whose behalf 2026-11-15 00:04:06 +11:00
sam e78cb1e63e fix(webhookguard): token counts in task logs keep their value; secrets under token keys stay redacted (#1720) 2026-11-14 23:42:46 +11:00
sam 14e2474a49 feat(ui): workflow list shows triggers, steps, last run and delivery with an inline enabled switch; the workflow page header carries them too 2026-11-14 23:11:38 +11:00