Compare commits

...
756 Commits
Author SHA1 Message Date
sam 6abfe32540 chore(release): v1.58.0
Quality / check (push) Successful in 3m39s
deploy / gate (push) Successful in 4m19s
deploy / archied-image (push) Successful in 2m49s
deploy / agent-image (push) Successful in 3m9s
deploy / dist-zip (push) Successful in 4m52s
2026-11-01 23:55:55 +11:00
sam 1f9807a99c fix(ui/chat): give the collapsed composer its own card and reserve its height (#1719)
Quality / check (push) Successful in 3m39s
deploy / gate (push) Successful in 4m33s
deploy / archied-image (push) Successful in 3m16s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-11-01 23:11:01 +11:00
sam b2edf1fa8b build(ui): reinstall Trace and Collapsible with the shadcn-vue CLI
Quality / check (push) Successful in 3m34s
deploy / gate (push) Successful in 4m32s
deploy / archied-image (push) Successful in 3m26s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-11-01 23:05:18 +11:00
sam bb897e76b8 Merge pull request 'feat(agentexec): record each agent run's transcript and show it per step (#1718)' (#1724) from claude/intelligent-tereshkova-5422da into main
deploy / gate (push) Successful in 4m37s
Quality / check (push) Successful in 3m41s
deploy / archied-image (push) Successful in 3m13s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
Reviewed-on: #1724
2026-11-01 11:43:32 +00:00
sam 07062352b4 Merge branch 'main' into claude/intelligent-tereshkova-5422da
Quality / check (pull_request) Successful in 3m35s
2026-11-01 11:43:20 +00:00
sam 856c15858b feat(ui): replace the top bar navigation with the sidebar-07 block (#1723)
Quality / check (push) Successful in 3m24s
deploy / gate (push) Successful in 4m32s
deploy / archied-image (push) Successful in 3m18s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-11-01 22:09:54 +11:00
sam 69a46249cc feat(webui): draw each transcript entry with its Trace pattern (#1718)
Quality / check (pull_request) Successful in 3m38s
Record the model's reasoning parts. The step run view shows reasoning as a
Thought row, shell calls as a terminal, the gate as a test run, web_fetch as a
source, finish as the verdict, and each fan-out branch as a subagent.
2026-11-01 22:09:53 +11:00
sam 6f10ecc04f feat(agentexec): record each agent run's transcript and show it per step (#1718)
The loop runner hooks every model call and tool call and reports ordered,
redacted, clipped entries. Each is persisted as an agent_transcript task
event through InsertEvent, left out of the timeline read, and served per
attempt at /api/tasks/{id}/transcript. The step run view shows it with Trace.
2026-11-01 22:09:53 +11:00
sam d6ca6a72a5 build(ui): build the dashboard in CI and the Taskfile instead of committing ui/dist
deploy / gate (push) Successful in 4m28s
Quality / check (push) Canceled after 1m27s
deploy / archied-image (push) Successful in 3m29s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-11-01 22:07:36 +11:00
sam 243832fee6 docs(ui): add components with the shadcn-vue CLI, not by hand
Quality / check (push) Successful in 3m7s
deploy / gate (push) Successful in 3m51s
deploy / archied-image (push) Successful in 2m47s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-11-01 21:47:54 +11:00
sam e8c2c844a8 ci: skip setup-go caching on the self-hosted runner (#1716)
Quality / check (push) Successful in 3m1s
deploy / gate (push) Successful in 4m6s
deploy / archied-image (push) Successful in 2m54s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-11-01 21:21:09 +11:00
sam 6220387ed6 fix(install): restart running services on reinstall (#1716)
Quality / check (push) Successful in 3m32s
deploy / gate (push) Successful in 7m18s
deploy / archied-image (push) Successful in 3m4s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-11-01 17:59:05 +11:00
sam efd3eb2854 fix(releaseupdate): wait for the canary to offer a release before installing (#1716)
Quality / check (push) Successful in 3m14s
deploy / gate (push) Successful in 6m48s
deploy / archied-image (push) Successful in 3m3s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-11-01 02:55:31 +11:00
sam c78063eba0 chore(release): v1.57.0
Quality / check (push) Successful in 3m20s
deploy / gate (push) Successful in 6m29s
deploy / archied-image (push) Successful in 2m51s
deploy / agent-image (push) Successful in 3m25s
deploy / dist-zip (push) Failing after 1m56s
2026-11-01 02:26:01 +11:00
sam 0e931485a0 docs(releaseupdate): use contractions in the release and canary text (#1716)
Quality / check (push) Successful in 7m33s
deploy / gate (push) Successful in 6m27s
deploy / archied-image (push) Successful in 2m57s
deploy / agent-image (push) Successful in 12s
deploy / dist-zip (push) Skipped
2026-10-31 22:18:57 +11:00
sam 1bf536d4ab docs(releaseupdate): rewrite the canary comments in plain English (#1716)
deploy / gate (push) Successful in 6m20s
Quality / check (push) Canceled after 8m7s
deploy / archied-image (push) Successful in 2m57s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-10-31 22:11:04 +11:00
sam 2181b5fd08 ci(deploy): move the images' :latest only when a release is promoted (#1716)
Quality / check (push) Successful in 3m47s
deploy / gate (push) Successful in 6m29s
deploy / archied-image (push) Successful in 2m59s
deploy / agent-image (push) Successful in 10s
deploy / dist-zip (push) Skipped
2026-10-31 21:48:10 +11:00
sam a4a7c96da6 feat(releaseupdate): publish to next and promote to stable only after a canary evaluation (#1716)
Quality / check (push) Successful in 3m49s
deploy / gate (push) Failing after 16m14s
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped
2026-10-31 21:39:32 +11:00
sam a7f6e517ad ci(release): cut releases from [Unreleased] by workflow dispatch (#1716)
deploy / gate (push) Successful in 7m17s
Quality / check (push) Canceled after 9m13s
deploy / archied-image (push) Successful in 2m56s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-10-31 21:30:33 +11:00
sam 812d9004a7 feat(webui): keep the Model setup step open until the provider credential resolves (#1045)
Quality / check (push) Successful in 4m40s
deploy / gate (push) Successful in 6m15s
deploy / archied-image (push) Successful in 2m57s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-10-31 20:04:06 +11:00
sam ebc6dd67e6 fix(setup): offer the bundled database as an explicit choice on a re-run (#1388)
With an existing database_url, setup prefilled the URL, so a blank answer
kept it and the bundled socket database was unreachable without typing its
URL. The re-run database step now presents a choice menu: keep the existing
URL (still the default), switch to the bundled database (socket URL plus a
generated PGPASSWORD written to the env file), or enter a different URL.
Fresh installs and -database-url are unchanged; a blank answer anywhere
still keeps the existing URL. Pinned at the setup API level with fake
prompter/sink: TestRunParamsDatabaseChoice.
2026-10-31 20:03:33 +11:00
sam 949457689c chore(release): v1.56.0
Quality / check (push) Successful in 3m46s
deploy / gate (push) Successful in 6m7s
deploy / archied-image (push) Successful in 2m46s
deploy / agent-image (push) Successful in 3m16s
deploy / dist-zip (push) Successful in 3m16s
2026-10-31 19:26:43 +11:00
sam 0cb035555f ci(deploy): link the published packages to the repository
Quality / check (push) Successful in 4m25s
deploy / gate (push) Successful in 6m4s
deploy / archied-image (push) Successful in 2m55s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-10-31 19:19:49 +11:00
sam a5974d0ea0 ci(deploy): one v* release stream; drop the legacy per-component tags
Quality / check (push) Successful in 3m44s
deploy / gate (push) Successful in 5m58s
deploy / archied-image (push) Successful in 2m58s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
2026-10-31 19:14:48 +11:00
sam 1ea15462c0 feat(messaging): run Telegram as an archipelago channel extension (#1399)
Quality / check (push) Successful in 4m56s
deploy / gate (push) Successful in 6m11s
deploy / archied-image (push) Successful in 2m56s
deploy / agent-image (push) Successful in 10s
deploy / dist-zip (push) Skipped
The bundled internal/channels/telegram package (17 files) is deleted; the
channel now ships as archipelago/channels/telegram, launched by archiemessaging
through the existing channel-extension machinery. An existing [chat.telegram]
config enables it with the same keys: the token stays a secret reference
(token_ref) the host resolves, allowed_user_ids and show_tool_calls map onto
extension settings. Per-org bots compose the same extension per org from the
org's credential binding. Reload support is now derived from a channels.Reloader
interface instead of a *telegram.Gateway assertion. The five host-only seams
(/update, release announcements, running versions, in-place show_tool_calls,
reload) are dropped from the channel and need a contract home or deletion.
2026-10-31 18:19:21 +11:00
sam 9d8f364af1 feat(releaseupdate): signed OCI distribution sources for releases and the catalogue (#1715)
Quality / check (push) Successful in 5m53s
deploy / gate (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
2026-10-31 18:18:43 +11:00
sam c87b0c31e1 chore(tools): sign cloud environment commits with an SSH key
Quality / check (push) Successful in 5m1s
deploy / gate (push) Successful in 6m30s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
2026-10-31 14:57:01 +11:00
sam c5802cf86d fix(releaseupdate): load the env file beside the config so update install gets the database password from a shell (#1431) 2026-10-31 14:40:41 +11:00
sam 4f2338810b chore(tools): install go 1.27.3 in the cloud setup script
go.mod moved to 1.27.3 for the crypto/x509 advisory govulncheck reports; the
setup script still installed 1.27.2.
2026-10-31 14:39:58 +11:00
sam f8da67348c feat(webui): org-scoped schedules for non-system orgs (#1639 #1051 #49) 2026-10-31 14:25:24 +11:00
sam 003771ca48 feat(access): denial retention knob, State Store sweep and dashboard denials page (#1842)
Add [access].denial_retention (default 90 days, matching the audit-retention
seed) wired through config defaults and validation; the State Store sweeps
denial records older than the configured age hourly via the new
access.DenialPruner / PruneDenials store query. The dashboard gains
GET /api/access/denials (read_audit-gated, so org admins/owners see their
org's records; the store scopes by the credential's org) and an
/org/denials page backed by a Pinia store.
2026-10-31 14:23:31 +11:00
sam f7926cde15 fix(deps): go 1.27.3 and x/net 0.62.0 to clear govulncheck
The deploy gate's govulncheck step failed on the first run that reached it, for
two real findings: crypto/x509 in the standard library, fixed in go1.27.3, and
golang.org/x/net v0.61.0, reached from webfetch.htmlToText calling html.Parse,
fixed in v0.62.0. govulncheck now reports none.
2026-10-31 01:05:27 +11:00
sam 3a05b3ecd0 fix(ui): show stream state at phone width and serve sections from the sheet below lg (#1261 #1386) 2026-10-31 00:47:38 +11:00
sam 6031a7a14b ci(deploy): run the gate from the Taskfile, not an inlined copy (#1580)
deploy.yml inlined its own sequence, which drifted weaker than `task check`:
no db:check, news:check or ui:check, so a release could ship stale sqlc
output, a stale ui/dist, or release notes that disagree with CHANGELOG.md,
and the dashboard suite ran outside the gate without its type check.

The release now runs `task check TEST_FLAGS=-count=1`: same definition, the
full uncached suite including the Docker-backed tests -short skips. quality.yml
already invoked the Taskfile, so both pipelines now share one gate.
2026-10-31 00:37:26 +11:00
sam ad9ec16844 test(egress): delete the test-only ResolverFunc adapter and its tests (#1671) 2026-10-31 00:36:37 +11:00
sam 3977eaad68 fix(workflow): make the repository optional for the triage workflow (#1578) 2026-10-31 00:36:10 +11:00
sam 3b6de96782 docs(deploy): name the registry each agent-image path publishes to
The pinning section said CI republished ghcr.io on every push to main. CI
publishes git.catlow.cloud, and only for a release tag; ghcr is where the
hand-run tools/publish.sh writes, which is the reference the default names.

A release zip pins a digest on a registry an anonymous pull cannot reach, and
[containers].registry_auth -- the setting that fixes it -- was documented
nowhere. Documented there, beside the pin.

Also corrected: every shipped profile does not pin the image, and the section
link omitted its number so it matched no heading.
2026-10-31 00:35:49 +11:00
sam decc86fd08 ci(quality): stop caching the pnpm store
setup-node's cache save fails on this runner -- the pnpm store path it computes
does not exist at post-step time, which marks the job failed after the gate has
already passed. Run 19 proved it: 0 lint issues, ui/dist matched, no task failure,
then 'Path Validation Error' and exit 1.
2026-10-30 01:44:56 +11:00
sam 5485dc4690 chore(workflow): finish dropping the unread step-type catalogue accessors (#1014)
Manager.StepTypes and Providers had no reader; the catalogue they were meant
to feed is not missing -- Registry/Settings serve it as x-step-types in the
workflow-definitions schema, read by the dashboard workflow editor and the
gateway's workflow_step_types tool. Remove the write-only providers field
the accessor deletion left behind, and pin that production reader in
controlplanerpc so a dropped schema extension fails the gate.
2026-10-30 01:31:36 +11:00
sam 57865b51f4 fix(forge): return SetStateLabel failures to the caller
A failed state-label change was dropped at three points: the forge.Forge
interface returned nothing, forgeext logged the extension's gRPC error
instead of returning it, and the forgerpc client and server discarded the
response error. SetStateLabel now returns an error on the interface and on
NoopForge, forgeext propagates the extension's error, and the forgerpc
server carries it in the response envelope while the client returns it,
matching the other forgerpc handlers.

The proto is unchanged: a gRPC error rides the status and
SetStateLabelResponse is already an empty message.

TestSetStateLabelFailureReachesTheCaller pins the full chain: an extension
whose SetStateLabel RPC fails, through forgeext and the forgerpc
client/server, to the caller receiving the error.

Refs #280
2026-10-30 00:58:07 +11:00
sam 0a1aa8b3c2 fix(prreview): classify comment lines against the diff before posting 2026-10-30 00:35:36 +11:00
sam 7c8114bc55 fix(curator): grant the definition engine its model runner
Registry.filter stripped the LLM capability whenever a manifest declared
no tools, skills, memory or conversation capabilities, but
DefinitionEngine.Pass always calls the model. An instruction-only custom
curator therefore registered healthy and then failed every pass with
'no model runner is bound'. The definition engine is inherently agentic,
so the filter now keeps the model runner for it while every other
capability service stays bound only when declared.

Adds tests reproducing the instruction-only pass through the
registry/engine path and pinning that the registrar view for an
instruction-only manifest exposes the model but no tools, skills,
memory or conversations.

Closes #1132
2026-10-30 00:22:50 +11:00
sam aa57377c7f fix(staterpc): make model usage writes durable through a State Store outage
A failed RecordUsage was logged and dropped, losing chat, title, sampling
and curator usage that cannot be rebuilt from events. The staterpc Client
now keeps a bounded local outbox: a failed write is queued and retried with
backoff (1s doubling to 1m, 10s per attempt) until the store accepts it, so
records land once the store recovers. The queue is capped at 1024 records;
an overflow is refused so the caller logs the drop. The sampling usage
write is bounded to 5s so a dead store cannot hold a model call.
2026-10-30 00:06:38 +11:00
sam 8aa65bc7b4 fix(workflow): close a budget-stopped stage with its findings as the outcome 2026-10-30 00:06:38 +11:00
sam a781fde566 fix(catalogue): sign an issue time and refuse a replayed older catalogue 2026-10-30 00:06:38 +11:00
sam 3b372b4a91 ci(deploy): stop installing ripgrep and setting sysctl from the gate
The deploy gate runs on a self-hosted runner under an unprivileged user, so the
sudo apt-get install and sudo sysctl steps fail. Both are host provisioning:
ripgrep is installed on the runner host and the userns restriction belongs in
sysctl.d. The namespace check stays, without sudo.
2026-10-29 23:57:23 +11:00
sam 066522cf5d ci(quality): run the gate on the archie-quality runner
The check job asked for the self-hosted label. The repository's only runner,
archie-quality, is online but carries just its own custom label, so run 17 has
been queued since it was pushed. Name the runner instead of a label nothing
offers.
2026-10-29 23:30:43 +11:00
sam ec9bf5feb2 docs: track work in Gitea issues instead of beads
Every one of the 1709 tracker issues was created in Gitea and checked field by
field against its source record: title, body, state, label set, assignee,
comments, dependency edges and epic label. All 1729 beads are closed, citing the
issue that carries each one, and .beads is removed.

Three differences are deliberate: Gitea truncates titles at 253 characters, so
three long titles keep their full text in the issue body; Gitea refuses a mutual
dependency, so five symmetric relates-to links exist in one direction; issue 497
carries its fix from e3b1103f.
2026-10-29 23:22:35 +11:00
sam dfb37fb4f2 Merge origin/main: README update 2026-10-29 23:00:09 +11:00
sam 86c2909a57 Update README.md 2026-10-29 22:54:26 +11:00
sam b5482857f8 fix(forge): accept invitations only to configured repositories
The GitHub forge extension accepted every pending repository
invitation, so any GitHub user could add archie's account to a
repository by sending an invitation. AcceptInvitations now carries the
connection's configured repositories and the extension leaves an
invitation to anything else pending.
2026-10-28 23:57:44 +11:00
sam 0c137d9319 refactor(fsutil): consolidate nine copies of the atomic write helper
Nine packages each had their own write-temp-then-rename helper with
slightly different behaviour (some synced, some did not; some created
the parent directory, some did not; modes and temp-file patterns
varied). They are replaced by one fsutil.WriteFileAtomic that always
syncs before rename, creates the parent directory, and takes the file
mode as a parameter.
2026-10-28 00:48:59 +11:00
sam 59827b19bd fix(controlplane): reject userinfo and query in notify_webhook
A webhook URL with embedded credentials or a query string can leak
secrets through logs, proxies and referrer headers. The task policy
validator now refuses both.
2026-10-28 00:36:33 +11:00
sam 34179f0f9f ci(deploy): publish images and releases to Gitea
The deploy workflow now targets git.catlow.cloud: images push to the
Gitea registry and the distribution zip publishes as a release on
sam/archie through the Gitea API, both authenticated with one
DEPLOY_TOKEN PAT (write:packages + write:repository scopes).
2026-10-27 23:20:54 +11:00
sam 9c193aeebb fix(staterpc): log internal identity errors through the service logger with request context 2026-10-27 20:54:41 +11:00
sam 1cd8955d23 docs(agents): errors surface through OpenTelemetry, not global slog 2026-10-27 20:51:52 +11:00
sam 004e38b8eb fix(staterpc): record internal identity errors on the request span instead of slog 2026-10-27 20:51:46 +11:00
sam c5991a560e fix(staterpc): give token revoke its own audit request ID and log internal identity errors 2026-10-27 20:50:18 +11:00
sam 04ce0f9056 feat(identity): name, lifetime and last-used on personal API tokens 2026-10-27 15:37:44 +11:00
sam e5cb0ac00b fix(ui): copy and dismiss a new API token 2026-10-27 15:31:13 +11:00
sam abe4c488cf fix(archied): recover an orphaned update journal while running, not only at boot 2026-10-27 15:24:04 +11:00
sam 973541f344 fix(gatewayrpc): refuse an inbound attachment whose bytes contradict its declared type 2026-10-27 15:23:48 +11:00
sam 3c4b7b5877 fix(workflow): keep a stopped stage's notes in the parked detail 2026-10-27 15:22:42 +11:00
sam 8fbfb3c99f fix(ui): show the last update's outcome on Settings > Status and present install as staged 2026-10-27 15:18:52 +11:00
sam 3b33d164c7 test(e2e): per-run report.html, fix stale workflow-logic and audit-runtime, add org selector, org pages, setup, recovery, readiness and schedule-trigger checks 2026-10-27 11:44:23 +11:00
sam 292597660f fix(webui): skip the open-card reframe while the workflow canvas is hidden 2026-10-27 11:44:23 +11:00
sam ba3a26af3c fix(postgres): carry org, park class and park blocker on task list rows so a parked task's recovery link shows 2026-10-27 11:44:23 +11:00
sam 4bb473c0b0 fix(webui): resolve a selected org's workspaces as the caller, wire selection into gateway and harness, and let a member start tasks in the org they selected 2026-10-27 11:06:18 +11:00
sam c3d49cbc6c feat(webui): park model credential failures with a recovery link, add Model setup step, readiness badges, and move audit to the organisation 2026-10-27 11:06:18 +11:00
sam e831edb005 feat(webui): act in a selected organisation the caller is a member of, enforced at the dashboard and the State Store 2026-10-27 11:06:18 +11:00
sam 3db2654188 feat(webui): derive the setup checklist from the caller's organisation and drop the optional chat channel step 2026-10-27 10:47:14 +11:00
sam afdb4b203f feat(daemon): park repository, credential and forge-extension failures with a recovery link on the task list 2026-10-27 10:47:14 +11:00
sam 6f57d38669 feat(webui): offer each organisation page only to callers its API write allows, and move appearance to the account menu 2026-10-27 10:47:14 +11:00
sam d60995af43 fix(orgs): layer only the fields an org document sets, retry alerts on a failed lookup, and key chat sessions by org 2026-10-27 10:38:00 +11:00
sam 472d9d8b10 feat(messaging): run a channel per organisation and deliver only through the owner's 2026-10-27 10:38:00 +11:00
sam 11b89354a6 feat(alerts): send each organisation's alerts to its own webhook 2026-10-27 10:38:00 +11:00
sam 8150df8d81 feat(scheduling): resolve the issue discovery rule per organisation 2026-10-27 10:38:00 +11:00
sam b8e080301c fix(postgres): let every org read a built-in mapping so a non-system org can arm a schedule trigger 2026-10-27 10:13:03 +11:00
sam 2d87e9f587 fix(applystatus): report only the instance's own copy so another org's read cannot overwrite it 2026-10-27 10:08:24 +11:00
sam 749baa3e5d fix(scheduling): fire a schedule's capture into its owning organisation 2026-10-27 10:03:29 +11:00
sam 90deba8472 fix(gateway): chat /cancel declines through the task-action service so the run stops 2026-10-27 10:00:54 +11:00
sam 9498fad064 fix(webui): report a workflow's running count and last status from its own runs 2026-10-27 02:52:38 +11:00
sam 6ca5c7f851 fix(release): ship archie-agent beside archied so Kit runs have one to mount 2026-10-27 02:49:31 +11:00
sam dfce3360b2 test(orgs): hold the agent-assignment contract the Agents tab reads 2026-10-27 02:45:35 +11:00
sam 58629ea03a fix(webui): keep the instance settings out of another org's reach 2026-10-27 02:44:33 +11:00
sam 5b3b88ed3d fix(taskfile): install dashboard deps before the parallel gate scans the tree 2026-10-27 02:41:38 +11:00
sam 62dbac9247 fix(archied): refuse an unknown subcommand instead of starting a second daemon 2026-10-27 02:40:41 +11:00
sam a8aad28239 fix(ui): give the topbar its own surface and a filled active tab 2026-10-27 02:13:27 +11:00
sam 9d633855f4 fix(ui): use the Archie mark in chat empty state and sign-in gate 2026-10-27 02:01:32 +11:00
sam 56ac50931e fix(ui): drop cycling names from the logo 2026-10-27 01:57:00 +11:00
sam 3e437d4275 chore: remove dashboard-v2, archived out of tree 2026-10-27 01:54:05 +11:00
sam c9951c085c feat(dashboard-v2): tasks page from table-filter template 2026-10-27 01:47:42 +11:00
sam 59c6f0e4c0 fix(dashboard-v2): fail loudly when 5174 is taken 2026-10-27 01:37:38 +11:00
sam 9460f51e07 Merge remote-tracking branch 'origin/main' 2026-10-27 01:29:45 +11:00
sam 3ac5b97706 fix(ui): larger all-sage mark in the topbar (#1859) 2026-10-27 01:12:19 +11:00
sam 1add0fca32 feat(dashboard-v2): Archie motion mark on login, mark favicon 2026-10-27 01:10:24 +11:00
sam 0d8c48cbf4 Merge remote-tracking branch 'origin/main' 2026-10-27 01:06:12 +11:00
sam e41b7606d6 feat(ui): new Archie mark, shared sage accent, theme follows the OS (#1858) 2026-10-27 01:04:15 +11:00
sam ad2ceaaec2 fix(dashboard-v2): remove duplicated api opener 2026-10-27 00:19:58 +11:00
sam c3b636bf72 feat(dashboard-v2): show instance, offer SSO when advertised 2026-10-27 00:19:20 +11:00
sam 98acd6aad0 chore(dashboard-v2): lock TanStack Query 5.104.5 2026-10-27 00:16:40 +11:00
sam 8f7743c73d fix(dashboard-v2): gate session on status user, add favicon 2026-10-27 00:15:49 +11:00
sam 60a19ab15e feat(dashboard-v2): TanStack Query plus session state 2026-10-26 23:53:48 +11:00
sam dc1e45ff82 feat(dashboard-v2): sign in on 401 via login template page 2026-10-26 23:52:12 +11:00
sam 5fefd1902f fix(dashboard-v2): require StyleX ^0.19 per core peer range 2026-10-26 23:44:18 +11:00
sam 45ed5b2faf feat(dashboard-v2): verify build, commit lockfile and generated theme 2026-10-26 23:44:01 +11:00
sam f0fac7899f chore(dashboard-v2): drop stub lockfile from offline install 2026-10-26 23:41:00 +11:00
sam c7e12b56d0 feat(dashboard-v2): scaffold Astryx app with system status slice 2026-10-26 23:40:47 +11:00
sam 087aa45349 test(e2e): split overloaded checks, standardize screenshots 2026-10-26 22:57:15 +11:00
sam 4cc22ac5e0 refactor(ui): audit leftovers use Alert, Item, CodeView and Tooltip
Inline error paragraphs become destructive Alerts, divided record lists
become Item rows, the redirect URI box uses CodeView, and icon-button
title hints use Tooltip. Native titles remain on truncated values and on
disabled controls.
2026-10-26 22:35:47 +11:00
sam 7f0ecaa192 build: move the dashboard and e2e packages from npm to pnpm 2026-10-26 22:15:26 +11:00
sam a203cbc03b refactor(ui): Empty, Spinner and Label replace hand-built equivalents 2026-10-26 22:11:39 +11:00
sam 17c07a31fe build(ui): update dependencies within range 2026-10-26 22:00:33 +11:00
sam 87100c4aba build(ui): add vue-sonner and the Sonner component 2026-10-26 21:58:02 +11:00
sam 5498c97e3d fix(ui): e2e checks match the current dashboard; trim stray label whitespace, keep Home/End in suggest input 2026-10-26 20:59:48 +11:00
sam 3ff6867e84 refactor(ui): raw buttons, details and hr use Button, Collapsible and Separator 2026-10-26 20:00:57 +11:00
sam 7c050eef14 refactor(ui): block error messages use Alert 2026-10-26 19:59:00 +11:00
sam d98abad8bb feat(archied): raise an alert when container max uptime is under the task limit 2026-10-26 19:48:09 +11:00
sam 9e92beb4cc fix(ui): agent profile tools commit on change so commas can be typed 2026-10-26 19:46:56 +11:00
sam ca597c3678 feat(ui): suggest input on Combobox replaces datalists, RadioGroup for task pickers
Also records the combobox and radio-group components added in 63476393.
2026-10-26 19:45:18 +11:00
sam 63476393d7 feat(ui): settings pages edit through TanStack Form with shadcn-vue Field
Each control-plane kind has one store-owned TanStack form, so edits survive
navigation and the save bar submits every dirty section. Shared editors emit
new values, map entries are written whole, unset resources stay null, and the
container runtime page warns when max uptime is under the task limit.
2026-10-26 19:17:03 +11:00
sam 9d930436c5 refactor(ui): delete unused SegmentBar 2026-10-26 18:52:55 +11:00
sam be0f6f5ab7 fix(gateway): name a plan wait's workflow from its run, not the next one
workflow.approve pre-writes the task's workflow column with the workflow
that runs once approved, so task_list named a workflow that had not
started while the task's own log named the one that produced the plan.
Chat now names the compiled workflow through the pinned definition for a
plan wait, matching the log.
2026-10-26 18:32:25 +11:00
sam 66daa071a5 fix(configuration): raise the default max uptime above the task limit 2026-10-26 18:32:25 +11:00
sam ca44b9e6bb fix(archied): bound task titles in chat notifications 2026-10-26 18:32:25 +11:00
sam da7efa3f4e fix(ui): keep the chat dock open across navigation
Clicking any navigation control counted as an outside click, so the dock
collapsed on every route change and the conversation disappeared. Hide and
Escape remain the only ways to collapse it.

The e2e accessibility check referenced the removed outside-click launcher and
the old Close chat label; both now use the dock's real controls.
2026-10-26 18:28:32 +11:00
sam 4de8882ef5 fix(gateway): require a remote check before claiming branch or PR state
The chat agent read only its local checkout, so an unfetched workspace made it report that no task branch or PR existed and that shipped UI code did not exist. Add a core rule: refresh from the remote or check the forge before describing branches, commits, pull requests or the default branch, and say the answer is local-only when it cannot.
2026-10-26 18:28:32 +11:00
sam c00a90c9ca fix(workflow): report a parked run's outcome as the task's status
A run that parked left tc.Outcome empty, so the taskrun response carried an
empty status and the daemon logged 'taskrun run recorded no outcome' for a run
that had recorded one, then retried the park it could not apply.

Record the outcome once the parked transition lands, so a budget stop and every
other park surface with the reason the run parked.
2026-10-26 18:28:32 +11:00
sam c4c50ea70d fix(gateway): cap task_spawn titles and carry instructions into the body 2026-10-26 18:24:47 +11:00
sam c578c8e954 fix(taskactions): let the operator chat act on every task, like the dashboard
A chat profile bound to the operator identity passed a strict scope to the
action gate, so it refused root-owned tasks whose identity is the daemon's
empty sentinel (task 22: belongs to "", not "d898c8c8-..."). The dashboard
acts with a nil scope and the chat read paths already treat the operator as
acting across identities, so the write gate was the only surface that disagreed.

Exempt the operator identity from the scope comparison and share that rule with
the chat adapters that had their own copy.
2026-10-26 18:24:47 +11:00
sam e85719f2d2 fix(controlplanerpc): attribute chat workflow drafts so saves succeed 2026-10-26 18:24:46 +11:00
sam 4dca007003 fix(container): report a crashed container's panic line and log its stderr 2026-10-26 18:24:46 +11:00
sam d7d1bd4556 fix(workflow): record the own-PR flag after the review stages that allocate it
StagePRReviewAndOpenPR set tc.prReview.ownPR before the decision stages ran,
but intake allocates tc.prReview, so every implement run dereferenced a nil
state at repo.open-pr and the agent container panicked with exit code 2
before opening the pull request.
2026-10-26 18:07:01 +11:00
sam dc26daeebe fix(daemon): issue poll and PR passes report failed items to the scheduler 2026-10-26 17:24:55 +11:00
sam f727d54d75 feat(ui): schedules table, runs page and Schedule trigger
Schedules list as a table with enable, run now, edit, duplicate, delete and
view runs; built-ins only enable, retime and run. The runs page links each
run's tasks through its capture's dispatches. The Start node gains a Schedule
trigger that picks or creates a schedule and binds the schedule source to the
workflow. Times show in a per-browser display zone set under Appearance; the
cron time zone and run retention are edited on the Schedules page.
2026-10-26 00:57:52 +11:00
sam 6f8371a7bf feat(workflow): message.send step delivers text through archied's messaging client 2026-10-26 00:56:07 +11:00
sam fff689312d feat(archied): run daemon maintenance as built-in schedules 2026-10-26 00:51:53 +11:00
sam b701f60a99 feat(scheduling): schedules and runs in the State Store with grid timing and run history
Schedules leave the schedules control-plane resource for State Store tables
behind a ScheduleService contract. A run is claimed per schedule slot, missed
slots fire once, the next run stays on the schedule's grid, cron is read in the
schedule-settings time zone, and failed runs are recorded and advance. Three
failures in a row raise a schedule.failing alert. A fired run records a
schedule-fired capture. Run history is pruned by age and count.

Removes the chat and spawn-task runners, the dangerous-payload guard and the
old schedules settings page.
2026-10-26 00:49:24 +11:00
sam 6ba6a595b8 feat(eda): capture schedule firings on a reserved source for bindings 2026-10-26 00:38:55 +11:00
sam 6cd9c4a7d8 feat(daemon): built-in maintenance jobs and idle mirror pruning
Cycle's maintenance passes become a BuiltinJobs list for the scheduler to
seed as locked schedules. Mirrors use a file lock shared by every Manager
and held across refresh and clone, so pruning cannot race a clone.
2026-10-26 00:37:25 +11:00
sam 816ce2e1f8 fix(extension): log go-plugin output through the service slog logger 2026-10-26 00:25:37 +11:00
sam 19570ad4bb fix(logging): route ui, messaging and playbook logs through the service log 2026-10-26 00:18:39 +11:00
sam 5212a4d913 build(deps): bump ai-sdk to v0.6.0, nats.go, oras-go, go-jose and indirect deps 2026-10-26 00:18:39 +11:00
sam 46f0643cf5 fix(webui): name API spans after their route 2026-10-25 23:42:44 +11:00
sam 656feab2a4 refactor(logging): log with the caller's context so records carry trace ids 2026-10-25 23:30:01 +11:00
sam 0611e00330 feat(llm): trace model and tool calls via ai-sdk v0.5.0 2026-10-25 23:19:40 +11:00
sam 128d5e0a82 feat(agent): export container spans over NATS through archied 2026-10-25 23:17:34 +11:00
sam c6187b7c23 feat(servicekit): OpenTelemetry tracer provider and RPC propagation 2026-10-25 23:11:03 +11:00
sam afd6669877 fix(memory): rotate a full section's oldest records to history 2026-10-25 23:10:15 +11:00
sam 7bf007bb58 test(e2e): wait for audit dialogs to close 2026-10-25 23:05:27 +11:00
sam 92a74e4b7d test(e2e): wait for audit dialogs to close 2026-10-25 23:04:56 +11:00
sam 0880e6a01c feat(natsrpc): propagate trace context across NATS and into task runs 2026-10-25 23:03:55 +11:00
sam 4a889991bd test(e2e): audit page browser check 2026-10-25 23:00:44 +11:00
sam 89bb4eb46b fix(audit): filter count aliases outside the projection and clean identity detail 2026-10-25 23:00:44 +11:00
sam f3c7555195 test(e2e): browser check for the audit page 2026-10-25 22:56:18 +11:00
sam 79f3895923 feat(logging): stamp trace and span ids on log records 2026-10-25 22:55:57 +11:00
sam 837cd91501 refactor(controlplane): move the store-backed server out of internal/app 2026-10-25 22:49:27 +11:00
sam 5112ce896b fix(channelext): bound the extension broker server with service limits 2026-10-25 22:46:47 +11:00
sam 7715d6b23b fix(audit): close the feed union and repair denied and retention controls 2026-10-25 22:42:00 +11:00
sam 373032e330 fix(audit): gate resource history, harden export, scope legacy keys and catalog 2026-10-25 22:39:34 +11:00
sam 6a69fb760a fix(audit): harden export, scope history and derive feed targets 2026-10-25 22:39:22 +11:00
sam 4cc7573b27 fix(ui): gate audit retention, resolve export time on click, merge live updates 2026-10-25 22:33:31 +11:00
sam 1d7fd6aab3 fix(ui): gate audit retention, resolve export at click, merge live updates 2026-10-25 22:32:59 +11:00
sam c04a18d387 feat(ui): audit page with server filters, live tail, export and revert 2026-10-25 22:14:53 +11:00
sam abf485b9ef fix(ui): address audit page review findings 2026-10-25 22:14:33 +11:00
sam 0245c4e455 fix(webui): link audit task targets to the task detail 2026-10-25 22:09:31 +11:00
sam fa00f74af5 fix(ui): enforce the retention minimum beside the hours field 2026-10-25 22:09:25 +11:00
sam 2f9ed7adca fix(webui): link audit task targets to task detail 2026-10-25 22:09:25 +11:00
sam 4f2e1c3687 fix(ui): send explicit export range and whole-hour retention 2026-10-25 22:09:25 +11:00
sam 2d2ca156d8 feat(ui): unified audit page with server filters and live tail 2026-10-25 22:09:25 +11:00
sam f8c3dbedf2 fix(webui): allow an all-time audit export 2026-10-25 22:05:40 +11:00
sam 17354de8fe fix(webui): treat the epoch export start as any time 2026-10-25 22:05:34 +11:00
sam 7066a6fd46 feat(webui): audit feed API, export and read_audit grant 2026-10-25 22:02:03 +11:00
sam 20595a70b4 feat(webui): audit feed API, export and read_audit grant 2026-10-25 22:01:02 +11:00
sam 568f7adf52 fix(storage): mount a task's object mirror read-only into its container 2026-10-25 21:58:25 +11:00
sam 74e34fb07a perf(worktree): clone tasks from a shared per-repository mirror 2026-10-25 21:55:20 +11:00
sam e6d765d233 feat(state): audit retention resource and observability sweep 2026-10-25 21:53:29 +11:00
sam 4250a31ff9 fix(state): retain product-read events and normalise audit retention 2026-10-25 21:53:19 +11:00
sam ad19271c6c fix(archied): drop a cached extension binary when its start fails 2026-10-25 21:47:31 +11:00
sam b774b68ed4 perf(archied): reuse running forge extension instances and materialized binaries 2026-10-25 21:46:51 +11:00
sam 8eaf7b00c3 fix(daemon): drain tasks in their own loop, not on the poll tick 2026-10-25 21:45:57 +11:00
sam 59eecd956d feat(state): apply audit retention to observability events 2026-10-25 21:42:38 +11:00
sam e2f9388071 feat(state): unified org-scoped audit feed and AuditService 2026-10-25 21:37:56 +11:00
sam 6c095e5ac6 fix(state): resolve identity audit org in one statement 2026-10-25 21:37:50 +11:00
sam 274acfe6f5 fix(state): attribute identity events to the subject's single org 2026-10-25 21:35:19 +11:00
sam f1eda629a8 feat(state): audit access reset, org, membership and EDA writes 2026-10-25 21:33:28 +11:00
sam 5602534ba9 fix(state): serialise source writes and keep binding workspaces audited 2026-10-25 21:33:08 +11:00
sam bc9b9952cd fix(state): classify audit coverage rows and keep unknown identity orgs private 2026-10-25 21:25:55 +11:00
sam 7f5a73d97d fix(state): close residual audit coverage gaps 2026-10-25 21:24:50 +11:00
sam 02a4ac0629 fix(state): harden the audit feed against audit findings 2026-10-25 21:23:52 +11:00
sam ab78f5c909 feat(state): org-scoped audit feed contract and read model 2026-10-25 21:23:52 +11:00
sam c9c552a1bd feat(state): audit access resets, org and EDA writes 2026-10-25 21:10:38 +11:00
sam c24b055cf3 feat(state): audit package and harness secret writes 2026-10-25 21:10:08 +11:00
sam 72052fe186 fix(postgres): skip unchanged authority in package audit 2026-10-25 21:10:02 +11:00
sam 0f14378363 fix(postgres): correct package and secret audit coverage 2026-10-25 21:03:00 +11:00
sam 551220eccc feat(postgres): audit package and harness secret writes 2026-10-25 21:00:27 +11:00
sam 287f8d71dd refactor(staterpc): one file per State Store service 2026-10-25 21:00:19 +11:00
sam 390e89aefb fix(state): correct audit backfill scoping and policy write races 2026-10-25 20:59:04 +11:00
sam 18e21661b2 feat(state): shared audit write helper for domain tables 2026-10-25 20:49:47 +11:00
sam 8af19c79f4 feat(state): org-scoped audit trail and complete policy write audit 2026-10-25 20:49:20 +11:00
sam b7cda2b2fe build: keep the agent image context to what compiles it
A trailing-slash pattern in .dockerignore matches only the context root, so
node_modules/ never excluded ui/node_modules -- 200MB shipped to the builder
for a Go compile. The issue tracker's Dolt directory was never listed at all.
Every line here either bloats the context or invalidates the COPY layer for
nothing: 467MB transferred per build, 320kB now.
2026-10-25 20:47:24 +11:00
sam c86b8659e5 build: stamp the agent image with the checkout's version
The container build was the one build path that could not learn a version: the
build context excludes .git, so it has to be passed in, and nothing passed one
-- Compose handed the Dockerfile no build args, so every locally built agent
answered "dev" while the daemon reported the tag. The Taskfile now derives the
version from git describe once, for both the host binaries and the image, and
task image:agent passes it through.

docker compose build agent also failed outright: the service named the image by
digest, and Compose refuses to tag a digest. The build-only service names it by
tag now; what a task container runs is still pinned in the daemon's own
[containers] image.
2026-10-25 20:24:27 +11:00
sam de3b41b70d fix(messaging): read a voice clip's container instead of believing its type
The dashboard upload names its own attachment type, so the check that ran on
it only compared two declarations the sender wrote. A browser can label any
bytes audio/ogg, and the transcriber keys on the attachment type alone, so the
bytes went to the operator's provider regardless.

When the bytes are present the container decides: Ogg, WebM/Matroska, mp4/m4a,
wav, flac and mp3 are the containers a clip is recorded in, and anything else
claimed to be speech is refused before it reaches a transcriber. Magic numbers
rather than http.DetectContentType, which reports application/octet-stream for
the WebM every browser but Safari records.
2026-10-25 20:17:30 +11:00
sam 5aa0aead4d chore(proto): drop the one-off service-deletion exception 2026-10-25 19:54:47 +11:00
sam 0dae907dad refactor(state)!: split StateStoreService into per-domain services
One gRPC service per domain in state.v1 (tasks, executions, accounts, identities, packages, captures, bindings, access, orgs, alerts and so on), each with its own server type in staterpc. RPC and message names and numbers are unchanged.
2026-10-25 19:54:27 +11:00
sam 59e3de62db feat(ui): marketplace grouped by surface, searchable, with install state
The marketplace was one long list of filled Install buttons with the raw
surface name beside each version. Packages now group under Forges, Channels,
Secret engines and the rest, as cards in a two-column grid with a search
box. Installed packages stay listed, marked installed or offering their
update.
2026-10-25 19:45:28 +11:00
sam 6c2ab54f65 fix(ui): offer an extension update only when the catalogue has one
An installed extension showed its own version and an Update button whether
or not the catalogue pinned anything newer, so a published update was
invisible. The row now offers 'Update to <version>' when the catalogue's
digest differs from the installed one and no update is already pending.
2026-10-25 18:55:20 +11:00
sam be47311883 docs: map the services and development commands in CLAUDE.md 2026-10-25 18:15:14 +11:00
sam 1e9659c7a2 fix(messaging): say what the inbound media check actually checks
The check compares two declarations; it never reads the bytes, so it cannot
tell whether a file is what its content type says. The comment and the test
row claiming otherwise have gone, and so has an allowance letting a video
carry an image type, which no producer emits.

A caller that named the attachment type itself -- a browser upload -- must now
also state a content type, since the previous empty-type escape made the check
optional there. The Telegram declared-size rule is deleted: the shared check
runs first with the same ceiling, so only the rule on the bytes actually
received can still fire.
2026-10-25 18:13:30 +11:00
sam ca73d02804 chore: bump beads version to 1.3.2 2026-10-25 18:11:33 +11:00
sam 5f827b6e19 fix(messaging): refuse an inbound attachment whose type contradicts its content
A declared MIME type decides what the Gateway does with a file: a voice note is
transcribed, an image goes to a model. Both acceptance points took that claim
from the caller unchecked -- the dashboard's voice upload and every Telegram
attachment -- so a file could be used as something it is not.

ValidateInbound refuses a type outside the shared vocabulary, content over the
size ceiling, and a MIME type that contradicts the attachment type, with an
error the caller sees: a dashboard upload is a 400, a Telegram file gets a
chat reply instead of a silent drop.
2026-10-25 18:05:34 +11:00
sam 7d9c40d79d fix(workflow): review a task's own pull request as a comment
GitHub refuses REQUEST_CHANGES from a pull request's author, so a blocking
finding on the PR a task opened lost every finding. The retry's identical
refusal is now reported once, and forge errors drop the gRPC framing.
2026-10-25 17:57:20 +11:00
sam 33da08bce5 feat(ui): task log opens newest first 2026-10-25 17:41:21 +11:00
sam f2b8681611 refactor(workflow): stop assuming a human decides
An approval, ask or park can be resolved by an operator, a rule, a
classifier or automatically, so the vocabulary stops naming a person:

- step type human.approve -> workflow.approve
- park class needs_human -> needs_decision (ParkNeedsDecision)
- event kinds human_* -> operator_*
- alert kind task.needs_human -> task.needs_decision
- status grouping "needs you" -> "needs attention"

0061 rewrites the stored values, including the approval step type in the
workflow-definitions resource and each task's pinned definition, with the
digest recomputed so resumed tasks still match.
2026-10-25 17:31:16 +11:00
sam fc609171ca docs: clarify reviewer in implement finish summary 2026-10-25 17:20:13 +11:00
sam 2399da1f8d docs(workflow): name no human approver in the plan document 2026-10-25 17:19:06 +11:00
sam d699b9afba feat(workflow): approve a PRD as one structured document
The prd step returns the PRD as structured fields and human.approve takes
them as its document. The plan text every surface reads and the approval
card's layout are both rendered from that one document, so what the human
approves is what the implement workflow is handed. Replaces the separately
generated OpenUI view, which could drift from the plan.
2026-10-25 16:53:17 +11:00
sam 7a03e003a1 docs(ui): drop the local deploy sequence from the shared rules 2026-10-25 16:53:17 +11:00
sam 340223de2e feat(modelloop): run a step's tool calls in parallel as each tool's classification allows 2026-10-25 16:45:34 +11:00
sam 54697c6e17 feat(curator): add and remove curators live; definition updates touch only changed curators 2026-10-25 16:45:34 +11:00
sam 18eed1fb96 fix(webui): refuse change captures whose file entries have the wrong key set 2026-10-25 16:45:34 +11:00
sam 55c201e7c1 fix(builtin): send_file resolves symlinks before the confinement check 2026-10-25 16:45:34 +11:00
sam 54a78175b4 feat(workflow): render a PRD's generated view on the plan approval card
agent.run gains views: the agent may return an OpenUI Lang view of its
answer through an optional view tool, read as steps.<id>.view. human.approve
stores it as the task's plan_view, and the approval card renders it with
the dashboard's own components, falling back to the plan text when there
is no view or it does not parse. The feasibility prd step uses it.
2026-10-25 16:33:04 +11:00
sam cae19ca42e fix(ui): name and link the identity a parked reason names 2026-10-25 16:24:03 +11:00
sam d4558c15d3 test(daemon): a task start parks transient when the policy chain is unavailable 2026-10-25 16:23:16 +11:00
sam 75c1dbf83c fix(access): check the policy version before each decision
archied, archie-ui and the tool gateway re-read the stored policies on a 30s
ticker, so a forbid written seconds earlier did not stop a run. One
instance-wide revision now moves inside the transaction of every policy write,
and a decision reads it first and rebuilds the engine only when it moved.

A version read that fails, or a policy list that fails after a bump, refuses
with ErrChainUnavailable instead of standing on the last chain, so three call
sites now treat unavailable as availability rather than denial: dispatch leaves
the capture for the next cycle, a task start parks transient, and the tool
gateway reports the tool as unavailable.
2026-10-25 16:21:01 +11:00
sam 536155752c test(egress): a recording session performs no central tool call 2026-10-25 16:02:46 +11:00
sam 958561d255 feat(egress): record a test run's deliveries instead of sending them
A test run used to suppress only forge and push writes, which named one
destination among many. Deliveries now have one seam: TaskContext.Deliveries
records each as "would ..." and performs none, and a recording egress
session does the same for a Kit run's HTTP writes and central tool calls,
answering them synthetically. Provider hosts stay live, since model traffic
is how a test run reads. Native containers have no proxy (archie-core-n8d3).
2026-10-25 16:01:06 +11:00
sam 7cd62232ef feat(webui): add WebMCP task actions 2026-10-25 15:47:59 +11:00
sam 32b73c3a28 fix(store): post open chat task states once after the posted-status migration 2026-10-25 02:46:43 +11:00
sam b0137d6181 fix(daemon): archied --once drains until callees of a waiting call finish 2026-10-25 02:46:16 +11:00
sam a776de8b8f fix(archied): post each reportable status a chat task reaches, recorded by status not by flag 2026-10-25 02:42:31 +11:00
sam b577b02eb6 feat(archied): tell the chat when its task opens a pull request 2026-10-25 02:39:34 +11:00
sam b006b1c943 fix(ui): long log messages wrap inside the table 2026-10-25 02:23:29 +11:00
sam 4241dbf817 fix(ui): log table shows component on the Logs page and a bordered sticky header 2026-10-25 02:21:57 +11:00
sam 0ccd1793e3 fix(ui): the log table header sticks to the log frame 2026-10-25 02:20:29 +11:00
sam 29aad11bed fix(ui): sticky log table header and bounded stage and service columns 2026-10-25 02:19:05 +11:00
sam 6e33004ef2 feat(ui): the Logs page uses the task log's table 2026-10-25 02:17:35 +11:00
sam afca2c164f fix(ui): singular field count in the task log 2026-10-25 01:24:21 +11:00
sam c7e2160582 fix(ui): metadata labels size to their content and wrap in table details 2026-10-25 01:22:59 +11:00
sam 849e24757d feat(ui): task logs as a table with expandable fields 2026-10-25 01:21:21 +11:00
sam e143362479 fix(ui): centre the plan in the approval card 2026-10-25 00:50:16 +11:00
sam 4146600579 fix(ui): put the approval card in the task page's main column 2026-10-25 00:46:18 +11:00
sam a04afe8d4e fix(ui): size the approval card to its text so the answers sit beside it 2026-10-25 00:38:02 +11:00
sam 550bb60691 fix(ui): hold the plan to a readable line length 2026-10-25 00:36:45 +11:00
sam df54db239d fix(ui): plain text for the plan's title on the approval card 2026-10-25 00:17:27 +11:00
sam de532ca299 fix(ui): approve a plan from a card that holds the plan and both answers 2026-10-25 00:16:10 +11:00
sam d7fc4e1fe9 feat(archied): post approval requests to the chat that started the task 2026-10-24 23:59:25 +11:00
sam e8a60c4abd refactor!: waiting_human becomes waiting_approval, with the approval kind on each task 2026-10-24 23:45:20 +11:00
sam 1f8a9964c1 fix(ui): show the plan and Approve/Reject on a task waiting for approval 2026-10-24 23:35:31 +11:00
sam aabe8f7a80 fix(archied): post dashboard chat task outcomes into the conversation through the gateway 2026-10-24 23:22:11 +11:00
sam fe9bdefc62 fix(workflow): keep the failing lines when clipping gate output 2026-10-24 23:18:23 +11:00
sam 205d0ec976 feat(archied): update agent-image sets the image new tasks run 2026-10-24 23:16:13 +11:00
sam e9ecc84064 docs(config): cut the setup template to the settings that start the services 2026-10-24 22:26:33 +11:00
sam 3b7193c207 refactor!: remove the diff-size cap and its gate.diff-size step 2026-10-24 22:19:23 +11:00
sam 84cb0eb3fd build(agent): golangci-lint 2.14.0, which reads Go 1.27.3 export data 2026-10-24 22:00:30 +11:00
sam d9fda2338f test(secretengine): skip the host launch test where the kernel refuses namespaces 2026-10-24 21:54:04 +11:00
sam 64acc0e97a fix(ui): mount a fresh canvas menu at each right-click 2026-10-24 21:50:23 +11:00
sam 8d2307d12d fix(ui): close the canvas menu for a tick before reopening it at the pointer 2026-10-24 21:48:29 +11:00
sam 8c128592bd fix(ui): show full repo names and reopen the canvas menu at a new right-click 2026-10-24 21:46:12 +11:00
sam 39430d78ae Revert "fix(messaging): mask secrets embedded in chat tool arguments"
This reverts commit 9c9aefd296.
2026-10-24 20:56:31 +11:00
sam 9c9aefd296 fix(messaging): mask secrets embedded in chat tool arguments 2026-10-24 20:53:27 +11:00
sam e63489829e fix(ui): show non-text tool arguments as key: value pairs 2026-10-24 20:51:59 +11:00
sam 87bc53c278 feat(chat): show each tool call where it happened in the reply 2026-10-24 20:48:43 +11:00
sam 5bdf68594d fix(messaging): show tool argument values in chat, redacting only sensitive keys 2026-10-24 20:46:29 +11:00
sam f6988916d8 feat(gateway): record how long each chat tool call took and show it per row 2026-10-24 20:44:40 +11:00
sam aaccbcf984 fix(ui): show a chat tool run as N tool calls with one status row per call 2026-10-24 20:31:51 +11:00
sam f9e3c4eaa4 fix(ui): summarise a chat tool run as one line instead of per-tool counts 2026-10-24 20:30:27 +11:00
sam 97195bf2ac chore(workflow): say in a review post failure whether it carried inline comments 2026-10-24 18:27:17 +11:00
sam c787db7e07 chore(workflow): log where a review's comments are placed before posting 2026-10-24 18:18:54 +11:00
sam 12b5022a4f fix(workflow): repost a review without inline comments when the forge refuses their placement 2026-10-24 18:07:14 +11:00
sam 8c98f20f0e build(deps): bump ai-sdk to v0.3.2 for DeepSeek forced tool choices 2026-10-24 17:48:24 +11:00
sam 9e334c3627 fix(ui): let command rows shrink to their column 2026-10-24 17:45:36 +11:00
sam 66f06a1878 fix(ui): stop wide setting controls from stretching the row past its card 2026-10-24 17:29:12 +11:00
sam 6d7f341de5 fix(workflow): post review findings outside the diff in the review body instead of inline 2026-10-24 17:27:35 +11:00
sam 7973feceb0 fix(tools): compare protos against an export of main so the gate runs as any user 2026-10-24 17:27:34 +11:00
sam 8ccac46fc9 fix(ui): size the command list to its setting row 2026-10-24 17:18:05 +11:00
sam b70e791fed fix(ui): keep command fields to the row width 2026-10-24 17:16:55 +11:00
sam 1a57aa7216 fix(ui): edit gate and tooling commands as shell-quoted lines instead of argument chips 2026-10-24 17:15:41 +11:00
sam 102355aba5 fix(daemon): park a pushing workflow before it runs when its identity may not push, with a link to the connection 2026-10-24 17:06:25 +11:00
sam 9a08048744 fix(archied): stop retrying task outcomes for a channel messaging does not have 2026-10-24 17:02:50 +11:00
sam 793569f6e1 refactor(ui): build the task list on DataTable with sortable columns and row links 2026-10-24 13:29:57 +11:00
sam ffafc3a989 fix(ui): add a warn alert variant and fit org and model forms on phones 2026-10-24 13:26:35 +11:00
sam 951acb8088 refactor(ui): build settings, org, task, workflow and dashboard pages from the shared components 2026-10-24 12:34:29 +11:00
sam afc0c0319b fix(ui): merge type-scale sizes with colours and put the column picker in the header 2026-10-24 12:21:48 +11:00
sam 522dfa5703 feat(ui): add the shared design-system components and type scale 2026-10-24 12:20:01 +11:00
sam 332e444397 fix(ui): lay out appearance preferences as setting rows 2026-10-24 12:15:52 +11:00
sam 959e1e0520 fix(ui): shorten the missing-snapshot notice 2026-10-24 11:47:16 +11:00
sam d8572e17e6 fix(ui): cut copy that restates what a value is 2026-10-24 11:46:38 +11:00
sam b2f720cc2b feat(ui): split agents from services, choose status columns, open reasons from the state badge 2026-10-24 11:45:57 +11:00
sam c7fc55a0ef fix(ui): group consecutive chat tool calls and simplify the chat controls 2026-10-24 11:45:57 +11:00
sam e84dd0f7e2 fix(ui): give service problems room and drop rows and bars with nothing to say 2026-10-24 11:41:48 +11:00
sam 1624353b2b fix(readiness): name only the filesystems over their limit 2026-10-24 11:41:48 +11:00
sam 5e7b51710c fix(ui): trim the task page and draw a run's pinned definition on the canvas 2026-10-24 11:39:55 +11:00
sam 97466ad27d refactor(daemon): name a taskrun failure's cause in one place 2026-10-24 11:32:16 +11:00
sam 90c5f5075a fix(daemon): leave a task running when only the daemon is stopping 2026-10-24 11:30:45 +11:00
sam 4e97975862 fix(archieui): reach the sandbox and setup terminal on the daemon's listener 2026-10-24 11:24:49 +11:00
sam 64e398112f fix(container): keep agent output out of the exit reason 2026-10-24 02:28:01 +11:00
sam 2a5b50346c fix(ui): keep page controls clear of the chat dock and hide synthetic issue numbers 2026-10-24 02:25:26 +11:00
sam 6ff09f92a5 fix(releaseupdate): a development build names no release to compare 2026-10-24 02:25:25 +11:00
sam 07c8bf310d fix(daemon): say how an agent container ended when it dies mid-task 2026-10-24 02:25:25 +11:00
sam dc6c4826bc fix(ui): fold the workflow title into the toolbar band on desktop 2026-10-24 02:17:53 +11:00
sam d915a24f4d fix(webui): compare a describe build's release, not its raw version, for drift 2026-10-24 02:17:53 +11:00
sam 267528efba fix(ui): use the shared settings card on account, authentication, instructions and channels pages 2026-10-24 00:03:21 +11:00
sam ad827e34bb test(kitrun): drop the WorkerEnv wiring test 2026-10-22 17:39:37 +11:00
sam 69b8c482c1 fix(config): read a model alias's provider the way the resolver does 2026-10-22 17:39:13 +11:00
sam aac77950f2 fix(configuration): keep named instances under the archie- namespace 2026-10-22 17:38:40 +11:00
sam 614ab1e6fa fix(workflow): require triage's workflow when a code change is needed 2026-10-22 17:37:33 +11:00
sam 2e6c493487 fix(config): give a non-system org only the aliases its policy resolves 2026-10-22 17:36:24 +11:00
sam 2ca7c9b2b9 fix(daemon): relay a loopback State Store with external NATS, and only for the task's container 2026-10-22 17:35:24 +11:00
sam b395eec893 fix(archiegateway): confine non-operator chat identities to their own tasks 2026-10-22 17:32:55 +11:00
sam 5675284b08 fix(controlplane): keep an org's own provider credential reference 2026-10-22 17:31:54 +11:00
sam cbe998b598 Merge pull request #1818 from samcharles93/fix/triage-non-code-path
fix(triage): let a task that needs no code change be classified
2026-10-22 13:52:18 +11:00
sam fc0dd41092 fix(triage): let a task that needs no code change be classified
The classify result required a workflow, and the capture tool rejects an empty
required string on the agent's single allowed call. A task needing no code
change has no workflow to name, so the classification failed instead of
closing the task -- the non-code path could never complete.

Require only what every classification has: whether a change is needed and the
reasons. Name the workflow required-when-true in its description, guard the
handoff on needs_code_change rather than relying on the finish step having
ended the run first, and comment the reasons before closing so the reporter
sees why nothing was built.
2026-10-22 13:50:47 +11:00
sam 2f8d375692 Merge pull request #1817 from samcharles93/fix/repo-tooling-stage
feat(workflow): install a repository's declared tooling before its gate
2026-10-21 23:11:52 +11:00
sam 8ed814cbf7 feat(workflow): install a repository's declared tooling before its gate 2026-10-21 23:11:16 +11:00
sam 852dd4f6c7 Merge pull request #1815 from samcharles93/fix/model-provider-credential-ref
fix(staterpc): carry each model provider's credential reference
2026-10-20 07:13:44 +11:00
sam 88514a444b fix(staterpc): carry each model provider's credential reference
The State Store wire described a provider's class, base URL and key variable
but never where its key lives, so every provider reached the daemon
credential-less. A task then built its runtime with no key: the egress session
had nothing to bind and the agent parked on 'APIKey is required'.

Carry api_key_engine and api_key_key alongside the provider. They are a
reference, not a secret; the key is still resolved daemon-side and never
travels to a container.
2026-10-20 07:10:58 +11:00
sam e33adbb12f Merge pull request #1814 from samcharles93/fix/egress-provider-secret-ref
fix(egress): bind a task's model providers from their api_key_ref
2026-10-20 06:57:31 +11:00
sam ae178f1be0 fix(egress): bind a task's model providers from their api_key_ref
A container task parked when a provider carried an api_key_env but no
credential binding named after it, even though the task's models never
reached that provider. Egress pre-bound every provider the instance
configures and ignored api_key_ref, so the credentials an operator stores in
provider-settings were never used.

A task's config now carries only the providers its model aliases resolve to,
each with the variable its credential is read from: the operator's
api_key_env, or a name derived from the provider when its credential is a
secret reference. modelEgress resolves that reference once for the session
and the proxy substitutes the session's key for the sentinel, so the
container still holds no key. A provider that only declares an env var keeps
resolving through its org credential binding.
2026-10-20 06:56:38 +11:00
sam d1b7a21b9b Merge pull request #1813 from samcharles93/fix/default-org-providers
fix(controlplane): resolve the default org's providers with its aliases
2026-10-20 03:44:53 +11:00
sam bf4fde5f7d fix(config): keep the resolved aliases when an org supplies none 2026-10-20 03:44:21 +11:00
sam 6194a51ed0 fix(controlplane): resolve the default org's providers with its aliases 2026-10-20 03:44:21 +11:00
sam 4847fb0b77 Merge pull request #1811 from samcharles93/fix/container-state-store-reachability
fix(daemon): give a task container a reachable State Store endpoint
2026-10-20 03:25:36 +11:00
sam fd241a59cc Merge pull request #1810 from samcharles93/fix/agent-empty-status-parks
fix(daemon): park a task whose agent reported no status
2026-10-20 03:24:38 +11:00
sam 0f0f048380 Merge pull request #1812 from samcharles93/fix/messaging-session-save
fix(gateway): save a messaging session instead of requiring web visibility
2026-10-20 03:24:00 +11:00
sam 974c93498a fix(gateway): save a messaging session instead of requiring web visibility 2026-10-20 03:12:40 +11:00
sam 92bc0f692f fix(daemon): give a task container a reachable State Store endpoint 2026-10-20 03:12:21 +11:00
sam 7b2af3348d fix(daemon): park a task whose agent reported no status
runViaAgent logged the agent's reply status and returned, so a task whose
agent could not persist its own outcome (empty status, State Store down)
stayed running with no park reason while the run read as complete.

A status the task cannot reach from running now parks it, quoting the
status and naming the condition.
2026-10-20 03:10:33 +11:00
sam 89cbbfc871 fix: chat streaming blocking the UI. extensions not showing accepted policies once accepted. (#1809)
* fix(ui): show an extension's accepted authority after it is accepted

* fix(ui): keep a chat reply's streamed text when the turn is stopped or fails

* feat(ui): queue chat messages sent while a turn runs
2026-10-19 18:53:13 +11:00
sam e955c45ba8 fix(egress): name the denied target when refusing a tunnel CONNECT (#1808) 2026-10-19 07:50:58 +00:00
sam 1ed8d4f543 fix(archiegateway): create the chat workspace before enabling its tools 2026-10-19 11:15:20 +11:00
sam 19e5dcd9d0 fix(gateway): chat acts as the control-plane operator and sees every task 2026-10-19 11:12:34 +11:00
sam caafdb266f feat(webui): scope cookies to the instance and show non-default instance names 2026-10-19 10:17:05 +11:00
sam 412d73e7e1 feat(install): install and update a named instance side by side 2026-10-19 10:16:49 +11:00
sam 76c0e4dd1b fix(container): scope agent containers, volumes and the egress relay to the instance 2026-10-19 10:15:47 +11:00
sam b8b223c87c feat(configuration): name the instance with ARCHIE_INSTANCE and scope default paths by it 2026-10-19 10:12:48 +11:00
sam 9d3ea208ef docs(news): regenerate release notes from the changelog 2026-10-19 10:05:23 +11:00
sam 5a55196572 docs: edit guides, PRDs and security notes, regenerate release news 2026-10-19 10:04:36 +11:00
sam 35e9d5d64e feat(ui): wrap the YAML editor at the pane or a set print width, with an appearance setting 2026-10-19 09:41:03 +11:00
sam b47f768076 feat(ui): scroll past the end of the YAML editor and history diff, with an appearance setting 2026-10-19 09:34:32 +11:00
sam 6630b0c9bf fix(ui): clear the chat on /new, show the copy action on hover, fold settings into the bar's menu 2026-10-19 09:01:44 +11:00
sam 1b2a8eec7c feat(chat): ask several questions in one interaction with ask_questions
A turn can pose a questionnaire (single and multiple choice, free text,
skippable) and read the answers back, rendered in the chat with the
shadcn-vue questionnaire. The gateway contract gains a questionnaire ask and a
can_question capability; answers travel as a JSON object keyed by question name
and are checked against the questions that were asked.
2026-10-19 03:30:47 +11:00
sam 31da6dc7c2 feat(ui): show a capture's changed files as a folder tree 2026-10-19 03:24:03 +11:00
sam d873cb5476 feat(ui): chat tool calls, approvals and suggestions on shadcn-vue's trace, item and button patterns 2026-10-19 03:19:07 +11:00
sam 5179bc81b7 fix(ui): anchor each question in the chat transcript and keep the live reply as the row its message takes 2026-10-19 03:13:12 +11:00
sam 26e3d2bff2 feat(ui): fade the chat's borders in when it opens and close it on an outside click 2026-10-19 03:09:57 +11:00
sam 61ee5fd3a7 feat(ui): dock the chat at the bottom of every page and keep a skeleton while a conversation loads 2026-10-19 03:01:12 +11:00
sam 0eecc95aac feat(ui): one chat panel on every page; the workflow editor syncs its draft around a turn
Replaces the separate Build with Archie bar and its per-workflow channel, so
every conversation belongs to the account and is listed on every device, and
the command palette is the same everywhere.
2026-10-19 02:56:23 +11:00
sam 3bb8f73c6a feat(ui): offer only conversation commands in the workflow editor's chat 2026-10-19 02:53:06 +11:00
sam 890361468d fix(ui): stop clipping the slash palette above the Build with Archie bar 2026-10-19 02:47:22 +11:00
sam 889856aa81 feat(ui): Build with Archie runs on the chat system, floats over the canvas and keeps its conversation
Each workflow has its own persisted conversation, rendered like the chat panel.
The canvas and YAML go read-only while Archie works instead of inert. The code
block highlighter loads Go and TOML and drops jsx, tsx and vue.
2026-10-19 02:43:54 +11:00
sam 63adbc71ef feat(ui): code blocks and chat messages from shadcn-vue's code-block, message and bubble 2026-10-19 02:22:42 +11:00
sam d876c150eb refactor(ui): one key/value list for a task's inputs, outputs and details, sized to its content 2026-10-19 02:10:46 +11:00
sam 3202386eaa feat(ui): list a task's inputs and outputs as separate sections of one card 2026-10-19 02:07:26 +11:00
sam eade816ee0 fix(webui): return an interrupted stage's cause and show it in a warning tone 2026-10-19 02:05:45 +11:00
sam f9861d3ea5 fix(ui): drop the duplicate start time from a task's stages 2026-10-19 01:59:47 +11:00
sam 580108dd7f fix(ui): frame the task page's attempts, stages, details and inputs, and fit the run tabs on a phone 2026-10-19 01:56:38 +11:00
sam 30105666e2 fix(ui): show a parked task's error once and wrap long log lines on a phone 2026-10-19 01:47:34 +11:00
sam 8d0d707d3e fix(postgres): repin parked and queued tasks that still name the root identity 2026-10-19 01:45:48 +11:00
sam c94a943854 fix(ui): improve keyboard access and add headed checks 2026-10-19 01:45:20 +11:00
sam 12685e264d fix(ui): show the agent's name, not its id, in a workflow's Runs as 2026-10-19 01:42:47 +11:00
sam 1e56219bbe fix(ui): label the default credential grants as Default, not Root identity 2026-10-19 01:39:27 +11:00
sam ab43c4e337 fix(archied): stop flagging embedding and transcription aliases as retired models 2026-10-19 01:07:39 +11:00
sam 02d4e162b8 fix(ui): fit phone workflows and allow dynamic handoffs 2026-10-19 01:04:32 +11:00
sam cc4f20ce30 fix(ui): align alert times in a right column and lift the body contrast 2026-10-19 01:02:38 +11:00
sam 10e1207242 fix(ui): date an alert from when it was first raised, not last re-checked 2026-10-19 01:01:19 +11:00
sam 24c3f7e857 feat(ui): show when each alert last fired 2026-10-19 00:43:23 +11:00
sam a76c54d1ac feat(e2e): list checks by default and run all explicitly 2026-10-19 00:38:17 +11:00
sam 9fea68815e fix(ui): one chat toolbar row, compact session actions menu, smaller bubble text 2026-10-19 00:32:56 +11:00
sam 9ff62f2cc4 fix(ui): section icons in the phone menu 2026-10-18 23:53:44 +11:00
sam 3f0fd7409d build(ui): regenerate dashboard 2026-10-18 23:50:32 +11:00
sam bb8f716abd fix(ui): put the workflow overflow menu at the end of the editor toolbar 2026-10-18 23:50:17 +11:00
sam 4201512912 fix(ui): end the switch otherwise edge at a marker in its own column 2026-10-18 23:50:09 +11:00
sam 409b5e6e54 fix(ui): draw no run state on the canvas for a run without a pinned definition 2026-10-18 23:50:03 +11:00
sam 490532643e fix(ui): hide the Runs tab for a never-published workflow 2026-10-18 23:49:55 +11:00
sam b6f4481038 fix(ui): drop the stray dot beside the end insert point 2026-10-18 23:49:50 +11:00
sam 227a991388 fix(ui): move workflow enable toggle into the editor toolbar, tie it to the published version 2026-10-18 23:49:41 +11:00
sam 18bb7b7dcb fix(ui): let the phone canvas fill the height reserved for the chat launcher 2026-10-18 23:49:35 +11:00
sam d40ba948e9 fix(ui): give the mobile workflow picker the header row, drop the duplicate Draft badge 2026-10-18 23:49:17 +11:00
sam 7f5fbe4135 fix(ui): show workflow validation errors on the failing step and link to it 2026-10-18 23:49:09 +11:00
sam 86d4066084 fix(ui): render watched-run actions secondary so Publish stays the toolbar primary 2026-10-18 23:48:58 +11:00
sam 912f5e99ff fix(ui): label run picker statuses with the shared status name 2026-10-18 23:48:47 +11:00
sam 1d4278c5d2 fix(ui): open draft change review only when there are changes 2026-10-18 23:48:42 +11:00
sam 3871b820d9 fix(ui): grey out disabled Publish and give the reason on hover 2026-10-18 23:48:42 +11:00
sam 18d36b00bc fix(ui): dismiss all alerts and show the full alert list 2026-10-18 23:48:42 +11:00
sam 5e62f8311f fix(ui): short run picker label that ellipsises 2026-10-18 23:48:42 +11:00
sam 8e0614436b fix(ui): open the workflow canvas at the top and keep the list within the viewport 2026-10-18 23:47:18 +11:00
sam 68b8e5d00a fix(ui): open validation errors from the indicator and link each to its step 2026-10-18 23:47:14 +11:00
sam a202c280d8 fix(ui): enable Publish only when the draft has changes 2026-10-18 23:47:01 +11:00
sam ff5cab992b fix(postgres): task alert body carries the truncated task title, not a restated title 2026-10-18 23:46:48 +11:00
sam 46f3c881ec fix(ui): fill the viewport instead of a rounded inset frame 2026-10-18 23:46:34 +11:00
sam a54fec0b43 fix(ui): titles on truncated step badge and trigger labels 2026-10-18 23:46:30 +11:00
sam f2a1aedbc2 fix(ui): workflow names in the sans face 2026-10-18 23:46:25 +11:00
sam fbe0742ef6 fix(ui): group run picker and run actions apart from workflow edit actions 2026-10-18 23:46:19 +11:00
sam a0524c0cf3 fix(ui): make the whole alert item open its link 2026-10-18 23:45:54 +11:00
sam bc7f4390b1 fix(ui): bound option select lists to the trigger side and ellipsise labels 2026-10-18 23:45:28 +11:00
sam e5520ae4e5 fix(ui): fade the hidden edges of horizontally scrolling tab rows 2026-10-18 23:45:28 +11:00
sam 06014f4a39 fix(ui): keep OIDC save in its card and make the redirect URI copyable 2026-10-18 23:45:27 +11:00
sam addd9b8f14 fix(ui): give every workflow row the same status line with a titled delivery bar 2026-10-18 23:45:27 +11:00
sam 0d78e26e8d fix(ui): mark the step failing validation on its canvas node 2026-10-18 23:45:27 +11:00
sam bc291255e8 fix(ui): move neighbouring columns aside when a step card opens 2026-10-18 23:45:27 +11:00
sam 5aba9b8707 fix(ui): drop stale alert loads so badge and list agree 2026-10-18 23:45:27 +11:00
sam 6c555adb79 fix(ui): give canvas zoom controls tooltips and larger hit targets 2026-10-18 23:45:27 +11:00
sam 3eca2ef5df fix(ui): step page, workspace, card and canvas surfaces apart 2026-10-18 23:45:26 +11:00
sam 491c1fa683 fix(ui): hide the chat launcher on the workflow page, where the Archie bar is the entry point 2026-10-18 23:45:26 +11:00
sam 4fe217ef0e fix(ui): dim the top bar under the section sheet 2026-10-18 23:45:26 +11:00
sam 872958127a fix(ui): label the no-run picker option as the current definition 2026-10-18 23:45:26 +11:00
sam 32735a2ab1 fix(ui): rename a step to a valid step id 2026-10-18 23:45:26 +11:00
sam f300b96251 fix(ui): anchor the alerts badge beside the bell instead of over it 2026-10-18 23:45:26 +11:00
sam b1d38bb7b7 fix(ui): put the new workflow button on the workflow list 2026-10-18 23:45:26 +11:00
sam 0af9ac496e fix(ui): mark each trigger on the start node with its kind 2026-10-18 23:45:25 +11:00
sam fd30a24079 fix(ui): product logo heads the phone section sheet 2026-10-18 23:45:25 +11:00
sam 0749f45054 fix(ui): outline the workflow toolbar overflow button to match Test and Run 2026-10-18 23:45:25 +11:00
sam 168ddde0dd fix(ui): align branch lane ends and route the unmatched switch path down its own lane 2026-10-18 23:45:25 +11:00
sam 0d6d5e7dd3 fix(ui): one name for the workflow chat bar 2026-10-18 23:45:25 +11:00
sam 27c70d8e24 fix(ui): style notification group labels as panel headings 2026-10-18 23:45:25 +11:00
sam 0275e9e75f fix(ui): one insert chip per earlier step, inserting its summary 2026-10-18 23:45:24 +11:00
sam c618b30013 fix(ui): size the alerts panel to the phone viewport 2026-10-18 23:45:24 +11:00
sam cbb2e823da fix(ui): select the next workflow after deleting one 2026-10-18 23:43:24 +11:00
sam 113da1cd4b docs: the production-readiness goal until 1 December 2026-10-18 23:05:28 +11:00
sam a9ae4ab3f1 docs: forge is one of many inputs or outputs; drop the expired temporary note 2026-10-18 22:57:18 +11:00
sam 3be983c650 docs: a forge is an event source and output destination, not core 2026-10-18 22:55:22 +11:00
sam 7b680f8ac6 fix(ui): icon-only run button matches the 32px icon size 2026-10-18 22:52:19 +11:00
sam b6057a0a11 build(ui): regenerate dashboard 2026-10-18 22:42:51 +11:00
sam 3bebdb2af7 fix(ui): keep the workflows toolbar readable on the 36px ladder
The run selector is the only control that gives up width, and beside the
workflow list it had none left: Open and the run's version move into the one
menu at every width, so the picked run stays readable from 390 to 1440.

Step editor and binding fields take the next rung (h-8) so they match the
selects and switches they sit beside.
2026-10-18 22:42:14 +11:00
sam dd80fcb337 build(ui): regenerate dashboard 2026-10-18 22:29:59 +11:00
sam 2b523fe7e0 fix(ui): burger section sheet at phone width, 36px control scale
The coarse-pointer rule gave every button, link and field a 44px minimum on
touch, which made the phone dashboard look like a toy and pushed the section
strip into overlapping its neighbours. Controls now keep their own size, and
the shared ladder is one step taller (default 36px, sm 32px) so a finger still
hits something. Inputs stay 16px only where iOS would zoom.

Below md the sections move into a sheet with the current page marked; the bar
keeps brand, search, alerts and the operator. Page titles drop to 18px so the
title and its action sit on one centred line.
2026-10-18 22:29:25 +11:00
sam 39e33e75a3 fix(ui): one workflows toolbar row, one menu, no repeat step type
The step editor's More disclosure no longer fills when open, so only the
chevron moves. A step card keeps its type chip only when its title does not
already say it.

The editor header is one toolbar at every width: view tabs left, the run
selector and actions right, and a single menu holding the sections that do
not fit, the run's own actions and the draft's change list. Publish is the
one primary action. Restore replaces Discard draft and the per-workflow
Restore default, which settings owns.

The page header no longer wraps, and run rows on a phone no longer squeeze
the run title.
2026-10-18 22:29:25 +11:00
sam 991b40047a fix(ui): Instructions replaces SOUL in routes and agent pages; terse alerts; missing-key hint 2026-10-18 19:27:11 +11:00
sam 39e44e9da9 build(ui): regenerate dashboard 2026-10-18 15:55:08 +11:00
sam 499898a4fc fix(ui): distinguish loading, failed and empty lists, one role label set, en dash for no value 2026-10-18 15:54:31 +11:00
sam de7571f91e fix(ui): keep the chat launcher and Archie bar clear of controls and the canvas
Reserve bottom space for the floating launcher at phone width, drop the
duplicate provider class and the setup guidance sentence, give the source
and model rows room to size, place the Archie bar below the canvas, use the
shared Empty on the not-found page, and let the org overview list titles.
2026-10-18 15:54:31 +11:00
sam fd8d2c1941 fix(ui): one text colour scale, Empty for page empty states, token requests through api 2026-10-18 15:03:44 +11:00
sam e953fc8891 fix(ui): trim workflow and log captions, select components for event binding 2026-10-18 15:02:00 +11:00
sam b9d28418e8 fix(ui): tighten tasks page prose and phone layout 2026-10-18 15:02:00 +11:00
sam 3f46d2ec33 fix(ui): trim settings prose, inline switches, wrap narrow add forms 2026-10-18 15:02:00 +11:00
sam 81f1be388e fix(ui): trim view captions and empty-state copy in org, accounts, curators and skills
Drop captions that restated headings, cut the duplicate Policies card title,
use the Select component for account roles, let org agent actions wrap on
phone width, and use em-free placeholders.
2026-10-18 15:02:00 +11:00
sam 4b921227c5 fix(ui): trim view prose, en dash placeholders, collapse fixed grids on phones
Drop empty-state essays that repeated their titles, the harness native select
becomes the Select component, and the binding and source forms collapse to one
column below sm. Issue-ID and history narration removed from comments.
2026-10-18 15:02:00 +11:00
sam c0bd7bb6a3 fix(ui): drop history narration and em dashes from chat and dashboard comments 2026-10-18 15:02:00 +11:00
sam 0cec2ec16d docs(ui): record the presentation rules 2026-10-18 14:57:50 +11:00
sam 7120cf52a2 fix(ui): check step names drop the repeated gate 2026-10-18 13:20:52 +11:00
sam cc9151425f fix(ui): plus-only new workflow; restore default workflows moves to task settings 2026-10-18 13:18:21 +11:00
sam c744928e07 fix(ui): the workflow switch needs no Enabled label 2026-10-18 13:15:53 +11:00
sam 6529613496 fix(ui): drop the log and change-file status captions 2026-10-18 13:14:52 +11:00
sam 010c8b28dd docs(ui): no captions that describe the view 2026-10-18 13:10:26 +11:00
sam 198702010f fix(ui): drop captions that only describe the view 2026-10-18 13:09:55 +11:00
sam ffffaa9fe6 fix(ui): put the Archie bar under the canvas on phones so it cannot cover a step 2026-10-18 13:04:43 +11:00
sam 90b7d28627 fix(ui): pick the workflow and the revision from a select on narrow screens
The workflow list scrolled sideways off a phone screen and the history grid
pushed the diff off it. Below lg the list becomes a header select with the
draft badge; below md the revision list becomes a select above a full-width
diff, with the two canvases stacked.
2026-10-18 12:32:32 +11:00
sam d8b4e04861 fix(ui): keep the YAML gutter aligned on phones and fit the editor to a phone viewport
The gutter printed one number per source line while the text layer wrapped,
so every line after a long one was numbered wrong. The textarea no longer
wraps: the gutter, the highlight layer and the textarea share one row per
line and scroll together on both axes.

Below md the section tabs that do not fit collapse into one menu that sets
the same tab, and the actions share one right-aligned row. The canvas is
sized to the viewport left on a phone, frames a graph or card wider than the
canvas instead of clipping its edges, and clears the chat launcher.
2026-10-18 12:32:21 +11:00
sam 8c1756d312 fix(ui): scale touch targets to the pointer, not the window width
A coarse-pointer-only floor keeps switches, tab triggers and scrolled nav
strips from being deformed on a phone, and the topbar reveals the current
section after a route change.
2026-10-18 12:32:10 +11:00
sam 5989f0b45f fix(ui): finish an Archie turn across tab switches and name map entries in the settings review 2026-10-18 02:52:49 +11:00
sam 846626fabf feat(gateway): read instructions and access policies from the workflow tools
settings_get now reads three more kinds:
- soul, the instruction text layered into a workflow run;
- task-policy, the diff cap and alert delivery settings;
- org-model-policy, which models an org may use.

None of them holds a secret value: task-policy's notify_secret and the
secrets elsewhere in the readable kinds are SecretRef references (engine and
key), never the resolved value.

access_policies_list is new: the caller org's Cedar policies (id, level,
scope, text), and the instance policies when the caller owns the instance,
which is what the dashboard lists for the same read. It is guarded as
access.ActionRead on access.KindPolicy, the check the dashboard makes.
IntegrationSource gained Policies, implemented over the State Store's
ListPolicies.

workflow_get now says how its instructions field layers: after the
instance's and the organisation's, before the repository's.
2026-10-18 02:39:25 +11:00
sam 7768fa808d fix(gateway): workflow and integration tools ask the access policies as their caller 2026-10-18 02:35:59 +11:00
sam 39c3c47ea2 feat(gateway): workflow and integration tools for chat and Kit harnesses alike 2026-10-18 02:32:30 +11:00
sam f5770fdc6e fix(workflows): lock the editor while Archie writes the draft 2026-10-18 02:29:12 +11:00
sam b4595bf8bb feat(workflows): iterate on a workflow's draft with Archie from the canvas 2026-10-18 02:27:41 +11:00
sam 8e3711b73c feat(workflows): edits save as a draft and reach the running workflow only on publish 2026-10-18 02:21:54 +11:00
sam 55deeaa88c feat(ui): revert single changes in settings and workflow review 2026-10-18 02:18:23 +11:00
sam f10199f0b6 feat(ui): workflow canvas cards expand in place instead of side panels 2026-10-18 01:59:09 +11:00
sam eb6aaca1f5 feat(credentials): grant credential services to dashboard identities, chosen from pickers 2026-10-18 00:43:31 +11:00
sam 9167c861d6 fix(postgres): run stored workflows that name the root identity as the seeded agent 2026-10-18 00:29:14 +11:00
sam 2d1bbb6e6a feat(tasks): a work request's description is optional 2026-10-18 00:24:42 +11:00
sam d82e316f9b fix(ui): keep a numeric workflow input as text so the run form does not crash 2026-10-18 00:08:41 +11:00
sam 33f5290015 feat(instructions): layer instance, organisation, workflow and repository instructions into every agent stage 2026-10-17 23:42:39 +11:00
sam aa1e2ca660 feat(kit): central tools for harnesses through the egress proxy and gateway task-tool RPCs 2026-10-17 23:42:37 +11:00
sam 86600c3884 build(ui): commit the dist assets the accordion and connection fixes changed 2026-10-17 23:16:22 +11:00
sam c6c7a44c5b fix(ui): show a connection's saved forge and identities; selection data lives in the stores 2026-10-17 23:05:14 +11:00
sam 0652ded616 fix(ui): let accordion content overflow sideways so row tints keep their margin 2026-10-17 23:02:31 +11:00
sam 2d3b6d0d87 fix(ui): pad tinted setting rows so the tint is not clipped 2026-10-17 22:58:58 +11:00
sam b25263308b feat(repos): access check reports the operations the agent can perform 2026-10-17 22:58:01 +11:00
sam 1410fbc565 fix(ui): drop redundant connection labels and hints 2026-10-17 22:26:31 +11:00
sam c72c443090 feat(ui): choose a connection's permitted identities from the identity list 2026-10-17 22:07:27 +11:00
sam 6f29790b76 feat(ui): choose a connection's forge type from the enabled forge extensions 2026-10-17 22:06:13 +11:00
sam d936609188 build(taskfile): rebuild binaries when embedded files change 2026-10-17 21:56:25 +11:00
sam 8aa59bdb51 fix(postgres): allow the agent org upgrade phase 2026-10-17 21:55:42 +11:00
sam f0eee80ab7 fix(staterpc): derive harness secret org from caller grants 2026-10-17 21:44:08 +11:00
sam 7f9486fff1 refactor(servicekit): stop linking the State Store and control plane into archie-messaging 2026-10-17 17:22:53 +11:00
sam e9f45eeb8b feat(ui): default the workflow's run-as identity to the seeded agent 2026-10-17 17:21:58 +11:00
sam 127e5e70a0 build(taskfile): drop unused tasks and share the dev State Store wait 2026-10-17 17:21:10 +11:00
sam 334787c140 fix(install): name the required Go version when its toolchain is unavailable 2026-10-17 17:19:08 +11:00
sam 2cdf3b2c85 build(dev): serve the dev State Store over TLS on the Docker bridge so task containers reach it 2026-10-17 17:19:08 +11:00
sam bf14695eab feat(workflow): pr-review submits REQUEST_CHANGES on blocking findings and lists unanchored ones in the review body 2026-10-17 17:17:48 +11:00
sam a4da914994 fix(identity): emit RFC 4122 shaped stable IDs and migrate stored ones 2026-10-17 17:16:20 +11:00
sam fefbe19011 fix(archiemessaging): announce READY after channels bind; run notifying units as Type=notify 2026-10-17 17:15:34 +11:00
sam a2ade2ee42 fix(config): treat a [[curators]] entry without enabled as on 2026-10-17 17:15:34 +11:00
sam 2e7158a760 fix(workflow): remove the pr-review snapshot when any phase ends the run 2026-10-17 17:14:31 +11:00
sam 1cd0ed22f5 refactor(curator): rename SessionSummary to SessionRef 2026-10-17 17:12:52 +11:00
sam db982f2d93 refactor(workflow): drop the root identity alias from workflow definitions 2026-10-17 17:09:37 +11:00
sam 44a10943c3 feat(webui): link parked tasks to the page that fixes their blocker 2026-10-17 17:08:24 +11:00
sam 055e0250bd feat(identity): seed a narrow agent identity and run shipped workflows as it 2026-10-17 17:04:43 +11:00
sam 48dc39a3d5 fix(ui): 44px touch targets on narrow and coarse-pointer viewports 2026-10-17 17:01:27 +11:00
sam f45ea9e0aa feat(workflow): configure review precision and approval on the review.pr step 2026-10-17 17:00:55 +11:00
sam ab16bc673d fix(releaseupdate): run the release's watchdog and bound control-plane calls 2026-10-17 17:00:04 +11:00
sam 7b504f9ed6 refactor(archied): discover issues through organisation connections 2026-10-17 13:38:46 +11:00
sam 9d7287c647 feat(taskactions): retry a parked task on the current workflow definition 2026-10-17 13:35:12 +11:00
sam c80d4750a8 feat(archied): dispatch every organisation's schedules 2026-10-17 10:19:32 +11:00
sam e579b908f3 chore(postgres): delete unused queries 2026-10-17 10:17:14 +11:00
sam 01acb97f96 chore: delete code no binary or test reaches 2026-10-17 10:14:26 +11:00
sam 7986ccb3f7 fix(workflow): clip park details within the store cap and share the diff-rule blocking level 2026-10-17 10:11:07 +11:00
sam e452451926 fix(ui): state credential and connection status without internal service names 2026-10-17 10:10:03 +11:00
sam 9b7e7fc221 refactor(postgres): split lifecycle exit side effects out of Apply 2026-10-17 10:10:02 +11:00
sam 42ba637935 fix(postgres): keep every organisation an active owner 2026-10-17 10:07:45 +11:00
sam 6aced84146 fix(daemon): open model egress only for workflows with a model step 2026-10-17 10:03:12 +11:00
sam 05987f04e2 feat(daemon): execute and verify organisation repository connections 2026-10-17 09:32:39 +11:00
sam 32642af4a9 feat(ui): give organisation, instance and account clear homes
The Access area mixed organisation, instance and personal settings under
one name. Split them: /org is the organisation's own area (members,
identities, connections, models, schedules, playbooks), /settings is
instance administration only, and personal security stays in the account
menu. Setup checklist steps now link to the page that fixes them.
2026-10-17 09:01:41 +11:00
sam 62ee8a0381 fix(controlplane): name a migrated connection for its host
The seeded root connection was called "Instance forge", which names two
archie concepts an operator never chose. Name it for the host it points at
instead.
2026-10-17 08:59:57 +11:00
sam 30216dd367 fix(e2e): build stack with release metadata 2026-10-17 08:47:05 +11:00
sam cbc4cf309d fix(webui): bind task requester to authenticated principal 2026-10-17 08:42:08 +11:00
sam 4217a50874 fix(ui): connections copy states the field, not the model
Drop the sentence explaining that the credential is a reference and that an
identity with no entry is not granted: both lectured at the operator instead of
labelling the field. The external account needs no hint, the forge type keeps
one line saying where the value comes from, and the identity button reads the
way the credential-grants control already does.
2026-10-17 03:25:30 +11:00
sam a8a27eb4a4 fix(ui): clarify connection permission guidance 2026-10-17 03:24:20 +11:00
sam 8410271fdb feat(ui): configure forge connections in the dashboard
A Connections page under Settings lists the organisation's forge connections:
host, forge type, the reference to the credential (never its value), the
external account it belongs to, and the operations each execution identity may
perform through it. The chat agent's page registry names the page too.
2026-10-17 03:20:17 +11:00
sam fe97e92dd2 fix(daemon): execute dashboard identities with scoped authority 2026-10-17 03:13:30 +11:00
sam 9ab0121af0 feat(archied): a rotated connection reaches the next operation
The connections kind joins the live resource watches. On a new revision
archied re-resolves the instance forge from the settings it just published and
replaces every holder of the client: the boot forge, the worktree token, the
daemon's root forge and the root task RPC servers, which are now returned from
registration so a task that is already connected asks the new credential
rather than the one the process booted with.

This commit also carries the execution-identity agent's concurrent edits to
these three files, which the shared working tree had not committed yet.
2026-10-17 03:09:43 +11:00
sam 6132c12835 feat(controlplane): the instance forge is its root connection
Layering reads forge-connections and takes the root connection for the
instance's own forge, keeping the file's webhook intake and secret, which are
instance infrastructure rather than an account. A document with no root
connection disables the forge instead of falling back to a credential the
operator may have withdrawn.
2026-10-17 03:07:09 +11:00
sam cb48a27d16 feat(controlplane): organisation forge connections
A connection is an organisation's own resource: the forge host, the
credential reference and the external account it belongs to. It records a
reference, never a token value, and names per execution identity the
operations that identity may perform through it.

The file's [forge] sections seed it: the root's becomes the root connection
and each identity's own forge becomes a connection only that identity may
use, so the migration keeps exactly the grants the file expressed.
2026-10-17 03:05:01 +11:00
sam 3953a3a06c refactor(ui): move personal tokens and instance authentication out of Access
Personal API tokens are the signed-in operator's, and the instance URL and
OIDC providers are the instance's, so neither belongs under the organisation
Access area. Tokens render in the account page and Authentication moves to
Settings; the old paths redirect.
2026-10-17 02:41:24 +11:00
sam 139338cf34 docs(prompts): define organisation automation handoff 2026-10-17 02:25:32 +11:00
sam 41cd938748 fix(ui): repair settings editing and workflow diagnostics 2026-10-16 23:55:58 +11:00
sam 3229de9b3b fix(e2e): recover reliable local stack startup 2026-10-16 22:25:49 +11:00
sam dcc201e7bb fix(tasks): limit titles and display descriptions 2026-10-16 21:50:13 +11:00
sam 1b8abd3509 chore(release): v1.55.0
deploy / gate (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
2026-10-16 03:57:48 +11:00
sam 7ebf842c5c feat(agent): frame the default SOUL around event-driven automation 2026-10-16 03:57:08 +11:00
sam 74699fcd21 refactor: remove personas
Personas were a misread requirement: SOUL is the chat identity and
identities are per action. The selected persona's prompt never reached the
model. Drops the resource, /personality, the chat selector, the settings
page and ChatService.SetPersona, and deletes stored persona documents.
2026-10-16 03:57:08 +11:00
sam f8b061c314 chore(release): v1.54.3
deploy / gate (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
2026-10-16 03:46:35 +11:00
sam c5158edb6c feat(gateway): chat reads workflows and validates drafts
workflow_list, workflow_get and workflow_step_types read the org's
definitions and step catalog; workflow_validate runs the editor's save
check on a proposed definition without saving it.
2026-10-16 03:46:27 +11:00
sam 9ad270b9a4 chore(release): v1.54.2
deploy / gate (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
2026-10-16 03:33:58 +11:00
sam 51328c9585 fix(deps): ai-sdk v0.3.1 so Gemini Interactions tool calls get valid arguments 2026-10-16 03:33:49 +11:00
sam aa1ca9e653 chore(release): v1.54.1
deploy / gate (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
2026-10-16 03:11:22 +11:00
sam cb29967e7b fix(releaseupdate): find releases in the public releases repository
The source repository is private, so the updater and install.sh got 404.
Releases are now published to samcharles93/archie-releases by
task release:publish.
2026-10-16 03:11:14 +11:00
sam 474fd59759 chore(release): v1.54.0
deploy / gate (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
2026-10-16 03:00:32 +11:00
sam 40ee9ffafa fix(rpc): bound gRPC servers and return listener failures
Cap concurrent streams, the handshake and dead peers' streams on every
service, drain shutdown for at most 10s, and stop messaging when its
listener dies instead of running on without Deliver.
2026-10-16 02:57:26 +11:00
sam 939b912889 refactor(ui): unify account administration under Access 2026-10-16 02:57:13 +11:00
sam 83aa17cf8b feat(identity): add browser setup and user accounts 2026-10-16 02:41:24 +11:00
sam 9cdae5642e feat(rpc): mTLS between services from operator-issued certificates
Replace the service bearer tokens with [tls] ca_file and cert_dir. Caller
identity comes from the verified certificate, not metadata. Without TLS,
services listen and dial on loopback only. Task containers get only the CA
and keep their grant.
2026-10-16 02:37:51 +11:00
sam dcf2972f26 feat(ui): start tasks from the dashboard and slim it to activity and setup 2026-10-14 23:28:37 +11:00
sam f96c44d092 refactor(scheduling): remove unused engine accessors 2026-10-14 23:10:35 +11:00
sam f537d5f8cd refactor: delete wrappers superseded by live entry points
Remove controlplanerpc.NewClient (superseded by NewRPCClient), Loader.Overlay
(-config-overlay reaches Resolve directly), and setup.Run (RunParams is
the live entry point). Move ResolverFunc into a test file, since only
tests adapt functions to the egress Resolver.
2026-10-14 23:10:35 +11:00
sam c833b651a9 fix(workflow): set BuildNoChanges from writable stages and clear it on commit
A writable agent stage that passes now marks BuildNoChanges; repo.commit
clears it when the stage commits changes. The flag had no setter, so the
signal was lost in the YAML migration. The outcome of an empty commit
stays with if_empty: unset still fails, complete closes the issue, skip
moves on.
2026-10-14 23:10:34 +11:00
sam 062f5332a0 refactor(gateway): delete unused wrappers and in-memory session store
Remove gateway re-exports of messaging helpers with no callers, the
unused DeltaFunc adapter, DefaultPersonas, NewStoreTaskCreator, the
SortBySeq stub, and the in-memory session store that nothing constructs.
2026-10-14 23:10:34 +11:00
sam d9fe384fd9 build(deps): bump ai-sdk v0.1.43 -> v0.3.0 and update dependencies
Gemini 3.x/4 chat now routes through the Interactions API transport, which
replays thought signatures on tool turns; long decode stays opt-in. Also
takes go get -u updates (x/*, genproto, goose, nats-server, modernc sqlite).
2026-10-14 23:10:34 +11:00
sam 8a7220f5e9 fix(gateway): isolate model selections by org 2026-10-14 21:19:34 +11:00
sam 5b9ff6fa47 fix(gateway): restore provider model selection in chat
Restore provider groups and concrete model references in chat snapshots. Permit catalog selections while retaining named aliases and tenant model restrictions. Show the active model in /profile without requiring a task identity.

Refs: archie-core-mvek6
2026-10-14 21:03:30 +11:00
sam 66b22f4833 build: trim filesystem paths from service and agent binaries 2026-10-14 03:49:31 +11:00
sam acec5d392d feat(archied): read-only run-scoped sandbox view over the harness contract (#1662)
* feat(archied): read-only run-scoped sandbox view over the harness contract

Serve RunTarget: the daemon resolves a running task and attempt to its Kit
container and follows its output, refusing a finished or unknown task with a
stated reason. The dashboard adds a Sandbox tab behind the task log's read
authority. Takeover stays out of scope until the sod1 authority is wired.

* fix(archied): scope and close sandbox views correctly

Forward harness activity into container output, bind containers and dashboard views to their attempt, enforce the asserted org, and report unavailable dependencies and interrupted streams accurately.

Refs: archie-core-qi91, archie-core-252tj
2026-10-14 02:57:32 +11:00
sam 59be81c7f6 fix(webui): an absent setting equals its zero value in drafts; setting rows get roomier padding 2026-10-13 20:20:03 +11:00
sam c0ac39b8da fix(webui): the danger setting row tints without shifting its content 2026-10-13 19:55:05 +11:00
sam 7b19935a14 build(webui): add the CardAccordion chunk missing from the bundle 2026-10-13 19:49:25 +11:00
sam fa7d0d83c1 fix(archied): report schedules apply status at start and on a timer 2026-10-13 19:08:55 +11:00
sam 7542e3b15e fix(archied): report workflow definitions apply status at start and on a timer 2026-10-13 19:06:53 +11:00
sam 6412e6d116 feat(webui): settings lists share a card accordion that opens the new item and blocks adding while unsaved 2026-10-13 19:06:01 +11:00
sam b1dbe519b0 feat(webui): repositories list is an accordion; adding opens the new one and waits for save 2026-10-13 19:04:14 +11:00
sam 3103f87b71 fix(applystatus): the gateway no longer owes an apply status for channel and plugin settings 2026-10-13 19:00:52 +11:00
sam 8664e8cd97 fix(webui): drop settings hints that restate their label 2026-10-13 18:11:12 +11:00
sam 9e566e7278 fix(webui): shorten route descriptions, setup steps, alerts and panel errors 2026-10-13 18:10:39 +11:00
sam f02a3b6d02 fix(agent): drop the one-question cap from the chat prompt and SOUL 2026-10-13 17:49:35 +11:00
sam bf6f3512b1 feat(agent): default persona and SOUL share a reporting-focused identity prompt 2026-10-13 17:47:46 +11:00
sam 00112ae205 fix(webui): attention vocabulary no longer addresses a single user 2026-10-13 17:42:11 +11:00
sam 8001c893bd fix(webui): cut tutorial and marketing prose from labels, hints, empty states and confirms 2026-10-13 17:37:53 +11:00
sam 0e25291d47 fix(webui): review settings drop the in-force echo and rewrite the approval hint 2026-10-13 17:28:31 +11:00
sam 68fb3a7e19 fix(webui): form fields sit on the card colour so they no longer read as disabled 2026-10-13 17:24:48 +11:00
sam 541575a073 fix(archied): load and report EDA playbooks at start instead of at the first dispatch 2026-10-13 17:22:01 +11:00
sam d4d24cb1db fix(webui): default-alias warning states the action only 2026-10-13 17:17:06 +11:00
sam 20cb2fd99d fix(webui): task page drops filler copy, the unattributed-events note and the New run tooltip 2026-10-13 17:16:25 +11:00
sam 4fd6efb7f0 fix(webui): alerts drop UI-explaining prose and align Dismiss with the title 2026-10-13 17:14:43 +11:00
sam 9eabc624ee fix(config): a task snapshot carries only the model limits its aliases resolve to 2026-10-13 17:07:40 +11:00
sam 01418b7e81 fix(webui): harness terminal-unavailable message says what the operator can do 2026-10-13 17:02:45 +11:00
sam cac763a339 feat(webui): finish redesign dashboard task and secret settings 2026-10-13 16:41:35 +11:00
sam 0dde93e57e fix(taskactions): a failed callee cancel no longer leaves the caller's run going
Issue: archie-core-kig5j
2026-10-13 16:22:40 +11:00
sam 7435b6efe5 fix(eda): the undispatched-capture batch lists only captures an enabled binding still owes
Issue: archie-core-kfjz1
2026-10-13 16:21:21 +11:00
sam 796c7a711b fix(postgres): age retention spares captures still waiting to be dispatched
Issue: archie-core-jrh2m
2026-10-13 16:19:12 +11:00
sam 4ac9fd852f fix(postgres): assign bootstrapped agent identities to the default org on every start
Issue: archie-core-n5yj5
2026-10-13 16:18:19 +11:00
sam 06d6293a9d fix(controlplane): instance settings are written by the system org only
Issue: archie-core-f5zso
2026-10-13 16:17:38 +11:00
sam 0c904fb9ef fix(controlplane): playbook dispatch resolves and caches per the task's org
Issue: archie-core-5t4z7
2026-10-13 16:16:31 +11:00
sam 59645969ee fix(e2e): repository policy applies live, so seeding no longer restarts archied
Issue: archie-core-m5aqb
2026-10-13 16:15:07 +11:00
sam acacdfdab5 fix(statestore): an invalid stored policy raises an alert and resolves when it validates
Issue: archie-core-kgxw.16
2026-10-13 16:14:16 +11:00
sam 2090c41960 fix(ops): external NATS needs a token and publishes monitoring on loopback only
Issue: archie-core-ov11
2026-10-13 16:09:23 +11:00
sam e5a67b8ff0 fix(webui): a source create is authorized against the workspace it names
Issue: archie-core-ed8tw
2026-10-13 16:00:37 +11:00
sam 8e6dfd785f fix(webui): channel reload route is authorized as the channel action
Issue: archie-core-4laa1
2026-10-13 15:59:36 +11:00
sam b9547b01a8 fix(staterpc): an org-scoped caller cannot read or write another org's harness secret
Issue: archie-core-jo15w
2026-10-13 15:58:51 +11:00
sam 0720e9629c fix(statestore): a restart never resolves a service alert still inside its grace
Issue: archie-core-07lyl
2026-10-13 15:56:23 +11:00
sam bb67bd77f1 fix(statestore): service-unhealthy grace counts from the last stored report and covers silent services
Issue: archie-core-07lyl
2026-10-13 15:29:29 +11:00
sam 8ecda341e0 fix(servicekit): report apply status only for kinds the process re-applies live
Issue: archie-core-mt91
2026-10-13 15:28:43 +11:00
sam dee78a876a fix(postgres): clamp event, token and denial limits to int32
Issue: archie-core-g14d
2026-10-13 15:27:36 +11:00
sam 33ccfb2505 fix(daemon): run-time workflow check sees the binding event's signature and address
Issue: archie-core-bmro8
2026-10-13 15:10:31 +11:00
sam 0330a65054 fix(postgres): confine identity writes and GetPrincipal to the caller's org
Issue: archie-core-wkey2
2026-10-13 15:07:48 +11:00
sam 4eb9c20c0c fix(workflows): callees of a test run inherit the test source 2026-10-13 12:46:48 +11:00
sam 1f4910a651 feat(workflows): test-run unsaved drafts and browse workflow version history
A test run pins a validated draft, runs with forge and push writes
suppressed and recorded per step, and is excluded from workflow stats.
The History tab lists revisions that changed a workflow, diffs them as
YAML and on the canvas, restores into the editor, and ties runs to the
revision they used.
2026-10-13 12:27:40 +11:00
sam 150bfd4605 fix(postgres): quote the alert lock key so a NUL cannot reach Postgres text 2026-10-13 03:15:06 +11:00
sam 3bf64933b0 fix(ui/topbar): replace Jump to with a command palette, drop filler chrome (#1650)
* fix(ui/topbar): replace Jump to with a command palette, drop filler chrome

Jump to opens a shadcn-vue Command dialog that finds pages, tasks and
workflows by name. The connection indicator shows only when the stream is
lost, the dead documentation link is gone, and the profile menu label has
no stray whitespace.

* fix(ui): trim stray whitespace from template text and drop em dashes from copy

Element text that started or ended with a line break rendered with leading
and trailing spaces. Also removes the unused 'soon' nav state and the nav
group components no route reaches.

* fix(ui): drop the space a hidden spinner left before button text

* fix(ui/status): one dense Status page, full-width settings, problems-only apply status

Status drops its tabs and the duplicate health card; services list only
what is wrong. Settings pages use the full width, the resizable sidebar
handle is gone, and apply status shows only processes that have not
applied a change. PageHeader puts the title and actions on one line.

* refactor(ui): use shadcn ToggleGroup and Badge, drop SegmentedControl and StatusPill

Status badges show only when a state needs attention: no Running, Enabled,
Active, Listening or live pills next to healthy rows. Removes the unused
pagination, radio-group and scroll-area components.

* fix(ui/history): use the shadcn Table with fixed columns so nothing is clipped

* fix(ui/workflows): apply ?workflow= only once the workflow is listed

Selecting it before the definitions loaded opened an empty canvas.

* refactor(ui/workflows): use shadcn Input, NativeSelect, Checkbox and Button in editors

Replaces hand-rolled inputs, selects, the repository mode switch and icon
buttons in the workflow editor, bind dialog, harness page, sources panel
and review gate. Adds the upstream shadcn-vue NativeSelect.

* style(ui): rounded-rectangle controls instead of pills

Halves the radius scale so inputs, selects and buttons stop reading as
pills, and badges and chips lose their full rounding.

* fix(ui/alerts): centre the bell's failed state and stop it contradicting Needs you

* fix(ui/tasks): one header line, aligned columns, no placeholder issue numbers

Tasks puts its filters beside the title and drops the stat tiles the
dashboard already shows. Sort headers align with their cells, chat tasks
no longer show their synthetic issue number, and Logs and the task
not-found page use the shared header.

* fix(ui/dashboard): shared header and cards, empty cards stay silent

Needs you uses the shadcn Card and drops its duplicate Open button; quality
gates and token outlook render only when there is something to show; the
throughput strip moves into the dashboard, its only user.

* refactor(ui/stores): one Pinia store per feature

Splits the site-wide control-plane store and the module-level refs into
settings, workflows, tasks, events, org and session stores. Identity
requests move into lib/api. Drops store fields nothing read: per-resource
stream state, the states map and loadApplyStatus.

* fix(ui/org): one header for the org area, sections drop their repeated titles

The org name is the page title with the admin's org switcher and New org
beside it; Members and Workspaces tables sit in cards like other pages.

* fix(ui/events): shadcn Tabs for the capture, map and bind steps

Replaces the numbered step strip with line tabs that carry each step's
count; the Listening pill is gone and Capture off shows only when it is.

* fix(ui/workflows): confirm a workflow delete in an AlertDialog, not window.confirm

* style(ui/settings): denser setting rows
2026-10-12 04:40:21 +11:00
sam 94d2f98cc0 feat(e2e): local stack, seed and browser checks for release validation 2026-10-12 04:28:26 +11:00
sam 2df2f72fc2 fix(ci): guard apparmor userns sysctl in deploy workflow 2026-10-12 04:17:11 +11:00
sam 8a3ba32c5a Feat/operator alerts (#1635)
* feat(state): durable operator alerts owned by the State Store

Alerts dedup on org+kind+subject, resolve themselves when a condition
clears, and are raised, resolved, dismissed and listed through the state
contract. Task transitions raise needs-human and failed alerts in the same
transaction; the store checks service health and prunes closed alerts.
Each raise and resolve queues a webhook delivery whose attempts are kept.

* feat(notify): deliver operator alerts to the webhook; raise config and release alerts

notify.webhook now receives raised and resolved alerts above a severity
threshold with HMAC-signed payloads, bounded retry and every attempt recorded
on the alert. archied raises model alias, provider and credential-binding
alerts from the effective configuration, an update alert from the release
channel, and a credential-rejected alert from the egress resolver. The
dashboard API lists and dismisses the caller's org's alerts.

* feat(ui): alert bell in the top bar and webhook alert settings

The bell lists the org's open alerts by severity with dismiss and a link per
alert, and refreshes from the event stream. The task settings page gains the
webhook severity threshold and signing secret. ui/dist rebuilt.
2026-10-12 03:30:46 +11:00
sam f34f60f9c7 Feat/org epic (#1634)
* fix(postgres): scope OpenPRs to the caller's org

A principal-carrying caller read every org's pr_open tasks. The query now
honours the request scope; the daemon's unscoped review scan still sees all
orgs.

Issue: archie-core-kgxw.23

* fix(statestore): serve task logs only to the task's org

ReadTaskLog and StreamTaskLogContent took a task ID and read the file with
no org check. The State Store's task-log reader now confirms the task is
visible under the caller's scope first; unscoped services read as before.

Issue: archie-core-kgxw.24

* fix(postgres): scope ListPolicies to the caller's org

Every org's policy text reached any principal-carrying caller. A scoped read
now sees its own org's policies, plus instance policies when scoped to the
system org. The engines and the lockout guard decide for every org, so they
read the full chain unscoped: the dashboard engine loads without the
request's principal and the guard lifts the caller's scope.

Issue: archie-core-kgxw.25

* fix(postgres): scope identity reads to the caller's org

ListIdentities and GetIdentity (and its alias fallback) returned every
identity to any caller. A caller scoped to an org now sees only that org's
members and assigned agents; the system org and unscoped services still see
the whole instance.

Issue: archie-core-kgxw.26

* fix(postgres): hide instance status from other orgs

ListPresence, ListChannelStatus, ListApplyStatus and GetConfigSnapshot
answered any org principal with instance-wide state. They now return nothing
unless the request is unscoped or scoped to the system org. The dashboard
reads the published config as itself, since its handlers project it for
callers of every org.

Issue: archie-core-kgxw.27

* feat(postgres): assign new agents an org and role at creation

A bot or service account created through the API served no org until the
next State Store boot granted it one. Create now assigns it to the org the
request acts in with the developer role in the same transaction, so it is
authorized immediately.

Issue: archie-core-kgxw.14

* feat(edastore): create event records in a chosen workspace

Sources are created in a workspace of the caller's org, the default one when
none is named; event types and bindings take their source's workspace and
mappings their event type's, the same rule the org backfill applied. The
binding, mapping and event type contracts carry the workspace, the four list
endpoints accept ?workspace=, and the Events page has a workspace selector
that filters every step and picks where a new source goes.

Issue: archie-core-kgxw.11

* feat(webui): authorize a record in its workspace

The API built every access request with no workspace, so workspace
policies and per-workspace roles never applied. A request naming a source,
binding, mapping, event type or task now reads the record's workspace under
the caller's scope and authorizes in it; tasks carry their workspace on the
State Store contract for this.

Issue: archie-core-kgxw.9

* feat(access): expose workspace environment to policies

Policies can test resource.workspace.environment. The workspace attribute
is the workspace entity, which carries its environment; the principal
brings its org's workspaces from the State Store, so the dashboard and the
daemon's run checks describe a resource's workspace without another lookup,
and the daemon now authorizes runs in the task's or binding's workspace.

Issue: archie-core-kgxw.10

* fix(webui): ask read_secret when a source secret is read

Rotating a source's secret returns its value, but the route asked update,
which every developer holds, so no policy could narrow who reads a secret.
It now asks read_secret on the secret, which the shipped roles give admins
and an object policy can narrow further.

Issue: archie-core-kgxw.17

* refactor(org): delete the unused upgrade-incomplete sentinel

Nothing returns org.ErrUpgradeIncomplete: the State Store finishes the org
upgrade before it serves.

Issue: archie-core-kgxw.18
2026-10-12 03:24:04 +11:00
sam 8540c9f7c8 feat(releaseupdate): transactional self-update through archied (#1633)
archied update install verifies the release zip, checks every binary
reports the release, pulls the agent image by digest, backs up the
database in-process and stages the binaries before handing off to
archied update watchdog in its own process. The watchdog restarts units
in release order, requires archied healthy for 120s and otherwise rolls
back binaries and image policy, restoring the database only when a
migration ran. Boot recovery resumes the frozen watchdog.

Deletes scripts/archie-update-install, scripts/archie-update-watchdog,
the updater's --from-source and --auto, CommandInstaller,
ScriptInstaller and the update-image and update-topology subcommands.
2026-10-12 03:21:02 +11:00
sam 3014db85e7 Fix/workflow eda audit (#1627)
* fix(webui): accept the merge task action

The action whitelist omitted merge, so the dashboard's Merge button on a
pr_open task was refused with 400 unknown action.

Closes: archie-core-slpoz

* fix(workflow): give each parallel branch its own outputs

Branches shared the task's Outputs map, so concurrent declared-output
writes raced (or were lost when the map started nil). Each branch now
writes a copy; join merges new outputs in branch-name order and refuses
one written by two branches as a second write.

Closes: archie-core-3a7w2

* fix(postgres): dispatch captures oldest first and keep pending ones

ListUndispatchedCaptures ordered newest first and listed captures no
binding can match (failed HMAC), so sustained intake starved older work
and bad signatures held the batch. It is now oldest first and lists only
dispatchable captures. Count retention no longer evicts a capture that
is still pending for an armed binding. The daemon lists only sources
with an enabled workflow, so captures waiting on a disabled one do not
hold the oldest-first batch.

Closes: archie-core-2et4b, archie-core-o0s0z

* fix(ui): refuse renaming a workflow onto an existing id

Saving upserts by id, so editing a workflow's id to another workflow's
id removed the open one and overwrote the other. The editor now refuses
that save and says why.

Closes: archie-core-wpoz8

* fix(workflow): reject unknown step settings at save

Step factories decoded settings with yaml.Node.Decode, which drops keys
it does not know, and settings-less steps ignored settings entirely, so a
misspelt key (readOnly for read_only) saved and silently did nothing.
Every factory now decodes strictly and settings-less steps refuse
settings; ParseDefinition runs the factories, so the save refuses them.

Closes: archie-core-8b5nk

* fix(postgres): keep a stored capture when its prune fails

InsertCapture committed the capture, then returned the prune's error, so
intake answered 500 and a sender without a delivery header retried into
a duplicate capture and a duplicate dispatch. A failed prune is now
logged and the stored capture's id returned.

Closes: archie-core-3miuh

* fix(crondelivery): fail and advance a job no runner can deliver

Router.Run returned nil for a kind with no runner, so the engine reported
a successful run while the schedule never advanced and the job fired on
every tick. The run now fails with the refusal, which the engine reports,
and the schedule advances (a one-shot is removed). The router's own
refusal event is gone with it.

Closes: archie-core-s6ahh

* fix(taskactions): stop the runs of cancelled callees

CancelExecution cancelled a caller's waited-on callees in the store, but
only the caller's run was stopped, so callee containers ran to the end.
CancelExecution now returns the callees it cancelled (nested included)
in place of the step ids nobody read, and every cancelling action stops
their runs too.

Closes: archie-core-9labz

* fix(workflow): treat a zero json.Number as false in when

Task inputs and step results decode numbers as json.Number, which truthy
did not unpack, so when: inputs.count held for a count of 0.

Closes: archie-core-uv270

* fix(webui): read a workflow's runs with a workflow-filtered page

The workflows page and the canvas run picker filtered the newest 100
tasks of every workflow client-side, so on a busy instance a workflow's
older runs were invisible. GET /api/tasks takes a workflow filter, carried
through the State Store's Tasks request to the query, and both views ask
for the selected workflow's runs.

Closes: archie-core-tpiw1

* fix(ui): load the restored workflow into the editor

Restore Defaults saved the shipped definition but left the open draft in
the editor, still marked unsaved, so a later save re-applied it. The
editor now reloads the restored definition.

Closes: archie-core-85e7w
2026-10-12 03:20:00 +11:00
sam aea7c5c9f1 build(tools): provision PostgreSQL 18 in the cloud setup for full checks 2026-10-12 03:00:46 +11:00
sam c792c552cf build(tools): link cloud setup tools onto the default PATH 2026-10-12 02:44:11 +11:00
sam a71f1e0817 ci: drop the Postgres client from the deploy gate 2026-10-12 02:19:51 +11:00
sam 76905c8ec6 ci: run every job on the self-hosted runner 2026-10-12 02:10:14 +11:00
sam 85d8b771f0 Merge pull request #1602 from samcharles93/feat/workflow-runs-as
Feat/workflow runs as
2026-10-12 02:08:30 +11:00
sam d31a950daa feat(workflow): shipped workflows run as the instance root 2026-10-12 01:53:55 +11:00
sam f765e23812 feat(daemon): run each workflow as its declared identity
Every attempt checks that the identity that started the task and the
identity the workflow declares may both run it, recording a denial for
either. A workflow that declares no identity is refused rather than
running as its starter or the root. A workflow.call callee is started by
its caller's declared identity instead of inheriting the caller's row.
The workflow settings panel marks the identity as required and offers
the agent identities.
2026-10-11 14:49:38 +00:00
sam d66dca44e0 Merge pull request #1601 from samcharles93/fix/atomic-dispatch
Fix/atomic dispatch
2026-10-12 01:29:16 +11:00
sam b8f8f9a272 fix(postgres): allocate synthetic issue numbers from a per-repo counter
InsertChatTask and EnqueueCallTask computed MAX(issue_number)+1, so
concurrent inserts in one repository took the same number and the second
failed on the unique key. Both now bump a chat_issue_numbers row, seeded
from the existing maxima, whose row lock serializes allocation.
2026-10-11 14:21:27 +00:00
sam e128f82e11 build(ui): install dashboard deps from the lockfile without rewriting it 2026-10-12 01:21:16 +11:00
sam daab5732e8 fix(daemon): claim binding dispatch and enqueue its task atomically
EnqueueBindingTask now takes the capture and claims the ledger row,
inserts the task, stamps its provenance and links the ledger row in one
State Store transaction. A failure anywhere leaves the delivery
undispatched for the next cycle; a replay or concurrent claim is refused
by the ledger's unique index. SetDispatchTask is removed.
2026-10-11 14:19:43 +00:00
sam eb5703b7dd ci: drop the Postgres client the removed tests needed 2026-10-12 01:17:11 +11:00
sam ce5fc3e226 test(postgres): remove database-backed tests and the testcontainers harness 2026-10-12 01:17:02 +11:00
sam c2a649ded4 docs(agents): forbid database-backed tests 2026-10-12 01:15:19 +11:00
sam 1b0a89ca2e fix(tools): keep bd hook setup out of the checkout 2026-10-12 01:14:38 +11:00
sam 1441585e06 chore: reindent beads config and add agent profile 2026-10-12 01:01:19 +11:00
sam f3576342b6 chore(tools): rely on preinstalled gh in cloud setup 2026-10-12 00:46:51 +11:00
sam ede2102c60 chore(tools): install gh in cloud setup 2026-10-12 00:43:37 +11:00
sam 16d98dd47c chore(tools): install bd via upstream installer and disable attribution in cloud setup 2026-10-12 00:41:07 +11:00
sam 7aca31b18f chore(tools): add Claude cloud environment setup script 2026-10-12 00:12:18 +11:00
sam e97f1fa609 fix(ci): limit gate concurrency to runner memory 2026-10-11 22:28:11 +11:00
sam 62f0baba36 fix(ci): use repository-scoped quality runner 2026-10-11 22:10:52 +11:00
sam 40fa6f9d7d fix(ci): check namespace support before installing tools 2026-10-11 21:33:56 +11:00
sam 6ce605d6ea fix(ci): allow extension namespaces in quality container 2026-10-11 21:30:43 +11:00
sam feba855326 style(ui): tidy org page layouts and empty states
Members and Workspaces get fixed column widths and their add forms move
into labelled sections. Agents lists agents first and moves credential
grants below. Access puts New policy in the card header. Tokens states
when none exist.
2026-10-11 15:59:30 +11:00
sam 47f75f71a7 docs: remove incorrect notice 2026-10-11 12:17:31 +11:00
sam 4e060ce5ef fix(ui): stage history restore as a draft applied from the save bar 2026-10-11 11:35:02 +11:00
sam e2e24f9d56 ci(deploy): pull the container image the uncached test suite needs
deploy / gate (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
2026-10-11 04:26:08 +11:00
sam 5aa5c2a6c8 chore(release): v1.53.0 2026-10-11 04:23:10 +11:00
sam 41b2daed0c Merge branch 'work/53jc' 2026-10-11 04:11:43 +11:00
sam e0a79b3990 Merge branch 'work/ry4k' 2026-10-11 04:11:43 +11:00
sam e2d6b75b10 fix(prreview): restore the benchmark runner on configured models and public PRs 2026-10-11 04:11:40 +11:00
sam b4be999777 fix(gateway): remove the web /restart command that no process could serve 2026-10-11 04:11:37 +11:00
sam 5c3bf0b642 feat(storepkg): auto-update policy, applied by a State Store ticker 2026-10-11 04:10:53 +11:00
sam be2b897149 refactor(servicediscovery): delete unreachable contract and NATS implementation 2026-10-11 04:09:56 +11:00
sam f5a39cfb9b fix(daemon): bound a package workflow's triggers by its accepted authority 2026-10-11 04:08:02 +11:00
sam f5a6fa5b32 fix(postgres): number the outcome-posted migration after package updates 2026-10-11 04:04:45 +11:00
sam 93ec6d916b Merge branch 'work/mt9xo' 2026-10-11 04:03:52 +11:00
sam c36fb29683 Merge branch 'work/zcg8' 2026-10-11 04:03:52 +11:00
sam cac0f43b58 Merge branch 'work/mqti13'
# Conflicts:
#	internal/contracts/state/v1/state.pb.go
2026-10-11 04:03:52 +11:00
sam 805364f201 feat(archied): post a chat task's outcome back to its chat 2026-10-11 04:03:30 +11:00
sam 3b2a3a7630 fix(webui): the setup checklist and skill catalogue are system-org only 2026-10-11 04:01:46 +11:00
sam bf29d3640e fix(daemon): reown worktrees a killed container left root-owned 2026-10-11 04:01:19 +11:00
sam de15bffc2f fix(telegram): publish /approve, which the router already serves 2026-10-11 03:57:10 +11:00
sam 1377e7ebf2 feat(webui): add a member by provider subject or email
POST /api/orgs/{id}/members binds a person by subject, or by email as a
placeholder. The first sign-in whose provider vouches for that email
claims it: the State Store moves the binding onto the provider's subject
in one statement, so a second account with the same address finds
nothing to claim and later sign-ins rest on the subject alone.
2026-10-11 03:54:49 +11:00
sam d53ebbda95 fix(daemon): last poll reports the least recently polled loop 2026-10-11 03:53:11 +11:00
sam b227df3c3f feat(storepkg): widening updates wait for approval, rollback restores the previous pin 2026-10-11 03:48:31 +11:00
sam a3e0e5c1bb fix(daemon): bound a package workflow's tools by its accepted authority 2026-10-11 03:48:31 +11:00
sam 116f8a10fb style(webui): rewrap the assets comment 2026-10-11 03:48:17 +11:00
sam 116b03534f fix(staterpc): a task's own credential cannot replace its workflow pin
The pinned definition carries the package a run's authority is read
from. A task-scoped Update now reaches the store without a definition,
and UpdateTask keeps the stored pin when none is sent; the workflow name
still moves for handoffs and the daemon re-pins it.
2026-10-11 03:47:17 +11:00
sam b697a12b89 fix(webui): an unserved /api path is a 404, not the dashboard page 2026-10-11 03:46:40 +11:00
sam 7b64699ff1 refactor(workflow): delete routing overrides nothing applied 2026-10-11 03:43:25 +11:00
sam 1598b3cc74 docs(agents): extend the finish-and-shrink rule to 2026-10-20 2026-10-11 03:39:31 +11:00
sam 212742e880 feat(forgerpc): bound a package workflow's forge calls by its accepted authority 2026-10-11 03:37:16 +11:00
sam 6693e60f6f fix(access): an unloaded chain is a refusing engine, not nil
Webhook intake answers 503 and counts no refusal while the chain loads.
The readiness probe reads the chain on every check. The UI never exits on
a first-load failure. An invalid instance policy closes the instance but
lets an instance admin repair policies. Outage pages are 503, and the
health detail names the unloaded chain.
2026-10-10 22:19:02 +11:00
sam c097e50405 fix(archieui): warn when the dashboard is reachable off-host over plain HTTP
The dashboard serves plain HTTP, so a non-loopback bind carries the
session cookie and provider token in clear unless TLS terminates in front.
Warn at startup unless the operator declares a proxy with
[web].trust_forwarded_headers, and record the choice in deployments/README
where the dashboard is deployed. Point the non-loopback token error at
that surviving doc, not the deleted UI-boundary PRD.
2026-10-10 22:09:05 +11:00
sam ccbc9c7844 fix(webui): the wildcard listen address is not loopback
IsLoopback(":8484") returned true: the empty host fell through the
switch as loopback, so a wildcard bind skipped the non-loopback token
requirement and served every interface unauthenticated. An empty host is
the wildcard, not loopback.
2026-10-10 22:09:05 +11:00
sam 948a8d34fd test(worktree): give each transport its own branch
The four subtests share one bare repo but pushed the same feat/1-test
branch. Their commits have the same tree, message, author and parent, so
two commits in the same second hash identically and the second push is a
no-op -- passing by luck -- while a second of clock drift makes it a
non-fast-forward failure. One issue per subtest gives each its own branch.
2026-10-10 22:05:22 +11:00
sam e078b5c4bc fix(webui): refuse API requests until the access chain loads
A State Store that was unreachable at startup left the access chain nil,
and authorize treated nil as no chain at all: every request passed the
credential check, no principal or org reached the context, the State Store
defaulted each call to org-sys, and the instance-only surfaces were served.
The dashboard stayed open until a restart.

Build a chain with no engine when the first load is Unavailable; it refuses
every request with 503 (or the notice page for a browser) until the first
load succeeds, and Run keeps retrying so the dashboard recovers without a
restart. A denial is not recorded, because nothing was evaluated.
2026-10-10 21:55:02 +11:00
sam 4a24c0b31f fix(memory): each org's agent memory is its own 2026-10-10 21:20:37 +11:00
sam e988d3cc40 fix: close cross-org writes and move existing rows into their owner's org 2026-10-10 20:31:54 +11:00
sam cd20aeadad fix(webui): instance health, logs, config and identities are system-org only 2026-10-10 20:20:07 +11:00
sam 1bb7ba1248 fix(postgres): tasks, events, steps and run stats stay in their org 2026-10-10 20:18:29 +11:00
sam fdafec3d9d fix(postgres): event sources, types, mappings and bindings stay in their org 2026-10-10 20:14:23 +11:00
sam 0fcf792db3 feat(gateway): chat sessions belong to one org
Sessions carry an org; listing, reading and writing a session, its
messages and its turns are limited to the caller's org. Another org's
session reads as not found and cannot be overwritten or appended to.
Sessions from before orgs belong to the system org.
2026-10-10 18:57:26 +11:00
sam 9cd52dd9aa feat(archiegateway): chat resolves models in the caller's org and bills it
The State Store answers the calling principal's org aliases
(CallerModels) and bills chat usage to that org; usage records no longer
carry a caller-named org. Chat lists and resolves aliases for the
caller's org and fails rather than substitute one it may not use.
2026-10-10 18:53:57 +11:00
sam 5290dab199 feat(controlplane): per-org model access, org aliases and org providers
The system org sets each org's allowed models and whether it may add its
own providers (org-model-policy); an org with no entry may use nothing.
An org's aliases and providers are checked against that policy on save
and filtered by it at resolution. Tasks get their org's providers, keyed
by the org's credential binding through the egress proxy. Org Settings
gains a Models tab; instance Models gains Org access.
2026-10-10 18:48:40 +11:00
sam e17c7895e4 feat(daemon): resolve a task's models and credentials in the task's own org
The State Store answers a task's effective model aliases (instance aliases
with the task org's own over them), deriving the org from the task. Model
egress and the run credential resolver use the task's stored org instead
of the identity mapping in config.
2026-10-10 18:40:53 +11:00
sam e4ea2eaabc feat(statestore): record a usage row for every model call
Task agent runs and MCP sampling record against their task (billed to the
task's org); gateway chat turns, titles, sampling and curators record
against the system org. Rows carry source, workflow, step, alias,
provider/model and tokens for later chargeback.
2026-10-10 18:32:43 +11:00
sam 12b9a57404 feat(config): model aliases replace model roles, resolved by one resolver
Agent steps, implement, pr-review, MCP sampling, chat, embedding and
transcription resolve a model alias (empty means the purpose's default)
and fail on an unknown alias instead of falling back. The step editor and
chat pick aliases; workflow definitions naming an unknown alias are
refused on save.
2026-10-10 17:29:52 +11:00
sam 514c6cf61c fix(daemon): keep model provider keys out of agent containers via the egress proxy 2026-10-10 17:12:09 +11:00
sam bef0ecea3a feat(ui): workflow list shows running count and latest run result 2026-10-10 11:50:27 +11:00
sam 5bb5d9b660 feat(ui): quieter workflows page: hover data edges, apply chip, restore behind confirm 2026-10-10 11:49:32 +11:00
sam f30405ea2b fix(ui): input group addon no longer steals clicks from its select 2026-10-10 11:26:42 +11:00
sam f9efae8a5e fix(archiegateway): keep the chat model list non-nil when empty 2026-10-10 11:17:37 +11:00
sam 819cfc655b refactor: slices.Sorted over map keys and one shared IsNil check 2026-10-10 11:14:36 +11:00
sam 5afe5bcf99 refactor: use slices.Index/Delete and slices.Clone for small copies 2026-10-10 11:14:36 +11:00
sam 0c25b2f4a6 refactor(workflow): decodeSettings returns a typed value 2026-10-10 11:14:36 +11:00
sam 252895e01c refactor(staterpc): use mapValues for proto list conversions 2026-10-10 11:05:59 +11:00
sam 3ea49c7e07 refactor(gateway): drop duplicate string arg helpers 2026-10-10 11:05:59 +11:00
sam 66a27bd7ef refactor(controlplane): make layerResource decode into a typed value 2026-10-10 11:05:59 +11:00
sam b070ce4715 refactor(eda): use slices.Sorted over maps.Keys for ordered keys 2026-10-10 11:05:58 +11:00
sam 84b581fde6 refactor(webui): decode JSON request bodies with generic decodeBody 2026-10-10 11:05:58 +11:00
sam af5e11a734 refactor(domain): share one generic lifecycle registry for curators and memory engines 2026-10-10 11:05:58 +11:00
sam 522ced45ff feat(ui): lanes for parallel and switch steps on the workflow canvas 2026-10-10 10:52:52 +11:00
sam 79d7f2fa68 feat(workflow): switch step runs the case matching a reference 2026-10-10 10:52:52 +11:00
sam eb3ee14a0e feat(ui): step roles, numbers and run trace on workflow canvas 2026-10-10 10:37:47 +11:00
sam 6ed6b28d02 build(ui): refresh dashboard bundle 2026-10-09 20:06:01 +11:00
sam 2f4e9bbe14 Merge branch 'main' into codex/control-plane-4q28 2026-10-09 20:03:52 +11:00
sam 3057f054b2 style: remove space between icons and labels 2026-10-09 19:56:27 +11:00
sam a4e7ea8cc3 fix(kit): migrate runtime to sandbox kit m8 2026-10-09 18:31:56 +11:00
sam c812192800 feat(ui): author parallel workflow branches on canvas 2026-10-09 18:18:45 +11:00
sam 81121d03b0 docs(agents): omit status the maintainer can already see 2026-10-09 18:16:45 +11:00
sam e5f03587c9 docs(agents): post externally only when told 2026-10-09 18:09:11 +11:00
sam c25e70a588 docs(agents): act on clear direction and keep replies short 2026-10-09 18:04:38 +11:00
sam b97c79aa0b feat(ui): edit workflow call interfaces on the canvas 2026-10-09 18:04:08 +11:00
sam 2d2c39f9e5 fix(daemon): reconcile call waits from durable steps 2026-10-09 17:56:15 +11:00
sam 673a5bc2ce chore(release): v1.52.0
deploy / gate (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
2026-10-09 13:09:59 +11:00
sam df5ee243b1 feat(harness): create the setup PTY at the browser's size
The setup terminal created its PTY at a fixed 24x80 while the browser
measured its own box and threw the measurement away, so a full-screen CLI
login drew into a corner of a much larger xterm.

OpenRequest now carries a ConsoleSize with the target frame; the route
reads cols/rows from the WebSocket URL, falling back to 24x80 when they
are absent or out of range, and the daemon creates the PTY at that
geometry. The component sends the size it measured before connecting.

Live resize is the follow-on: it needs a control channel on the WebSocket,
which today is a raw byte copy.
2026-10-09 13:07:29 +11:00
sam 71fa670512 fix(harness): keep the setup container alive with archie's own binary
A setup session started its container with "sleep infinity" and opened the
PTY with "sh -l". Neither binary is guaranteed: the spec capability whose
floor is a shell and bash is com.docker.sandbox/sbx@1, and archie's
supported map does not list it, so a Kit image need not provide either. A
missing sleep killed the container at start and a missing sh failed the
exec, both as an opaque error.

The container now runs archie-agent hold as its entrypoint. The agent
binary is archie's own and already mounted into every Kit, so the
keepalive needs nothing the image may lack and the container env stays
empty. Before opening the PTY, harnesssession probes for bash then sh and
returns ErrNoShell naming the Kit reference when neither is present.

Test: TestPickShell covers bash-preferred, sh-only, neither, and a probe
that cannot run.
2026-10-09 13:05:05 +11:00
sam d91ab1ab0f fix(channels): normalize stored settings and deduplicate save errors 2026-10-09 13:02:23 +11:00
sam 1eb05f0d24 test(ui): prune brittle checks and document agent rules 2026-10-09 12:51:57 +11:00
sam a49e939609 fix(ui): clean dependencies and add task table sorting 2026-10-09 12:46:05 +11:00
sam e76e2fd317 chore(lint): pin the linter to 2.14.0
The setup task is the only installer, so the pin follows the version in
use rather than holding it back, and CI follows the pin.
2026-10-09 12:32:05 +11:00
sam 2418a81a9e fix(egress): use context-aware dial and request in the token-endpoint test
net.Dial and httptest.NewRequest fail the noctx linter, so the gate was red
on the commit that added the test.
2026-10-09 12:27:45 +11:00
sam c4a441d1c3 chore(task): install the pinned tooling with task setup
task setup installs the golangci-lint CI pins, the protobuf generators and
the dashboard dependencies, and warns by name about the tools it cannot
install (Go, Task, Node, Docker).

The linter version now lives in one file read by both the setup task and
both workflows, so a local checkout and the gate cannot run different
linters.
2026-10-09 12:27:45 +11:00
sam c5c145f325 test(archieui): restore the archie-ui import-boundary check
Only the daemon owns containers, and the dashboard consumes a harness
session over its gRPC contract. Go imports are atomic, so a single
reference relinks a runtime, and the boundary holds only while something
re-measures it. cmd/archie-ui/architecture_test.go enforced this until it
was purged with the test suite; nothing enforced it since.

The restored check runs go list -deps . and fails if the dashboard links
internal/container, internal/app/archied or internal/agentexec. It is
transitive, which is what "links" means, and runs in the existing test
step.
2026-10-09 11:42:39 +11:00
sam 3683ce9082 fix(egress): refuse a token endpoint the run is not granted
forward intercepted a declared OAuth credential's token endpoint only when
the run was granted the service. For an optional credential it fell
through to the reverse proxy, so the provider's real access and refresh
tokens reached the container un-sentinelized, contradicting the harness
contract's "the real credential never enters the container".

A matched token endpoint is now refused when the service is not granted
(403 for an optional credential; a required one keeps its existing 502).
The table test drives forward against a recording upstream and asserts
both the status and that the upstream was never contacted.
2026-10-09 11:42:39 +11:00
sam 80dc6ec8d0 fix(deps): pin sandbox-kit-spec to the API the code is written against
The dependency bump moved sandbox-kit-spec from v3.0.0-m.6 to m.8 without
adapting the code, so the tree no longer builds: CredentialCapability.Phase
is now spec.Phases, not a string (internal/infrastructure/egress), and
Client.Assemble became a package-level fetch.Assemble that takes a Loader
and a LayerValidator instead of spec.MergeOptions (internal/infrastructure/
kitrun).

Migrating to m.8 is not a version-string change: m.8 pushes kit integrity,
safe layer extraction and resource limits onto the caller, so it is
security-relevant work, not an unblock. Pin back to m.6, which the code is
written against, and leave the migration to a deliberate change.

Verified: go build ./..., go vet ./..., go test -short ./... all pass with
this pin. The gate's ui:check and lint steps fail for unrelated
toolchain reasons recorded separately.
2026-10-09 11:42:33 +11:00
sam 12d6585586 ```
chore: update ui dependencies
```
2026-10-09 11:27:48 +11:00
sam 53916b0f96 chore: bump Go dependencies and toolchain 2026-10-09 11:23:04 +11:00
sam badbbf84bd fix(config): normalize default org for harness credentials 2026-10-09 10:01:35 +11:00
sam d98352d003 feat(settings): classify startup and live runtime settings 2026-10-09 09:57:57 +11:00
sam 542bd88040 feat(logging): aggregate recent service logs in dashboard 2026-10-09 09:57:57 +11:00
sam 81384939a2 fix(gateway): attribute chat settings to signed-in users 2026-10-09 09:57:57 +11:00
sam c8ed5619c6 fix(webui): explain personal token availability 2026-10-09 09:57:57 +11:00
sam 3b79155602 refactor(webui): remove unused configuration schema 2026-10-09 09:57:57 +11:00
sam 552ee93a47 fix(settings): show configuration reload failures 2026-10-09 09:57:57 +11:00
sam 7bf429b599 fix(gateway): read task logs through state store 2026-10-09 09:57:57 +11:00
sam 0792f0ba84 fix(ui): render unknown routes and correct status description 2026-10-09 09:57:56 +11:00
sam 02ab747ca9 fix(configuration): reject unknown conf.d files 2026-10-09 09:57:56 +11:00
sam c53a98ee87 feat(curators): edit and apply definitions live 2026-10-09 09:57:56 +11:00
sam 1e4aa8badc feat(settings): edit profiles bindings and playbooks 2026-10-09 09:57:56 +11:00
sam 1e76c99b48 feat(settings): show resource consumers and apply status 2026-10-09 09:57:56 +11:00
sam ff9b6c7196 feat(presence): report workers and broker on status 2026-10-09 09:57:56 +11:00
sam 7680dc5079 feat(presence): expose service dependency checks 2026-10-09 09:57:56 +11:00
sam d0370ed9f7 fix(daemon): inherit live settings for identity tasks 2026-10-09 09:57:56 +11:00
sam 7e3b3dbd78 test: verify enablement reports channel running 2026-10-09 02:24:47 +11:00
sam 6b71dc8108 fix(workflow): enforce optional result booleans only when required 2026-10-09 02:22:19 +11:00
sam 307f2fc9e2 fix(messaging): refuse failed channels as enablement success 2026-10-09 02:22:19 +11:00
sam 455de3d799 fix(workflow): retry a transient read while awaiting a callee 2026-10-09 02:21:49 +11:00
sam 4e74ed37b4 fix(workflow): preserve a reference's type between steps 2026-10-09 02:10:43 +11:00
sam 7ef58293be feat(harness): serve a daemon-side setup session to the dashboard
The dashboard's setup terminal was a 503: it had a WebSocket route, an
authorizer and an xterm.js surface, but nothing owned a container. The
daemon owns containers, so the session contract lands there and the
dashboard consumes it over a new gRPC contract.

One session concept, two targets. A setup session is addressed by Kit
profile and is ephemeral; a run session (archie-core-qi91) is addressed by
task and attempt and is bounded by the task. This slice serves setup and
answers Unimplemented for run.

The contract, the authorisation, the lifetime and the egress phase are
settled in docs/prds/external-agent-harness.md, "Session contract". The
short version: the daemon serves harness.v1.HarnessService; the dashboard
authorizes the operator as an update on the secret and then dials the
daemon with the harness service token, required even on loopback because a
session is a shell holding an org's credential; the setup container runs
no worker, mounts no worktree, holds a keepalive, and carries an empty
container environment. Install hooks run at the install phase and the
session enters runtime before the shell, so a runtime-phase credential's
token endpoint is the one the proxy intercepts.

Capture is gated by the egress proxy on a granted service, and a setup
session has no task, so the daemon registers a session grant: the
session's proxy token resolves to the org's bindings for the Kit's
declared services. The real token never enters the container: the token
endpoint response is sentinelized and stored as the org's harness secret.

Every teardown path releases the pool slot, revokes the egress session and
the grant, removes the sandbox network, and removes the session's volumes.
The listener requires HARNESS_TOKEN and stops with a 10s grace before
Stop, so an open session cannot hold shutdown to the watchdog leash.
2026-10-09 01:38:41 +11:00
sam 27c9647a13 fix(container): reap orphaned processes in Kit containers 2026-10-09 01:37:57 +11:00
sam 89541eb3b0 chore(lint): drop nolint directives that suppress nothing
29 of 59 directives did nothing. Removing each one individually and
re-running the gate revealed no issue from any of them: 20 named gosec,
which is not enabled in .golangci.yml and never has been, plus 4 nilerr
in functions that return no error, 2 dupl where dupl reports nothing
repo-wide, and one each of contextcheck, nestif and unused. The funlen
name on settings.go:147 is gone for the same reason; its gocyclo and
cyclop names are both live.

The unused directive in webui/authorize.go sat on `var _ = slog.Default`,
a statement that only existed to keep the log/slog import alive. Both go.

The 30 remaining directives all suppress a real issue.
2026-10-08 23:29:19 +11:00
sam 3a3a714cc4 fix(modelcatalog): never serve a disabled provider from the ambient key
disableProvider already cleared a failed provider's credential, but that
made it indistinguishable from a provider nobody configured, so
usableProvider fell back to the catalog's ambient env var (e.g.
OPENAI_API_KEY) and sent turns with a key the operator did not choose.
Mark the provider Disabled when its key fails to resolve, refuse it in
usableProvider, and carry the flag through mergeProviders so a catalog
refresh cannot resurrect it.
2026-10-08 22:59:23 +11:00
sam b107e4452a fix(webui): keep the dashboard token out of the startup log
DashboardURL no longer takes a token, so the startup line cannot embed
?t=<token> in the printed URL. The log now names the token file instead.
2026-10-08 22:57:28 +11:00
sam 2b514cb526 feat(scheduling): refuse a job payload that names a dangerous command
A scheduled job runs unattended, so a payload that restarts the daemon,
formats a disk or powers the machine down is refused when the job is
created rather than when it fires. scheduling.RefuseDangerousJob is the
one rule every creation path reaches: the dashboard, any control-plane
client and the config seed all replace the schedules document through the
same validator, so a new token is added in one place.
2026-10-08 22:45:28 +11:00
sam 630c30de79 fix(archiemessaging): apply channel enablement live 2026-10-08 22:44:15 +11:00
sam a69b3455d3 refactor(tools): back generate_video with ai-sdk's minimax video provider
Delete the hand-rolled MiniMax HTTP/poll client; ai-sdk v0.1.43 already
ships provider/minimax implementing video.Provider with the same endpoints,
defaults and poll semantics. The tool now takes a video.Provider and the
composition root builds it, matching the transcription and embedding
capabilities.
2026-10-08 22:42:49 +11:00
sam ddf8383784 fix(archiemessaging): recover a channel that fails on its own 2026-10-08 22:36:09 +11:00
sam c1bbeba18f fix(archied): wait for in-flight tasks on a single-cycle run
A drain pass no longer waits for the tasks it submitted, so -once (the
systemd timer and test invocation) returned while their containers were
still running and the process then tore them down. Wait for the pass's
tasks here, restoring what the flag means.
2026-10-08 22:31:07 +11:00
sam 1f99fb592e fix(daemon): let a run waiting on a callee release its capacity
A wait:true workflow.call run held its global slot and its repo's place for
the callee's whole life, and the drain pass waited for its own tasks, so a
callee queued by that pass was never claimed. With containers.max_concurrency
saturated, or a repo that does not allow concurrency, the wait could not end.

A drain pass now returns once the stream and the claim fallback are empty, and
shutdown waits for in-flight work once. Suspend/Resume give a run's slot and
repo place back while it waits on a callee, driven by the workflow call events
on the daemon's bus; a hold records one slot and one place, so a second
re-acquire gives back what it took.
2026-10-08 22:31:07 +11:00
sam aae01431b4 refactor(workflow): keep the call key change inside the lint gate
golangci-lint failed on the change and had not before: gofumpt wants
StartCall's same-typed parameters grouped, and runWorkflowCall reached a
cyclomatic complexity of 16. The unwaited call's early close moves into
closeUnwaitedCall on *TaskContext -- it needs only the call step, the
callee and the settings -- which leaves runWorkflowCall below the limit
with its behaviour unchanged.

The walk's id-less call case is deleted: ParseDefinition now refuses that
definition before validateWorkflowCalls runs, so it passed for the wrong
reason. The refusal is pinned where it happens instead, by the compile
case in TestWorkflowCallKeyIsTheDeclaredPath, now asserting the whole
message so it still names the step it refused.
2026-10-08 22:31:07 +11:00
sam 3c99f69fee fix(workflow): key a call on its callee, and free a terminal child's key
A call's key was the step's declared path alone, so one task running a
second definition at a colliding path -- workflow.handoff, human.approve
and a definition re-pin all change it -- was handed the first callee's
child, waited on the wrong workflow and published its outputs. The key
now carries the callee too, while the step row and the call's events stay
named and staged for the call site, so a rail pairing an event with its
step still attaches them.

A child that reached dead or closed_wont_do can never do the work and
holds no result the caller can use, so it leaves the call key's index and
frees the key for the caller's retry to start a fresh child. parked and
rejected keep theirs: a parked child is recoverable by retrying it, and a
rejected child ran.

The id a call step must declare is now refused where the definition is
compiled, which is also the path a pinned definition takes, so an id that
spells a step type is accepted again and no stage needs a heuristic.
2026-10-08 22:31:07 +11:00
sam b7fd13923a fix(workflow): key a workflow.call on its declared step path
A call site had no durable identity, so any retry of it -- a lost
EnqueueCallTask reply, a failed call-step record, a requeued attempt that
re-runs the stage -- started a second child and its work happened twice.

The call step's declared path within the run is that identity: wrapStep
sets it (branch-qualified, restored on return), a workflow.call step must
declare an id so two call sites cannot share one, and the key crosses
EnqueueCallTaskRequest.call_key into tasks.call_key, which EnqueueCallTask
upserts on so the retry returns the child already started.
2026-10-08 22:31:07 +11:00
sam 0a47a95cc3 fix(agentexec): enforce capture tool result schemas 2026-10-08 22:30:12 +11:00
sam ef8d9af469 fix(workflow): apply step retry and on_failure to command.run 2026-10-08 22:22:13 +11:00
sam 549f36a1f2 fix(ui): stop the command palette scrolling sideways 2026-10-08 21:58:22 +11:00
sam 187e6e81ee fix(ui): anchor the command palette and stop scroll stealing its highlight 2026-10-08 21:57:20 +11:00
sam e60ad551f0 fix(webhook): authorize delivery against the source's org 2026-10-08 21:43:28 +11:00
sam a0617ad437 test(postgres): derive the org fixture source from its insert 2026-10-08 21:40:24 +11:00
sam 411736fdaa fix(captures): keep count-retention inside the inserted capture's org 2026-10-08 21:27:54 +11:00
sam bea6567933 fix(captures): scope the capture list to the acting org 2026-10-08 21:26:07 +11:00
sam d6b693a9b2 fix(sources): store the acting org on source creation 2026-10-08 21:25:49 +11:00
sam b8bedf4d7b fix(capture): inherit source org on ingestion 2026-10-08 21:02:21 +11:00
sam 5c53dfb91b fix(workflow): resolve definitions in the owning org 2026-10-08 20:41:08 +11:00
sam e0cbbc0895 chore(release): v1.51.1
deploy / gate (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
2026-10-08 01:42:29 +11:00
sam 40dd546564 fix(release): a dependency bump is releasable for every binary 2026-10-08 01:42:27 +11:00
sam b89d8cbab2 fix(deps): ai-sdk v0.1.43 sends gpt-6 tool calls through the Responses API 2026-10-08 01:41:44 +11:00
1685 changed files with 128177 additions and 67738 deletions

No files matched your search

-89
View File
@@ -1,89 +0,0 @@
# Dolt database (managed by Dolt, not git)
dolt/
embeddeddolt/
proxieddb/
# Runtime files
bd.sock
bd.sock.startlock
sync-state.json
last-touched
.exclusive-lock
# Daemon runtime (lock, log, pid)
daemon.*
# Push state (runtime, per-machine)
push-state.json
# Lock files (various runtime locks)
*.lock
# Credential key (encryption key for federation peer auth — never commit)
.beads-credential-key
# Local version tracking (prevents upgrade notification spam after git ops)
.local_version
proxied_server_client_info.json
# Worktree redirect file (contains relative path to main repo's .beads/)
# Must not be committed as paths would be wrong in other clones
redirect
# Sync state (local-only, per-machine)
# These files are machine-specific and should not be shared across clones
.sync.lock
# Workspace operation gate (internal/workspacegate): physical-root gate
# files live beside the guarded root inside .beads (e.g. dolt.gate.lock)
*.gate.lock*
export-state/
export-state.json
last_pull
# Ephemeral store (SQLite - wisps/molecules, intentionally not versioned)
ephemeral.sqlite3
ephemeral.sqlite3-journal
ephemeral.sqlite3-wal
ephemeral.sqlite3-shm
# Dolt server management (auto-started by bd)
dolt-server.pid
dolt-server.log
dolt-server.lock
dolt-server.port
dolt-server.activity
# Debug-mode pprof artifacts (written when dolt.debug: true in config.yaml)
dolt-pprof/
# Corrupt backup directories (created by bd doctor --fix recovery)
*.corrupt.backup/
# issues.jsonl is deliberately TRACKED (see export.git-add in config.yaml).
# Dolt remains the authoritative store and GitHub the external issue surface;
# the tracked export exists so issue state is readable and recoverable from a
# plain git clone, without a Dolt server. Removing it from this file is what
# tracks it -- do NOT add a "!issues.jsonl" negation, which would override the
# fork protection in .git/info/exclude (see the note at the end of this file).
#
# Backups stay local: they are point-in-time copies of the same data.
backup/
# Per-project environment file (Dolt connection config, GH#2520)
.env
# Legacy files (from pre-Dolt versions)
*.db
*.db?*
*.db-journal
*.db-wal
*.db-shm
db.sqlite
bd.db
# NOTE: Do NOT add negation patterns here.
# They would override fork protection in .git/info/exclude.
# Config files (metadata.json, config.yaml) are tracked by git by default
# since no pattern above ignores them.
# config.yaml
-85
View File
@@ -1,85 +0,0 @@
# Beads - AI-Native Issue Tracking
Welcome to Beads! This repository uses **Beads** for issue tracking - a modern, AI-native tool designed to live directly in your codebase alongside your code.
## What is Beads?
Beads is issue tracking that lives in your repo, making it perfect for AI coding agents and developers who want their issues close to their code. No web UI required - everything works through the CLI and integrates seamlessly with git.
**Learn more:** [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
## Quick Start
### Essential Commands
```bash
# Create new issues
bd create "Add user authentication"
# View all issues
bd list
# View issue details
bd show <issue-id>
# Update issue status
bd update <issue-id> --claim
bd update <issue-id> --status done
# Sync with Dolt remote
bd dolt push
```
### Working with Issues
Issues in Beads are:
- **Git-native**: Stored in Dolt database with version control and branching
- **AI-friendly**: CLI-first design works perfectly with AI coding agents
- **Branch-aware**: Issues can follow your branch workflow
- **Sync-ready**: Uses Dolt remotes for backup and team sharing
## Why Beads?
✨ **AI-Native Design**
- Built specifically for AI-assisted development workflows
- CLI-first interface works seamlessly with AI coding agents
- No context switching to web UIs
🚀 **Developer Focused**
- Issues live in your repo, right next to your code
- Works offline, syncs when you push
- Fast, lightweight, and stays out of your way
🔧 **Git Integration**
- Dolt-native sync via bd dolt push / bd dolt pull
- Branch-aware issue tracking
- Dolt-native three-way merge resolution
## Get Started with Beads
Try Beads in your own projects:
```bash
# Install Beads
curl -sSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
# Initialize in your repo
bd init
# Create your first issue
bd create "Try out Beads"
```
## Learn More
- **Documentation**: [github.com/steveyegge/beads/docs](https://github.com/steveyegge/beads/tree/main/docs)
- **Quick Start Guide**: Run `bd quickstart`
- **Examples**: [github.com/steveyegge/beads/examples](https://github.com/steveyegge/beads/tree/main/examples)
---
_Beads: Issue tracking that moves at the speed of thought_ ⚡
-80
View File
@@ -1,80 +0,0 @@
# Beads Configuration File
# This file configures default behavior for all bd commands in this repository
# All settings can also be set via environment variables (BD_* prefix)
# or overridden with command-line flags
# Issue prefix for this repository (used by bd init)
# If not set, bd init will auto-detect from directory name
# Example: issue-prefix: "myproject" creates issues like "myproject-1", "myproject-2", etc.
# issue-prefix: ""
# Use no-db mode: JSONL-only, no Dolt database
# When true, .beads/issues.jsonl is the only local store
# no-db: false
# Enable JSON output by default
# json: false
# Feedback title formatting for mutating commands (create/update/close/dep/edit)
# 0 = hide titles, N > 0 = truncate to N characters
# output:
# title-length: 255
# Default actor for audit trails (overridden by BEADS_ACTOR or --actor)
# actor: ""
# Optional JSONL sidecar for explicit agent/tool interaction audit records.
# Issue history is always recorded in the database and is visible with
# bd history <id> --events; this only controls .beads/interactions.jsonl.
# audit:
# enabled: false
# Export events (audit trail) to .beads/events.jsonl on each flush/sync
# When enabled, new events are appended incrementally using a high-water mark.
# Use 'bd export --events' to trigger manually regardless of this setting.
# events-export: false
# Multi-repo configuration (experimental - bd-307)
# Allows hydrating from multiple repositories and routing writes to the correct database
# repos:
# primary: "." # Primary repo (where this database lives)
# additional: # Additional repos to hydrate from (read-only)
# - ~/beads-planning # Personal planning repo
# - ~/work-planning # Work planning repo
# Dolt-native backup (periodic backup for off-machine recovery)
# This is full database backup only. Cross-machine sync uses Dolt remotes.
# backup:
# enabled: false # Disable auto-backup entirely
# interval: 15m # Minimum time between auto-backups
# git-push: false # Disable git push (backup locally only)
# git-repo: "" # Separate git repo for backups (default: project repo)
# Optional JSONL auto-export for viewers, interchange, and issue-level migration.
# Disabled by default; enable only when an integration needs fresh .beads/issues.jsonl.
# Use relative paths under .beads/ for JSONL import/export filenames.
export:
auto: false
path: issues.jsonl
interval: 60s
# issues.jsonl/interactions.jsonl are .gitignore'd local-only files --
# Dolt (synced via sync.remote) is the source of truth. Leave auto off
# and git-add off; do not re-track these in git.
git-add: false
import:
path: issues.jsonl
# Integration settings (access with 'bd config get/set')
# Non-secret keys (stored in the database):
# - jira.url, jira.project
# - linear.team_id
# - github.org, github.repo
#
# Secret keys (stored in this file but prefer env vars to avoid git exposure):
# - linear.api_key → use LINEAR_API_KEY env var instead
# - github.token → use GITHUB_TOKEN env var instead
sync.remote: "git+https://github.com/samcharles93/archie-core.git"
dolt:
shared-server: false
auto-commit: "on"
audit:
enabled: true
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
_bd_used_perl=0
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run post-checkout "$@"
_bd_exit=$?
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout "$_bd_timeout" bd hooks run post-checkout "$@"
_bd_exit=$?
elif command -v perl >/dev/null 2>&1; then
_bd_used_perl=1
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run post-checkout "$@"
_bd_exit=$?
else
echo >&2 "beads: hook 'post-checkout' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
bd hooks run post-checkout "$@"
_bd_exit=$?
fi
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
echo >&2 "beads: hook 'post-checkout' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ $_bd_exit -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'post-checkout'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.2.2 ---
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
_bd_used_perl=0
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run post-merge "$@"
_bd_exit=$?
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout "$_bd_timeout" bd hooks run post-merge "$@"
_bd_exit=$?
elif command -v perl >/dev/null 2>&1; then
_bd_used_perl=1
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run post-merge "$@"
_bd_exit=$?
else
echo >&2 "beads: hook 'post-merge' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
bd hooks run post-merge "$@"
_bd_exit=$?
fi
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
echo >&2 "beads: hook 'post-merge' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ $_bd_exit -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'post-merge'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.2.2 ---
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
_bd_used_perl=0
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run pre-commit "$@"
_bd_exit=$?
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout "$_bd_timeout" bd hooks run pre-commit "$@"
_bd_exit=$?
elif command -v perl >/dev/null 2>&1; then
_bd_used_perl=1
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run pre-commit "$@"
_bd_exit=$?
else
echo >&2 "beads: hook 'pre-commit' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
bd hooks run pre-commit "$@"
_bd_exit=$?
fi
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
echo >&2 "beads: hook 'pre-commit' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ $_bd_exit -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'pre-commit'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.2.2 ---
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
_bd_used_perl=0
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run pre-push "$@"
_bd_exit=$?
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout "$_bd_timeout" bd hooks run pre-push "$@"
_bd_exit=$?
elif command -v perl >/dev/null 2>&1; then
_bd_used_perl=1
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run pre-push "$@"
_bd_exit=$?
else
echo >&2 "beads: hook 'pre-push' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
bd hooks run pre-push "$@"
_bd_exit=$?
fi
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
echo >&2 "beads: hook 'pre-push' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ $_bd_exit -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'pre-push'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.2.2 ---
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
_bd_used_perl=0
if command -v timeout >/dev/null 2>&1; then
timeout "$_bd_timeout" bd hooks run prepare-commit-msg "$@"
_bd_exit=$?
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout "$_bd_timeout" bd hooks run prepare-commit-msg "$@"
_bd_exit=$?
elif command -v perl >/dev/null 2>&1; then
_bd_used_perl=1
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run prepare-commit-msg "$@"
_bd_exit=$?
else
echo >&2 "beads: hook 'prepare-commit-msg' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
bd hooks run prepare-commit-msg "$@"
_bd_exit=$?
fi
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
echo >&2 "beads: hook 'prepare-commit-msg' timed out after ${_bd_timeout}s — continuing without beads"
_bd_exit=0
fi
if [ $_bd_exit -eq 3 ]; then
echo >&2 "beads: database not initialized — skipping hook 'prepare-commit-msg'"
_bd_exit=0
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.2.2 ---
-8
View File
@@ -1,8 +0,0 @@
{
"database": "dolt",
"backend": "dolt",
"dolt_mode": "embedded",
"dolt_database": "archie_core",
"project_id": "e8a66150-1f5f-42d2-8653-dcf8463cef74",
"last_bd_version": "1.2.2"
}
+6 -1
View File
@@ -10,7 +10,12 @@
bin/
dist/
docs/
node_modules/
tmp/
.playwright-mcp/
# A trailing-slash pattern matches only the context root, so this is written to
# match a node_modules at any depth: ui/node_modules alone is 200MB and the
# agent image compiles Go, which needs none of it.
**/node_modules/
# Stray host-built binaries committed at the repo root.
/archied
+53
View File
@@ -0,0 +1,53 @@
# Every 15 minutes, checks how the newest release on the `next` channel is
# running on the canary host. If a hard check fails, the canary goes back to
# the stable release straight away. If the release stays healthy for 24 hours,
# 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 }}
run: |
"$RUNNER_TEMP/archied" release canary check -dashboard "${{ vars.CANARY_URL }}" \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
+143 -156
View File
@@ -1,12 +1,13 @@
# Builds and pushes the archied and archie-agent images to GHCR on every
# merge to main. Mirrors .gitea/workflows/deploy.yml, which remains the
# production build path against git.catlow.cloud until that's cut over.
# 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: ["archied/v*", "archie/v*", "v*"]
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,
@@ -30,7 +31,7 @@ permissions:
jobs:
gate:
runs-on: ubuntu-latest
runs-on: self-hosted
outputs:
archied_version: ${{ steps.release_tag.outputs.archied_version }}
steps:
@@ -46,7 +47,7 @@ jobs:
- name: Resolve archied tag at HEAD
id: release_tag
run: |
version="$(git tag --points-at HEAD --list 'archied/v*' --list 'v*' | sed -e 's|^archied/v||' -e 's|^v||' | sort -V | tail -1)"
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"
@@ -58,6 +59,13 @@ jobs:
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
- uses: pnpm/action-setup@v4
with:
package_json_file: ui/package.json
- name: Set up Node
uses: actions/setup-node@v4
@@ -66,72 +74,45 @@ jobs:
- name: Install quality tools
run: |
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(cat .golangci-version)
go install mvdan.cc/gofumpt@v0.11.0
go install github.com/go-task/task/v3/cmd/task@v3.48.0
- name: Install protobuf tools
run: bash tools/proto.sh install
# The backup/restore tests shell out to pg_dump/pg_restore against a
# postgres:18 testcontainer; the runner's stock client is older and
# refuses the server version.
- name: Install PostgreSQL 18 client
run: |
sudo install -d /usr/share/postgresql-common/pgdg
sudo curl --fail --silent --show-error --location \
https://www.postgresql.org/media/keys/ACCC4CF8.asc \
--output /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc
. /etc/os-release
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt ${VERSION_CODENAME}-pgdg main" \
| sudo tee /etc/apt/sources.list.d/pgdg.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends postgresql-client-18
echo "/usr/lib/postgresql/18/bin" >> $GITHUB_PATH
- name: Ensure contract baseline ref
run: |
if ! git show-ref --verify --quiet refs/heads/main; then
git branch main origin/main
fi
- name: Install ripgrep
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends ripgrep
# 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
# Extensions run in an unprivileged user and network namespace, which
# Ubuntu 24.04 runners forbid through AppArmor by default.
- name: Allow unprivileged user namespaces
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
# 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
run: |
# The formatter sequence has one owner: task fmt, which drives go fix
# to a fixpoint and then the configured lint formatters. This step
# used to inline its own single `go fix ./...`, which leaves the
# redundant loop-variable copy that copyloopvar rejects -- the hazard
# of archie-core-wwho, surfacing here as a spurious git-diff failure
# (archie-core-6kda).
task fmt
task check TEST_FLAGS=-count=1
git diff --exit-code
bash tools/proto.sh lint
bash tools/proto.sh check
go vet ./...
golangci-lint run ./...
go build ./...
go test ./... -count=1
- name: Vulnerability scan
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
# The dashboard suite runs in CI too, or it only ever runs when
# someone remembers to; the Go steps above never touch it.
- name: Dashboard tests
run: |
npm ci --prefix ui || npm install --prefix ui
npm test --prefix ui
- name: Release tags must match changelogs
run: |
set -e
@@ -146,33 +127,21 @@ jobs:
fail=1
}
;;
archied/v* | archie/v*)
# Legacy per-component tags. History is not re-tagged, and the
# merged CHANGELOG.md carries every component's versions, so the
# section is found there rather than in a component file.
ver="${tag#*/v}"
echo " legacy 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. Run: task release:prepare VERSION=<ver>"
echo "edit the generated notes, then: task release VERSION=<ver>"
echo "describe that version. Cut releases with the release workflow."
exit 1
fi
if ! git tag --points-at HEAD | grep -qE '^(v[0-9]|archied/v|archie/v)' ; then
echo "This commit is not a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest release."
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
archied-image:
needs: gate
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -180,11 +149,8 @@ jobs:
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 — measured, 80 of 80
# `archied/v*` and `archie/v*` tags are tag objects — so it names something
# that cannot be checked out. `archied/v1.36.0` is an instance: it points at
# 6720bc42 (a tag object) and dereferences to commit c25f8d39. The producer
# is right to create annotated tags; the consumer stops guessing.
# 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: |
@@ -195,22 +161,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- 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: |
GATEWAY_TAG="$(git tag --points-at HEAD --list 'archied/v*' | sort -V | tail -1)"
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
# One release stream: a `v*` tag covers the whole release, so it names
# both components' versions. Legacy per-component tags still win where
# they exist, because history is not re-tagged.
# 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="${GATEWAY_TAG#archied/}"
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
[ -n "$GATEWAY_VERSION" ] || GATEWAY_VERSION="${RELEASE_TAG#v}"
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION="${RELEASE_TAG#v}"
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
@@ -220,32 +180,24 @@ jobs:
# 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}"
# Keep the raw tag presence separate from the version fallback: a
# LEGACY gateway-only release (archied/v* and no archie/v*) must not
# rebuild the runtime image as dev. A one-stream `v*` release is not
# gateway-only -- one version covers the runtime too -- so it does
# rebuild it, and release_tag is what tells the two apart.
echo "gateway_tag=$GATEWAY_TAG" >> "$GITHUB_OUTPUT"
echo "runtime_tag=$RUNTIME_TAG" >> "$GITHUB_OUTPUT"
echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
echo "gateway=$GATEWAY_VERSION" >> "$GITHUB_OUTPUT"
echo "runtime=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
# :latest names the newest RELEASE, so only a commit that IS one
# publishes it. A push to main publishes :edge (mutable, newest main)
# and sha-<sha> (immutable) instead. That is what stops a release's
# :latest stamping from being overwritten minutes later by the next
# ordinary commit, which left a host reporting dev and made the update
# path unable to tell current from stale (archie-core-i5nb).
# :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 "ghcr.io/samcharles93/archied:latest"
echo "git.catlow.cloud/sam/archied:$RELEASE_TAG"
fi
echo "ghcr.io/samcharles93/archied:edge"
echo "ghcr.io/samcharles93/archied:sha-${{ steps.commit.outputs.sha }}"
echo "git.catlow.cloud/sam/archied:edge"
echo "git.catlow.cloud/sam/archied:sha-${{ steps.commit.outputs.sha }}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
@@ -267,7 +219,7 @@ jobs:
outputs:
agent_digest: ${{ steps.agent.outputs.digest }}
needs: gate
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -285,31 +237,28 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- 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: |
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
RELEASE_TAG="$(git tag --points-at HEAD --list 'v*' | sort -V | tail -1)"
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION="${RELEASE_TAG#v}"
echo "runtime_tag=$RUNTIME_TAG" >> "$GITHUB_OUTPUT"
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.runtime_tag != '' || steps.versions.outputs.release_tag != ''
if: steps.versions.outputs.release_tag != ''
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: |
ghcr.io/samcharles93/archie-agent:latest
ghcr.io/samcharles93/archie-agent:sha-${{ steps.commit.outputs.sha }}
git.catlow.cloud/sam/archie-agent:${{ steps.versions.outputs.release_tag }}
git.catlow.cloud/sam/archie-agent:sha-${{ steps.commit.outputs.sha }}
build-args: |
RUNTIME_VERSION=${{ steps.versions.outputs.runtime }}
cache-from: type=gha,scope=archie-agent
@@ -318,8 +267,10 @@ jobs:
# 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. It waits only for the agent image, whose digest
# release.json pins; archie-agent itself never ships as a host binary.
# 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
@@ -330,11 +281,7 @@ jobs:
# the ref that won the race, and skip only when there is genuinely no
# archied tag at HEAD.
if: needs.gate.outputs.archied_version != ''
runs-on: ubuntu-latest
# Least privilege: the workflow default is contents:read, and only this
# job needs to write, to create the Release and attach the zip to it.
permissions:
contents: write
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -343,6 +290,25 @@ jobs:
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
- uses: pnpm/action-setup@v4
with:
package_json_file: ui/package.json
- 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: Resolve archied version
id: version
@@ -366,9 +332,12 @@ jobs:
# 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 }}"
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
for cmd in $(jq -r '.required_topology.units[]' release.json); do
# 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
@@ -378,56 +347,56 @@ jobs:
set -e
name="archie-core-archied-v${{ steps.version.outputs.version }}-linux-amd64"
mkdir -p "$name"
for cmd in $(jq -r '.required_topology.units[]' release.json); do
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 scripts/archie-update-* "$name/"
digest='${{ needs.agent-image.outputs.agent_digest }}'
test -n "$digest"
jq --arg image "ghcr.io/samcharles93/archie-agent@$digest" '. + {agent_image: $image}' release.json > "$name/release.json"
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"
sha256sum "$name.zip" > SHA256SUMS
echo "name=$name" >> "$GITHUB_OUTPUT"
- name: Upload distribution zip
uses: actions/upload-artifact@v4
with:
name: ${{ steps.zip.outputs.name }}
path: |
${{ steps.zip.outputs.name }}.zip
SHA256SUMS
path: ${{ steps.zip.outputs.name }}.zip
retention-days: 90
# A Release is what an operator can actually download from; the
# artifact above is reachable only from the run's page, behind an
# Actions login, and expires after 90 days. Until this step existed the
# zip was produced and then stranded -- the only Release on this repo
# (archied/v1.22.0) was created by hand and carries no asset at all.
#
# Attached to the release's v* tag, or the archied tag for a release
# cut before the single release stream.
# --generate-notes is deliberately not used: the changelog section is
# the release's own reviewed prose, and the tag/changelog gate above
# already guarantees it describes this version.
- name: Publish GitHub Release with the distribution zip
# 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
- name: Publish the signed release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCHIE_RELEASE_SEED: ${{ secrets.RELEASE_SIGNING_KEY }}
run: |
set -e
version="${{ steps.version.outputs.version }}"
prerelease=false
case "$version" in *-*) prerelease=true ;; esac
./dist/archied release publish -source git.catlow.cloud/sam/archie \
-version "$version" -prerelease="$prerelease" \
-zip "${{ steps.zip.outputs.name }}.zip" \
-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 }}
run: |
set -e
tag="v${{ steps.version.outputs.version }}"
if ! git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null; then
tag="archied/v${{ steps.version.outputs.version }}"
fi
version="${{ steps.version.outputs.version }}"
# The release body is this version's changelog section, not the whole
# file: from its "## [x.y.z]" heading to the next "## [" heading.
# Extracting rather than inlining keeps the changelog the single
# source of truth, and the tag/changelog gate above has already
# proven that section exists.
notes="$(mktemp)"
awk -v hdr="## [$version]" '
index($0, hdr) == 1 { printing = 1 }
@@ -438,15 +407,33 @@ jobs:
echo "no [$version] section extracted from CHANGELOG.md" >&2
exit 1
fi
# Idempotent: --clobber replaces the asset and leaves the notes
# alone, so a re-run of this job (a retried or superseded deploy)
# cannot fail on an existing Release or duplicate the zip.
if gh release view "$tag" >/dev/null 2>&1; then
gh release upload "$tag" "${{ steps.zip.outputs.name }}.zip" SHA256SUMS --clobber
else
gh release create "$tag" \
--title "archied v$version" \
--notes-file "$notes" \
"${{ steps.zip.outputs.name }}.zip" SHA256SUMS
fi
echo "published $tag with ${{ steps.zip.outputs.name }}.zip"
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}')" \
"$api/repos/$repo/releases" >/dev/null
echo "published release notes for $tag"
# The canary host follows the `next` channel. canary.yml then decides
# whether this release is promoted to stable or the canary is rolled back.
- 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 }}
run: |
for name in archied archie-agent archie; do
curl -sS -o /dev/null -X POST -H "Authorization: token $DEPLOY_TOKEN" \
"https://git.catlow.cloud/api/v1/packages/sam/container/$name/-/link/archie" || true
done
+14 -26
View File
@@ -14,47 +14,40 @@ concurrency:
jobs:
check:
runs-on: ubuntu-latest
runs-on: archie-quality
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify extension namespace support
run: |
if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
unshare --user --map-root-user --net true
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: pnpm/action-setup@v4
with:
package_json_file: ui/package.json
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: npm
cache-dependency-path: ui/package-lock.json
- name: Install quality tools
run: |
go install github.com/go-task/task/v3/cmd/task@v3.48.0
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(cat .golangci-version)
go install mvdan.cc/gofumpt@v0.11.0
bash tools/proto.sh install
sudo apt-get update
sudo apt-get install -y --no-install-recommends ripgrep
sudo install -d /usr/share/postgresql-common/pgdg
sudo curl --fail --silent --show-error --location \
https://www.postgresql.org/media/keys/ACCC4CF8.asc \
--output /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc
. /etc/os-release
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt ${VERSION_CODENAME}-pgdg main" \
| sudo tee /etc/apt/sources.list.d/pgdg.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends postgresql-client-18
echo "/usr/lib/postgresql/18/bin" >> $GITHUB_PATH
pg_dump --version
pg_restore --version
- name: Ensure contract baseline ref
run: |
@@ -62,12 +55,7 @@ jobs:
git branch main origin/main
fi
# Extensions run in an unprivileged user and network namespace, which
# Ubuntu 24.04 runners forbid through AppArmor by default.
- name: Allow unprivileged user namespaces
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Run definitive gate
run: |
task check
task --concurrency 1 check
git diff --exit-code
+54
View File
@@ -0,0 +1,54 @@
# 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:
workflow_dispatch:
inputs:
release:
description: "major, minor, patch, or an exact version such as 1.57.0"
required: true
default: minor
concurrency:
group: release
permissions:
contents: write
jobs:
cut:
runs-on: self-hosted
steps:
# 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
with:
ref: main
fetch-depth: 0
token: ${{ secrets.DEPLOY_TOKEN }}
- 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: Install Task
run: go install github.com/go-task/task/v3/cmd/task@v3.48.0
- name: Cut the release
env:
RELEASE: ${{ inputs.release }}
run: |
git config user.name "Sam Catlow"
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)"
+1 -6
View File
@@ -25,19 +25,14 @@ config.production.toml
/ui/node_modules/
/ui/.vite/
/ui/*.tsbuildinfo
# ui/dist IS committed: the Go build must not need a Node toolchain.
/ui/dist/
# air live-reload
/.air/
/tmp/
# Beads / Dolt files (added by bd init)
.dolt/
.beads-credential-key
.beads/proxieddb/
*.gate.lock*
.beads/issues.jsonl
.beads/interactions.jsonl
.mcp.json
# gh CLI state (~/.local/state/gh) mistakenly created inside the tree
+1
View File
@@ -0,0 +1 @@
v2.14.0
+1
View File
@@ -120,6 +120,7 @@ linters:
sloglint:
no-mixed-args: true
key-naming-case: snake
context: scope
exclusions:
generated: lax
+155
View File
@@ -5,6 +5,161 @@ release's per-component sections are labelled beneath its heading.
## [Unreleased]
## [1.58.0] - 2026-11-01
### archied
- Running `install.sh` over an install whose services are already running now restarts them, so they run the new binaries.
## [1.57.0] - 2026-10-31
### archied
- 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.
## [1.56.0] - 2026-10-31
### archied
- **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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Instructions replace SOUL: instance, organisation, workflow and repository instructions are layered into every agent stage.
- 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.
- Run more than one instance side by side: `ARCHIE_INSTANCE` names an instance, and the installer installs and updates a named one.
- 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.
- A workflow installs a repository's declared tooling before its gate, and tasks clone from a shared per-repository mirror.
- Traces: services, model and tool calls and task containers export OpenTelemetry spans, and log lines carry the trace id.
- Telegram runs as an archipelago channel extension, enabled from the Extensions page.
- The Extensions page groups the marketplace by surface, is searchable, shows install state, and offers an update only when the catalogue has one.
- 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.
### archie-agent
- Released with archied 1.56.0; task containers export trace spans and install a repository's declared tooling before its gate.
## [1.55.0] - 2026-10-16
### archied
- 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.
- 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.
## [1.54.3] - 2026-10-16
### archied
- 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.
## [1.54.2] - 2026-10-16
### archied
- 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".
### archie-agent
- Agent steps on Gemini models (Interactions API) pass tools their arguments intact instead of failing to decode them.
## [1.54.1] - 2026-10-16
### archied
- 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.
## [1.54.0] - 2026-10-16
**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`.
### archied
- 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]`.
- 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.
- 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.
- `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.
- 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.
- 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.
- 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.
- 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.
- Labels, hints, alerts and empty states say what is wrong and what to do, without tutorial or marketing prose.
- 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.
- 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.
- 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.
- 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.
- Chat model selection works again for provider models.
### archie-agent
- Each run acts as its workflow's declared identity.
- A task snapshot carries only the model limits its aliases resolve to.
- A build step's "no changes" result comes from its writable stages and clears once a commit lands.
- Test runs suppress forge and push writes and record what they would have done.
- The default persona is a reporting-focused identity prompt, without the one-question limit in chat.
## [1.53.0] - 2026-10-11
### archied
- 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.
- 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.
- 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.
- 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.
- Add a member by provider subject, or by email as a placeholder that the first sign-in the provider vouches for claims.
- 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.
- 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.
- 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.
- 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.
- 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.
- `/approve` reaches Telegram; the router served it but nothing published it.
- 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.
- An unserved `/api` path returns 404 instead of the dashboard page, and an input group's select no longer loses clicks to its addon.
### archie-agent
- The runtime reaches model providers through the egress proxy, so provider keys stay out of the container.
- Agent steps resolve model aliases and their own org's models and credentials, failing on an unknown alias instead of falling back.
- A switch step runs the case matching its reference.
- A call waiting on another step is reconciled from durable steps, so it resumes after a daemon restart rather than stranding.
## [1.52.0] - 2026-10-09
### archied
- 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.
- 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.
- Settings → Profiles, Credential bindings and Playbooks are editable from the dashboard, and curator definitions can be changed and applied without a restart.
- Settings say whether each one applies live or needs a restart, show what is consuming resources, and report whether an apply landed.
- Status shows each service's dependency checks, the agent workers and the broker.
- The Logs page reads recent logs from every service, not just the daemon.
- 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.
- Chat settings are attributed to the signed-in user, and Settings → Tokens explains when a personal token cannot be created.
- 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.
- 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.
- A scheduled job whose payload names a dangerous command is refused.
- A disabled model provider is never served from the ambient API key.
- `generate_video` is backed by ai-sdk's MiniMax video provider.
- A dashboard token is no longer written to the startup log.
### archie-agent
- `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.
- `command.run` honours step retry and `on_failure`.
- A value passed between steps keeps its declared type, and optional result booleans are enforced only when the workflow declares them.
- Capture tools have their results checked against the declared schema.
- A single-cycle run waits for its in-flight tasks before exiting, and identity tasks inherit live settings.
- Kit containers run Docker's init as PID 1, so orphaned processes are reaped instead of accumulating inside a long task.
## [1.51.1] - 2026-10-08
### archied
- 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".
## [1.51.0] - 2026-10-08
### archied
+76 -17
View File
@@ -9,12 +9,34 @@ here changes a decision. If a rule stops changing decisions, delete it.
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.
of the product. A forge is one of many inputs or outputs; core code never
assumes one.
<temporary - this statement must be removed on 2026-10-10"> The product is
unfinished. Many features are half-built, and the codebase carries far more
code, binaries, docs and tooling than it delivers. The job right now is to
finish features and shrink the codebase, not to extend it. </temporary>
<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>
## Services and layout
Each service is a gRPC contract in `proto/<service>/v1`, generated into
`internal/contracts/<service>/v1`, and one binary in `cmd/` that parses flags
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-agent` | The worker inside each task container | NATS |
`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.
## Authority
@@ -23,10 +45,24 @@ When sources disagree, the higher one wins:
1. The maintainer's instruction in this session.
2. This file.
3. The code as it is in the tree.
4. Beads issues (`bd show <id>`): the plan for a piece of work.
4. Gitea issues (`tea issues view <n>`): the plan for a piece of work.
5. Everything else (memories, comments, old docs) is a hint. Verify it against
the code before acting on it.
## Working with the maintainer
- **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).
- **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,
and anything blocked, in a few lines. No preamble, no recap of the request, no
closing offers of more help. Leave out what the maintainer can see or infer:
a clean tree, unpushed commits, a passing gate (commits imply it), and steps
skipped that the task never asked for. Name a skipped step only when the
task required it.
## How to decide
- **Broken beats new.** A bug that blocks work gets fixed now, with the smallest
@@ -64,10 +100,12 @@ When sources disagree, the higher one wins:
`infrastructure` implements `domain` interfaces, `domain` imports neither.
`cmd/` parses flags and calls `app`, nothing else.
- Fix invalid state where it is produced, not with checks where it is consumed.
- Log through the service's injected `*slog.Logger` with the `...Context`
methods, so lines carry the OpenTelemetry trace id. Never the global `slog`.
- If a fix fails twice, throw the block away and rewrite it simply.
- Comments say why, briefly. No migration history, phase names or issue
narration in code.
- Generated files (`ui/dist/`, protobuf, sqlc) are regenerated and committed
- Generated files (protobuf, sqlc) are regenerated and committed
with the change that caused them, never hand-edited.
## Tests
@@ -83,7 +121,8 @@ 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. One table-driven test per behaviour; extend the table
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.
@@ -112,9 +151,18 @@ task build # binaries into bin/
task test # go test -short ./...
task ui # dashboard into ui/dist
task check # the gate
go test -short ./internal/domain/workflow -run TestName # one test
task dev # every service + Vite at http://localhost:5173, from deployments/dev.toml
task e2e:up # seeded local stack; task e2e:check -- all runs the browser checks
```
Requires Go 1.27, Task, golangci-lint, Node/npm and Docker. Adopt `task fmt` and
`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.
Requires Go 1.27, Task, golangci-lint, Node, pnpm and Docker. Adopt `task fmt` and
`go fix` output as-is.
- `task check` gates the commit: `task check && git commit ...`. Never claim a
@@ -129,21 +177,32 @@ Requires Go 1.27, Task, golangci-lint, Node/npm and Docker. Adopt `task fmt` and
Nothing in the working tree is read at runtime. Systemd is optional.
- Releases: `RELEASING.md`.
## Issues (beads)
## Issues (Gitea)
Work is tracked in `bd`, never in Markdown TODO files.
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
bd ready | bd show <id> | bd update <id> --claim | bd close <id>
tea issues list -r sam/archie --state open --labels priority::critical
tea issues list -r sam/archie --labels epic/<slug> --state open
tea issues view 497
tea issues edit 497 --add-labels status::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.
- Bead state syncs through Dolt (`bd dolt push/pull`, only when told), not git.
Never commit `.beads/` exports.
- No host names, IPs, paths, PIDs or credentials in any bead: they are
published.
- File follow-up work you find as a bead. Do not fix it in passing.
- 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.
- 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.
- The API caps `limit` at 50 regardless of what you pass.
- No host names, IPs, paths, PIDs or credentials in an issue: the text outlives
the change that wrote it.
- File follow-up work you find as an issue. Do not fix it in passing.
## Changing this file
+3 -2
View File
@@ -2,7 +2,8 @@
# Pre-installs system tools agents can't install themselves (no apt, no sudo).
# Language packages are installed at runtime via uv/npm/go.
#
# Build: docker build -t archie-agent:latest .
# Build: task image:agent (or docker build --build-arg RUNTIME_VERSION=<ver>)
# A build that names no version stamps none, and the agent reports dev.
# ── builder ──
FROM golang:1.27-trixie AS builder
@@ -54,7 +55,7 @@ ENV GOPATH="/go"
# /go/bin must be on PATH or anything `go install` puts there is unreachable.
ENV PATH="/usr/local/go/bin:/go/bin:${PATH}"
ARG GOLANGCI_LINT_VERSION=2.13.2
ARG GOLANGCI_LINT_VERSION=2.14.0
ARG GOFUMPT_VERSION=0.11.0
ARG BUF_VERSION=1.72.0
+9
View File
@@ -1,11 +1,20 @@
# archied — the archie daemon
# Run via docker compose alongside NATS.
FROM node:24-trixie-slim AS dashboard
WORKDIR /src/ui
RUN corepack enable
COPY ui/package.json ui/pnpm-lock.yaml ui/pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
COPY ui/ ./
RUN pnpm run build
FROM golang:1.27-trixie AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN 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 \
-12
View File
@@ -1,17 +1,5 @@
NOTICE
This product includes software derived from PR-AF
(https://github.com/Agent-Field/pr-af), Copyright AgentField,
licensed under the Apache License, Version 2.0.
Derived portions: internal/domain/workflow/prreview -- the unified diff
parser, change clustering, blast radius, evidence extraction, scoring,
deduplication, line mapping and review-event selection.
PR-AF declares the Apache License, Version 2.0 in its pyproject.toml and
ships no license file. A copy of the License is available at
https://www.apache.org/licenses/LICENSE-2.0
This product includes software from the Cedar project
(https://github.com/cedar-policy/cedar), Copyright Amazon.com, Inc. or its
affiliates, licensed under the Apache License, Version 2.0, as implemented by
+1 -3
View File
@@ -1,5 +1,3 @@
[![Quality](https://github.com/samcharles93/archie-core/actions/workflows/quality.yml/badge.svg)](https://github.com/samcharles93/archie-core/actions/workflows/quality.yml)
# Archie
**Event-driven Agentic Automation**
@@ -103,7 +101,7 @@ or a hosted provider API key.
1. **Install.**
```bash
curl -fsSL https://raw.githubusercontent.com/samcharles93/archie-core/main/install.sh | bash
curl -fsSL https://offloaded.dev/install.sh | bash
```
It downloads the latest release, verifies its checksum, installs the five
+113 -101
View File
@@ -1,129 +1,141 @@
# Releasing
One release stream. `CHANGELOG.md` carries every release section, one generated
page per version describes it, and one tag names the release. A release is one
version covering whatever changed; the components' entries are labelled sections
inside it (`### archied`, `### archie-agent`), not separate numbers or separate
pages.
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`).
The host bundle ships five processes (`archied`, `archie-gateway`,
`archie-state-store`, `archie-ui`, `archie-messaging`), and
one version covers all of them. `archie-agent`, the per-task sandboxed runtime,
ships as a container image and its changes are the `## [version]` release's
`### archie-agent` section.
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.
`tools/release.sh` decides which commits a release carries from the package
closure of **every shipped binary**, not from commit-message guessing: a change
to a package only the messaging service, state store, playbook runner or UI
links still lands in the changelog. Read its header comment for how it
partitions commits and enforces `main`-only, clean-tree releases.
## Notes are written with the change
## What justifies a version
`task release:preview VERSION=X.Y.Z` shows exactly what would land, before
anything is written. A commit set that justifies no version produces no version:
`release.sh` exits **3** with "nothing to release" rather than inventing one, so
a pipeline can finish green without tagging.
Most sessions touch the gateway side (daemon, gateway, web UI, chat, messaging)
and leave the agent runtime alone. That is no longer a per-component `skip`
decision — one version covers the release — but a runtime code change being
merged to `main` is still not the same as it being in production: the
`archie-agent` image is rebuilt by the release, and a host that runs the agent
must pull the new image (`docker compose pull agent`) to get it.
## What the notes are for
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 — is not the reader's experience
either — out.
- A capability that **shipped but is not yet wired** _is_ the reader's
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.
Do not apply this mechanically: deleting a caveat a reader needs misleads them,
which is the failure this rule exists to prevent.
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.
## Cutting a release
```bash
task release:preview VERSION=1.3.0 # preview what would land
task release:prepare VERSION=1.3.0 # write the section into CHANGELOG.md, uncommitted
# edit CHANGELOG.md -- generated notes are a starting point, not the release
task release VERSION=1.3.0 # commit + annotated tag
git push --atomic origin main v1.3.0 # both refs or neither
```
Dispatch the **release** workflow (`.github/workflows/release.yml`) with
`major`, `minor`, `patch` or an exact version. It runs `task release` on `main`:
`release:prepare` emits bare commit subjects; they are a starting point. Rewrite
them to say what a reader gets, per "What the notes are for" above.
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`;
Pushing is a separate, explicit step — never push without confirming first (see
the repo's general "check before doing anything hard to reverse" rule). The
deploy workflow reads tags pointing at `HEAD`; pushing the commit without its
tag gets images stamped `dev`, which is why the push names the tag and is
`--atomic`.
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.
### After a release, `main` and the working branch have diverged
The release commit lands on `main` — `tools/release.sh` refuses to run anywhere
else — while the working branch keeps advancing. So after every release, `main`
is ahead by exactly that commit and the branch is ahead by however far it has
moved: **neither tip is an ancestor of the other**, and `--ff-only` fails in
both directions. That refusal reads as "the tree is not ready" when in fact the
tree is fine.
Merge the release commit into the branch first, so any conflict is resolved on
the branch, where it is reversible and nobody is reading the tip:
```bash
git merge main # on the branch
git merge --ff-only <branch> # then, in whichever worktree holds main
```
Confirm which worktree holds `main` with `git worktree list` before the
`--ff-only`. A detached worktree sitting at the same commit will accept it and
move nothing, which looks like success.
After a release, pull `main` before committing on it again: CI has added the
release commit.
## What a release publishes
Tagging one version produces, from a single `deploy` run:
The tag push runs `deploy.yml`:
- **Container images** — `ghcr.io/samcharles93/archied:latest` and
`ghcr.io/samcharles93/archie-agent:latest`. The runtime image is rebuilt by
the release, so runtime commits merged to `main` do not reach a running
sandbox until the host pulls the new image.
- **`:latest` names the newest release, not the newest commit.** A push to
`main` that is not a release publishes `archied:edge` (mutable, tracking
`main`) and `archied:sha-<commit>` (immutable) instead, so a release's
`:latest` stamping is not overwritten minutes later by the next ordinary
commit. A host that runs releases follows `:latest`; a host that tracks `main`
follows `:edge`.
- **A GitHub Release with a distribution zip** — `dist-zip` builds every process
the reference deployment runs (`archied`, `archie-gateway`,
`archie-state-store`, `archie-ui`, `archie-messaging`) for
linux/amd64, packs them with `deployments/INSTRUCTIONS.md` and `CHANGELOG.md`,
and attaches the zip to the Release. The Release body is that version's
`## [version]` section of `CHANGELOG.md`.
- **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.
- **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 zip is also uploaded as an Actions artifact, but that is a backup copy:
artifacts expire after 90 days and need an Actions login to download. The
Release asset is the durable, operator-reachable one.
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.
## Gate
## The canary
CI (`deploy.yml`) runs `task check` before building images, then verifies any
release tag at `HEAD` has a matching `[version]` section in `CHANGELOG.md`. A
tag with no changelog entry is a hard failure. No tags at `HEAD` is a warning,
not a failure — images get stamped `dev`.
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 on `next`:
One consequence worth knowing when a release commit needs amending: GitHub
Actions runs the workflow **from the commit that triggered it**, so a fix to
`deploy.yml` only takes effect for a release if it is an ancestor of the tagged
commit. Delete and re-cut the tag (`git tag -d`, `task release`) rather than
committing the fix on top of an already-tagged release.
| Signal | Source | Fails when |
| --- | --- | --- |
| Install outcome | `GET /api/chat/update` | the canary doesn't run the 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 issued |
| Error log | `GET /api/logs?level=error` | error lines per day 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 24 hours before the release was issued. With
one production host there's no simultaneous control.
- **Window.** 24 hours from issue, one cycle of schedules and traffic. The
first 30 minutes are for the install and restart.
- **Hard signals** (install, readiness, alerts) roll back at any check after
that. **Relative signals** (errors, tasks) are judged at the end of the
window.
- **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 day from what it covers.
### 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.
### Roll back
`stable` stays put, and the run turns red. 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.
### Configuration
| Name | Kind | Holds |
| --- | --- | --- |
| `CANARY_URL` | Actions variable | the canary's dashboard URL; unset disables the canary steps |
| `CANARY_TOKEN` | Actions secret | a personal API token on the canary with instance admin |
| `DEPLOY_TOKEN` | Actions secret | registry and repository write, for publishing, promoting and the release push |
| `RELEASE_SIGNING_KEY` | Actions secret | the release signing seed |
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 \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
```
+114 -129
View File
@@ -2,13 +2,13 @@ version: "3"
vars:
BIN_DIR: "bin"
# The version a build reports: the nearest tag with the distance and commit,
# or a bare commit when the checkout has no tags (a shallow clone). A build
# should not answer "dev" only because the caller did not name a version.
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null | sed 's/^v//' || echo dev
tasks:
default:
desc: List available tasks
cmds:
- task --list
fmt:
desc: Fix and format Go source with the gate's configured formatters
cmds:
@@ -88,28 +88,7 @@ tasks:
desc: Run golangci-lint
cmds:
- golangci-lint run ./...
- task: lint:tools
lint:tools:
desc: Run golangci-lint over the tools module
dir: tools
cmds:
- golangci-lint run ./...
lint:playbooks:
desc: Validate playbook bindings
cmds:
- go run ./cmd/archied playbooks lint -dir ./playbooks
vuln:
desc: Scan for known vulnerabilities (requires network access)
cmds:
- govulncheck ./...
deadcode:
desc: Report unreachable production functions (advisory)
cmds:
- go run golang.org/x/tools/cmd/deadcode@latest -test=false ./cmd/...
- cd tools && golangci-lint run ./...
ui:deps:
desc: Install dashboard dependencies
@@ -118,38 +97,51 @@ tasks:
run: once
dir: ui
cmds:
- npm install --no-audit --no-fund
- pnpm install --frozen-lockfile
ui:
desc: Build the dashboard into ui/dist (committed; the Go build embeds it)
desc: Build the dashboard into ui/dist, which the Go build embeds
dir: ui
deps: [ui:deps]
cmds:
- npm run build
ui:check:
desc: Rebuild the dashboard into a temporary directory and reject a stale ui/dist
deps: [ui:deps]
cmds:
- bash tools/uidist.sh check
- pnpm run build
test:ui:
desc: Test and type-check the dashboard
dir: ui
deps: [ui:deps]
cmds:
- npm test
- npm run typecheck
- pnpm test
- pnpm run typecheck
webhook:send:
desc: Send a test event to the dashboard's capture intake (--help for kinds)
bench:prreview:
desc: Run the PR review benchmark on the configured models and write docs/benchmarks/pr-review-*.md (-- -model ALIAS -judge-model REF; --help for flags)
cmds:
- bash tools/webhook-send.sh {{.CLI_ARGS}}
- go run ./cmd/archied prbench {{.CLI_ARGS}}
dev:
desc: Run development services and Vite at http://localhost:5173
deps: [dev:daemon, dev:gateway, dev:messaging, dev:state-store, dev:dashboard, dev:ui]
dev:tls:
desc: Issue the development CA and service certificates deployments/dev.toml names
status:
- test -f tmp/dev-tls/archie-ui.pem
cmds:
- |
# Task containers reach the State Store over the Docker bridge, which
# services may only do over TLS.
set -eu
d=tmp/dev-tls
mkdir -p "$d"
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 3650 \
-subj /CN=archie-dev-ca -keyout "$d/ca-key.pem" -out "$d/ca.pem" 2>/dev/null
for s in archied archie-gateway archie-messaging archie-state-store archie-ui; do
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 3650 \
-subj "/CN=$s" -addext "subjectAltName=DNS:$s" -addext extendedKeyUsage=serverAuth,clientAuth \
-CA "$d/ca.pem" -CAkey "$d/ca-key.pem" -keyout "$d/$s-key.pem" -out "$d/$s.pem" 2>/dev/null
done
dev:postgres:
desc: Start PostgreSQL and wait for readiness
cmds:
@@ -166,17 +158,21 @@ tasks:
echo "postgres did not become healthy within 60s" >&2
exit 1
dev:daemon:
desc: Run archied with live reload
dev:wait-state:
internal: true
cmds:
- |
# The daemon and Gateway read their settings from the State Store at
# boot and exit if it is not up yet; it starts only once PostgreSQL
# is healthy, so wait for its port ([services.state] in
# deployments/dev.toml) first.
# Services read their settings from the State Store at boot and exit
# if it is not up yet, so wait for its port ([services.state] in
# deployments/dev.toml).
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
exit 1
dev:daemon:
desc: Run archied with live reload
cmds:
- task: dev:wait-state
- air -build.args_bin="-config-overlay,deployments/dev.toml"
dev:dashboard:
@@ -186,65 +182,64 @@ tasks:
dev:state-store:
desc: Run the State Store with development PostgreSQL
deps: [dev:postgres]
deps: [dev:postgres, dev:tls]
cmds:
- go run ./cmd/archie-state-store -config-overlay deployments/dev.toml
dev:gateway:
desc: Run the development Gateway
cmds:
- |
# The daemon and Gateway read their settings from the State Store at
# boot and exit if it is not up yet; it starts only once PostgreSQL
# is healthy, so wait for its port ([services.state] in
# deployments/dev.toml) first.
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
exit 1
- task: dev:wait-state
- go run ./cmd/archie-gateway -config-overlay deployments/dev.toml
dev:messaging:
desc: Run the development Messaging Service
cmds:
- for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done; echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2; exit 1
- task: dev:wait-state
- go run ./cmd/archie-messaging -config-overlay deployments/dev.toml
dev:ui:
desc: Run Vite (requires the dashboard backend)
dir: ui
cmds:
- npm install --no-audit --no-fund
- npm run dev
- pnpm install
- pnpm run dev
dev:mobile:
desc: Serve the dashboard on your LAN (token-protected) for phone viewing
deps:
- ui
e2e:up:
desc: Start the local stack without Docker (PostgreSQL 18, services, Vite) and seed it
cmds:
- cmd: |
IP=$(hostname -I | awk '{print $1}')
TOKEN_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/archie/web-token"
go run ./cmd/archie-ui -listen 0.0.0.0:8484 -token-file "$TOKEN_FILE" &
UI_PID=$!
sleep 2
TOKEN=$(cat "$TOKEN_FILE" 2>/dev/null)
URL="http://$IP:8484/?t=$TOKEN"
echo "Phone URL: $URL"
echo "$URL" | qrencode -t ANSIUTF8
trap "kill $UI_PID 2>/dev/null" EXIT
wait $UI_PID
- bash e2e/stack.sh start
- bash e2e/seed.sh
e2e:down:
desc: Stop the local e2e stack
cmds:
- bash e2e/stack.sh stop
e2e:check:
desc: List browser checks; use -- all or -- CHECK to run, add --headed to watch
cmds:
- node e2e/run.cjs {{.CLI_ARGS}}
build:
desc: Build archie services and agent binaries
deps: [ui]
vars:
GATEWAY_VERSION: '{{.GATEWAY_VERSION | default "dev"}}'
RUNTIME_VERSION: '{{.RUNTIME_VERSION | default "dev"}}'
GATEWAY_VERSION: '{{.GATEWAY_VERSION | default .VERSION}}'
RUNTIME_VERSION: '{{.RUNTIME_VERSION | default .VERSION}}'
SERVICE_LDFLAGS: >-
-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary
-X github.com/samcharles93/archie-core/internal/buildinfo.Version={{.GATEWAY_VERSION}}
-X github.com/samcharles93/archie-core/internal/buildinfo.Runtime={{.RUNTIME_VERSION}}
sources:
- Taskfile.yml
- "**/*.go"
# Files the binaries embed.
- "internal/**/*.sql"
- "internal/**/*.yaml"
- "internal/**/*.json"
- "internal/**/*.tpl"
- "internal/**/*.md"
- go.mod
- go.sum
- "ui/dist/**"
@@ -256,26 +251,33 @@ tasks:
- "{{.BIN_DIR}}/archie-messaging"
- "{{.BIN_DIR}}/archie-agent"
cmds:
# One flag set for every service, matching scripts/archie-update-install
# and the release workflow, so each binary reports the same version.
# 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]
cmd: go build -ldflags "{{.SERVICE_LDFLAGS}}" -o {{.BIN_DIR}}/{{.ITEM}} ./cmd/{{.ITEM}}
- go build -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
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
test:
desc: Run short Go tests with caching
desc: Run Go tests; the release gate passes TEST_FLAGS=-count=1
cmds:
- go test -short ./...
- go test {{.TEST_FLAGS | default "-short"}} ./...
test:full:
desc: Run the whole Go test suite uncached, including the wall-clock-bound tests
image:agent:
desc: Build the agent image stamped with this checkout's version
# Compose owns the image build; this only supplies the version, which a
# plain `docker build` has no way to learn from a context that excludes .git.
cmds:
- go test ./... -count=1
- RUNTIME_VERSION={{.VERSION}} docker compose build agent
check:
desc: Run the full quality gate
# Finish mutations before starting parallel checks.
cmds:
# Node packages land under ui/, which `go test ./...` walks: installing
# them while the parallel checks scan the tree makes a lockfile update
# delete Go sources mid-walk. Install first, then fan out. Every Go step
# embeds ui/dist, so the dashboard is built before any of them.
- task: ui
- task: fmt
- task: proto:check
- task: db:check
@@ -291,50 +293,33 @@ tasks:
- task: build
- task: test
- task: test:ui
- task: ui:check
release:preview:
desc: "Show the release notes that would be generated (VERSION=1.2.0)"
cmds:
- tools/release.sh --version {{.VERSION}} --dry-run
requires:
vars: [VERSION]
release:prepare:
desc: Prepare changelog notes for editing (VERSION=1.2.0)
cmds:
- tools/release.sh --version {{.VERSION}} --prepare
requires:
vars: [VERSION]
release:
desc: Commit and tag the prepared release (VERSION=1.2.0)
cmds:
- tools/release.sh --version {{.VERSION}} --tag
desc: "Turn [Unreleased] into a release, then commit and tag it (RELEASE=major|minor|patch|1.2.3)"
requires:
vars: [VERSION]
clean:
desc: Remove build artifacts
vars: [RELEASE]
cmds:
- rm -rf {{.BIN_DIR}}
docker-build:
desc: Build the archie-agent sandbox image
cmds:
- docker compose build agent
docker-up:
desc: Start the optional external NATS service via docker compose
cmds:
- docker compose up -d nats
docker-down:
desc: Stop the docker compose stack
cmds:
- docker compose down
docker-logs:
desc: Follow the NATS container logs
cmds:
- docker compose logs -f nats
- |
set -euo pipefail
die() { echo "release: $*" >&2; exit 1; }
[ "$(git rev-parse --abbrev-ref HEAD)" = main ] || die "releases are cut from main"
[ -z "$(git status --porcelain)" ] || die "the working tree is dirty"
last="$(git tag --list 'v*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1 || true)"
IFS=. read -r major minor patch <<<"${last#v}"
case "{{.RELEASE}}" in
major) version="$((major + 1)).0.0" ;;
minor) version="$major.$((minor + 1)).0" ;;
patch) version="$major.$minor.$((patch + 1))" ;;
*) version="$(echo "{{.RELEASE}}" | sed 's/^v//')" ;;
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"
+47 -16
View File
@@ -21,7 +21,6 @@ steps:
- id: plan
type: agent.run
settings:
role: planner
read_only: true
mission: |
Plan this change: {{ task.prompt }}
@@ -72,7 +71,7 @@ Any string setting may contain `{{ path }}`, replaced when the step runs:
| `task.repository` | `owner/name`. |
| `task.kind` | What the task came from, as prose: `GitHub issue` or `chat-originated task`. |
| `task.issue`, `task.pr` | Issue and pull request numbers. |
| `task.plan` | The plan a `human.approve` step handed over (an approved PRD). |
| `task.plan` | The plan a `workflow.approve` step handed over (an approved PRD). |
| `task.review` | The review comments a remediation round addresses. |
| `inputs.<name>` | A declared input; an undeclared one is refused at save. |
| `steps.<id>.summary` | What an earlier step reported, e.g. an agent's finish summary or a gate's output. |
@@ -109,7 +108,7 @@ it. Parallel steps do not nest, and need at least two branches.
### How a run ends
A run ends at the first step that sets an outcome: `workflow.finish`,
`workflow.handoff`, `human.approve`, `repo.open-pr`, `repo.commit` with
`workflow.handoff`, `workflow.approve`, `repo.open-pr`, `repo.commit` with
`if_empty: complete`, or `review.reply`. A run that reaches the end of its steps
completes, with the last step's summary as its detail. A step that fails parks
the run unless it continues on failure.
@@ -135,7 +134,7 @@ _runs without a repository._
| `protect_tests` | bool | Write-block the repository test files. |
| `read_only` | bool | Restrict the agent to read-only tools. |
| `result` | mapping | A JSON Schema object the agent must return; later steps read it as steps.<id>.result. |
| `role` | text | Which configured model role runs the agent, e.g. builder or planner. Empty means builder. |
| `model` | text | The model alias that runs the agent, e.g. default or fast. Empty means default. |
### `command.run`
@@ -174,6 +173,18 @@ _needs a repository._
|---|---|---|
| `branch` | `fresh` \| `task` | fresh starts a new branch from the base; task resumes the branch this task pushed. |
### `repo.tooling`
_needs a repository._
No settings. It runs the repository policy's `tooling` commands, in order, in
the task worktree — the installs a gate needs and the container does not ship
(protoc plugins, linters, generators). A repository that declares none installs
nothing and the step succeeds. Place it after `repo.prepare` and before any
`gate.*` step: a failing install fails the step with the command and its output
and says the gate did not run, so a missing toolchain is not read as a red
repository.
### `gate.diff-rules`
_needs a repository._
@@ -182,12 +193,6 @@ _needs a repository._
|---|---|---|
| `rules` | list of mapping | Patterns the change must not match. |
### `gate.diff-size`
_needs a repository._
No settings.
### `gate.repository`
_needs a repository._
@@ -212,13 +217,30 @@ _runs without a repository._
| `body` | text | The comment text. |
| `on` | `issue` \| `pr` | Comment on the issue or the pull request. Empty means issue. |
### `human.approve`
### `message.send`
_runs without a repository._
Sends text to one chat on a messaging channel the workflow's organisation owns,
and a package's workflow may not send. A test run records the message instead
of sending it.
| Setting | Type | Meaning |
|---|---|---|
| `channel` | text | The messaging channel to send through. |
| `chat_id` | text | The channel's identifier for the chat. |
| `text` | text | The message. References are filled in. |
A scheduled message is a schedule bound to a workflow whose only step is
`message.send`.
### `workflow.approve`
_runs without a repository._
| Setting | Type | Meaning |
|---|---|---|
| `plan` | text | What the human decides on; the next workflow reads it as task.plan. |
| `plan` | text | What the operator decides on; the next workflow reads it as task.plan. |
| `then` | text | The workflow the task runs once approved. |
### `review.pr`
@@ -247,11 +269,15 @@ _runs without a repository._
| Setting | Type | Meaning |
|---|---|---|
| `inputs` | mapping | |
| `outputs` | mapping | |
| `inputs` | mapping | Callee input names mapped to scalar literals or `inputs.<name>` references to caller inputs. |
| `outputs` | mapping | Callee output names mapped to `outputs.<name>` references to caller outputs; requires `wait: true`. |
| `wait` | bool | Wait for the child run to finish before continuing. |
| `workflow` | text | The workflow to start as a child run. |
The step must declare an `id`: the step's id is the key of the call it starts,
so a retry of that call site returns the child already started instead of
starting a second one.
### `workflow.finish`
_runs without a repository._
@@ -259,7 +285,7 @@ _runs without a repository._
| Setting | Type | Meaning |
|---|---|---|
| `detail` | text | What the operator reads about the outcome. |
| `status` | `completed` \| `parked` \| `waiting_human` \| `declined` | How the run ends. Empty means completed. |
| `status` | `completed` \| `parked` \| `waiting_approval` \| `declined` | How the run ends. Empty means completed. |
### `workflow.handoff`
@@ -284,10 +310,15 @@ expressions that limit which files the rule applies to.
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
a `Schedule fired` event (`schedule_id`, `name`, `scheduled_for`,
`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
workflows.
- **Other workflows**: `workflow.call` (a child run), `workflow.handoff` (the
same task, requeued), `human.approve` (once approved).
same task, requeued), `workflow.approve` (once approved).
- **By hand**: the New task form, or Run on the Workflows page.
The canvas Start node lists the triggers of each workflow.
+28 -1
View File
@@ -15,10 +15,23 @@ import (
"syscall"
"github.com/samcharles93/archie-core/internal/app/agentworker"
"github.com/samcharles93/archie-core/internal/infrastructure/egress"
"github.com/samcharles93/archie-core/internal/logging"
)
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())
}
@@ -28,6 +41,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)
}
@@ -39,12 +55,19 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
natsURLFlag := flags.String("nats-url", "", "NATS server URL (defaults to NATS_URL)")
stateStoreURLFlag := flags.String("state-store-url", "", "State Store gRPC target (defaults to STATE_STORE_URL; required -- the legacy NATS storerpc path is deleted)")
stateStoreTokenFlag := flags.String("state-store-token", "", "State Store bearer token (defaults to STATE_STORE_TOKEN)")
showVersion := flags.Bool("version", false, "print the version and exit")
if err := flags.Parse(args); err != nil {
if errors.Is(err, flag.ErrHelp) {
return 0
}
return 2
}
// The release and its updater read this line to prove a shipped
// archie-agent belongs to the release being installed.
if *showVersion {
fmt.Printf("archie-agent %s\n", agentworker.Version())
return 0
}
natsURL, natsToken := natsConnectionSettings(*natsURLFlag, getenv)
if natsURL == "" {
@@ -53,7 +76,7 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
return 1
}
log := slog.New(slog.NewJSONHandler(stderr, nil))
log := slog.New(logging.WithTrace(slog.NewJSONHandler(stderr, nil)))
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
@@ -76,6 +99,10 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
NATSToken: natsToken,
StateStoreTarget: stateStoreURL,
StateStoreToken: stateStoreToken,
StateStoreCA: []byte(getenv("STATE_STORE_CA")),
ModelProxy: getenv(egress.ModelProxyEnv),
ModelProxyHosts: egress.ParseHosts(getenv(egress.ModelProxyHostsEnv)),
ModelProxyCA: getenv(egress.ModelProxyCAEnv),
}, log); err != nil {
return 1
}
-1
View File
@@ -22,7 +22,6 @@ func run() int {
flag.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory")
flag.StringVar(&options.Overlay, "config-overlay", "", "configuration overlay file or directory")
flag.StringVar(&options.Listen, "listen", "", "gateway gRPC listen address (defaults to [services.gateway].listen, else 127.0.0.1:8585)")
flag.StringVar(&options.Token, "token", "", "Bearer [REDACTED] required for a non-loopback listener (defaults to [services.gateway].target_token)")
flag.Parse()
showVersion()
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
+39
View File
@@ -0,0 +1,39 @@
// 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)
}
})
}
}
-3
View File
@@ -23,11 +23,8 @@ func run() int {
flag.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory")
flag.StringVar(&options.Overlay, "config-overlay", "", "configuration overlay file or directory")
flag.StringVar(&options.Gateway.Target, "gateway-target", "", "archie-gateway gRPC address (defaults to [services.gateway].target, else 127.0.0.1:8585)")
flag.StringVar(&options.Gateway.Token, "gateway-token", "", "bearer token presented to archie-gateway")
flag.StringVar(&options.StateStore.Target, "state-store-target", "", "archie-state-store gRPC address (defaults to [services.state].target)")
flag.StringVar(&options.StateStore.Token, "state-store-token", "", "bearer token presented to archie-state-store")
flag.StringVar(&options.Listen, "listen", "", "MessagingService gRPC listen address (defaults to [services.messaging].listen)")
flag.StringVar(&options.Token, "token", "", "bearer token required from MessagingService callers on a non-loopback listener")
flag.DurationVar(&options.DependencyTimeout, "dependency-timeout", 0, "readiness probe timeout (default 5s)")
flag.DurationVar(&options.ShutdownTimeout, "shutdown-timeout", 0, "shutdown timeout (default 5s)")
flag.Parse()
-1
View File
@@ -34,7 +34,6 @@ func run() int {
flag.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory")
flag.StringVar(&options.Overlay, "config-overlay", "", "configuration overlay file or directory")
flag.StringVar(&options.Listen, "listen", "", "state store gRPC listen address (defaults to [services.state].listen, else 127.0.0.1:9090)")
flag.StringVar(&options.Token, "token", "", "bearer token required for a non-loopback listener (defaults to [services.state].target_token)")
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")
+41
View File
@@ -0,0 +1,41 @@
// 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)
}
})
}
}
-4
View File
@@ -27,17 +27,13 @@ func run() int {
flag.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory (only [services.*] targets and [web] are read)")
flag.StringVar(&options.Overlay, "config-overlay", "", "configuration overlay file or directory")
flag.StringVar(&options.Listen, "listen", "", "dashboard HTTP listen address (defaults to [web].listen, else 127.0.0.1:8484)")
flag.StringVar(&options.Token, "token", "", "dashboard token; required for a non-loopback listener")
flag.StringVar(&options.TokenFile, "token-file", "", "file holding the dashboard token, minted on first use")
flag.StringVar(&options.OidcIssuer, "oidc-issuer", "", "identity provider issuer URL; requests must then carry a token it signed")
flag.StringVar(&options.OidcAudience, "oidc-audience", "", "audience (resource identifier) this dashboard accepts tokens for; required with -oidc-issuer")
flag.StringVar(&options.OidcClientID, "oidc-client-id", "", "provider client id for browser sign-in; omitted means no sign-in flow")
flag.StringVar(&options.OidcClientSecretEnv, "oidc-client-secret-env", "", "name of the environment variable holding the sign-in client secret")
flag.StringVar(&options.OidcRedirectURL, "oidc-redirect-url", "", "callback URL registered at the provider (path must be /oauth2/callback)")
flag.StringVar(&options.Gateway.Target, "gateway-target", "", "archie-gateway gRPC address (defaults to [services.gateway].target)")
flag.StringVar(&options.Gateway.Token, "gateway-token", "", "bearer token presented to archie-gateway")
flag.StringVar(&options.State.Target, "state-target", "", "archie-state-store gRPC address (defaults to [services.state].target)")
flag.StringVar(&options.State.Token, "state-token", "", "bearer token presented to archie-state-store")
flag.DurationVar(&options.DependencyTimeout, "dependency-timeout", 0, "per-dependency readiness probe timeout (default 5s)")
flag.DurationVar(&options.EventPollInterval, "event-poll-interval", 0, "how often the activity feed polls the State Store for new events (default 1s)")
// BoolFunc rather than BoolVar so an unset flag stays distinguishable
+32 -17
View File
@@ -2,34 +2,49 @@
package main
import (
"fmt"
"os"
"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"
func main() {
args := os.Args[1:]
os.Exit(run(os.Args[1:]))
}
func run(args []string) int {
// The setup generator is dispatched before the daemon's flags are
// parsed: it writes a first-run config.toml and must not touch the
// store, NATS, or the running daemon's configuration.
if archied.IsSetupArgs(args) {
os.Exit(archied.RunSetup(args[1:], os.Stdin, os.Stdout, os.Stderr))
return archied.RunSetup(args[1:], os.Stdin, os.Stdout, os.Stderr)
}
if len(args) > 0 && args[0] == "update" {
os.Exit(archied.RunUpdate(args[1:], os.Stdout, os.Stderr))
if len(args) > 0 {
switch args[0] {
case "update":
return archied.RunUpdate(args[1:], os.Stdout, os.Stderr)
case "release":
return archied.RunRelease(args[1:], os.Stdout, os.Stderr)
case "status":
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
// daemon under the running one's feet.
if !strings.HasPrefix(args[0], "-") {
fmt.Fprintf(os.Stderr, "archied: unknown command %q\n%s\n", args[0], commandUsage)
return 2
}
}
if len(args) > 0 && args[0] == "update-image" {
os.Exit(archied.RunUpdateImage(args[1:], os.Stderr))
}
if len(args) > 0 && args[0] == "update-topology" {
os.Exit(archied.RunUpdateTopology(args[1:], os.Stdout, os.Stderr))
}
if len(args) > 0 && args[0] == "status" {
os.Exit(archied.RunStatus(args[1:], os.Stdout, os.Stderr))
}
if len(args) > 0 && args[0] == "playbooks" {
os.Exit(archieplaybooks.Run(args[1:], os.Stderr))
}
os.Exit(archied.Run())
return archied.Run()
}
+58 -457
View File
@@ -1,495 +1,96 @@
# archie configuration
#
# archied configuration
# This file starts the services. Everything else (forge connections, models,
# providers, chat, tools, containers, repositories, policies) is edited in the
# dashboard, and a saved value there overrides the same setting here.
#
# Secrets are NOT stored here: each one is a {engine, key}
# reference resolved through a secrets engine at startup.
# The built-in "env" engine reads key as an environment variable name.
# Every other engine (bws, sops, vault, age) is an extension installed from
# the archipelago marketplace and enabled through the control plane.
# Secrets are never written here: each is a {engine, key} reference. The
# built-in "env" engine reads key as an environment variable.
# work_dir = "~/.local/share/archie/work" # default
# state_dir = "~/.local/share/archie" # default; embedded NATS store, task logs, disk probe
# The PostgreSQL connection archie-state-store, archied and archie-gateway
# serve from. Required: each fails closed without it.
# `docker compose up -d postgres` starts a matching local postgres:18 with this
# default URL.
# database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
# skills_dir = "~/.local/share/archie/skills" # SKILL.md search path; defaults under work_dir when unset
# workflow_routing_file = "~/.local/share/archie/workflow-routing.yaml" # kind->workflow rebinding (bug/feature)
# workflow_labels_file = "~/.local/share/archie/workflow-labels.yaml" # arbitrary forge label -> workflow (EDA playbook slice 2)
# playbook_dirs = ["~/.local/share/archie/workflows"] # list of dirs of *.yaml binding files, merged with the two above (slice 3); a key bound twice across sources is a load failure
# database_url = "postgres://archie:archie@localhost:5432/archie?sslmode=disable"
# work_dir = "~/.local/share/archie/work"
# state_dir = "~/.local/share/archie"
poll_interval = "60s"
label = "archie"
bot_user = "vectis-labs-archie"
# 0 switches the cap off; omit the key to take the built-in default (400).
diff_cap_lines = 400
# org = "acme" # empty means the default org (a single-operator install's one identity)
# granted_credentials = ["openai"] # credential@1 services the root identity may resolve (see [containers.credentials])
# how many operator-triggered retries a parked task gets
# before it moves to dead (global default; set per-repo to
# override). Enforced by the dashboard's retry action.
# max_retries = 3
[forge]
# The name of an installed, enabled forge package (archipelago: forge/github, forge/gitea), or "none".
# Install and enable it from the Extensions page, then restart archied.
type = "github"
host = "https://github.com"
token = { engine = "env", key = "ARCHIE_GITHUB_TOKEN" }
# How forge issues become work:
# "poll" – re-discover issues each poll_interval (default)
# "webhook" – react to GitHub webhook events the moment they arrive
# "both" – webhook plus the poll as a backstop
# intake = "poll"
# Required when intake is "webhook" or "both": the shared secret configured
# on the GitHub webhook, and the host:port the receiver listens on. On
# GitHub, set the webhook's Content type to application/json (the UI
# default) -- the alternate form-encoded delivery is not supported.
# Webhook intake is single-identity, and that is enforced: with [[identities]]
# configured this combination is REJECTED at startup rather than silently
# downgraded to polling. The receiver binds one secret and one dispatch
# predicate, so it could only judge another identity's events by the wrong
# rules. Either drop the [[identities]] blocks, or keep intake = "poll" and
# let each identity poll.
# intake = "poll" # "poll", "webhook" or "both"
# webhook_secret = { engine = "env", key = "ARCHIE_WEBHOOK_SECRET" }
# webhook_addr = "0.0.0.0:8645"
# intake, webhook_secret and webhook_addr exist only here. Set on a
# [identities.forge] entry they are REJECTED for the same reason: nothing
# reads them, so the identity would silently keep polling. Serving webhook
# intake per identity is a pending migration, not a setting.
# [[identities]] runs more than one bot identity from a single daemon, each
# with its own forge/dispatch/models/providers/budgets/notify. Intake
# settings are rejected per identity, and [forge].intake = "webhook"/"both"
# is rejected alongside [[identities]]. Minimal shape:
# [[identities]]
# name = "personal" # required; namespaces logs/events/NATS subjects
# bot_user = "your-bot" # required
# forge = { type = "github", host = "https://github.com", token = { engine = "env", key = "ARCHIE_GITHUB_TOKEN_PERSONAL" } }
# org = "acme" # empty inherits the shared org (empty = default)
# granted_credentials = ["openai"] # credential@1 services this identity may resolve (see [containers.credentials])
[dispatch]
# Can be of "assignee", "label", or "either"
# this sets the method archie uses to pick up tasks.
trigger = "assignee"
trigger = "assignee" # "assignee", "label" or "either"
ack_reaction = "eyes" # "off" for none
# Optionally set a reaction to show that archie has picked up a task.
# setting this to "off" disables the pickup reactions.
ack_reaction = "eyes"
[models] # role -> ai-sdk runtime ref (used by agent workflows)
[models]
triage = "openai/gpt-5.4"
planner = "openai/gpt-5.4"
builder = "openai/gpt-5.4"
# `reviewer` runs the adversarial self-review stage and operator-triggered PR
# reviews. Omitted, it falls back to `builder`.
# reviewer = "openai/gpt-5.4"
# `embedding` is optional: it powers in-process embedding consumers
# (curators first). Unset, or a credential that fails to resolve, degrades
# to the capability reporting unavailable -- archied still starts.
# embedding = "openai/text-embedding-3-small"
# `transcription` is optional: it turns Telegram voice notes into text before
# the turn is dispatched, behind a "[voice transcription]" marker. Read by
# archie-messaging. Unset, or a provider that does not resolve, leaves the
# voice note as its media placeholder -- the turn still runs.
# transcription = "openai/whisper-1"
# [providers.openai]
# class = "openai"
# api_key = { engine = "env", key = "OPENAI_API_KEY" }
[providers.ollama]
class = "ollama"
# [chat]
# `operator` is the display name of user. It is
# passed to the chat agent as runtime metadata, which means it is sent to the
# configured model provider on every turn -- leave it unset to tell the agent
# nothing about who is running it.
# operator = "John Smith"
# `workspace` roots the chat agent's file and shell tools (read, write, edit,
# shell, grep, find). If unser, the tools aren't registered.
# Set it to let the agent read, modify and execute inside that directory
# choose it deliberately
# workspace = "~/.local/share/archie/workspace"
# `max_steps` caps the model/tool round-trips in a single chat turn
# (default 100). This is a task budget, not a safety limit.
# max_steps = 100
# Let read/write/edit/find/grep tools reach absolute paths outside the
# workspace jail. Relative paths still resolve against workspace.
# The shell tool is never confined, so a jail only pushes the agent into
# using shell for everything, losing truncation, line numbering, and
# read-before-write protection. Enable when the agent needs to work
# cross-filesystem (disk ops, system edits, etc.). Grant deliberately.
# unrestricted_filesystem = true
# Render each completed tool call inline in the reply, naming the tool and one
# line of its result, before the answer built from them. Off by default: it is
# there to make a wrong tool choice visible from the chat, at the cost of
# narrating every internal step. Applies to every chat channel -- Telegram
# and the web dashboard both read this one setting.
# show_tool_calls = true
# Optional interactive-chat catalog. /provider groups these references by
# their first path segment, and /model shows only the selected provider's
# entries. When omitted, Archie uses the distinct refs in [models].
# models = [
# "openai/gpt-5.6-sol",
# "openrouter/openai/gpt-5.6-sol",
# ]
# [chat.telegram]
# The bot token from @BotFather, resolved through a configured secret engine.
# token = { engine = "bws", key = "TELEGRAM_BOT_TOKEN" }
# Email and the generic inbound webhook are archipelago channel extensions
# (channels/email, channels/webhook): install, accept and enable them from the
# Extensions page, with their settings there.
# Per-(channel, sender) inbound rate limiting, shared by every chat channel:
# Telegram keys by numeric user ID, email by SMTP from address, webhook by
# its configured route path -- a source, not a person, so it reaches the
# limiter as a transport-only budget key rather than as an identity. Off by
# default -- both fields must be set to a positive value.
#
# This section is the seed for the Channel settings resource. The Web UI owns
# the value a running deployment limits with (restart-required), so edit it
# there rather than here; a stored value is not overwritten by this file.
# [chat.rate_limit]
# window = "1m"
# max_requests = 20
# External MCP tools are launched and managed by Archie's MCP client. A
# command of "npx" gets a persistent package cache under work_dir
# (top of this file) automatically, so a daemon restart reuses it instead
# of re-resolving and re-downloading the package from the npm registry
# every time. This does not cover a package's own separate downloads (e.g.
# a Playwright/Puppeteer-based server fetching a browser binary from a CDN
# via its postinstall script) -- consult that package's own env vars for
# those.
# Most MCP servers are single-threaded and get one tools/call at a time.
# parallel_tool_calls = true (default false) drops that serialization for
# this server only, for a server whose own implementation handles
# concurrent requests. It never affects another configured server.
# [[tools.mcp_servers]]
# name = "desktop-commander"
# transport = "stdio"
# command = "npx"
# args = ["-y", "@wonderwhy-er/desktop-commander@0.2.46", "--no-onboarding"]
# work_dir = "/path/to/workspace"
# parallel_tool_calls = false
# archied's own liveness surface, always on. GET /healthz and /health answer
# 200 once the daemon is serving (503 while it is still booting), and
# /health/detailed reports the readiness probes. This is what the update
# watchdog polls after restarting archied to decide whether the release came
# up or has to be rolled back, so it stays separate from the dashboard's
# /healthz: the dashboard can be switched off, and it runs as its own process
# in the extracted UI topology.
[health]
listen = "127.0.0.1:8485"
# Bounds one readiness probe's call into a service the daemon depends on but
# does not own (the Gateway), so a hung dependency degrades that probe instead
# of stalling the whole report. Omit for the default; a negative value leaves
# only the caller's own deadline in force.
# dependency_timeout = "5s"
# Web dashboard and API: task board, activity stream, chat, config,
# memory, SSE events. Served as an embedded SPA with a full REST
# and streaming API. Auth is token-based for non-loopback addresses;
# loopback binds (127.0.0.1, ::1, localhost) skip auth automatically.
#
# The dashboard is served by the
# standalone archie-ui process, not by archied: this listen address is what
# archie-ui binds, and archied runs no dashboard listener at all. Run
# `archie-ui -config <same config.toml>` alongside the other services.
[web]
listen = "127.0.0.1:8484"
# Trust X-Forwarded-Proto and X-Forwarded-Host headers when validating Origin
# on mutating requests (CSRF protection).
#
# Off by default. When false, the expected Origin scheme is derived directly
# from the daemon's own network connection (http unless TLS is terminated by
# archied directly). Setting this to true causes archied to respect the
# X-Forwarded-Proto header sent by a reverse proxy (e.g. Traefik, Caddy, Nginx).
#
# SECURITY WARNING: Enable ONLY when archied is deployed behind a trusted
# reverse proxy that strips or overwrites any client-supplied X-Forwarded-*
# headers. Enabling this on a directly exposed daemon allows untrusted
# clients to spoof the Origin scheme and bypass CSRF protection.
# trust_forwarded_headers = false
# Where archied writes its logs. Without file set, output goes only to
# stderr -- which under systemd means journald holds the sole copy, and
# running by hand leaves no record at all. Setting file gives a durable
# copy independent of the supervisor, and is what lets the dashboard show
# history from before it connected. Both stderr and the file get output
# unless quiet is set.
# [log]
# file = "~/.local/share/archie/logs/archied.log"
# max_size_mb = 20 # rotate once the file exceeds this; 0 uses the default (20)
# keep = 5 # rotated files to retain; 0 uses the default (5)
# level = "info" # "debug" | "info" | "warn" | "error"
# quiet = false # true suppresses stderr once a file is configured
# The built-in file-backed memory engine (internal/domain/memory +
# internal/infrastructure/memory) is always on -- nothing here is required
# to get memory at all. engine selects among the domain/memory engine
# family; "builtin" (the default, same as leaving it unset) is the only
# one implemented so far.
# [memory]
# engine = "builtin" # "builtin" is the only engine implemented so far
# Notifications for human-in-the-loop moments
# (approval requests, gate failures, parked tasks).
# Archie POSTs a JSON payload to the webhook
# wire it to n8n, email, Slack, or any HTTP endpoint.
[notify]
# webhook = "https://n8n.example.com/webhook/archie"
[budgets]
max_steps = 60
wall_clock = "30m" # one agent call
wall_clock = "30m" # one agent call
gate_max_failures = 5
task_wall_clock = "4h" # a whole task run; keep containers.max_uptime at or above it
task_wall_clock = "4h" # a whole task run
[health]
listen = "127.0.0.1:8485"
# dependency_timeout = "5s"
# Trace export. Without an endpoint nothing is exported.
# [telemetry]
# endpoint = "127.0.0.1:4317" # OTLP/gRPC collector
# insecure = false # plaintext to the collector
# ca_file = "" # PEM bundle verifying the collector
# sample_ratio = 1.0 # share of new traces recorded
# headers = { authorization = "Bearer ..." }
[web]
listen = "127.0.0.1:8484" # "off" disables the dashboard
# trust_forwarded_headers = false # only behind a proxy you control
# Services selects contract adapters at composition time.
[services.gateway]
target = "127.0.0.1:8585" # archie-gateway's gRPC address (always remote once set)
# listen = "127.0.0.1:8585" # The address archie-gateway BINDS. Read only by the
# # archie-gateway process; every client ignores it. Defaults
# # to the target above, so a default deployment's client and
# # server cannot drift onto different ports. Set it when the
# # host already owns that port.
# target_token = "..." # Bearer [REDACTED] for a NON-loopback listener. A loopback listener
# # (127.0.0.1/::1/localhost) needs no token. A non-loopback
# # listener without a token fails closed, as does a
# # non-loopback dial without one. The same token is
# # presented as GATEWAY_TOKEN by remote consumers.
target = "127.0.0.1:8585"
# listen = "127.0.0.1:8585"
[services.state]
target = "127.0.0.1:9090" # REQUIRED. The State Store gRPC address archied and
# # archie-gateway dial. They own no task data
# # in-process: the standalone archie-state-store process
# # owns it in PostgreSQL. An empty target is a startup error.
# listen = "127.0.0.1:9090" # The address archie-state-store BINDS. Read only by that
# # process; every client ignores it. Defaults to the target
# # above, so a default deployment's client and server cannot
# # drift onto different ports. Move it when a port is already
# # taken on the host.
# target_token = "..." # bearer token for a NON-loopback target. A loopback target
# # (127.0.0.1/::1/localhost) needs no token. A non-loopback
# # target without a token fails closed. The same token is injected as STATE_STORE_TOKEN into
# # archie-agent containers so the agent authenticates to the
# # same remote store. See deployments/README.md for how to
# # start archie-state-store.
target = "127.0.0.1:9090"
# listen = "127.0.0.1:9090"
# [tls]
# ca_file = "/etc/archie/tls/ca.pem"
# cert_dir = "/etc/archie/tls"
# NATS is the sole autonomous workflow handoff. mode changes only where the
# broker runs; every workflow still runs in a managed task container:
# "embedded" – in-process nats-server (the default; no external server)
# "external" – connect to url
# Leave the section absent to run embedded.
# [nats]
# mode = "embedded" # "embedded" | "external"
# url = "nats://localhost:4222" # required when mode = "external"
# token_env = "NATS_TOKEN" # optional external-server credential; embedded generates one per start
# mode = "embedded" # or "external" with url
# url = "nats://localhost:4222"
# token_env = "NATS_TOKEN"
# Unbound webhook capture: POST /webhooks/capture/{source} accepts and
# stores any inbound payload archie doesn't yet have a binding for, so it can
# be inspected and mapped later.
# Stored in the same PostgreSQL database as tasks, not NATS -- capture has one
# writer and one (human, dashboard) reader, so it doesn't need JetStream's
# fan-out/replay machinery. All fields default when the section is absent;
# capture is on by default.
#
# The receiver is mounted by the
# archie-ui process, which projects these same values from this file; the
# daemon's binding-dispatch loop consumes captures from the shared State
# Store. Leave this section here even if you do not edit it: both processes
# read it.
# [capture]
# retention = "168h" # 7 days; prune-on-write deletes anything older
# max_events = 5000 # row cap, pruned on every insert regardless of age
# max_body_bytes = 262144 # 256 KiB; larger POSTs are rejected with 413
# rate_per_second = 1.0 # per-remote-address token bucket
# rate_burst = 5
# [log]
# file = "~/.local/share/archie/logs/archied.log"
# level = "info"
# The cron/scheduling ticker engine: how often scheduled jobs are checked,
# how many may run at once, and how long one may run. The engine polls a job
# store for what is due and dispatches each due job to the delivery it names
# -- so nothing here schedules anything by itself, it only tunes the timing.
# Absent is valid: every field defaults independently, and a section naming
# only one of them still gets the defaults for the other two.
#
# Zero (or absent) takes the default named below. A NEGATIVE value is a
# startup error, not a clamp: running something other than what was written
# is how a misconfiguration stays invisible. Zero cannot mean "off" here for
# the same reason it cannot in [tools.tool_policy] -- it is indistinguishable
# from an unset key.
# [scheduling]
# interval = "60s" # tick cadence: how often due jobs are checked.
# # Absent/zero means 1m. The finest granularity a
# # cron-style schedule needs, and polling a local
# # job store that often costs nothing.
# max_parallel = 4 # caps simultaneous parallel-pool runs, so a store
# # reporting many jobs due at once (the first tick
# # after long downtime, typically) cannot launch an
# # unbounded fan-out. Absent/zero means 4. It does
# # not bound the sequential pool, which is one by
# # definition.
# job_timeout = "1h" # bounds one run. Absent/zero means 1h. A job that
# # has not finished in an hour is stuck, and leaving
# # it in flight would suppress every later run of the
# # same job forever.
# events_sink = "none" # "bus" publishes each run and failure on the event
# # stream, which is what the dashboard timeline reads;
# # "none" (the default, same as leaving it unset)
# # leaves the engine unobservable -- a scheduled run
# # has no task or chat turn behind it, so with no
# # sink nothing anywhere records that it fired.
# # Any other value is a startup error, so a typo
# # cannot silently turn observability off.
# Playbook-binding at-rest encryption: [bindings].encryption_key resolves a
# 32-byte high-entropy key through the secret registry (engine + key) and seals
# each binding's HMAC secret in the bindings.secret column with AES-256-
# GCM. When the key is absent,
# binding secrets are stored as plaintext (the pre-t2db.7 behaviour) -- enabling
# encryption does not retroactively encrypt existing rows, which stay plaintext
# until they are edited. Rotation: after changing encryption_key, retain the
# previous material in previous_encryption_keys so rows sealed under the old
# key still decrypt, then drop it once no row references it. A reload that
# changes these keys requires a daemon restart.
# [bindings]
# encryption_key = { engine = "env", key = "ARCHIE_BINDING_KEY" }
# previous_encryption_keys = [ { engine = "env", key = "ARCHIE_BINDING_KEY_OLD" } ]
# encryption_key = { engine = "env", key = "ARCHIE_BINDING_KEY" }
# Docker sandbox execution of archie-agent is mandatory for autonomous
# workflows. Omit this section to use the default image, lifetimes, and pull
# policy; the options below show the available overrides. If Docker or
# the image is unavailable, chat and the dashboard still start while tasks
# park explicitly; archied never falls back to a host agent loop.
# [containers]
# image = "ghcr.io/samcharles93/archie-agent:latest"
# max_concurrency = 4 # optional cap; 0/absent means no global cap
# max_uptime = "60m" # container lifetime cap
# volume_ttl = "72h" # max age for persistent repo volumes and Git clone caches
# pull_policy = "missing" # "missing" or "always"
#
# A private registry needs a credential the daemon sends on pull (an
# anonymous pull always answers 401 there, whatever the policy). The value is
# a Docker registry.AuthConfig JSON document -- {"username":"bot","password":"..."}
# ("identitytoken"/"registrytoken" are alternatives; "serveraddress" is
# optional and defaults to the image's registry). Unset means anonymous pulls,
# exactly as before this key existed; a reference that cannot be resolved
# warns and pulls anonymously rather than failing the daemon.
# registry_auth = { engine = "env", key = "ARCHIE_REGISTRY_AUTH" }
#
# Agent profiles a workflow selects with `profile: <name>`. A workflow that
# names none runs under [containers].image with every tool.
# Once the State Store holds container policies, edit profiles in the
# dashboard (Settings, Advanced); a stored set replaces the file's.
# [containers.profiles.network-investigator]
# image = "archie-agent-net:local" # docker compose build agent-net; empty uses [containers].image
# tools = [] # allowlist over MCP, script and plugin tools; empty allows all
# A Kit profile runs every agent stage on an external CLI packaged as a Kit v3
# image: one workload Kit or published Kit set (which merges a workload with
# its mixins), pinned by digest.
# [containers.profiles.claude]
# kit = "docker/claude-code-kit@sha256:<digest>"
# adapter = "claude-code" # claude-code, codex, pi, omp or copilot; empty runs without capture tools or usage
#
# Credential bindings map a Kit's credential@1 service name to a secret. A
# binding alone grants nothing -- an identity resolves it only when its own
# org matches and the service is in its granted_credentials
# ([[identities]] above). Once the State Store holds it, edit bindings in the
# dashboard (Settings, Advanced); a stored set replaces the file's.
# [[containers.credentials]]
# service = "openai"
# org = "acme" # empty means the default org
# secret = {engine = "env", key = "OPENAI_API_KEY"}
# Access records: how long a recorded access denial is kept before the State
# Store's sweep deletes it. Zero means 90 days.
# [access]
# denial_retention = "2160h"
# At least one [[repos]] entry is required before archied will poll
# anything -- it is deliberately left commented rather than shipped active:
# an active example here validates as a normal, working repo (owner/name are
# only checked for non-empty), so archied would silently start polling a
# repository that doesn't exist. archied setup does not write this section
# ([[repos]] is an array of tables, which the text-patching setup uses
# cannot target) -- add at least one entry by hand.
#
# [[repos]]
# owner = "your-github-username"
# name = "todo"
# base = "main"
# ecosystem = "go" # "go", "python", "node", "rust", or "custom"
# # Override the ecosystem defaults when needed:
# # preflight = [["go", "version"]]
# # test_glob = "*_test.go"
# protect = ["_templ.go"]
# gate = [
# ["templ", "generate", "./components/"],
# ["go", "vet", "./..."],
# ["go", "build", "./..."],
# ["golangci-lint", "run"],
# ["go", "test", "./...", "-count=1"],
# ]
# # allow_concurrent = true # let the daemon run multiple tasks for this repo at once instead of
# # FIFO-serializing them; only safe when concurrent worktrees won't collide
# # (e.g. different base branches or packages per task). Still bounded by
# # [containers].max_concurrency globally.
# # persistent_storage = true # reuse a per-repo Docker volume and Git object cache until volume_ttl
# # max_retries = 5 # per-repo override of the global max_retries above
# ── Tools ───────────────────────────────────────────────────────────────────
# Limits on what a tool may return. These bound how much of the context window
# one tool call can spend: the workspace file tools truncate themselves, but
# skill bodies and MCP server results otherwise arrive whole.
#
# Zero (or absent) takes the default. A NEGATIVE value disables the limit --
# zero cannot mean "off" because it is indistinguishable from an unset key.
# [tools.tool_policy]
# max_result_chars = 50000 # cap on one tool result; -1 for no cap
# spill_dir = "" # unset by default, which truncates oversized results
# # inline. When set, a result over the cap is written
# # here in full and the model is handed the path.
# # It MUST be inside chat.workspace: the read tool
# # refuses paths outside it, so a spill anywhere else
# # is a reference the model cannot open -- worse than
# # truncating. Startup warns if it is outside.
# # Task agents work in their own worktree and cannot
# # read it at all; they always truncate.
# The web_fetch tool: retrieve a URL and return readable text.
# [tools.web_fetch]
# enabled = true # set false to withdraw the tool entirely
# timeout = "30s"
# max_bytes = 2000000
# allow_private_networks = false
# # Off by default, and worth leaving off. archied's own dashboard, NATS and
# # the Docker API answer on loopback and private addresses, and the URL to
# # fetch arrives through chat -- an untrusted path, since a forge issue body
# # or an inbound email can be quoted into a turn. The address is checked at
# # dial time rather than on the URL string, so a public name that resolves to
# # a private address is refused too. Turn this on only for a homelab endpoint
# # you intend Archie to reach.
# The generate_video tool: text-to-video via MiniMax's API. Off by default,
# unlike web_fetch -- this spends real API credits per call, so it needs an
# explicit opt-in and a working key before it is registered at all.
# [tools.minimax]
# enabled = true
# api_key = { engine = "env", key = "MINIMAX_API_KEY" }
# base_url = "" # override the API host; leave unset in normal operation
# # Generation is synchronous from the model's point of view: the tool call
# # blocks until MiniMax reports the video ready or failed, which can take
# # several minutes. The result is a hosted URL delivered through whatever
# # channel supports gateway.MediaSender (Telegram today); channels without
# # that support get the URL as a plain link in the reply text instead.
# Where releases and the extension catalogue come from on a new instance: an
# OCI repository and the base64 ed25519 key it signs with. Blank is the
# official source. Once stored, change them in the dashboard settings.
# [distribution]
# releases = "registry.example/owner/archie"
# releases_key = "base64 public key"
# catalogue = "registry.example/owner/archipelago/catalogue"
# catalogue_key = "base64 public key"
+44 -40
View File
@@ -19,18 +19,22 @@ 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) is **not** in this archive —
it only ever runs inside the Docker container `archied` spawns per task, never
as a host binary. Pull it from GHCR: `ghcr.io/samcharles93/archie-agent`.
`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
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`
pins the digest the release published. Set `[containers].registry_auth` when
that reference is on a registry that needs a login -- see
`deployments/systemd-user-service.md#6-pinning-the-archie-agent-image`.
## Quickstart
1. Pick a starting configuration. The full set of annotated templates lives
in this repository's `deployments/` directory on GitHub
(<https://github.com/samcharles93/archie-core/tree/main/deployments>) —
(<https://offloaded.dev>) —
`standalone.toml` (no forge, the simplest start),
`single-forge-github.toml`, `multi-forge-github-gitea.toml` and
`docker-nats-stack.toml` cover the common cases. Every one needs
`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:
```bash
@@ -55,18 +59,13 @@ as a host binary. Pull it from GHCR: `ghcr.io/samcharles93/archie-agent`.
./archied -config ~/.config/archie/config.toml
```
Dashboard reachability comes from `[web].listen` (default
`127.0.0.1:8484`, which needs no dashboard token). For a non-loopback
bind pass `-listen` with `-token` or `-token-file` to mint and persist
one. `archie-ui` reads `GATEWAY_TOKEN` / `STATE_STORE_TOKEN` from its
process environment only — it has no secret registry, so when those
tokens live in a secret manager, whatever starts `archie-ui` must export
them into its environment (the `[services.*].target_token` values in
`config.toml` are the other supported source).
Open `[web].listen` (default `127.0.0.1:8484`) to configure the organisation,
workspace and first administrator account. Remote access requires an HTTPS
reverse proxy. Complete setup before exposing the dashboard publicly.
4. For a persistent, 24/7 deployment instead of a foreground run, follow the
systemd user-unit runbook:
<https://github.com/samcharles93/archie-core/blob/main/deployments/systemd-user-service.md>.
<https://offloaded.dev>.
## Verifying an install
@@ -90,12 +89,15 @@ an install (or an upgrade across v1.30.0) needs its unit as well -- see
### Native self-update
`archie-update-install` downloads the approved release's Linux/amd64 archive
and verifies its `SHA256SUMS` entry before executing or installing it. Releases
must include `release.json`, all host binaries, and the two updater scripts.
Older releases without this contract cannot be installed through the artifact
path. `--from-source` (or `ARCHIE_UPDATE_SOURCE_BUILD=1`) explicitly clones and
builds the selected release instead.
Install on Settings → Status runs `archied update install -version X` against
the release source in the update settings. It fetches release `vX`, refuses it
unless the source's key signed its statement, and downloads the Linux/amd64 zip
only if it hashes to the digest that statement names. Every host binary in the
zip must report `X`. It then pulls the agent image the statement pins by digest, backs up the database to
`db.pre-update.dump` in the state directory, stages the new binaries beside the
live ones and hands the transaction to `archied update watchdog` in a process of
its own (a transient systemd user unit). Nothing that runs changes until the
watchdog takes over.
`archied update check` finds the newest GitHub release with a linux-amd64 zip on
the channel chosen under Settings → Status → Updates: stable, next (includes
@@ -103,30 +105,32 @@ prereleases) or a pinned version. From a shell it reads
`ARCHIE_UPDATE_RELEASE_CHANNEL` and `ARCHIE_UPDATE_PIN`, or `-channel` and `-pin`.
The notification destination remains separate from the release channel.
For scheduled, unattended runs, `archie-update-install --auto` discovers the
selected release and refuses if the daemon reports work in flight. It checks
again immediately before promotion. A scheduler can set
`ARCHIE_UPDATE_RELEASE_CHANNEL` and `ARCHIE_UPDATE_PIN`; nothing schedules updates
by default. All services stop through their ordinary graceful shutdown path.
`release.json` supplies the service order and required config sections to both
first-install and self-update. A missing unit or config section produces an
ordered migration plan and refuses installation. Apply that plan before retrying.
Automatic topology edits are intentionally unsupported.
The watchdog switches staged executables by rename, restarts services, and
requires the candidate daemon's existing readiness registry to remain healthy
for 120 seconds. Agent images come from the release manifest by digest. The
image switch updates the control-plane policy, preserving other settings;
rollback restores the prior image policy with conflict detection. Source builds
use the built image's immutable image ID.
The watchdog stops the units in reverse `release.json` order, switches the
staged executables by rename, switches the control-plane image policy (only the
image field, with conflict detection), and restarts the units in order through
`systemctl --user`. archied must report the new version and stay healthy for
120 seconds. Otherwise the watchdog restores the previous binaries and image
policy. Data is not rolled back unless the new release migrated the database:
then the previous binaries cannot serve it, so the pre-update backup is restored
and the outcome report says that every write since the update began is gone.
Without a systemd user manager the watchdog switches binaries and image policy
but restarts nothing, and the install reports that the services need a manual
restart.
Transactions live in `${XDG_STATE_HOME:-~/.local/state}/archie/update`, outside
the binary directory. `phase`, `environment`, `image.json` (when applicable),
and `previous/` describe the transaction. A lock reports the owning process.
On daemon boot, an interrupted transaction schedules independent recovery before
normal startup. To recover manually, run `transaction/watchdog --recover` from
that state directory. A failed recovery keeps the journal for another attempt.
the binary directory: `transaction/journal.json`, `transaction/previous/`, and
`transaction/archied`, the frozen copy of the archied that wrote the journal. On
daemon boot, an interrupted transaction is
handed to that frozen watchdog with `-recover` before normal startup: a
transaction that never started is discarded, one that was switching or observing
is rolled back, and a decided one is finished. To recover manually, run
`transaction/archied update watchdog -recover -bin-dir ~/.local/bin` from that
state directory. A failed recovery keeps the journal for another attempt.
Database snapshots remain available for manual recovery. Schema migrations and
PostgreSQL data are never automatically reversed.
The database backup stays in the state directory after a committed update for
manual recovery with `archie-state-store restore`.
+18 -16
View File
@@ -7,9 +7,6 @@ This directory contains configuration templates and guides for different deploym
- **[`single-forge-github.toml`](./single-forge-github.toml)**:
Standard single-forge deployment managing multiple GitHub repositories under a single bot account and GitHub token.
- **[`multi-forge-github-gitea.toml`](./multi-forge-github-gitea.toml)**:
Multi-identity deployment running GitHub and a self-hosted Gitea instance simultaneously with distinct bot accounts, tokens, and repository sets.
- **[`standalone.toml`](./standalone.toml)**: start here. Event-driven
automation with no forge or repositories, local Ollama models, loopback
services and no tokens.
@@ -52,10 +49,10 @@ PostgreSQL database `database_url` names and serves the `StateStore` gRPC
contract. BOTH `archied` and `archie-gateway` dial it via
`[services.state].target` and never open the task tables themselves. The templates set
`[services.state]` accordingly: a host-only agent reaches a loopback bind
(`127.0.0.1:9090`) with no token, while a container-mode agent needs the
Docker bridge gateway address plus a matching bearer token (`target_token` /
`--token` / `STATE_STORE_TOKEN`), because a container cannot reach the host's
loopback.
(`127.0.0.1:9090`), while a container-mode agent needs the Docker bridge
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`.
## Running the dashboard
@@ -69,24 +66,29 @@ default). Start it after the Gateway and the State Store:
archie-ui -config ~/.config/archie/config.toml
```
A non-loopback `[web].listen` requires a dashboard token (`-token`, or
`-token-file` to mint and persist one); a loopback bind needs none.
Open the dashboard to configure the organisation, workspace and first administrator account.
Use HTTPS through a reverse proxy for remote access, and complete setup before exposing it publicly.
`archied` runs no dashboard listener at all, so webhook capture
(`POST /webhooks/capture/{source}`) is received by archie-ui and the
binding-dispatch loop in `archied` consumes what arrives from the shared
State Store.
Auth note: unlike `archied`, archie-ui has no secret registry --
`GATEWAY_TOKEN`/`STATE_STORE_TOKEN` resolve from its process environment
only (or from `[services.*].target_token` in `config.toml`), so whatever
starts archie-ui must export those tokens into its environment. See the UI
Service unit in `systemd-user-service.md` for the worked example.
The dashboard speaks plain HTTP. A non-loopback bind therefore carries the
session cookie and the provider token in clear over the network, and
archie-ui warns about exactly that at startup. Terminate TLS in front of it
(a reverse proxy or the tunnel itself) and set
`[web].trust_forwarded_headers = true` to declare the proxy and silence the
warning; leaving it off while exposing the port directly is the case the
warning names.
Auth note: archie-ui authenticates to its dependencies with its `[tls]`
certificate (`archie-ui.pem`).
```bash
# loopback (host-only agent)
archie-state-store -config ~/.config/archie/config.toml -listen 127.0.0.1:9090
# or container-mode: bind the bridge gateway with a token
archie-state-store -config ~/.config/archie/config.toml -listen 172.17.0.1:9090 -token <token>
# or container-mode: bind the bridge gateway ([tls] required)
archie-state-store -config ~/.config/archie/config.toml -listen 172.17.0.1:9090
```
## Verifying the daemon
+13 -3
View File
@@ -25,13 +25,23 @@ listen = "127.0.0.1:8484"
# when a port is already taken on the host -- before the
# listen key existed the collision could only be worked around by hand-writing
# a matching target and passing -listen, and it read as a code fault.
#
# Task containers dial the target over the Docker bridge gateway, so the store
# listens on every interface and [tls] (issued by `task dev:tls`) is required.
[services.state]
target = "127.0.0.1:9091"
listen = "127.0.0.1:9091"
target = "172.17.0.1:9091"
listen = "0.0.0.0:9091"
[tls]
ca_file = "tmp/dev-tls/ca.pem"
cert_dir = "tmp/dev-tls"
# `task dev` runs archie-gateway via dev:gateway, which also passes no -listen:
# the listen below is what it binds. Stated explicitly so the value archie-ui
# dials is visible next to the State Store one.
[services.gateway]
target = "127.0.0.1:8585"
listen = "127.0.0.1:8585"
listen = "127.0.0.1:8585"
[services.daemon]
target = "127.0.0.1:8587"
listen = "127.0.0.1:8587"
+12 -9
View File
@@ -13,7 +13,6 @@
poll_interval = "60s"
bot_user = "archie"
diff_cap_lines = 0
work_dir = "~/.local/share/archie/work"
state_dir = "~/.local/share/archie" # NATS store, task logs
# The State Store's PostgreSQL connection (PostgreSQL 18, required).
@@ -26,13 +25,15 @@ target = "127.0.0.1:8585"
# The State Store gRPC service owns the PostgreSQL task data; archied and
# archie-gateway dial it and never open those tables themselves.
# This deployment runs the agent in containers, so target is the Docker bridge
# gateway (172.17.0.1) the container can reach, with a matching target_token
# that archie-state-store validates. Host-only agent: use 127.0.0.1:9090 with
# no token.
# This deployment runs the agent in containers, so the target is the Docker
# bridge gateway (172.17.0.1) the container can reach. A non-loopback address
# needs [tls]; see config.example.toml.
[services.state]
target = "172.17.0.1:9090"
target_token = "change-me-state-store-token"
[tls]
ca_file = "/etc/archie/tls/ca.pem"
cert_dir = "/etc/archie/tls"
[forge]
type = "gitea"
@@ -60,11 +61,13 @@ url = "nats://172.19.0.1:4222"
network = "archie-core_default"
# Pin your own registry's tag/digest -- never deploy against a bare
# ":latest" reference, which can change under a running deployment with no
# warning. See deployments/systemd-user-service.md#pinning-the-archie-agent-image
# for the pinning convention this repo follows for its own GHCR image.
# warning. See deployments/systemd-user-service.md#6-pinning-the-archie-agent-image
# for the pinning convention this repo follows for its own agent image.
image = "git.example.com/you/archie-agent:v1.21.0" # or "@sha256:..." for a production digest pin
max_concurrency = 4
max_uptime = "60m"
# Must outlast the whole-task limit (default 4h), or the reaper ends a run the
# task budget would have parked.
max_uptime = "5h"
# "missing": pull only when the image is absent locally. "always" against a
# private registry answers 401 because the daemon sends no credentials, so
# refresh the agent by hand: docker compose pull agent
-104
View File
@@ -1,104 +0,0 @@
# ==============================================================================
# Multi-Forge (GitHub + Gitea) Deployment Example
#
# Runs GitHub and a self-hosted Gitea instance simultaneously.
# Each [[identities]] entry defines its own forge, token, and repository list.
# Each identity runs in an isolated background goroutine and worktree directory.
# ==============================================================================
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"
[services.gateway]
target = "127.0.0.1:8585"
# The State Store gRPC service owns the PostgreSQL task data; archied and
# archie-gateway dial it and never open those tables themselves.
# This deployment runs the agent in containers, so target is the Docker bridge
# gateway (172.17.0.1) the container can reach, with a matching target_token
# that archie-state-store validates. Host-only agent: use 127.0.0.1:9090 with
# no token.
[services.state]
target = "172.17.0.1:9090"
target_token = "change-me-state-store-token"
[models]
triage = "openai/gpt-6-luna"
planner = "openai/gpt-6-luna"
builder = "openai/gpt-6-luna"
[providers.openai]
class = "openai"
api_key_env = "OPENAI_API_KEY"
[nats]
mode = "embedded"
[containers]
# Pinned to a verified digest -- archie-agent has no published semver tag
# yet (CI only pushes :latest). See
# deployments/systemd-user-service.md#pinning-the-archie-agent-image.
image = "ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090"
pull_policy = "missing"
[budgets]
max_steps = 60
wall_clock = "30m"
# ------------------------------------------------------------------------------
# Identity 1: GitHub Bot
# ------------------------------------------------------------------------------
[[identities]]
name = "github-bot"
bot_user = "archie-github"
bot_email = "archie-github@users.noreply.github.com"
[identities.forge]
type = "github"
host = "https://github.com"
token = { engine = "env", key = "ARCHIE_GITHUB_TOKEN" }
[identities.dispatch]
trigger = "assignee"
ack_reaction = "eyes"
[[identities.repos]]
owner = "my-org"
name = "github-repo-one"
ecosystem = "go"
[[identities.repos]]
owner = "my-org"
name = "github-repo-two"
ecosystem = "node"
# ------------------------------------------------------------------------------
# Identity 2: Self-Hosted Gitea Bot
# ------------------------------------------------------------------------------
[[identities]]
name = "gitea-bot"
bot_user = "archie-gitea"
bot_email = "archie-gitea@example.com"
[identities.forge]
type = "gitea"
host = "https://gitea.example.com"
token = { engine = "env", key = "ARCHIE_GITEA_TOKEN" }
[identities.dispatch]
trigger = "label"
ack_reaction = "eyes"
[[identities.repos]]
owner = "internal-team"
name = "gitea-repo-alpha"
ecosystem = "go"
[[identities.repos]]
owner = "internal-team"
name = "gitea-repo-beta"
ecosystem = "python"
+6 -12
View File
@@ -15,7 +15,6 @@ poll_interval = "60s"
label = "archie"
bot_user = "archie-bot"
bot_email = "archie-bot@users.noreply.github.com"
diff_cap_lines = 400
# The Gateway Service owns conversational state and serves ChatContract over
# gRPC. Run archie-gateway alongside archied and archie-ui (the dashboard
@@ -25,16 +24,11 @@ target = "127.0.0.1:8585"
# The State Store gRPC service owns the PostgreSQL task data. archied and
# archie-gateway dial it here and never open those tables themselves.
# This deployment runs the
# agent in containers, so the target must be the Docker bridge gateway address
# (172.17.0.1) that the container can reach, and a non-loopback target requires
# a matching target_token that archie-state-store validates -- start it with the
# same token (e.g. `archie-state-store ... -listen 172.17.0.1:9090 -token
# change-me-state-store-token`). For a host-only agent (no [containers]) use the
# loopback target 127.0.0.1:9090 with no token.
# This deployment runs the agent in containers, so the target is the Docker
# bridge gateway (172.17.0.1) the container can reach. A non-loopback address
# needs [tls]; see config.example.toml.
[services.state]
target = "172.17.0.1:9090"
target_token = "change-me-state-store-token"
[forge]
type = "github"
@@ -59,9 +53,9 @@ mode = "embedded"
[containers]
# Pinned to a verified digest -- archie-agent has no published semver tag
# yet (CI only pushes :latest). See
# deployments/systemd-user-service.md#pinning-the-archie-agent-image.
image = "ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090"
# yet (a release publishes :latest and :sha-<commit>). See
# deployments/systemd-user-service.md#6-pinning-the-archie-agent-image.
image = "git.catlow.cloud/sam/archie-agent@sha256:<digest>"
pull_policy = "missing"
[budgets]
+59 -52
View File
@@ -20,10 +20,9 @@ The State Store unit is `archie-state-store.service`. It owns the task data in
PostgreSQL and serves the `StateStore` gRPC contract. BOTH `archied` and
`archie-gateway` dial it via `[services.state].target` (see the `archied`
config below) and never open the task tables themselves. A
host-only agent uses the loopback bind with no token below; a container-mode
agent needs the Docker bridge gateway address plus a bearer token via
`--token`/`STATE_STORE_TOKEN` or `[services.state].target_token`, and a
non-loopback bind fails closed without one:
host-only agent uses the loopback bind below; a container-mode agent needs the
Docker bridge gateway address, and a non-loopback bind needs `[tls]` (see
`config.example.toml`):
`install.sh` writes `archie-state-store.service` with that loopback bind.
@@ -36,14 +35,12 @@ by `archied`, since the v1.30.0 extraction. `archied` starts no gateway for them
and logs nothing when one is absent, so a host that updates across v1.30.0
without this unit runs on with dead channels and a daemon that looks perfectly
healthy. `install.sh` writes this unit on a fresh install;
`scripts/archie-update-install` refuses an
`archied update install` refuses an
update when a host is missing a unit and names what is missing, which now fires
for a host that drifted or predates this release rather than the normal path.
It dials the Gateway for the chat contract and the State Store for the stored
channel settings, and reads the same `config.toml`. Like `archie-ui` it resolves
`GATEWAY_TOKEN` and `STATE_STORE_TOKEN` from its process environment, hence the
`EnvironmentFile`:
channel settings, and reads the same `config.toml`, including `[tls]`.
`install.sh` writes `archie-messaging.service`. Its `After=` and `Wants=`
lines only tidy the start sequence: nothing depends on that order, because
@@ -53,46 +50,26 @@ each service waits for the peers it needs.
The dashboard is served by the standalone UI Service, not by `archied`. It reads the same `config.toml`, dials
the Gateway and State Store targets already in it, and binds `[web].listen`.
A non-loopback bind requires a dashboard token (`-token`, or `-token-file` to
mint and persist one);
Open the dashboard to configure the organisation, workspace and first administrator account.
Complete setup before exposing it publicly; remote access requires an HTTPS reverse proxy.
**Auth note:** unlike `archied`,
`archie-ui` has no secret registry — it resolves `GATEWAY_TOKEN` and
`STATE_STORE_TOKEN` from its **process environment only** (or from the
`target_token` values in `config.toml`). Whatever starts `archie-ui` is
therefore responsible for exporting those tokens into its environment: keep
them in `~/.config/archie/env` (loaded by the `EnvironmentFile` line below),
not only in a secret manager. A deployment that authenticates `archied`
through bws/Vault but exports nothing for `archie-ui` leaves the dashboard
unable to dial its dependencies.
**Auth note:** `archie-ui` authenticates to the Gateway, State Store and
harness 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
the dashboard's health endpoint behind the token. A watchdog can curl
the dashboard's health endpoint behind account authentication. A watchdog can curl
`/healthz` without credentials.
`install.sh` writes `archie-ui.service`. It has no secret registry of its own,
so its token handling is the `EnvironmentFile` note above.
Concretely, for a deployment whose dependency tokens live outside
`config.toml`, `~/.config/archie/env` carries the two names and the unit
loads it; the dashboard token itself comes from `-token-file` (there is no
environment variable for it):
```bash
# ~/.config/archie/env
GATEWAY_TOKEN=... # presented to archie-gateway
STATE_STORE_TOKEN=... # presented to archie-state-store
```
`install.sh` writes `archie-ui.service`. Browser accounts are configured through the dashboard.
`After=` orders the start, it does not wait for the store to bind. The UI
process closes that gap itself: its event pump retries priming with backoff
until the State Store answers, so the activity feed goes live once the store
is up rather than staying history-only until the next restart.
For a non-loopback bind, override the installed unit's `ExecStart` with
`-token-file %h/.local/share/archie/web-token` (or `-token`) in a drop-in rather
than editing the installer's copy in place.
For remote access, configure a TLS reverse proxy and the instance public URL in
Access → Authentication. Enrol passkeys from Your account on HTTPS or localhost.
---
@@ -157,9 +134,10 @@ Compose service or host `archie-agent` binary is required.
Docker must be installed and reachable by the service user. With no explicit
broker or container settings, Archie defaults `containers.image` to
`ghcr.io/samcharles93/archie-agent:latest`. Every profile shipped in
`deployments/` overrides that default with a pinned reference -- see
[Pinning the archie-agent image](#pinning-the-archie-agent-image) below. An
`git.catlow.cloud/sam/archie-agent:latest`. `single-forge-github.toml` and
`docker-nats-stack.toml` override that default with a pinned reference
(`standalone.toml` and `dev.toml` leave it) -- see
[Pinning the archie-agent image](#6-pinning-the-archie-agent-image) below. An
explicit equivalent, pinned the same way, is:
```toml
@@ -167,7 +145,7 @@ explicit equivalent, pinned the same way, is:
mode = "embedded"
[containers]
image = "ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090"
image = "git.catlow.cloud/sam/archie-agent@sha256:<digest>"
pull_policy = "missing"
```
@@ -191,37 +169,66 @@ fall back to a host model loop.
## 6. Pinning the archie-agent Image
`ghcr.io/samcharles93/archie-agent:latest` is a moving target: every push to
`main` that touches the runtime's package closure re-publishes it
(`.github/workflows/deploy.yml`), so `latest` can change under a running
deployment with no warning and no way to reproduce a prior build.
`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:
As of this writing, `archie-agent` has **no published semantic-version tag**
-- CI only pushes `:latest` to GHCR (`archied` is versioned independently per
`RELEASING.md`, but that versioning is not yet reflected as a registry tag for
the agent image). Until CI publishes one, the only reproducible reference is
a content digest, resolved once and pinned explicitly:
- `.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:
```toml
[containers]
image = "ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090"
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 ghcr.io/samcharles93/archie-agent@sha256:...`),
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. `ghcr.io/samcharles93/archie-agent:v1.21.0`), prefer that tag for
(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
cannot reach it:
```toml
[containers]
registry_auth = {engine = "env", key = "ARCHIE_REGISTRY_AUTH"}
```
The secret resolves to a Docker `AuthConfig` JSON document: the object
`docker login` stores under `auths`, without the surrounding map, and with a
personal access token that can read the package as the password --
`{"username":"<user>","password":"<token>"}`. Put it in
`~/.config/archie/env` as `ARCHIE_REGISTRY_AUTH` so it stays out of
`config.toml`. The field is file-owned and settled at boot, so a change takes
effect on restart; a value that cannot be read logs a warning and pulls
anonymously, which is the failure the task reports as a capability error.
The bundled update adapter snapshots the configured `[containers].image` before
rebuilding it and restores that image if the restarted daemon fails its health
check. A custom image reference is therefore supported directly in
+22 -8
View File
@@ -8,7 +8,7 @@
# Embedded NATS is the normal deployment and needs no Compose service.
# State Store DB: docker compose up -d postgres
# External broker: docker compose up -d nats
# Build worker: docker compose build agent
# Build worker: task image:agent (stamps this checkout's version)
# Profile image: docker compose build agent-net
# Stop external: docker compose down
# Logs: journalctl --user -u archied -f (the daemon)
@@ -44,10 +44,18 @@ services:
# ── NATS JetStream ────────────────────────────────────────────────
nats:
image: nats:2.14-alpine3.22
command: -js -m 8222
# 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"'
environment:
NATS_TOKEN: ${NATS_TOKEN:-}
ports:
- "4222:4222" # client
- "8222:8222" # monitoring (http://localhost:8222)
- "127.0.0.1:8222:8222" # monitoring (http://localhost:8222)
volumes:
- nats_data:/data
restart: unless-stopped
@@ -67,7 +75,7 @@ services:
# "Started", which reads like a crash loop. Naming the service explicitly
# still works without activating the profile:
#
# docker compose build agent (also: task docker-build)
# docker compose build agent
# docker compose pull agent -- plain `pull` skips profiled services
#
# Routine freshness is handled by the daemon, which pulls this image per
@@ -78,10 +86,16 @@ services:
build:
context: .
dockerfile: Dockerfile
# Pinned to a verified digest -- archie-agent has no published semver
# tag yet (CI only pushes :latest). See
# deployments/systemd-user-service.md#pinning-the-archie-agent-image.
image: ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090
# Stamped into the agent so the version it reports is the one the rest of
# the install reports. `task image:agent` passes this checkout's version;
# a bare `docker build` passes nothing and the agent answers dev.
args:
RUNTIME_VERSION: ${RUNTIME_VERSION:-dev}
# A tag, not the digest: Compose refuses to build an image it is told to
# name by digest. The digest a task container actually runs is pinned in
# the daemon's own [containers] image, so nothing here decides it. See
# deployments/systemd-user-service.md#6-pinning-the-archie-agent-image.
image: git.catlow.cloud/sam/archie-agent:latest
# ── example agent profile image ─────────────────────────────────────
# The agent image plus network lookup tools, for a workflow that names
+19 -9
View File
@@ -1,8 +1,12 @@
# Generating a GitHub Token for Archie Core
This guide walks you through creating a GitHub Personal Access Token (PAT) for Archie Core.
This guide walks you through creating a GitHub Personal Access Token (PAT) for
Archie Core.
> **Important**: Archie Core requires a **Classic Personal Access Token** (starts with `ghp_...`). Fine-grained PATs currently lack necessary scope permissions for Git HTTP push operations, repository invitation acceptance, and cross-repository operations needed by the orchestrator.
> **Important**: Archie Core requires a **Classic Personal Access Token**
> (starts with `ghp_...`). Fine-grained PATs currently lack necessary scope
> permissions for Git HTTP push operations, repository invitation acceptance,
> and cross-repository operations needed by the orchestrator.
---
@@ -11,23 +15,29 @@ This guide walks you through creating a GitHub Personal Access Token (PAT) for A
Archie Core uses the GitHub API to:
1. Poll assigned or labelled issues (`archie:queued`).
2. Update issue labels as tasks transition (`archie:working`, `archie:pr`, `archie:parked`).
2. Update issue labels as tasks transition (`archie:working`, `archie:pr`,
`archie:parked`).
3. Post status comments and emoji reactions.
4. Create branches, commit code changes, and open Pull Requests for human review.
4. Create branches, commit code changes, and open Pull Requests for review.
---
## Step-by-Step Instructions: Creating a Classic Token
1. Navigate to [GitHub Settings → Developer Settings → Tokens (classic)](https://github.com/settings/tokens).
1. Navigate to
[GitHub Settings → Developer Settings → Tokens (classic)](https://github.com/settings/tokens).
2. Click **Generate new token** → **Generate new token (classic)**.
3. Set the **Note**: `Archie Core` (or your bot's name).
4. Choose an **Expiration** (e.g. 90 days, 1 year, or No expiration for dedicated bot accounts).
4. Choose an **Expiration** (e.g. 90 days, 1 year, or No expiration for
dedicated bot accounts).
5. Select the required scope:
- **`repo`** (Full control of private repositories — required for polling, commenting, pushing branches, and opening PRs).
- **`workflow`** (Optional — required if Archie needs to update GitHub Actions workflows).
- **`repo`** (Full control of private repositories — required for polling,
commenting, pushing branches, and opening PRs).
- **`workflow`** (Optional — required if Archie needs to update GitHub
Actions workflows).
6. Scroll to the bottom and click **Generate token**.
7. **Copy your token immediately** (starts with `ghp_...`). You won't be able to see it again!
7. **Copy your token immediately** (starts with `ghp_...`). You won't be able to
see it again!
---
+34 -37
View File
@@ -1,16 +1,15 @@
# Building your first playbook binding
This walks through the whole no-code path the event-capture epic promises:
point an external app's webhook at archie, see the real payload it sends,
map the fields you care about, bind them to a workflow, and watch the next
matching event turn into a task -- no code, no redeploy, no restart.
This walks through the whole no-code path the event-capture epic promises: point
an external app's webhook at archie, see the real payload it sends, map the
fields you care about, bind them to a workflow, and watch the next matching
event turn into a task -- no code, no redeploy, no restart.
## 1. Create a source and send a test event
Open **Events → Inspector** and click **New source**. Archie shows the
source's URL and signing secret once; copy both. Point the external app's
webhook at that URL. Send one real
event however is easiest for a first test, e.g.:
Open **Events → Inspector** and click **New source**. Archie shows the source's
URL and signing secret once; copy both. Point the external app's webhook at that
URL. Send one real event however is easiest for a first test, e.g.:
```bash
curl -X POST http://localhost:8484/webhooks/capture/sentry \
@@ -18,25 +17,25 @@ curl -X POST http://localhost:8484/webhooks/capture/sentry \
-d '{"issue": {"title": "NullPointerException in checkout"}, "level": "error"}'
```
This event isn't signed yet, so it's captured but marked **unauthenticated**
-- visible for you to design against, but incapable of triggering anything: an unauthenticated event can never match a binding.
This event isn't signed yet, so it's captured but marked **unauthenticated** --
visible for you to design against, but incapable of triggering anything: an
unauthenticated event can never match a binding.
## 2. Inspect the captured payload
Open the dashboard's **Event inspector** (`/captures`). Your test event
appears there with its real body -- this is schema-by-example: you're
looking at an actual payload from the actual sender, not guessing at a
schema in advance.
Open the dashboard's **Event inspector** (`/captures`). Your test event appears
there with its real body -- this is schema-by-example: you're looking at an
actual payload from the actual sender, not guessing at a schema in advance.
## 3. Map the fields you care about
Open **Field mappings** (`/mappings`) → **New mapping**. Pick your captured
event from the dropdown, then click through its payload tree on the right --
every key and value is clickable. Clicking a value binds it as a field
(name, JSON path, and an inferred type you can change). Add whichever fields
your workflow needs (e.g. the issue title), mark the ones that must be
present as **Required**, hit **Preview** to confirm they resolve correctly
against the real payload, then **Save**.
every key and value is clickable. Clicking a value binds it as a field (name,
JSON path, and an inferred type you can change). Add whichever fields your
workflow needs (e.g. the issue title), mark the ones that must be present as
**Required**, hit **Preview** to confirm they resolve correctly against the real
payload, then **Save**.
## 4. Create the binding
@@ -46,20 +45,20 @@ Open **Playbook bindings** (`/bindings`) → **New binding**:
- **Source** -- the same `<source>` segment from step 1 (e.g. `sentry`).
- **Field mapping** -- the one you just saved.
- **Workflow** -- which registered workflow should run on a match.
- **Repo pin** (optional) -- leave both blank to use the single configured
repo; set owner/repo explicitly if you run a multi-repo deployment.
- **Shared secret** -- a real secret (16+ bytes), never `test1234`. The
sender signs every request body with this via HMAC-SHA256 so archie can
tell a genuine event from anyone who finds the URL.
- **Repo pin** (optional) -- leave both blank to use the single configured repo;
set owner/repo explicitly if you run a multi-repo deployment.
- **Shared secret** -- a real secret (16+ bytes), never `test1234`. The sender
signs every request body with this via HMAC-SHA256 so archie can tell a
genuine event from anyone who finds the URL.
Save. The binding starts in **draft** -- nothing fires yet.
## 5. Approve it
A **draft** or freshly-**edited** binding needs an explicit human 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
@@ -77,16 +76,14 @@ curl -X POST http://localhost:8484/webhooks/capture/sentry \
-d "$BODY"
```
This event is captured as **authenticated**, matched against your armed
binding, and dispatched into a new task through the exact same
gate/worktree/sandbox pipeline every other task goes through. Check
the **Tasks** page; a new task should appear, its body built from the fields
your mapping resolved.
This event is captured as **authenticated**, matched against your armed binding,
and dispatched into a new task through the exact same gate/worktree/sandbox
pipeline every other task goes through. Check the **Tasks** page; a new task
should appear, its body built from the fields your mapping resolved.
## Editing a live binding
Any edit to an armed binding -- even a typo fix -- drops it back to
**pending_approval** automatically. This can't be bypassed by editing; it
has to be re-approved. When editing, leave the **Shared secret** field blank
to keep the existing secret; only fill it in if you're deliberately
rotating it.
**pending_approval** automatically. This can't be bypassed by editing; it has to
be re-approved. When editing, leave the **Shared secret** field blank to keep
the existing secret; only fill it in if you're deliberately rotating it.
+24
View File
@@ -0,0 +1,24 @@
# 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.
+22
View File
@@ -76,6 +76,17 @@
"/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.6.0/": "/news/1.6.0/",
"/news/archie/1.7.0/": "/news/1.7.0/",
"/news/archie/1.8.0/": "/news/1.8.0/",
@@ -168,6 +179,17 @@
"/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.6.0/": "/news/1.6.0/",
"/news/archied/1.7.0/": "/news/1.7.0/",
"/news/archied/1.8.0/": "/news/1.8.0/",
+55
View File
@@ -1,4 +1,59 @@
[
{
"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",
+414
View File
@@ -0,0 +1,414 @@
# 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.
+248
View File
@@ -0,0 +1,248 @@
# User authorization boundaries
Archie separates authentication (which person or service is calling) from
permission to act on a resource. This inventory follows the
[OWASP Authentication Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)
and
[Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html),
including its guidance on attributes and relationships. It describes concrete
enforcement points and their regression tests; it is not a compliance
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
State Store opens the task/control-plane/account database; Gateway owns
conversation storage. Browser HTTP handlers never open either database.
Instance service credentials are administrative authority. They are not user
sessions and must never reach a browser, model, or agent container. A service
forwarding a principal preserves attribution and tenant scope; forwarding alone
does not mean every internal RPC evaluates Cedar. Most internal RPCs trust the
authenticated service and enforce their own resource scope. The public HTTP
boundary evaluates Cedar before invoking them. Task credentials have a separate,
explicit RPC allowlist and cannot call account or identity administration.
Local service listeners are trusted process boundaries. Loopback is not a
substitute for authentication on a remotely reachable listener. OIDC
credentials, local browser sessions, personal API tokens, service credentials,
and task grants must remain distinct.
## Policy and relationship model
`internal/domain/access` defines actions, resources, principals and memberships.
`internal/infrastructure/access` assembles Cedar entities and evaluates the
instance → organization → workspace → object chain. A forbid wins; each
applicable level must permit the operation. Missing or invalid policy chains
fail closed.
The default policies grant actions through scoped roles. Policies can also
restrict a named identity, workspace environment, owner, state, source address,
signature, run or step. HTTP task decisions now include the stored initiating
identity and task state; binding decisions include the stored binding state. The
HTTP source address is the actual connection peer, not an unverified forwarded
header. Membership and resource attributes must come from stored records or
authenticated context, never a request's assertion about itself.
Cedar permission is not ownership of another person's private data. Conversation
history, passkeys, recovery codes and personal tokens are bound to the person.
An organization or instance admin role does not override those relationships.
Account creation uses `manage_members` policy rather than a hard-coded admin
role. Authenticating through OIDC does not automatically grant membership, link
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` |
| 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 |
The policy HTTP matrix enumerates each registered protected route. It checks
both anonymous refusal and refusal by an explicit Cedar forbid, using the real
handler stack. Separate tests exercise allowed requests and personal ownership;
a denied-request matrix alone is not proof that a workflow works end to end.
## Public and personal routes
Public protocol entry points are `GET /api/auth/status`, `POST /api/auth/setup`,
`POST /api/auth/login`, `POST /api/auth/logout`, `POST /api/auth/recover`,
`POST /api/auth/passkey/begin`, `POST /api/auth/passkey/finish`,
`GET /oauth2/login`, `GET /oauth2/callback`, health probes and signed webhook
intake. Each has its own protocol checks. Static embedded app assets are public;
they do not contain user data. `/health/detailed` remains protected.
Personal routes under `/api/account/` require an active signed-in person and
server-derived ownership: password change, recovery-secret generation, passkey
begin/finish/list/delete. They do not require an organization administrator
role. `POST /api/accounts` and `/api/authentication` are administrative policy
routes.
## HTTP route inventory
The following routes are covered by `TestHTTPPolicyCannotBeBypassed` in
`internal/webui/authorization_surfaces_test.go`. `authorize.go` maps each to its
action/resource; the handler may impose a stricter record or instance boundary.
| Method | Route example |
| ------ | ----------------------------------------------------- |
| DELETE | `/api/access/policies` |
| DELETE | `/api/bindings/7` |
| DELETE | `/api/event-types/7` |
| DELETE | `/api/extensions/sample` |
| DELETE | `/api/mappings/7` |
| DELETE | `/api/orgs/7/members/sample` |
| DELETE | `/api/sources/sample` |
| DELETE | `/api/tokens/7` |
| GET | `/api/access/policies` |
| GET | `/api/alerts` |
| GET | `/api/audit` |
| GET | `/api/audit/export` |
| GET | `/api/authentication` |
| GET | `/api/bindings` |
| GET | `/api/bindings/7` |
| GET | `/api/bindings/7/dispatches` |
| GET | `/api/capabilities` |
| GET | `/api/captures` |
| GET | `/api/captures/7/dispatches` |
| GET | `/api/channels` |
| GET | `/api/chat/file/sample` |
| GET | `/api/chat/sessions` |
| GET | `/api/chat/sessions/7/messages` |
| GET | `/api/chat/sessions/7/turns` |
| GET | `/api/chat/update` |
| GET | `/api/config` |
| GET | `/api/control-plane/apply-status` |
| GET | `/api/control-plane/catalog` |
| GET | `/api/control-plane/resources/sample` |
| GET | `/api/control-plane/resources/sample/history` |
| GET | `/api/curators` |
| 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` |
| GET | `/api/mappings/7` |
| GET | `/api/orgs` |
| GET | `/api/orgs/7` |
| GET | `/api/orgs/7/members` |
| GET | `/api/orgs/7/workspaces` |
| GET | `/api/secret-engines` |
| GET | `/api/services` |
| GET | `/api/setup` |
| GET | `/api/skills` |
| GET | `/api/sources` |
| GET | `/api/stream` |
| GET | `/api/summary` |
| GET | `/api/task-meta` |
| GET | `/api/tasks` |
| GET | `/api/tasks/7` |
| GET | `/api/tasks/7/attempts` |
| GET | `/api/tasks/7/changes` |
| GET | `/api/tasks/7/debug` |
| GET | `/api/tasks/7/dispatches` |
| GET | `/api/tasks/7/logs` |
| GET | `/api/tasks/7/logs/download` |
| GET | `/api/tasks/7/sandbox` |
| GET | `/api/tokens` |
| GET | `/api/version` |
| GET | `/api/workflows` |
| PATCH | `/api/bindings/7` |
| PATCH | `/api/mappings/7` |
| POST | `/api/accounts` |
| POST | `/api/alerts/7/dismiss` |
| POST | `/api/bindings` |
| POST | `/api/bindings/7/approve` |
| POST | `/api/bindings/7/pause` |
| POST | `/api/bindings/7/resume` |
| POST | `/api/channels/7/reload` |
| POST | `/api/chat/answer` |
| POST | `/api/chat/cancel` |
| POST | `/api/chat/message` |
| POST | `/api/chat/persona` |
| POST | `/api/chat/stream` |
| POST | `/api/chat/update/defer` |
| POST | `/api/chat/update/install` |
| POST | `/api/control-plane/resources/sample/commands/sample` |
| POST | `/api/event-types` |
| POST | `/api/extensions` |
| POST | `/api/extensions/catalogue/sample/install` |
| POST | `/api/extensions/sample/accept` |
| POST | `/api/extensions/sample/approve-update` |
| POST | `/api/extensions/sample/rollback` |
| POST | `/api/extensions/sample/update` |
| POST | `/api/identities` |
| POST | `/api/identities/7/sample` |
| POST | `/api/mappings` |
| POST | `/api/mappings/preview` |
| POST | `/api/orgs` |
| POST | `/api/orgs/7/members` |
| POST | `/api/orgs/7/workspaces` |
| POST | `/api/secret-references/check` |
| POST | `/api/sources` |
| POST | `/api/sources/sample/approve-unsigned` |
| POST | `/api/sources/sample/secret` |
| POST | `/api/sources/sample/signing` |
| POST | `/api/tasks/7/action` |
| POST | `/api/tokens` |
| POST | `/api/work-requests` |
| PUT | `/api/access/policies` |
| PUT | `/api/authentication` |
| PUT | `/api/event-types/7` |
| PUT | `/api/extensions/sample/enabled` |
| PUT | `/api/extensions/sample/update-policy` |
| PUT | `/api/orgs/7/agents/sample` |
| PUT | `/api/orgs/7/members/sample` |
| PUT | `/api/sources/sample/delivery-header` |
| PUT | `/api/sources/sample/name` |
| PUT | `/api/workflows/7/enabled` |
## Verification limits
A synthetic browser authenticator verifies protocol behavior, not a physical
security key or every operating system. An OIDC unit test is not acceptance
against a deployed provider. Disposable PostgreSQL smoke checks verify real SQL
without putting database-dependent tests in the fast unit suite.
Existing anonymous conversations are retained but are not silently assigned to a
new person. Existing service credentials remain privileged; this inventory does
not claim that all internal gRPC methods have independent Cedar gates.
When changing a user-facing operation, update its inventory entry and its
allow/deny behavior cases. Include another user in the same organization, a
caller in another organization, a missing principal, unavailable policy storage,
and the applicable owner/workspace/instance restrictions.
Bootstrap is unauthenticated until the first administrator is created. Complete
setup before exposing a new installation to untrusted users. Last-active-owner
protection for identity suspension/retirement is tracked separately as
`archie-core-d7avc`; membership-policy guards are not that lifecycle guard.
+2
View File
@@ -0,0 +1,2 @@
node_modules/
out/
+115
View File
@@ -0,0 +1,115 @@
# e2e
Validation of the whole stack, run by hand or by an agent, never by
`task check` or CI. It needs PostgreSQL 18, five services, Vite and a browser,
which the gate must not. Docker is not needed: without it tasks queue and
park, which is useful data for the dashboard.
| File | What it does |
| --- | --- |
| `stack.sh` | Starts PostgreSQL 18 (port 55432) and the five services as local processes, then Vite on 5173 |
| `seed.sh` | Seeds the stack through the dashboard API; safe to rerun |
| `run.cjs` | Runs `checks/*.cjs` in Chromium; screenshots, manifest and `report.html` to `out/<stamp>/` |
| `checks/` | One module per behaviour |
| `results/` | One committed report per release |
## Run
```bash
task e2e:up # build, start everything, seed
task e2e:check # list available checks (no stack needed)
task e2e:check -- list # explicitly list checks
task e2e:check -- audit-redirect # one check
task e2e:check -- all # all checks
task e2e:check -- --headed accessibility # watch a check in Chromium
task e2e:check -- --headed all # watch every check
task e2e:down # stop; e2e/stack.sh reset also deletes the data
```
Headless is the default. `--headed` opens visible Chromium and slows browser
actions to 150ms so you can follow them; assertions and saved evidence are the
same in both modes. The terminal prints each check before it starts. Headed mode
requires a graphical desktop.
Nothing reads the installed config: `stack.sh` points the XDG directories at
`${ARCHIE_DEV_DIR:-~/.local/state/archie-dev}` and writes its overlay from
`deployments/dev.toml`. Logs are in its `logs/`. `e2e/stack.sh restart archied`
restarts one service. Run `task e2e:down` before starting again: startup refuses
occupied service ports and checks that each launched process stays alive.
The seed creates a local test administrator: `operator@example.test`, password
`archie-local-e2e-password`. Use it at `http://localhost:5173`; the browser
checks sign in with the same account. These are test fixtures for this
loopback-only stack. To use an existing test account, set `ARCHIE_E2E_EMAIL`
and `ARCHIE_E2E_PASSWORD` for both seeding and browser checks. Seeding never
resets an existing account or deletes test data.
The first run needs `pnpm install --dir e2e` and `pnpm --dir e2e exec playwright
install chromium`. In the cloud environment, Chromium and Playwright are
preinstalled; run with `NODE_PATH=$(pnpm root -g)`.
## Release evidence
```bash
node e2e/run.cjs --record v1.54.0 all
```
writes `results/v1.54.0.md`, the pass, fail or skip of every check for
that release. Commit it with the release. Screenshots stay in `out/`.
## Writing a check
A module in `checks/` exports `async ({ page, go, shot, fail, skip, settled, attach, tolerate })`.
- `go(path)` loads a dashboard route: `waitUntil: 'load'` plus 1200ms.
Wait for elements, never for `networkidle`: the event stream never goes idle.
- `shot(label)` saves `<check>-<kebab>[-<w>x<h>].png` after a short settle,
and records `{file, w, h, check}` in the manifest. The label is slugified,
so `shot('/')` becomes `routes-home.png`; a viewport other than the
1440x900 default adds a suffix (`-390x844`). Repeated labels get `-2`,
`-3`, so every capture is kept.
- `fail(msg)` records a problem without stopping.
- `skip(reason)` stops the check and records a skip: a missing
precondition, never a failure.
- `tolerate(re)` ignores console errors matching `re`, for a response the page is designed to survive.
- `attach(name, data)` saves a non-image artifact as `<check>-<name>`.
- `settled(sel?)` waits for a selector or URL, then settles briefly.
It is the harness-owned wait; checks need no capture wrapper or
ad-hoc sleeps around screenshots.
Each check gets a fresh page at 1440x900 with the login `storageState`;
a check that needs a phone viewport resizes it itself to 390x844.
Those are the only two viewports in use. A throw, a `fail`, or any
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.
`routes` loads every static route and flags text with stray leading,
trailing or doubled spaces. `seeded` checks the seed is visible.
`/logs` is visited but skipped by the whitespace lint: log lines are
data, not copy.
## Output
Every run writes `out/<stamp>/` with the screenshots,
`results.json` (the manifest: `{check, ok, ms, problems, artifacts[]}`,
plus `skipped`/`skipReason` for skips) and `report.html`: a self-contained
test record with the commit, totals and one row per check (status, time,
message and that check's artifacts, screenshots inline). `attach(name, data)`
adds a non-image artifact to the current check; a failed check also gets a
`failure` screenshot.
Exits: 0 when every check passes or skips, 1 when any check fails,
2 when the harness itself errors. `ARCHIE_E2E_URL` points the run at
a dashboard other than `http://localhost:5173`.
## Pitfalls
| Symptom | Cause | Fix |
| --- | --- | --- |
| State Store exits: server is older than PostgreSQL 18 | another server answered | `stack.sh` uses port 55432; set `ARCHIE_DEV_PGPORT` if that is taken |
| Startup says a port is in use | a stack or another process already owns it | Run `task e2e:down`, then `task e2e:up`; inspect any remaining listener with `ss -ltnp` |
| Your own shell is killed (exit 144) | `pkill -f` matched its own command line | `stack.sh stop` or `restart`, which kill by PID |
| Postgres aborts in the cloud | `/tmp/claude-0` is reset to mode 700 | `stack.sh` keeps the root cluster in `/var/lib/archie-dev` |
+53
View File
@@ -0,0 +1,53 @@
// Keyboard and phone access: the task dialog fits and tabs in order, pages
// title correctly, the skip link and palette focus main content, and
// query-only tab switches keep focus where it is.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot, settled }) => {
await page.setViewportSize({ width: 390, height: 844 });
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');
await dialog.waitFor();
await settled();
const bounds = await dialog.boundingBox();
assert.ok(bounds.y >= 0 && bounds.y + bounds.height <= 844, 'New task dialog extends outside viewport');
await shot('phone-task-dialog-top');
const start = dialog.getByRole('button', { name: 'Start task', exact: true });
await start.scrollIntoViewIfNeeded();
const button = await start.boundingBox();
assert.ok(button.y >= 0 && button.y + button.height <= 844, 'Start task cannot be reached by scrolling');
await shot('phone-task-dialog');
const close = dialog.getByRole('button', { name: 'Close', exact: true });
await dialog.getByRole('button', { name: 'Cancel', exact: true }).focus();
await page.keyboard.press('Tab');
assert.ok(await close.evaluate(el => el === document.activeElement), 'Close is missing from keyboard tab order');
const closeBounds = await close.boundingBox();
assert.ok(closeBounds.y >= 0 && closeBounds.y + closeBounds.height <= 844, 'Close cannot be reached by keyboard');
await page.keyboard.press('Escape');
for (const [path, title] of [['/tasks', 'Tasks'], ['/events', 'Events'], ['/account', 'Your account'], ['/settings/models', 'Models | Instance'], ['/org/models', 'Models | Organisation']]) {
await go(path);
assert.equal(await page.title(), `${title} | Archie`);
}
await page.keyboard.press('Tab');
const skip = page.getByRole('link', { name: 'Skip to main content', exact: true });
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: 'Sections', exact: true }).click();
await page.getByRole('navigation', { name: 'Sections', exact: true }).getByRole('link', { 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();
await page.getByRole('option', { name: 'Events', 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', 'palette navigation did not focus main');
// The conversation panel is only open on some entries to this page; the
// focus check below needs it closed either way.
const hide = page.getByRole('button', { name: 'Hide conversation', exact: true });
if (await hide.count()) await hide.click();
const tab = page.getByRole('tab', { name: /^Map/ });
await tab.click();
assert.ok(await tab.evaluate(el => el === document.activeElement), 'query-only navigation stole focus');
};
+113
View File
@@ -0,0 +1,113 @@
// Audit filters are server-evaluated through the URL contract: search,
// category, time range, back/forward restore, denied, and the actor filter.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail }) => {
const { requestMatching, waitForUrl } = trackAudit(page);
await go('/org/audit');
const status = await page.evaluate(async () => (await fetch('/api/auth/status')).json());
const actor = status?.user?.id;
assert.ok(actor, 'signed-in identity has no id');
const search = page.getByLabel('Search events', { exact: true });
let request = await requestMatching(
() => search.fill('repository'),
(u) => u.searchParams.get('q') === 'repository',
);
assert.ok(request, 'search issued no matching /api/audit request');
await waitForUrl((u) => u.searchParams.get('q') === 'repository');
assert.equal((await search.inputValue()), 'repository');
await go('/org/audit');
request = await requestMatching(
() => page.getByRole('button', { name: 'Runtime', exact: true }).click(),
(u) => u.searchParams.get('categories') === 'runtime',
);
assert.ok(request, 'category filter issued no matching /api/audit request');
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
assert.equal(
await page.getByRole('button', { name: 'Runtime', exact: true }).getAttribute('aria-pressed'),
'true',
);
// Time: Any time drops the window from the request rather than guessing one.
await page.getByRole('combobox', { name: 'Time range', exact: true }).click();
request = await requestMatching(
() => page.getByRole('option', { name: 'Any time', exact: true }).click(),
(u) => u.searchParams.get('from') === null && u.searchParams.get('categories') === 'runtime',
);
assert.ok(request, 'Any time issued no matching /api/audit request');
await waitForUrl((u) => u.searchParams.get('since') === 'any');
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Any time');
// Back/forward restore the controls the URL describes.
const backRequest = page.waitForRequest(
(r) => {
const u = new URL(r.url());
return u.pathname === '/api/audit' && u.searchParams.get('categories') === 'runtime' && !!u.searchParams.get('from');
},
{ timeout: 8000 },
);
await page.goBack();
await backRequest;
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime' && u.searchParams.get('since') === null);
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Last 30 days');
assert.equal(
await page.getByRole('button', { name: 'Runtime', exact: true }).getAttribute('aria-pressed'),
'true',
'back did not restore the category toggle',
);
const forwardRequest = page.waitForRequest(
(r) => {
const u = new URL(r.url());
return u.pathname === '/api/audit' && u.searchParams.get('categories') === 'runtime' && u.searchParams.get('from') === null;
},
{ timeout: 8000 },
);
await page.goForward();
await forwardRequest;
await waitForUrl((u) => u.searchParams.get('since') === 'any');
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Any time');
// Denied reaches the server through the same URL contract as the other
// filters. It must both update the URL and issue a request.
await go('/org/audit');
const denied = page.getByRole('button', { name: 'Denied', exact: true });
request = await requestMatching(
() => denied.click(),
(u) => u.searchParams.get('outcome') === 'denied',
3000,
);
const deniedUrl = new URL(page.url());
if (!request || deniedUrl.searchParams.get('outcome') !== 'denied') {
await shot('denied');
fail(
`Denied filter did not reach the server: URL ${page.url()} has outcome=${deniedUrl.searchParams.get('outcome') ?? 'absent'}, ` +
`aria-pressed=${await denied.getAttribute('aria-pressed')}, no /api/audit request with outcome=denied`,
);
} else {
assert.equal(await denied.getAttribute('aria-pressed'), 'true');
}
// Advanced actor filter: server-evaluated, in the URL, shown as a chip.
await go('/org/audit');
await page.getByRole('button', { name: 'Filters', exact: true }).click();
const actorInput = page.getByLabel('Actor', { exact: true });
request = await requestMatching(
async () => {
await actorInput.fill(actor);
await actorInput.press('Enter');
},
(u) => u.searchParams.get('actor') === actor,
);
assert.ok(request, 'advanced actor filter issued no matching /api/audit request');
await waitForUrl((u) => u.searchParams.get('actor') === actor);
assert.match(
await page.locator('ul[aria-label="Active filters"] li', { hasText: 'Actor:' }).first().innerText(),
new RegExp(actor),
);
await shot('filters');
await page.keyboard.press('Escape');
};
+42
View File
@@ -0,0 +1,42 @@
// The audit page at phone width: secondary columns collapse, and the list,
// an expanded row and the filters dialog fit without horizontal overflow.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail, settled }) => {
trackAudit(page);
await page.setViewportSize({ width: 390, height: 844 });
await go('/org/audit');
const assertNoOverflow = async (label) => {
const { scrollWidth, innerWidth } = await page.evaluate(() => ({
scrollWidth: document.documentElement.scrollWidth,
innerWidth,
}));
if (scrollWidth > innerWidth) {
fail(`${label} overflows 390px: documentElement.scrollWidth=${scrollWidth} > innerWidth=${innerWidth}`);
}
};
await page.locator('[data-row-key]').first().waitFor();
await assertNoOverflow('audit list');
assert.equal(
await page.locator('thead th', { hasText: 'Target' }).first().evaluate((el) => getComputedStyle(el).display),
'none',
'secondary columns are still rendered on the phone',
);
await shot('list');
const phoneRow = page.locator('[data-row-key]').first();
await phoneRow.focus();
await page.keyboard.press('Enter');
await settled();
assert.equal(await phoneRow.getAttribute('aria-expanded'), 'true', 'phone row did not expand');
await assertNoOverflow('expanded change set');
await shot('expanded');
await page.getByRole('button', { name: 'Filters', exact: true }).click();
await page.getByRole('dialog').first().waitFor();
await settled();
await assertNoOverflow('advanced filters');
await shot('filters');
};
+50
View File
@@ -0,0 +1,50 @@
// A deep link to the old history route redirects to the audit page keeping
// section, actor, since and the hash, and the feed loads with filter chips.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail }) => {
const { lastRequest } = trackAudit(page);
await go('/org/audit');
const status = await page.evaluate(async () => (await fetch('/api/auth/status')).json());
const actor = status?.user?.id;
assert.ok(actor, 'signed-in identity has no id');
const deepLink = `/settings/history?section=container-runtime-policies&actor=${encodeURIComponent(actor)}&since=30d#deep`;
await go(deepLink);
assert.match(page.url(), /\/org\/audit\?/, 'history did not redirect to the audit route');
assert.match(page.url(), /section=container-runtime-policies/, 'redirect dropped section');
assert.match(page.url(), new RegExp(`actor=${encodeURIComponent(actor)}`), 'redirect dropped actor');
assert.match(page.url(), /since=30d/, 'redirect dropped since');
assert.match(page.url(), /#deep$/, 'redirect dropped the hash');
const redirected = lastRequest();
assert.ok(redirected, 'the redirect issued no /api/audit request');
assert.equal(redirected.searchParams.get('kind'), 'container-runtime-policies');
assert.equal(redirected.searchParams.get('actor'), actor);
// The feed must be readable before anything below can mean anything. A 500
// here is the whole page: say what the server answered instead of timing out.
const probe = await page.evaluate(async () => {
const response = await fetch('/api/audit?limit=1');
return { status: response.status, body: await response.text() };
});
if (probe.status !== 200) {
await shot('unavailable');
fail(`GET /api/audit returned ${probe.status}: ${probe.body.slice(0, 200)}`);
return;
}
const kindChip = page.locator('ul[aria-label="Active filters"] li', { hasText: 'Kind:' });
await kindChip.first().waitFor({ timeout: 8000 });
assert.match(await kindChip.first().innerText(), /Container runtime policies/, 'kind chip missing its catalog title');
assert.match(
await page.locator('ul[aria-label="Active filters"] li', { hasText: 'Actor:' }).first().innerText(),
new RegExp(actor),
'actor chip missing',
);
await shot('redirect');
await go('/org/audit');
await page.locator('[data-row-key]').first().waitFor();
await shot('desktop');
};
+148
View File
@@ -0,0 +1,148 @@
// Audit retention reads the stored resource, the live tail prepends new rows
// without a reload and holds them behind a button while scrolled away, and a
// retention save persists. The save stays last: it must not stop the rest.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail, settled }) => {
const { loadCount } = trackAudit(page);
await go('/org/audit');
const resourceResponse = await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`);
assert.equal(resourceResponse.status(), 200, 'audit-retention resource is unreadable');
const retentionResource = await resourceResponse.json();
const retentionHours = (value) => {
const match = String(value || '').match(/^(\d+)h$/);
return match ? Number(match[1]) : 0;
};
const originalHours = retentionHours(retentionResource.resource.value.runtime_event_retention);
const openRetention = async () => {
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
await page.getByRole('menuitem', { name: 'Retention', exact: true }).click();
const dialog = page.getByRole('dialog');
await dialog.waitFor();
await dialog.getByLabel('Runtime event retention (hours)', { exact: true }).waitFor();
return dialog;
};
let retentionDialog = await openRetention();
assert.match(await retentionDialog.innerText(), /Audit retention/);
assert.equal(
await retentionDialog.getByLabel('Runtime event retention (hours)', { exact: true }).inputValue(),
String(originalHours),
'retention dialog did not read the stored resource',
);
await retentionDialog.getByRole('button', { name: 'Cancel', exact: true }).click();
await retentionDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
assert.ok(!(await retentionDialog.isVisible().catch(() => false)), 'Cancel left the retention dialog open');
// ---- live tail -----------------------------------------------------------
await go('/org/audit');
await page.evaluate(() => window.scrollTo(0, 0));
await settled();
const topKey = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
const loadsBeforeWrite = loadCount();
let resource = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
const toggleRetention = async () => {
const current = retentionHours(resource.resource.value.runtime_event_retention);
const next = current === 2160 ? 2161 : 2160;
const written = await page.request.post(
`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention/commands/replace`,
{
headers: { 'X-Archie-CSRF': '1', Origin: new URL(page.url()).origin },
data: { value: { runtime_event_retention: `${next}h` }, expected_version: resource.resource.version },
},
);
const body = await written.text();
assert.equal(written.status(), 200, `retention write answered ${written.status()}: ${body.slice(0, 200)}`);
resource = JSON.parse(body);
};
await toggleRetention();
let liveKey = null;
for (let attempt = 0; attempt < 40; attempt += 1) {
const key = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
if (key !== topKey) {
liveKey = key;
break;
}
await page.waitForTimeout(300);
}
if (!liveKey) {
fail('live tail did not show a new row within 12s of a write');
await shot('live');
} else {
assert.equal(loadCount(), loadsBeforeWrite, 'the live row required a page reload');
assert.match(
await page.locator(`[data-row-key="${liveKey}"]`).innerText(),
/audit-retention/i,
'the live row is not the write that caused it',
);
await shot('live');
}
// Scrolled away, a new event is held behind a button instead of jumping the
// list under the operator.
await page.evaluate(() => window.scrollTo(0, 900));
await settled();
const scrolledTo = await page.evaluate(() => window.scrollY);
assert.ok(scrolledTo > 80, 'the feed is too short to test held new events');
const heldTop = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
await toggleRetention();
const heldButton = page.getByRole('button', { name: /^\d+ new events?$/ }).first();
let held = false;
for (let attempt = 0; attempt < 40; attempt += 1) {
if ((await heldButton.count()) && (await heldButton.isVisible().catch(() => false))) {
held = true;
break;
}
await page.waitForTimeout(300);
}
if (!held) {
fail('held new events did not appear while scrolled away');
await shot('held');
} else {
assert.equal(
await page.locator('[data-row-key]').first().getAttribute('data-row-key'),
heldTop,
'a new row was prepended while the operator was scrolled away',
);
await shot('held');
await heldButton.click();
await page.waitForFunction(
(top) => document.querySelector('[data-row-key]')?.getAttribute('data-row-key') !== top,
heldTop,
{ timeout: 8000 },
).catch(() => {});
await settled();
assert.notEqual(
await page.locator('[data-row-key]').first().getAttribute('data-row-key'),
heldTop,
'showing held events did not prepend the new row',
);
assert.ok((await page.evaluate(() => window.scrollY)) < 10, 'showing held events did not return to the top');
}
// ---- retention: save -----------------------------------------------------
// Kept last: the page error this currently raises must not stop the rest.
await go('/org/audit');
retentionDialog = await openRetention();
const hoursField = retentionDialog.getByLabel('Runtime event retention (hours)', { exact: true });
const beforeSave = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
const beforeHours = retentionHours(beforeSave.resource.value.runtime_event_retention);
const wanted = beforeHours === 2160 ? 2161 : 2160;
await hoursField.fill(String(wanted));
await retentionDialog.getByRole('button', { name: 'Save', exact: true }).click();
await retentionDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
const stillOpen = await retentionDialog.isVisible().catch(() => false);
const afterSave = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
const afterHours = retentionHours(afterSave.resource.value.runtime_event_retention);
if (stillOpen || afterHours !== wanted) {
await shot('retention-save');
fail(
`retention save did not complete: dialog ${stillOpen ? 'stayed open' : 'closed'}, ` +
`stored retention is ${afterHours}h (wanted ${wanted}h), URL ${page.url()}`,
);
}
};
+69
View File
@@ -0,0 +1,69 @@
// A revertable change set expands to its Before/After diff, offers one Revert
// action whose dialog cancels cleanly, and toggles from the keyboard.
const assert = require('node:assert/strict');
const { DEFAULT_WINDOW_MS, trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail, settled }) => {
trackAudit(page);
await go('/org/audit');
await page.locator('[data-row-key]').first().waitFor();
const from = new Date(Date.now() - DEFAULT_WINDOW_MS).toISOString();
// The feed page size is 100: only rows in this response are rendered.
const feed = await page.evaluate(
async (iso) => (await fetch(`/api/audit?limit=100&from=${encodeURIComponent(iso)}`)).json(),
from,
);
const records = feed.records || [];
assert.ok(records.length, 'the seeded feed is empty');
const changeSet = records.find(
(row) =>
row.target?.kind === 'resource' &&
(row.detail?.fields || []).length > 0 &&
(row.detail?.version ?? 0) > 1,
);
if (!changeSet) {
fail('no revertable settings change set in the feed; cannot exercise the diff or Revert');
return;
}
const row = page.locator(`[data-row-key="${changeSet.id}"]`);
await row.waitFor();
await row.scrollIntoViewIfNeeded();
await row.locator('td').first().click();
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'click did not expand the change set');
const detail = row.locator('xpath=following-sibling::tr[1]');
await detail.getByText('Before:', { exact: false }).first().waitFor();
assert.match(await detail.innerText(), /After:/, 'expanded change set has no after value');
assert.equal(
await detail.getByRole('button', { name: /^Revert \S/ }).count(),
0,
'the audit diff offers a per-field revert',
);
const revertAll = page.getByRole('button', { name: 'Revert', exact: true });
assert.ok((await revertAll.count()) > 0, 'no Revert action on a revertable change set');
await shot('change-set');
await revertAll.first().click();
const dialog = page.getByRole('alertdialog');
await dialog.waitFor();
assert.match(await dialog.innerText(), /Revert this change\?/);
assert.match(await dialog.innerText(), /previous version opens for review/i);
await dialog.getByRole('button', { name: 'Cancel', exact: true }).click();
await dialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
assert.ok(!(await dialog.isVisible().catch(() => false)), 'Cancel left the revert dialog open');
assert.equal(
await page.getByRole('region', { name: 'Unsaved changes' }).count(),
0,
'Cancel touched the save bar',
);
// Enter is the keyboard equivalent of clicking the row.
await row.click();
assert.equal(await row.getAttribute('aria-expanded'), 'false', 'the row did not collapse');
await row.focus();
await page.keyboard.press('Enter');
await settled();
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'Enter did not expand the change set');
};
+36
View File
@@ -0,0 +1,36 @@
// A runtime event with a task target expands to its metadata and links to
// the task. The seed's work requests park and record the event; the feed is
// filtered to it so settings noise cannot push it off the page. Without it
// there is nothing to exercise, so the check skips instead of failing.
const assert = require('node:assert/strict');
const { DEFAULT_WINDOW_MS, trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, skip }) => {
trackAudit(page);
await go('/org/audit?kind=parked');
await page.locator('[data-row-key]').first().waitFor();
const from = new Date(Date.now() - DEFAULT_WINDOW_MS).toISOString();
// The feed page size is 100: only rows in this response are rendered.
const feed = await page.evaluate(
async (iso) => (await fetch(`/api/audit?limit=100&kind=parked&from=${encodeURIComponent(iso)}`)).json(),
from,
);
const records = feed.records || [];
const runtime = records.find((row) => row.category === 'runtime' && row.target?.kind === 'task' && row.target?.id);
if (!runtime) {
skip('no runtime event with a task target in the feed');
}
const row = page.locator(`[data-row-key="${runtime.id}"]`);
await row.waitFor();
await row.scrollIntoViewIfNeeded();
await row.locator('td').first().click();
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'runtime row did not expand');
const detail = row.locator('xpath=following-sibling::tr[1]');
await detail.locator('dl dt', { hasText: 'Target' }).first().waitFor();
assert.match(await detail.innerText(), /Table/, 'runtime metadata has no table row');
const link = detail.getByRole('link', { name: runtime.target.label || runtime.target.id, exact: true });
assert.equal(await link.count(), 1, 'runtime target is not a link');
assert.equal(await link.getAttribute('href'), `/tasks/${runtime.target.id}`);
};
+50
View File
@@ -0,0 +1,50 @@
// Audit saved views round-trip through the URL, and CSV/JSON exports carry
// the resolved window and arrive as attachments.
const assert = require('node:assert/strict');
const { trackAudit, exportOnce } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail, settled }) => {
const { waitForUrl } = trackAudit(page);
await go('/org/audit');
await page.getByRole('button', { name: 'Runtime', exact: true }).click();
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
const viewName = `e2e-view-${Date.now()}`;
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
await page.getByRole('menuitem', { name: 'Save view…', exact: true }).click();
const saveDialog = page.getByRole('dialog');
await saveDialog.waitFor();
await saveDialog.getByLabel('Name', { exact: true }).fill(viewName);
await saveDialog.getByRole('button', { name: 'Save', exact: true }).click();
await settled();
await saveDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
const savedView = page.getByRole('combobox', { name: 'Saved view', exact: true });
await savedView.waitFor();
assert.equal((await savedView.innerText()).trim(), viewName);
await shot('saved-view');
await page.getByRole('button', { name: 'Runtime', exact: true }).click();
await waitForUrl((u) => u.searchParams.get('categories') === null);
await savedView.click();
await page.getByRole('option', { name: viewName, exact: true }).click();
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
assert.equal((await savedView.innerText()).trim(), viewName, 'applying the saved view did not restore it');
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
await page.getByRole('menuitem', { name: 'Delete view', exact: true }).click();
await savedView.waitFor({ state: 'detached', timeout: 5000 }).catch(() => {});
assert.equal(await savedView.count(), 0, 'deleting the saved view left it in the picker');
await go('/org/audit');
await page.getByRole('button', { name: 'Export', exact: true }).click();
await page.getByRole('menuitem', { name: 'CSV', exact: true }).waitFor();
await shot('export');
await page.keyboard.press('Escape');
const csvBody = await exportOnce(page, fail, 'CSV', 'csv');
if (csvBody !== null) assert.ok(csvBody.split('\n')[0].trim().length > 0, 'CSV export is empty');
const jsonBody = await exportOnce(page, fail, 'JSON', 'json');
if (jsonBody !== null) assert.ok(jsonBody.trimStart().startsWith('['), 'JSON export is not an array');
};
+28
View File
@@ -0,0 +1,28 @@
// The chat composer: IME confirmation never submits the draft, Shift+Enter
// inserts a newline, and ordinary Enter submits and clears.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
await go('/events');
const composer = page.getByRole('textbox', { name: 'Message Archie', exact: true });
await composer.waitFor();
await composer.fill('Composition in progress');
const sent = [];
await page.route('**/api/chat/stream', async route => {
sent.push(route.request().postDataJSON().text);
await route.fulfill({ contentType: 'text/event-stream', body: 'data: {"type":"done","text":"Test response"}\n\n' });
});
for (const event of [{ isComposing: true }, { keyCode: 229 }]) {
await composer.dispatchEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true, ...event });
assert.equal(await composer.inputValue(), 'Composition in progress', 'IME confirmation submitted the draft');
}
assert.equal(sent.length, 0);
await composer.press('Shift+Enter');
assert.ok((await composer.inputValue()).includes('\n'), 'Shift+Enter no longer inserts a newline');
await composer.fill('Ordinary Enter submits');
const request = page.waitForRequest('**/api/chat/stream');
await composer.press('Enter');
assert.equal((await request).postDataJSON().text, 'Ordinary Enter submits');
assert.equal(await composer.inputValue(), '');
await shot('chat-composition');
};
+50
View File
@@ -0,0 +1,50 @@
// Real local API records; workflow edits stay unsaved and the test agent retires.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
const base = process.env.ARCHIE_E2E_URL || 'http://localhost:5173';
const headers = { 'X-Archie-CSRF': '1', Origin: base };
let agent;
const command = async (name, display_name = '') => {
const response = await page.request.post(`${base}/api/identities/${agent.id}/${name}`, {
headers, data: { expected_version: agent.version, display_name },
});
assert.equal(response.ok(), true, await response.text());
agent = await response.json();
};
const openSettings = async () => {
await go('/workflows');
await page.getByRole('button', { name: /^implement/ }).click();
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();
return page.getByRole('combobox', { name: 'Execution identity', exact: true });
};
try {
const created = await page.request.post(`${base}/api/identities`, {
headers, data: { display_name: `E2E execution agent ${Date.now()}`, kind: 'bot' },
});
assert.equal(created.ok(), true, await created.text());
agent = await created.json();
const trigger = await openSettings();
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
await trigger.click();
await page.getByRole('option', { name: agent.display_name, exact: true }).click();
assert.match(await trigger.innerText(), new RegExp(agent.display_name));
await shot('named-execution-identity');
await command('rename', agent.display_name + ' renamed');
await page.reload();
const renamed = await openSettings();
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
await renamed.click();
await page.getByRole('option', { name: agent.display_name, exact: true }).waitFor();
await page.keyboard.press('Escape');
await command('suspend');
await page.reload();
const suspended = await openSettings();
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
await suspended.click();
assert.equal(await page.getByRole('option', { name: agent.display_name, exact: true }).and(page.locator(':not([data-disabled])')).count(), 0);
} finally {
if (agent && agent.lifecycle !== 'retired') await command('retire');
}
};
+103
View File
@@ -0,0 +1,103 @@
// Shared setup for the audit-* checks: feed request tracking, URL waits,
// and the export download-or-popup accept. One behaviour per check module;
// this file holds only what several of them need.
const assert = require('node:assert/strict');
const fs = require('node:fs');
const DEFAULT_WINDOW_MS = 30 * 24 * 60 * 60 * 1000;
function isAudit(u) {
return u.pathname === '/api/audit';
}
// Installs request tracking on a fresh check page. Returns the helpers the
// audit checks share; a check destructures only what it uses.
function trackAudit(page) {
page.setDefaultTimeout(10000);
const auditRequests = [];
page.on('request', (request) => {
try {
const url = new URL(request.url());
if (isAudit(url) || url.pathname === '/api/audit/export') auditRequests.push(url);
} catch {
// A non-URL request cannot be an audit call.
}
});
let loads = 0;
page.on('load', () => (loads += 1));
const requestMatching = async (action, predicate, timeout = 6000) => {
const waiter = page
.waitForRequest(
(request) => {
try {
const url = new URL(request.url());
return (isAudit(url) || url.pathname === '/api/audit/export') && predicate(url);
} catch {
return false;
}
},
{ timeout },
)
.catch(() => null);
await action();
return waiter;
};
const waitForUrl = (predicate, timeout = 8000) =>
page.waitForURL((url) => predicate(new URL(url)), { timeout });
const lastRequest = () => auditRequests[auditRequests.length - 1] || null;
const loadCount = () => loads;
return { requestMatching, waitForUrl, lastRequest, loadCount };
}
// Export resolves its window at click time and opens a tab. A successful
// export arrives as an attachment download; a failed one stays visible in
// that tab, so the check accepts either and reads the response from it.
async function exportOnce(page, fail, label, extension) {
await page.getByRole('button', { name: 'Export', exact: true }).click();
const item = page.getByRole('menuitem', { name: label, exact: true });
await item.waitFor();
const downloadP = page.waitForEvent('download', { timeout: 15000 }).then((download) => ({ download })).catch(() => null);
const popupP = page.waitForEvent('popup', { timeout: 15000 }).then((popup) => ({ popup })).catch(() => null);
await item.click();
const settled = await Promise.race([downloadP, popupP]);
if (!settled) {
fail(`${label} export neither downloaded nor opened a tab`);
return null;
}
if (settled.popup) {
await settled.popup.waitForLoadState('load').catch(() => {});
const url = new URL(settled.popup.url());
assert.equal(url.pathname, '/api/audit/export', `${label} opened ${url.href}`);
assert.equal(url.searchParams.get('format'), extension);
assert.ok(url.searchParams.get('from'), `${label} export has no explicit start`);
assert.ok(url.searchParams.get('to'), `${label} export has no explicit end`);
const response = await page.request.get(url.href);
const body = await response.text();
if (response.status() !== 200) {
fail(`${label} export failed (${response.status()}): ${body.slice(0, 200)}`);
return null;
}
if (!new RegExp(`attachment;.*\\.${extension}`).test(response.headers()['content-disposition'] || '')) {
fail(`${label} export opened a tab without an attachment filename`);
return null;
}
return body;
}
if (!new RegExp(`\\.${extension}$`).test(settled.download.suggestedFilename())) {
fail(`${label} export did not download a .${extension} file`);
return null;
}
const failure = await settled.download.failure();
if (failure) {
fail(`${label} download failed: ${failure}`);
return null;
}
const saved = await settled.download.path();
return saved ? fs.readFileSync(saved, 'utf8') : '';
}
module.exports = { DEFAULT_WINDOW_MS, isAudit, trackAudit, exportOnce };
+18
View File
@@ -0,0 +1,18 @@
// Shared by the org-* and setup checks: acting in a seeded org and the 404s a
// fresh org's pages are built to survive.
const ORG = { home: 'org-sys', beta: 'org-beta', outsider: 'org-gamma' };
// A new org has written no documents, and the instance-only reads answer
// not found outside the system org.
const ABSENT = /status of 404.*\/api\/(control-plane|schedules|identities)/;
// Selects an org the way the topbar does, over the page's own session.
async function selectOrg(page, id) {
const origin = new URL(page.url() === 'about:blank' ? 'http://localhost:5173' : page.url()).origin;
return page.request.put(`${origin}/api/orgs/current`, {
headers: { 'X-Archie-CSRF': '1', Origin: origin },
data: { id },
});
}
module.exports = { ORG, ABSENT, selectOrg };
+19
View File
@@ -0,0 +1,19 @@
const assert=require('node:assert/strict');
module.exports=async({page,go,shot})=>{
await page.route('**/api/access/policies',async route=>{await new Promise(r=>setTimeout(r,2200));await route.continue()});
await go('/access/policies');
assert.equal(await page.getByText('No policies yet.',{exact:true}).count(),0);
await page.getByText('Loading policies…',{exact:true}).waitFor({state:'hidden'});
await page.route('**/api/tasks?**',async route=>{
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 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);
await page.unroute('**/api/tasks?**');
await page.getByRole('button',{name:'Retry runs',exact:true}).click();
await page.getByRole('alert').filter({hasText:'Could not load recent runs'}).waitFor({state:'hidden'});
await shot('recovered');
};
+18
View File
@@ -0,0 +1,18 @@
// The save response is mocked; this checks the page's save path without changing models.
const assert=require('node:assert/strict');
module.exports=async({page,go,shot})=>{
let submitted;
await page.route('**/api/control-plane/resources/model-aliases/commands/replace',async route=>{
submitted=route.request().postDataJSON();
await route.fulfill({json:{resource:{kind:'model-aliases',version:submitted.expected_version+1,value:submitted.value}}});
});
await go('/access/models');
await page.getByLabel('New alias',{exact:true}).fill('e2e-test');
await page.getByRole('button',{name:'Add alias',exact:true}).click();
await page.getByLabel('e2e-test',{exact:true}).fill('test/model');
await page.getByRole('button',{name:'Review and save',exact:true}).click();
await page.getByRole('button',{name:'Save',exact:true}).click();
await page.getByRole('heading',{name:/^Review \d/}).waitFor({state:'hidden'});
assert.equal(submitted?.value['e2e-test'],'test/model');
await shot('saved');
};
+30
View File
@@ -0,0 +1,30 @@
// The organisation pages: each loads its form in the selected org, and the old
// settings audit route lands on the organisation's audit page.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
const PAGES = [
{ path: '/org/channels', heading: 'Channels', text: 'Chat session defaults' },
{ path: '/org/scheduling-policy', heading: 'Scheduling policy', text: 'Retries and polling' },
{ path: '/org/alerts', heading: 'Alert webhook', text: 'Webhook severity' },
];
module.exports = async ({ page, go, shot }) => {
for (const { path, heading, text } of PAGES) {
await go(path);
await page.getByRole('heading', { name: heading, exact: true }).waitFor();
await page.getByText(text, { exact: true }).first().waitFor();
assert.equal(new URL(page.url()).pathname, path);
await shot(path);
}
trackAudit(page);
await go('/org/audit');
await page.getByRole('heading', { name: 'Audit', exact: true }).first().waitFor();
await page.locator('[data-row-key]').first().waitFor();
await shot('/org/audit');
await go('/settings/audit?since=7d');
assert.equal(new URL(page.url()).pathname, '/org/audit', '/settings/audit did not redirect');
assert.equal(new URL(page.url()).searchParams.get('since'), '7d', 'redirect dropped the query');
await page.locator('[data-row-key]').first().waitFor();
};
+31
View File
@@ -0,0 +1,31 @@
// A non-system org can arm a schedule trigger: the schedule source's built-in
// mapping is readable there, so a binding on it is accepted. The editor's own
// schedule list is instance-only, so the binding is written over the API.
const assert = require('node:assert/strict');
const { ORG, ABSENT, selectOrg } = require('./helpers/org-helpers.cjs');
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');
const origin = new URL(page.url()).origin;
const headers = { 'X-Archie-CSRF': '1', Origin: origin };
const created = await page.request.post(`${origin}/api/bindings`, {
headers,
data: {
name: 'e2e schedule trigger', matcher: { source: 'schedule' }, mapping_id: 'schedule-fired',
filter: 'schedule_id == "issue-discovery"', workflow: 'feasibility', repo_param: '', owner: '', repo: '', inputs: {},
},
});
try {
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 page.getByText('Starts when').first().waitFor();
await shot('beta-trigger');
} finally {
if (created.ok()) await page.request.delete(`${origin}/api/bindings/${(await created.json()).id}`, { headers });
}
};
+43
View File
@@ -0,0 +1,43 @@
// The topbar org selector: choosing a member org reloads the dashboard into it,
// Tasks and Workflows then show only that org's work, and the API refuses an
// org the caller is not a member of.
const assert = require('node:assert/strict');
const { ORG, ABSENT, selectOrg } = require('./helpers/org-helpers.cjs');
module.exports = async ({ page, go, shot, settled, tolerate }) => {
tolerate(ABSENT);
await go('/tasks');
await page.getByText('Fix flaky login test').first().waitFor();
const picker = page.getByRole('combobox', { name: 'Organisation' });
await picker.waitFor();
const offered = await (async () => {
await picker.click();
const names = await page.getByRole('option').allInnerTexts();
await page.keyboard.press('Escape');
return names;
})();
assert.deepEqual(offered.sort(), ['Beta', 'E2E'], 'selector must offer exactly the orgs the caller belongs to');
await go('/workflows');
await page.getByText('Parked', { exact: true }).first().waitFor();
await shot('home-org-workflows');
await picker.click();
await Promise.all([page.waitForEvent('load'), page.getByRole('option', { name: 'Beta', exact: true }).click()]);
await settled('/workflows');
await page.getByRole('combobox', { name: 'Organisation' }).waitFor();
assert.equal(await page.getByText('Parked', { exact: true }).count(), 0, 'workflow run counts leaked across orgs');
await shot('beta-workflows');
await go('/tasks');
await page.getByText('No tasks yet').waitFor();
assert.equal(await page.getByText('Fix flaky login test').count(), 0, 'tasks leaked across orgs');
await shot('beta-tasks');
// The selector never writes an org the caller is outside of; the server decides.
const refused = await selectOrg(page, ORG.outsider);
assert.equal(refused.status(), 403, 'selecting a non-member org must be forbidden');
await go('/tasks');
await page.getByText('No tasks yet').waitFor();
assert.equal((await selectOrg(page, ORG.home)).status(), 204);
await go('/tasks');
await page.getByText('Fix flaky login test').first().waitFor();
};
+13
View File
@@ -0,0 +1,13 @@
// Repositories and connections say what stops them serving work: the seeded
// repository has no connection, and the seeded connection's forge is not enabled.
module.exports = async ({ page, go, shot }) => {
await go('/org/repositories');
await page.getByText('acme/widgets', { exact: true }).first().waitFor();
await page.getByText('No connection', { exact: true }).waitFor();
await shot('repositories');
await go('/org/connections');
await page.getByText('github.com', { exact: true }).first().waitFor();
await page.getByText('Forge not enabled', { exact: true }).waitFor();
await shot('connections');
};
+36
View File
@@ -0,0 +1,36 @@
// Every static route loads without errors, renders, and shows no text with
// stray leading, trailing or doubled spaces.
const fs = require('fs');
const path = require('path');
function routes() {
const src = fs.readFileSync(path.join(__dirname, '../../ui/src/router/index.ts'), 'utf8');
const out = [];
for (const line of src.split('\n')) {
if (/redirect:/.test(line)) continue;
const m = line.match(/path: "([^"]*)"/);
if (!m || m[1].includes(':')) continue;
if (m[1].startsWith('/')) out.push(m[1]);
else if (m[1]) out.push('/org/' + m[1]);
}
return [...new Set(out)];
}
module.exports = async ({ page, go, shot, fail }) => {
const stray = new Map();
for (const r of routes()) {
await go(r);
await shot(r);
// Log lines are data, not copy.
if (r === '/logs') continue;
const bad = await page.evaluate(() => [...document.querySelectorAll('body *')]
.filter((el) => !el.children.length && !el.closest('pre,code,textarea,.xterm') && el.getClientRects().length && !getComputedStyle(el).whiteSpace.startsWith('pre'))
.map((el) => el.textContent)
.filter((t) => t.trim() && (t !== t.trim() || / /.test(t.trim()))));
for (const t of bad) {
const key = JSON.stringify(t.length > 60 ? t.slice(0, 60) + '…' : t);
stray.set(key, (stray.get(key) || new Set()).add(r));
}
}
for (const [text, where] of stray) fail(`stray whitespace ${text} on ${[...where].join(', ')}`);
};
+9
View File
@@ -0,0 +1,9 @@
// The seed (e2e/seed.sh) is visible where an operator would look for it.
module.exports = async ({ page, go, shot }) => {
await go('/tasks');
await page.getByText('Fix flaky login test').first().waitFor({ timeout: 10000 });
await shot('tasks');
await go('/events');
await page.getByText('e2e-hook').first().waitFor({ timeout: 10000 });
await shot('events');
};
+32
View File
@@ -0,0 +1,32 @@
// Draft edits only: no saved configuration is changed.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
await go('/settings/channels');
const workspace = page.getByLabel('Workspace', { exact: true });
assert.equal(await page.getByRole('region', { name: 'Unsaved changes' }).count(), 0, 'unsaved bar before any edit');
await workspace.fill('/srv/e2e-workspace');
await page.getByRole('link', { name: 'Models', exact: true }).click();
await page.getByRole('heading', { name: 'Models' }).waitFor();
await page.getByRole('link', { name: 'Channels', exact: true }).click();
assert.equal(await page.getByLabel('Workspace', { exact: true }).inputValue(), '/srv/e2e-workspace', 'edit lost on navigation');
const form = await page.getByText('Chat session defaults', { exact: true }).evaluate(el => el.closest('[data-slot="card"]').getBoundingClientRect().width);
assert.ok(form <= 850, `settings form stretched to ${form}px`);
const review = page.getByRole('button', { name: 'Review and save', exact: true });
await review.scrollIntoViewIfNeeded();
const unobscured = await review.evaluate(el => { const r=el.getBoundingClientRect(); const hit=document.elementFromPoint(r.x+r.width/2,r.y+r.height/2); return hit && el.contains(hit); });
assert.ok(unobscured, 'Review and save is covered');
await review.click();
await page.getByRole('heading', { name: /^Review \d/ }).waitFor();
await page.getByText('/srv/e2e-workspace', { exact: false }).last().waitFor();
await shot('review');
await page.getByRole('button', { name: 'Discard all', exact: true }).click();
assert.equal(await page.getByRole('region', { name: 'Unsaved changes' }).count(), 0);
assert.equal(await page.getByLabel('Workspace', { exact: true }).inputValue(), '', 'discard kept the edit');
await page.setViewportSize({width:390,height:844});
await page.getByLabel('Workspace', { exact: true }).fill('/srv/e2e-workspace');
const mobileReview=page.getByRole('button',{name:'Review and save',exact:true});
await mobileReview.scrollIntoViewIfNeeded();
assert.ok(await mobileReview.evaluate(el=>{const r=el.getBoundingClientRect();return el.contains(document.elementFromPoint(r.x+r.width/2,r.y+r.height/2))}), 'mobile save action covered');
await shot('mobile');
await page.getByRole('button',{name:'Discard',exact:true}).click();
};
+21
View File
@@ -0,0 +1,21 @@
// The setup checklist reads the selected org: an org with no model to run gets a
// Model step that leads to the page that fixes it.
const assert = require('node:assert/strict');
const { ORG, ABSENT, selectOrg } = require('./helpers/org-helpers.cjs');
module.exports = async ({ page, go, shot, settled, tolerate }) => {
tolerate(ABSENT);
await go('/');
await page.getByPlaceholder('Describe a task').waitFor();
assert.equal(await page.getByRole('link', { name: 'Model', exact: true }).count(), 0, 'an org with a model got a Model step');
assert.equal((await selectOrg(page, ORG.beta)).status(), 204);
await go('/');
await page.getByText('Setup', { exact: true }).waitFor();
const model = page.getByRole('link', { name: 'Model', exact: true });
await model.waitFor();
assert.equal(await model.getAttribute('href'), '/org/models');
await shot('beta-dashboard');
await model.click();
await settled('/org/models');
await shot('model-page');
};
+21
View File
@@ -0,0 +1,21 @@
const assert=require('node:assert/strict');
module.exports=async({page,go,shot})=>{
await go('/tasks');
const base=new URL(page.url()).origin;
const tasks=await (await page.request.get(base+'/api/tasks')).json();
const task=tasks.find(t=>t.status==='parked' && t.attempt>0);
assert.ok(task,'seeded stack has no parked attempt to inspect');
const state=await (await page.request.get(`${base}/api/tasks/${task.id}/attempts`)).json();
assert.ok(state.attempts.some(a=>a.attempt===state.current_attempt),'claimed current attempt missing');
await go(`/tasks/${task.id}`);
assert.equal(await page.getByText(`Attempt ${state.current_attempt} is not recorded`,{exact:true}).count(),0);
const logs=await (await page.request.get(`${base}/api/tasks/${task.id}/logs?attempt=${state.current_attempt}&level=ERROR&limit=1`)).json();
await page.getByRole('button',{name:'Jump to log line',exact:true}).click();
if(logs.entries?.[0]?.id){
await page.locator(`[data-row-key="${logs.entries[0].id}"]`).waitFor();
await page.waitForFunction(id=>document.activeElement?.getAttribute('data-row-key')===String(id),logs.entries[0].id);
}else{
await page.getByText('No error log line was recorded for this attempt.',{exact:true}).waitFor();
}
await shot('attempt');
};
+29
View File
@@ -0,0 +1,29 @@
// A parked task whose blocker has a fix links to the page that supplies it, from
// Needs attention on the dashboard and from the Stage Rail on the task page.
// The seed's work requests park for want of a repository connection.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot, settled, skip }) => {
await go('/');
const tasks = await page.evaluate(async () => (await fetch('/api/tasks?limit=100')).json());
if (!tasks.some((task) => task.status === 'parked')) skip('no parked task');
const parked = tasks.find((task) => task.status === 'parked' && task.recovery);
assert.ok(parked, 'no parked task in the list carries a recovery link');
const { label, link } = parked.recovery;
const row = page.getByRole('link', { name: parked.title, exact: true }).locator('xpath=ancestor::*[.//a[normalize-space()="' + label + '"]][1]');
const fromDashboard = row.getByRole('link', { name: label, exact: true });
await fromDashboard.waitFor();
assert.equal(await fromDashboard.getAttribute('href'), link);
await shot('needs-attention');
await fromDashboard.click();
await settled(link);
await go(`/tasks/${parked.id}`);
const fromRail = page.getByRole('complementary', { name: 'Task details' }).getByRole('link', { name: label, exact: true });
await fromRail.waitFor();
assert.equal(await fromRail.getAttribute('href'), link);
await shot('stage-rail');
await fromRail.click();
await settled(link);
};
+14
View File
@@ -0,0 +1,14 @@
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
await page.route('**/api/control-plane/resources/workflow-definitions', async route => {
await new Promise(resolve => setTimeout(resolve, 2200));
await route.continue();
});
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();
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');
};
+118
View File
@@ -0,0 +1,118 @@
// Workflow definition behaviour at desktop width: legacy title IDs migrate
// to slugs, invalid expressions flag the node and toolbar alike, a pinned
// historical run keeps its original step IDs inspectable, and handoff
// targets round-trip between the step form and YAML.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot, settled }) => {
await page.route('**/api/control-plane/resources/workflow-drafts', async route => {
const response = await route.fetch();
const data = await response.json();
data.resource.value = { drafts: [] };
await route.fulfill({ json: data });
});
const panTo = async node => {
const flow = page.locator('.vue-flow');
await flow.hover();
for (let adjustment = 0; adjustment < 3; adjustment++) {
const target = await node.boundingBox(), viewport = await flow.boundingBox();
const delta = target.y + target.height / 2 - viewport.y - viewport.height / 2;
if (Math.abs(delta) < 30) break;
await page.mouse.wheel(0, delta * 2);
await settled();
}
};
// Reproduce a previously stored title ID without changing the test server.
await go('/workflows');
const response = await page.request.get(new URL('/api/control-plane/resources/workflow-definitions', page.url()).href);
const resource = await response.json();
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();
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();
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();
await shot('legacy-reference');
await page.keyboard.press('Escape');
await page.getByRole('tab', { name: 'YAML', 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();
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') });
assert.equal(await problem.evaluate(el => getComputedStyle(el).color), await toolbarProblem.evaluate(el => getComputedStyle(el).color));
const invalidPage = await page.evaluate(() => ({
scrollWidth: document.documentElement.scrollWidth, width: innerWidth,
}));
assert.equal(invalidPage.scrollWidth, invalidPage.width, 'invalid toolbar overflows');
await shot('validation');
// A pinned historical run keeps its original step IDs and remains inspectable.
const snapshot = definition.yaml;
await page.route('**/api/tasks?*', route => {
const workflow = new URL(route.request().url()).searchParams.get('workflow');
return workflow === 'feasibility'
? route.fulfill({ json: [{ id: 999999, workflow, title: 'Historical run', status: 'failed', workflow_definition_yaml: snapshot }] })
: route.continue();
});
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');
const picker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
await picker.waitFor();
assert.match(await picker.innerText(), /Run #999999/);
const root = await page.locator('.vue-flow__node[data-id="workflow"]').boundingBox();
const pinnedCanvas = await page.locator('.workflow-canvas').boundingBox();
assert.ok(root.y >= pinnedCanvas.y, 'historical workflow header clipped above canvas');
await shot('run-picker');
await page.locator('.vue-flow').hover();
await page.mouse.wheel(0, 550);
await settled();
const historicalStep = page.locator('.vue-flow__node').filter({ hasText: 'Write a Product Requirement Document' }).first();
await panTo(historicalStep);
await historicalStep.click();
await page.getByText('Historical failure', { exact: true }).first().waitFor();
await shot('historical-run');
await page.keyboard.press('Escape');
await picker.click();
await page.getByRole('option', { name: 'Definition', exact: true }).click();
assert.equal(await picker.innerText(), 'Definition');
await shot('definition-picker');
await go('/workflows?workflow=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();
await page.mouse.wheel(0, 650);
await settled();
const handoff = page.locator('.vue-flow__node').filter({ hasText: 'Hand off' }).first();
await panTo(handoff);
await handoff.click();
const target = handoff.getByLabel('Workflow', { exact: true });
await target.waitFor();
assert.equal(await target.inputValue(), '{{ steps.classify.result.workflow }}');
await target.fill('{{ steps.classify.result.alternative }}');
await target.press('Home');
await shot('dynamic-handoff');
await page.keyboard.press('Escape');
await page.getByRole('tab', { name: 'YAML', 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 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();
assert.ok((await page.getByLabel('Workflow YAML', { exact: true }).inputValue()).includes('workflow: implement'));
};
+83
View File
@@ -0,0 +1,83 @@
// The workflow canvas at phone width: no page scroll, a clean topbar, lanes
// inside the canvas, zoom controls below the graph, step and run dialogs
// that fit, YAML without page scroll, and a pinned run header that stays
// visible.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot, settled }) => {
await page.setViewportSize({ width: 390, height: 844 });
for (const workflow of ['implement', 'feasibility']) {
await go(`/workflows?workflow=${workflow}`);
const canvas = page.locator('.workflow-canvas');
await canvas.waitFor();
const dimensions = await page.evaluate(() => ({
height: innerHeight, width: innerWidth,
scrollHeight: document.documentElement.scrollHeight,
scrollWidth: document.documentElement.scrollWidth,
}));
assert.equal(dimensions.scrollHeight, dimensions.height, 'workflow page scrolls vertically');
assert.equal(dimensions.scrollWidth, dimensions.width, 'workflow page scrolls horizontally');
const topbar = page.locator('header').first();
const bar = await topbar.boundingBox();
assert.equal(bar.y, 0, 'blank band above topbar');
assert.equal(await topbar.evaluate(el => getComputedStyle(el).backdropFilter), 'none');
assert.ok(!await canvas.getByText('Works on a repository', { exact: true }).count());
const run = page.getByRole('button', { name: new RegExp(`^(Run|Test) ${workflow}$`) });
assert.ok(await run.isVisible(), 'Run hidden on phone');
const box = await canvas.boundingBox();
const start = await page.locator('.vue-flow__node[data-id="start"]').boundingBox();
assert.ok(start.y >= box.y && start.y < box.y + box.height, 'start is outside initial viewport');
const nodes = await page.locator('.vue-flow__node').evaluateAll(elements => elements.map(el => ({
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');
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');
await step.click();
const dialog = page.getByRole('dialog');
await dialog.waitFor();
const dialogBox = await dialog.boundingBox();
assert.ok(dialogBox.x >= 0 && dialogBox.x + dialogBox.width <= 390, 'step editor exceeds phone width');
const input = dialog.getByRole('textbox').first();
if (await input.count()) assert.ok(await input.evaluate(el => el.getBoundingClientRect().height) >= 24, 'step form scaled down');
await shot(`${workflow}-step`);
await page.keyboard.press('Escape');
await run.click();
await page.getByRole('dialog').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 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();
// 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();
const snapshot = resource.resource.value.definitions.find(entry => entry.id === 'feasibility').yaml;
await page.route('**/api/tasks?*', route => {
const workflow = new URL(route.request().url()).searchParams.get('workflow');
return workflow === 'feasibility'
? route.fulfill({ json: [{ id: 999999, workflow, title: 'Historical run', status: 'failed', workflow_definition_yaml: snapshot }] })
: route.continue();
});
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');
const picker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
await picker.waitFor();
assert.match(await picker.innerText(), /Run #999999/);
const root = await page.locator('.vue-flow__node[data-id="workflow"]').boundingBox();
const pinnedCanvas = await page.locator('.workflow-canvas').boundingBox();
assert.ok(root.y >= pinnedCanvas.y, 'historical workflow header clipped above canvas');
};
+23
View File
@@ -0,0 +1,23 @@
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
await go('/workflows');
await page.getByRole('button', {name:/^implement/}).click();
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 condition=page.getByLabel('Run only when', {exact:true});
await condition.fill('what');
await page.getByRole('alert').filter({hasText:'when must name'}).first().waitFor();
await condition.fill('task.title');
await page.getByRole('alert').filter({hasText:'when must name'}).first().waitFor({state:'hidden'});
const backoff=page.getByLabel('Retry backoff',{exact:true});
await backoff.fill('yes');
await page.getByText('Enter a number zero or greater.',{exact:true}).waitFor();
await backoff.fill('0.5');
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();
assert.match(await page.getByLabel('Workflow YAML',{exact:true}).inputValue(), /backoff: 30s/);
await shot('validated');
};
+12
View File
@@ -0,0 +1,12 @@
{
"name": "archie-e2e",
"private": true,
"description": "Validation of a running local stack; never part of the gate",
"scripts": {
"check": "node run.cjs"
},
"devDependencies": {
"playwright": "1.64.0"
},
"packageManager": "pnpm@12.10.1"
}
+191
View File
@@ -0,0 +1,191 @@
---
lockfileVersion: '9.0'
importers:
.:
configDependencies: {}
packageManagerDependencies:
pnpm:
specifier: 12.10.1
version: 12.10.1
packages:
'@pnpm/exe.android-arm64@12.10.1':
resolution: {integrity: sha512-CVTlHPwNvadQCJD9bGSMzWIhFX8QpjtqC2c27dhdnn/9iKzEjZ3qL62o3gHpKbIuo6qn4WxTKRoaokgNdReBig==}
cpu: [arm64]
os: [android]
'@pnpm/exe.android-x64@12.10.1':
resolution: {integrity: sha512-NFiYLIaodY7da0XIebwcU3JoP7IK/lzF7zgKSSP+9H+QcFnQ1GDfBkuBKCYJzZ+Xu0WH54neIPLBBCaOjaaauA==}
cpu: [x64]
os: [android]
'@pnpm/exe.darwin-arm64@12.10.1':
resolution: {integrity: sha512-0O8tdQ8ijlPJudXspLMTcitMkdBEz6uUflazL5uQE0WMs85oQIp0U+5hfEktMFB64QqEhjqlvvujTwbzdr9oMg==}
cpu: [arm64]
os: [darwin]
'@pnpm/exe.darwin-x64@12.10.1':
resolution: {integrity: sha512-ud+1/uZOKEo8P/AsPynOJc/LNwfI0j6WwCElibj71rU9l4nIBnsSn+wWTIPZPkZ4BBSH5+82azSnAARMyJ1lNA==}
cpu: [x64]
os: [darwin]
'@pnpm/exe.freebsd-x64@12.10.1':
resolution: {integrity: sha512-mj9PE5rf8uAfQQ2K66HSATMSut+lNiB4eSqFd5+azFVCMnxNSy/32xpZQJT21PhnN3Y4qbK+iKHe5nWAxSuRhw==}
cpu: [x64]
os: [freebsd]
'@pnpm/exe.linux-arm64-musl@12.10.1':
resolution: {integrity: sha512-xba+00wZJ8Um6rBJJjWl88uJj0tydB8dtomvjlCLvi0uL32vpa9CRP8Vv26FIXvbiZ1bo2RCzYt/eChxJVV52w==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@pnpm/exe.linux-arm64@12.10.1':
resolution: {integrity: sha512-oBdMp69ScC9UnniG4qZAQVr2fBDSXjm4yk/72vkEVyrlwS23yMxcRQl7Qdo3sgXPAygY6TWnPRKm4rXzjoyW7w==}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@pnpm/exe.linux-ppc64@12.10.1':
resolution: {integrity: sha512-Yyb3wu09h3c7mLme270uHFiVaAIUHC411Ru9LIU2BKUIstrGlXa9OqqVWoXaRgYRdFdOFknkwG7GNn6ygwLbnw==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@pnpm/exe.linux-riscv64@12.10.1':
resolution: {integrity: sha512-PdkeUFFkybknnGkWP0H22eMpIiS4OZXL5BcQzF4lh+vmrW3IaC2HOkbANKgot/PKO0Kl77pzA/6PKFxgbgfXIQ==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@pnpm/exe.linux-s390x@12.10.1':
resolution: {integrity: sha512-1okKuHKJwJPAbofDxfhZWAUxEWtee4ZSf7Pah8kcvocaJkf2WxFJ5KVTiNIvDml5GLidDQsgf7Pcf/WHbCak7Q==}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@pnpm/exe.linux-x64-musl@12.10.1':
resolution: {integrity: sha512-e6IqzVNkPa7srFKJKnY23uWJ+qz0LaRWiTUo/sHfFXRRMRzB5uNOr6qWWip/jqhdGwU91n9J7LrEYZ6e0tRczw==}
cpu: [x64]
os: [linux]
libc: [musl]
'@pnpm/exe.linux-x64@12.10.1':
resolution: {integrity: sha512-ZByV0DRgWzGaDSjT5ddRBASdwz+r/qPMYh7o6RGmPQjtRGNFbSl94xY2DcAM8mqCOZJUUDtAXQ+wpBXcdpKlkg==}
cpu: [x64]
os: [linux]
libc: [glibc]
'@pnpm/exe.win32-arm64@12.10.1':
resolution: {integrity: sha512-I7QZHcjioG7orFeCRUFUHByJ1G0zFPnAlaGGyrUvb6MGkv5oeNwNPl7t+Gp+7zHfnMcgLGJ1a+Wfim0IDw3lOw==}
cpu: [arm64]
os: [win32]
'@pnpm/exe.win32-x64@12.10.1':
resolution: {integrity: sha512-4WJFdp58EKlCj0zLobrXU0vpszSZIr4X/3y/uNbAQqGW0zE+VdruZB0gFc3L2kzsUzVwTYbaCn+XEhnCYSAlTg==}
cpu: [x64]
os: [win32]
pnpm@12.10.1:
resolution: {integrity: sha512-ukCjfrGjcNYP6oxM8dNkwTvMzvUY6YrSvO6VT1OdONo3RY5YJho/pV4GUjRQ6g//+fSXsTW+QfLBXBZCusrObA==}
engines: {node: '>=18.*'}
hasBin: true
snapshots:
'@pnpm/exe.android-arm64@12.10.1':
optional: true
'@pnpm/exe.android-x64@12.10.1':
optional: true
'@pnpm/exe.darwin-arm64@12.10.1':
optional: true
'@pnpm/exe.darwin-x64@12.10.1':
optional: true
'@pnpm/exe.freebsd-x64@12.10.1':
optional: true
'@pnpm/exe.linux-arm64-musl@12.10.1':
optional: true
'@pnpm/exe.linux-arm64@12.10.1':
optional: true
'@pnpm/exe.linux-ppc64@12.10.1':
optional: true
'@pnpm/exe.linux-riscv64@12.10.1':
optional: true
'@pnpm/exe.linux-s390x@12.10.1':
optional: true
'@pnpm/exe.linux-x64-musl@12.10.1':
optional: true
'@pnpm/exe.linux-x64@12.10.1':
optional: true
'@pnpm/exe.win32-arm64@12.10.1':
optional: true
'@pnpm/exe.win32-x64@12.10.1':
optional: true
pnpm@12.10.1:
optionalDependencies:
'@pnpm/exe.android-arm64': 12.10.1
'@pnpm/exe.android-x64': 12.10.1
'@pnpm/exe.darwin-arm64': 12.10.1
'@pnpm/exe.darwin-x64': 12.10.1
'@pnpm/exe.freebsd-x64': 12.10.1
'@pnpm/exe.linux-arm64': 12.10.1
'@pnpm/exe.linux-arm64-musl': 12.10.1
'@pnpm/exe.linux-ppc64': 12.10.1
'@pnpm/exe.linux-riscv64': 12.10.1
'@pnpm/exe.linux-s390x': 12.10.1
'@pnpm/exe.linux-x64': 12.10.1
'@pnpm/exe.linux-x64-musl': 12.10.1
'@pnpm/exe.win32-arm64': 12.10.1
'@pnpm/exe.win32-x64': 12.10.1
---
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
devDependencies:
playwright:
specifier: 1.64.0
version: 1.64.0
packages:
playwright-core@1.64.0:
resolution: {integrity: sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==}
engines: {node: '>=20'}
hasBin: true
playwright@1.64.0:
resolution: {integrity: sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==}
engines: {node: '>=20'}
hasBin: true
snapshots:
playwright-core@1.64.0: {}
playwright@1.64.0:
dependencies:
playwright-core: 1.64.0
+186
View File
@@ -0,0 +1,186 @@
// Drive the dashboard of a running local stack (e2e/stack.sh) in Chromium. Each module in checks/ exports async ({ page, go, shot, fail, skip, settled }).
// A check fails on a thrown error or any console or page error. skip(reason)
// records a skip for a missing precondition and never fails.
//
// node e2e/run.cjs [--headed] [--record VERSION] [list | all | check ...]
//
// Screenshots, results.json (the manifest) and report.html (the run report) go to
// e2e/out/<stamp>/. --record also writes e2e/results/VERSION.md, the committed
// evidence for a release.
const fs = require('fs');
const path = require('path');
const DESKTOP = { width: 1440, height: 900 };
// Stable label naming: kebab-case, so a route like /org/members becomes
// org-members and / becomes home.
function slug(label) {
return String(label).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') || 'home';
}
class SkipCheck extends Error {}
const base = process.env.ARCHIE_E2E_URL || 'http://localhost:5173';
const args = process.argv.slice(2);
const headed = args.includes('--headed');
if (headed) args.splice(args.indexOf('--headed'), 1);
let record = '';
if (args[0] === '--record') {
record = args[1];
if (!record || record.startsWith('-')) {
console.error('Usage: --record VERSION all|check ...');
process.exit(1);
}
args.splice(0, 2);
}
const available = fs.readdirSync(path.join(__dirname, 'checks')).filter((f) => f.endsWith('.cjs')).map((f) => f.slice(0, -4)).sort();
if (!args.length || (args.length === 1 && args[0] === 'list')) {
console.log(`Available browser checks:\n${available.map(name => ` ${name}`).join('\n')}\n\nRun: task e2e:check -- <check ...>\nAll: task e2e:check -- all\nWatch: task e2e:check -- --headed <check ...>`);
process.exit(0);
}
const names = args.length === 1 && args[0] === 'all' ? available : args;
const unknown = names.filter(name => !available.includes(name));
if (unknown.length) {
console.error(`Unknown checks: ${unknown.join(', ')}. Run task e2e:check to list available checks.`);
process.exit(1);
}
const { chromium } = require('playwright');
const stamp = new Date().toISOString().replace(/[:.]/g, '-');
const out = path.join(__dirname, 'out', stamp);
fs.mkdirSync(out, { recursive: true });
(async () => {
const browser = await chromium.launch({ headless: !headed, slowMo: headed ? 150 : 0 });
const context = await browser.newContext({ viewport: { width: 1440, height: 900 } });
const login = await context.request.post(base + '/api/auth/login', {
headers: { 'X-Archie-CSRF': '1', Origin: base },
data: { email: process.env.ARCHIE_E2E_EMAIL || 'operator@example.test', password: process.env.ARCHIE_E2E_PASSWORD || 'archie-local-e2e-password' },
});
if (!login.ok()) {
const error = `Test account sign-in failed (${login.status()}): ${await login.text()}`;
await browser.close();
throw new Error(error);
}
const storageState = await context.storageState();
await context.close();
const results = [];
for (const name of names) {
console.log(`run ${name}`);
const check = require(path.join(__dirname, 'checks', name + '.cjs'));
// A fresh page per check: open event streams pile up across navigations.
const page = await browser.newPage({ viewport: { width: 1440, height: 900 }, storageState });
const errors = [];
const notes = [];
page.on('pageerror', (e) => errors.push(String(e)));
page.on('console', (m) => {
if (m.type() !== 'error') return;
const url = m.location().url;
errors.push(url ? `${m.text()} (${url})` : m.text());
});
// Wait for load, never networkidle: the event stream never goes idle.
const go = async (p) => { await page.goto(base + p, { waitUntil: 'load' }); await page.waitForTimeout(1200); };
// Harness-owned wait: wait for a selector or URL, then settle briefly.
const settled = async (sel, timeout = 10000) => {
if (sel) {
if (/^https?:/.test(sel)) await page.waitForURL(sel, { timeout });
else if (sel.startsWith('/')) await page.waitForURL('**' + sel, { timeout });
else await page.locator(sel).first().waitFor({ timeout });
}
await page.waitForTimeout(150);
};
const artifacts = [];
// <check>-<kebab>[-<w>x<h>].png; the viewport suffix marks non-desktop
// shots. A short settle precedes every capture so checks need no capture
// wrapper of their own. Every capture is kept: a repeated label gets -2, -3...
const shot = async (label) => {
await page.waitForTimeout(150);
const vp = page.viewportSize() || DESKTOP;
const suffix = (vp.width === DESKTOP.width && vp.height === DESKTOP.height) ? '' : `-${vp.width}x${vp.height}`;
const stem = `${name}-${slug(label)}${suffix}`;
let file = `${stem}.png`;
for (let n = 2; fs.existsSync(path.join(out, file)); n++) file = `${stem}-${n}.png`;
await page.screenshot({ path: path.join(out, file) });
artifacts.push({ file });
return file;
};
// Keep a non-image artifact for this case: written as <check>-<name>.
const attach = (fileName, data) => {
const file = `${name}-${fileName}`;
fs.writeFileSync(path.join(out, file), data);
artifacts.push({ file });
};
const fail = (msg) => notes.push(msg);
// Drop console errors matching re: a response the page is designed to survive.
const tolerated = [];
const tolerate = (re) => tolerated.push(re);
const skip = (reason) => { throw new SkipCheck(reason || 'precondition missing'); };
const started = Date.now();
let error = '';
let skipped = '';
try { await check({ page, go, shot, fail, skip, settled, attach, tolerate }); } catch (e) {
if (e instanceof SkipCheck) skipped = e.message;
else error = String(e && e.message || e);
}
if (error || notes.length) await shot('failure').catch(() => {});
await page.close();
const problems = skipped ? [] : [error, ...notes, ...errors.filter((e) => !tolerated.some((re) => re.test(e)))].filter(Boolean);
const result = { check: name, ok: problems.length === 0, ms: Date.now() - started, problems, artifacts };
if (skipped) { result.skipped = true; result.skipReason = skipped; }
results.push(result);
console.log(`${skipped ? 'SKIP' : problems.length ? 'FAIL' : 'ok '} ${name}${skipped ? ` (${skipped})` : problems.length ? '\n ' + problems.join('\n ') : ''}`);
}
await browser.close();
fs.writeFileSync(path.join(out, 'results.json'), JSON.stringify(results, null, 2));
const commit = require('child_process').execFileSync('git', ['rev-parse', '--short', 'HEAD'], { cwd: __dirname, encoding: 'utf8' }).trim();
fs.writeFileSync(path.join(out, 'report.html'), report(results, { time: new Date().toISOString(), commit }));
if (record) writeRecord(record, results);
console.log(`evidence: ${out}`);
process.exit(results.every((r) => r.ok) ? 0 : 1);
})().catch((e) => { console.error(e); process.exit(2); });
function esc(s) {
return String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
}
// One self-contained page per run: a test plan and verification record. Each
// case carries the artifacts its own run produced; images are inlined.
function report(results, meta) {
const status = (r) => (r.skipped ? 'SKIP' : r.ok ? 'ok' : 'FAIL');
const count = (s) => results.filter((r) => status(r) === s).length;
const artifact = (a) => {
const data = fs.readFileSync(path.join(out, a.file));
if (!a.file.endsWith('.png')) return `<a href="${esc(a.file)}">${esc(a.file)}</a>`;
const src = `data:image/png;base64,${data.toString('base64')}`;
return `<figure><img src="${src}" alt="${esc(a.file)}" title="${esc(a.file)}"></figure>`;
};
const rows = results.map((r) => {
const s = status(r);
const msg = r.skipped ? [r.skipReason] : r.problems;
return `<tr class="${s}"><td>${esc(r.check)}</td><td class="st">${s}</td><td>${r.ms}ms</td>`
+ `<td>${msg.map((m) => `<pre>${esc(m)}</pre>`).join('')}</td>`
+ `<td class="art">${r.artifacts.map(artifact).join('')}</td></tr>`;
}).join('\n');
return `<!doctype html>
<html><head><meta charset="utf-8"><title>e2e ${esc(meta.time)}</title>
<style>body{font:14px system-ui,sans-serif;margin:1em}table{border-collapse:collapse;width:100%}td,th{border-top:1px solid #ccc;padding:.4em;vertical-align:top;text-align:left}pre{margin:0 0 .3em;white-space:pre-wrap;font-size:12px}.st{font-weight:600}.ok .st{color:#060}.FAIL .st{color:#a00}.SKIP .st{color:#668}.FAIL{background:#fff3f3}.art{display:flex;flex-wrap:wrap;gap:.5em;border:0}figure{margin:0}.art img{width:150px;border:1px solid #ccc;cursor:zoom-in}.art img.big{position:fixed;inset:2vh 2vw;width:96vw;height:96vh;object-fit:contain;background:#fff;z-index:9;cursor:zoom-out}</style>
</head><body><h1>e2e ${esc(meta.time)}</h1>
<p>commit ${esc(meta.commit)} against ${esc(base)}: ${results.length} cases, ${count('ok')} ok, ${count('FAIL')} FAIL, ${count('SKIP')} SKIP</p>
<table><tr><th>Case</th><th>Status</th><th>Time</th><th>Message</th><th>Artifacts</th></tr>
${rows}
</table>
<script>document.addEventListener('click',e=>{if(e.target.matches('.art img'))e.target.classList.toggle('big')})</script>
</body></html>
`;
}
function writeRecord(version, results) {
const dir = path.join(__dirname, 'results');
fs.mkdirSync(dir, { recursive: true });
const rows = results.map((r) => `| ${r.check} | ${r.skipped ? 'skip' : r.ok ? 'pass' : 'fail'} | ${r.problems.join('<br>').replace(/\|/g, '\\|') || ''} |`);
const passed = results.filter((r) => r.ok).length;
fs.writeFileSync(path.join(dir, `${version}.md`), [
`# ${version}`, '',
`Run ${new Date().toISOString()} against ${base}: ${passed} of ${results.length} checks passed.`, '',
'| Check | Result | Problems |', '| --- | --- | --- |', ...rows, '',
].join('\n'));
}
Executable
+77
View File
@@ -0,0 +1,77 @@
#!/usr/bin/env bash
# Seed a running local stack (e2e/stack.sh) through the dashboard's own HTTP
# API, so the seed exercises real validation. Safe to run again: each step
# skips what already exists.
set -euo pipefail
base=${ARCHIE_E2E_API:-http://localhost:8484}
here=$(cd "$(dirname "$0")" && pwd)
cookie=$(mktemp)
trap 'rm -f "$cookie"' EXIT
H=(-b "$cookie" -c "$cookie" -H 'Content-Type: application/json' -H 'X-Archie-CSRF: 1' -H "Origin: $base")
get() { curl -fsS -b "$cookie" "$base$1"; }
post() { curl -fsS -X POST "$base$1" "${H[@]}" -d "$2"; }
# jq-free JSON reads: py EXPR, with the parsed body as d.
py() { python3 -c "import sys, json; d = json.load(sys.stdin); print($1)"; }
# This account belongs only to the isolated local test stack.
email=${ARCHIE_E2E_EMAIL:-operator@example.test}
password=${ARCHIE_E2E_PASSWORD:-archie-local-e2e-password}
account=$(python3 -c 'import json,sys; print(json.dumps(dict(email=sys.argv[1], password=sys.argv[2], display_name="E2E operator", organisation_name="E2E", workspace_name="Local test", public_url=sys.argv[3])))' "$email" "$password" "${ARCHIE_E2E_URL:-http://localhost:5173}")
if [ "$(get /api/auth/status | py 'd["setup_required"]')" = "True" ]; then
post /api/auth/setup "$account" >/dev/null
else
if ! post /api/auth/login "$account" >/dev/null; then
echo "Test account sign-in failed. Set ARCHIE_E2E_EMAIL and ARCHIE_E2E_PASSWORD to this test stack's account credentials." >&2
exit 1
fi
fi
# Repository policy. archied applies it live; the pause lets the watch publish it.
if ! get /api/control-plane/resources/repository-policies | grep -q '"widgets"'; then
version=$(get /api/control-plane/resources/repository-policies | py 'd["resource"]["version"]')
post /api/control-plane/resources/repository-policies/commands/replace \
"{\"value\":[{\"owner\":\"acme\",\"name\":\"widgets\",\"base\":\"main\"}],\"expected_version\":$version}" >/dev/null
sleep 5
fi
# Work requests. Without Docker they park within a minute, which fills
# Needs you, Quality gates and the task pages.
tasks=$(get /api/tasks)
for t in "Fix flaky login test" "Add retry to webhook sender" "Document the gate" "Speed up the CI cache" "Recovery probe"; do
grep -qF "\"$t\"" <<<"$tasks" && continue
post /api/work-requests "{\"repository\":\"acme/widgets\",\"workflow\":\"triage\",\"title\":\"$t\",\"instructions\":\"Do it.\"}" >/dev/null
done
# An unsigned capture source with one delivery, an event type, a mapping and
# a binding left pending approval.
src=e2e-hook
if ! get /api/sources | grep -q "\"$src\""; then
post /api/sources "{\"path\":\"$src\"}" >/dev/null
post "/api/sources/$src/signing" '{"signed":false}' >/dev/null
post "/api/sources/$src/approve-unsigned" '{}' >/dev/null
bash "$here/../tools/webhook-send.sh" --url "$base" --source "$src" --kind github-issue --quiet >/dev/null
fi
et=$(get /api/event-types | py '"".join(t["id"] for t in (d.get("event_types", []) if isinstance(d, dict) else d) if t["name"] == "issue-opened")')
if [ -z "$et" ]; then
et=$(post /api/event-types "{\"source\":\"$src\",\"name\":\"issue-opened\",\"rule\":{\"headers\":[],\"payload\":[{\"path\":\"action\",\"op\":\"equals\",\"value\":\"opened\"}]},\"example\":{\"headers\":{},\"body\":\"{\\\"action\\\":\\\"opened\\\",\\\"issue\\\":{\\\"title\\\":\\\"x\\\"}}\"}}" | py 'd["id"]')
fi
if ! get /api/bindings | grep -q '"e2e-binding"'; then
mapping=$(post /api/mappings "{\"name\":\"e2e-issue\",\"source_hint\":\"$src\",\"event_type_id\":\"$et\",\"fields\":[{\"name\":\"title\",\"path\":\"issue.title\",\"type\":\"string\",\"required\":true}]}" | py 'd["id"]')
post /api/bindings "{\"name\":\"e2e-binding\",\"matcher\":{\"source\":\"$src\"},\"mapping_id\":\"$mapping\",\"workflow\":\"feasibility\",\"owner\":\"acme\",\"repo\":\"widgets\"}" >/dev/null
fi
# Two more orgs: the operator owns Beta, so the org selector offers it; Gamma
# belongs to an identity the operator is not a member of, so selecting it is refused.
orgs=$(get /api/orgs)
if ! grep -q '"org-beta"' <<<"$orgs"; then
operator=$(get /api/identities | py '"".join(i["id"] for i in d["identities"] if i["display_name"] == "E2E operator")')
post /api/orgs "{\"id\":\"org-beta\",\"name\":\"Beta\",\"owner_identity\":\"$operator\"}" >/dev/null
fi
if ! grep -q '"org-gamma"' <<<"$orgs"; then
outsider=$(post /api/identities '{"display_name":"E2E outsider","kind":"user"}' | py 'd["id"]')
post /api/orgs "{\"id\":\"org-gamma\",\"name\":\"Gamma\",\"owner_identity\":\"$outsider\"}" >/dev/null
fi
echo "seeded: $(get /api/tasks | py 'len(d.get("tasks", d) if isinstance(d, dict) else d)') tasks"
Executable
+176
View File
@@ -0,0 +1,176 @@
#!/usr/bin/env bash
# Run the whole stack as local processes against a throwaway PostgreSQL 18,
# for manual and scripted checks. Never part of the gate. Nothing here reads
# the installed config: XDG paths point into the dev directory.
#
# e2e/stack.sh start | stop | restart <service> | status | reset
set -Eeuo pipefail
repo=$(cd "$(dirname "$0")/.." && pwd)
dir=${ARCHIE_DEV_DIR:-${XDG_STATE_HOME:-$HOME/.local/state}/archie-dev}
pgport=${ARCHIE_DEV_PGPORT:-55432}
services=(archie-state-store archie-gateway archied archie-messaging archie-ui)
# initdb refuses root, and postgres cannot traverse root's home.
if [ "$(id -u)" -eq 0 ]; then
pgdata=/var/lib/archie-dev/pg
as_pg() { runuser -u postgres -- "$@"; }
else
pgdata=$dir/pg
as_pg() { "$@"; }
fi
export XDG_CONFIG_HOME=$dir/config XDG_DATA_HOME=$dir/data XDG_STATE_HOME=$dir/state
pgbin() {
local d
for d in /usr/lib/postgresql/18/bin "$(dirname "$(command -v postgres 2>/dev/null || echo /x/x)")"; do
if [ -x "$d/postgres" ] && "$d/postgres" --version | grep -q ' 18\.'; then
echo "$d"
return
fi
done
echo "PostgreSQL 18 server not found" >&2
exit 1
}
check_process() {
local pid
if [ ! -f "$dir/pids/$1" ] || ! pid=$(cat "$dir/pids/$1") || ! kill -0 "$pid" 2>/dev/null; then
echo "$1 exited; see $dir/logs/$1.log" >&2
return 1
fi
}
wait_port() {
for _ in $(seq 1 "${3:-60}"); do
check_process "$2" || return 1
(echo >"/dev/tcp/127.0.0.1/$1") 2>/dev/null && return 0
sleep 1
done
echo "$2 did not listen on $1; see $dir/logs/$2.log" >&2
return 1
}
start_pg() {
local bin
bin=$(pgbin)
if [ ! -f "$pgdata/PG_VERSION" ]; then
mkdir -p "$pgdata"
[ "$(id -u)" -ne 0 ] || chown postgres "$pgdata"
as_pg "$bin/initdb" -D "$pgdata" -U archie --auth=trust >/dev/null
fi
if ! as_pg "$bin/pg_ctl" -D "$pgdata" status >/dev/null 2>&1; then
as_pg "$bin/pg_ctl" -D "$pgdata" -w -l "$pgdata/server.log" \
-o "-p $pgport -k $pgdata -c listen_addresses=127.0.0.1" start >/dev/null
fi
"$bin/psql" -h 127.0.0.1 -p "$pgport" -U archie -d postgres -qtAc \
"SELECT 1 FROM pg_database WHERE datname = 'archie'" | grep -q 1 ||
"$bin/createdb" -h 127.0.0.1 -p "$pgport" -U archie archie
}
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\"#" \
"$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)
version=${version#v}
[ -n "$version" ] || version="dev+$(git -C "$repo" rev-parse --short=12 HEAD)"
task --dir "$repo" dev:tls
task --dir "$repo" --force build BIN_DIR="$dir/bin" GATEWAY_VERSION="$version" RUNTIME_VERSION="$version"
}
# spawn NAME DIR CMD...: a detached session leader, so stop takes its children.
spawn() {
local name=$1 cwd=$2
shift 2
rm -f "$dir/pids/$name"
setsid -f bash -c 'cd "$1" && echo $$ >"$2" && shift 2 && exec "$@"' _ "$cwd" "$dir/pids/$name" "$@" \
</dev/null >"$dir/logs/$name.log" 2>&1 9>&-
for _ in $(seq 1 50); do
[ ! -f "$dir/pids/$name" ] || { check_process "$name"; return; }
sleep 0.1
done
echo "$name did not start; see $dir/logs/$name.log" >&2
return 1
}
start_service() {
spawn "$1" "$repo" "$dir/bin/$1" -config-overlay "$dir/dev.toml"
}
stop_pid() {
local f=$1 pid
[ -f "$f" ] || return 0
pid=$(cat "$f")
if kill -- "-$pid" 2>/dev/null; then
for _ in $(seq 1 20); do kill -0 "$pid" 2>/dev/null || break; sleep 0.5; done
kill -9 -- "-$pid" 2>/dev/null || true
fi
rm -f "$f"
}
start() {
local port
for port in 9091 8585 8586 8587 8485 8484 5173; do
if (echo >"/dev/tcp/127.0.0.1/$port") 2>/dev/null; then
echo "Port $port is already in use. Run task e2e:down before task e2e:up; if it stays occupied, inspect its owner with ss -ltnp." >&2
return 1
fi
done
trap 'trap - ERR; stop' ERR
prepare
start_pg 9>&-
start_service archie-state-store
wait_port 9091 archie-state-store 90
local s
for s in archie-gateway archied archie-messaging archie-ui; do start_service "$s"; done
wait_port 8585 archie-gateway
wait_port 8586 archie-messaging
wait_port 8485 archied
wait_port 8484 archie-ui
[ -d "$repo/ui/node_modules" ] || (cd "$repo/ui" && pnpm install --frozen-lockfile >/dev/null)
spawn vite "$repo/ui" pnpm exec vite --host 127.0.0.1 --port 5173 --strictPort
wait_port 5173 vite
for s in "${services[@]}" vite; do check_process "$s"; done
trap - ERR
echo "dashboard: http://localhost:5173 logs: $dir/logs"
}
stop() {
local f
for f in "$dir"/pids/*; do stop_pid "$f"; done
if [ -f "$pgdata/PG_VERSION" ]; then
as_pg "$(pgbin)/pg_ctl" -D "$pgdata" -m fast stop >/dev/null 2>&1 || true
fi
}
# Keep concurrent invocations from replacing each other's process records.
mkdir -p "$dir"
exec 9>"$dir/stack.lock"
flock -n 9 || { echo "Another e2e stack command is running" >&2; exit 1; }
case ${1:-} in
start) start ;;
stop) stop ;;
restart)
stop_pid "$dir/pids/${2:?service}"
start_service "$2"
;;
status)
for f in "$dir"/pids/*; do
[ -f "$f" ] || continue
if kill -0 "$(cat "$f")" 2>/dev/null; then echo "up $(basename "$f")"; else echo "down $(basename "$f")"; fi
done
;;
reset)
stop
rm -rf "$dir" "$pgdata"
;;
*)
echo "usage: $0 start | stop | restart <service> | status | reset" >&2
exit 2
;;
esac
+1 -1
View File
@@ -3,7 +3,7 @@
# the network-investigator profile package (archipelago: profiles/network-investigator).
#
# Build: docker compose build agent-net
ARG AGENT_IMAGE=ghcr.io/samcharles93/archie-agent:latest
ARG AGENT_IMAGE=git.catlow.cloud/sam/archie-agent:latest
FROM ${AGENT_IMAGE}
RUN apt-get update && apt-get install -y --no-install-recommends \
+54 -64
View File
@@ -1,130 +1,120 @@
module github.com/samcharles93/archie-core
go 1.27.0
go 1.27.3
require (
cel.dev/expr v0.25.3 // indirect
dario.cat/mergo v1.0.2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20260917205352-e937bb47801a // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.5.1 // 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/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // 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 v1.0.0 // 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/cpuguy83/dockercfg v0.3.2 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.8.1 // indirect
github.com/docker/go-connections v0.8.2 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.1.0 // indirect
github.com/ebitengine/purego v0.11.1 // 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/go-git/gcfg/v2 v2.0.2 // indirect
github.com/go-jose/go-jose/v4 v4.1.5 // indirect
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // 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/google/jsonschema-go v0.4.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.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.2 // 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.0 // indirect
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 // indirect
github.com/magiconair/properties v1.18.12 // indirect
github.com/mattn/go-colorable v0.1.14 // 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/minio/highwayhash v1.0.4 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.3.3 // indirect
github.com/moby/patternmatcher v0.6.1 // indirect
github.com/moby/sys/sequential v0.7.0 // indirect
github.com/moby/sys/user v0.4.1 // indirect
github.com/moby/sys/userns v0.2.1 // indirect
github.com/moby/term v0.5.2 // 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.1.0 // indirect
github.com/pjbgf/sha1cd v0.6.0 // indirect
github.com/oklog/run v1.2.0 // indirect
github.com/philhofer/fwd v1.2.1 // indirect
github.com/pjbgf/sha1cd v0.7.0 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0 // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/segmentio/encoding v0.5.4 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/sethvargo/go-retry v0.4.0 // indirect
github.com/shirou/gopsutil/v4 v4.26.8 // indirect
github.com/sethvargo/go-retry v0.5.0 // indirect
github.com/sirupsen/logrus v1.10.2 // indirect
github.com/stretchr/testify v1.12.1 // indirect
github.com/tklauser/go-sysconf v0.4.0 // indirect
github.com/tklauser/numcpus v0.12.0 // 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
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0 // indirect
go.opentelemetry.io/otel v1.46.0 // indirect
go.opentelemetry.io/otel/metric v1.46.0 // indirect
go.opentelemetry.io/otel/trace v1.46.0 // indirect
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/crypto v0.57.0 // indirect
golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba // indirect
golang.org/x/sync v0.23.0 // indirect
golang.org/x/text v0.42.0 // 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
golang.org/x/time v0.16.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260921155816-b14227669459 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260921155816-b14227669459 // indirect
modernc.org/libc v1.77.1 // indirect
modernc.org/sqlite v1.59.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
)
require (
cel.dev/cel-go v0.32.0
github.com/BurntSushi/toml v1.6.0
github.com/cedar-policy/cedar-go v1.8.0
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.6
github.com/go-git/go-billy/v6 v6.0.0-alpha.2
github.com/go-git/go-git/v6 v6.0.0-alpha.5
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-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/moby/moby/api v1.56.0
github.com/moby/moby/client v0.6.0
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.0
github.com/nats-io/nats.go v1.54.0
github.com/nats-io/nats-server/v2 v2.15.1
github.com/nats-io/nats.go v1.55.0
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1
github.com/pressly/goose/v3 v3.28.0
github.com/samcharles93/ai-sdk v0.1.42
github.com/testcontainers/testcontainers-go v0.44.0
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0
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
golang.org/x/mod v0.41.0
golang.org/x/net v0.59.0
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
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0
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/net v0.62.0
golang.org/x/oauth2 v0.37.0
golang.org/x/sys v0.48.0
golang.org/x/term v0.46.0
google.golang.org/grpc v1.85.0-dev.0.20260825072537-93e31b48545e
golang.org/x/sys v0.49.0
golang.org/x/term v0.47.0
google.golang.org/grpc v1.86.0-dev
google.golang.org/protobuf v1.36.12
gopkg.in/yaml.v3 v3.0.1
oras.land/oras-go/v2 v2.6.2
oras.land/oras-go/v2 v2.7.0
)
+116 -144
View File
@@ -2,18 +2,12 @@ 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=
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/Azure/go-ansiterm v0.0.0-20260917205352-e937bb47801a h1:4hxax9ktNjSDoFn1tZSeL6gXMTRMpO0FzjdKfT01jgY=
github.com/Azure/go-ansiterm v0.0.0-20260917205352-e937bb47801a/go.mod h1:3EWSSOZ50kb+arhww0qIaEXHToib/3FjBj9Jj5lcP5g=
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.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/ProtonMail/go-crypto v1.5.1 h1:pTrLDQHyOT8y3DFYIpijgPBTw/7E2GLMimutvOlceuE=
github.com/ProtonMail/go-crypto v1.5.1/go.mod h1:/RaSu30DaKO4RY+XdV/ACcCcZkGr7AhUIduq5sjzzCo=
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/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=
@@ -26,8 +20,8 @@ github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/
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/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
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=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cloudflare/circl v1.6.5 h1:O64F26HEqNhznd/hrC5KZXVKYuKM2rx4deZDTc4ihQA=
@@ -42,24 +36,18 @@ github.com/containerd/platforms v1.0.0-rc.5 h1:vXd569rDrz8LeMXzAnBsy6LADV5YtsD8o
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/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA=
github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
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=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/go-connections v0.8.1 h1:JibmG5hULs5qXSr/cp/w3Pw5fZuStt4MOHMUExb29/M=
github.com/docker/go-connections v0.8.1/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
github.com/docker/go-connections v0.8.2 h1:9d9DEokx5W7qlr0shkFXIxEA7+TTD+llwzcykSlxMNc=
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.6 h1:co7vn6GgImYEGO/KPlhPRJT9i5EPWgOKcB9q7bNJlFQ=
github.com/docker/sandbox-kit-spec/v3 v3.0.0-m.6/go.mod h1:MrWO4PN3/VYC5xF8eyI8U82Nv/agTHcN4IUzheqA90c=
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/ebitengine/purego v0.11.1 h1:2zpWRSQNVKN4eKsKO9eM1ILDgWfYMY9GwqRmK6XeQ/0=
github.com/ebitengine/purego v0.11.1/go.mod h1:DCHPP08djqhNSoTfImcnHYQRZmd0qhakvrozqaEYhGQ=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
@@ -67,18 +55,20 @@ 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/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=
github.com/go-git/gcfg/v2 v2.0.2/go.mod h1:/lv2NsxvhepuMrldsFilrgct6pxzpGdSRC13ydTLSLs=
github.com/go-git/go-billy/v6 v6.0.0-alpha.2 h1:1Sv5WemXL8CxKrAx1gioJ+uHNb2bZJhiQLfwSZ4Et8c=
github.com/go-git/go-billy/v6 v6.0.0-alpha.2/go.mod h1:r/bsv9i/iDyyEU8/Z6mjC+YraOVwie1ddfUqBCElKXQ=
github.com/go-git/go-billy/v6 v6.0.0-beta.1 h1:OJ4r207zcEbeq/DJNajQUOMd+pph3r9A7hRq1Sjl1bA=
github.com/go-git/go-billy/v6 v6.0.0-beta.1/go.mod h1:QGOWN4CzmtRfpFeCw5paG3RJyKdTwsfGASkxBVkIaAU=
github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1 h1:gmqi2jvsreu0s8JMLylYDFq4sbjHwwlhktMw0DUg3mA=
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-alpha.5 h1:sE+OlkHgYWNMVmN1s9sR7uyFgsWLtxcNWse/vBYKxRE=
github.com/go-git/go-git/v6 v6.0.0-alpha.5/go.mod h1:3IjhiZnM+uBmUrOGSeqrJpsmi4Vd0H2NZO/uK2a7d0s=
github.com/go-jose/go-jose/v4 v4.1.5 h1:RjgjO2LOtWOJKUC5wpwY9LR3B3vwVAz6JS2YHfYU6eA=
github.com/go-jose/go-jose/v4 v4.1.5/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
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-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -86,11 +76,14 @@ 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-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
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-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=
github.com/go-webauthn/webauthn v0.18.2/go.mod h1:hEXaOuLxvZ3zG9miZe3ehlyeVso9AtklXG+kTn36k+A=
github.com/go-webauthn/x v0.3.1 h1:1ff37z3XfmTTomkhlURgGizLIDyOvPgTt2t9nlzKLRo=
github.com/go-webauthn/x v0.3.1/go.mod h1:ZInxAynYXfBPvvm5gzKZ7geBlL23K71xASMgohHl/Rg=
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
@@ -99,10 +92,14 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo=
github.com/google/go-tpm v0.9.8/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY=
github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba h1:qJEJcuLzH5KDR0gKc0zcktin6KSAwL7+jWKBYceddTc=
github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba/go.mod h1:EFYHy8/1y2KfgTAsx7Luu7NGhoxtuVHnNo8jE7FikKc=
github.com/google/jsonschema-go v0.4.3 h1:/DBOLZTfDow7pe2GmaJNhltueGTtDKICi8V8p+DQPd0=
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/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=
@@ -115,16 +112,14 @@ github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7Ulw
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/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
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/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.0 h1:a3C1ke2ohxFymNlb2HWAHjDeKCI90scRskErZkR0ezA=
github.com/klauspost/compress v1.20.0/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw=
github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU=
github.com/klauspost/compress v1.20.3 h1:zWNoFqq/lSuYQRim3dUXlXeA0IqwuZGicdG5ZTfY5j4=
github.com/klauspost/compress v1.20.3/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=
@@ -132,116 +127,82 @@ 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/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 h1:eveIIGn4BGM3qknO74omf6HYr30/exH+eVUTuAgwjZ0=
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
github.com/magiconair/properties v1.18.12 h1:sT9zQpvTB3B4gzrX0tmZNTEaGyg8Zw55MFYRE32Mr9I=
github.com/magiconair/properties v1.18.12/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
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.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-colorable v0.1.16 h1:+2YjeAe7xP1OQbZW1jERPWWCDLlNqFNCvjiqGiAt84A=
github.com/mattn/go-colorable v0.1.16/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
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/mdelapenya/tlscert v0.2.0 h1:7H81W6Z/4weDvZBNOfQte5GpIMo0lGYEeWbkGp5LJHI=
github.com/mdelapenya/tlscert v0.2.0/go.mod h1:O4njj3ELLnJjGdkN7M/vIVCpZ+Cf0L6muqOG4tLSl8o=
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/minio/highwayhash v1.0.4 h1:asJizugGgchQod2ja9NJlGOWq4s7KsAWr5XUc9Clgl4=
github.com/minio/highwayhash v1.0.4/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ=
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/go-archive v0.3.3 h1:OxxR9paxsluYi+zDUEXTTaIxtkK3viymW+Ka7vRhhME=
github.com/moby/go-archive v0.3.3/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE=
github.com/moby/moby/api v1.56.0 h1:GQzua3NA599ASSIICx0iFgiJeO9YkdDARvQsm23ZZuQ=
github.com/moby/moby/api v1.56.0/go.mod h1:sZ+THbVWkjOmBPPfbnzdD/G1LuIexWhqlSHHPTDQ1Uk=
github.com/moby/moby/client v0.6.0 h1:AJjEB21QPbXSXjDsZorFBoDZPhMrfbpaPLgSMAW9Bgs=
github.com/moby/moby/client v0.6.0/go.mod h1:OCo00wNRyA3m4lmJ228W3JbyCN4ZNNYjpOXiJydBdcQ=
github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U=
github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/mount v0.3.5 h1:eS3fsZTjHaBihwjp4/+5Z3jxqLXYsbwxqpVSfFv3M00=
github.com/moby/sys/mount v0.3.5/go.mod h1:WUQDO+/uCiCIkIztx8SrwIDVn2dtMFRBebRhpDFT71M=
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
github.com/moby/sys/sequential v0.7.0 h1:ASQNGNROJSuOO6LL6bPHbKvuZu6NU8P4ldPWk31zj/8=
github.com/moby/sys/sequential v0.7.0/go.mod h1:NfSTAp6V3fw4tmkD62PEcOKeZKquXT8VKCkf7aVR79o=
github.com/moby/sys/user v0.4.1 h1:RgjRlaDKi/Xmyrz4t8lyzXT6v2ooFeO/7xtchmhVWE0=
github.com/moby/sys/user v0.4.1/go.mod h1:E9QsW5WRe1kUAf7kW8hXKwu1uhsZEAdPLYHYSDudF4Y=
github.com/moby/sys/userns v0.2.1 h1:4OvdM7BcPkASbuouHsbW3aeMJSFlYDldBRnXVZhaRk8=
github.com/moby/sys/userns v0.2.1/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=
github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=
github.com/moby/moby/api v1.56.1 h1:PpWkvVPB7Fr/No8w+TfyJ/I6rWZ2YPZhT3JorIg+06c=
github.com/moby/moby/api v1.56.1/go.mod h1:sZ+THbVWkjOmBPPfbnzdD/G1LuIexWhqlSHHPTDQ1Uk=
github.com/moby/moby/client v0.6.2 h1:ekSPlMccrZGcw6Scb8T9D39qE0mB+XupU/yS0zNw9N4=
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.0 h1:M99yf0y05rTr46/qc/Is6ZAowI58Ryp2SjufLCUeVJc=
github.com/nats-io/nats-server/v2 v2.15.0/go.mod h1:5qLF4CDGzZVFt//3fUrY1ePpwbi05r7QHPNroSUtolk=
github.com/nats-io/nats.go v1.54.0 h1:vsXoOxjHp/GmPUN+EcI7uOf/uB+iAP+kEsAFNQN0yzA=
github.com/nats-io/nats.go v1.54.0/go.mod h1:y+DZoD1oBOYfZTU681eTUiUjI0vbqYGixNVFHcjHJ0k=
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/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/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.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk=
github.com/ncruces/go-strftime v1.1.0/go.mod h1:yVaq7iwCN09vHRrKBrrflXT0M9tTMG2KmZ9Fj7xeG/g=
github.com/oklog/run v1.2.0 h1:O8x3yXwah4A73hJdlrwo/2X6J62gE5qTMusH0dvz60E=
github.com/oklog/run v1.2.0/go.mod h1:mgDbKRSwPhJfesJ4PntqFUbKQRZ50NgmZTSPlFA0YFk=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/pjbgf/sha1cd v0.6.0 h1:3WJ8Wz8gvDz29quX1OcEmkAlUg9diU4GxJHqs0/XiwU=
github.com/pjbgf/sha1cd v0.6.0/go.mod h1:lhpGlyHLpQZoxMv8HcgXvZEhcGs0PG/vsZnEJ7H0iCM=
github.com/philhofer/fwd v1.2.1 h1:UtpS73q8bFgy/yH3gCq8LSNvj5gv/FowNOiWZa7uKwQ=
github.com/philhofer/fwd v1.2.1/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
github.com/pjbgf/sha1cd v0.7.0 h1:ZRNPKHj+gfkLBf0KJv/p1Hmz+7bqCT5o311YX0nq+DA=
github.com/pjbgf/sha1cd v0.7.0/go.mod h1:pKR5Li+qTCo+ebqITZfwPlJGoCFCvSO00qxjbNtTUFQ=
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/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0 h1:XA01Vk/wv9YikCi1V51yRzIHPMT5of9+cMpZoZvDn/M=
github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/pressly/goose/v3 v3.28.0 h1:D2M+iL31GmpZxSHOhX8mqyqAT3CXnokUmm0eKoSP+Vc=
github.com/pressly/goose/v3 v3.28.0/go.mod h1:v26MOuB8bL3kzzrt3Vqhb3R0PRVsl8hFQKdrht/L6Rk=
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/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.1.42 h1:YV4O6oV0OLIqDAnEWAotPyw19K1VH2YoAT0He7aW+Lg=
github.com/samcharles93/ai-sdk v0.1.42/go.mod h1:u4zrQ9/Q58L5mNEut4bNQ1ks+RCKq71LN5EDz2N/0Zk=
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/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=
github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=
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.4.0 h1:9qy1OoIAxBL+gBYnkTnTnWle5wlfsXQlwRzIbbpdqPw=
github.com/sethvargo/go-retry v0.4.0/go.mod h1:tvsjdKG6xfiCx4LSiUZ06kcv38xvdVQwv8R6/VnnVWg=
github.com/shirou/gopsutil/v4 v4.26.8 h1:YQMTF/1J50B5+Y0vlo1eDRf5DoR7Gk69hY+8wjYkQeo=
github.com/shirou/gopsutil/v4 v4.26.8/go.mod h1:5O9FjBiXoTDFatIWjZZosqj4pV0DRtLx598xGbBehzM=
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/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
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/testcontainers/testcontainers-go v0.44.0 h1:/Fwh6HY1mIikhnm9e7HwoxGycx0lzRAE0f5VQpjFxzI=
github.com/testcontainers/testcontainers-go v0.44.0/go.mod h1:IcnwQrYTO86xHXu5bvMaBH7ATlbS3Qn1M1QWW3c66rE=
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0 h1:8fdv/9y3JMxjQ+ULAcOG8RtgeNu5t9XF9LolSXDuTwM=
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0/go.mod h1:CFr2LncGYokw+OKjXcr8ARCKG1SaC2UEnGxFBovE86g=
github.com/tklauser/go-sysconf v0.4.0 h1:7H0uAN+7RkwWRaxhYXDLqa5V3LPrJeV8wmD9dRUgPQU=
github.com/tklauser/go-sysconf v0.4.0/go.mod h1:8mTNWyog7H+MpKijp4VmKJAd2bbYQ2zuUwkYRbUArPI=
github.com/tklauser/numcpus v0.12.0 h1:NR85qdvHA9pFse3x3weVZ0r0ST8R6l5RHbZrlRaqob4=
github.com/tklauser/numcpus v0.12.0/go.mod h1:ABHeXzJnr/qqwguhClkZKT1/8VABcYrsyUiUGobwWJg=
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=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
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=
@@ -250,62 +211,73 @@ 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/net/http/otelhttp v0.71.0 h1:3g7B90UzBltIDKq1/5mrTGxTnOFDV0ICOhLoxiZ8jlg=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0/go.mod h1:Ef8SuTh59BT7+ofpDxN9z+yOlc4t2GjLmKDgYNJL/NU=
go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc=
go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE=
go.opentelemetry.io/otel/metric v1.46.0 h1:yBnkXvgV7AXFILZc5K6IZe/CBFF3OS7BJ8ov6/lj0K8=
go.opentelemetry.io/otel/metric v1.46.0/go.mod h1:iPmdWqifKUdzziPkvvzIJXITl56fQx2mGM/DHLB3/2o=
go.opentelemetry.io/otel/sdk v1.46.0 h1:h5CNQQjEbuQXY/JfZtgt3i7HVFV3aHPO2OAwO2eTYPI=
go.opentelemetry.io/otel/sdk v1.46.0/go.mod h1:GAERFXFt5SYCEB+YiKUbMBeza6UaDH7GmGOZEfh2gSM=
go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE=
go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4=
go.opentelemetry.io/otel/trace v1.46.0 h1:OULy7ccdJnZtJ0UDYFOIGaCmiWzJ8Vi2G/Rsu60qs1c=
go.opentelemetry.io/otel/trace v1.46.0/go.mod h1:J7GAXweO77XSFkB/rmAqk9D6ihszhFjLU+d9WuUxDLI=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0 h1:Tq+E65HaNbZTeqcLw6QUhsV+/EIWdkfUH2CQzcrlE5M=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0/go.mod h1:A+EVhDakAj1waJBPhmTszZaSr08ww8MRRKy1nB1rqck=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 h1:LxwW/9ctSCv+QkE/cLR7M91ZIkXNMqJtEMi1vCw9U8s=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0/go.mod h1:tOsftB4SslBwwErVEPaenU2RpThXWPIU8DoJHEC4dyw=
go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM=
go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 h1:UFpxOpYPmMNUtOWhdb+nC1WELIgVf8z9higURrbzYU4=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0/go.mod h1:YBGjxe3lt0jtXoEXxGrGhv/jM7oUBUDVK7zhAvNyEjc=
go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI=
go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw=
go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY=
go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU=
go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I=
go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0=
go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw=
go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw=
go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM=
go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0=
go.opentelemetry.io/proto/otlp v1.11.1 h1:SCrPqH9NE5CmBrOqpjNCiT0X5mGwMyGERXdogfR7Yjw=
go.opentelemetry.io/proto/otlp v1.11.1/go.mod h1:wq8W4aSf6bOy8RZyESOeQFr9Pu7wydWX/TY4sgvrTPg=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
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.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M=
golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA=
golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba h1:Ck8QetSgk912qxWLMCKxd0in+aiyBQyDSMae6e/xmpU=
golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba/go.mod h1:50RgIsmK7OwqzTTeqcSXQW8SswW0o8fRcDxmqGluJ8E=
golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c=
golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o=
golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues=
golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg=
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=
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.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
golang.org/x/sync v0.24.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-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo=
golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE=
golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc=
golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI=
golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E=
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/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE=
golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s=
golang.org/x/tools v0.50.0 h1:c2ifzfcuY7L90lZ2aKd8S4K2NpASF08SZx9ZuJkHmSU=
golang.org/x/tools v0.50.0/go.mod h1:7ulVMw3831Mwi5EZD6RomGyffr4VFjuNYXf2BbCEAV0=
golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs=
golang.org/x/tools v0.52.0/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-20260921155816-b14227669459 h1:GS9OIt/j7c8bvBjYNgnKQysVfmV7e4jM0H8ZK95G4t8=
google.golang.org/genproto/googleapis/api v0.0.0-20260921155816-b14227669459/go.mod h1:PX5/4vemwVoXtwEcRDWwcR1/r0qrosfx3qoVADMwnVE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260921155816-b14227669459 h1:b0xCahf3FK2m2Cv0p4vTozGPWncCvLfwV86UNg8xWU8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260921155816-b14227669459/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
google.golang.org/grpc v1.85.0-dev.0.20260825072537-93e31b48545e h1:ar+feAPij1Znzug45m6AoShUCc5AaR8FLA3I6LZd94k=
google.golang.org/grpc v1.85.0-dev.0.20260825072537-93e31b48545e/go.mod h1:7aY/KlAHanMAVIWHnk8wloQsdlfwzDz/PP9vCbJG6CU=
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/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=
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -319,15 +291,15 @@ 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.77.1 h1:Ct8j47QtiZ1Enj2DtFXQtUqrPCAjdCmPjtCuvrYQ0Hs=
modernc.org/libc v1.77.1/go.mod h1:87/pZ4L6nD1zqW4nItuS12YO7hN1igAah34xjnQo/W0=
modernc.org/libc v1.78.0 h1:Lpm+e9K6ruVYEGwWfuBO1xXtYEaXDouFOG1SuWjFDP4=
modernc.org/libc v1.78.0/go.mod h1:wvxR55nOF2/66NkJoNV7/coXBTCvT3HR22rcqW6lOuA=
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.59.0 h1:X1es1GpqBlS/5T+vbM4HLUdaa8OtQx468DF2vrx+38A=
modernc.org/sqlite v1.59.0/go.mod h1:+paeT2A3iPRHkQDwG7oA6Tk0zQd5woMEI8q7orfry8k=
oras.land/oras-go/v2 v2.6.2 h1:N04RXngAp1LJKTG6ifz3xHPipasEkWr+hFmInja5YKo=
oras.land/oras-go/v2 v2.6.2/go.mod h1:PlTtg4JTDJkDe8yVHpM2wz7/YDc00GVas+i4jAW2TZ4=
modernc.org/sqlite v1.60.1 h1:/blz53O951KWFOso4QQvEs/Fq6cDBKLtMVrYNSeJVKw=
modernc.org/sqlite v1.60.1/go.mod h1:1dIoEagfDE72QytD5scH1lxARtaUgKgHC/NuApA27r0=
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=
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
+188 -64
View File
@@ -1,25 +1,33 @@
#!/usr/bin/env bash
# install.sh - installs Archie Core for the current user.
#
# curl -fsSL https://raw.githubusercontent.com/samcharles93/archie-core/main/install.sh | bash
# curl -fsSL https://offloaded.dev/install.sh | bash
#
# Downloads the latest release, verifies it against SHA256SUMS, installs the
# Downloads a release from its OCI registry, verifies the release key signed
# it and that the zip is the one signed, installs the
# five services to ${XDG_BIN_HOME:-~/.local/bin}, runs `archied setup`, starts
# the bundled PostgreSQL and installs systemd user units.
# Config: ${XDG_CONFIG_HOME:-~/.config}/archie Data: ${XDG_DATA_HOME:-~/.local/share}/archie
set -euo pipefail
REPO="samcharles93/archie-core"
MODULE="github.com/samcharles93/archie-core"
SOURCE_GIT="https://git.catlow.cloud/sam/archie.git"
# Where releases come from: an OCI repository and the base64 ed25519 key that
# must have signed them. A self-hosted source sets both.
DEFAULT_RELEASES="git.catlow.cloud/sam/archie"
DEFAULT_RELEASE_KEY="gIBqoQMwy+8WXmGfiuHtnUa50W0IqfzkTR6iF5q3dSM="
ARCHIE_RELEASES="${ARCHIE_RELEASES:-${DEFAULT_RELEASES}}"
ARCHIE_RELEASE_KEY="${ARCHIE_RELEASE_KEY:-${DEFAULT_RELEASE_KEY}}"
ARCHIE_CHANNEL="${ARCHIE_CHANNEL:-stable}"
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
XDG_DATA_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}"
XDG_BIN_HOME="${XDG_BIN_HOME:-${HOME}/.local/bin}"
ARCHIE_CONFIG_DIR="${XDG_CONFIG_HOME}/archie"
ARCHIE_DATA_DIR="${XDG_DATA_HOME}/archie"
ARCHIE_BIN_DIR="${XDG_BIN_HOME}"
ENV_FILE="${ARCHIE_CONFIG_DIR}/env"
INSTANCE=archie
PORT_BASE=""
INSTALL_SYSTEMD=true
ENABLE_LINGER=true
@@ -33,12 +41,21 @@ if (: </dev/tty) 2>/dev/null; then INTERACTIVE=true; fi
usage() {
cat <<EOF
Usage: install.sh [options]
or: curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh | bash -s -- [options]
or: curl -fsSL https://offloaded.dev/install.sh | bash -s -- [options]
Environment:
ARCHIE_RELEASES OCI repository to install from (default ${DEFAULT_RELEASES})
ARCHIE_RELEASE_KEY base64 ed25519 key that source signs with
ARCHIE_CHANNEL stable (default) or next
Options:
--version X.Y.Z Install this release instead of the latest
--from-source Build from a checkout (this one, or a fresh clone) instead
of a release; needs Go, git and jq
--instance NAME Install a named instance beside others: archie (default)
or archie-X; its dirs are <xdg>/NAME and its units end in -X
--port-base N Use ports N..N+6 for web, health, gateway, state store,
state store readiness, messaging and daemon
--no-systemd Skip systemd user units
--no-linger Skip loginctl enable-linger
--no-start Install the units but do not start them
@@ -51,6 +68,8 @@ VERSION=""
while [ $# -gt 0 ]; do
case "$1" in
--version) VERSION="${2:?--version needs a value}"; shift ;;
--instance) INSTANCE="${2:?--instance needs a value}"; shift ;;
--port-base) PORT_BASE="${2:?--port-base needs a value}"; shift ;;
--from-source) FROM_SOURCE=true ;;
--no-systemd) INSTALL_SYSTEMD=false; AUTO_START=false ;;
--no-linger) ENABLE_LINGER=false ;;
@@ -62,12 +81,86 @@ while [ $# -gt 0 ]; do
shift
done
if ! [[ "${INSTANCE}" =~ ^archie(-[a-z0-9][a-z0-9-]{0,23})?$ ]]; then
echo "Error: --instance '${INSTANCE}' must be archie or archie-<name>, e.g. archie-dev" >&2; exit 1
fi
if [ -n "${PORT_BASE}" ] && ! { [[ "${PORT_BASE}" =~ ^[0-9]+$ ]] && [ "${PORT_BASE}" -ge 1024 ] && [ "${PORT_BASE}" -le 65529 ]; }; then
echo "Error: --port-base must be a number from 1024 to 65529" >&2; exit 1
fi
export ARCHIE_INSTANCE="${INSTANCE}"
ARCHIE_CONFIG_DIR="${XDG_CONFIG_HOME}/${INSTANCE}"
ARCHIE_DATA_DIR="${XDG_DATA_HOME}/${INSTANCE}"
ENV_FILE="${ARCHIE_CONFIG_DIR}/env"
# unit maps a base unit name to this instance's: unchanged for the default
# instance, suffixed with the name after archie- otherwise.
unit() {
if [ "${INSTANCE}" = archie ]; then echo "$1"; else echo "$1-${INSTANCE#archie-}"; fi
}
U_DAEMON="$(unit archied)"
U_STATE="$(unit archie-state-store)"
U_GATEWAY="$(unit archie-gateway)"
U_UI="$(unit archie-ui)"
U_MESSAGING="$(unit archie-messaging)"
# Ports in --port-base order; without it, today's defaults.
if [ -n "${PORT_BASE}" ]; then
P_WEB=${PORT_BASE}; P_HEALTH=$((PORT_BASE + 1)); P_GATEWAY=$((PORT_BASE + 2))
P_STATE=$((PORT_BASE + 3)); P_READY=$((PORT_BASE + 4)); P_MESSAGING=$((PORT_BASE + 5)); P_DAEMON=$((PORT_BASE + 6))
else
P_WEB=8484; P_HEALTH=8485; P_GATEWAY=8585; P_STATE=9090; P_READY=9091; P_MESSAGING=8586; P_DAEMON=8587
fi
need() {
for cmd in "$@"; do
command -v "$cmd" &>/dev/null || { echo "Error: '$cmd' is required but not installed." >&2; exit 1; }
done
}
# install_release fetches the release on ARCHIE_CHANNEL (or VERSION) from
# ARCHIE_RELEASES and unpacks it into TMP: the statement must verify against
# ARCHIE_RELEASE_KEY and the zip must hash to the digest the statement names.
install_release() {
local registry="${ARCHIE_RELEASES%%/*}" repo="${ARCHIE_RELEASES#*/}" scheme=https tag="${ARCHIE_CHANNEL}"
case "${registry}" in localhost | localhost:* | 127.* | "[::1]"*) scheme=http ;; esac
[ -n "${VERSION}" ] && tag="v${VERSION#v}"
local base="${scheme}://${registry}/v2/${repo}" auth=()
# Registries hand anonymous readers a pull token named by the challenge.
local challenge
challenge="$(curl -fsS -o /dev/null -D - "${base}/manifests/${tag}" 2>/dev/null | tr -d '\r' | sed -n 's/^[Ww][Ww][Ww]-[Aa]uthenticate: *Bearer *//p')" || true
if [ -n "${challenge}" ]; then
local realm service token
realm="$(sed -n 's/.*realm="\([^"]*\)".*/\1/p' <<<"${challenge}")"
service="$(sed -n 's/.*service="\([^"]*\)".*/\1/p' <<<"${challenge}")"
token="$(curl -fsSL -G "${realm}" --data-urlencode "service=${service}" --data-urlencode "scope=repository:${repo}:pull" | jq -r '.token // .access_token')"
auth=(-H "Authorization: Bearer ${token}")
fi
echo "==> Fetching ${ARCHIE_RELEASES}:${tag}..."
curl -fsSL "${auth[@]}" -H "Accept: application/vnd.oci.image.manifest.v1+json" "${base}/manifests/${tag}" -o "${TMP}/manifest.json"
blob() { curl -fsSL "${auth[@]}" "${base}/blobs/$1" -o "$2" && [ "sha256:$(sha256sum "$2" | cut -d' ' -f1)" = "$1" ]; }
local statement_digest
statement_digest="$(jq -er '.layers[0].digest' "${TMP}/manifest.json")"
blob "${statement_digest}" "${TMP}/statement.json" || { echo "Error: the release statement does not match its digest." >&2; exit 1; }
jq -er '.annotations["dev.archie.release.signature.v1"]' "${TMP}/manifest.json" | base64 -d >"${TMP}/statement.sig"
# An ed25519 public key is its 32 bytes behind a fixed SubjectPublicKeyInfo header.
{ printf '\x30\x2a\x30\x05\x06\x03\x2b\x65\x70\x03\x21\x00'; base64 -d <<<"${ARCHIE_RELEASE_KEY}"; } >"${TMP}/key.der"
openssl pkeyutl -verify -pubin -inkey "${TMP}/key.der" -keyform DER -rawin \
-in "${TMP}/statement.json" -sigfile "${TMP}/statement.sig" >/dev/null 2>&1 ||
{ echo "Error: ${ARCHIE_RELEASES}:${tag} is not signed by the release key." >&2; exit 1; }
local zip_name zip_digest
VERSION="$(jq -er .version "${TMP}/statement.json")"
[ "$(jq -r .platform "${TMP}/statement.json")" = linux-amd64 ] || { echo "Error: the release is not built for linux-amd64." >&2; exit 1; }
[ -z "${VERSION}" ] || [ "${tag}" = "${ARCHIE_CHANNEL}" ] || [ "v${VERSION}" = "${tag}" ] ||
{ echo "Error: ${tag} carries the statement for ${VERSION}." >&2; exit 1; }
zip_name="$(jq -er .zip.name "${TMP}/statement.json")"
zip_digest="$(jq -er .zip.digest "${TMP}/statement.json")"
RELEASE_NAME="${zip_name%.zip}"
case "${RELEASE_NAME}" in archie-core-archied-v*-linux-amd64) ;; *) echo "Error: unexpected release zip ${zip_name}." >&2; exit 1 ;; esac
echo "==> Downloading Archie ${VERSION}..."
blob "${zip_digest}" "${TMP}/${zip_name}" || { echo "Error: ${zip_name} does not match the signed digest." >&2; exit 1; }
unzip -q "${TMP}/${zip_name}" -d "${TMP}"
}
# 1. Prerequisites
echo "==> Checking prerequisites..."
# The installer depends on systemd user units and GNU tools.
@@ -79,7 +172,7 @@ if [ "${FROM_SOURCE}" = true ]; then
need git go jq
else
[ "$(uname -m)" = x86_64 ] || { echo "Error: releases are built for x86_64 only; use --from-source." >&2; exit 1; }
need curl unzip sha256sum
need curl unzip sha256sum openssl jq base64
fi
if command -v docker &>/dev/null; then
echo " [OK] $(docker --version)"
@@ -89,56 +182,51 @@ fi
mkdir -p "${ARCHIE_CONFIG_DIR}" "${ARCHIE_DATA_DIR}" "${ARCHIE_BIN_DIR}"
# 2. Binaries. STAGE ends up holding the binaries, release.json and the
# updater scripts, whichever way they were obtained.
# 2. Binaries. STAGE ends up holding the binaries and release.json, whichever
# way they were obtained.
TMP="$(mktemp -d)"
trap 'rm -rf "${TMP}"' EXIT
if [ "${FROM_SOURCE}" = true ]; then
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
if [ -f "${SCRIPT_DIR}/go.mod" ] && grep -q "github.com/${REPO}" "${SCRIPT_DIR}/go.mod"; then
if [ -f "${SCRIPT_DIR}/go.mod" ] && grep -q "${MODULE}" "${SCRIPT_DIR}/go.mod"; then
SRC_DIR="${SCRIPT_DIR}"
else
SRC_DIR="${TMP}/src"
git clone --quiet --depth=1 "https://github.com/${REPO}.git" "${SRC_DIR}"
git clone --quiet --depth=1 "${SOURCE_GIT}" "${SRC_DIR}"
fi
echo "==> Building from ${SRC_DIR}..."
# Selects (and under the default GOTOOLCHAIN=auto, downloads) the toolchain
# go.mod requires, so a missing one fails here rather than mid-build.
required="$(sed -n 's/^go //p' "${SRC_DIR}/go.mod")"
if ! out="$(cd "${SRC_DIR}" && go list -m 2>&1)"; then
echo "Error: Archie needs Go ${required}, which is not available: ${out}" >&2
echo "Install Go ${required} from https://go.dev/dl, or allow the download with GOTOOLCHAIN=auto and network access to proxy.golang.org." >&2
exit 1
fi
STAGE="${TMP}/stage"
mkdir -p "${STAGE}"
# A source build is not a release: it says `dev`, and buildType=binary lets
# it self-update.
LDFLAGS="-X github.com/${REPO}/internal/buildinfo.Version=dev -X github.com/${REPO}/internal/buildinfo.Runtime=dev -X github.com/${REPO}/internal/installtype.buildType=binary"
for cmd in $(jq -er '.required_topology.units | join(" ")' "${SRC_DIR}/release.json"); do
# it self-update. The agentworker stamp only lands in archie-agent.
LDFLAGS="-X ${MODULE}/internal/buildinfo.Version=dev -X ${MODULE}/internal/buildinfo.Runtime=dev -X ${MODULE}/internal/installtype.buildType=binary -X ${MODULE}/internal/app/agentworker.version=dev"
for cmd in $(jq -er '[.required_topology.units[], .required_topology.binaries[]?] | join(" ")' "${SRC_DIR}/release.json"); do
(cd "${SRC_DIR}" && go build -ldflags "${LDFLAGS}" -o "${STAGE}/${cmd}" "./cmd/${cmd}")
done
cp "${SRC_DIR}/release.json" "${SRC_DIR}"/scripts/archie-update-* "${STAGE}/"
cp "${SRC_DIR}/release.json" "${STAGE}/"
else
if [ -z "${VERSION}" ]; then
tag="$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p')"
[ -n "${tag}" ] || { echo "Error: could not find the latest release." >&2; exit 1; }
else
tag="v${VERSION}"
fi
VERSION="${tag##*v}"
name="archie-core-archied-v${VERSION}-linux-amd64"
echo "==> Downloading Archie ${VERSION}..."
base="https://github.com/${REPO}/releases/download/${tag}"
curl -fsSL "${base}/${name}.zip" -o "${TMP}/${name}.zip"
curl -fsSL "${base}/SHA256SUMS" -o "${TMP}/SHA256SUMS"
expected="$(awk -v n="${name}.zip" '$2 == n {print $1}' "${TMP}/SHA256SUMS")"
[[ "${expected}" =~ ^[a-f0-9]{64}$ ]] || { echo "Error: ${name}.zip is not in SHA256SUMS." >&2; exit 1; }
printf '%s %s\n' "${expected}" "${TMP}/${name}.zip" | sha256sum --check --status ||
{ echo "Error: checksum mismatch for ${name}.zip." >&2; exit 1; }
unzip -q "${TMP}/${name}.zip" -d "${TMP}"
STAGE="${TMP}/${name}"
install_release
STAGE="${TMP}/${RELEASE_NAME}"
fi
TOPOLOGY_UNITS="$(tr -d '\n' <"${STAGE}/release.json" | sed -n 's/.*"units": *\[\([^]]*\)\].*/\1/p' | tr -d '" ' | tr , ' ')"
for cmd in ${TOPOLOGY_UNITS}; do
# 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.
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}"
done
install -m755 "${STAGE}"/archie-update-* "${ARCHIE_BIN_DIR}/"
echo " Installed ${TOPOLOGY_UNITS} and the updater to ${ARCHIE_BIN_DIR}/"
echo " Installed ${TOPOLOGY_UNITS} ${TOPOLOGY_BINARIES} to ${ARCHIE_BIN_DIR}/"
# 3. Configuration. archied setup asks every question and writes config.toml
# plus any secrets to the env file beside it; this script asks nothing itself.
@@ -156,7 +244,25 @@ if [ ! -f "${ARCHIE_CONFIG_DIR}/config.toml" ]; then
echo "ERROR: archied setup could not generate ${ARCHIE_CONFIG_DIR}/config.toml" >&2
exit 1
fi
if [ "${ARCHIE_RELEASES}" != "${DEFAULT_RELEASES}" ] || [ "${ARCHIE_RELEASE_KEY}" != "${DEFAULT_RELEASE_KEY}" ]; then
# The instance keeps updating from the source it was installed from.
printf '\n[distribution]\nreleases = "%s"\nreleases_key = "%s"\n' "${ARCHIE_RELEASES}" "${ARCHIE_RELEASE_KEY}" >>"${ARCHIE_CONFIG_DIR}/config.toml"
fi
if [ -n "${PORT_BASE}" ]; then
# The generated config names the default addresses; move them to this
# instance's ports and pin the services the template leaves commented.
sed -i -e "s/127\.0\.0\.1:8484/127.0.0.1:${P_WEB}/g" -e "s/127\.0\.0\.1:8485/127.0.0.1:${P_HEALTH}/g" \
-e "s/127\.0\.0\.1:8585/127.0.0.1:${P_GATEWAY}/g" -e "s/127\.0\.0\.1:9090/127.0.0.1:${P_STATE}/g" \
-e "s/127\.0\.0\.1:8586/127.0.0.1:${P_MESSAGING}/g" -e "s/127\.0\.0\.1:8587/127.0.0.1:${P_DAEMON}/g" \
"${ARCHIE_CONFIG_DIR}/config.toml"
for section in messaging:${P_MESSAGING} daemon:${P_DAEMON}; do
name="${section%%:*}" port="${section#*:}"
grep -q "^\[services\.${name}\]" "${ARCHIE_CONFIG_DIR}/config.toml" ||
printf '\n[services.%s]\ntarget = "127.0.0.1:%s"\nlisten = "127.0.0.1:%s"\n' "${name}" "${port}" "${port}" >>"${ARCHIE_CONFIG_DIR}/config.toml"
done
fi
else
[ -n "${PORT_BASE}" ] && echo " [WARN] --port-base only applies to a new config; ${ARCHIE_CONFIG_DIR}/config.toml keeps its addresses." >&2
echo " [SKIP] ${ARCHIE_CONFIG_DIR}/config.toml already exists. Re-run 'archied setup' to change it."
fi
@@ -198,9 +304,9 @@ services:
volumes:
pg_data:
EOF
if ! docker compose -p archie --env-file "${ENV_FILE}" -f "${PG_COMPOSE}" up -d --wait; then
if ! docker compose -p "${INSTANCE}" --env-file "${ENV_FILE}" -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 archie -f ${PG_COMPOSE} logs" >&2
echo " Check: docker compose -p "${INSTANCE}" -f ${PG_COMPOSE} logs" >&2
AUTO_START=false
fi
fi
@@ -234,7 +340,7 @@ if [ "${INSTALL_SYSTEMD}" = true ] && command -v systemctl &>/dev/null && [ -d "
# description now, not the mechanism: a fresh install must not need four
# hand-written units before its own updater will run, and
# the contents must not live in two places to drift apart.
cat <<EOF > "${SYSTEMD_USER_DIR}/archied.service"
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_DAEMON}.service"
[Unit]
Description=Archie Core Orchestrator Daemon
After=network.target
@@ -245,9 +351,13 @@ StartLimitIntervalSec=300
StartLimitBurst=5
[Service]
Type=simple
Type=notify
NotifyAccess=main
# Beats only while the run loop is polling, so a wedged loop is restarted.
WatchdogSec=30s
ExecStart=${ARCHIE_BIN_DIR}/archied -config ${ARCHIE_CONFIG_DIR}/config.toml
EnvironmentFile=-${ENV_FILE}
Environment=ARCHIE_INSTANCE=${INSTANCE}
# archied reloads its configuration on SIGHUP. Without ExecReload,
# 'systemctl --user reload archied' fails and the operator has to know
# to run 'systemctl --user kill -s HUP' instead.
@@ -261,15 +371,17 @@ EOF
# The State Store owns the task data and is the process everything else dials, so
# its unit is the first dependency the others name.
cat <<EOF > "${SYSTEMD_USER_DIR}/archie-state-store.service"
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_STATE}.service"
[Unit]
Description=Archie State Store Service
After=network.target
[Service]
Type=simple
ExecStart=${ARCHIE_BIN_DIR}/archie-state-store -config ${ARCHIE_CONFIG_DIR}/config.toml -listen 127.0.0.1:9090 -ready-addr 127.0.0.1:9091
Type=notify
NotifyAccess=main
ExecStart=${ARCHIE_BIN_DIR}/archie-state-store -config ${ARCHIE_CONFIG_DIR}/config.toml -listen 127.0.0.1:${P_STATE} -ready-addr 127.0.0.1:${P_READY}
EnvironmentFile=-${ENV_FILE}
Environment=ARCHIE_INSTANCE=${INSTANCE}
Restart=on-failure
RestartSec=5s
@@ -277,15 +389,17 @@ RestartSec=5s
WantedBy=default.target
EOF
cat <<EOF > "${SYSTEMD_USER_DIR}/archie-gateway.service"
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_GATEWAY}.service"
[Unit]
Description=Archie Gateway Service
After=network.target
[Service]
Type=simple
ExecStart=${ARCHIE_BIN_DIR}/archie-gateway -config ${ARCHIE_CONFIG_DIR}/config.toml -listen 127.0.0.1:8585
Type=notify
NotifyAccess=main
ExecStart=${ARCHIE_BIN_DIR}/archie-gateway -config ${ARCHIE_CONFIG_DIR}/config.toml -listen 127.0.0.1:${P_GATEWAY}
EnvironmentFile=-${ENV_FILE}
Environment=ARCHIE_INSTANCE=${INSTANCE}
Restart=on-failure
RestartSec=5s
@@ -293,16 +407,17 @@ RestartSec=5s
WantedBy=default.target
EOF
cat <<EOF > "${SYSTEMD_USER_DIR}/archie-ui.service"
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_UI}.service"
[Unit]
Description=Archie UI Service
After=network.target archie-state-store.service
Wants=archie-state-store.service
After=network.target ${U_STATE}.service
Wants=${U_STATE}.service
[Service]
Type=simple
ExecStart=${ARCHIE_BIN_DIR}/archie-ui -config ${ARCHIE_CONFIG_DIR}/config.toml
EnvironmentFile=-${ENV_FILE}
Environment=ARCHIE_INSTANCE=${INSTANCE}
Restart=on-failure
RestartSec=5s
@@ -312,16 +427,18 @@ EOF
# The Telegram, email and webhook channels run here, not in archied: without
# this unit a host looks healthy while its channels are dead.
cat <<EOF > "${SYSTEMD_USER_DIR}/archie-messaging.service"
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_MESSAGING}.service"
[Unit]
Description=Archie Messaging Service
After=network.target archie-gateway.service archie-state-store.service
Wants=archie-gateway.service archie-state-store.service
After=network.target ${U_GATEWAY}.service ${U_STATE}.service
Wants=${U_GATEWAY}.service ${U_STATE}.service
[Service]
Type=simple
Type=notify
NotifyAccess=main
ExecStart=${ARCHIE_BIN_DIR}/archie-messaging -config ${ARCHIE_CONFIG_DIR}/config.toml
EnvironmentFile=-${ENV_FILE}
Environment=ARCHIE_INSTANCE=${INSTANCE}
Restart=on-failure
RestartSec=5s
@@ -329,9 +446,12 @@ RestartSec=5s
WantedBy=default.target
EOF
INSTANCE_UNITS=""
for base in $TOPOLOGY_UNITS; do INSTANCE_UNITS="${INSTANCE_UNITS:+${INSTANCE_UNITS} }$(unit "${base}")"; done
systemctl --user daemon-reload || true
SERVICE_INSTALLED=true
for unit in $TOPOLOGY_UNITS; do
for unit in $INSTANCE_UNITS; do
test -f "${SYSTEMD_USER_DIR}/${unit}.service" || { echo "missing required unit: $unit" >&2; exit 1; }
echo " Installed ${SYSTEMD_USER_DIR}/${unit}.service"
done
@@ -355,11 +475,13 @@ EOF
fi
# Auto-enable and start the services, the store first so a fresh boot does
# not race a dial it depends on.
# not race a dial it depends on. Restart rather than start, because a
# reinstall over running services would otherwise leave the old binaries
# running.
if [ "${AUTO_START}" = true ]; then
echo "==> Enabling and starting Archie services..."
systemctl --user enable --now $TOPOLOGY_UNITS ||
echo " Notice: Could not start every service automatically. Check: systemctl --user status archied archie-state-store archie-gateway archie-ui archie-messaging"
{ systemctl --user enable $INSTANCE_UNITS && systemctl --user restart $INSTANCE_UNITS; } ||
echo " Notice: Could not start every service automatically. Check: systemctl --user status ${INSTANCE_UNITS}"
fi
fi
@@ -386,13 +508,15 @@ fi
if [ "${SERVICE_INSTALLED}" = true ] && [ "${AUTO_START}" = true ]; then
echo "Service Management:"
echo " - Units installed : archied archie-state-store archie-gateway archie-ui archie-messaging"
echo " - View live logs : journalctl --user -u archied -f"
echo " - Service status : systemctl --user status archied archie-state-store archie-gateway archie-ui archie-messaging"
echo " - Restart daemon : systemctl --user restart archied"
echo " - Units installed : ${INSTANCE_UNITS}"
echo " - View live logs : journalctl --user -u ${U_DAEMON} -f"
echo " - Service status : systemctl --user status ${INSTANCE_UNITS}"
echo " - Restart daemon : systemctl --user restart ${U_DAEMON}"
else
echo "Manual Startup: start the five services as in https://github.com/${REPO}/blob/main/deployments/README.md"
echo "Manual Startup: start the five services as in https://offloaded.dev"
fi
echo ""
echo "Dashboard: http://127.0.0.1:8484 Change the config: archied setup"
SETUP_HINT="archied setup"
[ "${INSTANCE}" = archie ] || SETUP_HINT="ARCHIE_INSTANCE=${INSTANCE} archied setup"
echo "Dashboard: http://127.0.0.1:${P_WEB} Change the config: ${SETUP_HINT}"
echo ""
+26 -3
View File
@@ -46,6 +46,17 @@ func AcceptCapture(spec agentrun.CaptureTool, accepted int, value json.RawMessag
// 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 {
@@ -121,8 +132,8 @@ func ServeCaptureFiles(ctx context.Context, specPath, capturesPath string, t mcp
if err != nil {
return err
}
var specs []agentrun.CaptureTool
if err := json.Unmarshal(raw, &specs); err != nil {
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)
@@ -130,5 +141,17 @@ func ServeCaptureFiles(ctx context.Context, specPath, capturesPath string, t mcp
return err
}
defer sink.Close()
return ServeCaptureMCP(ctx, specs, sink, t)
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)
}
+4 -7
View File
@@ -29,12 +29,9 @@ var harnessAdapters = map[string]HarnessAdapter{
NewOutput: func() HarnessOutput { return newClaudeCodeHarnessOutput() },
MCPConfig: []string{"--mcp-config", mcpConfigPlaceholder},
},
// Codex takes MCP servers only as inline -c overrides, and Pi and OMP
// read no MCP config file of this shape, so their stages serve no
// capture tools.
AdapterCodex: {NewOutput: func() HarnessOutput { return &codexHarnessOutput{} }},
AdapterPi: {NewOutput: func() HarnessOutput { return &piHarnessOutput{} }},
AdapterOMP: {NewOutput: func() HarnessOutput { return &piHarnessOutput{} }},
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},
@@ -55,7 +52,7 @@ type HarnessStages struct {
Spec agentrun.HarnessSpec
}
func (r HarnessStages) Run(ctx context.Context, workspace string, req agentrun.Request, report agentrun.ToolCallReporter) (agentrun.Result, error) {
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
@@ -0,0 +1,127 @@
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
@@ -0,0 +1,46 @@
//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)
}
})
}
}
+7 -9
View File
@@ -28,7 +28,7 @@ func newClaudeCodeHarnessOutput() *claudeCodeHarnessOutput {
}
}
func (o *claudeCodeHarnessOutput) Line(line []byte, report agentrun.ToolCallReporter) {
func (o *claudeCodeHarnessOutput) Line(line []byte, report agentrun.Reporter) {
var event struct {
Type string `json:"type"`
SessionID string `json:"session_id"`
@@ -55,7 +55,7 @@ func (o *claudeCodeHarnessOutput) Line(line []byte, report agentrun.ToolCallRepo
}
}
func (o *claudeCodeHarnessOutput) assistant(raw json.RawMessage, _ agentrun.ToolCallReporter) {
func (o *claudeCodeHarnessOutput) assistant(raw json.RawMessage, _ agentrun.Reporter) {
var message struct {
ID string `json:"id"`
Usage json.RawMessage `json:"usage"`
@@ -79,7 +79,7 @@ func (o *claudeCodeHarnessOutput) assistant(raw json.RawMessage, _ agentrun.Tool
}
}
func (o *claudeCodeHarnessOutput) user(raw json.RawMessage, report agentrun.ToolCallReporter) {
func (o *claudeCodeHarnessOutput) user(raw json.RawMessage, report agentrun.Reporter) {
var message struct {
Content []struct {
Type string `json:"type"`
@@ -100,12 +100,10 @@ func (o *claudeCodeHarnessOutput) user(raw json.RawMessage, report agentrun.Tool
continue
}
delete(o.pending, block.ToolUseID)
if report != nil {
report(agentrun.ToolCallReport{
Tool: tool, Detail: ClipToolCallDetail(claudeResultContent(block.Content)),
Failed: block.IsError,
})
}
report.ReportToolCall(agentrun.ToolCallReport{
Tool: tool, Detail: ClipToolCallDetail(claudeResultContent(block.Content)),
Failed: block.IsError,
})
}
}
+3 -3
View File
@@ -15,7 +15,7 @@ type codexHarnessOutput struct {
usage agentrun.Usage
}
func (o *codexHarnessOutput) Line(line []byte, report agentrun.ToolCallReporter) {
func (o *codexHarnessOutput) Line(line []byte, report agentrun.Reporter) {
var event struct {
Type string `json:"type"`
ThreadID string `json:"thread_id"`
@@ -43,8 +43,8 @@ func (o *codexHarnessOutput) Line(line []byte, report agentrun.ToolCallReporter)
})
}
case "item.completed":
if call, ok := event.Item.report(); ok && report != nil {
report(call)
if call, ok := event.Item.report(); ok {
report.ReportToolCall(call)
}
}
}
+2 -4
View File
@@ -18,7 +18,7 @@ func newCopilotHarnessOutput() *copilotHarnessOutput {
return &copilotHarnessOutput{pending: make(map[string]string)}
}
func (o *copilotHarnessOutput) Line(line []byte, report agentrun.ToolCallReporter) {
func (o *copilotHarnessOutput) Line(line []byte, report agentrun.Reporter) {
var event struct {
Type string `json:"type"`
SessionID string `json:"sessionId"`
@@ -52,9 +52,7 @@ func (o *copilotHarnessOutput) Line(line []byte, report agentrun.ToolCallReporte
return
}
delete(o.pending, event.Data.ToolCallID)
if report != nil {
report(agentrun.ToolCallReport{Tool: tool, Detail: ClipToolCallDetail(event.Data.Result.Content), Failed: !event.Data.Success})
}
report.ReportToolCall(agentrun.ToolCallReport{Tool: tool, Detail: ClipToolCallDetail(event.Data.Result.Content), Failed: !event.Data.Success})
}
}
+3 -3
View File
@@ -15,7 +15,7 @@ type piHarnessOutput struct {
usage agentrun.Usage
}
func (o *piHarnessOutput) Line(line []byte, report agentrun.ToolCallReporter) {
func (o *piHarnessOutput) Line(line []byte, report agentrun.Reporter) {
var event struct {
Type string `json:"type"`
ID string `json:"id"`
@@ -49,7 +49,7 @@ func (o *piHarnessOutput) Line(line []byte, report agentrun.ToolCallReporter) {
o.usage = addUsage(o.usage, usageFromFields(u.Input, u.Output, u.CacheRead, u.CacheWrite))
}
case "tool_execution_end":
if event.ToolName == "" || report == nil {
if event.ToolName == "" {
return
}
texts := make([]string, 0, len(event.Result.Content))
@@ -58,7 +58,7 @@ func (o *piHarnessOutput) Line(line []byte, report agentrun.ToolCallReporter) {
texts = append(texts, block.Text)
}
}
report(agentrun.ToolCallReport{Tool: event.ToolName, Detail: ClipToolCallDetail(strings.Join(texts, "\n")), Failed: event.IsError})
report.ReportToolCall(agentrun.ToolCallReport{Tool: event.ToolName, Detail: ClipToolCallDetail(strings.Join(texts, "\n")), Failed: event.IsError})
}
}
+27 -15
View File
@@ -45,7 +45,7 @@ const (
// 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.ToolCallReporter)
Line(line []byte, report agentrun.Reporter)
SessionID() string
Usage() agentrun.Usage
}
@@ -67,7 +67,7 @@ func NewHarnessRunner(newOutput func() HarnessOutput) *HarnessRunner {
return &HarnessRunner{newOutput: newOutput}
}
func (r *HarnessRunner) Run(ctx context.Context, workspace string, req agentrun.Request, report agentrun.ToolCallReporter) (agentrun.Result, error) {
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
}
@@ -81,6 +81,11 @@ func (r *HarnessRunner) Run(ctx context.Context, workspace string, req agentrun.
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))
@@ -90,7 +95,7 @@ func (r *HarnessRunner) Run(ctx context.Context, workspace string, req agentrun.
return res, err
}
func (r *HarnessRunner) run(ctx context.Context, workspace string, req agentrun.Request, mcpConfig string, report agentrun.ToolCallReporter) (agentrun.Result, error) {
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 {
@@ -195,8 +200,8 @@ func validateHarness(req agentrun.Request) error {
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 && !slices.ContainsFunc(h.MCPConfig, func(s string) bool { return strings.Contains(s, mcpConfigPlaceholder) }) {
return errors.New("stage has capture tools but the harness registers no MCP server; its results would be lost")
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
}
@@ -239,7 +244,7 @@ func resumeVerb(h *agentrun.HarnessSpec, sessionID string) []string {
// 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.ToolCallReporter) error {
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
@@ -254,16 +259,18 @@ func invoke(ctx context.Context, workspace string, h *agentrun.HarnessSpec, argv
return err
}
var stderr tailBuffer
cmd.Stderr = &stderr
cmd.Stderr = io.MultiWriter(&stderr, os.Stderr)
if err := cmd.Start(); err != nil {
return fmt.Errorf("start harness: %w", err)
}
scanner := bufio.NewScanner(stdout)
// 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, stdout)
_, _ = io.Copy(io.Discard, output)
if err := cmd.Wait(); err != nil {
if ctx.Err() != nil {
return ctx.Err()
@@ -460,9 +467,9 @@ func policyViolation(before, after repoState, changes []string, req agentrun.Req
type silentOutput struct{}
func (silentOutput) Line([]byte, agentrun.ToolCallReporter) {}
func (silentOutput) SessionID() string { return "" }
func (silentOutput) Usage() agentrun.Usage { return agentrun.Usage{} }
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 }
@@ -483,7 +490,7 @@ func (t *tailBuffer) String() string { return t.buf.String() }
// writes into it.
func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures string, cleanup func(), err error) {
cleanup = func() {}
if len(req.CaptureTools) == 0 {
if len(req.CaptureTools) == 0 && !req.Harness.CentralTools {
return "", "", cleanup, nil
}
dir, err := os.MkdirTemp("", "archie-captures-")
@@ -495,7 +502,7 @@ func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures
cleanup()
return "", "", func() {}, err
}
spec, err := json.Marshal(req.CaptureTools)
spec, err := json.Marshal(harnessMCPSpec{Captures: req.CaptureTools, CentralTools: req.Harness.CentralTools})
if err != nil {
return fail(err)
}
@@ -509,6 +516,7 @@ func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures
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}),
}
@@ -524,5 +532,9 @@ func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures
if err := ownForHarness(req.Harness.User, dir, specPath, configPath, capturesPath); err != nil {
return fail(err)
}
return configPath, capturesPath, cleanup, nil
registration, err := harnessMCPRegistration(req.Harness.Adapter, dir, configPath, server)
if err != nil {
return fail(err)
}
return registration, capturesPath, cleanup, nil
}
+41
View File
@@ -0,0 +1,41 @@
//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)
}
}
}
+46 -1
View File
@@ -8,6 +8,8 @@ import (
"slices"
"strings"
"github.com/google/jsonschema-go/jsonschema"
"github.com/samcharles93/archie-core/internal/domain/agentrun"
)
@@ -62,7 +64,7 @@ func ProtectionMatcher(p agentrun.Protection, readOnly bool) func(string) bool {
func ValidateCaptureArgs(spec agentrun.CaptureTool, value json.RawMessage) (string, bool) {
var object map[string]json.RawMessage
if err := json.Unmarshal(value, &object); err != nil {
return spec.Name + " rejected: arguments must be a JSON object", false //nolint:nilerr // the agent loop must see malformed tool arguments as feedback it can correct, not as a failed tool call
return spec.Name + " rejected: arguments must be a JSON object", false // the agent loop must see malformed tool arguments as feedback it can correct, not as a failed tool call
}
for _, check := range []func(agentrun.CaptureTool, map[string]json.RawMessage) (string, bool){
checkRequiredFields,
@@ -74,9 +76,52 @@ func ValidateCaptureArgs(spec agentrun.CaptureTool, value json.RawMessage) (stri
return rejection, false
}
}
// The derived checks above cover the common cases with friendly wording;
// the schema is what enforces the rest of what the tool advertised --
// enums, numeric types, nested objects, array shapes -- so a call the
// agent could only make valid is rejected with the reason, not recorded.
return checkSchema(spec, value)
}
// checkSchema validates the arguments against the tool's advertised JSON
// Schema. A tool with no schema, or one that will not resolve, is accepted
// here: a schema that never resolves is a definition bug, refused where the
// tool is built (workflow's agentResultTool), so the agent is never blamed
// for it.
func checkSchema(spec agentrun.CaptureTool, value json.RawMessage) (string, bool) {
if len(spec.Parameters) == 0 {
return "", true
}
resolved, err := resolveCaptureSchema(spec.Parameters)
if err != nil {
return "", true
}
var instance any
if err := json.Unmarshal(value, &instance); err != nil {
return spec.Name + " rejected: arguments must be JSON", false
}
if err := resolved.Validate(instance); err != nil {
return fmt.Sprintf("%s rejected: %v", spec.Name, err), false
}
return "", true
}
// resolveCaptureSchema parses and resolves a capture tool's JSON Schema. The
// workflow parser resolves the same schema when it builds the tool, so an
// unusable schema is refused at definition time rather than silently skipped
// here.
func resolveCaptureSchema(params json.RawMessage) (*jsonschema.Resolved, error) {
var schema jsonschema.Schema
if err := json.Unmarshal(params, &schema); err != nil {
return nil, fmt.Errorf("capture tool schema: %w", err)
}
resolved, err := schema.Resolve(nil)
if err != nil {
return nil, fmt.Errorf("capture tool schema: %w", err)
}
return resolved, nil
}
func checkRequiredFields(spec agentrun.CaptureTool, object map[string]json.RawMessage) (string, bool) {
for _, field := range spec.RequiredFields {
if _, ok := object[field]; !ok {
Loaded 100 of 1685 files, more files were not shown because too many files have changed in this diff. Show more