Commit Graph
2877 Commits
Author SHA1 Message Date
sam dd41d7a0cd chore(lint): pin the linter to 2.14.0
The setup task is the only installer, so the pin follows the version in
use rather than holding it back, and CI follows the pin.
2026-10-09 12:32:05 +11:00
sam be3efd4fc4 fix(egress): use context-aware dial and request in the token-endpoint test
net.Dial and httptest.NewRequest fail the noctx linter, so the gate was red
on the commit that added the test.
2026-10-09 12:27:45 +11:00
sam f28c0a8dee chore(task): install the pinned tooling with task setup
task setup installs the golangci-lint CI pins, the protobuf generators and
the dashboard dependencies, and warns by name about the tools it cannot
install (Go, Task, Node, Docker).

The linter version now lives in one file read by both the setup task and
both workflows, so a local checkout and the gate cannot run different
linters.
2026-10-09 12:27:45 +11:00
sam 045fc5fc31 test(archieui): restore the archie-ui import-boundary check
Only the daemon owns containers, and the dashboard consumes a harness
session over its gRPC contract. Go imports are atomic, so a single
reference relinks a runtime, and the boundary holds only while something
re-measures it. cmd/archie-ui/architecture_test.go enforced this until it
was purged with the test suite; nothing enforced it since.

The restored check runs go list -deps . and fails if the dashboard links
internal/container, internal/app/archied or internal/agentexec. It is
transitive, which is what "links" means, and runs in the existing test
step.
2026-10-09 11:42:39 +11:00
sam f5cf74df45 fix(egress): refuse a token endpoint the run is not granted
forward intercepted a declared OAuth credential's token endpoint only when
the run was granted the service. For an optional credential it fell
through to the reverse proxy, so the provider's real access and refresh
tokens reached the container un-sentinelized, contradicting the harness
contract's "the real credential never enters the container".

A matched token endpoint is now refused when the service is not granted
(403 for an optional credential; a required one keeps its existing 502).
The table test drives forward against a recording upstream and asserts
both the status and that the upstream was never contacted.
2026-10-09 11:42:39 +11:00
sam 7438c3211c fix(deps): pin sandbox-kit-spec to the API the code is written against
The dependency bump moved sandbox-kit-spec from v3.0.0-m.6 to m.8 without
adapting the code, so the tree no longer builds: CredentialCapability.Phase
is now spec.Phases, not a string (internal/infrastructure/egress), and
Client.Assemble became a package-level fetch.Assemble that takes a Loader
and a LayerValidator instead of spec.MergeOptions (internal/infrastructure/
kitrun).

Migrating to m.8 is not a version-string change: m.8 pushes kit integrity,
safe layer extraction and resource limits onto the caller, so it is
security-relevant work, not an unblock. Pin back to m.6, which the code is
written against, and leave the migration to a deliberate change.

Verified: go build ./..., go vet ./..., go test -short ./... all pass with
this pin. The gate's ui:check and lint steps fail for unrelated
toolchain reasons recorded separately.
2026-10-09 11:42:33 +11:00
sam 9fcf9fa6f3 ```
chore: update ui dependencies
```
2026-10-09 11:27:48 +11:00
sam 5991fc3ea2 chore: bump Go dependencies and toolchain 2026-10-09 11:23:04 +11:00
sam e2edc1bd5c fix(config): normalize default org for harness credentials 2026-10-09 10:01:35 +11:00
sam ae416320f1 feat(settings): classify startup and live runtime settings 2026-10-09 09:57:57 +11:00
sam 45e908374b feat(logging): aggregate recent service logs in dashboard 2026-10-09 09:57:57 +11:00
sam 32f69a60fc fix(gateway): attribute chat settings to signed-in users 2026-10-09 09:57:57 +11:00
sam b03a610535 fix(webui): explain personal token availability 2026-10-09 09:57:57 +11:00
sam 84d1286211 refactor(webui): remove unused configuration schema 2026-10-09 09:57:57 +11:00
sam 018f549055 fix(settings): show configuration reload failures 2026-10-09 09:57:57 +11:00
sam dd203997a8 fix(gateway): read task logs through state store 2026-10-09 09:57:57 +11:00
sam 756a76a7bb fix(ui): render unknown routes and correct status description 2026-10-09 09:57:56 +11:00
sam 8b1fafd1d6 fix(configuration): reject unknown conf.d files 2026-10-09 09:57:56 +11:00
sam 88760b8d5a feat(curators): edit and apply definitions live 2026-10-09 09:57:56 +11:00
sam a8e91b3ba2 feat(settings): edit profiles bindings and playbooks 2026-10-09 09:57:56 +11:00
sam 6f612befb7 feat(settings): show resource consumers and apply status 2026-10-09 09:57:56 +11:00
sam 8513d7ff9d feat(presence): report workers and broker on status 2026-10-09 09:57:56 +11:00
sam 6671f23673 feat(presence): expose service dependency checks 2026-10-09 09:57:56 +11:00
sam 422b2f413e fix(daemon): inherit live settings for identity tasks 2026-10-09 09:57:56 +11:00
sam 143ac94c40 test: verify enablement reports channel running 2026-10-09 02:24:47 +11:00
sam 741dbb1c7e fix(workflow): enforce optional result booleans only when required 2026-10-09 02:22:19 +11:00
sam 0248cc35f8 fix(messaging): refuse failed channels as enablement success 2026-10-09 02:22:19 +11:00
sam b24d336f81 fix(workflow): retry a transient read while awaiting a callee 2026-10-09 02:21:49 +11:00
sam 502899cef6 fix(workflow): preserve a reference's type between steps 2026-10-09 02:10:43 +11:00
sam d201257382 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 1adbc6a5f9 fix(container): reap orphaned processes in Kit containers 2026-10-09 01:37:57 +11:00
sam 78df7bd454 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 64a8c56aee fix(modelcatalog): never serve a disabled provider from the ambient key
disableProvider already cleared a failed provider's credential, but that
made it indistinguishable from a provider nobody configured, so
usableProvider fell back to the catalog's ambient env var (e.g.
OPENAI_API_KEY) and sent turns with a key the operator did not choose.
Mark the provider Disabled when its key fails to resolve, refuse it in
usableProvider, and carry the flag through mergeProviders so a catalog
refresh cannot resurrect it.
2026-10-08 22:59:23 +11:00
sam f968f0518f fix(webui): keep the dashboard token out of the startup log
DashboardURL no longer takes a token, so the startup line cannot embed
?t=<token> in the printed URL. The log now names the token file instead.
2026-10-08 22:57:28 +11:00
sam 0a3ecf268b feat(scheduling): refuse a job payload that names a dangerous command
A scheduled job runs unattended, so a payload that restarts the daemon,
formats a disk or powers the machine down is refused when the job is
created rather than when it fires. scheduling.RefuseDangerousJob is the
one rule every creation path reaches: the dashboard, any control-plane
client and the config seed all replace the schedules document through the
same validator, so a new token is added in one place.
2026-10-08 22:45:28 +11:00
sam 1c887b5e39 fix(archiemessaging): apply channel enablement live 2026-10-08 22:44:15 +11:00
sam 04692fc299 refactor(tools): back generate_video with ai-sdk's minimax video provider
Delete the hand-rolled MiniMax HTTP/poll client; ai-sdk v0.1.43 already
ships provider/minimax implementing video.Provider with the same endpoints,
defaults and poll semantics. The tool now takes a video.Provider and the
composition root builds it, matching the transcription and embedding
capabilities.
2026-10-08 22:42:49 +11:00
sam e6791746ae fix(archiemessaging): recover a channel that fails on its own 2026-10-08 22:36:09 +11:00
sam 4183fa4442 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 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 bd0cd3c2ef refactor(workflow): keep the call key change inside the lint gate
golangci-lint failed on the change and had not before: gofumpt wants
StartCall's same-typed parameters grouped, and runWorkflowCall reached a
cyclomatic complexity of 16. The unwaited call's early close moves into
closeUnwaitedCall on *TaskContext -- it needs only the call step, the
callee and the settings -- which leaves runWorkflowCall below the limit
with its behaviour unchanged.

The walk's id-less call case is deleted: ParseDefinition now refuses that
definition before validateWorkflowCalls runs, so it passed for the wrong
reason. The refusal is pinned where it happens instead, by the compile
case in TestWorkflowCallKeyIsTheDeclaredPath, now asserting the whole
message so it still names the step it refused.
2026-10-08 22:31:07 +11:00
sam 592acf20de fix(workflow): key a call on its callee, and free a terminal child's key
A call's key was the step's declared path alone, so one task running a
second definition at a colliding path -- workflow.handoff, human.approve
and a definition re-pin all change it -- was handed the first callee's
child, waited on the wrong workflow and published its outputs. The key
now carries the callee too, while the step row and the call's events stay
named and staged for the call site, so a rail pairing an event with its
step still attaches them.

A child that reached dead or closed_wont_do can never do the work and
holds no result the caller can use, so it leaves the call key's index and
frees the key for the caller's retry to start a fresh child. parked and
rejected keep theirs: a parked child is recoverable by retrying it, and a
rejected child ran.

The id a call step must declare is now refused where the definition is
compiled, which is also the path a pinned definition takes, so an id that
spells a step type is accepted again and no stage needs a heuristic.
2026-10-08 22:31:07 +11:00
sam 0387e0226c fix(workflow): key a workflow.call on its declared step path
A call site had no durable identity, so any retry of it -- a lost
EnqueueCallTask reply, a failed call-step record, a requeued attempt that
re-runs the stage -- started a second child and its work happened twice.

The call step's declared path within the run is that identity: wrapStep
sets it (branch-qualified, restored on return), a workflow.call step must
declare an id so two call sites cannot share one, and the key crosses
EnqueueCallTaskRequest.call_key into tasks.call_key, which EnqueueCallTask
upserts on so the retry returns the child already started.
2026-10-08 22:31:07 +11:00
sam 3bbe7d1c72 fix(agentexec): enforce capture tool result schemas 2026-10-08 22:30:12 +11:00
sam 4188cb3199 fix(workflow): apply step retry and on_failure to command.run 2026-10-08 22:22:13 +11:00
sam d4a86cbb4e fix(ui): stop the command palette scrolling sideways 2026-10-08 21:58:22 +11:00
sam 6b59cfa3fa fix(ui): anchor the command palette and stop scroll stealing its highlight 2026-10-08 21:57:20 +11:00
sam 3d7aa337d5 fix(webhook): authorize delivery against the source's org 2026-10-08 21:43:28 +11:00
sam f94d386e29 test(postgres): derive the org fixture source from its insert 2026-10-08 21:40:24 +11:00
sam 53bd52fd8f fix(captures): keep count-retention inside the inserted capture's org 2026-10-08 21:27:54 +11:00