Commit Graph
17 Commits
Author SHA1 Message Date
sam e76f7d5ff0 chore(build): bump Docker builder images from golang:1.26 to golang:1.27-trixie
go.mod is already on 1.27.0 (supersedes the 1.26.6 stdlib CVE fix set);
the Dockerfiles were still pinned to the older 1.26-trixie floating tag.
2026-08-31 21:25:50 +10:00
sam 972fb5b8e1 feat(deployment): default to managed NATS workers
Autonomous workflows now always hand a complete task to a scoped archie-agent container. Embedded NATS is the default and external NATS changes only broker placement; legacy agent and containers.enabled inputs decode for migration but cannot select an execution path. The daemon flushes task-event subscriptions before a worker can publish, and runtime updates snapshot and restore the configured worker image.
2026-08-24 14:56:57 +10:00
sam ed33ab5380 feat(agent): stamp archie-agent's build and report it back to the daemon
archied's own build has carried a compiled-in gatewayVersion and an
internal/installtype stamp since archie-core-522/b5d08d0, but
archie-agent's build had neither -- its Taskfile.yml and Dockerfile
build steps passed no -ldflags at all, so even a daemon that wanted to
verify what agent build is actually in service had nothing to check
against. daemonRunningVersions said as much explicitly: the agent was
left out of every verification on purpose, because nothing self-reported
a real value.

Every archie-agent process is task-scoped and ephemeral (spawned per
task, dies after), not a long-lived process the daemon can poll on
demand the way it polls Telegram's gateway. So there's no "ask the
agent its version" request -- the only channel back is whatever a
worker includes in the taskrun.Response it already sends on every
completed task.

Stamp archie-agent's build the same way archied's is (installtype,
plus a new agentworker.Version()), have executeTaskRequest report both
in its Response, and have the daemon record the latest observation in
a new mutex-guarded AgentStatus, fed from runViaAgent on every
successful response only -- never off a request that never reached an
agent, or one describing a failed/parked task. daemonRunningVersions
now includes the agent component once (and only once) something has
actually been observed, so Report.Verify gets a real value to check
future update claims against instead of omitting the component
entirely.

Part 1/3 of archie-core-1786751948782-3-837a8fd0 point 4. Closes
archie-core-1786751948782-3-837a8fd0.1.
2026-08-23 23:18:00 +10:00
sam 9187f023c3 chore: drop residual beads tooling from build and lint config
Beads was removed as the issue tracker in 8bf0f6b, but five files still
referenced it. The Dockerfile one had real cost: every agent container
downloaded and installed bd v1.1.2 into the image for a tool the project
no longer uses.

- Dockerfile: remove the beads install stanza
- .golangci.yml: the godox comment told agents `bd create`; tracked work
  now lives in GitHub Issues
- .air.toml, .dockerignore, .gitignore: drop .beads exclusions

Old archie-core-xxx identifiers in git history do not resolve to anything;
all 416 issues were migrated by title, which is how they must be matched.
2026-08-09 18:10:11 +10:00
sam 8b21418e38 fix(build): install ripgrep where grep.go actually needs it on PATH
grepBinary() resolves rg from PATH since the embedded binaries were
dropped, but nothing installed it: not the GitHub Actions runner (CI
grep tests fell back to direct search and failed), and not the
archie-agent image (Dockerfile) that runs grep tool calls for sandboxed
tasks. Production was masked by carina's host already having ripgrep
installed system-wide for archied's own tool execution.

Dockerfile.archied is unused by the current deployment (docker-compose
builds only Dockerfile; archied runs on the host under systemd) --
corrected its stale "ripgrep is embedded" comment rather than adding
the package to an image nothing builds from.
2026-08-09 02:06:20 +10:00
sam 10775e5edf fix(docker): slim both images and repair unreachable Go tooling
archie-agent 3.92GB -> 1.43GB, archied 475MB -> 251MB.

- rm -rf /go/pkg/mod/cache cleared the wrong thing: it left the
  extracted module sources and the whole GOCACHE in the image, so that
  layer was 2.23GB to deliver 168MB of binaries.
- /go/bin was never on PATH, so golangci-lint, gofumpt, buf and dlv
  shipped as unreachable dead weight.
- Replace go install with pinned upstream release binaries. delve is
  dropped: it publishes no prebuilt binary and was the only thing
  forcing a compile step. go install it at runtime if needed.
- beads from its Go release rather than npm, and drop dolt entirely --
  bd runs Dolt embedded.
- uv manages Python; no apt Python, no deadsnakes, one version.
- debian:trixie-slim base, Node copied from node:24-trixie-slim.
- archied drops Node: the builtin tools cover what desktop-commander
  did, and archied registers MCP providers itself and hard-fails the
  process when one cannot start.

Add .dockerignore: the build context was shipping .git, docs/, bin/
and two host-built binaries into every COPY.
2026-07-31 01:13:02 +10:00
sam 15d746c2f6 style: phase 1 of lint remediation — autofix pass (qa4)
golangci-lint run --fix plus the formatters: errorlint, gocritic,
sloglint, usestdlibvars, usetesting, gci, gofumpt, goimports.
160 issues -> 130.

One autofix was wrong and had to be reverted by hand. gocritic rewrote

    ctx, cancel = context.WithTimeout(ctx, m.prefetchTimeout)

to `:=` inside an if-block in internal/memory/manager.go. That does not
compile, which is the good outcome — had it compiled, the shadowed ctx
would have scoped the timeout to the if-block and the prefetch deadline
would silently never have applied. Restored the assignment and commented
why it must not be a declaration.

Worth recording: --fix is not a safe no-op. It broke the build on a
24-file change, and the failure mode it was one compiler error away from
was a silent behaviour change.
2026-07-28 01:37:20 +10:00
sam ec8534dfe2 feat(gateway): ship model controls, shell tools, and release tracking 2026-07-27 06:16:39 +10:00
sam 920c56a14b fix: create branch on reuse if not found, add dolt+beads to Dockerfile 2026-07-24 11:31:27 +10:00
sam 4be28e0e48 feat: optional NATS token authentication (archie-core-l1q)
Add token_env to [nats] config, resolved and validated at daemon startup
(fails early if configured but the named env var is unset). Container
workers get NATS_URL/NATS_TOKEN; archie-agent honors both while CLI-supplied
URL still takes precedence. Anonymous auth remains the default for
single-node deployments.

Unblocks archie-core-5zh (promote archie-agent to per-task process).
2026-07-24 07:51:06 +10:00
sam 6850556790 fix: install common Go tools for development 2026-07-23 00:21:24 +10:00
sam 9fdc2a6138 fix: revert golangci-lint to go install (tarball path broken) 2026-07-22 21:18:21 +10:00
sam 3490bd4124 fix: use pre-built golangci-lint binary, fix NATS healthcheck 2026-07-22 10:56:06 +10:00
sam 5bc6b2791d docs: note Python 3.14.6 as latest 2026-07-22 09:44:58 +10:00
sam a9b91cb551 fix: update Dockerfile Python versions to 3.14/3.13 2026-07-22 09:43:56 +10:00
sam 4c56062678 fix: add stylelint and htmlhint to Dockerfile 2026-07-22 09:37:16 +10:00
sam de57f72cce feat: add Docker container sandbox for archie-agent
Dockerfile: multi-stage fat image (golang:1.26 builder → ubuntu:24.04)
with Go 1.26, Python 3.12/3.13 via deadsnakes, UV, Node 22, pnpm,
TypeScript, esbuild, git, gh, golangci-lint, gofumpt.

Container pool (internal/container): manages Docker container lifecycle
via moby/moby client. Per-task containers with bind-mounted workspaces.

- Acquire: create, start, mount workspace, inject NATS + API key env
- Release: stop, remove (AutoRemove as safety net)
- Orphan recovery on daemon startup (label: archie-daemon=true)
- MaxConcurrency enforcement, MaxUptime config (unused in MVP)
- Image pull with "missing"/"always" policy

Config: [containers] block (enabled, image, max_concurrency, max_uptime,
pull_policy). Validation: requires agent.mode = "nats" and [nats] url.

Daemon: acquires container before workflow.Run, releases after.
Container environment auto-populated from provider API keys.
2026-07-22 02:39:17 +10:00