Commit Graph
215 Commits
Author SHA1 Message Date
sam e3add11a1d feat(credentials): grant credential services to dashboard identities, chosen from pickers 2026-10-18 00:43:31 +11:00
sam 65f2586121 feat(instructions): layer instance, organisation, workflow and repository instructions into every agent stage 2026-10-17 23:42:39 +11:00
sam 3f553bb6f2 feat(kit): central tools for harnesses through the egress proxy and gateway task-tool RPCs 2026-10-17 23:42:37 +11:00
sam ca12e36728 refactor(workflow): drop the root identity alias from workflow definitions 2026-10-17 17:09:37 +11:00
sam 4e56a9a05f feat(webui): link parked tasks to the page that fixes their blocker 2026-10-17 17:08:24 +11:00
sam 5c8e8b0fcb refactor(archied): discover issues through organisation connections 2026-10-17 13:38:46 +11:00
sam 41199b1bc4 fix(daemon): open model egress only for workflows with a model step 2026-10-17 10:03:12 +11:00
sam e624a3737b feat(daemon): execute and verify organisation repository connections 2026-10-17 09:32:39 +11:00
sam 5d6d24c147 fix(daemon): execute dashboard identities with scoped authority 2026-10-17 03:13:30 +11:00
sam 57456b3e9e fix(ui): repair settings editing and workflow diagnostics 2026-10-16 23:55:58 +11:00
sam 53c95038de 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 cc0fba87b4 feat(archied): read-only run-scoped sandbox view over the harness contract (#1662)
Quality / check (push) Canceled after 0s
* 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 91fd383bdb 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 0a96ccddcc 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 132152f545 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 747a7cbfd7 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 3960a00f5d 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 af1a5f0b89 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 2cef93a59d feat(workflow): shipped workflows run as the instance root 2026-10-12 01:53:55 +11:00
sam f78f2a1629 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 77837aad2e 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 2ee0b1df45 fix(daemon): bound a package workflow's triggers by its accepted authority 2026-10-11 04:08:02 +11:00
sam 07a95e94ec Merge branch 'work/zcg8' 2026-10-11 04:03:52 +11:00
sam 7ca1896b16 fix(daemon): reown worktrees a killed container left root-owned 2026-10-11 04:01:19 +11:00
sam bc5f6e7779 fix(daemon): last poll reports the least recently polled loop 2026-10-11 03:53:11 +11:00
sam 4ed4b7f9d7 fix(daemon): bound a package workflow's tools by its accepted authority 2026-10-11 03:48:31 +11:00
sam ffee1a3394 refactor(workflow): delete routing overrides nothing applied 2026-10-11 03:43:25 +11:00
sam e4b2e34e4a 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 307ab4e507 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 66a977763d fix(daemon): keep model provider keys out of agent containers via the egress proxy 2026-10-10 17:12:09 +11:00
sam ffacc10766 fix(daemon): reconcile call waits from durable steps 2026-10-09 17:56:15 +11:00
sam e2edc1bd5c fix(config): normalize default org for harness credentials 2026-10-09 10:01:35 +11:00
sam 422b2f413e fix(daemon): inherit live settings for identity tasks 2026-10-09 09:57:56 +11:00
sam 629404a509 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 f8dcef011c fix(workflow): resolve definitions in the owning org 2026-10-08 20:41:08 +11:00
sam 15905f4047 fix(daemon): withdraw only issues the same dispatch rule found eligible and then lost 2026-10-05 22:04:41 +11:00
sam be553e6dad feat(daemon): record an approving review on the task's timeline 2026-10-05 20:56:13 +11:00
sam 9e52a66ee6 feat(daemon): withdrawing an issue declines its queued or running work 2026-10-05 20:50:57 +11:00
sam 3ec0cc9b10 feat(daemon): the timeline names and links the binding and capture that started a task 2026-10-05 20:39:26 +11:00
sam 113ba5f9c3 fix(daemon): webhook forge intake does not poll for issues 2026-10-05 20:31:39 +11:00
sam cf63275a90 fix(postgres): collect inline comments on a review queued behind a running remediation 2026-10-05 20:30:25 +11:00
sam 45a6efedcb feat(eda): record every terminal binding outcome and flag failing bindings 2026-10-05 20:17:52 +11:00
sam fcd66395cd feat(eda): link binding dispatches to the captures and tasks they started 2026-10-05 20:16:02 +11:00
sam 582c1b2f66 fix(daemon): refuse a disabled workflow on every start path 2026-10-05 20:08:18 +11:00
sam 1b8d735ad5 fix(daemon): record terminal non-dispatch outcomes so a capture is evaluated once 2026-10-05 20:06:45 +11:00
sam ee2c9cda97 feat(releaseupdate): install from release artifacts with journaled rollback, topology check and channels 2026-10-05 17:02:29 +11:00
sam 80d3b0752c fix(postgres): queue a review that arrives during a remediation
A review reaction that landed while a remediate run owned the task failed the
pr_open guard, was acked and dropped, and the poll cursor advanced past it.
Runs against one task are serialised, so the unit is appended to
tasks.pending_reviews instead; the transition that returns the task to pr_open
promotes the oldest waiting review back to queued. A re-delivered unit is
absorbed by payload equality, never queued twice.
2026-10-05 14:58:14 +11:00
sam 23636d6120 feat(egress): the run credential is the proxy login; Kit secrets resolve per request from live grants 2026-10-04 19:35:26 +11:00
sam 4699280c9d fix(nats): containers log in with their run credential and reach only their task's subjects 2026-10-04 19:33:14 +11:00
sam 7f1aeb1927 feat(daemon): a workflow that names an identity runs as it; the dispatcher needs run on the workflow 2026-10-04 18:55:37 +11:00