Commit Graph
171 Commits
Author SHA1 Message Date
sam a6eb136f66 feat(instructions): layer instance, organisation, workflow and repository instructions into every agent stage 2026-10-17 23:42:39 +11:00
sam 96aaeec06b refactor(archied): discover issues through organisation connections 2026-10-17 13:38:46 +11:00
sam 24ded57b4e feat(daemon): execute and verify organisation repository connections 2026-10-17 09:32:39 +11:00
sam 6a6db5737a 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 cf3455ef2e 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 8ff629e74e fix(archied): report workflow definitions apply status at start and on a timer 2026-10-13 19:06:53 +11:00
sam d4cc0aa12c fix(archied): load and report EDA playbooks at start instead of at the first dispatch 2026-10-13 17:22:01 +11:00
sam 358b964ba7 feat(webui): finish redesign dashboard task and secret settings 2026-10-13 16:41:35 +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 7d72ba4fb3 Merge branch 'work/mqti13'
# Conflicts:
#	internal/contracts/state/v1/state.pb.go
2026-10-11 04:03:52 +11:00
sam 3af20a3320 feat(archied): post a chat task's outcome back to its chat 2026-10-11 04:03:30 +11:00
sam fc0e156649 fix(daemon): bound a package workflow's tools by its accepted authority 2026-10-11 03:48:31 +11:00
sam f6da64300b feat(forgerpc): bound a package workflow's forge calls by its accepted authority 2026-10-11 03:37:16 +11:00
sam ea52c8622e 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 f4e1308b23 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 df554b3056 fix(daemon): keep model provider keys out of agent containers via the egress proxy 2026-10-10 17:12:09 +11:00
sam 645ab0ae9f feat(settings): classify startup and live runtime settings 2026-10-09 09:57:57 +11:00
sam eac34272ae feat(logging): aggregate recent service logs in dashboard 2026-10-09 09:57:57 +11:00
sam a057531bad refactor(webui): remove unused configuration schema 2026-10-09 09:57:57 +11:00
sam 9773b0a753 feat(settings): show resource consumers and apply status 2026-10-09 09:57:56 +11:00
sam bba5c9d7de 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 01b691142c 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 34bc6865e5 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 aef764d775 feat(daemon): withdrawing an issue declines its queued or running work 2026-10-05 20:50:57 +11:00
sam c1fd42f575 refactor(archied): drop the unreachable multi-identity webhook skip; validation refuses it 2026-10-05 20:32:43 +11:00
sam efa1e5cf85 feat(messaging): serve MessagingService.Deliver and deliver chat schedules through it 2026-10-05 18:01:33 +11:00
sam 0a12d4db40 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 78e4427f0d feat(staterpc): one run credential per task, kept in the State Store, authorizes its store calls and its push 2026-10-04 18:32:45 +11:00
sam 7aec66b2d3 feat(contracts)!: requests no longer name their org; the State Store derives it from the caller 2026-10-04 17:28:31 +11:00
sam cf13c097c7 refactor(forge): github and gitea leave core; webhooks parse in the forge extension 2026-10-04 14:26:27 +11:00
sam 939c0d2058 feat(forgeext): forge surface served by extensions; forge.type names the installed package 2026-10-04 13:56:32 +11:00
sam f0b34892da feat(controlplane): playbooks and agent profiles install from packages; the daemon reads eda-playbooks live 2026-10-04 13:49:03 +11:00
sam 5d03513633 feat(staterpc): attribute State Store calls to the calling service; policy audit records it 2026-10-04 13:48:37 +11:00
sam b2997764c0 feat(access): instance network rules at the capture receiver; policies reload without a restart 2026-10-04 12:58:00 +11:00
sam 91f79f7b3b refactor(module): the log action is built in; delete the module loader and reconciler
module_dir, logextract and examples/modules go with the Yaegi loader. The plugin
reconciler had only the module directory left to watch, so it goes too.
2026-10-04 03:06:20 +11:00
sam 2de1545e62 refactor(plugin): delete Yaegi daemon plugins and plugin_dir
Nothing consumed plugin.Plugin. The daemon's capability host held only those
plugins, so it goes too. The lint fix to the extensions access test rides along.
2026-10-04 03:04:35 +11:00
sam 7c6271b128 style: adopt task fmt output; regenerate contracts and sqlc code; gateway cleanup derives its context
goimports during the service refactors rewrote generated files; they are
restored from their generators.
2026-10-04 01:48:32 +10:00
sam 59166eda3a refactor(agentrun): agent stage contract moves to the domain layer
internal/domain/workflow imported internal/agentexec for its protocol types,
pulling the AI runtime into every binary that touches workflow types. The
request, result and runner contract now live in internal/domain/agentrun;
agentexec keeps the runtime. The model catalog cache moves from servicekit
into modelcatalog and WaitForPeer into staterpc, so archie-state-store and
archie-messaging no longer link the AI runtime.
2026-10-04 01:33:00 +10:00
sam 11dd7b6306 fix(services): services wait for peers instead of exiting; restarted broker keeps its endpoint
State Store calls from the daemon, Gateway and Messaging wait for the store to
come up, so start order no longer matters; the daemon's state_db probe carries
its own deadline so an outage reports degraded instead of hanging. The
Gateway retries its first NATS connect. A restarted daemon reuses the embedded
broker's previous port and token, so the Gateway reconnects instead of
holding a dead address. Fixes a nil catalog the catalog move introduced.
2026-10-04 01:15:11 +10:00
sam fa58050281 refactor(archiegateway): own package for the Gateway service
archie-gateway no longer links the daemon, the web UI or archied. Shared
runtime layering, watches, catalog, NATS discovery and the State Store client
live in servicekit; chat task profiles in chattask. The Gateway waits for the
daemon's NATS endpoint instead of starting a second broker, and chat
approvals go through the task-action client instead of a local service with
no daemon behind it. Version stamping uses buildinfo only.
2026-10-04 00:59:02 +10:00
sam 2819b2b259 refactor(archied): gateway owns model work; daemon drops chat runtime, tools, memory and curators
The gateway now applies provider, model-role and tool settings live and
runs the curators, which wake on its turns and read its conversations.
2026-10-04 00:48:28 +10:00
sam 1400f204ae refactor(statestore): own package for the State Store service; access reset moves to archie-state-store 2026-10-04 00:46:11 +10:00
sam 077dd2ad98 docs(archied): drop secret engines from the plugin reconciler comment 2026-10-04 00:43:59 +10:00
sam dc181b7874 feat(secretengine): serve secret engines as go-plugin extensions
A secret engine is now a subprocess serving secretengine.v1, installed through
the package store's new extensions family and enabled by extension-settings.
bws leaves the binary, as do the Yaegi engine loader and its examples.
2026-10-04 00:40:23 +10:00
sam 1044129e28 fix(archied): restore contextcheck directives and drop unused adapter 2026-10-03 21:55:48 +10:00
sam 3c338a9722 refactor: strip doc and issue narration from code comments
Remove PRD/doc paths, bead IDs, phase notes and deleted-test references
from comments; drop test-only hooks left by the test deletion. Includes
in-progress archied bootstrap, gateway and query changes.
2026-10-03 21:47:46 +10:00
sam 51f9f087cf fix(webhook): set a ReadHeaderTimeout on the forge webhook receivers
Both listen on the network without a header-read bound, the slowloris surface. Matches the timeout the other daemon servers already carry.
2026-10-02 22:45:02 +10:00
sam 1e7df797b3 fix(daemon): drop the import and assignment left by the composition cleanup
l45's refactor removed the assigned-but-unread daemon handles and l44 had
already moved the guardrail wiring out of the daemon, so the rebase union
left internal/daemon/daemon.go importing internal/tools with no use and
internal/app/archied/bootstrap.go assigning a Guardrails field that no
longer exists. main did not build.

Caught by building the merged tree rather than trusting the merge; the
merge train merged on a failed gate instead of chaining on it, which is
the mistake this commit repairs.
2026-10-02 13:00:56 +10:00
sam 92ea5dee56 refactor(daemon): drop assigned-but-unread composition handles
Three exported Daemon fields were wired by the composition root and read
nowhere: CapabilityHost (*plugin.Host), Curators (*curator.Registry) and
ToolRegistry (*tools.Registry). No field access exists anywhere in the
repo, and git history shows no read ever existed.

Each handle has a live owner outside the daemon: the curator
registry/runtime is boot-owned (the curator isolation invariant keeps it
off the agent loop), the capability host is lifecycle-owned by the
composition root and consumed by the control plane, and the tool registry
is consumed by chat, curator and MCP wiring. Keeping the daemon copies was
decorative wiring, so the fields, their composition assignments and the
now-unused plugin/curator imports go together.

The daemon architecture test now refuses the three names, and the plugin
host contract test refuses a CapabilityHost: handle on the daemon alongside
the PluginRegistry: one it already refused.
2026-10-02 12:57:53 +10:00
sam f6037e0d76 fix(agentworker): supply the guardrail engine to every task run
TaskContext.Guardrails was never assigned: the engine was built in
archied's composition root and held on Daemon.Guardrails, which no code
read after workflow execution moved to the full-task worker handoff.
archie-agent is a separate process, so a live engine cannot cross that
handoff. Build the engine at the agentworker composition root (the
process that runs agent stages), thread it through the task dependencies,
and set it on TaskContext; drop the now-dead archied-side construction.

Refs: archie-core-jd5v
2026-10-02 12:37:35 +10:00