Task containers log in with their run credential on an external broker and
reach only their own subjects, decided by the embedded broker's authenticator.
The broker token is never put in a container environment.
Every service connected to PostgreSQL as the database owner, which is a
superuser, so anything that compromised an app process owned the cluster, and
every connection reached the server with an empty application_name, so
pg_stat_activity could not say which service a session belonged to.
Split the DB credential into two login roles and name every pool:
- archie_migrator owns public and its objects and runs goose. Migrations run
on a short-lived pool opened from the new migration_database_url, before the
serving pool opens. It is not a superuser.
- archie_runtime serves requests with SELECT, INSERT, UPDATE, DELETE, sequence
USAGE/SELECT and function EXECUTE only. It has no CREATE privilege, so it
cannot change the schema.
- Every pool sets application_name: archie-state-store, archie-gateway, and a
-migrate / -recovery / -schema / -provision suffix on the transient
administrative connections. Existing one-URL installs keep working: an
absent migration_database_url falls back to database_url and the migration
runs on the serving pool exactly as before.
Provisioning is a new idempotent `archie-state-store provision` subcommand: it
needs an admin URL the services never hold (database owner or superuser),
creates or reconciles both roles, hands every public-schema object to the
migration role, revokes PUBLIC's CREATE on public, sets row-level grants, and
sets the migration role's default privileges so tables future migrations
create are usable without a hand-run grant. It stores SCRAM verifiers, refuses
superuser roles, and verifies the boundary before committing.
install.sh now provisions the bundled path and separates the credentials: the
superuser password the Compose database is created with lives only in a
compose-only postgres.env, while the env file the units load holds the
non-superuser PGPASSWORD. A bundled install that predates the split is
upgraded in place: the roles are created, the superuser password is rotated
out of the env file, and config.toml is moved to the runtime and migration
URLs. External databases keep their operator-managed credential; the
deployments README documents the one-shot provision command.
setup writes both bundled URLs, dev:postgres provisions the dev database, the
e2e stack provisions its throwaway server, and the deployment templates point
at the two roles.
The pinning section said CI republished ghcr.io on every push to main. CI
publishes git.catlow.cloud, and only for a release tag; ghcr is where the
hand-run tools/publish.sh writes, which is the reference the default names.
A release zip pins a digest on a registry an anonymous pull cannot reach, and
[containers].registry_auth -- the setting that fixes it -- was documented
nowhere. Documented there, beside the pin.
Also corrected: every shipped profile does not pin the image, and the section
link omitted its number so it matched no heading.
The container build was the one build path that could not learn a version: the
build context excludes .git, so it has to be passed in, and nothing passed one
-- Compose handed the Dockerfile no build args, so every locally built agent
answered "dev" while the daemon reported the tag. The Taskfile now derives the
version from git describe once, for both the host binaries and the image, and
task image:agent passes it through.
docker compose build agent also failed outright: the service named the image by
digest, and Compose refuses to tag a digest. The build-only service names it by
tag now; what a task container runs is still pinned in the daemon's own
[containers] image.
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.
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.
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)
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.
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.
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.
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.
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.
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.
- 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
- 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.