Commit Graph
64 Commits
Author SHA1 Message Date
sam 92a9eca12c docs(architecture): state the shipped execution transition rules
The lifecycle block still showed `running -> merged` and never mentioned
`completed`. `running -> merged` is now illegal (taskstate transition table)
and `merged` is reachable only from `pr_open`; a workflow that opens no pull
request ends in the terminal `completed`.

Rewrite the block to the current rules and fold the crash-recovery requeue
into the `running` row it belongs to. Regenerate the committed docs artifact
carried by `task docs:artifact:check`.
2026-09-26 04:01:08 +10:00
sam 5b6572bcea feat(agentexec): run harness invocations as the Kit's user with no inherited environment
A Kit task runs worker and harness in one container, separated by user:
the worker keeps its credentials as root, and every harness invocation
runs as the Kit's user with only its declared environment. A nil env
would inherit the worker's, so the runner always passes an explicit one;
root is refused as a harness user, and a root worker refuses to start a
harness with no user. The PRD's container layout now says one container
per run, with the relay forwarding the proxy, NATS and the State Store.
2026-09-26 03:08:34 +10:00
sam 486d5574b3 docs(prds): fit harnesses, steps and the store inside the org boundary and profile model
A harness is an agent profile whose environment is a Kit composition, so
image profiles and existing workflows are unchanged and only Kit runs take
the egress path; the relay replaces the claim that containers reach the
proxy directly. Credentials, step records, store installs and reviews are
org-scoped under the run credential and the Authorizer, and workflow calls
are linked across executions rather than nested.
2026-09-26 02:41:02 +10:00
sam 1cf2742f54 docs(prds): approve PR review agent and store PRDs 2026-09-26 02:08:13 +10:00
sam 0f6cb5b8a6 docs(prds): store 2026-09-26 02:06:50 +10:00
sam fca30d6445 docs(prds): PR review agent 2026-09-26 02:05:52 +10:00
sam a98ca2c8e9 docs(prds): approve execution-tree and external-harness PRDs 2026-09-26 01:58:29 +10:00
sam 22d36fef75 docs(prds): harnesses run as Kit v3 images behind a credential-injecting egress proxy 2026-09-26 01:54:35 +10:00
sam f74827795d docs(prds): fold review findings into execution-tree and harness PRDs 2026-09-26 01:45:10 +10:00
sam ca8d189f96 docs(prds): agents reach a harness only through a workflow stage 2026-09-26 01:41:12 +10:00
sam 2ee7043daf docs(prds): external agent harnesses 2026-09-26 01:38:14 +10:00
sam bbc39897de docs(prds): execution tree and enforced state machine 2026-09-26 01:34:26 +10:00
sam 1bb52fe8c7 feat(webui): five-place top bar with Settings, New task and one connection pill
Dashboard, Tasks, Workflows, Events and Settings replace the Work, Agent
and System menus. Configuration pages move under /settings/* with
redirects from their old paths; Logs and Appearance leave the bar and stay
reachable from Jump to, the Dashboard and the account menu. New task opens
the Start work form in a dialog and lands on the new task. One pill reports
the live stream's state.

Drops docs/prds/dashboard-navigation-groups.md: web UI design is not
tracked in PRDs.
2026-09-25 15:09:18 +10:00
sam 067d365f84 fix(webui): multiplex dashboard live updates over one stream 2026-09-25 14:05:34 +10:00
sam 459bbcd5fc docs(prds): reflow playbook-expression-syntax
deploy / gate (push) Failing after 5m32s
deploy / build-and-push (push) Skipped
deploy / dist-zip (push) Skipped
2026-09-25 02:00:16 +10:00
sam 35dd7489dd test: remove layout-pinned route-registry and task-meta fixture tests
TestDashboardPagesRegistryCoversEveryRoute parsed ui/src/router/index.ts as
text, and TestTaskMetaPayloadMatchesFixture plus ui/test/task-meta-snapshot
pinned a formatted JSON fixture. They failed on formatting, not behaviour.
2026-09-25 01:32:20 +10:00
sam 065606b2a5 fix(ci): make the gate tolerate formatting and give deploy a PG 18 client
The page-registry test parsed the route table one line per route and the
task-meta fixture was byte-compared, so the prettier reformat broke both.
The registry test now splits route objects and ignores comments; the
fixture compares compacted JSON. Also drops a stale router comment that
described the removed redirects, rebuilds ui/dist, regenerates the
contracts artifact, keeps prettier off generated output, and installs
postgresql-client-18 in deploy.yml's gate as quality.yml already does.
2026-09-25 01:29:23 +10:00
sam 0d35e753b5 refactor: format markdown files using prettier, fix spelling concerns, reduce Taskfile bloat 2026-09-25 01:10:28 +10:00
sam c1cd5c8f5b chore(state-store): remove the one-time SQLite import and db_path
Every install serves from Postgres, so the legacyread/legacyimport packages,
the archie-state-store import command, the boot gate that refused to serve
over unimported SQLite files, and db_path (which only located those files)
go. Migration 0010 drops the import_completion table.
2026-09-25 00:40:48 +10:00
sam e5105280ad chore(config): remove token_env aliases for forge, artifacts and telegram
Each credential is now only a {engine, key} secret reference. A stale
token_env in a file is reported at startup as an unrecognised key.
nats.token_env stays (no secret-ref form), and providers.api_key_env stays:
it is the carrier the resolver writes each resolved key's env name into.
2026-09-24 23:58:26 +10:00
sam d299448de1 Merge branch 'main' into pg/foundation 2026-09-24 22:21:24 +10:00
sam c971348a86 docs(development): organise the guides by area
One page per area: frontend UI, agent, workflows, daemon (task lifecycle and
event automation together), State Store, control plane and settings, and
processes and wiring, with merging work kept separate.
2026-09-24 21:05:29 +10:00
sam 21e4d47907 docs(development): checklists for every kind of change
docs/development/ holds one page per kind of change (settings, State Store
and persistence, task lifecycle, workflows and steps, event automation,
dashboard, agent execution and containers, processes and wiring, merging
work), each naming every layer the change must reach and pointing at the
document that owns the design. The docs build puts them in the development
set; docs/index.md and CLAUDE.md link them.

Also adds the container-profile case to the validator agreement test, the
check the profiles work skipped.
2026-09-24 21:03:34 +10:00
sam d8bec1ae06 fix(eda): clear completed tasks; document the tool allowlist's reach and unchecked profile names
ClearTerminalTasks now deletes completed tasks, with a test that holds its
SQL list to taskstate.Terminal. The AllowTools comment says agentloop's
built-in file tools are outside the allowlist and why. The PRD model
diagram lists only what a profile holds (image, tools), and the profile
field and AgentProfile say a workflow's profile name is resolved at
dispatch, not when the workflow is saved.
2026-09-24 20:53:51 +10:00
sam d320a1a01a feat(eda): workflow inputs, optional repository and agent profiles
Workflow definitions declare inputs, repository (none, optional or
required; default required) and profile. A binding assigns each input
from a mapped parameter or a constant and may take its repository from a
parameter, which must name a configured repo; both are checked when the
binding is saved and again at dispatch. Inputs travel as structured task
data (tasks.inputs, the task brief, and a JSON block in the agent's
mission), never as body text.

A task with no repository runs in a per-task scratch workspace with no
clone and no publication grant. The agent.run step runs one mission
without a repository and finishes the task in the new completed status.

Agent profiles live under [containers.profiles.<name>]: an image and an
allowlist over the tools archie adds (MCP, scripts, plugins).
[containers].image is the default profile; an unconfigured profile parks
the task. The workflow is now pinned before the container starts so the
profile can choose its image.

Also stop two archied tests writing embedded NATS state into the package
directory, refuse an empty state_dir for embedded NATS, and drop the NATS
store files an earlier lane commit tracked.
2026-09-24 20:29:33 +10:00
sam be9a45ad2d Merge branch 'pg/foundation' into worktree-agent-a96503bc8828fc104
# Conflicts:
#	docs/data/generated/dev-docs.json
#	internal/app/archied/state_store_test.go
#	internal/app/archied/state_store_toolcalls_test.go
#	internal/contracts/state/v1/state.pb.go
#	internal/daemon/dispatch_bindings_test.go
#	internal/infrastructure/bindingcipher/cipher_test.go
#	internal/infrastructure/captureintake/receiver_test.go
#	internal/infrastructure/edastore/contracts_binding.go
#	internal/infrastructure/edastore/testsupport_test.go
#	internal/infrastructure/postgres/edastore.go
#	internal/infrastructure/postgres/edastore_test.go
#	internal/infrastructure/staterpc/error_test.go
#	internal/store/store.go
#	internal/webui/api_binding_test.go
2026-09-24 19:47:00 +10:00
sam 9864766804 docs: describe the PostgreSQL-only stores, state_dir and the import-only db_path
Architecture, deployment, installer, skill and PRD text now name the Postgres
State Store, the offline recovery commands on database_url, state_dir for host
state, and db_path as the legacy-file locator for archie-state-store import.
Finalised PRDs, CHANGELOG, docs/news and docs/archive are unchanged records.
2026-09-24 14:51:48 +10:00
sam 4f8290567b docs(bindings): bindings apply per event type with a filter; mappings count matches 2026-09-24 14:46:44 +10:00
sam 00e3520a1e Merge branch 'worktree-agent-a2b33953bdffebf56' into worktree-giggly-marinating-lamport
# Conflicts:
#	docs/data/generated/dev-docs.json
#	internal/app/archied/state_store_pool.go
2026-09-24 10:06:00 +10:00
sam 368e33a9a5 feat(archied): serve the State Store, event store and Gateway conversations from Postgres
The State Store's task and event-capture stores and the conversation store
read by archied and served by archie-gateway now open on database_url.
Every serving process refuses to start when legacy SQLite data exists and no
import completion is recorded, naming archie-state-store import; a fresh
install records completion itself. The Gateway holds its Postgres serve
claim for its lifetime and releases it before the pool closes.
2026-09-24 10:01:54 +10:00
sam 1b5ba30113 feat(archied): recovery commands on PostgreSQL; fail-closed pre-update snapshot, no automatic schema rollback
Without -db, backup/restore/validate/rollback resolve database_url from the
config and work on the whole PostgreSQL database. Restore claims every service
role; rollback claims the State Store role; validate refuses a schema newer
than the binary. The installer refuses a daemon update it cannot snapshot
first; the watchdog never restores the database and prints the explicit
offline restore instead.
2026-09-24 09:50:10 +10:00
sam 5687d1b04e feat(webui): serve change statuses and the config schema through /api/task-meta
Closes #865. The dashboard hand-copied the Change* file-status ids and events.ConfigCapturedSchema. /api/task-meta now serves both; the Vue dashboard renders ui/src/lib/task-meta-snapshot.ts until the served catalog lands. The Go handler is pinned to internal/webui/testdata/task_meta.json and the snapshot is pinned to that same fixture, so a one-sided rename fails a test.
2026-09-24 09:31:09 +10:00
sam c620e00396 feat(postgres): pool that refuses servers before PG 18, goose migrations under an advisory lock, testcontainers harness
internal/infrastructure/postgres opens a pgx pool, checks server_version_num >= 180000, and applies goose migrations with a Postgres session advisory lock so processes starting together apply each migration once. internal/infrastructure/postgres/pgtest starts postgres:18 through testcontainers per test binary and gives each test its own database. Adds jackc/pgx/v5 v5.11.0, pressly/goose/v3 v3.28.0 and testcontainers-go v0.44.0. The database URL config, sqlc, the Compose service and the ownership lock move to archie-core-7r0x.2, where they have consumers.
2026-09-24 01:03:08 +10:00
sam 01586f1630 docs(prds): orgs, workspaces and access control
Approved design for orgs and workspaces, people and agents as identities, the Cedar policy chain (instance with network rules, org, workspace, identity and workflow, object), server-derived credential scope, and one run credential per agent run. Secrets move from agent profiles to identities; event-automation.md is marked superseded where it said otherwise.
2026-09-24 00:34:14 +10:00
sam d03e7fdef4 docs: regenerate dev-docs.json for the event automation PRD 2026-09-24 00:30:22 +10:00
sam 86690ef73e fix(bindings): a new binding is created pending approval
Nothing moved a binding out of draft except an unrelated edit, so a newly created binding could not be approved and the dashboard showed no Approve button. Draft is removed; existing draft rows are promoted to pending_approval when the EDA store opens.
2026-09-23 23:13:49 +10:00
sam 891970f1ad feat(eda): playbook.Load findings name the offending action, when or args line 2026-09-23 22:42:14 +10:00
sam fda2c51f6d feat(playbooks): archie-playbooks serve, a language server publishing lint findings as diagnostics 2026-09-23 22:22:56 +10:00
sam 61dd33edce feat(playbooks): lint an EDA playbook directory with -eda-dir 2026-09-23 22:11:01 +10:00
sam 534153d50a feat(eda): reject an args value whose checked CEL type cannot fill its Args field 2026-09-23 22:05:50 +10:00
sam 2bc4b8db32 feat(eda): run action playbooks at pin time through the at-most-once dispatch ledger 2026-09-23 22:00:52 +10:00
sam 6046948ff0 docs(eda): playbook dispatch rows are retained until an explicit delete 2026-09-23 21:52:10 +10:00
sam 4237b560b0 fix(eda): type-aware actions classifier, one stable-identifier grammar, loader tests that fail for the named reason 2026-09-23 21:48:52 +10:00
sam 3a4af23caa feat(workflow): routing and playbook findings carry the key's file:line 2026-09-23 21:41:56 +10:00
sam 288e9ea370 fix(webui): move the live stream to /api/stream so reloading /events serves the page 2026-09-23 21:16:29 +10:00
sam a65eae2458 docs(agents): a bead never carries production instance detail
Beads sync to a Dolt remote, so anything written into one is published.
Two beads filed earlier today named an operator host, its internal
address and its filesystem paths -- the tracker was treated as a private
store, which it is not.

The rule is stated where the tracker is described, next to the existing
one about .beads/ never reaching a commit, because it is the same class:
the tracker is not a private store. Host-specific facts belong in the
operator's memos instance, which a bead may point at.
2026-09-23 12:29:29 +10:00
sam 2393ec6dae docs(prds): approve the master-detail run page PRD
The maintainer approved task-run-master-detail.md after the
adversarial-review round; its status moves Draft -> Approved while the
work it describes is completed and verified.
2026-09-23 11:36:16 +10:00
sam 00cfd6bda0 fix(webui): reset the stage filter on an attempt switch
A stage filter is a command scoped to the attempt it was made on: the
rail set it against that attempt's stage list. selectAttempt and
performRetry left filters untouched, so a stage selected on attempt 2
carried into attempt 1 -- a same-named stage there rendered as selected
without ever being commanded, or the log stayed narrowed to a stage the
new attempt does not have. The stage filter now resets when the selected
attempt changes; the level filter is attempt-agnostic and survives.

The master-detail PRD absorbs the adversarial review's verified findings:
the reload claim is narrowed to the URL contract (filters are not in the
URL), the unimplemented scroll and pinned claims are dropped, the
unnamed-stage and level-filter contracts are stated, the rail inventory
is corrected, and the acceptance list gains criteria for the
command-not-binding rule, attempt-switch reset, and keyboard selection.
2026-09-23 11:31:58 +10:00
sam fd3f661a73 feat(webui): split the task run page into a master-detail pane
The five tabs gave the stage rail less than a third of the screen and
disconnected the log stream from the stage that produced it. The stage
rail is now the page's master pane, always visible; the four context
panels are the inspector and own the tab bar. Selecting a stage commands
the inspector to the log tab with that stage's filter set; clicking the
selected stage clears it. Selection is a command, not a binding -- the
operator can change the filter afterwards.

No endpoint, RPC or contract changed. tab=stages still resolves, to the
log tab; every inspector tab and attempt deep-link survives a reload.
Below the shell's 900px frame breakpoint the rail stacks above the
inspector. Design of record: docs/prds/task-run-master-detail.md (Draft,
per-run panel contracts unchanged from task-run-detail.md).
2026-09-23 11:20:45 +10:00
sam 4fe53f1028 merge(sams-cleanup): the PocketBase event-capture migration and its follow-ups
Moves event capture, mappings and bindings onto PocketBase-owned collections
in internal/infrastructure/edastore, and adds the read-only stateadmin
surface over the task database. Follow-ups included:

- the event feed cursor becomes a total order over a fixed-width timestamp
  with an opaque string cursor, so it no longer depends on rowid
  monotonicity;
- cron schedules get next-run arithmetic, so a cron job fires instead of
  returning ErrScheduleUnsupported;
- binding and mapping edits announce on the activity stream, so a dashboard
  edit is visible without a manual refresh;
- an unresolvable task identity fails closed rather than falling back to the
  root forge's credential;
- tool_call events project into the tool_calls collection, which had a
  schema and no writer.

Also: the branch is brought back to a passing task check, which it had not
been for the whole migration -- two pre-existing failures, an unrecorded
int64-to-string proto break and a stale generated docs artifact.
2026-09-23 03:33:49 +10:00