Commit Graph
137 Commits
Author SHA1 Message Date
sam da01f2cbe1 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 c59f9336a5 feat(identity): name, lifetime and last-used on personal API tokens 2026-10-27 15:37:44 +11:00
sam 6c78358c7b 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 0880f703d7 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 1a8b442acd 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 c465d58713 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 334bb8cc40 fix(scheduling): fire a schedule's capture into its owning organisation 2026-10-27 10:03:29 +11:00
sam 9855f5820e fix(webui): report a workflow's running count and last status from its own runs 2026-10-27 02:52:38 +11:00
sam 5815c383c6 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 c23f92802e fix(audit): filter count aliases outside the projection and clean identity detail 2026-10-25 23:00:44 +11:00
sam edffc529dd fix(audit): close the feed union and repair denied and retention controls 2026-10-25 22:42:00 +11:00
sam 83f333876f fix(audit): harden export, scope history and derive feed targets 2026-10-25 22:39:22 +11:00
sam 717f9d5219 feat(webui): audit feed API, export and read_audit grant 2026-10-25 22:01:02 +11:00
sam 045f8c427d feat(state): apply audit retention to observability events 2026-10-25 21:42:38 +11:00
sam 655068db70 feat(state): unified org-scoped audit feed and AuditService 2026-10-25 21:37:56 +11:00
sam 9314b02eb1 fix(state): resolve identity audit org in one statement 2026-10-25 21:37:50 +11:00
sam 9a3060d4f7 fix(state): attribute identity events to the subject's single org 2026-10-25 21:35:19 +11:00
sam bcdd4bb531 feat(state): audit access reset, org, membership and EDA writes 2026-10-25 21:33:28 +11:00
sam 135007b5f8 fix(state): serialise source writes and keep binding workspaces audited 2026-10-25 21:33:08 +11:00
sam 06da6a8334 fix(state): classify audit coverage rows and keep unknown identity orgs private 2026-10-25 21:25:55 +11:00
sam deb136652e fix(state): harden the audit feed against audit findings 2026-10-25 21:23:52 +11:00
sam f873368080 feat(state): org-scoped audit feed contract and read model 2026-10-25 21:23:52 +11:00
sam 99b1f8a2d9 feat(state): audit access resets, org and EDA writes 2026-10-25 21:10:38 +11:00
sam 36cd4b09b4 fix(postgres): correct package and secret audit coverage 2026-10-25 21:03:00 +11:00
sam f7caf2c40e feat(postgres): audit package and harness secret writes 2026-10-25 21:00:27 +11:00
sam 6120c38e7f fix(state): correct audit backfill scoping and policy write races 2026-10-25 20:59:04 +11:00
sam 3e9948960e feat(state): shared audit write helper for domain tables 2026-10-25 20:49:47 +11:00
sam 5816c5cc53 feat(state): org-scoped audit trail and complete policy write audit 2026-10-25 20:49:20 +11:00
sam 4de8b67ba8 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 3915441cdf 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 cf2942c97a 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 cc7bc90ff3 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 952187eb2c fix(store): post open chat task states once after the posted-status migration 2026-10-25 02:46:43 +11:00
sam 4e2edc911f 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 1a386dae7e feat(archied): tell the chat when its task opens a pull request 2026-10-25 02:39:34 +11:00
sam 348c08cebb feat(archied): post approval requests to the chat that started the task 2026-10-24 23:59:25 +11:00
sam 721e43c5e4 feat(webui): link parked tasks to the page that fixes their blocker 2026-10-17 17:08:24 +11:00
sam 8785456e44 feat(identity): seed a narrow agent identity and run shipped workflows as it 2026-10-17 17:04:43 +11:00
sam d6a2de6fd3 feat(taskactions): retry a parked task on the current workflow definition 2026-10-17 13:35:12 +11:00
sam 467453e4ff chore(postgres): delete unused queries 2026-10-17 10:17:14 +11:00
sam aa012a7c6e feat(identity): add browser setup and user accounts 2026-10-16 02:41:24 +11:00
sam cf5674f5da 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 df20b64f62 fix(postgres): age retention spares captures still waiting to be dispatched
Issue: archie-core-jrh2m
2026-10-13 16:19:12 +11:00
sam bf17cd3a13 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 25face6d04 fix(workflows): callees of a test run inherit the test source 2026-10-13 12:46:48 +11:00
sam 2a066f6d4f 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 caf560bdfa 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 03b43fc07b 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 23f87c4cea 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 357cb3a54c 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