Compare commits

..
433 Commits
Author SHA1 Message Date
sam 6a3bf5a71a refactor(governance): open role identifiers and guard policy lockout with Cedar (#2017)
deploy / agent-image (push) Skipped
deploy / plan (push) Successful in 3s
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / gate (push) Failing after 8m2s
Carried policy lockout guard from internal/app/statestore/policy_guard.go.
2026-11-18 02:29:06 +11:00
sam 0218e4ec89 feat(governance): move identity, org and Cedar access engine into governance (#2017)
Copied from internal/domain/identity, internal/domain/org, internal/domain/access, internal/infrastructure/access and internal/infrastructure/postgres.
2026-11-18 02:09:29 +11:00
sam ce70d4f3ee feat(runs): workflow documents take today's step shape, references and when (#2039)
A step is id/type/settings with when and on_failure; the five kinds become
the types agent.run (inline mission), connector.action, approval.wait,
run.notify and workflow.sleep. Documents declare inputs, repository,
instructions, identity and profile; references are {{ task|inputs|steps }}
checked at save. Any number of approval steps, each asking only about what
was held since; actions still held at the end are put to people before the
run finishes. Triggers are refused for a workflow they can't start, and the
workflows API lists, reads and saves documents beside a step-type catalog.

Copied from internal/domain/workflow: definition.go, step_refs.go,
step_flow.go's checks, control_steps.go's when parser, vocabulary.go and
task/interface.go. stableid moves to internal/platform.
2026-11-17 18:43:45 +11:00
sam 83613d902a docs: format the docs 2026-11-17 17:53:58 +11:00
sam 1026d5e3b6 feat(httpapi): the API is described by an OpenAPI document generated with Huma (#2028)
Every /api operation is registered with Huma behind one admin-token
middleware, served at /api/openapi.json with a docs page at /api/docs,
and committed as api/openapi.yaml, which task check keeps current.
2026-11-16 20:05:05 +11:00
sam ee4c3f9c16 docs(agents): old code moves into its module; a rewrite or a deletion needs a verdict in the move map (#1977) 2026-11-16 15:52:21 +11:00
sam 21de660ae1 test(system): the rotation fixture uses a listen address without an IP (#2026) 2026-11-16 13:48:07 +11:00
sam 52b027955b feat(connectors): a secret setting is resolved through its engine before the extension starts (#2026) 2026-11-16 13:46:48 +11:00
sam e2917420fb feat(ui): the dashboard edits every control-plane setting (#2026) 2026-11-16 13:45:20 +11:00
sam c226c4f686 feat(system): bootstrap values are read-only and the admin token rotates into the config (#2026) 2026-11-16 13:45:18 +11:00
sam 9e2cf252ac feat(judgement): the Controls API reports each guard's judge, its standing and its eval date (#2026) 2026-11-16 13:45:18 +11:00
sam 9fe446a426 feat(governance): the agent model names a credential and answers a test call (#2026) 2026-11-16 13:45:15 +11:00
sam 20d81258ac feat(events): sources, triggers and filtered events are listed for the dashboard (#2026) 2026-11-16 13:45:15 +11:00
sam 053ed58c08 feat(connectors): an extension declares the settings it reads, and each accepted package is listed (#2026) 2026-11-16 13:45:12 +11:00
sam 546e5cd6ef refactor(ui): hard rules and change-request rules are Controls, not Policies, which stays the access model (archie #1977) 2026-11-16 13:23:09 +11:00
sam 2f802e04a4 Merge branch 'worktree-agent-a1bd90c329b751a72' 2026-11-16 12:06:07 +11:00
sam 124d2033fc feat(guard): a judge record keeps the request, response, path, status and latency of every model call 2026-11-16 12:06:05 +11:00
sam 46372b51d5 feat(runs,ui): the trail shows each model request and response, connector calls and delivery attempts
The run trail exposes the model request the journal recorded and its finish reason. Each model and tool step opens a Request and a Response, and each decision lists the connector calls behind it. The composer lists each delivery attempt with its outcome and response.
2026-11-16 12:06:05 +11:00
sam db36d853ce feat(deliveries): every attempt keeps its response, its error and how long it took
A delivery.attempts row is written with the success or failure the store already records. The composer API returns the connector attempts that carry each message, so the dashboard can show each attempt's outcome and response.
2026-11-16 12:06:05 +11:00
sam 4b97ac5841 feat(audit): a connector call keeps the request core sent and the response it received
Resolve, target facts, invoke, lookup, deliver and parse record the protobuf wire messages as JSON on the context recorder the owning module supplies. Credentials are redacted and a body over 1 MiB keeps its prefix, full length and SHA-256. Judgement stores the resolve and target facts in the decision body and appends the executed invoke to it.
2026-11-16 12:06:05 +11:00
sam e909aee155 refactor(ui): the Unmatched page lives at /unmatched, matching the nav label (#1994) 2026-11-16 12:06:04 +11:00
sam 564339e1aa feat(events,runs): an event keeps the payload it arrived in, and every model call records the request it sent via ai-sdk v0.8.1 (audit requirement) 2026-11-16 11:54:50 +11:00
sam e45fee9bc9 fix(runs): a held action is described to the agent as waiting for approval, not a person's 2026-11-16 11:48:05 +11:00
sam 4cdb5996c5 feat(guard): a model judge's answer, basis and eval standing are recorded in every verdict, clean answers included (audit requirement) 2026-11-16 11:12:15 +11:00
sam 4657ff2646 fix(runs): a workflow summary names approval, not a person, as what holds an action (#2008) 2026-11-16 10:09:59 +11:00
sam 703d5376bb feat(ui): the Unmatched page shows each group's draft with its summary, dry-run trail and publish (#2008) 2026-11-16 10:05:51 +11:00
sam dd80500e7a feat(drafts): a draft bundles trigger, workflow and policy with a summary and a dry run, and publishes them (#2008) 2026-11-16 10:05:51 +11:00
sam 1e21aa975d refactor(runs): a workflow is a stored document of agent, action, wait-for-approval, notify and sleep steps, and investigate ships as one; dry mode judges without executing (#2008) 2026-11-16 10:05:51 +11:00
sam 66b63260e9 feat(events): a group's stored events can be replayed, and a trigger saved, through the module's API (#2008) 2026-11-16 10:05:17 +11:00
sam 470015483e feat(judgement): a dry decision is recorded apart, counts toward nothing and never executes a changing action, and a draft's policy can overlay the set in force (#2008) 2026-11-16 10:05:17 +11:00
sam 42f0688f84 feat(pg): tables for stored workflow documents, dry runs and drafts (#2008) 2026-11-16 10:05:04 +11:00
sam b6f7059212 feat(storepkg,ui): a package can declare a multi-line text setting (#2006) 2026-11-16 09:56:10 +11:00
sam 88afd1ebc9 feat(guard,runs): a guard is shown the agent's diagnosis and the evidence it read before proposing an action (#2006) 2026-11-16 09:55:14 +11:00
sam a4a4e97f07 feat(judgement): a target's owner is looked up from the connectors at decision time, and an unknown owner is a finding that sends the request to the default owner (#1991) 2026-11-16 09:49:33 +11:00
sam 4bc0d54341 refactor(governance): check escalation deadlines in their own function, keeping validate under the complexity limit (#1985) 2026-11-16 09:44:30 +11:00
sam dabe0b4f7c refactor(approvals): judgement's change-request rules route an approval, and without a connector it goes to the channels (#1985) 2026-11-16 09:42:23 +11:00
sam 28733c8522 feat(approvals,runs): an unanswered approval escalates step by step and then expires, a discarded approval never counts, and a change-request seam routes and withdraws (#1985) 2026-11-16 09:42:23 +11:00
sam 4b1ae4babf feat(governance): each escalation step has its own deadline, and the path skips anyone below the authority an action needs (#1985) 2026-11-16 09:42:23 +11:00
sam 50b75f6987 feat(events): unmatched events are grouped by source, type and key fields, and Archie's own deliveries never group (#1994) 2026-11-16 09:42:23 +11:00
sam 0c8b673615 refactor(archie): build the policy sets in their own constructor so Run stays within its statement limit 2026-11-16 09:40:26 +11:00
sam ef62dcc97a feat(judgement): impact, provenance, timing and cost guards from data, with business hours, blackouts and action budgets as settings (#1988) 2026-11-16 09:38:34 +11:00
sam 82cfc1de5b feat(judgement): hard rules and change-request rules as versioned Cedar policy sets (#1989) 2026-11-16 09:38:07 +11:00
sam 983f462740 fix(governance): the settings and people responses no longer fail to encode on an unsupported json tag 2026-11-16 05:23:38 +11:00
sam 46edda9961 refactor(runs): one conclude step ends an investigation, keeping Investigate under the complexity limit 2026-11-16 05:21:48 +11:00
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
sam 86192e8053 chore(ui): remove unused components, exports and helpers 2026-11-14 23:09:57 +11:00
sam 990cd9408c chore(gatewayrpc): remove the session-store RPCs no client called 2026-11-14 23:09:57 +11:00
sam c7ce32df3e feat(ui): split Workflows into a list page and a workflow page 2026-11-14 22:49:36 +11:00
sam 5d620461fe fix(openshell): sandboxes reach the embedded broker by the services host, and may open /dev/null and /proc (#1864) 2026-11-14 22:06:09 +11:00
sam 411632548c fix(openshell): a sandbox that fails to start reports its last log lines (#1864) 2026-11-14 21:59:42 +11:00
sam a262151cb9 fix(daemon): park pr_open tasks on permanent forge resolution failures (#1975) 2026-11-14 20:09:19 +11:00
sam a8d1de8b5e fix(prompts): mark forge-authored text as untrusted data (#1976) 2026-11-14 20:09:19 +11:00
sam 9f830db510 fix(daemon): publish polled issues only from authors with write access (#1830)
The issue poller published title and body of every labelled or assigned
issue to the agent. It now keeps only write-access authors, failing closed
when the forge cannot answer. The filter moves to forge.WriterIssues,
shared with the issue_list tool.
2026-11-14 18:31:54 +11:00
sam 80129b7dd6 fix(webui): capture list narrows to the requested workspace in the store query (#1335) 2026-11-14 15:29:36 +11:00
sam 48c28b36ba fix(gateway): bound task titles in the /tasks and /agents listings (#1076) 2026-11-14 15:29:36 +11:00
sam c5382a8476 fix(webui): a personal token create that fails is revoked and bounded under the dashboard timeout (#1717) 2026-11-14 15:08:37 +11:00
sam eed9101d5b fix(ui): agent profile fields say what they accept and what empty means (#1875) 2026-11-14 15:08:37 +11:00
sam cdfdf3a756 fix(e2e): workflow checks drive the reworked step cards (#1966)
A duration field with an id now takes its accessible name from its label
instead of a fixed 'Duration' aria-label.
2026-11-14 15:05:53 +11:00
sam 1d329bad35 fix(daemon): reclaim idle task clones hourly, not only on a full volume (#1814) 2026-11-14 15:05:53 +11:00
sam f5c566bcab fix(logging): redact secrets from shipped task log entries (#1720) 2026-11-14 15:05:53 +11:00
sam 90090922e1 fix(archied): the Docker egress proxy and relay do not start under the OpenShell runtime (#1973) 2026-11-14 14:22:29 +11:00
sam a8f1fc9ea3 fix(openshell): keyless model providers get an egress rule on their base URL's host and port (#1972) 2026-11-14 14:22:29 +11:00
sam a9621b91cd fix(archiemessaging): enabling or disabling a channel extension applies without a restart (#1586) 2026-11-14 14:20:37 +11:00
sam c7fabbee25 fix(archiegateway): curators resolve the default chat model per pass, not at boot (#1818) 2026-11-14 14:20:37 +11:00
sam b7b6078939 fix(ui): chat suggestions leave out prompts already asked in the conversation 2026-11-14 12:27:17 +11:00
sam 39bfde195c fix(ui): opening the chat window keeps the minimised bar's width 2026-11-14 12:20:47 +11:00
sam 67ae6afec1 fix(ui): the floating chat window follows the page when the browser pans to the focused input 2026-11-14 12:18:44 +11:00
sam b314968328 fix(ui): the floating chat window stays above a tablet's on-screen keyboard 2026-11-14 12:16:08 +11:00
sam 432e6280d6 feat(ui): the minimised chat composer is wider and taller, with larger text 2026-11-14 12:14:02 +11:00
sam 236d0b678a fix(ui): a task row's action error clears when the task changes status (#1872) 2026-11-14 12:11:04 +11:00
sam 5f45cdebb5 fix(daemon): reconcile PR state through the repository's org connection (#1872) 2026-11-14 12:03:40 +11:00
sam bfe28f6750 fix(taskactions): a refused merge tells the operator why, not the forge's error chain (#1872) 2026-11-14 12:03:40 +11:00
sam 44a7d59acf fix(daemon): log why a task's forge could not be resolved (#1872) 2026-11-14 11:56:53 +11:00
sam 7148579544 fix(controlplanestore): the container runtime document stores egress_hosts (#1967) 2026-11-14 11:37:16 +11:00
sam 6eea6aaffa fix(ui): egress hosts is a one-host-per-line text area (#1967) 2026-11-14 11:33:13 +11:00
sam dc4cd29c83 fix(ui): a host list inserted from the keyboard clipboard splits into separate egress hosts (#1967) 2026-11-14 11:29:29 +11:00
sam 87ed8a2e15 fix(ui): egress hosts add on blur and paste; Docker-only container fields hide under OpenShell (#1967) 2026-11-14 11:24:28 +11:00
sam 855e8ceb3b fix(ui): the minimised chat composer docks at the bottom of the screen 2026-11-14 11:18:22 +11:00
sam 7a9f507e2d test(e2e): chat-dock-layout uses the v2 stored layout shape (#1964) 2026-11-14 04:09:20 +11:00
sam 104854da2a fix(ui): accessibility check targets the New task dialog; keep focus outlines on dock handles (#1963) 2026-11-14 04:09:20 +11:00
sam 3225396cf1 fix(agent): pass the State Store CA base64-encoded; the OpenShell gateway rejects newlines in the environment (#1864) 2026-11-14 04:04:16 +11:00
sam 811cab57ac fix(openshell): short random sandbox names the gateway accepts (#1864) 2026-11-14 04:04:15 +11:00
sam 3a965e2a4f feat(nats): an external broker defers logins to archie through auth callout (#1866)
Task containers log in with their run credential on an external broker and
reach only their own subjects, decided by the embedded broker's authenticator.
The broker token is never put in a container environment.
2026-11-14 04:04:15 +11:00
sam 7d664d7efb fix(archied): label OpenShell gateway providers and sweep leftovers at boot (#1970) 2026-11-14 04:04:15 +11:00
sam 92fbcd7a28 fix(ui): the topbar section crumb names the destination on detail pages (#1880) 2026-11-14 04:03:46 +11:00
sam 5edf58fd68 fix(daemon): reconcile and merge tasks whose PR was merged on the forge (#1872)
ListOpenPRs dropped org_id, so the reconciler resolved the forge and
worktrees in the default org instead of the task's own and skipped the
task silently. Select the org, log a skipped task, and let the Merge
action succeed when the forge reports the PR already merged.
2026-11-14 04:01:31 +11:00
sam da1795c597 feat(egress): Docker task containers reach allowed hosts through the egress proxy (#1967)
The task session carries containers.egress_hosts and the profile's remote MCP
hosts, and the container gets ProxyEnv with the relay exempt from the proxy so
the State Store and NATS dials bypass it. A host the session lists exactly may
resolve to a private address; wildcard and any-host matches may not.
egress_hosts moves from openshell to containers, as it applies to both runtimes.
2026-11-14 04:01:31 +11:00
sam a18a4f7500 fix(controlplanestore): refuse workflow writes that drop a workflow an intake route names (#1962) 2026-11-14 03:58:15 +11:00
sam 7ab209fa7e fix(sdnotify,staterpc): log with the request context so lines carry a trace id (#1936) 2026-11-14 03:57:07 +11:00
sam 97fbc35ee4 fix(modelloop): log each model call and tool call as it finishes (#1850) 2026-11-14 03:55:29 +11:00
sam 7d6f22d227 fix(daemon): a per-task stop interrupts a resumed run reacquiring capacity (#1937) 2026-11-14 03:51:03 +11:00
sam 0451545220 fix(ui): clearing an agent profile field no longer leaves an unsaved change (#1874) 2026-11-14 03:48:04 +11:00
sam 5c02207d48 feat(openshell): connect to a gateway that requires mutual TLS (#1864) 2026-11-14 03:41:24 +11:00
sam e784adbd7a chore: the OpenShell SDK is a direct dependency 2026-11-14 03:34:31 +11:00
sam d3678869d2 feat(archied): OpenShell tasks get model keys through gateway providers (#1864) 2026-11-14 03:33:36 +11:00
sam 6c287b48e6 fix: return write-side close errors; the gate checks unhandled errors 2026-11-14 03:31:46 +11:00
sam bbd3c39ef1 feat(ui): container runtime page edits the OpenShell services host and egress hosts (#1864) 2026-11-14 03:28:42 +11:00
sam 2096ae8267 feat(openshell): each sandbox's network policy admits only what its task needs (#1864, #1967)
Runtimes now take a task launch: image, mounts, env, the daemon's NATS
and State Store with the task's credentials, its model providers and the
hosts its tools may reach. Docker addresses them through the egress relay
as before. An OpenShell sandbox reaches NATS and the State Store over
plain TCP, the model providers with their credential bound, and the
task's remote MCP hosts and the allowed package registries; services
addressed by IP or loopback are named by the configured services host,
since sandbox policy admits only DNS names.
2026-11-14 03:24:37 +11:00
sam a1ec538a87 feat(openshell): task agents can run as OpenShell sandboxes (#1864)
Container runtime policies gain a runtime (docker or openshell) and the
OpenShell gateway's address, workspace and token, set on the container
runtime page and applied on restart. The OpenShell backend creates a
sandbox per task with the worktree and volumes bound in, reports when
the agent exits or outlives its maximum uptime, deletes the sandbox on
release, and sweeps this instance's leftovers at boot. Storage volumes
are created attachable to OpenShell sandboxes.
2026-11-14 03:07:57 +11:00
sam 45b9295cb7 refactor(daemon): tasks run through a TaskRuntime; the Docker pool is its first backend (#1864) 2026-11-14 02:58:26 +11:00
sam e7d3ed72e4 fix(container): task containers run on their own sandbox network behind the egress relay (#1867)
Each task container now gets an internal bridge with no host address,
shared only with the egress relay. NATS, the State Store and the model
proxy are reached through the relay's ports; a loopback State Store is
forwarded to the host gateway. The network is removed with the task, and
boot sweeps any a previous daemon left. The per-task State Store relay on
the host bridge is gone.
2026-11-14 00:14:21 +11:00
sam 82f5afaa6d feat(ui): History is the workflow's YAML editor, marking changes since the picked version; the YAML tab goes
A never-run workflow's Runs view shows one empty state. Browser checks open the editor through History; the stale parts are #1966.
2026-11-13 23:49:46 +11:00
sam 2f95dfb67d fix(ui): a failed step restart names the run and step it was for 2026-11-13 23:32:14 +11:00
sam fb732974f5 fix(ui): canvas zoom controls float in the canvas corner instead of taking a row 2026-11-13 23:32:14 +11:00
sam 81c59d7fac fix(chat): touch drags the minimised bar from anywhere, as a mouse does 2026-11-13 23:26:58 +11:00
sam a2b82b4c25 fix(chat): the dock drags, resizes and swipes through vueuse; touch can move the minimised bar 2026-11-13 23:24:30 +11:00
sam 21dfb56e50 refactor(ui): the phone uses the topbar crumbs; the sidebar sheet goes 2026-11-13 22:21:17 +11:00
sam 41f44c43a1 feat(workflow): issue routing is a control-plane setting edited in the dashboard (#1959)
Label to workflow rules and a default workflow are the intake-routes
resource: ordered, case-insensitive, first rule wins, seeded with bug to
tdd, feature to feasibility, default triage. A write naming an undefined
workflow or an empty label is refused. The daemon reads it through the
workflow definitions client when pinning a task and at intake.

The kind indirection only carried this routing, so it is removed: the
per-kind NATS subjects (every consumer already bound archie.task.>) are
one subject, the envelope and playbook triggers lose their kind, and
x-intake-routes is dropped. The dashboard gets an Issue routing page
under Automation; the trigger card reads the same setting.
2026-11-13 20:28:52 +11:00
sam ca4b039cb4 feat(workflow): serve step type titles with the step vocabulary (#1961)
Each step type declares its title beside its factory and settings; the
control plane serves it in x-step-types, and the dashboard reads it instead
of a hand-written TYPE_TITLES table. Parallel and switch are YAML shapes, not
registered types, so their titles stay with the graph.
2026-11-13 20:26:27 +11:00
sam 841c6aea16 feat(workflow): serve which workflows start each one; the trigger card stops re-deriving it (#1960) 2026-11-13 18:01:33 +11:00
sam fb330f350d fix(ui): workflow list uses Progress; tooltip essays go; instructions lead workflow settings (#1957) 2026-11-13 17:56:13 +11:00
sam 6516477b20 feat(ui): workflow canvas fills the editor; cards say what they are; one step menu for pointer, keyboard and touch (#1954) 2026-11-13 17:54:29 +11:00
sam 9d8e4f68ab fix(ui): step cards use the shared stage status words; new step areas reach the insert menu (#1956) 2026-11-13 17:48:48 +11:00
sam 3653376221 feat(ui): workflow header shows Publish only with a draft; enabling moves to the list (#1955) 2026-11-13 17:46:43 +11:00
sam 925365b245 refactor(ui): one input spec type and parser for workflow inputs and outputs (#1958) 2026-11-13 14:42:10 +11:00
sam 5b3ae6abde refactor(ui): fold one-consumer workflow files into their consumers; move shared ones out (#1958) 2026-11-13 14:40:01 +11:00
sam ecf4e6b95a fix(ui): trigger forms show the server's binding status and load what they read (#1951) 2026-11-13 14:35:24 +11:00
sam 6a17951a3a fix(ui): workflow list menus sit in their row, a new workflow is listed at once, moving a step opens nothing (#1952) 2026-11-13 14:32:46 +11:00
sam 0cfa701f5c fix(ui): one run dialog for a workflow; a disabled Run says why (#1953, #1952) 2026-11-13 14:30:25 +11:00
sam a5ba2c994f feat(ui): one Runs view for a workflow, built on the run list the canvas uses (#1950, #1953) 2026-11-13 14:28:27 +11:00
sam 5e9e551fbb fix(ui): stale workflow responses no longer overwrite newer ones (#1949) 2026-11-13 14:24:22 +11:00
sam 5810c49260 fix(ui): failed workflow reads no longer look like empty data (#1948) 2026-11-13 14:22:52 +11:00
sam e2df9cbd0a fix(ui): workflow editor fields no longer drop input (#1947) 2026-11-13 14:19:29 +11:00
sam 806c82bda3 fix: guard workflow names against blanks and collisions
- refuse blank or duplicate spec names and duplicate step ids, with inline errors
- offer a payload path for every array item in event previews, not just the first three
- trim multiline step settings and apply them on change
2026-11-13 14:16:22 +11:00
sam 39929b9e48 fix(ui): discarding or restoring over unpublished workflow changes asks first (#1945) 2026-11-13 14:04:02 +11:00
sam f4b7652ae7 fix(ui): a workflow draft changed elsewhere is never overwritten silently (#1944) 2026-11-13 14:01:35 +11:00
sam 1def83a43f fix(ui): a workflow link isn't replaced before the list loads 2026-11-13 13:56:12 +11:00
sam 6d54952cbb docs: an epic's children are linked as dependencies, not labelled 2026-11-13 13:54:28 +11:00
sam 757c3016ae fix(ui): Enter in a workflow field no longer publishes (#1943) 2026-11-13 13:51:50 +11:00
sam a0ee8e3f2e refactor(ui/copy): one unresponsive entry in common, no empty catalogues, no em dashes 2026-11-13 13:43:11 +11:00
sam 3eb976ef83 fix(ui/workflows): failures read from the error catalogue 2026-11-13 13:41:32 +11:00
sam 47a340bf79 fix(ui/org): failures read from the error catalogue 2026-11-13 13:41:32 +11:00
sam cdd636d5aa fix(ui/captures): failures read from the error catalogue 2026-11-13 13:41:31 +11:00
sam 4c54d250f6 fix(ui/tasks): failures read from the error catalogue 2026-11-13 13:41:23 +11:00
sam f9ac9229d5 fix(ui/chat): failures read from the error catalogue 2026-11-13 13:41:23 +11:00
sam 0d9e2d1cd8 feat(ui): error catalogue and describeError; dropped connections read as network copy 2026-11-13 13:33:39 +11:00
sam e389e1a21e fix(ui): Escape on the chat rename dialog closes the dialog only 2026-11-13 13:30:19 +11:00
sam 73e32f016a fix(ui): a workflow with no runs says so instead of showing a dash 2026-11-13 13:27:10 +11:00
sam 6b7f6f2731 fix(ui): the open workflow is in the URL, so chat knows which one you mean 2026-11-13 13:26:05 +11:00
sam f5be0d60dd fix(ui): chat prompts hide until a model is connected and scroll as one row 2026-11-13 13:19:29 +11:00
sam 851cb78b04 fix(chat): a failed turn reads as a plain sentence, shown as an error 2026-11-13 13:16:11 +11:00
sam f183a397cb fix(ui): slash palette at label size with descriptions under each command 2026-11-13 13:12:17 +11:00
sam f49ba6bd66 feat(ui): topbar crumb menus open on hover 2026-11-13 13:07:31 +11:00
sam 8dba4e6dec feat(ui): topbar chat button; a docked chat hides when minimised 2026-11-13 13:05:42 +11:00
sam c26eeda939 feat(ui): organisations are created and opened from Instance settings 2026-11-13 13:03:43 +11:00
sam e6a2a16bba fix(ui): the command palette opens on Ctrl+K only 2026-11-13 13:00:46 +11:00
sam 6cc8107ebb fix(ui): Ctrl+/ toggles chat only; the palette opens on a bare slash 2026-11-13 12:58:12 +11:00
sam 8c3464163d fix(ui): centre the minimised chat bar on one line 2026-11-13 12:55:11 +11:00
sam 8d89f47d6b fix(ui): space the topbar controls and keep the alert count off the avatar 2026-11-13 12:53:23 +11:00
sam 260732f400 feat(ui): rework the chat dock header and empty state; fix resize tracking 2026-11-13 12:52:16 +11:00
sam 55e477794e fix(dev): task dev uses embedded NATS regardless of the installed config 2026-11-13 12:10:46 +11:00
sam 3ff1649322 chore(ui): add spotnote for element-level UI feedback in dev 2026-11-13 12:00:05 +11:00
sam bdc457d11e refactor(daemon): identity, org and access checks are their own gate (#1934) 2026-11-13 04:20:41 +11:00
sam 500d02be78 fix(daemon): the task bus is its own type; a cancelled run stops waiting for its slot (#1932) 2026-11-13 04:17:46 +11:00
sam 0cd9cefd76 refactor(daemon): binding dispatch is its own type (#1930) 2026-11-13 04:15:14 +11:00
sam 0a770ed171 refactor(daemon): PR review scanning and reactions are their own type (#1933) 2026-11-13 04:13:36 +11:00
sam 0d13b919da refactor(daemon): issue polling is its own type (#1931) 2026-11-13 04:12:29 +11:00
sam 63a1750936 refactor(daemon): drop nil paths production never takes; one file per cluster (#1929) 2026-11-13 04:08:55 +11:00
sam d0118756d7 refactor(gateway): the turn owner ID is made once by the composition root (#1928) 2026-11-13 03:57:05 +11:00
sam f4c304cfba refactor: log through the injected logger with context; NATS handlers root in the registering context (#1927) 2026-11-13 03:56:12 +11:00
sam afaea346ee refactor(access): authorization takes the caller's context instead of a stored one (#1925) 2026-11-13 03:54:05 +11:00
sam 68e8552f0d fix: log NATS ack and nak failures instead of discarding them (#1924) 2026-11-13 03:52:38 +11:00
sam b25676b612 fix: check Docker conflicts, push errors and RPC status by type, not message text (#1923) 2026-11-13 03:47:34 +11:00
sam 60c0f19e63 fix(forge): a close refused for open dependencies is a typed error across the boundary (#1922) 2026-11-13 03:47:34 +11:00
sam 65e6bafb23 fix(tools): the path jail is a value each tool set owns, not a process global (#1921) 2026-11-13 03:47:34 +11:00
sam 1c191b4ee0 refactor(config): service registry is a static map, not init() registration (#1926) 2026-11-13 03:47:34 +11:00
sam 892ed291b9 refactor(mcp): use the official MCP Go SDK for the client
Deletes the hand-written internal/tools/mcp client and transports. The
provider talks to an SDK ClientSession over CommandTransport,
StreamableClientTransport or SSEClientTransport, and reconnects when the
server exits. The http transport now keeps a real streamable session
instead of stateless POSTs. Sampling goes through one adapter, since the
SDK marks it deprecated (SEP-2577). message_endpoint is removed: the
SSE transport takes the POST URL from the server's endpoint event.
2026-11-13 03:44:55 +11:00
sam c5f24ec914 chore: delete code no binary reaches
Removes the Kit task-tool result shim (and with it the MCP go-sdk
dependency), the messaging enable/disable/restart helpers and channel
rebuild closures nothing calls since channels became extensions, the
unused messaging capability, ephemeral and text-fallback types, and
single stragglers in telemetry, releaseupdate, skill, storepkg and
webui. The egress sandbox relay stays for #1867.
2026-11-13 03:33:32 +11:00
sam aefb4e486b chore(deps): update Go modules 2026-11-13 03:20:22 +11:00
sam 7c7129eefb docs(agents): say how tests are written 2026-11-13 03:16:15 +11:00
sam db346b159d fix(webui): mark cookies Secure behind a TLS proxy; run gosec in the gate (#1919)
Cookies took Secure from r.TLS, which is nil behind a proxy that terminates
TLS, so sign-in cookies went out without it. Every dashboard cookie now goes
through one builder that reads the scheme the way the origin check does.

The worktree reset and the agent worker's chown walk use os.Root, so a
symlink swapped in mid-walk can't point them outside the worktree.

gosec runs in golangci-lint, tests included. G104, G115, G204 and G304 are
excluded in config; each remaining finding is fixed or suppressed at the site
with its reason.
2026-11-13 03:16:15 +11:00
sam a3d4b751b9 ci: pin every action to a commit SHA (#1919) 2026-11-13 03:16:15 +11:00
sam f3a379add1 ci(promote): pass the version through env, not into the script 2026-11-13 03:03:30 +11:00
sam d7741d6088 docs(agents): name priorities critical, high, medium and low 2026-11-13 02:56:00 +11:00
sam 27df64f8b0 docs(agents): use the in-progress and deferred labels 2026-11-13 02:55:10 +11:00
sam 8890c9ac3e docs(agents): describe the p0-p3 and bare type labels 2026-11-13 02:53:48 +11:00
sam fb281c192a docs(agents): keep a lighter push-back rule 2026-11-13 02:45:35 +11:00
sam fc6f614408 docs(agents): drop the December rule, loosen two decision rules, correct the services table 2026-11-13 02:44:48 +11:00
sam 40526b077f ci(deploy): drop comments from the release workflow (#1917) 2026-11-13 02:37:20 +11:00
sam 061227708d chore(release): remove the canary, release news, changelog and Woodpecker pipelines (#1917) 2026-11-13 02:35:59 +11:00
sam a04fd3834d Merge pull request 'chore(workflow): remove the needs block (#1888)' (#1916) from chore/1888-remove-workflow-needs into main
deploy / agent-image (push) Skipped
ci/woodpecker/push/deploy Pipeline failed
deploy / gate (push) Failing after 8m36s
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / plan (push) Successful in 26s
Reviewed-on: #1916
2026-11-12 15:31:42 +00:00
sam a4fbaaf84c Merge branch 'main' into chore/1888-remove-workflow-needs
Quality / check (pull_request) Successful in 4m50s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 15:31:30 +00:00
sam 606da1aee5 chore(workflow): remove the needs block (#1888)
Quality / check (pull_request) Successful in 3m8s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-13 02:11:22 +11:00
sam 228f17d98a Merge pull request 'feat(chat): float the chat dock anywhere on screen (#1904)' (#1912) from feat/1904-chat-dock-float into main
deploy / plan (push) Successful in 7s
ci/woodpecker/push/deploy Pipeline failed
deploy / gate (push) Failing after 7m36s
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
Reviewed-on: #1912
2026-11-12 14:23:35 +00:00
sam 3c1ecc8087 Merge remote branch feat/1904-chat-dock-float into the rebased head
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 2m47s
2026-11-13 01:17:25 +11:00
sam 29e263ab23 feat(chat): float the chat dock anywhere on screen (#1904)
The chat dock is now a free-floating window on desktop-width screens:
the header drags it to any position, all eight edges and corners resize
it by pointer and keyboard (role=separator with aria-orientation and
valuenow), and Left / Float / Right controls in the header switch
modes explicitly. Dragging near a side edge shows the pinned split
preview and commits on release; minimising leaves the bar in place and
draggable; Ctrl+/ toggles the window. The layout persists under
archie.chat.dock.v2, migrating and removing the old archie.chat.dock
key. Phone width keeps the full-width bottom bar.
2026-11-13 00:47:07 +11:00
sam fbc9ed21e7 Merge pull request 'fix(daemon): skip issue intake when the routed workflow is disabled (#1913)' (#1915) from fix/1913-intake-skip-disabled into main
deploy / gate (push) Failing after 8s
deploy / archied-image (push) Skipped
ci/woodpecker/push/deploy Pipeline failed
deploy / plan (push) Successful in 7s
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
Reviewed-on: #1915
2026-11-12 13:44:06 +00:00
sam 76be7b87b2 Merge branch 'main' into fix/1913-intake-skip-disabled
Quality / check (pull_request) Successful in 8m11s
2026-11-12 13:43:34 +00:00
sam 804d306f75 fix(daemon): skip issue intake when the routed workflow is disabled (#1913)
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline was successful
pollNATS queued every discovered issue and let the pin path park it with
'workflow triage is disabled'. Now, after the TaskByIssue existence check
and before PublishTask, the label-routed workflow is resolved against the
active definitions and checked against the identity org's enablement, the
same filter dispatchOrgBindings applies to armed bindings. A disabled
route logs one Info line and returns false without acknowledging, so the
issue is rediscovered on a later poll and picked up if the workflow is
re-enabled. Read failures of org, definitions or enablement log a Warn
and fall through to publishing; no routable definition keeps the current
publish behaviour. processNATSTask's park path is unchanged.
2026-11-13 00:42:40 +11:00
sam 782daf8bbb Merge pull request 'fix(chat): anchor the More popover outside the tooltip chain (#1862)' (#1914) from fix/1862-more-menu into main
ci/woodpecker/push/deploy Pipeline was canceled
deploy / plan (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
Reviewed-on: #1914
2026-11-12 13:42:32 +00:00
sam 5baef8805d Merge branch 'main' into fix/1862-more-menu
ci/woodpecker/pr/quality Pipeline was canceled
Quality / check (pull_request) Failing after 5m19s
2026-11-12 13:42:04 +00:00
sam 82ca9613c7 fix(chat): anchor the More popover outside the tooltip chain (#1862)
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline was canceled
Nested inside TooltipTrigger as-child, PopoverTrigger's PopperAnchor ref
resolved to a component object instead of the button, so the popover never
became positioned and its content stayed parked off-screen at
translate(0, -200%): the menu opened in state only, invisible to the user.
Wrapping the tooltip in an explicit PopoverAnchor makes the anchor the real
button element, so the menu renders beside it. The tooltip (accessible name
More), the menu items, and the rename/branch dialog are unchanged.

Adds ui/test/chat-more-menu.test.ts, a browser behaviour check (vite dev
server + headless Chrome over CDP, API mocked in-page) that fails on the old
nesting with the menu at (0, -526) and passes with it in the viewport; it
skips when no Chrome binary is installed.
2026-11-13 00:40:53 +11:00
sam 4e9745d5c6 feat(chat): float the chat dock anywhere on screen (#1904)
Quality / check (pull_request) Successful in 10m29s
ci/woodpecker/pr/quality Pipeline was successful
The chat dock is now a free-floating window on desktop-width screens:
the header drags it to any position, all eight edges and corners resize
it by pointer and keyboard (role=separator with aria-orientation and
valuenow), and Left / Float / Right controls in the header switch
modes explicitly. Dragging near a side edge shows the pinned split
preview and commits on release; minimising leaves the bar in place and
draggable; Ctrl+/ toggles the window. The layout persists under
archie.chat.dock.v2, migrating and removing the old archie.chat.dock
key. Phone width keeps the full-width bottom bar.
2026-11-13 00:30:52 +11:00
sam ea64d84696 Merge pull request 'feat(chat): page-aware suggested prompts beside the composer, sent on click (#1905, #1906)' (#1911) from feat/1905-1906-chat-suggestions into main
deploy / gate (push) Canceled after 3m40s
ci/woodpecker/push/deploy Pipeline failed
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / plan (push) Successful in 10s
deploy / dist-zip (push) Canceled after 0s
Reviewed-on: #1911
2026-11-12 13:26:20 +00:00
sam 2bec268b29 Merge branch 'main' into feat/1905-1906-chat-suggestions
Quality / check (pull_request) Successful in 11m7s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 13:26:03 +00:00
sam 5b282c9efe Merge pull request 'feat(chat): surface streamed model thinking in the dashboard (#1907)' (#1910) from feat/1907-chat-thinking into main
deploy / gate (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline is pending
deploy / agent-image (push) Canceled after 0s
deploy / plan (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
Reviewed-on: #1910
2026-11-12 13:25:51 +00:00
sam 7b295df8ff feat(chat): page-aware suggested prompts beside the composer, sent on click (#1905, #1906)
ci/woodpecker/pr/quality Pipeline is pending
Quality / check (pull_request) Canceled after 0s
The suggestion strip moves out of the empty transcript into the composer,
above the field, so prompts stay reachable without scrolling to the top and
show in the collapsed bar where there is room (hidden below the md breakpoint
in the collapsed bar, wrapping when expanded on a phone). Clicking a prompt
calls sendMessage({ textOverride }), which sends at once while no turn runs
instead of filling the composer. Prompt sets are keyed off the current route
name, the same identity the page tag uses: task detail (naming the open task),
tasks, events, workflows, schedules, settings, and a default set. The empty
transcript keeps its logo and no longer owns the fixed prompt list; the dead
prompt re-emit in ChatTranscript is removed.
2026-11-13 00:25:18 +11:00
sam 607bfddd0e Merge branch 'main' into feat/1907-chat-thinking
Quality / check (pull_request) Successful in 12m49s
2026-11-12 13:24:24 +00:00
sam 779b036d95 Merge pull request 'fix(webui): sanitise dashboard chat error responses (#1908)' (#1909) from fix/1908-webui-chat-errors into main
deploy / plan (push) Successful in 46s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
Reviewed-on: #1909
2026-11-12 13:23:30 +00:00
sam 27e997e0d9 Merge branch 'main' into fix/1908-webui-chat-errors
Quality / check (pull_request) Successful in 4m40s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 13:23:15 +00:00
sam 433ea390a6 feat(chat): render the live turn's thinking in the dashboard (#1907)
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline was successful
Reasoning frames accumulate into streamingTurn.reasoning and the live row
shows them in a collapsible Thinking trace built from the components/ui
trace pattern, with a spinning icon and shimmering title while no reasoning
has arrived yet. A turn that produces no reasoning renders no trace, and
reasoning never leaks into the reply text.
2026-11-13 00:21:27 +11:00
sam ff8615b090 feat(gateway): stream model reasoning as reasoning chat events (#1907)
The ai-sdk FullStream drain moves from the archiegateway composition into
internal/gateway (DrainStreamParts), next to the TurnStream it feeds, and
gains a StreamPartReasoningDelta case: each reasoning delta is forwarded on
the new optional ReasoningStream method, which localChatStream turns into a
ChatEvent{Kind: "reasoning", Text: delta} on the same stream. done/error
semantics are unchanged, and the FullStream is still drained to close when no
stream is attached.
2026-11-13 00:21:23 +11:00
sam 14da38b9b7 fix(webui): sanitise dashboard chat error responses (#1908)
Quality / check (pull_request) Successful in 7m28s
ci/woodpecker/pr/quality Pipeline was successful
Chat handlers returned raw contract errors to the browser, which can
carry SQL fragments, gRPC status details or host paths. Each 5xx and
transport failure now answers with a plain sentence in the gateway's
wording and logs the real cause through the injected logger's
ErrorContext. The SSE error frame on stream-open failure gets the same
treatment. Safe 400 validation messages and the 404 'session not found'
are unchanged.
2026-11-13 00:10:22 +11:00
sam 017a1d56e2 Merge pull request 'fix(ui): size page layouts by container width, not viewport (#1892)' (#1899) from fix/1892-container-queries into main
deploy / dist-zip (push) Skipped
ci/woodpecker/push/deploy Pipeline failed
deploy / gate (push) Failing after 9m40s
deploy / plan (push) Successful in 7s
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
Reviewed-on: #1899
2026-11-12 12:15:05 +00:00
sam af02cbe832 Merge branch 'main' into fix/1892-container-queries
Quality / check (pull_request) Successful in 10m46s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 12:14:54 +00:00
sam 38d9cca84a Merge pull request 'test(e2e): chat dock browser checks (#1886)' (#1901) from test/1886-chat-dock-checks into main
ci/woodpecker/push/deploy Pipeline is pending
deploy / plan (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
Reviewed-on: #1901
2026-11-12 12:14:40 +00:00
sam cdae23d7e9 Merge branch 'main' into test/1886-chat-dock-checks
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Failing after 10m40s
2026-11-12 12:14:32 +00:00
sam 1ae6d39680 Merge pull request 'feat(chat): unseen reply counts and phone dock (#1883, #1885)' (#1898) from feat/1883-1885-chat-dock into main
deploy / plan (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
Reviewed-on: #1898
2026-11-12 12:13:56 +00:00
sam 07e4e8f727 Merge branch 'main' into feat/1883-1885-chat-dock
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 11m36s
2026-11-12 12:13:43 +00:00
sam 98941c20a0 fix(controlplanestore): legacy channel settings drop the retired models key on migration (#1903)
deploy / gate (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / plan (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
2026-11-12 23:12:57 +11:00
sam fe8afb18d0 fix(gateway): a failed chat turn shows plain wording, not the provider's error (#1902)
deploy / plan (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
deploy / gate (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
2026-11-12 23:11:07 +11:00
sam 3f092c0704 test(e2e): chat dock browser checks (#1886)
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 23:08:02 +11:00
sam f156150a8b fix(ui): size page layouts by container width, not viewport (#1892)
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline failed
2026-11-12 23:05:31 +11:00
sam 9dd55646bb feat(chat): count unseen replies and follow the phone keyboard (#1883, #1885)
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline was canceled
2026-11-12 23:03:14 +11:00
sam 6a7f8b4847 Merge pull request 'feat(ui): show the page context tag above the chat composer (#1854)' (#1897) from feat/1854-page-context-tag into main
deploy / plan (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline failed
deploy / gate (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
Reviewed-on: #1897
2026-11-12 11:59:14 +00:00
sam 1c5915f521 feat(ui): show the page context tag above the chat composer (#1854)
Quality / check (pull_request) Successful in 4m23s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 22:57:21 +11:00
sam 864240fd61 Merge pull request 'feat(ui): attach tasks to a chat message with # (#1861)' (#1893) from feat/1861-task-context-picker into main
ci/woodpecker/push/deploy Pipeline is pending
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / plan (push) Canceled after 0s
Reviewed-on: #1893
2026-11-12 11:50:55 +00:00
sam 1730938e03 Merge branch 'main' into feat/1861-task-context-picker
Quality / check (pull_request) Successful in 9m53s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 11:50:37 +00:00
sam 2a73a37d27 Merge pull request 'feat(chat): copy a conversation as Markdown from the More menu (#1884)' (#1894) from feat/1884-copy-markdown into main
ci/woodpecker/push/deploy Pipeline is pending
deploy / plan (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
Reviewed-on: #1894
2026-11-12 11:50:30 +00:00
sam 4694406434 Merge branch 'main' into feat/1884-copy-markdown
Quality / check (pull_request) Successful in 3m55s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 11:50:19 +00:00
sam b8c394767c Merge pull request 'feat(chat): link #N in replies to tasks that exist (#1882)' (#1895) from feat/1882-task-chips into main
ci/woodpecker/push/deploy Pipeline is pending
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / plan (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
Reviewed-on: #1895
2026-11-12 11:50:09 +00:00
sam 604d615d7a Merge pull request 'feat(ui): pin the chat dock to a side edge (#1853)' (#1896) from feat/chat-dock-pin into main
ci/woodpecker/push/deploy Pipeline is pending
deploy / agent-image (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Canceled after 0s
Reviewed-on: #1896
2026-11-12 11:49:57 +00:00
sam 77db59141c feat(ui): pin the chat dock to a side edge (#1853)
Quality / check (pull_request) Successful in 16m15s
ci/woodpecker/pr/quality Pipeline was canceled
2026-11-12 22:48:41 +11:00
sam eabd7c8884 feat(chat): copy a conversation as Markdown from the More menu (#1884)
Quality / check (pull_request) Canceled after 1m25s
ci/woodpecker/pr/quality Pipeline was canceled
2026-11-12 22:47:26 +11:00
sam 7ffbf0435c feat(chat): link #N in replies to tasks that exist (#1882)
ci/woodpecker/pr/quality Pipeline was canceled
Quality / check (pull_request) Successful in 16m18s
2026-11-12 22:46:22 +11:00
sam 8082e200f2 test(e2e): chat composer check follows the combobox role and the # task picker (#1861)
ci/woodpecker/pr/quality Pipeline was canceled
Quality / check (pull_request) Canceled after 2m16s
2026-11-12 22:45:14 +11:00
sam b234a85090 feat(ui): attach tasks to a chat message with # (#1861) 2026-11-12 22:43:41 +11:00
sam 37ea698a28 Merge pull request 'feat(ui): move desktop navigation into the topbar breadcrumb (#1880)' (#1891) from feat/topbar-nav into main
deploy / dist-zip (push) Skipped
deploy / gate (push) Failing after 9m22s
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
deploy / plan (push) Successful in 25s
ci/woodpecker/push/deploy Pipeline failed
Reviewed-on: #1891
2026-11-12 11:34:09 +00:00
sam bc429cd351 Merge branch 'main' into feat/topbar-nav
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 10m53s
2026-11-12 11:33:48 +00:00
sam 75044ee4c0 Merge pull request 'fix(chat): open More menu, keep Send after mic error, per-session drafts (#1862, #1878, #1879)' (#1890) from fix/chat-dock-bugs into main
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
deploy / gate (push) Canceled after 46s
deploy / archied-image (push) Canceled after 0s
deploy / plan (push) Successful in 9s
Reviewed-on: #1890
2026-11-12 11:33:13 +00:00
sam 914a5f9b03 Merge branch 'main' into fix/chat-dock-bugs
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 4m9s
2026-11-12 11:33:06 +00:00
sam a7a411bd4b Merge pull request 'chore(runtime): delete Kit and external agent harness support (#1877)' (#1887) from chore/delete-kit-harness into main
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 5m2s
deploy / plan (push) Successful in 34s
ci/woodpecker/push/deploy Pipeline failed
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
Reviewed-on: #1887
2026-11-12 11:27:20 +00:00
sam 9ac8a60999 Merge branch 'main' into chore/delete-kit-harness
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 4m5s
2026-11-12 11:27:07 +00:00
sam 04975db9a1 feat(ui): move desktop navigation into the topbar breadcrumb (#1880)
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline is pending
2026-11-12 21:53:31 +11:00
sam b97eb45275 style(staterpc): drop a blank line left by the removal
Quality / check (pull_request) Successful in 8m16s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-12 21:42:27 +11:00
sam 658a4cb50e chore(runtime): remove code left dead by the Kit removal (#1877)
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline was canceled
Drops Client.TaskPrincipalForCredential and the principal_id field only
it read, Reporter.ReportToolCall, Pool.EnsureImage and Pool.Instance,
and the binding cipher's exported domain API. Clears the remaining
harness references from the audit target kinds, docs and comments.
2026-11-12 21:42:17 +11:00
sam 5a98c313e0 fix(chat): open More menu, keep Send after mic error, per-session drafts (#1862, #1878, #1879)
ci/woodpecker/pr/quality Pipeline was canceled
Quality / check (pull_request) Canceled after 7s
2026-11-12 21:34:56 +11:00
sam f92c5b4536 chore(runtime): delete Kit and external agent harness support (#1877)
Quality / check (pull_request) Canceled after 7m39s
ci/woodpecker/pr/quality Pipeline was successful
Archie runs its own agent loop only. Removes Kit resolution and launch,
the harness runner and adapters, the setup terminal and sandbox view,
harness secrets and OAuth capture (table dropped in migration 0075), the
task-tools contract that only Kit containers reached, and the
sandbox-kit-spec dependency. Agent profiles carry image and tools only.
The egress proxy keeps the model-session path; the sandbox relay code
stays for #1867.
2026-11-12 21:29:05 +11:00
sam c54d328f0d feat(store): run services as a non-superuser role and name every connection (#1857)
Every service connected to PostgreSQL as the database owner, which is a
superuser, so anything that compromised an app process owned the cluster, and
every connection reached the server with an empty application_name, so
pg_stat_activity could not say which service a session belonged to.

Split the DB credential into two login roles and name every pool:

- archie_migrator owns public and its objects and runs goose. Migrations run
  on a short-lived pool opened from the new migration_database_url, before the
  serving pool opens. It is not a superuser.
- archie_runtime serves requests with SELECT, INSERT, UPDATE, DELETE, sequence
  USAGE/SELECT and function EXECUTE only. It has no CREATE privilege, so it
  cannot change the schema.
- Every pool sets application_name: archie-state-store, archie-gateway, and a
  -migrate / -recovery / -schema / -provision suffix on the transient
  administrative connections. Existing one-URL installs keep working: an
  absent migration_database_url falls back to database_url and the migration
  runs on the serving pool exactly as before.

Provisioning is a new idempotent `archie-state-store provision` subcommand: it
needs an admin URL the services never hold (database owner or superuser),
creates or reconciles both roles, hands every public-schema object to the
migration role, revokes PUBLIC's CREATE on public, sets row-level grants, and
sets the migration role's default privileges so tables future migrations
create are usable without a hand-run grant. It stores SCRAM verifiers, refuses
superuser roles, and verifies the boundary before committing.

install.sh now provisions the bundled path and separates the credentials: the
superuser password the Compose database is created with lives only in a
compose-only postgres.env, while the env file the units load holds the
non-superuser PGPASSWORD. A bundled install that predates the split is
upgraded in place: the roles are created, the superuser password is rotated
out of the env file, and config.toml is moved to the runtime and migration
URLs. External databases keep their operator-managed credential; the
deployments README documents the one-shot provision command.

setup writes both bundled URLs, dev:postgres provisions the dev database, the
e2e stack provisions its throwaway server, and the deployment templates point
at the two roles.
2026-11-11 03:12:54 +11:00
sam 161e8f95bf perf(store): share one control-plane version read across all watchers (#1858)
The control-plane Watch was a 250 ms database poll per subscription: an idle instance ran about 180 transactions a second (archied 14 streams, gateway 5, dashboard 26), almost all sequential scans of the small resources table. The State Store now keeps one shared view of every stored resource version, read once per 250 ms window and reused by every Watch stream; a stream reads its own resource only when its kind's version advanced, so idle database work is one read per interval for the whole process whatever the subscriber count.

The watch contract is unchanged: resume from AfterVersion, no missed update (versions are monotonic per org and kind), the immediate seed probe, the same 250 ms latency bound (streams wake on the same window boundary), and a store error still ends the stream with Unavailable so the clients' existing reconnect backoff applies.
2026-11-11 03:03:37 +11:00
sam c155bb24ba fix(taskactions): record the retention rule for archived task children (#1859)
Archiving deletes the task row but deliberately keeps its child rows:
execution history, usage and the dispatch ledger are records about the work,
not attachments to the row. Nothing recorded that rule, so the kept rows had no
parent row to explain them and no query could say what happened to an archived
task.

Record the rule in the archive event's data. The kind is protected from audit
retention and already projects into the audit feed, so that event is the
archived-task record: it names the kept child sets and leaves event rows to the
instance's per-kind retention.
2026-11-11 02:59:20 +11:00
sam 0033933a58 perf(store): index the six unindexed foreign keys (#1860)
Postgres does not index the referencing side of a foreign key, so deleting or updating a parent row scanned the child table once per referencing row for the six keys that had no matching index: identity aliases and subjects, org memberships and agents, installed package requirements, and the task a handoff came from. Migration 0074 adds one supporting index per key; the foreign-key integrity checks on the restored snapshot pass, with every one of the 17 constraints now covered.
2026-11-11 02:49:37 +11:00
sam a9aacab79d docs(agents): push every commit as soon as it is made
deploy / plan (push) Successful in 8s
deploy / archied-image (push) Successful in 50s
deploy / dist-zip (push) Skipped
ci/woodpecker/push/deploy Pipeline was successful
deploy / gate (push) Successful in 8m5s
deploy / agent-image (push) Skipped
2026-11-11 02:48:29 +11:00
sam dcc12582ce feat(audit): set per-kind event retention from the instance (#1856)
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 25s
deploy / plan (push) Successful in 35s
deploy / archied-image (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
The retention sweep applied one window to a code-fixed allowlist, and the
largest event kind (agent transcripts) was outside it, so the events table
grew whatever the instance set. The audit-retention document now takes
per-kind overrides, the dashboard offers each prunable kind its own window
from the server's list, and a kind without an override follows the default.
A security kind is refused where the document is written, and the sweep cuts
each kind at its own cutoff in one bounded, locked transaction.
2026-11-11 02:31:46 +11:00
sam 4728c8c253 feat(usage): report model usage per org with identity and cost (#1855)
Model usage was recorded per call and never read, so an org could not see
what it spent. Add the read side:

- model_usage carries identity_id. Task calls take it from the task row,
  chat and curator calls from the calling principal carried in the usage
  record, so an outbox replay keeps its attribution. Existing task rows are
  backfilled from tasks.
- StatsService.UsageTotals sums the caller org's rows by UTC day, source,
  provider, model and identity. The org comes from the principal, with no
  org parameter, so cross-org reads do not exist.
- GET /api/usage prices tokens at the catalog's list rate, netting cache
  hits, and reports calls to unpriced models as tokens only. The published
  catalog view now carries each model's cost.
- A new org Usage page behind a read_usage grant: admin and owner only,
  with a 7, 30 or 90 day range, totals, the daily series, and model, source
  and identity breakdowns. The org shell keeps it on the caller's own org.
2026-11-11 02:15:29 +11:00
sam 255e0c7ee0 feat(chat): titles read the reply too, and session memory sees what it already holds
deploy / dist-zip (push) Skipped
ci/woodpecker/push/deploy Pipeline was successful
deploy / gate (push) Successful in 7m39s
deploy / agent-image (push) Skipped
deploy / plan (push) Successful in 7s
deploy / archied-image (push) Successful in 30s
2026-11-11 00:10:00 +11:00
sam bc16b74c93 fix(prompts): correct the product guide, and make chat replies scannable and honest about their own history
deploy / plan (push) Successful in 8s
ci/woodpecker/push/deploy Pipeline was successful
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 5m8s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
2026-11-11 00:04:43 +11:00
sam 44237b448b refactor(prompts): every model prompt is a file in internal/prompts
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Successful in 6s
ci/woodpecker/push/deploy Pipeline was canceled
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 2m58s
2026-11-11 00:01:43 +11:00
sam e5e968780f fix(chat): the conversation picker reads as the panel's title, and titles name the subject, not the mood
deploy / gate (push) Successful in 7m24s
ci/woodpecker/push/deploy Pipeline was successful
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 38s
deploy / plan (push) Successful in 9s
2026-11-10 23:53:24 +11:00
sam 31578e8857 fix(ui): label the conversation picker, centre Send on the composer line, say Archie is waiting when no task runs
deploy / gate (push) Canceled after 57s
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Successful in 46s
deploy / archied-image (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
deploy / agent-image (push) Canceled after 0s
2026-11-10 23:51:47 +11:00
sam f3f90f3224 fix(chat): a stopped turn shows in its conversation, and the composer field draws no box of its own
ci/woodpecker/push/deploy Pipeline was successful
deploy / archied-image (push) Successful in 58s
deploy / gate (push) Successful in 7m41s
deploy / agent-image (push) Skipped
deploy / plan (push) Successful in 8s
deploy / dist-zip (push) Skipped
2026-11-10 23:33:30 +11:00
sam 8aa3540fa7 fix(ui): outline toggle groups mark the selected segment inside its border
deploy / agent-image (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
deploy / plan (push) Successful in 7s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 3m19s
2026-11-10 23:29:58 +11:00
sam 52549c1bab fix(dashboard): the workflow picker's menu opens below it instead of over it
deploy / archied-image (push) Canceled after 0s
deploy / plan (push) Successful in 9s
deploy / agent-image (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 47s
2026-11-10 23:28:55 +11:00
sam f7c3e1788c fix(dashboard): keep the workflow picker's label beside its value and one font on attention rows
deploy / plan (push) Successful in 9s
deploy / gate (push) Canceled after 3m40s
ci/woodpecker/push/deploy Pipeline was canceled
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
2026-11-10 23:24:59 +11:00
sam 5ea115746c fix(dashboard): blocked tasks say what they need, and a provider refusal names its fix
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 5m37s
deploy / plan (push) Successful in 6s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
ci/woodpecker/push/deploy Pipeline was canceled
2026-11-10 23:19:29 +11:00
sam 12a25faf31 Merge pull request 'ci: build release binaries once and stop recompiling archied' (#1852) from ci/release-build-once into main
deploy / archied-image (push) Successful in 2m13s
deploy / dist-zip (push) Skipped
deploy / plan (push) Successful in 12s
deploy / gate (push) Successful in 10m7s
deploy / agent-image (push) Skipped
Reviewed-on: #1852
2026-11-10 11:42:32 +00:00
sam c9a8e21759 Merge branch 'main' into ci/release-build-once
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 12m5s
2026-11-10 11:41:17 +00:00
sam 28a6ac8b98 fix(ui): the token revoke dialog runs the revoke it was opened for
deploy / plan (push) Successful in 8s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 3m33s
2026-11-10 22:37:59 +11:00
sam 73860b26d2 ci(woodpecker): build once, keep Go's caches, fetch archied for the canary
ci/woodpecker/pr/quality Pipeline was canceled
Quality / check (pull_request) Canceled after 0s
The same changes as the Actions workflows: a release gate runs
`task check dist` and the dist step only packages; canary and promote copy
archied out of archied:edge instead of compiling it.

The gate and the pull-request check keep Go's module, build and lint caches
on the host, in separate directories so a pull request cannot write into the
cache a release build reads.

Fixes: notes wait for the signed release and carry the prerelease flag;
the canary clones with tags, which its rollback needs to diff migrations;
release puts HEAD on main before `task release`, which refuses anything else.
2026-11-10 10:57:59 +00:00
sam 9ca3432f8e ci(canary): take archied from the published edge image
canary and promote compiled archied from source on every run, the canary
every fifteen minutes. Both now copy the binary out of archied:edge, which
deploy already published for main.

The canary keeps its checkout: a rollback diffs the migrations between two
release tags. Promotion never reads the repository, so it drops its own.
2026-11-10 10:57:06 +00:00
sam 1b53c5787e ci(deploy): build the release binaries once, in the gate
A release gate runs `task check dist`, uploads dist/, and dist-zip packages
that instead of installing Go and Node and compiling the tree again.

plan resolves the commit and version once for the image jobs. agent-image is
skipped outside a release. dist-zip waits for archied-image. The image jobs
share one builder that is never removed, so the Dockerfiles' cache mounts
survive between runs.

Also: Node 24 in the gate like everywhere else, govulncheck pinned, and the
release notes carry the prerelease flag.
2026-11-10 10:56:55 +00:00
sam b509397e8d build: add task dist, build the dashboard once, cache Go in image builds
`task dist` builds the binaries release.json names into dist/ with the
compiler flags `build` uses, so after the gate has built bin/ it only links.
`build` is now static (CGO_ENABLED=0), like what ships.

`ui` runs once per task invocation: check built the dashboard, then build's
dependency built it again under the Go steps that embed it.

Both Dockerfiles compile with cache mounts for Go's module and build caches.
2026-11-10 10:56:12 +00:00
sam 721e6332ed fix(chat): show a failed turn's error in a reopened conversation 2026-11-10 21:56:06 +11:00
sam cc49fecc77 fix(egress): default base URL for the gemini-interactions provider class (#457) 2026-11-10 21:56:06 +11:00
sam c3e64e5485 chore(release): v1.62.0
deploy / dist-zip (push) Successful in 5m9s
deploy / plan (push) Successful in 8s
deploy / agent-image (push) Successful in 3m15s
deploy / gate (push) Successful in 6m49s
deploy / archied-image (push) Successful in 2m36s
2026-11-10 09:48:01 +00:00
sam 13ec693726 fix(gateway): let a streamed chat turn finish after its stream closes (#1848)
deploy / plan (push) Successful in 7s
deploy / gate (push) Successful in 7m49s
deploy / agent-image (push) Successful in 12s
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Successful in 2m24s
2026-11-10 20:14:04 +11:00
sam e3ffefdc7d fix(identity): use System as the one root identity and record who created every task (#1851)
deploy / plan (push) Successful in 25s
deploy / gate (push) Successful in 7m57s
deploy / archied-image (push) Successful in 2m12s
deploy / agent-image (push) Successful in 21s
deploy / dist-zip (push) Skipped
Drop the bot_user-derived root identity and the empty-identity sentinel. System
polls forge connections and owns instance-level work; a polled task stores the
polling identity, task_queued and work_request_submitted carry task id, actor
and principal, and an empty task identity is refused. Migration 0072 moves
empty tasks.identity, the identity-grants root key and the old root's
connection permits to System so a re-poll dedups.
2026-11-10 20:01:16 +11:00
sam 04798b990a docs(changelog): notes for the changes since 1.61.3
deploy / plan (push) Successful in 8s
deploy / agent-image (push) Successful in 24s
deploy / dist-zip (push) Skipped
deploy / gate (push) Successful in 8m52s
deploy / archied-image (push) Successful in 3m25s
2026-11-10 19:28:08 +11:00
sam 0e889977c0 fix(archied): resolve merge, close and issue tools through the repository's connection (#1847)
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Successful in 6s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 2m50s
2026-11-10 19:25:15 +11:00
sam 47e3d8d837 Merge pull request 'Expose all task actions in the task detail header (archie)' (#1846) from feat/1000000000000000-expose-all-task-actions-in-the-task-detail-header into main
deploy / plan (push) Successful in 6s
deploy / gate (push) Successful in 7m43s
deploy / agent-image (push) Successful in 14s
deploy / archied-image (push) Successful in 2m27s
deploy / dist-zip (push) Skipped
Reviewed-on: #1846
2026-11-10 06:54:28 +00:00
archie 9a9629400e Expose all task actions in the task detail header (archie)
Quality / check (pull_request) Successful in 13m0s
ci/woodpecker/pr/quality Pipeline was successful
2026-11-10 16:54:00 +11:00
sam 0525edd3bb fix(postgres): blocker-changed marks only the org whose resource changed (#1839)
deploy / dist-zip (push) Skipped
deploy / gate (push) Successful in 8m39s
deploy / archied-image (push) Failing after 13m38s
deploy / plan (push) Successful in 7s
deploy / agent-image (push) Canceled after 2s
2026-11-09 14:40:58 +11:00
sam 82313e4af5 feat(state-store): flag parked tasks when the resource their blocker names changes (#1839) 2026-11-09 14:40:58 +11:00
sam e34941b1eb fix(workflow): record a close refused for open dependencies instead of parking (#1845) 2026-11-09 14:40:58 +11:00
sam 67c9b7a00a fix(workflow): publish a baseline repair as a PR before the task continues (#1844)
Dependents now wait for the baseline gate to pass on the base branch
instead of a specific branch merging.
2026-11-09 14:40:58 +11:00
sam 20ffe63367 fix(worktree): object-not-found match tolerates a successful push
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 1m47s
deploy / plan (push) Successful in 8s
2026-11-09 14:40:19 +11:00
sam bcbd09fc08 fix(workflow): a budget stop in a parallel branch asks to continue and resumes the branch (#1838) 2026-11-09 14:37:22 +11:00
sam a3fdbddfc0 fix(worktree): match object-not-found by message too, as push transports may flatten it (#1843) 2026-11-09 14:37:18 +11:00
sam 70eef0ec99 fix(secretengine): report a full volume as an environment failure, not a bad credential (#1842) 2026-11-09 14:37:17 +11:00
sam 96236b6186 fix(worktree): rebuild the mirror and retry once when a push hits a missing object (#1843) 2026-11-09 14:37:17 +11:00
sam e75d5c8ade fix(store): a restart re-queues a running task at its interrupted step and parks it after 3 restarts (#1841)
deploy / plan (push) Successful in 7s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 4m4s
2026-11-09 14:36:08 +11:00
sam f44db54948 fix(archied): the watchdog heartbeat proves liveness and a stalled run loop reports degraded readiness (#1840)
State Store calls the daemon makes without a deadline now get one.
2026-11-09 14:36:08 +11:00
sam 44b52c54c0 build(agent): bake task into the agent image so the repository gate never fetches it per run
deploy / plan (push) Successful in 7s
deploy / dist-zip (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 8m56s
deploy / archied-image (push) Canceled after 0s
2026-11-09 14:27:18 +11:00
sam ec79c8123e fix(worktree): TestAwaitSpace recovery rows get a deadline a loaded host cannot run out 2026-11-09 14:27:18 +11:00
sam 4b0adac674 fix(daemon): open the task log before the workflow-identity check so its parks are logged
deploy / gate (push) Successful in 8m37s
deploy / agent-image (push) Successful in 23s
deploy / plan (push) Successful in 6s
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Successful in 2m4s
2026-11-09 13:55:19 +11:00
sam dc2c3b983f feat(workflow): a budget continuation resumes at the stopped step with its conversation (#1832)
deploy / plan (push) Successful in 7s
deploy / gate (push) Successful in 8m12s
deploy / agent-image (push) Successful in 28s
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Successful in 2m11s
2026-11-09 12:44:01 +11:00
sam e3dc7fc2e9 fix(issuerpc): list only issues opened by users with write access (#1830)
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Canceled after 7s
Adds Issue.Author to the forge contract; the daemon drops issues from
authors without write access and fails the listing closed when the forge
cannot answer.
2026-11-09 12:43:44 +11:00
sam 2ae471398b test(gatewayrpc): an unreachable secret engine answers Unavailable
deploy / agent-image (push) Canceled after 0s
deploy / plan (push) Successful in 7s
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 2m30s
deploy / dist-zip (push) Canceled after 0s
2026-11-09 12:39:32 +11:00
sam 6437c8009c fix(gatewayrpc): secret check reports an unreachable engine as unavailable, not as a missing key
deploy / plan (push) Successful in 13s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 1m47s
2026-11-09 12:39:12 +11:00
sam f9b6077595 fix(ui): Dismiss all tooltip opens below so the unread badge stays visible (#1837)
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
deploy / plan (push) Successful in 9s
deploy / gate (push) Successful in 8m1s
deploy / archied-image (push) Successful in 2m38s
2026-11-09 09:41:50 +11:00
sam 00f62a5772 fix(configuration): startup setting descriptions in sentence case saying what a change needs (#1836) 2026-11-09 09:41:50 +11:00
sam 3db75f9e28 fix(postgres): drop the removed schedules kind's apply status so archied is not degraded (#1834) 2026-11-09 09:41:50 +11:00
sam f27e9853cc test(workflow): budget stop asks to continue and resumes on approval (#1832) 2026-11-09 09:41:46 +11:00
sam 561863613f feat(workflow): agent.run asks to continue when it reaches its step budget (#1832) 2026-11-09 09:41:46 +11:00
sam fce5fab2a1 feat(ui): workflow row actions, throttled live reloads, toolbar and layout fixes (#1833) 2026-11-09 09:41:39 +11:00
sam 3b840d7847 fix(daemon): drop PR review activity from authors without write access (#1830)
Adds a forge HasWriteAccess call; the review scan publishes only
collaborators' reviews and comments, and issue_list marks forge text
as untrusted.
2026-11-09 09:41:39 +11:00
sam 8e5d4e8061 fix(worktree): rebuild the repo mirror when a refresh fails on a corrupt mirror (#1831) 2026-11-09 09:41:39 +11:00
sam c98666d6b7 fix(worktree): stale-clone reclaim keeps clones with uncommitted or unpushed work (#1829) 2026-11-09 09:41:33 +11:00
sam 055f2da9cd fix(daemon): reclaim stale task clones when the work volume is full; clean up dead tasks too (#1829) 2026-11-09 09:41:33 +11:00
sam fd14b8d358 fix(ui): toast on workflow enable/disable; editor toolbar wraps instead of crushing the run picker and Publish
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / gate (push) Skipped
deploy / dist-zip (push) Skipped
deploy / plan (push) Failing after 2s
2026-11-09 09:26:40 +11:00
sam 2365e5ede9 fix(archied): model catalog load no longer reverts control-plane execution budgets to the file's
deploy / agent-image (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 1m46s
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Successful in 7s
2026-11-09 09:24:51 +11:00
sam c9248a251a fix(releaseupdate): label the daemon release row Services, not Gateway
deploy / dist-zip (push) Skipped
deploy / gate (push) Skipped
deploy / plan (push) Failing after 2s
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
2026-11-09 09:08:39 +11:00
sam eb4b2fab5a fix(ui): dashboard shows five tasks needing attention, not every one
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / gate (push) Failing after 1m14s
deploy / plan (push) Successful in 7s
deploy / dist-zip (push) Skipped
2026-11-09 09:05:47 +11:00
sam e0eb1dfdb7 fix(workflow): refuse an output named result beside an agent.run result capture at save time (#1384)
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 1m25s
deploy / plan (push) Successful in 7s
2026-11-09 09:04:17 +11:00
sam 031291a4bf fix(daemon): clone free-space floor is 1 GiB, not 5; clones share the mirror's objects
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Successful in 7s
deploy / agent-image (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 3m17s
2026-11-09 09:00:46 +11:00
sam 618b22db15 fix(releaseupdate): canary ignores task alerts, which the park rate already judges
deploy / plan (push) Successful in 6s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 4m28s
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
2026-11-09 08:56:22 +11:00
sam fc50b026cf docs(deployments): name the release pipeline, not one CI system's file
deploy / gate (push) Successful in 7m38s
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Successful in 2m28s
deploy / plan (push) Successful in 6s
deploy / agent-image (push) Successful in 22s
2026-11-09 08:39:08 +11:00
sam e9f5d136b4 build(ui): drop the unused vue-sonner and vue-flow/controls dependencies
deploy / plan (push) Successful in 7s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 3m21s
2026-11-09 08:35:44 +11:00
sam 403d5f8427 refactor: drop the unused access.PolicySource and the stale playbooks usage word 2026-11-09 08:35:44 +11:00
sam 5539835dd6 docs(deployments): agent image tags match the Woodpecker pipeline; drop the missing publish.sh
deploy / plan (push) Canceled after 8s
deploy / gate (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
2026-11-09 08:35:25 +11:00
sam b16dd6add4 refactor: delete unreferenced Go code (embedding contract, PolicySource, embedded changelog, ignored webui file) and the stale playbooks usage word 2026-11-09 08:35:25 +11:00
sam a053d98d7c refactor(kit): update capability types to use spec constants and add test for known capabilities
deploy / plan (push) Successful in 7s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 2m24s
deploy / dist-zip (push) Canceled after 0s
2026-11-09 08:32:56 +11:00
sam f5a04ce8c5 refactor(archiegateway): own the chat task profiles; archied built a task creator it never read
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / plan (push) Successful in 7s
deploy / gate (push) Canceled after 22s
2026-11-09 08:32:28 +11:00
sam 9616dd72ce refactor(playbook): drop the directory loader and docs left by the playbooks command
deploy / gate (push) Successful in 14m32s
deploy / plan (push) Successful in 7s
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Successful in 12s
deploy / archied-image (push) Successful in 3m2s
2026-11-09 07:53:02 +11:00
sam 6871abd7ee chore(lint): guard the messaging service's contract boundary with depguard instead of a test
deploy / plan (push) Successful in 6s
deploy / dist-zip (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 1m47s
deploy / agent-image (push) Canceled after 0s
2026-11-09 07:51:10 +11:00
sam 32fcbf1a2b chore(lint): guard the dashboard's daemon boundary with depguard instead of a test
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Successful in 7s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 38s
2026-11-09 07:50:15 +11:00
sam 632ceb0f85 refactor: archieplaybooks is not required for some time now, webui is where playbooks are defined
deploy / agent-image (push) Canceled after 0s
deploy / plan (push) Successful in 7s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 3m46s
2026-11-09 07:46:30 +11:00
sam 5414405ceb ci(woodpecker): add the Woodpecker pipelines that replace the Actions workflows
deploy / archied-image (push) Successful in 2m20s
deploy / gate (push) Successful in 8m56s
deploy / plan (push) Successful in 6s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
quality, deploy, release, canary and promote move to .woodpecker/. The
Gitea Actions files stay in place until the maintainer removes them, so
both paths are live for now.

deploy keeps its shape (plan -> gate -> images -> signed release) in one
workflow because Woodpecker shares nothing between workflows: the plan
env file, the built zip and the agent image digest pass through the
workspace. The gate drives the host daemon through the Go client with the
socket mounted, and the images are built with buildx so the digest the
release statement pins comes from --metadata-file.

Two behavioural changes: the userns preflight is gone (a docker-backend
step cannot create unprivileged user namespaces, and no test needs one),
and the zip is no longer published as a CI artifact (Woodpecker has none);
it ships through the OCI release, which is what install.sh reads.
2026-11-09 07:02:11 +11:00
sam cdbdbbc72d chore(release): v1.61.3
deploy / plan (push) Successful in 7s
deploy / agent-image (push) Successful in 2m44s
deploy / archied-image (push) Successful in 3m32s
deploy / gate (push) Successful in 15m51s
deploy / dist-zip (push) Successful in 3m17s
2026-11-08 15:47:31 +00:00
sam 2a04abb84e docs(ui): note the merged agent-profiles and harness settings page
deploy / dist-zip (push) Skipped
deploy / plan (push) Failing after 1s
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
deploy / gate (push) Skipped
2026-11-09 02:09:58 +11:00
sam 98f5af3eef refactor(ui): merge the harness settings page into agent profiles
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / plan (push) Failing after 2s
deploy / gate (push) Skipped
The harness page's setup terminal targets the Kit agent profiles, so the
two pages were two halves of one flow split across routes: with no Kit
profile the harness page dead-ended in a disabled 'No profiles
configured' select while the place to create one sat on another page.

/settings/agent-profiles now carries the profiles editor and a 'Harness
sign-in' section (setup terminal plus the credential-bindings sign-in
table), and /settings/harness redirects to it. The bindings re-read when
a terminal session ends so a fresh capture shows immediately, and a
null-seeded agent-profiles document now renders the empty state instead
of a bare add form. The gateway page registry names the merged page.
2026-11-09 02:03:20 +11:00
sam d1b1bac4fb fix(presence): list only running agents; a finished task's agent is not stale
deploy / plan (push) Failing after 1s
deploy / agent-image (push) Skipped
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
2026-11-09 01:53:42 +11:00
sam 45b368af2e docs(agentexec): drop history and refactoring narration from comments
deploy / plan (push) Failing after 2s
deploy / gate (push) Skipped
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
2026-11-09 01:45:07 +11:00
sam 0f6448c048 refactor(agentexec): delete unused runner injection seams, ServeCaptureMCP, an unreachable approval branch and orphan fixtures
deploy / agent-image (push) Skipped
deploy / plan (push) Failing after 1s
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
2026-11-09 01:43:53 +11:00
sam b15858adc9 fix(agentexec): clip tool detail on a rune boundary, stop resuming without a session, keep captures when the ready marker fails, log with context
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / plan (push) Failing after 1s
deploy / gate (push) Skipped
2026-11-09 01:41:46 +11:00
sam 1ef576ca7b fix(agentexec): run gate commands as the harness user and reap the process group after each invocation
deploy / gate (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Skipped
deploy / plan (push) Failing after 7s
2026-11-09 01:40:10 +11:00
sam 50cb0b4276 fix(agent): point toolchains at their cache volumes so pnpm's store stays out of the worktree (#1815)
deploy / gate (push) Skipped
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / plan (push) Failing after 2s
2026-11-09 01:35:18 +11:00
sam 472478cf83 refactor(state): delete the unused ArmedBindingsForSource RPC and query
deploy / plan (push) Failing after 2s
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped
2026-11-09 01:22:02 +11:00
sam 90c7d137fb fix(ui): embed only the Latin IBM Plex subsets, woff2 only
deploy / plan (push) Failing after 1s
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / gate (push) Skipped
deploy / agent-image (push) Skipped
2026-11-09 01:21:07 +11:00
sam 2d51cf5106 perf(daemon): dispatch captured events every second instead of every poll_interval; match bindings in memory
deploy / archied-image (push) Skipped
deploy / plan (push) Failing after 2s
deploy / gate (push) Skipped
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
2026-11-09 01:19:50 +11:00
sam 1167f8a51e docs: add the Archie mark, wordmark, app icon and social card; show the wordmark in the README
deploy / gate (push) Skipped
deploy / plan (push) Failing after 1s
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
2026-11-09 01:11:08 +11:00
sam 17e6e66e72 refactor(archied): delete the file-configured forge webhook receiver; forge webhooks arrive through event capture (#1817)
deploy / gate (push) Skipped
deploy / plan (push) Failing after 2s
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
2026-11-09 00:50:00 +11:00
sam fa76f4c994 fix(worktree): sign and attribute agent commits at push; forge git credentials (#1816, #1817)
deploy / agent-image (push) Skipped
deploy / plan (push) Failing after 7s
deploy / gate (push) Skipped
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Skipped
2026-11-09 00:11:54 +11:00
sam 21a523bd35 fix(gateway): report why curators are disabled instead of never reporting
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
deploy / plan (push) Failing after 2s
deploy / gate (push) Skipped
2026-11-09 00:11:03 +11:00
sam db377380a0 perf(ui): load route pages on demand
deploy / plan (push) Failing after 32s
deploy / dist-zip (push) Skipped
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
2026-11-09 00:05:39 +11:00
sam 81fcea7a03 fix(ui): keep blocked tasks out of pinned activity alerts 2026-11-09 00:05:39 +11:00
sam 011d22c24c fix(ui): read board and alerts once on load, not again on the first stream connect 2026-11-09 00:05:39 +11:00
sam 83c8614418 fix(statestore): start service health grace at boot, not at a peer's last report 2026-11-09 00:05:39 +11:00
sam ac98b68bda feat(archied): connection commit identity and SSH commit signing (#1816)
deploy / plan (push) Failing after 2s
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / gate (push) Skipped
deploy / agent-image (push) Skipped
2026-11-09 00:05:32 +11:00
sam ad63692781 fix(archied): sign connection commits with the connection account (#1815)
deploy / plan (push) Failing after 12s
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / gate (push) Skipped
2026-11-08 23:57:40 +11:00
sam 090b220d25 fix(ui): label resolved alerts in the activity feed
deploy / plan (push) Failing after 1s
deploy / archied-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / gate (push) Skipped
deploy / agent-image (push) Skipped
2026-11-08 23:56:41 +11:00
sam 514219b6a5 chore: ignore the pnpm store agents create in the worktree
deploy / archied-image (push) Skipped
deploy / gate (push) Skipped
deploy / dist-zip (push) Skipped
deploy / plan (push) Failing after 4s
deploy / agent-image (push) Skipped
2026-11-08 23:53:17 +11:00
sam 6a5ba67cf5 ci: keep the golangci-lint cache between quality runs
deploy / dist-zip (push) Skipped
deploy / gate (push) Skipped
deploy / plan (push) Failing after 10s
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
2026-11-08 23:34:33 +11:00
sam c09ece6064 fix(webui): hash, cache and gzip dashboard assets
deploy / plan (push) Failing after 8s
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped
2026-11-08 23:32:25 +11:00
sam 43ba64684e fix(webui): start a fresh event stream at recent activity, not the whole events table
deploy / plan (push) Successful in 25s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 2m38s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
2026-11-08 23:29:40 +11:00
sam 67fa57008e fix(ui): read alerts once per event burst, not once per replayed event
deploy / dist-zip (push) Skipped
deploy / plan (push) Failing after 1s
deploy / gate (push) Skipped
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
2026-11-08 23:21:06 +11:00
sam 074ebbd931 fix(chat): keep long turns alive, record and log why a turn failed (#1813)
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / gate (push) Skipped
deploy / dist-zip (push) Skipped
deploy / plan (push) Failing after 1s
2026-11-08 23:03:04 +11:00
sam 10d23e3e06 fix(ui): compare live reloads structurally instead of serialising them (#1812)
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 1m35s
deploy / agent-image (push) Canceled after 0s
deploy / plan (push) Successful in 26s
2026-11-08 23:01:10 +11:00
sam 6a4e1964f6 refactor(chat): one send path, drop POST /api/chat/message
deploy / plan (push) Successful in 8s
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / gate (push) Failing after 13m53s
deploy / dist-zip (push) Skipped
2026-11-08 18:34:26 +11:00
sam 5939ef6ff1 fix(postgres): write no audit row when retention prunes nothing (#1810)
deploy / archied-image (push) Successful in 2m55s
deploy / plan (push) Successful in 10s
deploy / agent-image (push) Successful in 12s
deploy / gate (push) Successful in 8m29s
deploy / dist-zip (push) Skipped
2026-11-08 17:27:30 +11:00
sam 1d9eff6529 fix(ops): log cancelled contexts at debug, one reconnect line per outage (#1809) 2026-11-08 17:27:30 +11:00
sam 6ae7f319cb fix(staterpc): log the cause of run credential lookup failures (#1808) 2026-11-08 17:27:30 +11:00
sam 260e9fc46e fix(agentworker): stop reporting task worker presence (#1807) 2026-11-08 17:27:30 +11:00
sam 52b5740c39 fix(daemon): cap tasks per issue poll and wait for disk before cloning (#1805)
deploy / plan (push) Successful in 1m6s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 11s
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
2026-11-08 17:26:00 +11:00
sam d11a0cd245 fix(workflow): one baseline fix per repository revision, drop download noise from gate output (#1806)
deploy / archied-image (push) Canceled after 0s
deploy / gate (push) Canceled after 1m2s
deploy / plan (push) Successful in 14s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
2026-11-08 17:23:21 +11:00
sam 860b2c85e0 fix(taskstate): retry transient parks with backoff, escalate when exhausted (#1804)
deploy / gate (push) Canceled after 2m21s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / plan (push) Successful in 16s
2026-11-08 17:19:14 +11:00
sam af7577625f refactor(messaging): store Telegram's connection in extension-settings (#1802)
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / gate (push) Canceled after 7m26s
deploy / plan (push) Successful in 11s
deploy / dist-zip (push) Canceled after 0s
2026-11-08 17:12:59 +11:00
sam 617a312ed5 ci(deploy): cancel superseded main deploys, never a release (#1801)
deploy / archied-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
deploy / gate (push) Canceled after 0s
deploy / plan (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
2026-11-08 17:11:56 +11:00
sam a7d202fb04 ci: drop comments from workflow scripts 2026-11-08 17:11:56 +11:00
sam 2a52508a5d fix(build): install protoc-gen-go and protoc-gen-go-grpc in the agent image
deploy / archied-image (push) Skipped
deploy / gate (push) Failing after 14m30s
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
The in-container baseline task check failed at proto:check because buf
generate could not find either plugin on PATH, parking every task at
gate.repository.
2026-11-08 17:11:49 +11:00
sam 98fb9dfddf feat(workflow): task, workflow, step and model attributes on run, step and agent spans (#1803)
deploy / gate (push) Successful in 16m25s
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Successful in 22s
deploy / archied-image (push) Successful in 7m25s
2026-11-08 17:00:42 +11:00
sam 64bb195700 perf(ui): mount row action dialogs only while open and keep unchanged live reloads (#1798)
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
deploy / gate (push) Failing after 13m59s
2026-11-08 16:55:59 +11:00
sam c8a46fd9e7 ci: drop comments from workflow files
deploy / gate (push) Successful in 16m26s
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Successful in 12s
deploy / archied-image (push) Successful in 3m53s
2026-11-08 16:55:03 +11:00
sam 93db9a6395 feat(extensions): typed extension settings (number, boolean, duration, list, select)
deploy / agent-image (push) Successful in 12s
deploy / dist-zip (push) Skipped
deploy / gate (push) Successful in 7m52s
deploy / archied-image (push) Successful in 2m33s
2026-11-08 16:14:23 +11:00
sam 89808d0719 fix(extensions): list settings a version no longer declares and save only once they are removed
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Skipped
deploy / gate (push) Failing after 13m0s
deploy / agent-image (push) Skipped
2026-11-08 16:07:42 +11:00
sam ef99b7d74e fix(extensions): keep an extension's settings across removal and keys a version drops
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
deploy / gate (push) Failing after 3m39s
2026-11-08 16:05:19 +11:00
sam 62ddbea0c1 fix(messaging): show a configured Telegram whose extension is not installed
deploy / gate (push) Failing after 8m12s
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
2026-11-08 16:00:29 +11:00
sam b548cabcbf refactor(publicnet): one public-address dial guard for webhooks, attachments and web fetch (#1795)
deploy / agent-image (push) Skipped
deploy / archied-image (push) Skipped
deploy / gate (push) Failing after 8m13s
deploy / dist-zip (push) Skipped
2026-11-08 15:52:39 +11:00
sam 8f37cc79cd feat(channels): package-declared channel settings on an instance Channels page (#1796)
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / gate (push) Failing after 8m32s
deploy / dist-zip (push) Skipped
2026-11-08 15:48:43 +11:00
sam 031521550a fix(ui): keep unchanged rows across live reloads on the dashboard and workflows (#1798)
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped
deploy / gate (push) Failing after 8m11s
deploy / archied-image (push) Skipped
2026-11-08 15:09:06 +11:00
sam 3b67ef746f Merge pull request 'fix(daemon): claim and fetch tasks only while the dispatcher has room' (#1799) from fix/1797-claim-within-capacity into main
deploy / gate (push) Successful in 6m5s
deploy / agent-image (push) Successful in 15s
deploy / archied-image (push) Successful in 3m9s
deploy / dist-zip (push) Skipped
2026-11-08 03:53:07 +00:00
sam 18838105f0 ci(quality): run on pull requests only; deploy gates main
deploy / archied-image (push) Successful in 3m10s
deploy / dist-zip (push) Skipped
deploy / gate (push) Successful in 4m50s
deploy / agent-image (push) Successful in 15s
2026-11-08 14:50:29 +11:00
sam d70596f4bf Merge branch 'main' into fix/1797-claim-within-capacity
Quality / check (pull_request) Successful in 7m24s
2026-11-08 03:45:21 +00:00
sam a9878c329d Merge pull request 'fix(ui/tasks): keep unchanged rows across live reloads' (#1800) from fix/1798-task-list-stable-rows into main
deploy / gate (push) Successful in 4m39s
Quality / check (push) Successful in 6m40s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Successful in 3m27s
Reviewed-on: #1800
2026-11-08 03:45:13 +00:00
sam 558659bcf4 test(daemon): adopt go fix's promoted-field literal (#1797)
Quality / check (pull_request) Canceled after 2m32s
2026-11-08 03:37:54 +00:00
sam 00e7603932 fix(ui/tasks): keep unchanged rows across live reloads (#1798)
Quality / check (pull_request) Successful in 6m36s
2026-11-08 03:32:08 +00:00
sam 33f7323eb0 fix(daemon): claim and fetch tasks only while the dispatcher has room (#1797)
Quality / check (pull_request) Failing after 6m37s
2026-11-08 03:29:25 +00:00
sam 184038a918 fix(webui): link tasks to their repository connection's forge
deploy / archied-image (push) Successful in 3m2s
deploy / dist-zip (push) Skipped
Quality / check (push) Successful in 44m46s
deploy / agent-image (push) Successful in 12s
deploy / gate (push) Successful in 4m52s
2026-11-08 06:42:38 +11:00
sam 8cb76092b6 chore(release): v1.61.2
deploy / gate (push) Successful in 5m3s
Quality / check (push) Canceled after 12m5s
deploy / agent-image (push) Successful in 3m23s
deploy / dist-zip (push) Successful in 1m51s
deploy / archied-image (push) Successful in 3m6s
2026-11-08 06:30:16 +11:00
sam 49d7619ba3 fix(daemon): claim a requeued backlog without a poll wait per task
deploy / gate (push) Successful in 4m56s
Quality / check (push) Canceled after 6m11s
deploy / archied-image (push) Successful in 3m1s
deploy / agent-image (push) Successful in 12s
deploy / dist-zip (push) Skipped
2026-11-08 06:24:54 +11:00
sam ae53e83ff3 chore(release): v1.61.1
Quality / check (push) Successful in 6m19s
deploy / archied-image (push) Successful in 3m0s
deploy / dist-zip (push) Successful in 2m41s
deploy / gate (push) Successful in 4m46s
deploy / agent-image (push) Successful in 3m16s
2026-11-08 06:04:33 +11:00
sam ef84e18f46 fix(ui): a new canvas workflow names the agent it runs as (#1622)
Quality / check (push) Successful in 6m53s
deploy / agent-image (push) Successful in 11s
deploy / gate (push) Successful in 4m52s
deploy / archied-image (push) Successful in 3m21s
deploy / dist-zip (push) Skipped
2026-11-08 05:49:40 +11:00
sam cf1be16763 fix(controlplane): repair a stored workflow collection that no longer validates (#1622) 2026-11-08 05:49:40 +11:00
sam cc8428643a fix(gatewayrpc): sniff the head of URL-only attachments (#1672)
deploy / dist-zip (push) Skipped
deploy / agent-image (push) Successful in 12s
deploy / gate (push) Successful in 4m41s
Quality / check (push) Successful in 7m2s
deploy / archied-image (push) Successful in 3m37s
2026-11-08 05:40:27 +11:00
1282 changed files with 69699 additions and 36380 deletions

No files matched your search

-61
View File
@@ -1,61 +0,0 @@
# Every 15 minutes, checks how the release installed on the canary host is
# running, judged over the window counted from its install (-window, default
# 24h; CANARY_WINDOW overrides it). If a hard check fails, the canary goes
# back to the stable release straight away. If the release stays healthy for
# the window, it's promoted to stable. A rollback fails the run, so it shows
# up red.
name: canary
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch:
concurrency:
group: canary
permissions:
contents: read
packages: write
jobs:
judge:
if: vars.CANARY_URL != ''
runs-on: self-hosted
steps:
# Full history with tags: a rollback compares the migrations between
# the stable and failed release tags.
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# The self-hosted runner keeps the Go caches on disk between jobs, and
# archiving them for the Actions cache takes minutes.
cache: false
- name: Build archied
# The check never serves the dashboard, so the build leaves it out.
run: go build -tags no_ui -o "$RUNNER_TEMP/archied" ./cmd/archied
# Promotion retags stable and the images' latest in the registry.
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
- name: Judge the canary
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
CANARY_WINDOW: ${{ vars.CANARY_WINDOW }}
run: |
window_args=()
if [ -n "$CANARY_WINDOW" ]; then
window_args=(-window "$CANARY_WINDOW")
fi
"$RUNNER_TEMP/archied" release canary check -dashboard "${{ vars.CANARY_URL }}" \
"${window_args[@]}" \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
+82 -262
View File
@@ -1,28 +1,11 @@
# Builds and pushes the archied and archie-agent images to the Gitea
# registry on every merge to main, and publishes the distribution zip as a
# release on this repository. Gitea Actions reads this .github/workflows/
# directory.
name: deploy
on:
push:
branches: [main]
tags: ["v*"]
# Rapid successive pushes to main (a release commit right after its
# preceding fix, say) previously queued a full gate+build for each one,
# several minutes apiece, with no caching -- so a burst of pushes left
# three deploys racing in parallel for the same runner capacity. Only the
# last one's images matter (each job pushes its image tags), so cancel a
# superseded run rather than let it fight for resources it can't use.
#
# Keyed on the commit, not github.ref: a release push lands main and its
# tag in one go, both pointing at the same commit -- on.push matches
# branches and tags both, so a single release push otherwise fires
# redundant builds of identical content that a ref-keyed group can't see
# as the same work.
concurrency:
group: deploy-${{ github.sha }}
group: deploy-${{ github.ref }}
cancel-in-progress: true
permissions:
@@ -30,47 +13,44 @@ permissions:
packages: write
jobs:
gate:
plan:
runs-on: self-hosted
outputs:
archied_version: ${{ steps.release_tag.outputs.archied_version }}
sha: ${{ steps.release_tag.outputs.sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Resolve the release
id: release_tag
run: |
echo "archied_version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
echo "sha=$(git rev-parse "${GITHUB_REF}^{commit}")" >> "$GITHUB_OUTPUT"
gate:
needs: plan
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
# Read the release from the commit, not from github.ref. One release
# push carries main and both tags at the same SHA, and only one of
# those refs survives the concurrency group, so a ref-derived version
# is whatever won the race. The tag at HEAD is the same either way.
- name: Resolve archied tag at HEAD
id: release_tag
run: |
version="$(git tag --points-at HEAD --list 'v*' | sed -e 's|^v||' | sort -V | tail -1)"
echo "archied_version=$version" >> "$GITHUB_OUTPUT"
if [ -n "$version" ]; then
echo "archied release at HEAD: $version"
else
echo "no release tag at HEAD; distribution zip will be skipped"
fi
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
with:
go-version-file: go.mod
# The self-hosted runner keeps the Go caches on disk between jobs, and
# archiving them for the Actions cache takes minutes.
cache: false
- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1
with:
package_json_file: ui/package.json
- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: "22"
node-version: "24"
- name: Install quality tools
run: |
@@ -87,259 +67,127 @@ jobs:
git branch main origin/main
fi
# ripgrep and the unprivileged-userns sysctl are provisioned on the host.
# A self-hosted runner should not need sudo, and installing a package on
# every run is not the gate's job.
- name: Verify unprivileged user namespaces
run: unshare --user --map-root-user --net true
# The gate's uncached `go test ./...` runs the Docker-backed tests that
# -short skips, and those start a container from alpine:3. A fresh runner
# has no such image, so the suite failed on "No such image: alpine:3".
- name: Pull test container images
run: docker pull alpine:3
# One definition of the gate, in the Taskfile. TEST_FLAGS is the one
# difference: the release runs the whole suite, uncached and including
# the Docker-backed tests -short skips. The diff after it asserts
# `task fmt` changed nothing.
- name: Quality gate
env:
RELEASE_VERSION: ${{ needs.plan.outputs.archied_version }}
run: |
task check TEST_FLAGS=-count=1
task check dist TEST_FLAGS=-count=1 VERSION="$RELEASE_VERSION"
git diff --exit-code
- name: Vulnerability scan
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
go install golang.org/x/vuln/cmd/govulncheck@v1.9.0
govulncheck ./...
- name: Release tags must match changelogs
run: |
set -e
fail=0
for tag in $(git tag --points-at HEAD); do
case "$tag" in
v*)
ver="${tag#v}"
echo " release tag $tag -> looking for [$ver] in CHANGELOG.md"
grep -q "^## \\[$ver\\]" CHANGELOG.md || {
echo " FAIL: CHANGELOG.md has no [$ver] section"
fail=1
}
;;
esac
done
if [ $fail -ne 0 ]; then
echo
echo "A release tag points at this commit but its changelog does not"
echo "describe that version. Cut releases with the release workflow."
exit 1
fi
if ! git tag --points-at HEAD | grep -qE '^v[0-9]' ; then
echo "This commit isn't a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest promoted release."
fi
- name: Package the release binaries
# tar keeps the executable bit, which an uploaded artifact drops.
run: tar -cf release-binaries.tar dist
- name: Upload the release binaries
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: release-binaries
path: release-binaries.tar
if-no-files-found: error
retention-days: 1
archied-image:
needs: gate
needs: [plan, gate]
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Deliberately NOT `github.sha`. On a tag push that is the ref's OBJECT id,
# and every release tag in this repo is annotated, so it names a tag object
# that cannot be checked out. Dereference it to the commit.
- name: Resolve the commit this ref points at
id: commit
run: |
sha="$(git rev-parse "${GITHUB_REF}^{commit}")"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
echo "short=${sha:0:12}" >> "$GITHUB_OUTPUT"
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
with:
# One named builder that is never removed, so the Dockerfiles' cache
# mounts are still there on the next run. Removing it at the end of
# a job would take it from under another run that is building.
name: archie-ci
cleanup: false
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
- name: Resolve component versions
id: versions
run: |
# One release stream: a `v*` tag names both components' versions.
RELEASE_TAG="$(git tag --points-at HEAD --list 'v*' | sort -V | tail -1)"
GATEWAY_VERSION="${RELEASE_TAG#v}"
RUNTIME_VERSION="${RELEASE_TAG#v}"
# `dev+<sha>` is what a build that is NOT a release reports, and it is
# honest now that such a build no longer publishes :latest: the version
# names the commit it came from, and the sha-<sha> tag makes it
# restorable. Before, this same string reached :latest minutes after a
# release and made the release's own stamping read as dev
# (archie-core-i5nb). (On an untagged push GITHUB_SHA IS the commit —
# the tag case is handled by the dereference above.)
[ -n "$GATEWAY_VERSION" ] || GATEWAY_VERSION="dev+${GITHUB_SHA:0:12}"
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION="dev+${GITHUB_SHA:0:12}"
echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
echo "gateway=$GATEWAY_VERSION" >> "$GITHUB_OUTPUT"
echo "runtime=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
# :latest names the newest PROMOTED release, so a release publishes
# :v<version> and canary promotion moves :latest to it. A push to
# main publishes :edge (mutable, newest main) and sha-<sha>
# (immutable), so an ordinary commit never overwrites a release's
# stamping.
#
# `if` blocks rather than `[ -n "$X" ] && echo`: the latter returns
# non-zero when the test fails, and these steps run under `set -e`.
{
echo "archied_tags<<EOF"
if [ -n "$RELEASE_TAG" ]; then
echo "git.catlow.cloud/sam/archied:$RELEASE_TAG"
fi
echo "git.catlow.cloud/sam/archied:edge"
echo "git.catlow.cloud/sam/archied:sha-${{ steps.commit.outputs.sha }}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Build and push archied
uses: docker/build-push-action@v6
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
with:
context: .
file: Dockerfile.archied
push: true
tags: ${{ steps.versions.outputs.archied_tags }}
tags: |
git.catlow.cloud/sam/archied:v${{ needs.plan.outputs.archied_version }}
git.catlow.cloud/sam/archied:sha-${{ needs.plan.outputs.sha }}
build-args: |
GATEWAY_VERSION=${{ steps.versions.outputs.gateway }}
RUNTIME_VERSION=${{ steps.versions.outputs.runtime }}
GATEWAY_VERSION=${{ needs.plan.outputs.archied_version }}
RUNTIME_VERSION=${{ needs.plan.outputs.archied_version }}
cache-from: type=gha,scope=archied
cache-to: type=gha,mode=max,scope=archied
agent-image:
needs: [plan, gate]
outputs:
agent_digest: ${{ steps.agent.outputs.digest }}
needs: gate
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Annotated tags: dereference to the commit, as archied-image does.
- name: Resolve the commit this ref points at
id: commit
run: |
sha="$(git rev-parse "${GITHUB_REF}^{commit}")"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
echo "short=${sha:0:12}" >> "$GITHUB_OUTPUT"
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
with:
# One named builder that is never removed, so the Dockerfiles' cache
# mounts are still there on the next run. Removing it at the end of
# a job would take it from under another run that is building.
name: archie-ci
cleanup: false
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
- name: Resolve runtime version
id: versions
run: |
RELEASE_TAG="$(git tag --points-at HEAD --list 'v*' | sort -V | tail -1)"
RUNTIME_VERSION="${RELEASE_TAG#v}"
echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
echo "runtime=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
- name: Build and push archie-agent
id: agent
if: steps.versions.outputs.release_tag != ''
uses: docker/build-push-action@v6
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
with:
context: .
file: Dockerfile
push: true
tags: |
git.catlow.cloud/sam/archie-agent:${{ steps.versions.outputs.release_tag }}
git.catlow.cloud/sam/archie-agent:sha-${{ steps.commit.outputs.sha }}
git.catlow.cloud/sam/archie-agent:v${{ needs.plan.outputs.archied_version }}
git.catlow.cloud/sam/archie-agent:sha-${{ needs.plan.outputs.sha }}
build-args: |
RUNTIME_VERSION=${{ steps.versions.outputs.runtime }}
RUNTIME_VERSION=${{ needs.plan.outputs.archied_version }}
cache-from: type=gha,scope=archie-agent
cache-to: type=gha,mode=max,scope=archie-agent
# Packages every host-run binary (archied, archie-gateway,
# archie-state-store, archie-ui, archie-messaging) as a
# linux/amd64 zip for a
# non-Docker install, plus archie-agent: it has no unit, but a Kit run
# mounts it from archied's directory, so a host without it parks them.
# It waits only for the agent image, whose digest
# release.json pins.
dist-zip:
needs: [gate, agent-image]
# Not gated on github.ref. A release is pushed as main plus both tags at
# one SHA, the concurrency group below collapses those into a single run,
# and the survivor is whichever ref happened to start last -- for
# v1.23.0 that was refs/heads/main, so this job was skipped and no zip
# was ever produced. Resolve the tag from the commit instead of trusting
# the ref that won the race, and skip only when there is genuinely no
# archied tag at HEAD.
if: needs.gate.outputs.archied_version != ''
needs: [plan, gate, archied-image, agent-image]
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
go-version-file: go.mod
# The self-hosted runner keeps the Go caches on disk between jobs, and
# archiving them for the Actions cache takes minutes.
cache: false
fetch-depth: 0
- uses: pnpm/action-setup@v4
# The gate built these from the tree it checked; nothing is compiled here.
- name: Download the release binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
package_json_file: ui/package.json
name: release-binaries
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "24"
# archied and archie-ui embed the dashboard.
- name: Build the dashboard
working-directory: ui
run: |
pnpm install --frozen-lockfile
pnpm run build
- name: Unpack the release binaries
run: tar -xf release-binaries.tar
- name: Resolve archied version
id: version
run: echo "version=${{ needs.gate.outputs.archied_version }}" >> "$GITHUB_OUTPUT"
- name: Build linux/amd64 binaries
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: "0"
run: |
set -e
# Every process in the documented deployment ships in the zip, and
# every one of them carries the archied version it was cut from:
# they are one release, and an operator matching binaries by eye
# needs each to say so.
#
# That claim is load-bearing and this list is the whole of it: the
# v1.30.0 messaging extraction moved Telegram/email/webhook out of
# archied and nothing added archie-messaging here, so a host install
# ran on with a dead Telegram bot and no error anywhere
# (archie-core-1c01). TestDistZipShipsEveryHostCommand fails if this
# list and the copy list below stop matching the commands in cmd/.
ldflags="-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary -X github.com/samcharles93/archie-core/internal/buildinfo.Version=${{ steps.version.outputs.version }} -X github.com/samcharles93/archie-core/internal/buildinfo.Runtime=${{ steps.version.outputs.version }} -X github.com/samcharles93/archie-core/internal/app/agentworker.version=${{ steps.version.outputs.version }}"
mkdir -p dist
# Units first, then the binaries that run beside them without one.
# The agentworker stamp only lands in archie-agent; the linker
# ignores -X for a symbol a binary does not import.
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
go build -ldflags "$ldflags" -o "dist/$cmd" "./cmd/$cmd"
done
run: echo "version=${{ needs.plan.outputs.archied_version }}" >> "$GITHUB_OUTPUT"
- name: Assemble distribution zip
id: zip
@@ -350,27 +198,21 @@ jobs:
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
cp "dist/$cmd" "$name/"
done
cp deployments/INSTRUCTIONS.md CHANGELOG.md "$name/"
cp deployments/INSTRUCTIONS.md "$name/"
digest='${{ needs.agent-image.outputs.agent_digest }}'
test -n "$digest"
jq --arg image "git.catlow.cloud/sam/archie-agent@$digest" '. + {agent_image: $image}' release.json > "$name/release.json"
# README.md doesn't exist yet in this repo; include it once it does
# rather than fail the release on its absence.
[ -f README.md ] && cp README.md "$name/"
zip -r "$name.zip" "$name"
echo "name=$name" >> "$GITHUB_OUTPUT"
- name: Upload distribution zip
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: ${{ steps.zip.outputs.name }}
path: ${{ steps.zip.outputs.name }}.zip
retention-days: 90
# Installs and updates take a release from the signed artifact in the
# registry, so this is what publishes it: the statement signed with
# RELEASE_SIGNING_KEY and the zip, tagged v<version> and next. stable
# moves only when canary.yml promotes it.
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
@@ -388,8 +230,6 @@ jobs:
-agent-image "git.catlow.cloud/sam/archie-agent@${{ needs.agent-image.outputs.agent_digest }}" \
-changelog "https://git.catlow.cloud/sam/archie/releases/tag/v$version"
# The release page carries this version's changelog section, the
# release's own reviewed prose; the signed statement links to it.
- name: Publish the Gitea release notes
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
@@ -397,42 +237,22 @@ jobs:
set -e
tag="v${{ steps.version.outputs.version }}"
version="${{ steps.version.outputs.version }}"
prerelease=false
case "$version" in *-*) prerelease=true ;; esac
notes="$(mktemp)"
awk -v hdr="## [$version]" '
index($0, hdr) == 1 { printing = 1 }
printing && /^## \[/ && index($0, hdr) != 1 { exit }
printing { print }
' CHANGELOG.md > "$notes"
if ! [ -s "$notes" ]; then
echo "no [$version] section extracted from CHANGELOG.md" >&2
exit 1
fi
previous="$(git describe --tags --abbrev=0 --match 'v*' "$tag^" 2>/dev/null || true)"
git log --no-merges --format='- %s' ${previous:+"$previous.."}"$tag" > "$notes"
api="https://git.catlow.cloud/api/v1"
repo="sam/archie"
auth="Authorization: token $DEPLOY_TOKEN"
# Idempotent: a re-run replaces the release on the tag.
curl -sf -X DELETE -H "$auth" "$api/repos/$repo/releases/tags/$tag" >/dev/null || true
curl -sf -X POST -H "$auth" -H "Content-Type: application/json" \
-d "$(jq -n --arg tag "$tag" --arg name "Archie v$version" --arg body "$(cat "$notes")" \
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')" \
--argjson prerelease "$prerelease" \
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: $prerelease}')" \
"$api/repos/$repo/releases" >/dev/null
echo "published release notes for $tag"
# The canary host follows the `next` channel. canary.yml then judges the
# release installed on the canary and decides whether it is promoted to
# stable or the canary is rolled back. The start is queue-safe: a release
# published while the canary still judges a newer one is queued behind
# it and picked up by the next check, so the running window isn't
# restarted under a different release.
- name: Install the release on the canary
if: vars.CANARY_URL != ''
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
run: ./dist/archied release canary start -dashboard "${{ vars.CANARY_URL }}" -version "${{ steps.version.outputs.version }}"
# A Gitea package belongs to its owner, not a repository, so the ones this
# workflow publishes are linked here. Linking is per package and a no-op
# once done, so an already linked package is not an error.
- name: Link the packages to this repository
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
+16 -28
View File
@@ -1,14 +1,10 @@
# Promotes the release the canary is running right now, without waiting out
# the judging window: the canary's signals must show no hard failure and no
# relative breach, otherwise the run refuses and fails. Dispatch it with the
# version the canary runs (`archied release canary status` shows it).
name: promote
on:
workflow_dispatch:
inputs:
version:
description: "release the canary is expected to run; must match what it runs"
description: "published release to move stable to, such as 1.63.0"
required: true
type: string
@@ -22,34 +18,26 @@ permissions:
jobs:
promote:
if: vars.CANARY_URL != ''
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# The self-hosted runner keeps the Go caches on disk between jobs, and
# archiving them for the Actions cache takes minutes.
cache: false
- name: Build archied
# The promote never serves the dashboard, so the build leaves it out.
run: go build -tags no_ui -o "$RUNNER_TEMP/archied" ./cmd/archied
# Promotion retags stable and the images' latest in the registry.
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
- name: Promote the canary's release
- name: Fetch the release's archied
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
VERSION: ${{ inputs.version }}
run: |
"$RUNNER_TEMP/archied" release canary promote -dashboard "${{ vars.CANARY_URL }}" \
-version "${{ inputs.version }}" \
set -e
image="git.catlow.cloud/sam/archied:v$VERSION"
docker pull -q "$image"
container="$(docker create "$image")"
docker cp "$container:/usr/local/bin/archied" "$RUNNER_TEMP/archied"
docker rm "$container" >/dev/null
- name: Promote to stable
env:
VERSION: ${{ inputs.version }}
run: |
"$RUNNER_TEMP/archied" release promote \
-version "$VERSION" \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
+12 -9
View File
@@ -2,8 +2,6 @@ name: Quality
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
@@ -16,25 +14,22 @@ jobs:
check:
runs-on: archie-quality
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
# ripgrep and the unprivileged-userns sysctl are provisioned on the host.
# A self-hosted runner should not need sudo, and installing a package on
# every run is not the gate's job.
- name: Verify unprivileged user namespaces
run: unshare --user --map-root-user --net true
- uses: actions/setup-go@v5
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
with:
go-version-file: go.mod
- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1
with:
package_json_file: ui/package.json
- uses: actions/setup-node@v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: "24"
@@ -45,6 +40,14 @@ jobs:
go install mvdan.cc/gofumpt@v0.11.0
bash tools/proto.sh install
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: ~/.cache/golangci-lint
key: golangci-lint-${{ hashFiles('.golangci-version', '.golangci.yml', 'go.sum') }}-${{ github.sha }}
restore-keys: |
golangci-lint-${{ hashFiles('.golangci-version', '.golangci.yml', 'go.sum') }}-
golangci-lint-
- name: Ensure contract baseline ref
run: |
if ! git show-ref --verify --quiet refs/heads/main; then
+4 -14
View File
@@ -1,6 +1,3 @@
# Cuts a release from main: [Unreleased] in CHANGELOG.md becomes the version's
# section, then the commit and its tag are pushed together. The tag push starts
# deploy.yml, which publishes the release to `next` for the canary.
name: release
on:
@@ -21,32 +18,26 @@ jobs:
cut:
runs-on: self-hosted
steps:
# A mirror carries its own Actions secrets. An empty token checks out
# fine and fails at the push instead, which reads as a broken release.
- name: Check DEPLOY_TOKEN is configured
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
if [ -z "$DEPLOY_TOKEN" ]; then
echo "::error::DEPLOY_TOKEN is not set for this repository, so the release cannot push its commit and tag. Set the secret here, or dispatch the release from the Gitea primary."
echo "::error::DEPLOY_TOKEN is not set for this repository, so the release cannot push its tag. Set the secret here, or dispatch the release from the Gitea primary."
exit 1
fi
# DEPLOY_TOKEN rather than the job token: a push made with the job token
# doesn't start workflows, and the tag push must start deploy.yml.
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
ref: main
fetch-depth: 0
token: ${{ secrets.DEPLOY_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
with:
go-version-file: go.mod
# The self-hosted runner keeps the Go caches on disk between jobs, and
# archiving them for the Actions cache takes minutes.
cache: false
- name: Install Task
@@ -60,6 +51,5 @@ jobs:
git config user.email "sam@catlow.tech"
task release RELEASE="$RELEASE"
# Atomic: a commit without its tag would build images stamped dev.
- name: Push the release
run: git push --atomic origin main "$(git describe --exact-match --match 'v*' HEAD)"
run: git push origin "$(git describe --exact-match --match 'v*' HEAD)"
+3
View File
@@ -1,6 +1,7 @@
/archied
/archie-agent
/bin/
/dist/
.task/
*.db
.references/
@@ -48,3 +49,5 @@ __pycache__/
# Local symlink to the archipelago marketplace repo
/archipelago
.agents-run/
/.pnpm-store/
deployments/archie/.build/
+48 -2
View File
@@ -42,6 +42,7 @@ linters:
- errorlint
- fatcontext
- forcetypeassert
- gosec
- makezero
- nilerr
- nilnesserr
@@ -82,8 +83,48 @@ linters:
- {pkg: "github.com/samcharles93/archie-core/internal/app/archied", desc: "the daemon is another service"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/archiegateway", desc: "the Gateway is another service"}
- {pkg: "github.com/nats-io", desc: "the State Store serves gRPC only"}
dashboard-service:
files: ["**/internal/webui/**", "**/internal/app/archieui/**", "**/cmd/archie-ui/**"]
deny:
- {pkg: "github.com/samcharles93/archie-core/internal/container", desc: "only the daemon owns containers"}
- {pkg: "github.com/samcharles93/archie-core/internal/agentexec", desc: "only the daemon owns containers"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/archied", desc: "the daemon is another service"}
messaging-service:
files: ["**/internal/app/archiemessaging/**", "**/cmd/archie-messaging/**"]
deny:
- {pkg: "github.com/jackc/pgx", desc: "reach the State Store through its contract"}
- {pkg: "github.com/samcharles93/archie-core/internal/infrastructure/postgres", desc: "reach the State Store through its contract"}
- {pkg: "github.com/samcharles93/archie-core/internal/infrastructure/controlplanestore", desc: "reach the State Store through its contract"}
- {pkg: "github.com/samcharles93/archie-core/internal/domain/workflow", desc: "the workflow engine is the daemon's"}
- {pkg: "github.com/samcharles93/archie-core/internal/agentexec", desc: "agent execution is the daemon's"}
# The single binary replaces the services slice by slice. It never
# imports their packages, so each old path can be deleted outright.
single-binary:
files: ["**/cmd/archie/**", "**/internal/app/archie/**", "**/internal/platform/**", "**/modules/**"]
deny:
- {pkg: "github.com/samcharles93/archie-core/internal/app/archied", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/statestore", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/archiegateway", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/archiemessaging", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/archieui", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/servicekit", desc: "old service plumbing"}
- {pkg: "github.com/samcharles93/archie-core/internal/daemon", desc: "old service code; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/gateway", desc: "old service code; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/webui", desc: "old service code; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/domain", desc: "old domain code; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/infrastructure", desc: "old infrastructure; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/state", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/gateway", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/daemon", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/controlplane", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/messaging", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/logging", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/forge", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/channel", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/config", desc: "the single binary has its own bootstrap config"}
- {pkg: "github.com/nats-io", desc: "the single binary has no message bus"}
shared:
files: ["**/internal/app/servicekit/**", "**/internal/app/chattask/**"]
files: ["**/internal/app/servicekit/**"]
deny:
- {pkg: "github.com/samcharles93/archie-core/internal/daemon", desc: "shared code must not pull in a service"}
- {pkg: "github.com/samcharles93/archie-core/internal/webui", desc: "shared code must not pull in a service"}
@@ -114,6 +155,12 @@ linters:
- HACK
- BUG
gosec:
excludes:
- G104 # errcheck covers unchecked errors
- G115 # integer conversions are bounded where they occur
- G204 # running commands is what the tools and workflow steps do
- G304 # file paths come from configuration and confined worktrees
interfacebloat:
max: 8
@@ -133,7 +180,6 @@ linters:
- ui/node_modules
presets:
- comments
- std-error-handling
- common-false-positives
- legacy
rules:
-4
View File
@@ -1,4 +0,0 @@
# Generated output: only its generator writes it, and the gate byte-checks it.
docs/data/generated/
internal/contracts/
ui/dist/
-2836
View File
File diff suppressed because it is too large. Load diff
+103 -51
View File
@@ -5,21 +5,39 @@ here changes a decision. If a rule stops changing decisions, delete it.
## What this is
**archie-core** is event-driven agentic automation. An event (an issue, PR,
webhook, schedule, chat message) is matched to a workflow, the workflow runs an
agent or tool in an isolated container, and the result lands somewhere for
review or action. A repository is an optional input to a workflow, not the point
of the product. A forge is one of many inputs or outputs; core code never
assumes one.
**archie-core** is event-driven agentic automation. An event (an alert, a
webhook, a schedule, a chat message, an issue) is matched to a workflow, the
workflow runs an agent whose every action is judged before it runs, and the
result lands somewhere for review or action. A repository is an optional input
to a workflow, not the point of the product. A forge is one of many inputs or
outputs; core code never assumes one.
<temporary - remove on 2026-12-01> The goal until 1 December is a
production-ready archie-core, including the features the maintainer is still
adding. Speak up when a request competes with something more urgent: a bug that
loses work, a failure that shows nothing, a security gap, a broken setup path.
Give the trade-off in a sentence or two and suggest whether the request belongs
in the backlog. Don't hold work back on your own judgement. </temporary>
## Layout
## Services and layout
Main is becoming one binary, `archie`. The design is ARCHITECTURE.md in the
private sam/archie-product repo, and the work is epic #1977. New work goes
there:
- `cmd/archie` parses flags and calls `internal/app/archie`, the composition
root.
- Each module is `modules/<name>/`: an API package and an `internal/` directory
nothing outside the module can import. Modules reach each other only through
API packages, own their schema and tables, and keep no state only in memory.
- `internal/platform/` holds the few leaf packages every module may use.
- The new code never imports the old services' packages (depguard enforces it).
Old code moves: `git mv` it into the module that owns it, then adapt it.
While an old service still imports it, copy it instead, name the source
path in the commit, and delete the old copy with its service.
MIGRATION.md in sam/archie-product gives every old package a destination and
a verdict. Writing a replacement from scratch, or deleting an old package,
needs the maintainer's verdict on its row. Before building anything an old
package already does, read that package and carry its behaviour.
### The services being replaced
The six services below are deleted slice by slice as the binary replaces them,
each only once MIGRATION.md has a verdict for every package it holds. Don't
add features to them; fix them only when a bug blocks work.
Each service is a gRPC contract in `proto/<service>/v1`, generated into
`internal/contracts/<service>/v1`, and one binary in `cmd/` that parses flags
@@ -27,16 +45,22 @@ and calls its composition root in `internal/app/<service>`.
| Binary | Serves | Dials |
| --- | --- | --- |
| `archie-state-store` | State Store and Control Plane contracts; owns the task and control-plane PostgreSQL tables | PostgreSQL |
| `archie-gateway` | Chat, conversation state, task tools | State Store |
| `archied` | Scheduling, workflow runs, harness, Daemon contract | State Store, Gateway, Messaging |
| `archie-messaging` | External channel frontends | Gateway |
| `archie-ui` | Dashboard HTTP API (`internal/webui`) and the embedded SPA | State Store, Gateway, daemon, harness |
| `archie-state-store` | State Store and Control Plane contracts; owns the task and control-plane tables | PostgreSQL |
| `archie-gateway` | Chat contract; owns the conversation tables | State Store, PostgreSQL |
| `archied` | Daemon contract; scheduling, workflow runs, task containers | State Store, Gateway, Messaging, NATS |
| `archie-messaging` | Messaging contract; external channel frontends | State Store, Gateway |
| `archie-ui` | Dashboard HTTP API (`internal/webui`) and the embedded SPA | State Store, Gateway, Daemon, Messaging |
| `archie-agent` | The worker inside each task container | NATS |
Forge, channel and secret-engine contracts are extension boundaries, not
services: a core binary starts the extension as a plugin process and dials it.
`archied` also runs the State Store's backup and restore during a host update.
`internal/domain` holds behaviour and interfaces; `internal/infrastructure`
implements them. Dashboard work follows `ui/CLAUDE.md`. Workflow YAML and its
step vocabulary are in `WORKFLOWS.md`; the server catalogue is authoritative.
implements them. Every instruction sent to a model is a file in
`internal/prompts`, read through that package; never inline a prompt in code.
Dashboard work follows `ui/CLAUDE.md`. Workflow YAML and its step vocabulary
are in `WORKFLOWS.md`; the server catalogue is authoritative.
## Authority
@@ -54,6 +78,11 @@ When sources disagree, the higher one wins:
- **A clear direction is the go-ahead.** Do it in the same turn. Do not restate
the plan, offer options, or ask "shall I proceed?". Stop only for destructive
or outward-facing actions (deleting data, pushing, touching a live host).
- **Push back when it matters.** If a request competes with something clearly
more urgent (a bug that loses work, a failure that shows nothing, a security
gap, a broken setup path), or looks like the wrong call, say so once in a
sentence or two and suggest whether it belongs in the backlog. Then do what
was asked: don't repeat the point or hold work back on your own judgement.
- **Post outside the repo only when told.** Chat, tickets and any external
service get a message only on the maintainer's instruction.
- **Report, don't narrate.** Final replies say what changed, what was verified,
@@ -65,23 +94,22 @@ When sources disagree, the higher one wins:
## How to decide
- **Broken beats new.** A bug that blocks work gets fixed now, with the smallest
change that unblocks it. No design docs and no new mechanism.
- **Cheapest option first.** Before building, name the smallest change that
solves the problem, including changing configuration or deleting something. If
your plan adds a new mechanism (RPC, process, binary, abstraction, config
field, tool) or grows past about 100 lines, stop and assess whether you're
taking the path of least resistance.
- **Broken comes first.** A bug that blocks or loses work goes ahead of new
features. Fix the cause. When that's a bigger job, unblock with a small change
first and file the proper fix rather than stopping there.
- **Cheapest option first.** Before building, consider the smallest change that
solves the problem, including changing configuration or deleting something.
A new mechanism (RPC, process, binary, abstraction, config field, tool) is
fine when it's the right design; say why the smaller option wasn't enough.
- **Delete before adding.** Unused code, dead paths, fallbacks nobody takes and
features nobody runs get removed, not maintained. Solo project, single user:
breaking changes need no compatibility shims.
- **Finish before starting.** Prefer completing a half-built feature end to end
over starting a new one.
- **Services own contracts.** A service is a gRPC contract in
`proto/<service>/v1` and one binary that serves it. Services reach each other
only through those contracts, never through another service's tables or
packages. A new command is a subcommand of an existing binary. A new binary
exists only for a new service or a real process boundary.
- **Modules own their API and tables.** A module reaches another only through
its API package, never its tables or `internal/`. The only real process
boundaries are extensions and the runner. A new command is a subcommand of
`archie`.
- **No compensating tools.** Do not write a linter, checker or generator to
enforce something a simpler design would make unnecessary. Fix the design.
- **A setting must work end to end.** A config field that parses but has no
@@ -121,19 +149,37 @@ The default for a change is no new test. Write one only when:
A test that exists must catch a real regression, survive refactoring, run fast,
and be cheap to keep. Never test wiring, constants, defaults, struct shapes,
fakes, or call order. No test opens a real database or needs Docker; test
SQL semantics at the interceptor or domain level with fakes. One table-driven test per behaviour; extend the table
instead of adding a second test. Prefer making an invalid state unrepresentable
to testing that it is rejected. Test helpers live in `_test.go` files only.
fakes, or call order. Prefer making an invalid state unrepresentable to testing
that it is rejected.
How to write one:
- **Prove it.** Run the new test against the code before the fix and see it
fail. A test that passes either way proves nothing: delete it. When a bug
can't be reproduced deterministically (a race, say), fix it with an API that
rules it out and don't add a test.
- **One table per behaviour.** Extend the table instead of adding a second test.
Name the test after the behaviour, and say in its comment what regression it
guards.
- **Same gate as production.** Tests pass golangci-lint, gosec included, with no
exclusions for test files. Fix what the linter finds. A fixture that has to
look like a secret (a key the redaction must catch, a URL with a password the
parser must reject) uses a plainly fake value and a `//nolint:gosec` saying
what it tests.
- **Isolated.** Use `t.TempDir()` and `t.Setenv`, never host state. A test that
commits with git sets `GIT_CONFIG_GLOBAL` to `os.DevNull`. No test opens a
real database or needs Docker: test SQL semantics at the interceptor or domain
level with fakes. Files are written `0o600`, or `0o700` for a script.
- **Shared setup in helpers.** When several tests repeat the same setup, put it
in a helper in a `_test.go` file, never in production code.
## Invariants
These protect users. Do not weaken them without the maintainer's say-so.
- Failure stays local. Any service may crash, restart or be absent without
losing accepted work or taking another service down. Callers retry, degrade
and report the dependency as unhealthy; they never exit because a peer is
missing, and work is acknowledged only once it is durable.
- A crash loses no accepted work, and a restart resumes every run. Work is
acknowledged only once it is durable. A missing dependency is reported
unhealthy and retried, never a reason to exit.
- The model never runs git. Commits and pushes go through the daemon.
- The daemon's own credentials never enter an agent container. Containers get
task-scoped grants that are revoked when the task ends.
@@ -157,10 +203,10 @@ task dev # every service + Vite at http://localhost:5173, from deployments/d
task e2e:up # seeded local stack; task e2e:check -- all runs the browser checks
```
`task proto:generate` and `task db:generate` write the committed generated
output for `proto/` and `internal/infrastructure/postgres/`; `task check` runs
their check variants and rejects stale output. The e2e stack is not part of the
gate.
`task proto:generate`, `task db:generate` and `task openapi:generate` write
the committed generated output for `proto/`, `internal/infrastructure/postgres/`
and `api/openapi.yaml`; `task check` runs their check variants and rejects stale
output. The e2e stack is not part of the gate.
Requires Go 1.27, Task, golangci-lint, Node, pnpm and Docker. Adopt `task fmt` and
`go fix` output as-is.
@@ -170,7 +216,7 @@ Requires Go 1.27, Task, golangci-lint, Node, pnpm and Docker. Adopt `task fmt` a
run, say what you did verify.
- Commit finished work without asking. Stage only your own paths and commit in
the same command. Conventional Commits scoped by package, short messages. Push
only when told.
every commit as soon as it is made; a local-only commit is not acceptable.
- Never commit binaries, build output, scratch files or `.references/`. Scratch
goes in `/tmp`.
- Runtime config lives at `${XDG_CONFIG_HOME:-~/.config}/archie/config.toml`.
@@ -183,19 +229,25 @@ Work is tracked as issues on the primary remote, never in Markdown TODO files.
GitHub is a read-only mirror; do not open, close or comment there.
```bash
tea issues list -r sam/archie --state open --labels priority::critical
tea issues list -r sam/archie --labels epic/<slug> --state open
tea issues list -r sam/archie --state open --labels critical
tea issues view 497
tea issues edit 497 --add-labels status::in_progress --add-assignees sam
tea issues edit 497 --add-labels in-progress --add-assignees sam
tea comment 497 "what changed, and what was run"
tea issues close 497
```
- An issue is the plan: what is wrong or wanted, and how you know it is done.
Keep it to that.
- Labels carry state: `type::`, `priority::`, `status::in_progress` and
`status::deferred`. Open/closed is the issue state, not a label.
`epic/<slug>` says which epic an issue belongs to.
- Labels carry state: a type (`bug`, `feature`, `task`, `chore`, `epic`,
`decision`, `discovery`), a priority (`critical`, `high`, `medium`, `low`), `in-progress`
and `deferred`. Open/closed is the issue state, not a label.
- An epic's children are its dependencies: link each one as it is filed (Gitea
MCP `issue_write` `add_dependency`, the epic `blocked_by` the child), plus any
real blocker between children. No `epic/<slug>` label; the dependencies are
the link, and the only place the web UI shows an epic's children.
- `tea` drops labels on `issues create` and `edit --add-labels`. Label through
the Gitea MCP connector, by label ID: it resolves names from the first 50
labels only.
- Cite the issue number in commits and comments.
- `tea issues list --labels` silently ignores an unknown name and returns every
issue. Check the count is plausible before trusting a filtered list.
+31 -4
View File
@@ -10,9 +10,13 @@ FROM golang:1.27-trixie AS builder
ARG RUNTIME_VERSION=dev
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
# Cache mounts keep modules and compiled packages on the build daemon; without
# them COPY . . makes every commit a cold compile.
RUN --mount=type=cache,target=/go/pkg/mod go mod download
COPY . .
RUN CGO_ENABLED=0 go build \
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 go build \
-ldflags "-X github.com/samcharles93/archie-core/internal/app/agentworker.version=${RUNTIME_VERSION} -X github.com/samcharles93/archie-core/internal/installtype.buildType=container" \
-o /usr/local/bin/archie-agent ./cmd/archie-agent/
@@ -58,6 +62,12 @@ ENV PATH="/usr/local/go/bin:/go/bin:${PATH}"
ARG GOLANGCI_LINT_VERSION=2.14.0
ARG GOFUMPT_VERSION=0.11.0
ARG BUF_VERSION=1.72.0
# Pinned to the versions tools/proto.sh installs; buf generate shells out to them.
ARG PROTOC_GEN_GO_VERSION=1.36.11
ARG PROTOC_GEN_GO_GRPC_VERSION=1.6.2
# Repository gates run `task`; fetching it per run parks the task when the
# download fails.
ARG TASK_VERSION=3.54.0
RUN curl -fsSL "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" \
| tar -xz -C /usr/local/bin --strip-components=1 \
@@ -66,7 +76,12 @@ RUN curl -fsSL "https://github.com/golangci/golangci-lint/releases/download/v${G
"https://github.com/mvdan/gofumpt/releases/download/v${GOFUMPT_VERSION}/gofumpt_v${GOFUMPT_VERSION}_linux_amd64" && \
curl -fsSL -o /usr/local/bin/buf \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-Linux-x86_64" && \
chmod +x /usr/local/bin/gofumpt /usr/local/bin/buf
curl -fsSL "https://github.com/go-task/task/releases/download/v${TASK_VERSION}/task_linux_amd64.tar.gz" \
| tar -xz -C /usr/local/bin task && \
chmod +x /usr/local/bin/gofumpt /usr/local/bin/buf && \
GOBIN=/usr/local/bin go install "google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOC_GEN_GO_VERSION}" && \
GOBIN=/usr/local/bin go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc@v${PROTOC_GEN_GO_GRPC_VERSION}" && \
go clean -cache -modcache
# ── Python via uv ─────────────────────────────────────────────────────
ARG PYTHON_VERSION=3.14
@@ -74,7 +89,19 @@ RUN curl -fsSL https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
RUN uv python install --default "${PYTHON_VERSION}" && rm -rf /root/.cache/uv
# Point each toolchain at its cache volume (internal/storage). Unset, pnpm puts
# its store on the worktree's filesystem, inside the repository the agent commits.
ENV GOMODCACHE=/data/cache/go/mod \
GOCACHE=/data/cache/go/build \
npm_config_cache=/data/cache/node \
npm_config_store_dir=/data/cache/pnpm \
DENO_DIR=/data/cache/deno \
BUN_INSTALL_CACHE_DIR=/data/cache/bun \
PIP_CACHE_DIR=/data/cache/pip \
UV_CACHE_DIR=/data/cache/pip \
CARGO_HOME=/data/cache/cargo
COPY --from=builder /usr/local/bin/archie-agent /usr/local/bin/archie-agent
# The daemon injects NATS_URL and, when configured, NATS_TOKEN.
# The daemon injects NATS_URL.
ENTRYPOINT ["archie-agent"]
+6 -3
View File
@@ -12,12 +12,16 @@ RUN pnpm run build
FROM golang:1.27-trixie AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
# Cache mounts keep modules and compiled packages on the build daemon; without
# them COPY . . makes every commit a cold compile.
RUN --mount=type=cache,target=/go/pkg/mod go mod download
COPY . .
COPY --from=dashboard /src/ui/dist ./ui/dist
ARG GATEWAY_VERSION=dev
ARG RUNTIME_VERSION=dev
RUN CGO_ENABLED=0 go build \
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 go build \
-ldflags "-X github.com/samcharles93/archie-core/internal/buildinfo.Version=${GATEWAY_VERSION} -X github.com/samcharles93/archie-core/internal/buildinfo.Runtime=${RUNTIME_VERSION} -X github.com/samcharles93/archie-core/internal/installtype.buildType=container" \
-o /usr/local/bin/archied ./cmd/archied/
@@ -31,6 +35,5 @@ ARG RUNTIME_VERSION=dev
LABEL org.opencontainers.image.version="${GATEWAY_VERSION}"
LABEL cloud.catlow.archie.runtime-version="${RUNTIME_VERSION}"
COPY CHANGELOG.md /usr/share/archie/CHANGELOG.md
ENTRYPOINT ["archied"]
+6 -1
View File
@@ -1,4 +1,9 @@
# Archie
<h1>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/brand/archie-wordmark-dark.svg">
<img alt="Archie" src="assets/brand/archie-wordmark.svg" height="56">
</picture>
</h1>
**Event-driven Agentic Automation**
+33 -235
View File
@@ -1,258 +1,56 @@
# Releasing
One release stream. `CHANGELOG.md` carries every release section, one generated
page per version describes it, and one `v*` tag names the release. One version
covers every process in the host bundle (`archied`, `archie-gateway`,
`archie-state-store`, `archie-ui`, `archie-messaging`) and the `archie-agent`
image; per-component detail is a labelled section inside the version
(`### archied`, `### archie-agent`).
A release is cut by CI, published to `next`, run on the canary for a day, and
promoted to `stable` only if the canary's signals pass. Nothing is run locally.
## Notes are written with the change
A commit that changes what a reader experiences adds its bullet under
`## [Unreleased]` in `CHANGELOG.md`, in the same commit. The release takes that
section as it stands, so write the bullet as the release note, not as a commit
subject.
**Release notes describe the reader's experience of what shipped.** The test is
the reader, not whether a sentence is negative:
- A capability that **never existed** leaves no expectation to correct, so a
note about it reads as a feature to someone who never had the thing: out.
- **The implementation's journey** (what was rebuilt, what a guard finally
covers, what a browser API refuses to surface) isn't the reader's experience
either: out.
- A capability that **shipped but isn't yet wired** _is_ the reader's
experience, so it belongs, worded as a caveat on the capability and paired
with the behaviour that compensates for it.
Design constraints and withheld capabilities are not release news. Deleting a
caveat a reader needs misleads them, which is the failure this rule exists to
prevent.
One `v*` tag names a release. One version covers every process in the host
bundle (`archied`, `archie-gateway`, `archie-state-store`, `archie-ui`,
`archie-messaging`) and the `archie-agent` image. Nothing is released from a
laptop.
## Cutting a release
Dispatch the **release** workflow (`.github/workflows/release.yml`) with
`major`, `minor`, `patch` or an exact version. It runs `task release` on `main`:
1. refuses a dirty tree, an existing tag, or an `[Unreleased]` with no entries;
2. turns `[Unreleased]` into `## [x.y.z] - date` under a new empty
`[Unreleased]`, and runs `task news`;
3. commits `chore(release): vx.y.z` and tags `vx.y.z`;
then pushes `main` and the tag atomically with `DEPLOY_TOKEN`. A push made with
the job token wouldn't start other workflows, so the user token is what lets
the tag start the deploy.
Every workflow that reaches the registry or the canary reads its credentials
from Actions secrets, so a mirror of this repository carries its own set:
| Name | Kind | Used by |
|---|---|---|
| `DEPLOY_TOKEN` | secret | release, deploy, canary, promote — the registry push, the tag push, and the package links |
| `RELEASE_SIGNING_KEY` | secret | deploy — signs the release statement |
| `CANARY_TOKEN` | secret | deploy, canary, promote — the canary's dashboard API |
| `CANARY_URL` | variable | deploy, canary, promote — where that dashboard is |
| `CANARY_WINDOW` | variable | canary — the judged window; empty means the default |
A mirror missing them fails at its first login or push; `release.yml` names the
missing `DEPLOY_TOKEN` before it checks out, so the run doesn't read as a broken
release.
After a release, pull `main` before committing on it again: CI has added the
release commit.
`major`, `minor`, `patch` or an exact version. It runs `task release` on
`main`, which refuses a dirty tree or an existing tag and then tags `vx.y.z`,
and pushes the tag with `DEPLOY_TOKEN`. A push made with the job token
wouldn't start other workflows, so the user token is what lets the tag start
the deploy.
## What a release publishes
The tag push runs `deploy.yml`:
- **Gate.** `task check TEST_FLAGS=-count=1` (uncached, including the
Docker-backed tests `-short` skips) and `govulncheck`, then a check that the
tag has a `[version]` section in `CHANGELOG.md`.
- **Images.** `archied:v<version>` and `archie-agent:v<version>` on a release
tag; `archied:edge` and `archied:sha-<commit>` on any other push to `main`.
`:latest` moves only on promotion, so it names the newest promoted release.
- **Gate.** `task check dist TEST_FLAGS=-count=1` and `govulncheck`. The
binaries the zip ships are built in the same run, so nothing is compiled
again after the gate.
- **Images.** `archied:v<version>` and `archie-agent:v<version>`, plus
`sha-<commit>` tags. `:latest` moves only on promotion.
- **The signed release.** `archied release publish` signs a statement
(version, issued_at, zip digest, agent image by digest) with
`RELEASE_SIGNING_KEY` and pushes it with the distribution zip to
`git.catlow.cloud/sam/archie` as `v<version>` and `next`. It never moves
`stable`.
- **The release-notes page** on Gitea, from that version's `CHANGELOG.md`
section, which the statement links to.
- **The canary install**: `archied release canary start` points the canary at
`next` and installs the release through its dashboard.
- **The release page** on Gitea, listing the commit subjects since the
previous tag. The statement links to it.
GitHub-style Actions run the workflow from the tagged commit, so a fix to
`deploy.yml` reaches a release only if it is an ancestor of the tag. Re-cut the
release rather than committing the fix on top of a tagged one.
Actions run the workflow from the tagged commit, so a fix to `deploy.yml`
reaches a release only if it is an ancestor of the tag. Cut a new release
rather than committing the fix on top of a tagged one.
## The canary
## Promote
The canary is the production host, following `next`. Every quarter hour
`canary.yml` runs `archied release canary check`, which reads the canary
through its dashboard API and judges **the release the canary actually runs**,
not the moving `next` tag:
| Signal | Source | Fails when |
| --- | --- | --- |
| Install outcome | `GET /api/chat/update` | the canary doesn't run the judged release (the watchdog rolled it back) |
| Readiness | `GET /health/detailed` | the rollup isn't `ok` |
| Alerts | `GET /api/alerts` | an open `action` alert was first raised after the release was installed |
| Error log | `GET /api/logs?level=error` | error lines per window exceed `2 × baseline + 10` |
| Task outcomes | `GET /api/tasks` | the share of finished tasks that parked or died rose more than 10 points |
- **Control.** The canary's own window before the release was installed. With
one production host there's no simultaneous control.
- **Window.** 24 hours counted from the **install** on the canary, not from
the release's issue time: the host records it in `installed.json`
(`committed_at`) and reports it as `installed_at` in `GET /api/chat/update`.
One cycle of schedules and traffic. The first 30 minutes are for the install
and restart. `canary.yml` passes `-window` when the `CANARY_WINDOW` Actions
variable is set; the flag defaults to 24h. A host that doesn't report an
install time degrades to the release statement's issue time.
- **Hard signals** (install, readiness, alerts) roll back at any check after
that. **Relative signals** (errors, tasks) are judged against the baseline
whenever both windows carry enough data, so a breach rolls the release back
even mid-window; a full window with no failure promotes it.
- **Too little data skips a signal** rather than failing it: fewer than 5
finished tasks in the window, or an error log that reaches back less than an
hour into the baseline. A log read that stops short of a window is scaled to
a full window from what it covers.
### Queueing
`deploy.yml` installs each new release on the canary with
`archied release canary start -version V`, which first points the canary back
at `next` (clearing any rollback pin) and then installs `V` — unless the
canary is already judging a release newer than stable that isn't `V`, in which
case `V` is **queued** behind it and the canary keeps running what it judges.
`-force` installs regardless. A `check` that promotes (or finds nothing to
judge) installs the newer `next` in the same run, so a queue drains one
release per promotion.
### Subcommands
```
archied release canary status read-only: channel/pin, installed release and
installed_at, stable/next, window progress, and
the verdict the current signals would give
archied release canary start point the canary at next and install -version,
queued behind a release being judged (-force to
override)
archied release canary check judge the installed release over -window
(default 24h): promote, pick up a newer next,
or roll back; a held canary is reported, and a
held pin that is no longer installable fails
the run red
archied release canary promote promote the installed release now if its
signals pass; refuses with exit 1 otherwise
archied release canary unpin return the canary to next from any pin
```
### Promote
A release that passes the window is promoted: `stable` is retagged to the
`v<version>` manifest. The signature covers the statement, not the tag, so the
retag needs no signing key. The `archied` and `archie-agent` images' `:latest`
move to their `:v<version>` first, and the agent image must be the digest the
statement pins. Promotion refuses a prerelease and a release issued before the
one `stable` names, the same replay rule hosts enforce. The decision and its
reasons are in the `canary` run log.
Early promotion is a dispatch away: the **promote** workflow
(`.github/workflows/promote.yml`) takes a `version` input and runs
`archied release canary promote -version V` on the canary. It judges the
release the canary runs — the window doesn't matter for the decision — and
refuses (red run) on any hard failure or relative breach with enough data.
### Roll back
`stable` stays put, and the run turns red. Before the canary is pinned to
`stable`, `check` verifies `stable` is actually installable — its statement's
zip blob must still be in the release repository and its pinned agent image
must still resolve (`releaseupdate.Installable`). If it isn't, the run fails
loudly and the canary stays on `next` rather than being stranded on a pin.
Otherwise the canary is pinned to the `stable` version through its update
settings and reinstalled through its dashboard.
A release whose migrations differ from `stable`'s can't go back without
restoring the pre-update database snapshot, which loses every write since. The
canary is held on the failed release instead (pinned to it) and the fix goes
forward in the next release. The next release's deploy points the canary back
at `next`.
A pinned canary isn't judged, so a rollback is decided once — but `check`
verifies the pin is still installable every run, so a stranded pin shows red
instead of green. `archied release canary unpin` returns the canary to `next`
by hand.
### Configuration
| Name | Kind | Holds |
| --- | --- | --- |
| `CANARY_URL` | Actions variable | the canary's dashboard URL; unset disables the canary steps |
| `CANARY_TOKEN` | Actions secret | an API token bound to a dedicated `service_account` identity on the canary, carrying only the canary grant policy (see below) — never instance admin |
| `CANARY_WINDOW` | Actions variable | optional `-window` override for `canary check`; unset is 24h |
| `DEPLOY_TOKEN` | Actions secret | registry and repository write, for publishing, promoting and the release push; stays CI-only, promotion runs in CI and never on the host |
| `RELEASE_SIGNING_KEY` | Actions secret | the release signing seed |
#### Setting up `CANARY_TOKEN` once
`CANARY_TOKEN` is a bearer token for a dedicated service-account identity in
the system org whose only grant is the canary policy
(`access.CanaryGrantPolicy`): read the signal endpoints (`GET /api/chat/update`,
`GET /api/alerts`, `GET /api/logs`, `GET /api/tasks`), read and write the
`update-settings` resource, and trigger an update install
(`POST /api/chat/update/install`). It carries no other rights, and instance
admin is never needed. With an instance-admin token (for example the operator
session), run against the canary host:
Dispatch the **promote** workflow (`.github/workflows/promote.yml`) with a
`version`. It retags `stable` to that release and moves the `archied` and
`archie-agent` images' `:latest` to it. Promotion refuses a prerelease and a
release issued before the one `stable` names, the same replay rule hosts
enforce. The same thing by hand:
```bash
# 1. Create the service-account identity in the system org.
curl -X POST "$CANARY_URL/api/identities" -H "Authorization: Bearer $ADMIN" \
-H 'Content-Type: application/json' \
-d '{"kind":"service_account","display_name":"ci-canary"}'
# -> {"id":"<canary-identity-id>", ...}
# 2. Issue its token (shown exactly once).
curl -X POST "$CANARY_URL/api/identities/<canary-identity-id>/tokens" \
-H "Authorization: Bearer $ADMIN" -H 'Content-Type: application/json' \
-d '{"name":"ci-canary","days":90}'
# -> {"id":"<token-hash>","token":"archie_pat_..."} -- store the token value as the CANARY_TOKEN secret
# 3. Install the grant pair, scoped to that identity. The policies' org is
# pinned to the caller's org (org-sys for the instance admin), so the
# bodies need no org field. The permit alone is not enough: service
# accounts created through the API are assigned the developer role, so a
# matching forbid (installed second) negates everything outside the
# permit's surface for that identity.
curl -X PUT "$CANARY_URL/api/access/policies" -H "Authorization: Bearer $ADMIN" \
-H 'Content-Type: application/json' \
-d '{"id":"org-canary-grant","level":"org","text":"permit(principal, action, resource) when {\n resource.org == principal.org &&\n principal == Archie::Identity::\"<canary-identity-id>\" &&\n (\n (action == Archie::Action::\"read\" && [\"dashboard\", \"task\"].contains(resource.kind)) ||\n (action == Archie::Action::\"read\" && resource == Archie::Object::\"update-settings\") ||\n (action == Archie::Action::\"update\" && resource == Archie::Object::\"update\") ||\n (action == Archie::Action::\"manage_identities\" && resource == Archie::Object::\"update-settings\")\n )\n};"}'
```
The second policy forbids the canary identity from everything the permit does
not name, so its developer role cannot widen the grant:
```bash
curl -X PUT "$CANARY_URL/api/access/policies" -H "Authorization: Bearer $ADMIN" \
-H 'Content-Type: application/json' \
-d '{"id":"org-canary-grant-forbid","level":"org","text":"forbid(principal, action, resource) when {\\n resource.org == principal.org &&\\n principal == Archie::Identity::\\\"<canary-identity-id>\\\" &&\\n !(\\n (action == Archie::Action::\\\"read\\\" && [\\\"dashboard\\\", \\\"task\\\"].contains(resource.kind)) ||\\n (action == Archie::Action::\\\"read\\\" && resource == Archie::Object::\\\"update-settings\\\") ||\\n (action == Archie::Action::\\\"update\\\" && resource == Archie::Object::\\\"update\\\") ||\\n (action == Archie::Action::\\\"manage_identities\\\" && resource == Archie::Object::\\\"update-settings\\\")\\n )\\n};"}'
```
The policy texts are exactly `access.CanaryGrantPolicy` and
`access.CanaryGrantForbidPolicy` from `internal/domain/access/canary.go` with
the identity id filled in. The canary needs no other rights: `GET
/health/detailed` is unauthenticated, and every other call it makes is covered
by the grant pair.
The runner must reach `CANARY_URL`. Without a canary a release stays on `next`
until promoted by hand, under the same refusals:
```bash
archied release promote -version 1.57.0 \
archied release promote -version 1.63.0 \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
```
## Secrets
| Name | Used by |
|---|---|
| `DEPLOY_TOKEN` | release, deploy, promote: the registry push, the tag push and the package links |
| `RELEASE_SIGNING_KEY` | deploy: signs the release statement |
+57 -29
View File
@@ -64,21 +64,23 @@ tasks:
- task: db:generate
- git diff --exit-code -- internal/infrastructure/postgres/postgresdb
openapi:generate:
desc: Write the API's OpenAPI document to api/openapi.yaml
cmds:
- mkdir -p api
- go run ./cmd/archie openapi > api/openapi.yaml
openapi:check:
desc: Regenerate the OpenAPI document and reject uncommitted differences
cmds:
- task: openapi:generate
- git diff --exit-code -- api/openapi.yaml
proto:check:
desc: Regenerate contracts and reject uncommitted generated differences
cmds:
- bash tools/proto.sh check
news:
desc: Regenerate the release data artifacts from the changelog
cmds:
- go -C tools run -mod=readonly ./newsgen --repo-root ..
news:check:
desc: Verify the committed release notes match the changelog
cmds:
- go -C tools run -mod=readonly ./newsgen check --repo-root ..
vet:
desc: Run go vet
cmds:
@@ -88,7 +90,6 @@ tasks:
desc: Run golangci-lint
cmds:
- golangci-lint run ./...
- cd tools && golangci-lint run ./...
ui:deps:
desc: Install dashboard dependencies
@@ -101,6 +102,9 @@ tasks:
ui:
desc: Build the dashboard into ui/dist, which the Go build embeds
# check builds the dashboard and then build depends on it again; a second
# build empties ui/dist under the Go steps that embed it.
run: once
dir: ui
deps: [ui:deps]
cmds:
@@ -143,7 +147,7 @@ tasks:
done
dev:postgres:
desc: Start PostgreSQL and wait for readiness
desc: Start PostgreSQL, wait for readiness, provision the database roles
cmds:
- docker compose up -d postgres
- |
@@ -157,6 +161,15 @@ tasks:
done
echo "postgres did not become healthy within 60s" >&2
exit 1
- |
# docker-compose.yml creates the dev database with a superuser named
# archie; provision the least-privilege roles deployments/dev.toml
# points at. Idempotent, so this also upgrades a volume created before
# the role split.
go run ./cmd/archie-state-store provision \
-admin-url "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable" \
-runtime-url "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable" \
-migration-url "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
dev:wait-state:
internal: true
@@ -221,16 +234,13 @@ tasks:
cmds:
- node e2e/run.cjs {{.CLI_ARGS}}
canary:rehearse:
# Local rehearsal only: spins up its own registry, database and host, and
# is deliberately absent from check and CI.
desc: Rehearse the release-canary loop on a throwaway local host (needs docker; never part of the gate)
cmds:
- sh tools/canary-rehearse.sh
build:
desc: Build archie services and agent binaries
deps: [ui]
# Static, like the binaries a release ships, so `dist` reuses these
# compiled packages and only links again.
env:
CGO_ENABLED: "0"
vars:
GATEWAY_VERSION: '{{.GATEWAY_VERSION | default .VERSION}}'
RUNTIME_VERSION: '{{.RUNTIME_VERSION | default .VERSION}}'
@@ -257,13 +267,38 @@ tasks:
- "{{.BIN_DIR}}/archie-ui"
- "{{.BIN_DIR}}/archie-messaging"
- "{{.BIN_DIR}}/archie-agent"
- "{{.BIN_DIR}}/archie"
cmds:
# One flag set for every service, matching the release workflow, so each
# binary reports the same version.
- for: [archied, archie-gateway, archie-state-store, archie-ui, archie-messaging]
- for: [archie, archied, archie-gateway, archie-state-store, archie-ui, archie-messaging]
cmd: go build -trimpath -ldflags "{{.SERVICE_LDFLAGS}}" -o {{.BIN_DIR}}/{{.ITEM}} ./cmd/{{.ITEM}}
- go build -trimpath -ldflags "-X github.com/samcharles93/archie-core/internal/app/agentworker.version={{.RUNTIME_VERSION}} -X github.com/samcharles93/archie-core/internal/installtype.buildType=binary" -o {{.BIN_DIR}}/archie-agent ./cmd/archie-agent
dist:
desc: Build the linux/amd64 binaries a release ships into dist/ (VERSION=1.2.3; needs jq)
deps: [ui]
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: "0"
vars:
DIST_LDFLAGS: >-
-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary
-X github.com/samcharles93/archie-core/internal/buildinfo.Version={{.VERSION}}
-X github.com/samcharles93/archie-core/internal/buildinfo.Runtime={{.VERSION}}
-X github.com/samcharles93/archie-core/internal/app/agentworker.version={{.VERSION}}
cmds:
# release.json names what a release ships, so the zip and this build
# cannot disagree. The compiler flags match `build`, so after the gate
# has built bin/ this only links.
- |
set -eu
mkdir -p dist
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
go build -trimpath -ldflags "{{.DIST_LDFLAGS}}" -o "dist/$cmd" "./cmd/$cmd"
done
test:
desc: Run Go tests; the release gate passes TEST_FLAGS=-count=1
cmds:
@@ -288,13 +323,13 @@ tasks:
- task: fmt
- task: proto:check
- task: db:check
- task: openapi:check
- task: check:readonly
check:readonly:
internal: true
deps:
- task: proto:lint
- task: news:check
- task: vet
- task: lint
- task: build
@@ -302,7 +337,7 @@ tasks:
- task: test:ui
release:
desc: "Turn [Unreleased] into a release, then commit and tag it (RELEASE=major|minor|patch|1.2.3)"
desc: "Tag main as a release (RELEASE=major|minor|patch|1.2.3)"
requires:
vars: [RELEASE]
cmds:
@@ -321,12 +356,5 @@ tasks:
esac
echo "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$' || die "$version is not a version"
! git rev-parse -q --verify "refs/tags/v$version" >/dev/null || die "v$version already exists"
awk '/^## \[Unreleased\]/ { u = 1; next } u && /^## \[/ { exit } u && /^- / { found = 1 } END { exit !found }' CHANGELOG.md ||
die "[Unreleased] in CHANGELOG.md has no entries"
awk -v hdr="## [$version] - $(date -u +%F)" '{ print } /^## \[Unreleased\]/ { print ""; print hdr }' CHANGELOG.md >CHANGELOG.md.tmp
mv CHANGELOG.md.tmp CHANGELOG.md
go -C tools run -mod=readonly ./newsgen --repo-root ..
git add CHANGELOG.md docs/news
git commit -q -m "chore(release): v$version"
git tag -a "v$version" -m "v$version"
echo "tagged v$version"
+5 -4
View File
@@ -46,7 +46,6 @@ steps:
| `outputs` | mapping | Named, typed results the run writes once each (same shape as inputs). A required output the run never writes parks it. A calling workflow reads them. |
| `profile` | text | The container profile (`[containers.profiles]`) the run's agents use. Resolved when the task is dispatched. |
| `identity` | text | The identity every run acts as, whatever started it. Empty runs as the starter. |
| `needs` | mapping | Harness capabilities the run requires: `captures` (bool), `gate_retries` (number). Declared outputs imply `captures`. |
## A step
@@ -315,8 +314,10 @@ expressions that limit which files the rule applies to.
## What starts a workflow
- **Issues**, by label: `bug` runs `tdd`, `feature` runs `feasibility`, anything
else runs `triage`, which classifies it and hands off.
- **Issues**, by label: the Issue routing setting lists label to workflow rules
(first match wins) and a default for the rest. It starts as `bug` runs
`tdd`, `feature` runs `feasibility`, anything else runs `triage`, which
classifies it and hands off.
- **Event bindings**: a webhook source mapped onto a workflow and its inputs
(Events page).
- **Schedules**: each firing is captured on the reserved `schedule` source as
@@ -324,7 +325,7 @@ expressions that limit which files the rule applies to.
`fired_at`). A schedule trigger is a binding on that source using the
`schedule-fired` mapping, filtered to one `schedule_id`. A firing starts at
most one task per binding.
- **Playbooks**: a trigger (issue kind and labels) and actions that dispatch
- **Playbooks**: a trigger (issue labels) and actions that dispatch
workflows.
- **Other workflows**: `workflow.call` (a child run), `workflow.handoff` (the
same task, requeued), `workflow.approve` (once approved).
+3451
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><rect width="512" height="512" rx="112" fill="#0e0f10"/><g fill="#51a580" transform="translate(96 96) scale(13.333) translate(-0 -0)"><path d="M2 21h4l8-18h-4z"/><path d="M14.9 5.03 22 21h-4l-5.1-11.47z"/><path d="M10.47 15h3.06l1.11 2.5H9.36z"/></g></svg>

After

Width:  |  Height:  |  Size: 319 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#51a580"><path d="M2 21h4l8-18h-4z"/><path d="M14.9 5.03 22 21h-4l-5.1-11.47z"/><path d="M10.47 15h3.06l1.11 2.5H9.36z"/></svg>

After

Width:  |  Height:  |  Size: 194 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630"><rect width="1200" height="630" fill="#0e0f10"/><svg x="320" y="209.6153846153846" width="560" height="150.76923076923077" viewBox="-4 21.4 312 84"><g fill="#51a580" transform="translate(-7.7555555555555555 18.56666666666667) scale(3.8777777777777778)"><path d="M2 21h4l8-18h-4z"/><path d="M14.9 5.03 22 21h-4l-5.1-11.47z"/><path d="M10.47 15h3.06l1.11 2.5H9.36z"/></g><path fill="#e8e6e1" d="M99.76 68L99.76 100L86.96 100L86.96 47.80L99.76 47.80L99.76 58.60L100.26 58.60Q100.96 55.80 102.61 53.35Q104.26 50.90 107.11 49.35Q109.96 47.80 114.06 47.80L116.86 47.80L116.86 59.90L112.86 59.90Q108.56 59.90 105.61 60.75Q102.66 61.60 101.21 63.35Q99.76 65.10 99.76 68M145.86 101.20Q134.26 101.20 128.01 93.80Q121.76 86.40 121.76 73.80Q121.76 61.30 128.01 53.95Q134.26 46.60 145.86 46.60Q153.76 46.60 158.91 50.10Q164.06 53.60 166.36 59.80L155.86 64.50Q154.96 61.20 152.46 59.05Q149.96 56.90 145.86 56.90Q140.56 56.90 137.86 60.25Q135.16 63.60 135.16 69.20L135.16 78.70Q135.16 84.10 137.86 87.50Q140.56 90.90 145.86 90.90Q150.36 90.90 152.91 88.55Q155.46 86.20 156.86 82.70L166.66 87.40Q164.16 94.30 158.81 97.75Q153.46 101.20 145.86 101.20M188.36 100L175.56 100L175.56 26L188.36 26L188.36 56.50L188.86 56.50Q190.46 52.30 193.91 49.45Q197.36 46.60 203.46 46.60Q211.46 46.60 215.81 51.95Q220.16 57.30 220.16 67L220.16 100L207.36 100L207.36 68.30Q207.36 62.80 205.36 59.95Q203.36 57.10 198.76 57.10Q196.16 57.10 193.76 58.05Q191.36 59 189.86 60.85Q188.36 62.70 188.36 65.50M239.76 40.20Q235.86 40.20 234.06 38.35Q232.26 36.50 232.26 33.80L232.26 31.80Q232.26 29 234.06 27.20Q235.86 25.40 239.76 25.40Q243.66 25.40 245.46 27.20Q247.26 29 247.26 31.80L247.26 33.80Q247.26 36.50 245.46 38.35Q243.66 40.20 239.76 40.20M246.16 100L233.36 100L233.36 47.80L246.16 47.80M280.96 101.20Q273.26 101.20 267.76 97.85Q262.26 94.50 259.31 88.35Q256.36 82.20 256.36 73.80Q256.36 65.60 259.26 59.45Q262.16 53.30 267.56 49.95Q272.96 46.60 280.56 46.60Q288.76 46.60 294.01 50.20Q299.26 53.80 301.81 59.75Q304.36 65.70 304.36 72.90L304.36 77.10L269.66 77.10L269.66 78.40Q269.66 84 272.86 87.50Q276.06 91 282.36 91Q287.06 91 290.16 88.95Q293.26 86.90 295.66 83.90L302.56 91.60Q299.36 95.90 293.81 98.55Q288.26 101.20 280.96 101.20M280.76 56.20Q277.36 56.20 274.86 57.75Q272.36 59.30 271.01 62.05Q269.66 64.80 269.66 68.40L269.66 69.20L291.06 69.20L291.06 68.30Q291.06 64.60 289.86 61.95Q288.66 59.30 286.36 57.75Q284.06 56.20 280.76 56.20"/></svg><g fill="#a8a59f" transform="translate(224.91199999999998 460.38461538461536)"><path transform="translate(0.00 0)" d="M18.70-23.73L18.70-21.22L11.15-21.22L11.15 0L8.30 0L8.30-21.22L0.75-21.22L0.75-23.73"/><path transform="translate(19.45 0)" d="M5.61 0L2.89 0L2.89-25.16L5.61-25.16L5.61-14.69L5.75-14.69Q6.39-16.18 7.57-17.07Q8.74-17.95 10.71-17.95Q13.43-17.95 15.01-16.20Q16.59-14.45 16.59-11.25L16.59 0L13.87 0L13.87-10.78Q13.87-13.12 12.87-14.31Q11.87-15.50 9.89-15.50Q8.81-15.50 7.82-15.15Q6.83-14.79 6.22-14.04Q5.61-13.29 5.61-12.17"/><path transform="translate(38.76 0)" d="M9.49 0.41Q7.11 0.41 5.34-0.73Q3.57-1.87 2.58-3.93Q1.60-5.98 1.60-8.77Q1.60-11.56 2.58-13.62Q3.57-15.67 5.34-16.81Q7.11-17.95 9.49-17.95Q11.83-17.95 13.53-16.85Q15.23-15.74 16.15-13.80Q17.07-11.87 17.07-9.38L17.07-8.09L4.45-8.09L4.45-7.28Q4.45-5 5.83-3.49Q7.21-1.97 9.66-1.97Q11.32-1.97 12.56-2.75Q13.80-3.54 14.48-5L16.42-3.60Q15.57-1.84 13.77-0.71Q11.97 0.41 9.49 0.41M9.49-15.67Q8.02-15.67 6.89-14.99Q5.75-14.31 5.10-13.11Q4.45-11.90 4.45-10.37L4.45-10.13L14.14-10.13L14.14-10.51Q14.14-12.07 13.57-13.23Q12.99-14.38 11.93-15.03Q10.88-15.67 9.49-15.67"/><path transform="translate(57.43 0)" d=""/><path transform="translate(65.45 0)" d="M17.17-2.38L17.17 0L15.64 0Q14.55 0 13.87-0.46Q13.19-0.92 12.89-1.73Q12.68-2.24 12.61-2.86L12.44-2.86Q11.90-1.26 10.56-0.42Q9.21 0.41 7.38 0.41Q4.59 0.41 3.04-1.02Q1.50-2.45 1.50-4.90Q1.50-6.56 2.31-7.70Q3.13-8.84 4.78-9.44Q6.43-10.03 8.98-10.03L12.44-10.03L12.44-11.76Q12.44-13.63 11.42-14.62Q10.40-15.61 8.30-15.61Q6.73-15.61 5.64-14.89Q4.56-14.18 3.84-12.99L2.21-14.52Q2.92-15.91 4.49-16.93Q6.05-17.95 8.43-17.95Q11.59-17.95 13.38-16.39Q15.16-14.82 15.16-12.04L15.16-2.38L17.17-2.38M12.44-5.10L12.44-7.99L8.84-7.99Q6.53-7.99 5.44-7.31Q4.35-6.63 4.35-5.34L4.35-4.62Q4.35-3.33 5.30-2.62Q6.26-1.90 7.82-1.90Q9.18-1.90 10.22-2.33Q11.25-2.75 11.85-3.49Q12.44-4.22 12.44-5.10"/><path transform="translate(83.61 0)" d="M17.68 1.94Q17.68 3.74 16.73 4.91Q15.78 6.09 13.89 6.65Q12 7.21 9.18 7.21Q6.46 7.21 4.74 6.70Q3.03 6.19 2.24 5.22Q1.46 4.25 1.46 2.89Q1.46 1.46 2.21 0.65Q2.96-0.17 4.25-0.51L4.25-0.88Q3.50-1.26 3.09-1.85Q2.69-2.45 2.69-3.33Q2.69-4.66 3.54-5.36Q4.39-6.05 5.71-6.39L5.71-6.53Q4.15-7.28 3.28-8.67Q2.41-10.06 2.41-11.90Q2.41-13.70 3.23-15.06Q4.05-16.42 5.54-17.19Q7.04-17.95 9.01-17.95Q9.96-17.95 10.79-17.78Q11.63-17.61 12.34-17.27L12.34-17.58Q12.34-18.60 12.82-19.26Q13.29-19.92 14.38-19.92L17-19.92L17-17.54L13.67-17.54L13.67-16.42Q14.62-15.61 15.15-14.45Q15.67-13.29 15.67-11.90Q15.67-Line truncated

After

Width:  |  Height:  |  Size: 20 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-4 21.40 312 84" role="img" aria-label="Archie"><title>Archie</title><g fill="#51a580" transform="translate(-7.7555555555555555 18.56666666666667) scale(3.8777777777777778)"><path d="M2 21h4l8-18h-4z"/><path d="M14.9 5.03 22 21h-4l-5.1-11.47z"/><path d="M10.47 15h3.06l1.11 2.5H9.36z"/></g><path fill="#e8e6e1" d="M99.76 68L99.76 100L86.96 100L86.96 47.80L99.76 47.80L99.76 58.60L100.26 58.60Q100.96 55.80 102.61 53.35Q104.26 50.90 107.11 49.35Q109.96 47.80 114.06 47.80L116.86 47.80L116.86 59.90L112.86 59.90Q108.56 59.90 105.61 60.75Q102.66 61.60 101.21 63.35Q99.76 65.10 99.76 68M145.86 101.20Q134.26 101.20 128.01 93.80Q121.76 86.40 121.76 73.80Q121.76 61.30 128.01 53.95Q134.26 46.60 145.86 46.60Q153.76 46.60 158.91 50.10Q164.06 53.60 166.36 59.80L155.86 64.50Q154.96 61.20 152.46 59.05Q149.96 56.90 145.86 56.90Q140.56 56.90 137.86 60.25Q135.16 63.60 135.16 69.20L135.16 78.70Q135.16 84.10 137.86 87.50Q140.56 90.90 145.86 90.90Q150.36 90.90 152.91 88.55Q155.46 86.20 156.86 82.70L166.66 87.40Q164.16 94.30 158.81 97.75Q153.46 101.20 145.86 101.20M188.36 100L175.56 100L175.56 26L188.36 26L188.36 56.50L188.86 56.50Q190.46 52.30 193.91 49.45Q197.36 46.60 203.46 46.60Q211.46 46.60 215.81 51.95Q220.16 57.30 220.16 67L220.16 100L207.36 100L207.36 68.30Q207.36 62.80 205.36 59.95Q203.36 57.10 198.76 57.10Q196.16 57.10 193.76 58.05Q191.36 59 189.86 60.85Q188.36 62.70 188.36 65.50M239.76 40.20Q235.86 40.20 234.06 38.35Q232.26 36.50 232.26 33.80L232.26 31.80Q232.26 29 234.06 27.20Q235.86 25.40 239.76 25.40Q243.66 25.40 245.46 27.20Q247.26 29 247.26 31.80L247.26 33.80Q247.26 36.50 245.46 38.35Q243.66 40.20 239.76 40.20M246.16 100L233.36 100L233.36 47.80L246.16 47.80M280.96 101.20Q273.26 101.20 267.76 97.85Q262.26 94.50 259.31 88.35Q256.36 82.20 256.36 73.80Q256.36 65.60 259.26 59.45Q262.16 53.30 267.56 49.95Q272.96 46.60 280.56 46.60Q288.76 46.60 294.01 50.20Q299.26 53.80 301.81 59.75Q304.36 65.70 304.36 72.90L304.36 77.10L269.66 77.10L269.66 78.40Q269.66 84 272.86 87.50Q276.06 91 282.36 91Q287.06 91 290.16 88.95Q293.26 86.90 295.66 83.90L302.56 91.60Q299.36 95.90 293.81 98.55Q288.26 101.20 280.96 101.20M280.76 56.20Q277.36 56.20 274.86 57.75Q272.36 59.30 271.01 62.05Q269.66 64.80 269.66 68.40L269.66 69.20L291.06 69.20L291.06 68.30Q291.06 64.60 289.86 61.95Q288.66 59.30 286.36 57.75Q284.06 56.20 280.76 56.20"/></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-4 21.40 312 84" role="img" aria-label="Archie"><title>Archie</title><g fill="currentColor" transform="translate(-7.7555555555555555 18.56666666666667) scale(3.8777777777777778)"><path d="M2 21h4l8-18h-4z"/><path d="M14.9 5.03 22 21h-4l-5.1-11.47z"/><path d="M10.47 15h3.06l1.11 2.5H9.36z"/></g><path fill="currentColor" d="M99.76 68L99.76 100L86.96 100L86.96 47.80L99.76 47.80L99.76 58.60L100.26 58.60Q100.96 55.80 102.61 53.35Q104.26 50.90 107.11 49.35Q109.96 47.80 114.06 47.80L116.86 47.80L116.86 59.90L112.86 59.90Q108.56 59.90 105.61 60.75Q102.66 61.60 101.21 63.35Q99.76 65.10 99.76 68M145.86 101.20Q134.26 101.20 128.01 93.80Q121.76 86.40 121.76 73.80Q121.76 61.30 128.01 53.95Q134.26 46.60 145.86 46.60Q153.76 46.60 158.91 50.10Q164.06 53.60 166.36 59.80L155.86 64.50Q154.96 61.20 152.46 59.05Q149.96 56.90 145.86 56.90Q140.56 56.90 137.86 60.25Q135.16 63.60 135.16 69.20L135.16 78.70Q135.16 84.10 137.86 87.50Q140.56 90.90 145.86 90.90Q150.36 90.90 152.91 88.55Q155.46 86.20 156.86 82.70L166.66 87.40Q164.16 94.30 158.81 97.75Q153.46 101.20 145.86 101.20M188.36 100L175.56 100L175.56 26L188.36 26L188.36 56.50L188.86 56.50Q190.46 52.30 193.91 49.45Q197.36 46.60 203.46 46.60Q211.46 46.60 215.81 51.95Q220.16 57.30 220.16 67L220.16 100L207.36 100L207.36 68.30Q207.36 62.80 205.36 59.95Q203.36 57.10 198.76 57.10Q196.16 57.10 193.76 58.05Q191.36 59 189.86 60.85Q188.36 62.70 188.36 65.50M239.76 40.20Q235.86 40.20 234.06 38.35Q232.26 36.50 232.26 33.80L232.26 31.80Q232.26 29 234.06 27.20Q235.86 25.40 239.76 25.40Q243.66 25.40 245.46 27.20Q247.26 29 247.26 31.80L247.26 33.80Q247.26 36.50 245.46 38.35Q243.66 40.20 239.76 40.20M246.16 100L233.36 100L233.36 47.80L246.16 47.80M280.96 101.20Q273.26 101.20 267.76 97.85Q262.26 94.50 259.31 88.35Q256.36 82.20 256.36 73.80Q256.36 65.60 259.26 59.45Q262.16 53.30 267.56 49.95Q272.96 46.60 280.56 46.60Q288.76 46.60 294.01 50.20Q299.26 53.80 301.81 59.75Q304.36 65.70 304.36 72.90L304.36 77.10L269.66 77.10L269.66 78.40Q269.66 84 272.86 87.50Q276.06 91 282.36 91Q287.06 91 290.16 88.95Q293.26 86.90 295.66 83.90L302.56 91.60Q299.36 95.90 293.81 98.55Q288.26 101.20 280.96 101.20M280.76 56.20Q277.36 56.20 274.86 57.75Q272.36 59.30 271.01 62.05Q269.66 64.80 269.66 68.40L269.66 69.20L291.06 69.20L291.06 68.30Q291.06 64.60 289.86 61.95Q288.66 59.30 286.36 57.75Q284.06 56.20 280.76 56.20"/></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-4 21.40 312 84" role="img" aria-label="Archie"><title>Archie</title><g fill="#51a580" transform="translate(-7.7555555555555555 18.56666666666667) scale(3.8777777777777778)"><path d="M2 21h4l8-18h-4z"/><path d="M14.9 5.03 22 21h-4l-5.1-11.47z"/><path d="M10.47 15h3.06l1.11 2.5H9.36z"/></g><path fill="#1f1f1d" d="M99.76 68L99.76 100L86.96 100L86.96 47.80L99.76 47.80L99.76 58.60L100.26 58.60Q100.96 55.80 102.61 53.35Q104.26 50.90 107.11 49.35Q109.96 47.80 114.06 47.80L116.86 47.80L116.86 59.90L112.86 59.90Q108.56 59.90 105.61 60.75Q102.66 61.60 101.21 63.35Q99.76 65.10 99.76 68M145.86 101.20Q134.26 101.20 128.01 93.80Q121.76 86.40 121.76 73.80Q121.76 61.30 128.01 53.95Q134.26 46.60 145.86 46.60Q153.76 46.60 158.91 50.10Q164.06 53.60 166.36 59.80L155.86 64.50Q154.96 61.20 152.46 59.05Q149.96 56.90 145.86 56.90Q140.56 56.90 137.86 60.25Q135.16 63.60 135.16 69.20L135.16 78.70Q135.16 84.10 137.86 87.50Q140.56 90.90 145.86 90.90Q150.36 90.90 152.91 88.55Q155.46 86.20 156.86 82.70L166.66 87.40Q164.16 94.30 158.81 97.75Q153.46 101.20 145.86 101.20M188.36 100L175.56 100L175.56 26L188.36 26L188.36 56.50L188.86 56.50Q190.46 52.30 193.91 49.45Q197.36 46.60 203.46 46.60Q211.46 46.60 215.81 51.95Q220.16 57.30 220.16 67L220.16 100L207.36 100L207.36 68.30Q207.36 62.80 205.36 59.95Q203.36 57.10 198.76 57.10Q196.16 57.10 193.76 58.05Q191.36 59 189.86 60.85Q188.36 62.70 188.36 65.50M239.76 40.20Q235.86 40.20 234.06 38.35Q232.26 36.50 232.26 33.80L232.26 31.80Q232.26 29 234.06 27.20Q235.86 25.40 239.76 25.40Q243.66 25.40 245.46 27.20Q247.26 29 247.26 31.80L247.26 33.80Q247.26 36.50 245.46 38.35Q243.66 40.20 239.76 40.20M246.16 100L233.36 100L233.36 47.80L246.16 47.80M280.96 101.20Q273.26 101.20 267.76 97.85Q262.26 94.50 259.31 88.35Q256.36 82.20 256.36 73.80Q256.36 65.60 259.26 59.45Q262.16 53.30 267.56 49.95Q272.96 46.60 280.56 46.60Q288.76 46.60 294.01 50.20Q299.26 53.80 301.81 59.75Q304.36 65.70 304.36 72.90L304.36 77.10L269.66 77.10L269.66 78.40Q269.66 84 272.86 87.50Q276.06 91 282.36 91Q287.06 91 290.16 88.95Q293.26 86.90 295.66 83.90L302.56 91.60Q299.36 95.90 293.81 98.55Q288.26 101.20 280.96 101.20M280.76 56.20Q277.36 56.20 274.86 57.75Q272.36 59.30 271.01 62.05Q269.66 64.80 269.66 68.40L269.66 69.20L291.06 69.20L291.06 68.30Q291.06 64.60 289.86 61.95Q288.66 59.30 286.36 57.75Q284.06 56.20 280.76 56.20"/></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

-9
View File
@@ -1,9 +0,0 @@
package configtemplate
import _ "embed"
// Changelog is the verbatim contents of CHANGELOG.md, so a binary carries the
// release notes for the version it was built as.
//
//go:embed CHANGELOG.md
var Changelog string
+16 -61
View File
@@ -3,6 +3,7 @@ package main
import (
"context"
"encoding/base64"
"errors"
"flag"
"fmt"
@@ -21,17 +22,6 @@ import (
type workerRunner func(context.Context, agentworker.Settings, *slog.Logger) error
// runHold blocks until signalled and exits 0. It is the keepalive for a Kit
// container that runs no worker: the agent binary is archie's own and is
// mounted into every Kit, so the container needs no binary the image may not
// ship, and holds no environment of its own.
func runHold() int {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
<-ctx.Done()
return 0
}
func main() {
os.Exit(run())
}
@@ -41,15 +31,9 @@ func run() int {
}
func runCommand(args []string, getenv func(string) string, stderr io.Writer, runWorker workerRunner) int {
if len(args) > 0 && args[0] == "hold" {
return runHold()
}
if len(args) > 0 && args[0] == "relay" {
return runRelay(args[1:], stderr, agentworker.RunRelay)
}
if len(args) > 0 && args[0] == "mcp" {
return runMCP(args[1:], stderr, agentworker.RunCaptureMCP)
}
flags := flag.NewFlagSet("archie-agent", flag.ContinueOnError)
flags.SetOutput(stderr)
natsURLFlag := flags.String("nats-url", "", "NATS server URL (defaults to NATS_URL)")
@@ -69,9 +53,12 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
return 0
}
natsURL, natsToken := natsConnectionSettings(*natsURLFlag, getenv)
natsURL := *natsURLFlag
if natsURL == "" {
fmt.Fprintln(stderr, "error: -nats-url or NATS_URL is required")
natsURL = getenv("NATS_URL")
}
if natsURL == "" {
_, _ = fmt.Fprintln(stderr, "error: -nats-url or NATS_URL is required")
flags.Usage()
return 1
}
@@ -85,7 +72,7 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
stateStoreURL = getenv("STATE_STORE_URL")
}
if stateStoreURL == "" {
fmt.Fprintln(stderr, "error: -state-store-url or STATE_STORE_URL is required (the legacy NATS storerpc path is deleted)")
_, _ = fmt.Fprintln(stderr, "error: -state-store-url or STATE_STORE_URL is required (the legacy NATS storerpc path is deleted)")
flags.Usage()
return 1
}
@@ -94,12 +81,17 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
stateStoreToken = getenv("STATE_STORE_TOKEN")
}
stateStoreCA, err := base64.StdEncoding.DecodeString(getenv("STATE_STORE_CA_BASE64"))
if err != nil {
_, _ = fmt.Fprintf(stderr, "error: STATE_STORE_CA_BASE64: %v\n", err)
return 1
}
if err := runWorker(ctx, agentworker.Settings{
NATSURL: natsURL,
NATSToken: natsToken,
StateStoreTarget: stateStoreURL,
StateStoreToken: stateStoreToken,
StateStoreCA: []byte(getenv("STATE_STORE_CA")),
StateStoreCA: stateStoreCA,
ModelProxy: getenv(egress.ModelProxyEnv),
ModelProxyHosts: egress.ParseHosts(getenv(egress.ModelProxyHostsEnv)),
ModelProxyCA: getenv(egress.ModelProxyCAEnv),
@@ -109,14 +101,6 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
return 0
}
func natsConnectionSettings(flagURL string, getenv func(string) string) (url, token string) {
url = flagURL
if url == "" {
url = getenv("NATS_URL")
}
return url, getenv("NATS_TOKEN")
}
type relayServer func(ctx context.Context, forwards map[string]string) error
// runRelay is the sandbox egress relay: the container on both a sandbox's
@@ -150,43 +134,14 @@ func runRelay(args []string, stderr io.Writer, serve relayServer) int {
return 2
}
if len(forwards) == 0 {
fmt.Fprintln(stderr, "error: at least one -forward is required")
_, _ = fmt.Fprintln(stderr, "error: at least one -forward is required")
flags.Usage()
return 1
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
if err := serve(ctx, forwards); err != nil {
fmt.Fprintln(stderr, "error:", err)
return 1
}
return 0
}
type mcpServer func(ctx context.Context, specPath, capturesPath string) error
// runMCP serves a stage's capture tools to a harness over stdio. The
// harness starts it, so it runs as the harness user and holds no secrets.
func runMCP(args []string, stderr io.Writer, serve mcpServer) int {
flags := flag.NewFlagSet("archie-agent mcp", flag.ContinueOnError)
flags.SetOutput(stderr)
spec := flags.String("spec", "", "JSON file listing the stage's capture tools")
captures := flags.String("captures", "", "file accepted capture calls are appended to")
if err := flags.Parse(args); err != nil {
if errors.Is(err, flag.ErrHelp) {
return 0
}
return 2
}
if *spec == "" || *captures == "" {
fmt.Fprintln(stderr, "error: -spec and -captures are required")
flags.Usage()
return 1
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
if err := serve(ctx, *spec, *captures); err != nil {
fmt.Fprintln(stderr, "error:", err)
_, _ = fmt.Fprintln(stderr, "error:", err)
return 1
}
return 0
-39
View File
@@ -1,39 +0,0 @@
// The Messaging Service reaches the State Store and the workflow engine only
// through their contracts. Go imports are atomic, so one reference relinks a
// runtime, and the boundary holds only while something re-measures it.
package main
import (
"context"
"os/exec"
"strings"
"testing"
"time"
)
func TestMessagingDoesNotLinkStoreOrWorkflowRuntime(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
out, err := exec.CommandContext(ctx, "go", "list", "-deps", ".").Output()
if err != nil {
t.Fatalf("go list -deps .: %v", err)
}
linked := map[string]bool{}
for line := range strings.SplitSeq(strings.TrimSpace(string(out)), "\n") {
linked[line] = true
}
for _, pkg := range []string{
"github.com/jackc/pgx/v5/pgxpool",
"github.com/samcharles93/archie-core/internal/infrastructure/postgres",
"github.com/samcharles93/archie-core/internal/infrastructure/controlplanestore",
"github.com/samcharles93/archie-core/internal/domain/workflow",
"github.com/samcharles93/archie-core/internal/agentexec",
} {
t.Run(pkg, func(t *testing.T) {
if linked[pkg] {
t.Errorf("cmd/archie-messaging links %s: services reach each other only through contracts", pkg)
}
})
}
}
+7 -4
View File
@@ -19,10 +19,13 @@ import (
func main() { os.Exit(run()) }
func run() int {
// A leading non-flag argument selects a recovery subcommand; anything else,
// A leading non-flag argument selects a subcommand; anything else,
// including no arguments at all, serves the State Store contract. An
// unrecognised word is refused rather than ignored, so a mistyped recovery
// command never leaves an operator watching a server start instead.
// unrecognised word is refused rather than ignored, so a mistyped command
// never leaves an operator watching a server start instead.
if args := os.Args[1:]; statestore.IsProvisionArgs(args) {
return statestore.RunProvision(context.Background(), args[1:], os.Stdout, os.Stderr)
}
if args := os.Args[1:]; statestore.IsAccessResetArgs(args) {
return statestore.RunAccessReset(context.Background(), args[2:], os.Stderr)
}
@@ -36,7 +39,7 @@ func run() int {
flag.StringVar(&options.Listen, "listen", "", "state store gRPC listen address (defaults to [services.state].listen, else 127.0.0.1:9090)")
flag.StringVar(&options.ReadyAddr, "ready-addr", "", "optional readiness HTTP listen address (e.g. 127.0.0.1:9091)")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), "usage: archie-state-store [flags] # serve the State Store gRPC contract\n\noffline recovery: archie-state-store <backup|restore|validate|rollback> -h | access reset -h\n\n")
_, _ = fmt.Fprintf(flag.CommandLine.Output(), "usage: archie-state-store [flags] # serve the State Store gRPC contract\n\ndatabase roles: archie-state-store provision -h\noffline recovery: archie-state-store <backup|restore|validate|rollback> -h | access reset -h\n\n")
flag.PrintDefaults()
}
flag.Parse()
+7 -7
View File
@@ -47,7 +47,7 @@ the daemon boots with, which names the database.
// 1 the operation failed, 2 the command line was wrong.
func runRecovery(args []string, stdout, stderr io.Writer) int {
if len(args) == 0 {
fmt.Fprint(stderr, recoveryUsage)
_, _ = fmt.Fprint(stderr, recoveryUsage)
return 2
}
command := args[0]
@@ -55,14 +55,14 @@ func runRecovery(args []string, stdout, stderr io.Writer) int {
switch command {
case statestore.RecoveryBackup, statestore.RecoveryRestore, statestore.RecoveryValidate, statestore.RecoveryRollback:
default:
fmt.Fprintf(stderr, "archie-state-store: unknown command %q\n\n", command)
fmt.Fprint(stderr, recoveryUsage)
_, _ = fmt.Fprintf(stderr, "archie-state-store: unknown command %q\n\n", command)
_, _ = fmt.Fprint(stderr, recoveryUsage)
return 2
}
flags := flag.NewFlagSet("archie-state-store "+command, flag.ContinueOnError)
flags.SetOutput(stderr)
flags.Usage = func() { fmt.Fprint(stderr, recoveryUsage) }
flags.Usage = func() { _, _ = fmt.Fprint(stderr, recoveryUsage) }
flags.StringVar(&options.Out, "out", "", "snapshot file backup writes")
flags.StringVar(&options.From, "from", "", "snapshot file restore reads")
flags.StringVar(&options.Kind, "kind", "", "control-plane resource kind rollback replays")
@@ -80,15 +80,15 @@ func runRecovery(args []string, stdout, stderr io.Writer) int {
return 2
}
if flags.NArg() > 0 {
fmt.Fprintf(stderr, "archie-state-store %s: unexpected argument %q\n", command, flags.Arg(0))
_, _ = fmt.Fprintf(stderr, "archie-state-store %s: unexpected argument %q\n", command, flags.Arg(0))
return 2
}
summary, err := statestore.RunRecovery(context.Background(), options)
if err != nil {
fmt.Fprintf(stderr, "archie-state-store %s: %v\n", command, err)
_, _ = fmt.Fprintf(stderr, "archie-state-store %s: %v\n", command, err)
return 1
}
fmt.Fprintln(stdout, summary)
_, _ = fmt.Fprintln(stdout, summary)
return 0
}
-41
View File
@@ -1,41 +0,0 @@
// This file enforces the dashboard's process boundary
// (docs/prds/external-agent-harness.md, "Session contract", Transport): the
// dashboard must not link the container or daemon internals, because only the
// daemon owns containers. Go imports are atomic, so a single reference
// relinks a runtime, and the boundary holds only while something re-measures
// it. archie-core-h3s0 names this check; it was purged with the test suite and
// is restored here.
package main
import (
"context"
"os/exec"
"strings"
"testing"
"time"
)
func TestDashboardDoesNotLinkContainerRuntime(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
out, err := exec.CommandContext(ctx, "go", "list", "-deps", ".").Output()
if err != nil {
t.Fatalf("go list -deps .: %v", err)
}
linked := map[string]bool{}
for line := range strings.SplitSeq(strings.TrimSpace(string(out)), "\n") {
linked[line] = true
}
for _, pkg := range []string{
"github.com/samcharles93/archie-core/internal/container",
"github.com/samcharles93/archie-core/internal/app/archied",
"github.com/samcharles93/archie-core/internal/agentexec",
} {
t.Run(pkg, func(t *testing.T) {
if linked[pkg] {
t.Errorf("cmd/archie-ui links %s: only the daemon owns containers", pkg)
}
})
}
}
+53
View File
@@ -0,0 +1,53 @@
// Command archie is the single Archie binary. It parses flags and hands over to
// the composition root.
package main
import (
"context"
"flag"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/samcharles93/archie-core/internal/app/archie"
"github.com/samcharles93/archie-core/internal/buildinfo"
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, "archie:", err)
os.Exit(1)
}
}
func run() error {
configPath := flag.String("config", archie.DefaultConfigPath(), "path to the bootstrap config file")
newIdentity := flag.Bool("new-age-identity", false, "print a new age identity for age_identity and exit")
showVersion := buildinfo.RegisterVersionFlag("archie")
flag.Usage = func() {
_, _ = fmt.Fprintln(flag.CommandLine.Output(), "usage: archie [flags]\n archie openapi print the API's OpenAPI document")
flag.PrintDefaults()
}
flag.Parse()
showVersion()
if *newIdentity {
return archie.NewAgeIdentity(os.Stdout)
}
switch flag.Arg(0) {
case "":
case "openapi":
doc, err := archie.Document()
if err != nil {
return err
}
_, err = os.Stdout.Write(doc)
return err
default:
return fmt.Errorf("unknown command %q", flag.Arg(0))
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
return archie.Run(ctx, *configPath)
}
+1 -4
View File
@@ -7,12 +7,11 @@ import (
"strings"
"github.com/samcharles93/archie-core/internal/app/archied"
"github.com/samcharles93/archie-core/internal/app/archieplaybooks"
"github.com/samcharles93/archie-core/internal/app/prbench"
)
const commandUsage = "usage: archied [flags] # run the daemon; archied -h lists the flags\n" +
"subcommands: setup, update, release, status, prbench, playbooks"
"subcommands: setup, update, release, status, prbench"
func main() {
os.Exit(run(os.Args[1:]))
@@ -35,8 +34,6 @@ func run(args []string) int {
return archied.RunStatus(args[1:], os.Stdout, os.Stderr)
case "prbench":
return prbench.Main(args[1:], os.Stdout, os.Stderr)
case "playbooks":
return archieplaybooks.Run(args[1:], os.Stderr)
}
// A word that is not a subcommand is refused rather than ignored: a
// stale `archied update-topology` would otherwise start a second
+8 -5
View File
@@ -7,7 +7,12 @@
# Secrets are never written here: each is a {engine, key} reference. The
# built-in "env" engine reads key as an environment variable.
# database_url = "postgres://archie:archie@localhost:5432/archie?sslmode=disable"
# The URL the services connect as: a least-privilege role, created by
# `archie-state-store provision`. migration_database_url is the role that owns
# the schema and runs migrations; when it is absent, database_url does both,
# which is what a single-role install does.
# database_url = "postgres://archie_runtime:secret@localhost:5432/archie?sslmode=disable"
# migration_database_url = "postgres://archie_migrator:secret@localhost:5432/archie?sslmode=disable"
# work_dir = "~/.local/share/archie/work"
# state_dir = "~/.local/share/archie"
@@ -19,9 +24,6 @@ bot_user = "vectis-labs-archie"
type = "github"
host = "https://github.com"
token = { engine = "env", key = "ARCHIE_GITHUB_TOKEN" }
# intake = "poll" # "poll", "webhook" or "both"
# webhook_secret = { engine = "env", key = "ARCHIE_WEBHOOK_SECRET" }
# webhook_addr = "0.0.0.0:8645"
[dispatch]
trigger = "assignee" # "assignee", "label" or "either"
@@ -72,7 +74,8 @@ target = "127.0.0.1:9090"
# [nats]
# mode = "embedded" # or "external" with url
# url = "nats://localhost:4222"
# token_env = "NATS_TOKEN"
# token_env = "NATS_TOKEN" # external: the archie-callout user's password
# callout_issuer_seed_env = "NATS_CALLOUT_SEED" # external: account nkey seed; the broker's auth_callout issuer is its public key
# [log]
# file = "~/.local/share/archie/logs/archied.log"
+6 -15
View File
@@ -1,8 +1,6 @@
# Running this distribution
This archive contains five linux/amd64 binaries:
Each service owns its data and reaches the others only through their gRPC
This archive holds the linux/amd64 binary for each service. Each service owns its data and reaches the others only through their gRPC
contracts (or NATS, for task actions):
| Service | Owns | Reaches |
@@ -13,14 +11,10 @@ contracts (or NATS, for task actions):
| `archie-messaging` | the Telegram, email and webhook channel connections | Gateway; State Store for channel settings |
| `archie-ui` | the dashboard and the webhook capture receiver | Gateway; State Store |
`archied playbooks lint` checks playbook binding YAML before it reaches the
daemon, and `archied playbooks serve` is its language server for editors.
Without `archie-messaging` the channels are simply absent, so it needs a unit
of its own (`deployments/systemd-user-service.md`).
`archie-agent` (the per-task sandboxed runtime) has no unit of its own: it
ships beside `archied` because a Kit run mounts it from that directory. The
`archie-agent` (the per-task sandboxed runtime) has no unit of its own. The
agent image is a separate thing, pulled for the containers `archied` spawns
per task: `[containers].image` defaults to
`git.catlow.cloud/sam/archie-agent:latest`, while this archive's `release.json`
@@ -35,7 +29,10 @@ that reference is on a registry that needs a login -- see
(<https://offloaded.dev>) —
`standalone.toml` (no forge, the simplest start),
`single-forge-github.toml` and `docker-nats-stack.toml` cover the common cases. Every one needs
PostgreSQL 18 at `database_url`. Copy whichever fits to:
PostgreSQL 18 with the `archie_migrator` and `archie_runtime` roles created
once by `archie-state-store provision` (see `deployments/README.md`);
`docker compose up -d postgres` plus that command gives the local default.
Copy whichever fits to:
```bash
mkdir -p ~/.config/archie
@@ -67,12 +64,6 @@ that reference is on a registry that needs a login -- see
systemd user-unit runbook:
<https://offloaded.dev>.
## Verifying an install
`archied playbooks lint -dir <playbooks-dir>` validates playbook binding YAML
against the same schema `archied` loads at startup — run it against your
playbooks directory before pointing `archied` at it.
## Version
This archive's binaries are built from the `archied` release tag in its
+32 -1
View File
@@ -42,7 +42,9 @@ systemctl --user start archied
Start order does not matter: a service waits for its peers and reports them as
degraded meanwhile. Every template needs PostgreSQL 18 at `database_url`;
`docker compose up -d postgres` provides the default one.
`docker compose up -d postgres` provides the default server. Its two login
roles are created once per database by `archie-state-store provision` -- see
[Database roles](#database-roles).
The State Store service (`archie-state-store`) owns the task data in the
PostgreSQL database `database_url` names and serves the `StateStore` gRPC
@@ -54,6 +56,35 @@ gateway address, because a container cannot reach the host's loopback. A
non-loopback address needs `[tls]` certificates from your own CA; see
`config.example.toml`.
## Database roles
The services do not connect as the database owner. `archie-state-store
provision` creates, or reconciles, two login roles in an existing PostgreSQL
database and hands the schema to one of them:
- `archie_migrator` owns the schema and its objects and runs the goose
migrations;
- `archie_runtime` may read and write rows (SELECT, INSERT, UPDATE, DELETE,
sequence USAGE, function EXECUTE) and has no CREATE privilege, so it cannot
change the schema.
Run it once per database with a role allowed to create roles and take ownership
of the schema (the database owner or a superuser), then point the templates at
the two roles: `database_url` is the runtime URL and `migration_database_url`
the migration one. The command is idempotent, so re-running it after an upgrade
reconciles objects a migration added.
```bash
archie-state-store provision \
-admin-url "postgres://owner:secret@db:5432/archie" \
-runtime-url "postgres://archie_runtime:secret@db:5432/archie" \
-migration-url "postgres://archie_migrator:secret@db:5432/archie"
```
The bundled installer and `task dev` run this for you. A configuration with only
`database_url` keeps working exactly as before: that one role applies the
schema and serves, which is what an install that has not split the roles does.
## Running the dashboard
The dashboard is served by the standalone UI Service (`archie-ui`), not by
+42
View File
@@ -0,0 +1,42 @@
name: archie
services:
archie-db:
image: postgres:18-alpine
restart: unless-stopped
environment:
POSTGRES_DB: archie
POSTGRES_USER: archie_owner
POSTGRES_PASSWORD: ${ARCHIE_OWNER_PASSWORD:?}
ARCHIE_APP_PASSWORD: ${ARCHIE_APP_PASSWORD:?}
volumes:
- ./postgres:/var/lib/postgresql
- ./initdb:/docker-entrypoint-initdb.d:ro
networks: [internal]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U archie_owner -d archie"]
interval: 5s
timeout: 3s
retries: 20
archie:
image: gcr.io/distroless/static-debian12:nonroot
restart: unless-stopped
command: ["/archie/archie", "-config", "/archie/config.toml"]
# Docker's default seccomp profile plus the one clone the extension host
# needs to confine an extension in its own user and network namespace.
security_opt:
- seccomp=./seccomp.json
volumes:
- ./bin/archie:/archie/archie:ro
- ./config.toml:/archie/config.toml:ro
- ./extensions:/archie/extensions:ro
ports:
- "${ARCHIE_BIND:?}:8080"
networks: [internal]
depends_on:
archie-db:
condition: service_healthy
networks:
internal: {}
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
# Deploys the single binary's stack to a host over ssh: deploy.sh root@staging-host.
# The first run creates the secrets on the host; they never leave it.
set -euo pipefail
target=${1:?usage: deploy.sh user@host [bind-address:port]}
bind=${2:-}
here=$(cd "$(dirname "$0")" && pwd)
repo=$(cd "$here/../.." && pwd)
dir=/root/archie
version=$(git -C "$repo" describe --tags --always --dirty)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -C "$repo" -trimpath \
-ldflags "-X github.com/samcharles93/archie-core/internal/buildinfo.Version=$version" \
-o "$here/.build/archie" ./cmd/archie
ssh "$target" "mkdir -p $dir/bin $dir/initdb $dir/extensions"
scp -q "$here/compose.yml" "$target:$dir/compose.yml"
scp -q "$here/seccomp.json" "$target:$dir/seccomp.json"
scp -q "$here/initdb/01-roles.sh" "$target:$dir/initdb/01-roles.sh"
scp -q "$here/.build/archie" "$target:$dir/bin/archie.new"
ssh "$target" BIND="$bind" DIR="$dir" bash -s <<'REMOTE'
set -euo pipefail
cd "$DIR"
chmod 755 initdb/01-roles.sh
mv bin/archie.new bin/archie && chmod 755 bin/archie
if [ ! -f .env ]; then
[ -n "$BIND" ] || { echo "first deploy needs a bind address, e.g. 10.0.0.1:8099" >&2; exit 1; }
umask 077
printf 'ARCHIE_OWNER_PASSWORD=%s\nARCHIE_APP_PASSWORD=%s\nARCHIE_BIND=%s\n' \
"$(openssl rand -hex 24)" "$(openssl rand -hex 24)" "$BIND" > .env
fi
if [ ! -f config.toml ]; then
set -a; . ./.env; set +a
umask 077
cat > config.toml <<CONFIG
listen = "0.0.0.0:8080"
[database]
url = "postgres://archie_app:${ARCHIE_APP_PASSWORD}@archie-db:5432/archie?sslmode=disable"
owner_url = "postgres://archie_owner:${ARCHIE_OWNER_PASSWORD}@archie-db:5432/archie?sslmode=disable"
CONFIG
chown 65532:65532 config.toml
fi
# The admin token guards /api/. Only its hash goes in the config, as a
# top-level key, so it must come before the [database] table.
if ! grep -q '^admin_token_sha256' config.toml; then
umask 077
openssl rand -hex 32 | tr -d '\n' > admin-token
hash=$(sha256sum admin-token | cut -d' ' -f1)
sed -i "1i admin_token_sha256 = \"$hash\"" config.toml
chown 65532:65532 config.toml
fi
# The age identity seals the credentials Archie keeps. It is made here and
# never leaves the host; back it up, or credentials die with it.
if ! grep -q '^age_identity' config.toml; then
umask 077
identity=$(bin/archie -new-age-identity)
sed -i "1i age_identity = \"$identity\"" config.toml
unset identity
chown 65532:65532 config.toml
fi
docker compose up -d --remove-orphans
docker compose up -d --force-recreate archie
REMOTE
echo "deployed $version to $target"
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
# Runs once, on an empty data directory. The owner (POSTGRES_USER) runs
# migrations; archie_app is the runtime role and holds no DDL rights.
set -eu
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \
-v app_password="$ARCHIE_APP_PASSWORD" <<'SQL'
CREATE ROLE archie_app LOGIN PASSWORD :'app_password';
GRANT CONNECT ON DATABASE archie TO archie_app;
SQL
File diff suppressed because it is too large. Load diff
+15 -3
View File
@@ -9,16 +9,28 @@
# [web] entirely.
# `task dev` runs archie-state-store against this overlay, and the State Store
# fails closed without a PostgreSQL URL. This must reach the `postgres`
# fails closed without a PostgreSQL URL. These must reach the `postgres`
# service in docker-compose.yml, which `task dev` brings up first via
# dev:postgres -- keep the URL and that service in agreement.
# dev:postgres -- keep them and that service in agreement. dev:postgres also
# provisions the two roles: the services serve as archie_runtime and migrate
# as archie_migrator, while the Compose-created archie role is only the
# admin that created them.
bot_user = "archie-dev"
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
database_url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"
migration_database_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
[web]
listen = "127.0.0.1:8484"
# The installed config may point [nats] at the optional external broker, which
# `task dev` never starts. An explicit empty url overrides it, so the daemon
# runs the embedded broker as in the e2e stack; the broker binds the host
# gateway, which task containers reach.
[nats]
mode = "embedded"
url = ""
# `task dev` runs archie-state-store via dev:state-store, which passes no
# -listen, so the listen below is the port the store binds. It must agree with
# the target: these two lines are the only place that pair is stated. Move them
+8 -3
View File
@@ -16,9 +16,12 @@ bot_user = "archie"
work_dir = "~/.local/share/archie/work"
state_dir = "~/.local/share/archie" # NATS store, task logs
# The State Store's PostgreSQL connection (PostgreSQL 18, required).
# `docker compose up -d postgres` provides this local default; point it at
# your own Postgres 18 server otherwise.
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
# `docker compose up -d postgres` provides the local default; point it at
# your own Postgres 18 server otherwise. The services serve as archie_runtime
# and migrations run as archie_migrator; create both once with
# `archie-state-store provision -h` (deployments/README.md).
database_url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"
migration_database_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
[services.gateway]
target = "127.0.0.1:8585"
@@ -56,6 +59,8 @@ mode = "external"
# The pinned Compose-network gateway is reachable from both the host daemon
# and the task containers it launches on archie-core_default.
url = "nats://172.19.0.1:4222"
token_env = "NATS_TOKEN"
callout_issuer_seed_env = "NATS_CALLOUT_SEED"
[containers]
network = "archie-core_default"
+10
View File
@@ -0,0 +1,10 @@
jetstream { store_dir: /data }
http_port: 8222
authorization {
users: [{ user: "archie-callout", password: $NATS_TOKEN }]
auth_callout {
issuer: $NATS_CALLOUT_ISSUER
auth_users: ["archie-callout"]
}
}
+6 -3
View File
@@ -8,9 +8,12 @@
work_dir = "~/.local/share/archie/work"
state_dir = "~/.local/share/archie" # NATS store, task logs
# The State Store's PostgreSQL connection (PostgreSQL 18, required).
# `docker compose up -d postgres` provides this local default; point it at
# your own Postgres 18 server otherwise.
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
# `docker compose up -d postgres` provides the local default; point it at
# your own Postgres 18 server otherwise. The services serve as archie_runtime
# and migrations run as archie_migrator; create both once with
# `archie-state-store provision -h` (deployments/README.md).
database_url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"
migration_database_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
poll_interval = "60s"
label = "archie"
bot_user = "archie-bot"
+6 -3
View File
@@ -15,9 +15,12 @@ bot_user = "archie"
work_dir = "~/.local/share/archie/work"
state_dir = "~/.local/share/archie" # NATS store, task logs
# PostgreSQL 18 connection (required).
# `docker compose up -d postgres` provides this local default; point it at
# your own Postgres 18 server otherwise.
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
# `docker compose up -d postgres` provides the local default; point it at
# your own Postgres 18 server otherwise. The services serve as archie_runtime
# and migrations run as archie_migrator; create both once with
# `archie-state-store provision -h` (deployments/README.md).
database_url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"
migration_database_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
[services.gateway]
target = "127.0.0.1:8585"
+20 -35
View File
@@ -54,7 +54,7 @@ Open the dashboard to configure the organisation, workspace and first administra
Complete setup before exposing it publicly; remote access requires an HTTPS reverse proxy.
**Auth note:** `archie-ui` authenticates to the Gateway, State Store and
harness with its `[tls]` certificate (`archie-ui.pem`) from `config.toml`.
daemon with its `[tls]` certificate (`archie-ui.pem`) from `config.toml`.
For supervision, `GET /healthz` on `[web].listen` is the process's liveness
probe (token-free by design); the authenticated readiness surface lives at
@@ -169,47 +169,24 @@ fall back to a host model loop.
## 6. Pinning the archie-agent Image
`archie-agent:latest` is a moving target: every release re-publishes it, so it
can change under a running deployment with no warning and no way to reproduce a
prior build. Two paths publish it, to different references:
The release pipeline publishes
`git.catlow.cloud/sam/archie-agent` as `:v<version>` and `:sha-<commit>` when
the commit carries a release tag; an ordinary push to `main` publishes nothing
for the agent image, and `:latest` moves only when a release is promoted. A
distribution zip pins the image its own release
published, by digest, in `release.json`, and `archied update install` pulls
exactly that.
- `.github/workflows/deploy.yml` publishes `git.catlow.cloud/sam/archie-agent`
as `:latest` and `:sha-<commit>` when the commit carries a release tag; an
ordinary push to `main` publishes nothing for the agent image.
- `tools/publish.sh`, run by hand for a release, publishes
`git.catlow.cloud/sam/archie-agent` as `:latest` and `:sha-<commit>`, which is
the registry the shipped default above names.
A distribution zip pins whichever one its own release published, by digest, in
`release.json`; `archied update install` then pulls exactly that.
As of this writing, `archie-agent` has **no published semantic-version tag** --
both paths publish only `:latest` and an immutable `:sha-<commit>` (`archied`
is versioned independently per `RELEASING.md`, but that versioning is not yet
reflected as a registry tag for the agent image). Until one publishes it, the
only reproducible reference is a content digest, resolved once and pinned
explicitly:
To pin by hand, prefer the version tag for readability, or a digest where you
need byte-for-byte reproducibility (a tag can be overwritten, a digest cannot):
```toml
[containers]
image = "git.catlow.cloud/sam/archie-agent:v<version>"
# or
image = "git.catlow.cloud/sam/archie-agent@sha256:<digest>"
```
This is the digest `latest` resolved to on 2026-09-05. Digest pinning is the
strongest option for production: it is immutable and independently
verifiable (`docker manifest inspect git.catlow.cloud/sam/archie-agent@sha256:...`),
at the cost of being opaque in a config file a human is meant to edit --
resolve a fresh digest deliberately (`docker pull ...:latest` followed by
`docker inspect --format '{{index .RepoDigests 0}}'`) rather than editing this
one in place expecting it to track new releases.
If/when CI starts publishing a semantic-version tag for `archie-agent`
(e.g. `git.catlow.cloud/sam/archie-agent:v1.21.0`), prefer that tag for
day-to-day config readability, and reserve digest pinning for deployments
that need byte-for-byte reproducibility guarantees a tag alone cannot give
(tags are mutable pointers; a compromised or accidentally-overwritten tag
still resolves, a digest cannot).
A reference on a registry that needs a login needs the credential in
`[containers].registry_auth` -- the release's own
`git.catlow.cloud/sam/archie-agent` digest is one, since an anonymous pull
@@ -248,11 +225,19 @@ docker compose up -d nats
[nats]
mode = "external"
url = "nats://172.19.0.1:4222"
token_env = "NATS_TOKEN"
callout_issuer_seed_env = "NATS_CALLOUT_SEED"
[containers]
network = "archie-core_default"
```
The broker defers every login to archied (NATS auth callout), so a worker logs
in with its run credential and reaches only its own task's subjects. Generate
an account nkey (`nk -gen account -pubout`), export its seed as
`NATS_CALLOUT_SEED` for archied and its public key as `NATS_CALLOUT_ISSUER` for
Compose, and set `NATS_TOKEN` to the same value in both.
The daemon hands workers the URL its own client connected to. The Compose
service name is not resolvable from the native host, and localhost inside a
worker is the worker itself; the pinned network gateway is reachable from both.
+10 -9
View File
@@ -19,8 +19,9 @@ services:
# The standalone archie-state-store process's database. PostgreSQL 18 is
# the required minimum and target; `postgres.Open` refuses anything older.
# `task dev` brings this up before the State Store via dev:postgres. The
# credentials and database name below are the dev default mirrored by
# deployments/dev.toml's database_url -- change both together.
# This superuser is the dev database's admin: `task dev` runs archie-state-store
# provision after first start to create the least-privilege roles the
# mirroring deployments/dev.toml URLs name -- change them together.
postgres:
image: postgres:18
environment:
@@ -45,19 +46,19 @@ services:
nats:
image: nats:2.14-alpine3.22
# The client port is published on every interface (agent containers reach
# it over the bridge), so it refuses to start without a token. Set
# NATS_TOKEN here and name the same value in [nats] token_env.
entrypoint:
- sh
- -c
- '[ -n "$$NATS_TOKEN" ] || { echo "NATS_TOKEN is required" >&2; exit 1; }; exec nats-server -js -m 8222 --auth "$$NATS_TOKEN"'
# it over the bridge), so it defers every login to archied. Set NATS_TOKEN
# (name it in [nats] token_env) and NATS_CALLOUT_ISSUER, the public key of
# the account nkey seed named in [nats] callout_issuer_seed_env.
command: ["-c", "/etc/nats/nats.conf"]
environment:
NATS_TOKEN: ${NATS_TOKEN:-}
NATS_TOKEN: ${NATS_TOKEN:?NATS_TOKEN is required}
NATS_CALLOUT_ISSUER: ${NATS_CALLOUT_ISSUER:?NATS_CALLOUT_ISSUER is required}
ports:
- "4222:4222" # client
- "127.0.0.1:8222:8222" # monitoring (http://localhost:8222)
volumes:
- nats_data:/data
- ./deployments/nats-callout.conf:/etc/nats/nats.conf:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8222/healthz"]
+4 -4
View File
@@ -55,10 +55,10 @@ Save. The binding starts in **draft** -- nothing fires yet.
## 5. Approve it
A **draft** or freshly-**edited** binding needs explicit approval
before it can ever match a live event -- this is deliberate, not a missing step:
an operator authoring a binding is a considered act, an event arriving is not,
and nothing should self-arm. Click **Approve**. Status becomes **armed**.
A **draft** or freshly-**edited** binding needs explicit approval before it can
ever match a live event -- this is deliberate, not a missing step: an operator
authoring a binding is a considered act, an event arriving is not, and nothing
should self-arm. Click **Approve**. Status becomes **armed**.
## 6. Fire it for real
-24
View File
@@ -1,24 +0,0 @@
# PR review benchmark
```
task bench:prreview
```
Reviews the 38 runnable Martian pull requests once each at `deep` depth with the
production pipeline, judges the posted comments against the golden comments in
`internal/app/prbench/martian.json`, and writes
`docs/benchmarks/pr-review-<timestamp>.md` (recall per PR, overall recall,
precision, models, archie version). Commit that file with the run.
- Models come from the config at `~/.config/archie/config.toml`: the reviewer
and judge both default to its `default` alias. Override with
`task bench:prreview -- -model ALIAS_OR_PROVIDER/MODEL -judge-model ALIAS_OR_PROVIDER/MODEL`.
Pick a judge other than the reviewer's model for an independent judgement.
Aliases set only in the dashboard are not in the file; pass a `provider/model`
ref instead.
- Pull requests are public, so no credential is needed. `GH_TOKEN` or
`GITHUB_TOKEN`, if set, only raises the GitHub API rate limit.
- `-problems ID,ID` runs a partial smoke run; its report says it is not the
acceptance run. A full run reports PASS when nothing failed and golden
micro-recall is at least 0.70.
- It is not part of `task test` and posts nothing to any pull request.
-216
View File
@@ -1,216 +0,0 @@
{
"/news/archie/1.0.0/": "/news/1.0.0/",
"/news/archie/1.1.0/": "/news/1.1.0/",
"/news/archie/1.10.0/": "/news/1.10.0/",
"/news/archie/1.11.0/": "/news/1.11.0/",
"/news/archie/1.11.1/": "/news/1.11.1/",
"/news/archie/1.12.0/": "/news/1.12.0/",
"/news/archie/1.13.0/": "/news/1.13.0/",
"/news/archie/1.14.0/": "/news/1.14.0/",
"/news/archie/1.15.0/": "/news/1.15.0/",
"/news/archie/1.16.0/": "/news/1.16.0/",
"/news/archie/1.16.1/": "/news/1.16.1/",
"/news/archie/1.17.0/": "/news/1.17.0/",
"/news/archie/1.17.1/": "/news/1.17.1/",
"/news/archie/1.18.0/": "/news/1.18.0/",
"/news/archie/1.19.0/": "/news/1.19.0/",
"/news/archie/1.19.1/": "/news/1.19.1/",
"/news/archie/1.19.10/": "/news/1.19.10/",
"/news/archie/1.19.2/": "/news/1.19.2/",
"/news/archie/1.19.3/": "/news/1.19.3/",
"/news/archie/1.19.4/": "/news/1.19.4/",
"/news/archie/1.19.5/": "/news/1.19.5/",
"/news/archie/1.19.6/": "/news/1.19.6/",
"/news/archie/1.19.7/": "/news/1.19.7/",
"/news/archie/1.19.8/": "/news/1.19.8/",
"/news/archie/1.19.9/": "/news/1.19.9/",
"/news/archie/1.2.0/": "/news/1.2.0/",
"/news/archie/1.20.0/": "/news/1.20.0/",
"/news/archie/1.21.0/": "/news/1.21.0/",
"/news/archie/1.22.0/": "/news/1.22.0/",
"/news/archie/1.23.0/": "/news/1.23.0/",
"/news/archie/1.24.0/": "/news/1.24.0/",
"/news/archie/1.25.0/": "/news/1.25.0/",
"/news/archie/1.26.0/": "/news/1.26.0/",
"/news/archie/1.27.0/": "/news/1.27.0/",
"/news/archie/1.28.0/": "/news/1.28.0/",
"/news/archie/1.29.0/": "/news/1.29.0/",
"/news/archie/1.3.0/": "/news/1.3.0/",
"/news/archie/1.3.1/": "/news/1.3.1/",
"/news/archie/1.30.0/": "/news/1.30.0/",
"/news/archie/1.31.0/": "/news/1.31.0/",
"/news/archie/1.32.0/": "/news/1.32.0/",
"/news/archie/1.32.1/": "/news/1.32.1/",
"/news/archie/1.33.0/": "/news/1.33.0/",
"/news/archie/1.34.0/": "/news/1.34.0/",
"/news/archie/1.35.0/": "/news/1.35.0/",
"/news/archie/1.36.0/": "/news/1.36.0/",
"/news/archie/1.37.0/": "/news/1.37.0/",
"/news/archie/1.37.1/": "/news/1.37.1/",
"/news/archie/1.38.0/": "/news/1.38.0/",
"/news/archie/1.39.0/": "/news/1.39.0/",
"/news/archie/1.4.0/": "/news/1.4.0/",
"/news/archie/1.4.1/": "/news/1.4.1/",
"/news/archie/1.40.0/": "/news/1.40.0/",
"/news/archie/1.41.0/": "/news/1.41.0/",
"/news/archie/1.41.1/": "/news/1.41.1/",
"/news/archie/1.41.2/": "/news/1.41.2/",
"/news/archie/1.42.0/": "/news/1.42.0/",
"/news/archie/1.43.0/": "/news/1.43.0/",
"/news/archie/1.44.0/": "/news/1.44.0/",
"/news/archie/1.44.1/": "/news/1.44.1/",
"/news/archie/1.45.0/": "/news/1.45.0/",
"/news/archie/1.46.0/": "/news/1.46.0/",
"/news/archie/1.47.0/": "/news/1.47.0/",
"/news/archie/1.47.1/": "/news/1.47.1/",
"/news/archie/1.47.2/": "/news/1.47.2/",
"/news/archie/1.47.3/": "/news/1.47.3/",
"/news/archie/1.48.0/": "/news/1.48.0/",
"/news/archie/1.48.1/": "/news/1.48.1/",
"/news/archie/1.49.0/": "/news/1.49.0/",
"/news/archie/1.49.1/": "/news/1.49.1/",
"/news/archie/1.49.2/": "/news/1.49.2/",
"/news/archie/1.49.3/": "/news/1.49.3/",
"/news/archie/1.49.4/": "/news/1.49.4/",
"/news/archie/1.5.0/": "/news/1.5.0/",
"/news/archie/1.50.0/": "/news/1.50.0/",
"/news/archie/1.50.1/": "/news/1.50.1/",
"/news/archie/1.51.0/": "/news/1.51.0/",
"/news/archie/1.51.1/": "/news/1.51.1/",
"/news/archie/1.52.0/": "/news/1.52.0/",
"/news/archie/1.53.0/": "/news/1.53.0/",
"/news/archie/1.54.0/": "/news/1.54.0/",
"/news/archie/1.54.1/": "/news/1.54.1/",
"/news/archie/1.54.2/": "/news/1.54.2/",
"/news/archie/1.54.3/": "/news/1.54.3/",
"/news/archie/1.55.0/": "/news/1.55.0/",
"/news/archie/1.56.0/": "/news/1.56.0/",
"/news/archie/1.57.0/": "/news/1.57.0/",
"/news/archie/1.58.0/": "/news/1.58.0/",
"/news/archie/1.58.1/": "/news/1.58.1/",
"/news/archie/1.59.0/": "/news/1.59.0/",
"/news/archie/1.6.0/": "/news/1.6.0/",
"/news/archie/1.60.0/": "/news/1.60.0/",
"/news/archie/1.61.0/": "/news/1.61.0/",
"/news/archie/1.7.0/": "/news/1.7.0/",
"/news/archie/1.8.0/": "/news/1.8.0/",
"/news/archie/1.9.0/": "/news/1.9.0/",
"/news/archie/1.9.1/": "/news/1.9.1/",
"/news/archie/1.9.10/": "/news/1.9.10/",
"/news/archie/1.9.11/": "/news/1.9.11/",
"/news/archie/1.9.2/": "/news/1.9.2/",
"/news/archie/1.9.3/": "/news/1.9.3/",
"/news/archie/1.9.4/": "/news/1.9.4/",
"/news/archie/1.9.5/": "/news/1.9.5/",
"/news/archie/1.9.6/": "/news/1.9.6/",
"/news/archie/1.9.7/": "/news/1.9.7/",
"/news/archie/1.9.8/": "/news/1.9.8/",
"/news/archie/1.9.9/": "/news/1.9.9/",
"/news/archied/1.0.0/": "/news/1.0.0/",
"/news/archied/1.1.0/": "/news/1.1.0/",
"/news/archied/1.10.0/": "/news/1.10.0/",
"/news/archied/1.11.0/": "/news/1.11.0/",
"/news/archied/1.11.1/": "/news/1.11.1/",
"/news/archied/1.12.0/": "/news/1.12.0/",
"/news/archied/1.13.0/": "/news/1.13.0/",
"/news/archied/1.14.0/": "/news/1.14.0/",
"/news/archied/1.15.0/": "/news/1.15.0/",
"/news/archied/1.16.0/": "/news/1.16.0/",
"/news/archied/1.16.1/": "/news/1.16.1/",
"/news/archied/1.17.0/": "/news/1.17.0/",
"/news/archied/1.17.1/": "/news/1.17.1/",
"/news/archied/1.18.0/": "/news/1.18.0/",
"/news/archied/1.19.0/": "/news/1.19.0/",
"/news/archied/1.19.1/": "/news/1.19.1/",
"/news/archied/1.19.10/": "/news/1.19.10/",
"/news/archied/1.19.2/": "/news/1.19.2/",
"/news/archied/1.19.3/": "/news/1.19.3/",
"/news/archied/1.19.4/": "/news/1.19.4/",
"/news/archied/1.19.5/": "/news/1.19.5/",
"/news/archied/1.19.6/": "/news/1.19.6/",
"/news/archied/1.19.7/": "/news/1.19.7/",
"/news/archied/1.19.8/": "/news/1.19.8/",
"/news/archied/1.19.9/": "/news/1.19.9/",
"/news/archied/1.2.0/": "/news/1.2.0/",
"/news/archied/1.20.0/": "/news/1.20.0/",
"/news/archied/1.21.0/": "/news/1.21.0/",
"/news/archied/1.22.0/": "/news/1.22.0/",
"/news/archied/1.23.0/": "/news/1.23.0/",
"/news/archied/1.24.0/": "/news/1.24.0/",
"/news/archied/1.25.0/": "/news/1.25.0/",
"/news/archied/1.26.0/": "/news/1.26.0/",
"/news/archied/1.27.0/": "/news/1.27.0/",
"/news/archied/1.28.0/": "/news/1.28.0/",
"/news/archied/1.29.0/": "/news/1.29.0/",
"/news/archied/1.3.0/": "/news/1.3.0/",
"/news/archied/1.3.1/": "/news/1.3.1/",
"/news/archied/1.30.0/": "/news/1.30.0/",
"/news/archied/1.31.0/": "/news/1.31.0/",
"/news/archied/1.32.0/": "/news/1.32.0/",
"/news/archied/1.32.1/": "/news/1.32.1/",
"/news/archied/1.33.0/": "/news/1.33.0/",
"/news/archied/1.34.0/": "/news/1.34.0/",
"/news/archied/1.35.0/": "/news/1.35.0/",
"/news/archied/1.36.0/": "/news/1.36.0/",
"/news/archied/1.37.0/": "/news/1.37.0/",
"/news/archied/1.37.1/": "/news/1.37.1/",
"/news/archied/1.38.0/": "/news/1.38.0/",
"/news/archied/1.39.0/": "/news/1.39.0/",
"/news/archied/1.4.0/": "/news/1.4.0/",
"/news/archied/1.4.1/": "/news/1.4.1/",
"/news/archied/1.40.0/": "/news/1.40.0/",
"/news/archied/1.41.0/": "/news/1.41.0/",
"/news/archied/1.41.1/": "/news/1.41.1/",
"/news/archied/1.41.2/": "/news/1.41.2/",
"/news/archied/1.42.0/": "/news/1.42.0/",
"/news/archied/1.43.0/": "/news/1.43.0/",
"/news/archied/1.44.0/": "/news/1.44.0/",
"/news/archied/1.44.1/": "/news/1.44.1/",
"/news/archied/1.45.0/": "/news/1.45.0/",
"/news/archied/1.46.0/": "/news/1.46.0/",
"/news/archied/1.47.0/": "/news/1.47.0/",
"/news/archied/1.47.1/": "/news/1.47.1/",
"/news/archied/1.47.2/": "/news/1.47.2/",
"/news/archied/1.47.3/": "/news/1.47.3/",
"/news/archied/1.48.0/": "/news/1.48.0/",
"/news/archied/1.48.1/": "/news/1.48.1/",
"/news/archied/1.49.0/": "/news/1.49.0/",
"/news/archied/1.49.1/": "/news/1.49.1/",
"/news/archied/1.49.2/": "/news/1.49.2/",
"/news/archied/1.49.3/": "/news/1.49.3/",
"/news/archied/1.49.4/": "/news/1.49.4/",
"/news/archied/1.5.0/": "/news/1.5.0/",
"/news/archied/1.50.0/": "/news/1.50.0/",
"/news/archied/1.50.1/": "/news/1.50.1/",
"/news/archied/1.51.0/": "/news/1.51.0/",
"/news/archied/1.51.1/": "/news/1.51.1/",
"/news/archied/1.52.0/": "/news/1.52.0/",
"/news/archied/1.53.0/": "/news/1.53.0/",
"/news/archied/1.54.0/": "/news/1.54.0/",
"/news/archied/1.54.1/": "/news/1.54.1/",
"/news/archied/1.54.2/": "/news/1.54.2/",
"/news/archied/1.54.3/": "/news/1.54.3/",
"/news/archied/1.55.0/": "/news/1.55.0/",
"/news/archied/1.56.0/": "/news/1.56.0/",
"/news/archied/1.57.0/": "/news/1.57.0/",
"/news/archied/1.58.0/": "/news/1.58.0/",
"/news/archied/1.58.1/": "/news/1.58.1/",
"/news/archied/1.59.0/": "/news/1.59.0/",
"/news/archied/1.6.0/": "/news/1.6.0/",
"/news/archied/1.60.0/": "/news/1.60.0/",
"/news/archied/1.61.0/": "/news/1.61.0/",
"/news/archied/1.7.0/": "/news/1.7.0/",
"/news/archied/1.8.0/": "/news/1.8.0/",
"/news/archied/1.9.0/": "/news/1.9.0/",
"/news/archied/1.9.1/": "/news/1.9.1/",
"/news/archied/1.9.10/": "/news/1.9.10/",
"/news/archied/1.9.11/": "/news/1.9.11/",
"/news/archied/1.9.2/": "/news/1.9.2/",
"/news/archied/1.9.3/": "/news/1.9.3/",
"/news/archied/1.9.4/": "/news/1.9.4/",
"/news/archied/1.9.5/": "/news/1.9.5/",
"/news/archied/1.9.6/": "/news/1.9.6/",
"/news/archied/1.9.7/": "/news/1.9.7/",
"/news/archied/1.9.8/": "/news/1.9.8/",
"/news/archied/1.9.9/": "/news/1.9.9/"
}
-537
View File
@@ -1,537 +0,0 @@
[
{
"version": "1.61.0",
"date": "2026-11-07",
"body": "### archied\n\n- A `workflow.handoff` now finishes its run and starts a separate, linked run of the next workflow on the same issue, instead of continuing as another attempt. The task page links each run to the one before and after it; attempts count only retries of one run.\n\n- A task no longer fails to prepare its worktree with \"some refs were not updated\" after a tag or branch moves on the forge.\n\n### archie-ui\n\n- The task page no longer flashes its loading state on every live update while a task runs.\n\n### archie-state-store\n\n- The extension catalogue lists and installs again. Its default signing key has changed; an instance that set its own catalogue signing key in Extension settings keeps using that key."
},
{
"version": "1.60.0",
"date": "2026-11-02",
"body": "### archied\n\n- Curators can list a repository's open issues and file new ones with the `issue_list` and `issue_create` tools, which reach the forge through the daemon. A curator files only when its definition declares `issue_create`; the shipped self-intake example runs in dry run with `issue_list` for deduplication. Listing every open issue needs the forge extensions from the archipelago release after 1.2.0."
},
{
"version": "1.59.0",
"date": "2026-11-02",
"body": "### archied\n\n- Forge extensions can open issues: the forge surface gains `CreateIssue` alongside list, comment and close, and the bundled Gitea and GitHub extensions implement it."
},
{
"version": "1.58.1",
"date": "2026-11-01",
"body": "### archied\n\n- The systemd watchdog now also watches the task intake loop, and its warning names the loop that stalled.\n- archied no longer restarts about a minute after it starts. Under systemd, the watchdog never saw a poll pass and killed it on every start since 1.56.0."
},
{
"version": "1.58.0",
"date": "2026-11-01",
"body": "### archied\n\n- Running `install.sh` over an install whose services are already running now restarts them, so they run the new binaries."
},
{
"version": "1.57.0",
"date": "2026-10-31",
"body": "### archied\n\n- A release reaches `stable` only after it has run on a canary for a day and passed: `archied release publish` now publishes to `next` alone, `archied release canary start|check` installs a release on a canary and judges it from the canary's dashboard, promoting it or rolling the canary back, and `archied release promote` moves `stable` by hand. Promotion refuses a prerelease and a release older than the one `stable` names. The `archied` and `archie-agent` images are published as `:v<version>`, and `:latest` moves only when a release is promoted."
},
{
"version": "1.56.0",
"date": "2026-10-31",
"body": "### archied\n\n- **Install once by hand.** Releases are now signed and published to `git.catlow.cloud/sam/archie`. A host on 1.55.0 or earlier still looks for releases on GitHub, so it finds this one only by running the new installer once: `curl -fsSL https://offloaded.dev/install.sh | bash`. Updates after that come from Settings → Status as before.\n- Releases are signed. Updates and `install.sh` refuse a release the release key did not sign, a zip that is not the one signed, and a channel moved back to an older release. Where releases and the extension catalogue come from is a setting (update settings and extension settings, or `[distribution]` in `config.toml` for a new instance), and `archied release keygen` and `archied release publish` publish signed releases to your own registry.\n- Organisations: forge connections, schedules, alerts, chat channels and audit are per organisation. A member acts in the organisation they select, the setup checklist follows it, and the instance's own forge is its root connection.\n- Workflows are edited as a draft and reach the running workflow only when published. Build a workflow with Archie from the canvas: chat writes the draft into the editor for review, and the editor locks while it does.\n- Schedules run from the State Store with run history, fire into their own organisation, and can trigger workflows. Daemon maintenance runs as built-in schedules.\n- A parked task links to the page that fixes its blocker (repository, credential, model or forge extension), and a parked task can be retried on the current workflow definition.\n- Shipped workflows run as a seeded agent identity with narrow grants instead of the root identity. Credential services are granted to dashboard identities from pickers, and personal API tokens have a name, a lifetime and a last-used time.\n- An org-scoped audit page with filters, a live tail, export and a retention setting; recorded access denials are kept for a set time and listed on their own page.\n- Instructions replace SOUL: instance, organisation, workflow and repository instructions are layered into every agent stage.\n- Chat docks at the bottom of every page and stays open across navigation. Tool calls show where they happened in a reply, with arguments (secrets masked) and durations, and `ask_questions` asks several questions at once.\n- Run more than one instance side by side: `ARCHIE_INSTANCE` names an instance, and the installer installs and updates a named one.\n- Pull request reviews submit REQUEST_CHANGES on blocking findings, list findings outside the diff in the review body, and repost without inline comments when the forge refuses their placement.\n- A workflow installs a repository's declared tooling before its gate, and tasks clone from a shared per-repository mirror.\n- Traces: services, model and tool calls and task containers export OpenTelemetry spans, and log lines carry the trace id.\n- Telegram runs as an archipelago channel extension, enabled from the Extensions page.\n- The Extensions page groups the marketplace by surface, is searchable, shows install state, and offers an update only when the catalogue has one.\n- The dashboard is rebuilt on shared components: a new Archie mark, a theme that follows the OS, task logs as a table, and layouts that fit a phone.\n\n### archie-agent\n\n- Released with archied 1.56.0; task containers export trace spans and install a repository's declared tooling before its gate."
},
{
"version": "1.55.0",
"date": "2026-10-16",
"body": "### archied\n\n- Personas are gone: the Personas settings page, the chat Personality selector and `/personality`. A selected persona never changed what the model was told; SOUL (Settings → SOUL) is the one place to set Archie's identity and style. Stored persona settings are deleted on upgrade.\n- The shipped SOUL describes Archie as the assistant for an event-driven automation system rather than a coding assistant. A SOUL you have saved is kept as it is."
},
{
"version": "1.54.3",
"date": "2026-10-16",
"body": "### archied\n\n- Chat can help write a workflow: it reads your workflows and the step catalog, writes a definition, and checks it the same way saving does, fixing what the check reports. It does not save; paste the YAML it gives you into the editor's YAML view and save there."
},
{
"version": "1.54.2",
"date": "2026-10-16",
"body": "### archied\n\n- Tool calls from Gemini models (Interactions API) receive their arguments intact. Any tool that takes arguments, such as `dashboard_navigate` in chat, failed with \"invalid character '{' after top-level value\".\n\n### archie-agent\n\n- Agent steps on Gemini models (Interactions API) pass tools their arguments intact instead of failing to decode them."
},
{
"version": "1.54.1",
"date": "2026-10-16",
"body": "### archied\n\n- Update checks, `archied update install` and `install.sh` find releases at `github.com/samcharles93/archie-releases`, so a host can update again. A host on 1.54.0 or earlier still looks in the old place and has to be upgraded to 1.54.1 by hand once."
},
{
"version": "1.54.0",
"date": "2026-10-16",
"body": "**Upgrade note:** services now authenticate each other with TLS certificates from your own CA instead of shared tokens. Before upgrading a host whose services listen on anything but loopback (any host running agent containers), issue a certificate per service (`archied`, `archie-gateway`, `archie-messaging`, `archie-state-store`, `archie-ui`, each with its name as the DNS SAN and both server and client auth), add `[tls] ca_file` and `cert_dir` to `config.toml`, and remove every `target_token`, the `*_TOKEN` service variables and the `--token`/`--*-token` flags, including archie-ui's `-token` and `-token-file`. A unit that still passes a removed flag fails to start. See `config.example.toml`.\n\n### archied\n\n- Services authenticate each other with mutual TLS. Each process presents `<cert_dir>/<service>.pem`, peers must chain to `ca_file`, and a caller is identified by its certificate rather than by what it claims. Renewed certificates are picked up without a restart. Without `[tls]`, services listen on and dial loopback only. The harness setup terminal requires `[tls]`.\n- Every gRPC service caps the streams a connection holds, times out stalled handshakes, releases a dead client's streams, and drains for at most 10 seconds on shutdown. Messaging exits when its listener fails instead of staying up without delivering.\n- The dashboard has user accounts. First run opens browser setup for the organisation, workspace and first administrator; people then sign in with a password, a passkey or your identity provider, and account administration lives under Access. The shared dashboard token is gone; reach the dashboard remotely through an HTTPS reverse proxy.\n- `archied update install` updates a host in one transaction: it verifies the release, stages every binary, pulls the agent image by digest and backs up the database, then restarts the services in order and rolls everything back if archied is not healthy for two minutes.\n- Each workflow runs as the identity it declares, checked on every attempt along with the identity that started it. A workflow that declares none is refused, a called workflow runs as its caller's declared identity, and shipped workflows run as the instance root.\n- Test-run a workflow draft before saving it, with forge and push writes suppressed and recorded per step. The History tab lists a workflow's revisions, diffs them as YAML and on the canvas, restores one into the editor, and shows which revision each run used.\n- Start a task from the dashboard. The dashboard home shows activity and setup, and a running task has a read-only Sandbox tab that follows its container.\n- The topbar's Jump to is a command palette, settings lists open as accordions that wait for a new item to be saved, and history restores land as a draft applied from the save bar.\n- Labels, hints, alerts and empty states say what is wrong and what to do, without tutorial or marketing prose.\n- Org isolation is tighter: harness secrets, identity writes, principals, playbook dispatch and model selections in chat stay in the caller's org, instance settings are written by the system org only, and creating a source or reloading a channel is authorized against the target.\n- Binding dispatch claims its capture and enqueues the task atomically, so a capture cannot start two runs, and the run-time workflow check sees the binding event's signature and address.\n- Service-unhealthy alerts count their grace from the last report and also cover a service that went silent, and a restart no longer clears an alert still inside its grace. An invalid stored access policy raises an alert until it validates.\n- A failed cancel of a called workflow no longer leaves the caller running, retention spares captures still waiting to be dispatched, and EDA playbooks load and report at start instead of on first dispatch.\n- Chat model selection works again for provider models.\n\n### archie-agent\n\n- Each run acts as its workflow's declared identity.\n- A task snapshot carries only the model limits its aliases resolve to.\n- A build step's \"no changes\" result comes from its writable stages and clears once a commit lands.\n- Test runs suppress forge and push writes and record what they would have done.\n- The default persona is a reporting-focused identity prompt, without the one-question limit in chat."
},
{
"version": "1.53.0",
"date": "2026-10-11",
"body": "### archied\n\n- Every organisation's data is its own. Chats, tasks, events, transitions, steps, tool calls, run statistics, event sources, event types, mappings, bindings and agent memory are read and written in the org that owns them, and a request can no longer write into another org. Rows written before orgs existed move to their owner's org on upgrade.\n- An instance admin decides what each org may reach: the models it can use, and whether it may register providers under its own credentials. Org Settings gains a Models tab and instance Models gains Org access. The system org is never restricted; another org uses nothing until it is granted.\n- Models are addressed by alias. Aliases replace model roles, one resolver serves every purpose (agent steps, implement, PR review, MCP sampling, chat, embedding, transcription), and an unknown alias fails instead of falling back to a default. The step editor and the chat picker offer aliases, and a workflow naming one that does not exist is refused when saved.\n- Chat sessions belong to one org; a chat resolves its models in the caller's org and is billed to it, and a task run from chat posts its outcome back to that chat.\n- Add a member by provider subject, or by email as a placeholder that the first sign-in the provider vouches for claims.\n- The workflow canvas authors parallel branches as lanes, adds a switch step that runs the case matching a reference, and edits a call's interface. A step shows its role, its number and its run trace.\n- The workflows list shows each workflow's running count and latest run result, the canvas reveals its data-edge handles on hover, and restoring a version asks for confirmation.\n- Store packages can auto-update: a package given the policy is moved to the catalogue's newest digest by a State Store ticker. An update asking for more authority than was accepted waits as a pending update with the running version untouched; approving it accepts the new authority, and a rollback restores the previous version with the authority accepted against it.\n- Model provider keys never enter an agent container: the runtime reaches its providers through the egress proxy, which holds the keys. A task's own credential can no longer replace the workflow definition its run is pinned to, and a package workflow's triggers, tools and forge calls are bounded by the authority accepted for the package.\n- The dashboard warns when it is reachable from off-host over plain HTTP, and the wildcard listen address counts as off-host rather than loopback. Instance health, logs, config and identities, the setup checklist and the skill catalogue are system-org only, and API requests are refused until the access chain has loaded.\n- `/approve` reaches Telegram; the router served it but nothing published it.\n- A worktree a killed container left root-owned is taken back by the daemon, and a PR review's benchmark runner works again on configured models and public PRs.\n- An unserved `/api` path returns 404 instead of the dashboard page, and an input group's select no longer loses clicks to its addon.\n\n### archie-agent\n\n- The runtime reaches model providers through the egress proxy, so provider keys stay out of the container.\n- Agent steps resolve model aliases and their own org's models and credentials, failing on an unknown alias instead of falling back.\n- A switch step runs the case matching its reference.\n- A call waiting on another step is reconciled from durable steps, so it resumes after a daemon restart rather than stranding."
},
{
"version": "1.52.0",
"date": "2026-10-09",
"body": "### archied\n\n- The harness page's setup terminal opens a real session: it starts an ephemeral container from a Kit profile, runs the CLI's own login and captures the OAuth tokens at the provider's token endpoint. Point the dashboard at the daemon with `[services.harness].target` and a `HARNESS_TOKEN` and it stops answering 503; the terminal is created at your browser's size. Takeover of a live task is not in this release.\n- A credential's token endpoint is refused when the run is not granted that service, instead of proxy-ing the provider's real tokens into the container.\n- Settings → Profiles, Credential bindings and Playbooks are editable from the dashboard, and curator definitions can be changed and applied without a restart.\n- Settings say whether each one applies live or needs a restart, show what is consuming resources, and report whether an apply landed.\n- Status shows each service's dependency checks, the agent workers and the broker.\n- The Logs page reads recent logs from every service, not just the daemon.\n- Captures and webhook sources are scoped to the org that owns them: the list, retention and delivery authorization all act in the right org, and a workflow definition resolves in its own org.\n- Chat settings are attributed to the signed-in user, and Settings → Tokens explains when a personal token cannot be created.\n- A channel enabled after Archie started works immediately; a channel that fails on its own recovers; a failed channel is no longer reported as enabled, and stored channel settings no longer save duplicate or unnormalized values.\n- The task table sorts, the command palette no longer scrolls sideways or loses its highlight, unknown routes render a not-found page, and configuration reload failures are shown instead of passing silently.\n- A scheduled job whose payload names a dangerous command is refused.\n- A disabled model provider is never served from the ambient API key.\n- `generate_video` is backed by ai-sdk's MiniMax video provider.\n- A dashboard token is no longer written to the startup log.\n\n### archie-agent\n\n- `workflow.call`: a call is keyed on its declared step path, its key is freed once the callee reaches a terminal state, and a caller waiting on a callee releases its capacity instead of holding it.\n- `command.run` honours step retry and `on_failure`.\n- A value passed between steps keeps its declared type, and optional result booleans are enforced only when the workflow declares them.\n- Capture tools have their results checked against the declared schema.\n- A single-cycle run waits for its in-flight tasks before exiting, and identity tasks inherit live settings.\n- Kit containers run Docker's init as PID 1, so orphaned processes are reaped instead of accumulating inside a long task."
},
{
"version": "1.51.1",
"date": "2026-10-08",
"body": "### archied\n\n- Chat with OpenAI's gpt-6 models (gpt-6-luna and the rest) works with tools; a turn failed with \"Function tools with reasoning_effort are not supported\"."
},
{
"version": "1.51.0",
"date": "2026-10-08",
"body": "### archied\n\n- A secret engine enabled after Archie started (Bitwarden, for example) now supplies its keys straight away; providers that depended on it no longer stay disabled until a restart.\n- The dashboard chat has a microphone button: record a voice message and it is transcribed like a Telegram voice note. It shows only when a `transcription` model role is set under Settings → Models.\n- A file Archie sends in the dashboard chat is a download link for an hour, instead of a note that it can't be delivered.\n- Typing `/model` or `/personality` on its own in the dashboard chat offers the choices as buttons."
},
{
"version": "1.50.1",
"date": "2026-10-08",
"body": "### archied\n\n- When an update is rolled back, the log names the health check that failed instead of only \"unhealthy\"."
},
{
"version": "1.50.0",
"date": "2026-10-08",
"body": "### archied\n\n- Tools that need your approval ask for it again, and Archie can ask you a question or offer choices mid-reply. Since the services were split these never reached Telegram or the dashboard: approval-gated tools failed and questions were never asked.\n- The dashboard chat shows approvals as Approve / Always this session / Deny, choices as buttons, and questions with a reply field.\n- `/update` in the dashboard chat lists what's available with Install and Not now.\n- Settings → Status → Versions installs the update it shows; its Install button sent an empty request."
},
{
"version": "1.49.4",
"date": "2026-10-07",
"body": "### archied\n\n- Settings → Status and Settings → Extensions are split into tabs instead of one long page; the Versions table's status column ends at the card's edge.\n- Tools & MCP has one \"Add MCP server\" button; the transport is chosen in the form, and an unnamed new server is not an unsaved change.\n- Settings → Repositories shows the add field when no repositories are configured, instead of a blank page.\n- The unsaved-changes bar always rests at the bottom of the window."
},
{
"version": "1.49.3",
"date": "2026-10-07",
"body": "### archied\n\n- Settings → Status → Versions shows the Gateway as \"Update available\" with an Install button when a newer release exists; it read \"Unknown\" with no way to install. The Runtime row stays \"Unknown\" until an agent task has run.\n- The release channel buttons sit at the Updates card's right edge instead of mid-row."
},
{
"version": "1.49.2",
"date": "2026-10-07",
"body": "### archied\n\n- Carries the 1.49.0 and 1.49.1 changes, whose builds were never published. The update check reads GitHub releases directly and still offers only releases with a verifiable linux-amd64 zip."
},
{
"version": "1.49.1",
"date": "2026-10-07",
"body": "### archied\n\n- When the dashboard session expires, the page returns to the sign-in screen instead of showing errors on every page until a manual refresh."
},
{
"version": "1.49.0",
"date": "2026-10-07",
"body": "### archied\n\n- Extensions that declare no egress hosts (vault, email, gitea) reach the network again; only packages that declare their hosts are confined to them. The Accept dialog shows \"network: unrestricted\" for the rest.\n- The update check finds releases itself, and reuses a found release for ten minutes so repeated checks stay under GitHub's rate limit."
},
{
"version": "1.48.1",
"date": "2026-10-07",
"body": "### archied\n\n- **Settings → Status → Updates** now chooses only the release channel (stable, prereleases, or a pinned version). Update checks and installs always run the `archie-update-*` scripts installed beside the binaries; the dashboard can no longer set the command that runs."
},
{
"version": "1.48.0",
"date": "2026-10-07",
"body": "### archied\n\n- **Settings → Status → Updates** edits the update check and install commands. They default to the `archie-update-*` scripts installed beside the binaries, so a zip install shows **Install** on the Versions card with nothing configured. The `update_check_command` and `update_install_command` keys under `[chat.telegram]` are no longer read; remove them from `config.toml`.\n- `archie-update-install` run from a shell now reads `~/.config/archie/env`, so the pre-update backup of the bundled database no longer fails with `no password supplied`. Run it with `--auto` to install the newest release."
},
{
"version": "1.47.3",
"date": "2026-10-07",
"body": "### archied\n\n- **Settings → Extensions**: **Accept** in the authority review now accepts the extension, and **Remove** removes it. Both previously closed the dialog without doing anything."
},
{
"version": "1.47.2",
"date": "2026-10-06",
"body": "### archied\n\n- **Events → Inspector** now lists your capture sources with their real URLs and a **New source** button, replacing the `/webhooks/capture/<source>` placeholder. Sources no longer sit on the Bindings tab."
},
{
"version": "1.47.1",
"date": "2026-10-06",
"body": "### archied\n\n- The bundled PostgreSQL has no network and publishes no port: the services reach it through its Unix socket under `~/.local/share/archie/postgres`, so it no longer collides with another PostgreSQL on 5432. Leaving the database question blank in `archied setup` selects it.\n- The installer does not start the services when the bundled PostgreSQL fails to start; it names the command to read its logs.\n- On hosts that restrict unprivileged user namespaces (Ubuntu 23.10+), the installer prints an AppArmor profile allowing them for the Archie binaries only."
},
{
"version": "1.47.0",
"date": "2026-10-06",
"body": "### archied\n\n- Install with one command: `curl -fsSL https://raw.githubusercontent.com/samcharles93/archie-core/main/install.sh | bash` downloads this release, verifies its checksum and runs `archied setup`. `--from-source` builds a checkout instead.\n- `archied setup` asks for the PostgreSQL URL. Left blank, it uses the bundled Compose database with a generated password stored in `~/.config/archie/env` as `PGPASSWORD`, not in `config.toml`.\n- The bundled PostgreSQL listens on 127.0.0.1 only. A database created before this release keeps its old `archie` password; enter its URL at setup or recreate the volume.\n- The release zip carries `docker-compose.yml`.\n- Extensions need unprivileged user namespaces, which Ubuntu 23.10 and later restrict. Allow them for the Archie binaries with an AppArmor profile; from the next release the installer prints it. Do not disable the restriction system-wide.\n- fix(app): assign the temp-file close result on the error path\n- fix(webhook): set a ReadHeaderTimeout on the forge webhook receivers\n- fix(forge): refuse a review line number that does not fit an int\n- fix(storepkg): mask the tar mode to the permission bits before narrowing\n- fix(webui): navigate the Events chain once, not twice\n- feat(tools): fail the gate when docs cite a path that no longer exists\n- fix(webhookguard): verify uppercase-hex HMAC signatures\n- fix(configuration): make bot_user required, defaulted, and named\n- feat(workflow): add the command.run step type\n- fix(controlplane): an absent MCP server field inherits the file value\n- fix(build): restore the go fix fixpoint, and give the formatter one owner\n- fix(archied): restore contextcheck directives and drop unused adapter\n- feat(secretengine): serve secret engines as go-plugin extensions\n- refactor(statestore): own package for the State Store service; access reset moves to archie-state-store\n- refactor(archied): gateway owns model work; daemon drops chat runtime, tools, memory and curators\n- refactor(archiegateway): own package for the Gateway service\n- fix(services): services wait for peers instead of exiting; restarted broker keeps its endpoint\n- refactor(archieplaybooks): fold archie-playbooks into archied playbooks lint|serve\n- refactor(agentrun): agent stage contract moves to the domain layer\n- refactor(agentexec): model loop moves to agentexec/modelloop\n- fix(configuration): bindings encryption keys must use the env engine\n- feat(storepkg): fetch packages from any registry, plain HTTP on loopback only\n- feat(webui): install, accept and enable extensions from the dashboard\n- feat(presence): every service re-stamps a presence record in the State Store\n- refactor(plugin): delete Yaegi daemon plugins and plugin_dir\n- refactor(module): the log action is built in; delete the module loader and reconciler\n- refactor(skill): delete Yaegi skill scripts and the run_go_script tool\n- refactor(examples): the firewall workflow moves to archipelago\n- feat(presence): services card on the status page and archied status\n- feat(archiemessaging): verify update reports against archied's presence and restore release announcements\n- fix(configuration): an overlay stands in for a missing config file; dev overlay is complete\n- feat(access): edit org, workspace and object policies from the dashboard; refuse owner lockout\n- feat(access): instance network rules at the capture receiver; policies reload without a restart\n- feat(staterpc): attribute State Store calls to the calling service; policy audit records it\n- feat(controlplane): playbooks and agent profiles install from packages; the daemon reads eda-playbooks live\n- feat(forgeext): forge surface served by extensions; forge.type names the installed package\n- refactor(forge): github and gitea leave core; webhooks parse in the forge extension\n- feat(staterpc): the State Store derives org and actor from the principal archie-ui forwards\n- feat(channelext): chat channels served by extensions; messaging runs the enabled ones\n- refactor(channels): webhook and email run only as extensions; their channel settings go\n- feat(skills): skill packages project into a skills resource the gateway reads live\n- fix(gatewayrpc): sender_id and rate_limited cross the chat wire\n- fix(controlplane): change history names kinds and reads only the caller's org\n- feat(contracts)!: requests no longer name their org; the State Store derives it from the caller\n- feat(identity): personal API tokens, created and revoked from the dashboard, act as their owner\n- fix(archieui): a sign-in provider outage is a health issue, not a startup failure\n- feat(staterpc): one run credential per task, kept in the State Store, authorizes its store calls and its push\n- fix(forgerpc): forge calls need the run credential and reach only the run's own repository\n- feat(controlplane): identity credential grants edited from the dashboard and applied live\n- feat(daemon): a workflow that names an identity runs asLine truncated
},
{
"version": "1.46.0",
"date": "2026-10-02",
"body": "### archied\n\n- feat(workflow): declared workflow outputs for wait:true callers\n- feat(prreview): the operator-approval gate is PRReview's own stage-list entry\n- feat(staterpc): carry the review gate and re-review rounds, with one guarded response write\n- feat(prreview): the gate records the review it holds and posts the operator's answer\n- feat(taskactions): one approval path answers the review gate from every surface\n- feat(webui): the dashboard answers the review gate, including a re-review's instructions\n- feat(daemon): resolve the producing identity's org before publishing work\n- feat(webui): block invalid settings and show a field's former value\n- fix(workflow): derive a declared output's captures need for profile selection\n- fix(storepkg): validate every declared authority grant at the package descriptor\n- feat(archied): refresh the model catalog at runtime\n- feat(mcp): answer server-initiated sampling from the chat model\n- feat(container): send registry auth on image pull\n- feat(messaging): retract ephemeral replies after their TTL\n- feat(messaging): transcribe Telegram voice notes\n- fix(egress): take a run's credential kind from its binding, not the Kit\n- feat(webui): a live-apply setting reads as applied, never as a restart\n- feat(webui): the dashboard reads harness bindings and opens the setup terminal\n- feat(gateway): list the harness page in the dashboard page registry\n- feat(webui): the harness settings page and its setup terminal\n- fix(workflow): park environment gate failures without dispatching a builder\n- feat(messaging): adapter-facing clarify, picker and approval contract\n- feat(gateway): gate admin slash commands by sender policy\n- feat(plugins): load plugin and secret-engine files without a restart\n- fix(workflow): deliver the feasibility PRD to the forge issue\n- fix(messaging): report the daemon version this process was built from\n- fix(messaging): carry an inbound attachment's bytes to the gateway turn\n- fix(daemon): resume a retry whose worktree is gone\n- fix(archied): omit the max-token bound on reasoning-class models\n- fix(logging): file a task log record under its own event time\n- fix(control-plane): unify validation for the domain-managed kinds\n- feat(webui): let the operator choose the retry worktree mode\n- feat(agent): seed a starter SOUL and upgrade only untouched templates\n- feat(controlplane): add the writable review-settings resource\n- fix(messaging): transcribe voice notes on the model-owning side of the boundary\n- fix(messaging): gate the boundary on config reads, not only package links\n- feat(messaging): restart only the channel whose settings changed\n- feat(container): apply container-runtime-policies live\n- feat(tools): reconcile MCP servers and tool settings live\n- feat(messaging): add a per-turn interactive carrier for clarify and picker\n- feat(gateway): offer ask_user when the turn's channel can carry a question\n- feat(telegram): carry clarify and picker through the text fallback\n- fix(webui): pin the dashboard validators to the control plane's\n- refactor(agent): drop the SOUL upgrade branch with no shipped template\n- feat(agentworker): answer MCP sampling from the task's model\n- fix(workflow): bind the remediate worktree before the builder runs\n- fix(config): carry max_retries into the worker TaskConfig snapshot\n- fix(agentworker): supply the guardrail engine to every task run\n\n### archie-agent\n\n- feat(workflow): declared workflow outputs for wait:true callers\n- feat(prreview): the operator-approval gate is PRReview's own stage-list entry\n- feat(staterpc): carry the review gate and re-review rounds, with one guarded response write\n- feat(prreview): the gate records the review it holds and posts the operator's answer\n- feat(taskactions): one approval path answers the review gate from every surface\n- fix(workflow): derive a declared output's captures need for profile selection\n- fix(storepkg): validate every declared authority grant at the package descriptor\n- feat(mcp): answer server-initiated sampling from the chat model\n- feat(container): send registry auth on image pull\n- feat(messaging): retract ephemeral replies after their TTL\n- feat(messaging): transcribe Telegram voice notes\n- fix(egress): take a run's credential kind from its binding, not the Kit\n- fix(workflow): park environment gate failures without dispatching a builder\n- feat(messaging): adapter-facing clarify, picker and approval contract\n- feat(plugins): load plugin and secret-engine files without a restart\n- fix(workflow): deliver the feasibility PRD to the forge issue\n- fix(messaging): carry an inbound attachment's bytes to the gateway turn\n- fix(daemon): resume a retry whose worktree is gone\n- fix(logging): file a task log record under its own event time\n- fix(control-plane): unify validation for the domain-managed kinds\n- feat(webui): let the operator choose the retry worktree mode\n- fix(messaging): transcribe Line truncated
},
{
"version": "1.45.0",
"date": "2026-09-30",
"body": "### archied\n\n- fix(eda): reject a result map missing a field or needing a conversion\n- feat(eda): per-org workflow enable/disable gating bindings\n- feat(telegram): carry inbound media through the chat turn\n- fix(prsource): use a CodeQL-recognised containment guard when extracting archives\n- feat(store): key control-plane resources by (org, kind)\n- fix(store): refuse resource keys the audit key cannot disambiguate\n- fix(daemon): resume the task branch before container acquisition\n- feat(webui): show attachment metadata in the session transcript\n- feat(webui): name a workflow's declared inputs on the work-request form\n- feat(controlplane): carry the caller org from the request principal\n- fix(webui): the workflow handlers act in the caller's org\n- feat(kitrun): render the OAuth credential file with sentinels\n- feat(store): record accepted package authority against the pin\n- fix(workflow): the own-PR flow no longer parks on the operator-approval gate\n- feat(gateway): a TTL-bounded dedup gate for redelivered platform messages\n- feat(egress): capture the OAuth scope set and carry it to the harness secret\n- feat(kitrun): render the OAuth scopes and omit an uncaptured primary key\n- feat(store): project installed package contributions into org resources\n- feat(gateway): coalesce rapid-fire text events into one turn\n- fix(config): expand plugin, module and skills dirs like every other operator path\n- fix(webui): drop the config schema's editability advert\n- feat(webui): events counts, YAML reading, log rows and dashboard filters\n\n### archie-agent\n\n- feat(eda): per-org workflow enable/disable gating bindings\n- feat(telegram): carry inbound media through the chat turn\n- fix(prsource): use a CodeQL-recognised containment guard when extracting archives\n- feat(store): key control-plane resources by (org, kind)\n- feat(controlplane): carry the caller org from the request principal\n- feat(kitrun): render the OAuth credential file with sentinels\n- feat(store): record accepted package authority against the pin\n- fix(workflow): the own-PR flow no longer parks on the operator-approval gate\n- feat(egress): capture the OAuth scope set and carry it to the harness secret\n- feat(kitrun): render the OAuth scopes and omit an uncaptured primary key\n- feat(store): project installed package contributions into org resources"
},
{
"version": "1.44.1",
"date": "2026-09-29",
"body": "### archied\n\nTwo fixes to tasks that could not get past their workflow definition.\n\n- **Approving a task no longer parks it again.** A task requeued under a\n different workflow kept the previous run's definition pinned, so the worker\n refused to compile the dispatch — it named `feasibility` while the row named\n `implement` — and the task parked immediately, identically on every further\n approval, which left `decline` as the only working operator action.\n The daemon now re-pins whenever the pinned definition's id disagrees with the\n task's workflow. A pin that is present, digest-valid and id-consistent is\n still a strict no-op, so an operator's own definition override survives a\n dispatch unchanged.\n- **A shipped workflow definition now reaches an existing install.** A stored\n seed was consulted only for a resource the store did not already hold, so a\n document that changed in the build never reached a database an earlier\n release had seeded. For workflow definitions that is a total outage rather\n than a stale setting: the collection validates as one document, so a stored\n step type this build no longer has failed every task's pin, whatever workflow\n the task named — and the documented recovery, removing the resource and\n restarting, wrote nothing either, because the store answered the seed's known\n request ID from a history that outlives the resource. A seed now refreshes a\n kind it wrote the newest revision of and re-creates a resource that is gone,\n while an operator's own replacement is never undone.\n\n### archie-agent\n\nThe runtime image is rebuilt with this release and links the shared workflow\npackage carrying the definition-id helper above. Hosts that run agent\ncontainers need `docker compose pull agent` after updating to pick it up."
},
{
"version": "1.44.0",
"date": "2026-09-29",
"body": "### archied\n\nArchie can now review pull requests.\n\n- **Reviews on request and by watch.** Ask in chat or on the dashboard work form, add a repository to the watch list, or just let archie review its own PRs before it opens them. Review intensity follows a depth dial (quick/standard/deep) classified from the size of the change, and every finished review passes a verification layer — coverage-gap and cross-finding consistency checks — before it is produced.\n- **No forge credential reaches the review sandbox.** The daemon prefetches the pull request's data and rebuilds its source snapshot over the forge's HTTP API, so the agent container works from an isolated copy with no read access to the repository's credentials.\n- **Reviews stop at the operator gate before posting.** `review.precision_gate` / `approve_before_post` decide whether a finished review posts itself or parks for operator approval. With this release the parked state is a stop sign, not a checkpoint: the approve/reject/re-review responses behind the gate are not wired yet, and the gate's settings are not yet editable in the dashboard (configure them in `config.toml`). A parked review sits until that follow-up lands.\n- The adversarial self-review pass archie previously ran before opening its own PRs is superseded by this pipeline and has been removed.\n- Hardened harness input handling: harness identifiers are bounded to integer types.\n\n### archie-agent\n\nThe runtime image is rebuilt with this release; it links the shared pr-review workflow packages behind the reviews above. Hosts that run agent containers need `docker compose pull agent` after updating to pick it up."
},
{
"version": "1.43.0",
"date": "2026-09-28",
"body": "### archied\n\n- **Organisations.** Tasks, identities and settings now belong to an org. An\n existing install is upgraded into a default org when the State Store first\n starts; the upgrade resumes if interrupted. Task de-duplication is scoped\n per org and identity.\n- **Access policies are enforced** at the dashboard, the API and task\n dispatch, with shipped roles and a rule that nothing crosses between orgs.\n Denials are recorded and reported on the health page. If a policy locks\n you out, `archied access reset --org <org>` (or `--instance`) on the State\n Store host restores the shipped defaults.\n- **Workflows can call workflows** with a `workflow.call` step. Inputs and\n call cycles are checked when the workflow is saved, and the caller waits\n on the callee's result.\n- **Runs record each step.** A run's stages and agent calls are stored as\n steps, the task detail page reads them, and stopping a task or archiving\n it goes through one cancel path. After a crash, steps left running are\n marked interrupted. Archiving a task removes its worktree.\n- **Model roles, repositories, scheduling policy, providers and agent\n profiles apply without a restart.**\n- **Kit harness profiles:**\n - `kit` is now one digest-pinned reference, a workload Kit or a published\n Kit set, not a list. **Rewrite `kit = [...]` in `config.toml` or the\n agent-profiles settings as the single reference**; a list no longer\n loads. Compose mixins by publishing a Kit set.\n - OAuth logins are handled on the host: the egress proxy refreshes tokens,\n stores them encrypted, and gives the container only placeholders.\n - A Kit's skills request mounts `skills_dir` read-only, and its\n instructions file (such as `CLAUDE.md`) is written beside the workspace,\n which is now `/archie/workspace`.\n - A run still cannot be granted the credential a Kit needs, so a Kit that\n requires one is refused at launch.\n- Rate-limited webhook deliveries get `429`.\n- `archie-gateway` and `archie-state-store` report ready to systemd.\n\n### archie-agent\n\n- Runs workflow calls, records its steps and agent calls, and runs Kit\n harness stages under the profile's Kit."
},
{
"version": "1.42.0",
"date": "2026-09-26",
"body": "### archied\n\n- **The dashboard is rebuilt on a new Graphite theme.** Settings moved to its\n own sidebar with one save flow across every page (Channels, Tools & MCP,\n Scheduling policy, Personas and Schedules, Identities, Plugins, Container\n runtime, and a History of past changes). The top bar, Dashboard, Workflows,\n task detail, the New task dialog and the Events page are all new: Dashboard\n leads with what needs you, a run's stage rail and detail panels sit\n side by side, Workflows shows per-workflow stats including completed runs,\n and Events states capture status with a copyable capture endpoint. Live\n updates share one stream and reopen after a drop instead of going quiet.\n- **Settings changes are audited.** A field-level audit table records who\n changed what, with a view on each settings page.\n- **A task can carry a whole-run wall-clock limit**, separate from a stage's\n own budget.\n- **A run that makes no changes now ends as completed and its worktree is\n cleaned up**, rather than left in a state Workflows didn't count.\n- **Abandoning a task no longer closes its forge issue.** Only the workflow's\n own terminal outcomes do that now.\n- **A task whose container exits before the worker replies is parked**\n instead of left running with no way to finish.\n- **A worktree still holding uncommitted work is kept**, rather than reset,\n when its task reaches a terminal state.\n- **A provider's stored settings no longer get corrupted with a process-local\n placeholder in place of your configured secret reference**, and archied\n rejects a stored value shaped like one on the way back in.\n- **Kit v3 harness profiles.** A `[containers.profiles.<name>]` entry can now\n name a Kit v3 image (`kit = [...]`, pinned by digest) instead of a plain\n container image, running the task's agent stages on an external CLI --\n Claude Code, Codex, Pi, OMP or GitHub Copilot CLI -- inside an isolated\n sandbox network. This release lands the daemon-side plumbing (egress\n proxy, sandbox network, credential injection points); it does not yet ship\n a way to grant a run's identity the credential a Kit needs, so a Kit\n requiring one is refused at launch until a later release adds it.\n- `task dev` now starts the State Store and waits for it before the rest of\n the stack.\n- Every service binary the installer builds is stamped with its version.\n\n### archie-agent\n\n- Carries the same task-lifecycle fixes as archied above (no-change runs,\n parking on an early container exit, and the abandon/forge-issue fix), plus\n the Kit v3 harness runner: a stage can now drive an external CLI\n headlessly, read output from Claude Code, Codex, Pi, OMP or GitHub Copilot\n CLI, and serve it capture tools over MCP.\n- Claude's cached tokens are counted as prompt tokens, matching the built-in\n agent loop's accounting."
},
{
"version": "1.41.2",
"date": "2026-09-25",
"body": "### archied\n\n- **`/update` no longer offers an old runtime.** The runtime has shipped under\n the release version since the version streams merged, but the update check\n still read the retired runtime tags, so a current host was offered runtime\n 1.35.0 as an update. Do not approve that offer on 1.41.1; update to 1.41.2\n instead.\n- **`/version` reports the runtime version.** Binaries from the release zip\n showed `Runtime: dev`."
},
{
"version": "1.41.1",
"date": "2026-09-25",
"body": "### archied\n\n- **First published build of 1.41.0.** The 1.41.0 tag produced no release\n artifacts; 1.41.1 carries everything listed under 1.41.0 below, including\n the PostgreSQL 18 requirement and the removed config keys."
},
{
"version": "1.41.0",
"date": "2026-09-25",
"body": "### archied\n\n- **Archie now stores everything in PostgreSQL 18, and `database_url` is\n required.** Tasks, events, captures, bindings, settings and chat\n conversations are served from the database `database_url` names; the State\n Store, archied and the Gateway refuse to start without it, and refuse a\n server older than PostgreSQL 18. `docker compose up -d postgres` starts a\n matching local database with the default URL in `config.example.toml`.\n- **Existing SQLite data is not carried over.** This release reads no SQLite\n file and ships no importer, so an upgraded install starts with empty task,\n event and conversation history. `db_path` is gone; `state_dir` (default\n `~/.local/share/archie`) now holds the embedded NATS store and task logs.\n- **Backups are whole-database snapshots.** `archie-state-store backup` and\n `restore` work on the PostgreSQL database through `pg_dump`/`pg_restore`,\n which must be on `PATH`. There is no automatic schema rollback: the way back\n from an upgrade is restoring the snapshot taken before it.\n- **Events carry a type, and bindings pick one.** Archie infers an event type\n from captured payloads; the Inspector shows proposed and unidentified\n events and lets you name them. Mappings are per event type and show how\n many captures they match, a source can feed several bindings, and a binding\n chooses an event type plus an optional filter. An unidentified event does\n not dispatch.\n- **Sources own webhook signing.** Each source gets a UUIDv7 path and its own\n signing secret, or can be explicitly approved to accept unsigned events. A\n new binding starts pending approval.\n- **EDA playbooks can run module actions and take workflow inputs.** Action\n playbooks run at most once per event through the dispatch ledger, a binding\n can pass inputs to its workflow, the repository is optional, and a workflow\n can name an agent profile. `archie-playbooks lint -eda-dir` checks a\n directory, and `archie-playbooks serve` publishes the same findings to your\n editor as a language server.\n- **Config keys removed.** `[agent]`, `[oidc]`, `[image]`,\n `containers.enabled`, `db_path`, and the `token_env` form of `[forge]`,\n `[artifacts]` and `[chat.telegram]` no longer exist. Write each credential as\n `token = { engine = \"env\", key = \"NAME\" }`. A leftover key is reported at\n startup as unrecognised rather than failing the load.\n- **Dashboard.** Old `#/path` links and the `/captures`, `/mappings` and\n `/bindings` addresses no longer redirect; use the Events page tabs. The live\n stream moved to `/api/stream`, so reloading `/events` serves the page.\n\n### archie-agent\n\n- The Postgres-backed wire formats, event types and workflow inputs are part\n of this image; a host that runs the agent should `docker compose pull agent`\n to pick it up."
},
{
"version": "1.40.0",
"date": "2026-09-23",
"body": "### archied\n\n- **Every park now says what kind of intervention it needs.** A parked task\n is classified as `needs you` (a decision or fix only an operator can\n supply), `transient` (an environment problem -- container pool, storage,\n transport -- retry once it is fixed), or `terminal` (the repository or\n identity cannot act; retrying cannot succeed). The class shows beside the\n Parked badge on the dashboard, so \"needs you\" reads as a request rather\n than a failure.\n- **Operator retries and review-remediation rounds now have separate\n budgets.** An operator's manual retries no longer draw down the rounds\n Archie may spend addressing review feedback on its pull requests, and a\n round-cap park no longer makes a later retry re-park immediately.\n- **`latest` now names the newest release. A push to `main` that is not a\n release publishes `edge` and `sha-<commit>` instead. A host that was\n following `main` by pulling `latest` stops advancing at this release --\n switch it to `edge` to keep tracking `main`, or leave it on `latest` to\n follow releases.**\n\n### archie-agent\n\n- The park-classification wire format is part of this image; a host that\n runs the agent should `docker compose pull agent` to pick it up."
},
{
"version": "1.39.0",
"date": "2026-09-23",
"body": "### archied\n\n- **Archie now acts on review comments left on its own pull requests.** A\n requested-changes review (or a standalone comment) on a PR Archie opened\n dispatches a remediation run: the smallest change that satisfies the\n feedback, committed to the same PR branch and answered in the review\n thread. Approved reviews never remediate, each reaction is its own round,\n and the exchange is bounded by the repo's `max_retries` before Archie stops\n and says so on the PR.\n- **The task run page is a master-detail view.** The run's stage rail and\n detail panels sit beside the run list, so one run's timeline is visible\n without leaving the page.\n- **Live activity groups related updates instead of stacking them by event\n kind**, so a burst of progress on one task reads as one story, and the\n stage filter resets when you switch attempts.\n- Contrast fixes on the info and subtle text tokens clear WCAG AA.\n\n### archie-agent\n\n- The review-reaction remediation path is part of this image; a host that\n runs the agent should `docker compose pull agent` to pick it up."
},
{
"version": "1.38.0",
"date": "2026-09-23",
"body": "### archied — Event capture, mappings and bindings are PocketBase records\n\n- **Captured events, field mappings and playbook bindings live in PocketBase\n collections instead of SQLite tables.** They are ordinary records, which is\n what lets a binding be changed at runtime rather than by editing a database.\n- **A read-only operator surface over the task database ships with the State\n Store** (`archie-state-store -admin-addr`). It serves view collections over\n tasks, transitions, events, identities and resources, and refuses\n `/api/backups` and `POST /api/sql`, so it cannot rewrite state or hand out the\n database file.\n- **A binding cannot go live without approval.** It moves draft → pending\n approval → armed; one binding per source is enforced on insert, on edit and\n on approval; and an edit always returns it to pending approval. A secret left\n blank on an edit keeps the stored one rather than disarming a live binding.\n- **The workspace code-search indexer is gone.** No deployment configured it,\n and it was one more resident writer over the workspace.\n\n### archied — Editing a binding or a mapping shows on the activity stream\n\n- **A dashboard edit no longer needs a manual refresh.** A successful binding or\n mapping write announces itself on the same activity path a captured event\n already uses. The announcement carries the record id and the action and the\n dashboard refetches the record, so the signal cannot go stale.\n\n### archied — Cron schedules fire\n\n- **A cron job computes its next run and fires.** Until this release a cron\n schedule was accepted at creation and then refused at run time with\n `ErrScheduleUnsupported`, so a cron job never ran.\n- **The dialect is PocketBase's, and it differs from Vixie cron on one point.**\n Day-of-month and day-of-week are combined with AND rather than Vixie's OR, so\n `0 0 1 * 1` means Monday the 1st, not \"the 1st, or any Monday\". The\n `@daily`-style macros behave as usual. An expression that can never match,\n such as `0 0 30 2 *`, is rejected instead of being left to run forever.\n\n### archied — Tool calls are queryable\n\n- **Every completed tool call is a row in the `tool_calls` collection**, not\n only a line in the on-disk task log. The row carries the task, the attempt,\n the tool, its result or its error, and when it ran.\n- **A failed projection never fails the task.** The event is the record and the\n collection is a transcript of it, so a copy that could not be written is\n logged and counted rather than propagated.\n\n### archied — A task whose identity no longer resolves parks instead of acting as root\n\n- **A task naming an identity archie no longer knows — renamed, retired or\n removed in the control plane — no longer falls back to the root forge's\n credential.** It parks with the reason recorded. A task arriving over NATS\n with such an identity is refused before it is enqueued. A task with no\n identity is the single-identity root path and is unchanged.\n\n### archied — The PR review is published as a readable artifact\n\n- **A completed review is rendered to markdown and published to the\n collaborative editor**, so a person reads it and comments on it instead of\n reading a wall of text in a pull-request comment.\n- **Publishing never fails the review.** With `[artifacts] base_url` unset the\n sender is not constructed and publishing is a log line; a publish that fails\n is logged with its status and the same review is republished the next time it\n completes. Set `[artifacts] token` (or `WORKSPACE_INGEST_TOKEN`) to enable it.\n\n### archied — The activity feed no longer depends on row ids being monotonic\n\n- **The feed's resume cursor is opaque, and a malformed or pre-upgrade cursor\n degrades to \"from the beginning\" rather than failing the stream.** One\n consequence on upgrade: a browser holding a cursor issued before this release\n replays the backlog once.\n\n### archie-agent\n\n- **The runtime image is rebuilt by this release, and a host must pull it**\n (`docker compose pull agent`). The shared State Store contract changed shape\n in the sections above — task and event-capture id fields are strings now — and\n the two halves are versioned together, so an agent image built before this\n release does not speak to the new State Store. There are no agent behaviour\n changes of its own in this release."
},
{
"version": "1.37.1",
"date": "2026-09-22",
"body": "### archied — A recorded event names the actor in its own fields\n\n- **Event attribution survives the trip to the State Store.** The acting\n identity, its kind, and the authorising principal are carried on the event\n itself, so an audit query finds the actor in its own fields rather than only in\n the event's prose. An approval taken through the dashboard is the case that\n exposed the gap.\n\n### archied — A chat reply that contains code renders the way it was written\n\n- **A code fence closes only on a run of the same character that is at least as\n long as the one that opened it.** A four-backtick fence, a tilde fence, or a\n reply that wraps its own code in a longer fence now arrives as code instead of\n as a broken language tag or paragraphs of leaked text.\n\n### archied — A tool call is one line with its own icon\n\n- **A tool call takes a single line instead of a label plus a fenced block.**\n Telegram draws a fenced block as a full code widget — language header, copy\n button and panel — and the block parser inserts a spacer before it, so a\n handful of calls filled the screen to show a few word counts. Each call now\n shows the icon its own tool declares, and a tool that declares none renders\n without one.\n- **The status word prints only when the outcome is not success.** Every tool\n line previously read \"done\", including the ones that had not finished.\n\n### archied — Runtime dependencies updated\n\n- **Runtime dependencies updated**, including the OpenID Connect and OAuth\n libraries."
},
{
"version": "1.37.0",
"date": "2026-09-22",
"body": "### archied — A request is attributed to the identity that made it\n\n- **A browser can sign in, and an action taken through it records the person.** The dashboard validates a\n provider-issued token, resolves it to an identity, and attaches it to the request; the task-action record\n then names the actor. `Authenticate` and the sign-in callback share one resolver, so a browser sign-in\n cannot be accepted on terms a presented token would be refused on.\n- **archie issues no session.** The callback stores the provider's own token in an HttpOnly cookie and every\n later request re-verifies it, so nothing archie holds can outlive the provider's decision and there is no\n session table to expire, revoke or get wrong.\n- **The event kind describes the actor.** A person's approval records `human_approved` as that person; an\n agent's records `agent_approved`; an action with no authorising principal records `task_approved` with the\n attribution fields **empty**. Nothing is credited to an identity that did not act, and an unattributed\n action is recorded as unattributed rather than guessed.\n- The acting identity is derived from the presented credential and **never** from a request field: a body\n carrying `actor`, `actor_id`, `identity` and an `X-Archie-Actor` header still cannot choose it.\n\n### archied — A host install now works, and an update refuses a host it cannot keep consistent\n\n- `install.sh` writes and enables **all five** host units; previously it seeded only `archied.service`, so a\n fresh host ran one service of five and an operator applied the rest by hand from a runbook. The runbook is\n a description again: it names the units and points at `systemctl --user cat`.\n- **Every host binary reports its version**, and the updater reads all of them **before it can report\n \"nothing to install\"**. A host whose binaries disagree is refused, naming each one: a newer messaging\n binary beside an older state store crash-loops against a service the older store does not serve, and that\n install previously looked healthy from the updater's point of view.\n- The packaged, installer and updater command lists are pinned by a test, so a service added to one and not\n the others fails the gate instead of shipping a partial install.\n\n### archied — A release image can be traced to a commit\n\n- The publish step derives the commit by **dereferencing the ref** rather than reading `github.sha`, because\n every release tag in this repository is annotated and a tag's object id is not a commit. An immutable\n `sha-<commit>` tag is published alongside `:latest`, and a build with no release tag is stamped\n `dev+<short sha>` rather than a bare `dev` that identified nothing.\n\n### archied — Curator definitions are data, not a second registry\n\n- Curator definitions may come from configuration or code and run through **one** engine into the existing\n registry — no parallel authority and no second config reader. A definition declares its tools, and an\n unknown tool name fails rather than widening the set silently."
},
{
"version": "1.36.0",
"date": "2026-09-22",
"body": "### archied — The dashboard declares tools an in-browser agent can call\n\n- The dashboard registers **seven WebMCP tools**. Read-only: `list_tasks`, `get_task`,\n `recent_events`, `daemon_health`. Recovery: `retry_task`, `stop_task`, `cancel_task`. An agent\n operating the dashboard now reads structured state and recovers stuck work instead of scraping the\n UI.\n- Every tool wraps the same `ui/src/lib/api.ts` client the dashboard itself calls, so an agent and a\n person exercise one path rather than two.\n- `archie-ui` cannot be attributed to the agent that called it: a page can invoke its own tools, so an\n agent's call and a page script's call reach the server identically. Tools therefore record the\n signed-in identity and a source, and **never** that an agent acted.\n\n### archied — Binaries built by the development build task can be updated\n\n- `task build` passed the `installtype` stamp for three of six commands, so `archie-messaging`,\n `archie-state-store` and `archie-ui` were built without it. An unstamped binary reports `unknown`\n and the self-update path **refuses rather than guesses**, which is how an operator ends up unable to\n update with `install type is unknown` and no way forward. All six are stamped now, and a test reads\n the build task and fails naming any command line that omits it."
},
{
"version": "1.35.0",
"date": "2026-09-22",
"body": "### archied — The Messaging Service is severed from the store and workflow runtime\n\n- `cmd/archie-messaging` no longer links `modernc.org/sqlite`, `internal/store`,\n `internal/domain/workflow` or `internal/agentexec`. All four arrived through a single import of\n `internal/app/controlplane`; the client half now lives in\n `internal/infrastructure/controlplanerpc`, and the app package keeps the server, the registry, the\n seeds, the validators and the schema derivation.\n- The resource documents are type-aliased back into the app package, so there is one definition read\n under two names rather than a copy per side.\n\n### archied — Channel lifecycle reaches the dashboard\n\n- The Messaging Service reports each channel's state, recorded **per channel**: one channel's failure\n marks only itself, a channel that cannot start is marked failed **with its reason** rather than only\n logged, and one that returns is marked stopped. `internal/channels/status.Manager` reports each channel's state.\n- `PutChannelStatus`/`ListChannelStatus` carry that to the dashboard, following the config-snapshot\n split. The store **replaces the reported set**, so a channel the reporter stops mentioning is\n deleted rather than left as a stale `running`; an empty report clears the table, because hosting no\n channels is a fact worth reporting; and an id-less row is refused, since it could never be replaced\n or removed by a later report.\n- `Service.ReloadChannel` routes to the channel's own seam and refuses a channel that cannot reload\n with a reason rather than accepting and ignoring it. `ReloadSupported` was previously declared **by\n name**, so a channel could advertise reload with nothing behind it; one function now decides both.\n\n### archied — Action playbooks: a second playbook shape, with typed results\n\n- A playbook is now one of two shapes: a **workflow playbook** (exactly one `workflow` action,\n unchanged) or an **action playbook** (one or more `module` actions in order). A playbook does not\n mix them.\n- `args` and `when` share one compilation path and one evaluation context, and `actions.<id>` is typed\n by the kind that action runs, so a misspelled result field, an unknown id, a map index, `in`, a\n comprehension, or a shape-foreign key (`kind` on a `workflow` action, `workflow` on a `module`\n action) is a **load failure** rather than a dispatch failure.\n- **Action playbooks load but do not run yet.** Routing arrives with the first side-effecting\n position; the daemon warns at load rather than accepting them silently.\n- The CEL environment is built per playbook, because result typing depends on the ids a playbook\n declares.\n- `ModuleRegistry.DecodeResult` turns a kind's flat map result into its typed `Result` before a later\n expression reads it. Without it a typed read evaluated against a shape the run never produces, and\n so silently read null.\n\n### archie-agent\n\nThe sandboxed runtime links the same shared packages as archied, so this release carries the\nchannel-lifecycle store contract and the stricter action-load errors with it:\n\n- The channel-status store contract (`PutChannelStatus`/`ListChannelStatus`) and its replace-the-set\n semantics.\n- Authoritative module ids and stricter action load errors: a misspelled result field, an unknown id,\n or a dynamic `actions` read now fails the playbook load rather than the dispatch.\n\narchied and archie-agent move together in this release."
},
{
"version": "1.34.0",
"date": "2026-09-22",
"body": "### archied — Dashboard: an actionable authentication failure state\n\n- An unauthenticated **document** request now receives a self-contained HTML page with a\n paste-the-token form, instead of plain text. Previously the whole dashboard -- `index.html`, the\n bundle and every asset -- sat behind the token check, so a bookmarked bare URL returned a\n `text/plain` \"unauthorised: open the dashboard URL archied logged at startup\", the SPA never ran,\n and none of the dashboard's existing failure surfaces were reachable at all.\n- The response is still **401**, with `Cache-Control: no-store` and a CSP. It is deliberately not a\n 200: a login page served as success would be cacheable, would read as healthy to anything that\n checks status alone, and a shared cache could hand it to the wrong person.\n- API and stream callers are unaffected. `application/json`, `*/*` and `text/event-stream` requests\n keep the plain-text 401, with a test pinning that split so an XHR or an `EventSource` reconnect can\n never start receiving a page.\n- The auth banner gains a **Retry** action that re-runs the dashboard's bootstrap reads, so a\n recovered session is actionable without a browser-level reload. It deliberately does not re-drive\n the SSE stream, which already reports its own reconnect state.\n- The page's guidance stays generic: it points at the dashboard URL the daemon logs rather than\n naming where the token is stored, so the HTTP layer is not coupled to the token file's location."
},
{
"version": "1.33.0",
"date": "2026-09-22",
"body": "### archied — EDA: playbook action arguments are compiled at load (J2)\n\n- A playbook action may now declare `args`, compiled as CEL expressions when the playbook loads.\n `args` and `when` share one compilation path and one evaluation context, so an expression written\n for one works in the other.\n- **Behaviour change:** an `args` expression that does not compile is a **load failure**, not a\n runtime miss — the same reject-at-load rule already applied to a binding collision and to an\n unknown `actions.<id>`. In practice, a daemon loading a playbook with a malformed `args` block\n fails at startup rather than part-way through a dispatch.\n- Compiling several arguments now reports the **first** bad key deterministically (keys are sorted).\n Previously it ranged a map, so the reported bad key could differ between runs and the failure was\n not reproducible.\n- `args` is deliberately **inert** for now: parsed, compiled and stored, but no shipped position\n consumes it yet. A consumer arrives with the first side-effecting position.\n\n**Not yet decided:** how an `args` evaluation failure behaves at dispatch. The `when` predicate rule\n(error, skip, log) does not obviously transfer, because `args` is data rather than a predicate, and\nsilently skipping an action whose arguments failed to evaluate would be a silent failure of exactly\nthe kind this release train has been removing. It currently propagates the error to the caller, and\nthat asymmetry is documented at the code. Ratifying it against a real consumer is tracked separately."
},
{
"version": "1.32.1",
"date": "2026-09-22",
"body": "### archied — Host packaging: `archie-messaging` now ships and updates\n\n- `cmd/archie-messaging` is included in the distribution zip, and `scripts/archie-update-install`\n installs and restarts it.\n- **Why this mattered.** v1.30.0 moved Telegram, email and webhook out of `archied` and into\n `archie-messaging`, but nothing packaged the new binary. A host install that upgraded across\n v1.30.0 therefore ran on with **no messaging process at all**: `archied` logged that it stopped\n serving the telegram gateway, nothing replaced it, and Telegram stayed dead — with no error\n logged anywhere, because nothing was failing. The process simply did not exist.\n- The host component set was enumerated in four places — the zip's build loop, the zip's copy list,\n the installer's service list, and the installer's binary list — and `archie-messaging` was missing\n from all four. The duplication was the defect: a single test now derives the host-run commands\n from `cmd/` and asserts that all four lists agree with it, so adding or extracting a process fails\n until it is packaged.\n- `deployments/systemd-user-service.md` gains the messaging unit. That is load-bearing rather than\n cosmetic: the updater refuses an update when a service unit is missing and tells the operator to\n create one from that document, which previously had nothing to offer.\n\n**Upgrade note:** a host that reached v1.30.0 without a messaging unit has been running with no\nTelegram, email or webhook. Updating to this release installs and starts `archie-messaging`."
},
{
"version": "1.32.0",
"date": "2026-09-22",
"body": "### archied — EDA: playbook action ids, and a dispatch idempotency ledger\n\n- **Action ids (J1).** Every action a later action references must now carry an `id`. Ids are\n validated at load -- unique and stable-identifier-shaped -- and a `when`/`args` expression\n naming an unknown `actions.<id>` is a **load failure**, not a runtime miss, the same\n reject-at-load rule already applied to a binding collision.\n- **Reference classification is strict at load.** A map-index reference (`actions[expr]`), a\n non-literal index, and a reference to an unknown prior id are all rejected when the playbook\n loads; references are classified by identifier versus static access, and the when-compilation\n helper is shared between the load-time and runtime paths.\n- **Dispatch idempotency ledger.** A `playbook_dispatches` row records a dispatch against\n `(playbook_id, playbook_version, event_id, action_id)`, written with `INSERT OR IGNORE` and\n surfaced through the shared `store.ErrAlreadyDispatched` sentinel. Module, channel and forge\n action positions are therefore at-most-once, which is what unblocks the side-effecting\n positions that were previously rejected at load.\n- **The ledger is wired into production.** `stateStoreDeps` constructs `Deps.PlaybookDispatcher`,\n so the ledger RPCs no longer answer `Unavailable` in a running daemon. This defect was found\n by the pre-release review of this change rather than by its tests.\n\n**Behaviour change:** a playbook whose actions reference `actions.<id>` without declaring that\nid, declare a duplicate id, or index `actions` with a non-literal value now fails to load\ninstead of failing at dispatch time.\n\n### archie-agent\n\nThe sandboxed runtime links `storecontract` and `staterpc`, so it carries the dispatch-ledger\ncontract alongside archied:\n\n- The shared `store.ErrAlreadyDispatched` sentinel now describes both dedup ledgers --\n `binding_dispatches` per `(binding_id, capture_id)`, and `playbook_dispatches` per\n `(playbook_id, playbook_version, event_id, action_id)`. Each is an at-most-once guarantee.\n- `RecordPlaybookDispatch` is part of the store contract the runtime builds against.\n\narchied and archie-agent move together in this release."
},
{
"version": "1.31.0",
"date": "2026-09-22",
"body": "### archied — Dashboard replaced: Preact -> Vue 3 + shadcn-vue\n\nThe dashboard is now a Vue 3 application built on shadcn-vue. This is the\nlarge piece of this release; it touches every page.\n\n- History routing, a grouped topbar built from components, the violet palette\n with self-hosted Geist, and a command palette with live tasks.\n- Chat is a FAB-opened panel that behaves like a chat window and scrolls its\n transcript with `MessageScroller`.\n- Task actions and dangerous approvals are deliberate; the task detail page is\n a single head strip with honest states; the run page settles its head around\n an attempts pager, which is hidden for zero or one attempt.\n- Appearance and System navigation were refined, with a four-column appearance\n grid on wide screens.\n- A copy pass removed redundant tails and restating descriptions, empty states\n derive their own titles, and a stuck log read surfaces as an error rather\n than eternal loading.\n- The capture pane is bound to the list it sits beside and reads beside it,\n not over it.\n\n### archied — Events is one page with three tabs\n\n- Inspector, Bindings and Mappings are now tabs of a single **Events** page.\n- The nav entry is always live, the tabs prune by capability, and the three old\n paths survive as bookmarks that redirect to their tab.\n- Tab selection lives in one module (`ui/src/events/tab-selection.ts`) that the\n page uses, rather than a copy of it.\n- `feat(tools)`: a capture-intake sender exists for exercising the Events\n surfaces.\n\n### archied — The channel travels with the message\n\n`SessionSource.Platform` -- the first component of the session natural key, and\nthe column `GetByChannel` filters on -- was a constant `\"web\"`, because one\nRouter serves every channel and named itself after its own. Two things followed:\nthe per-user identity policy was real code that no production call site reached\nwith a real channel name, and a curator pass's write to agent-user memory could\nnot be read back by the turn that wrote it, because that turn resolved no\n`UserID`.\n\n- The frontends now name the channel they carry (`telegram`, `email`,\n `webhook`, `web`), the channel rides the message, and the Gateway stamps the\n session from it -- falling back to its own name when a sender names none,\n which is what every existing row holds.\n- Identity resolution reads the platform off the inbound, so `carriesPersonIdentity`\n decides something in production: telegram and email resolve a person, the\n dashboard and a webhook resolve nothing, and an unknown platform fails closed.\n- **Behaviour change:** a chat whose active session came from `/new` or\n `/branch` re-resolves once, because session lookup now filters on the\n channel's real name. A chat without `/new` re-resolves onto the same\n deterministic id and heals silently.\n- Deliberately unchanged: `TurnRunnerConfig.Channel` still keys tool\n availability, so no channel gains or loses a tool in this release.\n\n### archied — Control plane: runtime administration, history, and derived schemas\n\n- The State Store's gRPC server now carries runtime administration, and each\n process reports which settings version it is running; the dashboard shows it.\n- Resource history is exposed so edits can be reviewed and rolled back, and\n resource schemas are derived from the documents they describe -- the document\n editor reads the derived schema (labels from `title`, `format: duration` ->\n `1m0s`, hints from `doc`), and the abandoned schema-driven card is deleted.\n- A live settings replacement is checked before it is switched to, the daemon's\n state surfaces are folded into one boot step, and a SIGHUP reload re-applies\n database-owned settings.\n- Forge intake settings that nothing reads are now rejected at load.\n\n### archied — Configuration: judged where it is owned\n\n- The runtime config overlay is deleted; database-owned settings are judged at\n the layer that owns them rather than on the file load path.\n- A file overlay no longer drops the fields it omits inside a map entry, and a\n kind with no stored value leaves the file's value in force.\n- The default config path is resolved in one place, and the channel document\n has its own shape.\n\n### archied — State Store: offline backup, restore, validate and rollback\n\n- New offline backup / restore / validate / rollback path.\n- `validate` runs boot's own gate; it no longer replaces the database, reads a\n kind the store does not hold as its seed, or touches the daemon's log.\n- The recovery control-plane server is built on the shared step vocabulary.\n\n### archied — Workflow: one step vocabulary and a `gate.diff-rules` replacement\n\n- The step vocabulary is owned by a family manager registered at each\n composition root, replacing `.archie/gate.go` with `gate.diff-rules`, which\n fails closed on a change it never read.\n- Workflow roots are pinned and the dead vocabulary is rLine truncated
},
{
"version": "1.30.0",
"date": "2026-09-20",
"body": "### archied — Messaging Service extraction completed\n\nTelegram, email and webhook no longer run inside the daemon. They run in\n`archie-messaging` and reach the daemon through the Gateway's `ChatContract`\nover gRPC; the daemon builds no channel and no `gateway.Router` (#899).\n\n- The operator surface is re-wired in the extracted service: `/update` (built\n from its own `[chat.telegram]` commands), the update-report relay, the\n `show_tool_calls` projection, and `/restart`'s config reload, which\n re-resolves the token and allowlist from this service's own file and refuses\n a reload that resolves to an empty token.\n- `/version` is sourced from the Gateway through a new `ChatSnapshot.Version`\n field. `cmd/archie-messaging` deliberately takes no version ldflags, so it\n cannot report a partial upgrade as a matched one.\n- Channel configuration is validated at composition, so a configured-but-\n invalid front-end fails the service instead of being silently dropped.\n- The inbound rate limiter moves to the Gateway, which now owns the only\n Router and is therefore the one place a per-sender budget can apply to every\n channel's turns.\n\n`RunningVersions` and `ReleaseAnnouncements` are deliberately left unwired:\nboth need a component's real running version, and the only versions this\nprocess can obtain are another binary's stamps. See\n`docs/architecture/migration-decisions.md`.\n\n### archied — Configuration\n\n- `diff_cap_lines = 0` now switches the cap off, as the dashboard and the\n workflow step have always documented. It was a plain `int`, so the defaults\n pass could not tell an absent key from an explicit `0` and rewrote both to\n 400 -- the documented way to disable the cap was unreachable. **Behaviour\n change:** a config that set `0` was silently getting 400 and will now get no\n cap.\n- The same ambiguity was failing open per identity: `configForIdentity`\n assigned the identity's value unconditionally, so an identity that merely\n omitted `diff_cap_lines` overwrote the shared cap with the zero value and\n disabled the safety rail entirely. An identity now overrides only when it\n sets the key.\n- A diff-cap park no longer tells the operator to \"approve manually\". A parked\n task's actions are retry, abandon and reject, so there is no approve path out\n of diff-cap; it now names the two things that work.\n- `[health].dependency_timeout` makes the daemon's readiness probe timeout\n configurable, matching the extracted services.\n\n### archied — Chat rendering\n\n- `/status` and `/tasks` are line-oriented reports but separated lines with a\n plain newline, which is CommonMark's soft wrap: the Telegram renderer joined\n them into one run-on paragraph. The renderer implements CommonMark's hard\n line break and the reports use it. Ordinary prose still soft-wraps.\n- A park reason is capped to its first line in the `/tasks` list. It carries\n whatever the failing stage reported, which for a lint gate is a whole tool\n log; unbounded, one parked task pushed every other task out of the reply. The\n full reason is unchanged on the task, in `task_list` and on the dashboard.\n\n### archied — Review\n\n- Review findings are posted as line-anchored PR comments with suggested fixes,\n and a suggestion must be single-line -- GitHub applies a multi-line suggestion\n only up to its first line, silently corrupting the file (#891).\n- The remediate workflow handles PR review comments and requested changes.\n\n### archied — /status health surface\n\n`/status` reports the live broker connection and the last-known outcome of this\nprocess's chat-model calls, alongside the queue depth and runtime block (#892).\n\n- A provider error is flattened and capped, so a multiline or oversized error\n cannot break the one-line-per-fact layout.\n- Concurrent model calls no longer reorder: the completion time is taken before\n the lock, so the newer outcome wins rather than whichever goroutine stored\n last.\n- Curator model calls are recorded too. They bypass the chat path, so a daemon\n whose only recent model traffic was curator work reported \"no calls attempted\n yet\" while the provider was demonstrably reachable.\n- Title generation does not record health. It runs detached under its own\n bound and its error is swallowed, so a cosmetic timeout was overwriting the\n line with \"failed\".\n\n**Known limitation:** the container, poll and channel sections cannot render.\nThose facts live in the daemon, but the only Router lives in the Gateway\nprocess, which has no container pool and no poll loop. The command description\nsays what actually appears; restoring the rest needs a cross-process health\ncontract.\n\n### archied — Dashboard and containers\n\n- The served lifecycle vocabulary reaches an already-painted page, the page\n registry matches the routes, and the build verifies `ui/dist` is fresh\n instead of never looking at it (#890, #898).\n- The containLine truncated
},
{
"version": "1.29.0",
"date": "2026-09-19",
"body": "### archied — Security\n\n- `google.golang.org/grpc` bumped past `v1.84.0` to patch\n [GO-2026-6443](https://pkg.go.dev/vuln/GO-2026-6443), a server panic via a\n missing `:authority`/`Host` header reachable through `archied`'s gRPC\n gateway server. No stable release carries the fix yet, so this pins the\n pre-release commit that does (`v1.85.0-dev.0.20260825072537-93e31b48545e`)\n until `grpc-go` cuts `v1.85.0`.\n\n### archied — Memory engine unification\n\nOne memory engine, addressed by four typed scopes (global, agent, user,\nagent-user), replaces the two disconnected stores that previously existed:\na chat-tool-written store nothing ever read back, and a curator-written store\nwith no scope model.\n\n- `internal/domain/memory` is a CRUD contract (`Create`/`Get`/`Query`/`List`/\n `Update`/`Forget`/`Revisions`) with retained revisions; updates supersede\n rather than overwrite, so a crash mid-write leaves a recoverable extra\n history entry, never a lost prior state (#886).\n- The chat turn reads its subject's scopes synchronously before the prompt is\n built, rendering recalled records into a `<memory>` block; a failing or\n panicking engine degrades to no memory block rather than failing the turn\n (#887).\n- The model writes memory through four id-addressed tools\n (`memory_create`/`update`/`delete`/`list`), scoped to the turn's own\n resolved identity -- the model chooses the scope kind, never the ids, so it\n has no path to write into another user's memory (#888).\n- The session curator now derives the agent-user scope from the session's own\n user-role messages, instead of keying facts by a session id that stops\n meaning anything once the session ends.\n- A channel with no resolvable user (dashboard, webhook) reads and writes only\n global and agent scope; a webhook's route path is never treated as a user\n identity.\n- Fixed a review finding on the read path: the per-scope record limit was\n being applied as one shared total across all scopes rather than per scope,\n and the rendered block's byte cap was checked before template escaping\n rather than after, letting the escaped block exceed it.\n\n### archied — Work intake\n\n- feat(workintake): define review reaction envelope\n- feat(workintake): authorize review reactions by owned PR\n\n### archied — Cleanup\n\n- Deleted the unwired plugin capability-host health surface\n (`Host.Health`/`Host.Manifests`/`ModuleStatus`) and the `Module.Health`\n chain it fed -- including the `mcp`/`builtin` tool-provider health\n implementations and their aggregation in `tools/provider.Registry` -- none\n of which had ever had a production caller (#882).\n\n### archie-agent\n\n- The sandboxed runtime picks up the review-reaction envelope and its\n owned-PR authorization, so an agent can only react to reviews on pull\n requests it opened itself.\n- `google.golang.org/grpc` bumped past `v1.84.0` to patch\n [GO-2026-6443](https://pkg.go.dev/vuln/GO-2026-6443) (shared dependency\n with `archied`; the pre-release commit is pinned pending a stable\n `v1.85.0`)."
},
{
"version": "1.28.0",
"date": "2026-09-19",
"body": "### archied — Task detail and attempt attribution\n\n- New per-run task detail page, showing each attempt's own events, changes and\n configuration rather than a single merged view.\n- Events, changes and config are attributed to the attempt that produced them;\n `Event` carries `attempt` and `ReadTaskLogRequest` carries `stage`.\n- The task detail page remounts when the task id changes, so switching tasks\n does not leave the previous one's data on screen.\n\n### archied — Configuration\n\n- Services are keyed by name through a registry, so the State Store and Gateway\n listen addresses are configurable rather than fixed.\n- A partial overlay no longer clears the fields it omits — an overlay that set\n one key was wiping the rest.\n- The Services map is cloned on publish, so an overlay can no longer mutate the\n snapshot other readers are holding.\n- The service context is enforced at registration.\n\n### archied — Logging and park reasons\n\n- A parked run's reason is recorded in its own attempt log, in both the daemon\n and the workflow, so \"why did this park?\" is answerable from the task itself.\n- `TaskRegistry.Write` takes the caller's context.\n\n### archied — Worktrees and containers\n\n- Retries recover from path-type conflicts instead of failing opaquely, and the\n underlying cause is no longer masked.\n- The worktree is handed back on every sandbox exit.\n- A container's max-uptime reaper is cancelled on release, the cap stays active\n through the grace period, and teardown is claimed once rather than by\n cancelling a timer.\n\n### archied — Daemon and startup\n\n- Every identity's forge and repos are swept at startup, including the root\n forge.\n- A cancelled startup is no longer reported as an exhausted sweep budget; an\n exhausted budget names itself as the cause.\n\n### archied — Other\n\n- `grep` can use the workspace codesearch index.\n- Forge labels are matched when namespaced, so label-driven routing works for\n namespaced labels.\n- Triage is given criteria for choosing between workflows, and a workflow is\n required when a code change is needed.\n- The Telegram adapter restart callback is wired into the chat router.\n- The `ARCHIE_REACTIONS` fan-out stream is provisioned and bounded by age.\n- `archie-ui` exits cleanly when graceful shutdown overruns its deadline.\n- The dashboard's event pump retries priming until the State Store answers.\n- The update writer emits the agent version sidecar with a real newline.\n- The UI finishes its Preact port; the imperative DOM layer is deleted.\n- Collection fields decoded over the State Store gRPC contract are never nil\n slices, so an empty collection marshals as `[]` rather than `null`.\n\n### archie-agent\n\n- The sandboxed runtime picks up the attempt-attribution contract, so the events\n and changes an agent produces are recorded against the attempt that produced\n them.\n- `grep` can use the workspace codesearch index.\n- A worktree is handed back on every sandbox exit, and container teardown is\n claimed once — a released container's reaper is cancelled rather than\n re-firing during the grace period.\n- Retries recover from worktree path-type conflicts instead of failing\n opaquely.\n- A parked workflow run records its park reason in its own log.\n- Triage criteria distinguish the workflows, and a workflow is required when a\n code change is needed.\n- Namespaced forge labels match when routing by kind.\n- The `ARCHIE_REACTIONS` fan-out stream is provisioned.\n- Collection fields decoded over the State Store gRPC contract are never nil\n slices, so an empty collection marshals as `[]` rather than `null`."
},
{
"version": "1.27.0",
"date": "2026-09-17",
"body": "### archied — Dashboard task logs\n\n- Task logs are readable from the dashboard again, through a new State Store\n read contract (`ReadTaskLog`, `StreamTaskLogContent`) rather than the UI\n process reaching into the daemon's log files. Wired server-side by the\n standalone state-store process.\n- Added `GET /api/tasks/{id}/logs/download`, serving an attempt's raw log as a\n `task-<id>-attempt-<n>.log` attachment.\n- A process that cannot read logs and an attempt that recorded no log are now\n distinguishable (\"cannot read\" answers 503, \"no log\" answers 404) instead of\n both rendering as a claim about a configuration setting.\n\n### archied — Telegram output\n\n- Tool results are summarised rather than quoted: a search reports how many\n matches came back, a truncated result reports the tool's own total. The\n renderer no longer states a count it computed from its own truncated sample.\n- Repeated successful tool calls collapse into one counted entry.\n- The tool-activity block is capped to a third of the live frame, keeps the\n newest lines, and marks what it dropped with a `+N earlier` indicator. Every\n line that fits is kept.\n- Every clamped answer marks its cut with an ellipsis, including the opening\n frame, which previously appeared to begin mid-sentence.\n- An error response from the log download no longer ships as a `.log` file.\n\n### archied — Readiness and shutdown\n\n- The disk probe reports per-filesystem results and checks the root filesystem\n as well as the work directory, so a full root is no longer invisible.\n- A path shared by several disk targets keeps the strictest requirement any\n target places on it, so an optional target can no longer mask a required one.\n- The shutdown-watchdog test no longer races the Go scheduler, which was\n intermittently failing the quality gate and parking work unrelated to it.\n\n### archied — Other\n\n- Messages persist the channel-native sender id.\n- go-telegram/bot bumped to v1.27.0, fixing a streaming bug where the multipart\n body could not be replayed and `sendMessage`/`editMessageText` failed until\n the connection dropped.\n\n### archie-agent\n\n- The per-task runtime picks up the new State Store task-log read contract, so\n the sandboxed agents share one log-reading path with the daemon and the\n dashboard."
},
{
"version": "1.26.0",
"date": "2026-09-17",
"body": "### archied\n\n- fix(webui): publish per-identity forges so multi-identity task rows keep their links\n- feat(config): add [scheduling] config block\n- feat(configuration): translate [scheduling] into scheduling.EngineConfig\n- feat(cronevents): adapt the events bus to scheduling.Sink\n- fix(webui): count every chat front-end in the published projection\n- fix(scheduling): respect configuration ownership\n- feat(ratelimit): wire per-identity inbound rate limiting into the gateway\n- fix(tools): judge the rm guard by base name so absolute paths cannot bypass it\n- fix(store): keep an empty binding secret empty so a partial edit cannot erase it\n- fix(archied): stop advertising review_pr when no reviewer can run\n- fix(daemon): carry kind/label routing bindings to the process that routes\n- feat(configuration): add archied setup, the caller the first-run flow was built for\n- fix(configuration): stop letting a secret value be set from the command line\n- feat(configuration): let setup reference a secret without carrying its value\n- fix(archied): disable a provider whose credential is missing instead of refusing to boot\n- refactor(install): install.sh delegates config generation, and tests stop reading hand-written configs\n- fix(daemon): guard binding dispatch loop against nil dispatcher/creator\n- fix(webui): enforce CSRF/origin gate on binding and mapping mutations\n- fix(secret): recover a panicking secret engine instead of crashing\n- fix(config): deep-copy Image.Hosted/Image.Local in Config.Clone\n- fix(email): stop dropping the first paragraph of plain-text bodies\n- fix(logging): keep the live descriptor open across a failed rotation\n- feat(configuration): report config keys no decode target consumed\n- feat(archied): warn at boot when the config file has unrecognised keys\n- feat(archied): wire the scheduling ticker engine at boot\n- fix(agentworker): wire configured tool-result policy into worker's LoopRunner\n- refactor(staterpc): delete the superseded single-token auth interceptor\n- refactor(memory): delete the unreachable <memory> fence scrubber\n- fix(channels): delete unreachable Telegram webhook delivery mode\n- fix(gateway): delete unwired Router.Dangerous approval path\n- refactor(gateway): delete orphaned SessionState goal/steer/queue machinery\n- refactor(archied): delete the daemon's unused webui.Server and UI adapters\n- refactor(tools): delete unreachable dispatch/gating engine\n- feat(channels): wire chat.webhook route config through to the gateway\n- refactor(tools): delete unreachable AST-based tool discovery\n- refactor(tools): delete unused plugin-tool registration API from builtin.Registry\n- feat(channels): wire ConfigSchema/ValidateConfig into a startup validation loop\n- refactor(state): delete the dead IncrementRetryCount RPC (breaking change, accepted)\n- fix(curator): populate PassInput.Since with the prior pass time\n- fix(memory): install the threat scanner the composition root never wired\n- fix(staterpc): preserve marshal_error marker in eventDataJSON\n- fix(gate): validate finding level and share the blocking threshold\n- fix(scheduling): record a completed run so a recurring job stops re-firing every tick\n- fix(releaseupdate): don't treat empty available as deferred\n- fix(tools/provider/mcp): preserve MCP binary tool results for delivery\n- refactor(gateway): share sensitive-key markers with webhookguard\n- refactor(daemon): remove unreachable SQLite poll/drain path\n- refactor(tools/mcp): delete unreachable MCP adaptation path\n- fix(taskactions): resolve max_retries from the task's owning identity\n- fix(daemon): forward configured MCP servers to task agents\n- refactor(skill): delete dead Discover/DiscoverPlugins/Skill path\n- refactor(skillbuild): delete dead AugmentRegistry path\n- fix(builtin): bound read/edit filesystem work by DefaultToolTimeout\n- refactor(binding): delete dead Matcher.Overlaps method\n- refactor(forge): delete dead CreateIssue surface\n- fix(mcp): cancel in-flight SSE reconnect on Stop\n- fix(container): enforce MaxUptime lifetime cap with a timer\n- refactor(store): use taskstate status constants in SQL\n- fix(ui): unbreak binding approve and the two deletes, and centralise the client\n- fix(tools): stop testing on the text of other files, and ungate contractaudit\n- refactor(forge): delete the unwired RepliesAfter surface\n- refactor(config): delete the two decoded-but-unread policy fields\n\nThis release is dominated by dead-code removal and the completion of the\nscheduling capability. Roughly half the commits delete surfaces that no longer\nhad a caller: the unreachable SQLite poll/drain path, the unwired MCP\nadaptation path, the AST-based tool discovery, the superseded single-token auth\ninterceptor, and several dead forge and binding methods. The\n`IncrementRetryCount` State Store RPC is gone with them -- a breaking change to\nthe wire contract, accepted because nothing called it.\n\nThe cron/scheduling epic lands iLine truncated
},
{
"version": "1.25.0",
"date": "2026-09-15",
"body": "### archied\n\n- fix(update): resolve releases without a checkout, and fail loudly when it cannot\n- fix(update): back up the task store the daemon actually uses, or refuse\n- fix(update): build each component from its own approved release tag\n\nComponents are independently versioned, so the newest `archied/v*` and\n`archie/v*` tags usually sit on different commits. The installer required both\ntags to resolve to one commit whenever both components changed, which refused\nevery update once the two newest releases diverged -- a deployment stuck on\n1.22.0 could not take any update. Each component now builds from its own\napproved tag.\n\n### archie-agent\n\n- chore: no user-facing changes; versioned so the 1.25.0 release tags both\n components at the same commit"
},
{
"version": "1.24.0",
"date": "2026-09-12",
"body": "### archied\n\nMakes 1.23.0 deployable. That release split archied into separate processes,\nbut the self-updater still installed only the `archied` binary and restarted\nonly `archied.service`, so updating to it left the State Store, Gateway and UI\non the previous release. archied cannot boot without a reachable State Store,\nso the update failed its health check and rolled back. Update to this release\nrather than to 1.23.0.\n\nIf your host does not yet run the four units in\n`deployments/systemd-user-service.md`, create them first: the updater now\nrefuses, naming what is missing, instead of installing binaries onto a host it\nwould leave broken.\n\n- fix(update): install and cycle every process in the release\n- fix(telegram): stop the relay corrupting identifiers and code\n\nAlso in this release, though outside the version-stamped package closure:\n\n- ci(deploy): produce a complete distribution zip on every release. No zip was\n built for v1.23.0 at all, and the zip omitted `archie-ui`."
},
{
"version": "1.23.0",
"date": "2026-09-12",
"body": "### archied\n\nArchied is no longer a single process. The State Store (`archie-state-store`)\nnow owns `archie.db` outright, the Gateway serves its contract over\nauthenticated gRPC, and the dashboard ships as a standalone UI Service\n(`archie-ui`). Upgrading is not a binary swap: these processes must be running\nand addressable before `archied` will start clean. See `deployments/` for the\nsupported profiles.\n\n### archied — Service decomposition\n\n- feat(contracts): add gateway service seams and protobuf toolchain\n- feat(gateway): extract ChatContract service\n- feat(gateway): delete in-process ChatContract path, make remote the only mode\n- feat(gateway): authenticate the gRPC contract and allow off-loopback listeners\n- fix(gateway): drop services.gateway.mode, remote is the only transport\n- feat(state-store): generalize storerpc as the State Store gRPC contract (#770)\n- feat(state-store): stand up archie-state-store binary and own archie.db (#771)\n- refactor(state-store): migrate capture/mapping/binding consumers to State Store (#772)\n- refactor(state-store): migrate workflow/intake/task lifecycle consumers to State Store (#773)\n- refactor(state-store): cut daemon/Gateway over to the remote State Store (#774)\n- fix(state-store): task-scope container credentials, stream large capture lists, validate Update\n- feat(archieui): standalone UI process over remote Gateway and State Store\n- refactor(archied): cut the dashboard over to the archie-ui process\n- refactor(ui): sever the archie-ui binary from every daemon runtime package\n- refactor(archied): move the update relay to the process that owns updates\n- refactor(archied): move webhook capture intake to the process that owns work intake\n- feat(archieui): mount the capture intake receiver over the State Store\n- refactor(workflow): relocate Task/Status/Source and define workflow.Store (#754)\n- refactor(store): move the producer-owned contracts to internal/contracts/store/v1\n- feat(messaging): migrate gateway session persistence onto domain types\n- feat(gateway): flip channel boundary onto messaging.Message\n\n### archied — Pull request review\n\n- feat(gateway): operator-triggered PR review with selectable reviewer model\n- feat(forge): pull request review read surface (ListReviews/ListReviewComments/ReplyToReview)\n- feat(workflow): surface adversarial review findings on the PR body\n- feat(workflow): review calibration, checked properties and style nits out of contract\n- fix(archied): share one PR reviewer across channels; harden forge and worktree\n- fix(workflow): order findings before footer; test the report stash\n\n### archied — Dashboard\n\n- feat(webui): render configuration from a published snapshot\n- feat(staterpc): carry the dashboard's configuration snapshot\n- refactor(webui): take configuration off the dashboard server\n- feat(webui): report which dashboard sections a process can serve\n- feat(webui): deliver live dashboard events by polling the State Store cursor\n- feat(webui): route dashboard task actions through the Gateway contract\n- feat(gateway): give the dashboard operator its own task-action contract\n- feat(webui): add /health and /health/detailed readiness endpoints (#717)\n- fix(webui): distinguish refused vs broken task actions, handle 401 (#753)\n\n### archied — Daemon, gateway and workflow\n\n- feat(archied): add shutdown watchdog that force-exits a hung graceful shutdown (#716)\n- feat(archied): serve the daemon's own health endpoint\n- feat(drain): honour external drain marker with instantiation epoch (#718)\n- feat(gateway): wire progressive tool disclosure (bridge tools)\n- feat(gateway): render workspace, managed repos and operator into chat env\n- feat(gateway): add session_transcript tool for full JSON export\n- feat(gateway): consolidate task actions and repair daemon default path\n- feat(eda): thread Playbook ID/Version and DispatchInput task identity\n- feat(worktree): Resume re-syncs a worktree onto its branch tip\n- fix(staterpc): attach the bearer token to State Store streams\n- fix(archieui): resolve service tokens from env, without requiring a config file\n- fix(archied): initialize conversation persistence on daemon startup\n- fix(archied): preserve channel turn ledger with remote gateway\n- fix(gateway): share NATS and session ownership\n- fix(update): probe the dashboard's real address after a self-update\n- fix(store): migrate binding owner and repo columns\n\n### archie-agent\n\nThe agent runtime now reaches task state through the State Store gRPC contract\n(`STATE_STORE_URL`/`STATE_STORE_TOKEN`, injected by the daemon) instead of the\nNATS `storerpc` transport, which is deleted. Credentials handed to a task\ncontainer are scoped to that task rather than being the daemon's own token.\nRunning a 1.23.0 daemon against an older agent image will not work; rebuild or\npull the `archie-agent` image with this release.\n\n- feat(state-store): generalize storerpc as the StateLine truncated
},
{
"version": "1.22.0",
"date": "2026-09-03",
"body": "### archied\n\n- feat(telegram): support secret refs for bot tokens (#705)\n- fix(update): make daemon rollback schema-safe (#704)\n- fix(archied): preserve ephemeral gateway ports (#707)\n- fix(webui): bound log limit parsing and add endpoint regression coverage (#706)\n- fix(deps): upgrade x/crypto to v0.56.0 for security fixes (#708)"
},
{
"version": "1.21.0",
"date": "2026-09-03",
"body": "### archied\n\n- feat(workflow): make kind-to-workflow routing YAML-overridable\n- feat(workflow): route arbitrary forge labels to workflows via playbook YAML\n- feat(workflow): load kind/label bindings from multiple playbook directories\n- fix(extract): regenerate stale Yaegi symbol tables; fix wfextract directive\n- feat(eda): Module position first slice -- registry + side-effect-free log kind\n- feat(eda): CEL expression environment (compile/validate at load, evaluate at dispatch)\n- feat(eda): playbook document + event coordinator, single-action workflow-kind dispatch\n- fix(skillcurator): document and scope the intentional nilerr in reviewOne\n- fix(binding): add Owner/Repo pin, fixing multi-repo dispatch\n- feat(webui): bindings dashboard UI; fix app-wide Preact render regression\n- fix(binding): split ValidateForUpdate so edits can preserve the secret\n- refactor(ui): extract Pill to ui/src/base/, closing archie-core-mlro\n- refactor(eda): extract helpers to satisfy cyclop/gocognit gates\n- fix(webui): stretch HEALTH row cards to equal height\n- fix(eda): make playbook key collision reporting deterministic\n- fix(gateway): split /status (health) and /tasks (work) apart\n\n### archie-agent\n\n- feat(workflow): make kind-to-workflow routing YAML-overridable\n- feat(workflow): route arbitrary forge labels to workflows via playbook YAML\n- feat(workflow): load kind/label bindings from multiple playbook directories\n- fix(extract): regenerate stale Yaegi symbol tables; fix wfextract directive\n- feat(eda): Module position first slice -- registry + side-effect-free log kind\n- feat(eda): playbook document + event coordinator, single-action workflow-kind dispatch\n- fix(binding): add Owner/Repo pin, fixing multi-repo dispatch\n- fix(binding): split ValidateForUpdate so edits can preserve the secret\n- refactor(eda): extract helpers to satisfy cyclop/gocognit gates\n- fix(eda): make playbook key collision reporting deterministic"
},
{
"version": "1.20.0",
"date": "2026-09-03",
"body": "### archied\n\n- fix: baseline gate repair (go test ./... -count=1)\n- fix(logging): propagate bound slog attrs to wrapped handler in FeedHandler\n- feat(image): define provider-neutral image capability contract and config\n- fix(channels): call MarkRunning once a channel is actually up\n- fix(workflow): stop discarding baseline-fix commits as 'no changes'\n- fix(webui): wire the Logs page to per-task attempt-log detail\n- fix(workflow): net cache hits from token totals, trim gate-retry output\n- feat(workflow): dynamic triage instead of defaulting every task to implement\n- fix(gateway): stop SOUL from forging the prompt invariant tags\n- fix(curator): stop curator actions from serializing a zero timestamp\n- feat(webui): hand-author the configuration field descriptor catalog\n- feat(webui): attach the config field schema to GET /api/config\n- feat(webui): render scalar config sections generically from the schema\n- feat(webui): surface allow_concurrent/max_retries/review_enabled on the repositories card\n- feat(webui): inline editing for per-repo allow_concurrent/max_retries/review_enabled\n- feat(webui): playbook bindings -- matcher + mapping + workflow, HMAC-gated\n- fix: resolve golangci-lint funlen, nilerr, and empty branch issues\n- feat(store): encrypt playbook binding secrets at rest\n- feat(webhook): harden captured payload redaction\n- fix(store): satisfy makezero when building cipher payload\n- feat(webui): refactor chat module to Preact component and add unit tests\n\n### archie-agent\n\n- fix: baseline gate repair (go test ./... -count=1)\n- fix(logging): propagate bound slog attrs to wrapped handler in FeedHandler\n- feat(image): define provider-neutral image capability contract and config\n- fix(workflow): stop discarding baseline-fix commits as 'no changes'\n- fix(workflow): net cache hits from token totals, trim gate-retry output\n- feat(workflow): dynamic triage instead of defaulting every task to implement\n- feat(webui): playbook bindings -- matcher + mapping + workflow, HMAC-gated\n- feat(store): encrypt playbook binding secrets at rest\n- fix(store): satisfy makezero when building cipher payload"
},
{
"version": "1.19.10",
"date": "2026-09-02",
"body": "### archied\n\n- feat(curator): session-memory curator reference implementation"
},
{
"version": "1.19.9",
"date": "2026-09-02",
"body": "### archied\n\n- feat(memory): typed memory engine contract, registry, and registrar\n- feat(memory): builtin engine implementing the domain/memory contract\n- feat(config): config surface for memory engine selection\n- feat(daemon): wire the domain/memory engine registry at boot\n- feat(curator): bind curators to memory engines\n- fix(config): reject memory.provider instead of silently ignoring it\n- feat(curator): skill curator reference implementation\n\n### archie-agent\n\n- feat(config): config surface for memory engine selection"
},
{
"version": "1.19.8",
"date": "2026-09-02",
"body": "### archied\n\n- fix(update): drop dev-facing wording from the unconfirmed-update message\n- fix(telegram): stop adjacent rich blocks from rendering glued together\n- fix(telegram): send undelivered-media fallback after finalize as its own message"
},
{
"version": "1.19.7",
"date": "2026-09-02",
"body": "### archied\n\n- fix(logging): make Tail/Page allocation bound explicit for CodeQL\n\n### archie-agent\n\n- fix(logging): make Tail/Page allocation bound explicit for CodeQL"
},
{
"version": "1.19.6",
"date": "2026-09-02",
"body": "### archied\n\n- fix(build): stamp gatewayVersion/runtimeVersion in the right package"
},
{
"version": "1.19.5",
"date": "2026-09-01",
"body": "### archied\n\n- feat(webui): dashboard-aware chat — Archie sees the page, points you there\n- fix(telegram): drop retry_after bandaid, bump go-telegram/bot to v1.24.0\n- feat(curator): track and expose recent activity per curator\n- fix: go.mod bumped to 1.27.0 and stupid tests removed\n- refactor: remove unnecessary AI-generated scaffolding\n- refactor: go modernisation fixes\n- refactor: remove unused Operator param.\n- fix(gateway): fix broken system prompt template and scrub real telegram ID from tests\n- fix(plugin): add missing CLAUDE.md reference to plugin engine rule\n- fix(app): repoint archied wiring contract test at internal/app/archied\n- refactor(agentexec): use ai-sdk NewTypedTool for pluginToolSet and scriptToolSet\n- fix(config): standardize Provenance to pointer receivers (recvcheck)\n- refactor(lint): reduce cyclomatic/cognitive complexity in tools, workflow, webui\n- fix(app): repoint capability-host wiring contract test at internal/app/archied\n- refactor(lint): extract more helpers to clear nestif/gocyclo findings\n- refactor(lint): split AgentStage.Stage into resolveModel/buildRequest/handleResult\n- refactor(lint): split TurnRunner.Run and dispatchLocal further\n- refactor(lint): extract markdownBlockParser and list/quote helpers in richblocks.go\n- refactor(lint): extract Apply/findWalkVisitor helpers; go fix modernization\n- fix(lint): noctx fixes and dead-code cleanup\n- feat(workflow): adversarial self-review stage before PR open\n\n### archie-agent\n\n- feat(tasks): allow rejecting a task from any non-terminal state\n- feat(tasks): serve the lifecycle presentation catalog from /api/task-meta\n- fix: go.mod bumped to 1.27.0 and stupid tests removed\n- refactor: go modernisation fixes\n- refactor: remove unused Operator param.\n- fix(plugin): add missing CLAUDE.md reference to plugin engine rule\n- fix(app): repoint archied wiring contract test at internal/app/archied\n- refactor(agentexec): use ai-sdk NewTypedTool for pluginToolSet and scriptToolSet\n- refactor(lint): reduce cyclomatic/cognitive complexity in tools, workflow, webui\n- fix(app): repoint capability-host wiring contract test at internal/app/archied\n- refactor(lint): extract more helpers to clear nestif/gocyclo findings\n- refactor(lint): split AgentStage.Stage into resolveModel/buildRequest/handleResult\n- refactor(lint): extract Apply/findWalkVisitor helpers; go fix modernization\n- fix(lint): noctx fixes and dead-code cleanup\n- feat(workflow): adversarial self-review stage before PR open"
},
{
"version": "1.19.4",
"date": "2026-08-28",
"body": "### archied\n\n- refactor(telegram): render replies as structured rich blocks"
},
{
"version": "1.19.3",
"date": "2026-08-28",
"body": "### archied\n\n- feat(tasks): serve the lifecycle presentation catalog from /api/task-meta\n- feat(dashboard): render task actions, statuses and filters from the server catalog"
},
{
"version": "1.19.2",
"date": "2026-08-28",
"body": "### archied\n\n- feat(tasks): allow rejecting a task from any non-terminal state"
},
{
"version": "1.19.0",
"date": "2026-08-28",
"body": "### archied\n\n- feat(logging): cursor pagination and filtering for task_logs\n- build(deps): upgrade github.com/samcharles93/ai-sdk to v0.1.29"
},
{
"version": "1.18.0",
"date": "2026-08-28",
"body": "### archied (released 2026-08-25)\n\n- Fix concurrent chat-turn claims so SQLite writer contention no longer leaks as `SQLITE_BUSY`.\n- Make task timelines operationally useful with stage outcomes, durations, retry context, and durable per-stage token economics.\n- Return canonical repository, issue, and pull-request URLs for each task's owning GitHub or Gitea identity.\n- Preserve per-identity commit attribution and real model context limits across daemon-to-worker dispatch.\n\n### archie-agent\n\n- feat(logging): cursor pagination and filtering for task_logs\n- build(deps): upgrade github.com/samcharles93/ai-sdk to v0.1.29"
},
{
"version": "1.19.1",
"date": "2026-08-27",
"body": "### archied\n\n- fix(telegram): keep Markdown headings/lists as blocks and strip Markdown on plain fallback"
},
{
"version": "1.17.1",
"date": "2026-08-25",
"body": "### archied\n\n- fix(update): remove source checkout dependency\n- fix(gateway): make UUIDv7 session references unambiguous"
},
{
"version": "1.17.0",
"date": "2026-08-25",
"body": "### archied\n\n- fix(webui): add nil receiver guard to Server.trustForwardedHeaders\n- fix(chat): restore transcript and update replay\n\n### archie-agent\n\n- Compact task history against the selected model's real context capacity without imposing a token cap.\n- Preserve completed steps and billed usage when a later provider call fails; failed compaction now keeps the original history and continues.\n- Persist detailed agent-stage usage through the daemon-owned store before lossy live event fan-out.\n- Apply configured or forge-derived author and committer identity to sandboxed task commits."
},
{
"version": "1.16.1",
"date": "2026-08-25",
"body": "### archie-agent\n\n- fix(agentworker): reconcile task clone ownership after commits"
},
{
"version": "1.16.0",
"date": "2026-08-25",
"body": "### archied\n\n**The agent can hand you a file, and the dashboard works behind a reverse\nproxy.** Media delivery was fetch-by-URL only, so a file the agent produced\nlocally — a transcript, a log dump, a screenshot — was passed to Telegram as\na URL it could not fetch: the send did nothing and reported success. The new\n`send_file` tool plus upload-by-reader delivery closes that, and every layer\nthat cannot deliver now says so rather than staying silent. Dashboard\nmutations behind a TLS-terminating proxy were refused as cross-origin;\nforwarded headers are now honoured, but only under an explicit opt-in that is\noff by default.\n\n- feat(telegram): deliver a local file as an uploaded attachment, choosing\n upload-by-reader or fetch-by-URL per attachment; `send_file` resolves paths\n under the same confinement policy the read tool applies, so sending cannot\n reach what reading cannot\n- feat(gateway): `task_action` chat tool for operator task management —\n abandon, archive, retry, stop, cancel, approve and reject from chat, on the\n same action path and state machine as the dashboard\n- fix(webui): validate mutation `Origin` against the effective external\n scheme and host. `X-Forwarded-Proto`/`-Host` are honoured only when\n `web.trust_forwarded_headers` is set, which is off by default and safe only\n behind a proxy that overwrites or strips untrusted forwarded headers\n- fix(webui): report a local file the dashboard chat cannot upload as\n undelivered instead of dropping the event, which had reproduced the exact\n silent non-delivery `send_file` was built to end\n- fix(daemon): detach terminal state transitions and cleanup from a cancelled\n context, so a stopped task still records its outcome\n\n### archie-agent\n\n**Version realigned with `archied`.** This release jumps from 1.9.9 to 1.16.0\nto put the two components on matching numbers; there are no 1.10-1.15 agent\nreleases. It clears the accumulated runtime backlog in one cut rather than\nbundling it as a rider on a later change, so the list below spans several\nweeks of work rather than one session's.\n\nHighlights:\n\n- feat(nats): run an embedded server when no external NATS is configured, and\n expose the embedded broker to managed task workers\n- feat(deployment): default to managed NATS workers; the daemon requires a\n full-task worker handoff and the legacy in-process, subprocess and\n single-stage execution paths are gone\n- feat(forge): GitHub webhook receiver for immediate issue dispatch, with\n dedup regression proof; unbound webhook events are stored retention-bounded\n- feat(webui): payload field mapping -- bind JSON paths to named fields and\n preview before saving\n- feat(scheduling): ticker engine with configurable interval and pools\n- feat(storage): persist agent project state\n- feat(agent): stamp archie-agent's build and report it back to the daemon\n- feat(tools): `generate_video` via MiniMax, gated behind config, and\n `MultimodalResult.URLs` for remote-hosted media\n- feat(workflow): define the adversarial-review findings contract\n\nFixes:\n\n- fix(worktree): bind publication to dispatch grants; reset retries to a\n pristine base; reject diffs without a merge base; clean untracked files when\n `.git` is a gitdir file; post-push metadata resilience, cancellation and\n branch naming\n- fix(container): persist the npm cache for per-task MCP servers\n- fix(agentexec): recover omitted finish calls\n- fix(agentworker): move JSONL decode into storage, unblocking CI\n- fix(telegram): compact tool output and drop turn caps\n- fix(webui): give dashboard-initiated updates a phase-2 report; restore the\n provider gate and dashboard token accounting\n- refactor: remove dead `BasePlatformAdapter` code and legacy execution paths\n\nShared with archied 1.16.0 (these packages are in both closures):\n\n- feat(telegram): send local files as uploads, not fetchable URLs\n- fix(webui,sendfile): close three holes the adversarial review found\n- fix(webui): validate mutation Origin against the effective external scheme"
},
{
"version": "1.15.0",
"date": "2026-08-24",
"body": "### archied\n\n**Autonomous workflows now have exactly one production execution path.** Every\ntask is handed complete to a scoped `archie-agent` container over core NATS;\n`archied` no longer runs an agent loop in-process. Embedded NATS is the\ndefault and generates a per-start token, binding to the resolved Docker bridge\nso managed workers can reach it; external NATS changes only broker placement.\nThe legacy `[agent]` section and `containers.enabled` still decode for\nmigration but can no longer select an execution path, and a reloaded\n`nats.url` is logged as requiring a restart. Operators upgrading from a\n`agent.mode = inprocess` configuration get the managed-worker topology\nautomatically; see `deployments/` for the supported profiles.\n\n- feat(nats): expose the embedded broker to managed task containers behind a\n generated per-start credential\n- fix(daemon): park before worktree access when the container pool or task\n transport is unavailable, rather than silently executing locally\n- refactor(agentexec): remove the in-process, subprocess and single-stage\n execution paths\n- fix(worktree): report a successful push as successful even when writing\n local upstream tracking metadata afterwards fails, so a published branch no\n longer parks the task as failed\n- fix(worktree): honour context cancellation in `CommitAll`, so a cancelled\n task can no longer stage or commit\n- fix(daemon): remove the worktree when a task completes with no changes,\n which previously leaked a full clone per no-change task; parked worktrees\n are still retained for post-mortems\n- fix(worktree): derive the branch prefix from the issue title before falling\n back to labels, matching the documented contract\n- fix(worktree): clean untracked files when `.git` is a gitdir file\n- fix(agentexec): recover agents that end a turn without the required finish\n call\n- feat(scheduling): ticker engine with a configurable interval and pools\n- fix(telegram): keep tool-call context when compacting tool output (#609)\n- feat(workflow): add the adversarial-review findings contract, where only a\n confirmed finding blocks and \"review found nothing\" is distinct from\n \"review did not run\" (contract only; no review stage runs yet)"
},
{
"version": "1.14.0",
"date": "2026-08-23",
"body": "### archied\n\n- fix(telegram): compact tool output and drop turn caps\n- fix(update): install only approved components"
},
{
"version": "1.13.0",
"date": "2026-08-23",
"body": "### archied\n\n- fix(telegram): render tool progress as bounded code blocks"
},
{
"version": "1.12.0",
"date": "2026-08-23",
"body": "### archied\n\n- fix(webui): give dashboard-initiated updates a phase-2 report\n- feat(agent): stamp archie-agent's build and report it back to the daemon\n- feat(releaseupdate): enrich components with install type and reference\n- feat(webui): surface per-component update status on /api/version and Configuration"
},
{
"version": "1.11.1",
"date": "2026-08-23",
"body": "### archied\n\n- fix(update): wire Telegram personas and survive callback cancellation\n- fix(webui): theme the Workflows 'Start work' form controls"
},
{
"version": "1.11.0",
"date": "2026-08-23",
"body": "### archied\n\n- feat(forge): make webhook intake observable and deduplicate concurrent delivery\n- fix(telegram): preserve code fences across message splits\n- fix(gateway): replay completed-duplicate turns with their tool activity\n- feat(storage): persist agent project state across sessions\n- fix(container): persist npm cache for per-task MCP servers\n- fix(worktree): bind publication to dispatch grants, reset retries to a pristine base, and reject diffs without a merge base\n- feat(media): deliver generated media through Telegram with link fallback in the dashboard\n- feat(tools): generate videos through MiniMax, gated by provider configuration"
},
{
"version": "1.10.0",
"date": "2026-08-22",
"body": "### archied\n\n- feat(forge): GitHub webhook receiver for immediate issue dispatch\n- feat(webhookguard): shared HMAC, rate-limit, and redaction mechanics\n- feat(nats): run an embedded server when no external NATS is configured\n- feat(capture): store unbound webhook events, retention-bounded\n- feat(webui): event inspector -- see captured payloads in the dashboard\n- feat(webui): payload field mapping -- bind JSON paths to named fields, preview before saving\n- fix(webui): stop the capture live-event notification duplicating payloads into the unbounded events table\n- fix(update): verify an update took effect instead of trusting the report (#530)\n- fix(daemon): refuse to poll on an empty label-trigger match (#529)\n- fix(gateway): stop persona from asserting unverified claims as fact (#528)\n- fix(gateway): stop ClaimTurn's insert-race branch losing its own retry read\n- fix: restore provider gate and dashboard token accounting\n- fix: address simple findings from a repo-wide golangci-lint sweep"
},
{
"version": "1.9.11",
"date": "2026-08-19",
"body": "### archied\n\n- fix(mcp): persist npx package cache across daemon restarts"
},
{
"version": "1.9.10",
"date": "2026-08-19",
"body": "### archied\n\n- feat(update): `/update` now streams live progress while an update installs, reports a clear version summary (previous/installed, daemon/agent) once the build succeeds, and automatically rolls back and reports the outcome if the restarted daemon fails its post-update health check"
},
{
"version": "1.9.9",
"date": "2026-08-18",
"body": "### archied\n\n- fix(telegram): drain live renderer in concurrency test\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.8",
"date": "2026-08-17",
"body": "### archied\n\n- chore: no user-facing changes\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.7",
"date": "2026-08-17",
"body": "### archied\n\n- chore: no user-facing changes\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.6",
"date": "2026-08-16",
"body": "### archied\n\n- fix(update): stamp install type and bound retry backoff\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.5",
"date": "2026-08-16",
"body": "### archied\n\n- refactor(archied): decompose the daemon bootstrap into phased wiring (no behaviour change; splits the ~950-line run() into focused setup phases so complexity linting passes)\n- refactor(archied): extract the config overlay boot helper and thread context through chat gateway setup\n- refactor(tools): split the read executor and flatten nested config/tool fallback logic to lower complexity\n- fix(tools): avoid predeclared `max` names\n- fix(email): use context-aware test networking\n- fix(indexing): remove the unused code search test runner\n- fix(tests): use contexts and type assertions in overlay and gateway tests\n- docs(architecture): document the memory engine family\n\n### archie-agent\n\n- refactor: decompose the daemon bootstrap into phased wiring (no behaviour change; complexity-driven restructure)\n- refactor(tools): split the read executor and flatten nested config/tool fallback logic to lower complexity\n- fix(tools): avoid predeclared `max` names"
},
{
"version": "1.9.4",
"date": "2026-08-15",
"body": "### archied\n\n- feat(gateway): polish /status command response format\n- fix(telegram): preserve URL boundaries in responses\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.3",
"date": "2026-08-15",
"body": "### archied\n\n- fix(webui): scroll selected command into view on keyboard navigation\n- fix(logging): resolve error attrs to their message string, not {}\n- feat(agentexec,workflow): surface tool calls on the task timeline\n\n### archie-agent\n\n- fix(logging): resolve error attrs to their message string, not {}\n- fix(agentworker): back off before refetching a nak'd stage message\n- feat(agentexec,workflow): surface tool calls on the task timeline"
},
{
"version": "1.9.2",
"date": "2026-08-15",
"body": "### archied\n\n- fix(worktree): force checkout so retry recovers from a dirty worktree\n\n### archie-agent\n\n- fix(worktree): force checkout so retry recovers from a dirty worktree"
},
{
"version": "1.9.1",
"date": "2026-08-15",
"body": "### archied\n\n- fix(agentworker): forward workflow events across the NATS worker boundary\n- fix(webui): filter turn_completed noise from the Live Activity SSE feed\n- feat(releaseupdate): stamp install type at build time, fail closed on unknown\n\n### archie-agent\n\n- fix(agentworker): forward workflow events across the NATS worker boundary"
},
{
"version": "1.9.0",
"date": "2026-08-15",
"body": "### archied\n\n- fix(webui): style tool-call failure from a structured field, not a string prefix\n- fix(config,webui): make show_tool_calls one cross-channel setting\n- fix(telegram): guarantee no message is stranded on gateway stop/restart\n- fix(telegram): use NewRequestWithContext to satisfy noctx\n- refactor(webui): decompose handleSSE to cut cognitive complexity\n\n### archie-agent\n\n- fix(agent): resolve git dubious-ownership in sandbox containers\n- feat(agent): mark the mounted worktree as a git safe directory\n- fix(agent): route git safe.directory setup through markWorktreeSafe\n- feat(chat): show tool calls inline and stream replies into one message\n- refactor(agent): move worker runtime into application layer\n- fix(config,webui): make show_tool_calls one cross-channel setting"
},
{
"version": "1.8.0",
"date": "2026-08-15",
"body": "### archied\n\n- feat(archied): add -version so the installed build can be read from a shell\n- fix(webui): rebuild the Configuration page layout so values stop colliding\n- fix(webui): size Configuration key/value lists to their own content\n- fix(webui): keep Configuration rows full width, hug only the label column\n- fix(webui): cap and centre the Configuration page instead of its lists\n- fix(webui): preserve encoded redirect path characters\n- feat(chat): show tool calls inline and stream replies into one message\n- fix(chat): harden inline tool call streaming\n- refactor(agent): move worker runtime into application layer\n- fix(telegram): harden live-reply delivery against /stop and multi-byte content\n- fix(telegram): keep tool activity visible and mark failed/empty turns\n- fix(config): de-duplicate disabled-forge predicate, export ForgeDisabled"
},
{
"version": "1.7.0",
"date": "2026-08-10",
"body": "### archied\n\n- fix(build): install ripgrep where grep.go actually needs it on PATH\n- fix(webui): Send button no longer passes its click event to sendMessage\n- feat(webui): Enter sends, Shift+Enter inserts a newline\n- fix(chat): stop showing raw 501 banner for unconfigured update-check\n- fix(chat): give chat page a real height budget instead of a floor\n- fix(workflow): carry gate output into the baseline park error\n- feat(logging): add a per-task log sink\n- feat(agentexec): publish agent-side logs to the task's system subject\n- feat(daemon): consume agent system logs into per-task sinks and the dashboard feed\n- feat(webui,gateway): add /api/tasks/{id}/logs endpoint and task_logs chat tool\n- refactor(gateway): persist conversations in sqlite\n- refactor(store): replace legacy persistence with SQLite\n- fix(webui): tighten configuration KV row spacing\n- fix(gateway): harden session recovery paths\n- refactor(daemon,webui): make Daemon.Cfg and webui.Server.Cfg reload-safe\n- feat(config): SIGHUP-triggered reload with requires-restart warnings\n- fix(config): share one config Holder between daemon and dashboard; re-apply model catalog on reload\n- fix(config): complete the reloadable allowlist and pin it against ForTask\n- feat(config): runtime config overlay store, PATCH /api/config, and the `--no-config-overlay` recovery flag\n- feat(webui): inline config editing on the Configuration page\n- feat(config): surface overlay state, shadowed keys, and per-row reset\n- fix(config): close review blocker on the PATCH path; deep-copy snapshots; atomics for shared state\n- fix(config): preserve nil slices in Clone to avoid spurious reload warnings"
},
{
"version": "1.4.0",
"date": "2026-08-10",
"body": "### archied (released 2026-07-31)\n\n- fix(secrets): wire provider credentials through engines\n\n### archie-agent\n\n- feat(gateway): tool-approval gate, session tools for chat, and /delete command\n- feat(gateway): make chat turns durable and idempotent\n- feat(webui): lifecycle-safe task controls with atomic retry and archive\n- feat(logging,workflow): daemon log feed and executable workflow registry\n- fix(store,gateway): taskstate constants and mobile jump-to search\n- feat(webui,gateway): wire config, channel, log-feed, and work-intake seams\n- fix(build): install ripgrep where grep.go actually needs it on PATH\n- fix(workflow): carry gate output into the baseline park error\n- feat(logging): add a per-task log sink\n- feat(agentexec): publish agent-side logs to the task's system subject\n- feat(daemon): consume agent system logs into per-task sinks and the dashboard feed\n- feat(webui,gateway): add /api/tasks/{id}/logs endpoint and task_logs chat tool\n- refactor(store): replace legacy persistence with SQLite\n- refactor(daemon,webui): make Daemon.Cfg and webui.Server.Cfg reload-safe\n- feat(config): SIGHUP-triggered reload with requires-restart warnings\n- feat(config): surface overlay state, shadowed keys, and per-row reset\n- fix(config): close review blocker on the PATCH path; deep-copy snapshots; atomics for shared state\n- fix(config): preserve nil slices in Clone to avoid spurious reload warnings"
},
{
"version": "1.6.0",
"date": "2026-08-09",
"body": "### archied\n\n- feat(gateway): tool-approval gate, session tools for chat, and /delete command\n- fix(webui): close open-redirect in dashboard token-exchange handler\n- feat(gateway): make chat turns durable and idempotent\n- feat(webui): lifecycle-safe task controls with atomic retry and archive\n- feat(config,channels): format-neutral config resolution and truthful channel state\n- feat(logging,workflow): daemon log feed and executable workflow registry\n- fix(store,gateway): taskstate constants and mobile jump-to search\n- feat(webui,gateway): wire config, channel, log-feed, and work-intake seams\n- fix(ui): hide inactive chat command menu"
},
{
"version": "1.5.0",
"date": "2026-08-08",
"body": "### archied\n\n- feat(curator): engine family contract, registry, and runtime\n- feat(curator): trigger accounting — primary-input wake path\n- feat(setup): interactive setup steps with a TTY-gated prompter\n- feat(webui): rebuild the dashboard and add chat\n- feat(daemon): identity-scoped isolation plus gateway session titles and /delete\n- feat(logging): optional rotating log file\n- feat(configuration): export Validate for the setup flow\n- fix(gateway): durable message identity with a SQLite store\n- fix(gateway): consistent message ordering and paged search\n- fix(gateway): stop /compress destroying history it should have kept\n- fix(gateway): do not answer a redelivered message twice\n- fix(gateway): claim the session slot before writing it, not after\n- fix(gateway): keep /topic off from poisoning the session cache\n- fix(gateway): resolve the most recently active session, not an arbitrary one\n- fix(gateway): give branch-inherited messages their own identity\n- fix(gateway): make both backends agree on newest-first\n- fix(store): honour the transition guard in production persistence\n- fix(store): move ID counters away from the reserved metadata namespace\n- fix(store): surface task timestamps and tag the summary structs\n- fix(telegram): pause the update loop when rate limited\n- fix(memory): fail startup on an unusable memory directory\n- fix(tools): let an optional provider fail without taking the daemon down\n- fix(tools): report a cancelled find walk as an error, not empty results\n- fix(worktree): name the missing forge credential when a push fails\n- fix(tomlwrite): recognise table headers carrying a trailing comment\n- fix: close the duplicate-work loop and the dead paths around it\n- perf(tools): drop the embedded ripgrep binaries\n- refactor: one definition of what approving or declining a task means\n- refactor: move workflow into its own domain"
},
{
"version": "1.3.0",
"date": "2026-08-08",
"body": "### archied (released 2026-07-31)\n\n- fix(memory): replace framework-specific names with generic equivalents\n- feat: unify provider and model selection\n\n### archie-agent\n\n- feat(curator): engine family contract, registry, and runtime\n- feat(curator): trigger accounting — primary-input wake path\n- feat(logging): optional rotating log file\n- feat(daemon): identity-scoped isolation\n- fix(secrets): wire provider credentials through engines\n- fix(store): surface task timestamps and tag the summary structs\n- fix(tools): let an optional provider fail without taking the daemon down\n- fix(tools): report a cancelled find walk as an error, not empty results\n- fix(worktree): name the missing forge credential when a push fails\n- fix: close the duplicate-work loop and the dead paths around it\n- perf(tools): drop the embedded ripgrep binaries\n- refactor: one definition of what approving or declining a task means\n- refactor: move workflow into its own domain"
},
{
"version": "1.4.1",
"date": "2026-07-31",
"body": "### archied\n\n- fix(catalog): match SDK provider fallback"
},
{
"version": "1.3.1",
"date": "2026-07-31",
"body": "### archied\n\n- fix(telegram): omit empty model picker markup"
},
{
"version": "1.2.0",
"date": "2026-07-31",
"body": "### archied\n\n- feat: add MCP client capabilities to archied and archie-agent\n- fix: handleSummary ignores errors from WorkflowStats/StageStats/TokensByDay\n- feat: establish Archie identity and use stable callback tokens\n- refactor(telegram): keep one model selector command\n- fix: handleSSE silently swallows EventsSince backlog fetch errors\n- fix: Transition() ignores `from` status guard, allowing lost updates\n- fix: skillscript.Run ignores context, cannot be canceled/timed out\n- feat(telegram): report installed component versions\n- feat(telegram): add approved component updates\n- fix: LoadDir: no timeout around Yaegi Eval can hang daemon startup\n- feat(chat): real system prompt for Archie — identity, tools, env\n- feat(indexing): port tau's codesearch workspace index\n- fix(indexing): surface index config properly and stop silent degradation\n- refactor(worktree): replace git shell-out with go-git v6\n- fix(worktreerpc): bound handler contexts and drop the git binary from tests\n- refactor(nats): rebuild as infrastructure/eventbus/nats with real boundaries\n- refactor: route tasks on a typed kind, not forge labels\n- fix(natsrpc): make RegisterAll wait for the server to see subscriptions\n- refactor(config): move loading into infrastructure/configuration\n- fix(telegram): publish all executable session commands in menu and help\n- fix(telegram): publish the restored gateway commands\n- refactor: add internal/eventbus as the broker-neutral messaging contract\n- fix(chat): operator name from config, session wiring, prompt rules\n- feat(tools): lift tau's file and shell tools into the tool registry\n- feat: make /stop cancel the running chat turn\n- fix: kill the whole process group when a shell command is cancelled\n- feat: refuse unrecoverable shell commands\n- feat: make /stop reach running agent tasks\n- fix(chat): temper prompt brevity rules with warmth\n- fix: use errors.Is/As for context errors and cleanup\n- fix(grep): distinguish ripgrep exit 1 from a failed search\n- fix(archied): disable the forge on a missing credential, not the daemon\n- fix: restore /model parsing and close the 6d4e0be autofix audit\n- feat: embed config.example.toml and add comment-preserving TOML writer\n- fix(docker): install unzip and Node 24 so MCP servers can start\n- fix(docker): slim both images and repair unreachable Go tooling\n- fix(container): write the task boot brief under .git\n- fix(telegram): drop pending updates before long polling\n\n### archie-agent\n\n- feat: add MCP client capabilities to archied and archie-agent\n- fix: Transition() ignores `from` status guard, allowing lost updates\n- fix: skillscript.Run ignores context, cannot be canceled/timed out\n- fix: LoadDir: no timeout around Yaegi Eval can hang daemon startup\n- fix(indexing): surface index config properly and stop silent degradation\n- refactor(worktree): replace git shell-out with go-git v6\n- fix(worktreerpc): bound handler contexts and drop the git binary from tests\n- refactor(nats): rebuild as infrastructure/eventbus/nats with real boundaries\n- refactor: route tasks on a typed kind, not forge labels\n- fix(natsrpc): make RegisterAll wait for the server to see subscriptions\n- refactor(config): move loading into infrastructure/configuration\n- refactor: add internal/eventbus as the broker-neutral messaging contract\n- feat(tools): lift tau's file and shell tools into the tool registry\n- feat: make /stop cancel the running chat turn\n- fix: kill the whole process group when a shell command is cancelled\n- feat: refuse unrecoverable shell commands\n- feat: make /stop reach running agent tasks\n- fix: use errors.Is/As for context errors and cleanup\n- fix(grep): distinguish ripgrep exit 1 from a failed search\n- fix(docker): slim both images and repair unreachable Go tooling\n- fix(container): write the task boot brief under .git"
},
{
"version": "1.1.0",
"date": "2026-07-27",
"body": "### archied\n\n- feat: add the Telegram gateway with persistent sessions, topic-thread support, streamed rich replies, typing indicators, and Markdown rendering\n- feat: add `/spawn`, `/approve`, and `/cancel` for chat-driven task control\n- feat: provide a comprehensive `/help` guide whose command list stays aligned with Telegram's published menu and Archie's executable command surface\n- feat: add `/provider` and provider-filtered `/model` selectors that switch the provider and model used by subsequent live chat turns\n- feat: include the active provider and full model reference in `/status`\n- feat: notify authorized Telegram users once when a newly tagged component release is installed\n- feat: add `/restart` to reload and relaunch the Telegram gateway without interrupting in-flight daemon tasks\n- feat: add deny-by-default Telegram sender authorization and native command-menu publication\n- feat: connect Desktop Commander through Archie's managed MCP client so chat can use workspace file and process tools\n- feat: add multi-identity daemon configuration, persona routing, an email channel, and webhook platform support\n- feat: add durable task, session, message, and memory persistence\n- feat: add memory synchronization, prefetch, context scrubbing, threat scanning, and built-in memory tools\n- feat: add tool guardrails, classification, budgets, availability filtering, and disclosure controls\n- feat: add feature-based YAML configuration with `conf.d` overlay loading\n- feat: add typed secret-engine registration and Yaegi extension support\n- fix: reject unknown slash commands locally instead of allowing the LLM to fabricate command behavior\n- fix: publish Telegram commands to default, private-chat, and group-chat scopes so stale commands inherited with the bot token cannot shadow Archie's menu\n- fix: drain the SDK's full event stream so streamed Telegram replies cannot deadlock\n- fix: use standard newline-delimited JSON framing for MCP stdio clients\n- fix: make MCP stdio shutdown and timeout handling race-safe\n- fix: restore legacy `[forge].token_env` compatibility and required container environment passthrough\n- fix: make the agent-container Docker network explicitly configurable\n\n### archie-agent\n\n- feat: add streamed agent execution with typed message events\n- feat: add MCP client transports and managed tool-provider discovery\n- feat: add memory context scrubbing and normalized memory tool schemas\n- feat: add plugin metadata extraction from `metadata.archie.plugins`\n- feat: add configurable container networking for daemon-launched runtimes\n- fix: preserve valid UTF-8 when clipping runtime output\n- fix: make MCP stdio lifecycle, retries, and timeout handling race-safe\n- fix: enforce a zero-finding lint and vet baseline"
},
{
"version": "1.0.0",
"date": "2026-07-22",
"body": "### archied\n\n- feat: ship the resident forge-polling daemon, deterministic workflow engine, isolated worktrees, quality gates, Gitea integration, Docker/NATS worker split, plugin loading, and skills support\n- feat: publish `archied` and `archie-agent` container images to the Gitea registry\n\n### archie-agent\n\n- feat: ship the isolated agent runtime, NATS RPC boundary, workflow execution, skills, and plugin support\n- feat: publish the `archie-agent` container image to the Gitea registry"
}
]
-414
View File
@@ -1,414 +0,0 @@
# External agent harnesses
**Status:** Approved **Scope:** the harness model and, in "Session contract",
the duplex session that the setup terminal and the run-scoped live view both
use. Code cites this file for both (`ui/src/harness/SetupTerminal.vue`,
`internal/infrastructure/postgres/queries/harness_secrets.sql`).
## Decision
A workflow stage can run on an external coding-agent CLI instead of the built-in
agent loop: Claude Code, Codex, Pi, OMP, GitHub Copilot CLI, or any other CLI
packaged as a Docker Sandbox Kit v3. Each authenticates with an API key or the
operator's subscription login, and can carry the operator's own skills, plugins,
subagents and instructions.
Two boundaries hold regardless of what the harness does:
- **The real credential never enters the container.** The container sees
sentinel values; archie's egress proxy substitutes the real credential on
outbound requests and performs OAuth refresh on the host.
- **Archie's workflow guarantees are enforced outside the harness.** Git,
protected paths, read-only stages, gates and budgets are checked by archie
around the process and against the worktree afterwards.
## Kits
A harness is packaged as a Kit v3 image: an OCI image whose
`vnd.docker.sandbox.kit.descriptor` manifest annotation declares what the
harness needs. Archie reads descriptors with the published
`github.com/docker/sandbox-kit-spec/v3/spec` package and does not maintain its
own descriptor format. Published Kits run unmodified.
Archie is a partial Kit runtime. It implements these capability types:
| Type | Archie behaviour |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| `credential@1` | Proxy-managed only, described below. |
| `network-policy@1` | Enforced by the egress proxy. |
| `volume@1` | A Docker volume keyed by WorkflowExecution, deleted with it. |
| `lifecycle@1` | Install and startup hooks run on container create. |
| `agent-sessions@1` | The headless `prompt` and `resume` invocations for the stage. |
| `agent-skills@1` | Discovery paths for bundled skills and optional shared skills; host access is always read-only. |
| `agent-skill@1` | Selected image-bundled skills copied into the declared discovery paths. |
| `agent-context@1` | The resolved discovery directory, defaulting beside the workspace; preserve instructions outside Archie-managed sections. |
| `resources@1` | Container CPU and memory limits. |
Every other type fails closed: a required entry refuses the launch, an optional
one is skipped and recorded on the step. `credential@1` with `passthrough: true`
and any credential for a forge service are refused.
The operator's own setup (plugins, subagents, instructions, settings) is a mixin
Kit, published with the harness Kit as a Kit set: the set merges their layers
into one image. It is versioned image content, rewritten on every create, never
state a run can modify.
## Contract
A harness run is a second implementation of `agentexec.Runner`. It takes the
same `Request` and returns the same `Result`, so workflows, the daemon and the
State Store do not know which runner ran a stage.
`agent-sessions@1` supplies the invocation. Archie supplies, per CLI, an output
adapter that translates the CLI's JSON output stream into `ToolCallReporter`
calls, `Usage` and a session ID. A CLI with no adapter can run stages with no
capture tools, reporting no usage; its token budget falls back to wall clock.
Workflow definition validation rejects, at load time, a stage whose needs the
selected harness cannot meet: capture tools without an adapter, or a gate retry
without a `resume` verb.
## Selection
A harness is an agent profile. `docs/prds/event-automation.md` defines a profile
as the execution environment a workflow selects; a harness profile names one Kit
pinned by digest, a workload Kit or a published Kit set, in place of a container
image. Archie runs that Kit's image and composes no Kits itself; a bare mixin is
refused. Everything else about profiles holds: a workflow names its profile, a
stage may name a different one, and a profile holds no secrets.
`archie-agent` builds the stage's runner from the stage's profile: the ai-sdk
agent loop for an image profile, the harness runner for a Kit profile. Image
profiles, and every workflow already written against them, are unchanged. A Kit
profile named by no workflow is a validation error.
A stage naming a different profile than its workflow's is a separate run, not a
mid-container runner switch: a Kit task runs in one container provisioned for
one profile (Container layout), so a stage that needs a different one is its own
callee, started the way `workflow.call` already starts one
(`docs/prds/event-automation.md` "Workflows call workflows"), with its own agent
profile resolved off its own task row. This needs no mechanism beyond
`workflow.call` plus per-task profile resolution (`daemon.pinTaskProfile`), both
of which already treat every task's profile independently of any caller's -- see
`TestWorkflowCallerConformance` (staterpc) for the callee's independent
`Workflow` field and `TestWorkflowCallGivesACalleeItsOwnProfile` (daemon) for
the Kit-vs-image runner selection that independence produces.
Profiles are org resources in the State Store, so a Kit profile belongs to one
org, is granted to its workspaces like any profile, and applies without a
restart.
## Organisations
`docs/prds/orgs-and-access.md` is the boundary; a harness adds nothing that
crosses it.
- A Kit profile, its credential bindings and its OAuth tokens belong to one org.
No record is shared between orgs.
- A harness run is a run like any other: it acts as the workflow's identity,
under the run credential issued at dispatch.
- The egress proxy injects a credential only when the run credential carries the
secret the binding names. A Kit that declares a service the identity is not
granted gets no credential: a required one refuses the launch, an optional one
is skipped.
- A Kit's network policy is what the Kit asks for; the identity's network grants
are what the org allows. The proxy enforces the intersection.
- Concurrency slots are counted per binding within its org.
## Credentials
A credential binding maps a Kit's `credential@1` `service` name to an org
secret, which the org grants to identities like any secret. The secret holds one
of:
- **API key:** a value in the org's secret store.
- **OAuth:** tokens captured by the setup terminal, stored in the State Store
under the at-rest envelope of `binding-secret-encryption.md` with its own
domain separator.
The egress proxy resolves the binding for each request against the run
credential. The container gets the Kit's sentinel in the named variable or
credential file. OAuth refresh happens at the proxy, which intercepts the Kit's
`tokenEndpoint`, so a refreshed token is written to the State Store and never
returned to the container.
Runs sharing an OAuth binding share its subscription's rate limit.
`max_concurrent` on the binding (default 1) caps its simultaneous runs. A stage
waiting for a slot is `pending`, not `running`.
## Session contract
A **session** is a duplex PTY into a Kit container the daemon owns. One concept
covers both targets; only the address, the lifetime and the established egress
phase differ.
| | Setup session | Run session (deferred) |
| --------- | ------------------------------------------------------------- | ------------------------------ |
| Address | `{org, profile}` | `{org, task, attempt}` |
| Container | ephemeral, from the profile's Kit | the task's running container |
| Purpose | run the CLI's own login so the proxy captures the tokens | watch and optionally take over |
| Lifetime | bounded by the session TTL; the container is removed on close | bounded by the task |
- **Transport.** The daemon serves `harness.v1.HarnessService`, a bidi gRPC
stream, and the dashboard implements its `HarnessTerminal` interface
(`internal/webui`) over that client; the browser's WebSocket route is
unchanged. The contract lives on the daemon because the daemon owns
containers: the dashboard process must not link `internal/container`,
`internal/app/archied` or `internal/agentexec`.
- **Authorisation.** Opening a session is the `update` action on the secret,
decided by the dashboard's authorizer before the route runs
(`internal/webui/authorize.go`). The dashboard then dials the daemon with the
harness service token. The daemon does not re-authorise an operator; it trusts the
asserted `{org, profile}` exactly as the task-action RPC trusts an asserted
actor. Because that authority is a shell in a container holding an org's
credential, the harness listener requires `HARNESS_TOKEN` even on loopback,
unlike the State Store's loopback convention.
- **Egress phase.** Token interception is filtered by phase (`oauth.go`'s
`rule.runtime == atRun`), and `EnterRuntime` is one-way. A setup session
therefore follows a run's lifecycle exactly: install hooks at the install
phase, `EnterRuntime` before the shell. A credential whose token endpoint must
be captured declares `phase: runtime`; a credential capturing at install phase
is captured by the install hooks that run before the switch.
- **Credentials.** Capture is gated: the proxy intercepts a token endpoint only
for a service the session is granted (`Proxy.granted`). A setup session has no
task, so the daemon registers a session grant: its proxy token resolves to
`{org, the Kit's declared credential services the org binds}`. That is the
intersection the `update`-on-secret authorisation covers. The real token never
enters the container: the response is sentinelized and stored as the org's
harness secret.
- **Container discipline.** The setup container runs a keepalive entrypoint with
an empty `Config.Env`; the PTY is an exec as the Kit's harness user with the
harness env and nothing inherited from any worker. No worktree is mounted. It
is acquired through the container pool, so it carries the `archie-daemon`
label, the concurrency cap and the max-uptime reaper; the session TTL is the
smaller bound. Closing revokes the egress session, removes the sandbox network
and the Kit volumes, then releases the container.
- **Kit unavailable.** The daemon serves the contract only when it has a
container pool and a Kit launcher; otherwise there is no listener, and a
client's refused connection is gRPC's `Unavailable`. The dashboard's existing
failure surface is the honest degrade; `/api/harness`'s `terminal` field means
"a client is configured", not "the daemon can run a Kit".
- **Run target.** `RunTarget{task_id, attempt}` opens a read-only view of a
running task's sandbox; it ships as the peek. The daemon resolves the pair
itself, so the dashboard never learns a container name: the task store says
whether the task is `running` and which attempt is current, and the Kit
launcher names the container `kitrun.TaskContainer(task_id, attempt)` (one
container per attempt, removed when the run ends; volumes remain task-scoped
for retries). A finished or unknown task, a task that is not running, an
attempt other than the running one, or a container that is gone is `NotFound`
with the reason in the message; an unreachable task store or container engine
is `Unavailable`. The view follows the container's stdout and stderr,
including the harness output forwarded by the worker, carries no stdin and no
exec, and ends when the task's container ends or the client leaves, so it
confers no authority over the container. A read-only tail of the existing
per-attempt logs was rejected: those refresh only on task state changes and
are the daemon's account, not the sandbox's. Mid-stream failures are shown as
a reason in the terminal before it closes.
- **Authorisation.** The dashboard route `GET /api/tasks/{id}/sandbox` is
decided as `read-logs` on the task before the handler runs, so a caller sees
a sandbox exactly when they may read that task's log. The daemon checks that
the task belongs to the asserted org before following output.
- **Grants.** The view takes no grant of its own. The run's egress session
(its proxy token, install then `EnterRuntime`) already belongs to the run
and is revoked by `Launcher.Release` when the task ends; the view reads
after that phase switch and dies with the container.
- **Credentials.** The sandbox holds sentinels, never real credentials: API
keys are `egress.Sentinel` (`credentials.go`), and an OAuth token set is
sentinelised in the response and swapped back by the proxy only on a granted
service's resource host in the matching phase (`oauth.go`, `injectOAuth`).
The proxy runs in the daemon outside the container, so a shell in the
container sees only sentinels.
- **Takeover (interactive PTY into a running task) is out of scope for this
issue.** It needs the dangerous-command authority (#1574) to
gate it, and that authority is not wired for it: the harness listener has no
approval step; `ToolSetOptions.Approval` in `internal/agentexec/modelloop`
is never set by a caller, so task runs never build approval-required tools;
approvals reach an operator only on the chat paths (dashboard ask, Telegram,
Gateway). Takeover would also need an audit record naming the actor, task,
attempt and open/close times, and revocation tied to task end (the exec is
closed with the container). Those follow the setup session's shape
(`harnesssession.Session`, `container.ExecPTY`) once the authority exists.
- **Audit.** Opening and closing a session and a successful capture are recorded
with the asserted org and profile. A run view's open and close are logged with
the task and attempt; it reads output only, so it has no takeover record.
Each session is the only interactive path into a harness container.
## Egress
Only Kit profiles run on the egress path. An image profile keeps the network
access its identity is granted, because workflows such as a network investigator
need raw DNS, ICMP and arbitrary TCP that no HTTP proxy carries.
- **Sandbox network.** Each Kit run gets its own internal Docker bridge on which
the host holds no address. Host services, including those listening on every
interface, are unreachable from it by any address.
- **Relay.** One relay container, `archie-agent relay`, sits on the sandbox
networks under a fixed alias and on the host-reachable network. It forwards
three fixed ports, to the proxy, NATS and the State Store, and can reach
nothing else. It holds no secrets.
- **Proxy.** The proxy runs inside `archied`, listening on the host gateway of
the host-reachable network. It terminates TLS with a per-daemon CA installed
into the container at create, identifies the container by a per-run proxy
password distinct from the worker's run grant, and applies that run's network
policy and credential inject rules. Upstream dials refuse loopback, and refuse
internal addresses unless the policy names the exact IP, so an allowed name
cannot resolve back into the host.
## Container layout
A Kit task runs in one container, from the Kit composition's image, on the
task's sandbox network. The worker and every harness invocation share it; they
are separated by user, not by container, so a run's cost scales with the run and
not with how many agents it fans out to.
- **Worker.** Archie mounts its own `archie-agent` binary read-only and runs it
as the container's entrypoint, as root. It holds the task's NATS and State
Store credentials in its own environment and in root-only files, runs the
workflow, and serves `archie-agent mcp`. The Kit image's entrypoint is not
PID 1.
- **Harness.** Every invocation runs as the Kit's user (the image's `User`,
default uid 1000) with an explicit environment: the Kit's variables, the proxy
environment and the credential sentinels, and nothing inherited from the
worker. That user cannot read the worker's environment or files, or trace it.
Sibling invocations in one run share the user and the worktree.
- **Hooks.** `lifecycle@1` install and startup hooks run as the user each
declares, before the worker accepts work.
- **Mounts.** The task worktree at the Kit's workspace directory, owned by the
Kit's user, and the read-only skills store. Nothing else from the host.
- **Network.** The relay forwards three fixed ports on the sandbox network: the
egress proxy, NATS and the State Store. The worker reaches NATS and the State
Store with its credentials; a harness can open those ports but holds no
credential either accepts.
- **Volumes.** `volume@1` paths persist for the life of the WorkflowExecution,
which covers session resume across gate iterations and retries. They are not
shared between executions.
## Archie tools inside the harness
Capture tools return a stage's structured results through `archie-agent mcp`, a
stdio MCP server. The same command forwards central-tool discovery and calls
over Streamable HTTP to `http://archie.tools/mcp` through the egress proxy.
Claude Code, Codex, Pi, OMP and GitHub Copilot CLI register it using their
native MCP configuration. Registration files are per-stage and outside the
worktree; the Kit's bundled settings remain intact. A CLI that exits without
initializing the required MCP server fails the stage.
`archied` handles that exact endpoint inside the authenticated task proxy; it is
not a listener or an upstream network destination. It is available only during
task runtime, never during install or a setup session. The harness supplies a
sentinel, and the proxy injects a separate random gateway token held only on the
host. Ending the proxy session revokes that token and cancels active calls.
The proxy reaches `archie-gateway` through its authenticated gRPC contract. The
Gateway derives the task, execution principal and org from a live run grant on
every request. Its tool list is bounded by the profile in that org and the
package's accepted tool authority, checked again at invocation. Workspace tools,
chat file delivery, conversation-only tools and tools that require an
unavailable approver are not served. Tool result limits apply without exposing
host spill paths; media is returned as MCP content.
Task MCP providers run in the Gateway with task-bound sessions and sampling.
Sampling uses the task's model and credentials, records task usage and refuses
revoked grants. It does not use the chat identity or chat model. The worker does
not start another copy of those providers for Kit tasks. The harness's own
built-in tools remain outside Archie's tool-result limits.
## Enforcement around the harness
| Property | Enforcement |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Model never runs git | No forge credential can be bound. Archie records `HEAD` and every ref before the run; any change fails the step (`failed`, policy class). The workflow commits the stage's changes. |
| Protected paths | A diff touching a `Protection` path fails the step. |
| Read-only stage | Any worktree diff fails the step. |
| Gate | Archie runs the stage's gate after the harness exits. On failure it resumes the session with the gate output, up to the stage's iteration budget. |
| Budget | Archie kills the process on wall-clock timeout, or when streamed usage passes the token budget. |
| Cancellation | Cancelling the step kills the process group, then the container. |
| Egress | Only the proxy is reachable; the Kit's network policy decides the rest. |
Harness settings that deny git or protected paths are added where the CLI
supports them, to save wasted turns. They are never the enforcement.
## Execution tree
A harness run is one `agent` StepExecution. Subagents the harness spawns
internally are not recorded as children. Their usage is included in the step's
`tokens_used` when the adapter reports it.
## Agents never hold a harness
An Agent reaches a harness only by invoking a Workflow whose stage names it. No
Agent tool, chat tool or capability exposes a harness, its setup terminal or its
credential. The stage boundary is what carries the container, the git and path
checks, the gate and the budget; a harness outside a stage has none of them.
## Out of scope
- Chat through a harness. The gateway chat loop stays on the built-in runtime.
- `network-policy@2` HTTP method and path rules; a Kit requiring it is refused.
- Recording the harness's internal subagents as StepExecutions.
- Cost in currency.
- Choosing a harness automatically per task.
## Plan
1. Descriptor resolution with the Kit spec package; capability support table and
fail-closed refusal.
2. Egress proxy: internal network, per-daemon CA, per-container token,
`network-policy@1`.
3. `credential@1`: API-key bindings, sentinel rendering, inject rules.
4. Harness `Runner`: container create with worktree, volumes, lifecycle hooks
and the mounted `archie-agent`; `agent-sessions@1` invocation; worktree
checks for git, protected paths and read-only; budget and cancellation.
5. Claude Code output adapter; `archie-agent mcp`; gate-and-resume loop.
6. Kit profiles, runner selection from the stage's profile, and definition
validation.
7. OAuth bindings as org secrets: token-endpoint interception, encrypted
storage, per-binding concurrency; dashboard setup terminal.
8. Output adapters for Codex, Pi, OMP and GitHub Copilot CLI.
## Verification
- Every named adapter discovers and calls a permitted central tool through the
proxy and records a local capture. A guessed tool outside the profile or
accepted package authority is refused.
- The gateway token never appears in the container, generated MCP files,
worktree, logs or events. It is not the container's proxy password.
- A permission change after discovery takes effect at the next call; ending the
proxy session cancels active calls, and a revoked grant cannot execute tools
or sample a model.
- Bundled skills remain visible with shared skills missing or disabled; shared
mounts are per-skill and read-only. Explicit context directories preserve
non-managed instructions and refuse symlinked staging paths.
- The same workflow definition completes on `builtin` and on the Claude Code Kit
with the same `Result` shape and captures.
- After `/login` in the setup terminal, the container's credential file holds
only sentinels, the State Store holds the encrypted token, and a task run
authenticates.
- A real API key or OAuth token never appears in the container environment,
filesystem, worktree, task log or event stream.
- A request to a host outside the Kit's runtime allow list fails, including a
direct connection that bypasses the proxy settings.
- A harness instructed to `git commit` fails its step, and the task branch is
unchanged.
- A harness edit to a protected test file fails the step in a TDD fix stage.
- A read-only feasibility stage that writes a file fails.
- A file a run writes into a Kit-managed path such as the CLI's settings file is
gone on the next execution.
- A Kit requiring an unsupported capability is refused at launch with the
capability named.
- A stage with a failing gate resumes the same session with the gate output,
then succeeds or exhausts its iterations.
- Two tasks sharing an OAuth binding with `max_concurrent = 1` run one at a
time; the second waits as `pending`.
- Stopping a run kills the harness process and removes the container.
- A harness invocation cannot read the worker's NATS or State Store credential
from its environment, its files or `/proc`.
- A run fanning out to many agent invocations uses one container.
- A Kit profile in org A cannot be selected, and its binding cannot be resolved,
by a workflow in org B.
- A harness run whose identity is not granted a Kit's required credential is
refused at launch; the proxy never injects a secret outside the run
credential.
- The firewall investigation example runs unchanged on an image profile with
direct network access.
+7 -7
View File
@@ -4,11 +4,11 @@
persistently takes on development of archie-core itself. This file records a
desired state, not an implementation or a product: nothing below exists unless
the "Built today" section says so. The plan is tracked as epic #1769 with child
issues #1770–#1775. This file is a record, not a mechanism: agents only see
what is in their context, so verify every claim here against the code before
acting on it — where they disagree, the code wins. The boundary below is
load-bearing only where it is enforced (the gate, access control, the daemon's
git monopoly) and stated in `AGENTS.md`; everywhere else this file is a pointer.
issues #1770–#1775. This file is a record, not a mechanism: agents only see what
is in their context, so verify every claim here against the code before acting
on it — where they disagree, the code wins. The boundary below is load-bearing
only where it is enforced (the gate, access control, the daemon's git monopoly)
and stated in `AGENTS.md`; everywhere else this file is a pointer.
## Built today
@@ -17,8 +17,8 @@ workflows, the adversarial self-review stage before a PR opens (epic #1348,
closed), the prbench judge for review quality with its acceptance bar, canary
releases judged on the installed release (releaseupdate), and the curator
engine. What does not exist is the loop itself: no self-intake curator, no
approved-issue auto-run, no judge for diffs, no outcome distillation, no
canary routing specific to self-directed changes.
approved-issue auto-run, no judge for diffs, no outcome distillation, no canary
routing specific to self-directed changes.
## Decision
+29 -31
View File
@@ -12,7 +12,7 @@ certification.
## Transport and authority
The browser uses HTTP/JSON and SSE to the UI service. The UI service calls State
Store, Gateway, Messaging and Harness through their gRPC contracts. Only the
Store, Gateway, Messaging and the daemon through their gRPC contracts. Only the
State Store opens the task/control-plane/account database; Gateway owns
conversation storage. Browser HTTP handlers never open either database.
@@ -54,35 +54,35 @@ accounts by unverified email, or create an administrator.
## Enforcement inventory
| Location | Enforcement | Regression evidence |
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Browser credential gate: `webui/auth.go`, `accounts.go` | Account session or verified provider identity; shared dashboard token is not a person when accounts are enabled. No API data before authentication. | `TestAccountBoundary`, `TestAccountSessionFailureIsClosed` |
| Browser policy gate: `webui/authorize.go` | Resolve principal from stored identity; evaluate action against stored org/workspace and resource kind before handler. Missing chain refuses. | `TestHTTPPolicyCannotBeBypassed`, `TestAuthorizeRefusesWithoutAChain`, `TestAuthorizeRecord`, `TestTaskAuthorizationUsesStoredAttributes`, `TestAuthorizeCreateIn` |
| Instance-only HTTP surfaces: `webui/instance_only.go`, server route registration | Hide instance-owned configuration and diagnostics from another org; policy still applies first. | `TestInstanceOnlyHidesTheInstanceFromOtherOrgs`, `TestInstanceAdminOrgs` |
| First setup: `webui/accounts.go`, `postgres/accounts.go` | Initial organization, workspace, instance URL, admin identity and password commit together. Transaction lock closes bootstrap after first account; later requests require `manage_members`. | Disposable PostgreSQL smoke verification for bootstrap race and rollback; account policy tests below |
| Account creation: `webui/accounts.go`, `staterpc/accounts.go`, `postgres/accounts.go` | Cedar `manage_members` at HTTP and RPC; target org is authenticated context. New local accounts cannot request owner role. | `TestAccountManagementUsesPolicy`, `TestAccountBoundary` |
| Local passwords and sessions: `identity/password.go`, `postgres/accounts.go` | Argon2id, independent salts, length/common-password checks, generic login refusal, account throttling, session hashes and expiry, revocation on logout/password change/suspension. | `TestPasswordVerification`, `TestAccountBoundary`; disposable PostgreSQL session verification |
| Transport and CSRF: `webui/accounts.go`, `api_tasks.go` | Password/account mutations require HTTPS or localhost development, JSON, custom CSRF header and same-origin requests. Forwarded headers require explicit trusted-proxy configuration. | `TestAuthenticationTransport`, existing mutation security tests |
| Personal account routes: `webui/accounts.go` | Active signed-in person; principal supplied by server. Password change verifies current password. Sensitive authenticator changes require recent sign-in. No caller-supplied target identity. | `TestAccountBoundary` |
| Recovery: `postgres/account_security.go`, `webui/accounts.go` | Fresh authenticated owner generates a hashed, one-use recovery secret. Redemption replaces password and revokes all sessions atomically. No email-existence disclosure. | Disposable PostgreSQL recovery verification |
| Passkeys: `postgres/passkeys.go`, `webui/passkeys.go` | Configured RP origin, browser-bound one-use expiring challenge, verified credential signature and user verification. Enrollment/management belong to caller. Credential counters persist under a row lock. | Disposable browser virtual-authenticator verification; task-grant denial tests |
| OIDC: `infrastructure/oidc`, `archieui/account_oidc.go`, `webui/auth.go` | Discovery and signed ID token with issuer/client audience/expiry, PKCE, state and nonce. Verified subject resolves to active identity. Browser-local session cannot outlive provider token, and provider credential remains checked. | `TestBrowserFlowVerifiesIDToken`, `TestProviderOutageIsUnavailableThenRecovers`, subject-claim tests; no external provider acceptance implied |
| OIDC settings: `webui/accounts.go`, `postgres/authentication.go` | Instance ownership plus policy; recent sign-in for changes. Public URL cannot change while enrolled passkeys would be orphaned. | `TestAccountBoundary`, `TestAuthenticationSettingsRejectUntrustedOrigins` |
| Org membership/workspaces/agent assignment: `webui/api_orgs.go`, `staterpc/orgs.go`, `postgres/orgs.go` | Own org or instance-owner relationship, allowed role vocabulary, membership escalation/last-owner guards, tenant-scoped SQL. | `TestOrgRPCsActInTheCallersOrg`, `TestSetMembershipRefusesUnknownRole`, org HTTP tests |
| Personal API tokens: `webui/api_personal_tokens.go`, `staterpc/personal_tokens.go`, `postgres/personal_tokens.go` | Token owner comes from principal; store only token hash; revoke only caller's binding. | `TestPersonalTokensWithoutPerson`, `TestPersonalTokenOwner` |
| gRPC caller attribution: `rpcidentity/identity.go` | Authenticated service may forward a principal; State Store resolves memberships/org itself. Task grant metadata is stripped. | `TestCallerAttribution` |
| Agent/task gRPC: `staterpc/task_grants.go` | Durable task-scoped grant, explicit allowed RPC and target task, no definition-pin replacement, no account RPCs. | `TestTaskCredentialsCannotManageAccounts`, `TestTaskCredentialCannotReplaceItsPin`, `TestRecordUsageAuthority`, `TestWorkerPresenceAuthority` |
| Chat HTTP: `webui/api_chat.go` | Server stamps sender and person thread; lists/read/turns/cancel/persona verify session ownership. Browser cannot submit another sender identity. | `TestWebChatOwnership`, `TestWebChatSenderCannotBeSuppliedByBrowser`; HTTP deny matrix |
| Chat history, slash commands and model session tools: `gateway/session_store_postgres.go` | Store filters `Get`, `List`, `GetByChannel`; shared read/write guards check person ownership as well as org. A saved session cannot change its conversation source to claim another person's history. Service curation runs without a person principal. | `TestSessionVisibility`; PostgreSQL smoke for history isolation |
| Chat questions/approvals: `webui/api_chat_ask.go` | Waiting question is bound to the initiating person, in addition to its unguessable ID. | `TestChatQuestionBelongsToInitiatingPerson` |
| Chat downloads: `webui/api_chat_files.go` | Offered file token expires and is bound to the initiating person; requests cannot supply a filesystem path. | `TestChatFileDownload` |
| Per-person memory: `archiegateway/chat_identity.go`, gateway memory tools, `sessioncurator` | Verified web sender identity scopes reads/writes. Curator refuses unidentified or mixed participants instead of guessing a person. | Gateway memory and session-curator tests |
| Workflow/task actions: `webui/api_tasks.go`, `domain/taskactions`, `staterpc` | Policy and stored workspace before action; domain transition, authority and durable dispatch guards remain in force. | HTTP deny matrix, task action/domain tests, task grant tests |
| Incoming webhooks: `forge/webhook`, `captureintake`, access delivery engine | Verify HMAC before parsing; derive source/org from stored source; evaluate source delivery policies and egress rules. No browser-user credential is inferred. | Webhook/capture tests, `TestAuthorizeDelivery` |
| Control-plane configuration, secrets, harness and extensions | Browser policy and instance-only restrictions where registered; service contracts carry principal/org; task grants cannot invoke administrative RPCs. | HTTP deny matrix, `TestAdministrationRoutes`, `TestChannelReloadRoute`, `TestConfineHarnessOrg` |
| Location | Enforcement | Regression evidence |
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Browser credential gate: `webui/auth.go`, `accounts.go` | Account session or verified provider identity; shared dashboard token is not a person when accounts are enabled. No API data before authentication. | `TestAccountBoundary`, `TestAccountSessionFailureIsClosed` |
| Browser policy gate: `webui/authorize.go` | Resolve principal from stored identity; evaluate action against stored org/workspace and resource kind before handler. Missing chain refuses. | `TestHTTPPolicyCannotBeBypassed`, `TestAuthorizeRefusesWithoutAChain`, `TestAuthorizeRecord`, `TestTaskAuthorizationUsesStoredAttributes`, `TestAuthorizeCreateIn` |
| Instance-only HTTP surfaces: `webui/instance_only.go`, server route registration | Hide instance-owned configuration and diagnostics from another org; policy still applies first. | `TestInstanceOnlyHidesTheInstanceFromOtherOrgs`, `TestInstanceAdminOrgs` |
| First setup: `webui/accounts.go`, `postgres/accounts.go` | Initial organization, workspace, instance URL, admin identity and password commit together. Transaction lock closes bootstrap after first account; later requests require `manage_members`. | Disposable PostgreSQL smoke verification for bootstrap race and rollback; account policy tests below |
| Account creation: `webui/accounts.go`, `staterpc/accounts.go`, `postgres/accounts.go` | Cedar `manage_members` at HTTP and RPC; target org is authenticated context. New local accounts cannot request owner role. | `TestAccountManagementUsesPolicy`, `TestAccountBoundary` |
| Local passwords and sessions: `identity/password.go`, `postgres/accounts.go` | Argon2id, independent salts, length/common-password checks, generic login refusal, account throttling, session hashes and expiry, revocation on logout/password change/suspension. | `TestPasswordVerification`, `TestAccountBoundary`; disposable PostgreSQL session verification |
| Transport and CSRF: `webui/accounts.go`, `api_tasks.go` | Password/account mutations require HTTPS or localhost development, JSON, custom CSRF header and same-origin requests. Forwarded headers require explicit trusted-proxy configuration. | `TestAuthenticationTransport`, existing mutation security tests |
| Personal account routes: `webui/accounts.go` | Active signed-in person; principal supplied by server. Password change verifies current password. Sensitive authenticator changes require recent sign-in. No caller-supplied target identity. | `TestAccountBoundary` |
| Recovery: `postgres/account_security.go`, `webui/accounts.go` | Fresh authenticated owner generates a hashed, one-use recovery secret. Redemption replaces password and revokes all sessions atomically. No email-existence disclosure. | Disposable PostgreSQL recovery verification |
| Passkeys: `postgres/passkeys.go`, `webui/passkeys.go` | Configured RP origin, browser-bound one-use expiring challenge, verified credential signature and user verification. Enrollment/management belong to caller. Credential counters persist under a row lock. | Disposable browser virtual-authenticator verification; task-grant denial tests |
| OIDC: `infrastructure/oidc`, `archieui/account_oidc.go`, `webui/auth.go` | Discovery and signed ID token with issuer/client audience/expiry, PKCE, state and nonce. Verified subject resolves to active identity. Browser-local session cannot outlive provider token, and provider credential remains checked. | `TestBrowserFlowVerifiesIDToken`, `TestProviderOutageIsUnavailableThenRecovers`, subject-claim tests; no external provider acceptance implied |
| OIDC settings: `webui/accounts.go`, `postgres/authentication.go` | Instance ownership plus policy; recent sign-in for changes. Public URL cannot change while enrolled passkeys would be orphaned. | `TestAccountBoundary`, `TestAuthenticationSettingsRejectUntrustedOrigins` |
| Org membership/workspaces/agent assignment: `webui/api_orgs.go`, `staterpc/orgs.go`, `postgres/orgs.go` | Own org or instance-owner relationship, allowed role vocabulary, membership escalation/last-owner guards, tenant-scoped SQL. | `TestOrgRPCsActInTheCallersOrg`, `TestSetMembershipRefusesUnknownRole`, org HTTP tests |
| Personal API tokens: `webui/api_personal_tokens.go`, `staterpc/personal_tokens.go`, `postgres/personal_tokens.go` | Token owner comes from principal; store only token hash; revoke only caller's binding. | `TestPersonalTokensWithoutPerson`, `TestPersonalTokenOwner` |
| gRPC caller attribution: `rpcidentity/identity.go` | Authenticated service may forward a principal; State Store resolves memberships/org itself. Task grant metadata is stripped. | `TestCallerAttribution` |
| Agent/task gRPC: `staterpc/task_grants.go` | Durable task-scoped grant, explicit allowed RPC and target task, no definition-pin replacement, no account RPCs. | `TestTaskCredentialsCannotManageAccounts`, `TestTaskCredentialCannotReplaceItsPin`, `TestRecordUsageAuthority`, `TestWorkerPresenceAuthority` |
| Chat HTTP: `webui/api_chat.go` | Server stamps sender and person thread; lists/read/turns/cancel/persona verify session ownership. Browser cannot submit another sender identity. | `TestWebChatOwnership`, `TestWebChatSenderCannotBeSuppliedByBrowser`; HTTP deny matrix |
| Chat history, slash commands and model session tools: `gateway/session_store_postgres.go` | Store filters `Get`, `List`, `GetByChannel`; shared read/write guards check person ownership as well as org. A saved session cannot change its conversation source to claim another person's history. Service curation runs without a person principal. | `TestSessionVisibility`; PostgreSQL smoke for history isolation |
| Chat questions/approvals: `webui/api_chat_ask.go` | Waiting question is bound to the initiating person, in addition to its unguessable ID. | `TestChatQuestionBelongsToInitiatingPerson` |
| Chat downloads: `webui/api_chat_files.go` | Offered file token expires and is bound to the initiating person; requests cannot supply a filesystem path. | `TestChatFileDownload` |
| Per-person memory: `archiegateway/chat_identity.go`, gateway memory tools, `sessioncurator` | Verified web sender identity scopes reads/writes. Curator refuses unidentified or mixed participants instead of guessing a person. | Gateway memory and session-curator tests |
| Workflow/task actions: `webui/api_tasks.go`, `domain/taskactions`, `staterpc` | Policy and stored workspace before action; domain transition, authority and durable dispatch guards remain in force. | HTTP deny matrix, task action/domain tests, task grant tests |
| Incoming webhooks: `captureintake`, access delivery engine | Verify HMAC before parsing; derive source/org from stored source; evaluate source delivery policies and egress rules. No browser-user credential is inferred. | Capture tests, `TestAuthorizeDelivery` |
| Control-plane configuration, secrets and extensions | Browser policy and instance-only restrictions where registered; service contracts carry principal/org; task grants cannot invoke administrative RPCs. | HTTP deny matrix, `TestAdministrationRoutes`, `TestChannelReloadRoute` |
| Audit feed: `webui/api_audit.go`, `domain/audit` | `read_audit` on the `audit` resource; org scope and the instance-wide exception come from the authenticated principal, never the query string. Export carries the same grant, needs an explicit range of at most a year, and is rate-limited per identity, one at a time. Redaction runs in the State Store adapter before an entry crosses gRPC. | `TestReadAuditRoleBoundary`, `TestAuditRoutesFollowTheReadAuditRole`, `TestHTTPPolicyCannotBeBypassed`, `TestAuditErrorMapping`, `TestAuditCSVCellNeutralisesFormulas` |
| Live HTTP/SSE and diagnostics | Authenticated policy gate applies before stream creation; org-scoped event reads; instance logs require administrative visibility. | HTTP deny matrix, instance-only tests, `TestServiceLogsRequireInstanceCredential` |
| Background schedules, dispatch, curation | Service/agent authority, not an implicit browser user. Task-scoped grants and org scopes remain distinct from initiating operator attribution. | Existing dispatch, grant, memory and org-scope tests |
| Live HTTP/SSE and diagnostics | Authenticated policy gate applies before stream creation; org-scoped event reads; instance logs require administrative visibility. | HTTP deny matrix, instance-only tests, `TestServiceLogsRequireInstanceCredential` |
| Background schedules, dispatch, curation | Service/agent authority, not an implicit browser user. Task-scoped grants and org scopes remain distinct from initiating operator attribution. | Existing dispatch, grant, memory and org-scope tests |
The policy HTTP matrix enumerates each registered protected route. It checks
both anonymous refusal and refusal by an explicit Cedar forbid, using the real
@@ -146,8 +146,6 @@ action/resource; the handler may impose a stricter record or instance boundary.
| GET | `/api/event-types` |
| GET | `/api/extensions` |
| GET | `/api/extensions/catalogue` |
| GET | `/api/harness/bindings` |
| GET | `/api/harness/terminal` |
| GET | `/api/identities` |
| GET | `/api/logs` |
| GET | `/api/mappings` |
+2 -1
View File
@@ -84,7 +84,8 @@ console or page error fails the check. One module covers one behaviour;
families share a prefix: `audit-*` for the audit page (redirect,
filters, revert, runtime, views-export, retention-live, phone),
`workflow-*` for the canvas (loading, validation, phone-layout, logic),
`chat-composer` for chat input.
`chat-composer` for chat input, `chat-dock-*` for the chat dock (pin, drag-cancel,
layout, resize, drafts, picker, phone).
`routes` loads every static route and flags text with stray leading,
trailing or doubled spaces. `seeded` checks the seed is visible.
+3 -3
View File
@@ -13,7 +13,7 @@ module.exports = async ({ page, go, shot, fail, settled, tolerate }) => {
await go('/tasks');
await page.getByRole('button', { name: 'Jump to', exact: true }).click();
await page.getByRole('option', { name: 'New task', exact: true }).click();
const dialog = page.getByRole('dialog');
const dialog = page.getByRole('dialog', { name: 'New task' });
await dialog.waitFor();
await settled();
const bounds = await dialog.boundingBox();
@@ -40,8 +40,8 @@ module.exports = async ({ page, go, shot, fail, settled, tolerate }) => {
assert.ok(await skip.evaluate(el => el === document.activeElement), 'Skip link is not the first keyboard stop');
await page.keyboard.press('Enter');
assert.equal(await page.evaluate(() => document.activeElement?.id), 'main-content');
await page.getByRole('button', { name: 'Toggle Sidebar', exact: true }).click();
await page.getByRole('navigation', { name: 'Sections', exact: true }).getByRole('link', { name: 'Tasks', exact: true }).click();
await page.getByRole('button', { name: 'Sections', exact: true }).click();
await page.getByRole('menuitem', { name: 'Tasks', exact: true }).click();
await page.waitForFunction(() => document.activeElement?.id === 'main-content', null, { timeout: 5000 }).catch(() => {});
assert.equal(await page.evaluate(() => document.activeElement?.id), 'main-content', 'route navigation did not focus main');
await page.getByRole('button', { name: 'Jump to', exact: true }).click();
+45 -3
View File
@@ -1,10 +1,11 @@
// The chat composer: IME confirmation never submits the draft, Shift+Enter
// inserts a newline, and ordinary Enter submits and clears.
// inserts a newline, ordinary Enter submits and clears, and # attaches a task.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
module.exports = async ({ page, go, shot, tolerate }) => {
tolerate(/api\/tasks/);
await go('/events');
const composer = page.getByRole('textbox', { name: 'Message Archie', exact: true });
const composer = page.getByRole('combobox', { name: 'Message Archie', exact: true });
await composer.waitFor();
await composer.fill('Composition in progress');
const sent = [];
@@ -24,5 +25,46 @@ module.exports = async ({ page, go, shot }) => {
await composer.press('Enter');
assert.equal((await request).postDataJSON().text, 'Ordinary Enter submits');
assert.equal(await composer.inputValue(), '');
let failTasks = true;
await page.route('**/api/tasks?*', async route => {
if (failTasks) return route.fulfill({ status: 500, contentType: 'text/plain', body: 'task store down' });
await route.fulfill({
contentType: 'application/json',
body: JSON.stringify([
{ id: 1861, title: "Chat composer: '#' context dropdown", status: 'running' },
{ id: 1842, title: 'Retry stalled task runs', status: 'done' },
]),
});
});
const tasksPalette = page.getByRole('listbox', { name: 'Tasks' });
await composer.fill('Look at #');
await tasksPalette.getByRole('alert').waitFor();
assert.equal(await tasksPalette.getByRole('option').count(), 0);
failTasks = false;
await tasksPalette.getByRole('button', { name: 'Retry' }).click();
await tasksPalette.getByRole('option').first().waitFor();
assert.equal(await tasksPalette.getByRole('option').count(), 2);
await composer.press('Escape');
await tasksPalette.waitFor({ state: 'hidden' });
await composer.fill('Look at #184 now');
await composer.evaluate(el => el.setSelectionRange(12, 12));
await composer.dispatchEvent('input');
await tasksPalette.getByRole('option').first().waitFor();
assert.equal(await tasksPalette.getByRole('option').count(), 1);
await composer.press('Tab');
await tasksPalette.waitFor({ state: 'hidden' });
assert.equal(await composer.inputValue(), 'Look at now');
await page.getByRole('list', { name: 'Attached tasks' }).getByText('#1842').waitFor();
const tagged = page.waitForRequest('**/api/chat/stream');
await composer.press('Enter');
const text = (await tagged).postDataJSON().text;
assert.ok(text.startsWith('Look at now') && text.includes('#1842 Retry stalled task runs'), text);
assert.equal(await page.getByRole('list', { name: 'Attached tasks' }).count(), 0);
await shot('chat-composition');
};
+42
View File
@@ -0,0 +1,42 @@
// Each conversation keeps its own unsent text and attached tasks. Starting a
// new chat opens an empty composer, switching back restores the earlier
// draft, and hiding and reopening the conversation loses nothing.
const assert = require('node:assert/strict');
const h = require('./helpers/chat-dock.cjs');
module.exports = async ({ page, go, shot }) => {
await page.route('**/api/tasks?*', (route) =>
route.fulfill({ contentType: 'application/json', body: JSON.stringify([{ id: 1861, title: 'Task picker', status: 'running' }]) }),
);
await h.load(page, go);
await h.expand(page);
const composer = h.composerOf(page);
const tags = page.getByRole('list', { name: 'Attached tasks' });
await composer.fill('draft for the first chat');
await composer.fill('#');
await page.getByRole('listbox', { name: 'Tasks' }).getByRole('option').first().click();
await tags.getByText('#1861').waitFor();
await composer.fill('draft for the first chat');
await page.getByRole('button', { name: 'New chat' }).click();
await h.until(async () => (await composer.inputValue()) === '' && (await tags.count()) === 0, 'a new chat inherited the first chat draft');
await composer.fill('draft for the second chat');
await h.hideOf(page).click();
await h.expand(page);
assert.equal(await composer.inputValue(), 'draft for the second chat', 'hiding the conversation lost the draft');
const pick = async (index) => {
await page.getByRole('combobox', { name: 'Conversation' }).click();
await page.getByRole('option').nth(index).click();
};
await pick(1);
await h.until(async () => (await composer.inputValue()) === 'draft for the first chat', 'switching back did not restore the first draft');
await tags.getByText('#1861').waitFor();
await shot('first-chat-draft');
await pick(0);
await h.until(async () => (await composer.inputValue()) === 'draft for the second chat', 'switching forward did not restore the second draft');
assert.equal(await tags.count(), 0, 'the first chat task tag leaked into the second chat');
};
+27
View File
@@ -0,0 +1,27 @@
// A drag the browser cancels (a touch turned into a scroll, a lost pointer)
// leaves the dock where it was: nothing pins, nothing stays offset, and the
// next drag still works.
const assert = require('node:assert/strict');
const h = require('./helpers/chat-dock.cjs');
module.exports = async ({ page, go }) => {
await h.load(page, go);
await h.expand(page);
const dock = h.dockOf(page);
const before = await dock.boundingBox();
const header = dock.locator('div.cursor-grab');
await h.dragTo(page, 1430);
const dragging = await dock.getAttribute('style');
assert.ok(/translate/.test(dragging || ''), 'the drag never started, so cancelling it proves nothing');
await header.dispatchEvent('pointercancel');
await page.mouse.up();
await h.until(async () => !/translate/.test((await dock.getAttribute('style')) || ''), 'the dock stayed offset after the drag was cancelled');
assert.deepEqual(await dock.boundingBox(), before, 'cancelling the drag moved the dock');
assert.equal((await h.saved(page)).side, null, 'a cancelled drag pinned the dock');
await h.dragTo(page, 1430);
await page.mouse.up();
await h.until(async () => (await h.saved(page)).side === 'right', 'a drag after a cancelled one did not pin');
};
+46
View File
@@ -0,0 +1,46 @@
// The saved dock layout: a stored mode and width are honoured, widths outside
// the allowed range are clamped, unreadable JSON falls back to a usable
// floating dock that saves again, and visiting phone width never overwrites
// the desktop choice.
const assert = require('node:assert/strict');
const h = require('./helpers/chat-dock.cjs');
module.exports = async ({ page, go, shot, tolerate }) => {
tolerate(/JSON|SyntaxError/);
const dock = h.dockOf(page);
await h.load(page, go, JSON.stringify({ mode: 'left', w: 500 }));
await h.expand(page);
let box = await dock.boundingBox();
h.near(box.x, 0, 'saved left pin');
h.near(box.width, 500, 'saved width');
assert.ok((await h.mainRect(page)).x >= 499, 'page did not reflow beside the restored dock');
await h.load(page, go, JSON.stringify({ mode: 'right', w: -4 }));
await h.expand(page);
h.near((await dock.boundingBox()).width, 320, 'a negative width clamps to the minimum');
await h.load(page, go, JSON.stringify({ mode: 'right', w: 9999 }));
await h.expand(page);
h.near((await dock.boundingBox()).width, 720, 'a huge width clamps to the maximum');
await h.load(page, go, '{broken');
await h.expand(page);
box = await dock.boundingBox();
assert.ok(box.height < 900 && box.x > 0 && box.x + box.width < 1440, 'unreadable layout did not fall back to a floating dock');
await h.composerOf(page).fill('still usable');
await h.dragTo(page, 1430);
await page.mouse.up();
await h.until(async () => (await h.saved(page)).mode === 'right', 'the dock did not save a layout over the unreadable one');
await shot('recovered');
await h.load(page, go, JSON.stringify({ mode: 'left', w: 460 }));
const layout = await h.stored(page);
await page.setViewportSize({ width: 390, height: 844 });
await h.expand(page);
box = await dock.boundingBox();
assert.ok(box.x >= 0 && box.x + box.width <= 390, 'the dock overflows the phone viewport');
await page.setViewportSize({ width: 1440, height: 900 });
assert.equal(await h.stored(page), layout, 'visiting phone width rewrote the saved layout');
await h.until(async () => Math.abs((await dock.boundingBox()).width - 460) <= 1, 'the desktop layout did not return after phone width');
};
+41
View File
@@ -0,0 +1,41 @@
// The chat dock at phone width: the bar and the open conversation fit the
// screen on a few pages, a stored desktop pin is ignored, the composer stays
// reachable, and the dock adds no sideways scroll. The page's own overflow is
// phone-overflow's to report, so the dock is measured against the page
// without it.
const assert = require('node:assert/strict');
const h = require('./helpers/chat-dock.cjs');
module.exports = async ({ page, go, shot, tolerate }) => {
tolerate(/extensions\/catalogue/);
await page.setViewportSize({ width: 390, height: 844 });
const fits = async (label) => {
const { scroll, bare, inner } = await page.evaluate(() => {
const root = document.querySelector('aside[aria-label="Chat with Archie"]').parentElement;
const scroll = document.documentElement.scrollWidth;
root.style.display = 'none';
const bare = document.documentElement.scrollWidth;
root.style.display = '';
return { scroll, bare, inner: window.innerWidth };
});
assert.ok(scroll <= Math.max(bare, inner), `${label}: the dock widens the page (${scroll} > ${Math.max(bare, inner)})`);
const box = await h.dockOf(page).boundingBox();
assert.ok(box.x >= 0 && box.x + box.width <= inner, `${label}: dock leaves the screen (${box.x}..${box.x + box.width})`);
assert.ok(box.y >= 0 && box.y + box.height <= 844, `${label}: dock leaves the screen vertically`);
};
for (const path of ['/events', '/account', '/org/agents']) {
await h.load(page, go, JSON.stringify({ side: 'right', width: 420 }));
await go(path);
await fits(`${path} collapsed`);
await h.expand(page);
await fits(`${path} open`);
assert.equal(await page.evaluate(() => document.documentElement.style.getPropertyValue('--chat-pin-r')), '0px', `${path}: the page reserved room for a pin on a phone`);
const composer = await h.composerOf(page).boundingBox();
assert.ok(composer.y + composer.height <= 844 && composer.x >= 0 && composer.x + composer.width <= 390, `${path}: composer is off screen`);
assert.equal(await h.dividerOf(page).count(), 0, `${path}: a phone shows the pin divider`);
await h.composerOf(page).fill('A long unbroken line '.repeat(20));
await fits(`${path} long draft`);
await shot(path);
}
};
+59
View File
@@ -0,0 +1,59 @@
// The # task picker by keyboard: arrows move the selection and wrap, Enter
// attaches the selected task, Escape closes the picker and leaves the
// conversation open, and an IME confirmation Enter never picks.
const assert = require('node:assert/strict');
const h = require('./helpers/chat-dock.cjs');
const tasks = [
{ id: 1861, title: 'Task picker', status: 'running' },
{ id: 1842, title: 'Retry stalled task runs', status: 'done' },
{ id: 1830, title: 'Filter forge text', status: 'queued' },
];
module.exports = async ({ page, go, shot }) => {
await page.route('**/api/tasks?*', (route) => route.fulfill({ contentType: 'application/json', body: JSON.stringify(tasks) }));
await h.load(page, go);
await h.expand(page);
const composer = h.composerOf(page);
const palette = page.getByRole('listbox', { name: 'Tasks' });
const options = palette.getByRole('option');
const selected = () => options.evaluateAll((els) => els.findIndex((el) => el.getAttribute('aria-selected') === 'true'));
const tags = page.getByRole('list', { name: 'Attached tasks' });
await composer.fill('Look at #');
await options.first().waitFor();
assert.equal(await options.count(), 3);
assert.equal(await selected(), 0);
await shot('picker');
await composer.press('ArrowDown');
assert.equal(await selected(), 1);
assert.equal(await composer.getAttribute('aria-activedescendant'), 'slash-palette-option-1');
await composer.press('ArrowUp');
await composer.press('ArrowUp');
assert.equal(await selected(), 2, 'ArrowUp from the first row did not wrap to the last');
await composer.press('ArrowDown');
assert.equal(await selected(), 0, 'ArrowDown from the last row did not wrap to the first');
await composer.press('ArrowDown');
for (const event of [{ isComposing: true }, { keyCode: 229 }]) {
await composer.dispatchEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true, ...event });
assert.equal(await options.count(), 3, 'an IME confirmation closed the picker');
assert.equal(await tags.count(), 0, 'an IME confirmation attached a task');
}
await composer.press('Enter');
await palette.waitFor({ state: 'hidden' });
await tags.getByText('#1842').waitFor();
assert.equal(await tags.getByRole('listitem').count(), 1);
assert.equal(await composer.inputValue(), 'Look at ', 'the # token stayed in the text');
assert.ok(await composer.evaluate((el) => document.activeElement === el), 'focus left the composer');
await composer.fill('Look at #');
await options.first().waitFor();
await composer.press('Escape');
await palette.waitFor({ state: 'hidden' });
assert.equal(await h.hideOf(page).isVisible(), true, 'Escape on the picker also closed the conversation');
await composer.press('Escape');
await h.hideOf(page).waitFor({ state: 'hidden' });
};
+52
View File
@@ -0,0 +1,52 @@
// Pinning the chat dock: dragging its header to an edge pins it there and the
// page reflows beside it; double-clicking the header unpins it; hiding the
// conversation gives the page back its width; the choice survives a reload.
const assert = require('node:assert/strict');
const h = require('./helpers/chat-dock.cjs');
module.exports = async ({ page, go, shot }) => {
await h.load(page, go);
await h.expand(page);
const dock = h.dockOf(page);
const free = await h.mainRect(page);
const floating = await dock.boundingBox();
assert.ok(floating.height < 900, 'the dock starts as a floating card');
await h.dragTo(page, 1430);
await page.mouse.up();
await h.until(async () => (await h.saved(page)).side === 'right', 'dragging to the right edge did not pin right');
const right = await dock.boundingBox();
h.near(right.x + right.width, 1440, 'right pin touches the right edge');
h.near(right.height, 900, 'a pinned dock is full height');
const reflowed = await h.mainRect(page);
assert.ok(reflowed.x + reflowed.width <= right.x + 1, `page content runs under the pinned dock: ${reflowed.x + reflowed.width} > ${right.x}`);
assert.ok(reflowed.width < free.width, 'the page did not give up any width');
assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth), 'pinning made the page scroll sideways');
await shot('pinned-right');
await page.reload();
await h.expand(page);
await h.until(async () => Math.abs((await dock.boundingBox()).x - right.x) <= 1, 'the right pin did not survive a reload');
await h.hideOf(page).click();
await h.until(async () => Math.abs((await h.mainRect(page)).width - free.width) <= 1, 'hiding the conversation kept the page narrowed');
await h.expand(page);
await h.until(async () => Math.abs((await dock.boundingBox()).x - right.x) <= 1, 'reopening did not restore the pin');
const strip = await h.grip(page);
await page.mouse.dblclick(strip.x, strip.y);
await h.until(async () => (await h.saved(page)).side === null, 'double-clicking the header did not unpin');
assert.ok((await dock.boundingBox()).height < 900, 'an unpinned dock is a floating card again');
h.near((await h.mainRect(page)).width, free.width, 'the page returns to its full width');
await h.dragTo(page, 10);
await page.mouse.up();
await h.until(async () => (await h.saved(page)).side === 'left', 'dragging to the left edge did not pin left');
const left = await dock.boundingBox();
h.near(left.x, 0, 'left pin touches the left edge');
assert.ok((await h.mainRect(page)).x >= left.x + left.width - 1, 'page content runs under the left-pinned dock');
await shot('pinned-left');
await page.mouse.dblclick((await h.grip(page)).x, (await h.grip(page)).y);
await h.until(async () => (await h.saved(page)).side === null, 'double-clicking did not unpin the left pin');
};
+37
View File
@@ -0,0 +1,37 @@
// The pinned dock's divider is a keyboard separator: the arrow toward the
// page widens the dock, the arrow away narrows it, both stop at the allowed
// range, and the width is saved.
const assert = require('node:assert/strict');
const h = require('./helpers/chat-dock.cjs');
const width = (page) => h.dockOf(page).boundingBox().then((b) => Math.round(b.width));
const value = (page) => h.dividerOf(page).getAttribute('aria-valuenow').then(Number);
module.exports = async ({ page, go }) => {
const divider = h.dividerOf(page);
for (const [side, grow, shrink] of [['right', 'ArrowLeft', 'ArrowRight'], ['left', 'ArrowRight', 'ArrowLeft']]) {
await h.load(page, go, JSON.stringify({ side, width: 420 }));
await h.expand(page);
await divider.focus();
assert.equal(await value(page), 420);
assert.equal(await divider.getAttribute('aria-valuemin'), '320');
await page.keyboard.press(grow);
await h.until(async () => (await value(page)) === 436 && (await width(page)) === 436, `${side}: ${grow} did not widen by 16`);
await page.keyboard.press(shrink);
await page.keyboard.press(shrink);
await h.until(async () => (await value(page)) === 404 && (await width(page)) === 404, `${side}: ${shrink} did not narrow by 16`);
assert.equal((await h.saved(page)).width, 404, `${side}: the width was not saved`);
await page.keyboard.press('ArrowUp');
assert.equal(await value(page), 404, `${side}: a vertical arrow resized the dock`);
for (let i = 0; i < 12; i++) await page.keyboard.press(shrink);
await h.until(async () => (await width(page)) === 320, `${side}: the dock narrowed past its minimum`);
assert.equal(await value(page), 320);
for (let i = 0; i < 30; i++) await page.keyboard.press(grow);
await h.until(async () => (await width(page)) === 720, `${side}: the dock widened past its maximum`);
assert.equal(await value(page), 720);
}
};
+1 -2
View File
@@ -12,8 +12,7 @@ module.exports = async ({ page, go, shot }) => {
agent = await response.json();
};
const openSettings = async () => {
await go('/workflows');
await page.getByRole('button', { name: /^implement/ }).click();
await go('/workflows/implement');
const runPicker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
if (await runPicker.count()) { await runPicker.click(); await page.getByRole('option', { name: 'Definition', exact: true }).click(); }
await page.locator('.vue-flow__node').filter({ hasText: 'Workflow' }).first().click();
+63
View File
@@ -0,0 +1,63 @@
// Shared handles for the chat dock checks: the dock's own storage key, its
// landmarks, and the pointer gestures that pin it.
const assert = require('node:assert/strict');
const KEY = 'archie.chat.dock.v2';
const dockOf = (page) => page.getByRole('complementary', { name: 'Chat with Archie' });
const composerOf = (page) => page.getByRole('combobox', { name: 'Message Archie', exact: true });
const hideOf = (page) => page.getByRole('button', { name: 'Hide conversation' });
const dividerOf = (page) => page.getByRole('separator', { name: 'Resize chat' });
const stored = (page) => page.evaluate((key) => localStorage.getItem(key), KEY);
const saved = async (page) => JSON.parse(await stored(page));
// Loads /events with the given stored layout (a string, or null for none).
async function load(page, go, layout = null) {
await go('/events');
await page.evaluate(([key, value]) => (value === null ? localStorage.removeItem(key) : localStorage.setItem(key, value)), [KEY, layout]);
await go('/events');
}
// Focusing the composer is how the operator opens the conversation.
async function expand(page) {
await composerOf(page).focus();
await hideOf(page).waitFor();
}
// Retries an assertion until it holds: the dock settles over a few frames.
async function until(check, message, timeout = 5000) {
const end = Date.now() + timeout;
let last;
for (;;) {
try {
const ok = await check();
if (ok) return;
last = ok;
} catch (e) {
last = e;
}
if (Date.now() > end) throw new Error(`${message}${last instanceof Error ? `: ${last.message}` : ''}`);
await new Promise((r) => setTimeout(r, 50));
}
}
const near = (a, b, message, tolerance = 1) => assert.ok(Math.abs(a - b) <= tolerance, `${message}: ${a} is not within ${tolerance} of ${b}`);
// The empty strip at the top of the header, where a drag starts.
async function grip(page) {
const box = await dockOf(page).boundingBox();
return { x: box.x + box.width / 2, y: box.y + 8 };
}
async function dragTo(page, x, steps = 10) {
const from = await grip(page);
await page.mouse.move(from.x, from.y);
await page.mouse.down();
await page.mouse.move(x, from.y, { steps });
return from;
}
const mainRect = (page) => page.locator('#main-content').boundingBox();
module.exports = { KEY, dockOf, composerOf, hideOf, dividerOf, stored, saved, load, expand, until, near, grip, dragTo, mainRect };
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports=async({page,go,shot,tolerate})=>{
if(new URL(route.request().url()).searchParams.has('workflow')) await route.fulfill({status:200,contentType:'application/json',body:'unreadable response'});
else await route.continue();
});
await go('/workflows');
await go('/workflows/implement');
await page.getByRole('alert').filter({hasText:'Could not load recent runs'}).waitFor();
await page.getByRole('tab',{name:/^Runs/}).click();
assert.equal(await page.getByText('No runs yet',{exact:true}).count(),0);
+2 -2
View File
@@ -8,7 +8,7 @@ module.exports = async ({ page, go, shot, tolerate }) => {
tolerate(ABSENT);
await go('/');
assert.equal((await selectOrg(page, ORG.beta)).status(), 204);
await go('/workflows?workflow=feasibility');
await go('/workflows/feasibility');
const origin = new URL(page.url()).origin;
const headers = { 'X-Archie-CSRF': '1', Origin: origin };
const created = await page.request.post(`${origin}/api/bindings`, {
@@ -22,7 +22,7 @@ module.exports = async ({ page, go, shot, tolerate }) => {
assert.equal(created.status(), 201, `binding on the built-in schedule mapping refused: ${await created.text()}`);
const binding = await created.json();
assert.equal(binding.org_id, ORG.beta);
await go('/workflows?workflow=feasibility');
await go('/workflows/feasibility');
await page.getByText('Starts when').first().waitFor();
await shot('beta-trigger');
} finally {
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = async ({ page, go, shot }) => {
await go('/workflows');
assert.equal(await page.getByText('No workflows', { exact: true }).count(), 0, 'loading presented as empty');
await page.getByText('Loading workflows…', { exact: true }).waitFor({ state: 'hidden' });
await page.getByRole('button', { name: /^implement/ }).click();
await page.getByRole('link', { name: /^implement/ }).click();
assert.equal(await page.getByText(/workflow implement has no steps/).count(), 0, 'late definition left an empty canvas');
await page.locator('.vue-flow__node').filter({ hasText: 'Repository' }).first().waitFor();
await shot('loaded');
+13 -10
View File
@@ -29,25 +29,28 @@ module.exports = async ({ page, go, shot, settled }) => {
const definition = resource.resource.value.definitions.find(entry => entry.id === 'feasibility');
definition.yaml = definition.yaml.replace(/\bid: assess\b/, 'id: Write a Product Requirement Document').replaceAll('steps.assess.', 'steps.Write a Product Requirement Document.');
await page.route('**/api/control-plane/resources/workflow-definitions', route => route.fulfill({ json: resource }));
await go('/workflows?workflow=feasibility');
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
await go('/workflows/feasibility');
await page.getByRole('tab', { name: 'History', exact: true }).click();
const yaml = await page.getByLabel('Workflow YAML', { exact: true }).inputValue();
assert.ok(yaml.includes('id: write-a-product-requirement-document'));
assert.ok(yaml.includes('steps.write-a-product-requirement-document.result'));
assert.ok(!yaml.includes('steps.Write a Product Requirement Document'));
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
await page.getByRole('tab', { name: 'Canvas', exact: true }).first().click();
const definitionPicker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
if (await definitionPicker.count()) { await definitionPicker.click(); await page.getByRole('option', { name: 'Definition', exact: true }).click(); }
const approval = page.locator('.vue-flow__node').filter({ hasText: 'Approval' }).first();
await panTo(approval);
await approval.click();
const chip = approval.getByRole('button', { name: 'write-a-product-requirement-document', exact: true });
await chip.waitFor();
await chip.click();
assert.match(await approval.getByLabel('Plan', { exact: true }).inputValue(), /steps\.write-a-product-requirement-document\.summary/);
await shot('legacy-reference');
await page.keyboard.press('Escape');
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
await page.getByRole('tab', { name: 'History', exact: true }).click();
const field = page.getByLabel('Workflow YAML', { exact: true });
await field.fill((await field.inputValue()).replace('type: repo.prepare', 'type: repo.prepare\n when: not-a-valid-expression'));
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
await page.getByRole('tab', { name: 'Canvas', exact: true }).first().click();
const problem = page.locator('.vue-flow__node').filter({ hasText: 'Prepare worktree' }).first().locator('svg.text-danger');
await problem.waitFor();
const toolbarProblem = page.getByRole('status').filter({ has: page.locator('svg') });
@@ -68,7 +71,7 @@ module.exports = async ({ page, go, shot, settled }) => {
await page.route('**/api/tasks/999999/*?*', route => route.fulfill({ json: {} }));
await page.route('**/api/tasks/999999/debug', route => route.fulfill({ json: {} }));
await page.route('**/api/tasks/999999/attempts', route => route.fulfill({ json: { attempts: [{ attempt: 1, stages: [{ name: 'Write a Product Requirement Document', status: 'failed', error: 'Historical failure' }] }] } }));
await go('/workflows?workflow=feasibility');
await go('/workflows/feasibility');
const picker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
await picker.waitFor();
assert.match(await picker.innerText(), /Run #999999/);
@@ -89,7 +92,7 @@ module.exports = async ({ page, go, shot, settled }) => {
await page.getByRole('option', { name: 'Definition', exact: true }).click();
assert.equal(await picker.innerText(), 'Definition');
await shot('definition-picker');
await go('/workflows?workflow=triage');
await go('/workflows/triage');
const runPicker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
if (await runPicker.count()) { await runPicker.click(); await page.getByRole('option', { name: 'Definition', exact: true }).click(); }
await page.locator('.vue-flow').hover();
@@ -105,14 +108,14 @@ module.exports = async ({ page, go, shot, settled }) => {
await target.press('Home');
await shot('dynamic-handoff');
await page.keyboard.press('Escape');
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
await page.getByRole('tab', { name: 'History', exact: true }).click();
assert.ok((await page.getByLabel('Workflow YAML', { exact: true }).inputValue()).includes('steps.classify.result.alternative'));
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
await page.getByRole('tab', { name: 'Canvas', exact: true }).first().click();
await panTo(handoff);
await handoff.click();
await target.fill('implement');
await page.keyboard.press('Escape');
await page.keyboard.press('Escape');
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
await page.getByRole('tab', { name: 'History', exact: true }).click();
assert.ok((await page.getByLabel('Workflow YAML', { exact: true }).inputValue()).includes('workflow: implement'));
};
+29 -11
View File
@@ -6,8 +6,23 @@ const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot, settled }) => {
await page.setViewportSize({ width: 390, height: 844 });
// The list is a page at phone width: rows open the workflow, and the
// enabled switch is on the row and on the workflow page.
await go('/workflows');
const row = page.getByRole('link', { name: /^implement/ });
await row.waitFor();
const listWidth = await page.evaluate(() => ({ scrollWidth: document.documentElement.scrollWidth, width: innerWidth }));
assert.equal(listWidth.scrollWidth, listWidth.width, 'workflow list scrolls horizontally');
await shot('list');
await page.getByRole('switch', { name: 'implement enabled' }).waitFor();
await row.click();
await page.waitForURL(/\/workflows\/implement$/);
await page.locator('.workflow-canvas').waitFor();
await page.getByRole('switch', { name: 'implement enabled' }).waitFor();
await go('/workflows?workflow=implement');
assert.match(page.url(), /\/workflows\/implement$/, 'legacy ?workflow= link did not reach the workflow page');
for (const workflow of ['implement', 'feasibility']) {
await go(`/workflows?workflow=${workflow}`);
await go(`/workflows/${workflow}`);
const canvas = page.locator('.workflow-canvas');
await canvas.waitFor();
const dimensions = await page.evaluate(() => ({
@@ -31,14 +46,17 @@ module.exports = async ({ page, go, shot, settled }) => {
left: el.getBoundingClientRect().left, right: el.getBoundingClientRect().right,
})));
assert.ok(nodes.every(node => node.left >= box.x && node.right <= box.x + box.width), 'branch lanes clipped horizontally');
const controls = await page.getByRole('button', { name: 'Zoom in', exact: true }).boundingBox();
const flow = await canvas.locator('.vue-flow').boundingBox();
assert.ok(controls.y >= flow.y + flow.height, 'zoom control overlays graph');
const controls = await page.getByRole('group', { name: 'Zoom', exact: true }).boundingBox();
const covered = await page.locator('.vue-flow__node').evaluateAll((elements, c) => elements.some((el) => {
const r = el.getBoundingClientRect();
return r.left < c.x + c.width && r.right > c.x && r.top < c.y + c.height && r.bottom > c.y;
}), controls);
assert.ok(!covered, 'zoom controls cover a step');
await shot(workflow);
const step = page.locator('.vue-flow__node').filter({ hasText: 'Prepare worktree' }).first();
assert.equal(await step.locator('[data-slot="badge"]').innerText(), 'Prepare worktree');
assert.match(await step.innerText(), /^\d+\.\s+Prepare worktree$/);
await step.click();
const dialog = page.getByRole('dialog');
const dialog = page.locator('[role="dialog"][data-slot="dialog-content"]');
await dialog.waitFor();
const dialogBox = await dialog.boundingBox();
assert.ok(dialogBox.x >= 0 && dialogBox.x + dialogBox.width <= 390, 'step editor exceeds phone width');
@@ -47,19 +65,19 @@ module.exports = async ({ page, go, shot, settled }) => {
await shot(`${workflow}-step`);
await page.keyboard.press('Escape');
await run.click();
await page.getByRole('dialog').waitFor();
await page.locator('[role="dialog"][data-slot="dialog-content"]').waitFor();
await shot(`${workflow}-run`);
await page.keyboard.press('Escape');
}
// YAML must not make the page scroll at phone width.
await go('/workflows?workflow=feasibility');
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
await go('/workflows/feasibility');
await page.getByRole('tab', { name: 'History', exact: true }).click();
await settled();
const yamlPage = await page.evaluate(() => ({
scrollHeight: document.documentElement.scrollHeight, height: innerHeight,
}));
assert.equal(yamlPage.scrollHeight, yamlPage.height, 'YAML causes page scroll');
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
await page.getByRole('tab', { name: 'Canvas', exact: true }).first().click();
// A pinned historical run keeps its header visible on the canvas.
const response = await page.request.get(new URL('/api/control-plane/resources/workflow-definitions', page.url()).href);
const resource = await response.json();
@@ -73,7 +91,7 @@ module.exports = async ({ page, go, shot, settled }) => {
await page.route('**/api/tasks/999999/*?*', route => route.fulfill({ json: {} }));
await page.route('**/api/tasks/999999/debug', route => route.fulfill({ json: {} }));
await page.route('**/api/tasks/999999/attempts', route => route.fulfill({ json: { attempts: [{ attempt: 1, stages: [] }] } }));
await go('/workflows?workflow=feasibility');
await go('/workflows/feasibility');
const picker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
await picker.waitFor();
assert.match(await picker.innerText(), /Run #999999/);
+4 -3
View File
@@ -1,10 +1,11 @@
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
await go('/workflows');
await page.getByRole('button', {name:/^implement/}).click();
await go('/workflows/implement');
const runPicker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
if (await runPicker.count()) { await runPicker.click(); await page.getByRole('option', { name: 'Definition', exact: true }).click(); }
await page.locator('.vue-flow__node').filter({hasText:'Prepare worktree'}).first().click();
const more=page.getByRole('button',{name:'More',exact:true}).filter({hasText:'More'});
if (await more.getAttribute('aria-expanded')==='false') await more.click();
const condition=page.getByLabel('Run only when', {exact:true});
await condition.fill('what');
await page.getByRole('alert').filter({hasText:'when must name'}).first().waitFor();
@@ -17,7 +18,7 @@ module.exports = async ({ page, go, shot }) => {
await page.getByLabel('Run only when',{exact:true}).focus();
await page.getByText('Enter a number zero or greater.',{exact:true}).waitFor({state:'hidden'});
await page.getByRole('combobox',{name:'Unit',exact:true}).selectOption('m');
await page.getByRole('tab',{name:'YAML',exact:true}).click();
await page.getByRole('tab',{name:'History',exact:true}).click();
assert.match(await page.getByLabel('Workflow YAML',{exact:true}).inputValue(), /backoff: 30s/);
await shot('validated');
};
+15 -1
View File
@@ -72,7 +72,10 @@ start_pg() {
prepare() {
mkdir -p "$dir"/{bin,logs,pids} "$XDG_CONFIG_HOME/archie" "$XDG_DATA_HOME" "$XDG_STATE_HOME"
[ -f "$XDG_CONFIG_HOME/archie/config.toml" ] || cp "$repo/config.example.toml" "$XDG_CONFIG_HOME/archie/config.toml"
sed "s#^database_url = .*#database_url = \"postgres://archie@127.0.0.1:$pgport/archie?sslmode=disable\"#" \
# The services serve from the least-privilege role and migrate as the schema
# owner; initdb's archie role is the throwaway server's superuser only.
sed -e "s#^database_url = .*#database_url = \"postgres://archie_runtime@127.0.0.1:$pgport/archie?sslmode=disable\"#" \
-e "s#^migration_database_url = .*#migration_database_url = \"postgres://archie_migrator@127.0.0.1:$pgport/archie?sslmode=disable\"#" \
"$repo/deployments/dev.toml" >"$dir/dev.toml"
local version
version=$(git -C "$repo" describe --tags --exact-match --match 'v[0-9]*' 2>/dev/null || true)
@@ -101,6 +104,16 @@ start_service() {
spawn "$1" "$repo" "$dir/bin/$1" -config-overlay "$dir/dev.toml"
}
# provision_roles creates the least-privilege roles the stack connects as. The
# throwaway server runs with trust auth, so the role URLs' passwords are never
# checked; they are here only because provision sets the role password it reads.
provision_roles() {
"$dir/bin/archie-state-store" provision \
-admin-url "postgres://archie@127.0.0.1:$pgport/archie?sslmode=disable" \
-runtime-url "postgres://archie_runtime:e2e@127.0.0.1:$pgport/archie?sslmode=disable" \
-migration-url "postgres://archie_migrator:e2e@127.0.0.1:$pgport/archie?sslmode=disable"
}
stop_pid() {
local f=$1 pid
[ -f "$f" ] || return 0
@@ -123,6 +136,7 @@ start() {
trap 'trap - ERR; stop' ERR
prepare
start_pg 9>&-
provision_roles
start_service archie-state-store
wait_port 9091 archie-state-store 90
local s
-88
View File
@@ -1,88 +0,0 @@
# Gitea agent-run view
Untracked reference copies — deploy by hand onto the gitea container.
Renders inside Gitea's own Actions page (real `base/head` / `repo/header`
/ `base/footer`, real `.Repository`/`.CurWorkflow` context) via the
`body_inner_post.tmpl` hook — no full-file template override needed.
Confirmed 2026-07-22 that this hook receives the same per-page context
as `templates/repo/actions/list.tmpl`.
## Files → destinations
| file | destination on gitea container | role |
| ---------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------- |
| `extra_tabs.tmpl` | `$GITEA_CUSTOM/templates/custom/extra_tabs.tmpl` | adds the "Agent Run" repo tab |
| `body_inner_post.tmpl` | `$GITEA_CUSTOM/templates/custom/body_inner_post.tmpl` | loads the CDN CSS/JS + agent-monitor.js, gated on the sentinel |
| `agent-monitor.js` | `$GITEA_CUSTOM/public/assets/agent-monitor.js` | swaps the runs-list segment's content for the terminal, opens the SSE connection |
`$GITEA_CUSTOM` is usually `/data/gitea` in the container — confirm via
Site Administration > Configuration, or `gitea help`.
Restart Gitea after copying either file (custom/templates is only read
at startup unless `RUN_MODE = dev`).
## How it fits together
`extra_tabs.tmpl` links to the real `/actions` route with a sentinel
`?workflow=__agent_monitor__`. Gitea's Actions handler happily sets
`.CurWorkflow` to that string (it doesn't validate it matches a real
workflow file) and renders the stock page as normal — sidebar, run-count
bar, "0 workflow runs" panel, all real Gitea markup. `body_inner_post.tmpl`
then fires on that same page, sees the sentinel, and loads
`agent-monitor.js`, which:
1. finds the real `.ui.attached.segment` inside `.flex-container-main`
— the element list.tmpl already sizes correctly to hold the runs
list — and swaps its content for the terminal, rather than hiding or
duplicating anything
2. hides the run-count/filter bar directly above that segment (nothing
to filter once the terminal's showing)
3. styles the segment as a floating rounded card (border radius, shadow)
4. mounts the xterm.js terminal inside it and opens the SSE connection
The sidebar is deliberately left alone — it's real, always-current Gitea
markup (actual workflow files, actual routes). An earlier version tried
hiding it and hardcoding a lookalike sidebar instead; that goes stale the
moment a workflow is added/renamed, so it was dropped in favour of this.
Nesting the terminal inside other stock wrapper classes (e.g.
`.ui.top.attached.header`, meant for the slim counter bar) also produced
a tiny clipped box in testing — reason `.ui.attached.segment` specifically
is the target now.
**Why the terminal logic is a separate `.js` file, not inline in the
template:** Gitea's CSP requires a per-request nonce for inline
`<script>` blocks, and that nonce isn't exposed to custom/templates.
External `<script src>` tags match the `*` already in `script-src` and
load with zero CSP changes — discovered the hard way when the first
inline-script version got silently blocked by the browser.
No stock Gitea file is copied or overridden, so there's nothing to
re-diff on version bumps — this is the whole reason the hook route won
out over overriding `list.tmpl`.
## Before it'll actually connect
`body_inner_post.tmpl` reads `internal/webui`'s `GET /events` SSE
stream. Two things need doing on the archie-core side first:
1. **Reachability** — the browser loads Gitea's origin, so it needs a
path to the webui SSE endpoint. Either reverse-proxy `/events` under
Gitea's own host (cleanest — avoids CORS entirely), or add CORS
headers to `handleSSE` in `internal/webui/webui.go` for Gitea's
origin, and set `?webui=` on the tab link (or edit `WEBUI_BASE` in
the template) to point at it.
2. **Auth** — `internal/webui`'s own doc comment says "it has no auth" —
this whole path is trusted-network only right now, same as the
dashboard. Don't expose it publicly without adding one.
`/events` has no server-side repo/task filter; `agent-monitor.js`
filters client-side on `event.repo`, so it still receives every task's
events over the wire — fine at current volume, revisit if that stream
gets busy.
Note: the `[cors]` section in Gitea's own `app.ini` does NOT help here —
it controls CORS headers Gitea sends to let _other_ origins call Gitea's
API, not the reverse (the browser, loaded from Gitea's origin, fetching
archie-core's separate `internal/webui` server). The CORS header needs
to live on that webui response, or use the reverse-proxy route instead.
-158
View File
@@ -1,158 +0,0 @@
// Copy to: $GITEA_CUSTOM/public/assets/agent-monitor.js
// Referenced from body_inner_post.tmpl via
// <script src="{{AppSubUrl}}/assets/agent-monitor.js" data-repo="{{.Repository.FullName}}">
// rather than an inline <script> block — Gitea's CSP header requires a
// per-request nonce for inline scripts that custom/templates has no way
// to supply, but external script sources match the "*" already present
// in script-src, so this loads fine with no CSP changes needed.
//
// Doesn't hide or duplicate list.tmpl's sidebar — that's real,
// always-current Gitea markup. Instead it swaps the CONTENT of the
// existing ".ui.attached.segment" (the element list.tmpl already sizes
// correctly to hold the runs list) for the terminal. Nesting the
// terminal inside other stock wrapper classes instead (e.g.
// ".ui.top.attached.header", meant for the slim run-count bar) is what
// produced a tiny clipped box in earlier testing — this element is the
// right one.
(function () {
const scriptTag = document.currentScript;
const repoFilter = scriptTag ? scriptTag.dataset.repo : "";
console.log("[agent-monitor] loaded, repo=", repoFilter);
// Primary selector matches list.tmpl's structure; fall back to a looser
// one (drop the .flex-container-main ancestor requirement) and finally
// to "last .ui.attached.segment on the page" in case a workflow_dispatch
// block or markup drift shifted things — log which one hit so a failed
// match is visible in the console instead of silently doing nothing.
const candidates = [
".repository.actions .flex-container-main .ui.attached.segment",
".repository.actions .ui.attached.segment",
".ui.attached.segment",
];
let segment = null;
for (const sel of candidates) {
const found = document.querySelectorAll(sel);
if (found.length) {
segment = found[found.length - 1]; // last match = likely the runs-list one
console.log(
"[agent-monitor] matched selector:",
sel,
"(",
found.length,
"candidate(s))",
);
break;
}
}
if (!segment) {
console.warn(
"[agent-monitor] no .ui.attached.segment found on page — markup shape changed, nothing to swap",
);
return;
}
// The run-count/filter bar sits directly above the segment; hide it,
// there's nothing meaningful to filter once we're showing the terminal.
const counterBar = segment.previousElementSibling;
if (counterBar && counterBar.classList.contains("flex-left-right")) {
counterBar.style.display = "none";
}
segment.innerHTML = "";
Object.assign(segment.style, {
padding: "12px",
borderRadius: "10px",
overflow: "hidden",
boxShadow: "0 2px 10px rgba(0,0,0,0.35)",
background: "#1e1e1e",
border: "none",
height: "70vh",
boxSizing: "border-box",
});
const el = document.createElement("div");
Object.assign(el.style, { height: "100%", width: "100%" });
segment.appendChild(el);
// TODO: point this at wherever internal/webui (archie-core's SSE
// dashboard) is reachable from the browser — reverse-proxy it under
// this same host to avoid CORS. Override per-load with ?webui=.
const WEBUI_BASE =
new URLSearchParams(location.search).get("webui") ||
"https://gitea.example.com/agent-events";
const term = new Terminal({
convertEol: true,
disableStdin: true,
cursorBlink: false,
fontSize: 13,
});
term.open(el);
// FitAddon sizes xterm's internal viewport (rows/cols) to match the
// container's actual pixel size — without it xterm falls back to a
// default 80x24 grid that doesn't match our div, which is what made
// the terminal look mismatched/"out of place" against the card.
if (window.FitAddon) {
const fit = new window.FitAddon.FitAddon();
term.loadAddon(fit);
fit.fit();
window.addEventListener("resize", () => fit.fit());
}
term.writeln(
`\x1b[90mconnecting to ${WEBUI_BASE} (repo=${repoFilter})...\x1b[0m`,
);
function colorFor(stage) {
switch (stage) {
case "error":
return "\x1b[31m";
case "done":
return "\x1b[32m";
default:
return "\x1b[36m";
}
}
function render(e) {
if (repoFilter && e.repo && e.repo !== repoFilter) return;
const ts = new Date().toLocaleTimeString();
const tag = [e.workflow, e.stage].filter(Boolean).join(":");
term.writeln(
`\x1b[90m${ts}\x1b[0m ${colorFor(e.stage)}[${tag || "event"}]\x1b[0m ${e.detail || ""}`,
);
if (e.data && Object.keys(e.data).length) {
term.writeln(`\x1b[90m ${JSON.stringify(e.data)}\x1b[0m`);
}
}
// A new line per failed attempt spams the screen when the endpoint is
// unreachable for a while (each retry is 3s apart, but it adds up).
// Print the "lost" message once per disconnect, then just tick dots on
// the same line so it still reads as "trying," not a wall of red text.
let retrying = false;
function connect() {
const es = new EventSource(WEBUI_BASE + "/events");
es.onopen = () => {
if (retrying) term.writeln("\x1b[32m connected\x1b[0m");
retrying = false;
};
es.onmessage = (msg) => {
try {
render(JSON.parse(msg.data));
} catch {}
};
es.onerror = () => {
es.close();
if (!retrying) {
term.writeln("\x1b[31mconnection lost, retrying...\x1b[0m");
retrying = true;
} else {
term.write("\x1b[31m.\x1b[0m");
}
setTimeout(connect, 3000);
};
}
connect();
})();
@@ -1,36 +0,0 @@
{{/*
Copy to: $GITEA_CUSTOM/templates/custom/body_inner_post.tmpl
This is an optional hook file Gitea looks for if present (like
extra_links.tmpl) — nothing to diff against upstream, no maintenance
burden across Gitea version bumps, unlike overriding list.tmpl outright.
Confirmed empirically (2026-07-22): this hook gets the SAME per-page
context as templates/repo/actions/list.tmpl — .CurWorkflow, .Repository
etc. are all real values here, not a stripped-down base context.
Renders the agent terminal in place of the normal Actions runs list
when the tab link's sentinel ?workflow=__agent_monitor__ is present.
Does NOT hide or rebuild list.tmpl's sidebar/menu — that's real,
always-current Gitea markup (actual workflow files, actual routes) and
duplicating it here as static HTML would go stale the moment a
workflow is added/renamed/removed. Only the runs-list segment itself
(".ui.attached.segment" inside ".flex-container-main") gets its
content swapped for the terminal — done in JS (agent-monitor.js), not
here, since that's the element list.tmpl already sized correctly to
hold content; nesting the terminal inside other stock wrapper classes
(e.g. ".ui.top.attached.header", meant for a slim counter bar) is what
caused the tiny clipped box in testing.
The JS logic itself lives in the external agent-monitor.js (loaded via
<script src>, not inline) because Gitea's CSP requires a per-request
nonce for inline <script> blocks that custom/templates has no way to
supply — external script sources match the "*" already in script-src
and load fine without touching Gitea's CSP config at all.
*/}}
{{if eq $.CurWorkflow "__agent_monitor__"}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@5/css/xterm.css">
<script src="https://cdn.jsdelivr.net/npm/xterm@5/lib/xterm.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@xterm/addon-fit@0/lib/addon-fit.js"></script>
<script src="{{AppSubUrl}}/assets/agent-monitor.js" data-repo="{{.Repository.FullName}}"></script>
{{end}}
-18
View File
@@ -1,18 +0,0 @@
{{/*
Copy to: $GITEA_CUSTOM/templates/custom/extra_tabs.tmpl
(on the gitea container: /data/gitea/templates/custom/extra_tabs.tmpl,
or wherever GITEA_CUSTOM points — check Site Administration > Configuration)
Adds an "Agent Run" tab to the repo header, matching the markup Gitea
uses for its own tabs (see templates/repo/header.tmpl upstream).
Restart Gitea after copying (custom/templates is only read at startup
unless RUN_MODE = dev).
Links into the real Actions list route with a sentinel ?workflow= value
that list.tmpl (see list.tmpl in this same directory) intercepts to
render agent_monitor.tmpl instead of the normal runs list — real
head/header/footer, no separate static page or route needed.
*/}}
<a class="item" href="{{AppSubUrl}}/{{.Repository.OwnerName}}/{{.Repository.Name}}/actions?workflow=__agent_monitor__">
{{svg "octicon-play" 16 "tw-mr-2"}}Agent Run
</a>
+34 -35
View File
@@ -3,46 +3,43 @@ module github.com/samcharles93/archie-core
go 1.27.3
require (
cel.dev/expr v0.25.3 // indirect
cel.dev/expr v0.26.0 // indirect
filippo.io/hpke v0.4.0 // indirect
github.com/Microsoft/go-winio v0.6.4 // indirect
github.com/ProtonMail/go-crypto v1.5.2 // indirect
github.com/antithesishq/antithesis-sdk-go v0.8.0 // indirect
github.com/antithesishq/antithesis-sdk-go v0.9.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.6.5 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.2.0 // indirect
github.com/containerd/platforms v1.0.0-rc.5 // indirect
github.com/danielgtaylor/huma/v2 v2.40.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.8.2 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.6 // indirect
github.com/fxamacker/cbor/v2 v2.10.0 // indirect
github.com/go-git/gcfg/v2 v2.0.2 // indirect
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 // indirect
github.com/go-json-experiment/json v1.27.2 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/go-webauthn/x v0.3.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-tpm v0.9.8 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.33.0 // indirect
github.com/hashicorp/yamux v0.1.2 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.3 // indirect
github.com/kevinburke/ssh_config v1.6.0 // indirect
github.com/klauspost/compress v1.20.3 // indirect
github.com/mattn/go-colorable v0.1.16 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/mfridman/interpolate v0.0.2 // indirect
github.com/mfridman/interpolate v0.2.0 // indirect
github.com/minio/highwayhash v1.0.4 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/nats-io/jwt/v2 v2.8.2 // indirect
github.com/nats-io/nkeys v0.4.16 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/oklog/run v1.2.0 // indirect
github.com/philhofer/fwd v1.2.1 // indirect
@@ -52,7 +49,6 @@ require (
github.com/segmentio/encoding v0.5.4 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/sethvargo/go-retry v0.5.0 // indirect
github.com/sirupsen/logrus v1.10.2 // indirect
github.com/tinylib/msgp v1.6.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
@@ -60,45 +56,47 @@ require (
go.opentelemetry.io/otel/log v1.47.0 // indirect
go.opentelemetry.io/otel/metric v1.47.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e // indirect
golang.org/x/sync v0.24.0 // indirect
golang.org/x/text v0.43.0 // indirect
go.yaml.in/yaml/v3 v3.0.6 // indirect
golang.org/x/exp v0.0.0-20261112160707-e95cf140231d // indirect
golang.org/x/sync v0.25.0 // indirect
golang.org/x/text v0.44.0 // indirect
golang.org/x/time v0.16.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20261110000943-09e21b237f2c // indirect
)
require (
cel.dev/cel-go v0.32.0
cel.dev/cel-go v0.33.2
filippo.io/age v1.3.2
github.com/BurntSushi/toml v1.6.0
github.com/cedar-policy/cedar-go v1.8.0
github.com/ai-openshell/sdk-go v0.1.8
github.com/cedar-policy/cedar-go v1.9.1
github.com/containerd/errdefs v1.0.0
github.com/coreos/go-oidc/v3 v3.21.0
github.com/docker/sandbox-kit-spec/v3 v3.0.0-m.8
github.com/go-git/go-billy/v6 v6.0.0-beta.1
github.com/go-git/go-git/v6 v6.0.0-beta.1
github.com/go-jose/go-jose/v4 v4.1.6
github.com/go-telegram/bot v1.27.0
github.com/go-jose/go-jose/v4 v4.1.9
github.com/go-webauthn/webauthn v0.18.2
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/google/jsonschema-go v0.4.3
github.com/google/uuid v1.6.0
github.com/hashicorp/go-hclog v1.6.3
github.com/hashicorp/go-plugin v1.8.0
github.com/jackc/pgx/v5 v5.11.0
github.com/hiddeco/sshsig v0.2.0
github.com/jackc/pgx/v5 v5.13.0
github.com/jmoiron/sqlx v1.4.0
github.com/klauspost/compress v1.20.4
github.com/moby/moby/api v1.56.1
github.com/moby/moby/client v0.6.2
github.com/modelcontextprotocol/go-sdk v1.8.0
github.com/nats-io/nats-server/v2 v2.15.1
github.com/nats-io/jwt/v2 v2.8.3
github.com/nats-io/nats-server/v2 v2.15.3
github.com/nats-io/nats.go v1.55.0
github.com/nats-io/nkeys v0.4.17
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1
github.com/pressly/goose/v3 v3.29.0
github.com/samcharles93/ai-sdk v0.6.0
go.lsp.dev/jsonrpc2 v1.0.1
go.lsp.dev/protocol v1.0.1
go.lsp.dev/uri v1.0.1
github.com/pressly/goose/v3 v3.30.1
github.com/samcharles93/ai-sdk v0.8.1
github.com/synadia-io/callout.go v0.2.3
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0
go.opentelemetry.io/otel v1.47.0
@@ -107,12 +105,13 @@ require (
go.opentelemetry.io/otel/sdk v1.47.0
go.opentelemetry.io/otel/trace v1.47.0
go.opentelemetry.io/proto/otlp v1.11.1
golang.org/x/crypto v0.58.0
golang.org/x/mod v0.42.0
golang.org/x/crypto v0.59.0
golang.org/x/mod v0.43.0
golang.org/x/net v0.62.0
golang.org/x/oauth2 v0.37.0
golang.org/x/sys v0.49.0
golang.org/x/term v0.47.0
golang.org/x/oauth2 v0.38.0
golang.org/x/sys v0.50.0
golang.org/x/term v0.48.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c
google.golang.org/grpc v1.86.0-dev
google.golang.org/protobuf v1.36.12
gopkg.in/yaml.v3 v3.0.1
+98 -78
View File
@@ -1,25 +1,40 @@
cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk=
cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU=
cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0=
cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
c2sp.org/CCTV/age v0.0.0-20260829155415-4448f2097b2d h1:Blprhc2SbChNZtWcU+BLTM4YdoqYAS9V7cJgOwJKyAs=
c2sp.org/CCTV/age v0.0.0-20260829155415-4448f2097b2d/go.mod h1:SrHC2C7r5GkDk8R+NFVzYy/sdj0Ypg9htaPXQq5Cqeo=
cel.dev/cel-go v0.33.2 h1:eAcEdBguc6AFrGbPOyE0g168Uey4kKFW9J6qsBLSeMU=
cel.dev/cel-go v0.33.2/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU=
cel.dev/expr v0.26.0 h1:oLXvOF0jiYA5A/tmzU91pLEWZkKynhLJlC9Gw7PrKvs=
cel.dev/expr v0.26.0/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
filippo.io/age v1.3.2 h1:r6RSZLFSMm6rzKepZ7ZAYkKCu14f3/Me8c7uKYh7C8c=
filippo.io/age v1.3.2/go.mod h1:TH/Yr2sSRhCKbaH4XPxpUV0Us8Gv6txYUpiZQWz8Evk=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo=
filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc=
filippo.io/hpke v0.4.0 h1:p575VVQ6ted4pL+it6M00V/f2qTZITO0zgmdKCkd5+A=
filippo.io/hpke v0.4.0/go.mod h1:EmAN849/P3qdeK+PCMkDpDm83vRHM5cDipBJ8xbQLVY=
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/Microsoft/go-winio v0.6.4 h1:kJF2pamtYCWXf0xAT8sAkwKC0pMl2HYBrRPHAqyUc+g=
github.com/Microsoft/go-winio v0.6.4/go.mod h1:1xl5JXG4ze/m74GH6Dc4Mwxfc3VL5siRVQjIAlHH07U=
github.com/ProtonMail/go-crypto v1.5.2 h1:cucYnvqcY7UOXVD//mSyjeaPY0SSN3v5cDkYPxumINk=
github.com/ProtonMail/go-crypto v1.5.2/go.mod h1:/RaSu30DaKO4RY+XdV/ACcCcZkGr7AhUIduq5sjzzCo=
github.com/ai-openshell/sdk-go v0.1.8 h1:p5i7VAZxlB/tzWy6KQWkdvX3cLIu8x0AinUx1X6wp+s=
github.com/ai-openshell/sdk-go v0.1.8/go.mod h1:nYYe/HYeEct0KG5YyF2dbLHjUWb7EEA+I1lLi6A8j14=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/antithesishq/antithesis-sdk-go v0.8.0 h1:bVV5ZAuwaREn4klRSJusYaA+A7NXq8Qi9C/knCaQ2N4=
github.com/antithesishq/antithesis-sdk-go v0.8.0/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI=
github.com/antithesishq/antithesis-sdk-go v0.9.0 h1:JQpWOgYSYBb9HqgPtaXBswHxZFmOnXRsPFDI0yeCJWM=
github.com/antithesishq/antithesis-sdk-go v0.9.0/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI=
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
github.com/aricart/nst.go v0.2.0 h1:vfC+upJofU7OFJZM5Ph+HNko1XfJtVuSE6Q7FCQmT3g=
github.com/aricart/nst.go v0.2.0/go.mod h1:13ztPOEw3Jz0/LT8yDi5wZB+T4Lsj3Uhkc17CyZthII=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw=
github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c=
github.com/cedar-policy/cedar-go v1.8.0 h1:9gcU7EHXwHC2RMdpph68yTAkdB3behTTssC+kt4GoS8=
github.com/cedar-policy/cedar-go v1.8.0/go.mod h1:h5+3CVW1oI5LXVskJG+my9TFCYI5yjh/+Ul3EJie6MI=
github.com/cedar-policy/cedar-go v1.9.1 h1:wkcJD04aFpc/+ZObLQsFXYkfvrQsuW8DOEPEb8r62AE=
github.com/cedar-policy/cedar-go v1.9.1/go.mod h1:xF1pHCQW69SIyMguq5BX1ZP9CwdessfnZELtjUpyW7U=
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
@@ -30,12 +45,10 @@ github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk=
github.com/containerd/log v0.2.0 h1:BewD/umNgVnoczglOpX8eRMyEy5t5iPlu5AIpnWDONc=
github.com/containerd/log v0.2.0/go.mod h1:/M7L7CXKcPTfNC74XzaK+5H5KbO5+4lJVpuVI6vRLoM=
github.com/containerd/platforms v1.0.0-rc.5 h1:vXd569rDrz8LeMXzAnBsy6LADV5YtsD8oyaRarxdmSU=
github.com/containerd/platforms v1.0.0-rc.5/go.mod h1:lKlMXyLybmBedS/JJm11uDofzI8L2v0J2ZbYvNsbq1A=
github.com/coreos/go-oidc/v3 v3.21.0 h1:wZo4Q9Pum8dYEj0eMUPrqR+kvuGkeUplbLpNCkBqoWM=
github.com/coreos/go-oidc/v3 v3.21.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4=
github.com/danielgtaylor/huma/v2 v2.40.0 h1:429ynr7/T9Iar+8P6NSsjcKwCRgaXvPKvqIFmbeL6vE=
github.com/danielgtaylor/huma/v2 v2.40.0/go.mod h1:x+utAArLHnM93jq2Wy7nLYkVorUF1vYML2hoPVb/5yo=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
@@ -44,8 +57,6 @@ github.com/docker/go-connections v0.8.2 h1:9d9DEokx5W7qlr0shkFXIxEA7+TTD+llwzcyk
github.com/docker/go-connections v0.8.2/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/sandbox-kit-spec/v3 v3.0.0-m.8 h1:ay2XEj0yW3uzsNwN3KXS/c4nlneHONFKaHlrVhu2WCQ=
github.com/docker/sandbox-kit-spec/v3 v3.0.0-m.8/go.mod h1:4G6VgFAp9eaQkwy7DbZbOfWRD/Mjvc/TnEtQBRRMEsA=
github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg=
github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
@@ -55,8 +66,8 @@ github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w=
github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE=
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE=
github.com/fxamacker/cbor/v2 v2.9.6 h1:NHZPxuUjJXQjX9itA785y/5NKSlI4HQ+S7noZsmI7hs=
github.com/fxamacker/cbor/v2 v2.9.6/go.mod h1:4EaZp6ClVunETjQ4GHmGNzysDK91Lr+r6Yz6tJqzVCw=
github.com/fxamacker/cbor/v2 v2.10.0 h1:HVF3T5vYwLqO81ebPirWEPNv2SMrUMD3HLnKgEr6uWE=
github.com/fxamacker/cbor/v2 v2.10.0/go.mod h1:uSwlToFuT9BZAKRxxVm3qQC8DR4tlWl7D6pf20iRYH4=
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
github.com/go-git/gcfg/v2 v2.0.2 h1:MY5SIIfTGGEMhdA7d7JePuVVxtKL7Hp+ApGDJAJ7dpo=
@@ -67,17 +78,18 @@ github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1 h1:gmqi2jvsreu0s8JMLylYDFq4s
github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1/go.mod h1:ECf1MqJlBdYpKggBrOXjo/0EnvRZx6D++I86UYjPgAQ=
github.com/go-git/go-git/v6 v6.0.0-beta.1 h1:1t+vJYGDBN6f9GRWskgWx5UjXPFUa7wfffZZZ2C5GtA=
github.com/go-git/go-git/v6 v6.0.0-beta.1/go.mod h1:ugDlr38Wwc+fOw85J+Oluh5TNXQtJgYMcriOljg3l4s=
github.com/go-jose/go-jose/v4 v4.1.6 h1:sNRkftxFJxwsILiQukqp5z83QBSmntVwmgRY7AqBDO4=
github.com/go-jose/go-jose/v4 v4.1.6/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 h1:UADEEmDKgfXbtnGJZ97beY5XLo9ZechG1nlU4KnRrkE=
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
github.com/go-jose/go-jose/v4 v4.1.9 h1:pKfeQkig1NmgK4hJrZYXLEYURXfoJB61Larw0uIW4gY=
github.com/go-jose/go-jose/v4 v4.1.9/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
github.com/go-json-experiment/json v1.27.2 h1:rZIyqYh+Qq+nEa+Y5iwohr8h7G/MfLJqu2CD4/ZONqM=
github.com/go-json-experiment/json v1.27.2/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8=
github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-telegram/bot v1.27.0 h1:PG9yBDzM8O26oUerE9SZwWlHon4RpH8WcNslZ7CEZmE=
github.com/go-telegram/bot v1.27.0/go.mod h1:i2TRs7fXWIeaceF3z7KzsMt/he0TwkVC680mvdTFYeM=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/go-sql-driver/mysql v1.10.1 h1:arlSnNLq6a5yxGxV7qg9lF4j0C+KwD6NbQyKr9QL6ME=
github.com/go-sql-driver/mysql v1.10.1/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk=
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/go-webauthn/webauthn v0.18.2 h1:0BeftmEHU7i3Dv0VFwBtidy/ba37Vcdjvqst9EYu8Sk=
@@ -98,28 +110,32 @@ github.com/google/jsonschema-go v0.4.3 h1:/DBOLZTfDow7pe2GmaJNhltueGTtDKICi8V8p+
github.com/google/jsonschema-go v0.4.3/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0 h1:QMILzF8BA7xftE4zVORkRrlv08m12St3csK4RsyRgRs=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0/go.mod h1:+ZQ6iUL8+ATyxGDQNuRKpNwJFdGDUi0e7E1QL9MvI7U=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.33.0 h1:5T5Ns3kMpWr+z3s5ZA0e7ljVyWNVNxK76sHPAxi5D1k=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.33.0/go.mod h1:oWNYw09cH8wl8fFgC5hKlBLxR4XfKy2KQpP8MJjeCcc=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-plugin v1.8.0 h1:ie8S6RRY8RvB2usYZv+AAZ/wBvx2AU5p5QeP5j/FORs=
github.com/hashicorp/go-plugin v1.8.0/go.mod h1:BExt6KEaIYx804z8k4gRzRLEvxKVb+kn0NMcihqOqb8=
github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8=
github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns=
github.com/hiddeco/sshsig v0.2.0 h1:gMWllgKCITXdydVkDL+Zro0PU96QI55LwUwebSwNTSw=
github.com/hiddeco/sshsig v0.2.0/go.mod h1:nJc98aGgiH6Yql2doqH4CTBVHexQA40Q+hMMLHP4EqE=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.11.0 h1:IzBBtyK9AHqf98cctWFifYSci2hgQR/cd56wB4p+ogg=
github.com/jackc/pgx/v5 v5.11.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4=
github.com/jackc/pgx/v5 v5.13.0 h1:Hl08k64maU0nrRyVUEbwCnK6/gT0EhMrtAqBHz9/gA4=
github.com/jackc/pgx/v5 v5.13.0/go.mod h1:u2Fi6no03HCSBYE+ZVdLxbwdu3xyi2vU+K/YNJioSds=
github.com/jackc/puddle/v2 v2.2.3 h1:f8HoREISb3l5eO9coPgK7U3hKLhWGokOFVcThl5jrao=
github.com/jackc/puddle/v2 v2.2.3/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94=
github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8=
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
github.com/kevinburke/ssh_config v1.6.0 h1:J1FBfmuVosPHf5GRdltRLhPJtJpTlMdKTBjRgTaQBFY=
github.com/kevinburke/ssh_config v1.6.0/go.mod h1:q2RIzfka+BXARoNexmF9gkxEX7DmvbW9P4hIVx2Kg4M=
github.com/klauspost/compress v1.20.3 h1:zWNoFqq/lSuYQRim3dUXlXeA0IqwuZGicdG5ZTfY5j4=
github.com/klauspost/compress v1.20.3/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
github.com/klauspost/compress v1.20.4 h1:dD0v/bvxtjCBqQu6sx1TNWkalEY5lNTIe+HY9w8TeNI=
github.com/klauspost/compress v1.20.4/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
@@ -127,6 +143,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.16 h1:+2YjeAe7xP1OQbZW1jERPWWCDLlNqFNCvjiqGiAt84A=
@@ -135,10 +153,14 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=
github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mfridman/interpolate v0.2.0 h1:HM9ID8p6CUxoMJX+fECOtGQ2Mu7TW/GIMPyu48nnvUg=
github.com/mfridman/interpolate v0.2.0/go.mod h1:8SfDy95IaPNnIokZh9mvIppmc3fGl8fx+Gu7uusuO9Q=
github.com/minio/highwayhash v1.0.4 h1:asJizugGgchQod2ja9NJlGOWq4s7KsAWr5XUc9Clgl4=
github.com/minio/highwayhash v1.0.4/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/moby/api v1.56.1 h1:PpWkvVPB7Fr/No8w+TfyJ/I6rWZ2YPZhT3JorIg+06c=
@@ -147,14 +169,16 @@ github.com/moby/moby/client v0.6.2 h1:ekSPlMccrZGcw6Scb8T9D39qE0mB+XupU/yS0zNw9N
github.com/moby/moby/client v0.6.2/go.mod h1:DGcnO7qmPJrqobx/ggQgQ/AUk+2wgVdQv7uxB0/mEsc=
github.com/modelcontextprotocol/go-sdk v1.8.0 h1:KIvahhYqwtbeniWVPs3TcXEA7b8jEtwfBpOTAI+Urx4=
github.com/modelcontextprotocol/go-sdk v1.8.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts=
github.com/nats-io/jwt/v2 v2.8.2 h1:XXRgB60MSTnqsRwejQurVDs/hcv2dkt+86GjI+I/bMc=
github.com/nats-io/jwt/v2 v2.8.2/go.mod h1:Ag/56sq9OblL4JgdYufDd16Egb17Kr/8WwwuO/forVc=
github.com/nats-io/nats-server/v2 v2.15.1 h1:fK3AeYFIji1Smng60jB0hVoAPZezA/UzsaI3BqXFNEI=
github.com/nats-io/nats-server/v2 v2.15.1/go.mod h1:yeuYRtKVKIFtmMz2/YPk+6hvmNBnk+WwTUzErBdH6IE=
github.com/nats-io/jwt/v2 v2.8.3 h1:pqImTmlqH2zPHKNdRXO0YRyWif2diGRlrtLFJ2RxM2I=
github.com/nats-io/jwt/v2 v2.8.3/go.mod h1:OOY2rP/UU8tcfoqhbHmBKcNdpFMKvmxIkmFFa16M4wI=
github.com/nats-io/nats-server/v2 v2.15.3 h1:IgHIKL4DYN9mEfwtPcdM39muvXG8v9FBADQn0f4Whs0=
github.com/nats-io/nats-server/v2 v2.15.3/go.mod h1:6Xv7yIatdWlcqIzqFkW1uC78c5o8vG3dBrhazEF8WDA=
github.com/nats-io/nats.go v1.55.0 h1:Ng8QKHdvdHIWoaiq0+d/aH1BWkxvcJxWJ0Y/9BPKx3M=
github.com/nats-io/nats.go v1.55.0/go.mod h1:y+DZoD1oBOYfZTU681eTUiUjI0vbqYGixNVFHcjHJ0k=
github.com/nats-io/nkeys v0.4.16 h1:rd5oAuLOb8mnAycB0xleuEBNS1pVVnN0fv/FF34Eypg=
github.com/nats-io/nkeys v0.4.16/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs=
github.com/nats-io/nkeys v0.4.17 h1:JAJrlDhOyQqOt0a1eg4cbIZ1Kc7+vmkCigAltpwQpVA=
github.com/nats-io/nkeys v0.4.17/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs=
github.com/nats-io/nsc/v2 v2.10.3-0.20250110165315-eeda721ecff6 h1:V1uh9L3rGIUeYoMd0/EZY2Tvy5+1CkgGpDRx8t3+PNY=
github.com/nats-io/nsc/v2 v2.10.3-0.20250110165315-eeda721ecff6/go.mod h1:ScomAvx1cgjiXzW3WpGo9x/lLENkwELhewCcok/GTU8=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk=
@@ -172,14 +196,14 @@ github.com/pjbgf/sha1cd v0.7.0/go.mod h1:pKR5Li+qTCo+ebqITZfwPlJGoCFCvSO00qxjbNt
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pressly/goose/v3 v3.29.0 h1:dtEnBCT7CqkHIUCdgrXsrmeisaN8gFkRU4Y5OEwif4o=
github.com/pressly/goose/v3 v3.29.0/go.mod h1:plA4aP4+u+Q3FMTgbFbhF8TuAWpAdfWpoFGkJsIFWh0=
github.com/pressly/goose/v3 v3.30.1 h1:KO28meBdbAUIdMbTP7bl9dp1FYZGXcYWb2O7miT09lE=
github.com/pressly/goose/v3 v3.30.1/go.mod h1:CHGwuG2acDerUaXwz2i5T18VSauXpYDiL4WxzDvcOIM=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/samcharles93/ai-sdk v0.6.0 h1:ANHutwvl/K233Dkflc2vKT48qsXRT1iRwjL5S1Dm+jY=
github.com/samcharles93/ai-sdk v0.6.0/go.mod h1:NNkiUZ2qfezDHhmF8zHibKsPgpU8b5jphDQ0n2t1KL0=
github.com/rogpeppe/go-internal v1.16.0 h1:O9DK+vNMDVGLr2BeZqmpLeMjiMNkuXfcqntWbZV6S5g=
github.com/rogpeppe/go-internal v1.16.0/go.mod h1:DrUVZyrJU+txYW5/1kwtXQSMFio52ZOxX7yM1VHvnxs=
github.com/samcharles93/ai-sdk v0.8.1 h1:9mxfaudUhQDqAEdmrOVX9yXcCWMTYvkNl6LRSICxP8k=
github.com/samcharles93/ai-sdk v0.8.1/go.mod h1:NNkiUZ2qfezDHhmF8zHibKsPgpU8b5jphDQ0n2t1KL0=
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0=
@@ -188,8 +212,6 @@ github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
github.com/sethvargo/go-retry v0.5.0 h1:JYfFKmVJ8ER06GReN1efzc5cm52BrVsFVzmcHiKJwfY=
github.com/sethvargo/go-retry v0.5.0/go.mod h1:tvsjdKG6xfiCx4LSiUZ06kcv38xvdVQwv8R6/VnnVWg=
github.com/sirupsen/logrus v1.10.2 h1:G2SED73/qrAu6YwbdxOD6peLkCBI3z7L+ykJFTXJBBo=
github.com/sirupsen/logrus v1.10.2/go.mod h1:SLEg8TqYulVKKfIGHldVp2K2aYz2DKSVBq4g/H5bR7Q=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -197,18 +219,16 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/synadia-io/callout.go v0.2.3 h1:22u8sIIdpkKuyySXqEWvGAkAQ4tMBnvLtpVPNBdbj6Y=
github.com/synadia-io/callout.go v0.2.3/go.mod h1:IDVofaME9xzbBO5nUvEL59Ml0jGd6gAsF1qC4Nm6Pn8=
github.com/synadia-io/jwt-auth-builder.go v0.0.9 h1:UmXQ0JsqiA7sboE0VC46YEqrGAFA4MYHnhw54uYKRi8=
github.com/synadia-io/jwt-auth-builder.go v0.0.9/go.mod h1:0XPmvG3TihNkiM3ZFVtcCAzv0oBgFtjnw/lb/h8NHs0=
github.com/tinylib/msgp v1.6.5 h1:iAH6XTP7BpzErjBZlujJQXxA+GmRi2YWs6M4KdLtNbE=
github.com/tinylib/msgp v1.6.5/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
go.lsp.dev/jsonrpc2 v1.0.1 h1:JZAchpm6RcOuwEOnZ7kF3kA1EpEjdJZ/6rMSfOF3+F4=
go.lsp.dev/jsonrpc2 v1.0.1/go.mod h1:WN+TesqrPumBmUdsuWyn9DHq3zl4i85L/qG0NLdj8qg=
go.lsp.dev/protocol v1.0.1 h1:kLWUIk1v/deXxo1D0VO4avjZnfeuZ82mouJgJd/NbdU=
go.lsp.dev/protocol v1.0.1/go.mod h1:e//i41aEqc9ml32xiNuneUwbjOjuvTA4+uv+AkssJgk=
go.lsp.dev/uri v1.0.1 h1:ywxJN1UXoQ+v0I9lkoQNMmsm7lub5G9ZG7KXT8YTx30=
go.lsp.dev/uri v1.0.1/go.mod h1:06a0ghafs4PuqkLsJGUmlgPHw6+kH79edRXjOT/rA8s=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0 h1:Tq+E65HaNbZTeqcLw6QUhsV+/EIWdkfUH2CQzcrlE5M=
@@ -239,20 +259,20 @@ go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54=
golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w=
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e h1:HgI6W1OolKK6tcV74is+rl9SMT0njsHlp0TbQiGXI/A=
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e/go.mod h1:DBoxwWhjaW8DJJw/YeM4zpeOKMC1FMXSblsYy+1mFSw=
golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg=
golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs=
go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM=
go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c=
golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U=
golang.org/x/exp v0.0.0-20261112160707-e95cf140231d h1:YGnTHliLVZi5alOPp2qu0ggfMT1g+Dp13ZVpReekWYM=
golang.org/x/exp v0.0.0-20261112160707-e95cf140231d/go.mod h1:J3U+E8RzytcGvwz+uJuAP4zULJ2TkAQBnmPZMexpdXs=
golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg=
golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY=
golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY=
golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98=
golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58=
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/oauth2 v0.38.0 h1:uW7XQbcu1eoiQS7uMJvLOjPMl04bTbmY1VeRPxvbspI=
golang.org/x/oauth2 v0.38.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58=
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -260,22 +280,22 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM=
golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY=
golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc=
golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s=
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk=
golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4=
golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo=
golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY=
golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE=
golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s=
golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs=
golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a h1:Yqozs0FNPRoPGS4hNGlrNwRENWr5H5nVG9sN/f+5640=
golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b h1:nB3spRIaSPtxJpxb0k41yljROvm2Jrwfs2pSNdKS5y8=
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b/go.mod h1:9N4vtjEwvgQKEdlFVQO0M44ErhecQ9DCSQfGoZ51M6w=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b h1:6WNWHZk91dp4gZ25642OALkuG1UVNZbwENJD19DnB8k=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
google.golang.org/genproto/googleapis/api v0.0.0-20261110000943-09e21b237f2c h1:ofk4SEqvpf6M5VWh88xRp42IYgdVOh7gffebnDj3OqU=
google.golang.org/genproto/googleapis/api v0.0.0-20261110000943-09e21b237f2c/go.mod h1:OzYcNQzaMRKcOFRMtyLzG/cfW1SmS2eh+7UmOLLFblk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c h1:XXChExL+Tm7Ubp0x0VXUEncPLHrkXIgoVWqnxmKNbAA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
google.golang.org/grpc v1.86.0-dev h1:FLq7hcApuJeJ70J9+k0FvmXsNCwS8B2/MeAfYdy3GHY=
google.golang.org/grpc v1.86.0-dev/go.mod h1:Ovl0ECo4xx5r4kn/6d4BPSNB7OIFuu6EAjOzjtVAKaM=
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
@@ -291,14 +311,14 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
modernc.org/libc v1.78.0 h1:Lpm+e9K6ruVYEGwWfuBO1xXtYEaXDouFOG1SuWjFDP4=
modernc.org/libc v1.78.0/go.mod h1:wvxR55nOF2/66NkJoNV7/coXBTCvT3HR22rcqW6lOuA=
modernc.org/libc v1.80.2 h1:3+a4fJZvvzg920ZC0mOepnKPGn7cqCaVeDxm/UnrM1A=
modernc.org/libc v1.80.2/go.mod h1:pvo25Rs3OJEbDqhUV9jdEGevxeLJrJeDmNid/AcQV1g=
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
modernc.org/memory v1.12.1 h1:nFMiWrpStgZczNl6XI9GnIk/rWhYIyHGUaR04pGbp9g=
modernc.org/memory v1.12.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/sqlite v1.60.1 h1:/blz53O951KWFOso4QQvEs/Fq6cDBKLtMVrYNSeJVKw=
modernc.org/sqlite v1.60.1/go.mod h1:1dIoEagfDE72QytD5scH1lxARtaUgKgHC/NuApA27r0=
modernc.org/sqlite v1.62.0 h1:gMaCjSM1qpl+iOjiWhR1LYP3zqrYDI+5GYLGt6veP2g=
modernc.org/sqlite v1.62.0/go.mod h1:Jzjh1mt4s0HuQ0KvtB1LIuHiGRmU2D5pgj8dUhW7/SE=
oras.land/oras-go/v2 v2.7.0 h1:0bXRBBSqYgPSjZRrhJbT71Rb465c+rdlft2xdQPxLtQ=
oras.land/oras-go/v2 v2.7.0/go.mod h1:imXEFiYkTZUVVYkfv/r5GVmWeiLkGtNQA8FU4F/sjKs=
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
+75 -6
View File
@@ -91,6 +91,17 @@ export ARCHIE_INSTANCE="${INSTANCE}"
ARCHIE_CONFIG_DIR="${XDG_CONFIG_HOME}/${INSTANCE}"
ARCHIE_DATA_DIR="${XDG_DATA_HOME}/${INSTANCE}"
ENV_FILE="${ARCHIE_CONFIG_DIR}/env"
# The database roles a bundled install serves from: the least-privilege role
# the services connect as, and the role that owns the schema and runs
# migrations. The names mirror postgres.RuntimeRole/MigrationRole, which setup
# writes into the bundled configuration.
RUNTIME_ROLE=archie_runtime
MIGRATION_ROLE=archie_migrator
# The credential the bundled PostgreSQL is created with and the installer uses
# once, to create the two roles. It lives in this Compose-only file, which the
# systemd units never load, so no service holds a credential that owns the
# cluster.
PG_ADMIN_ENV="${ARCHIE_DATA_DIR}/postgres.env"
# unit maps a base unit name to this instance's: unchanged for the default
# instance, suffixed with the name after archie- otherwise.
@@ -219,9 +230,8 @@ else
fi
TOPOLOGY_UNITS="$(tr -d '\n' <"${STAGE}/release.json" | sed -n 's/.*"units": *\[\([^]]*\)\].*/\1/p' | tr -d '" ' | tr , ' ')"
# Binaries that run beside the units without a service of their own: a Kit run
# mounts archie-agent from archied's directory, so it must be installed with
# them and replaced with them.
# Binaries that run beside the units without a service of their own are
# installed and replaced with them.
TOPOLOGY_BINARIES="$(tr -d '\n' <"${STAGE}/release.json" | sed -n 's/.*"binaries": *\[\([^]]*\)\].*/\1/p' | tr -d '" ' | tr , ' ')"
for cmd in ${TOPOLOGY_UNITS} ${TOPOLOGY_BINARIES}; do
install -m755 "${STAGE}/${cmd}" "${ARCHIE_BIN_DIR}/${cmd}"
@@ -266,10 +276,55 @@ else
echo " [SKIP] ${ARCHIE_CONFIG_DIR}/config.toml already exists. Re-run 'archied setup' to change it."
fi
# provision_database reconciles the two database roles a bundled install
# serves from: an archie_migrator that owns the schema and runs goose, and an
# archie_runtime with row access only. It also moves the superuser password out
# of the env file the units load: a config written before the split connects as
# the bundled superuser, so its password is rotated to the Compose-only one
# once the roles exist. Idempotent, so re-running the installer reconciles an
# already-split install.
provision_database() {
local role_pw admin_pw connect_pw split=false
role_pw="$(sed -n "s/^PGPASSWORD='\([^']*\)'$/\1/p" "${ENV_FILE}" | tail -n1)"
admin_pw="$(sed -n "s/^POSTGRES_PASSWORD='\([^']*\)'$/\1/p" "${PG_ADMIN_ENV}" | tail -n1)"
if [ -z "${role_pw}" ] || [ -z "${admin_pw}" ]; then
echo " [WARN] Cannot provision database roles: ${ENV_FILE} needs PGPASSWORD and ${PG_ADMIN_ENV} needs POSTGRES_PASSWORD." >&2
return
fi
if ! grep -q '^migration_database_url' "${ARCHIE_CONFIG_DIR}/config.toml"; then
split=true
fi
# A pre-split install authenticates as the superuser with the env file's
# PGPASSWORD; a split one authenticates with the Compose-only password.
if [ "${split}" = true ]; then connect_pw="${role_pw}"; else connect_pw="${admin_pw}"; fi
echo "==> Provisioning the database roles..."
if ! PGPASSWORD="${connect_pw}" ARCHIE_NEW_ADMIN_PASSWORD="${admin_pw}" \
"${ARCHIE_BIN_DIR}/archie-state-store" provision \
-admin-url "postgres://archie@/archie?host=${PG_SOCKET_DIR}" \
-runtime-url "postgres://${RUNTIME_ROLE}:${role_pw}@/archie?host=${PG_SOCKET_DIR}" \
-migration-url "postgres://${MIGRATION_ROLE}:${role_pw}@/archie?host=${PG_SOCKET_DIR}" \
-rotate-admin-password-env ARCHIE_NEW_ADMIN_PASSWORD; then
echo " [WARN] Database role provisioning failed; not restarting the services until it succeeds. Re-run the installer once the database accepts the admin credential." >&2
AUTO_START=false
return
fi
if [ "${split}" = true ]; then
if grep -q '^database_url = "postgres://archie@' "${ARCHIE_CONFIG_DIR}/config.toml"; then
sed -i "s#^database_url = \"postgres://archie@#database_url = \"postgres://${RUNTIME_ROLE}@#" "${ARCHIE_CONFIG_DIR}/config.toml"
sed -i "/^database_url = /a migration_database_url = \"postgres://${MIGRATION_ROLE}@/archie?host=${PG_SOCKET_DIR}\"" "${ARCHIE_CONFIG_DIR}/config.toml"
echo " [OK] config.toml now connects as ${RUNTIME_ROLE} and migrates as ${MIGRATION_ROLE}."
else
echo " [WARN] Could not move database_url to ${RUNTIME_ROLE}; set database_url and migration_database_url by hand." >&2
fi
fi
}
# 4. PostgreSQL. Every service fails closed without it. The bundled database
# has no network at all: the services reach it through its Unix socket,
# mounted at PG_SOCKET_DIR, so it publishes no port and cannot collide with
# another PostgreSQL. Its password is the PGPASSWORD setup generated.
# another PostgreSQL. The superuser it is created with is only the installer's
# bootstrap credential; the services connect as the two provisioned roles and
# read their password from the env file's PGPASSWORD as before.
PG_SOCKET_DIR="${ARCHIE_DATA_DIR}/postgres"
PG_COMPOSE="${ARCHIE_DATA_DIR}/postgres.yml"
if ! grep -qF "host=${PG_SOCKET_DIR}" "${ARCHIE_CONFIG_DIR}/config.toml"; then
@@ -280,6 +335,15 @@ elif ! command -v docker &>/dev/null; then
else
echo "==> Starting the bundled PostgreSQL 18..."
mkdir -p "${PG_SOCKET_DIR}"
# The superuser password is generated here rather than reused from setup: it
# is the one credential that must never be in the env file the units load.
# Written before the first start so a failed run can be retried with it.
if [ ! -f "${PG_ADMIN_ENV}" ]; then
previous_umask="$(umask)"
umask 077
printf "POSTGRES_PASSWORD='%s'\n" "$(od -An -N24 -tx1 /dev/urandom | tr -d ' \n')" >"${PG_ADMIN_ENV}"
umask "${previous_umask}"
fi
cat >"${PG_COMPOSE}" <<'EOF'
services:
postgres:
@@ -287,7 +351,7 @@ services:
network_mode: none
environment:
POSTGRES_USER: archie
POSTGRES_PASSWORD: ${PGPASSWORD:-}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-}
POSTGRES_DB: archie
POSTGRES_INITDB_ARGS: --auth-local=scram-sha-256
PGDATA: /var/lib/postgresql/data/pgdata
@@ -304,10 +368,12 @@ services:
volumes:
pg_data:
EOF
if ! docker compose -p "${INSTANCE}" --env-file "${ENV_FILE}" -f "${PG_COMPOSE}" up -d --wait; then
if ! docker compose -p "${INSTANCE}" --env-file "${PG_ADMIN_ENV}" -f "${PG_COMPOSE}" up -d --wait; then
echo " [WARN] The bundled PostgreSQL did not start, so the services are installed but not started." >&2
echo " Check: docker compose -p "${INSTANCE}" -f ${PG_COMPOSE} logs" >&2
AUTO_START=false
else
provision_database
fi
fi
@@ -495,6 +561,9 @@ echo "Installation Details:"
echo " - Binaries : ${ARCHIE_BIN_DIR}/{archied,archie-state-store,archie-gateway,archie-ui,archie-messaging}"
echo " - Config : ${ARCHIE_CONFIG_DIR}/config.toml"
echo " - Secrets : ${ENV_FILE}"
if [ -f "${PG_ADMIN_ENV}" ]; then
echo " - DB admin : ${PG_ADMIN_ENV} # compose-only, never loaded by the units"
fi
echo " - Data : ${ARCHIE_DATA_DIR}/"
echo ""
-157
View File
@@ -1,157 +0,0 @@
package agentexec
import (
"bufio"
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"os"
"sync"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
const mcpConfigPlaceholder = "{{.MCPConfig}}"
// captureRecord is one accepted capture call, as the MCP server appends it
// to the captures file.
type captureRecord struct {
Tool string `json:"tool"`
Args json.RawMessage `json:"args"`
}
// AcceptCapture decides whether one capture call is kept. Both the built-in
// loop and the harness path use it, and the harness path applies it twice:
// in the MCP server, and again when the worker reads the captures back.
func AcceptCapture(spec agentrun.CaptureTool, accepted int, value json.RawMessage) (string, bool) {
if spec.MaxCalls > 0 && accepted >= spec.MaxCalls {
return fmt.Sprintf("%s rejected: maximum call count is %d", spec.Name, spec.MaxCalls), false
}
if !json.Valid(value) {
return spec.Name + " rejected: arguments are not valid JSON", false
}
if rejection, ok := ValidateCaptureArgs(spec, value); !ok {
return rejection, false
}
return spec.Name + " recorded", true
}
// ServeCaptureMCP serves a stage's capture tools over MCP and appends each
// accepted call to sink as one JSON line. A rejected call is answered with
// its rejection, so the agent can correct it, and is not recorded.
func ServeCaptureMCP(ctx context.Context, specs []agentrun.CaptureTool, sink io.Writer, t mcp.Transport) error {
server := mcp.NewServer(&mcp.Implementation{Name: "archie", Version: "1"}, nil)
return serveHarnessMCP(ctx, specs, sink, t, server, false)
}
func serveHarnessMCP(ctx context.Context, specs []agentrun.CaptureTool, sink io.Writer, t mcp.Transport, server *mcp.Server, central bool) error {
if central {
cleanup, err := addCentralTools(ctx, server, specs)
if err != nil {
return err
}
defer cleanup()
}
var mu sync.Mutex
accepted := map[string]int{}
for _, spec := range specs {
schema := spec.Parameters
if len(schema) == 0 {
schema = json.RawMessage(`{"type":"object"}`)
}
server.AddTool(&mcp.Tool{Name: spec.Name, Description: spec.Description, InputSchema: schema},
func(_ context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
mu.Lock()
defer mu.Unlock()
args := append(json.RawMessage(nil), req.Params.Arguments...)
reply, ok := AcceptCapture(spec, accepted[spec.Name], args)
if ok {
line, err := json.Marshal(captureRecord{Tool: spec.Name, Args: args})
if err != nil {
return nil, err
}
if _, err := sink.Write(append(line, '\n')); err != nil {
return nil, fmt.Errorf("record %s: %w", spec.Name, err)
}
accepted[spec.Name]++
}
return &mcp.CallToolResult{Content: []mcp.Content{&mcp.TextContent{Text: reply}}}, nil
})
}
return server.Run(ctx, t)
}
// readCaptures reads a captures file back into a stage's captures. The file
// is writable by the harness user, so nothing in it is trusted: every record
// is checked again, and anything that is not an accepted call of a declared
// tool is dropped.
func readCaptures(path string, specs []agentrun.CaptureTool) (map[string][]json.RawMessage, error) {
raw, err := os.ReadFile(path)
if errors.Is(err, os.ErrNotExist) {
return nil, nil
}
if err != nil {
return nil, err
}
byName := make(map[string]agentrun.CaptureTool, len(specs))
for _, s := range specs {
byName[s.Name] = s
}
captures := map[string][]json.RawMessage{}
scanner := bufio.NewScanner(bytes.NewReader(raw))
scanner.Buffer(make([]byte, 64*1024), 16*1024*1024)
for scanner.Scan() {
var rec captureRecord
if json.Unmarshal(scanner.Bytes(), &rec) != nil {
continue
}
spec, declared := byName[rec.Tool]
if !declared {
continue
}
if _, ok := AcceptCapture(spec, len(captures[rec.Tool]), rec.Args); ok {
captures[rec.Tool] = append(captures[rec.Tool], rec.Args)
}
}
if len(captures) == 0 {
return nil, scanner.Err()
}
return captures, scanner.Err()
}
// ServeCaptureFiles serves the capture tools listed in specPath, appending
// accepted calls to capturesPath. The files are the ones prepareCaptures
// writes, so this package owns their format end to end.
func ServeCaptureFiles(ctx context.Context, specPath, capturesPath string, t mcp.Transport) error {
raw, err := os.ReadFile(specPath)
if err != nil {
return err
}
var spec harnessMCPSpec
if err := json.Unmarshal(raw, &spec); err != nil {
return fmt.Errorf("capture tool spec: %w", err)
}
sink, err := os.OpenFile(capturesPath, os.O_WRONLY|os.O_APPEND, 0)
if err != nil {
return err
}
defer sink.Close()
server := mcp.NewServer(&mcp.Implementation{Name: "archie", Version: "1"}, nil)
server.AddReceivingMiddleware(func(next mcp.MethodHandler) mcp.MethodHandler {
return func(ctx context.Context, method string, req mcp.Request) (mcp.Result, error) {
result, err := next(ctx, method, req)
if err == nil && (method == "tools/list" || method == "tools/call") {
if err := os.WriteFile(capturesPath+".ready", nil, 0o600); err != nil {
return nil, fmt.Errorf("record MCP initialization: %w", err)
}
}
return result, err
}
})
return serveHarnessMCP(ctx, spec.Captures, sink, t, server, spec.CentralTools)
}
-59
View File
@@ -1,59 +0,0 @@
package agentexec
import (
"context"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
// AdapterClaudeCode names the Claude Code stream-json output adapter.
const AdapterClaudeCode = "claude-code"
// Adapters for the other supported CLIs' JSON output streams.
const (
AdapterCodex = "codex"
AdapterPi = "pi"
AdapterOMP = "omp"
AdapterCopilot = "copilot"
)
// HarnessAdapter is what archie knows about one CLI: how to read its output
// stream and how to register archie's MCP server with it.
type HarnessAdapter struct {
NewOutput func() HarnessOutput
MCPConfig []string
}
var harnessAdapters = map[string]HarnessAdapter{
AdapterClaudeCode: {
NewOutput: func() HarnessOutput { return newClaudeCodeHarnessOutput() },
MCPConfig: []string{"--mcp-config", mcpConfigPlaceholder},
},
AdapterCodex: {NewOutput: func() HarnessOutput { return &codexHarnessOutput{} }, MCPConfig: []string{"-c", mcpConfigPlaceholder}},
AdapterPi: {NewOutput: func() HarnessOutput { return &piHarnessOutput{} }, MCPConfig: []string{"--extension", mcpConfigPlaceholder}},
AdapterOMP: {NewOutput: func() HarnessOutput { return &piHarnessOutput{} }, MCPConfig: []string{"--extension", mcpConfigPlaceholder}},
AdapterCopilot: {
NewOutput: func() HarnessOutput { return newCopilotHarnessOutput() },
MCPConfig: []string{"--additional-mcp-config", "@" + mcpConfigPlaceholder},
},
}
// LookupHarnessAdapter returns the named adapter. The empty name is a CLI
// with no adapter: it reports nothing and serves no capture tools.
func LookupHarnessAdapter(name string) (HarnessAdapter, bool) {
a, ok := harnessAdapters[name]
return a, ok
}
// HarnessStages runs every stage of a task on one harness: a Kit task's
// container is built from its harness, so no stage in it runs anywhere else.
type HarnessStages struct {
Runner agentrun.Runner
Spec agentrun.HarnessSpec
}
func (r HarnessStages) Run(ctx context.Context, workspace string, req agentrun.Request, report agentrun.Reporter) (agentrun.Result, error) {
spec := r.Spec
req.Harness = &spec
return r.Runner.Run(ctx, workspace, req, report)
}
-127
View File
@@ -1,127 +0,0 @@
package agentexec
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
"github.com/samcharles93/archie-core/internal/infrastructure/tasktools"
)
type harnessMCPSpec struct {
Captures []agentrun.CaptureTool `json:"captures"`
CentralTools bool `json:"central_tools"`
}
// Each adapter registers one stdio bridge; it holds only proxy credentials
// and sentinels, and never writes invocation configuration into the worktree.
func harnessMCPRegistration(adapter, dir, configPath string, server map[string]any) (string, error) {
switch adapter {
case AdapterCodex:
args, err := json.Marshal(server["args"])
if err != nil {
return "", err
}
command, ok := server["command"].(string)
if !ok {
return "", fmt.Errorf("MCP command is missing")
}
return "mcp_servers.archie={command=" + strconv.Quote(command) + ",args=" + string(args) + ",env={HTTP_PROXY=" + strconv.Quote(harnessMCPEnvironmentValue(server)) + "},required=true}", nil
case AdapterPi:
server["exposure"] = "direct"
definition, err := json.Marshal(server)
if err != nil {
return "", err
}
path := filepath.Join(dir, "archie-mcp.ts")
script := "export default function(pi) { if (typeof pi.registerMcpServer !== 'function') throw new Error('This Pi version does not support native MCP registration'); pi.registerMcpServer('archie', " + string(definition) + "); }\n"
if err := os.WriteFile(path, []byte(script), 0o644); err != nil {
return "", err
}
return path, nil
case AdapterOMP:
// OMP discovers .mcp.json in an explicitly loaded extension package.
path := filepath.Join(dir, "index.ts")
if err := os.WriteFile(path, []byte("export default function() {}\n"), 0o644); err != nil {
return "", err
}
data, err := os.ReadFile(configPath)
if err != nil {
return "", err
}
if err := os.WriteFile(filepath.Join(dir, ".mcp.json"), data, 0o644); err != nil {
return "", err
}
return dir, nil
default:
return configPath, nil
}
}
type centralTransport struct{ base http.RoundTripper }
func (t centralTransport) RoundTrip(r *http.Request) (*http.Response, error) {
if r.URL.String() != tasktools.Endpoint {
return nil, fmt.Errorf("central tool request names an unexpected endpoint")
}
r = r.Clone(r.Context())
r.Header.Set("Authorization", "Bearer "+tasktools.Sentinel)
return t.base.RoundTrip(r)
}
func addCentralTools(ctx context.Context, server *mcp.Server, captures []agentrun.CaptureTool) (func(), error) {
proxy, err := url.Parse(os.Getenv("HTTP_PROXY"))
if err != nil || proxy.Host == "" {
return nil, fmt.Errorf("central tools require the task egress proxy")
}
transport := &http.Transport{Proxy: http.ProxyURL(proxy)}
client := mcp.NewClient(&mcp.Implementation{Name: "archie-harness", Version: "1"}, nil)
session, err := client.Connect(ctx, &mcp.StreamableClientTransport{Endpoint: tasktools.Endpoint, HTTPClient: &http.Client{Transport: centralTransport{base: transport}, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}, DisableStandaloneSSE: true, MaxRetries: -1, MaxEventSize: -1}, nil)
if err != nil {
transport.CloseIdleConnections()
return nil, fmt.Errorf("connect central tools: %w", err)
}
closeSession := func() { _ = session.Close(); transport.CloseIdleConnections() }
names := map[string]bool{}
for _, spec := range captures {
names[spec.Name] = true
}
for tool, err := range session.Tools(ctx, nil) {
if err != nil {
closeSession()
return nil, fmt.Errorf("list central tools: %w", err)
}
if names[tool.Name] {
closeSession()
return nil, fmt.Errorf("central tool %q collides with a capture tool", tool.Name)
}
server.AddTool(tool, func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
return session.CallTool(ctx, &mcp.CallToolParams{Name: req.Params.Name, Arguments: req.Params.Arguments})
})
}
return closeSession, nil
}
func harnessMCPEnvironment(env []string) map[string]string {
out := map[string]string{}
for _, entry := range env {
if value, ok := strings.CutPrefix(entry, "HTTP_PROXY="); ok {
out["HTTP_PROXY"] = value
}
}
return out
}
func harnessMCPEnvironmentValue(server map[string]any) string {
env, _ := server["env"].(map[string]string)
return env["HTTP_PROXY"]
}
-46
View File
@@ -1,46 +0,0 @@
//go:build unix
package agentexec
import (
"encoding/json"
"os"
"os/exec"
"testing"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
// Some CLIs log an unsupported MCP configuration but still exit successfully.
func TestHarnessRequiresMCPInitialization(t *testing.T) {
for _, central := range []bool{false, true} {
t.Run(map[bool]string{false: "captures", true: "central tools"}[central], func(t *testing.T) {
workspace, err := os.MkdirTemp("", "archie-mcp-regression-") //nolint:usetesting // The harness user cannot traverse testing's private parent directory.
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(workspace)
for _, args := range [][]string{{"init", "-q"}, {"-c", "user.name=fixture", "-c", "user.email=fixture@example.invalid", "commit", "--allow-empty", "-q", "-m", "fixture"}} {
cmd := exec.CommandContext(t.Context(), "git", append([]string{"-C", workspace}, args...)...)
if raw, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("git fixture %v: %s", err, raw)
}
}
h := &agentrun.HarnessSpec{Launch: []string{"sh", "-c", "exit 0", "harness"}, Prompt: []string{"{{.Prompt}}"}, MCPConfig: []string{"{{.MCPConfig}}"}, Env: []string{"PATH=/usr/bin:/bin"}, CentralTools: central}
if os.Geteuid() == 0 {
h.User = "65534"
}
req := agentrun.Request{Version: agentrun.ProtocolVersion, TaskID: 7, Attempt: 1, Stage: "test", Mission: "return a result", Model: "fixture/model", Harness: h}
if !central {
req.CaptureTools = []agentrun.CaptureTool{{Name: "capture_result", Parameters: json.RawMessage(`{"type":"object"}`)}}
}
result, err := NewHarnessRunner(nil).Run(t.Context(), workspace, req, agentrun.Reporter{})
if err != nil {
t.Fatal(err)
}
if result.Status == agentrun.StatusPassed || result.StopReason != StopExited {
t.Fatalf("unsupported MCP silently passed: %+v", result)
}
})
}
}
-171
View File
@@ -1,171 +0,0 @@
package agentexec
import (
"bytes"
"encoding/json"
"strings"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
// claudeCodeHarnessOutput reads Claude Code's newline-delimited stream-json
// output. It keeps tool-use IDs until the corresponding user tool_result
// arrives and retains assistant usage as a fallback for interrupted runs.
type claudeCodeHarnessOutput struct {
sessionID string
pending map[string]string
messageUsage agentrun.Usage
seenMessages map[string]struct{}
hasResult bool
resultUsage agentrun.Usage
}
func newClaudeCodeHarnessOutput() *claudeCodeHarnessOutput {
return &claudeCodeHarnessOutput{
pending: make(map[string]string),
seenMessages: make(map[string]struct{}),
}
}
func (o *claudeCodeHarnessOutput) Line(line []byte, report agentrun.Reporter) {
var event struct {
Type string `json:"type"`
SessionID string `json:"session_id"`
Message json.RawMessage `json:"message"`
Usage json.RawMessage `json:"usage"`
}
if json.Unmarshal(line, &event) != nil {
return
}
if event.SessionID != "" {
o.sessionID = event.SessionID
}
switch event.Type {
case "assistant":
o.assistant(event.Message, report)
case "user":
o.user(event.Message, report)
case "result":
if usage, ok := decodeClaudeUsage(event.Usage); ok {
o.resultUsage = usage
o.hasResult = true
}
}
}
func (o *claudeCodeHarnessOutput) assistant(raw json.RawMessage, _ agentrun.Reporter) {
var message struct {
ID string `json:"id"`
Usage json.RawMessage `json:"usage"`
Content []struct {
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Input any `json:"input"`
} `json:"content"`
}
if json.Unmarshal(raw, &message) != nil {
return
}
if usage, ok := decodeClaudeUsage(message.Usage); ok && (message.ID == "" || o.markMessage(message.ID)) {
o.messageUsage = addUsage(o.messageUsage, usage)
}
for _, block := range message.Content {
if block.Type == "tool_use" && block.ID != "" && block.Name != "" {
o.pending[block.ID] = block.Name
}
}
}
func (o *claudeCodeHarnessOutput) user(raw json.RawMessage, report agentrun.Reporter) {
var message struct {
Content []struct {
Type string `json:"type"`
ToolUseID string `json:"tool_use_id"`
Content json.RawMessage `json:"content"`
IsError bool `json:"is_error"`
} `json:"content"`
}
if json.Unmarshal(raw, &message) != nil {
return
}
for _, block := range message.Content {
if block.Type != "tool_result" || block.ToolUseID == "" {
continue
}
tool, ok := o.pending[block.ToolUseID]
if !ok {
continue
}
delete(o.pending, block.ToolUseID)
report.ReportToolCall(agentrun.ToolCallReport{
Tool: tool, Detail: ClipToolCallDetail(claudeResultContent(block.Content)),
Failed: block.IsError,
})
}
}
func (o *claudeCodeHarnessOutput) markMessage(id string) bool {
if _, seen := o.seenMessages[id]; seen {
return false
}
o.seenMessages[id] = struct{}{}
return true
}
func (o *claudeCodeHarnessOutput) SessionID() string { return o.sessionID }
func (o *claudeCodeHarnessOutput) Usage() agentrun.Usage {
if o.hasResult {
return o.resultUsage
}
return o.messageUsage
}
func decodeClaudeUsage(raw json.RawMessage) (agentrun.Usage, bool) {
var fields struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
CacheReadInputTokens int `json:"cache_read_input_tokens"`
CacheCreationInputTokens int `json:"cache_creation_input_tokens"`
}
if len(raw) == 0 || bytes.Equal(bytes.TrimSpace(raw), []byte("null")) || json.Unmarshal(raw, &fields) != nil {
return agentrun.Usage{}, false
}
return usageFromFields(fields.InputTokens, fields.OutputTokens, fields.CacheReadInputTokens, fields.CacheCreationInputTokens), true
}
// usageFromFields folds cache reads and writes into PromptTokens, as the
// built-in loop's Anthropic provider does: Claude's input_tokens excludes
// them, and budgets must count a harness run the way they count a built-in
// one.
func usageFromFields(input, output, cacheRead, cacheCreation int) agentrun.Usage {
prompt := input + cacheRead + cacheCreation
return agentrun.Usage{
PromptTokens: prompt, CompletionTokens: output, TotalTokens: prompt + output,
CachedTokens: cacheRead, CacheCreationTokens: cacheCreation,
}
}
func claudeResultContent(raw json.RawMessage) string {
var content string
if json.Unmarshal(raw, &content) == nil {
return content
}
var blocks []struct {
Type string `json:"type"`
Text string `json:"text"`
}
if json.Unmarshal(raw, &blocks) != nil {
return ""
}
texts := make([]string, 0, len(blocks))
for _, block := range blocks {
if block.Type == "text" {
texts = append(texts, block.Text)
}
}
return strings.Join(texts, "\n")
}
-107
View File
@@ -1,107 +0,0 @@
package agentexec
import (
"encoding/json"
"strings"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
// codexHarnessOutput reads `codex exec --json`. Each tool item is reported
// when its item.completed event arrives; usage comes from turn.completed, so
// a run killed mid-turn reports none.
type codexHarnessOutput struct {
threadID string
usage agentrun.Usage
}
func (o *codexHarnessOutput) Line(line []byte, report agentrun.Reporter) {
var event struct {
Type string `json:"type"`
ThreadID string `json:"thread_id"`
Usage *struct {
InputTokens int `json:"input_tokens"`
CachedInputTokens int `json:"cached_input_tokens"`
CacheWriteTokens int `json:"cache_write_input_tokens"`
OutputTokens int `json:"output_tokens"`
} `json:"usage"`
Item codexItem `json:"item"`
}
if json.Unmarshal(line, &event) != nil {
return
}
switch event.Type {
case "thread.started":
o.threadID = event.ThreadID
case "turn.completed":
if u := event.Usage; u != nil {
// Codex follows OpenAI: input_tokens already includes cached input.
o.usage = addUsage(o.usage, agentrun.Usage{
PromptTokens: u.InputTokens, CompletionTokens: u.OutputTokens,
TotalTokens: u.InputTokens + u.OutputTokens,
CachedTokens: u.CachedInputTokens, CacheCreationTokens: u.CacheWriteTokens,
})
}
case "item.completed":
if call, ok := event.Item.report(); ok {
report.ReportToolCall(call)
}
}
}
type codexItem struct {
Type string `json:"type"`
Status string `json:"status"`
AggregatedOutput string `json:"aggregated_output"`
Tool string `json:"tool"`
Result *struct {
Content []struct {
Type string `json:"type"`
Text string `json:"text"`
} `json:"content"`
} `json:"result"`
Error *struct {
Message string `json:"message"`
} `json:"error"`
Changes []struct {
Path string `json:"path"`
} `json:"changes"`
Query string `json:"query"`
}
func (item codexItem) report() (agentrun.ToolCallReport, bool) {
call := agentrun.ToolCallReport{Tool: item.Type, Failed: item.Status == "failed"}
switch item.Type {
case "command_execution":
call.Detail = item.AggregatedOutput
case "mcp_tool_call":
call.Tool = item.Tool
switch {
case item.Error != nil:
call.Detail, call.Failed = item.Error.Message, true
case item.Result != nil:
texts := make([]string, 0, len(item.Result.Content))
for _, block := range item.Result.Content {
if block.Type == "text" {
texts = append(texts, block.Text)
}
}
call.Detail = strings.Join(texts, "\n")
}
case "file_change":
paths := make([]string, 0, len(item.Changes))
for _, change := range item.Changes {
paths = append(paths, change.Path)
}
call.Detail = strings.Join(paths, "\n")
case "web_search":
call.Detail = item.Query
default:
return agentrun.ToolCallReport{}, false
}
call.Detail = ClipToolCallDetail(call.Detail)
return call, true
}
func (o *codexHarnessOutput) SessionID() string { return o.threadID }
func (o *codexHarnessOutput) Usage() agentrun.Usage { return o.usage }
@@ -1,60 +0,0 @@
package agentexec
import (
"encoding/json"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
// copilotHarnessOutput reads GitHub Copilot CLI's `--output-format json`.
// The stream carries no token counts, so a Copilot run reports no usage and
// its budget is wall clock.
type copilotHarnessOutput struct {
sessionID string
pending map[string]string
}
func newCopilotHarnessOutput() *copilotHarnessOutput {
return &copilotHarnessOutput{pending: make(map[string]string)}
}
func (o *copilotHarnessOutput) Line(line []byte, report agentrun.Reporter) {
var event struct {
Type string `json:"type"`
SessionID string `json:"sessionId"`
Data struct {
ToolCallID string `json:"toolCallId"`
ToolName string `json:"toolName"`
MCPToolName string `json:"mcpToolName"`
Success bool `json:"success"`
Result struct {
Content string `json:"content"`
} `json:"result"`
} `json:"data"`
}
if json.Unmarshal(line, &event) != nil {
return
}
switch event.Type {
case "result":
o.sessionID = event.SessionID
case "tool.execution_start":
name := event.Data.MCPToolName
if name == "" {
name = event.Data.ToolName
}
if event.Data.ToolCallID != "" && name != "" {
o.pending[event.Data.ToolCallID] = name
}
case "tool.execution_complete":
tool, ok := o.pending[event.Data.ToolCallID]
if !ok {
return
}
delete(o.pending, event.Data.ToolCallID)
report.ReportToolCall(agentrun.ToolCallReport{Tool: tool, Detail: ClipToolCallDetail(event.Data.Result.Content), Failed: !event.Data.Success})
}
}
func (o *copilotHarnessOutput) SessionID() string { return o.sessionID }
func (o *copilotHarnessOutput) Usage() agentrun.Usage { return agentrun.Usage{} }
-66
View File
@@ -1,66 +0,0 @@
package agentexec
import (
"encoding/json"
"strings"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
// piHarnessOutput reads `--mode json` from Pi and OMP, which share the
// event stream. Usage is summed from each assistant message_end, so an
// interrupted run still reports what it spent.
type piHarnessOutput struct {
sessionID string
usage agentrun.Usage
}
func (o *piHarnessOutput) Line(line []byte, report agentrun.Reporter) {
var event struct {
Type string `json:"type"`
ID string `json:"id"`
ToolName string `json:"toolName"`
IsError bool `json:"isError"`
Result struct {
Content []struct {
Type string `json:"type"`
Text string `json:"text"`
} `json:"content"`
} `json:"result"`
Message struct {
Role string `json:"role"`
Usage *struct {
Input int `json:"input"`
Output int `json:"output"`
CacheRead int `json:"cacheRead"`
CacheWrite int `json:"cacheWrite"`
} `json:"usage"`
} `json:"message"`
}
if json.Unmarshal(line, &event) != nil {
return
}
switch event.Type {
case "session":
o.sessionID = event.ID
case "message_end":
// Pi's input excludes cache reads and writes, as Claude's does.
if u := event.Message.Usage; event.Message.Role == "assistant" && u != nil {
o.usage = addUsage(o.usage, usageFromFields(u.Input, u.Output, u.CacheRead, u.CacheWrite))
}
case "tool_execution_end":
if event.ToolName == "" {
return
}
texts := make([]string, 0, len(event.Result.Content))
for _, block := range event.Result.Content {
if block.Type == "text" {
texts = append(texts, block.Text)
}
}
report.ReportToolCall(agentrun.ToolCallReport{Tool: event.ToolName, Detail: ClipToolCallDetail(strings.Join(texts, "\n")), Failed: event.IsError})
}
}
func (o *piHarnessOutput) SessionID() string { return o.sessionID }
func (o *piHarnessOutput) Usage() agentrun.Usage { return o.usage }
-27
View File
@@ -1,27 +0,0 @@
//go:build !unix
package agentexec
import (
"errors"
"os/exec"
)
// setProcessGroup falls back to killing the harness process alone where
// process groups are unavailable.
func setProcessGroup(*exec.Cmd) {}
// runAsHarnessUser refuses a named harness user where user switching is
// unavailable, rather than running the harness as the worker.
func runAsHarnessUser(_ *exec.Cmd, name string) error {
if name != "" {
return errors.New("harness user switching is unsupported on this platform")
}
return nil
}
// ownForHarness has nothing to do where the harness runs as the worker.
func ownForHarness(string, ...string) error { return nil }
// ownTreeForHarness has nothing to do where the harness runs as the worker.
func ownTreeForHarness(string, string) error { return nil }
-118
View File
@@ -1,118 +0,0 @@
//go:build unix
package agentexec
import (
"errors"
"fmt"
"io/fs"
"os"
"os/exec"
"os/user"
"path/filepath"
"strconv"
"strings"
"syscall"
)
// setProcessGroup puts the harness in its own process group and makes
// cancellation kill the whole group.
func setProcessGroup(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
cmd.Cancel = func() error { return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL) }
}
// runAsHarnessUser drops the invocation to the Kit's user. A worker running
// as root refuses to start a harness with no user, because the harness would
// then share the worker's user and could read its credentials.
func runAsHarnessUser(cmd *exec.Cmd, name string) error {
if name == "" {
if os.Geteuid() == 0 {
return errors.New("harness has no user and the worker runs as root; refusing to give the harness the worker's privileges")
}
return nil
}
cred, err := harnessCredential(name)
if err != nil {
return err
}
cmd.SysProcAttr.Credential = cred
return nil
}
// harnessCredential resolves a user name or "uid[:gid]" to a credential.
// Root is refused whichever way it is named. IDs are bounded to 31 bits so
// they convert to int for os.Chown on every platform.
func harnessCredential(name string) (*syscall.Credential, error) {
uidText, gidText, hasGid := strings.Cut(name, ":")
uid, uidErr := strconv.ParseUint(uidText, 10, 31)
var cred syscall.Credential
if uidErr == nil {
cred.Uid, cred.Gid = uint32(uid), uint32(uid)
} else {
u, err := user.Lookup(uidText)
if err != nil {
return nil, fmt.Errorf("harness user %q: %w", uidText, err)
}
id, err := strconv.ParseUint(u.Uid, 10, 31)
if err != nil {
return nil, fmt.Errorf("harness user %q has non-numeric uid %q", uidText, u.Uid)
}
group, err := strconv.ParseUint(u.Gid, 10, 31)
if err != nil {
return nil, fmt.Errorf("harness user %q has non-numeric gid %q", uidText, u.Gid)
}
cred.Uid, cred.Gid = uint32(id), uint32(group)
}
if hasGid {
gid, err := strconv.ParseUint(gidText, 10, 31)
if err != nil {
return nil, fmt.Errorf("harness group %q is not numeric", gidText)
}
cred.Gid = uint32(gid)
}
if cred.Uid == 0 {
return nil, fmt.Errorf("harness user %q is root; a harness never runs with the worker's privileges", name)
}
return &cred, nil
}
// ownForHarness gives paths to the harness user when the worker is root, so
// the harness's MCP server can write its captures.
func ownForHarness(name string, paths ...string) error {
if name == "" || os.Geteuid() != 0 {
return nil
}
cred, err := harnessCredential(name)
if err != nil {
return err
}
for _, p := range paths {
if err := os.Chown(p, int(cred.Uid), int(cred.Gid)); err != nil {
return err
}
}
return nil
}
// ownTreeForHarness gives the worktree to the harness user when the worker
// is root, except .git: the harness edits files and never writes the
// repository, so its refs and config stay the worker's.
func ownTreeForHarness(name, root string) error {
if name == "" || os.Geteuid() != 0 {
return nil
}
cred, err := harnessCredential(name)
if err != nil {
return err
}
return filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if d.IsDir() && d.Name() == ".git" && path != root {
return filepath.SkipDir
}
return os.Lchown(path, int(cred.Uid), int(cred.Gid))
})
}
-540
View File
@@ -1,540 +0,0 @@
package agentexec
import (
"bufio"
"bytes"
"context"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"maps"
"os"
"os/exec"
"path/filepath"
"slices"
"strings"
"time"
git "github.com/go-git/go-git/v6"
"github.com/go-git/go-git/v6/plumbing"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
// Harness outcomes beyond StatusPassed. The strings match the built-in
// loop's, so a stage reads the same whichever runner ran it.
const (
StatusParked = "parked"
StopTimedOut = "timed_out"
StopPolicy = "policy_violation"
StopGate = "gate_failed"
StopExited = "harness_exited"
)
const (
promptPlaceholder = "{{.Prompt}}"
sessionPlaceholder = "{{.SessionID}}"
stderrTailBytes = 2000
killGrace = 2 * time.Second
)
// HarnessOutput reads one harness invocation's standard output. An adapter
// knows its CLI's stream format; it reports tool calls as they complete and
// the session to resume.
type HarnessOutput interface {
Line(line []byte, report agentrun.Reporter)
SessionID() string
Usage() agentrun.Usage
}
// HarnessRunner runs a stage on an external coding-agent CLI. Archie's
// guarantees do not depend on the CLI obeying its prompt: the runner checks
// the worktree and the repository's refs and configuration after every
// invocation, runs the gate itself, and owns the process's lifetime.
type HarnessRunner struct {
newOutput func() HarnessOutput
// mcpCommand starts archie's MCP server; it defaults to this binary's
// own "mcp" subcommand.
mcpCommand []string
}
// NewHarnessRunner returns a runner using newOutput to read each
// invocation. A nil newOutput reads with the adapter the request names.
func NewHarnessRunner(newOutput func() HarnessOutput) *HarnessRunner {
return &HarnessRunner{newOutput: newOutput}
}
func (r *HarnessRunner) Run(ctx context.Context, workspace string, req agentrun.Request, report agentrun.Reporter) (agentrun.Result, error) {
if err := validateHarness(req); err != nil {
return agentrun.Result{}, err
}
if err := ownTreeForHarness(req.Harness.User, workspace); err != nil {
return agentrun.Result{}, fmt.Errorf("give the worktree to the harness user: %w", err)
}
mcpConfig, capturesPath, cleanup, err := r.prepareCaptures(req)
if err != nil {
return agentrun.Result{}, err
}
defer cleanup()
res, err := r.run(ctx, workspace, req, mcpConfig, report)
if capturesPath != "" {
if res.Status == agentrun.StatusPassed {
if _, readyErr := os.Stat(capturesPath + ".ready"); readyErr != nil {
return park(res, StopExited, "harness did not initialize Archie MCP; check CLI MCP support and startup errors"), err
}
}
captures, readErr := readCaptures(capturesPath, req.CaptureTools)
if readErr != nil {
return res, errors.Join(err, fmt.Errorf("read captures: %w", readErr))
}
res.Captures = captures
}
return res, err
}
func (r *HarnessRunner) run(ctx context.Context, workspace string, req agentrun.Request, mcpConfig string, report agentrun.Reporter) (agentrun.Result, error) {
res := agentrun.Result{Version: agentrun.ProtocolVersion, TaskID: req.TaskID, Attempt: req.Attempt, Stage: req.Stage}
before, err := snapshotRepo(workspace)
if err != nil {
return agentrun.Result{}, fmt.Errorf("snapshot workspace before harness: %w", err)
}
runCtx := ctx
if req.Budget.WallClock > 0 {
var cancel context.CancelFunc
runCtx, cancel = context.WithTimeout(ctx, req.Budget.WallClock)
defer cancel()
}
maxIterations := 1
if len(req.Harness.Resume) > 0 || len(req.Harness.Continue) > 0 {
maxIterations = max(1, req.Gate.MaxConsecutiveFailures)
}
prompt := harnessPrompt(workspace, req)
verb := req.Harness.Prompt
session := ""
for {
res.Iterations++
out := r.output(req.Harness.Adapter)
exitErr := invoke(runCtx, workspace, req.Harness, harnessArgv(req.Harness, verb, prompt, session, mcpConfig), out, report)
if id := out.SessionID(); id != "" {
session = id
}
res.Usage = addUsage(res.Usage, out.Usage())
res.TokensUsed = res.Usage.TotalTokens
if ctx.Err() != nil {
return res, ctx.Err()
}
res, stopped, err := settle(runCtx, workspace, before, req, res, exitErr)
if err != nil || stopped {
return res, err
}
gateOutput, gateErr := runHarnessGate(runCtx, req.Gate.Commands, workspace)
if gateErr == nil {
res.Status = agentrun.StatusPassed
return res, nil
}
if runCtx.Err() != nil {
return park(res, StopTimedOut, "harness exceeded its wall-clock budget during the gate"), nil
}
if res.Iterations >= maxIterations {
return park(res, StopGate, gateOutput), nil
}
verb, prompt = resumeVerb(req.Harness, session), "The quality gate failed. Fix the cause, then stop.\n\n"+gateOutput
}
}
// settle checks one finished invocation. Guarantees come first: a policy
// violation parks the step even when the invocation also timed out or
// failed, because what the harness did matters more than how it ended.
func settle(runCtx context.Context, workspace string, before repoState, req agentrun.Request, res agentrun.Result, exitErr error) (agentrun.Result, bool, error) {
after, err := snapshotRepo(workspace)
if err != nil {
return res, true, fmt.Errorf("snapshot workspace after harness: %w", err)
}
res.Changes = changedPaths(before, after)
// An exhausted budget is an outcome of the step, not a runner error.
outOfTime := errors.Is(runCtx.Err(), context.DeadlineExceeded)
switch violation := policyViolation(before, after, res.Changes, req); {
case violation != "":
return park(res, StopPolicy, violation), true, nil
case outOfTime:
return park(res, StopTimedOut, "harness exceeded its wall-clock budget"), true, nil
case exitErr != nil:
return park(res, StopExited, exitErr.Error()), true, nil
}
return res, false, nil
}
func (r *HarnessRunner) output(adapter string) HarnessOutput {
if r.newOutput != nil {
return r.newOutput()
}
if a, ok := LookupHarnessAdapter(adapter); ok {
return a.NewOutput()
}
return silentOutput{}
}
func validateHarness(req agentrun.Request) error {
if err := req.Validate(); err != nil {
return err
}
h := req.Harness
if h == nil || len(h.Launch) == 0 {
return errors.New("harness runner needs a harness spec with a launch command")
}
if !slices.ContainsFunc(h.Prompt, func(s string) bool { return strings.Contains(s, promptPlaceholder) }) {
return fmt.Errorf("harness prompt verb must carry %s, or the mission is never passed", promptPlaceholder)
}
if _, ok := LookupHarnessAdapter(h.Adapter); h.Adapter != "" && !ok {
return fmt.Errorf("harness output adapter %q is unknown", h.Adapter)
}
if req.Gate.MaxConsecutiveFailures > 1 && len(h.Resume) == 0 && len(h.Continue) == 0 {
return errors.New("stage retries its gate but the harness declares no resume or continue verb")
}
if len(h.Resume) > 0 && !slices.ContainsFunc(h.Resume, func(s string) bool { return strings.Contains(s, sessionPlaceholder) }) {
return fmt.Errorf("harness resume verb must carry %s", sessionPlaceholder)
}
if (len(req.CaptureTools) > 0 || h.CentralTools) && !slices.ContainsFunc(h.MCPConfig, func(s string) bool { return strings.Contains(s, mcpConfigPlaceholder) }) {
return errors.New("stage needs Archie tools but the harness registers no MCP server; its results would be lost")
}
return nil
}
// harnessArgv is the launch command, then the verb, then the prompt verb
// when the verb is a resume or continue, with placeholders substituted as
// raw values rather than shell text.
func harnessArgv(h *agentrun.HarnessSpec, verb []string, prompt, session, mcpConfig string) []string {
argv := slices.Clone(h.Launch)
tails := [][]string{verb}
if !slices.Equal(verb, h.Prompt) {
tails = append(tails, h.Prompt)
}
if mcpConfig != "" {
tails = append([][]string{h.MCPConfig}, tails...)
}
for _, tail := range tails {
for _, arg := range tail {
arg = strings.ReplaceAll(arg, promptPlaceholder, prompt)
arg = strings.ReplaceAll(arg, sessionPlaceholder, session)
arg = strings.ReplaceAll(arg, mcpConfigPlaceholder, mcpConfig)
argv = append(argv, arg)
}
}
return argv
}
// resumeVerb continues the session the last invocation reported, falling
// back to the most recent session when the CLI reported none.
func resumeVerb(h *agentrun.HarnessSpec, sessionID string) []string {
if len(h.Resume) > 0 && sessionID != "" {
return slices.Clone(h.Resume)
}
if len(h.Continue) > 0 {
return slices.Clone(h.Continue)
}
return slices.Clone(h.Resume)
}
// invoke runs one harness invocation in its own process group, feeding
// stdout to out line by line. Cancelling ctx kills the whole group, so a
// CLI's children cannot outlive the step.
func invoke(ctx context.Context, workspace string, h *agentrun.HarnessSpec, argv []string, out HarnessOutput, report agentrun.Reporter) error {
cmd := exec.CommandContext(ctx, argv[0], argv[1:]...)
cmd.Dir = workspace
cmd.WaitDelay = killGrace
// A nil Env would inherit the worker's environment and its credentials.
cmd.Env = append([]string{}, h.Env...)
setProcessGroup(cmd)
if err := runAsHarnessUser(cmd, h.User); err != nil {
return err
}
stdout, err := cmd.StdoutPipe()
if err != nil {
return err
}
var stderr tailBuffer
cmd.Stderr = io.MultiWriter(&stderr, os.Stderr)
if err := cmd.Start(); err != nil {
return fmt.Errorf("start harness: %w", err)
}
// Keep the raw harness activity visible in the container's live output.
output := io.TeeReader(stdout, os.Stdout)
scanner := bufio.NewScanner(output)
scanner.Buffer(make([]byte, 64*1024), 16*1024*1024)
for scanner.Scan() {
out.Line(scanner.Bytes(), report)
}
_, _ = io.Copy(io.Discard, output)
if err := cmd.Wait(); err != nil {
if ctx.Err() != nil {
return ctx.Err()
}
return fmt.Errorf("harness exited: %w: %s", err, strings.TrimSpace(stderr.String()))
}
return nil
}
func harnessPrompt(workspace string, req agentrun.Request) string {
var b strings.Builder
b.WriteString(req.Mission)
b.WriteString("\n\n## Rules\n\n")
b.WriteString(ProjectScopedRules(workspace, req.ExtraRules))
b.WriteString("\nDo not run git commands that change history, refs or configuration. Archie commits your changes.")
if req.ReadOnly {
b.WriteString("\nThis stage is read-only. Do not create, modify or delete any file.")
}
if patterns := slices.Concat(req.Protection.Suffixes, req.Protection.Globs); len(patterns) > 0 {
b.WriteString("\nDo not modify files matching: " + strings.Join(patterns, ", "))
}
if len(req.Gate.Commands) > 0 {
b.WriteString("\nYour work must pass these commands:")
for _, c := range req.Gate.Commands {
b.WriteString("\n- " + strings.Join(c.Argv, " "))
}
}
if strings.TrimSpace(req.Notes) != "" {
b.WriteString("\n\n## Notes\n\n" + req.Notes)
}
return b.String()
}
func runHarnessGate(ctx context.Context, commands []agentrun.Command, workspace string) (string, error) {
for _, c := range commands {
if len(c.Argv) == 0 {
continue
}
cmd := exec.CommandContext(ctx, c.Argv[0], c.Argv[1:]...)
cmd.Dir = workspace
output, err := cmd.CombinedOutput()
switch {
case c.ExpectFailure && err == nil:
return fmt.Sprintf("[%s] expected this command to fail, but it passed:\n%s", c.Name, clipGate(output)),
fmt.Errorf("gate %s: expected failure", c.Name)
case !c.ExpectFailure && err != nil:
return fmt.Sprintf("[%s] %s\n%s", c.Name, strings.Join(c.Argv, " "), clipGate(output)), fmt.Errorf("gate %s: %w", c.Name, err)
}
}
return "", nil
}
func clipGate(out []byte) string {
const limit = 4000
s := strings.TrimSpace(string(out))
if len(s) <= limit {
return s
}
return s[:limit/2] + "\n...[truncated]...\n" + s[len(s)-limit/2:]
}
func park(res agentrun.Result, stop, detail string) agentrun.Result {
res.Status, res.StopReason, res.Detail = StatusParked, stop, detail
return res
}
func addUsage(a, b agentrun.Usage) agentrun.Usage {
return agentrun.Usage{
PromptTokens: a.PromptTokens + b.PromptTokens,
CompletionTokens: a.CompletionTokens + b.CompletionTokens,
TotalTokens: a.TotalTokens + b.TotalTokens,
CachedTokens: a.CachedTokens + b.CachedTokens,
CacheCreationTokens: a.CacheCreationTokens + b.CacheCreationTokens,
}
}
// repoState is what the runner compares across an invocation: every ref
// (HEAD included), the repository configuration, and a content hash of each
// path git reports as not clean.
type repoState struct {
refs map[string]string
config string
dirty map[string]string
}
func snapshotRepo(workspace string) (repoState, error) {
repo, err := git.PlainOpen(workspace)
if err != nil {
return repoState{}, err
}
state := repoState{refs: map[string]string{}, dirty: map[string]string{}}
if head, err := repo.Storer.Reference(plumbing.HEAD); err == nil {
state.refs[plumbing.HEAD.String()] = head.String()
}
iter, err := repo.References()
if err != nil {
return repoState{}, err
}
if err := iter.ForEach(func(ref *plumbing.Reference) error {
state.refs[ref.Name().String()] = ref.String()
return nil
}); err != nil {
return repoState{}, err
}
cfg, err := repo.Config()
if err != nil {
return repoState{}, err
}
raw, err := cfg.Marshal()
if err != nil {
return repoState{}, err
}
state.config = string(raw)
wt, err := repo.Worktree()
if err != nil {
return repoState{}, err
}
status, err := wt.Status()
if err != nil {
return repoState{}, err
}
for path, st := range status {
if st.Worktree == git.Unmodified && st.Staging == git.Unmodified {
continue
}
state.dirty[path] = contentHash(filepath.Join(workspace, path))
}
return state, nil
}
func contentHash(path string) string {
data, err := os.ReadFile(path)
if err != nil {
return "absent"
}
sum := sha256.Sum256(data)
return hex.EncodeToString(sum[:])
}
// changedPaths is every path whose state differs across the invocation. A
// path already dirty and left untouched is not a change of this run.
func changedPaths(before, after repoState) []string {
var changed []string
for path := range mergeKeys(before.dirty, after.dirty) {
if before.dirty[path] != after.dirty[path] {
changed = append(changed, path)
}
}
slices.Sort(changed)
return changed
}
func mergeKeys(a, b map[string]string) map[string]struct{} {
keys := make(map[string]struct{}, len(a)+len(b))
for k := range maps.Keys(a) {
keys[k] = struct{}{}
}
for k := range maps.Keys(b) {
keys[k] = struct{}{}
}
return keys
}
func policyViolation(before, after repoState, changes []string, req agentrun.Request) string {
if !maps.Equal(before.refs, after.refs) {
var moved []string
for name := range mergeKeys(before.refs, after.refs) {
if before.refs[name] != after.refs[name] {
moved = append(moved, name)
}
}
slices.Sort(moved)
return "the harness changed git refs: " + strings.Join(moved, ", ")
}
if before.config != after.config {
return "the harness changed the git configuration"
}
if req.ReadOnly && len(changes) > 0 {
return "the harness wrote in a read-only stage: " + strings.Join(changes, ", ")
}
if protected := ProtectionMatcher(req.Protection, false); protected != nil {
var hit []string
for _, path := range changes {
if protected(path) {
hit = append(hit, path)
}
}
if len(hit) > 0 {
return "the harness modified protected paths: " + strings.Join(hit, ", ")
}
}
return ""
}
type silentOutput struct{}
func (silentOutput) Line([]byte, agentrun.Reporter) {}
func (silentOutput) SessionID() string { return "" }
func (silentOutput) Usage() agentrun.Usage { return agentrun.Usage{} }
// tailBuffer keeps the last stderrTailBytes written to it.
type tailBuffer struct{ buf bytes.Buffer }
func (t *tailBuffer) Write(p []byte) (int, error) {
t.buf.Write(p)
if extra := t.buf.Len() - stderrTailBytes; extra > 0 {
t.buf.Next(extra)
}
return len(p), nil
}
func (t *tailBuffer) String() string { return t.buf.String() }
// prepareCaptures writes the capture tools' spec and an MCP config pointing
// the CLI at archie's MCP server, and creates the captures file the server
// appends to. The directory belongs to the harness user, whose MCP server
// writes into it.
func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures string, cleanup func(), err error) {
cleanup = func() {}
if len(req.CaptureTools) == 0 && !req.Harness.CentralTools {
return "", "", cleanup, nil
}
dir, err := os.MkdirTemp("", "archie-captures-")
if err != nil {
return "", "", cleanup, err
}
cleanup = func() { _ = os.RemoveAll(dir) }
fail := func(err error) (string, string, func(), error) {
cleanup()
return "", "", func() {}, err
}
spec, err := json.Marshal(harnessMCPSpec{Captures: req.CaptureTools, CentralTools: req.Harness.CentralTools})
if err != nil {
return fail(err)
}
specPath, capturesPath, configPath := filepath.Join(dir, "tools.json"), filepath.Join(dir, "captures.jsonl"), filepath.Join(dir, "mcp.json")
command := r.mcpCommand
if len(command) == 0 {
self, err := os.Executable()
if err != nil {
return fail(err)
}
command = []string{self}
}
server := map[string]any{
"env": harnessMCPEnvironment(req.Harness.Env),
"command": command[0],
"args": slices.Concat(command[1:], []string{"mcp", "-spec", specPath, "-captures", capturesPath}),
}
cfg, err := json.Marshal(map[string]any{"mcpServers": map[string]any{"archie": server}})
if err != nil {
return fail(err)
}
for path, content := range map[string][]byte{specPath: spec, configPath: cfg, capturesPath: nil} {
if err := os.WriteFile(path, content, 0o600); err != nil {
return fail(err)
}
}
if err := ownForHarness(req.Harness.User, dir, specPath, configPath, capturesPath); err != nil {
return fail(err)
}
registration, err := harnessMCPRegistration(req.Harness.Adapter, dir, configPath, server)
if err != nil {
return fail(err)
}
return registration, capturesPath, cleanup, nil
}
-41
View File
@@ -1,41 +0,0 @@
//go:build unix
package agentexec
import (
"os"
"os/exec"
"strings"
"testing"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
func TestHarnessLiveOutput(t *testing.T) {
if os.Getenv("ARCHIE_TEST_HARNESS_OUTPUT") == "1" {
adapter := &codexHarnessOutput{}
user := ""
if os.Geteuid() == 0 {
user = "65534"
}
err := invoke(t.Context(), "/tmp", &agentrun.HarnessSpec{User: user}, []string{"sh", "-c", `printf '%s\n' '{"type":"thread.started","thread_id":"live-thread"}'; printf '%s\n' 'live diagnostic' >&2`}, adapter, agentrun.Reporter{})
if err != nil {
t.Fatal(err)
}
if adapter.SessionID() != "live-thread" {
t.Fatal("forwarding lost the adapter input")
}
return
}
cmd := exec.CommandContext(t.Context(), os.Args[0], "-test.run=^TestHarnessLiveOutput$")
cmd.Env = append(os.Environ(), "ARCHIE_TEST_HARNESS_OUTPUT=1")
got, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("harness: %v: %s", err, got)
}
for _, want := range []string{"live-thread", "live diagnostic"} {
if !strings.Contains(string(got), want) {
t.Errorf("worker output %q is missing %q", got, want)
}
}
}
+21 -3
View File
@@ -7,6 +7,7 @@ import (
"path/filepath"
"slices"
"strings"
"unicode/utf8"
"github.com/google/jsonschema-go/jsonschema"
@@ -15,15 +16,18 @@ import (
// toolCallDetailBytes caps the summary ToolCallReport.Detail carries. This
// rides on every task's observability event stream, so one large file read
// must not dominate it the way baselineMissionBytes-sized content is allowed
// to dominate a builder's own context.
// must not dominate it.
const toolCallDetailBytes = 300
func ClipToolCallDetail(s string) string {
if len(s) <= toolCallDetailBytes {
return s
}
return s[:toolCallDetailBytes] + "…"
cut := toolCallDetailBytes
for cut > 0 && !utf8.RuneStart(s[cut]) {
cut--
}
return s[:cut] + "…"
}
func ProjectScopedRules(workspace, extra string) string {
@@ -173,3 +177,17 @@ func isNonEmptyString(object map[string]json.RawMessage, field string) bool {
raw, ok := object[field]
return ok && json.Unmarshal(raw, &text) == nil && strings.TrimSpace(text) != ""
}
// AcceptCapture decides whether one capture call is kept.
func AcceptCapture(spec agentrun.CaptureTool, accepted int, value json.RawMessage) (string, bool) {
if spec.MaxCalls > 0 && accepted >= spec.MaxCalls {
return fmt.Sprintf("%s rejected: maximum call count is %d", spec.Name, spec.MaxCalls), false
}
if !json.Valid(value) {
return spec.Name + " rejected: arguments are not valid JSON", false
}
if rejection, ok := ValidateCaptureArgs(spec, value); !ok {
return rejection, false
}
return spec.Name + " recorded", true
}
+45
View File
@@ -0,0 +1,45 @@
package modelloop
import (
"fmt"
"strings"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
"github.com/samcharles93/archie-core/internal/prompts"
)
// missionWithHistory puts the conversation of an earlier run of the stage
// ahead of the mission, cut to fit the model's context window. agentloop has no
// field for prior messages, so the conversation goes in the first user message
// as text.
func missionWithHistory(req agentrun.Request) string {
entries := agentrun.BoundHistory(req.History, agentrun.HistoryBytes(req.ContextWindow))
if len(entries) == 0 {
return req.Mission
}
var b strings.Builder
b.WriteString("<previous_run>\n" + prompts.ResumeRun() + "\n\n")
for _, e := range entries {
switch e.Kind {
case agentrun.TranscriptModel:
if e.Text != "" {
fmt.Fprintf(&b, "[you] %s\n", e.Text)
}
for _, call := range e.ToolCalls {
fmt.Fprintf(&b, "[you called %s] %s\n", call.Name, call.Args)
}
case agentrun.TranscriptTool:
if e.Error != "" {
fmt.Fprintf(&b, "[%s failed] %s\n", e.Tool, e.Error)
} else {
fmt.Fprintf(&b, "[%s returned] %s\n", e.Tool, e.Output)
}
case agentrun.TranscriptUser:
fmt.Fprintf(&b, "[feedback] %s\n", e.Text)
case agentrun.TranscriptCompaction:
fmt.Fprintf(&b, "[summary of earlier steps] %s\n", e.Text)
}
}
b.WriteString("</previous_run>\n\n")
return b.String() + req.Mission
}
+27 -6
View File
@@ -3,17 +3,21 @@ package modelloop
import (
"context"
"encoding/json"
"errors"
"fmt"
"log/slog"
"maps"
"net/http"
"slices"
"github.com/samcharles93/ai-sdk/agentloop"
"github.com/samcharles93/ai-sdk/core"
errx "github.com/samcharles93/ai-sdk/error"
"github.com/samcharles93/ai-sdk/runtime"
"github.com/samcharles93/archie-core/internal/agentexec"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
"github.com/samcharles93/archie-core/internal/taskstate"
"github.com/samcharles93/archie-core/internal/tools"
)
@@ -73,11 +77,12 @@ func (r *LoopRunner) Run(ctx context.Context, workspace string, req agentrun.Req
return agentrun.Result{}, fmt.Errorf("build central tool set: %w", err)
}
captureTools := captureToolSet(req.CaptureTools, captures)
var modelHooks []core.ModelHook
var toolHooks []core.ToolHook
log := r.logger(req)
progress := newProgressLog(log)
modelHooks, toolHooks := []core.ModelHook{progress}, []core.ToolHook{progress}
if report.Transcript != nil {
recorder := newTranscript(report.Transcript)
modelHooks, toolHooks = []core.ModelHook{recorder}, []core.ToolHook{recorder}
modelHooks, toolHooks = append(modelHooks, recorder), append(toolHooks, recorder)
}
res, err := r.run(ctx, agentloop.Config{
Runtime: r.runtime,
@@ -85,7 +90,7 @@ func (r *LoopRunner) Run(ctx context.Context, workspace string, req agentrun.Req
WorkDir: workspace,
MaxParallelToolCalls: MaxParallelToolCalls,
Mission: req.Mission,
Mission: missionWithHistory(req),
ExtraRules: agentexec.ProjectScopedRules(workspace, req.ExtraRules),
Notes: notes,
Gate: toAgentGate(req.Gate),
@@ -109,13 +114,29 @@ func (r *LoopRunner) Run(ctx context.Context, workspace string, req agentrun.Req
),
ModelHooks: modelHooks,
ToolHooks: toolHooks,
Logger: r.logger(req),
Logger: log,
})
result := resultFromRun(req, res, notes.appended, captures)
if cause := context.Cause(ctx); cause != nil {
return result, cause
}
return result, err
return result, providerBlocked(err)
}
// providerBlocked marks a provider refusal the operator must fix: a rejected
// credential, or an account without credit. Retrying either fails the same way.
func providerBlocked(err error) error {
failure, ok := errors.AsType[*errx.ProviderError](err)
if !ok {
return err
}
switch failure.StatusCode {
case http.StatusUnauthorized, http.StatusForbidden:
return &agentrun.BlockedError{Blocker: taskstate.BlockerModelCredential, Err: err}
case http.StatusPaymentRequired:
return &agentrun.BlockedError{Blocker: taskstate.BlockerModelCredit, Err: err}
}
return err
}
func resultFromRun(req agentrun.Request, res agentloop.Result, appended []string, captures map[string][]json.RawMessage) agentrun.Result {
+65
View File
@@ -0,0 +1,65 @@
package modelloop
import (
"context"
"log/slog"
"sync"
"time"
"github.com/samcharles93/ai-sdk/chat"
"github.com/samcharles93/ai-sdk/core"
)
// progressLog writes one task-log line per model call and tool call as it
// finishes. agentloop logs its per-step lines only after the run returns, so
// without this the operator sees nothing for the length of the stage.
type progressLog struct {
log *slog.Logger
mu sync.Mutex
started map[string]time.Time
}
func newProgressLog(log *slog.Logger) *progressLog {
return &progressLog{log: log, started: map[string]time.Time{}}
}
func (p *progressLog) ModelCallStarted(context.Context, chat.Request) {}
func (p *progressLog) ModelCallFinished(ctx context.Context, _ chat.Request, resp *chat.Response, err error, latency time.Duration, usage *chat.Usage) {
attrs := []any{"latency_ms", latency.Milliseconds()}
if usage != nil {
attrs = append(attrs, "prompt_tokens", usage.PromptTokens, "completion_tokens", usage.CompletionTokens)
}
if err != nil {
p.log.WarnContext(ctx, "agent model call failed", append(attrs, "err", err)...)
return
}
if resp != nil {
attrs = append(attrs, "tool_calls", len(resp.ToolCalls))
}
p.log.InfoContext(ctx, "agent model call", attrs...)
}
func (p *progressLog) BeforeToolExecute(_ context.Context, call *core.ToolCall) (*core.Skip, error) {
p.mu.Lock()
p.started[call.ToolCallID] = time.Now()
p.mu.Unlock()
return nil, nil
}
func (p *progressLog) AfterToolExecute(ctx context.Context, call core.ToolCall, result *core.ToolResult) {
p.mu.Lock()
started, ok := p.started[call.ToolCallID]
delete(p.started, call.ToolCallID)
p.mu.Unlock()
attrs := []any{"tool", call.ToolName}
if ok {
attrs = append(attrs, "latency_ms", time.Since(started).Milliseconds())
}
if result.Error != "" {
p.log.WarnContext(ctx, "agent tool call failed", append(attrs, "err", clip(result.Error, nil))...)
return
}
p.log.InfoContext(ctx, "agent tool call", attrs...)
}
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"github.com/samcharles93/ai-sdk/chat"
protocol "github.com/samcharles93/archie-core/internal/tools/mcp"
protocol "github.com/samcharles93/archie-core/internal/tools/provider/mcp"
)
// DefaultSamplingMaxTokens bounds a server-requested completion when the
+6 -12
View File
@@ -36,24 +36,22 @@ func (l ToolLimits) EnsureSpillDir() error {
return nil
}
// Options builds the tool-set options for a single turn or stage.
// There is no aggregate turn output budget; only per-result caps apply.
// Options builds the tool-set options for a single turn or stage. Only
// per-result caps apply; there is no aggregate turn output budget.
func (l ToolLimits) Options(excludeToolsets ...string) ToolSetOptions {
opts := ToolSetOptions{
return ToolSetOptions{
MaxResultChars: l.MaxResultChars,
ExcludeToolsets: excludeToolsets,
SpillDir: l.SpillDir,
}
return opts
}
// ToolSetOptions bounds what a built tool set may do and return.
//
// The zero value builds every available tool with no result limits, which is
// the behaviour this package had before the options existed.
// The zero value builds every available tool with no result limits.
type ToolSetOptions struct {
// SpillDir receives complete results displaced by the per-tool cap. Empty
// selects inline truncation. There is deliberately no aggregate turn cap.
// selects inline truncation.
SpillDir string
// MaxResultChars caps a single tool result. Entries setting
@@ -78,8 +76,7 @@ type ToolSetOptions struct {
}
// reportToolCallCompletion notifies opts.OnToolCall, if set, of one
// completed call. Factored out of toolExecute's closure so the branching
// here doesn't add to that function's own cognitive-complexity budget.
// completed call.
func reportToolCallCompletion(opts ToolSetOptions, entry tools.ToolEntry, result string, err error) {
if opts.OnToolCall == nil {
return
@@ -241,9 +238,6 @@ func toolExecute(entry tools.ToolEntry, opts ToolSetOptions) func(context.Contex
// requireApproval blocks until entry's approval is granted, returning an
// error if it is denied, times out, or the approver misbehaves.
func requireApproval(ctx context.Context, entry tools.ToolEntry, opts ToolSetOptions, args map[string]any) error {
if opts.Approval == nil {
return fmt.Errorf("tool %s requires approval but no approver is configured", entry.Name)
}
approveCtx, cancel := context.WithTimeout(ctx, tools.ToolApprovalTimeout)
defer cancel()
desc := entry.Description
@@ -11,7 +11,7 @@ import (
func TestTranscriptToolEntryRedactsAndClips(t *testing.T) {
const jwt = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcmNoaWUifQ.c2lnbmF0dXJlc2lnbmF0dXJl"
const pem = "-----BEGIN RSA PRIVATE KEY-----\nMIIEow\n-----END RSA PRIVATE KEY-----"
const pem = "-----BEGIN RSA PRIVATE KEY-----\nMIIEow\n-----END RSA PRIVATE KEY-----" //nolint:gosec // G101: a fake key the redaction must catch.
long := strings.Repeat("x", transcriptFieldLimit+10)
tests := []struct {
name string
+4 -3
View File
@@ -1,6 +1,7 @@
package agentexec
import (
"context"
"encoding/json"
"log/slog"
@@ -14,16 +15,16 @@ type EventPublisher interface {
// ForwardTaskEvents publishes every event from sub to SubjectForEvents(taskID)
// until sub closes. Failures are logged.
func ForwardTaskEvents(sub *events.Sub, pub EventPublisher, taskID int64, log *slog.Logger) {
func ForwardTaskEvents(ctx context.Context, sub *events.Sub, pub EventPublisher, taskID int64, log *slog.Logger) {
subject := SubjectForEvents(taskID)
for e := range sub.C {
data, err := json.Marshal(e)
if err != nil {
log.Warn("task event marshal failed", "task", taskID, "kind", e.Kind, "err", err)
log.WarnContext(ctx, "task event marshal failed", "task", taskID, "kind", e.Kind, "err", err)
continue
}
if err := pub.Publish(subject, data); err != nil {
log.Warn("task event publish failed", "task", taskID, "kind", e.Kind, "err", err)
log.WarnContext(ctx, "task event publish failed", "task", taskID, "kind", e.Kind, "err", err)
}
}
}
@@ -1,15 +0,0 @@
{"type": "system", "subtype": "hook_started", "hook_id": "3364ed13-2659-4abb-bda4-58243f1eb065", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "959d5b3d-d376-4416-9abb-71e0b8a36047", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_started", "hook_id": "4c58406e-b5f0-49d7-af88-483c14212e0d", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "1f5ed274-0baa-4558-b00f-36ef98d28ebc", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_started", "hook_id": "04acf4c4-0c8d-4dd5-9d3a-a7a6df371224", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "5aa154a9-9315-4a6c-8de0-750cb35139cf", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_started", "hook_id": "a0cb320b-0bdd-45b5-90b5-451add28d1ed", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "ef74547a-736e-4bb9-bd68-16cc1592b2a3", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_response", "hook_id": "3364ed13-2659-4abb-bda4-58243f1eb065", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "", "stdout": "", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "398b087e-942b-4d67-904c-1778d3b20063", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_response", "hook_id": "04acf4c4-0c8d-4dd5-9d3a-a7a6df371224", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "", "stdout": "", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "ecbfdcf2-446c-4386-a89f-eeaf43e48b46", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_response", "hook_id": "4c58406e-b5f0-49d7-af88-483c14212e0d", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "", "stdout": "", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "c10b3042-e990-49db-8937-954b6fe11570", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_response", "hook_id": "a0cb320b-0bdd-45b5-90b5-451add28d1ed", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "", "stdout": "", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "3a3327f8-ad24-46d7-a194-e0ce68f9f871", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "init", "cwd": "/workspace", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "tools": ["Task", "Bash", "Edit", "Read", "Write"], "mcp_servers": [], "model": "claude-opus-5-5", "permissionMode": "bypassPermissions", "slash_commands": [], "terminal_slash_commands": [], "apiKeySource": "none", "claude_code_version": "2.1.282", "output_style": "default", "agents": [], "skills": [], "plugins": [], "capabilities": ["interrupt_receipt_v1", "interrupt_cancel_queued_v1", "msg_lifecycle_v1", "mcp_read_resource_v1", "mcp_tool_ui_meta_v1"], "analytics_disabled": false, "product_feedback_disabled": false, "uuid": "0ad7c54e-a817-406b-af22-8f647b4e0021", "memory_paths": {}, "messaging_socket_path": "", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required", "per_turn_effort_active": true, "view_mode": "default"}
{"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfQYZ2iQ3sZ59vJ9CCae9", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01P8qrSZwqH1jjZXfrZETjKz", "name": "Bash", "input": {"command": "echo hello", "description": "Print hello"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 23584, "cache_read_input_tokens": 10119, "cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 23584}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "input_transformations": [], "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "b4c3b51e-0a58-4b28-8c5a-20a2ff2aaadb", "timestamp": "2026-09-25T17:22:54.134Z", "request_id": "req_011CfQYZ2Ddp5YubZj8vB9Fb", "wire_tool_inputs": {"toolu_01P8qrSZwqH1jjZXfrZETjKz": {"command": "echo hello", "description": "Print hello"}}}
{"type": "rate_limit_event", "rate_limit_info": {"status": "allowed_warning", "resetsAt": 1790377200, "rateLimitType": "seven_day", "utilization": 0.98, "isUsingOverage": false, "surpassedThreshold": 0.75, "unifiedWindows": {"five_hour": {"utilization": 0.76, "resetsAt": 1790366400}, "seven_day": {"utilization": 0.98, "resetsAt": 1790377200}}}, "uuid": "a91b2340-329e-4c73-8e1a-307860859743", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "user", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01P8qrSZwqH1jjZXfrZETjKz", "type": "tool_result", "content": "hello", "is_error": false}]}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "6beae671-52a0-499a-b72b-f9321c1d9e14", "timestamp": "2026-09-25T17:22:54.460Z", "tool_use_result": {"stdout": "hello", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": false}}
{"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfQYZHW9AJ164FSYj39uG", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01YNNETbc61jN44ATXrmHdEC", "name": "Bash", "input": {"command": "cat /nonexistent-file", "description": "Read a nonexistent file"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 580, "cache_read_input_tokens": 33703, "cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 580}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "input_transformations": [], "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "3b14941d-c8eb-45f4-b555-829e06119f19", "timestamp": "2026-09-25T17:22:56.420Z", "request_id": "req_011CfQYZH18nwJgBYNZs8XGq", "wire_tool_inputs": {"toolu_01YNNETbc61jN44ATXrmHdEC": {"command": "cat /nonexistent-file", "description": "Read a nonexistent file"}}}
{"type": "user", "message": {"role": "user", "content": [{"type": "tool_result", "content": "Exit code 1\ncat: /nonexistent-file: No such file or directory", "is_error": true, "tool_use_id": "toolu_01YNNETbc61jN44ATXrmHdEC"}]}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "395dc93d-0e4f-40b5-854b-77a128aa0990", "timestamp": "2026-09-25T17:22:56.442Z", "tool_use_result": "Error: Exit code 1\ncat: /nonexistent-file: No such file or directory"}
{"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfQYZRy8qPUaVcnVs9CQD", "type": "message", "role": "assistant", "content": [{"type": "text", "text": "done\n\nThe first command printed `hello`. The second failed with \"No such file or directory\".\n\nGoogle Drive, exa and intercom still need authorizing. Google Drive is set up in its claude.ai connector settings. For exa and intercom, run `/mcp` in an interactive session."}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 145, "cache_read_input_tokens": 34283, "cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 145}, "output_tokens": 89, "service_tier": "standard", "inference_geo": "not_available"}, "input_transformations": [], "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "8f97a329-c76c-4b90-b154-bda9468b969d", "timestamp": "2026-09-25T17:22:58.580Z", "request_id": "req_011CfQYZRSdq9mNMbE7n8okT"}
-17
View File
@@ -1,17 +0,0 @@
{"type": "system", "subtype": "hook_started", "hook_id": "3364ed13-2659-4abb-bda4-58243f1eb065", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "959d5b3d-d376-4416-9abb-71e0b8a36047", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_started", "hook_id": "4c58406e-b5f0-49d7-af88-483c14212e0d", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "1f5ed274-0baa-4558-b00f-36ef98d28ebc", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_started", "hook_id": "04acf4c4-0c8d-4dd5-9d3a-a7a6df371224", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "5aa154a9-9315-4a6c-8de0-750cb35139cf", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_started", "hook_id": "a0cb320b-0bdd-45b5-90b5-451add28d1ed", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "ef74547a-736e-4bb9-bd68-16cc1592b2a3", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_response", "hook_id": "3364ed13-2659-4abb-bda4-58243f1eb065", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "", "stdout": "", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "398b087e-942b-4d67-904c-1778d3b20063", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_response", "hook_id": "04acf4c4-0c8d-4dd5-9d3a-a7a6df371224", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "", "stdout": "", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "ecbfdcf2-446c-4386-a89f-eeaf43e48b46", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_response", "hook_id": "4c58406e-b5f0-49d7-af88-483c14212e0d", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "", "stdout": "", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "c10b3042-e990-49db-8937-954b6fe11570", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "hook_response", "hook_id": "a0cb320b-0bdd-45b5-90b5-451add28d1ed", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "", "stdout": "", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "3a3327f8-ad24-46d7-a194-e0ce68f9f871", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "system", "subtype": "init", "cwd": "/workspace", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "tools": ["Task", "Bash", "Edit", "Read", "Write"], "mcp_servers": [], "model": "claude-opus-5-5", "permissionMode": "bypassPermissions", "slash_commands": [], "terminal_slash_commands": [], "apiKeySource": "none", "claude_code_version": "2.1.282", "output_style": "default", "agents": [], "skills": [], "plugins": [], "capabilities": ["interrupt_receipt_v1", "interrupt_cancel_queued_v1", "msg_lifecycle_v1", "mcp_read_resource_v1", "mcp_tool_ui_meta_v1"], "analytics_disabled": false, "product_feedback_disabled": false, "uuid": "0ad7c54e-a817-406b-af22-8f647b4e0021", "memory_paths": {}, "messaging_socket_path": "", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required", "per_turn_effort_active": true, "view_mode": "default"}
{"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfQYZ2iQ3sZ59vJ9CCae9", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01P8qrSZwqH1jjZXfrZETjKz", "name": "Bash", "input": {"command": "echo hello", "description": "Print hello"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 23584, "cache_read_input_tokens": 10119, "cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 23584}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "input_transformations": [], "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "b4c3b51e-0a58-4b28-8c5a-20a2ff2aaadb", "timestamp": "2026-09-25T17:22:54.134Z", "request_id": "req_011CfQYZ2Ddp5YubZj8vB9Fb", "wire_tool_inputs": {"toolu_01P8qrSZwqH1jjZXfrZETjKz": {"command": "echo hello", "description": "Print hello"}}}
{"type":"assistant","message":{"content":[{"type":"tool_use"
{"type": "rate_limit_event", "rate_limit_info": {"status": "allowed_warning", "resetsAt": 1790377200, "rateLimitType": "seven_day", "utilization": 0.98, "isUsingOverage": false, "surpassedThreshold": 0.75, "unifiedWindows": {"five_hour": {"utilization": 0.76, "resetsAt": 1790366400}, "seven_day": {"utilization": 0.98, "resetsAt": 1790377200}}}, "uuid": "a91b2340-329e-4c73-8e1a-307860859743", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92"}
{"type": "user", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01P8qrSZwqH1jjZXfrZETjKz", "type": "tool_result", "content": "hello", "is_error": false}]}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "6beae671-52a0-499a-b72b-f9321c1d9e14", "timestamp": "2026-09-25T17:22:54.460Z", "tool_use_result": {"stdout": "hello", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": false}}
{"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfQYZHW9AJ164FSYj39uG", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01YNNETbc61jN44ATXrmHdEC", "name": "Bash", "input": {"command": "cat /nonexistent-file", "description": "Read a nonexistent file"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 580, "cache_read_input_tokens": 33703, "cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 580}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "input_transformations": [], "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "3b14941d-c8eb-45f4-b555-829e06119f19", "timestamp": "2026-09-25T17:22:56.420Z", "request_id": "req_011CfQYZH18nwJgBYNZs8XGq", "wire_tool_inputs": {"toolu_01YNNETbc61jN44ATXrmHdEC": {"command": "cat /nonexistent-file", "description": "Read a nonexistent file"}}}
{"type": "user", "message": {"role": "user", "content": [{"type": "tool_result", "content": "Exit code 1\ncat: /nonexistent-file: No such file or directory", "is_error": true, "tool_use_id": "toolu_01YNNETbc61jN44ATXrmHdEC"}]}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "395dc93d-0e4f-40b5-854b-77a128aa0990", "timestamp": "2026-09-25T17:22:56.442Z", "tool_use_result": "Error: Exit code 1\ncat: /nonexistent-file: No such file or directory"}
{"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfQYZRy8qPUaVcnVs9CQD", "type": "message", "role": "assistant", "content": [{"type": "text", "text": "done\n\nThe first command printed `hello`. The second failed with \"No such file or directory\".\n\nGoogle Drive, exa and intercom still need authorizing. Google Drive is set up in its claude.ai connector settings. For exa and intercom, run `/mcp` in an interactive session."}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 145, "cache_read_input_tokens": 34283, "cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 145}, "output_tokens": 89, "service_tier": "standard", "inference_geo": "not_available"}, "input_transformations": [], "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "uuid": "8f97a329-c76c-4b90-b154-bda9468b969d", "timestamp": "2026-09-25T17:22:58.580Z", "request_id": "req_011CfQYZRSdq9mNMbE7n8okT"}
{"duration_api_ms": 7263, "stop_reason": "end_turn", "session_id": "9c22c15c-80ef-42c6-a503-8d087ec47d92", "total_cost_usd": 0.21507700000000002, "usage": {"input_tokens": 6, "cache_creation_input_tokens": 24309, "cache_read_input_tokens": 78105, "output_tokens": 248, "output_tokens_details": {"thinking_tokens": 0}, "server_tool_use": {"web_search_requests": 0, "web_fetch_requests": 0}, "service_tier": "standard", "cache_creation": {"ephemeral_1h_input_tokens": 24309, "ephemeral_5m_input_tokens": 0}, "inference_geo": "not_available", "iterations": [{"input_tokens": 2, "output_tokens": 89, "cache_read_input_tokens": 34283, "cache_creation_input_tokens": 145, "cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 145}, "type": "message"}], "speed": "standard"}, "modelUsage": {"claude-opus-5-5": {"inputTokens": 6, "outputTokens": 248, "cacheReadInputTokens": 78105, "cacheCreationInputTokens": 24309, "webSearchRequests": 0, "costUSD": 0.21507700000000002, "contextWindow": 1000000, "maxOutputTokens": 128000, "thinkingTokens": 0, "canonicalModel": "claude-opus-5-5", "provider": "firstParty", "costBasis": "list"}}, "permission_denials": [], "terminal_reason": "completed", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required", "subagent_stats": {"spawned": 0, "requested": {"background": 0, "foreground": 0, "unset": 0}, "started_in_background": 0, "max_depth": 0, "spawned_by_subagents": 0, "completed": 0, "failed": 0, "killed": {"parent": 0, "user": 0, "system": 0}, "refused": {"depth_limit": 0, "concurrency_limit": 0, "budget": 0}, "by_type": {}}, "is_error": false, "num_turns": 3, "subtype": "success", "api_error_status": null, "result": "done\n\nThe first command printed `hello`. The second failed with \"No such file or directory\".\n\nGoogle Drive, exa and intercom still need authorizing. Google Drive is set up in its claude.ai connector settings. For exa and intercom, run `/mcp` in an interactive session.", "ttft_ms": 3229, "type": "result", "duration_ms": 7717, "uuid": "d0b46ba2-f8ff-49eb-b35e-b4eb6b9b272b", "ttft_stream_ms": 2833, "time_to_request_ms": 102, "first_content_frame_ms": 2834, "queued_turn_count": 0, "result_index": 0}
Loaded 100 of 1282 files, more files were not shown because too many files have changed in this diff. Show more