Commit Graph
26 Commits
Author SHA1 Message Date
sam 7826cd2fe8 refactor(examples): the firewall workflow moves to archipelago 2026-10-04 03:10:23 +11:00
sam 3eda7747cd refactor: format markdown files using prettier, fix spelling concerns, reduce Taskfile bloat 2026-09-25 01:10:28 +10:00
sam 4046766abe fix(controlplane): stored container policies replace file profiles; add profile image and workflow examples
A stored container-runtime-policies document that carries Profiles now
replaces the file's profiles instead of merging into them, so a profile
deleted in the dashboard stays deleted; one stored before profiles existed
still inherits the file's. Profiles drop their json tags so the stored
document keys them like its other fields.

Adds examples/profiles/Dockerfile.agent-net (agent image plus network
lookup tools) with a build-only agent-net compose service,
examples/workflows/firewall-investigate.yaml with a test that parses every
example against the registered step vocabulary, and names the postgres
service in the compose header.
2026-09-24 20:58:08 +10:00
sam 757b75de94 feat(postgres): wire the State Store to Postgres — DB URL, fail-closed pool, composition seam
Wave 1 of the Postgres migration (archie-core-7r0x.9). This is the shared shape
every port lane builds on; nothing here switches a live path to Postgres yet.

- config: add `database_url` beside `db_path` (config.go), mark it bootstrap-only
  in denied_keys, expose it in the webui StorageView/config schema, and add it to
  config.example.toml plus all deployments/*.toml.
- docker-compose: add a postgres:18 service; `task dev` (dev:postgres) brings it
  up and waits for it before the State Store boots.
- archied: `openStateStore` now opens and migrates the process-scoped Postgres
  pool via `openStateStorePool`. The State Store fails closed (D1.2) when
  database_url is absent or invalid rather than fall back to SQLite; serving
  against Postgres later requires an import-completion record (D1.3), which is a
  later lane's gate, not this one.
- composition seam: task-store construction (state_store_task.go) and EDA-store
  construction (state_store_eda.go) are extracted from openStateStore, with the
  pool open in state_store_pool.go. This is a behaviour-preserving refactor only
  — no store, interface, error, ordering or logging change — so L1 and L2 build
  against separate files instead of sharing state_store.go.

Tests: fail-closed pool behaviour is pinned (absent/invalid URL); the State Store
boot/restart tests now run against a throwaway Postgres 18 container (pgtest
TestMain). Scoped test command and module-wide build pass; see lane report.
2026-09-24 02:18:56 +10:00
sam 2d8a610bab fix(deploy): pin archie-agent image away from :latest (#751)
ghcr.io/samcharles93/archie-agent:latest is re-published on every main
push that touches the runtime's package closure, so a bare :latest
reference can change under a running deployment with no warning and no
way to reproduce a prior build.

archie-agent has no published semver tag yet -- CI (deploy.yml) only
ever pushes :latest to GHCR, confirmed via the GHCR package API. Pin
docker-compose.yml and the GitHub deployment profiles to the verified
digest of :latest as of 2026-09-05
(sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090),
and document the pinning strategy -- including the semver-tag-once-
published preference and digest pinning for production -- in
deployments/systemd-user-service.md. Update the generic
docker-nats-stack.toml example to demonstrate the same convention.

Ref archie-core-kllw (GitHub #670)
2026-09-05 22:19:05 +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 8e8c22be61 fix: docker-compose corrected image path 2026-08-10 02:28:48 +10:00
sam 367b89e5ee chore(deploy): run archied on the host, keep NATS and agents in Docker
The chat agent's file tools operate on host paths, so the daemon has to
see the host filesystem. It keeps spawning agent containers through the
Docker socket and talking to NATS, so compose still carries the bus and
the network; archied and watchtower leave it.

Pins the network subnet: the daemon hands agent containers its own
nats.url verbatim, so that URL has to work from the host and from inside
a container. The gateway address does; a Docker-assigned subnet would
move it silently when the network is recreated.
2026-07-31 02:00:11 +10:00
sam fd1abdd6c8 fix(deploy): stop the agent stanza starting, and pull agent images
The agent service created a container that exited 0 immediately while
compose reported it as "Started", which reads like a crash loop. A build
profile keeps it out of `up -d`; naming it still works for build and pull.

containers.pull_policy was "if-not-present", which is not a recognised
value -- the pool pulls only when it is "always" or "missing", so the
typo disabled pulling outright and the deployed agent image drifted a day
behind the daemon. Watchtower cannot cover for it: agent containers are
spawned per task, and it only restarts long-running ones.
2026-07-31 01:51:19 +10:00
sam 3ee3bcf202 chore(deploy): commit the compose stack, drop the required overlay
docker-compose.yml was never committed -- it only existed on the
deployment host. It bind-mounted ./config.docker.toml and passed
-config-overlay unconditionally, which made an untracked repo-root
file load-bearing: Docker creates a directory when a bind source is
missing, and the loader rejects a directory, so a fresh clone took the
daemon down at boot.

The stack now passes a single -config pointing at a path outside the
repo. Nothing in the working tree is required at runtime. The
docker-specific values move to deployments/docker-nats-stack.toml as a
reference config, alongside the other deployment guides.

Also drops the ./:/workspace mount, which existed only for
desktop-commander's work_dir.
2026-07-31 01:13:23 +10:00
sam cbb7929ea6 fix: use msg.Reply instead of header for NATS reply-to 2026-07-30 16:13:51 +10:00
sam ec8534dfe2 feat(gateway): ship model controls, shell tools, and release tracking 2026-07-27 06:16:39 +10:00
sam bf0e348cbb fix: pass HEYARCHIE_TELEGRAM_BOT_TOKEN through to archied
The telegram chat gateway is enabled via chat.telegram.token_env in
config.toml, but compose never forwarded the named variable, so
cfg.Chat.Telegram.TokenEnv resolved to empty and archied exited 1.
Same class of bug as ARCHIE_GITEA_TOKEN_ARCHIE.
2026-07-27 04:51:10 +10:00
sam 52015c81b0 fix: pass ARCHIE_GITEA_TOKEN_ARCHIE through to archied container
The archied service only forwarded ARCHIE_GITEA_TOKEN, but config.toml
names ARCHIE_GITEA_TOKEN_ARCHIE for the archie identity. Recreating the
container via docker compose (rather than a manual docker run with an
explicit -e) silently dropped the token.
2026-07-27 04:31:43 +10:00
sam bb784297ae feat: fix webui task table and add merge-to-deploy automation
- webui: task rows referenced Go-style field names but store.Task
  JSON-marshals with lowercase tags, so every task row rendered blank
- add .gitea/workflows/deploy.yml: build+push archied and archie-agent
  images to the registry on merge to main
- docker-compose.yml: add a watchtower service so carina picks up new
  images and restarts the daemons without needing CI to SSH in
2026-07-24 17:22:19 +10:00
sam d80401d595 feat: add config overlay and shared RPC/Yaegi packages
- Introduce `-config-overlay` flag and `config.LoadOverlay()` to merge a base config with an overlay file, only overriding fields the overlay sets. This enables docker-compose to mount the base config from the host and apply only deployment-specific overrides.
- Create `internal/natsrpc` package with reusable NATS request/reply primitives (Envelope, Client, Call, RegisterAll, Respond). Migrate storerpc, worktreerpc, and forgerpc to use it, eliminating duplicated marshal/unmarshal and error handling.
- Create `internal/yaegiutil` package with shared interpreter construction (stdlib + extra symbols), generic export resolution (Resolve), and panic recovery (Safe). Migrate all Yaegi-based surfaces (gate scripts, daemon plugins, skill plugins, workflow stages, skill scripts) to use it, reducing boilerplate and centralizing panic safety.
- Simplify `config.docker.toml` to contain only overlay fields (paths, container config) and remove the duplicated repos list – the base config is now the single source of truth.
- Update docker-compose.yml to pass both -config and -config-overlay flags and mount the base config from the host.
- Add tests for LoadOverlay, DockerConfigOverlaysExampleConfig, Envelope, and yaegiutil utilities.
2026-07-24 12:57:10 +10:00
sam 8f8d0188b8 fix: host bind mounts for worktree to fix Docker container mount paths 2026-07-24 12:31:31 +10:00
sam 242762b2fb refactor: archie:* → agent:* labels, remove stale archie label 2026-07-24 12:09:38 +10:00
sam b8ac644acd fix: sync docker config with inprocess — DeepSeek, 100M, diff cap 0 2026-07-24 11:44:04 +10:00
sam deda2b3d58 fix: remove image tag from archied compose service to force local builds 2026-07-22 21:14:09 +10:00
sam 53376823d4 fix: push images to Gitea registry, reference in compose and config 2026-07-22 11:09:03 +10:00
sam 3490bd4124 fix: use pre-built golangci-lint binary, fix NATS healthcheck 2026-07-22 10:56:06 +10:00
sam cac64bcea6 fix: remove nonexistent runtime stage from agent build target 2026-07-22 10:36:28 +10:00
sam 209c653d15 fix: correct config mount path, add host.docker.internal for Linux, remove non-existent grace_period field 2026-07-22 10:17:28 +10:00
sam b79018ad7a fix: bump NATS image to 2.14-alpine3.22 2026-07-22 10:09:28 +10:00
sam 99b8d49c1e feat: add Docker Compose stack with NATS and agent containers 2026-07-22 09:46:54 +10:00