Commit Graph
122 Commits
Author SHA1 Message Date
sam e3130d53e7 Merge branch 'worktree-agent-a82ec64b6cc1a2809'
# Conflicts:
#	internal/app/archie/operations.go
#	modules/events/events.go
#	modules/governance/accounts_api.go
#	modules/governance/governance.go
2026-11-22 02:16:56 +11:00
sam 098d8cc328 feat(runs): authorize runs, deliveries and intake as the workload principal (#2078)
Trigger dispatch, run start, every run claim, every delivery attempt and
webhook intake now ask the policy chain. Background work acts as the
workload principal; a refusal is final and recorded on the run or the
delivery, and an undecidable chain leaves the work queued for another
attempt. Intake applies the per-source delivery policy after source
verification.
2026-11-22 02:15:05 +11:00
sam 6c59d6b742 feat(httpapi): refuse every API operation that does not declare its access (#2078)
Operations register through httpapi.Register with Public, Authorized or
AdminAuthorized, and the guard asks the policy chain for the declared
action and resource kind before the handler runs. An undeclared operation
and an undecidable chain are refused. The workload principal, its shipped
policy, a self-service policy and Recording for denials are added in
governance.
2026-11-22 02:15:02 +11:00
sam 1a0c697858 Merge branch 'worktree-agent-a124e124e24c6a56b' 2026-11-22 02:13:32 +11:00
sam 65a8b7cd47 Merge branch 'worktree-agent-a559cecce669715a6' 2026-11-22 02:13:32 +11:00
sam e127b2b05d feat(approvals): gate answers by role and link channel accounts through single-use codes, replacing the people model (#2095) 2026-11-22 02:13:08 +11:00
sam 02227a0b22 feat(connectors): let a connector declare it links accounts and return the link URL for a code (#2095) 2026-11-22 02:13:08 +11:00
sam 9c0ea938b8 fix(chat): canonicalise a held action's stored input before comparing it (#2072, #2096)
The binding is read back from a jsonb column with a space after every colon,
so an unchanged approved action failed the byte comparison and never ran.
2026-11-22 02:09:32 +11:00
sam 763cd0e581 feat(governance): delete a model or alias from /settings/models (#2090) 2026-11-22 02:03:24 +11:00
sam 48d0212784 style: fix gofmt alignment for maxBackoff 2026-11-21 23:18:43 +11:00
sam 4b494bf75b feat(approvals): add a People page, leave channel approvals unchanged, make a binding's target optional (#2072) 2026-11-21 21:37:42 +11:00
sam b9a60e03a3 feat(chat): bind held-action approvals to the whole action and require fresh passkey confirmation for irreversible ones (#2072) 2026-11-21 21:35:27 +11:00
sam bc72655c8e feat(judgement): refuse privileged and undeclared actions in chat (#2071)
Connector actions and lookups now declare privilege change and secret access,
and an MCP server declares both per installation. Chat withholds and refuses
any tool that has either effect or declared nothing, in judgement and at
execution, so an approval cannot convert the refusal. Workflows and the
dashboard are unchanged.
2026-11-21 21:28:06 +11:00
sam 592d36e0d1 feat(connectors): re-check saved workflows on capability change; validate core delivery schemas (#2091, #2092)
When a connector loads with new declarations, the saved workflows that
reference it are re-checked against them (via a Recheck hook wired to
runs.Engine.RecheckConnector); if any would become invalid, the new
declarations are refused and the connector fails to start, so the breakage
surfaces at update time instead of mid-run. The previous declarations stay
in force.

A connector that declares the message or chat_message delivery now has its
declared input schema checked against every payload shape core sends on it
when it loads; a rejecting schema fails the connector. The delivery names
are exported from the connectors module and used by core's senders, so the
contract has one definition.
2026-11-21 18:34:47 +11:00
sam d318f912a8 fix(runs): cancel a run from the API and the dashboard (#2088)
POST /api/runs/{id}/cancel now reaches Engine.Cancel, which cancels the
run and the runs it started with workflow.call, and returns the run.
Cancelling a run that has already ended is refused with a 409, and a run
from another organisation is not found. The run page shows a Cancel
action for a run that has not ended.
2026-11-21 18:21:31 +11:00
sam 31b2827048 fix(connectors): read a connector's capabilities before it has ever loaded (#2087) 2026-11-21 17:32:20 +11:00
sam 14060675cd feat(connectors): check workflow and trigger references against declared capabilities (#2087) 2026-11-21 17:14:00 +11:00
sam 74928925c8 Merge commit '35e2a216a' 2026-11-21 15:20:36 +11:00
sam 35e2a216ab fix(runs): refuse a message.send step whose channel can't send to a chat (#2085) 2026-11-21 15:18:16 +11:00
sam b6907d8366 fix(runs): cancel the runs a cancelled run called (#2086) 2026-11-21 15:17:13 +11:00
sam 4b5c60330d docs(runs): plain the call wait comment (#2044) 2026-11-21 15:00:21 +11:00
sam 69b5b2aba6 Merge branch 'worktree-agent-aa1d52313cfc167e1' 2026-11-21 15:00:11 +11:00
sam d6f3a1a01d docs(connectors): describe the extension kinds table accurately (#2084) 2026-11-21 15:00:01 +11:00
sam ca279a200a Merge branch 'worktree-agent-a773715d74288076a' 2026-11-21 14:59:56 +11:00
sam 5d8c9303e0 feat(runs): workflow.call, workflow.handoff, workflow.approve and message.send (#2044) 2026-11-21 14:59:49 +11:00
sam 23f23a6cab fix(connectors): refuse to store a contract that has no group (#2084) 2026-11-21 14:59:48 +11:00
sam 64ef2c9af7 feat(connectors): group extensions as platform, integration or agent (#2084) 2026-11-21 14:58:53 +11:00
sam 1989948ab3 fix(runs): encode agent prompts and action input with sorted keys (#2083) 2026-11-21 14:53:36 +11:00
sam 7b6154e7e8 docs(runs): plain the comments on run endings (#2042) 2026-11-21 13:55:46 +11:00
sam 3513dad609 Merge branch 'worktree-agent-a3fd604fba0fb36cc' 2026-11-21 13:55:00 +11:00
sam fb5f3ad472 refactor(runs): run the document's steps in their own function (#2042) 2026-11-21 13:54:34 +11:00
sam a88f5630fe feat(runs): the first step that sets an outcome ends the run (#2042)
Add workflow.finish (completed, parked, waiting_approval, declined). A failed
step parks the run unless it continues on failure, and a parked run retries
from a top-level step, replaying the earlier steps' recorded results. Adds the
retry-run operation and a Retry button on the run page.
2026-11-21 13:52:52 +11:00
sam f47e60db00 refactor(events,deliveries): split source saving and plain the new prose (#2021, #2016) 2026-11-21 13:52:33 +11:00
sam 29a06f7c54 Merge branch 'worktree-agent-a2d0eb6dd8a9d5b66' 2026-11-21 13:47:46 +11:00
sam 30b4c28e06 fix(events): a source save keeps its stored verification (#2021)
A PUT that names no verification keeps the stored scheme, token hash and
sealed secret, and an hmac save with a blank secret keeps the sealed one.
The sources page gains an Edit action that reuses the add dialog.
2026-11-21 13:47:37 +11:00
sam 01eb4aaf7c fix(events): verify webhook signatures before parsing (#2021)
A source now declares how its deliveries prove themselves: token (the
default, unchanged), hmac (HMAC-SHA256 over the raw body, per-source header
and prefix, secret sealed at rest and write-only) or none. The events module
verifies before the connector parses, answers 401 and logs the refusal.

The digest comparison is ported from internal/webhookguard/hmac.go and the
header-borne signature from internal/infrastructure/captureintake/receiver.go;
the old copies stay until their service goes. The seal package moves to
internal/platform/seal so events can seal the secret.
2026-11-21 13:46:48 +11:00
sam b48616798d fix(deliveries): stop retrying a delivery the channel rejects for good (#2016) 2026-11-21 13:45:31 +11:00
sam 073959b4f9 feat(memory): scope chat notes and preserve deletions on restore (#2069)
Keep personal notes private by default and require review before publishing shared notes. Restore backups and replay forgotten notes in one transaction, and retain the installed release when an unattended rollback could bring back forgotten notes.
2026-11-21 13:20:31 +11:00
sam 81bca2251e fix(app): retry startup and atomically seed policies (#2081) 2026-11-21 11:45:18 +11:00
sam ee66e4f0f3 refactor(prompts): the last three instructions written in Go are files (#2051)
AGENTS.md sends every instruction to a file in internal/prompts, and the
workspace scoping rule, the PR-review adversary mission and the model probe
were the three that still read as Go string literals. The text is unchanged:
the templates render the same bytes the concatenations built.
2026-11-21 03:48:42 +11:00
sam ae3bbc6cfe fix(app): serve only setup until the owner setup transaction commits
The binary started connectors, module routes, the starter workflow and the
worker loops at boot whatever the database said, so an instance with no owner
answered operational requests, the bootstrap admin token among them. The
governance module now signals once the bootstrap registration has committed,
and the composition root holds every operational route, connector and loop back
until it does. Liveness stays up and readiness reports the missing owner.
2026-11-21 03:40:02 +11:00
sam 98c0c11cbb feat(chat): track session taint and hold mutations in tainted conversations (#2068)
A conversation gets a persisted tainted flag (migration 00040), set the
first time output from a tool whose declaration trust level is not
"trusted" enters the turn, before that output reaches the model. The
flag is only ever set, never cleared, so later turns and resumed
processes inherit it. In a tainted conversation every non-read-only
action is raised to a floor of propose_and_wait, so the existing hold
path renders the approval card with the exact judged action; read-only
lookups still run, and a hard-rule refusal stays a refusal. An
unreadable taint state or a failed taint write fails closed. Trust
levels live on connectors.Declaration; unknown levels are untrusted.
2026-11-21 03:15:04 +11:00
sam 9af3b29342 fix(dashboard): drop remote images from chat Markdown and add an image-only CSP (#2073)
SAFE_SRC in ui/src/chat/markdown.ts now keeps only same-origin
root-relative paths and data:image/ URLs, rejecting http(s),
protocol-relative and backslash-after-slash forms that the browser
would read as a remote host. The shared parser also covers task
approvals, plans and run transcripts. modules/dashboard sets
Content-Security-Policy: img-src 'self' data: on every non-API
response (page, assets, errors, no-build fallback) as the browser
backstop; the /api/ JSON fallback is unchanged. No proxy, no
migration: stored replies re-render from their text.
2026-11-21 02:52:11 +11:00
sam 96fb0afcd9 feat(chat): offer the model only the tools its person may use (#2067)
Discovery now applies the same per-tool policy decision as invocation: a connector lookup needs read, an action needs run, and each builtin carries the action and resource kind it checks. The model's tool schemas and the system prompt's summaries come from that one filtered set. A name that two declarations, or a declaration and a builtin, both claim is withheld from all of them.

The stream client fixes the wire tools for the whole turn, so a guarded provider re-reads the owner's access and the running declarations before every model request. If an offered tool is no longer permitted or declared, the turn stops before the request instead of describing a stale set. A call to a declaration the registry no longer holds is refused before anything runs, naming nothing.

Memory notes are left out of the prompt when the person may not read settings, so the tool filter is not bypassed by prompt context.
2026-11-21 01:45:03 +11:00
sam 90637aa457 fix(runs): settle held actions a skipped or failed approval would leave
The end-of-run decision read the document's last approval step alone, so a conditional approval that was skipped, or one that continued past a failure, let a run finish without ever putting its held actions to people. Those approvals no longer count as settling. Resume still replays the agent and the request exactly once.

Triggers and dry runs now refuse a document that names an identity or profile, dry runs check required inputs, and step ids cannot contain dots that references read as separators.

The shipped investigate document gains a test that holds an action, suspends, resumes through the journal and reports one approved action.

Refs #2039
2026-11-21 01:20:21 +11:00
sam 064eeab748 feat(governance): let owners rename the organisation and workspaces
Adds the organisation routes the single binary's dashboard needs (list, get, workspace list and create) plus owner-only renames of the organisation and its workspaces. A rename is guarded by the version the caller read, writes only the display label, and appends an actor-attributed event in governance.org_events in the same transaction. The Organisation page shows those name changes, and a deep link is no longer replaced by the landing page while the router is still resolving it.

Refs #2077
2026-11-20 21:10:34 +11:00
samandCopilot cf6108ad14 feat(chat): conversations belong to their person and act with their access (#2065)
Sessions carry an owner; every chat route serves only the caller's own
conversations (others are 404). Each turn and each approved held action
acts as its owner's principal, checked against the access rules before
judgement, so an operator's chat can't do what the operator can't. Chat is
open to any signed-in person, and the stream sends chat updates only to
the owner.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-20 19:05:20 +11:00
samandCopilot 731417ab48 feat(ui/chat): run the Vue chat on the archie binary (#2023)
Sessions, turns, streamed replies, thinking and tool cards, held-action
approvals and resume now use modules/chat; /api/stream forwards the chat
topic. Sub-features the binary can't back yet stay hidden.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-20 01:45:35 +11:00
samandCopilot 264062866c feat(ui): run events, workflows, runs, controls and settings pages on the archie binary (#2023)
Events (sources, triggers), workflows (list, document, YAML publish,
read-only canvas), runs with approvals and the decision trail, controls
(policies, guards, action classes), agent models, accepted extensions,
secret engines and credentials now read the binary's API. Capabilities
name every section, so pages the binary can't back yet (the visual
workflow editor, captures, mappings, bindings, the extension catalogue,
model aliases and the rest) stay in the tree, hidden. Adds
GET /api/credential-kinds for the credentials form.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-20 01:04:29 +11:00
samandCopilot 59b0ac03c9 feat(dashboard): serve the live stream the Vue dashboard connects to
Same frames as internal/webui/sse.go with a keepalive; signed-in only.
Topics are added as each page moves onto the binary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-20 00:34:46 +11:00