Compare commits

..
4 Commits
Author SHA1 Message Date
samandClaude Fable 5.2 8f88b5b742 ci(woodpecker): build once, keep Go's caches, fetch archied for the canary
Quality / check (pull_request) Successful in 5m32s
ci/woodpecker/pr/quality Pipeline was successful
The same changes as the Actions workflows: a release gate runs
`task check dist` and the dist step only packages; canary and promote copy
archied out of archied:edge instead of compiling it.

The gate and the pull-request check keep Go's module, build and lint caches
on the host, in separate directories so a pull request cannot write into the
cache a release build reads.

Fixes: notes wait for the signed release and carry the prerelease flag;
the canary clones with tags, which its rollback needs to diff migrations;
release puts HEAD on main before `task release`, which refuses anything else.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSgGJ5xH1eDady5kVjcc8x
2026-11-10 10:57:59 +00:00
samandClaude Fable 5.2 69cd1e1426 ci(canary): take archied from the published edge image
canary and promote compiled archied from source on every run, the canary
every fifteen minutes. Both now copy the binary out of archied:edge, which
deploy already published for main.

The canary keeps its checkout: a rollback diffs the migrations between two
release tags. Promotion never reads the repository, so it drops its own.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSgGJ5xH1eDady5kVjcc8x
2026-11-10 10:57:06 +00:00
samandClaude Fable 5.2 ee71112bbc ci(deploy): build the release binaries once, in the gate
A release gate runs `task check dist`, uploads dist/, and dist-zip packages
that instead of installing Go and Node and compiling the tree again.

plan resolves the commit and version once for the image jobs. agent-image is
skipped outside a release. dist-zip waits for archied-image. The image jobs
share one builder that is never removed, so the Dockerfiles' cache mounts
survive between runs.

Also: Node 24 in the gate like everywhere else, govulncheck pinned, and the
release notes carry the prerelease flag.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSgGJ5xH1eDady5kVjcc8x
2026-11-10 10:56:55 +00:00
samandClaude Fable 5.2 a6fb7f531e build: add task dist, build the dashboard once, cache Go in image builds
`task dist` builds the binaries release.json names into dist/ with the
compiler flags `build` uses, so after the gate has built bin/ it only links.
`build` is now static (CGO_ENABLED=0), like what ships.

`ui` runs once per task invocation: check built the dashboard, then build's
dependency built it again under the Go steps that embed it.

Both Dockerfiles compile with cache mounts for Go's module and build caches.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSgGJ5xH1eDady5kVjcc8x
2026-11-10 10:56:12 +00:00
1774 changed files with 82583 additions and 108109 deletions

No files matched your search

+17 -6
View File
@@ -1,14 +1,25 @@
# Live reload for the single archie binary during development. The dashboard
# lives in archie-frontend and runs its own Vite server against this one.
# Live reload for archied during dashboard work.
#
# The frontend has its own loop -- `task ui:dev` runs Vite with HMR and proxies
# /api and /events here -- so this watcher deliberately ignores ui/. Watching
# it would rebuild the Go binary on every keystroke in a CSS file, and
# rebuilding on ui/dist changes would loop against `task ui`.
#
# ui/dist is NOT rebuilt here. During development the Vite server serves the
# frontend directly with HMR, so dist is not what you are looking at; it only
# matters for the embedded build, and `task ui` produces it before a commit.
# An earlier rule here claimed to keep dist current and never ran: air
# requires a file to satisfy include_dir AND include_file together, and ui/ is
# excluded from the walk anyway.
root = "."
tmp_dir = ".air"
[build]
cmd = "go build -o ./.air/archie ./cmd/archie"
cmd = "go build -o ./.air/archied ./cmd/archied"
# `bin` is deprecated in air; entrypoint is the current key.
entrypoint = "./.air/archie"
include_ext = ["go", "toml", "sql", "yaml", "cedar", "tmpl", "md"]
exclude_dir = ["bin", "docs", ".git", ".task", ".air", "tmp"]
entrypoint = "./.air/archied"
include_ext = ["go", "toml"]
exclude_dir = ["ui", "bin", "docs", ".git", ".task", ".air", "tmp"]
exclude_regex = ["_test\\.go"]
stop_on_error = true
delay = 400
+2 -2
View File
@@ -13,8 +13,8 @@ docs/
tmp/
.playwright-mcp/
# A trailing-slash pattern matches only the context root, so this is written to
# match a node_modules at any depth; the agent image compiles Go, which needs
# none of it.
# match a node_modules at any depth: ui/node_modules alone is 200MB and the
# agent image compiles Go, which needs none of it.
**/node_modules/
# Stray host-built binaries committed at the repo root.
+51
View File
@@ -0,0 +1,51 @@
name: canary
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch:
concurrency:
group: canary
permissions:
contents: read
packages: write
jobs:
judge:
if: vars.CANARY_URL != ''
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
- name: Fetch the published archied
# The deploy workflow already built this binary. edge is the newest
# main that passed the gate.
run: |
set -e
image=git.catlow.cloud/sam/archied:edge
docker pull -q "$image"
container="$(docker create "$image")"
docker cp "$container:/usr/local/bin/archied" "$RUNNER_TEMP/archied"
docker rm "$container" >/dev/null
- name: Judge the canary
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
CANARY_WINDOW: ${{ vars.CANARY_WINDOW }}
run: |
window_args=()
if [ -n "$CANARY_WINDOW" ]; then
window_args=(-window "$CANARY_WINDOW")
fi
"$RUNNER_TEMP/archied" release canary check -dashboard "${{ vars.CANARY_URL }}" \
"${window_args[@]}" \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
+115 -74
View File
@@ -2,10 +2,11 @@ name: deploy
on:
push:
branches: [main]
tags: ["v*"]
concurrency:
group: deploy-${{ github.ref }}
group: ${{ startsWith(github.ref, 'refs/tags/') && format('deploy-release-{0}', github.sha) || format('deploy-{0}', github.ref) }}
cancel-in-progress: true
permissions:
@@ -17,32 +18,68 @@ jobs:
runs-on: self-hosted
outputs:
archied_version: ${{ steps.release_tag.outputs.archied_version }}
run: ${{ steps.release_tag.outputs.run }}
sha: ${{ steps.release_tag.outputs.sha }}
component: ${{ steps.release_tag.outputs.component }}
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve the release
- name: Resolve archied tag at HEAD
id: release_tag
run: |
echo "archied_version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
echo "sha=$(git rev-parse "${GITHUB_REF}^{commit}")" >> "$GITHUB_OUTPUT"
version="$(git tag --points-at HEAD --list 'v*' | sed -e 's|^v||' | sort -V | tail -1)"
echo "archied_version=$version" >> "$GITHUB_OUTPUT"
if [ -n "$version" ]; then
echo "archied release at HEAD: $version"
else
echo "no release tag at HEAD; distribution zip will be skipped"
fi
# An annotated tag makes GITHUB_SHA the tag object, so the commit is
# resolved from the ref: image tags pin it.
sha="$(git rev-parse "${GITHUB_REF}^{commit}")"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
# A release reports its version; any other build of main names its commit.
echo "component=${version:-dev+${sha:0:12}}" >> "$GITHUB_OUTPUT"
run=true
case "$GITHUB_REF" in
refs/tags/*) ;;
*)
if [ -n "$version" ]; then
run=false
echo "the v$version tag push runs this commit; skipping the branch run"
fi
;;
esac
echo "run=$run" >> "$GITHUB_OUTPUT"
gate:
needs: plan
if: needs.plan.outputs.run == 'true'
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- uses: pnpm/action-setup@v4
with:
package_json_file: ui/package.json
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Install quality tools
run: |
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(cat .golangci-version)
@@ -68,7 +105,14 @@ jobs:
env:
RELEASE_VERSION: ${{ needs.plan.outputs.archied_version }}
run: |
task check dist TEST_FLAGS=-count=1 VERSION="$RELEASE_VERSION"
# A release also builds the binaries it ships, in the same task run:
# the dashboard is built once and the tree that passed is the tree
# that is published.
if [ -n "$RELEASE_VERSION" ]; then
task check dist TEST_FLAGS=-count=1 VERSION="$RELEASE_VERSION"
else
task check TEST_FLAGS=-count=1
fi
git diff --exit-code
- name: Vulnerability scan
@@ -76,12 +120,40 @@ jobs:
go install golang.org/x/vuln/cmd/govulncheck@v1.9.0
govulncheck ./...
- name: Release tags must match changelogs
run: |
set -e
fail=0
for tag in $(git tag --points-at HEAD); do
case "$tag" in
v*)
ver="${tag#v}"
echo " release tag $tag -> looking for [$ver] in CHANGELOG.md"
grep -q "^## \\[$ver\\]" CHANGELOG.md || {
echo " FAIL: CHANGELOG.md has no [$ver] section"
fail=1
}
;;
esac
done
if [ $fail -ne 0 ]; then
echo
echo "A release tag points at this commit but its changelog does not"
echo "describe that version. Cut releases with the release workflow."
exit 1
fi
if ! git tag --points-at HEAD | grep -qE '^v[0-9]' ; then
echo "This commit isn't a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest promoted release."
fi
- name: Package the release binaries
if: needs.plan.outputs.archied_version != ''
# tar keeps the executable bit, which an uploaded artifact drops.
run: tar -cf release-binaries.tar dist
- name: Upload the release binaries
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
if: needs.plan.outputs.archied_version != ''
uses: actions/upload-artifact@v4
with:
name: release-binaries
path: release-binaries.tar
@@ -93,10 +165,10 @@ jobs:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
uses: docker/setup-buildx-action@v3
with:
# One named builder that is never removed, so the Dockerfiles' cache
# mounts are still there on the next run. Removing it at the end of
@@ -108,31 +180,35 @@ jobs:
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
- name: Build and push archied
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.archied
push: true
# The first line is empty for a build of main; empty lines are ignored.
tags: |
git.catlow.cloud/sam/archied:v${{ needs.plan.outputs.archied_version }}
${{ needs.plan.outputs.archied_version != '' && format('git.catlow.cloud/sam/archied:v{0}', needs.plan.outputs.archied_version) || '' }}
git.catlow.cloud/sam/archied:edge
git.catlow.cloud/sam/archied:sha-${{ needs.plan.outputs.sha }}
build-args: |
GATEWAY_VERSION=${{ needs.plan.outputs.archied_version }}
RUNTIME_VERSION=${{ needs.plan.outputs.archied_version }}
GATEWAY_VERSION=${{ needs.plan.outputs.component }}
RUNTIME_VERSION=${{ needs.plan.outputs.component }}
cache-from: type=gha,scope=archied
cache-to: type=gha,mode=max,scope=archied
agent-image:
needs: [plan, gate]
# The agent image is only published with a release.
if: needs.plan.outputs.run == 'true' && needs.plan.outputs.archied_version != ''
outputs:
agent_digest: ${{ steps.agent.outputs.digest }}
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
uses: docker/setup-buildx-action@v3
with:
# One named builder that is never removed, so the Dockerfiles' cache
# mounts are still there on the next run. Removing it at the end of
@@ -145,7 +221,7 @@ jobs:
- name: Build and push archie-agent
id: agent
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
@@ -158,66 +234,18 @@ jobs:
cache-from: type=gha,scope=archie-agent
cache-to: type=gha,mode=max,scope=archie-agent
archie-image:
needs: [plan, gate]
outputs:
archie_digest: ${{ steps.archie.outputs.digest }}
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
with:
name: archie-ci
cleanup: false
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
- name: Build and push archie
id: archie
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
with:
context: .
file: Dockerfile.archie
push: true
sbom: true
provenance: mode=max
tags: |
git.catlow.cloud/sam/archie:v${{ needs.plan.outputs.archied_version }}
git.catlow.cloud/sam/archie:sha-${{ needs.plan.outputs.sha }}
build-args: |
VERSION=${{ needs.plan.outputs.archied_version }}
REVISION=${{ needs.plan.outputs.sha }}
cache-from: type=gha,scope=archie
cache-to: type=gha,mode=max,scope=archie
- name: Sign image with cosign
if: env.COSIGN_PRIVATE_KEY != ''
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
run: |
if command -v cosign >/dev/null 2>&1; then
cosign sign --yes --key env://COSIGN_PRIVATE_KEY "git.catlow.cloud/sam/archie@${{ steps.archie.outputs.digest }}"
else
echo "::warning::cosign binary not installed on runner; skipping signature"
fi
dist-zip:
# archied-image is needed so a release never reaches the canary without it.
needs: [plan, gate, archied-image, agent-image]
if: needs.plan.outputs.run == 'true' && needs.plan.outputs.archied_version != ''
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
uses: actions/checkout@v4
# The gate built these from the tree it checked; nothing is compiled here.
- name: Download the release binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
uses: actions/download-artifact@v4
with:
name: release-binaries
@@ -237,7 +265,7 @@ jobs:
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
cp "dist/$cmd" "$name/"
done
cp deployments/INSTRUCTIONS.md "$name/"
cp deployments/INSTRUCTIONS.md CHANGELOG.md "$name/"
digest='${{ needs.agent-image.outputs.agent_digest }}'
test -n "$digest"
jq --arg image "git.catlow.cloud/sam/archie-agent@$digest" '. + {agent_image: $image}' release.json > "$name/release.json"
@@ -246,7 +274,7 @@ jobs:
echo "name=$name" >> "$GITHUB_OUTPUT"
- name: Upload distribution zip
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
uses: actions/upload-artifact@v4
with:
name: ${{ steps.zip.outputs.name }}
path: ${{ steps.zip.outputs.name }}.zip
@@ -279,8 +307,15 @@ jobs:
prerelease=false
case "$version" in *-*) prerelease=true ;; esac
notes="$(mktemp)"
previous="$(git describe --tags --abbrev=0 --match 'v*' "$tag^" 2>/dev/null || true)"
git log --no-merges --format='- %s' ${previous:+"$previous.."}"$tag" > "$notes"
awk -v hdr="## [$version]" '
index($0, hdr) == 1 { printing = 1 }
printing && /^## \[/ && index($0, hdr) != 1 { exit }
printing { print }
' CHANGELOG.md > "$notes"
if ! [ -s "$notes" ]; then
echo "no [$version] section extracted from CHANGELOG.md" >&2
exit 1
fi
api="https://git.catlow.cloud/api/v1"
repo="sam/archie"
auth="Authorization: token $DEPLOY_TOKEN"
@@ -292,6 +327,12 @@ jobs:
"$api/repos/$repo/releases" >/dev/null
echo "published release notes for $tag"
- name: Install the release on the canary
if: vars.CANARY_URL != ''
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
run: ./dist/archied release canary start -dashboard "${{ vars.CANARY_URL }}" -version "${{ steps.version.outputs.version }}"
- name: Link the packages to this repository
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
+10 -9
View File
@@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: "published release to move stable to, such as 1.63.0"
description: "release the canary is expected to run; must match what it runs"
required: true
type: string
@@ -18,26 +18,27 @@ permissions:
jobs:
promote:
if: vars.CANARY_URL != ''
runs-on: self-hosted
steps:
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
- name: Fetch the release's archied
env:
VERSION: ${{ inputs.version }}
- name: Fetch the published archied
# The deploy workflow already built this binary. edge is the newest
# main that passed the gate.
run: |
set -e
image="git.catlow.cloud/sam/archied:v$VERSION"
image=git.catlow.cloud/sam/archied:edge
docker pull -q "$image"
container="$(docker create "$image")"
docker cp "$container:/usr/local/bin/archied" "$RUNNER_TEMP/archied"
docker rm "$container" >/dev/null
- name: Promote to stable
- name: Promote the canary's release
env:
VERSION: ${{ inputs.version }}
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
run: |
"$RUNNER_TEMP/archied" release promote \
-version "$VERSION" \
"$RUNNER_TEMP/archied" release canary promote -dashboard "${{ vars.CANARY_URL }}" \
-version "${{ inputs.version }}" \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
+11 -3
View File
@@ -14,17 +14,25 @@ jobs:
check:
runs-on: archie-quality
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify unprivileged user namespaces
run: unshare --user --map-root-user --net true
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: pnpm/action-setup@v4
with:
package_json_file: ui/package.json
- uses: actions/setup-node@v4
with:
node-version: "24"
- name: Install quality tools
run: |
go install github.com/go-task/task/v3/cmd/task@v3.48.0
@@ -32,7 +40,7 @@ jobs:
go install mvdan.cc/gofumpt@v0.11.0
bash tools/proto.sh install
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
- uses: actions/cache@v4
with:
path: ~/.cache/golangci-lint
key: golangci-lint-${{ hashFiles('.golangci-version', '.golangci.yml', 'go.sum') }}-${{ github.sha }}
+4 -4
View File
@@ -23,19 +23,19 @@ jobs:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
if [ -z "$DEPLOY_TOKEN" ]; then
echo "::error::DEPLOY_TOKEN is not set for this repository, so the release cannot push its tag. Set the secret here, or dispatch the release from the Gitea primary."
echo "::error::DEPLOY_TOKEN is not set for this repository, so the release cannot push its commit and tag. Set the secret here, or dispatch the release from the Gitea primary."
exit 1
fi
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.DEPLOY_TOKEN }}
- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
@@ -52,4 +52,4 @@ jobs:
task release RELEASE="$RELEASE"
- name: Push the release
run: git push origin "$(git describe --exact-match --match 'v*' HEAD)"
run: git push --atomic origin main "$(git describe --exact-match --match 'v*' HEAD)"
+4 -12
View File
@@ -23,6 +23,10 @@ config.production.toml
*.png
# Frontend
/ui/node_modules/
/ui/.vite/
/ui/*.tsbuildinfo
/ui/dist/
# air live-reload
/.air/
@@ -46,15 +50,3 @@ __pycache__/
/archipelago
.agents-run/
/.pnpm-store/
deployments/archie/.build/
.codebase-memory/
# Vale synced packages, dictionaries, and grammars (recreated by `vale sync`).
# Local house rules (.vale/styles/Archie/) and vocabulary stay tracked.
/.vale/styles/*
!/.vale/styles/Archie/
!/.vale/styles/config/
/.vale/styles/config/*
!/.vale/styles/config/vocabularies/
/.vale/styles/config/vocabularies/*
!/.vale/styles/config/vocabularies/Archie/
+7 -33
View File
@@ -42,7 +42,6 @@ linters:
- errorlint
- fatcontext
- forcetypeassert
- gosec
- makezero
- nilerr
- nilnesserr
@@ -97,32 +96,6 @@ linters:
- {pkg: "github.com/samcharles93/archie-core/internal/infrastructure/controlplanestore", desc: "reach the State Store through its contract"}
- {pkg: "github.com/samcharles93/archie-core/internal/domain/workflow", desc: "the workflow engine is the daemon's"}
- {pkg: "github.com/samcharles93/archie-core/internal/agentexec", desc: "agent execution is the daemon's"}
# The single binary replaces the services slice by slice. It never
# imports their packages, so each old path can be deleted outright.
single-binary:
files: ["**/cmd/archie/**", "**/internal/app/archie/**", "**/internal/platform/**", "**/modules/**"]
deny:
- {pkg: "github.com/samcharles93/archie-core/internal/app/archied", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/statestore", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/archiegateway", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/archiemessaging", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/archieui", desc: "an old service; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/app/servicekit", desc: "old service plumbing"}
- {pkg: "github.com/samcharles93/archie-core/internal/daemon", desc: "old service code; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/gateway", desc: "old service code; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/webui", desc: "old service code; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/domain", desc: "old domain code; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/infrastructure", desc: "old infrastructure; move what you need into a module"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/state", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/gateway", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/daemon", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/controlplane", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/messaging", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/logging", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/forge", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/contracts/channel", desc: "an internal service contract being deleted"}
- {pkg: "github.com/samcharles93/archie-core/internal/config", desc: "the single binary has its own bootstrap config"}
- {pkg: "github.com/nats-io", desc: "the single binary has no message bus"}
shared:
files: ["**/internal/app/servicekit/**"]
deny:
@@ -155,12 +128,6 @@ linters:
- HACK
- BUG
gosec:
excludes:
- G104 # errcheck covers unchecked errors
- G115 # integer conversions are bounded where they occur
- G204 # running commands is what the tools and workflow steps do
- G304 # file paths come from configuration and confined worktrees
interfacebloat:
max: 8
@@ -172,8 +139,15 @@ linters:
exclusions:
generated: lax
warn-unused: true
# npm dependencies are not this module's code. `flatted`, pulled in
# transitively by the dashboard toolchain, ships a Go implementation
# alongside its JavaScript, and linting a vendored third-party file fails
# the gate on complexity nobody here can fix.
paths:
- ui/node_modules
presets:
- comments
- std-error-handling
- common-false-positives
- legacy
rules:
-10
View File
@@ -1,10 +0,0 @@
{
"buildPath": "code",
"hook": {
"enabled": true,
"limits": {
"maxFindings": 5,
"maxChars": 8000
}
}
}
-141
View File
@@ -1,141 +0,0 @@
{
"schemaVersion": 2,
"generatedAt": "2026-11-24T00:00:00+11:00",
"title": "Design System: Archie",
"extensions": {
"colorMeta": {
"signal-sage": { "role": "primary", "displayName": "Signal Sage", "canonical": "#51a580", "tonalRamp": ["#0f2a1e", "#17402e", "#1f5740", "#2e795a", "#51a580", "#7dbf9f", "#acd8c2", "#dcefe5"] },
"signal-sage-deep": { "role": "primary", "displayName": "Signal Sage Deep", "canonical": "#2e795a" },
"signal-sage-ink": { "role": "primary", "displayName": "Signal Sage Ink", "canonical": "#0c6f4d" },
"graphite-card": { "role": "neutral", "displayName": "Graphite Card", "canonical": "#1c1d21", "tonalRamp": ["#0e0f10", "#16171a", "#1c1d21", "#26282c", "#3c3f45", "#70727a", "#a6a39b", "#e8e6e1"] },
"paper-canvas": { "role": "neutral", "displayName": "Paper Canvas", "canonical": "#e9e7e2", "tonalRamp": ["#1f1f1d", "#5c5a55", "#8a877f", "#c7c4bd", "#dcdad4", "#e9e7e2", "#f5f4f1", "#ffffff"] },
"amber-warn": { "role": "tertiary", "displayName": "Amber Warn", "canonical": "#d9a45b", "tonalRamp": ["#3a2a10", "#5c4116", "#8a5a12", "#b5833a", "#d9a45b", "#e5bf87", "#efd7b3", "#f8eddc"] },
"clay-danger": { "role": "tertiary", "displayName": "Clay Danger", "canonical": "#d9776b", "tonalRamp": ["#3d1714", "#5e2420", "#b3413a", "#c75d53", "#d9776b", "#e49d94", "#eec3bd", "#f8e6e3"] },
"slate-info": { "role": "tertiary", "displayName": "Slate Info", "canonical": "#8aa4c2", "tonalRamp": ["#17222f", "#24364b", "#3d5f86", "#6283a8", "#8aa4c2", "#adc0d5", "#cfdae6", "#ecf1f6"] },
"stone-idle": { "role": "neutral", "displayName": "Stone Idle", "canonical": "#9a978f" }
},
"typographyMeta": {
"page-title": { "displayName": "Page title", "purpose": "One per page, in PageHeader beside the page's actions." },
"title": { "displayName": "Title", "purpose": "Card and panel titles." },
"label": { "displayName": "Label", "purpose": "Body copy, rows, navigation, buttons and fields." },
"caption": { "displayName": "Caption", "purpose": "Metadata, column labels, step-type labels and badges." },
"section-label": { "displayName": "Section label", "purpose": "Uppercase group headings in sidebars and settings navigation." },
"micro": { "displayName": "Micro", "purpose": "The smallest annotations, used sparingly." },
"mono": { "displayName": "Mono", "purpose": "IDs, short hashes, durations, log fields and code." }
},
"shadows": [
{ "name": "rest", "value": "0 1px 2px rgba(0, 0, 0, 0.4)", "purpose": "Top bar and canvas nodes at rest (dark). Light: 0 1px 2px rgba(31, 31, 29, 0.06)." },
{ "name": "float", "value": "0 8px 28px rgba(0, 0, 0, 0.4)", "purpose": "Popovers, menus, dialogs and the expanded step node (dark). Light: 0 8px 28px rgba(31, 31, 29, 0.1)." }
],
"motion": [
{ "name": "transition", "value": "140ms cubic-bezier(0.4, 0, 0.2, 1)", "purpose": "Default colour and state transitions." },
{ "name": "node-expand", "value": "200ms", "purpose": "Step node width and shadow when it expands in place." },
{ "name": "reduced-motion", "value": "0.01ms", "purpose": "All animation and transition durations under prefers-reduced-motion or the reduced-motion setting." }
],
"breakpoints": [
{ "name": "sm", "value": "640px" },
{ "name": "md", "value": "768px" },
{ "name": "lg", "value": "1024px" }
]
},
"components": [
{
"name": "Primary Button",
"kind": "button",
"refersTo": "button-primary",
"description": "The one filled action per view.",
"html": "<button class=\"ds-btn-primary\">Run workflow</button>",
"css": ".ds-btn-primary { height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: var(--primary, #2e795a); color: var(--primary-foreground, #fff); font: 500 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; cursor: pointer; transition: all 140ms cubic-bezier(0.4, 0, 0.2, 1); } .ds-btn-primary:hover { background: color-mix(in srgb, var(--primary, #2e795a) 80%, transparent); } .ds-btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring, #51a580); } .ds-btn-primary:active { transform: translateY(1px); }"
},
{
"name": "Ghost Button",
"kind": "button",
"refersTo": "button-ghost",
"description": "Default for secondary and contextual actions.",
"html": "<button class=\"ds-btn-ghost\">Cancel</button>",
"css": ".ds-btn-ghost { height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--foreground, #e8e6e1); font: 500 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; cursor: pointer; transition: all 140ms cubic-bezier(0.4, 0, 0.2, 1); } .ds-btn-ghost:hover { background: var(--muted, #26282c); } .ds-btn-ghost:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring, #51a580); } .ds-btn-ghost:active { transform: translateY(1px); }"
},
{
"name": "Attention Button",
"kind": "button",
"refersTo": "button-attention",
"description": "An action that exists because something is waiting.",
"html": "<button class=\"ds-btn-attention\">Review approval</button>",
"css": ".ds-btn-attention { height: 36px; padding: 0 10px; border: 1px solid var(--warn, #d9a45b); border-radius: 8px; background: var(--warn-soft, rgba(217,164,91,0.08)); color: var(--warn, #d9a45b); font: 500 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; cursor: pointer; transition: all 140ms cubic-bezier(0.4, 0, 0.2, 1); } .ds-btn-attention:hover { background: rgba(217,164,91,0.16); } .ds-btn-attention:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring, #51a580); }"
},
{
"name": "Text Input",
"kind": "input",
"refersTo": "input",
"description": "Single-line field on the card surface.",
"html": "<input class=\"ds-input\" placeholder=\"Workflow name\" />",
"css": ".ds-input { height: 36px; width: 240px; padding: 4px 10px; border: 1px solid var(--input, #70727a); border-radius: 8px; background: var(--card, #1c1d21); color: var(--foreground, #e8e6e1); font: 400 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; outline: none; transition: border-color 140ms, box-shadow 140ms; } .ds-input::placeholder { color: var(--fg-muted, #a6a39b); } .ds-input:focus-visible { border-color: var(--ring, #51a580); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring, #51a580) 50%, transparent); }"
},
{
"name": "Status Badges",
"kind": "chip",
"refersTo": "badge-ok",
"description": "Solid tone on its soft background; the only place status colour is decided.",
"html": "<span class=\"ds-badge ds-ok\">Succeeded</span> <span class=\"ds-badge ds-warn\">Waiting</span> <span class=\"ds-badge ds-danger\">Failed</span> <span class=\"ds-badge ds-info\">Working</span> <span class=\"ds-badge ds-idle\">Idle</span>",
"css": ".ds-badge { display: inline-flex; align-items: center; height: 20px; padding: 2px 8px; border-radius: 4px; font: 500 0.6875rem 'IBM Plex Sans Variable', system-ui, sans-serif; white-space: nowrap; } .ds-ok { background: var(--ok-soft, rgba(81,165,128,0.12)); color: var(--ok, #51a580); } .ds-warn { background: var(--warn-soft, rgba(217,164,91,0.08)); color: var(--warn, #d9a45b); } .ds-danger { background: var(--danger-soft, rgba(217,119,107,0.08)); color: var(--danger, #d9776b); } .ds-info { background: var(--info-soft, rgba(138,164,194,0.1)); color: var(--info, #8aa4c2); } .ds-idle { background: var(--idle-soft, rgba(143,140,133,0.1)); color: var(--idle, #9a978f); }"
},
{
"name": "Section Card",
"kind": "card",
"refersTo": "card",
"description": "Titled card on the workspace; ring, no shadow.",
"html": "<section class=\"ds-card\"><h3 class=\"ds-card-title\">Event sources</h3><p class=\"ds-card-body\">prometheus <span class=\"ds-mono\">a41f9c2e</span></p></section>",
"css": ".ds-card { width: 320px; padding: 16px; border-radius: 12px; background: var(--card, #1c1d21); color: var(--card-foreground, #e8e6e1); box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground, #e8e6e1) 10%, transparent); font-family: 'IBM Plex Sans Variable', system-ui, sans-serif; } .ds-card-title { margin: 0 0 8px; font-size: 0.9375rem; font-weight: 500; line-height: 1.375; } .ds-card-body { margin: 0; font-size: 0.8125rem; color: var(--fg-muted, #a6a39b); } .ds-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.6875rem; color: var(--fg-subtle, #99968f); }"
},
{
"name": "Top Bar",
"kind": "nav",
"refersTo": "top-bar",
"description": "Sticky 56px bar with breadcrumb and account controls.",
"html": "<header class=\"ds-topbar\"><nav class=\"ds-crumbs\"><a href=\"#\">Workflows</a><span>/</span><span class=\"ds-current\">disk-pressure</span></nav><span class=\"ds-pill\"><i></i>Connected</span></header>",
"css": ".ds-topbar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; background: var(--card, #1c1d21); border-bottom: 1px solid var(--border-strong, #3c3f45); box-shadow: 0 1px 2px rgba(0,0,0,0.4); font: 400 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; } .ds-crumbs { display: flex; gap: 6px; color: var(--fg-muted, #a6a39b); } .ds-crumbs a { color: inherit; text-decoration: none; } .ds-crumbs a:hover { color: var(--foreground, #e8e6e1); } .ds-crumbs a:focus-visible { outline: 2px solid var(--ring, #51a580); outline-offset: 2px; } .ds-current { color: var(--foreground, #e8e6e1); } .ds-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.6875rem; color: var(--fg-muted, #a6a39b); } .ds-pill i { width: 6px; height: 6px; border-radius: 9999px; background: var(--ok, #51a580); }"
},
{
"name": "Step Node",
"kind": "custom",
"refersTo": "step-node",
"description": "The workflow canvas card; the same card shows edit state and live run state.",
"html": "<div class=\"ds-node\" tabindex=\"0\"><div class=\"ds-node-meta\"><svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 8V4H8\"/><rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\"/></svg><span>Agent</span><span class=\"ds-node-dur\">4.2s</span><i class=\"ds-node-dot\"></i></div><div class=\"ds-node-title\">2 Investigate disk usage</div></div>",
"css": ".ds-node { width: 240px; padding: 10px 12px; border: 1px solid var(--border, #313338); border-radius: 8px; background: var(--card, #1c1d21); box-shadow: 0 1px 2px rgba(0,0,0,0.4); font-family: 'IBM Plex Sans Variable', system-ui, sans-serif; color: var(--foreground, #e8e6e1); cursor: pointer; transition: width 200ms, box-shadow 200ms, border-color 140ms; } .ds-node:hover { border-color: var(--muted-foreground, #a6a39b); } .ds-node:focus-visible { outline: none; width: 416px; box-shadow: 0 8px 28px rgba(0,0,0,0.4), 0 0 0 2px var(--ring, #51a580); } .ds-node-meta { display: flex; align-items: center; gap: 6px; font-size: 0.6875rem; color: var(--fg-muted, #a6a39b); } .ds-node-meta svg { color: var(--link, #51a580); } .ds-node-dur { margin-left: auto; font-family: 'IBM Plex Mono', ui-monospace, monospace; color: var(--fg-subtle, #99968f); } .ds-node-dot { width: 6px; height: 6px; border-radius: 9999px; background: var(--info, #8aa4c2); } .ds-node-title { margin-top: 6px; font-size: 0.8125rem; font-weight: 500; }"
}
],
"narrative": {
"northStar": "The Operations Console",
"overview": "Archie's dashboard is a calm instrument panel for someone responsible for a live estate. It is dense and legible, and it stays quiet until something needs the operator. The mood is calm, precise and trustworthy: restraint is how the interface shows it is in control, and nothing raises its voice unless state demands it.\n\nThe palette is Graphite: warm neutral greys with no hue cast and a single accent, Signal Sage. Hierarchy comes from surface steps, hairlines and type weight, never from tinted backgrounds. Colour is a signal, not decoration. Sage marks what is live, healthy or actionable, and the four status hues (amber, clay, slate, stone) each keep one meaning everywhere they appear. Dark and light themes carry the same variable set and the same rules; the operator's OS chooses unless they pick one.\n\nDensity is a first-class setting. The default is already compact, and compact mode tightens the whole spacing scale without shrinking text or hit targets. Controls are compact and contextual: they appear where the work is, on hover or focus, rather than as permanent chrome. The interface never looks like a toy and never borrows generic SaaS gloss.",
"keyCharacteristics": [
"Warm graphite neutrals, one sage accent, four fixed status hues.",
"IBM Plex Sans with Plex Mono for IDs, durations and payloads, on a compact type scale (11 to 15px).",
"Flat tonal layers; shadows only for things that float.",
"Compact density by default, with a tighter compact mode.",
"Both themes, reduced motion and keyboard focus are invariants, not options."
],
"rules": [
{ "name": "The Semantic Names Rule", "body": "Components reference `--primary`, `--ok`, `--warn` and the rest, never a raw hex or a hue name such as `--violet`. A palette change is one file.", "section": "colors" },
{ "name": "The One Meaning Rule", "body": "A status colour means the same thing wherever it appears: a task state, a gate result, a log level and a trend all draw from the same five tones.", "section": "colors" },
{ "name": "The Measured Contrast Rule", "body": "Every foreground is checked against every surface it lands on, hover states included, at 4.5:1. Nothing dimmer than Text Subtle is allowed as text.", "section": "colors" },
{ "name": "The Type Scale Rule", "body": "Use the named steps (`text-micro`, `text-caption`, `text-label`, `text-title`), never pixel sizes. Headings are separated by weight and placement, not by size jumps.", "section": "typography" },
{ "name": "The Data Is Mono Rule", "body": "Anything the operator might copy or compare (an ID, a version, a duration, a payload) is set in Plex Mono.", "section": "typography" },
{ "name": "The Flat By Default Rule", "body": "Cards sit on the page with a 1px ring, not a shadow. A larger shadow means the element floats above the page.", "section": "elevation" }
],
"dos": [
"Do use semantic tokens (`bg-card`, `text-fg-muted`, `bg-ok-soft`) and the named type steps, so both themes and compact density work without extra code.",
"Do keep one filled primary button per view; everything else is ghost, outline or secondary.",
"Do set IDs, versions, durations and payloads in Plex Mono.",
"Do show actions on hover or focus where the work is, and make every hover action reachable by keyboard.",
"Do honour reduced motion: nothing animates when the operator asks it not to."
],
"donts": [
"Don't use generic SaaS gloss: no purple or multicolour gradients, no glow shadows, no glassmorphism cards, no gradient text.",
"Don't make it toy-like on phones: no blanket 44px minimum sizes on buttons, links and fields. Widen the tap area invisibly with `touch-hit` instead.",
"Don't tint backgrounds for hierarchy; use surface steps and borders.",
"Don't introduce a new hue or reuse a status colour for decoration.",
"Don't put white text on a status fill; use the soft background and the solid tone.",
"Don't add a shadow to a resting card."
]
}
}
-104
View File
@@ -1,104 +0,0 @@
StylesPath = .vale/styles
MinAlertLevel = warning
Vocab = Archie
# Run `vale sync` to install external packages and the Go comment grammar.
Packages = Google, Microsoft, Voices, TechTerms, Comments, Prompts
Grammars = go
[formats]
tmpl = md
[*.{md,tmpl}]
# Ignore Go/workflow template expressions such as {{ steps.plan.summary }}.
TokenIgnores = (\{\{[^}]*\}\})
BasedOnStyles = Vale, Voices, Direct, Google, Archie
# Australian English and Archie's technical prose conventions:
Google.Spelling = NO
Google.Quotes = NO
Google.DateFormat = NO
Google.OxfordComma = NO
Google.EmDash = NO
Google.Contractions = NO
Google.Parens = NO
Google.Semicolons = NO
Google.Colons = NO
Google.Units = NO
Google.Acronyms = NO
Google.WordList = NO
Google.WordListCase = NO
# Keep style nudges advisory (visible with --minAlertLevel=suggestion).
Google.Headings = suggestion
Google.Latin = suggestion
Google.Exclamation = warning
Google.FirstPerson = suggestion
Google.We = suggestion
Google.Will = suggestion
# Selective Microsoft rules (UI verbs, inclusive terminology, hyphens) without
# pulling in Microsoft-specific product jargon (e.g. agent -> personal digital assistant).
Microsoft.UIVerbs = warning
Microsoft.BiasFree = warning
Microsoft.Auto = warning
Microsoft.Suspended = warning
Microsoft.Accessibility = suggestion
Microsoft.Uppercase = suggestion
# "Term: explanation" is idiomatic throughout Archie's docs and comments.
Voices.ColonReveal = NO
# Replaced by Archie.Readability and Archie.SentenceLength, calibrated for technical docs.
Direct.Ease = NO
Direct.Length = NO
Direct.Hedging = warning
Direct.Preamble = warning
# Agent instruction and skill files get additional prompt-quality checks.
[{AGENTS,CLAUDE,SKILL}.md]
BasedOnStyles = Vale, Voices, Direct, Google, Archie, Prompts
# A rule file states each rule once, and many of those rules are absolutes.
# The prompt heuristic against repeated absolutes does not apply here.
Prompts.Absolutes = NO
# Model prompts are plain text (no Markdown bold) and reference tool names inline.
[internal/prompts/*.{md,tmpl}]
Vale.Spelling = suggestion
Archie.UILabelFormat = NO
# Go source comments: doc conventions, spelling, clarity, and no migration narration.
[*.go]
BasedOnStyles = Vale, Voices, Comments, GoDoc, Archie
# Go comments often mention camelCase/snake_case identifiers without backticks,
# so keep spelling advisory here.
Vale.Spelling = suggestion
# Upstream GoDoc.Sentence regex backtracks heavily on long comment blocks.
GoDoc.Sentence = NO
Voices.ColonReveal = NO
Archie.Readability = NO
Archie.SentenceLength = NO
Archie.UIElementType = NO
Archie.UILabelFormat = NO
# Never lint generated Go files (protobuf, sqlc).
[*.{pb,sql}.go]
BasedOnStyles =
# Scratch checkouts, installed skills and generated output are not Archie's
# prose: a run over the repository must report on what the repository holds.
[tmp/**]
BasedOnStyles =
[.local/**]
BasedOnStyles =
[.agents/**]
BasedOnStyles =
[archipelago/**]
BasedOnStyles =
[.agents-run/**]
BasedOnStyles =
[.impeccable/**]
BasedOnStyles =
-154
View File
@@ -1,154 +0,0 @@
# Enforce Australian English spelling in prose.
# Intentionally omits computing standards that use US forms in Australia
# (program, disk, artifact) and verb/noun pairs (licence/license, practise/practice).
extends: substitution
message: "Use Australian English '%s' instead of '%s'."
level: warning
ignorecase: true
action:
name: replace
# Exact-case exceptions for HTTP headers and Go method names.
exceptions:
- Authorize
- Authorization
swap:
analyze: analyse
analyzed: analysed
analyzes: analyses
analyzing: analysing
authorization: authorisation
authorizations: authorisations
authorize: authorise
authorized: authorised
authorizes: authorises
authorizing: authorising
behavior: behaviour
behavioral: behavioural
behaviors: behaviours
canceled: cancelled
canceling: cancelling
canonicalize: canonicalise
canonicalized: canonicalised
canonicalizes: canonicalises
canonicalizing: canonicalising
catalog: catalogue
cataloged: catalogued
cataloging: cataloguing
catalogs: catalogues
categorization: categorisation
categorize: categorise
categorized: categorised
categorizes: categorises
categorizing: categorising
center: centre
centered: centred
centering: centring
centers: centres
color: colour
colored: coloured
coloring: colouring
colors: colours
customization: customisation
customize: customise
customized: customised
customizes: customises
customizing: customising
favor: favour
favored: favoured
favoring: favouring
favorite: favourite
favorites: favourites
favors: favours
finalize: finalise
finalized: finalised
finalizes: finalises
finalizing: finalising
fulfill: fulfil
fulfillment: fulfilment
fulfills: fulfils
initialization: initialisation
initialize: initialise
initialized: initialised
initializes: initialises
initializing: initialising
judgment: judgement
judgments: judgements
labeled: labelled
labeling: labelling
maximize: maximise
maximized: maximised
maximizes: maximises
maximizing: maximising
minimize: minimise
minimized: minimised
minimizes: minimises
minimizing: minimising
modeled: modelled
modeling: modelling
normalization: normalisation
normalize: normalise
normalized: normalised
normalizes: normalises
normalizing: normalising
optimization: optimisation
optimizations: optimisations
optimize: optimise
optimized: optimised
optimizes: optimises
optimizing: optimising
organization: organisation
organizational: organisational
organizations: organisations
organize: organise
organized: organised
organizes: organises
organizing: organising
parameterize: parameterise
parameterized: parameterised
parameterizes: parameterises
parameterizing: parameterising
prioritize: prioritise
prioritized: prioritised
prioritizes: prioritises
prioritizing: prioritising
recognize: recognise
recognized: recognised
recognizes: recognises
recognizing: recognising
sanitization: sanitisation
sanitize: sanitise
sanitized: sanitised
sanitizes: sanitises
sanitizing: sanitising
serialization: serialisation
serialize: serialise
serialized: serialised
serializes: serialises
serializing: serialising
stabilize: stabilise
stabilized: stabilised
stabilizes: stabilises
stabilizing: stabilising
summarize: summarise
summarized: summarised
summarizes: summarises
summarizing: summarising
synchronization: synchronisation
synchronize: synchronise
synchronized: synchronised
synchronizes: synchronises
synchronizing: synchronising
unauthorized: unauthorised
tests:
- name: flags US spelling
input: |
The organization enforces authorization behavior.
want: |
1:5:Archie.AustralianEnglish:Use Australian English 'organisation' instead of 'organization'.
1:27:Archie.AustralianEnglish:Use Australian English 'authorisation' instead of 'authorization'.
1:41:Archie.AustralianEnglish:Use Australian English 'behaviour' instead of 'behavior'.
- name: accepts Australian spelling and inline code
input: |
The organisation enforces authorisation behaviour via `behavior_flag`.
want: ""
-7
View File
@@ -1,7 +0,0 @@
extends: existence
message: "No em dashes. Use a comma, brackets, a colon, or a second sentence."
level: error
nonword: true
scope: raw
tokens:
- '\u2014'
@@ -1,29 +0,0 @@
# AGENTS.md: "Comments explain why, not what the code already says.
# No migration history, phase names or issue narration in code."
extends: existence
message: "Avoid migration or plan narration ('%s') in code comments. Explain what the code does or why."
level: warning
scope: comment.go
ignorecase: true
nonword: true
tokens:
- '\b(?:phase|wave|slice|sprint)\s+\d+\b'
- '\bepic\s+#\d+\b'
- '\b(?:formerly|previously)\s+(?:called|named|known as)\b'
- '\b(?:migrated|moved|extracted|ported)\s+from\b'
tests:
- name: flags migration narration in Go comments
format: go
input: |
// Phase 2 moved from internal/legacy.
package demo
want: |
1:4:Archie.NoMigrationNarration:Avoid migration or plan narration ('Phase 2') in code comments. Explain what the code does or why.
1:12:Archie.NoMigrationNarration:Avoid migration or plan narration ('moved from') in code comments. Explain what the code does or why.
- name: allows normal rationale comments
format: go
input: |
// Verify the HMAC before parsing so malformed payloads cannot trigger work.
package demo
want: ""
-21
View File
@@ -1,21 +0,0 @@
# Calibrated for developer documentation: crisp technical docs with domain
# terminology typically score 8-11 on Flesch-Kincaid; higher scores usually
# signal dense paragraphs that benefit from simpler structure.
extends: metric
message: "Try to keep the Flesch-Kincaid grade level (%s) at or below 11."
link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
level: warning
formula: |
(0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59
condition: "> 11"
tests:
- name: flags dense technical prose
input: |
Notwithstanding architectural encapsulation prerequisites, interdepartmental orchestration mechanisms necessitate comprehensive deterministic authentication verification across heterogeneous distributed administrative infrastructures.
want: |
1:1:Archie.Readability:Try to keep the Flesch-Kincaid grade level (42.40) at or below 11.
- name: accepts clear technical prose
input: |
A source receives events and checks their HMAC signature. A mapping extracts named fields from the payload. A binding selects the workflow to run.
want: ""
-17
View File
@@ -1,17 +0,0 @@
# Flag overly long sentences in documentation. Set to 35 words so precise
# technical constraints fit comfortably while runaway sentences are caught.
extends: Std.Readability.SentenceLength
message: "This sentence has %d words. Consider splitting it for readability."
level: warning
max: 35
tests:
- name: flags long sentence
input: |
When the daemon starts a new workflow run for an incoming event that matched a signed binding, it loads the published workflow definition from storage, allocates an isolated container workspace, prepares task-scoped credentials, and dispatches the first step immediately without waiting.
want: |
1:1:Archie.SentenceLength:This sentence has 42 words. Consider splitting it for readability.
- name: accepts concise technical sentences
input: |
The daemon loads the published workflow definition and allocates an isolated container workspace. It prepares task-scoped credentials before dispatching the first step.
want: ""
-22
View File
@@ -1,22 +0,0 @@
# Microsoft Writing Style Guide: "Don't include the type of UI element, such as
# button or checkbox, unless including it adds needed clarity."
extends: existence
message: "Omit the UI element type after a bold label ('%s') unless it adds clarity."
link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui
level: warning
scope: raw
nonword: true
tokens:
- '\*\*[^*\n]{1,40}\*\*\s+(?:button|checkbox|check box|dropdown|drop-down|field|icon|link|menu|option|switch|tab|toggle)\b'
tests:
- name: flags bold label followed by UI element type
input: |
Select the **Save** button and leave the **Shared secret** field blank.
want: |
1:12:Archie.UIElementType:Omit the UI element type after a bold label ('**Save** button') unless it adds clarity.
1:42:Archie.UIElementType:Omit the UI element type after a bold label ('**Shared secret** field') unless it adds clarity.
- name: allows bold UI label without element type
input: |
Select **Save** and leave **Shared secret** blank.
want: ""
-46
View File
@@ -1,46 +0,0 @@
# Input-neutral UI interaction verbs complementing Microsoft.UIVerbs.
# Based on Microsoft Writing Style Guide: Describing interactions with UI.
extends: substitution
message: "Use the input-neutral UI verb '%s' instead of '%s'."
link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui
level: warning
ignorecase: true
action:
name: replace
swap:
deselect: clear
deselected: cleared
deselecting: clearing
deselects: clears
drag and drop: drag
drag-and-drop: drag
key in: enter
keyed in: entered
keying in: entering
mouse over: hover over
moused over: hovered over
mousing over: hovering over
navigate to: go to
navigated to: went to
navigating to: going to
press and hold: select and hold
tap and hold: select and hold
tap on: select
tapped on: selected
tapping on: selecting
uncheck: clear
unchecking: clearing
unchecks: clears
tests:
- name: flags input-specific UI verbs
input: |
Navigate to Settings, uncheck Auto-save, and mouse over the badge.
want: |
1:1:Archie.UIInteractions:Use the input-neutral UI verb 'go to' instead of 'Navigate to'.
1:23:Archie.UIInteractions:Use the input-neutral UI verb 'clear' instead of 'uncheck'.
1:46:Archie.UIInteractions:Use the input-neutral UI verb 'hover over' instead of 'mouse over'.
- name: accepts input-neutral UI verbs
input: |
Go to Settings, clear Auto-save, and hover over the badge.
want: ""
-26
View File
@@ -1,26 +0,0 @@
# Microsoft Writing Style Guide:
# - Use bold formatting for UI element names, not quotation marks.
# - Omit trailing colons or ellipses from UI labels in instructions.
extends: existence
message: "Format UI labels in bold without quotes or trailing punctuation ('%s')."
link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui
level: warning
scope: raw
ignorecase: true
nonword: true
tokens:
- '\b(?:select|choose|open|clear|go to|hover over)\s+"[^"\n]{1,40}"'
- '\b(?:select|choose|open|clear|go to|hover over)\s+\*\*[^*\n]{1,40}(?::|\.{3}|…)\*\*'
tests:
- name: flags quoted UI labels and trailing punctuation
input: |
Select "Save" or choose **Export...** and open **Settings:**.
want: |
1:1:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('Select "Save"').
1:18:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('choose **Export...**').
1:43:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('open **Settings:**').
- name: accepts clean bold UI labels
input: |
Select **Save**, choose **Export**, and open **Settings**.
want: ""
-44
View File
@@ -1,44 +0,0 @@
# Prefer concise wording over wordy phrases.
extends: substitution
message: "Use '%s' instead of '%s'."
level: warning
ignorecase: true
action:
name: replace
swap:
a large number of: many
a majority of: most
a sufficient number of: enough
as a means of: to
at this point in time: now
due to the fact that: because
for the purpose of: to
has the capability to: can
in close proximity to: near
in excess of: more than
in spite of the fact that: although
in the event that: if
in the near future: soon
make use of: use
on a daily basis: daily
on a monthly basis: monthly
on a weekly basis: weekly
prior to: before
subsequent to: after
take advantage of: use
until such time as: until
whether or not: whether
with regard to: about
with respect to: about
tests:
- name: flags wordy phrases
input: |
Check the signature prior to parsing due to the fact that payloads are untrusted.
want: |
1:21:Archie.Wordiness:Use 'before' instead of 'prior to'.
1:38:Archie.Wordiness:Use 'because' instead of 'due to the fact that'.
- name: accepts concise wording
input: |
Check the signature before parsing because payloads are untrusted.
want: ""
@@ -1,32 +0,0 @@
# Case-insensitive common terms (matched in any capitalisation)
(?i)approvers?
(?i)archipelago
(?i)canonicalis(?:e[ds]?|ing)
(?i)carina
(?i)confirmers?
(?i)fulfilment
(?i)glassmorphism
(?i)passkeys?
(?i)reapprovals?
(?i)redemptions?
(?i)retags?
(?i)undispatched
(?i)unpushed
(?i)wordmarks?
(?i)worktrees?
# Proper nouns, tools, and exact-case technical terms
archied
Catlow
depguard
gosec
govulncheck
hclog
Huma
Miessler
Pdeathsig
prbench
Reka
releaseupdate
secretengine
sqlc
+67
View File
@@ -0,0 +1,67 @@
# Canary judge: check the release the canary is running, then promote it, pick
# up a newer `next`, or roll it back. Every fifteen minutes, and on demand.
#
# Requires repo secrets canary_url, canary_token and deploy_token (the registry
# credentials the `-latest` re-tagging needs). canary_window is optional.
# Shell-side references are written $$name (see the note in deploy.yaml).
#
# Written to fail loudly when canary_url is missing: the schedule only exists
# because the maintainer asked for one, so a canary nobody configured is a
# misconfiguration, not a quiet skip.
when:
- event: [cron]
- event: [manual]
# A judging run takes longer than the interval when the canary is unhealthy;
# overlapping runs would judge the same release twice.
concurrency: 1
clone:
git:
image: woodpeckerci/plugin-git:2.8.0
settings:
# A rollback compares the migrations between two release tags, so the
# checkout needs the tags and the trees behind them.
tags: true
partial: false
steps:
- name: judge
image: docker:29-cli
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
DOCKER_HOST: unix:///var/run/docker.sock
CANARY_URL:
from_secret: canary_url
CANARY_WINDOW:
from_secret: canary_window
ARCHIE_CANARY_TOKEN:
from_secret: canary_token
DEPLOY_TOKEN:
from_secret: deploy_token
commands:
- '[ -n "$$CANARY_URL" ] || { echo "repo secret canary_url is not set, so there is no canary to judge"; exit 1; }'
- '[ -n "$$ARCHIE_CANARY_TOKEN" ] || { echo "repo secret canary_token is not set, so the canary cannot be reached"; exit 1; }'
- '[ -n "$$DEPLOY_TOKEN" ] || { echo "repo secret deploy_token is not set, so the registry cannot be tagged"; exit 1; }'
- apk add --no-cache git
# archied reads the registry credentials this login writes.
- printf '%s' "$$DEPLOY_TOKEN" | docker login git.catlow.cloud -u "$$CI_REPO_OWNER" --password-stdin
# The deploy pipeline already built this binary. edge is the newest main
# that passed the gate.
- |
set -eu
image=git.catlow.cloud/sam/archied:edge
docker pull -q "$$image"
container=$(docker create "$$image")
docker cp "$$container:/usr/local/bin/archied" /tmp/archied
docker rm "$$container" >/dev/null
- |
set -eu
set --
if [ -n "$$CANARY_WINDOW" ]; then
set -- -window "$$CANARY_WINDOW"
fi
/tmp/archied release canary check -dashboard "$$CANARY_URL" "$$@" \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
+337
View File
@@ -0,0 +1,337 @@
# Publish pipeline: a push to main builds the edge images, a v* tag also cuts a
# signed release. The release workflow pushes main and the tag in one command,
# so both events are delivered for the same commit; `plan` decides which
# pipeline does the work and the other one skips.
#
# Requires repo secrets: deploy_token (pushes images, publishes the Gitea
# release, links the packages) and release_signing_key (the ed25519 seed the
# release statement is signed with). canary_url and canary_token are optional;
# without them the canary install is skipped.
#
# Every shell-side reference is written $$name, which arrives at the shell as
# $name. Woodpecker rewrites only the braced form: ${name} is substituted before
# the shell runs, and an operator inside it is dropped, so ${version:-none}
# becomes empty instead of defaulting. The escaped form is used everywhere so the
# rule is mechanical rather than a judgement per line.
when:
- event: push
branch: [main]
- event: tag
ref: refs/tags/v*
# Two deployments at once would race on the released tags and on `latest`.
concurrency: 1
variables:
# Only the gate builds the dashboard and the release binaries; later steps
# reuse what it left in the workspace. The Node digest and the pnpm version
# are pinned here.
- &node-setup |
set -eu
apt-get update -qq
# jq reads release.json for `task dist`.
apt-get install -y -qq --no-install-recommends xz-utils jq
curl -fsSL -o /tmp/node.tar.xz https://nodejs.org/dist/v24.22.2/node-v24.22.2-linux-x64.tar.xz
echo "48cc0e21e048790e54c0cf5749c2725005313d652651c40b7a21feb9697aaf75 /tmp/node.tar.xz" | sha256sum -c -
tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1
# pnpm's version belongs to the lockfile; installing any other one makes
# `pnpm install --frozen-lockfile` reject the tree.
npm install -g "pnpm@$(node -p 'require("./ui/package.json").packageManager.split("@")[1]')"
clone:
git:
image: woodpeckerci/plugin-git:2.8.0
settings:
# A tag pipeline must see the tag it is building, and a branch pipeline
# must see a tag pointing at HEAD to know the tag pipeline owns it.
tags: true
fetch_target_branch: true
steps:
- name: plan
image: alpine:3
commands:
- apk add --no-cache git
- |
set -eu
# An annotated tag makes CI_COMMIT_SHA the tag object, so the commit is
# resolved from the ref: image tags and the release statement pin it.
sha=$(git rev-parse "$$CI_COMMIT_REF^{commit}")
version=$(git tag --points-at HEAD --list 'v*' | sed -e 's|^v||' | sort -V | tail -1)
run=true
case "$$CI_PIPELINE_EVENT" in
tag) ;;
*) [ -z "$$version" ] || run=false ;;
esac
{
echo "COMMIT_SHA=$$sha"
echo "RELEASE_VERSION=$$version"
echo "RUN=$$run"
} > "$$CI_WORKSPACE/.git/ci-plan.env"
echo "commit $$sha, release $${version:-none}, run $$run"
- name: gate
image: golang:1.27.3-bookworm
depends_on: [plan]
# The full test suite starts containers. It drives the host daemon through
# the Go client, so the socket is enough - this step needs no docker CLI.
# The one test that needs the daemon binds a temporary directory into the
# container it starts, so that directory has to exist at the same path on
# the host; TMPDIR points the test at it.
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/tmp/woodpecker-archie-gate:/var/tmp/woodpecker-archie-gate
# Module, build and lint caches outlive the step's container; without
# them every pipeline downloads and compiles everything from nothing.
- /var/cache/woodpecker-archie:/cache
environment:
DOCKER_HOST: unix:///var/run/docker.sock
TMPDIR: /var/tmp/woodpecker-archie-gate
GOCACHE: /cache/go-build
GOMODCACHE: /cache/go-mod
GOLANGCI_LINT_CACHE: /cache/golangci-lint
commands:
- '. "$$CI_WORKSPACE/.git/ci-plan.env"'
- '[ "$$RUN" = true ] || { echo "a release tag owns this commit; the tag pipeline publishes it"; exit 0; }'
- go install github.com/go-task/task/v3/cmd/task@v3.48.0
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(cat .golangci-version)
- go install mvdan.cc/gofumpt@v0.11.0
- bash tools/proto.sh install
- *node-setup
- |
set -eu
if ! git show-ref --verify --quiet refs/heads/main; then
if git rev-parse --verify --quiet origin/main >/dev/null; then
git branch main origin/main
else
# A tag pipeline clones the tag alone. HEAD is the released commit,
# which was on main, so the contract baseline is that same tree.
echo "no origin/main in this clone; using the released commit as the contract baseline"
git branch main HEAD
fi
fi
# A release also builds the binaries it ships, in the same task run: the
# dashboard is built once and the tree that passed is the tree that is
# published. dist/ stays in the workspace for the steps below.
- |
set -eu
if [ -n "$$RELEASE_VERSION" ]; then
task check dist TEST_FLAGS=-count=1 VERSION="$$RELEASE_VERSION"
else
task check TEST_FLAGS=-count=1
fi
- git diff --exit-code
- go install golang.org/x/vuln/cmd/govulncheck@v1.9.0
- govulncheck ./...
- |
set -eu
fail=0
for tag in $(git tag --points-at HEAD); do
case "$$tag" in
v*)
ver=$(echo "$$tag" | sed -e 's|^v||')
echo " release tag $$tag -> looking for [$$ver] in CHANGELOG.md"
grep -q "^## \[$$ver\]" CHANGELOG.md || {
echo " FAIL: CHANGELOG.md has no [$$ver] section"
fail=1
}
;;
esac
done
if [ $$fail -ne 0 ]; then
echo
echo "A release tag points at this commit but its changelog does not"
echo "describe that version. Cut releases with the release workflow."
exit 1
fi
if ! git tag --points-at HEAD | grep -qE '^v[0-9]'; then
echo "This commit isn't a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest promoted release."
fi
- name: archied-image
image: docker:29-cli
depends_on: [gate]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
DOCKER_HOST: unix:///var/run/docker.sock
DEPLOY_TOKEN:
from_secret: deploy_token
commands:
- '. "$$CI_WORKSPACE/.git/ci-plan.env"'
- '[ "$$RUN" = true ] || { echo "skipped: the tag pipeline publishes this commit"; exit 0; }'
- '[ -n "$$DEPLOY_TOKEN" ] || { echo "repo secret deploy_token is not set"; exit 1; }'
- printf '%s' "$$DEPLOY_TOKEN" | docker login git.catlow.cloud -u "$$CI_REPO_OWNER" --password-stdin
- |
set -eu
# A release reports its version; anything else is a build of main and
# says so, so a running binary can always name its commit.
if [ -n "$$RELEASE_VERSION" ]; then
component=$$RELEASE_VERSION
else
component="dev+$(echo "$$COMMIT_SHA" | cut -c1-12)"
fi
set -- \
--tag "git.catlow.cloud/sam/archied:edge" \
--tag "git.catlow.cloud/sam/archied:sha-$$COMMIT_SHA"
if [ -n "$$RELEASE_VERSION" ]; then
set -- "$$@" --tag "git.catlow.cloud/sam/archied:v$$RELEASE_VERSION"
fi
# No cache flags: the agent's daemon keeps its layer cache between
# pipelines, which is what type=gha bought on ephemeral runners.
docker buildx build --push --file Dockerfile.archied \
--build-arg GATEWAY_VERSION="$$component" \
--build-arg RUNTIME_VERSION="$$component" \
--provenance=false \
"$$@" .
- name: agent-image
image: docker:29-cli
depends_on: [gate]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
DOCKER_HOST: unix:///var/run/docker.sock
DEPLOY_TOKEN:
from_secret: deploy_token
commands:
- '. "$$CI_WORKSPACE/.git/ci-plan.env"'
- '[ "$$RUN" = true ] || { echo "skipped: the tag pipeline publishes this commit"; exit 0; }'
- '[ -n "$$RELEASE_VERSION" ] || { echo "not a release; the agent image is only published with a release"; exit 0; }'
- '[ -n "$$DEPLOY_TOKEN" ] || { echo "repo secret deploy_token is not set"; exit 1; }'
- printf '%s' "$$DEPLOY_TOKEN" | docker login git.catlow.cloud -u "$$CI_REPO_OWNER" --password-stdin
- |
set -eu
apk add --no-cache jq
docker buildx build --push --file Dockerfile \
--build-arg RUNTIME_VERSION="$$RELEASE_VERSION" \
--tag "git.catlow.cloud/sam/archie-agent:v$$RELEASE_VERSION" \
--tag "git.catlow.cloud/sam/archie-agent:sha-$$COMMIT_SHA" \
--provenance=false \
--metadata-file "$$CI_WORKSPACE/.git/agent-image.json" \
.
# The release statement pins the agent image by digest, so the digest is
# what the distribution records, not the tag.
jq -er '."containerimage.digest"' "$$CI_WORKSPACE/.git/agent-image.json" \
> "$$CI_WORKSPACE/.git/agent-image.digest"
echo "agent image $(cat "$$CI_WORKSPACE/.git/agent-image.digest")"
- name: dist
image: golang:1.27.3-bookworm
depends_on: [archied-image, agent-image]
commands:
- '. "$$CI_WORKSPACE/.git/ci-plan.env"'
- '[ "$$RUN" = true ] || { echo "skipped: the tag pipeline publishes this commit"; exit 0; }'
- '[ -n "$$RELEASE_VERSION" ] || { echo "not a release; no distribution to build"; exit 0; }'
- apt-get update -qq
- apt-get install -y -qq --no-install-recommends jq zip
# The gate built dist/ from the tree it checked; this only packages it.
- |
set -eu
cmds=$(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json)
name="archie-core-archied-v$$RELEASE_VERSION-linux-amd64"
mkdir -p "$$name"
for cmd in $$cmds; do
cp "dist/$$cmd" "$$name/"
done
cp deployments/INSTRUCTIONS.md CHANGELOG.md "$$name/"
if [ -f README.md ]; then cp README.md "$$name/"; fi
digest=$(cat "$$CI_WORKSPACE/.git/agent-image.digest")
test -n "$$digest"
jq --arg image "git.catlow.cloud/sam/archie-agent@$$digest" '. + {agent_image: $$image}' \
release.json > "$$name/release.json"
zip -qr "$$name.zip" "$$name"
echo "RELEASE_ZIP=$$name.zip" >> "$$CI_WORKSPACE/.git/ci-plan.env"
echo "built $$name.zip"
- name: publish
image: golang:1.27.3-bookworm
depends_on: [dist]
environment:
DEPLOY_TOKEN:
from_secret: deploy_token
ARCHIE_RELEASE_SEED:
from_secret: release_signing_key
commands:
- '. "$$CI_WORKSPACE/.git/ci-plan.env"'
- '[ "$$RUN" = true ] || { echo "skipped: the tag pipeline publishes this commit"; exit 0; }'
- '[ -n "$$RELEASE_VERSION" ] || { echo "not a release; nothing to publish"; exit 0; }'
- '[ -n "$$ARCHIE_RELEASE_SEED" ] || { echo "repo secret release_signing_key is not set"; exit 1; }'
# archied pushes the release artifact with oras, which reads the registry
# credentials a docker login would have written.
- |
set -eu
mkdir -p "$$HOME/.docker"
auth=$(printf '%s:%s' "$$CI_REPO_OWNER" "$$DEPLOY_TOKEN" | base64 -w0)
printf '{"auths":{"git.catlow.cloud":{"auth":"%s"}}}\n' "$$auth" > "$$HOME/.docker/config.json"
- |
set -eu
prerelease=false
case "$$RELEASE_VERSION" in *-*) prerelease=true ;; esac
digest=$(cat "$$CI_WORKSPACE/.git/agent-image.digest")
./dist/archied release publish -source git.catlow.cloud/sam/archie \
-version "$$RELEASE_VERSION" -prerelease="$$prerelease" \
-zip "$$RELEASE_ZIP" \
-agent-image "git.catlow.cloud/sam/archie-agent@$$digest" \
-changelog "https://git.catlow.cloud/sam/archie/releases/tag/v$$RELEASE_VERSION"
- name: notes
image: golang:1.27.3-bookworm
depends_on: [publish]
environment:
DEPLOY_TOKEN:
from_secret: deploy_token
commands:
- '. "$$CI_WORKSPACE/.git/ci-plan.env"'
- '[ "$$RUN" = true ] || { echo "skipped: the tag pipeline publishes this commit"; exit 0; }'
- '[ -n "$$RELEASE_VERSION" ] || { echo "not a release; no notes to publish"; exit 0; }'
- '[ -n "$$DEPLOY_TOKEN" ] || { echo "repo secret deploy_token is not set"; exit 1; }'
- apt-get update -qq
- apt-get install -y -qq --no-install-recommends jq
- |
set -eu
tag="v$$RELEASE_VERSION"
prerelease=false
case "$$RELEASE_VERSION" in *-*) prerelease=true ;; esac
notes=$(mktemp)
awk -v hdr="## [$$RELEASE_VERSION]" '
index($$0, hdr) == 1 { printing = 1 }
printing && /^## \[/ && index($$0, hdr) != 1 { exit }
printing { print }
' CHANGELOG.md > "$$notes"
if ! [ -s "$$notes" ]; then
echo "no [$$RELEASE_VERSION] section extracted from CHANGELOG.md" >&2
exit 1
fi
api=https://git.catlow.cloud/api/v1
repo=sam/archie
auth="Authorization: token $$DEPLOY_TOKEN"
curl -sf -X DELETE -H "$$auth" "$$api/repos/$$repo/releases/tags/$$tag" >/dev/null || true
curl -sf -X POST -H "$$auth" -H "Content-Type: application/json" \
-d "$(jq -n --arg tag "$$tag" --arg name "Archie v$$RELEASE_VERSION" --arg body "$(cat "$$notes")" \
--argjson prerelease "$$prerelease" \
'{tag_name: $$tag, name: $$name, body: $$body, draft: false, prerelease: $$prerelease}')" \
"$$api/repos/$$repo/releases" >/dev/null
echo "published release notes for $$tag"
# The packages exist under this repository's namespace but are not
# linked to it, so the package pages stay empty until this runs.
for name in archied archie-agent archie; do
curl -sS -o /dev/null -X POST -H "$$auth" \
"$$api/packages/sam/container/$$name/-/link/archie" || true
done
- name: canary
image: golang:1.27.3-bookworm
depends_on: [publish]
environment:
CANARY_URL:
from_secret: canary_url
ARCHIE_CANARY_TOKEN:
from_secret: canary_token
commands:
- '. "$$CI_WORKSPACE/.git/ci-plan.env"'
- '[ "$$RUN" = true ] || { echo "skipped: the tag pipeline publishes this commit"; exit 0; }'
- '[ -n "$$RELEASE_VERSION" ] || { echo "not a release; nothing to install on the canary"; exit 0; }'
- '[ -n "$$CANARY_URL" ] || { echo "canary_url is not set; skipping the canary install"; exit 0; }'
- ./dist/archied release canary start -dashboard "$$CANARY_URL" -version "$$RELEASE_VERSION"
+50
View File
@@ -0,0 +1,50 @@
# Manual promotion: move stable to the release the canary is running, without
# waiting for its verdict. Same rules as the canary's own promotion, minus the
# window.
#
# Start it with the pipeline variable VERSION set to the release the canary
# runs (woodpecker-cli pipeline create --branch main --var VERSION=1.57.0).
#
# Requires repo secrets canary_url, canary_token and deploy_token.
when:
- event: [manual]
concurrency: 1
# Promotion reads the canary and the registry, never the repository.
skip_clone: true
steps:
- name: promote
image: docker:29-cli
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
DOCKER_HOST: unix:///var/run/docker.sock
CANARY_URL:
from_secret: canary_url
ARCHIE_CANARY_TOKEN:
from_secret: canary_token
DEPLOY_TOKEN:
from_secret: deploy_token
commands:
- '[ -n "$$VERSION" ] || { echo "VERSION is empty: start this workflow with the pipeline variable VERSION=<release the canary runs>"; exit 1; }'
- '[ -n "$$CANARY_URL" ] || { echo "repo secret canary_url is not set, so there is no canary to read"; exit 1; }'
- '[ -n "$$ARCHIE_CANARY_TOKEN" ] || { echo "repo secret canary_token is not set, so the canary cannot be reached"; exit 1; }'
- '[ -n "$$DEPLOY_TOKEN" ] || { echo "repo secret deploy_token is not set, so the registry cannot be tagged"; exit 1; }'
# archied reads the registry credentials this login writes.
- printf '%s' "$$DEPLOY_TOKEN" | docker login git.catlow.cloud -u "$$CI_REPO_OWNER" --password-stdin
# The deploy pipeline already built this binary. edge is the newest main
# that passed the gate.
- |
set -eu
image=git.catlow.cloud/sam/archied:edge
docker pull -q "$$image"
container=$(docker create "$$image")
docker cp "$$container:/usr/local/bin/archied" /tmp/archied
docker rm "$$container" >/dev/null
- >-
/tmp/archied release canary promote -dashboard "$$CANARY_URL"
-version "$$VERSION"
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
+69
View File
@@ -0,0 +1,69 @@
# Pull-request gate: the same `task check` the maintainer runs locally.
#
# One step, not one step per check: `task check` installs task, golangci-lint,
# gofumpt, buf and sqlc into the container it runs in, and a second step starts
# from an empty container and pays for that again.
when:
- event: [pull_request]
clone:
git:
image: woodpeckerci/plugin-git:2.8.0
settings:
# The gate compares the contracts against main and reads the release tags
# for the version a build reports, so a partial clone will not do.
tags: true
# A pull-request pipeline otherwise clones only the pull request's own
# ref, leaving no main for the contract baseline to compare against.
fetch_target_branch: true
steps:
- name: check
image: golang:1.27.3-bookworm
# Module, build and lint caches outlive the step's container. Pull requests
# get their own directory so they cannot write into the cache a release
# build reads.
volumes:
- /var/cache/woodpecker-archie-pr:/cache
environment:
GOCACHE: /cache/go-build
GOMODCACHE: /cache/go-mod
GOLANGCI_LINT_CACHE: /cache/golangci-lint
commands:
- go install github.com/go-task/task/v3/cmd/task@v3.48.0
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(cat .golangci-version)
- go install mvdan.cc/gofumpt@v0.11.0
- bash tools/proto.sh install
# The gate builds and tests the dashboard, so Node and pnpm sit next to
# Go. Pinned tarball verified by digest, not a third-party setup script:
# the gate must not change under the repository.
- |
set -eu
apt-get update -qq
apt-get install -y -qq --no-install-recommends xz-utils
curl -fsSL -o /tmp/node.tar.xz https://nodejs.org/dist/v24.22.2/node-v24.22.2-linux-x64.tar.xz
echo "48cc0e21e048790e54c0cf5749c2725005313d652651c40b7a21feb9697aaf75 /tmp/node.tar.xz" | sha256sum -c -
tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1
# pnpm's version belongs to the lockfile; installing any other one makes
# `pnpm install --frozen-lockfile` reject the tree.
npm install -g "pnpm@$(node -p 'require("./ui/package.json").packageManager.split("@")[1]')"
node --version
pnpm --version
- |
set -eu
# The contract baseline is a local main. plugin-git fetches with an explicit
# refspec, so it creates no remote-tracking branch itself; only the target
# branch fetch above does, which is why this fails rather than comparing
# the pull request against its own tree.
if ! git show-ref --verify --quiet refs/heads/main; then
if ! git rev-parse --verify --quiet origin/main >/dev/null; then
echo "no main in this clone, so the contracts cannot be compared against a baseline" >&2
exit 1
fi
git branch main origin/main
fi
- task --concurrency 1 check
# The gate rewrites the tree (fmt, generated contracts and queries); a
# rewrite the author did not commit is a failure, not a side effect.
- git diff --exit-code
+53
View File
@@ -0,0 +1,53 @@
# Manual release: turn [Unreleased] in CHANGELOG.md into a release commit, tag
# it, and push main and the tag in one command. The deploy pipeline publishes
# what this pushes, so this workflow commits and tags but never builds.
#
# Start it with the pipeline variable RELEASE=minor (or major, patch, or an
# exact 1.2.3): woodpecker-cli pipeline create --branch main --var RELEASE=minor
# sam/archie, or the same variable in the web UI's pipeline dialog.
#
# Shell-side references are written $$name (see the note in deploy.yaml).
#
# Requires repo secret deploy_token, a token that may push to main and to tags.
when:
- event: [manual]
# Two releases at once would read the same last tag and try to write it twice.
concurrency: 1
clone:
git:
image: woodpeckerci/plugin-git:2.8.0
settings:
# `task release` derives the next version from the release tags.
tags: true
fetch_target_branch: true
steps:
- name: cut
image: golang:1.27.3-bookworm
environment:
DEPLOY_TOKEN:
from_secret: deploy_token
commands:
- '[ -n "$$RELEASE" ] || { echo "RELEASE is empty: start this workflow with the pipeline variable RELEASE=major|minor|patch|x.y.z"; exit 1; }'
- '[ -n "$$DEPLOY_TOKEN" ] || { echo "repo secret deploy_token is not set, so the release cannot push its commit and tag"; exit 1; }'
- go install github.com/go-task/task/v3/cmd/task@v3.48.0
- git config user.name "Sam Catlow"
- git config user.email "sam@catlow.tech"
# `task release` only cuts from a branch named main, and the clone can
# leave HEAD detached at main's tip.
- git checkout -q -B main
- task release RELEASE="$$RELEASE"
- |
set -eu
tag=$(git describe --exact-match --match 'v*' HEAD)
# HEAD, not a local main: the clone checks out the fetched ref detached,
# so there is no branch to name. The release commit is a child of main,
# so this is the fast-forward an atomic push needs.
#
# Gitea authenticates a token in the password position and ignores the
# user name, so the token never has to be a real login.
git push --atomic "https://x-access-token:$$DEPLOY_TOKEN@git.catlow.cloud/sam/archie.git" HEAD:refs/heads/main "$$tag"
echo "released $$tag"
+2895
View File
File diff suppressed because it is too large. Load diff
+84 -142
View File
@@ -5,39 +5,21 @@ here changes a decision. If a rule stops changing decisions, delete it.
## What this is
**archie-core** is event-driven agentic automation. It matches an event (an
alert, a webhook, a schedule, a chat message, an issue) to a workflow. The
workflow runs an agent, and archie-core judges every action before it runs. The
result lands somewhere for review or action. A repository is an optional input
to a workflow, not the point of the product. A forge is one of many inputs or
outputs; core code never assumes one.
**archie-core** is event-driven agentic automation. An event (an issue, PR,
webhook, schedule, chat message) is matched to a workflow, the workflow runs an
agent or tool in an isolated container, and the result lands somewhere for
review or action. A repository is an optional input to a workflow, not the point
of the product. A forge is one of many inputs or outputs; core code never
assumes one.
## Layout
<temporary - remove on 2026-12-01> The goal until 1 December is a
production-ready archie-core, including the features the maintainer is still
adding. Speak up when a request competes with something more urgent: a bug that
loses work, a failure that shows nothing, a security gap, a broken setup path.
Give the trade-off in a sentence or two and suggest whether the request belongs
in the backlog. Don't hold work back on your own judgement. </temporary>
Main is becoming one binary, `archie`. The design is ARCHITECTURE.md in the
private sam/archie-product repo, and the work is epic #1977. New work goes
there:
- `cmd/archie` parses flags and calls `internal/app/archie`, the composition
root.
- Each module is `modules/<name>/`: an API package and an `internal/` directory
nothing outside the module can import. Modules reach each other only through
API packages, own their schema and tables, and keep no state only in memory.
- `internal/platform/` holds the few leaf packages every module may use.
- The new code never imports the old services' packages (depguard enforces it).
Old code moves: `git mv` it into the module that owns it, then adapt it.
While an old service still imports it, copy it instead, name the source
path in the commit, and delete the old copy with its service.
MIGRATION.md in sam/archie-product gives every old package a destination and
a verdict. Writing a replacement from scratch, or deleting an old package,
needs the maintainer's verdict on its row. Before building anything an old
package already does, read that package and carry its behaviour.
### The services the binary replaces
Delete the six services below slice by slice as the binary replaces them,
each only once MIGRATION.md has a verdict for every package it holds. Don't
add features to them; fix them only when a bug blocks work.
## Services and layout
Each service is a gRPC contract in `proto/<service>/v1`, generated into
`internal/contracts/<service>/v1`, and one binary in `cmd/` that parses flags
@@ -45,25 +27,16 @@ and calls its composition root in `internal/app/<service>`.
| Binary | Serves | Dials |
| --- | --- | --- |
| `archie-state-store` | State Store and Control Plane contracts; owns the task and control-plane tables | PostgreSQL |
| `archie-gateway` | Chat contract; owns the conversation tables | State Store, PostgreSQL |
| `archied` | Daemon contract; scheduling, workflow runs, task containers | State Store, Gateway, Messaging, NATS |
| `archie-messaging` | Messaging contract; external channel frontends | State Store, Gateway |
| `archie-ui` | Dashboard HTTP API (`internal/webui`) and the embedded SPA | State Store, Gateway, Daemon, Messaging |
| `archie-state-store` | State Store and Control Plane contracts; owns the task and control-plane PostgreSQL tables | PostgreSQL |
| `archie-gateway` | Chat, conversation state, task tools | State Store |
| `archied` | Scheduling, workflow runs, harness, Daemon contract | State Store, Gateway, Messaging |
| `archie-messaging` | External channel frontends | Gateway |
| `archie-ui` | Dashboard HTTP API (`internal/webui`) and the embedded SPA | State Store, Gateway, daemon, harness |
| `archie-agent` | The worker inside each task container | NATS |
Forge, channel and secret-engine contracts are extension boundaries, not
services: a core binary starts the extension as a plugin process and dials it.
`archied` also runs the State Store's backup and restore during a host update.
`internal/domain` holds behaviour and interfaces; `internal/infrastructure`
implements them. Every instruction sent to a model is a file in
`internal/platform/prompts`, read through that package; never inline a prompt in
code. The old `internal/prompts` serves the services until they go.
The dashboard is its own repository, archie-frontend, and ships as its own
image; it reaches this backend only through `/api`, `/oauth2` and `/hooks`.
Workflow YAML and its step vocabulary
are in `WORKFLOWS.md`; the server catalogue is authoritative.
implements them. Dashboard work follows `ui/CLAUDE.md`. Workflow YAML and its
step vocabulary are in `WORKFLOWS.md`; the server catalogue is authoritative.
## Authority
@@ -72,7 +45,7 @@ When sources disagree, the higher one wins:
1. The maintainer's instruction in this session.
2. This file.
3. The code as it is in the tree.
4. GitHub issues (`gh issue view <n>`): the plan for a piece of work.
4. Gitea issues (`tea issues view <n>`): the plan for a piece of work.
5. Everything else (memories, comments, old docs) is a hint. Verify it against
the code before acting on it.
@@ -81,15 +54,9 @@ When sources disagree, the higher one wins:
- **A clear direction is the go-ahead.** Do it in the same turn. Do not restate
the plan, offer options, or ask "shall I proceed?". Stop only for destructive
or outward-facing actions (deleting data, pushing, touching a live host).
- **Push back when it matters.** If a request competes with something clearly
more urgent, or looks like the wrong call, say so once in a sentence or two.
A bug that loses work, a failure that shows nothing, a security gap and a
broken setup path are all more urgent. Suggest whether it belongs in the
backlog. Then do what the maintainer asked: don't repeat the point or hold
work back on your own judgement.
- **Post outside the repo only when told.** Chat, tickets and any external
service get a message only on the maintainer's instruction.
- **Report, don't narrate.** Final replies say what changed, what you verified,
- **Report, don't narrate.** Final replies say what changed, what was verified,
and anything blocked, in a few lines. No preamble, no recap of the request, no
closing offers of more help. Leave out what the maintainer can see or infer:
a clean tree, unpushed commits, a passing gate (commits imply it), and steps
@@ -98,31 +65,31 @@ When sources disagree, the higher one wins:
## How to decide
- **Broken comes first.** A bug that blocks or loses work goes ahead of new
features. Fix the cause. When that's a bigger job, unblock with a small change
first and file the proper fix rather than stopping there.
- **Cheapest option first.** Before building, consider the smallest change that
solves the problem, including changing configuration or deleting something.
A new mechanism (RPC, process, binary, abstraction, config field, tool) is
fine when it's the right design; say why the smaller option wasn't enough.
- **Broken beats new.** A bug that blocks work gets fixed now, with the smallest
change that unblocks it. No design docs and no new mechanism.
- **Cheapest option first.** Before building, name the smallest change that
solves the problem, including changing configuration or deleting something. If
your plan adds a new mechanism (RPC, process, binary, abstraction, config
field, tool) or grows past about 100 lines, stop and assess whether you're
taking the path of least resistance.
- **Delete before adding.** Unused code, dead paths, fallbacks nobody takes and
features nobody runs get removed, not maintained. Solo project, single user:
breaking changes need no compatibility shims.
- **Finish before starting.** Prefer completing a half-built feature end to end
over starting a new one.
- **Modules own their API and tables.** A module reaches another only through
its API package, never its tables or `internal/`. The only real process
boundaries are extensions and the runner. A new command is a subcommand of
`archie`.
- **Services own contracts.** A service is a gRPC contract in
`proto/<service>/v1` and one binary that serves it. Services reach each other
only through those contracts, never through another service's tables or
packages. A new command is a subcommand of an existing binary. A new binary
exists only for a new service or a real process boundary.
- **No compensating tools.** Do not write a linter, checker or generator to
enforce something a simpler design would make unnecessary. Fix the design.
- **A setting must work end to end.** A config field that parses but has no
consumer is a bug. Operators edit settings through the control plane (API and
dashboard), never through a server login.
consumer is a bug. Settings are edited through the control plane (API and
dashboard), never by requiring a server login.
- **Ask only for real decisions.** Product direction and trade-offs the
maintainer owns are questions. Anything with a conventional engineering
answer or an existing pattern in the codebase is not: decide, do it, say
what you chose.
maintainer owns are questions. Everything with a conventional answer is not:
decide, do it, say what you chose.
## Code
@@ -132,24 +99,14 @@ When sources disagree, the higher one wins:
- Dependencies point inward: `cmd → app → {domain, infrastructure}`,
`infrastructure` implements `domain` interfaces, `domain` imports neither.
`cmd/` parses flags and calls `app`, nothing else.
- Fix invalid state where the code produces it, not with checks where the
code consumes it.
- Fix invalid state where it is produced, not with checks where it is consumed.
- Log through the service's injected `*slog.Logger` with the `...Context`
methods, so lines carry the OpenTelemetry trace id. Never the global `slog`.
- If a fix fails twice, throw the block away and rewrite it simply.
- Comments explain why, not what the code already says. No migration
history, phase names or issue narration in code.
- Write natural, idiomatic technical English in comments, errors, logs,
test names, descriptions, prompts and user-facing text. Use conventional
terminology and normal word order. Avoid invented metaphors, awkward
possessives, inverted sentences and clever paraphrases. Prefer repeating
an established term over inventing a synonym.
- Regenerate generated files (protobuf, sqlc) and commit them with the change
that caused them; never hand-edit them.
- Foreign keys and attribution always reference immutable primary IDs, never
mutable or non-unique attributes (display names, slugs, emails). Store
display labels alongside an ID only when you need point-in-time snapshot
fidelity.
- Comments say why, briefly. No migration history, phase names or issue
narration in code.
- Generated files (protobuf, sqlc) are regenerated and committed
with the change that caused them, never hand-edited.
## Tests
@@ -164,65 +121,48 @@ The default for a change is no new test. Write one only when:
A test that exists must catch a real regression, survive refactoring, run fast,
and be cheap to keep. Never test wiring, constants, defaults, struct shapes,
fakes, or call order. Prefer making an invalid state unrepresentable to testing
that the code rejects it.
How to write one:
- **Prove it.** Run the new test against the code before the fix and see it
fail. A test that passes either way proves nothing: delete it. When you
can't reproduce a bug deterministically (a race, say), fix it with an API
that rules it out and don't add a test.
- **One table per behaviour.** Extend the table instead of adding a second test.
Name the test after the behaviour, and say in its comment what regression it
guards.
- **Same gate as production.** Tests pass golangci-lint, gosec included, with no
exclusions for test files. Fix what the linter finds. A fixture that has to
look like a secret (a key the redaction must catch, a URL with a password the
parser must reject) uses a plainly fake value and a `//nolint:gosec` saying
what it tests.
- **Isolated.** Use `t.TempDir()` and `t.Setenv`, never host state. A test that
commits with git sets `GIT_CONFIG_GLOBAL` to `os.DevNull`. No test opens a
real database or needs Docker: test SQL semantics at the interceptor or domain
level with fakes. Tests write files `0o600`, or `0o700` for a script.
- **Shared setup in helpers.** When several tests repeat the same setup, put it
in a helper in a `_test.go` file, never in production code.
fakes, or call order. No test opens a real database or needs Docker; test
SQL semantics at the interceptor or domain level with fakes. One table-driven test per behaviour; extend the table
instead of adding a second test. Prefer making an invalid state unrepresentable
to testing that it is rejected. Test helpers live in `_test.go` files only.
## Invariants
These protect users. Do not weaken them without the maintainer's say-so.
- A crash loses no accepted work, and a restart resumes every run. The service
that accepts the work acknowledges it only once it is durable. A service
reports a missing dependency as unhealthy and retries it; that is never a
reason to exit.
- Failure stays local. Any service may crash, restart or be absent without
losing accepted work or taking another service down. Callers retry, degrade
and report the dependency as unhealthy; they never exit because a peer is
missing, and work is acknowledged only once it is durable.
- The model never runs git. Commits and pushes go through the daemon.
- The daemon's own credentials never enter an agent container. Containers get
task-scoped grants that the daemon revokes when the task ends.
- The events module verifies webhook HMAC before it parses the payload.
task-scoped grants that are revoked when the task ends.
- Webhook HMAC is verified before the payload is parsed.
- Task briefs go in `<worktree>/.git/task.json`, never the worktree root.
- NATS: task and RPC replies use `msg.Respond`; flush after registering a
responder; `ARCHIE_TASKS` is a work queue, so never bind overlapping
consumers.
- Drain `ai-sdk` `FullStream` completely.
- `ai-sdk` `FullStream` must be drained completely.
## Build and gate
```bash
task build # binaries into bin/
task test # go test -short ./...
task ui # dashboard into ui/dist
task check # the gate
go test -short ./internal/domain/workflow -run TestName # one test
task dev # archie with live reload on 127.0.0.1:8484
task dev # every service + Vite at http://localhost:5173, from deployments/dev.toml
task e2e:up # seeded local stack; task e2e:check -- all runs the browser checks
```
`task proto:generate`, `task db:generate` and `task openapi:generate` write
the committed generated output for `proto/`, `internal/infrastructure/postgres/`
and `api/openapi.yaml`; `task check` runs their check variants and rejects stale
output.
`task proto:generate` and `task db:generate` write the committed generated
output for `proto/` and `internal/infrastructure/postgres/`; `task check` runs
their check variants and rejects stale output. The e2e stack is not part of the
gate.
Requires Go 1.27, Task, golangci-lint and Docker. Adopt `task fmt` and
Requires Go 1.27, Task, golangci-lint, Node, pnpm and Docker. Adopt `task fmt` and
`go fix` output as-is.
- `task check` gates the commit: `task check && git commit ...`. Never claim a
@@ -230,40 +170,42 @@ Requires Go 1.27, Task, golangci-lint and Docker. Adopt `task fmt` and
run, say what you did verify.
- Commit finished work without asking. Stage only your own paths and commit in
the same command. Conventional Commits scoped by package, short messages. Push
every commit as soon as you make it; a local-only commit is not acceptable.
only when told.
- Never commit binaries, build output, scratch files or `.references/`. Scratch
goes in `/tmp`.
- Runtime config lives at `${XDG_CONFIG_HOME:-~/.config}/archie/config.toml`.
The runtime reads nothing in the working tree. Systemd is optional.
Nothing in the working tree is read at runtime. Systemd is optional.
- Releases: `RELEASING.md`.
## Issues
## Issues (Gitea)
Track work as issues on `archie-platform/archie-core`, never in Markdown TODO
files. Dashboard work goes on `archie-platform/archie-frontend`.
Work is tracked as issues on the primary remote, never in Markdown TODO files.
GitHub is a read-only mirror; do not open, close or comment there.
```bash
gh issue list --label critical
gh issue view 497
gh issue edit 497 --add-label in-progress --add-assignee @me
gh issue comment 497 --body "what changed, and what was run"
gh issue close 497
tea issues list -r sam/archie --state open --labels priority::critical
tea issues list -r sam/archie --labels epic/<slug> --state open
tea issues view 497
tea issues edit 497 --add-labels status::in_progress --add-assignees sam
tea comment 497 "what changed, and what was run"
tea issues close 497
```
- An issue is the plan: what is wrong or wanted, and how you know the work is
complete. Keep it to that.
- Labels carry state: a type (`bug`, `feature`, `task`, `chore`, `epic`,
`decision`, `discovery`), a priority (`critical`, `high`, `medium`, `low`), `in-progress`
and `deferred`. Open/closed is the issue state, not a label.
- An epic's children are its sub-issues: add each one as you file it. No
`epic/<slug>` label.
- An issue is the plan: what is wrong or wanted, and how you know it is done.
Keep it to that.
- Labels carry state: `type::`, `priority::`, `status::in_progress` and
`status::deferred`. Open/closed is the issue state, not a label.
`epic/<slug>` says which epic an issue belongs to.
- Cite the issue number in commits and comments.
- The repository is public: no host names, IPs, paths, PIDs or credentials in
an issue, a commit or the code.
- `tea issues list --labels` silently ignores an unknown name and returns every
issue. Check the count is plausible before trusting a filtered list.
- The API caps `limit` at 50 regardless of what you pass.
- No host names, IPs, paths, PIDs or credentials in an issue: the text outlives
the change that wrote it.
- File follow-up work you find as an issue. Do not fix it in passing.
## Changing this file
Add a rule only after a real failure it would have prevented, and it must
A rule is added only after a real failure it would have prevented, and it must
say which decision it changes. Remove rules that no longer change decisions.
Keep it short enough to read in full every session.
-411
View File
@@ -1,411 +0,0 @@
---
name: Archie
description: Event-driven Agentic Automation
colors:
signal-sage: "#51a580"
signal-sage-deep: "#2e795a"
signal-sage-ink: "#0c6f4d"
graphite-canvas: "#0e0f10"
graphite-workspace: "#16171a"
graphite-card: "#1c1d21"
graphite-popover: "#202226"
graphite-hover: "#26282c"
graphite-hairline: "#2a2c30"
graphite-border: "#313338"
graphite-border-strong: "#3c3f45"
graphite-input: "#70727a"
graphite-text: "#e8e6e1"
graphite-text-muted: "#a6a39b"
graphite-text-subtle: "#99968f"
paper-canvas: "#e9eaec"
paper-workspace: "#f3f4f5"
paper-card: "#ffffff"
paper-hover: "#e7e9ec"
paper-hairline: "#d2d5da"
paper-border: "#d5d8dc"
paper-border-strong: "#bec3c9"
paper-input: "#838890"
paper-text: "#202327"
paper-text-muted: "#585d64"
paper-text-subtle: "#656a72"
amber-warn: "#d9a45b"
amber-warn-ink: "#8a5a12"
clay-danger: "#d9776b"
clay-danger-ink: "#b3413a"
slate-info: "#8aa4c2"
slate-info-ink: "#3d5f86"
stone-idle: "#9a978f"
stone-idle-ink: "#5b6068"
typography:
title:
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
fontSize: "0.9375rem"
fontWeight: 500
lineHeight: 1.375
page-title:
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
fontSize: "0.9375rem"
fontWeight: 600
lineHeight: 1.25
letterSpacing: "-0.025em"
label:
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
fontSize: "0.8125rem"
fontWeight: 400
caption:
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
fontSize: "0.6875rem"
fontWeight: 500
section-label:
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
fontSize: "0.6875rem"
fontWeight: 500
letterSpacing: "0.06em"
micro:
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
fontSize: "0.625rem"
mono:
fontFamily: "IBM Plex Mono, ui-monospace, monospace"
fontSize: "0.6875rem"
fontWeight: 400
rounded:
sm: "4px"
md: "6px"
lg: "8px"
xl: "12px"
full: "9999px"
spacing:
unit: "0.25rem"
unit-compact: "0.225rem"
control-gap: "0.375rem"
card-x: "1rem"
card-y: "1rem"
page-x: "1.5rem"
page-y: "1.25rem"
components:
button-primary:
backgroundColor: "{colors.signal-sage-deep}"
textColor: "#ffffff"
typography: "{typography.label}"
rounded: "{rounded.lg}"
padding: "0 10px"
height: "36px"
button-ghost:
backgroundColor: "transparent"
textColor: "{colors.graphite-text}"
typography: "{typography.label}"
rounded: "{rounded.lg}"
padding: "0 10px"
height: "36px"
button-ghost-hover:
backgroundColor: "{colors.graphite-hover}"
button-attention:
backgroundColor: "rgba(217, 164, 91, 0.08)"
textColor: "{colors.amber-warn}"
typography: "{typography.label}"
rounded: "{rounded.lg}"
padding: "0 10px"
height: "36px"
button-destructive:
backgroundColor: "rgba(217, 119, 107, 0.2)"
textColor: "{colors.clay-danger}"
typography: "{typography.label}"
rounded: "{rounded.lg}"
padding: "0 10px"
height: "36px"
input:
backgroundColor: "{colors.graphite-card}"
textColor: "{colors.graphite-text}"
typography: "{typography.label}"
rounded: "{rounded.lg}"
padding: "4px 10px"
height: "36px"
card:
backgroundColor: "{colors.graphite-card}"
textColor: "{colors.graphite-text}"
rounded: "{rounded.xl}"
padding: "16px"
badge-ok:
backgroundColor: "rgba(81, 165, 128, 0.12)"
textColor: "{colors.signal-sage}"
typography: "{typography.caption}"
rounded: "{rounded.sm}"
padding: "2px 8px"
height: "20px"
badge-warn:
backgroundColor: "rgba(217, 164, 91, 0.08)"
textColor: "{colors.amber-warn}"
typography: "{typography.caption}"
rounded: "{rounded.sm}"
padding: "2px 8px"
height: "20px"
badge-danger:
backgroundColor: "rgba(217, 119, 107, 0.08)"
textColor: "{colors.clay-danger}"
typography: "{typography.caption}"
rounded: "{rounded.sm}"
padding: "2px 8px"
height: "20px"
status-dot:
rounded: "{rounded.full}"
size: "6px"
top-bar:
backgroundColor: "{colors.graphite-card}"
height: "56px"
padding: "0 16px"
step-node:
backgroundColor: "{colors.graphite-card}"
rounded: "{rounded.lg}"
padding: "10px 12px"
width: "240px"
step-node-expanded:
width: "416px"
---
# Design System: Archie
## Overview
**Creative North Star: "The Operations Console"**
Archie's dashboard is a calm instrument panel for someone responsible for a live
estate. It is dense and legible, and it stays quiet until something needs the
operator. The mood is calm, precise and trustworthy: restraint is how the
interface shows it is in control, and nothing raises its voice unless state
demands it.
Graphite dark and Neutral light share one accent, Signal Sage. Neutral surfaces,
hairlines and type weight set the hierarchy. Solid sage marks the primary action;
a sage line or outline marks selection and focus. Labelled badges carry status.
Both themes use the same tokens, and the operator's OS chooses the theme unless
they pick one.
Density is a first-class setting. The default is already compact, and compact mode
tightens the whole spacing scale without shrinking text or hit targets. Controls
are compact and contextual: they appear where the work is, on hover or focus,
rather than as permanent chrome. The interface never looks like a toy and never
borrows generic SaaS gloss.
**Key Characteristics:**
- Neutral light and Graphite dark, with one sage accent.
- IBM Plex Sans with Plex Mono for IDs, durations and payloads, on a compact type
scale (11 to 15px).
- Flat tonal layers; shadows only for things that float.
- Compact density by default, with a tighter compact mode.
- Both themes, reduced motion and keyboard focus are invariants, not options.
## Colours
Neutral greys carry the structure. Signal Sage marks actions and selection;
status colours retain their meaning across both themes.
### Primary
- **Signal Sage** (#51a580): the mark, accents, focus rings and links in dark mode,
and the `ok` state there. On a dark card it is 5.7:1 as text.
- **Signal Sage Deep** (#2e795a): the primary button fill in both themes (white on
it is 5.3:1) and the focus ring on paper, where bright sage falls under 3:1.
- **Signal Sage Ink** (#0c6f4d): links and `ok` text in the light theme, 5.0:1 on
the paper canvas.
### Neutral
- **Graphite Canvas** (#0e0f10) / **Paper Canvas** (#e9eaec): the page behind
everything.
- **Graphite Workspace** (#16171a) / **Paper Workspace** (#f3f4f5): the main
content area inside the sidebar shell.
- **Graphite Card** (#1c1d21) / **Paper Card** (#ffffff): cards, the top bar,
inputs and canvas nodes. **Graphite Popover** (#202226) lifts menus one step
above cards in dark mode.
- **Graphite Hover** (#26282c) / **Paper Hover** (#e7e9ec): hover, secondary and
muted surfaces (shadcn's `accent`, `muted` and `secondary` all share it).
- **Hairline, Border, Border Strong** (#2a2c30, #313338, #3c3f45 dark; #d2d5da,
#d5d8dc, #bec3c9 light): dividers, card edges and the top bar's bottom edge.
- **Input stroke** (#70727a dark, #838890 light): field borders.
- **Text, Text Muted, Text Subtle** (#e8e6e1, #a6a39b, #99968f dark; #202327,
#585d64, #656a72 light): primary copy, secondary copy, and the dimmest text
allowed, for hints and captions only.
### Status
- **Amber Warn** (#d9a45b dark, #8a5a12 light): waiting, needs attention, the
`attention` button.
- **Clay Danger** (#d9776b dark, #b3413a light): failures and destructive
actions.
- **Slate Info** (#8aa4c2 dark, #3d5f86 light): an agent that is working.
- **Stone Idle** (#9a978f dark, #5b6068 light): idle, inactive or unknown.
Each status hue has a soft background at 8 to 12% alpha of its own tone. Status
badges put the solid tone on the soft background, never white text on a fill.
### Named Rules
**The Semantic Names Rule.** Components reference `--primary`, `--ok`, `--warn`
and the rest, never a raw hex or a hue name such as `--violet`. A palette change is
one file.
**The One Meaning Rule.** A status colour means the same thing wherever it
appears: a task state, a gate result, a log level and a trend all draw from the
same five tones.
**The Measured Contrast Rule.** Every foreground is checked against every surface
it lands on, hover states included, at 4.5:1. Nothing dimmer than Text Subtle is
allowed as text.
## Typography
**Body Font:** IBM Plex Sans Variable (with system-ui, sans-serif)
**Label/Mono Font:** IBM Plex Mono (with ui-monospace, monospace)
**Character:** A sober, engineered grotesque paired with its own monospace, so
identifiers, durations and payloads read as data without changing voice.
### Hierarchy
- **Page title** (600, 0.9375rem, 1.25, -0.025em): one per page, in PageHeader
beside the page's actions.
- **Title** (500, 0.9375rem, 1.375): card and panel titles.
- **Label** (400 to 500, 0.8125rem): body copy, rows, navigation, buttons and
fields. The default text size of the dashboard.
- **Caption** (500, 0.6875rem): metadata, column labels, step-type labels and
badges.
- **Section label** (500, 0.6875rem, 0.06em, uppercase): group headings in
sidebars and settings navigation only.
- **Micro** (0.625rem): the smallest annotations, used sparingly.
- **Mono** (400, caption size): IDs, short hashes, durations, log fields and code.
### Named Rules
**The Type Scale Rule.** Use the named steps (`text-micro`, `text-caption`,
`text-label`, `text-title`), never pixel sizes. Headings are separated by weight
and placement, not by size jumps.
**The Data Is Mono Rule.** Anything the operator might copy or compare (an ID, a
version, a duration, a payload) is set in Plex Mono.
## Layout
The app shell is a collapsible sidebar plus a sticky 56px top bar holding the
breadcrumb and account controls. Page content sits in the workspace surface with
1.5rem by 1.25rem padding, dropping to 1rem below the large breakpoint, and a
bottom clearance for the docked chat composer. The chat can pin to either side,
and the workspace shifts to make room for it.
Spacing is Tailwind's 0.25rem scale; compact density sets the unit to 0.225rem,
so every gap and padding tightens together and components keep their relative
rhythm. Pages use container queries (`@container`) so panels respond to the space
they actually have, not the viewport.
Phone width is a real target. Desktop layouts collapse to dropdowns instead of
side lists and to stacked panes, and nothing overlaps the canvas. Controls keep
their desktop size on touch screens; a `touch-hit` utility widens the tap area to
44px invisibly, and only rows in floating menus grow to 2.75rem.
The workflow canvas is the one full-bleed surface: on phones it takes the full
viewport height, and steps expand in place rather than opening side panels.
## Elevation & Depth
The system is flat, with tonal layers. Depth comes from surface steps (canvas,
workspace, card, popover) and from hairlines and 1px rings. Shadows are reserved
for things that float above the page: menus, popovers, dialogs and an expanded
canvas node.
### Shadow Vocabulary
- **Rest** (`box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4)` dark, `0 1px 2px
rgba(31, 31, 29, 0.06)` light): the top bar and canvas nodes at rest; barely
there.
- **Float** (`box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4)` dark, `0 8px 28px
rgba(31, 31, 29, 0.1)` light): popovers, menus, dialogs and the expanded step
node.
### Named Rules
**The Flat By Default Rule.** Cards sit on the page with a 1px ring, not a
shadow. A larger shadow means the element floats above the page.
## Shapes
Gently rounded and consistent. Controls, inputs and canvas nodes use 8px corners
(`rounded.lg`); cards use 12px (`rounded.xl`); badges use 4px (`rounded.sm`), and
small buttons step down to 6px. Status dots and avatars are the only full circles.
Borders are 1px and quiet; a strong border marks structural edges such as the top
bar. Focus is always a visible 2px ring offset by 2px, in sage.
## Components
Compact and contextual: small controls that appear where the work is.
### Buttons
- **Shape:** gently rounded (8px), 36px tall by default, with 32px and 24px sizes
and square icon variants.
- **Primary:** Signal Sage Deep fill with white label text. At most one per view.
- **Ghost / Outline / Secondary:** transparent or hover-surface fills that pick
up the hover surface on hover; the default for everything that is not the main
action.
- **Attention:** amber stroke and soft amber fill, for an action that exists
because something is waiting. Not destructive.
- **Destructive:** soft clay fill with clay text, never a solid red block.
- **Hover / Focus:** 140ms colour transitions, a 3px sage focus ring, and a 1px
downward press on active.
### Chips (Badges)
- **Style:** 20px tall, 4px corners, caption type. Status badges (`ok`, `warn`,
`danger`, `info`, `idle`) set the solid tone on its soft background.
- **State:** the badge and the StatusDot are the only places status colour is
decided.
### Cards / Containers
- **Corner Style:** 12px.
- **Background:** the card surface on the workspace.
- **Edges:** a 1px border ring, without a shadow.
- **Internal Padding:** 16px, or 12px for the small size. Section wraps a card
with a title; an edited section shows a sage ring.
- **Data tables:** card surface, muted header and a border, without card padding
or a shadow.
- **Alerts:** use the semantic soft fill and a matching border so they don't
look like regular cards.
### Inputs / Fields
- **Style:** card background, 1px input stroke, 8px corners, 36px tall, label
size (title size on touch screens so phones do not zoom).
- **Focus:** the border turns sage with a 3px sage ring.
- **Error / Disabled:** a clay border and ring; disabled fields drop to 50%
opacity.
### Navigation
- **Sidebar:** card surface, label-size rows, uppercase section labels in Text
Subtle, the hover surface on hover and active. Collapses on phones.
- **Top bar:** card surface, 56px, strong bottom border with the rest shadow,
breadcrumb on the left and a connection pill and account menu on the right.
- **Selection:** the active tab uses a sage underline. Pressed toggles use a
sage outline and a soft fill.
### Status Dot
A 6px circle in one of the five status tones. It pulses (motion-safe only) while
the thing it marks is live.
### Step Node (Signature Component)
The workflow canvas card. 240px wide at rest, with an 8px corner, the rest shadow
and a caption row naming the step type with a sage icon. The run duration sits on
the right in mono, beside a status icon. The title below is label size and medium
weight. Selecting it expands it in place to 416px with the float shadow and a 2px
sage ring, main field first. The same card shows the step's live run state:
editor and observer are one surface. Added, removed and changed steps are marked
in the sage, clay and amber tones.
## Do's and Don'ts
### Do:
- **Do** use semantic tokens (`bg-card`, `text-fg-muted`, `bg-ok-soft`) and the
named type steps, so both themes and compact density work without extra code.
- **Do** keep one filled primary button per view; everything else is ghost,
outline or secondary.
- **Do** set IDs, versions, durations and payloads in Plex Mono.
- **Do** show actions on hover or focus where the work is, and make every hover
action reachable by keyboard.
- **Do** honour reduced motion: nothing animates when the operator asks it not to.
### Don't:
- **Don't** use generic SaaS gloss: no purple or multicolour gradients, no glow
shadows, no glassmorphism cards, no gradient text.
- **Don't** make it toy-like on phones: no blanket 44px minimum sizes on buttons,
links and fields. Widen the tap area invisibly with `touch-hit` instead.
- **Don't** tint backgrounds for hierarchy; use surface steps and borders.
- **Don't** introduce a new hue or reuse a status colour for decoration.
- **Don't** put white text on a status fill; use the soft background and the
solid tone.
- **Don't** add a shadow to a resting card.
+1 -1
View File
@@ -103,5 +103,5 @@ ENV GOMODCACHE=/data/cache/go/mod \
COPY --from=builder /usr/local/bin/archie-agent /usr/local/bin/archie-agent
# The daemon injects NATS_URL.
# The daemon injects NATS_URL and, when configured, NATS_TOKEN.
ENTRYPOINT ["archie-agent"]
-28
View File
@@ -1,28 +0,0 @@
# Production single-binary image for cmd/archie.
# Build: docker build -f Dockerfile.archie --build-arg VERSION=v1.0.0 -t archie:v1.0.0 .
# ── builder ──
FROM golang:1.27-trixie AS builder
ARG VERSION=dev
WORKDIR /src
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod go mod download
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 go build -trimpath \
-ldflags "-s -w -X github.com/samcharles93/archie-core/internal/buildinfo.Version=${VERSION}" \
-o /usr/local/bin/archie ./cmd/archie
# ── runtime ──
FROM gcr.io/distroless/static-debian12:nonroot
ARG VERSION=dev
ARG REVISION=unknown
LABEL org.opencontainers.image.title="archie" \
org.opencontainers.image.description="Event-driven agentic automation" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${REVISION}"
COPY --from=builder /usr/local/bin/archie /archie
EXPOSE 8080
ENTRYPOINT ["/archie"]
+10
View File
@@ -1,6 +1,14 @@
# archied — the archie daemon
# Run via docker compose alongside NATS.
FROM node:24-trixie-slim AS dashboard
WORKDIR /src/ui
RUN corepack enable
COPY ui/package.json ui/pnpm-lock.yaml ui/pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
COPY ui/ ./
RUN pnpm run build
FROM golang:1.27-trixie AS builder
WORKDIR /src
COPY go.mod go.sum ./
@@ -8,6 +16,7 @@ COPY go.mod go.sum ./
# them COPY . . makes every commit a cold compile.
RUN --mount=type=cache,target=/go/pkg/mod go mod download
COPY . .
COPY --from=dashboard /src/ui/dist ./ui/dist
ARG GATEWAY_VERSION=dev
ARG RUNTIME_VERSION=dev
RUN --mount=type=cache,target=/go/pkg/mod \
@@ -26,5 +35,6 @@ ARG RUNTIME_VERSION=dev
LABEL org.opencontainers.image.version="${GATEWAY_VERSION}"
LABEL cloud.catlow.archie.runtime-version="${RUNTIME_VERSION}"
COPY CHANGELOG.md /usr/share/archie/CHANGELOG.md
ENTRYPOINT ["archied"]
-119
View File
@@ -1,119 +0,0 @@
# Product
<!-- impeccable:product-schema 1 -->
## Platform
web
## Users
Archie's audience comes in two stages.
1. **Now: the solo operator.** An infrastructure or IT operations engineer who
runs their own estate of VMs, containers and on-prem hosts and self-hosts
Archie. They want day-2 operations handled without babysitting: disks
filling up, alerts firing, routine maintenance. They use the dashboard on
desktop and phone, and talk to Archie through chat channels.
2. **Next: the IT operations team.** A team inside an organisation where an
application owner (recorded in the CMDB) approves production changes on the
servers that belong to their application. Governance, audit and risk
controls decide whether the team adopts it.
## Product Purpose
Archie is event-driven agentic automation. It hears an event (an alert, a
webhook, a schedule, a chat message, an issue), works out what it means, decides
what to do, and does the work through an agent. It judges every action before
the action runs, and delivers the result wherever it needs review or action.
Success: an operator connects a source and Archie notices events, acting without
being asked when allowed. It calls the operator in only when policy or risk
requires it, explaining what it found and did.
The loop is Hears, Understands, Decides, Defines, Does, Delivers. The platform
around it Governs, Reports, Assesses, Manages Risk and Invokes Policy.
## Positioning
In order of importance:
1. **Earned, explained autonomy.** Guards (policy, risk and others, each an
extension) score every action before it runs, and those scores set how much
the agent may do alone. Autonomy is graded per action, earned from approval
history, and always explained. Loosening a ceiling always needs approval from
someone with authority; it never happens automatically.
2. **Proposals from unhandled events.** The operator states intent rather than
wiring steps. Events that nothing handles become proposals, and workflows
learn from outcomes. Archie writes, runs and changes its own workflows; the
operator can view or edit them but should not need to.
3. **Self-hosted operations on VM and on-prem estates.** Archie runs in the
operator's own environment and acts directly, or through the automation a
team already has (AAP, Semaphore, ServiceNow).
Archie executes agentic work itself. It is not only a judgement layer, and not
another visual workflow builder in the n8n, Zapier or Make mould.
## Operating Context
- Events arrive from monitoring (for example Alertmanager on Prometheus),
webhooks, schedules, chat channels and forges. A forge is one source among
many; a repository is an optional input to a workflow, never the point.
- Results and approval requests go out as events to any channel (Telegram,
Slack, Discord, email, webhooks, the dashboard chat composer) and come back in.
- An approver can be an operator, a rule, a classifier or an automatic decision.
Never assume a human approver.
- Channels, forges, connectors, secret engines and guards ship as extensions,
not in-tree.
- The leading demonstration is proactive day-2 operations: a disk-filling alert
from Prometheus, investigated and remediated, with the operator told on both a
chat channel and the dashboard.
## Capabilities and Constraints
- One self-contained binary, `archie`, backed by PostgreSQL. Docker is never
the only mechanism for isolation or enforcement.
- The dashboard is a Vue single-page app embedded in the binary, used on
desktop and phone.
- The dashboard is the complete control plane: every configuration and mutable
setting is editable there. A setting reachable only through a file, flag or
API is a defect. Secrets are write-only.
- Every request and response of every judge, guard, action, model call,
delivery and evaluation is recorded for audit, never including credentials.
- Terminology: source, event, workflow, run, step, guard, approval, proposal,
connector, delivery. "Bindings" is a known-obscure name awaiting a
replacement.
- Undecided: the replacement for bindings and issue routing in the Decide step;
how guard scores combine into an autonomy mode; how Deliver works without
hard-coded outputs.
## Brand Commitments
- Name: Archie. Tagline: "Event-driven Agentic Automation".
- Assets in `assets/brand/`: wordmark (light, dark, mono), mark, app icon,
social card.
- Interface copy states the problem and the action only. It never explains the
interface, restates a title, or describes the mechanism behind it.
- Never frame the product around coding or a repository.
## Evidence on Hand
- Live staging deployment of the single binary, with real Prometheus alerts,
Telegram, Semaphore and host connectors.
- No customers, testimonials, benchmarks, pricing or press exist. Do not
fabricate any.
## Product Principles
1. **Governance is the product.** Judgement before every action, a full audit
record, and autonomy that is earned and explained are what make Archie worth
adopting. Keep them visible, not buried.
2. **Intent, not wiring.** The operator says what they want; Archie defines the
workflow. Editing is available, never required.
3. **Editor and observer are one live surface.** Workflows are defined,
connected and watched on the same interactive canvas, updating live as
events and runs flow through it. Nodes show what they do.
4. **Interrupt only when it matters.** Archie calls the operator in when policy
or risk requires it, with what it found and what it did, not to report
routine success.
5. **Everything operable from the dashboard.** No setting needs a server login.
+2 -6
View File
@@ -17,8 +17,8 @@ network operations, service management, and software delivery. You define the
process and the access it requires; agents work through its stages, using the
context of each event to decide how to accomplish the task.
Archie is under active development and some capabilities below remain
unfinished.
Archie is under active development and not every capability below is
finished.
## From an event to an outcome
@@ -150,10 +150,6 @@ another [deployment template](deployments/README.md).
<http://localhost:5173>, using [`deployments/dev.toml`](deployments/dev.toml).
`task check` is the quality gate; [AGENTS.md](AGENTS.md) lists its tools.
| Project skill | Use |
| --- | --- |
| [`/technical-prose-cleanup`](.github/skills/technical-prose-cleanup/SKILL.md) | Review technical writing in one module without changing behaviour. |
## Documentation
- [Your first playbook](docs/guides/first-playbook.md)
+239 -34
View File
@@ -1,56 +1,261 @@
# Releasing
One `v*` tag names a release. One version covers every process in the host
bundle (`archied`, `archie-gateway`, `archie-state-store`, `archie-ui`,
`archie-messaging`) and the `archie-agent` image. No release comes from a
laptop.
One release stream. `CHANGELOG.md` carries every release section, one generated
page per version describes it, and one `v*` tag names the release. One version
covers every process in the host bundle (`archied`, `archie-gateway`,
`archie-state-store`, `archie-ui`, `archie-messaging`) and the `archie-agent`
image; per-component detail is a labelled section inside the version
(`### archied`, `### archie-agent`).
A release is cut by CI, published to `next`, run on the canary for a day, and
promoted to `stable` only if the canary's signals pass. Nothing is run locally.
## Notes are written with the change
A commit that changes what a reader experiences adds its bullet under
`## [Unreleased]` in `CHANGELOG.md`, in the same commit. The release takes that
section as it stands, so write the bullet as the release note, not as a commit
subject.
**Release notes describe the reader's experience of what shipped.** The test is
the reader, not whether a sentence is negative:
- A capability that **never existed** leaves no expectation to correct, so a
note about it reads as a feature to someone who never had the thing: out.
- **The implementation's journey** (what was rebuilt, what a guard finally
covers, what a browser API refuses to surface) isn't the reader's experience
either: out.
- A capability that **shipped but isn't yet wired** _is_ the reader's
experience, so it belongs, worded as a caveat on the capability and paired
with the behaviour that compensates for it.
Design constraints and withheld capabilities are not release news. Deleting a
caveat a reader needs misleads them, which is the failure this rule exists to
prevent.
## Cutting a release
Dispatch the **release** workflow (`.github/workflows/release.yml`) with
`major`, `minor`, `patch` or an exact version. It runs `task release` on
`main`, which refuses a dirty tree or an existing tag and then tags `vx.y.z`,
and pushes the tag with `DEPLOY_TOKEN`. A push made with the job token
wouldn't start other workflows, so the user token is what lets the tag start
the deploy.
`major`, `minor`, `patch` or an exact version. It runs `task release` on `main`:
1. refuses a dirty tree, an existing tag, or an `[Unreleased]` with no entries;
2. turns `[Unreleased]` into `## [x.y.z] - date` under a new empty
`[Unreleased]`, and runs `task news`;
3. commits `chore(release): vx.y.z` and tags `vx.y.z`;
then pushes `main` and the tag atomically with `DEPLOY_TOKEN`. A push made with
the job token wouldn't start other workflows, so the user token is what lets
the tag start the deploy.
Every workflow that reaches the registry or the canary reads its credentials
from Actions secrets, so a mirror of this repository carries its own set:
| Name | Kind | Used by |
|---|---|---|
| `DEPLOY_TOKEN` | secret | release, deploy, canary, promote — the registry push, the tag push, and the package links |
| `RELEASE_SIGNING_KEY` | secret | deploy — signs the release statement |
| `CANARY_TOKEN` | secret | deploy, canary, promote — the canary's dashboard API |
| `CANARY_URL` | variable | deploy, canary, promote — where that dashboard is |
| `CANARY_WINDOW` | variable | canary — the judged window; empty means the default |
A mirror missing them fails at its first login or push; `release.yml` names the
missing `DEPLOY_TOKEN` before it checks out, so the run doesn't read as a broken
release.
After a release, pull `main` before committing on it again: CI has added the
release commit.
## What a release publishes
The tag push runs `deploy.yml`:
- **Gate.** `task check dist TEST_FLAGS=-count=1` and `govulncheck`. The
same run builds the binaries the zip ships, so it compiles nothing again
after the gate.
- **Images.** `archied:v<version>` and `archie-agent:v<version>`, plus
`sha-<commit>` tags. `:latest` moves only on promotion.
- **Gate.** `task check TEST_FLAGS=-count=1` (uncached, including the
Docker-backed tests `-short` skips) and `govulncheck`, then a check that the
tag has a `[version]` section in `CHANGELOG.md`. On a release the same task
run also builds the binaries the zip ships (`task dist`), so nothing is
compiled again after the gate.
- **Images.** `archied:v<version>` and `archie-agent:v<version>` on a release
tag; `archied:edge` and `archied:sha-<commit>` on any other push to `main`.
`:latest` moves only on promotion, so it names the newest promoted release.
- **The signed release.** `archied release publish` signs a statement
(version, `issued_at`, zip digest, agent image by digest) with
(version, issued_at, zip digest, agent image by digest) with
`RELEASE_SIGNING_KEY` and pushes it with the distribution zip to
`git.catlow.cloud/sam/archie` as `v<version>` and `next`. It never moves
`stable`.
- **The release page** on Gitea, listing the commit subjects since the
previous tag. The statement links to it.
- **The release-notes page** on Gitea, from that version's `CHANGELOG.md`
section, which the statement links to.
- **The canary install**: `archied release canary start` points the canary at
`next` and installs the release through its dashboard.
Actions run the workflow from the tagged commit, so a fix to `deploy.yml`
reaches a release only if it is an ancestor of the tag. Cut a new release
rather than committing the fix on top of a tagged one.
GitHub-style Actions run the workflow from the tagged commit, so a fix to
`deploy.yml` reaches a release only if it is an ancestor of the tag. Re-cut the
release rather than committing the fix on top of a tagged one.
## Promote
## The canary
Dispatch the **promote** workflow (`.github/workflows/promote.yml`) with a
`version`. It retags `stable` to that release and moves the `archied` and
`archie-agent` images' `:latest` to it. Promotion refuses a prerelease and a
release issued before the one `stable` names, the same replay rule hosts
enforce. The same thing by hand:
The canary is the production host, following `next`. Every quarter hour
`canary.yml` takes `archied` from the published `archied:edge` image and runs
`release canary check`, which reads the canary
through its dashboard API and judges **the release the canary actually runs**,
not the moving `next` tag:
```bash
archied release promote -version 1.63.0 \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
| Signal | Source | Fails when |
| --- | --- | --- |
| Install outcome | `GET /api/chat/update` | the canary doesn't run the judged release (the watchdog rolled it back) |
| Readiness | `GET /health/detailed` | the rollup isn't `ok` |
| Alerts | `GET /api/alerts` | an open `action` alert was first raised after the release was installed |
| Error log | `GET /api/logs?level=error` | error lines per window exceed `2 × baseline + 10` |
| Task outcomes | `GET /api/tasks` | the share of finished tasks that parked or died rose more than 10 points |
- **Control.** The canary's own window before the release was installed. With
one production host there's no simultaneous control.
- **Window.** 24 hours counted from the **install** on the canary, not from
the release's issue time: the host records it in `installed.json`
(`committed_at`) and reports it as `installed_at` in `GET /api/chat/update`.
One cycle of schedules and traffic. The first 30 minutes are for the install
and restart. `canary.yml` passes `-window` when the `CANARY_WINDOW` Actions
variable is set; the flag defaults to 24h. A host that doesn't report an
install time degrades to the release statement's issue time.
- **Hard signals** (install, readiness, alerts) roll back at any check after
that. **Relative signals** (errors, tasks) are judged against the baseline
whenever both windows carry enough data, so a breach rolls the release back
even mid-window; a full window with no failure promotes it.
- **Too little data skips a signal** rather than failing it: fewer than 5
finished tasks in the window, or an error log that reaches back less than an
hour into the baseline. A log read that stops short of a window is scaled to
a full window from what it covers.
### Queueing
`deploy.yml` installs each new release on the canary with
`archied release canary start -version V`, which first points the canary back
at `next` (clearing any rollback pin) and then installs `V` — unless the
canary is already judging a release newer than stable that isn't `V`, in which
case `V` is **queued** behind it and the canary keeps running what it judges.
`-force` installs regardless. A `check` that promotes (or finds nothing to
judge) installs the newer `next` in the same run, so a queue drains one
release per promotion.
### Subcommands
```
archied release canary status read-only: channel/pin, installed release and
installed_at, stable/next, window progress, and
the verdict the current signals would give
archied release canary start point the canary at next and install -version,
queued behind a release being judged (-force to
override)
archied release canary check judge the installed release over -window
(default 24h): promote, pick up a newer next,
or roll back; a held canary is reported, and a
held pin that is no longer installable fails
the run red
archied release canary promote promote the installed release now if its
signals pass; refuses with exit 1 otherwise
archied release canary unpin return the canary to next from any pin
```
## Secrets
### Promote
| Name | Used by |
|---|---|
| `DEPLOY_TOKEN` | release, deploy, promote: the registry push, the tag push and the package links |
| `RELEASE_SIGNING_KEY` | deploy: signs the release statement |
A release that passes the window is promoted: `stable` is retagged to the
`v<version>` manifest. The signature covers the statement, not the tag, so the
retag needs no signing key. The `archied` and `archie-agent` images' `:latest`
move to their `:v<version>` first, and the agent image must be the digest the
statement pins. Promotion refuses a prerelease and a release issued before the
one `stable` names, the same replay rule hosts enforce. The decision and its
reasons are in the `canary` run log.
Early promotion is a dispatch away: the **promote** workflow
(`.github/workflows/promote.yml`) takes a `version` input and runs
`archied release canary promote -version V` on the canary. It judges the
release the canary runs — the window doesn't matter for the decision — and
refuses (red run) on any hard failure or relative breach with enough data.
### Roll back
`stable` stays put, and the run turns red. Before the canary is pinned to
`stable`, `check` verifies `stable` is actually installable — its statement's
zip blob must still be in the release repository and its pinned agent image
must still resolve (`releaseupdate.Installable`). If it isn't, the run fails
loudly and the canary stays on `next` rather than being stranded on a pin.
Otherwise the canary is pinned to the `stable` version through its update
settings and reinstalled through its dashboard.
A release whose migrations differ from `stable`'s can't go back without
restoring the pre-update database snapshot, which loses every write since. The
canary is held on the failed release instead (pinned to it) and the fix goes
forward in the next release. The next release's deploy points the canary back
at `next`.
A pinned canary isn't judged, so a rollback is decided once — but `check`
verifies the pin is still installable every run, so a stranded pin shows red
instead of green. `archied release canary unpin` returns the canary to `next`
by hand.
### Configuration
| Name | Kind | Holds |
| --- | --- | --- |
| `CANARY_URL` | Actions variable | the canary's dashboard URL; unset disables the canary steps |
| `CANARY_TOKEN` | Actions secret | an API token bound to a dedicated `service_account` identity on the canary, carrying only the canary grant policy (see below) — never instance admin |
| `CANARY_WINDOW` | Actions variable | optional `-window` override for `canary check`; unset is 24h |
| `DEPLOY_TOKEN` | Actions secret | registry and repository write, for publishing, promoting and the release push; stays CI-only, promotion runs in CI and never on the host |
| `RELEASE_SIGNING_KEY` | Actions secret | the release signing seed |
#### Setting up `CANARY_TOKEN` once
`CANARY_TOKEN` is a bearer token for a dedicated service-account identity in
the system org whose only grant is the canary policy
(`access.CanaryGrantPolicy`): read the signal endpoints (`GET /api/chat/update`,
`GET /api/alerts`, `GET /api/logs`, `GET /api/tasks`), read and write the
`update-settings` resource, and trigger an update install
(`POST /api/chat/update/install`). It carries no other rights, and instance
admin is never needed. With an instance-admin token (for example the operator
session), run against the canary host:
```bash
# 1. Create the service-account identity in the system org.
curl -X POST "$CANARY_URL/api/identities" -H "Authorization: Bearer $ADMIN" \
-H 'Content-Type: application/json' \
-d '{"kind":"service_account","display_name":"ci-canary"}'
# -> {"id":"<canary-identity-id>", ...}
# 2. Issue its token (shown exactly once).
curl -X POST "$CANARY_URL/api/identities/<canary-identity-id>/tokens" \
-H "Authorization: Bearer $ADMIN" -H 'Content-Type: application/json' \
-d '{"name":"ci-canary","days":90}'
# -> {"id":"<token-hash>","token":"archie_pat_..."} -- store the token value as the CANARY_TOKEN secret
# 3. Install the grant pair, scoped to that identity. The policies' org is
# pinned to the caller's org (org-sys for the instance admin), so the
# bodies need no org field. The permit alone is not enough: service
# accounts created through the API are assigned the developer role, so a
# matching forbid (installed second) negates everything outside the
# permit's surface for that identity.
curl -X PUT "$CANARY_URL/api/access/policies" -H "Authorization: Bearer $ADMIN" \
-H 'Content-Type: application/json' \
-d '{"id":"org-canary-grant","level":"org","text":"permit(principal, action, resource) when {\n resource.org == principal.org &&\n principal == Archie::Identity::\"<canary-identity-id>\" &&\n (\n (action == Archie::Action::\"read\" && [\"dashboard\", \"task\"].contains(resource.kind)) ||\n (action == Archie::Action::\"read\" && resource == Archie::Object::\"update-settings\") ||\n (action == Archie::Action::\"update\" && resource == Archie::Object::\"update\") ||\n (action == Archie::Action::\"manage_identities\" && resource == Archie::Object::\"update-settings\")\n )\n};"}'
```
The second policy forbids the canary identity from everything the permit does
not name, so its developer role cannot widen the grant:
```bash
curl -X PUT "$CANARY_URL/api/access/policies" -H "Authorization: Bearer $ADMIN" \
-H 'Content-Type: application/json' \
-d '{"id":"org-canary-grant-forbid","level":"org","text":"forbid(principal, action, resource) when {\\n resource.org == principal.org &&\\n principal == Archie::Identity::\\\"<canary-identity-id>\\\" &&\\n !(\\n (action == Archie::Action::\\\"read\\\" && [\\\"dashboard\\\", \\\"task\\\"].contains(resource.kind)) ||\\n (action == Archie::Action::\\\"read\\\" && resource == Archie::Object::\\\"update-settings\\\") ||\\n (action == Archie::Action::\\\"update\\\" && resource == Archie::Object::\\\"update\\\") ||\\n (action == Archie::Action::\\\"manage_identities\\\" && resource == Archie::Object::\\\"update-settings\\\")\\n )\\n};"}'
```
The policy texts are exactly `access.CanaryGrantPolicy` and
`access.CanaryGrantForbidPolicy` from `internal/domain/access/canary.go` with
the identity id filled in. The canary needs no other rights: `GET
/health/detailed` is unauthenticated, and every other call it makes is covered
by the grant pair.
The runner must reach `CANARY_URL`. Without a canary a release stays on `next`
until promoted by hand, under the same refusals:
```bash
archied release promote -version 1.57.0 \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
```
+94 -131
View File
@@ -64,23 +64,21 @@ tasks:
- task: db:generate
- git diff --exit-code -- internal/infrastructure/postgres/postgresdb
openapi:generate:
desc: Write the API's OpenAPI document to api/openapi.yaml
cmds:
- mkdir -p api
- go run ./cmd/archie openapi > api/openapi.yaml
openapi:check:
desc: Regenerate the OpenAPI document and reject uncommitted differences
cmds:
- task: openapi:generate
- git diff --exit-code -- api/openapi.yaml
proto:check:
desc: Regenerate contracts and reject uncommitted generated differences
cmds:
- bash tools/proto.sh check
news:
desc: Regenerate the release data artifacts from the changelog
cmds:
- go -C tools run -mod=readonly ./newsgen --repo-root ..
news:check:
desc: Verify the committed release notes match the changelog
cmds:
- go -C tools run -mod=readonly ./newsgen check --repo-root ..
vet:
desc: Run go vet
cmds:
@@ -90,6 +88,34 @@ tasks:
desc: Run golangci-lint
cmds:
- golangci-lint run ./...
- cd tools && golangci-lint run ./...
ui:deps:
desc: Install dashboard dependencies
internal: true
# Parallel UI checks must share one dependency install.
run: once
dir: ui
cmds:
- pnpm install --frozen-lockfile
ui:
desc: Build the dashboard into ui/dist, which the Go build embeds
# check builds the dashboard and then build depends on it again; a second
# build empties ui/dist under the Go steps that embed it.
run: once
dir: ui
deps: [ui:deps]
cmds:
- pnpm run build
test:ui:
desc: Test and type-check the dashboard
dir: ui
deps: [ui:deps]
cmds:
- pnpm test
- pnpm run typecheck
bench:prreview:
desc: Run the PR review benchmark on the configured models and write docs/benchmarks/pr-review-*.md (-- -model ALIAS -judge-model REF; --help for flags)
@@ -97,12 +123,8 @@ tasks:
- go run ./cmd/archied prbench {{.CLI_ARGS}}
dev:
desc: Run archie with live reload on 127.0.0.1:8484; run the dashboard from archie-frontend
deps: [dev:archie]
dev:legacy:
desc: Run the legacy multi-service stack
deps: [dev:daemon, dev:gateway, dev:messaging, dev:state-store, dev:dashboard]
desc: Run development services and Vite at http://localhost:5173
deps: [dev:daemon, dev:gateway, dev:messaging, dev:state-store, dev:dashboard, dev:ui]
dev:tls:
desc: Issue the development CA and service certificates deployments/dev.toml names
@@ -124,7 +146,7 @@ tasks:
done
dev:postgres:
desc: Start PostgreSQL, wait for readiness, provision the database roles
desc: Start PostgreSQL and wait for readiness
cmds:
- docker compose up -d postgres
- |
@@ -138,38 +160,6 @@ tasks:
done
echo "postgres did not become healthy within 60s" >&2
exit 1
- |
# docker-compose.yml creates the dev database with a superuser named
# archie; provision the least-privilege runtime and migrator roles
# idempotently without depending on the legacy state-store binary.
# Single-binary archie uses its own database (archie_dev) so its goose
# migration history does not collide with the legacy archie database.
docker compose exec -T postgres psql -v ON_ERROR_STOP=1 -U archie -d postgres <<'SQL'
DO $$
BEGIN
IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'archie_migrator') THEN
CREATE ROLE archie_migrator LOGIN PASSWORD 'archie';
ELSE
ALTER ROLE archie_migrator WITH LOGIN PASSWORD 'archie';
END IF;
IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'archie_runtime') THEN
CREATE ROLE archie_runtime LOGIN PASSWORD 'archie';
ELSE
ALTER ROLE archie_runtime WITH LOGIN PASSWORD 'archie';
END IF;
END
$$;
SELECT 'CREATE DATABASE archie_dev OWNER archie_migrator'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'archie_dev')\gexec
GRANT CREATE, CONNECT ON DATABASE archie TO archie_migrator;
GRANT CONNECT ON DATABASE archie TO archie_runtime;
GRANT CREATE, CONNECT ON DATABASE archie_dev TO archie_migrator;
GRANT CONNECT ON DATABASE archie_dev TO archie_runtime;
SQL
docker compose exec -T postgres psql -v ON_ERROR_STOP=1 -U archie -d archie \
-c "GRANT CREATE, USAGE ON SCHEMA public TO archie_migrator; GRANT USAGE ON SCHEMA public TO archie_runtime;"
docker compose exec -T postgres psql -v ON_ERROR_STOP=1 -U archie -d archie_dev \
-c "GRANT CREATE, USAGE ON SCHEMA public TO archie_migrator; GRANT USAGE ON SCHEMA public TO archie_runtime;"
dev:wait-state:
internal: true
@@ -183,67 +173,67 @@ tasks:
exit 1
dev:daemon:
desc: Run legacy archied
desc: Run archied with live reload
cmds:
- task: dev:wait-state
- go run ./cmd/archied -config-overlay deployments/dev.toml
- air -build.args_bin="-config-overlay,deployments/dev.toml"
dev:dashboard:
desc: Run the legacy dashboard backend
desc: Run the dashboard backend
cmds:
- go run ./cmd/archie-ui -config-overlay deployments/dev.toml
dev:state-store:
desc: Run the legacy State Store with development PostgreSQL
desc: Run the State Store with development PostgreSQL
deps: [dev:postgres, dev:tls]
cmds:
- go run ./cmd/archie-state-store -config-overlay deployments/dev.toml
dev:gateway:
desc: Run the legacy development Gateway
desc: Run the development Gateway
cmds:
- task: dev:wait-state
- go run ./cmd/archie-gateway -config-overlay deployments/dev.toml
dev:messaging:
desc: Run the legacy development Messaging Service
desc: Run the development Messaging Service
cmds:
- task: dev:wait-state
- go run ./cmd/archie-messaging -config-overlay deployments/dev.toml
dev:archie:
desc: Run the single archie binary against the development PostgreSQL (admin token "dev", live reload via air if installed)
deps: [dev:postgres]
vars:
DIR: tmp/dev-archie
dev:ui:
desc: Run Vite (requires the dashboard backend)
dir: ui
cmds:
- |
set -eu
mkdir -p {{.DIR}}/state
# Generated once: the age identity seals the dev credentials, so keep
# it across runs. Roles come from dev:postgres.
if [ ! -f {{.DIR}}/config.toml ]; then
install -m 0600 /dev/null {{.DIR}}/config.toml
{
echo 'listen = "127.0.0.1:8484"'
echo 'state_dir = "{{.ROOT_DIR}}/{{.DIR}}/state"'
echo "admin_token_sha256 = \"$(printf dev | sha256sum | cut -d' ' -f1)\""
echo "age_identity = \"$(go run ./cmd/archie -new-age-identity)\""
echo '[database]'
echo 'url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie_dev?sslmode=disable"'
echo 'owner_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie_dev?sslmode=disable"'
} > {{.DIR}}/config.toml
elif ! grep -q '^state_dir' {{.DIR}}/config.toml; then
sed -i '1i state_dir = "{{.ROOT_DIR}}/{{.DIR}}/state"' {{.DIR}}/config.toml
fi
- |
if command -v air >/dev/null 2>&1; then
exec air -build.args_bin="-config,{{.DIR}}/config.toml"
fi
exec go run ./cmd/archie -config {{.DIR}}/config.toml
- pnpm install
- pnpm run dev
e2e:up:
desc: Start the local stack without Docker (PostgreSQL 18, services, Vite) and seed it
cmds:
- bash e2e/stack.sh start
- bash e2e/seed.sh
e2e:down:
desc: Stop the local e2e stack
cmds:
- bash e2e/stack.sh stop
e2e:check:
desc: List browser checks; use -- all or -- CHECK to run, add --headed to watch
cmds:
- node e2e/run.cjs {{.CLI_ARGS}}
canary:rehearse:
# Local rehearsal only: spins up its own registry, database and host, and
# is deliberately absent from check and CI.
desc: Rehearse the release-canary loop on a throwaway local host (needs docker; never part of the gate)
cmds:
- sh tools/canary-rehearse.sh
build:
desc: Build archie services and agent binaries
deps: [ui]
# Static, like the binaries a release ships, so `dist` reuses these
# compiled packages and only links again.
env:
@@ -259,17 +249,14 @@ tasks:
- Taskfile.yml
- "**/*.go"
# Files the binaries embed.
- config.example.toml
- "internal/**/*.sql"
- "internal/**/*.yaml"
- "internal/**/*.json"
- "internal/**/*.tpl"
- "internal/**/*.tmpl"
- "internal/**/*.md"
- "modules/**/*.cedar"
- "modules/**/*.yaml"
- go.mod
- go.sum
- "ui/dist/**"
generates:
- "{{.BIN_DIR}}/archied"
- "{{.BIN_DIR}}/archie-gateway"
@@ -277,16 +264,16 @@ tasks:
- "{{.BIN_DIR}}/archie-ui"
- "{{.BIN_DIR}}/archie-messaging"
- "{{.BIN_DIR}}/archie-agent"
- "{{.BIN_DIR}}/archie"
cmds:
# One flag set for every service, matching the release workflow, so each
# binary reports the same version.
- for: [archie, archied, archie-gateway, archie-state-store, archie-ui, archie-messaging]
- for: [archied, archie-gateway, archie-state-store, archie-ui, archie-messaging]
cmd: go build -trimpath -ldflags "{{.SERVICE_LDFLAGS}}" -o {{.BIN_DIR}}/{{.ITEM}} ./cmd/{{.ITEM}}
- go build -trimpath -ldflags "-X github.com/samcharles93/archie-core/internal/app/agentworker.version={{.RUNTIME_VERSION}} -X github.com/samcharles93/archie-core/internal/installtype.buildType=binary" -o {{.BIN_DIR}}/archie-agent ./cmd/archie-agent
dist:
desc: Build the linux/amd64 binaries a release ships into dist/ (VERSION=1.2.3; needs jq)
deps: [ui]
env:
GOOS: linux
GOARCH: amd64
@@ -324,60 +311,29 @@ tasks:
desc: Run the full quality gate
# Finish mutations before starting parallel checks.
cmds:
# Node packages land under ui/, which `go test ./...` walks: installing
# them while the parallel checks scan the tree makes a lockfile update
# delete Go sources mid-walk. Install first, then fan out. Every Go step
# embeds ui/dist, so the dashboard is built before any of them.
- task: ui
- task: fmt
- task: proto:check
- task: db:check
- task: openapi:check
- task: check:readonly
wt:check:
desc: "Fix, format and check a worktree's Go packages (-- ./pkg/... to name packages; default: those changed since main)"
# The full gate still runs once, on the merged tree.
cmds:
- |
set -eu
base="$(git merge-base HEAD main)"
changed="$( { git diff --name-only "$base"; git ls-files --others --exclude-standard; } | sort -u)"
pkgs="{{.CLI_ARGS}}"
if [ -z "$pkgs" ]; then
pkgs="$(printf '%s\n' "$changed" | grep '\.go$' | xargs -r -n1 dirname | sort -u | while read -r d; do [ -d "$d" ] && echo "./$d"; done | tr '\n' ' ')"
fi
if [ -n "$pkgs" ]; then
echo "packages: $pkgs"
# The same fixes and formatters as task fmt, applied to these
# packages only; see fmt for why go fix runs until it converges.
converged=false
for pass in 1 2 3 4 5 6 7 8 9 10; do
go fix $pkgs
if go fix -diff $pkgs >/dev/null; then
converged=true
break
fi
done
if [ "$converged" != true ]; then
echo "go fix still rewrites these packages after 10 passes" >&2
exit 1
fi
golangci-lint fmt $pkgs
go vet $pkgs
go test -short $pkgs
golangci-lint run $pkgs
fi
if [ -z "$pkgs" ]; then
echo "nothing changed since main"
fi
check:readonly:
internal: true
deps:
- task: proto:lint
- task: news:check
- task: vet
- task: lint
- task: build
- task: test
- task: test:ui
release:
desc: "Tag main as a release (RELEASE=major|minor|patch|1.2.3)"
desc: "Turn [Unreleased] into a release, then commit and tag it (RELEASE=major|minor|patch|1.2.3)"
requires:
vars: [RELEASE]
cmds:
@@ -396,5 +352,12 @@ tasks:
esac
echo "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$' || die "$version is not a version"
! git rev-parse -q --verify "refs/tags/v$version" >/dev/null || die "v$version already exists"
awk '/^## \[Unreleased\]/ { u = 1; next } u && /^## \[/ { exit } u && /^- / { found = 1 } END { exit !found }' CHANGELOG.md ||
die "[Unreleased] in CHANGELOG.md has no entries"
awk -v hdr="## [$version] - $(date -u +%F)" '{ print } /^## \[Unreleased\]/ { print ""; print hdr }' CHANGELOG.md >CHANGELOG.md.tmp
mv CHANGELOG.md.tmp CHANGELOG.md
go -C tools run -mod=readonly ./newsgen --repo-root ..
git add CHANGELOG.md docs/news
git commit -q -m "chore(release): v$version"
git tag -a "v$version" -m "v$version"
echo "tagged v$version"
+42 -42
View File
@@ -1,15 +1,15 @@
# Workflow definitions
A workflow is a YAML document: an id, what it declares to whatever starts it,
and an ordered list of steps. Definitions live in the control plane's
`workflow-definitions` resource, and operators edit them on the dashboard's
Workflows page (the Canvas and YAML tabs edit the same document). The shipped
workflows are in `internal/domain/workflow/shipped/`.
and an ordered list of steps. Definitions are stored in the control plane's
`workflow-definitions` resource and edited on the dashboard's Workflows page
(the Canvas and YAML tabs edit the same document). The shipped workflows are in
`internal/domain/workflow/shipped/`.
The server is the authority. It serves the step vocabulary, including each step
type's settings schema, in the `workflow-definitions` catalogue entry
(`x-step-types`), and validates every definition on save. This file
describes that vocabulary; when they disagree, the catalogue wins.
type's settings schema, in the `workflow-definitions` catalog entry
(`x-step-types`), and validates every definition when it is saved. This file
describes that vocabulary; when they disagree, the catalog wins.
```yaml
id: implement
@@ -41,11 +41,12 @@ steps:
|---|---|---|
| `id` | text | The workflow's name. Required, unique. |
| `steps` | list | The steps, run in order. At least one. |
| `repository` | `required` \| `optional` \| `none` | `required` (the default) clones the task's repository into a worktree. `optional` clones one when the run names a repository and uses a scratch workspace otherwise. `none` never clones; the workflow may use only steps that run without a repository. |
| `repository` | `required` \| `optional` \| `none` | `required` (the default) clones the task's repository into a worktree. `optional` clones one when the run names a repository and uses a scratch workspace otherwise. `none` never clones; only steps that run without a repository may be used. |
| `inputs` | mapping | Named, typed values whatever starts the run must supply: `{type, required}`, where type is `string`, `number`, `bool`, `object`, `array` or `any`. Steps read them as `{{ inputs.<name> }}`. |
| `outputs` | mapping | Named, typed results the run writes once each (same shape as inputs). A required output the run never writes parks it. A calling workflow reads them. |
| `profile` | text | The container profile (`[containers.profiles]`) the run's agents use. Resolution happens at dispatch. |
| `profile` | text | The container profile (`[containers.profiles]`) the run's agents use. Resolved when the task is dispatched. |
| `identity` | text | The identity every run acts as, whatever started it. Empty runs as the starter. |
| `needs` | mapping | Harness capabilities the run requires: `captures` (bool), `gate_retries` (number). Declared outputs imply `captures`. |
## A step
@@ -72,13 +73,13 @@ Any string setting may contain `{{ path }}`, replaced when the step runs:
| `task.issue`, `task.pr` | Issue and pull request numbers. |
| `task.plan` | The plan a `workflow.approve` step handed over (an approved PRD). |
| `task.review` | The review comments a remediation round addresses. |
| `inputs.<name>` | A declared input; the server refuses an undeclared one at save. |
| `inputs.<name>` | A declared input; an undeclared one is refused at save. |
| `steps.<id>.summary` | What an earlier step reported, e.g. an agent's finish summary or a gate's output. |
| `steps.<id>.result.<field>` | A field of an earlier agent's structured result, or an output of an earlier `workflow.call` that waits. At save, the server refuses a field that the agent's `result` schema or the callee's `outputs` does not declare. |
| `steps.<id>.result.<field>` | A field of an earlier agent's structured result, or an output of an earlier `workflow.call` that waits. A field the agent's `result` schema or the callee's `outputs` does not declare is refused at save. |
Reference only earlier steps; the server refuses a reference to a later or
unknown step on save. A value that does not exist at run time (for instance, a
step the run skipped) renders empty.
Only earlier steps may be referenced; a reference to a later or unknown step is
refused when the definition is saved. A value that does not exist at run time
(for instance, a step that was skipped) renders empty.
### Conditions
@@ -112,11 +113,12 @@ A run ends at the first step that sets an outcome: `workflow.finish`,
completes, with the last step's summary as its detail. A step that fails parks
the run unless it continues on failure.
An operator can retry a parked run from a top-level step instead of from the
start. The run skips the steps before it and keeps their results available to
references. The step's id (else its type) names the resume point, so give an id
to any step whose type appears twice. A run with a repository resumes only on
its pushed branch: work an earlier step did not push is not there.
A parked run can be retried from a top-level step instead of from the start.
The steps before it are skipped and their results stay available to
references. The resume point is named by the step's id (else its type), so
give an id to any step whose type appears twice. A run with a repository
resumes only on its pushed branch: work an earlier step did not push is not
there.
## Step types
@@ -128,11 +130,11 @@ _runs without a repository._
|---|---|---|
| `extra_rules` | text | Appended to the agent system prompt. |
| `gate` | `repository` \| `test-failure` | Hold the agent to the repository gate before it may finish; test-failure requires the tests to fail. |
| `mission` | text | What the step asks the agent to do. May reference {{ task.* }}, {{ inputs.* }} and {{ steps.<id>.* }}. |
| `mission` | text | What the agent is asked to do. May reference {{ task.* }}, {{ inputs.* }} and {{ steps.<id>.* }}. |
| `protect_tests` | bool | Write-block the repository test files. |
| `read_only` | bool | Restrict the agent to read-only tools. |
| `result` | mapping | A JSON Schema object the agent must return; later steps read it as steps.<id>.result. |
| `model` | text | A model alias configured under Settings > Agent models, such as `fast`. Omit it or use `default` to select the organisation's default agent model. |
| `model` | text | The model alias that runs the agent, e.g. default or fast. Empty means default. |
### `command.run`
@@ -154,12 +156,12 @@ _needs a repository._
| `push` | bool | Push the branch after committing. |
| `reference` | `Fixes` \| `Implements` \| `Refs` | How the commit links to the task issue. |
Hooks never run. go-git creates the commit, and it ignores `.git/hooks` and
`core.hooksPath`; the agent never runs git, so `pre-commit`, `commit-msg` and
`prepare-commit-msg` in the checkout are inert files. A
repository whose rules live only in a hook (a formatter, a secret scanner,
commitlint, a DCO trailer) gets a commit that does not satisfy them. The run
reports success, but the pull request fails the check afterwards. Put the same
Hooks never run. The commit is created by go-git, which ignores `.git/hooks`
and `core.hooksPath`, and the agent never runs git, so `pre-commit`,
`commit-msg` and `prepare-commit-msg` in the checkout are inert files. A
repository whose rules live only in a hook — a formatter, a secret scanner,
commitlint, a DCO trailer — gets a commit that does not satisfy them: the run
reports success and the pull request fails the check afterwards. Put the same
commands in `command.run` or the repository gate, which both run in the task
container before this step.
@@ -185,10 +187,10 @@ _needs a repository._
_needs a repository._
No settings. It runs the repository policy's `tooling` commands, in order, in
the task worktree: the installs a gate needs and the container does not ship
the task worktree — the installs a gate needs and the container does not ship
(protoc plugins, linters, generators). A repository that declares none installs
nothing and the step succeeds. Place it after `repo.prepare` and before any
`gate.*` step. A failing install fails the step with the command and its output,
`gate.*` step: a failing install fails the step with the command and its output
and says the gate did not run, so a missing toolchain is not read as a red
repository.
@@ -236,7 +238,7 @@ of sending it.
|---|---|---|
| `channel` | text | The messaging channel to send through. |
| `chat_id` | text | The channel's identifier for the chat. |
| `text` | text | The message. The run fills in references. |
| `text` | text | The message. References are filled in. |
A scheduled message is a schedule bound to a workflow whose only step is
`message.send`.
@@ -300,31 +302,29 @@ _runs without a repository._
| Setting | Type | Meaning |
|---|---|---|
| `detail` | text | Why the workflow handed off the task. |
| `workflow` | text | The workflow the handoff requeues the task under. |
| `detail` | text | Why the task was handed off. |
| `workflow` | text | The workflow the task is requeued under. |
`command.run` commands are `{name, argv, expect_failure}`: `argv` is the
program and its arguments, and `expect_failure` requires a non-zero exit.
`gate.diff-rules` rules are `{id, level, pattern, path, exclude_path, message}`:
the step requires `level` (`error` blocks, `warn` reports) and `pattern` (an RE2
expression the gate matches against each added line); `path` and `exclude_path`
are RE2 expressions that limit which files the rule applies to.
`level` (`error` blocks, `warn` reports) and `pattern` (an RE2 expression matched
against each added line) are required; `path` and `exclude_path` are RE2
expressions that limit which files the rule applies to.
## What starts a workflow
- **Issues**, by label: the Issue routing setting lists label to workflow rules
(first match wins) and a default for the rest. It starts as `bug` runs
`tdd`, `feature` runs `feasibility`, anything else runs `triage`, which
classifies it and hands off.
- **Issues**, by label: `bug` runs `tdd`, `feature` runs `feasibility`, anything
else runs `triage`, which classifies it and hands off.
- **Event bindings**: a webhook source mapped onto a workflow and its inputs
(Events page).
- **Schedules**: the scheduler captures each firing on the reserved `schedule`
source as a `Schedule fired` event (`schedule_id`, `name`, `scheduled_for`,
- **Schedules**: each firing is captured on the reserved `schedule` source as
a `Schedule fired` event (`schedule_id`, `name`, `scheduled_for`,
`fired_at`). A schedule trigger is a binding on that source using the
`schedule-fired` mapping, filtered to one `schedule_id`. A firing starts at
most one task per binding.
- **Playbooks**: a trigger (issue labels) and actions that dispatch
- **Playbooks**: a trigger (issue kind and labels) and actions that dispatch
workflows.
- **Other workflows**: `workflow.call` (a child run), `workflow.handoff` (the
same task, requeued), `workflow.approve` (once approved).
-10827
View File
File diff suppressed because it is too large. Load diff
+61 -16
View File
@@ -3,7 +3,6 @@ package main
import (
"context"
"encoding/base64"
"errors"
"flag"
"fmt"
@@ -22,6 +21,17 @@ import (
type workerRunner func(context.Context, agentworker.Settings, *slog.Logger) error
// runHold blocks until signalled and exits 0. It is the keepalive for a Kit
// container that runs no worker: the agent binary is archie's own and is
// mounted into every Kit, so the container needs no binary the image may not
// ship, and holds no environment of its own.
func runHold() int {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
<-ctx.Done()
return 0
}
func main() {
os.Exit(run())
}
@@ -31,9 +41,15 @@ func run() int {
}
func runCommand(args []string, getenv func(string) string, stderr io.Writer, runWorker workerRunner) int {
if len(args) > 0 && args[0] == "hold" {
return runHold()
}
if len(args) > 0 && args[0] == "relay" {
return runRelay(args[1:], stderr, agentworker.RunRelay)
}
if len(args) > 0 && args[0] == "mcp" {
return runMCP(args[1:], stderr, agentworker.RunCaptureMCP)
}
flags := flag.NewFlagSet("archie-agent", flag.ContinueOnError)
flags.SetOutput(stderr)
natsURLFlag := flags.String("nats-url", "", "NATS server URL (defaults to NATS_URL)")
@@ -53,12 +69,9 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
return 0
}
natsURL := *natsURLFlag
natsURL, natsToken := natsConnectionSettings(*natsURLFlag, getenv)
if natsURL == "" {
natsURL = getenv("NATS_URL")
}
if natsURL == "" {
_, _ = fmt.Fprintln(stderr, "error: -nats-url or NATS_URL is required")
fmt.Fprintln(stderr, "error: -nats-url or NATS_URL is required")
flags.Usage()
return 1
}
@@ -72,7 +85,7 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
stateStoreURL = getenv("STATE_STORE_URL")
}
if stateStoreURL == "" {
_, _ = fmt.Fprintln(stderr, "error: -state-store-url or STATE_STORE_URL is required (the legacy NATS storerpc path is deleted)")
fmt.Fprintln(stderr, "error: -state-store-url or STATE_STORE_URL is required (the legacy NATS storerpc path is deleted)")
flags.Usage()
return 1
}
@@ -81,17 +94,12 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
stateStoreToken = getenv("STATE_STORE_TOKEN")
}
stateStoreCA, err := base64.StdEncoding.DecodeString(getenv("STATE_STORE_CA_BASE64"))
if err != nil {
_, _ = fmt.Fprintf(stderr, "error: STATE_STORE_CA_BASE64: %v\n", err)
return 1
}
if err := runWorker(ctx, agentworker.Settings{
NATSURL: natsURL,
NATSToken: natsToken,
StateStoreTarget: stateStoreURL,
StateStoreToken: stateStoreToken,
StateStoreCA: stateStoreCA,
StateStoreCA: []byte(getenv("STATE_STORE_CA")),
ModelProxy: getenv(egress.ModelProxyEnv),
ModelProxyHosts: egress.ParseHosts(getenv(egress.ModelProxyHostsEnv)),
ModelProxyCA: getenv(egress.ModelProxyCAEnv),
@@ -101,6 +109,14 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
return 0
}
func natsConnectionSettings(flagURL string, getenv func(string) string) (url, token string) {
url = flagURL
if url == "" {
url = getenv("NATS_URL")
}
return url, getenv("NATS_TOKEN")
}
type relayServer func(ctx context.Context, forwards map[string]string) error
// runRelay is the sandbox egress relay: the container on both a sandbox's
@@ -134,14 +150,43 @@ func runRelay(args []string, stderr io.Writer, serve relayServer) int {
return 2
}
if len(forwards) == 0 {
_, _ = fmt.Fprintln(stderr, "error: at least one -forward is required")
fmt.Fprintln(stderr, "error: at least one -forward is required")
flags.Usage()
return 1
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
if err := serve(ctx, forwards); err != nil {
_, _ = fmt.Fprintln(stderr, "error:", err)
fmt.Fprintln(stderr, "error:", err)
return 1
}
return 0
}
type mcpServer func(ctx context.Context, specPath, capturesPath string) error
// runMCP serves a stage's capture tools to a harness over stdio. The
// harness starts it, so it runs as the harness user and holds no secrets.
func runMCP(args []string, stderr io.Writer, serve mcpServer) int {
flags := flag.NewFlagSet("archie-agent mcp", flag.ContinueOnError)
flags.SetOutput(stderr)
spec := flags.String("spec", "", "JSON file listing the stage's capture tools")
captures := flags.String("captures", "", "file accepted capture calls are appended to")
if err := flags.Parse(args); err != nil {
if errors.Is(err, flag.ErrHelp) {
return 0
}
return 2
}
if *spec == "" || *captures == "" {
fmt.Fprintln(stderr, "error: -spec and -captures are required")
flags.Usage()
return 1
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
if err := serve(ctx, *spec, *captures); err != nil {
fmt.Fprintln(stderr, "error:", err)
return 1
}
return 0
+4 -7
View File
@@ -19,13 +19,10 @@ import (
func main() { os.Exit(run()) }
func run() int {
// A leading non-flag argument selects a subcommand; anything else,
// A leading non-flag argument selects a recovery subcommand; anything else,
// including no arguments at all, serves the State Store contract. An
// unrecognised word is refused rather than ignored, so a mistyped command
// never leaves an operator watching a server start instead.
if args := os.Args[1:]; statestore.IsProvisionArgs(args) {
return statestore.RunProvision(context.Background(), args[1:], os.Stdout, os.Stderr)
}
// unrecognised word is refused rather than ignored, so a mistyped recovery
// command never leaves an operator watching a server start instead.
if args := os.Args[1:]; statestore.IsAccessResetArgs(args) {
return statestore.RunAccessReset(context.Background(), args[2:], os.Stderr)
}
@@ -39,7 +36,7 @@ func run() int {
flag.StringVar(&options.Listen, "listen", "", "state store gRPC listen address (defaults to [services.state].listen, else 127.0.0.1:9090)")
flag.StringVar(&options.ReadyAddr, "ready-addr", "", "optional readiness HTTP listen address (e.g. 127.0.0.1:9091)")
flag.Usage = func() {
_, _ = fmt.Fprintf(flag.CommandLine.Output(), "usage: archie-state-store [flags] # serve the State Store gRPC contract\n\ndatabase roles: archie-state-store provision -h\noffline recovery: archie-state-store <backup|restore|validate|rollback> -h | access reset -h\n\n")
fmt.Fprintf(flag.CommandLine.Output(), "usage: archie-state-store [flags] # serve the State Store gRPC contract\n\noffline recovery: archie-state-store <backup|restore|validate|rollback> -h | access reset -h\n\n")
flag.PrintDefaults()
}
flag.Parse()
+15 -28
View File
@@ -19,31 +19,20 @@ const recoveryUsage = `usage: archie-state-store <command> [flags]
With no command, archie-state-store serves the State Store gRPC contract.
The recovery commands operate on the PostgreSQL database configured by
database_url. Install the PostgreSQL client tools (pg_dump, pg_restore and
psql) and make sure they're on PATH.
The recovery commands are how an operator recovers a database the control
plane will not start on. They operate on the PostgreSQL database the
configuration's database_url names, through pg_dump and pg_restore (which
must be on PATH).
backup takes a consistent snapshot of a serving database. restore is
destructive and offline: stop every archie service first, since it refuses
while any of them holds its serving claim or the exclusive restore lock, and
every write made after the snapshot is lost. rollback refuses while the State
Store serves. There is no automatic schema rollback: the way back from a
migration is restoring the snapshot taken before it.
restore re-applies the deletions recorded outside the database, and refuses when
the record cannot account for them. Keep that record with your snapshots: a
snapshot restored without the current record cannot show which notes were
forgotten after it was taken. Nothing about a snapshot and a record can prove the
record is the newest one; that is the operator's responsibility, and this is why
a restore that cannot account for the data needs -accept-unrecorded-deletions,
which means forgotten notes may return.
while any of them holds its ownership claim, and every write made after the
snapshot is lost. rollback refuses while the State Store serves. There is no
automatic schema rollback: the way back from a migration is restoring the
snapshot taken before it.
backup -out FILE write a snapshot of the database
restore -from FILE replace the database with a snapshot
[-accept-unrecorded-deletions]
proceed although the record of deletions
cannot account for this data, so forgotten
notes may return
validate check the database, its stored settings and
the configuration the daemon would boot with
rollback -kind KIND replay an earlier revision of a stored
@@ -58,7 +47,7 @@ the daemon boots with, which names the database.
// 1 the operation failed, 2 the command line was wrong.
func runRecovery(args []string, stdout, stderr io.Writer) int {
if len(args) == 0 {
_, _ = fmt.Fprint(stderr, recoveryUsage)
fmt.Fprint(stderr, recoveryUsage)
return 2
}
command := args[0]
@@ -66,20 +55,18 @@ func runRecovery(args []string, stdout, stderr io.Writer) int {
switch command {
case statestore.RecoveryBackup, statestore.RecoveryRestore, statestore.RecoveryValidate, statestore.RecoveryRollback:
default:
_, _ = fmt.Fprintf(stderr, "archie-state-store: unknown command %q\n\n", command)
_, _ = fmt.Fprint(stderr, recoveryUsage)
fmt.Fprintf(stderr, "archie-state-store: unknown command %q\n\n", command)
fmt.Fprint(stderr, recoveryUsage)
return 2
}
flags := flag.NewFlagSet("archie-state-store "+command, flag.ContinueOnError)
flags.SetOutput(stderr)
flags.Usage = func() { _, _ = fmt.Fprint(stderr, recoveryUsage) }
flags.Usage = func() { fmt.Fprint(stderr, recoveryUsage) }
flags.StringVar(&options.Out, "out", "", "snapshot file backup writes")
flags.StringVar(&options.From, "from", "", "snapshot file restore reads")
flags.StringVar(&options.Kind, "kind", "", "control-plane resource kind rollback replays")
flags.Int64Var(&options.Revision, "revision", 0, "revision rollback replays (default: the newest one older than the current value)")
flags.BoolVar(&options.AcceptUnrecordedDeletions, "accept-unrecorded-deletions", false,
"restore although the record of deletions cannot account for this data: forgotten notes may return")
// The configuration names the PostgreSQL database, and validate also checks
// the stored settings against it.
flags.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory the daemon boots with")
@@ -93,15 +80,15 @@ func runRecovery(args []string, stdout, stderr io.Writer) int {
return 2
}
if flags.NArg() > 0 {
_, _ = fmt.Fprintf(stderr, "archie-state-store %s: unexpected argument %q\n", command, flags.Arg(0))
fmt.Fprintf(stderr, "archie-state-store %s: unexpected argument %q\n", command, flags.Arg(0))
return 2
}
summary, err := statestore.RunRecovery(context.Background(), options)
if err != nil {
_, _ = fmt.Fprintf(stderr, "archie-state-store %s: %v\n", command, err)
fmt.Fprintf(stderr, "archie-state-store %s: %v\n", command, err)
return 1
}
_, _ = fmt.Fprintln(stdout, summary)
fmt.Fprintln(stdout, summary)
return 0
}
-134
View File
@@ -1,134 +0,0 @@
// Command archie is the single Archie binary. It parses flags and hands over to
// the composition root.
package main
import (
"context"
"errors"
"flag"
"fmt"
"os"
"os/signal"
"strings"
"syscall"
"github.com/samcharles93/archie-core/internal/app/archie"
"github.com/samcharles93/archie-core/internal/buildinfo"
)
type exitCodeError int
func (e exitCodeError) Error() string { return fmt.Sprintf("exit %d", int(e)) }
func main() {
if err := run(); err != nil {
if code, ok := errors.AsType[exitCodeError](err); ok {
os.Exit(int(code))
}
fmt.Fprintln(os.Stderr, "archie:", err)
os.Exit(1)
}
}
func run() error {
configPath := flag.String("config", archie.DefaultConfigPath(), "path to the bootstrap config file")
specPath := flag.String("spec", "", "path to the bootstrap spec file (used by 'archie bootstrap')")
newIdentity := flag.Bool("new-age-identity", false, "print a new age identity for age_identity and exit")
showVersion := buildinfo.RegisterVersionFlag("archie")
flag.Usage = func() {
_, _ = fmt.Fprintln(flag.CommandLine.Output(), "usage: archie [flags]\n archie migrate apply database migrations and runtime grants\n archie bootstrap idempotently provision initial owner and SSO settings\n archie rekey rotate age sealing identities in one transaction\n archie bundle validate, export, diff, or apply promotion bundles\n archie catalogue generate keys or mirror extension catalogues offline\n archie openapi print the API's OpenAPI document")
flag.PrintDefaults()
}
flag.Parse()
showVersion()
if *newIdentity {
return archie.NewAgeIdentity(os.Stdout)
}
switch flag.Arg(0) {
case "":
case "migrate":
return runMigrate(*configPath, flag.Args()[1:])
case "bootstrap":
return runBootstrap(*configPath, *specPath, flag.Args()[1:])
case "rekey":
return runRekey(*configPath, flag.Args()[1:])
case "bundle":
code, err := runBundle(*configPath, flag.Args()[1:])
if err != nil {
return err
}
if code != 0 {
return exitCodeError(code)
}
return nil
case "catalogue":
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
return archie.RunCatalogueCLI(ctx, flag.Args()[1:], os.Stdout)
case "openapi":
doc, err := archie.Document()
if err != nil {
return err
}
_, err = os.Stdout.Write(doc)
return err
default:
return fmt.Errorf("unknown command %q", flag.Arg(0))
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
return archie.Run(ctx, *configPath)
}
func runRekey(configPath string, args []string) error {
fs := flag.NewFlagSet("rekey", flag.ContinueOnError)
oldIdentity := fs.String("old-identity", "", "current age identity (or ARCHIE_OLD_AGE_IDENTITY[_FILE])")
newIdentity := fs.String("new-identity", "", "replacement age identity (or ARCHIE_NEW_AGE_IDENTITY[_FILE])")
newBackupsRaw := fs.String("new-backups", "", "comma-separated age backup recipients for re-sealed values")
if err := fs.Parse(args); err != nil {
return err
}
var newBackups []string
for r := range strings.SplitSeq(*newBackupsRaw, ",") {
if r = strings.TrimSpace(r); r != "" {
newBackups = append(newBackups, r)
}
}
rcfg, err := archie.LoadRekeyConfig(*oldIdentity, *newIdentity, newBackups)
if err != nil {
return err
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
return archie.Rekey(ctx, configPath, rcfg)
}
func runMigrate(defaultConfig string, args []string) error {
fs := flag.NewFlagSet("migrate", flag.ContinueOnError)
configPath := fs.String("config", defaultConfig, "path to the bootstrap config file")
if err := fs.Parse(args); err != nil {
return err
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
return archie.Migrate(ctx, *configPath)
}
func runBootstrap(defaultConfig, defaultSpec string, args []string) error {
fs := flag.NewFlagSet("bootstrap", flag.ContinueOnError)
configPath := fs.String("config", defaultConfig, "path to the bootstrap config file")
specPath := fs.String("spec", defaultSpec, "path to the bootstrap spec file")
if err := fs.Parse(args); err != nil {
return err
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
return archie.Bootstrap(ctx, *configPath, *specPath)
}
func runBundle(configPath string, args []string) (int, error) {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
return archie.RunBundleCLI(ctx, configPath, args, os.Stdout)
}
+2 -17
View File
@@ -7,12 +7,7 @@
# Secrets are never written here: each is a {engine, key} reference. The
# built-in "env" engine reads key as an environment variable.
# The URL the services connect as: a least-privilege role, created by
# `archie-state-store provision`. migration_database_url is the role that owns
# the schema and runs migrations; when it is absent, database_url does both,
# which is what a single-role install does.
# database_url = "postgres://archie_runtime:secret@localhost:5432/archie?sslmode=disable"
# migration_database_url = "postgres://archie_migrator:secret@localhost:5432/archie?sslmode=disable"
# database_url = "postgres://archie:archie@localhost:5432/archie?sslmode=disable"
# work_dir = "~/.local/share/archie/work"
# state_dir = "~/.local/share/archie"
@@ -74,8 +69,7 @@ target = "127.0.0.1:9090"
# [nats]
# mode = "embedded" # or "external" with url
# url = "nats://localhost:4222"
# token_env = "NATS_TOKEN" # external: the archie-callout user's password
# callout_issuer_seed_env = "NATS_CALLOUT_SEED" # external: account nkey seed; the broker's auth_callout issuer is its public key
# token_env = "NATS_TOKEN"
# [log]
# file = "~/.local/share/archie/logs/archied.log"
@@ -98,15 +92,6 @@ target = "127.0.0.1:9090"
# catalogue = "registry.example/owner/archipelago/catalogue"
# catalogue_key = "base64 public key"
# The image task containers run. There is no default: the daemon reports a
# missing containers.image at startup instead of guessing a registry, so set
# your own pinned reference -- see
# deployments/systemd-user-service.md#6-pinning-the-archie-agent-image.
# [containers]
# image = "registry.example.com/archie/archie-agent@sha256:<digest>"
# pull_policy = "missing"
# registry_auth = { engine = "env", key = "ARCHIE_REGISTRY_AUTH" } # when the registry needs a login
# Long-running agent loops that maintain memory, skills and — in dry run —
# file follow-up issues from recent runs. Definitions are data: the server
# validates them and the gateway applies them live.
+23 -28
View File
@@ -14,27 +14,23 @@ contracts (or NATS, for task actions):
Without `archie-messaging` the channels are simply absent, so it needs a unit
of its own (`deployments/systemd-user-service.md`).
`archie-agent` (the per-task sandboxed runtime) has no unit of its own. The
`archie-agent` (the per-task sandboxed runtime) has no unit of its own: it
ships beside `archied` because a Kit run mounts it from that directory. The
agent image is a separate thing, pulled for the containers `archied` spawns
per task: `[containers].image` has no default, and the daemon reports it as
missing at startup. This archive's `release.json` pins the digest the release
published, and the deploy step passes it to the install, so a release install
needs nothing by hand; a from-source install sets the image itself. Set
`[containers].registry_auth` when the reference is on a registry that needs a
login -- see
per task: `[containers].image` defaults to
`git.catlow.cloud/sam/archie-agent:latest`, while this archive's `release.json`
pins the digest the release published. Set `[containers].registry_auth` when
that reference is on a registry that needs a login -- see
`deployments/systemd-user-service.md#6-pinning-the-archie-agent-image`.
## Quickstart
1. Pick a starting configuration. The full set of annotated templates lives
in this repository's `deployments/` directory on GitHub
(<https://offloaded.dev>):
(<https://offloaded.dev>) —
`standalone.toml` (no forge, the simplest start),
`single-forge-github.toml` and `docker-nats-stack.toml` cover the common cases. Every one needs
PostgreSQL 18 with the `archie_migrator` and `archie_runtime` roles created
once by `archie-state-store provision` (see `deployments/README.md`);
`docker compose up -d postgres` plus that command gives the local default.
Copy whichever fits to:
PostgreSQL 18 at `database_url`. Copy whichever fits to:
```bash
mkdir -p ~/.config/archie
@@ -47,8 +43,8 @@ login -- see
3. Start the five processes. Order does not matter: a service whose peer is
not up yet waits for it and reports it as degraded on its health surface
meanwhile. The Gateway waits for the daemon's NATS endpoint when the daemon
runs the embedded broker.
meanwhile. The Gateway waits for the daemon's NATS endpoint when the broker
is embedded.
```bash
./archie-state-store -config ~/.config/archie/config.toml -listen 127.0.0.1:9090 &
@@ -68,16 +64,16 @@ login -- see
## Version
The release pipeline builds this archive's binaries from the `archied` release
tag in its filename. `archie-ui`, `archie-gateway`, `archie-state-store` and
This archive's binaries are built from the `archied` release tag in its
filename; `archie-ui`, `archie-gateway`, `archie-state-store` and
`archie-messaging` ship at that same version rather than
being independently tagged (see `RELEASING.md` in the source repository for why
only `archied` and `archie-agent` are independently versioned).
`archie-state-store`, `archie-gateway`, `archie-messaging`, `archie-ui` and
`archied` are services that must be running and addressable. `archie-messaging`
`archied` are services that must be running and addressable; `archie-messaging`
carries the Telegram, email and webhook channels since the v1.30.0 extraction, so
an install (or an upgrade across v1.30.0) needs its unit as well. See
an install (or an upgrade across v1.30.0) needs its unit as well -- see
`deployments/systemd-user-service.md`.
### Native self-update
@@ -86,8 +82,8 @@ Install on Settings → Status runs `archied update install -version X` against
the release source in the update settings. It fetches release `vX`, refuses it
unless the source's key signed its statement, and downloads the Linux/amd64 zip
only if it hashes to the digest that statement names. Every host binary in the
zip must report `X`. It then pulls the agent image the statement pins by digest and backs up the database to
`db.pre-update.dump` in the state directory. It stages the new binaries beside the
zip must report `X`. It then pulls the agent image the statement pins by digest, backs up the database to
`db.pre-update.dump` in the state directory, stages the new binaries beside the
live ones and hands the transaction to `archied update watchdog` in a process of
its own (a transient systemd user unit). Nothing that runs changes until the
watchdog takes over.
@@ -108,10 +104,9 @@ staged executables by rename, switches the control-plane image policy (only the
image field, with conflict detection), and restarts the units in order through
`systemctl --user`. archied must report the new version and stay healthy for
120 seconds. Otherwise the watchdog restores the previous binaries and image
policy. Data is not rolled back unless the new release migrated the database.
Then the previous binaries cannot serve it, so the watchdog restores the
pre-update backup, and the outcome report says that the restore discarded every
write since the update began.
policy. Data is not rolled back unless the new release migrated the database:
then the previous binaries cannot serve it, so the pre-update backup is restored
and the outcome report says that every write since the update began is gone.
Without a systemd user manager the watchdog switches binaries and image policy
but restarts nothing, and the install reports that the services need a manual
restart.
@@ -119,10 +114,10 @@ restart.
Transactions live in `${XDG_STATE_HOME:-~/.local/state}/archie/update`, outside
the binary directory: `transaction/journal.json`, `transaction/previous/`, and
`transaction/archied`, the frozen copy of the archied that wrote the journal. On
daemon boot, archied hands an interrupted transaction to that frozen watchdog
with `-recover` before normal startup. The watchdog discards a transaction that
never started, rolls back one that was switching or observing, and finishes a
decided one. To recover manually, run
daemon boot, an interrupted transaction is
handed to that frozen watchdog with `-recover` before normal startup: a
transaction that never started is discarded, one that was switching or observing
is rolled back, and a decided one is finished. To recover manually, run
`transaction/archied update watchdog -recover -bin-dir ~/.local/bin` from that
state directory. A failed recovery keeps the journal for another attempt.
+12 -42
View File
@@ -42,9 +42,7 @@ systemctl --user start archied
Start order does not matter: a service waits for its peers and reports them as
degraded meanwhile. Every template needs PostgreSQL 18 at `database_url`;
`docker compose up -d postgres` provides the default server.
`archie-state-store provision` creates its two login roles once per database --
see [Database roles](#database-roles).
`docker compose up -d postgres` provides the default one.
The State Store service (`archie-state-store`) owns the task data in the
PostgreSQL database `database_url` names and serves the `StateStore` gRPC
@@ -56,39 +54,10 @@ gateway address, because a container cannot reach the host's loopback. A
non-loopback address needs `[tls]` certificates from your own CA; see
`config.example.toml`.
## Database roles
The services do not connect as the database owner. `archie-state-store
provision` creates, or reconciles, two login roles in an existing PostgreSQL
database and hands the schema to one of them:
- `archie_migrator` owns the schema and its objects and runs the goose
migrations;
- `archie_runtime` may read and write rows (SELECT, INSERT, UPDATE, DELETE,
sequence USAGE, function EXECUTE) and has no CREATE privilege, so it cannot
change the schema.
Run it once per database with a role allowed to create roles and take ownership
of the schema (the database owner or a superuser). Then point the templates at
the two roles: `database_url` is the runtime URL and `migration_database_url`
the migration one. The command is idempotent, so re-running it after an upgrade
reconciles objects a migration added.
```bash
archie-state-store provision \
-admin-url "postgres://owner:secret@db:5432/archie" \
-runtime-url "postgres://archie_runtime:secret@db:5432/archie" \
-migration-url "postgres://archie_migrator:secret@db:5432/archie"
```
The bundled installer and `task dev` run this for you. A configuration with only
`database_url` keeps working exactly as before: that one role applies the
schema and serves, which is what an install that has not split the roles does.
## Running the dashboard
The standalone UI Service (`archie-ui`) serves the dashboard's API, not
`archied`. The dashboard itself ships from archie-frontend as its own image.
The dashboard is served by the standalone UI Service (`archie-ui`), not by
`archied`.
It reads the same `config.toml`, dials the Gateway and State Store targets
already configured there, and binds `[web].listen` (`127.0.0.1:8484` by
default). Start it after the Gateway and the State Store:
@@ -99,16 +68,17 @@ archie-ui -config ~/.config/archie/config.toml
Open the dashboard to configure the organisation, workspace and first administrator account.
Use HTTPS through a reverse proxy for remote access, and complete setup before exposing it publicly.
`archied` runs no dashboard listener at all, so archie-ui receives webhook
capture (`POST /webhooks/capture/{source}`) and the binding-dispatch loop in
`archied` consumes what arrives from the shared State Store.
`archied` runs no dashboard listener at all, so webhook capture
(`POST /webhooks/capture/{source}`) is received by archie-ui and the
binding-dispatch loop in `archied` consumes what arrives from the shared
State Store.
The dashboard speaks plain HTTP. A non-loopback bind therefore carries the
session cookie and the provider token in clear over the network, and
archie-ui warns about exactly that at startup. Terminate TLS in front of it
(a reverse proxy or the tunnel itself) and set
`[web].trust_forwarded_headers = true` to declare the proxy and silence the
warning. Leaving it off while exposing the port directly is the case the
warning; leaving it off while exposing the port directly is the case the
warning names.
Auth note: archie-ui authenticates to its dependencies with its `[tls]`
@@ -149,10 +119,10 @@ curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:9091/healthz #
curl -s http://127.0.0.1:9091/health/detailed # state_db component -> 200, or 503 when degraded
```
A running State Store holds the `state-store` ownership lock on its database.
A running State Store holds the `state-store` ownership lock on its database;
`archied` and `archie-gateway` never open the task tables directly, so a second
store process on the same `database_url` refuses to start. A consumer that
store process on the same `database_url` refuses to start, and a consumer that
opens the task tables indicates dual-store ownership.
The readiness probe is the single-writer check the runbook has against a
degraded store: a `503` from `/health/detailed` means the operator should
start `archied` only after the store is healthy.
degraded store: a `503` from `/health/detailed` means `archied` should be
started only after the store is healthy.
-80
View File
@@ -1,80 +0,0 @@
# Hardened enterprise overlay for deployments/archie/compose.yml.
# Usage: docker compose -f compose.yml -f compose.enterprise.yml up -d
#
# Ensure ./config.toml omits database.owner_url and ./secrets/* holds:
# - db_runtime_url (DML-only archie_app connection string)
# - db_owner_url (DDL archie_owner connection string, mounted only in archie-migrate)
# - age_identity (AGE-SECRET-KEY-1...)
# - admin_token_sha256 (hex SHA-256)
services:
archie-migrate:
image: ${ARCHIE_IMAGE:-gcr.io/distroless/static-debian12:nonroot}
restart: "no"
user: "65532:65532"
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,nodev,size=64m
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
entrypoint: ["/archie/archie"]
command: ["-config", "", "migrate"]
environment:
HOME: /tmp
SSL_CERT_FILE: /etc/ssl/certs/enterprise-ca.crt
ARCHIE_DATABASE_URL_FILE: /run/secrets/db_runtime_url
ARCHIE_DATABASE_OWNER_URL_FILE: /run/secrets/db_owner_url
secrets:
- db_runtime_url
- db_owner_url
volumes:
- ./bin/archie:/archie/archie:ro
- ${ARCHIE_CA_BUNDLE:-./certs/enterprise-ca.crt}:/etc/ssl/certs/enterprise-ca.crt:ro
networks: [internal]
depends_on:
archie-db:
condition: service_healthy
archie:
image: ${ARCHIE_IMAGE:-gcr.io/distroless/static-debian12:nonroot}
user: "65532:65532"
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,nodev,size=128m
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
- seccomp=./seccomp.json
environment:
HOME: /tmp
SSL_CERT_FILE: /etc/ssl/certs/enterprise-ca.crt
HTTPS_PROXY: ${HTTPS_PROXY:-}
HTTP_PROXY: ${HTTP_PROXY:-}
NO_PROXY: ${NO_PROXY:-localhost,127.0.0.1,archie-db}
ARCHIE_DATABASE_URL_FILE: /run/secrets/db_runtime_url
ARCHIE_AGE_IDENTITY_FILE: /run/secrets/age_identity
ARCHIE_ADMIN_TOKEN_SHA256_FILE: /run/secrets/admin_token_sha256
secrets:
- db_runtime_url
- age_identity
- admin_token_sha256
volumes:
- ${ARCHIE_CA_BUNDLE:-./certs/enterprise-ca.crt}:/etc/ssl/certs/enterprise-ca.crt:ro
depends_on:
archie-db:
condition: service_healthy
archie-migrate:
condition: service_completed_successfully
secrets:
db_runtime_url:
file: ./secrets/db_runtime_url
db_owner_url:
file: ./secrets/db_owner_url
age_identity:
file: ./secrets/age_identity
admin_token_sha256:
file: ./secrets/admin_token_sha256
-76
View File
@@ -1,76 +0,0 @@
name: archie
services:
archie-db:
image: postgres:18-alpine
restart: unless-stopped
environment:
POSTGRES_DB: archie
POSTGRES_USER: archie_owner
POSTGRES_PASSWORD: ${ARCHIE_OWNER_PASSWORD:?}
ARCHIE_APP_PASSWORD: ${ARCHIE_APP_PASSWORD:?}
volumes:
- ./postgres:/var/lib/postgresql
- ./initdb:/docker-entrypoint-initdb.d:ro
networks: [internal]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U archie_owner -d archie"]
interval: 5s
timeout: 3s
retries: 20
archie:
image: gcr.io/distroless/static-debian12:nonroot
restart: unless-stopped
command: ["/archie/archie", "-config", "/archie/config.toml"]
environment:
# The age secret engine resolves secret:// references from this file with
# this identity. Both are paths the state mount already holds, so no key
# is in this file.
AGE_FILE: /archie/state/age/secrets.age
AGE_IDENTITY: /archie/state/age/identity.txt
# Docker's default seccomp profile plus the one clone the extension host
# needs to confine an extension in its own user and network namespace.
security_opt:
- seccomp=./seccomp.json
volumes:
- ./bin/archie:/archie/archie:ro
- ./config.toml:/archie/config.toml:ro
- ./extensions:/archie/extensions:ro
- ./state:/archie/state
- ./catalogue:/archie/catalogue:ro
networks: [internal]
depends_on:
archie-db:
condition: service_healthy
archie-frontend:
image: ${ARCHIE_FRONTEND_IMAGE:-ghcr.io/archie-platform/archie-frontend:v0.1.0}
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
networks: [internal]
# The ingress: one host, routed by path to the backend or the dashboard.
edge:
image: nginxinc/nginx-unprivileged:1.29-alpine
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
volumes:
- ./edge.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- "${ARCHIE_BIND:?}:8080"
networks: [internal]
depends_on: [archie, archie-frontend]
networks:
internal: {}
-95
View File
@@ -1,95 +0,0 @@
#!/usr/bin/env bash
# Deploys the single binary's stack to a host over ssh: deploy.sh root@staging-host.
# The first run creates the secrets on the host; they never leave it. The
# dashboard image is built from an archie-frontend checkout beside this one, or
# from ARCHIE_FRONTEND.
set -euo pipefail
target=${1:?usage: deploy.sh user@host [bind-address:port]}
bind=${2:-}
here=$(cd "$(dirname "$0")" && pwd)
repo=$(cd "$here/../.." && pwd)
frontend=${ARCHIE_FRONTEND:-"$(cd "$repo/.." && pwd)/archie-frontend"}
dir=/root/archie
version=$(git -C "$repo" describe --tags --always --dirty)
frontend_version=$(git -C "$frontend" describe --tags --always --dirty)
frontend_image="archie-frontend:$frontend_version"
docker build -q --build-arg VERSION="$frontend_version" \
--build-arg REVISION="$(git -C "$frontend" rev-parse HEAD)" \
-t "$frontend_image" "$frontend" >/dev/null
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -C "$repo" -trimpath \
-ldflags "-X github.com/samcharles93/archie-core/internal/buildinfo.Version=$version" \
-o "$here/.build/archie" ./cmd/archie
ssh "$target" "mkdir -p $dir/bin $dir/initdb $dir/extensions $dir/catalogue $dir/state && chown 65532:65532 $dir/state"
scp -q "$here/compose.yml" "$target:$dir/compose.yml"
scp -q "$here/edge.conf" "$target:$dir/edge.conf"
docker save "$frontend_image" | ssh "$target" docker load -q
scp -q "$here/seccomp.json" "$target:$dir/seccomp.json"
scp -q "$here/initdb/01-roles.sh" "$target:$dir/initdb/01-roles.sh"
scp -q "$here/.build/archie" "$target:$dir/bin/archie.new"
ssh "$target" BIND="$bind" DIR="$dir" FRONTEND_IMAGE="$frontend_image" bash -s <<'REMOTE'
set -euo pipefail
cd "$DIR"
chmod 755 initdb/01-roles.sh
mv bin/archie.new bin/archie && chmod 755 bin/archie
if [ ! -f .env ]; then
[ -n "$BIND" ] || { echo "first deploy needs a bind address, e.g. 10.0.0.1:8099" >&2; exit 1; }
umask 077
printf 'ARCHIE_OWNER_PASSWORD=%s\nARCHIE_APP_PASSWORD=%s\nARCHIE_BIND=%s\n' \
"$(openssl rand -hex 24)" "$(openssl rand -hex 24)" "$BIND" > .env
fi
if [ ! -f config.toml ]; then
set -a; . ./.env; set +a
umask 077
cat > config.toml <<CONFIG
listen = "0.0.0.0:8080"
[database]
url = "postgres://archie_app:${ARCHIE_APP_PASSWORD}@archie-db:5432/archie?sslmode=disable"
owner_url = "postgres://archie_owner:${ARCHIE_OWNER_PASSWORD}@archie-db:5432/archie?sslmode=disable"
CONFIG
chown 65532:65532 config.toml
fi
# The admin token guards /api/. Only its hash goes in the config, as a
# top-level key, so it must come before the [database] table.
if ! grep -q '^admin_token_sha256' config.toml; then
umask 077
openssl rand -hex 32 | tr -d '\n' > admin-token
hash=$(sha256sum admin-token | cut -d' ' -f1)
sed -i "1i admin_token_sha256 = \"$hash\"" config.toml
chown 65532:65532 config.toml
fi
# Fetched extension binaries and other state outside the database live in
# the mounted state directory, so they survive the container being recreated.
if ! grep -q '^state_dir' config.toml; then
sed -i '1i state_dir = "/archie/state"' config.toml
fi
# The age identity seals the credentials Archie keeps. It is made here and
# never leaves the host; back it up, or credentials die with it.
if ! grep -q '^age_identity' config.toml; then
umask 077
identity=$(bin/archie -new-age-identity)
sed -i "1i age_identity = \"$identity\"" config.toml
unset identity
chown 65532:65532 config.toml
fi
# The age secret engine resolves secret:// references from this key and the
# file sealed to it. Skipped, not fatal, where age isn't installed: the engine
# simply has nothing to read.
if [ ! -f state/age/identity.txt ] && command -v age-keygen >/dev/null; then
umask 077
mkdir -p state/age
age-keygen -o state/age/identity.txt 2>/dev/null
chown -R 65532:65532 state/age
echo "age secret engine recipient: $(age-keygen -y state/age/identity.txt)"
fi
sed -i '/^ARCHIE_FRONTEND_IMAGE=/d' .env
echo "ARCHIE_FRONTEND_IMAGE=$FRONTEND_IMAGE" >> .env
docker compose up -d --remove-orphans
docker compose up -d --force-recreate archie
# edge.conf is a bind mount, so a changed route table needs a restart.
docker compose restart edge
REMOTE
echo "deployed $version and dashboard $frontend_version to $target"
-33
View File
@@ -1,33 +0,0 @@
# The Compose stack's ingress: API, sign-in and webhook paths go to the
# backend, every other path to the dashboard, all on one host.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8080;
server_name _;
server_tokens off;
client_max_body_size 64m;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# TLS ends at the proxy in front of this one, so keep the scheme it saw.
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
location ~ ^/(api|oauth2|hooks)(/|$) {
# The dashboard's live stream is a long-lived response; buffering it
# would hold every update back.
proxy_buffering off;
proxy_read_timeout 1h;
proxy_pass http://archie:8080;
}
location / {
proxy_pass http://archie-frontend:8080;
}
}
-9
View File
@@ -1,9 +0,0 @@
#!/bin/sh
# Runs once, on an empty data directory. The owner (POSTGRES_USER) runs
# migrations; archie_app is the runtime role and holds no DDL rights.
set -eu
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \
-v app_password="$ARCHIE_APP_PASSWORD" <<'SQL'
CREATE ROLE archie_app LOGIN PASSWORD :'app_password';
GRANT CONNECT ON DATABASE archie TO archie_app;
SQL
File diff suppressed because it is too large. Load diff
+3 -23
View File
@@ -9,36 +9,16 @@
# [web] entirely.
# `task dev` runs archie-state-store against this overlay, and the State Store
# fails closed without a PostgreSQL URL. These must reach the `postgres`
# fails closed without a PostgreSQL URL. This must reach the `postgres`
# service in docker-compose.yml, which `task dev` brings up first via
# dev:postgres -- keep them and that service in agreement. dev:postgres also
# provisions the two roles: the services serve as archie_runtime and migrate
# as archie_migrator, while the Compose-created archie role is only the
# admin that created them.
# dev:postgres -- keep the URL and that service in agreement.
bot_user = "archie-dev"
database_url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"
migration_database_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
[web]
listen = "127.0.0.1:8484"
# The installed config may point [nats] at the optional external broker, which
# `task dev` never starts. An explicit empty url overrides it, so the daemon
# runs the embedded broker as in the e2e stack; the broker binds the host
# gateway, which task containers reach.
[nats]
mode = "embedded"
url = ""
# Task containers run the agent image `task image:agent` builds locally
# (docker-compose.yml tags it git.catlow.cloud/sam/archie-agent:latest), and
# the "missing" pull policy never pulls over the local build. There is no
# code-level default image: an unset containers.image fails validation at
# startup.
[containers]
image = "git.catlow.cloud/sam/archie-agent:latest"
# `task dev` runs archie-state-store via dev:state-store, which passes no
# -listen, so the listen below is the port the store binds. It must agree with
# the target: these two lines are the only place that pair is stated. Move them
+3 -8
View File
@@ -16,12 +16,9 @@ bot_user = "archie"
work_dir = "~/.local/share/archie/work"
state_dir = "~/.local/share/archie" # NATS store, task logs
# The State Store's PostgreSQL connection (PostgreSQL 18, required).
# `docker compose up -d postgres` provides the local default; point it at
# your own Postgres 18 server otherwise. The services serve as archie_runtime
# and migrations run as archie_migrator; create both once with
# `archie-state-store provision -h` (deployments/README.md).
database_url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"
migration_database_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
# `docker compose up -d postgres` provides this local default; point it at
# your own Postgres 18 server otherwise.
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
[services.gateway]
target = "127.0.0.1:8585"
@@ -59,8 +56,6 @@ mode = "external"
# The pinned Compose-network gateway is reachable from both the host daemon
# and the task containers it launches on archie-core_default.
url = "nats://172.19.0.1:4222"
token_env = "NATS_TOKEN"
callout_issuer_seed_env = "NATS_CALLOUT_SEED"
[containers]
network = "archie-core_default"
-13
View File
@@ -1,13 +0,0 @@
apiVersion: v2
name: archie
description: Event-driven agentic automation platform with pre-action governance and isolated extension execution.
type: application
version: 0.1.0
appVersion: "1.0.0"
keywords:
- archie
- automation
- governance
- enterprise
maintainers:
- name: Archie Platform Team
@@ -1,129 +0,0 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "archie.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
*/}}
{{- define "archie.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "archie.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels.
*/}}
{{- define "archie.labels" -}}
helm.sh/chart: {{ include "archie.chart" . }}
{{ include "archie.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels.
*/}}
{{- define "archie.selectorLabels" -}}
app.kubernetes.io/name: {{ include "archie.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
ServiceAccount name.
*/}}
{{- define "archie.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "archie.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Container image reference, preferring digest pinning when configured.
*/}}
{{- define "archie.image" -}}
{{- if .Values.image.digest }}
{{- printf "%s@%s" .Values.image.repository .Values.image.digest }}
{{- else }}
{{- printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) }}
{{- end }}
{{- end }}
{{/*
Migration secret name.
*/}}
{{- define "archie.migrateSecretName" -}}
{{- default .Values.secrets.existingSecret .Values.migrate.existingSecret }}
{{- end }}
{{/*
Render a map to YAML while omitting keys whose value is null (used so OpenShift
restricted-v2 overlays can unset runAsUser, runAsGroup, and fsGroup cleanly).
*/}}
{{- define "archie.compactYaml" -}}
{{- $out := dict -}}
{{- range $k, $v := . -}}
{{- if not (kindIs "invalid" $v) -}}
{{- if kindIs "map" $v -}}
{{- $sub := include "archie.compactYaml" $v -}}
{{- if $sub -}}
{{- $_ := set $out $k (fromYaml $sub) -}}
{{- end -}}
{{- else -}}
{{- $_ := set $out $k $v -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if $out -}}
{{- toYaml $out -}}
{{- end -}}
{{- end }}
{{/*
Dashboard name and selector labels. The name differs from the API's, so the
API's Service and NetworkPolicy never select dashboard pods.
*/}}
{{- define "archie.frontendFullname" -}}
{{- printf "%s-frontend" (include "archie.fullname" .) | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "archie.frontendSelectorLabels" -}}
app.kubernetes.io/name: {{ printf "%s-frontend" (include "archie.name" .) | trunc 63 | trimSuffix "-" }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "archie.frontendLabels" -}}
helm.sh/chart: {{ include "archie.chart" . }}
{{ include "archie.frontendSelectorLabels" . }}
app.kubernetes.io/component: frontend
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- define "archie.frontendImage" -}}
{{- if .Values.frontend.image.digest }}
{{- printf "%s@%s" .Values.frontend.image.repository .Values.frontend.image.digest }}
{{- else }}
{{- printf "%s:%s" .Values.frontend.image.repository .Values.frontend.image.tag }}
{{- end }}
{{- end }}
@@ -1,71 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "archie.fullname" . }}-config
labels:
{{- include "archie.labels" . | nindent 4 }}
data:
config.toml: |
listen = {{ .Values.config.listen | quote }}
{{- if .Values.metrics.enabled }}
metrics_listen = {{ printf "0.0.0.0:%v" .Values.metrics.port | quote }}
{{- end }}
state_dir = {{ .Values.config.stateDir | quote }}
shutdown_grace = {{ .Values.config.shutdownGrace | quote }}
{{- if .Values.config.ageBackupRecipients }}
age_backup_recipients = [
{{- range $i, $r := .Values.config.ageBackupRecipients }}
{{ $r | quote }}{{ if lt $i (sub (len $.Values.config.ageBackupRecipients) 1) }},{{ end }}
{{- end }}
]
{{- end }}
[catalogue]
disable_auto_update = {{ .Values.config.catalogue.disableAutoUpdate }}
{{- if .Values.config.catalogue.location }}
location = {{ .Values.config.catalogue.location | quote }}
{{- end }}
{{- if .Values.config.catalogue.publicKey }}
public_key = {{ .Values.config.catalogue.publicKey | quote }}
{{- end }}
{{- if .Values.config.catalogue.authSecret }}
auth_file = "/run/secrets/archie-catalogue/config.json"
{{- end }}
[extensions]
require_remote = {{ .Values.config.extensions.requireRemote }}
{{- if .Values.config.extensions.tls.existingSecret }}
ca_file = {{ printf "%s/ca.crt" .Values.config.extensions.tls.mountPath | quote }}
cert_file = {{ printf "%s/tls.crt" .Values.config.extensions.tls.mountPath | quote }}
key_file = {{ printf "%s/tls.key" .Values.config.extensions.tls.mountPath | quote }}
{{- end }}
{{- range $name, $ep := .Values.config.extensions.remote }}
[extensions.remote.{{ $name }}]
address = {{ $ep.address | quote }}
{{- if $ep.serverName }}
server_name = {{ $ep.serverName | quote }}
{{- end }}
{{- end }}
{{- if and .Values.bootstrap.enabled .Values.bootstrap.publicUrl }}
bootstrap.toml: |
public_url = {{ .Values.bootstrap.publicUrl | quote }}
{{- if .Values.bootstrap.trustedProxies }}
trusted_proxies = [
{{- range $i, $p := .Values.bootstrap.trustedProxies }}
{{ $p | quote }}{{ if lt $i (sub (len $.Values.bootstrap.trustedProxies) 1) }},{{ end }}
{{- end }}
]
{{- end }}
[owner]
email = {{ .Values.bootstrap.owner.email | quote }}
display_name = {{ .Values.bootstrap.owner.displayName | quote }}
{{- if .Values.bootstrap.oidc.issuer }}
[oidc]
issuer = {{ .Values.bootstrap.oidc.issuer | quote }}
audience = {{ .Values.bootstrap.oidc.audience | quote }}
client_id = {{ .Values.bootstrap.oidc.clientId | quote }}
{{- end }}
{{- end }}
@@ -1,31 +0,0 @@
{{- if .Values.externalSecret.enabled -}}
# Example ExternalSecret for External Secrets Operator (Vault / OpenBao / KMS).
# Enable with externalSecret.enabled=true or copy into your GitOps manifest repo.
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: {{ .Values.secrets.existingSecret }}
labels:
{{- include "archie.labels" . | nindent 4 }}
spec:
refreshInterval: {{ .Values.externalSecret.refreshInterval }}
secretStoreRef:
name: {{ .Values.externalSecret.secretStoreRef.name }}
kind: {{ .Values.externalSecret.secretStoreRef.kind }}
target:
name: {{ .Values.secrets.existingSecret }}
creationPolicy: Owner
data:
- secretKey: {{ .Values.secrets.keys.databaseUrl }}
remoteRef:
key: {{ .Values.externalSecret.remoteRefs.databaseUrlKey }}
property: {{ .Values.externalSecret.remoteRefs.databaseUrlProperty }}
- secretKey: {{ .Values.secrets.keys.ageIdentity }}
remoteRef:
key: {{ .Values.externalSecret.remoteRefs.ageIdentityKey }}
property: {{ .Values.externalSecret.remoteRefs.ageIdentityProperty }}
- secretKey: {{ .Values.secrets.keys.adminTokenSha256 }}
remoteRef:
key: {{ .Values.externalSecret.remoteRefs.adminTokenSha256Key }}
property: {{ .Values.externalSecret.remoteRefs.adminTokenSha256Property }}
{{- end }}
@@ -1,128 +0,0 @@
{{- if .Values.frontend.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "archie.frontendFullname" . }}
labels:
{{- include "archie.frontendLabels" . | nindent 4 }}
spec:
{{- if not .Values.frontend.autoscaling.enabled }}
replicas: {{ .Values.frontend.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "archie.frontendSelectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "archie.frontendLabels" . | nindent 8 }}
spec:
automountServiceAccountToken: false
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- include "archie.compactYaml" .Values.frontend.podSecurityContext | nindent 8 }}
containers:
- name: frontend
image: {{ include "archie.frontendImage" . }}
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
securityContext:
{{- include "archie.compactYaml" .Values.frontend.securityContext | nindent 12 }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: http
readinessProbe:
httpGet:
path: /healthz
port: http
resources:
{{- toYaml .Values.frontend.resources | nindent 12 }}
volumeMounts:
# nginx keeps its pid file and temporary files here; the root
# filesystem is read-only.
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir:
sizeLimit: 64Mi
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "archie.frontendFullname" . }}
labels:
{{- include "archie.frontendLabels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- name: http
port: {{ .Values.frontend.service.port }}
targetPort: http
protocol: TCP
selector:
{{- include "archie.frontendSelectorLabels" . | nindent 4 }}
{{- if .Values.frontend.autoscaling.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "archie.frontendFullname" . }}
labels:
{{- include "archie.frontendLabels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "archie.frontendFullname" . }}
minReplicas: {{ .Values.frontend.autoscaling.minReplicas }}
maxReplicas: {{ .Values.frontend.autoscaling.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.frontend.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.networkPolicy.enabled }}
---
# The dashboard only answers the internal ingress and calls nothing.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "archie.frontendFullname" . }}
labels:
{{- include "archie.frontendLabels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "archie.frontendSelectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
- Egress
ingress:
- ports:
- protocol: TCP
port: 8080
{{- if or .Values.networkPolicy.ingress.internal.namespaceSelector .Values.networkPolicy.ingress.internal.podSelector }}
from:
- {{- if .Values.networkPolicy.ingress.internal.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.networkPolicy.ingress.internal.namespaceSelector | nindent 12 }}
{{- end }}
{{- if .Values.networkPolicy.ingress.internal.podSelector }}
podSelector:
{{- toYaml .Values.networkPolicy.ingress.internal.podSelector | nindent 12 }}
{{- end }}
{{- end }}
egress: []
{{- end }}
{{- end }}
@@ -1,82 +0,0 @@
{{- if .Values.ingress.perimeter.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "archie.fullname" . }}-perimeter
labels:
{{- include "archie.labels" . | nindent 4 }}
app.kubernetes.io/component: perimeter-ingress
{{- with .Values.ingress.perimeter.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.perimeter.className }}
ingressClassName: {{ .Values.ingress.perimeter.className }}
{{- end }}
{{- with .Values.ingress.perimeter.tls }}
tls:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
{{- range .Values.ingress.perimeter.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
pathType: Prefix
backend:
service:
name: {{ include "archie.fullname" $ }}
port:
name: http
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.ingress.internal.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "archie.fullname" . }}-internal
labels:
{{- include "archie.labels" . | nindent 4 }}
app.kubernetes.io/component: internal-ingress
{{- with .Values.ingress.internal.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.internal.className }}
ingressClassName: {{ .Values.ingress.internal.className }}
{{- end }}
{{- with .Values.ingress.internal.tls }}
tls:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
{{- range .Values.ingress.internal.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range $.Values.ingress.internal.backendPaths }}
- path: {{ . }}
pathType: Prefix
backend:
service:
name: {{ include "archie.fullname" $ }}
port:
name: http
{{- end }}
{{- if $.Values.frontend.enabled }}
- path: /
pathType: Prefix
backend:
service:
name: {{ include "archie.frontendFullname" $ }}
port:
name: http
{{- end }}
{{- end }}
{{- end }}
@@ -1,109 +0,0 @@
{{- if .Values.bootstrap.enabled -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "archie.fullname" . }}-bootstrap
labels:
{{- include "archie.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": {{ .Values.bootstrap.hookWeight | quote }}
"helm.sh/hook-delete-policy": {{ .Values.bootstrap.hookDeletePolicy | quote }}
spec:
backoffLimit: {{ .Values.bootstrap.backoffLimit }}
activeDeadlineSeconds: {{ .Values.bootstrap.activeDeadlineSeconds }}
template:
metadata:
labels:
{{- include "archie.labels" . | nindent 8 }}
app.kubernetes.io/component: bootstrap
spec:
restartPolicy: OnFailure
serviceAccountName: {{ include "archie.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (include "archie.compactYaml" .Values.podSecurityContext) }}
securityContext:
{{- . | nindent 8 }}
{{- end }}
containers:
- name: bootstrap
image: {{ include "archie.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-config"
- ""
- "-spec"
- "/etc/archie/bootstrap.toml"
- "bootstrap"
{{- with (include "archie.compactYaml" .Values.securityContext) }}
securityContext:
{{- . | nindent 12 }}
{{- end }}
env:
- name: HOME
value: "/tmp"
- name: ARCHIE_DATABASE_URL_FILE
value: /run/secrets/archie/{{ .Values.secrets.keys.databaseUrl }}
- name: ARCHIE_BOOTSTRAP_OWNER_PASSWORD_FILE
value: /run/secrets/archie-bootstrap/{{ .Values.bootstrap.owner.passwordSecretKey }}
{{- if .Values.caBundle.enabled }}
- name: SSL_CERT_FILE
value: {{ .Values.caBundle.mountPath | quote }}
{{- end }}
resources:
{{- toYaml .Values.bootstrap.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /etc/archie/bootstrap.toml
subPath: bootstrap.toml
readOnly: true
- name: runtime-secrets
mountPath: /run/secrets/archie
readOnly: true
- name: bootstrap-secrets
mountPath: /run/secrets/archie-bootstrap
readOnly: true
- name: tmp
mountPath: /tmp
{{- if .Values.caBundle.enabled }}
- name: ca-bundle
mountPath: {{ .Values.caBundle.mountPath }}
subPath: {{ .Values.caBundle.key }}
readOnly: true
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "archie.fullname" . }}-config
- name: runtime-secrets
secret:
secretName: {{ .Values.secrets.existingSecret }}
defaultMode: 0400
items:
- key: {{ .Values.secrets.keys.databaseUrl }}
path: {{ .Values.secrets.keys.databaseUrl }}
- name: bootstrap-secrets
secret:
secretName: {{ .Values.bootstrap.owner.passwordSecretName }}
defaultMode: 0400
items:
- key: {{ .Values.bootstrap.owner.passwordSecretKey }}
path: {{ .Values.bootstrap.owner.passwordSecretKey }}
- name: tmp
emptyDir: {}
{{- if .Values.caBundle.enabled }}
- name: ca-bundle
{{- if .Values.caBundle.existingSecret }}
secret:
secretName: {{ .Values.caBundle.existingSecret }}
defaultMode: 0444
{{- else }}
configMap:
name: {{ .Values.caBundle.existingConfigMap }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,127 +0,0 @@
{{- if .Values.bundleSync.enabled -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "archie.fullname" . }}-bundle-sync
labels:
{{- include "archie.labels" . | nindent 4 }}
annotations:
{{- if .Values.bundleSync.hooks.helm }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": {{ .Values.bundleSync.hookWeight | quote }}
"helm.sh/hook-delete-policy": {{ .Values.bundleSync.hookDeletePolicy | quote }}
{{- end }}
{{- if .Values.bundleSync.hooks.argocd }}
"argocd.argoproj.io/hook": PostSync
"argocd.argoproj.io/hook-delete-policy": BeforeHookCreation
{{- end }}
spec:
backoffLimit: {{ .Values.bundleSync.backoffLimit }}
activeDeadlineSeconds: {{ .Values.bundleSync.activeDeadlineSeconds }}
template:
metadata:
labels:
{{- include "archie.labels" . | nindent 8 }}
app.kubernetes.io/component: bundle-sync
spec:
restartPolicy: OnFailure
serviceAccountName: {{ include "archie.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (include "archie.compactYaml" .Values.podSecurityContext) }}
securityContext:
{{- . | nindent 8 }}
{{- end }}
containers:
- name: bundle-sync
image: {{ include "archie.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-config"
- ""
- "bundle"
- "apply"
- "--bundle"
- "/etc/archie/bundle/bundle.yaml"
{{- if .Values.bundleSync.bindings.enabled }}
- "--bindings"
- "/etc/archie/bindings/bindings.yaml"
{{- end }}
{{- if .Values.bundleSync.expectDigest }}
- "--expect-digest"
- {{ .Values.bundleSync.expectDigest | quote }}
{{- end }}
{{- if .Values.bundleSync.dryRun }}
- "--dry-run"
{{- end }}
{{- with (include "archie.compactYaml" .Values.securityContext) }}
securityContext:
{{- . | nindent 12 }}
{{- end }}
env:
- name: HOME
value: "/tmp"
# Uses only the DML runtime role (archie_app), never owner_url.
- name: ARCHIE_DATABASE_URL_FILE
value: /run/secrets/archie/{{ .Values.secrets.keys.databaseUrl }}
{{- if .Values.caBundle.enabled }}
- name: SSL_CERT_FILE
value: {{ .Values.caBundle.mountPath | quote }}
{{- end }}
resources:
{{- toYaml .Values.bundleSync.resources | nindent 12 }}
volumeMounts:
- name: bundle
mountPath: /etc/archie/bundle/bundle.yaml
subPath: {{ .Values.bundleSync.bundleKey }}
readOnly: true
{{- if .Values.bundleSync.bindings.enabled }}
- name: bindings
mountPath: /etc/archie/bindings/bindings.yaml
subPath: {{ .Values.bundleSync.bindings.key }}
readOnly: true
{{- end }}
- name: runtime-secrets
mountPath: /run/secrets/archie
readOnly: true
- name: tmp
mountPath: /tmp
{{- if .Values.caBundle.enabled }}
- name: ca-bundle
mountPath: {{ .Values.caBundle.mountPath }}
subPath: {{ .Values.caBundle.key }}
readOnly: true
{{- end }}
volumes:
- name: bundle
configMap:
name: {{ default (printf "%s-bundle" (include "archie.fullname" .)) .Values.bundleSync.existingConfigMap }}
{{- if .Values.bundleSync.bindings.enabled }}
- name: bindings
configMap:
name: {{ default (default (printf "%s-bundle" (include "archie.fullname" .)) .Values.bundleSync.existingConfigMap) .Values.bundleSync.bindings.existingConfigMap }}
{{- end }}
- name: runtime-secrets
secret:
secretName: {{ .Values.secrets.existingSecret }}
defaultMode: 0400
items:
- key: {{ .Values.secrets.keys.databaseUrl }}
path: {{ .Values.secrets.keys.databaseUrl }}
- name: tmp
emptyDir: {}
{{- if .Values.caBundle.enabled }}
- name: ca-bundle
{{- if .Values.caBundle.existingSecret }}
secret:
secretName: {{ .Values.caBundle.existingSecret }}
defaultMode: 0444
{{- else }}
configMap:
name: {{ .Values.caBundle.existingConfigMap }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,92 +0,0 @@
{{- if .Values.migrate.enabled -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "archie.fullname" . }}-migrate
labels:
{{- include "archie.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-weight": {{ .Values.migrate.hookWeight | quote }}
"helm.sh/hook-delete-policy": {{ .Values.migrate.hookDeletePolicy | quote }}
spec:
backoffLimit: {{ .Values.migrate.backoffLimit }}
activeDeadlineSeconds: {{ .Values.migrate.activeDeadlineSeconds }}
template:
metadata:
labels:
{{- include "archie.labels" . | nindent 8 }}
app.kubernetes.io/component: migrate
spec:
restartPolicy: OnFailure
serviceAccountName: {{ include "archie.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (include "archie.compactYaml" .Values.podSecurityContext) }}
securityContext:
{{- . | nindent 8 }}
{{- end }}
containers:
- name: migrate
image: {{ include "archie.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-config"
- ""
- "migrate"
{{- with (include "archie.compactYaml" .Values.securityContext) }}
securityContext:
{{- . | nindent 12 }}
{{- end }}
env:
- name: HOME
value: "/tmp"
- name: ARCHIE_DATABASE_URL_FILE
value: /run/secrets/archie-migrate/{{ .Values.secrets.keys.databaseUrl }}
- name: ARCHIE_DATABASE_OWNER_URL_FILE
value: /run/secrets/archie-migrate/{{ .Values.secrets.keys.databaseOwnerUrl }}
{{- if .Values.caBundle.enabled }}
- name: SSL_CERT_FILE
value: {{ .Values.caBundle.mountPath | quote }}
{{- end }}
resources:
{{- toYaml .Values.migrate.resources | nindent 12 }}
volumeMounts:
- name: migrate-secrets
mountPath: /run/secrets/archie-migrate
readOnly: true
- name: tmp
mountPath: /tmp
{{- if .Values.caBundle.enabled }}
- name: ca-bundle
mountPath: {{ .Values.caBundle.mountPath }}
subPath: {{ .Values.caBundle.key }}
readOnly: true
{{- end }}
volumes:
- name: migrate-secrets
secret:
secretName: {{ include "archie.migrateSecretName" . }}
defaultMode: 0400
items:
- key: {{ .Values.secrets.keys.databaseUrl }}
path: {{ .Values.secrets.keys.databaseUrl }}
- key: {{ .Values.secrets.keys.databaseOwnerUrl }}
path: {{ .Values.secrets.keys.databaseOwnerUrl }}
- name: tmp
emptyDir: {}
{{- if .Values.caBundle.enabled }}
- name: ca-bundle
{{- if .Values.caBundle.existingSecret }}
secret:
secretName: {{ .Values.caBundle.existingSecret }}
defaultMode: 0444
{{- else }}
configMap:
name: {{ .Values.caBundle.existingConfigMap }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,189 +0,0 @@
{{- if .Values.networkPolicy.enabled -}}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "archie.fullname" . }}-default-deny
labels:
{{- include "archie.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "archie.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "archie.fullname" . }}-allow
labels:
{{- include "archie.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "archie.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
- Egress
ingress:
{{- if .Values.ingress.perimeter.enabled }}
- ports:
- protocol: TCP
port: 8080
{{- if or .Values.networkPolicy.ingress.perimeter.namespaceSelector .Values.networkPolicy.ingress.perimeter.podSelector }}
from:
- {{- if .Values.networkPolicy.ingress.perimeter.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.networkPolicy.ingress.perimeter.namespaceSelector | nindent 12 }}
{{- end }}
{{- if .Values.networkPolicy.ingress.perimeter.podSelector }}
podSelector:
{{- toYaml .Values.networkPolicy.ingress.perimeter.podSelector | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.ingress.internal.enabled }}
- ports:
- protocol: TCP
port: 8080
{{- if or .Values.networkPolicy.ingress.internal.namespaceSelector .Values.networkPolicy.ingress.internal.podSelector }}
from:
- {{- if .Values.networkPolicy.ingress.internal.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.networkPolicy.ingress.internal.namespaceSelector | nindent 12 }}
{{- end }}
{{- if .Values.networkPolicy.ingress.internal.podSelector }}
podSelector:
{{- toYaml .Values.networkPolicy.ingress.internal.podSelector | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.enabled }}
- ports:
- protocol: TCP
port: {{ .Values.metrics.port }}
{{- if or .Values.networkPolicy.ingress.metrics.namespaceSelector .Values.networkPolicy.ingress.metrics.podSelector }}
from:
- {{- if .Values.networkPolicy.ingress.metrics.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.networkPolicy.ingress.metrics.namespaceSelector | nindent 12 }}
{{- end }}
{{- if .Values.networkPolicy.ingress.metrics.podSelector }}
podSelector:
{{- toYaml .Values.networkPolicy.ingress.metrics.podSelector | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
egress:
# DNS resolution
- ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
{{- if or .Values.networkPolicy.egress.dns.namespaceSelector .Values.networkPolicy.egress.dns.podSelector }}
to:
- {{- if .Values.networkPolicy.egress.dns.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.networkPolicy.egress.dns.namespaceSelector | nindent 12 }}
{{- end }}
{{- if .Values.networkPolicy.egress.dns.podSelector }}
podSelector:
{{- toYaml .Values.networkPolicy.egress.dns.podSelector | nindent 12 }}
{{- end }}
{{- end }}
# PostgreSQL / PgBouncer session pool
- ports:
- protocol: TCP
port: {{ .Values.networkPolicy.egress.postgres.port }}
{{- if or .Values.networkPolicy.egress.postgres.cidrs .Values.networkPolicy.egress.postgres.namespaceSelector .Values.networkPolicy.egress.postgres.podSelector }}
to:
{{- range .Values.networkPolicy.egress.postgres.cidrs }}
- ipBlock:
cidr: {{ . | quote }}
{{- end }}
{{- if or .Values.networkPolicy.egress.postgres.namespaceSelector .Values.networkPolicy.egress.postgres.podSelector }}
- {{- if .Values.networkPolicy.egress.postgres.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.networkPolicy.egress.postgres.namespaceSelector | nindent 12 }}
{{- end }}
{{- if .Values.networkPolicy.egress.postgres.podSelector }}
podSelector:
{{- toYaml .Values.networkPolicy.egress.postgres.podSelector | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
# OIDC Identity Provider
- ports:
- protocol: TCP
port: {{ .Values.networkPolicy.egress.oidc.port }}
{{- if .Values.networkPolicy.egress.oidc.cidrs }}
to:
{{- range .Values.networkPolicy.egress.oidc.cidrs }}
- ipBlock:
cidr: {{ . | quote }}
{{- end }}
{{- end }}
{{- if or .Values.proxy.httpsProxy .Values.proxy.httpProxy .Values.networkPolicy.egress.proxy.cidrs }}
# Corporate egress proxy
- ports:
- protocol: TCP
port: {{ .Values.networkPolicy.egress.proxy.port }}
{{- if .Values.networkPolicy.egress.proxy.cidrs }}
to:
{{- range .Values.networkPolicy.egress.proxy.cidrs }}
- ipBlock:
cidr: {{ . | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if or .Values.config.extensions.remote .Values.networkPolicy.egress.extensions.cidrs .Values.networkPolicy.egress.extensions.namespaceSelector .Values.networkPolicy.egress.extensions.podSelector }}
# Remote gRPC+mTLS extension endpoints
- ports:
{{- range .Values.networkPolicy.egress.extensions.ports }}
- protocol: TCP
port: {{ . }}
{{- end }}
{{- if or .Values.networkPolicy.egress.extensions.cidrs .Values.networkPolicy.egress.extensions.namespaceSelector .Values.networkPolicy.egress.extensions.podSelector }}
to:
{{- range .Values.networkPolicy.egress.extensions.cidrs }}
- ipBlock:
cidr: {{ . | quote }}
{{- end }}
{{- if or .Values.networkPolicy.egress.extensions.namespaceSelector .Values.networkPolicy.egress.extensions.podSelector }}
- {{- if .Values.networkPolicy.egress.extensions.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.networkPolicy.egress.extensions.namespaceSelector | nindent 12 }}
{{- end }}
{{- if .Values.networkPolicy.egress.extensions.podSelector }}
podSelector:
{{- toYaml .Values.networkPolicy.egress.extensions.podSelector | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if or .Values.telemetry.otlpEndpoint .Values.networkPolicy.egress.otlp.cidrs .Values.networkPolicy.egress.otlp.namespaceSelector .Values.networkPolicy.egress.otlp.podSelector }}
# OpenTelemetry collector
- ports:
- protocol: TCP
port: {{ .Values.networkPolicy.egress.otlp.port }}
{{- if or .Values.networkPolicy.egress.otlp.cidrs .Values.networkPolicy.egress.otlp.namespaceSelector .Values.networkPolicy.egress.otlp.podSelector }}
to:
{{- range .Values.networkPolicy.egress.otlp.cidrs }}
- ipBlock:
cidr: {{ . | quote }}
{{- end }}
{{- if or .Values.networkPolicy.egress.otlp.namespaceSelector .Values.networkPolicy.egress.otlp.podSelector }}
- {{- if .Values.networkPolicy.egress.otlp.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.networkPolicy.egress.otlp.namespaceSelector | nindent 12 }}
{{- end }}
{{- if .Values.networkPolicy.egress.otlp.podSelector }}
podSelector:
{{- toYaml .Values.networkPolicy.egress.otlp.podSelector | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,17 +0,0 @@
{{- if .Values.podDisruptionBudget.enabled -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "archie.fullname" . }}
labels:
{{- include "archie.labels" . | nindent 4 }}
spec:
{{- if not (kindIs "invalid" .Values.podDisruptionBudget.minAvailable) }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- else }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "archie.selectorLabels" . | nindent 6 }}
{{- end }}
@@ -1,23 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "archie.fullname" . }}
labels:
{{- include "archie.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- name: http
port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
- name: metrics
port: {{ .Values.service.metricsPort }}
targetPort: metrics
protocol: TCP
selector:
{{- include "archie.selectorLabels" . | nindent 4 }}
@@ -1,13 +0,0 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "archie.serviceAccountName" . }}
labels:
{{- include "archie.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- end }}
@@ -1,20 +0,0 @@
{{- if .Values.metrics.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "archie.fullname" . }}
labels:
{{- include "archie.labels" . | nindent 4 }}
{{- with .Values.metrics.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "archie.selectorLabels" . | nindent 6 }}
endpoints:
- port: metrics
path: {{ .Values.metrics.path }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
@@ -1,208 +0,0 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "archie.fullname" . }}
labels:
{{- include "archie.labels" . | nindent 4 }}
spec:
serviceName: {{ include "archie.fullname" . }}
# Active-Passive HA in Enterprise v1 requires a single active replica.
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "archie.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "archie.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "archie.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (include "archie.compactYaml" .Values.podSecurityContext) }}
securityContext:
{{- . | nindent 8 }}
{{- end }}
containers:
- name: archie
image: {{ include "archie.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-config"
- "/etc/archie/config.toml"
{{- with (include "archie.compactYaml" .Values.securityContext) }}
securityContext:
{{- . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
- name: metrics
containerPort: {{ .Values.metrics.port }}
protocol: TCP
env:
- name: HOME
value: "/tmp"
- name: ARCHIE_DATABASE_URL_FILE
value: /run/secrets/archie/{{ .Values.secrets.keys.databaseUrl }}
- name: ARCHIE_AGE_IDENTITY_FILE
value: /run/secrets/archie/{{ .Values.secrets.keys.ageIdentity }}
- name: ARCHIE_ADMIN_TOKEN_SHA256_FILE
value: /run/secrets/archie/{{ .Values.secrets.keys.adminTokenSha256 }}
{{- if .Values.caBundle.enabled }}
- name: SSL_CERT_FILE
value: {{ .Values.caBundle.mountPath | quote }}
{{- end }}
{{- if .Values.proxy.httpsProxy }}
- name: HTTPS_PROXY
value: {{ .Values.proxy.httpsProxy | quote }}
{{- end }}
{{- if .Values.proxy.httpProxy }}
- name: HTTP_PROXY
value: {{ .Values.proxy.httpProxy | quote }}
{{- end }}
{{- if or .Values.proxy.httpsProxy .Values.proxy.httpProxy }}
- name: NO_PROXY
value: {{ .Values.proxy.noProxy | quote }}
{{- end }}
{{- if .Values.telemetry.otlpEndpoint }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .Values.telemetry.otlpEndpoint | quote }}
{{- end }}
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
startupProbe:
httpGet:
path: /startupz
port: http
initialDelaySeconds: {{ .Values.probes.startup.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.startup.periodSeconds }}
timeoutSeconds: {{ .Values.probes.startup.timeoutSeconds }}
failureThreshold: {{ .Values.probes.startup.failureThreshold }}
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
readinessProbe:
httpGet:
path: /readyz
port: http
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /etc/archie/config.toml
subPath: config.toml
readOnly: true
- name: runtime-secrets
mountPath: /run/secrets/archie
readOnly: true
- name: tmp
mountPath: /tmp
- name: state
mountPath: {{ .Values.config.stateDir }}
{{- if .Values.caBundle.enabled }}
- name: ca-bundle
mountPath: {{ .Values.caBundle.mountPath }}
subPath: {{ .Values.caBundle.key }}
readOnly: true
{{- end }}
{{- if .Values.config.extensions.tls.existingSecret }}
- name: extensions-tls
mountPath: {{ .Values.config.extensions.tls.mountPath }}
readOnly: true
{{- end }}
{{- if .Values.config.catalogue.authSecret }}
- name: catalogue-auth
mountPath: /run/secrets/archie-catalogue
readOnly: true
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "archie.fullname" . }}-config
- name: runtime-secrets
secret:
secretName: {{ .Values.secrets.existingSecret }}
defaultMode: 0400
items:
- key: {{ .Values.secrets.keys.databaseUrl }}
path: {{ .Values.secrets.keys.databaseUrl }}
- key: {{ .Values.secrets.keys.ageIdentity }}
path: {{ .Values.secrets.keys.ageIdentity }}
- key: {{ .Values.secrets.keys.adminTokenSha256 }}
path: {{ .Values.secrets.keys.adminTokenSha256 }}
- name: tmp
emptyDir: {}
{{- if not .Values.persistence.enabled }}
- name: state
emptyDir: {}
{{- else if .Values.persistence.existingClaim }}
- name: state
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim }}
{{- end }}
{{- if .Values.caBundle.enabled }}
- name: ca-bundle
{{- if .Values.caBundle.existingSecret }}
secret:
secretName: {{ .Values.caBundle.existingSecret }}
defaultMode: 0444
{{- else }}
configMap:
name: {{ .Values.caBundle.existingConfigMap }}
{{- end }}
{{- end }}
{{- if .Values.config.extensions.tls.existingSecret }}
- name: extensions-tls
secret:
secretName: {{ .Values.config.extensions.tls.existingSecret }}
defaultMode: 0400
{{- end }}
{{- if .Values.config.catalogue.authSecret }}
- name: catalogue-auth
secret:
secretName: {{ .Values.config.catalogue.authSecret }}
defaultMode: 0400
items:
- key: {{ .Values.config.catalogue.authSecretKey }}
path: config.json
{{- end }}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
volumeClaimTemplates:
- metadata:
name: state
labels:
{{- include "archie.labels" . | nindent 10 }}
spec:
accessModes:
{{- toYaml .Values.persistence.accessModes | nindent 10 }}
{{- if .Values.persistence.storageClass }}
storageClassName: {{ .Values.persistence.storageClass | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end }}
-32
View File
@@ -1,32 +0,0 @@
# Development stage overlay: isolated non-prod database, key, and relaxed egress for local testing.
image:
tag: "dev"
pullPolicy: IfNotPresent
config:
catalogue:
disableAutoUpdate: false
extensions:
requireRemote: true
persistence:
size: "2Gi"
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "512Mi"
networkPolicy:
enabled: false
podDisruptionBudget:
enabled: false
metrics:
serviceMonitor:
enabled: false
@@ -1,32 +0,0 @@
# OpenShift restricted-v2 SCC overlay: let OpenShift allocate namespace UIDs
# and GID 0 rather than pinning UID/GID 65532.
# Example:
# helm upgrade --install archie deployments/helm/archie \
# -f deployments/helm/archie/values-prod.yaml \
# -f deployments/helm/archie/values-openshift.yaml
podSecurityContext:
runAsNonRoot: true
runAsUser: null
runAsGroup: null
fsGroup: null
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: null
capabilities:
drop:
- ALL
frontend:
podSecurityContext:
runAsNonRoot: true
runAsUser: null
runAsGroup: null
seccompProfile:
type: RuntimeDefault
-68
View File
@@ -1,68 +0,0 @@
# Production stage overlay: full restricted hardening, split ingress, remote mTLS extensions, and PDB.
replicaCount: 1
image:
# Always pin an immutable cosign-verified digest in production (for example "sha256:...").
digest: ""
pullPolicy: IfNotPresent
terminationGracePeriodSeconds: 45
config:
shutdownGrace: "30s"
catalogue:
disableAutoUpdate: true
extensions:
requireRemote: true
persistence:
enabled: true
size: "20Gi"
resources:
requests:
cpu: "500m"
memory: "512Mi"
limits:
cpu: "2000m"
memory: "2Gi"
ingress:
perimeter:
enabled: true
className: "external-nginx"
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/limit-rps: "25"
hosts:
- host: hooks.archie.example.com
paths:
- /hooks
- /webhooks
tls:
- secretName: archie-prod-perimeter-tls
hosts:
- hooks.archie.example.com
internal:
enabled: true
className: "internal-nginx"
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
hosts:
- host: archie.internal.example.com
tls:
- secretName: archie-prod-internal-tls
hosts:
- archie.internal.example.com
networkPolicy:
enabled: true
metrics:
serviceMonitor:
enabled: true
podDisruptionBudget:
enabled: true
maxUnavailable: 1
@@ -1,55 +0,0 @@
# Staging stage overlay: mirrors production hardening and ingress isolation with its own DB and keys.
image:
# Pin digest before promoting from dev to staging.
digest: ""
config:
catalogue:
disableAutoUpdate: true
extensions:
requireRemote: true
persistence:
size: "5Gi"
resources:
requests:
cpu: "250m"
memory: "256Mi"
limits:
cpu: "1000m"
memory: "1Gi"
ingress:
perimeter:
enabled: true
className: "external-nginx"
hosts:
- host: hooks.staging.archie.example.com
paths:
- /hooks
- /webhooks
tls:
- secretName: archie-staging-perimeter-tls
hosts:
- hooks.staging.archie.example.com
internal:
enabled: true
className: "internal-nginx"
hosts:
- host: archie.staging.internal.example.com
tls:
- secretName: archie-staging-internal-tls
hosts:
- archie.staging.internal.example.com
networkPolicy:
enabled: true
metrics:
serviceMonitor:
enabled: true
podDisruptionBudget:
enabled: false
-332
View File
@@ -1,332 +0,0 @@
# Default production-oriented values for Archie Enterprise (Active-Passive v1).
# Pair with values-dev.yaml, values-staging.yaml, or values-prod.yaml.
replicaCount: 1
image:
repository: ghcr.io/samcharles93/archie
tag: "v1.0.0"
# Set digest (e.g. "sha256:...") to pin the exact immutable artifact in staging and prod.
digest: ""
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
create: true
name: ""
annotations: {}
automountServiceAccountToken: false
# Exceeds config.shutdownGrace (30s) so active requests and run checkpoints drain on SIGTERM.
terminationGracePeriodSeconds: 45
podAnnotations: {}
podLabels: {}
podSecurityContext:
runAsNonRoot: true
runAsUser: 65532
runAsGroup: 65532
fsGroup: 65532
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 65532
capabilities:
drop:
- ALL
config:
listen: "0.0.0.0:8080"
stateDir: "/var/lib/archie"
shutdownGrace: "30s"
# Public age1... backup recipients used alongside the primary sealing identity.
ageBackupRecipients: []
catalogue:
# Must be set together with publicKey when overriding the default catalogue mirror.
location: ""
publicKey: ""
disableAutoUpdate: true
# Optional Secret containing Docker config.json for private OCI catalogue registries.
authSecret: ""
authSecretKey: "config.json"
extensions:
# Kubernetes restricted PSS forbids CLONE_NEWUSER namespaces; require remote gRPC+mTLS extensions.
requireRemote: true
tls:
# Secret holding ca.crt, tls.crt, and tls.key for mTLS client authentication to extensions.
existingSecret: ""
mountPath: "/etc/archie/extensions-tls"
# Map extension key or name to { address: "ext.ns.svc:50051", serverName: "ext.internal" }.
remote: {}
secrets:
# Secret holding database-url, age-identity, and admin-token-sha256 for runtime pods.
existingSecret: "archie-runtime-secrets"
keys:
databaseUrl: "database-url"
databaseOwnerUrl: "database-owner-url"
ageIdentity: "age-identity"
adminTokenSha256: "admin-token-sha256"
caBundle:
enabled: false
existingConfigMap: ""
existingSecret: ""
key: "ca-certificates.crt"
mountPath: "/etc/ssl/certs/archie-ca.crt"
proxy:
httpsProxy: ""
httpProxy: ""
noProxy: "localhost,127.0.0.1,.svc,.cluster.local"
telemetry:
otlpEndpoint: ""
extraEnv: []
persistence:
enabled: true
existingClaim: ""
storageClass: ""
accessModes:
- ReadWriteOnce
size: "10Gi"
resources:
requests:
cpu: "250m"
memory: "256Mi"
limits:
cpu: "1000m"
memory: "1Gi"
probes:
startup:
initialDelaySeconds: 2
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 30
liveness:
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
readiness:
initialDelaySeconds: 2
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
migrate:
enabled: true
# Dedicated migration secret holding database-owner-url and database-url.
# Keeps DDL credentials completely out of the runtime StatefulSet.
existingSecret: "archie-migrate-secrets"
hookWeight: "-5"
hookDeletePolicy: "before-hook-creation,hook-succeeded"
backoffLimit: 3
activeDeadlineSeconds: 300
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
bootstrap:
enabled: false
hookWeight: "-1"
hookDeletePolicy: "before-hook-creation,hook-succeeded"
backoffLimit: 2
activeDeadlineSeconds: 180
publicUrl: ""
trustedProxies: []
owner:
email: ""
displayName: "Platform Owner"
passwordSecretName: "archie-bootstrap-secrets"
passwordSecretKey: "owner-password"
oidc:
issuer: ""
audience: ""
clientId: ""
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
bundleSync:
enabled: false
hooks:
helm: true
argocd: true
hookWeight: "5"
hookDeletePolicy: "before-hook-creation,hook-succeeded"
backoffLimit: 2
activeDeadlineSeconds: 180
# ConfigMap holding bundle.yaml (and optional bindings.yaml).
existingConfigMap: ""
bundleKey: "bundle.yaml"
bindings:
enabled: true
# Optional separate ConfigMap for stage-local bindings; falls back to bundleSync.existingConfigMap.
existingConfigMap: ""
key: "bindings.yaml"
expectDigest: ""
dryRun: false
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
service:
type: ClusterIP
port: 8080
metricsPort: 9090
annotations: {}
metrics:
enabled: true
port: 9090
path: "/metrics"
serviceMonitor:
enabled: false
interval: "30s"
scrapeTimeout: "10s"
labels: {}
# The dashboard: static files served by its own image, routed by the internal
# ingress on the same host as the API.
frontend:
enabled: true
replicaCount: 2
image:
repository: ghcr.io/archie-platform/archie-frontend
tag: "v0.1.0"
digest: ""
pullPolicy: IfNotPresent
podSecurityContext:
runAsNonRoot: true
runAsUser: 101
runAsGroup: 101
seccompProfile:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop:
- ALL
resources:
requests:
cpu: "25m"
memory: "32Mi"
limits:
cpu: "250m"
memory: "128Mi"
autoscaling:
enabled: false
minReplicas: 2
maxReplicas: 6
targetCPUUtilizationPercentage: 70
service:
port: 8080
ingress:
# External edge ingress admitting webhook intake (/hooks/ and /webhooks/) only.
perimeter:
enabled: false
className: ""
annotations: {}
hosts: []
tls: []
# Internal corporate VPN / SSO ingress. On each host, backendPaths go to the
# API and every other path to the dashboard.
internal:
enabled: false
className: ""
annotations: {}
hosts: []
backendPaths:
- /api
- /oauth2
- /hooks
tls: []
networkPolicy:
enabled: true
ingress:
perimeter:
namespaceSelector: {}
podSelector: {}
internal:
namespaceSelector: {}
podSelector: {}
metrics:
namespaceSelector: {}
podSelector: {}
egress:
dns:
namespaceSelector:
kubernetes.io/metadata.name: kube-system
podSelector:
k8s-app: kube-dns
postgres:
port: 5432
cidrs: []
namespaceSelector: {}
podSelector: {}
oidc:
port: 443
cidrs: []
proxy:
port: 3128
cidrs: []
extensions:
ports:
- 50051
cidrs: []
namespaceSelector: {}
podSelector: {}
otlp:
port: 4317
cidrs: []
namespaceSelector: {}
podSelector: {}
podDisruptionBudget:
enabled: false
maxUnavailable: 1
minAvailable: null
externalSecret:
enabled: false
refreshInterval: "1h"
secretStoreRef:
name: "vault-backend"
kind: "ClusterSecretStore"
remoteRefs:
databaseUrlKey: "archie/prod/database"
databaseUrlProperty: "runtime_url"
ageIdentityKey: "archie/prod/age"
ageIdentityProperty: "identity"
adminTokenSha256Key: "archie/prod/admin"
adminTokenSha256Property: "token_sha256"
-10
View File
@@ -1,10 +0,0 @@
jetstream { store_dir: /data }
http_port: 8222
authorization {
users: [{ user: "archie-callout", password: $NATS_TOKEN }]
auth_callout {
issuer: $NATS_CALLOUT_ISSUER
auth_users: ["archie-callout"]
}
}
+3 -6
View File
@@ -8,12 +8,9 @@
work_dir = "~/.local/share/archie/work"
state_dir = "~/.local/share/archie" # NATS store, task logs
# The State Store's PostgreSQL connection (PostgreSQL 18, required).
# `docker compose up -d postgres` provides the local default; point it at
# your own Postgres 18 server otherwise. The services serve as archie_runtime
# and migrations run as archie_migrator; create both once with
# `archie-state-store provision -h` (deployments/README.md).
database_url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"
migration_database_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
# `docker compose up -d postgres` provides this local default; point it at
# your own Postgres 18 server otherwise.
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
poll_interval = "60s"
label = "archie"
bot_user = "archie-bot"
+3 -14
View File
@@ -15,12 +15,9 @@ bot_user = "archie"
work_dir = "~/.local/share/archie/work"
state_dir = "~/.local/share/archie" # NATS store, task logs
# PostgreSQL 18 connection (required).
# `docker compose up -d postgres` provides the local default; point it at
# your own Postgres 18 server otherwise. The services serve as archie_runtime
# and migrations run as archie_migrator; create both once with
# `archie-state-store provision -h` (deployments/README.md).
database_url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"
migration_database_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
# `docker compose up -d postgres` provides this local default; point it at
# your own Postgres 18 server otherwise.
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
[services.gateway]
target = "127.0.0.1:8585"
@@ -58,11 +55,3 @@ models = [
[budgets]
max_steps = 60
wall_clock = "30m"
# The image task containers run. There is no default: the daemon refuses to
# start without it and names the key, so set your own pinned reference here --
# see deployments/systemd-user-service.md#6-pinning-the-archie-agent-image.
# [containers]
# image = "registry.example.com/archie/archie-agent@sha256:<digest>"
# pull_policy = "missing"
# registry_auth = { engine = "env", key = "ARCHIE_REGISTRY_AUTH" } # when the registry needs a login
+26 -37
View File
@@ -11,7 +11,7 @@ This runbook describes how to manage `archied` as a background user service on L
with the contents it
ships. This page describes what runs and why; the installer owns the contents,
so inspect a unit with `systemctl --user cat <unit>` rather than copying it from
here, where it would drift from what `install.sh` writes.
here, where it would drift from what is written.
The Gateway unit is `archie-gateway.service`, written by `install.sh` beside
`archied.service`.
@@ -30,14 +30,14 @@ Docker bridge gateway address, and a non-loopback bind needs `[tls]` (see
### Messaging Service Unit (`~/.config/systemd/user/archie-messaging.service`)
`archie-messaging` serves the Telegram, email and webhook channels, not
`archied`, since the v1.30.0 extraction. `archied` starts no gateway for them
and logs nothing when one is absent. A host that updates across v1.30.0
The Telegram, email and webhook channels are served by `archie-messaging`, not
by `archied`, since the v1.30.0 extraction. `archied` starts no gateway for them
and logs nothing when one is absent, so a host that updates across v1.30.0
without this unit runs on with dead channels and a daemon that looks perfectly
healthy. `install.sh` writes this unit on a fresh install.
`archied update install` refuses an update when a host is missing a unit and
names what is missing. That now fires for a host that drifted or predates this
release rather than the normal path.
healthy. `install.sh` writes this unit on a fresh install;
`archied update install` refuses an
update when a host is missing a unit and names what is missing, which now fires
for a host that drifted or predates this release rather than the normal path.
It dials the Gateway for the chat contract and the State Store for the stored
channel settings, and reads the same `config.toml`, including `[tls]`.
@@ -48,23 +48,23 @@ each service waits for the peers it needs.
## 2. UI Service Unit (`~/.config/systemd/user/archie-ui.service`)
The standalone UI Service serves the dashboard, not `archied`. It reads the same `config.toml`, dials
The dashboard is served by the standalone UI Service, not by `archied`. It reads the same `config.toml`, dials
the Gateway and State Store targets already in it, and binds `[web].listen`.
Open the dashboard to configure the organisation, workspace and first administrator account.
Complete setup before exposing it publicly; remote access requires an HTTPS reverse proxy.
**Auth note:** `archie-ui` authenticates to the Gateway, State Store and
daemon with its `[tls]` certificate (`archie-ui.pem`) from `config.toml`.
harness with its `[tls]` certificate (`archie-ui.pem`) from `config.toml`.
For supervision, `GET /healthz` on `[web].listen` is the process's liveness
probe (token-free by design); the authenticated readiness surface lives at
the dashboard's health endpoint behind account authentication. A watchdog can curl
`/healthz` without credentials.
`install.sh` writes `archie-ui.service`. Operators configure browser accounts through the dashboard.
`install.sh` writes `archie-ui.service`. Browser accounts are configured through the dashboard.
`After=` orders the start, it does not wait for the store to bind. The UI
process closes that gap itself. Its event pump retries priming with backoff
process closes that gap itself: its event pump retries priming with backoff
until the State Store answers, so the activity feed goes live once the store
is up rather than staying history-only until the next restart.
@@ -129,18 +129,16 @@ systemctl --user stop archied
Embedded NATS is the default. The systemd service runs `archied` natively, so
interactive chat keeps the host access the operator configured, while every
autonomous repository workflow runs in a task-scoped Docker container. The
deployment needs no Compose service or host `archie-agent` binary.
autonomous repository workflow runs in a task-scoped Docker container. No
Compose service or host `archie-agent` binary is required.
The operator must install Docker and make it reachable to the service user.
`containers.image` has no default: with it unset the daemon refuses to start and
names the key, so a fresh install learns about it at startup, not at the first
failed pull.
`single-forge-github.toml` and `docker-nats-stack.toml` set a pinned
reference; `standalone.toml` and `dev.toml` leave it for the operator to set
-- see
Docker must be installed and reachable by the service user. With no explicit
broker or container settings, Archie defaults `containers.image` to
`git.catlow.cloud/sam/archie-agent:latest`. `single-forge-github.toml` and
`docker-nats-stack.toml` override that default with a pinned reference
(`standalone.toml` and `dev.toml` leave it) -- see
[Pinning the archie-agent image](#6-pinning-the-archie-agent-image) below. An
explicit reference, pinned the same way, is:
explicit equivalent, pinned the same way, is:
```toml
[nats]
@@ -157,9 +155,9 @@ and passes the resulting endpoint to each worker. There is no port to publish
and no broker URL to maintain.
The State Store is a separate process and, with a container-mode agent, must
be reachable from the container. Bind it to the same bridge gateway with a
be reachable from the container, so bind it to the same bridge gateway with a
token and point `[services.state].target` at it (start
`archie-state-store` with `-listen <bridge>:9090 -token <token>`). Without a
`archie-state-store` with `-listen <bridge>:9090 -token <token>`); without a
token a non-loopback bind fails closed. For a host-only agent, `127.0.0.1:9090`
with no token is correct.
@@ -174,8 +172,8 @@ fall back to a host model loop.
The release pipeline publishes
`git.catlow.cloud/sam/archie-agent` as `:v<version>` and `:sha-<commit>` when
the commit carries a release tag; an ordinary push to `main` publishes nothing
for the agent image, and `:latest` moves only when the release pipeline promotes
a release. A distribution zip pins the image its own release
for the agent image, and `:latest` moves only when a release is promoted. A
distribution zip pins the image its own release
published, by digest, in `release.json`, and `archied update install` pulls
exactly that.
@@ -205,9 +203,8 @@ personal access token that can read the package as the password --
`{"username":"<user>","password":"<token>"}`. Put it in
`~/.config/archie/env` as `ARCHIE_REGISTRY_AUTH` so it stays out of
`config.toml`. The field is file-owned and settled at boot, so a change takes
effect on restart. When the daemon cannot read a value, it logs a warning
and pulls anonymously, which is the failure the task reports as a capability
error.
effect on restart; a value that cannot be read logs a warning and pulls
anonymously, which is the failure the task reports as a capability error.
The bundled update adapter snapshots the configured `[containers].image` before
rebuilding it and restores that image if the restarted daemon fails its health
@@ -228,19 +225,11 @@ docker compose up -d nats
[nats]
mode = "external"
url = "nats://172.19.0.1:4222"
token_env = "NATS_TOKEN"
callout_issuer_seed_env = "NATS_CALLOUT_SEED"
[containers]
network = "archie-core_default"
```
The broker defers every login to archied (NATS auth callout), so a worker logs
in with its run credential and reaches only its own task's subjects. Generate
an account nKey (`nk -gen account -pubout`), export its seed as
`NATS_CALLOUT_SEED` for archied and its public key as `NATS_CALLOUT_ISSUER` for
Compose, and set `NATS_TOKEN` to the same value in both.
The daemon hands workers the URL its own client connected to. The Compose
service name is not resolvable from the native host, and localhost inside a
worker is the worker itself; the pinned network gateway is reachable from both.
+9 -11
View File
@@ -19,9 +19,8 @@ services:
# The standalone archie-state-store process's database. PostgreSQL 18 is
# the required minimum and target; `postgres.Open` refuses anything older.
# `task dev` brings this up before the State Store via dev:postgres. The
# This superuser is the dev database's admin: `task dev` runs archie-state-store
# provision after first start to create the least-privilege roles the
# mirroring deployments/dev.toml URLs name -- change them together.
# credentials and database name below are the dev default mirrored by
# deployments/dev.toml's database_url -- change both together.
postgres:
image: postgres:18
environment:
@@ -44,22 +43,21 @@ services:
# ── NATS JetStream ────────────────────────────────────────────────
nats:
profiles: ["nats"]
image: nats:2.14-alpine3.22
# The client port is published on every interface (agent containers reach
# it over the bridge), so it defers every login to archied. Set NATS_TOKEN
# (name it in [nats] token_env) and NATS_CALLOUT_ISSUER, the public key of
# the account nkey seed named in [nats] callout_issuer_seed_env.
command: ["-c", "/etc/nats/nats.conf"]
# it over the bridge), so it refuses to start without a token. Set
# NATS_TOKEN here and name the same value in [nats] token_env.
entrypoint:
- sh
- -c
- '[ -n "$$NATS_TOKEN" ] || { echo "NATS_TOKEN is required" >&2; exit 1; }; exec nats-server -js -m 8222 --auth "$$NATS_TOKEN"'
environment:
- NATS_TOKEN
- NATS_CALLOUT_ISSUER
NATS_TOKEN: ${NATS_TOKEN:-}
ports:
- "4222:4222" # client
- "127.0.0.1:8222:8222" # monitoring (http://localhost:8222)
volumes:
- nats_data:/data
- ./deployments/nats-callout.conf:/etc/nats/nats.conf:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8222/healthz"]
@@ -1,54 +0,0 @@
# Enterprise Compliance Control Mapping
Archie enforces preventive, detective, and corrective controls in code and deployment files. This guide maps each control to its source code, deployment files, `go test -short` tests, and compliance frameworks. It covers SOC 2 (CC6, CC7, CC8), ISO/IEC 27001:2022, SOX ITGC, and APRA CPS 234.
## Control Matrix
| Control area | Archie code | Deployment files | Automated test proof | Framework mapping |
| --- | --- | --- | --- | --- |
| Database role split | `pg.Migrate` (`owner_url`) vs DML-only `url` checked by `pg.VerifySchema` (`internal/platform/pg/pg.go`) | `job-migrate.yaml` mounts `owner_url`; `statefulset.yaml` and `compose.enterprise.yml` omit `owner_url` | `TestMissingMigrations` (`internal/platform/pg/pg_test.go`), `TestLoadMigrateConfigRequiresOnlyDatabaseRoles` (`internal/app/archie/config_test.go`) | SOC 2 CC6.1, CC6.3; ISO 27001 A.5.15, A.8.2; SOX ITGC Access; CPS 234 (15-17) |
| API and setup gate | Cedar policy checks on every route (`internal/app/archie/api.go`, `modules/governance/access.go`) and closed gate (`internal/app/archie/gate.go`) | Split internal vs perimeter ingress (`ingress.yaml`) | `TestEveryOperationIsAuthorized`, `TestUnwiredAuthorizerRefuses` (`internal/app/archie/access_test.go`), `TestClosedGateServesOnlySetup`, `TestGateIsNotBypassedByPathTricks` (`internal/app/archie/gate_test.go`), `TestEnforcementFailsClosedAndRecordsDecisions` (`modules/governance/enforce_test.go`) | SOC 2 CC6.1, CC6.2; ISO 27001 A.5.15, A.8.3; SOX ITGC Access; CPS 234 (15-18) |
| Identity and SSO | Confidential OIDC, role mapping, SSO-only mode, session limits, and back-channel logout (`modules/governance/oidc.go`, `identity.go`) | Headless `archie bootstrap` (`job-bootstrap.yaml`, `internal/app/archie/bootstrap.go`) | `TestAuthenticateRequest` (`modules/governance/auth_test.go`), `TestAuthenticationSettingsRejectUntrustedOrigins`, `TestPasswordVerification` (`modules/governance/identity_test.go`), `TestLoadBootstrapSpecAndEnvFiles` (`internal/app/archie/bootstrap_test.go`) | SOC 2 CC6.1, CC6.2; ISO 27001 A.5.17, A.8.5; SOX ITGC Access; CPS 234 (15-17) |
| Four-eyes SoD and step-up | Cedar judgement (`modules/judgement/`), passkey checks (`modules/approvals/`), and SoD rule blocking self-approval | Stage-local autonomy caps; prod approval gates | `TestDashboardAnswerComesFromAnAccountWhoseRoleMayApprove`, `TestIrreversibleActionsNeedFreshAuthentication` (`modules/approvals/dashboard_test.go`), `TestExecuteApprovedRunsOnlyWhatThePersonSaw` (`modules/judgement/judgement_test.go`), `TestChatProhibitsPrivilegedActions` (`modules/judgement/chat_test.go`) | SOC 2 CC6.3, CC8.1; ISO 27001 A.5.3; SOX ITGC Changes; CPS 234 (16-18) |
| Keys and secrets | Label-bound `age` X25519 sealing (`internal/platform/seal/seal.go`), `*_FILE` loading (`config.go`), `archie rekey`, and log redaction (`auditjson/`) | `*_FILE` mounts in `statefulset.yaml` and `compose.enterprise.yml`; `externalsecret.example.yaml` | `TestSealedValueOpensOnlyWhereItBelongs` (`internal/platform/seal/seal_test.go`), `TestCredentialRoutesNeverReturnASecret`, `TestBearerTokenByIDRespectsScope` (`modules/connectors/credentials_test.go`), `TestStoredPayloadKeepsCredentialsOut` (`internal/platform/auditjson/auditjson_test.go`), `TestLoadConfigRuntimeAndEnvFiles` (`internal/app/archie/config_test.go`) | SOC 2 CC6.1, CC6.7; ISO 27001 A.8.24; SOX ITGC Access; CPS 234 (15-20) |
| Pod and extension isolation | `RemoteGRPCRuntime` over mTLS (`modules/connectors/internal/host/remote.go`) and `LocalNamespaceRuntime` with egress tunnel (`egress/tunnel.go`) | `restricted` PSS in `statefulset.yaml`; `seccomp.json` in `compose.enterprise.yml`; `networkpolicy.yaml` | `TestRemoteGRPCRequiresMTLSAndEnforcesTrust` (`modules/connectors/internal/host/remote_test.go`), `TestCommandConfinesOnlyWithEgress`, `TestNamespaceLimitRefusesDisabledNamespaces` (`modules/connectors/internal/host/host_test.go`), `TestTunnelEnforcesAllowListBeforeCorporateProxy` (`modules/connectors/internal/egress/tunnel_test.go`) | SOC 2 CC6.6, CC6.7; ISO 27001 A.8.20, A.8.22; SOX ITGC Ops; CPS 234 (16-18) |
| Supply chain and webhooks | Ed25519-signed catalogues with SHA-256 checks (`catalogue/`) and pre-parse HMAC checks (`modules/events/verify.go`) | Digest-pinned images (`values-prod.yaml`); `[catalogue]` mirror; perimeter `/hooks/` ingress | `TestFetchRefusesAnArtifactWhoseDigestDoesNotMatch`, `TestAcceptRefusesGrantsTheExtensionNeverDeclared`, `TestVerifyRefusesAForgedOrMalformedCatalogue` (`modules/connectors/internal/catalogue/catalogue_test.go`), `TestReadOCIChecksSignatureAndPackagePin` (`oci_test.go`), `TestHMACSourceVerifiesBeforeParsing` (`modules/events/verify_test.go`) | SOC 2 CC7.1, CC8.1; ISO 27001 A.8.25, A.8.28; SOX ITGC Changes; CPS 234 (21-22) |
| Audit, tracing, and changes | Append-only `audit.events` (`SELECT`, `INSERT`), stdout JSON audit logs, OTel trace IDs, `archie bundle`, and change windows | `servicemonitor.yaml`; SIEM log shipping; `values-{dev,staging,prod}.yaml` | `TestEveryDecisionIsRecorded`, `TestAllowedDecisionNeedsItsRecord` (`modules/governance/decisions_test.go`), `TestReadAuditRoleBoundary` (`modules/governance/access_test.go`), `TestTimingHoldsChangingActionsOutsideTheSchedule` (`modules/governance/timing_test.go`), `TestAutonomyIsEarnedSlowlyAndLostAtOnce` (`modules/judgement/autonomy_test.go`) | SOC 2 CC7.2, CC7.3, CC8.1; ISO 27001 A.8.15, A.8.32; SOX ITGC Changes, Ops; CPS 234 (23-28) |
| Availability and deletion record | `/healthz`, `/startupz`, `/readyz` (`health/health.go`), `ClaimServe` lock (`pg/pg.go`), and deletion ledger (`deletions/deletions.go`) | RWO PVC in `statefulset.yaml`; `poddisruptionbudget.yaml`; `dr-and-backup.md` drill | `TestProbesSeparateStartupFromReadiness` (`internal/platform/health/health_test.go`), `TestLogRecordsEachDeletion` (`internal/platform/deletions/deletions_test.go`), `TestForgetCommitsThenRecords`, `TestReapplyDeletionsAppliesEveryRecordedNote` (`modules/memory/notes_test.go`) | SOC 2 CC7.4, A1.2; ISO 27001 A.5.30; SOX ITGC Ops; CPS 234 (19, 25) |
## Framework Alignment Summary
### SOC 2 (CC6, CC7, CC8)
- **CC6 (Access Controls):** Archie enforces OIDC SSO, Cedar checks on every route (`TestEveryOperationIsAuthorized`), DML-only database roles, `age` sealing, and default-deny `NetworkPolicy`.
- **CC7 (System Operations):** Archie checks webhook HMACs before parsing (`TestHMACSourceVerifiesBeforeParsing`), runs as UID `65532` with a read-only root filesystem, and exposes `/healthz`, `/startupz`, `/readyz`, stdout JSON audit logs, and `/metrics`.
- **CC8 (Change Management):** Archie splits `archie migrate` from serving pods, signs extension catalogues, promotes stages with `archie bundle`, checks change windows (`TestTimingHoldsChangingActionsOutsideTheSchedule`), and enforces SoD on approvals.
### ISO/IEC 27001:2022
- **Access Rights (A.5.15, A.5.17, A.8.2, A.8.5):** Separate `archie_owner` and `archie_app` roles limit schema rights. OIDC role mapping, SSO-only mode, and passkey checks gate high-risk actions.
- **Crypto and Networks (A.8.20, A.8.22, A.8.24):** Deployments use PostgreSQL `sslmode=verify-full`, TLS 1.3 mTLS for remote gRPC extensions, `age` keys with backup recipients, and `HTTPS_PROXY` allow-lists.
- **Logs, Supply Chain, and Continuity (A.8.15, A.8.25, A.8.32, A.5.30):** Append-only audit logs, Ed25519-signed catalogues, `task check` (`golangci-lint`, `gosec`, `go test -short`), and quarterly DR drills cover daily operations.
### SOX ITGC
- **Access to Programs and Data:** Only `archie migrate` holds DDL rights. Runtime pods cannot change schemas, edit audit rows, or return secrets (`TestCredentialRoutesNeverReturnASecret`).
- **Program Changes:** Stages stay isolated across `dev`, `staging`, and `prod`. Digest-pinned OCI images, `archie bundle diff` and `apply`, and four-eyes SoD gate all changes.
- **Computer Operations:** `ClaimServe` blocks serving pods during database restores. `shutdown_grace` drains active runs cleanly. `memory.ReapplyDeletions` keeps deleted notes removed after a snapshot restore.
### APRA CPS 234
- **Asset Controls and Testing (Paragraphs 15-22):** Controls scale with impact via Cedar guards, extension trust ceilings (`TestGuardExtensionsDecideAtTheLowestCeiling`), mTLS checks, and automated `task check` suites.
- **Detection and Recovery (Paragraphs 23-28):** Pre-parse webhook checks, stdout JSON audit streams to SIEM/WORM storage, OpenTelemetry trace IDs, and quarterly DR drills provide full audit trails.
## Continuous Gate
Run the repository gate, Helm lint, and prose checks before each release and audit:
```bash
task check
helm lint deployments/helm/archie -f deployments/helm/archie/values-prod.yaml
vale docs/enterprise/*.md
```
`task check` runs `go test -short ./...`, `golangci-lint` (including `gosec`), and generated schema and OpenAPI checks.
@@ -1,99 +0,0 @@
# Enterprise Deployment Architecture
Archie runs as a single static binary (`cmd/archie`) backed by PostgreSQL. Regulated deployments isolate each stage, separate DDL from DML credentials, split external webhook ingress from internal operator access, and enforce strict pod or container boundaries.
## Multi-Stage Isolation Zones
Deploy Archie into three independent stages: `dev`, `staging`, and `prod`. Each stage runs its own Archie instance and shares no runtime state with any other stage.
| Resource | `dev` | `staging` | `prod` |
| --- | --- | --- | --- |
| Kubernetes namespace or host | `archie-dev` | `archie-staging` | `archie-prod` |
| PostgreSQL database | Isolated dev instance | Isolated staging instance | Managed HA PostgreSQL (`sslmode=verify-full`) |
| `age` sealing key | Stage-local `age_identity` | Stage-local `age_identity` | Stage-local `age_identity` with offline `age_backup_recipients` |
| OIDC client | Non-prod IdP client | Staging IdP client | Production IdP confidential client |
| Earned autonomy | Local to `dev` | Local to `staging` | Built independently in `prod` |
| Helm overlay | `values-dev.yaml` | `values-staging.yaml` | `values-prod.yaml` |
Earned autonomy in `staging` never promotes to `prod`. Promote declarative configuration (workflows, Cedar policies, judgement rules, and action-type metadata) with `archie bundle`. Keep credentials, OIDC bindings, target hosts, and autonomy counters local to each stage.
Pin container images by immutable SHA-256 digest (`image.digest` in Helm) and verify cosign signatures before deploying to `staging` and `prod`. Set `[catalogue]` `disable_auto_update = true` and mirror signed extension catalogues internally in air-gapped stages.
### Stage Promotion Models
Choose one of two promotion workflows depending on your delivery pipeline:
1. **Push CI/CD (GitHub Actions, GitLab CI, or Jenkins):**
- On pull requests, run `archie bundle validate` offline to check workflow YAML, Cedar policy syntax, judgement rules, and stage `Bindings` without database access.
- Export the tested bundle from `staging` and record its canonical SHA-256 digest (`Bundle.Digest()`).
- After manual change approval, the `prod` pipeline runs `archie bundle apply --expect-digest <sha256>` over HTTPS using `ARCHIE_URL` and `ARCHIE_TOKEN_FILE`. The CI runner never touches PostgreSQL directly.
2. **Pull GitOps (Argo CD or Flux):**
- Store the stage Helm values (`values-staging.yaml`, `values-prod.yaml`), `bundle.yaml`, and stage-local `bindings.yaml` in Git.
- Enable `bundleSync.enabled: true` in `deployments/helm/archie` to run `templates/job-bundle-sync.yaml` as an Argo CD `PostSync` or Helm `post-install,post-upgrade` Job.
- The Job mounts the bundle `ConfigMap`, uses only the runtime `archie_app` database secret (`ARCHIE_DATABASE_URL_FILE`), and applies unchanged bundles idempotently with optional `expectDigest` verification.
## Split Ingress and Network Boundaries
Separate external webhook delivery from operator and administrator access using two ingress resources (`deployments/helm/archie/templates/ingress.yaml`):
1. **Perimeter webhook ingress (`ingress.perimeter`):** Expose only webhook intake paths (`/hooks/` for `cmd/archie` intake and `/webhooks/` where routed by a reverse proxy). Terminate TLS at the edge and apply rate limits. The `events` module verifies each payload's HMAC signature before parsing JSON (`modules/events/verify.go`).
2. **Internal operator ingress (`ingress.internal`):** Serve the Dashboard, `/api/`, and OIDC routes behind a corporate VPN or internal load balancer. Never expose `/api/` or the setup surface on the perimeter ingress.
Enforce default-deny `NetworkPolicy` rules (`deployments/helm/archie/templates/networkpolicy.yaml`) in `staging` and `prod`. Permit ingress only from the perimeter ingress controller (port `8080`), internal ingress controller (port `8080`), and Prometheus scraper (port `9090` on `/metrics`). Permit egress only to DNS (`53`), PostgreSQL or PgBouncer (`5432`), the OIDC issuer (`443`), configured remote extension endpoints, the corporate proxy (`HTTPS_PROXY`), and the OpenTelemetry collector (`4317`).
## Database Role Split and PgBouncer Session Pooling
Archie separates schema ownership from runtime operations across two PostgreSQL roles:
- **`archie_owner` (`ARCHIE_DATABASE_OWNER_URL_FILE`):** Holds DDL rights. Used only by `archie migrate` inside the Helm pre-install/pre-upgrade `Job` (`job-migrate.yaml`) or the Compose `archie-migrate` init service (`deployments/archie/compose.enterprise.yml`).
- **`archie_app` (`ARCHIE_DATABASE_URL_FILE`):** Holds only `USAGE` and DML privileges (`SELECT`, `INSERT`, `UPDATE`, `DELETE`, and `SELECT` on `public.goose_db_version`). The runtime `StatefulSet` and Compose `archie` service mount only this credential. At startup, `pg.VerifySchema` (`internal/platform/pg/pg.go`) checks that every embedded migration is applied and fails closed if the schema lags behind.
### PgBouncer Session-Pooling Requirement for `ClaimServe`
At boot, `cmd/archie` calls `pg.ClaimServe` (`internal/platform/pg/pg.go`). `ClaimServe` opens a dedicated connection via `db.Conn(ctx)` and acquires a shared PostgreSQL session advisory lock (`pg_try_advisory_lock_shared(hashtextextended('archie.serve.owner', 0))`). It holds that lock for the entire lifetime of the serving process. A database restore takes the same key exclusively so no serving pod can start or run during a restore window.
If you deploy PgBouncer in front of PostgreSQL, configure `pool_mode = session` for Archie's runtime pool. PgBouncer `transaction` and `statement` pooling modes share server backends across clients and release or drop session advisory locks between transactions. Direct connections to the HA PostgreSQL primary also satisfy this requirement.
## Pod Security and Extension Confinement
Extension execution differs between Kubernetes and Docker Compose because Kubernetes `restricted` Pod Security Standards forbid user namespaces.
| Control | Kubernetes (`deployments/helm/archie`) | Hardened Compose (`deployments/archie/compose.enterprise.yml`) |
| --- | --- | --- |
| User and root filesystem | `runAsNonRoot: true`, UID/GID `65532`, read-only root filesystem, `allowPrivilegeEscalation: false`, `capabilities.drop: [ALL]` | `user: "65532:65532"`, `read_only: true`, `tmpfs: /tmp`, `cap_drop: [ALL]`, `no-new-privileges:true` |
| Seccomp profile | `seccompProfile.type: RuntimeDefault` | `deployments/archie/seccomp.json` (Docker default plus `clone` for namespaces) |
| Extension runtime | `RemoteGRPCRuntime` over mTLS or Unix socket (`require_remote = true`) | `LocalNamespaceRuntime` (`CLONE_NEWUSER` and `CLONE_NEWNET`) |
| Egress proxy and PKI | `HTTPS_PROXY`, `NO_PROXY`, and `SSL_CERT_FILE` propagated to runtime and `NetworkPolicy` | `HTTPS_PROXY`, `NO_PROXY`, and `SSL_CERT_FILE` propagated into confined namespaces |
In Kubernetes, run extensions as separate Pods or sidecars under `restricted` Pod Security Standards and isolate them with `NetworkPolicy`. Configure `[extensions]` in `config.toml` (`templates/configmap.yaml`) with `require_remote = true`, TLS 1.3 mTLS certificates (`ca_file`, `cert_file`, `key_file`), and explicit `[extensions.remote.<name>]` targets. If neither `RemoteGRPCRuntime` nor `LocalNamespaceRuntime` is available, `modules/connectors/internal/host/remote.go` fails closed.
In Docker Compose and VM hosts, `LocalNamespaceRuntime` confines each extension binary in its own user and network namespace behind an allow-list forward proxy (`modules/connectors/internal/egress/tunnel.go`). The tunnel enforces Archie's host allow-list and loopback checks before chaining allowed traffic through `HTTPS_PROXY`.
### OpenShift `restricted-v2` SCC
OpenShift's default `restricted-v2` security context rejects pinned `runAsUser`, `runAsGroup`, and `fsGroup` values because it assigns UIDs per namespace. Add [values-openshift.yaml](../../deployments/helm/archie/values-openshift.yaml) alongside `values-prod.yaml` to omit those numeric IDs while keeping `runAsNonRoot: true`, `allowPrivilegeEscalation: false`, and a read-only root filesystem.
## Private OCI and Air-Gapped Catalogues
Private OCI registries authenticate through `[catalogue]` in `config.toml` or container environment variables:
- **Docker config file:** Set `catalogue.auth_file` (`ARCHIE_CATALOGUE_AUTH_FILE`) or set `config.catalogue.authSecret` in Helm to mount a registry `config.json` Secret.
- **Direct credentials:** Set `catalogue.username` and `catalogue.password` via `ARCHIE_CATALOGUE_USERNAME` and `ARCHIE_CATALOGUE_PASSWORD_FILE`.
In air-gapped stages, mirror a verified catalogue to local storage and re-sign it with an internal Ed25519 key:
1. Generate an internal signing keypair with `archie catalogue keygen`.
2. Download, verify, and re-sign the catalogue and binaries with `archie catalogue mirror -to /var/lib/archie/mirror -sign-key-file /etc/archie/mirror.key`.
3. Transfer the mirror directory into the isolated environment and point `[catalogue]` `location` and `public_key` at the mirrored `catalogue.json` and internal public key.
## Probes, Graceful Drain, and High Availability
`cmd/archie` exposes three health endpoints (`internal/platform/health/health.go`):
- `/healthz`: Liveness probe. Returns `200` while the HTTP server process is alive.
- `/startupz`: Startup probe. Verifies database connectivity and confirms the deletion ledger is consistent before Kubernetes routes traffic or triggers liveness checks.
- `/readyz`: Readiness probe. Requires `/startupz` checks plus completion of owner setup (`gate.go`), and returns `503` as soon as `SIGTERM` begins draining.
Set `terminationGracePeriodSeconds` (`45` seconds in `values-prod.yaml`) higher than `shutdown_grace` (`30s`) so in-flight HTTP requests and run checkpoints finish before `SIGKILL`.
Enterprise v1 runs Active-Passive HA with `replicaCount: 1` on a `StatefulSet` backed by a `ReadWriteOnce` PVC for `state_dir`. Never scale `replicaCount` above `1` in v1 without shared `state_dir` storage and v2 Active-Active coordination (`LISTEN/NOTIFY` hub, lease election, and object-lock deletion ledger).
-65
View File
@@ -1,65 +0,0 @@
# Disaster Recovery and Backup Runbook
Archie keeps durable state across three separate stores: PostgreSQL, the `age` sealing keys, and the external deletion ledger (`deletions.jsonl`). Back up and protect each store independently. Restoring PostgreSQL alone is never enough if `age` keys or the deletion ledger are lost.
## Recovery Objectives
| Store | What it holds | RPO target | RTO target | Backup mechanism |
| --- | --- | --- | --- | --- |
| PostgreSQL (`archie` database) | Workflows, runs, approvals, events, governance, sealed credentials, audit events | 5 minutes or less | 30 minutes | Automated base snapshots plus continuous WAL archiving (PITR) |
| `age` recovery keys (`age_backup_recipients`) | Ability to open sealed connector credentials and event HMAC secrets | Zero key loss | Immediate on restore | Offline escrow in enterprise secret manager or HSM vault |
| Deletion ledger (`state_dir/deletions.jsonl`) | Append-only record of deleted memory notes | Zero acknowledged deletion loss | 15 minutes | Independent PVC or host volume snapshots replicated off-cluster |
## Independent Backup Strategy
### 1. PostgreSQL Database
Back up the PostgreSQL cluster using continuous WAL archiving and scheduled base backups so you can restore to a point in time.
- Back up as the `postgres` or `archie_owner` administrative role, not `archie_app`.
- Include the `public.goose_db_version` table and every Archie module schema (`runs`, `connectors`, `events`, `governance`, `deliveries`, `judgement`, `approvals`, `memory`, `alerts`, `proposals`, `chat`, and `audit`).
- Exclude `state_dir` and `age` private keys from database backup media so a database dump alone cannot decrypt stored credentials.
### 2. `age` Sealing Keys and Key Rotation
`internal/platform/seal/seal.go` seals connector credentials (`connectors.credentials`) and webhook secrets (`events.sources.hmac_secret_sealed`) with `age` X25519 keys bound to record labels. If the active `age_identity` and all `age_backup_recipients` are lost, every sealed secret in the database is unrecoverable.
Protect sealing keys with two controls:
1. **Configure offline backup recipients:** Generate a recovery `age` keypair in your enterprise vault (`archie -new-age-identity` or `age-keygen`) and list its public `age1...` string under `age_backup_recipients` in `config.toml`. Keep the matching `AGE-SECRET-KEY-1...` offline in your secret manager.
2. **Rotate keys with `archie rekey`:** Rotate compromised or expiring `age` identities atomically using `archie rekey`. The command takes a PostgreSQL advisory lock (`archie.rekey.owner`). It opens every sealed credential and webhook secret with the old identity, re-seals and checks decryption with the new identity in one transaction, and writes a JSON audit log.
Never delete the old identity from your vault until the post-rotation database backup completes.
### 3. External Deletion Ledger (`deletions.jsonl`)
When a user deletes a memory note, `modules/memory` commits the deletion in PostgreSQL and appends an `Entry` (`table`, `org_id`, `id`, `at`) to `deletions.jsonl` inside `state_dir` (`internal/platform/deletions/deletions.go`). Each append uses `flock` and `fsync` on both the file and parent directories so the record outlives the database.
Keep `state_dir` on an independent `ReadWriteOnce` persistent volume (or dedicated host volume in Compose) and snapshot it separately from PostgreSQL. Never restore `state_dir` from a snapshot older than the database snapshot you are restoring. If `deletions.jsonl` is lost on an instance that previously recorded deletions, `memory.ReapplyDeletions` returns `deletions.ErrUnsafeRollback` and stops startup rather than exposing deleted notes.
## Restore Procedure
Follow these steps to recover a stage from backup:
1. **Stop active Archie pods or containers:** Scale the `StatefulSet` to `0` (`kubectl scale statefulset archie --replicas=0`) or run `docker compose stop archie`.
2. **Acquire the exclusive serve lock:** If restoring onto an active PostgreSQL instance, hold `pg_advisory_lock(hashtextextended('archie.serve.owner', 0))` in your restore session so no stray Archie process can pass `pg.ClaimServe` before recovery finishes.
3. **Restore PostgreSQL:** Restore the base snapshot and replay WAL logs to the target recovery timestamp. Verify `public.goose_db_version` is intact.
4. **Restore or preserve `state_dir`:** Keep the existing `state_dir` volume containing the latest `deletions.jsonl`, or restore the newest `state_dir` backup taken at or after the database restore timestamp.
5. **Restore `age` key material:** Ensure `ARCHIE_AGE_IDENTITY_FILE` mounts a valid `age_identity` (or the backup identity stored in your vault if the primary key was lost). If you recover with the backup identity, run `archie rekey` right after startup to rotate to a new runtime key.
6. **Run migrations and start Archie:** Run the `archie migrate` Job if the restored snapshot precedes the deployed binary schema version, then scale the `StatefulSet` back to `1`.
7. **Verify reconciliation and readiness:** Watch stdout JSON logs for `applied the record of deletions` (`memory.ReapplyDeletions`) and confirm `/startupz` and `/readyz` return `200`.
## Restore Verification Drill
Run this drill in `staging` each quarter and after any backup architecture change. Record the completion timestamp, operator, and measured RTO in your compliance log.
1. Sign in to the `staging` instance and create a test memory note. Record its note ID and confirm it appears in `GET /api/memory/notes`.
2. Take an on-demand PostgreSQL snapshot (`pre-deletion snapshot`).
3. Delete the test memory note through the UI or API. Verify `state_dir/deletions.jsonl` contains a new JSON line matching the deleted note ID.
4. Scale the `staging` Archie `StatefulSet` to `0`.
5. Restore the `staging` PostgreSQL database to the `pre-deletion snapshot` taken in step 2. Leave `state_dir` untouched.
6. Verify the deleted note row is temporarily present again in PostgreSQL before Archie starts.
7. Scale the `staging` Archie `StatefulSet` back to `1`.
8. Check pod logs for `applied the record of deletions` and wait for `/readyz` to return `200`.
9. Query `GET /api/memory/notes` and PostgreSQL to confirm the test note remains deleted.
10. Verify credential decryption works using the backup `age` recipient key (or perform a test `archie rekey` rotation and confirm an existing connector still passes health checks).
+6 -6
View File
@@ -24,20 +24,20 @@ Archie Core uses the GitHub API to:
## Step-by-Step Instructions: Creating a Classic Token
1. Go to
1. Navigate to
[GitHub Settings → Developer Settings → Tokens (classic)](https://github.com/settings/tokens).
2. Select **Generate new token** → **Generate new token (classic)**.
2. Click **Generate new token** → **Generate new token (classic)**.
3. Set the **Note**: `Archie Core` (or your bot's name).
4. Choose an **Expiration** (e.g. 90 days, 1 year, or No expiration for
dedicated bot accounts).
5. Select the required scope:
- **`repo`** (Full control of private repositories: required for polling,
- **`repo`** (Full control of private repositories — required for polling,
commenting, pushing branches, and opening PRs).
- **`workflow`** (Optional, required if Archie needs to update GitHub
- **`workflow`** (Optional — required if Archie needs to update GitHub
Actions workflows).
6. Scroll to the bottom and select **Generate token**.
6. Scroll to the bottom and click **Generate token**.
7. **Copy your token immediately** (starts with `ghp_...`). You won't be able to
see it again.
see it again!
---
+17 -18
View File
@@ -1,13 +1,13 @@
# Building your first playbook binding
This walks through the whole no-code path the event-capture epic promises. Point
an external app's webhook at archie and see the real payload it sends. Map the
This walks through the whole no-code path the event-capture epic promises: point
an external app's webhook at archie, see the real payload it sends, map the
fields you care about, bind them to a workflow, and watch the next matching
event turn into a task. No code, no redeploy, no restart.
event turn into a task -- no code, no redeploy, no restart.
## 1. Create a source and send a test event
Open **Events → Inspector** and select **New source**. Archie shows the source's
Open **Events → Inspector** and click **New source**. Archie shows the source's
URL and signing secret once; copy both. Point the external app's webhook at that
URL. Send one real event however is easiest for a first test, e.g.:
@@ -30,8 +30,8 @@ actual payload from the actual sender, not guessing at a schema in advance.
## 3. Map the fields you care about
Open **Field mappings** (`/mappings`) → **New mapping**. Pick your captured
event from the dropdown, then select items in its payload tree on the right.
Every key and value is selectable, and selecting one binds it as a field (name,
event from the dropdown, then click through its payload tree on the right --
every key and value is clickable. Clicking a value binds it as a field (name,
JSON path, and an inferred type you can change). Add whichever fields your
workflow needs (e.g. the issue title), mark the ones that must be present as
**Required**, hit **Preview** to confirm they resolve correctly against the real
@@ -55,10 +55,10 @@ Save. The binding starts in **draft** -- nothing fires yet.
## 5. Approve it
A **draft** or freshly-**edited** binding needs explicit approval before it can
ever match a live event. This is deliberate, not a missing step: an operator
authoring a binding is a considered act, an event arriving is not, and nothing
should self-arm. Select **Approve**. Status becomes **armed**.
A **draft** or freshly-**edited** binding needs explicit approval
before it can ever match a live event -- this is deliberate, not a missing step:
an operator authoring a binding is a considered act, an event arriving is not,
and nothing should self-arm. Click **Approve**. Status becomes **armed**.
## 6. Fire it for real
@@ -76,15 +76,14 @@ curl -X POST http://localhost:8484/webhooks/capture/sentry \
-d "$BODY"
```
Archie captures this event as **authenticated**, matches it against your armed
binding, and dispatches it into a new task through the exact same
gate/worktree/sandbox pipeline every other task goes through. Check the
**Tasks** page; a new task should appear, its body built from the fields your
mapping resolved.
This event is captured as **authenticated**, matched against your armed binding,
and dispatched into a new task through the exact same gate/worktree/sandbox
pipeline every other task goes through. Check the **Tasks** page; a new task
should appear, its body built from the fields your mapping resolved.
## Editing a live binding
Any edit to an armed binding, even a typo fix, drops it back to
**`pending_approval`** automatically. You can't bypass this by editing; you have
to re-approve it. When editing, leave **Shared secret** blank to keep
Any edit to an armed binding -- even a typo fix -- drops it back to
**pending_approval** automatically. This can't be bypassed by editing; it has to
be re-approved. When editing, leave the **Shared secret** field blank to keep
the existing secret; only fill it in if you're deliberately rotating it.
+24
View File
@@ -0,0 +1,24 @@
# PR review benchmark
```
task bench:prreview
```
Reviews the 38 runnable Martian pull requests once each at `deep` depth with the
production pipeline, judges the posted comments against the golden comments in
`internal/app/prbench/martian.json`, and writes
`docs/benchmarks/pr-review-<timestamp>.md` (recall per PR, overall recall,
precision, models, archie version). Commit that file with the run.
- Models come from the config at `~/.config/archie/config.toml`: the reviewer
and judge both default to its `default` alias. Override with
`task bench:prreview -- -model ALIAS_OR_PROVIDER/MODEL -judge-model ALIAS_OR_PROVIDER/MODEL`.
Pick a judge other than the reviewer's model for an independent judgement.
Aliases set only in the dashboard are not in the file; pass a `provider/model`
ref instead.
- Pull requests are public, so no credential is needed. `GH_TOKEN` or
`GITHUB_TOKEN`, if set, only raises the GitHub API rate limit.
- `-problems ID,ID` runs a partial smoke run; its report says it is not the
acceptance run. A full run reports PASS when nothing failed and golden
micro-recall is at least 0.70.
- It is not part of `task test` and posts nothing to any pull request.
+224
View File
@@ -0,0 +1,224 @@
{
"/news/archie/1.0.0/": "/news/1.0.0/",
"/news/archie/1.1.0/": "/news/1.1.0/",
"/news/archie/1.10.0/": "/news/1.10.0/",
"/news/archie/1.11.0/": "/news/1.11.0/",
"/news/archie/1.11.1/": "/news/1.11.1/",
"/news/archie/1.12.0/": "/news/1.12.0/",
"/news/archie/1.13.0/": "/news/1.13.0/",
"/news/archie/1.14.0/": "/news/1.14.0/",
"/news/archie/1.15.0/": "/news/1.15.0/",
"/news/archie/1.16.0/": "/news/1.16.0/",
"/news/archie/1.16.1/": "/news/1.16.1/",
"/news/archie/1.17.0/": "/news/1.17.0/",
"/news/archie/1.17.1/": "/news/1.17.1/",
"/news/archie/1.18.0/": "/news/1.18.0/",
"/news/archie/1.19.0/": "/news/1.19.0/",
"/news/archie/1.19.1/": "/news/1.19.1/",
"/news/archie/1.19.10/": "/news/1.19.10/",
"/news/archie/1.19.2/": "/news/1.19.2/",
"/news/archie/1.19.3/": "/news/1.19.3/",
"/news/archie/1.19.4/": "/news/1.19.4/",
"/news/archie/1.19.5/": "/news/1.19.5/",
"/news/archie/1.19.6/": "/news/1.19.6/",
"/news/archie/1.19.7/": "/news/1.19.7/",
"/news/archie/1.19.8/": "/news/1.19.8/",
"/news/archie/1.19.9/": "/news/1.19.9/",
"/news/archie/1.2.0/": "/news/1.2.0/",
"/news/archie/1.20.0/": "/news/1.20.0/",
"/news/archie/1.21.0/": "/news/1.21.0/",
"/news/archie/1.22.0/": "/news/1.22.0/",
"/news/archie/1.23.0/": "/news/1.23.0/",
"/news/archie/1.24.0/": "/news/1.24.0/",
"/news/archie/1.25.0/": "/news/1.25.0/",
"/news/archie/1.26.0/": "/news/1.26.0/",
"/news/archie/1.27.0/": "/news/1.27.0/",
"/news/archie/1.28.0/": "/news/1.28.0/",
"/news/archie/1.29.0/": "/news/1.29.0/",
"/news/archie/1.3.0/": "/news/1.3.0/",
"/news/archie/1.3.1/": "/news/1.3.1/",
"/news/archie/1.30.0/": "/news/1.30.0/",
"/news/archie/1.31.0/": "/news/1.31.0/",
"/news/archie/1.32.0/": "/news/1.32.0/",
"/news/archie/1.32.1/": "/news/1.32.1/",
"/news/archie/1.33.0/": "/news/1.33.0/",
"/news/archie/1.34.0/": "/news/1.34.0/",
"/news/archie/1.35.0/": "/news/1.35.0/",
"/news/archie/1.36.0/": "/news/1.36.0/",
"/news/archie/1.37.0/": "/news/1.37.0/",
"/news/archie/1.37.1/": "/news/1.37.1/",
"/news/archie/1.38.0/": "/news/1.38.0/",
"/news/archie/1.39.0/": "/news/1.39.0/",
"/news/archie/1.4.0/": "/news/1.4.0/",
"/news/archie/1.4.1/": "/news/1.4.1/",
"/news/archie/1.40.0/": "/news/1.40.0/",
"/news/archie/1.41.0/": "/news/1.41.0/",
"/news/archie/1.41.1/": "/news/1.41.1/",
"/news/archie/1.41.2/": "/news/1.41.2/",
"/news/archie/1.42.0/": "/news/1.42.0/",
"/news/archie/1.43.0/": "/news/1.43.0/",
"/news/archie/1.44.0/": "/news/1.44.0/",
"/news/archie/1.44.1/": "/news/1.44.1/",
"/news/archie/1.45.0/": "/news/1.45.0/",
"/news/archie/1.46.0/": "/news/1.46.0/",
"/news/archie/1.47.0/": "/news/1.47.0/",
"/news/archie/1.47.1/": "/news/1.47.1/",
"/news/archie/1.47.2/": "/news/1.47.2/",
"/news/archie/1.47.3/": "/news/1.47.3/",
"/news/archie/1.48.0/": "/news/1.48.0/",
"/news/archie/1.48.1/": "/news/1.48.1/",
"/news/archie/1.49.0/": "/news/1.49.0/",
"/news/archie/1.49.1/": "/news/1.49.1/",
"/news/archie/1.49.2/": "/news/1.49.2/",
"/news/archie/1.49.3/": "/news/1.49.3/",
"/news/archie/1.49.4/": "/news/1.49.4/",
"/news/archie/1.5.0/": "/news/1.5.0/",
"/news/archie/1.50.0/": "/news/1.50.0/",
"/news/archie/1.50.1/": "/news/1.50.1/",
"/news/archie/1.51.0/": "/news/1.51.0/",
"/news/archie/1.51.1/": "/news/1.51.1/",
"/news/archie/1.52.0/": "/news/1.52.0/",
"/news/archie/1.53.0/": "/news/1.53.0/",
"/news/archie/1.54.0/": "/news/1.54.0/",
"/news/archie/1.54.1/": "/news/1.54.1/",
"/news/archie/1.54.2/": "/news/1.54.2/",
"/news/archie/1.54.3/": "/news/1.54.3/",
"/news/archie/1.55.0/": "/news/1.55.0/",
"/news/archie/1.56.0/": "/news/1.56.0/",
"/news/archie/1.57.0/": "/news/1.57.0/",
"/news/archie/1.58.0/": "/news/1.58.0/",
"/news/archie/1.58.1/": "/news/1.58.1/",
"/news/archie/1.59.0/": "/news/1.59.0/",
"/news/archie/1.6.0/": "/news/1.6.0/",
"/news/archie/1.60.0/": "/news/1.60.0/",
"/news/archie/1.61.0/": "/news/1.61.0/",
"/news/archie/1.61.1/": "/news/1.61.1/",
"/news/archie/1.61.2/": "/news/1.61.2/",
"/news/archie/1.61.3/": "/news/1.61.3/",
"/news/archie/1.62.0/": "/news/1.62.0/",
"/news/archie/1.7.0/": "/news/1.7.0/",
"/news/archie/1.8.0/": "/news/1.8.0/",
"/news/archie/1.9.0/": "/news/1.9.0/",
"/news/archie/1.9.1/": "/news/1.9.1/",
"/news/archie/1.9.10/": "/news/1.9.10/",
"/news/archie/1.9.11/": "/news/1.9.11/",
"/news/archie/1.9.2/": "/news/1.9.2/",
"/news/archie/1.9.3/": "/news/1.9.3/",
"/news/archie/1.9.4/": "/news/1.9.4/",
"/news/archie/1.9.5/": "/news/1.9.5/",
"/news/archie/1.9.6/": "/news/1.9.6/",
"/news/archie/1.9.7/": "/news/1.9.7/",
"/news/archie/1.9.8/": "/news/1.9.8/",
"/news/archie/1.9.9/": "/news/1.9.9/",
"/news/archied/1.0.0/": "/news/1.0.0/",
"/news/archied/1.1.0/": "/news/1.1.0/",
"/news/archied/1.10.0/": "/news/1.10.0/",
"/news/archied/1.11.0/": "/news/1.11.0/",
"/news/archied/1.11.1/": "/news/1.11.1/",
"/news/archied/1.12.0/": "/news/1.12.0/",
"/news/archied/1.13.0/": "/news/1.13.0/",
"/news/archied/1.14.0/": "/news/1.14.0/",
"/news/archied/1.15.0/": "/news/1.15.0/",
"/news/archied/1.16.0/": "/news/1.16.0/",
"/news/archied/1.16.1/": "/news/1.16.1/",
"/news/archied/1.17.0/": "/news/1.17.0/",
"/news/archied/1.17.1/": "/news/1.17.1/",
"/news/archied/1.18.0/": "/news/1.18.0/",
"/news/archied/1.19.0/": "/news/1.19.0/",
"/news/archied/1.19.1/": "/news/1.19.1/",
"/news/archied/1.19.10/": "/news/1.19.10/",
"/news/archied/1.19.2/": "/news/1.19.2/",
"/news/archied/1.19.3/": "/news/1.19.3/",
"/news/archied/1.19.4/": "/news/1.19.4/",
"/news/archied/1.19.5/": "/news/1.19.5/",
"/news/archied/1.19.6/": "/news/1.19.6/",
"/news/archied/1.19.7/": "/news/1.19.7/",
"/news/archied/1.19.8/": "/news/1.19.8/",
"/news/archied/1.19.9/": "/news/1.19.9/",
"/news/archied/1.2.0/": "/news/1.2.0/",
"/news/archied/1.20.0/": "/news/1.20.0/",
"/news/archied/1.21.0/": "/news/1.21.0/",
"/news/archied/1.22.0/": "/news/1.22.0/",
"/news/archied/1.23.0/": "/news/1.23.0/",
"/news/archied/1.24.0/": "/news/1.24.0/",
"/news/archied/1.25.0/": "/news/1.25.0/",
"/news/archied/1.26.0/": "/news/1.26.0/",
"/news/archied/1.27.0/": "/news/1.27.0/",
"/news/archied/1.28.0/": "/news/1.28.0/",
"/news/archied/1.29.0/": "/news/1.29.0/",
"/news/archied/1.3.0/": "/news/1.3.0/",
"/news/archied/1.3.1/": "/news/1.3.1/",
"/news/archied/1.30.0/": "/news/1.30.0/",
"/news/archied/1.31.0/": "/news/1.31.0/",
"/news/archied/1.32.0/": "/news/1.32.0/",
"/news/archied/1.32.1/": "/news/1.32.1/",
"/news/archied/1.33.0/": "/news/1.33.0/",
"/news/archied/1.34.0/": "/news/1.34.0/",
"/news/archied/1.35.0/": "/news/1.35.0/",
"/news/archied/1.36.0/": "/news/1.36.0/",
"/news/archied/1.37.0/": "/news/1.37.0/",
"/news/archied/1.37.1/": "/news/1.37.1/",
"/news/archied/1.38.0/": "/news/1.38.0/",
"/news/archied/1.39.0/": "/news/1.39.0/",
"/news/archied/1.4.0/": "/news/1.4.0/",
"/news/archied/1.4.1/": "/news/1.4.1/",
"/news/archied/1.40.0/": "/news/1.40.0/",
"/news/archied/1.41.0/": "/news/1.41.0/",
"/news/archied/1.41.1/": "/news/1.41.1/",
"/news/archied/1.41.2/": "/news/1.41.2/",
"/news/archied/1.42.0/": "/news/1.42.0/",
"/news/archied/1.43.0/": "/news/1.43.0/",
"/news/archied/1.44.0/": "/news/1.44.0/",
"/news/archied/1.44.1/": "/news/1.44.1/",
"/news/archied/1.45.0/": "/news/1.45.0/",
"/news/archied/1.46.0/": "/news/1.46.0/",
"/news/archied/1.47.0/": "/news/1.47.0/",
"/news/archied/1.47.1/": "/news/1.47.1/",
"/news/archied/1.47.2/": "/news/1.47.2/",
"/news/archied/1.47.3/": "/news/1.47.3/",
"/news/archied/1.48.0/": "/news/1.48.0/",
"/news/archied/1.48.1/": "/news/1.48.1/",
"/news/archied/1.49.0/": "/news/1.49.0/",
"/news/archied/1.49.1/": "/news/1.49.1/",
"/news/archied/1.49.2/": "/news/1.49.2/",
"/news/archied/1.49.3/": "/news/1.49.3/",
"/news/archied/1.49.4/": "/news/1.49.4/",
"/news/archied/1.5.0/": "/news/1.5.0/",
"/news/archied/1.50.0/": "/news/1.50.0/",
"/news/archied/1.50.1/": "/news/1.50.1/",
"/news/archied/1.51.0/": "/news/1.51.0/",
"/news/archied/1.51.1/": "/news/1.51.1/",
"/news/archied/1.52.0/": "/news/1.52.0/",
"/news/archied/1.53.0/": "/news/1.53.0/",
"/news/archied/1.54.0/": "/news/1.54.0/",
"/news/archied/1.54.1/": "/news/1.54.1/",
"/news/archied/1.54.2/": "/news/1.54.2/",
"/news/archied/1.54.3/": "/news/1.54.3/",
"/news/archied/1.55.0/": "/news/1.55.0/",
"/news/archied/1.56.0/": "/news/1.56.0/",
"/news/archied/1.57.0/": "/news/1.57.0/",
"/news/archied/1.58.0/": "/news/1.58.0/",
"/news/archied/1.58.1/": "/news/1.58.1/",
"/news/archied/1.59.0/": "/news/1.59.0/",
"/news/archied/1.6.0/": "/news/1.6.0/",
"/news/archied/1.60.0/": "/news/1.60.0/",
"/news/archied/1.61.0/": "/news/1.61.0/",
"/news/archied/1.61.1/": "/news/1.61.1/",
"/news/archied/1.61.2/": "/news/1.61.2/",
"/news/archied/1.61.3/": "/news/1.61.3/",
"/news/archied/1.62.0/": "/news/1.62.0/",
"/news/archied/1.7.0/": "/news/1.7.0/",
"/news/archied/1.8.0/": "/news/1.8.0/",
"/news/archied/1.9.0/": "/news/1.9.0/",
"/news/archied/1.9.1/": "/news/1.9.1/",
"/news/archied/1.9.10/": "/news/1.9.10/",
"/news/archied/1.9.11/": "/news/1.9.11/",
"/news/archied/1.9.2/": "/news/1.9.2/",
"/news/archied/1.9.3/": "/news/1.9.3/",
"/news/archied/1.9.4/": "/news/1.9.4/",
"/news/archied/1.9.5/": "/news/1.9.5/",
"/news/archied/1.9.6/": "/news/1.9.6/",
"/news/archied/1.9.7/": "/news/1.9.7/",
"/news/archied/1.9.8/": "/news/1.9.8/",
"/news/archied/1.9.9/": "/news/1.9.9/"
}
+557
View File
@@ -0,0 +1,557 @@
[
{
"version": "1.62.0",
"date": "2026-11-10",
"body": "### archied\n\n- When an agent step reaches its step budget, the task asks to continue instead of parking. Approving resumes the stopped step with its conversation, including inside a parallel branch.\n- A parked task is flagged when the credential, connection or setting its blocker names changes, so you can see which parks are worth retrying.\n- Merging, closing and issue tools use the repository's own forge connection. A repository on Gitea no longer gets a GitHub 404 when its pull request is merged from archie.\n- A restart re-queues a running task at the step it was interrupted in, and parks it after three restarts instead of looping.\n- Issues and pull request review activity from authors without write access are ignored.\n- A baseline repair made by the repository gate is opened as its own pull request before the task continues.\n- Closing an issue that still has open dependencies is recorded as refused, rather than parking the task.\n- When the work volume fills, stale task clones are reclaimed; clones with uncommitted or unpushed work are kept. Clones need 1 GiB free, not 5.\n- A corrupt repository mirror is rebuilt, and a push that hits a missing object rebuilds the mirror and retries once.\n- Readiness reports degraded when the run loop stalls.\n- Execution budgets set in the dashboard are no longer reverted when the model catalogue loads.\n- A full volume is reported as an environment failure, and an unreachable secret engine as unavailable, rather than as a bad or missing credential.\n- A park from the workflow identity check now appears in the task log.\n- Every task records the identity that created it, and its queued event names the task, actor and principal. System is the one instance identity: it polls forge connections and owns the root grants and connection permits the bot-named identity used to hold, which existing tasks, grants and permits move to on upgrade.\n\n### archie-ui\n\n- A chat reply is no longer lost when you switch conversation or reload mid-answer: the turn finishes and its reply is in the conversation when you come back. Stop is the only way to cancel it.\n- The task page offers every action the task list does.\n- Workflows have row actions, enabling or disabling one confirms with a toast, and the editor toolbar wraps on narrow screens.\n- The dashboard lists five tasks needing attention, not every one.\n- Dismiss all no longer covers the unread badge.\n\n### archie-agent\n\n- The agent image includes Task, so the repository gate no longer downloads it on every run."
},
{
"version": "1.61.3",
"date": "2026-11-08",
"body": "### archie-ui\n\n- Issue, pull request and repository links on tasks open on the forge the repository's connection points at, instead of GitHub.\n\n- Settings: the Harness page is now part of Agent profiles. The setup terminal and the credential sign-in status sit on the same page as the Kit profiles they target, so a profile with a Kit can be signed in from the page that defines it."
},
{
"version": "1.61.2",
"date": "2026-11-07",
"body": "### archied\n\n- archied no longer gets killed by the systemd watchdog when a restart or update leaves many tasks to resume. Each resumed task used to cost a full queue poll before the next was picked up, so a dozen of them outlasted the 30-second watchdog; an update that hit this was rolled back."
},
{
"version": "1.61.1",
"date": "2026-11-07",
"body": "### archie-gateway\n\n- An image or voice attachment that arrives as a link is now checked against what the link serves, the same as an uploaded one. A link whose content is not the declared type, or that cannot be read, is refused.\n\n### archie-ui\n\n- A workflow created on the canvas now saves the agent it runs as, so it runs instead of parking with \"declares no identity to run as\".\n\n### archie-state-store\n\n- A workflow that no longer validates after an upgrade (for example it names a step type that was removed) is repaired at startup instead of breaking every workflow. A shipped workflow is restored from this release's copy; a workflow you created is removed and logged, and its earlier revision stays in the resource history. Valid workflows you created or edited are kept."
},
{
"version": "1.61.0",
"date": "2026-11-07",
"body": "### archied\n\n- A `workflow.handoff` now finishes its run and starts a separate, linked run of the next workflow on the same issue, instead of continuing as another attempt. The task page links each run to the one before and after it; attempts count only retries of one run.\n\n- A task no longer fails to prepare its worktree with \"some refs were not updated\" after a tag or branch moves on the forge.\n\n### archie-ui\n\n- The task page no longer flashes its loading state on every live update while a task runs.\n\n### archie-state-store\n\n- The extension catalogue lists and installs again. Its default signing key has changed; an instance that set its own catalogue signing key in Extension settings keeps using that key."
},
{
"version": "1.60.0",
"date": "2026-11-02",
"body": "### archied\n\n- Curators can list a repository's open issues and file new ones with the `issue_list` and `issue_create` tools, which reach the forge through the daemon. A curator files only when its definition declares `issue_create`; the shipped self-intake example runs in dry run with `issue_list` for deduplication. Listing every open issue needs the forge extensions from the archipelago release after 1.2.0."
},
{
"version": "1.59.0",
"date": "2026-11-02",
"body": "### archied\n\n- Forge extensions can open issues: the forge surface gains `CreateIssue` alongside list, comment and close, and the bundled Gitea and GitHub extensions implement it."
},
{
"version": "1.58.1",
"date": "2026-11-01",
"body": "### archied\n\n- The systemd watchdog now also watches the task intake loop, and its warning names the loop that stalled.\n- archied no longer restarts about a minute after it starts. Under systemd, the watchdog never saw a poll pass and killed it on every start since 1.56.0."
},
{
"version": "1.58.0",
"date": "2026-11-01",
"body": "### archied\n\n- Running `install.sh` over an install whose services are already running now restarts them, so they run the new binaries."
},
{
"version": "1.57.0",
"date": "2026-10-31",
"body": "### archied\n\n- A release reaches `stable` only after it has run on a canary for a day and passed: `archied release publish` now publishes to `next` alone, `archied release canary start|check` installs a release on a canary and judges it from the canary's dashboard, promoting it or rolling the canary back, and `archied release promote` moves `stable` by hand. Promotion refuses a prerelease and a release older than the one `stable` names. The `archied` and `archie-agent` images are published as `:v<version>`, and `:latest` moves only when a release is promoted."
},
{
"version": "1.56.0",
"date": "2026-10-31",
"body": "### archied\n\n- **Install once by hand.** Releases are now signed and published to `git.catlow.cloud/sam/archie`. A host on 1.55.0 or earlier still looks for releases on GitHub, so it finds this one only by running the new installer once: `curl -fsSL https://offloaded.dev/install.sh | bash`. Updates after that come from Settings → Status as before.\n- Releases are signed. Updates and `install.sh` refuse a release the release key did not sign, a zip that is not the one signed, and a channel moved back to an older release. Where releases and the extension catalogue come from is a setting (update settings and extension settings, or `[distribution]` in `config.toml` for a new instance), and `archied release keygen` and `archied release publish` publish signed releases to your own registry.\n- Organisations: forge connections, schedules, alerts, chat channels and audit are per organisation. A member acts in the organisation they select, the setup checklist follows it, and the instance's own forge is its root connection.\n- Workflows are edited as a draft and reach the running workflow only when published. Build a workflow with Archie from the canvas: chat writes the draft into the editor for review, and the editor locks while it does.\n- Schedules run from the State Store with run history, fire into their own organisation, and can trigger workflows. Daemon maintenance runs as built-in schedules.\n- A parked task links to the page that fixes its blocker (repository, credential, model or forge extension), and a parked task can be retried on the current workflow definition.\n- Shipped workflows run as a seeded agent identity with narrow grants instead of the root identity. Credential services are granted to dashboard identities from pickers, and personal API tokens have a name, a lifetime and a last-used time.\n- An org-scoped audit page with filters, a live tail, export and a retention setting; recorded access denials are kept for a set time and listed on their own page.\n- Instructions replace SOUL: instance, organisation, workflow and repository instructions are layered into every agent stage.\n- Chat docks at the bottom of every page and stays open across navigation. Tool calls show where they happened in a reply, with arguments (secrets masked) and durations, and `ask_questions` asks several questions at once.\n- Run more than one instance side by side: `ARCHIE_INSTANCE` names an instance, and the installer installs and updates a named one.\n- Pull request reviews submit REQUEST_CHANGES on blocking findings, list findings outside the diff in the review body, and repost without inline comments when the forge refuses their placement.\n- A workflow installs a repository's declared tooling before its gate, and tasks clone from a shared per-repository mirror.\n- Traces: services, model and tool calls and task containers export OpenTelemetry spans, and log lines carry the trace id.\n- Telegram runs as an archipelago channel extension, enabled from the Extensions page.\n- The Extensions page groups the marketplace by surface, is searchable, shows install state, and offers an update only when the catalogue has one.\n- The dashboard is rebuilt on shared components: a new Archie mark, a theme that follows the OS, task logs as a table, and layouts that fit a phone.\n\n### archie-agent\n\n- Released with archied 1.56.0; task containers export trace spans and install a repository's declared tooling before its gate."
},
{
"version": "1.55.0",
"date": "2026-10-16",
"body": "### archied\n\n- Personas are gone: the Personas settings page, the chat Personality selector and `/personality`. A selected persona never changed what the model was told; SOUL (Settings → SOUL) is the one place to set Archie's identity and style. Stored persona settings are deleted on upgrade.\n- The shipped SOUL describes Archie as the assistant for an event-driven automation system rather than a coding assistant. A SOUL you have saved is kept as it is."
},
{
"version": "1.54.3",
"date": "2026-10-16",
"body": "### archied\n\n- Chat can help write a workflow: it reads your workflows and the step catalog, writes a definition, and checks it the same way saving does, fixing what the check reports. It does not save; paste the YAML it gives you into the editor's YAML view and save there."
},
{
"version": "1.54.2",
"date": "2026-10-16",
"body": "### archied\n\n- Tool calls from Gemini models (Interactions API) receive their arguments intact. Any tool that takes arguments, such as `dashboard_navigate` in chat, failed with \"invalid character '{' after top-level value\".\n\n### archie-agent\n\n- Agent steps on Gemini models (Interactions API) pass tools their arguments intact instead of failing to decode them."
},
{
"version": "1.54.1",
"date": "2026-10-16",
"body": "### archied\n\n- Update checks, `archied update install` and `install.sh` find releases at `github.com/samcharles93/archie-releases`, so a host can update again. A host on 1.54.0 or earlier still looks in the old place and has to be upgraded to 1.54.1 by hand once."
},
{
"version": "1.54.0",
"date": "2026-10-16",
"body": "**Upgrade note:** services now authenticate each other with TLS certificates from your own CA instead of shared tokens. Before upgrading a host whose services listen on anything but loopback (any host running agent containers), issue a certificate per service (`archied`, `archie-gateway`, `archie-messaging`, `archie-state-store`, `archie-ui`, each with its name as the DNS SAN and both server and client auth), add `[tls] ca_file` and `cert_dir` to `config.toml`, and remove every `target_token`, the `*_TOKEN` service variables and the `--token`/`--*-token` flags, including archie-ui's `-token` and `-token-file`. A unit that still passes a removed flag fails to start. See `config.example.toml`.\n\n### archied\n\n- Services authenticate each other with mutual TLS. Each process presents `<cert_dir>/<service>.pem`, peers must chain to `ca_file`, and a caller is identified by its certificate rather than by what it claims. Renewed certificates are picked up without a restart. Without `[tls]`, services listen on and dial loopback only. The harness setup terminal requires `[tls]`.\n- Every gRPC service caps the streams a connection holds, times out stalled handshakes, releases a dead client's streams, and drains for at most 10 seconds on shutdown. Messaging exits when its listener fails instead of staying up without delivering.\n- The dashboard has user accounts. First run opens browser setup for the organisation, workspace and first administrator; people then sign in with a password, a passkey or your identity provider, and account administration lives under Access. The shared dashboard token is gone; reach the dashboard remotely through an HTTPS reverse proxy.\n- `archied update install` updates a host in one transaction: it verifies the release, stages every binary, pulls the agent image by digest and backs up the database, then restarts the services in order and rolls everything back if archied is not healthy for two minutes.\n- Each workflow runs as the identity it declares, checked on every attempt along with the identity that started it. A workflow that declares none is refused, a called workflow runs as its caller's declared identity, and shipped workflows run as the instance root.\n- Test-run a workflow draft before saving it, with forge and push writes suppressed and recorded per step. The History tab lists a workflow's revisions, diffs them as YAML and on the canvas, restores one into the editor, and shows which revision each run used.\n- Start a task from the dashboard. The dashboard home shows activity and setup, and a running task has a read-only Sandbox tab that follows its container.\n- The topbar's Jump to is a command palette, settings lists open as accordions that wait for a new item to be saved, and history restores land as a draft applied from the save bar.\n- Labels, hints, alerts and empty states say what is wrong and what to do, without tutorial or marketing prose.\n- Org isolation is tighter: harness secrets, identity writes, principals, playbook dispatch and model selections in chat stay in the caller's org, instance settings are written by the system org only, and creating a source or reloading a channel is authorized against the target.\n- Binding dispatch claims its capture and enqueues the task atomically, so a capture cannot start two runs, and the run-time workflow check sees the binding event's signature and address.\n- Service-unhealthy alerts count their grace from the last report and also cover a service that went silent, and a restart no longer clears an alert still inside its grace. An invalid stored access policy raises an alert until it validates.\n- A failed cancel of a called workflow no longer leaves the caller running, retention spares captures still waiting to be dispatched, and EDA playbooks load and report at start instead of on first dispatch.\n- Chat model selection works again for provider models.\n\n### archie-agent\n\n- Each run acts as its workflow's declared identity.\n- A task snapshot carries only the model limits its aliases resolve to.\n- A build step's \"no changes\" result comes from its writable stages and clears once a commit lands.\n- Test runs suppress forge and push writes and record what they would have done.\n- The default persona is a reporting-focused identity prompt, without the one-question limit in chat."
},
{
"version": "1.53.0",
"date": "2026-10-11",
"body": "### archied\n\n- Every organisation's data is its own. Chats, tasks, events, transitions, steps, tool calls, run statistics, event sources, event types, mappings, bindings and agent memory are read and written in the org that owns them, and a request can no longer write into another org. Rows written before orgs existed move to their owner's org on upgrade.\n- An instance admin decides what each org may reach: the models it can use, and whether it may register providers under its own credentials. Org Settings gains a Models tab and instance Models gains Org access. The system org is never restricted; another org uses nothing until it is granted.\n- Models are addressed by alias. Aliases replace model roles, one resolver serves every purpose (agent steps, implement, PR review, MCP sampling, chat, embedding, transcription), and an unknown alias fails instead of falling back to a default. The step editor and the chat picker offer aliases, and a workflow naming one that does not exist is refused when saved.\n- Chat sessions belong to one org; a chat resolves its models in the caller's org and is billed to it, and a task run from chat posts its outcome back to that chat.\n- Add a member by provider subject, or by email as a placeholder that the first sign-in the provider vouches for claims.\n- The workflow canvas authors parallel branches as lanes, adds a switch step that runs the case matching a reference, and edits a call's interface. A step shows its role, its number and its run trace.\n- The workflows list shows each workflow's running count and latest run result, the canvas reveals its data-edge handles on hover, and restoring a version asks for confirmation.\n- Store packages can auto-update: a package given the policy is moved to the catalogue's newest digest by a State Store ticker. An update asking for more authority than was accepted waits as a pending update with the running version untouched; approving it accepts the new authority, and a rollback restores the previous version with the authority accepted against it.\n- Model provider keys never enter an agent container: the runtime reaches its providers through the egress proxy, which holds the keys. A task's own credential can no longer replace the workflow definition its run is pinned to, and a package workflow's triggers, tools and forge calls are bounded by the authority accepted for the package.\n- The dashboard warns when it is reachable from off-host over plain HTTP, and the wildcard listen address counts as off-host rather than loopback. Instance health, logs, config and identities, the setup checklist and the skill catalogue are system-org only, and API requests are refused until the access chain has loaded.\n- `/approve` reaches Telegram; the router served it but nothing published it.\n- A worktree a killed container left root-owned is taken back by the daemon, and a PR review's benchmark runner works again on configured models and public PRs.\n- An unserved `/api` path returns 404 instead of the dashboard page, and an input group's select no longer loses clicks to its addon.\n\n### archie-agent\n\n- The runtime reaches model providers through the egress proxy, so provider keys stay out of the container.\n- Agent steps resolve model aliases and their own org's models and credentials, failing on an unknown alias instead of falling back.\n- A switch step runs the case matching its reference.\n- A call waiting on another step is reconciled from durable steps, so it resumes after a daemon restart rather than stranding."
},
{
"version": "1.52.0",
"date": "2026-10-09",
"body": "### archied\n\n- The harness page's setup terminal opens a real session: it starts an ephemeral container from a Kit profile, runs the CLI's own login and captures the OAuth tokens at the provider's token endpoint. Point the dashboard at the daemon with `[services.harness].target` and a `HARNESS_TOKEN` and it stops answering 503; the terminal is created at your browser's size. Takeover of a live task is not in this release.\n- A credential's token endpoint is refused when the run is not granted that service, instead of proxy-ing the provider's real tokens into the container.\n- Settings → Profiles, Credential bindings and Playbooks are editable from the dashboard, and curator definitions can be changed and applied without a restart.\n- Settings say whether each one applies live or needs a restart, show what is consuming resources, and report whether an apply landed.\n- Status shows each service's dependency checks, the agent workers and the broker.\n- The Logs page reads recent logs from every service, not just the daemon.\n- Captures and webhook sources are scoped to the org that owns them: the list, retention and delivery authorization all act in the right org, and a workflow definition resolves in its own org.\n- Chat settings are attributed to the signed-in user, and Settings → Tokens explains when a personal token cannot be created.\n- A channel enabled after Archie started works immediately; a channel that fails on its own recovers; a failed channel is no longer reported as enabled, and stored channel settings no longer save duplicate or unnormalized values.\n- The task table sorts, the command palette no longer scrolls sideways or loses its highlight, unknown routes render a not-found page, and configuration reload failures are shown instead of passing silently.\n- A scheduled job whose payload names a dangerous command is refused.\n- A disabled model provider is never served from the ambient API key.\n- `generate_video` is backed by ai-sdk's MiniMax video provider.\n- A dashboard token is no longer written to the startup log.\n\n### archie-agent\n\n- `workflow.call`: a call is keyed on its declared step path, its key is freed once the callee reaches a terminal state, and a caller waiting on a callee releases its capacity instead of holding it.\n- `command.run` honours step retry and `on_failure`.\n- A value passed between steps keeps its declared type, and optional result booleans are enforced only when the workflow declares them.\n- Capture tools have their results checked against the declared schema.\n- A single-cycle run waits for its in-flight tasks before exiting, and identity tasks inherit live settings.\n- Kit containers run Docker's init as PID 1, so orphaned processes are reaped instead of accumulating inside a long task."
},
{
"version": "1.51.1",
"date": "2026-10-08",
"body": "### archied\n\n- Chat with OpenAI's gpt-6 models (gpt-6-luna and the rest) works with tools; a turn failed with \"Function tools with reasoning_effort are not supported\"."
},
{
"version": "1.51.0",
"date": "2026-10-08",
"body": "### archied\n\n- A secret engine enabled after Archie started (Bitwarden, for example) now supplies its keys straight away; providers that depended on it no longer stay disabled until a restart.\n- The dashboard chat has a microphone button: record a voice message and it is transcribed like a Telegram voice note. It shows only when a `transcription` model role is set under Settings → Models.\n- A file Archie sends in the dashboard chat is a download link for an hour, instead of a note that it can't be delivered.\n- Typing `/model` or `/personality` on its own in the dashboard chat offers the choices as buttons."
},
{
"version": "1.50.1",
"date": "2026-10-08",
"body": "### archied\n\n- When an update is rolled back, the log names the health check that failed instead of only \"unhealthy\"."
},
{
"version": "1.50.0",
"date": "2026-10-08",
"body": "### archied\n\n- Tools that need your approval ask for it again, and Archie can ask you a question or offer choices mid-reply. Since the services were split these never reached Telegram or the dashboard: approval-gated tools failed and questions were never asked.\n- The dashboard chat shows approvals as Approve / Always this session / Deny, choices as buttons, and questions with a reply field.\n- `/update` in the dashboard chat lists what's available with Install and Not now.\n- Settings → Status → Versions installs the update it shows; its Install button sent an empty request."
},
{
"version": "1.49.4",
"date": "2026-10-07",
"body": "### archied\n\n- Settings → Status and Settings → Extensions are split into tabs instead of one long page; the Versions table's status column ends at the card's edge.\n- Tools & MCP has one \"Add MCP server\" button; the transport is chosen in the form, and an unnamed new server is not an unsaved change.\n- Settings → Repositories shows the add field when no repositories are configured, instead of a blank page.\n- The unsaved-changes bar always rests at the bottom of the window."
},
{
"version": "1.49.3",
"date": "2026-10-07",
"body": "### archied\n\n- Settings → Status → Versions shows the Gateway as \"Update available\" with an Install button when a newer release exists; it read \"Unknown\" with no way to install. The Runtime row stays \"Unknown\" until an agent task has run.\n- The release channel buttons sit at the Updates card's right edge instead of mid-row."
},
{
"version": "1.49.2",
"date": "2026-10-07",
"body": "### archied\n\n- Carries the 1.49.0 and 1.49.1 changes, whose builds were never published. The update check reads GitHub releases directly and still offers only releases with a verifiable linux-amd64 zip."
},
{
"version": "1.49.1",
"date": "2026-10-07",
"body": "### archied\n\n- When the dashboard session expires, the page returns to the sign-in screen instead of showing errors on every page until a manual refresh."
},
{
"version": "1.49.0",
"date": "2026-10-07",
"body": "### archied\n\n- Extensions that declare no egress hosts (vault, email, gitea) reach the network again; only packages that declare their hosts are confined to them. The Accept dialog shows \"network: unrestricted\" for the rest.\n- The update check finds releases itself, and reuses a found release for ten minutes so repeated checks stay under GitHub's rate limit."
},
{
"version": "1.48.1",
"date": "2026-10-07",
"body": "### archied\n\n- **Settings → Status → Updates** now chooses only the release channel (stable, prereleases, or a pinned version). Update checks and installs always run the `archie-update-*` scripts installed beside the binaries; the dashboard can no longer set the command that runs."
},
{
"version": "1.48.0",
"date": "2026-10-07",
"body": "### archied\n\n- **Settings → Status → Updates** edits the update check and install commands. They default to the `archie-update-*` scripts installed beside the binaries, so a zip install shows **Install** on the Versions card with nothing configured. The `update_check_command` and `update_install_command` keys under `[chat.telegram]` are no longer read; remove them from `config.toml`.\n- `archie-update-install` run from a shell now reads `~/.config/archie/env`, so the pre-update backup of the bundled database no longer fails with `no password supplied`. Run it with `--auto` to install the newest release."
},
{
"version": "1.47.3",
"date": "2026-10-07",
"body": "### archied\n\n- **Settings → Extensions**: **Accept** in the authority review now accepts the extension, and **Remove** removes it. Both previously closed the dialog without doing anything."
},
{
"version": "1.47.2",
"date": "2026-10-06",
"body": "### archied\n\n- **Events → Inspector** now lists your capture sources with their real URLs and a **New source** button, replacing the `/webhooks/capture/<source>` placeholder. Sources no longer sit on the Bindings tab."
},
{
"version": "1.47.1",
"date": "2026-10-06",
"body": "### archied\n\n- The bundled PostgreSQL has no network and publishes no port: the services reach it through its Unix socket under `~/.local/share/archie/postgres`, so it no longer collides with another PostgreSQL on 5432. Leaving the database question blank in `archied setup` selects it.\n- The installer does not start the services when the bundled PostgreSQL fails to start; it names the command to read its logs.\n- On hosts that restrict unprivileged user namespaces (Ubuntu 23.10+), the installer prints an AppArmor profile allowing them for the Archie binaries only."
},
{
"version": "1.47.0",
"date": "2026-10-06",
"body": "### archied\n\n- Install with one command: `curl -fsSL https://raw.githubusercontent.com/samcharles93/archie-core/main/install.sh | bash` downloads this release, verifies its checksum and runs `archied setup`. `--from-source` builds a checkout instead.\n- `archied setup` asks for the PostgreSQL URL. Left blank, it uses the bundled Compose database with a generated password stored in `~/.config/archie/env` as `PGPASSWORD`, not in `config.toml`.\n- The bundled PostgreSQL listens on 127.0.0.1 only. A database created before this release keeps its old `archie` password; enter its URL at setup or recreate the volume.\n- The release zip carries `docker-compose.yml`.\n- Extensions need unprivileged user namespaces, which Ubuntu 23.10 and later restrict. Allow them for the Archie binaries with an AppArmor profile; from the next release the installer prints it. Do not disable the restriction system-wide.\n- fix(app): assign the temp-file close result on the error path\n- fix(webhook): set a ReadHeaderTimeout on the forge webhook receivers\n- fix(forge): refuse a review line number that does not fit an int\n- fix(storepkg): mask the tar mode to the permission bits before narrowing\n- fix(webui): navigate the Events chain once, not twice\n- feat(tools): fail the gate when docs cite a path that no longer exists\n- fix(webhookguard): verify uppercase-hex HMAC signatures\n- fix(configuration): make bot_user required, defaulted, and named\n- feat(workflow): add the command.run step type\n- fix(controlplane): an absent MCP server field inherits the file value\n- fix(build): restore the go fix fixpoint, and give the formatter one owner\n- fix(archied): restore contextcheck directives and drop unused adapter\n- feat(secretengine): serve secret engines as go-plugin extensions\n- refactor(statestore): own package for the State Store service; access reset moves to archie-state-store\n- refactor(archied): gateway owns model work; daemon drops chat runtime, tools, memory and curators\n- refactor(archiegateway): own package for the Gateway service\n- fix(services): services wait for peers instead of exiting; restarted broker keeps its endpoint\n- refactor(archieplaybooks): fold archie-playbooks into archied playbooks lint|serve\n- refactor(agentrun): agent stage contract moves to the domain layer\n- refactor(agentexec): model loop moves to agentexec/modelloop\n- fix(configuration): bindings encryption keys must use the env engine\n- feat(storepkg): fetch packages from any registry, plain HTTP on loopback only\n- feat(webui): install, accept and enable extensions from the dashboard\n- feat(presence): every service re-stamps a presence record in the State Store\n- refactor(plugin): delete Yaegi daemon plugins and plugin_dir\n- refactor(module): the log action is built in; delete the module loader and reconciler\n- refactor(skill): delete Yaegi skill scripts and the run_go_script tool\n- refactor(examples): the firewall workflow moves to archipelago\n- feat(presence): services card on the status page and archied status\n- feat(archiemessaging): verify update reports against archied's presence and restore release announcements\n- fix(configuration): an overlay stands in for a missing config file; dev overlay is complete\n- feat(access): edit org, workspace and object policies from the dashboard; refuse owner lockout\n- feat(access): instance network rules at the capture receiver; policies reload without a restart\n- feat(staterpc): attribute State Store calls to the calling service; policy audit records it\n- feat(controlplane): playbooks and agent profiles install from packages; the daemon reads eda-playbooks live\n- feat(forgeext): forge surface served by extensions; forge.type names the installed package\n- refactor(forge): github and gitea leave core; webhooks parse in the forge extension\n- feat(staterpc): the State Store derives org and actor from the principal archie-ui forwards\n- feat(channelext): chat channels served by extensions; messaging runs the enabled ones\n- refactor(channels): webhook and email run only as extensions; their channel settings go\n- feat(skills): skill packages project into a skills resource the gateway reads live\n- fix(gatewayrpc): sender_id and rate_limited cross the chat wire\n- fix(controlplane): change history names kinds and reads only the caller's org\n- feat(contracts)!: requests no longer name their org; the State Store derives it from the caller\n- feat(identity): personal API tokens, created and revoked from the dashboard, act as their owner\n- fix(archieui): a sign-in provider outage is a health issue, not a startup failure\n- feat(staterpc): one run credential per task, kept in the State Store, authorizes its store calls and its push\n- fix(forgerpc): forge calls need the run credential and reach only the run's own repository\n- feat(controlplane): identity credential grants edited from the dashboard and applied live\n- feat(daemon): a workflow that names an identity runs asLine truncated
},
{
"version": "1.46.0",
"date": "2026-10-02",
"body": "### archied\n\n- feat(workflow): declared workflow outputs for wait:true callers\n- feat(prreview): the operator-approval gate is PRReview's own stage-list entry\n- feat(staterpc): carry the review gate and re-review rounds, with one guarded response write\n- feat(prreview): the gate records the review it holds and posts the operator's answer\n- feat(taskactions): one approval path answers the review gate from every surface\n- feat(webui): the dashboard answers the review gate, including a re-review's instructions\n- feat(daemon): resolve the producing identity's org before publishing work\n- feat(webui): block invalid settings and show a field's former value\n- fix(workflow): derive a declared output's captures need for profile selection\n- fix(storepkg): validate every declared authority grant at the package descriptor\n- feat(archied): refresh the model catalog at runtime\n- feat(mcp): answer server-initiated sampling from the chat model\n- feat(container): send registry auth on image pull\n- feat(messaging): retract ephemeral replies after their TTL\n- feat(messaging): transcribe Telegram voice notes\n- fix(egress): take a run's credential kind from its binding, not the Kit\n- feat(webui): a live-apply setting reads as applied, never as a restart\n- feat(webui): the dashboard reads harness bindings and opens the setup terminal\n- feat(gateway): list the harness page in the dashboard page registry\n- feat(webui): the harness settings page and its setup terminal\n- fix(workflow): park environment gate failures without dispatching a builder\n- feat(messaging): adapter-facing clarify, picker and approval contract\n- feat(gateway): gate admin slash commands by sender policy\n- feat(plugins): load plugin and secret-engine files without a restart\n- fix(workflow): deliver the feasibility PRD to the forge issue\n- fix(messaging): report the daemon version this process was built from\n- fix(messaging): carry an inbound attachment's bytes to the gateway turn\n- fix(daemon): resume a retry whose worktree is gone\n- fix(archied): omit the max-token bound on reasoning-class models\n- fix(logging): file a task log record under its own event time\n- fix(control-plane): unify validation for the domain-managed kinds\n- feat(webui): let the operator choose the retry worktree mode\n- feat(agent): seed a starter SOUL and upgrade only untouched templates\n- feat(controlplane): add the writable review-settings resource\n- fix(messaging): transcribe voice notes on the model-owning side of the boundary\n- fix(messaging): gate the boundary on config reads, not only package links\n- feat(messaging): restart only the channel whose settings changed\n- feat(container): apply container-runtime-policies live\n- feat(tools): reconcile MCP servers and tool settings live\n- feat(messaging): add a per-turn interactive carrier for clarify and picker\n- feat(gateway): offer ask_user when the turn's channel can carry a question\n- feat(telegram): carry clarify and picker through the text fallback\n- fix(webui): pin the dashboard validators to the control plane's\n- refactor(agent): drop the SOUL upgrade branch with no shipped template\n- feat(agentworker): answer MCP sampling from the task's model\n- fix(workflow): bind the remediate worktree before the builder runs\n- fix(config): carry max_retries into the worker TaskConfig snapshot\n- fix(agentworker): supply the guardrail engine to every task run\n\n### archie-agent\n\n- feat(workflow): declared workflow outputs for wait:true callers\n- feat(prreview): the operator-approval gate is PRReview's own stage-list entry\n- feat(staterpc): carry the review gate and re-review rounds, with one guarded response write\n- feat(prreview): the gate records the review it holds and posts the operator's answer\n- feat(taskactions): one approval path answers the review gate from every surface\n- fix(workflow): derive a declared output's captures need for profile selection\n- fix(storepkg): validate every declared authority grant at the package descriptor\n- feat(mcp): answer server-initiated sampling from the chat model\n- feat(container): send registry auth on image pull\n- feat(messaging): retract ephemeral replies after their TTL\n- feat(messaging): transcribe Telegram voice notes\n- fix(egress): take a run's credential kind from its binding, not the Kit\n- fix(workflow): park environment gate failures without dispatching a builder\n- feat(messaging): adapter-facing clarify, picker and approval contract\n- feat(plugins): load plugin and secret-engine files without a restart\n- fix(workflow): deliver the feasibility PRD to the forge issue\n- fix(messaging): carry an inbound attachment's bytes to the gateway turn\n- fix(daemon): resume a retry whose worktree is gone\n- fix(logging): file a task log record under its own event time\n- fix(control-plane): unify validation for the domain-managed kinds\n- feat(webui): let the operator choose the retry worktree mode\n- fix(messaging): transcribe Line truncated
},
{
"version": "1.45.0",
"date": "2026-09-30",
"body": "### archied\n\n- fix(eda): reject a result map missing a field or needing a conversion\n- feat(eda): per-org workflow enable/disable gating bindings\n- feat(telegram): carry inbound media through the chat turn\n- fix(prsource): use a CodeQL-recognised containment guard when extracting archives\n- feat(store): key control-plane resources by (org, kind)\n- fix(store): refuse resource keys the audit key cannot disambiguate\n- fix(daemon): resume the task branch before container acquisition\n- feat(webui): show attachment metadata in the session transcript\n- feat(webui): name a workflow's declared inputs on the work-request form\n- feat(controlplane): carry the caller org from the request principal\n- fix(webui): the workflow handlers act in the caller's org\n- feat(kitrun): render the OAuth credential file with sentinels\n- feat(store): record accepted package authority against the pin\n- fix(workflow): the own-PR flow no longer parks on the operator-approval gate\n- feat(gateway): a TTL-bounded dedup gate for redelivered platform messages\n- feat(egress): capture the OAuth scope set and carry it to the harness secret\n- feat(kitrun): render the OAuth scopes and omit an uncaptured primary key\n- feat(store): project installed package contributions into org resources\n- feat(gateway): coalesce rapid-fire text events into one turn\n- fix(config): expand plugin, module and skills dirs like every other operator path\n- fix(webui): drop the config schema's editability advert\n- feat(webui): events counts, YAML reading, log rows and dashboard filters\n\n### archie-agent\n\n- feat(eda): per-org workflow enable/disable gating bindings\n- feat(telegram): carry inbound media through the chat turn\n- fix(prsource): use a CodeQL-recognised containment guard when extracting archives\n- feat(store): key control-plane resources by (org, kind)\n- feat(controlplane): carry the caller org from the request principal\n- feat(kitrun): render the OAuth credential file with sentinels\n- feat(store): record accepted package authority against the pin\n- fix(workflow): the own-PR flow no longer parks on the operator-approval gate\n- feat(egress): capture the OAuth scope set and carry it to the harness secret\n- feat(kitrun): render the OAuth scopes and omit an uncaptured primary key\n- feat(store): project installed package contributions into org resources"
},
{
"version": "1.44.1",
"date": "2026-09-29",
"body": "### archied\n\nTwo fixes to tasks that could not get past their workflow definition.\n\n- **Approving a task no longer parks it again.** A task requeued under a\n different workflow kept the previous run's definition pinned, so the worker\n refused to compile the dispatch — it named `feasibility` while the row named\n `implement` — and the task parked immediately, identically on every further\n approval, which left `decline` as the only working operator action.\n The daemon now re-pins whenever the pinned definition's id disagrees with the\n task's workflow. A pin that is present, digest-valid and id-consistent is\n still a strict no-op, so an operator's own definition override survives a\n dispatch unchanged.\n- **A shipped workflow definition now reaches an existing install.** A stored\n seed was consulted only for a resource the store did not already hold, so a\n document that changed in the build never reached a database an earlier\n release had seeded. For workflow definitions that is a total outage rather\n than a stale setting: the collection validates as one document, so a stored\n step type this build no longer has failed every task's pin, whatever workflow\n the task named — and the documented recovery, removing the resource and\n restarting, wrote nothing either, because the store answered the seed's known\n request ID from a history that outlives the resource. A seed now refreshes a\n kind it wrote the newest revision of and re-creates a resource that is gone,\n while an operator's own replacement is never undone.\n\n### archie-agent\n\nThe runtime image is rebuilt with this release and links the shared workflow\npackage carrying the definition-id helper above. Hosts that run agent\ncontainers need `docker compose pull agent` after updating to pick it up."
},
{
"version": "1.44.0",
"date": "2026-09-29",
"body": "### archied\n\nArchie can now review pull requests.\n\n- **Reviews on request and by watch.** Ask in chat or on the dashboard work form, add a repository to the watch list, or just let archie review its own PRs before it opens them. Review intensity follows a depth dial (quick/standard/deep) classified from the size of the change, and every finished review passes a verification layer — coverage-gap and cross-finding consistency checks — before it is produced.\n- **No forge credential reaches the review sandbox.** The daemon prefetches the pull request's data and rebuilds its source snapshot over the forge's HTTP API, so the agent container works from an isolated copy with no read access to the repository's credentials.\n- **Reviews stop at the operator gate before posting.** `review.precision_gate` / `approve_before_post` decide whether a finished review posts itself or parks for operator approval. With this release the parked state is a stop sign, not a checkpoint: the approve/reject/re-review responses behind the gate are not wired yet, and the gate's settings are not yet editable in the dashboard (configure them in `config.toml`). A parked review sits until that follow-up lands.\n- The adversarial self-review pass archie previously ran before opening its own PRs is superseded by this pipeline and has been removed.\n- Hardened harness input handling: harness identifiers are bounded to integer types.\n\n### archie-agent\n\nThe runtime image is rebuilt with this release; it links the shared pr-review workflow packages behind the reviews above. Hosts that run agent containers need `docker compose pull agent` after updating to pick it up."
},
{
"version": "1.43.0",
"date": "2026-09-28",
"body": "### archied\n\n- **Organisations.** Tasks, identities and settings now belong to an org. An\n existing install is upgraded into a default org when the State Store first\n starts; the upgrade resumes if interrupted. Task de-duplication is scoped\n per org and identity.\n- **Access policies are enforced** at the dashboard, the API and task\n dispatch, with shipped roles and a rule that nothing crosses between orgs.\n Denials are recorded and reported on the health page. If a policy locks\n you out, `archied access reset --org <org>` (or `--instance`) on the State\n Store host restores the shipped defaults.\n- **Workflows can call workflows** with a `workflow.call` step. Inputs and\n call cycles are checked when the workflow is saved, and the caller waits\n on the callee's result.\n- **Runs record each step.** A run's stages and agent calls are stored as\n steps, the task detail page reads them, and stopping a task or archiving\n it goes through one cancel path. After a crash, steps left running are\n marked interrupted. Archiving a task removes its worktree.\n- **Model roles, repositories, scheduling policy, providers and agent\n profiles apply without a restart.**\n- **Kit harness profiles:**\n - `kit` is now one digest-pinned reference, a workload Kit or a published\n Kit set, not a list. **Rewrite `kit = [...]` in `config.toml` or the\n agent-profiles settings as the single reference**; a list no longer\n loads. Compose mixins by publishing a Kit set.\n - OAuth logins are handled on the host: the egress proxy refreshes tokens,\n stores them encrypted, and gives the container only placeholders.\n - A Kit's skills request mounts `skills_dir` read-only, and its\n instructions file (such as `CLAUDE.md`) is written beside the workspace,\n which is now `/archie/workspace`.\n - A run still cannot be granted the credential a Kit needs, so a Kit that\n requires one is refused at launch.\n- Rate-limited webhook deliveries get `429`.\n- `archie-gateway` and `archie-state-store` report ready to systemd.\n\n### archie-agent\n\n- Runs workflow calls, records its steps and agent calls, and runs Kit\n harness stages under the profile's Kit."
},
{
"version": "1.42.0",
"date": "2026-09-26",
"body": "### archied\n\n- **The dashboard is rebuilt on a new Graphite theme.** Settings moved to its\n own sidebar with one save flow across every page (Channels, Tools & MCP,\n Scheduling policy, Personas and Schedules, Identities, Plugins, Container\n runtime, and a History of past changes). The top bar, Dashboard, Workflows,\n task detail, the New task dialog and the Events page are all new: Dashboard\n leads with what needs you, a run's stage rail and detail panels sit\n side by side, Workflows shows per-workflow stats including completed runs,\n and Events states capture status with a copyable capture endpoint. Live\n updates share one stream and reopen after a drop instead of going quiet.\n- **Settings changes are audited.** A field-level audit table records who\n changed what, with a view on each settings page.\n- **A task can carry a whole-run wall-clock limit**, separate from a stage's\n own budget.\n- **A run that makes no changes now ends as completed and its worktree is\n cleaned up**, rather than left in a state Workflows didn't count.\n- **Abandoning a task no longer closes its forge issue.** Only the workflow's\n own terminal outcomes do that now.\n- **A task whose container exits before the worker replies is parked**\n instead of left running with no way to finish.\n- **A worktree still holding uncommitted work is kept**, rather than reset,\n when its task reaches a terminal state.\n- **A provider's stored settings no longer get corrupted with a process-local\n placeholder in place of your configured secret reference**, and archied\n rejects a stored value shaped like one on the way back in.\n- **Kit v3 harness profiles.** A `[containers.profiles.<name>]` entry can now\n name a Kit v3 image (`kit = [...]`, pinned by digest) instead of a plain\n container image, running the task's agent stages on an external CLI --\n Claude Code, Codex, Pi, OMP or GitHub Copilot CLI -- inside an isolated\n sandbox network. This release lands the daemon-side plumbing (egress\n proxy, sandbox network, credential injection points); it does not yet ship\n a way to grant a run's identity the credential a Kit needs, so a Kit\n requiring one is refused at launch until a later release adds it.\n- `task dev` now starts the State Store and waits for it before the rest of\n the stack.\n- Every service binary the installer builds is stamped with its version.\n\n### archie-agent\n\n- Carries the same task-lifecycle fixes as archied above (no-change runs,\n parking on an early container exit, and the abandon/forge-issue fix), plus\n the Kit v3 harness runner: a stage can now drive an external CLI\n headlessly, read output from Claude Code, Codex, Pi, OMP or GitHub Copilot\n CLI, and serve it capture tools over MCP.\n- Claude's cached tokens are counted as prompt tokens, matching the built-in\n agent loop's accounting."
},
{
"version": "1.41.2",
"date": "2026-09-25",
"body": "### archied\n\n- **`/update` no longer offers an old runtime.** The runtime has shipped under\n the release version since the version streams merged, but the update check\n still read the retired runtime tags, so a current host was offered runtime\n 1.35.0 as an update. Do not approve that offer on 1.41.1; update to 1.41.2\n instead.\n- **`/version` reports the runtime version.** Binaries from the release zip\n showed `Runtime: dev`."
},
{
"version": "1.41.1",
"date": "2026-09-25",
"body": "### archied\n\n- **First published build of 1.41.0.** The 1.41.0 tag produced no release\n artifacts; 1.41.1 carries everything listed under 1.41.0 below, including\n the PostgreSQL 18 requirement and the removed config keys."
},
{
"version": "1.41.0",
"date": "2026-09-25",
"body": "### archied\n\n- **Archie now stores everything in PostgreSQL 18, and `database_url` is\n required.** Tasks, events, captures, bindings, settings and chat\n conversations are served from the database `database_url` names; the State\n Store, archied and the Gateway refuse to start without it, and refuse a\n server older than PostgreSQL 18. `docker compose up -d postgres` starts a\n matching local database with the default URL in `config.example.toml`.\n- **Existing SQLite data is not carried over.** This release reads no SQLite\n file and ships no importer, so an upgraded install starts with empty task,\n event and conversation history. `db_path` is gone; `state_dir` (default\n `~/.local/share/archie`) now holds the embedded NATS store and task logs.\n- **Backups are whole-database snapshots.** `archie-state-store backup` and\n `restore` work on the PostgreSQL database through `pg_dump`/`pg_restore`,\n which must be on `PATH`. There is no automatic schema rollback: the way back\n from an upgrade is restoring the snapshot taken before it.\n- **Events carry a type, and bindings pick one.** Archie infers an event type\n from captured payloads; the Inspector shows proposed and unidentified\n events and lets you name them. Mappings are per event type and show how\n many captures they match, a source can feed several bindings, and a binding\n chooses an event type plus an optional filter. An unidentified event does\n not dispatch.\n- **Sources own webhook signing.** Each source gets a UUIDv7 path and its own\n signing secret, or can be explicitly approved to accept unsigned events. A\n new binding starts pending approval.\n- **EDA playbooks can run module actions and take workflow inputs.** Action\n playbooks run at most once per event through the dispatch ledger, a binding\n can pass inputs to its workflow, the repository is optional, and a workflow\n can name an agent profile. `archie-playbooks lint -eda-dir` checks a\n directory, and `archie-playbooks serve` publishes the same findings to your\n editor as a language server.\n- **Config keys removed.** `[agent]`, `[oidc]`, `[image]`,\n `containers.enabled`, `db_path`, and the `token_env` form of `[forge]`,\n `[artifacts]` and `[chat.telegram]` no longer exist. Write each credential as\n `token = { engine = \"env\", key = \"NAME\" }`. A leftover key is reported at\n startup as unrecognised rather than failing the load.\n- **Dashboard.** Old `#/path` links and the `/captures`, `/mappings` and\n `/bindings` addresses no longer redirect; use the Events page tabs. The live\n stream moved to `/api/stream`, so reloading `/events` serves the page.\n\n### archie-agent\n\n- The Postgres-backed wire formats, event types and workflow inputs are part\n of this image; a host that runs the agent should `docker compose pull agent`\n to pick it up."
},
{
"version": "1.40.0",
"date": "2026-09-23",
"body": "### archied\n\n- **Every park now says what kind of intervention it needs.** A parked task\n is classified as `needs you` (a decision or fix only an operator can\n supply), `transient` (an environment problem -- container pool, storage,\n transport -- retry once it is fixed), or `terminal` (the repository or\n identity cannot act; retrying cannot succeed). The class shows beside the\n Parked badge on the dashboard, so \"needs you\" reads as a request rather\n than a failure.\n- **Operator retries and review-remediation rounds now have separate\n budgets.** An operator's manual retries no longer draw down the rounds\n Archie may spend addressing review feedback on its pull requests, and a\n round-cap park no longer makes a later retry re-park immediately.\n- **`latest` now names the newest release. A push to `main` that is not a\n release publishes `edge` and `sha-<commit>` instead. A host that was\n following `main` by pulling `latest` stops advancing at this release --\n switch it to `edge` to keep tracking `main`, or leave it on `latest` to\n follow releases.**\n\n### archie-agent\n\n- The park-classification wire format is part of this image; a host that\n runs the agent should `docker compose pull agent` to pick it up."
},
{
"version": "1.39.0",
"date": "2026-09-23",
"body": "### archied\n\n- **Archie now acts on review comments left on its own pull requests.** A\n requested-changes review (or a standalone comment) on a PR Archie opened\n dispatches a remediation run: the smallest change that satisfies the\n feedback, committed to the same PR branch and answered in the review\n thread. Approved reviews never remediate, each reaction is its own round,\n and the exchange is bounded by the repo's `max_retries` before Archie stops\n and says so on the PR.\n- **The task run page is a master-detail view.** The run's stage rail and\n detail panels sit beside the run list, so one run's timeline is visible\n without leaving the page.\n- **Live activity groups related updates instead of stacking them by event\n kind**, so a burst of progress on one task reads as one story, and the\n stage filter resets when you switch attempts.\n- Contrast fixes on the info and subtle text tokens clear WCAG AA.\n\n### archie-agent\n\n- The review-reaction remediation path is part of this image; a host that\n runs the agent should `docker compose pull agent` to pick it up."
},
{
"version": "1.38.0",
"date": "2026-09-23",
"body": "### archied — Event capture, mappings and bindings are PocketBase records\n\n- **Captured events, field mappings and playbook bindings live in PocketBase\n collections instead of SQLite tables.** They are ordinary records, which is\n what lets a binding be changed at runtime rather than by editing a database.\n- **A read-only operator surface over the task database ships with the State\n Store** (`archie-state-store -admin-addr`). It serves view collections over\n tasks, transitions, events, identities and resources, and refuses\n `/api/backups` and `POST /api/sql`, so it cannot rewrite state or hand out the\n database file.\n- **A binding cannot go live without approval.** It moves draft → pending\n approval → armed; one binding per source is enforced on insert, on edit and\n on approval; and an edit always returns it to pending approval. A secret left\n blank on an edit keeps the stored one rather than disarming a live binding.\n- **The workspace code-search indexer is gone.** No deployment configured it,\n and it was one more resident writer over the workspace.\n\n### archied — Editing a binding or a mapping shows on the activity stream\n\n- **A dashboard edit no longer needs a manual refresh.** A successful binding or\n mapping write announces itself on the same activity path a captured event\n already uses. The announcement carries the record id and the action and the\n dashboard refetches the record, so the signal cannot go stale.\n\n### archied — Cron schedules fire\n\n- **A cron job computes its next run and fires.** Until this release a cron\n schedule was accepted at creation and then refused at run time with\n `ErrScheduleUnsupported`, so a cron job never ran.\n- **The dialect is PocketBase's, and it differs from Vixie cron on one point.**\n Day-of-month and day-of-week are combined with AND rather than Vixie's OR, so\n `0 0 1 * 1` means Monday the 1st, not \"the 1st, or any Monday\". The\n `@daily`-style macros behave as usual. An expression that can never match,\n such as `0 0 30 2 *`, is rejected instead of being left to run forever.\n\n### archied — Tool calls are queryable\n\n- **Every completed tool call is a row in the `tool_calls` collection**, not\n only a line in the on-disk task log. The row carries the task, the attempt,\n the tool, its result or its error, and when it ran.\n- **A failed projection never fails the task.** The event is the record and the\n collection is a transcript of it, so a copy that could not be written is\n logged and counted rather than propagated.\n\n### archied — A task whose identity no longer resolves parks instead of acting as root\n\n- **A task naming an identity archie no longer knows — renamed, retired or\n removed in the control plane — no longer falls back to the root forge's\n credential.** It parks with the reason recorded. A task arriving over NATS\n with such an identity is refused before it is enqueued. A task with no\n identity is the single-identity root path and is unchanged.\n\n### archied — The PR review is published as a readable artifact\n\n- **A completed review is rendered to markdown and published to the\n collaborative editor**, so a person reads it and comments on it instead of\n reading a wall of text in a pull-request comment.\n- **Publishing never fails the review.** With `[artifacts] base_url` unset the\n sender is not constructed and publishing is a log line; a publish that fails\n is logged with its status and the same review is republished the next time it\n completes. Set `[artifacts] token` (or `WORKSPACE_INGEST_TOKEN`) to enable it.\n\n### archied — The activity feed no longer depends on row ids being monotonic\n\n- **The feed's resume cursor is opaque, and a malformed or pre-upgrade cursor\n degrades to \"from the beginning\" rather than failing the stream.** One\n consequence on upgrade: a browser holding a cursor issued before this release\n replays the backlog once.\n\n### archie-agent\n\n- **The runtime image is rebuilt by this release, and a host must pull it**\n (`docker compose pull agent`). The shared State Store contract changed shape\n in the sections above — task and event-capture id fields are strings now — and\n the two halves are versioned together, so an agent image built before this\n release does not speak to the new State Store. There are no agent behaviour\n changes of its own in this release."
},
{
"version": "1.37.1",
"date": "2026-09-22",
"body": "### archied — A recorded event names the actor in its own fields\n\n- **Event attribution survives the trip to the State Store.** The acting\n identity, its kind, and the authorising principal are carried on the event\n itself, so an audit query finds the actor in its own fields rather than only in\n the event's prose. An approval taken through the dashboard is the case that\n exposed the gap.\n\n### archied — A chat reply that contains code renders the way it was written\n\n- **A code fence closes only on a run of the same character that is at least as\n long as the one that opened it.** A four-backtick fence, a tilde fence, or a\n reply that wraps its own code in a longer fence now arrives as code instead of\n as a broken language tag or paragraphs of leaked text.\n\n### archied — A tool call is one line with its own icon\n\n- **A tool call takes a single line instead of a label plus a fenced block.**\n Telegram draws a fenced block as a full code widget — language header, copy\n button and panel — and the block parser inserts a spacer before it, so a\n handful of calls filled the screen to show a few word counts. Each call now\n shows the icon its own tool declares, and a tool that declares none renders\n without one.\n- **The status word prints only when the outcome is not success.** Every tool\n line previously read \"done\", including the ones that had not finished.\n\n### archied — Runtime dependencies updated\n\n- **Runtime dependencies updated**, including the OpenID Connect and OAuth\n libraries."
},
{
"version": "1.37.0",
"date": "2026-09-22",
"body": "### archied — A request is attributed to the identity that made it\n\n- **A browser can sign in, and an action taken through it records the person.** The dashboard validates a\n provider-issued token, resolves it to an identity, and attaches it to the request; the task-action record\n then names the actor. `Authenticate` and the sign-in callback share one resolver, so a browser sign-in\n cannot be accepted on terms a presented token would be refused on.\n- **archie issues no session.** The callback stores the provider's own token in an HttpOnly cookie and every\n later request re-verifies it, so nothing archie holds can outlive the provider's decision and there is no\n session table to expire, revoke or get wrong.\n- **The event kind describes the actor.** A person's approval records `human_approved` as that person; an\n agent's records `agent_approved`; an action with no authorising principal records `task_approved` with the\n attribution fields **empty**. Nothing is credited to an identity that did not act, and an unattributed\n action is recorded as unattributed rather than guessed.\n- The acting identity is derived from the presented credential and **never** from a request field: a body\n carrying `actor`, `actor_id`, `identity` and an `X-Archie-Actor` header still cannot choose it.\n\n### archied — A host install now works, and an update refuses a host it cannot keep consistent\n\n- `install.sh` writes and enables **all five** host units; previously it seeded only `archied.service`, so a\n fresh host ran one service of five and an operator applied the rest by hand from a runbook. The runbook is\n a description again: it names the units and points at `systemctl --user cat`.\n- **Every host binary reports its version**, and the updater reads all of them **before it can report\n \"nothing to install\"**. A host whose binaries disagree is refused, naming each one: a newer messaging\n binary beside an older state store crash-loops against a service the older store does not serve, and that\n install previously looked healthy from the updater's point of view.\n- The packaged, installer and updater command lists are pinned by a test, so a service added to one and not\n the others fails the gate instead of shipping a partial install.\n\n### archied — A release image can be traced to a commit\n\n- The publish step derives the commit by **dereferencing the ref** rather than reading `github.sha`, because\n every release tag in this repository is annotated and a tag's object id is not a commit. An immutable\n `sha-<commit>` tag is published alongside `:latest`, and a build with no release tag is stamped\n `dev+<short sha>` rather than a bare `dev` that identified nothing.\n\n### archied — Curator definitions are data, not a second registry\n\n- Curator definitions may come from configuration or code and run through **one** engine into the existing\n registry — no parallel authority and no second config reader. A definition declares its tools, and an\n unknown tool name fails rather than widening the set silently."
},
{
"version": "1.36.0",
"date": "2026-09-22",
"body": "### archied — The dashboard declares tools an in-browser agent can call\n\n- The dashboard registers **seven WebMCP tools**. Read-only: `list_tasks`, `get_task`,\n `recent_events`, `daemon_health`. Recovery: `retry_task`, `stop_task`, `cancel_task`. An agent\n operating the dashboard now reads structured state and recovers stuck work instead of scraping the\n UI.\n- Every tool wraps the same `ui/src/lib/api.ts` client the dashboard itself calls, so an agent and a\n person exercise one path rather than two.\n- `archie-ui` cannot be attributed to the agent that called it: a page can invoke its own tools, so an\n agent's call and a page script's call reach the server identically. Tools therefore record the\n signed-in identity and a source, and **never** that an agent acted.\n\n### archied — Binaries built by the development build task can be updated\n\n- `task build` passed the `installtype` stamp for three of six commands, so `archie-messaging`,\n `archie-state-store` and `archie-ui` were built without it. An unstamped binary reports `unknown`\n and the self-update path **refuses rather than guesses**, which is how an operator ends up unable to\n update with `install type is unknown` and no way forward. All six are stamped now, and a test reads\n the build task and fails naming any command line that omits it."
},
{
"version": "1.35.0",
"date": "2026-09-22",
"body": "### archied — The Messaging Service is severed from the store and workflow runtime\n\n- `cmd/archie-messaging` no longer links `modernc.org/sqlite`, `internal/store`,\n `internal/domain/workflow` or `internal/agentexec`. All four arrived through a single import of\n `internal/app/controlplane`; the client half now lives in\n `internal/infrastructure/controlplanerpc`, and the app package keeps the server, the registry, the\n seeds, the validators and the schema derivation.\n- The resource documents are type-aliased back into the app package, so there is one definition read\n under two names rather than a copy per side.\n\n### archied — Channel lifecycle reaches the dashboard\n\n- The Messaging Service reports each channel's state, recorded **per channel**: one channel's failure\n marks only itself, a channel that cannot start is marked failed **with its reason** rather than only\n logged, and one that returns is marked stopped. `internal/channels/status.Manager` reports each channel's state.\n- `PutChannelStatus`/`ListChannelStatus` carry that to the dashboard, following the config-snapshot\n split. The store **replaces the reported set**, so a channel the reporter stops mentioning is\n deleted rather than left as a stale `running`; an empty report clears the table, because hosting no\n channels is a fact worth reporting; and an id-less row is refused, since it could never be replaced\n or removed by a later report.\n- `Service.ReloadChannel` routes to the channel's own seam and refuses a channel that cannot reload\n with a reason rather than accepting and ignoring it. `ReloadSupported` was previously declared **by\n name**, so a channel could advertise reload with nothing behind it; one function now decides both.\n\n### archied — Action playbooks: a second playbook shape, with typed results\n\n- A playbook is now one of two shapes: a **workflow playbook** (exactly one `workflow` action,\n unchanged) or an **action playbook** (one or more `module` actions in order). A playbook does not\n mix them.\n- `args` and `when` share one compilation path and one evaluation context, and `actions.<id>` is typed\n by the kind that action runs, so a misspelled result field, an unknown id, a map index, `in`, a\n comprehension, or a shape-foreign key (`kind` on a `workflow` action, `workflow` on a `module`\n action) is a **load failure** rather than a dispatch failure.\n- **Action playbooks load but do not run yet.** Routing arrives with the first side-effecting\n position; the daemon warns at load rather than accepting them silently.\n- The CEL environment is built per playbook, because result typing depends on the ids a playbook\n declares.\n- `ModuleRegistry.DecodeResult` turns a kind's flat map result into its typed `Result` before a later\n expression reads it. Without it a typed read evaluated against a shape the run never produces, and\n so silently read null.\n\n### archie-agent\n\nThe sandboxed runtime links the same shared packages as archied, so this release carries the\nchannel-lifecycle store contract and the stricter action-load errors with it:\n\n- The channel-status store contract (`PutChannelStatus`/`ListChannelStatus`) and its replace-the-set\n semantics.\n- Authoritative module ids and stricter action load errors: a misspelled result field, an unknown id,\n or a dynamic `actions` read now fails the playbook load rather than the dispatch.\n\narchied and archie-agent move together in this release."
},
{
"version": "1.34.0",
"date": "2026-09-22",
"body": "### archied — Dashboard: an actionable authentication failure state\n\n- An unauthenticated **document** request now receives a self-contained HTML page with a\n paste-the-token form, instead of plain text. Previously the whole dashboard -- `index.html`, the\n bundle and every asset -- sat behind the token check, so a bookmarked bare URL returned a\n `text/plain` \"unauthorised: open the dashboard URL archied logged at startup\", the SPA never ran,\n and none of the dashboard's existing failure surfaces were reachable at all.\n- The response is still **401**, with `Cache-Control: no-store` and a CSP. It is deliberately not a\n 200: a login page served as success would be cacheable, would read as healthy to anything that\n checks status alone, and a shared cache could hand it to the wrong person.\n- API and stream callers are unaffected. `application/json`, `*/*` and `text/event-stream` requests\n keep the plain-text 401, with a test pinning that split so an XHR or an `EventSource` reconnect can\n never start receiving a page.\n- The auth banner gains a **Retry** action that re-runs the dashboard's bootstrap reads, so a\n recovered session is actionable without a browser-level reload. It deliberately does not re-drive\n the SSE stream, which already reports its own reconnect state.\n- The page's guidance stays generic: it points at the dashboard URL the daemon logs rather than\n naming where the token is stored, so the HTTP layer is not coupled to the token file's location."
},
{
"version": "1.33.0",
"date": "2026-09-22",
"body": "### archied — EDA: playbook action arguments are compiled at load (J2)\n\n- A playbook action may now declare `args`, compiled as CEL expressions when the playbook loads.\n `args` and `when` share one compilation path and one evaluation context, so an expression written\n for one works in the other.\n- **Behaviour change:** an `args` expression that does not compile is a **load failure**, not a\n runtime miss — the same reject-at-load rule already applied to a binding collision and to an\n unknown `actions.<id>`. In practice, a daemon loading a playbook with a malformed `args` block\n fails at startup rather than part-way through a dispatch.\n- Compiling several arguments now reports the **first** bad key deterministically (keys are sorted).\n Previously it ranged a map, so the reported bad key could differ between runs and the failure was\n not reproducible.\n- `args` is deliberately **inert** for now: parsed, compiled and stored, but no shipped position\n consumes it yet. A consumer arrives with the first side-effecting position.\n\n**Not yet decided:** how an `args` evaluation failure behaves at dispatch. The `when` predicate rule\n(error, skip, log) does not obviously transfer, because `args` is data rather than a predicate, and\nsilently skipping an action whose arguments failed to evaluate would be a silent failure of exactly\nthe kind this release train has been removing. It currently propagates the error to the caller, and\nthat asymmetry is documented at the code. Ratifying it against a real consumer is tracked separately."
},
{
"version": "1.32.1",
"date": "2026-09-22",
"body": "### archied — Host packaging: `archie-messaging` now ships and updates\n\n- `cmd/archie-messaging` is included in the distribution zip, and `scripts/archie-update-install`\n installs and restarts it.\n- **Why this mattered.** v1.30.0 moved Telegram, email and webhook out of `archied` and into\n `archie-messaging`, but nothing packaged the new binary. A host install that upgraded across\n v1.30.0 therefore ran on with **no messaging process at all**: `archied` logged that it stopped\n serving the telegram gateway, nothing replaced it, and Telegram stayed dead — with no error\n logged anywhere, because nothing was failing. The process simply did not exist.\n- The host component set was enumerated in four places — the zip's build loop, the zip's copy list,\n the installer's service list, and the installer's binary list — and `archie-messaging` was missing\n from all four. The duplication was the defect: a single test now derives the host-run commands\n from `cmd/` and asserts that all four lists agree with it, so adding or extracting a process fails\n until it is packaged.\n- `deployments/systemd-user-service.md` gains the messaging unit. That is load-bearing rather than\n cosmetic: the updater refuses an update when a service unit is missing and tells the operator to\n create one from that document, which previously had nothing to offer.\n\n**Upgrade note:** a host that reached v1.30.0 without a messaging unit has been running with no\nTelegram, email or webhook. Updating to this release installs and starts `archie-messaging`."
},
{
"version": "1.32.0",
"date": "2026-09-22",
"body": "### archied — EDA: playbook action ids, and a dispatch idempotency ledger\n\n- **Action ids (J1).** Every action a later action references must now carry an `id`. Ids are\n validated at load -- unique and stable-identifier-shaped -- and a `when`/`args` expression\n naming an unknown `actions.<id>` is a **load failure**, not a runtime miss, the same\n reject-at-load rule already applied to a binding collision.\n- **Reference classification is strict at load.** A map-index reference (`actions[expr]`), a\n non-literal index, and a reference to an unknown prior id are all rejected when the playbook\n loads; references are classified by identifier versus static access, and the when-compilation\n helper is shared between the load-time and runtime paths.\n- **Dispatch idempotency ledger.** A `playbook_dispatches` row records a dispatch against\n `(playbook_id, playbook_version, event_id, action_id)`, written with `INSERT OR IGNORE` and\n surfaced through the shared `store.ErrAlreadyDispatched` sentinel. Module, channel and forge\n action positions are therefore at-most-once, which is what unblocks the side-effecting\n positions that were previously rejected at load.\n- **The ledger is wired into production.** `stateStoreDeps` constructs `Deps.PlaybookDispatcher`,\n so the ledger RPCs no longer answer `Unavailable` in a running daemon. This defect was found\n by the pre-release review of this change rather than by its tests.\n\n**Behaviour change:** a playbook whose actions reference `actions.<id>` without declaring that\nid, declare a duplicate id, or index `actions` with a non-literal value now fails to load\ninstead of failing at dispatch time.\n\n### archie-agent\n\nThe sandboxed runtime links `storecontract` and `staterpc`, so it carries the dispatch-ledger\ncontract alongside archied:\n\n- The shared `store.ErrAlreadyDispatched` sentinel now describes both dedup ledgers --\n `binding_dispatches` per `(binding_id, capture_id)`, and `playbook_dispatches` per\n `(playbook_id, playbook_version, event_id, action_id)`. Each is an at-most-once guarantee.\n- `RecordPlaybookDispatch` is part of the store contract the runtime builds against.\n\narchied and archie-agent move together in this release."
},
{
"version": "1.31.0",
"date": "2026-09-22",
"body": "### archied — Dashboard replaced: Preact -> Vue 3 + shadcn-vue\n\nThe dashboard is now a Vue 3 application built on shadcn-vue. This is the\nlarge piece of this release; it touches every page.\n\n- History routing, a grouped topbar built from components, the violet palette\n with self-hosted Geist, and a command palette with live tasks.\n- Chat is a FAB-opened panel that behaves like a chat window and scrolls its\n transcript with `MessageScroller`.\n- Task actions and dangerous approvals are deliberate; the task detail page is\n a single head strip with honest states; the run page settles its head around\n an attempts pager, which is hidden for zero or one attempt.\n- Appearance and System navigation were refined, with a four-column appearance\n grid on wide screens.\n- A copy pass removed redundant tails and restating descriptions, empty states\n derive their own titles, and a stuck log read surfaces as an error rather\n than eternal loading.\n- The capture pane is bound to the list it sits beside and reads beside it,\n not over it.\n\n### archied — Events is one page with three tabs\n\n- Inspector, Bindings and Mappings are now tabs of a single **Events** page.\n- The nav entry is always live, the tabs prune by capability, and the three old\n paths survive as bookmarks that redirect to their tab.\n- Tab selection lives in one module (`ui/src/events/tab-selection.ts`) that the\n page uses, rather than a copy of it.\n- `feat(tools)`: a capture-intake sender exists for exercising the Events\n surfaces.\n\n### archied — The channel travels with the message\n\n`SessionSource.Platform` -- the first component of the session natural key, and\nthe column `GetByChannel` filters on -- was a constant `\"web\"`, because one\nRouter serves every channel and named itself after its own. Two things followed:\nthe per-user identity policy was real code that no production call site reached\nwith a real channel name, and a curator pass's write to agent-user memory could\nnot be read back by the turn that wrote it, because that turn resolved no\n`UserID`.\n\n- The frontends now name the channel they carry (`telegram`, `email`,\n `webhook`, `web`), the channel rides the message, and the Gateway stamps the\n session from it -- falling back to its own name when a sender names none,\n which is what every existing row holds.\n- Identity resolution reads the platform off the inbound, so `carriesPersonIdentity`\n decides something in production: telegram and email resolve a person, the\n dashboard and a webhook resolve nothing, and an unknown platform fails closed.\n- **Behaviour change:** a chat whose active session came from `/new` or\n `/branch` re-resolves once, because session lookup now filters on the\n channel's real name. A chat without `/new` re-resolves onto the same\n deterministic id and heals silently.\n- Deliberately unchanged: `TurnRunnerConfig.Channel` still keys tool\n availability, so no channel gains or loses a tool in this release.\n\n### archied — Control plane: runtime administration, history, and derived schemas\n\n- The State Store's gRPC server now carries runtime administration, and each\n process reports which settings version it is running; the dashboard shows it.\n- Resource history is exposed so edits can be reviewed and rolled back, and\n resource schemas are derived from the documents they describe -- the document\n editor reads the derived schema (labels from `title`, `format: duration` ->\n `1m0s`, hints from `doc`), and the abandoned schema-driven card is deleted.\n- A live settings replacement is checked before it is switched to, the daemon's\n state surfaces are folded into one boot step, and a SIGHUP reload re-applies\n database-owned settings.\n- Forge intake settings that nothing reads are now rejected at load.\n\n### archied — Configuration: judged where it is owned\n\n- The runtime config overlay is deleted; database-owned settings are judged at\n the layer that owns them rather than on the file load path.\n- A file overlay no longer drops the fields it omits inside a map entry, and a\n kind with no stored value leaves the file's value in force.\n- The default config path is resolved in one place, and the channel document\n has its own shape.\n\n### archied — State Store: offline backup, restore, validate and rollback\n\n- New offline backup / restore / validate / rollback path.\n- `validate` runs boot's own gate; it no longer replaces the database, reads a\n kind the store does not hold as its seed, or touches the daemon's log.\n- The recovery control-plane server is built on the shared step vocabulary.\n\n### archied — Workflow: one step vocabulary and a `gate.diff-rules` replacement\n\n- The step vocabulary is owned by a family manager registered at each\n composition root, replacing `.archie/gate.go` with `gate.diff-rules`, which\n fails closed on a change it never read.\n- Workflow roots are pinned and the dead vocabulary is rLine truncated
},
{
"version": "1.30.0",
"date": "2026-09-20",
"body": "### archied — Messaging Service extraction completed\n\nTelegram, email and webhook no longer run inside the daemon. They run in\n`archie-messaging` and reach the daemon through the Gateway's `ChatContract`\nover gRPC; the daemon builds no channel and no `gateway.Router` (#899).\n\n- The operator surface is re-wired in the extracted service: `/update` (built\n from its own `[chat.telegram]` commands), the update-report relay, the\n `show_tool_calls` projection, and `/restart`'s config reload, which\n re-resolves the token and allowlist from this service's own file and refuses\n a reload that resolves to an empty token.\n- `/version` is sourced from the Gateway through a new `ChatSnapshot.Version`\n field. `cmd/archie-messaging` deliberately takes no version ldflags, so it\n cannot report a partial upgrade as a matched one.\n- Channel configuration is validated at composition, so a configured-but-\n invalid front-end fails the service instead of being silently dropped.\n- The inbound rate limiter moves to the Gateway, which now owns the only\n Router and is therefore the one place a per-sender budget can apply to every\n channel's turns.\n\n`RunningVersions` and `ReleaseAnnouncements` are deliberately left unwired:\nboth need a component's real running version, and the only versions this\nprocess can obtain are another binary's stamps. See\n`docs/architecture/migration-decisions.md`.\n\n### archied — Configuration\n\n- `diff_cap_lines = 0` now switches the cap off, as the dashboard and the\n workflow step have always documented. It was a plain `int`, so the defaults\n pass could not tell an absent key from an explicit `0` and rewrote both to\n 400 -- the documented way to disable the cap was unreachable. **Behaviour\n change:** a config that set `0` was silently getting 400 and will now get no\n cap.\n- The same ambiguity was failing open per identity: `configForIdentity`\n assigned the identity's value unconditionally, so an identity that merely\n omitted `diff_cap_lines` overwrote the shared cap with the zero value and\n disabled the safety rail entirely. An identity now overrides only when it\n sets the key.\n- A diff-cap park no longer tells the operator to \"approve manually\". A parked\n task's actions are retry, abandon and reject, so there is no approve path out\n of diff-cap; it now names the two things that work.\n- `[health].dependency_timeout` makes the daemon's readiness probe timeout\n configurable, matching the extracted services.\n\n### archied — Chat rendering\n\n- `/status` and `/tasks` are line-oriented reports but separated lines with a\n plain newline, which is CommonMark's soft wrap: the Telegram renderer joined\n them into one run-on paragraph. The renderer implements CommonMark's hard\n line break and the reports use it. Ordinary prose still soft-wraps.\n- A park reason is capped to its first line in the `/tasks` list. It carries\n whatever the failing stage reported, which for a lint gate is a whole tool\n log; unbounded, one parked task pushed every other task out of the reply. The\n full reason is unchanged on the task, in `task_list` and on the dashboard.\n\n### archied — Review\n\n- Review findings are posted as line-anchored PR comments with suggested fixes,\n and a suggestion must be single-line -- GitHub applies a multi-line suggestion\n only up to its first line, silently corrupting the file (#891).\n- The remediate workflow handles PR review comments and requested changes.\n\n### archied — /status health surface\n\n`/status` reports the live broker connection and the last-known outcome of this\nprocess's chat-model calls, alongside the queue depth and runtime block (#892).\n\n- A provider error is flattened and capped, so a multiline or oversized error\n cannot break the one-line-per-fact layout.\n- Concurrent model calls no longer reorder: the completion time is taken before\n the lock, so the newer outcome wins rather than whichever goroutine stored\n last.\n- Curator model calls are recorded too. They bypass the chat path, so a daemon\n whose only recent model traffic was curator work reported \"no calls attempted\n yet\" while the provider was demonstrably reachable.\n- Title generation does not record health. It runs detached under its own\n bound and its error is swallowed, so a cosmetic timeout was overwriting the\n line with \"failed\".\n\n**Known limitation:** the container, poll and channel sections cannot render.\nThose facts live in the daemon, but the only Router lives in the Gateway\nprocess, which has no container pool and no poll loop. The command description\nsays what actually appears; restoring the rest needs a cross-process health\ncontract.\n\n### archied — Dashboard and containers\n\n- The served lifecycle vocabulary reaches an already-painted page, the page\n registry matches the routes, and the build verifies `ui/dist` is fresh\n instead of never looking at it (#890, #898).\n- The containLine truncated
},
{
"version": "1.29.0",
"date": "2026-09-19",
"body": "### archied — Security\n\n- `google.golang.org/grpc` bumped past `v1.84.0` to patch\n [GO-2026-6443](https://pkg.go.dev/vuln/GO-2026-6443), a server panic via a\n missing `:authority`/`Host` header reachable through `archied`'s gRPC\n gateway server. No stable release carries the fix yet, so this pins the\n pre-release commit that does (`v1.85.0-dev.0.20260825072537-93e31b48545e`)\n until `grpc-go` cuts `v1.85.0`.\n\n### archied — Memory engine unification\n\nOne memory engine, addressed by four typed scopes (global, agent, user,\nagent-user), replaces the two disconnected stores that previously existed:\na chat-tool-written store nothing ever read back, and a curator-written store\nwith no scope model.\n\n- `internal/domain/memory` is a CRUD contract (`Create`/`Get`/`Query`/`List`/\n `Update`/`Forget`/`Revisions`) with retained revisions; updates supersede\n rather than overwrite, so a crash mid-write leaves a recoverable extra\n history entry, never a lost prior state (#886).\n- The chat turn reads its subject's scopes synchronously before the prompt is\n built, rendering recalled records into a `<memory>` block; a failing or\n panicking engine degrades to no memory block rather than failing the turn\n (#887).\n- The model writes memory through four id-addressed tools\n (`memory_create`/`update`/`delete`/`list`), scoped to the turn's own\n resolved identity -- the model chooses the scope kind, never the ids, so it\n has no path to write into another user's memory (#888).\n- The session curator now derives the agent-user scope from the session's own\n user-role messages, instead of keying facts by a session id that stops\n meaning anything once the session ends.\n- A channel with no resolvable user (dashboard, webhook) reads and writes only\n global and agent scope; a webhook's route path is never treated as a user\n identity.\n- Fixed a review finding on the read path: the per-scope record limit was\n being applied as one shared total across all scopes rather than per scope,\n and the rendered block's byte cap was checked before template escaping\n rather than after, letting the escaped block exceed it.\n\n### archied — Work intake\n\n- feat(workintake): define review reaction envelope\n- feat(workintake): authorize review reactions by owned PR\n\n### archied — Cleanup\n\n- Deleted the unwired plugin capability-host health surface\n (`Host.Health`/`Host.Manifests`/`ModuleStatus`) and the `Module.Health`\n chain it fed -- including the `mcp`/`builtin` tool-provider health\n implementations and their aggregation in `tools/provider.Registry` -- none\n of which had ever had a production caller (#882).\n\n### archie-agent\n\n- The sandboxed runtime picks up the review-reaction envelope and its\n owned-PR authorization, so an agent can only react to reviews on pull\n requests it opened itself.\n- `google.golang.org/grpc` bumped past `v1.84.0` to patch\n [GO-2026-6443](https://pkg.go.dev/vuln/GO-2026-6443) (shared dependency\n with `archied`; the pre-release commit is pinned pending a stable\n `v1.85.0`)."
},
{
"version": "1.28.0",
"date": "2026-09-19",
"body": "### archied — Task detail and attempt attribution\n\n- New per-run task detail page, showing each attempt's own events, changes and\n configuration rather than a single merged view.\n- Events, changes and config are attributed to the attempt that produced them;\n `Event` carries `attempt` and `ReadTaskLogRequest` carries `stage`.\n- The task detail page remounts when the task id changes, so switching tasks\n does not leave the previous one's data on screen.\n\n### archied — Configuration\n\n- Services are keyed by name through a registry, so the State Store and Gateway\n listen addresses are configurable rather than fixed.\n- A partial overlay no longer clears the fields it omits — an overlay that set\n one key was wiping the rest.\n- The Services map is cloned on publish, so an overlay can no longer mutate the\n snapshot other readers are holding.\n- The service context is enforced at registration.\n\n### archied — Logging and park reasons\n\n- A parked run's reason is recorded in its own attempt log, in both the daemon\n and the workflow, so \"why did this park?\" is answerable from the task itself.\n- `TaskRegistry.Write` takes the caller's context.\n\n### archied — Worktrees and containers\n\n- Retries recover from path-type conflicts instead of failing opaquely, and the\n underlying cause is no longer masked.\n- The worktree is handed back on every sandbox exit.\n- A container's max-uptime reaper is cancelled on release, the cap stays active\n through the grace period, and teardown is claimed once rather than by\n cancelling a timer.\n\n### archied — Daemon and startup\n\n- Every identity's forge and repos are swept at startup, including the root\n forge.\n- A cancelled startup is no longer reported as an exhausted sweep budget; an\n exhausted budget names itself as the cause.\n\n### archied — Other\n\n- `grep` can use the workspace codesearch index.\n- Forge labels are matched when namespaced, so label-driven routing works for\n namespaced labels.\n- Triage is given criteria for choosing between workflows, and a workflow is\n required when a code change is needed.\n- The Telegram adapter restart callback is wired into the chat router.\n- The `ARCHIE_REACTIONS` fan-out stream is provisioned and bounded by age.\n- `archie-ui` exits cleanly when graceful shutdown overruns its deadline.\n- The dashboard's event pump retries priming until the State Store answers.\n- The update writer emits the agent version sidecar with a real newline.\n- The UI finishes its Preact port; the imperative DOM layer is deleted.\n- Collection fields decoded over the State Store gRPC contract are never nil\n slices, so an empty collection marshals as `[]` rather than `null`.\n\n### archie-agent\n\n- The sandboxed runtime picks up the attempt-attribution contract, so the events\n and changes an agent produces are recorded against the attempt that produced\n them.\n- `grep` can use the workspace codesearch index.\n- A worktree is handed back on every sandbox exit, and container teardown is\n claimed once — a released container's reaper is cancelled rather than\n re-firing during the grace period.\n- Retries recover from worktree path-type conflicts instead of failing\n opaquely.\n- A parked workflow run records its park reason in its own log.\n- Triage criteria distinguish the workflows, and a workflow is required when a\n code change is needed.\n- Namespaced forge labels match when routing by kind.\n- The `ARCHIE_REACTIONS` fan-out stream is provisioned.\n- Collection fields decoded over the State Store gRPC contract are never nil\n slices, so an empty collection marshals as `[]` rather than `null`."
},
{
"version": "1.27.0",
"date": "2026-09-17",
"body": "### archied — Dashboard task logs\n\n- Task logs are readable from the dashboard again, through a new State Store\n read contract (`ReadTaskLog`, `StreamTaskLogContent`) rather than the UI\n process reaching into the daemon's log files. Wired server-side by the\n standalone state-store process.\n- Added `GET /api/tasks/{id}/logs/download`, serving an attempt's raw log as a\n `task-<id>-attempt-<n>.log` attachment.\n- A process that cannot read logs and an attempt that recorded no log are now\n distinguishable (\"cannot read\" answers 503, \"no log\" answers 404) instead of\n both rendering as a claim about a configuration setting.\n\n### archied — Telegram output\n\n- Tool results are summarised rather than quoted: a search reports how many\n matches came back, a truncated result reports the tool's own total. The\n renderer no longer states a count it computed from its own truncated sample.\n- Repeated successful tool calls collapse into one counted entry.\n- The tool-activity block is capped to a third of the live frame, keeps the\n newest lines, and marks what it dropped with a `+N earlier` indicator. Every\n line that fits is kept.\n- Every clamped answer marks its cut with an ellipsis, including the opening\n frame, which previously appeared to begin mid-sentence.\n- An error response from the log download no longer ships as a `.log` file.\n\n### archied — Readiness and shutdown\n\n- The disk probe reports per-filesystem results and checks the root filesystem\n as well as the work directory, so a full root is no longer invisible.\n- A path shared by several disk targets keeps the strictest requirement any\n target places on it, so an optional target can no longer mask a required one.\n- The shutdown-watchdog test no longer races the Go scheduler, which was\n intermittently failing the quality gate and parking work unrelated to it.\n\n### archied — Other\n\n- Messages persist the channel-native sender id.\n- go-telegram/bot bumped to v1.27.0, fixing a streaming bug where the multipart\n body could not be replayed and `sendMessage`/`editMessageText` failed until\n the connection dropped.\n\n### archie-agent\n\n- The per-task runtime picks up the new State Store task-log read contract, so\n the sandboxed agents share one log-reading path with the daemon and the\n dashboard."
},
{
"version": "1.26.0",
"date": "2026-09-17",
"body": "### archied\n\n- fix(webui): publish per-identity forges so multi-identity task rows keep their links\n- feat(config): add [scheduling] config block\n- feat(configuration): translate [scheduling] into scheduling.EngineConfig\n- feat(cronevents): adapt the events bus to scheduling.Sink\n- fix(webui): count every chat front-end in the published projection\n- fix(scheduling): respect configuration ownership\n- feat(ratelimit): wire per-identity inbound rate limiting into the gateway\n- fix(tools): judge the rm guard by base name so absolute paths cannot bypass it\n- fix(store): keep an empty binding secret empty so a partial edit cannot erase it\n- fix(archied): stop advertising review_pr when no reviewer can run\n- fix(daemon): carry kind/label routing bindings to the process that routes\n- feat(configuration): add archied setup, the caller the first-run flow was built for\n- fix(configuration): stop letting a secret value be set from the command line\n- feat(configuration): let setup reference a secret without carrying its value\n- fix(archied): disable a provider whose credential is missing instead of refusing to boot\n- refactor(install): install.sh delegates config generation, and tests stop reading hand-written configs\n- fix(daemon): guard binding dispatch loop against nil dispatcher/creator\n- fix(webui): enforce CSRF/origin gate on binding and mapping mutations\n- fix(secret): recover a panicking secret engine instead of crashing\n- fix(config): deep-copy Image.Hosted/Image.Local in Config.Clone\n- fix(email): stop dropping the first paragraph of plain-text bodies\n- fix(logging): keep the live descriptor open across a failed rotation\n- feat(configuration): report config keys no decode target consumed\n- feat(archied): warn at boot when the config file has unrecognised keys\n- feat(archied): wire the scheduling ticker engine at boot\n- fix(agentworker): wire configured tool-result policy into worker's LoopRunner\n- refactor(staterpc): delete the superseded single-token auth interceptor\n- refactor(memory): delete the unreachable <memory> fence scrubber\n- fix(channels): delete unreachable Telegram webhook delivery mode\n- fix(gateway): delete unwired Router.Dangerous approval path\n- refactor(gateway): delete orphaned SessionState goal/steer/queue machinery\n- refactor(archied): delete the daemon's unused webui.Server and UI adapters\n- refactor(tools): delete unreachable dispatch/gating engine\n- feat(channels): wire chat.webhook route config through to the gateway\n- refactor(tools): delete unreachable AST-based tool discovery\n- refactor(tools): delete unused plugin-tool registration API from builtin.Registry\n- feat(channels): wire ConfigSchema/ValidateConfig into a startup validation loop\n- refactor(state): delete the dead IncrementRetryCount RPC (breaking change, accepted)\n- fix(curator): populate PassInput.Since with the prior pass time\n- fix(memory): install the threat scanner the composition root never wired\n- fix(staterpc): preserve marshal_error marker in eventDataJSON\n- fix(gate): validate finding level and share the blocking threshold\n- fix(scheduling): record a completed run so a recurring job stops re-firing every tick\n- fix(releaseupdate): don't treat empty available as deferred\n- fix(tools/provider/mcp): preserve MCP binary tool results for delivery\n- refactor(gateway): share sensitive-key markers with webhookguard\n- refactor(daemon): remove unreachable SQLite poll/drain path\n- refactor(tools/mcp): delete unreachable MCP adaptation path\n- fix(taskactions): resolve max_retries from the task's owning identity\n- fix(daemon): forward configured MCP servers to task agents\n- refactor(skill): delete dead Discover/DiscoverPlugins/Skill path\n- refactor(skillbuild): delete dead AugmentRegistry path\n- fix(builtin): bound read/edit filesystem work by DefaultToolTimeout\n- refactor(binding): delete dead Matcher.Overlaps method\n- refactor(forge): delete dead CreateIssue surface\n- fix(mcp): cancel in-flight SSE reconnect on Stop\n- fix(container): enforce MaxUptime lifetime cap with a timer\n- refactor(store): use taskstate status constants in SQL\n- fix(ui): unbreak binding approve and the two deletes, and centralise the client\n- fix(tools): stop testing on the text of other files, and ungate contractaudit\n- refactor(forge): delete the unwired RepliesAfter surface\n- refactor(config): delete the two decoded-but-unread policy fields\n\nThis release is dominated by dead-code removal and the completion of the\nscheduling capability. Roughly half the commits delete surfaces that no longer\nhad a caller: the unreachable SQLite poll/drain path, the unwired MCP\nadaptation path, the AST-based tool discovery, the superseded single-token auth\ninterceptor, and several dead forge and binding methods. The\n`IncrementRetryCount` State Store RPC is gone with them -- a breaking change to\nthe wire contract, accepted because nothing called it.\n\nThe cron/scheduling epic lands iLine truncated
},
{
"version": "1.25.0",
"date": "2026-09-15",
"body": "### archied\n\n- fix(update): resolve releases without a checkout, and fail loudly when it cannot\n- fix(update): back up the task store the daemon actually uses, or refuse\n- fix(update): build each component from its own approved release tag\n\nComponents are independently versioned, so the newest `archied/v*` and\n`archie/v*` tags usually sit on different commits. The installer required both\ntags to resolve to one commit whenever both components changed, which refused\nevery update once the two newest releases diverged -- a deployment stuck on\n1.22.0 could not take any update. Each component now builds from its own\napproved tag.\n\n### archie-agent\n\n- chore: no user-facing changes; versioned so the 1.25.0 release tags both\n components at the same commit"
},
{
"version": "1.24.0",
"date": "2026-09-12",
"body": "### archied\n\nMakes 1.23.0 deployable. That release split archied into separate processes,\nbut the self-updater still installed only the `archied` binary and restarted\nonly `archied.service`, so updating to it left the State Store, Gateway and UI\non the previous release. archied cannot boot without a reachable State Store,\nso the update failed its health check and rolled back. Update to this release\nrather than to 1.23.0.\n\nIf your host does not yet run the four units in\n`deployments/systemd-user-service.md`, create them first: the updater now\nrefuses, naming what is missing, instead of installing binaries onto a host it\nwould leave broken.\n\n- fix(update): install and cycle every process in the release\n- fix(telegram): stop the relay corrupting identifiers and code\n\nAlso in this release, though outside the version-stamped package closure:\n\n- ci(deploy): produce a complete distribution zip on every release. No zip was\n built for v1.23.0 at all, and the zip omitted `archie-ui`."
},
{
"version": "1.23.0",
"date": "2026-09-12",
"body": "### archied\n\nArchied is no longer a single process. The State Store (`archie-state-store`)\nnow owns `archie.db` outright, the Gateway serves its contract over\nauthenticated gRPC, and the dashboard ships as a standalone UI Service\n(`archie-ui`). Upgrading is not a binary swap: these processes must be running\nand addressable before `archied` will start clean. See `deployments/` for the\nsupported profiles.\n\n### archied — Service decomposition\n\n- feat(contracts): add gateway service seams and protobuf toolchain\n- feat(gateway): extract ChatContract service\n- feat(gateway): delete in-process ChatContract path, make remote the only mode\n- feat(gateway): authenticate the gRPC contract and allow off-loopback listeners\n- fix(gateway): drop services.gateway.mode, remote is the only transport\n- feat(state-store): generalize storerpc as the State Store gRPC contract (#770)\n- feat(state-store): stand up archie-state-store binary and own archie.db (#771)\n- refactor(state-store): migrate capture/mapping/binding consumers to State Store (#772)\n- refactor(state-store): migrate workflow/intake/task lifecycle consumers to State Store (#773)\n- refactor(state-store): cut daemon/Gateway over to the remote State Store (#774)\n- fix(state-store): task-scope container credentials, stream large capture lists, validate Update\n- feat(archieui): standalone UI process over remote Gateway and State Store\n- refactor(archied): cut the dashboard over to the archie-ui process\n- refactor(ui): sever the archie-ui binary from every daemon runtime package\n- refactor(archied): move the update relay to the process that owns updates\n- refactor(archied): move webhook capture intake to the process that owns work intake\n- feat(archieui): mount the capture intake receiver over the State Store\n- refactor(workflow): relocate Task/Status/Source and define workflow.Store (#754)\n- refactor(store): move the producer-owned contracts to internal/contracts/store/v1\n- feat(messaging): migrate gateway session persistence onto domain types\n- feat(gateway): flip channel boundary onto messaging.Message\n\n### archied — Pull request review\n\n- feat(gateway): operator-triggered PR review with selectable reviewer model\n- feat(forge): pull request review read surface (ListReviews/ListReviewComments/ReplyToReview)\n- feat(workflow): surface adversarial review findings on the PR body\n- feat(workflow): review calibration, checked properties and style nits out of contract\n- fix(archied): share one PR reviewer across channels; harden forge and worktree\n- fix(workflow): order findings before footer; test the report stash\n\n### archied — Dashboard\n\n- feat(webui): render configuration from a published snapshot\n- feat(staterpc): carry the dashboard's configuration snapshot\n- refactor(webui): take configuration off the dashboard server\n- feat(webui): report which dashboard sections a process can serve\n- feat(webui): deliver live dashboard events by polling the State Store cursor\n- feat(webui): route dashboard task actions through the Gateway contract\n- feat(gateway): give the dashboard operator its own task-action contract\n- feat(webui): add /health and /health/detailed readiness endpoints (#717)\n- fix(webui): distinguish refused vs broken task actions, handle 401 (#753)\n\n### archied — Daemon, gateway and workflow\n\n- feat(archied): add shutdown watchdog that force-exits a hung graceful shutdown (#716)\n- feat(archied): serve the daemon's own health endpoint\n- feat(drain): honour external drain marker with instantiation epoch (#718)\n- feat(gateway): wire progressive tool disclosure (bridge tools)\n- feat(gateway): render workspace, managed repos and operator into chat env\n- feat(gateway): add session_transcript tool for full JSON export\n- feat(gateway): consolidate task actions and repair daemon default path\n- feat(eda): thread Playbook ID/Version and DispatchInput task identity\n- feat(worktree): Resume re-syncs a worktree onto its branch tip\n- fix(staterpc): attach the bearer token to State Store streams\n- fix(archieui): resolve service tokens from env, without requiring a config file\n- fix(archied): initialize conversation persistence on daemon startup\n- fix(archied): preserve channel turn ledger with remote gateway\n- fix(gateway): share NATS and session ownership\n- fix(update): probe the dashboard's real address after a self-update\n- fix(store): migrate binding owner and repo columns\n\n### archie-agent\n\nThe agent runtime now reaches task state through the State Store gRPC contract\n(`STATE_STORE_URL`/`STATE_STORE_TOKEN`, injected by the daemon) instead of the\nNATS `storerpc` transport, which is deleted. Credentials handed to a task\ncontainer are scoped to that task rather than being the daemon's own token.\nRunning a 1.23.0 daemon against an older agent image will not work; rebuild or\npull the `archie-agent` image with this release.\n\n- feat(state-store): generalize storerpc as the StateLine truncated
},
{
"version": "1.22.0",
"date": "2026-09-03",
"body": "### archied\n\n- feat(telegram): support secret refs for bot tokens (#705)\n- fix(update): make daemon rollback schema-safe (#704)\n- fix(archied): preserve ephemeral gateway ports (#707)\n- fix(webui): bound log limit parsing and add endpoint regression coverage (#706)\n- fix(deps): upgrade x/crypto to v0.56.0 for security fixes (#708)"
},
{
"version": "1.21.0",
"date": "2026-09-03",
"body": "### archied\n\n- feat(workflow): make kind-to-workflow routing YAML-overridable\n- feat(workflow): route arbitrary forge labels to workflows via playbook YAML\n- feat(workflow): load kind/label bindings from multiple playbook directories\n- fix(extract): regenerate stale Yaegi symbol tables; fix wfextract directive\n- feat(eda): Module position first slice -- registry + side-effect-free log kind\n- feat(eda): CEL expression environment (compile/validate at load, evaluate at dispatch)\n- feat(eda): playbook document + event coordinator, single-action workflow-kind dispatch\n- fix(skillcurator): document and scope the intentional nilerr in reviewOne\n- fix(binding): add Owner/Repo pin, fixing multi-repo dispatch\n- feat(webui): bindings dashboard UI; fix app-wide Preact render regression\n- fix(binding): split ValidateForUpdate so edits can preserve the secret\n- refactor(ui): extract Pill to ui/src/base/, closing archie-core-mlro\n- refactor(eda): extract helpers to satisfy cyclop/gocognit gates\n- fix(webui): stretch HEALTH row cards to equal height\n- fix(eda): make playbook key collision reporting deterministic\n- fix(gateway): split /status (health) and /tasks (work) apart\n\n### archie-agent\n\n- feat(workflow): make kind-to-workflow routing YAML-overridable\n- feat(workflow): route arbitrary forge labels to workflows via playbook YAML\n- feat(workflow): load kind/label bindings from multiple playbook directories\n- fix(extract): regenerate stale Yaegi symbol tables; fix wfextract directive\n- feat(eda): Module position first slice -- registry + side-effect-free log kind\n- feat(eda): playbook document + event coordinator, single-action workflow-kind dispatch\n- fix(binding): add Owner/Repo pin, fixing multi-repo dispatch\n- fix(binding): split ValidateForUpdate so edits can preserve the secret\n- refactor(eda): extract helpers to satisfy cyclop/gocognit gates\n- fix(eda): make playbook key collision reporting deterministic"
},
{
"version": "1.20.0",
"date": "2026-09-03",
"body": "### archied\n\n- fix: baseline gate repair (go test ./... -count=1)\n- fix(logging): propagate bound slog attrs to wrapped handler in FeedHandler\n- feat(image): define provider-neutral image capability contract and config\n- fix(channels): call MarkRunning once a channel is actually up\n- fix(workflow): stop discarding baseline-fix commits as 'no changes'\n- fix(webui): wire the Logs page to per-task attempt-log detail\n- fix(workflow): net cache hits from token totals, trim gate-retry output\n- feat(workflow): dynamic triage instead of defaulting every task to implement\n- fix(gateway): stop SOUL from forging the prompt invariant tags\n- fix(curator): stop curator actions from serializing a zero timestamp\n- feat(webui): hand-author the configuration field descriptor catalog\n- feat(webui): attach the config field schema to GET /api/config\n- feat(webui): render scalar config sections generically from the schema\n- feat(webui): surface allow_concurrent/max_retries/review_enabled on the repositories card\n- feat(webui): inline editing for per-repo allow_concurrent/max_retries/review_enabled\n- feat(webui): playbook bindings -- matcher + mapping + workflow, HMAC-gated\n- fix: resolve golangci-lint funlen, nilerr, and empty branch issues\n- feat(store): encrypt playbook binding secrets at rest\n- feat(webhook): harden captured payload redaction\n- fix(store): satisfy makezero when building cipher payload\n- feat(webui): refactor chat module to Preact component and add unit tests\n\n### archie-agent\n\n- fix: baseline gate repair (go test ./... -count=1)\n- fix(logging): propagate bound slog attrs to wrapped handler in FeedHandler\n- feat(image): define provider-neutral image capability contract and config\n- fix(workflow): stop discarding baseline-fix commits as 'no changes'\n- fix(workflow): net cache hits from token totals, trim gate-retry output\n- feat(workflow): dynamic triage instead of defaulting every task to implement\n- feat(webui): playbook bindings -- matcher + mapping + workflow, HMAC-gated\n- feat(store): encrypt playbook binding secrets at rest\n- fix(store): satisfy makezero when building cipher payload"
},
{
"version": "1.19.10",
"date": "2026-09-02",
"body": "### archied\n\n- feat(curator): session-memory curator reference implementation"
},
{
"version": "1.19.9",
"date": "2026-09-02",
"body": "### archied\n\n- feat(memory): typed memory engine contract, registry, and registrar\n- feat(memory): builtin engine implementing the domain/memory contract\n- feat(config): config surface for memory engine selection\n- feat(daemon): wire the domain/memory engine registry at boot\n- feat(curator): bind curators to memory engines\n- fix(config): reject memory.provider instead of silently ignoring it\n- feat(curator): skill curator reference implementation\n\n### archie-agent\n\n- feat(config): config surface for memory engine selection"
},
{
"version": "1.19.8",
"date": "2026-09-02",
"body": "### archied\n\n- fix(update): drop dev-facing wording from the unconfirmed-update message\n- fix(telegram): stop adjacent rich blocks from rendering glued together\n- fix(telegram): send undelivered-media fallback after finalize as its own message"
},
{
"version": "1.19.7",
"date": "2026-09-02",
"body": "### archied\n\n- fix(logging): make Tail/Page allocation bound explicit for CodeQL\n\n### archie-agent\n\n- fix(logging): make Tail/Page allocation bound explicit for CodeQL"
},
{
"version": "1.19.6",
"date": "2026-09-02",
"body": "### archied\n\n- fix(build): stamp gatewayVersion/runtimeVersion in the right package"
},
{
"version": "1.19.5",
"date": "2026-09-01",
"body": "### archied\n\n- feat(webui): dashboard-aware chat — Archie sees the page, points you there\n- fix(telegram): drop retry_after bandaid, bump go-telegram/bot to v1.24.0\n- feat(curator): track and expose recent activity per curator\n- fix: go.mod bumped to 1.27.0 and stupid tests removed\n- refactor: remove unnecessary AI-generated scaffolding\n- refactor: go modernisation fixes\n- refactor: remove unused Operator param.\n- fix(gateway): fix broken system prompt template and scrub real telegram ID from tests\n- fix(plugin): add missing CLAUDE.md reference to plugin engine rule\n- fix(app): repoint archied wiring contract test at internal/app/archied\n- refactor(agentexec): use ai-sdk NewTypedTool for pluginToolSet and scriptToolSet\n- fix(config): standardize Provenance to pointer receivers (recvcheck)\n- refactor(lint): reduce cyclomatic/cognitive complexity in tools, workflow, webui\n- fix(app): repoint capability-host wiring contract test at internal/app/archied\n- refactor(lint): extract more helpers to clear nestif/gocyclo findings\n- refactor(lint): split AgentStage.Stage into resolveModel/buildRequest/handleResult\n- refactor(lint): split TurnRunner.Run and dispatchLocal further\n- refactor(lint): extract markdownBlockParser and list/quote helpers in richblocks.go\n- refactor(lint): extract Apply/findWalkVisitor helpers; go fix modernization\n- fix(lint): noctx fixes and dead-code cleanup\n- feat(workflow): adversarial self-review stage before PR open\n\n### archie-agent\n\n- feat(tasks): allow rejecting a task from any non-terminal state\n- feat(tasks): serve the lifecycle presentation catalog from /api/task-meta\n- fix: go.mod bumped to 1.27.0 and stupid tests removed\n- refactor: go modernisation fixes\n- refactor: remove unused Operator param.\n- fix(plugin): add missing CLAUDE.md reference to plugin engine rule\n- fix(app): repoint archied wiring contract test at internal/app/archied\n- refactor(agentexec): use ai-sdk NewTypedTool for pluginToolSet and scriptToolSet\n- refactor(lint): reduce cyclomatic/cognitive complexity in tools, workflow, webui\n- fix(app): repoint capability-host wiring contract test at internal/app/archied\n- refactor(lint): extract more helpers to clear nestif/gocyclo findings\n- refactor(lint): split AgentStage.Stage into resolveModel/buildRequest/handleResult\n- refactor(lint): extract Apply/findWalkVisitor helpers; go fix modernization\n- fix(lint): noctx fixes and dead-code cleanup\n- feat(workflow): adversarial self-review stage before PR open"
},
{
"version": "1.19.4",
"date": "2026-08-28",
"body": "### archied\n\n- refactor(telegram): render replies as structured rich blocks"
},
{
"version": "1.19.3",
"date": "2026-08-28",
"body": "### archied\n\n- feat(tasks): serve the lifecycle presentation catalog from /api/task-meta\n- feat(dashboard): render task actions, statuses and filters from the server catalog"
},
{
"version": "1.19.2",
"date": "2026-08-28",
"body": "### archied\n\n- feat(tasks): allow rejecting a task from any non-terminal state"
},
{
"version": "1.19.0",
"date": "2026-08-28",
"body": "### archied\n\n- feat(logging): cursor pagination and filtering for task_logs\n- build(deps): upgrade github.com/samcharles93/ai-sdk to v0.1.29"
},
{
"version": "1.18.0",
"date": "2026-08-28",
"body": "### archied (released 2026-08-25)\n\n- Fix concurrent chat-turn claims so SQLite writer contention no longer leaks as `SQLITE_BUSY`.\n- Make task timelines operationally useful with stage outcomes, durations, retry context, and durable per-stage token economics.\n- Return canonical repository, issue, and pull-request URLs for each task's owning GitHub or Gitea identity.\n- Preserve per-identity commit attribution and real model context limits across daemon-to-worker dispatch.\n\n### archie-agent\n\n- feat(logging): cursor pagination and filtering for task_logs\n- build(deps): upgrade github.com/samcharles93/ai-sdk to v0.1.29"
},
{
"version": "1.19.1",
"date": "2026-08-27",
"body": "### archied\n\n- fix(telegram): keep Markdown headings/lists as blocks and strip Markdown on plain fallback"
},
{
"version": "1.17.1",
"date": "2026-08-25",
"body": "### archied\n\n- fix(update): remove source checkout dependency\n- fix(gateway): make UUIDv7 session references unambiguous"
},
{
"version": "1.17.0",
"date": "2026-08-25",
"body": "### archied\n\n- fix(webui): add nil receiver guard to Server.trustForwardedHeaders\n- fix(chat): restore transcript and update replay\n\n### archie-agent\n\n- Compact task history against the selected model's real context capacity without imposing a token cap.\n- Preserve completed steps and billed usage when a later provider call fails; failed compaction now keeps the original history and continues.\n- Persist detailed agent-stage usage through the daemon-owned store before lossy live event fan-out.\n- Apply configured or forge-derived author and committer identity to sandboxed task commits."
},
{
"version": "1.16.1",
"date": "2026-08-25",
"body": "### archie-agent\n\n- fix(agentworker): reconcile task clone ownership after commits"
},
{
"version": "1.16.0",
"date": "2026-08-25",
"body": "### archied\n\n**The agent can hand you a file, and the dashboard works behind a reverse\nproxy.** Media delivery was fetch-by-URL only, so a file the agent produced\nlocally — a transcript, a log dump, a screenshot — was passed to Telegram as\na URL it could not fetch: the send did nothing and reported success. The new\n`send_file` tool plus upload-by-reader delivery closes that, and every layer\nthat cannot deliver now says so rather than staying silent. Dashboard\nmutations behind a TLS-terminating proxy were refused as cross-origin;\nforwarded headers are now honoured, but only under an explicit opt-in that is\noff by default.\n\n- feat(telegram): deliver a local file as an uploaded attachment, choosing\n upload-by-reader or fetch-by-URL per attachment; `send_file` resolves paths\n under the same confinement policy the read tool applies, so sending cannot\n reach what reading cannot\n- feat(gateway): `task_action` chat tool for operator task management —\n abandon, archive, retry, stop, cancel, approve and reject from chat, on the\n same action path and state machine as the dashboard\n- fix(webui): validate mutation `Origin` against the effective external\n scheme and host. `X-Forwarded-Proto`/`-Host` are honoured only when\n `web.trust_forwarded_headers` is set, which is off by default and safe only\n behind a proxy that overwrites or strips untrusted forwarded headers\n- fix(webui): report a local file the dashboard chat cannot upload as\n undelivered instead of dropping the event, which had reproduced the exact\n silent non-delivery `send_file` was built to end\n- fix(daemon): detach terminal state transitions and cleanup from a cancelled\n context, so a stopped task still records its outcome\n\n### archie-agent\n\n**Version realigned with `archied`.** This release jumps from 1.9.9 to 1.16.0\nto put the two components on matching numbers; there are no 1.10-1.15 agent\nreleases. It clears the accumulated runtime backlog in one cut rather than\nbundling it as a rider on a later change, so the list below spans several\nweeks of work rather than one session's.\n\nHighlights:\n\n- feat(nats): run an embedded server when no external NATS is configured, and\n expose the embedded broker to managed task workers\n- feat(deployment): default to managed NATS workers; the daemon requires a\n full-task worker handoff and the legacy in-process, subprocess and\n single-stage execution paths are gone\n- feat(forge): GitHub webhook receiver for immediate issue dispatch, with\n dedup regression proof; unbound webhook events are stored retention-bounded\n- feat(webui): payload field mapping -- bind JSON paths to named fields and\n preview before saving\n- feat(scheduling): ticker engine with configurable interval and pools\n- feat(storage): persist agent project state\n- feat(agent): stamp archie-agent's build and report it back to the daemon\n- feat(tools): `generate_video` via MiniMax, gated behind config, and\n `MultimodalResult.URLs` for remote-hosted media\n- feat(workflow): define the adversarial-review findings contract\n\nFixes:\n\n- fix(worktree): bind publication to dispatch grants; reset retries to a\n pristine base; reject diffs without a merge base; clean untracked files when\n `.git` is a gitdir file; post-push metadata resilience, cancellation and\n branch naming\n- fix(container): persist the npm cache for per-task MCP servers\n- fix(agentexec): recover omitted finish calls\n- fix(agentworker): move JSONL decode into storage, unblocking CI\n- fix(telegram): compact tool output and drop turn caps\n- fix(webui): give dashboard-initiated updates a phase-2 report; restore the\n provider gate and dashboard token accounting\n- refactor: remove dead `BasePlatformAdapter` code and legacy execution paths\n\nShared with archied 1.16.0 (these packages are in both closures):\n\n- feat(telegram): send local files as uploads, not fetchable URLs\n- fix(webui,sendfile): close three holes the adversarial review found\n- fix(webui): validate mutation Origin against the effective external scheme"
},
{
"version": "1.15.0",
"date": "2026-08-24",
"body": "### archied\n\n**Autonomous workflows now have exactly one production execution path.** Every\ntask is handed complete to a scoped `archie-agent` container over core NATS;\n`archied` no longer runs an agent loop in-process. Embedded NATS is the\ndefault and generates a per-start token, binding to the resolved Docker bridge\nso managed workers can reach it; external NATS changes only broker placement.\nThe legacy `[agent]` section and `containers.enabled` still decode for\nmigration but can no longer select an execution path, and a reloaded\n`nats.url` is logged as requiring a restart. Operators upgrading from a\n`agent.mode = inprocess` configuration get the managed-worker topology\nautomatically; see `deployments/` for the supported profiles.\n\n- feat(nats): expose the embedded broker to managed task containers behind a\n generated per-start credential\n- fix(daemon): park before worktree access when the container pool or task\n transport is unavailable, rather than silently executing locally\n- refactor(agentexec): remove the in-process, subprocess and single-stage\n execution paths\n- fix(worktree): report a successful push as successful even when writing\n local upstream tracking metadata afterwards fails, so a published branch no\n longer parks the task as failed\n- fix(worktree): honour context cancellation in `CommitAll`, so a cancelled\n task can no longer stage or commit\n- fix(daemon): remove the worktree when a task completes with no changes,\n which previously leaked a full clone per no-change task; parked worktrees\n are still retained for post-mortems\n- fix(worktree): derive the branch prefix from the issue title before falling\n back to labels, matching the documented contract\n- fix(worktree): clean untracked files when `.git` is a gitdir file\n- fix(agentexec): recover agents that end a turn without the required finish\n call\n- feat(scheduling): ticker engine with a configurable interval and pools\n- fix(telegram): keep tool-call context when compacting tool output (#609)\n- feat(workflow): add the adversarial-review findings contract, where only a\n confirmed finding blocks and \"review found nothing\" is distinct from\n \"review did not run\" (contract only; no review stage runs yet)"
},
{
"version": "1.14.0",
"date": "2026-08-23",
"body": "### archied\n\n- fix(telegram): compact tool output and drop turn caps\n- fix(update): install only approved components"
},
{
"version": "1.13.0",
"date": "2026-08-23",
"body": "### archied\n\n- fix(telegram): render tool progress as bounded code blocks"
},
{
"version": "1.12.0",
"date": "2026-08-23",
"body": "### archied\n\n- fix(webui): give dashboard-initiated updates a phase-2 report\n- feat(agent): stamp archie-agent's build and report it back to the daemon\n- feat(releaseupdate): enrich components with install type and reference\n- feat(webui): surface per-component update status on /api/version and Configuration"
},
{
"version": "1.11.1",
"date": "2026-08-23",
"body": "### archied\n\n- fix(update): wire Telegram personas and survive callback cancellation\n- fix(webui): theme the Workflows 'Start work' form controls"
},
{
"version": "1.11.0",
"date": "2026-08-23",
"body": "### archied\n\n- feat(forge): make webhook intake observable and deduplicate concurrent delivery\n- fix(telegram): preserve code fences across message splits\n- fix(gateway): replay completed-duplicate turns with their tool activity\n- feat(storage): persist agent project state across sessions\n- fix(container): persist npm cache for per-task MCP servers\n- fix(worktree): bind publication to dispatch grants, reset retries to a pristine base, and reject diffs without a merge base\n- feat(media): deliver generated media through Telegram with link fallback in the dashboard\n- feat(tools): generate videos through MiniMax, gated by provider configuration"
},
{
"version": "1.10.0",
"date": "2026-08-22",
"body": "### archied\n\n- feat(forge): GitHub webhook receiver for immediate issue dispatch\n- feat(webhookguard): shared HMAC, rate-limit, and redaction mechanics\n- feat(nats): run an embedded server when no external NATS is configured\n- feat(capture): store unbound webhook events, retention-bounded\n- feat(webui): event inspector -- see captured payloads in the dashboard\n- feat(webui): payload field mapping -- bind JSON paths to named fields, preview before saving\n- fix(webui): stop the capture live-event notification duplicating payloads into the unbounded events table\n- fix(update): verify an update took effect instead of trusting the report (#530)\n- fix(daemon): refuse to poll on an empty label-trigger match (#529)\n- fix(gateway): stop persona from asserting unverified claims as fact (#528)\n- fix(gateway): stop ClaimTurn's insert-race branch losing its own retry read\n- fix: restore provider gate and dashboard token accounting\n- fix: address simple findings from a repo-wide golangci-lint sweep"
},
{
"version": "1.9.11",
"date": "2026-08-19",
"body": "### archied\n\n- fix(mcp): persist npx package cache across daemon restarts"
},
{
"version": "1.9.10",
"date": "2026-08-19",
"body": "### archied\n\n- feat(update): `/update` now streams live progress while an update installs, reports a clear version summary (previous/installed, daemon/agent) once the build succeeds, and automatically rolls back and reports the outcome if the restarted daemon fails its post-update health check"
},
{
"version": "1.9.9",
"date": "2026-08-18",
"body": "### archied\n\n- fix(telegram): drain live renderer in concurrency test\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.8",
"date": "2026-08-17",
"body": "### archied\n\n- chore: no user-facing changes\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.7",
"date": "2026-08-17",
"body": "### archied\n\n- chore: no user-facing changes\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.6",
"date": "2026-08-16",
"body": "### archied\n\n- fix(update): stamp install type and bound retry backoff\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.5",
"date": "2026-08-16",
"body": "### archied\n\n- refactor(archied): decompose the daemon bootstrap into phased wiring (no behaviour change; splits the ~950-line run() into focused setup phases so complexity linting passes)\n- refactor(archied): extract the config overlay boot helper and thread context through chat gateway setup\n- refactor(tools): split the read executor and flatten nested config/tool fallback logic to lower complexity\n- fix(tools): avoid predeclared `max` names\n- fix(email): use context-aware test networking\n- fix(indexing): remove the unused code search test runner\n- fix(tests): use contexts and type assertions in overlay and gateway tests\n- docs(architecture): document the memory engine family\n\n### archie-agent\n\n- refactor: decompose the daemon bootstrap into phased wiring (no behaviour change; complexity-driven restructure)\n- refactor(tools): split the read executor and flatten nested config/tool fallback logic to lower complexity\n- fix(tools): avoid predeclared `max` names"
},
{
"version": "1.9.4",
"date": "2026-08-15",
"body": "### archied\n\n- feat(gateway): polish /status command response format\n- fix(telegram): preserve URL boundaries in responses\n\n### archie-agent\n\n- chore: no user-facing changes"
},
{
"version": "1.9.3",
"date": "2026-08-15",
"body": "### archied\n\n- fix(webui): scroll selected command into view on keyboard navigation\n- fix(logging): resolve error attrs to their message string, not {}\n- feat(agentexec,workflow): surface tool calls on the task timeline\n\n### archie-agent\n\n- fix(logging): resolve error attrs to their message string, not {}\n- fix(agentworker): back off before refetching a nak'd stage message\n- feat(agentexec,workflow): surface tool calls on the task timeline"
},
{
"version": "1.9.2",
"date": "2026-08-15",
"body": "### archied\n\n- fix(worktree): force checkout so retry recovers from a dirty worktree\n\n### archie-agent\n\n- fix(worktree): force checkout so retry recovers from a dirty worktree"
},
{
"version": "1.9.1",
"date": "2026-08-15",
"body": "### archied\n\n- fix(agentworker): forward workflow events across the NATS worker boundary\n- fix(webui): filter turn_completed noise from the Live Activity SSE feed\n- feat(releaseupdate): stamp install type at build time, fail closed on unknown\n\n### archie-agent\n\n- fix(agentworker): forward workflow events across the NATS worker boundary"
},
{
"version": "1.9.0",
"date": "2026-08-15",
"body": "### archied\n\n- fix(webui): style tool-call failure from a structured field, not a string prefix\n- fix(config,webui): make show_tool_calls one cross-channel setting\n- fix(telegram): guarantee no message is stranded on gateway stop/restart\n- fix(telegram): use NewRequestWithContext to satisfy noctx\n- refactor(webui): decompose handleSSE to cut cognitive complexity\n\n### archie-agent\n\n- fix(agent): resolve git dubious-ownership in sandbox containers\n- feat(agent): mark the mounted worktree as a git safe directory\n- fix(agent): route git safe.directory setup through markWorktreeSafe\n- feat(chat): show tool calls inline and stream replies into one message\n- refactor(agent): move worker runtime into application layer\n- fix(config,webui): make show_tool_calls one cross-channel setting"
},
{
"version": "1.8.0",
"date": "2026-08-15",
"body": "### archied\n\n- feat(archied): add -version so the installed build can be read from a shell\n- fix(webui): rebuild the Configuration page layout so values stop colliding\n- fix(webui): size Configuration key/value lists to their own content\n- fix(webui): keep Configuration rows full width, hug only the label column\n- fix(webui): cap and centre the Configuration page instead of its lists\n- fix(webui): preserve encoded redirect path characters\n- feat(chat): show tool calls inline and stream replies into one message\n- fix(chat): harden inline tool call streaming\n- refactor(agent): move worker runtime into application layer\n- fix(telegram): harden live-reply delivery against /stop and multi-byte content\n- fix(telegram): keep tool activity visible and mark failed/empty turns\n- fix(config): de-duplicate disabled-forge predicate, export ForgeDisabled"
},
{
"version": "1.7.0",
"date": "2026-08-10",
"body": "### archied\n\n- fix(build): install ripgrep where grep.go actually needs it on PATH\n- fix(webui): Send button no longer passes its click event to sendMessage\n- feat(webui): Enter sends, Shift+Enter inserts a newline\n- fix(chat): stop showing raw 501 banner for unconfigured update-check\n- fix(chat): give chat page a real height budget instead of a floor\n- fix(workflow): carry gate output into the baseline park error\n- feat(logging): add a per-task log sink\n- feat(agentexec): publish agent-side logs to the task's system subject\n- feat(daemon): consume agent system logs into per-task sinks and the dashboard feed\n- feat(webui,gateway): add /api/tasks/{id}/logs endpoint and task_logs chat tool\n- refactor(gateway): persist conversations in sqlite\n- refactor(store): replace legacy persistence with SQLite\n- fix(webui): tighten configuration KV row spacing\n- fix(gateway): harden session recovery paths\n- refactor(daemon,webui): make Daemon.Cfg and webui.Server.Cfg reload-safe\n- feat(config): SIGHUP-triggered reload with requires-restart warnings\n- fix(config): share one config Holder between daemon and dashboard; re-apply model catalog on reload\n- fix(config): complete the reloadable allowlist and pin it against ForTask\n- feat(config): runtime config overlay store, PATCH /api/config, and the `--no-config-overlay` recovery flag\n- feat(webui): inline config editing on the Configuration page\n- feat(config): surface overlay state, shadowed keys, and per-row reset\n- fix(config): close review blocker on the PATCH path; deep-copy snapshots; atomics for shared state\n- fix(config): preserve nil slices in Clone to avoid spurious reload warnings"
},
{
"version": "1.4.0",
"date": "2026-08-10",
"body": "### archied (released 2026-07-31)\n\n- fix(secrets): wire provider credentials through engines\n\n### archie-agent\n\n- feat(gateway): tool-approval gate, session tools for chat, and /delete command\n- feat(gateway): make chat turns durable and idempotent\n- feat(webui): lifecycle-safe task controls with atomic retry and archive\n- feat(logging,workflow): daemon log feed and executable workflow registry\n- fix(store,gateway): taskstate constants and mobile jump-to search\n- feat(webui,gateway): wire config, channel, log-feed, and work-intake seams\n- fix(build): install ripgrep where grep.go actually needs it on PATH\n- fix(workflow): carry gate output into the baseline park error\n- feat(logging): add a per-task log sink\n- feat(agentexec): publish agent-side logs to the task's system subject\n- feat(daemon): consume agent system logs into per-task sinks and the dashboard feed\n- feat(webui,gateway): add /api/tasks/{id}/logs endpoint and task_logs chat tool\n- refactor(store): replace legacy persistence with SQLite\n- refactor(daemon,webui): make Daemon.Cfg and webui.Server.Cfg reload-safe\n- feat(config): SIGHUP-triggered reload with requires-restart warnings\n- feat(config): surface overlay state, shadowed keys, and per-row reset\n- fix(config): close review blocker on the PATCH path; deep-copy snapshots; atomics for shared state\n- fix(config): preserve nil slices in Clone to avoid spurious reload warnings"
},
{
"version": "1.6.0",
"date": "2026-08-09",
"body": "### archied\n\n- feat(gateway): tool-approval gate, session tools for chat, and /delete command\n- fix(webui): close open-redirect in dashboard token-exchange handler\n- feat(gateway): make chat turns durable and idempotent\n- feat(webui): lifecycle-safe task controls with atomic retry and archive\n- feat(config,channels): format-neutral config resolution and truthful channel state\n- feat(logging,workflow): daemon log feed and executable workflow registry\n- fix(store,gateway): taskstate constants and mobile jump-to search\n- feat(webui,gateway): wire config, channel, log-feed, and work-intake seams\n- fix(ui): hide inactive chat command menu"
},
{
"version": "1.5.0",
"date": "2026-08-08",
"body": "### archied\n\n- feat(curator): engine family contract, registry, and runtime\n- feat(curator): trigger accounting — primary-input wake path\n- feat(setup): interactive setup steps with a TTY-gated prompter\n- feat(webui): rebuild the dashboard and add chat\n- feat(daemon): identity-scoped isolation plus gateway session titles and /delete\n- feat(logging): optional rotating log file\n- feat(configuration): export Validate for the setup flow\n- fix(gateway): durable message identity with a SQLite store\n- fix(gateway): consistent message ordering and paged search\n- fix(gateway): stop /compress destroying history it should have kept\n- fix(gateway): do not answer a redelivered message twice\n- fix(gateway): claim the session slot before writing it, not after\n- fix(gateway): keep /topic off from poisoning the session cache\n- fix(gateway): resolve the most recently active session, not an arbitrary one\n- fix(gateway): give branch-inherited messages their own identity\n- fix(gateway): make both backends agree on newest-first\n- fix(store): honour the transition guard in production persistence\n- fix(store): move ID counters away from the reserved metadata namespace\n- fix(store): surface task timestamps and tag the summary structs\n- fix(telegram): pause the update loop when rate limited\n- fix(memory): fail startup on an unusable memory directory\n- fix(tools): let an optional provider fail without taking the daemon down\n- fix(tools): report a cancelled find walk as an error, not empty results\n- fix(worktree): name the missing forge credential when a push fails\n- fix(tomlwrite): recognise table headers carrying a trailing comment\n- fix: close the duplicate-work loop and the dead paths around it\n- perf(tools): drop the embedded ripgrep binaries\n- refactor: one definition of what approving or declining a task means\n- refactor: move workflow into its own domain"
},
{
"version": "1.3.0",
"date": "2026-08-08",
"body": "### archied (released 2026-07-31)\n\n- fix(memory): replace framework-specific names with generic equivalents\n- feat: unify provider and model selection\n\n### archie-agent\n\n- feat(curator): engine family contract, registry, and runtime\n- feat(curator): trigger accounting — primary-input wake path\n- feat(logging): optional rotating log file\n- feat(daemon): identity-scoped isolation\n- fix(secrets): wire provider credentials through engines\n- fix(store): surface task timestamps and tag the summary structs\n- fix(tools): let an optional provider fail without taking the daemon down\n- fix(tools): report a cancelled find walk as an error, not empty results\n- fix(worktree): name the missing forge credential when a push fails\n- fix: close the duplicate-work loop and the dead paths around it\n- perf(tools): drop the embedded ripgrep binaries\n- refactor: one definition of what approving or declining a task means\n- refactor: move workflow into its own domain"
},
{
"version": "1.4.1",
"date": "2026-07-31",
"body": "### archied\n\n- fix(catalog): match SDK provider fallback"
},
{
"version": "1.3.1",
"date": "2026-07-31",
"body": "### archied\n\n- fix(telegram): omit empty model picker markup"
},
{
"version": "1.2.0",
"date": "2026-07-31",
"body": "### archied\n\n- feat: add MCP client capabilities to archied and archie-agent\n- fix: handleSummary ignores errors from WorkflowStats/StageStats/TokensByDay\n- feat: establish Archie identity and use stable callback tokens\n- refactor(telegram): keep one model selector command\n- fix: handleSSE silently swallows EventsSince backlog fetch errors\n- fix: Transition() ignores `from` status guard, allowing lost updates\n- fix: skillscript.Run ignores context, cannot be canceled/timed out\n- feat(telegram): report installed component versions\n- feat(telegram): add approved component updates\n- fix: LoadDir: no timeout around Yaegi Eval can hang daemon startup\n- feat(chat): real system prompt for Archie — identity, tools, env\n- feat(indexing): port tau's codesearch workspace index\n- fix(indexing): surface index config properly and stop silent degradation\n- refactor(worktree): replace git shell-out with go-git v6\n- fix(worktreerpc): bound handler contexts and drop the git binary from tests\n- refactor(nats): rebuild as infrastructure/eventbus/nats with real boundaries\n- refactor: route tasks on a typed kind, not forge labels\n- fix(natsrpc): make RegisterAll wait for the server to see subscriptions\n- refactor(config): move loading into infrastructure/configuration\n- fix(telegram): publish all executable session commands in menu and help\n- fix(telegram): publish the restored gateway commands\n- refactor: add internal/eventbus as the broker-neutral messaging contract\n- fix(chat): operator name from config, session wiring, prompt rules\n- feat(tools): lift tau's file and shell tools into the tool registry\n- feat: make /stop cancel the running chat turn\n- fix: kill the whole process group when a shell command is cancelled\n- feat: refuse unrecoverable shell commands\n- feat: make /stop reach running agent tasks\n- fix(chat): temper prompt brevity rules with warmth\n- fix: use errors.Is/As for context errors and cleanup\n- fix(grep): distinguish ripgrep exit 1 from a failed search\n- fix(archied): disable the forge on a missing credential, not the daemon\n- fix: restore /model parsing and close the 6d4e0be autofix audit\n- feat: embed config.example.toml and add comment-preserving TOML writer\n- fix(docker): install unzip and Node 24 so MCP servers can start\n- fix(docker): slim both images and repair unreachable Go tooling\n- fix(container): write the task boot brief under .git\n- fix(telegram): drop pending updates before long polling\n\n### archie-agent\n\n- feat: add MCP client capabilities to archied and archie-agent\n- fix: Transition() ignores `from` status guard, allowing lost updates\n- fix: skillscript.Run ignores context, cannot be canceled/timed out\n- fix: LoadDir: no timeout around Yaegi Eval can hang daemon startup\n- fix(indexing): surface index config properly and stop silent degradation\n- refactor(worktree): replace git shell-out with go-git v6\n- fix(worktreerpc): bound handler contexts and drop the git binary from tests\n- refactor(nats): rebuild as infrastructure/eventbus/nats with real boundaries\n- refactor: route tasks on a typed kind, not forge labels\n- fix(natsrpc): make RegisterAll wait for the server to see subscriptions\n- refactor(config): move loading into infrastructure/configuration\n- refactor: add internal/eventbus as the broker-neutral messaging contract\n- feat(tools): lift tau's file and shell tools into the tool registry\n- feat: make /stop cancel the running chat turn\n- fix: kill the whole process group when a shell command is cancelled\n- feat: refuse unrecoverable shell commands\n- feat: make /stop reach running agent tasks\n- fix: use errors.Is/As for context errors and cleanup\n- fix(grep): distinguish ripgrep exit 1 from a failed search\n- fix(docker): slim both images and repair unreachable Go tooling\n- fix(container): write the task boot brief under .git"
},
{
"version": "1.1.0",
"date": "2026-07-27",
"body": "### archied\n\n- feat: add the Telegram gateway with persistent sessions, topic-thread support, streamed rich replies, typing indicators, and Markdown rendering\n- feat: add `/spawn`, `/approve`, and `/cancel` for chat-driven task control\n- feat: provide a comprehensive `/help` guide whose command list stays aligned with Telegram's published menu and Archie's executable command surface\n- feat: add `/provider` and provider-filtered `/model` selectors that switch the provider and model used by subsequent live chat turns\n- feat: include the active provider and full model reference in `/status`\n- feat: notify authorized Telegram users once when a newly tagged component release is installed\n- feat: add `/restart` to reload and relaunch the Telegram gateway without interrupting in-flight daemon tasks\n- feat: add deny-by-default Telegram sender authorization and native command-menu publication\n- feat: connect Desktop Commander through Archie's managed MCP client so chat can use workspace file and process tools\n- feat: add multi-identity daemon configuration, persona routing, an email channel, and webhook platform support\n- feat: add durable task, session, message, and memory persistence\n- feat: add memory synchronization, prefetch, context scrubbing, threat scanning, and built-in memory tools\n- feat: add tool guardrails, classification, budgets, availability filtering, and disclosure controls\n- feat: add feature-based YAML configuration with `conf.d` overlay loading\n- feat: add typed secret-engine registration and Yaegi extension support\n- fix: reject unknown slash commands locally instead of allowing the LLM to fabricate command behavior\n- fix: publish Telegram commands to default, private-chat, and group-chat scopes so stale commands inherited with the bot token cannot shadow Archie's menu\n- fix: drain the SDK's full event stream so streamed Telegram replies cannot deadlock\n- fix: use standard newline-delimited JSON framing for MCP stdio clients\n- fix: make MCP stdio shutdown and timeout handling race-safe\n- fix: restore legacy `[forge].token_env` compatibility and required container environment passthrough\n- fix: make the agent-container Docker network explicitly configurable\n\n### archie-agent\n\n- feat: add streamed agent execution with typed message events\n- feat: add MCP client transports and managed tool-provider discovery\n- feat: add memory context scrubbing and normalized memory tool schemas\n- feat: add plugin metadata extraction from `metadata.archie.plugins`\n- feat: add configurable container networking for daemon-launched runtimes\n- fix: preserve valid UTF-8 when clipping runtime output\n- fix: make MCP stdio lifecycle, retries, and timeout handling race-safe\n- fix: enforce a zero-finding lint and vet baseline"
},
{
"version": "1.0.0",
"date": "2026-07-22",
"body": "### archied\n\n- feat: ship the resident forge-polling daemon, deterministic workflow engine, isolated worktrees, quality gates, Gitea integration, Docker/NATS worker split, plugin loading, and skills support\n- feat: publish `archied` and `archie-agent` container images to the Gitea registry\n\n### archie-agent\n\n- feat: ship the isolated agent runtime, NATS RPC boundary, workflow execution, skills, and plugin support\n- feat: publish the `archie-agent` container image to the Gitea registry"
}
]
+414
View File
@@ -0,0 +1,414 @@
# External agent harnesses
**Status:** Approved **Scope:** the harness model and, in "Session contract",
the duplex session that the setup terminal and the run-scoped live view both
use. Code cites this file for both (`ui/src/harness/SetupTerminal.vue`,
`internal/infrastructure/postgres/queries/harness_secrets.sql`).
## Decision
A workflow stage can run on an external coding-agent CLI instead of the built-in
agent loop: Claude Code, Codex, Pi, OMP, GitHub Copilot CLI, or any other CLI
packaged as a Docker Sandbox Kit v3. Each authenticates with an API key or the
operator's subscription login, and can carry the operator's own skills, plugins,
subagents and instructions.
Two boundaries hold regardless of what the harness does:
- **The real credential never enters the container.** The container sees
sentinel values; archie's egress proxy substitutes the real credential on
outbound requests and performs OAuth refresh on the host.
- **Archie's workflow guarantees are enforced outside the harness.** Git,
protected paths, read-only stages, gates and budgets are checked by archie
around the process and against the worktree afterwards.
## Kits
A harness is packaged as a Kit v3 image: an OCI image whose
`vnd.docker.sandbox.kit.descriptor` manifest annotation declares what the
harness needs. Archie reads descriptors with the published
`github.com/docker/sandbox-kit-spec/v3/spec` package and does not maintain its
own descriptor format. Published Kits run unmodified.
Archie is a partial Kit runtime. It implements these capability types:
| Type | Archie behaviour |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| `credential@1` | Proxy-managed only, described below. |
| `network-policy@1` | Enforced by the egress proxy. |
| `volume@1` | A Docker volume keyed by WorkflowExecution, deleted with it. |
| `lifecycle@1` | Install and startup hooks run on container create. |
| `agent-sessions@1` | The headless `prompt` and `resume` invocations for the stage. |
| `agent-skills@1` | Discovery paths for bundled skills and optional shared skills; host access is always read-only. |
| `agent-skill@1` | Selected image-bundled skills copied into the declared discovery paths. |
| `agent-context@1` | The resolved discovery directory, defaulting beside the workspace; preserve instructions outside Archie-managed sections. |
| `resources@1` | Container CPU and memory limits. |
Every other type fails closed: a required entry refuses the launch, an optional
one is skipped and recorded on the step. `credential@1` with `passthrough: true`
and any credential for a forge service are refused.
The operator's own setup (plugins, subagents, instructions, settings) is a mixin
Kit, published with the harness Kit as a Kit set: the set merges their layers
into one image. It is versioned image content, rewritten on every create, never
state a run can modify.
## Contract
A harness run is a second implementation of `agentexec.Runner`. It takes the
same `Request` and returns the same `Result`, so workflows, the daemon and the
State Store do not know which runner ran a stage.
`agent-sessions@1` supplies the invocation. Archie supplies, per CLI, an output
adapter that translates the CLI's JSON output stream into `ToolCallReporter`
calls, `Usage` and a session ID. A CLI with no adapter can run stages with no
capture tools, reporting no usage; its token budget falls back to wall clock.
Workflow definition validation rejects, at load time, a stage whose needs the
selected harness cannot meet: capture tools without an adapter, or a gate retry
without a `resume` verb.
## Selection
A harness is an agent profile. `docs/prds/event-automation.md` defines a profile
as the execution environment a workflow selects; a harness profile names one Kit
pinned by digest, a workload Kit or a published Kit set, in place of a container
image. Archie runs that Kit's image and composes no Kits itself; a bare mixin is
refused. Everything else about profiles holds: a workflow names its profile, a
stage may name a different one, and a profile holds no secrets.
`archie-agent` builds the stage's runner from the stage's profile: the ai-sdk
agent loop for an image profile, the harness runner for a Kit profile. Image
profiles, and every workflow already written against them, are unchanged. A Kit
profile named by no workflow is a validation error.
A stage naming a different profile than its workflow's is a separate run, not a
mid-container runner switch: a Kit task runs in one container provisioned for
one profile (Container layout), so a stage that needs a different one is its own
callee, started the way `workflow.call` already starts one
(`docs/prds/event-automation.md` "Workflows call workflows"), with its own agent
profile resolved off its own task row. This needs no mechanism beyond
`workflow.call` plus per-task profile resolution (`daemon.pinTaskProfile`), both
of which already treat every task's profile independently of any caller's -- see
`TestWorkflowCallerConformance` (staterpc) for the callee's independent
`Workflow` field and `TestWorkflowCallGivesACalleeItsOwnProfile` (daemon) for
the Kit-vs-image runner selection that independence produces.
Profiles are org resources in the State Store, so a Kit profile belongs to one
org, is granted to its workspaces like any profile, and applies without a
restart.
## Organisations
`docs/prds/orgs-and-access.md` is the boundary; a harness adds nothing that
crosses it.
- A Kit profile, its credential bindings and its OAuth tokens belong to one org.
No record is shared between orgs.
- A harness run is a run like any other: it acts as the workflow's identity,
under the run credential issued at dispatch.
- The egress proxy injects a credential only when the run credential carries the
secret the binding names. A Kit that declares a service the identity is not
granted gets no credential: a required one refuses the launch, an optional one
is skipped.
- A Kit's network policy is what the Kit asks for; the identity's network grants
are what the org allows. The proxy enforces the intersection.
- Concurrency slots are counted per binding within its org.
## Credentials
A credential binding maps a Kit's `credential@1` `service` name to an org
secret, which the org grants to identities like any secret. The secret holds one
of:
- **API key:** a value in the org's secret store.
- **OAuth:** tokens captured by the setup terminal, stored in the State Store
under the at-rest envelope of `binding-secret-encryption.md` with its own
domain separator.
The egress proxy resolves the binding for each request against the run
credential. The container gets the Kit's sentinel in the named variable or
credential file. OAuth refresh happens at the proxy, which intercepts the Kit's
`tokenEndpoint`, so a refreshed token is written to the State Store and never
returned to the container.
Runs sharing an OAuth binding share its subscription's rate limit.
`max_concurrent` on the binding (default 1) caps its simultaneous runs. A stage
waiting for a slot is `pending`, not `running`.
## Session contract
A **session** is a duplex PTY into a Kit container the daemon owns. One concept
covers both targets; only the address, the lifetime and the established egress
phase differ.
| | Setup session | Run session (deferred) |
| --------- | ------------------------------------------------------------- | ------------------------------ |
| Address | `{org, profile}` | `{org, task, attempt}` |
| Container | ephemeral, from the profile's Kit | the task's running container |
| Purpose | run the CLI's own login so the proxy captures the tokens | watch and optionally take over |
| Lifetime | bounded by the session TTL; the container is removed on close | bounded by the task |
- **Transport.** The daemon serves `harness.v1.HarnessService`, a bidi gRPC
stream, and the dashboard implements its `HarnessTerminal` interface
(`internal/webui`) over that client; the browser's WebSocket route is
unchanged. The contract lives on the daemon because the daemon owns
containers: the dashboard process must not link `internal/container`,
`internal/app/archied` or `internal/agentexec`.
- **Authorisation.** Opening a session is the `update` action on the secret,
decided by the dashboard's authorizer before the route runs
(`internal/webui/authorize.go`). The dashboard then dials the daemon with the
harness service token. The daemon does not re-authorise an operator; it trusts the
asserted `{org, profile}` exactly as the task-action RPC trusts an asserted
actor. Because that authority is a shell in a container holding an org's
credential, the harness listener requires `HARNESS_TOKEN` even on loopback,
unlike the State Store's loopback convention.
- **Egress phase.** Token interception is filtered by phase (`oauth.go`'s
`rule.runtime == atRun`), and `EnterRuntime` is one-way. A setup session
therefore follows a run's lifecycle exactly: install hooks at the install
phase, `EnterRuntime` before the shell. A credential whose token endpoint must
be captured declares `phase: runtime`; a credential capturing at install phase
is captured by the install hooks that run before the switch.
- **Credentials.** Capture is gated: the proxy intercepts a token endpoint only
for a service the session is granted (`Proxy.granted`). A setup session has no
task, so the daemon registers a session grant: its proxy token resolves to
`{org, the Kit's declared credential services the org binds}`. That is the
intersection the `update`-on-secret authorisation covers. The real token never
enters the container: the response is sentinelized and stored as the org's
harness secret.
- **Container discipline.** The setup container runs a keepalive entrypoint with
an empty `Config.Env`; the PTY is an exec as the Kit's harness user with the
harness env and nothing inherited from any worker. No worktree is mounted. It
is acquired through the container pool, so it carries the `archie-daemon`
label, the concurrency cap and the max-uptime reaper; the session TTL is the
smaller bound. Closing revokes the egress session, removes the sandbox network
and the Kit volumes, then releases the container.
- **Kit unavailable.** The daemon serves the contract only when it has a
container pool and a Kit launcher; otherwise there is no listener, and a
client's refused connection is gRPC's `Unavailable`. The dashboard's existing
failure surface is the honest degrade; `/api/harness`'s `terminal` field means
"a client is configured", not "the daemon can run a Kit".
- **Run target.** `RunTarget{task_id, attempt}` opens a read-only view of a
running task's sandbox; it ships as the peek. The daemon resolves the pair
itself, so the dashboard never learns a container name: the task store says
whether the task is `running` and which attempt is current, and the Kit
launcher names the container `kitrun.TaskContainer(task_id, attempt)` (one
container per attempt, removed when the run ends; volumes remain task-scoped
for retries). A finished or unknown task, a task that is not running, an
attempt other than the running one, or a container that is gone is `NotFound`
with the reason in the message; an unreachable task store or container engine
is `Unavailable`. The view follows the container's stdout and stderr,
including the harness output forwarded by the worker, carries no stdin and no
exec, and ends when the task's container ends or the client leaves, so it
confers no authority over the container. A read-only tail of the existing
per-attempt logs was rejected: those refresh only on task state changes and
are the daemon's account, not the sandbox's. Mid-stream failures are shown as
a reason in the terminal before it closes.
- **Authorisation.** The dashboard route `GET /api/tasks/{id}/sandbox` is
decided as `read-logs` on the task before the handler runs, so a caller sees
a sandbox exactly when they may read that task's log. The daemon checks that
the task belongs to the asserted org before following output.
- **Grants.** The view takes no grant of its own. The run's egress session
(its proxy token, install then `EnterRuntime`) already belongs to the run
and is revoked by `Launcher.Release` when the task ends; the view reads
after that phase switch and dies with the container.
- **Credentials.** The sandbox holds sentinels, never real credentials: API
keys are `egress.Sentinel` (`credentials.go`), and an OAuth token set is
sentinelised in the response and swapped back by the proxy only on a granted
service's resource host in the matching phase (`oauth.go`, `injectOAuth`).
The proxy runs in the daemon outside the container, so a shell in the
container sees only sentinels.
- **Takeover (interactive PTY into a running task) is out of scope for this
issue.** It needs the dangerous-command authority (#1574) to
gate it, and that authority is not wired for it: the harness listener has no
approval step; `ToolSetOptions.Approval` in `internal/agentexec/modelloop`
is never set by a caller, so task runs never build approval-required tools;
approvals reach an operator only on the chat paths (dashboard ask, Telegram,
Gateway). Takeover would also need an audit record naming the actor, task,
attempt and open/close times, and revocation tied to task end (the exec is
closed with the container). Those follow the setup session's shape
(`harnesssession.Session`, `container.ExecPTY`) once the authority exists.
- **Audit.** Opening and closing a session and a successful capture are recorded
with the asserted org and profile. A run view's open and close are logged with
the task and attempt; it reads output only, so it has no takeover record.
Each session is the only interactive path into a harness container.
## Egress
Only Kit profiles run on the egress path. An image profile keeps the network
access its identity is granted, because workflows such as a network investigator
need raw DNS, ICMP and arbitrary TCP that no HTTP proxy carries.
- **Sandbox network.** Each Kit run gets its own internal Docker bridge on which
the host holds no address. Host services, including those listening on every
interface, are unreachable from it by any address.
- **Relay.** One relay container, `archie-agent relay`, sits on the sandbox
networks under a fixed alias and on the host-reachable network. It forwards
three fixed ports, to the proxy, NATS and the State Store, and can reach
nothing else. It holds no secrets.
- **Proxy.** The proxy runs inside `archied`, listening on the host gateway of
the host-reachable network. It terminates TLS with a per-daemon CA installed
into the container at create, identifies the container by a per-run proxy
password distinct from the worker's run grant, and applies that run's network
policy and credential inject rules. Upstream dials refuse loopback, and refuse
internal addresses unless the policy names the exact IP, so an allowed name
cannot resolve back into the host.
## Container layout
A Kit task runs in one container, from the Kit composition's image, on the
task's sandbox network. The worker and every harness invocation share it; they
are separated by user, not by container, so a run's cost scales with the run and
not with how many agents it fans out to.
- **Worker.** Archie mounts its own `archie-agent` binary read-only and runs it
as the container's entrypoint, as root. It holds the task's NATS and State
Store credentials in its own environment and in root-only files, runs the
workflow, and serves `archie-agent mcp`. The Kit image's entrypoint is not
PID 1.
- **Harness.** Every invocation runs as the Kit's user (the image's `User`,
default uid 1000) with an explicit environment: the Kit's variables, the proxy
environment and the credential sentinels, and nothing inherited from the
worker. That user cannot read the worker's environment or files, or trace it.
Sibling invocations in one run share the user and the worktree.
- **Hooks.** `lifecycle@1` install and startup hooks run as the user each
declares, before the worker accepts work.
- **Mounts.** The task worktree at the Kit's workspace directory, owned by the
Kit's user, and the read-only skills store. Nothing else from the host.
- **Network.** The relay forwards three fixed ports on the sandbox network: the
egress proxy, NATS and the State Store. The worker reaches NATS and the State
Store with its credentials; a harness can open those ports but holds no
credential either accepts.
- **Volumes.** `volume@1` paths persist for the life of the WorkflowExecution,
which covers session resume across gate iterations and retries. They are not
shared between executions.
## Archie tools inside the harness
Capture tools return a stage's structured results through `archie-agent mcp`, a
stdio MCP server. The same command forwards central-tool discovery and calls
over Streamable HTTP to `http://archie.tools/mcp` through the egress proxy.
Claude Code, Codex, Pi, OMP and GitHub Copilot CLI register it using their
native MCP configuration. Registration files are per-stage and outside the
worktree; the Kit's bundled settings remain intact. A CLI that exits without
initializing the required MCP server fails the stage.
`archied` handles that exact endpoint inside the authenticated task proxy; it is
not a listener or an upstream network destination. It is available only during
task runtime, never during install or a setup session. The harness supplies a
sentinel, and the proxy injects a separate random gateway token held only on the
host. Ending the proxy session revokes that token and cancels active calls.
The proxy reaches `archie-gateway` through its authenticated gRPC contract. The
Gateway derives the task, execution principal and org from a live run grant on
every request. Its tool list is bounded by the profile in that org and the
package's accepted tool authority, checked again at invocation. Workspace tools,
chat file delivery, conversation-only tools and tools that require an
unavailable approver are not served. Tool result limits apply without exposing
host spill paths; media is returned as MCP content.
Task MCP providers run in the Gateway with task-bound sessions and sampling.
Sampling uses the task's model and credentials, records task usage and refuses
revoked grants. It does not use the chat identity or chat model. The worker does
not start another copy of those providers for Kit tasks. The harness's own
built-in tools remain outside Archie's tool-result limits.
## Enforcement around the harness
| Property | Enforcement |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Model never runs git | No forge credential can be bound. Archie records `HEAD` and every ref before the run; any change fails the step (`failed`, policy class). The workflow commits the stage's changes. |
| Protected paths | A diff touching a `Protection` path fails the step. |
| Read-only stage | Any worktree diff fails the step. |
| Gate | Archie runs the stage's gate after the harness exits. On failure it resumes the session with the gate output, up to the stage's iteration budget. |
| Budget | Archie kills the process on wall-clock timeout, or when streamed usage passes the token budget. |
| Cancellation | Cancelling the step kills the process group, then the container. |
| Egress | Only the proxy is reachable; the Kit's network policy decides the rest. |
Harness settings that deny git or protected paths are added where the CLI
supports them, to save wasted turns. They are never the enforcement.
## Execution tree
A harness run is one `agent` StepExecution. Subagents the harness spawns
internally are not recorded as children. Their usage is included in the step's
`tokens_used` when the adapter reports it.
## Agents never hold a harness
An Agent reaches a harness only by invoking a Workflow whose stage names it. No
Agent tool, chat tool or capability exposes a harness, its setup terminal or its
credential. The stage boundary is what carries the container, the git and path
checks, the gate and the budget; a harness outside a stage has none of them.
## Out of scope
- Chat through a harness. The gateway chat loop stays on the built-in runtime.
- `network-policy@2` HTTP method and path rules; a Kit requiring it is refused.
- Recording the harness's internal subagents as StepExecutions.
- Cost in currency.
- Choosing a harness automatically per task.
## Plan
1. Descriptor resolution with the Kit spec package; capability support table and
fail-closed refusal.
2. Egress proxy: internal network, per-daemon CA, per-container token,
`network-policy@1`.
3. `credential@1`: API-key bindings, sentinel rendering, inject rules.
4. Harness `Runner`: container create with worktree, volumes, lifecycle hooks
and the mounted `archie-agent`; `agent-sessions@1` invocation; worktree
checks for git, protected paths and read-only; budget and cancellation.
5. Claude Code output adapter; `archie-agent mcp`; gate-and-resume loop.
6. Kit profiles, runner selection from the stage's profile, and definition
validation.
7. OAuth bindings as org secrets: token-endpoint interception, encrypted
storage, per-binding concurrency; dashboard setup terminal.
8. Output adapters for Codex, Pi, OMP and GitHub Copilot CLI.
## Verification
- Every named adapter discovers and calls a permitted central tool through the
proxy and records a local capture. A guessed tool outside the profile or
accepted package authority is refused.
- The gateway token never appears in the container, generated MCP files,
worktree, logs or events. It is not the container's proxy password.
- A permission change after discovery takes effect at the next call; ending the
proxy session cancels active calls, and a revoked grant cannot execute tools
or sample a model.
- Bundled skills remain visible with shared skills missing or disabled; shared
mounts are per-skill and read-only. Explicit context directories preserve
non-managed instructions and refuse symlinked staging paths.
- The same workflow definition completes on `builtin` and on the Claude Code Kit
with the same `Result` shape and captures.
- After `/login` in the setup terminal, the container's credential file holds
only sentinels, the State Store holds the encrypted token, and a task run
authenticates.
- A real API key or OAuth token never appears in the container environment,
filesystem, worktree, task log or event stream.
- A request to a host outside the Kit's runtime allow list fails, including a
direct connection that bypasses the proxy settings.
- A harness instructed to `git commit` fails its step, and the task branch is
unchanged.
- A harness edit to a protected test file fails the step in a TDD fix stage.
- A read-only feasibility stage that writes a file fails.
- A file a run writes into a Kit-managed path such as the CLI's settings file is
gone on the next execution.
- A Kit requiring an unsupported capability is refused at launch with the
capability named.
- A stage with a failing gate resumes the same session with the gate output,
then succeeds or exhausts its iterations.
- Two tasks sharing an OAuth binding with `max_concurrent = 1` run one at a
time; the second waits as `pending`.
- Stopping a run kills the harness process and removes the container.
- A harness invocation cannot read the worker's NATS or State Store credential
from its environment, its files or `/proc`.
- A run fanning out to many agent invocations uses one container.
- A Kit profile in org A cannot be selected, and its binding cannot be resolved,
by a workflow in org B.
- A harness run whose identity is not granted a Kit's required credential is
refused at launch; the proxy never injects a secret outside the run
credential.
- The firewall investigation example runs unchanged on an image profile with
direct network access.
+37 -40
View File
@@ -1,26 +1,24 @@
# Self-development loop: archie develops its own codebase
**Status:** Decided, not yet built (2026-11-03, sam) **Scope:** how archie
keeps developing archie-core itself. This file records a
desired state, not an implementation or a product. Nothing below exists unless
the "Built today" section says so. Epic #1769 tracks the plan, with child
issues #1770–#1775. This file is a record, not a mechanism: agents only see what
is in their context, so verify every claim here against the code before acting
on it. Where they disagree, the code wins. The boundary below is load-bearing
only where the code enforces it (the gate, access control, the daemon's git
monopoly) and only where `AGENTS.md` states it. Everywhere else this file is a
pointer.
persistently takes on development of archie-core itself. This file records a
desired state, not an implementation or a product: nothing below exists unless
the "Built today" section says so. The plan is tracked as epic #1769 with child
issues #1770–#1775. This file is a record, not a mechanism: agents only see
what is in their context, so verify every claim here against the code before
acting on it — where they disagree, the code wins. The boundary below is
load-bearing only where it is enforced (the gate, access control, the daemon's
git monopoly) and stated in `AGENTS.md`; everywhere else this file is a pointer.
## Built today
The machinery the loop will reuse exists. It includes the shipped
triage/implement/pr-review workflows and the adversarial self-review stage before
a PR opens (epic #1348, closed). It also includes the prbench judge for review
quality with its acceptance bar, canary releases judged on the installed release
(releaseupdate), and the curator engine. What does not exist is the loop itself:
no self-intake curator, no automatic run for approved issues, no judge for
diffs, no outcome distillation, no canary routing specific to self-directed
changes.
The machinery the loop will reuse exists: shipped triage/implement/pr-review
workflows, the adversarial self-review stage before a PR opens (epic #1348,
closed), the prbench judge for review quality with its acceptance bar, canary
releases judged on the installed release (releaseupdate), and the curator
engine. What does not exist is the loop itself: no self-intake curator, no
approved-issue auto-run, no judge for diffs, no outcome distillation, no
canary routing specific to self-directed changes.
## Decision
@@ -30,42 +28,41 @@ Archie improves its own codebase through a closed loop, built in stages:
gate failures and alerts, dedupes against open issues, and files new issues.
Archie files its own work; the maintainer approves priority.
2. **Approved-issue loop** (#1771): an approved issue runs the shipped
triage/implement workflows end to end. The workflow makes a read-only plan
and a gated build, then runs the adversarial self-review; the daemon commits
and opens a green PR. The maintainer still merges at this stage.
triage/implement workflows end to end — read-only plan, gated build,
adversarial self-review, daemon commits and opens a green PR. The maintainer
still merges at this stage.
3. **Implementation judge** (#1772): the prbench judge pattern scores diffs,
calibrated against the maintainer's merge decisions. Automatic merge applies
only when the gate is green, the review stage is clean, and the judge is above
the calibrated bar.
calibrated against the maintainer's merge decisions; auto-merge applies only
when the gate is green, the review stage is clean, and the judge is above the
calibrated bar.
4. **Outcome distillation** (#1773): a curator turns merged-run postmortems into
proposals for the repo's agent instructions. The maintainer adds each
proposal only because it changes a decision, and removes rules that stop
changing decisions.
proposals for the repo's agent instructions, each added only because it
changes a decision; rules that stop changing decisions are removed.
5. **Canary** (#1774): self-directed changes ship through the canary release
window, and the canary verdict on the installed release gates their
promotion. Rollback is a plain revert, because every self-directed change is
one gated commit.
window and are judged on the installed release before promotion. Rollback is
a plain revert, because every self-directed change is one gated commit.
## Boundary
Enforcement lives in the code, never in the prompt (#1775). Archie may propose
changes to the commit gate, the invariants in `AGENTS.md`, access control and
grant scoping, the daemon-only git path, and webhook HMAC verification. It never
merges them; those changes require a maintainer merge. Everything else
(workflows, curators, memory, docs, the dashboard) is fair game for the loop.
Enforcement lives in the harness, never in the prompt (#1775). Changes to the
commit gate, the invariants in `AGENTS.md`, access control and grant scoping,
the daemon-only git path, and webhook HMAC verification may be proposed by
archie but are never merged by archie — they require a maintainer merge.
Everything else (workflows, curators, memory, docs, the dashboard) is fair game
for the loop.
## Why
Self-improvement degrades when it relies on the model choosing to follow rules.
The model can argue with a prompt, not with gates, scoped grants or the daemon's
monopoly on git. Keeping quality measurable is what lets the loop widen without
turning the codebase to garbage: a judge bar and a canary verdict as numbers,
and tests guarding the protected seams.
Gates, scoped grants and the daemon's monopoly on git cannot be argued with; a
prompt can. Keeping quality measurable — a judge bar and a canary verdict as
numbers, tests guarding the protected seams — is what lets the loop widen
without turning the codebase to garbage.
## Consequences
- One issue to one small PR applies doubly to self-directed work. Past about 100
- One issue → one small PR applies doubly to self-directed work: past about 100
lines or any new mechanism, the change stops and reassesses.
- Every self-directed commit cites the issue that authorised it.
- Every self-directed commit cites the issue that authorized it.
- Rule proposals from the distillation curator must name the run that triggered
them, and `AGENTS.md` stays short enough to read in full every session.
+74 -76
View File
@@ -1,31 +1,31 @@
# User authorisation boundaries
# User authorization boundaries
Archie separates authentication (which person or service is calling) from
permission to act on a resource. This inventory follows the
[OWASP Authentication Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)
and
[Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html).
It includes the guidance on attributes and relationships from the Authorization
Cheat Sheet. It describes concrete enforcement points and their regression
tests. It is not a compliance certification.
[Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html),
including its guidance on attributes and relationships. It describes concrete
enforcement points and their regression tests; it is not a compliance
certification.
## Transport and authority
The browser uses HTTP/JSON and SSE to the UI service. The UI service calls State
Store, Gateway, Messaging and the daemon through their gRPC contracts. Only the
State Store opens the task/control-plane/account database. Gateway owns
Store, Gateway, Messaging and Harness through their gRPC contracts. Only the
State Store opens the task/control-plane/account database; Gateway owns
conversation storage. Browser HTTP handlers never open either database.
Instance service credentials are administrative authority. They are not user
sessions and must never reach a browser, model, or agent container. A service
forwarding a principal preserves attribution and tenant scope. Forwarding alone
forwarding a principal preserves attribution and tenant scope; forwarding alone
does not mean every internal RPC evaluates Cedar. Most internal RPCs trust the
authenticated service and enforce their own resource scope. The public HTTP
boundary evaluates Cedar before invoking them. Task credentials have a separate,
explicit RPC allowlist and cannot call account or identity administration.
The services treat local service listeners as trusted process boundaries.
Loopback does not replace authentication on a remotely reachable listener. OIDC
Local service listeners are trusted process boundaries. Loopback is not a
substitute for authentication on a remotely reachable listener. OIDC
credentials, local browser sessions, personal API tokens, service credentials,
and task grants must remain distinct.
@@ -33,84 +33,82 @@ and task grants must remain distinct.
`internal/domain/access` defines actions, resources, principals and memberships.
`internal/infrastructure/access` assembles Cedar entities and evaluates the
instance → organisation → workspace → object chain. A forbid wins. Each
instance → organization → workspace → object chain. A forbid wins; each
applicable level must permit the operation. Missing or invalid policy chains
fail closed.
The default policies grant actions through scoped roles. Policies can also
restrict a named identity, workspace environment, owner, state, source address,
signature, run or step. HTTP task decisions now include the stored initiating
identity and task state. Binding decisions include the stored binding state. The
identity and task state; binding decisions include the stored binding state. The
HTTP source address is the actual connection peer, not an unverified forwarded
header. Membership and resource attributes must come from stored records or
authenticated context. They never come from a request's assertion about itself.
authenticated context, never a request's assertion about itself.
Cedar permission is not ownership of another person's private data. The services
bind conversation history, passkeys, recovery codes and personal tokens to the
person. An organisation or instance admin role does not override those
relationships. Account creation uses `manage_members` policy rather than a fixed
admin role. An OIDC login does not automatically grant membership, link
Cedar permission is not ownership of another person's private data. Conversation
history, passkeys, recovery codes and personal tokens are bound to the person.
An organization or instance admin role does not override those relationships.
Account creation uses `manage_members` policy rather than a hard-coded admin
role. Authenticating through OIDC does not automatically grant membership, link
accounts by unverified email, or create an administrator.
## Enforcement inventory
| Location | Enforcement | Regression evidence |
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Browser credential gate: `webui/auth.go`, `accounts.go` | Account session or verified provider identity; shared dashboard token is not a person once setup creates an account. No API data before authentication. | `TestAccountBoundary`, `TestAccountSessionFailureIsClosed` |
| Browser policy gate: `webui/authorize.go` | Resolve principal from stored identity; evaluate action against stored org/workspace and resource kind before handler. Missing chain refuses. | `TestHTTPPolicyCannotBeBypassed`, `TestAuthorizeRefusesWithoutAChain`, `TestAuthorizeRecord`, `TestTaskAuthorizationUsesStoredAttributes`, `TestAuthorizeCreateIn` |
| Instance-only HTTP surfaces: `webui/instance_only.go`, server route registration | Hide instance-owned configuration and diagnostics from another org; policy still applies first. | `TestInstanceOnlyHidesTheInstanceFromOtherOrgs`, `TestInstanceAdminOrgs` |
| First setup: `webui/accounts.go`, `postgres/accounts.go` | Initial organisation, workspace, instance URL, admin identity and password commit together. Transaction lock closes bootstrap after first account; later requests require `manage_members`. | Disposable PostgreSQL smoke verification for bootstrap race and rollback; account policy tests below |
| Account creation: `webui/accounts.go`, `staterpc/accounts.go`, `postgres/accounts.go` | Cedar `manage_members` at HTTP and RPC; derive the target org from the authenticated context. New local accounts cannot request owner role. | `TestAccountManagementUsesPolicy`, `TestAccountBoundary` |
| Local passwords and sessions: `identity/password.go`, `postgres/accounts.go` | Argon2id, independent salts, length/common-password checks, generic login refusal, account throttling, session hashes and expiry, revocation on logout/password change/suspension. | `TestPasswordVerification`, `TestAccountBoundary`; disposable PostgreSQL session verification |
| Transport and CSRF: `webui/accounts.go`, `api_tasks.go` | Password/account mutations require HTTPS or localhost development, JSON, custom CSRF header and same-origin requests. Forwarded headers require explicit trusted-proxy configuration. | `TestAuthenticationTransport`, existing mutation security tests |
| Personal account routes: `webui/accounts.go` | Active signed-in person; principal supplied by server. Password change verifies current password. Sensitive authenticator changes require recent sign-in. No caller-supplied target identity. | `TestAccountBoundary` |
| Recovery: `postgres/account_security.go`, `webui/accounts.go` | Fresh authenticated owner generates a hashed, one-use recovery secret. Redemption replaces password and revokes all sessions atomically. No email-existence disclosure. | Disposable PostgreSQL recovery verification |
| Passkeys: `postgres/passkeys.go`, `webui/passkeys.go` | Configured RP origin, browser-bound one-use expiring challenge, verified credential signature and user verification. Enrollment/management belong to caller. Credential counters persist under a row lock. | Disposable browser virtual-authenticator verification; task-grant denial tests |
| OIDC: `infrastructure/oidc`, `archieui/account_oidc.go`, `webui/auth.go` | Discovery and signed ID token with issuer/client audience/expiry, PKCE, state and nonce. Verified subject resolves to active identity. Browser-local session cannot outlive provider token, and provider credential remains checked. | `TestBrowserFlowVerifiesIDToken`, `TestProviderOutageIsUnavailableThenRecovers`, subject-claim tests; no external provider acceptance implied |
| OIDC settings: `webui/accounts.go`, `postgres/authentication.go` | Instance ownership plus policy; recent sign-in for changes. The instance refuses a public URL change that would orphan enrolled passkeys. | `TestAccountBoundary`, `TestAuthenticationSettingsRejectUntrustedOrigins` |
| Org membership/workspaces/agent assignment: `webui/api_orgs.go`, `staterpc/orgs.go`, `postgres/orgs.go` | Own org or instance-owner relationship, allowed role vocabulary, membership escalation/last-owner guards, tenant-scoped SQL. | `TestOrgRPCsActInTheCallersOrg`, `TestSetMembershipRefusesUnknownRole`, org HTTP tests |
| Personal API tokens: `webui/api_personal_tokens.go`, `staterpc/personal_tokens.go`, `postgres/personal_tokens.go` | Token owner comes from principal; store only token hash; revoke only caller's binding. | `TestPersonalTokensWithoutPerson`, `TestPersonalTokenOwner` |
| gRPC caller attribution: `rpcidentity/identity.go` | Authenticated service may forward a principal; State Store resolves memberships/org itself. State Store strips task grant metadata. | `TestCallerAttribution` |
| Agent/task gRPC: `staterpc/task_grants.go` | Durable task-scoped grant, explicit allowed RPC and target task, no definition-pin replacement, no account RPCs. | `TestTaskCredentialsCannotManageAccounts`, `TestTaskCredentialCannotReplaceItsPin`, `TestRecordUsageAuthority`, `TestWorkerPresenceAuthority` |
| Chat HTTP: `webui/api_chat.go` | Server stamps sender and person thread; lists/read/turns/cancel/persona verify session ownership. Browser cannot submit another sender identity. | `TestWebChatOwnership`, `TestWebChatSenderCannotBeSuppliedByBrowser`; HTTP deny matrix |
| Chat history, slash commands and model session tools: `gateway/session_store_postgres.go` | Store filters `Get`, `List`, `GetByChannel`; shared read/write guards check person ownership as well as org. A saved session cannot change its conversation source to claim another person's history. Service curation runs without a person principal. | `TestSessionVisibility`; PostgreSQL smoke for history isolation |
| Chat questions/approvals: `webui/api_chat_ask.go` | The UI service binds the waiting question to the initiating person, in addition to its unguessable ID. | `TestChatQuestionBelongsToInitiatingPerson` |
| Chat downloads: `webui/api_chat_files.go` | The UI service binds the offered file token to the initiating person, and the token expires; requests cannot supply a filesystem path. | `TestChatFileDownload` |
| Per-person memory: `archiegateway/chat_identity.go`, gateway memory tools, `sessioncurator` | Verified web sender identity scopes reads/writes. Curator refuses unidentified or mixed participants instead of guessing a person. | Gateway memory and session-curator tests |
| Workflow/task actions: `webui/api_tasks.go`, `domain/taskactions`, `staterpc` | Policy and stored workspace before action; domain transition, authority and durable dispatch guards remain in force. | HTTP deny matrix, task action/domain tests, task grant tests |
| Incoming webhooks: `captureintake`, access delivery engine | Verify HMAC before parsing; derive source/org from stored source; evaluate source delivery policies and egress rules. The capture intake never infers a browser-user credential. | Capture tests, `TestAuthorizeDelivery` |
| Control-plane configuration, secrets and extensions | Browser policy and instance-only restrictions where registered; service contracts carry principal/org; task grants cannot invoke administrative RPCs. | HTTP deny matrix, `TestAdministrationRoutes`, `TestChannelReloadRoute` |
| Location | Enforcement | Regression evidence |
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Browser credential gate: `webui/auth.go`, `accounts.go` | Account session or verified provider identity; shared dashboard token is not a person when accounts are enabled. No API data before authentication. | `TestAccountBoundary`, `TestAccountSessionFailureIsClosed` |
| Browser policy gate: `webui/authorize.go` | Resolve principal from stored identity; evaluate action against stored org/workspace and resource kind before handler. Missing chain refuses. | `TestHTTPPolicyCannotBeBypassed`, `TestAuthorizeRefusesWithoutAChain`, `TestAuthorizeRecord`, `TestTaskAuthorizationUsesStoredAttributes`, `TestAuthorizeCreateIn` |
| Instance-only HTTP surfaces: `webui/instance_only.go`, server route registration | Hide instance-owned configuration and diagnostics from another org; policy still applies first. | `TestInstanceOnlyHidesTheInstanceFromOtherOrgs`, `TestInstanceAdminOrgs` |
| First setup: `webui/accounts.go`, `postgres/accounts.go` | Initial organization, workspace, instance URL, admin identity and password commit together. Transaction lock closes bootstrap after first account; later requests require `manage_members`. | Disposable PostgreSQL smoke verification for bootstrap race and rollback; account policy tests below |
| Account creation: `webui/accounts.go`, `staterpc/accounts.go`, `postgres/accounts.go` | Cedar `manage_members` at HTTP and RPC; target org is authenticated context. New local accounts cannot request owner role. | `TestAccountManagementUsesPolicy`, `TestAccountBoundary` |
| Local passwords and sessions: `identity/password.go`, `postgres/accounts.go` | Argon2id, independent salts, length/common-password checks, generic login refusal, account throttling, session hashes and expiry, revocation on logout/password change/suspension. | `TestPasswordVerification`, `TestAccountBoundary`; disposable PostgreSQL session verification |
| Transport and CSRF: `webui/accounts.go`, `api_tasks.go` | Password/account mutations require HTTPS or localhost development, JSON, custom CSRF header and same-origin requests. Forwarded headers require explicit trusted-proxy configuration. | `TestAuthenticationTransport`, existing mutation security tests |
| Personal account routes: `webui/accounts.go` | Active signed-in person; principal supplied by server. Password change verifies current password. Sensitive authenticator changes require recent sign-in. No caller-supplied target identity. | `TestAccountBoundary` |
| Recovery: `postgres/account_security.go`, `webui/accounts.go` | Fresh authenticated owner generates a hashed, one-use recovery secret. Redemption replaces password and revokes all sessions atomically. No email-existence disclosure. | Disposable PostgreSQL recovery verification |
| Passkeys: `postgres/passkeys.go`, `webui/passkeys.go` | Configured RP origin, browser-bound one-use expiring challenge, verified credential signature and user verification. Enrollment/management belong to caller. Credential counters persist under a row lock. | Disposable browser virtual-authenticator verification; task-grant denial tests |
| OIDC: `infrastructure/oidc`, `archieui/account_oidc.go`, `webui/auth.go` | Discovery and signed ID token with issuer/client audience/expiry, PKCE, state and nonce. Verified subject resolves to active identity. Browser-local session cannot outlive provider token, and provider credential remains checked. | `TestBrowserFlowVerifiesIDToken`, `TestProviderOutageIsUnavailableThenRecovers`, subject-claim tests; no external provider acceptance implied |
| OIDC settings: `webui/accounts.go`, `postgres/authentication.go` | Instance ownership plus policy; recent sign-in for changes. Public URL cannot change while enrolled passkeys would be orphaned. | `TestAccountBoundary`, `TestAuthenticationSettingsRejectUntrustedOrigins` |
| Org membership/workspaces/agent assignment: `webui/api_orgs.go`, `staterpc/orgs.go`, `postgres/orgs.go` | Own org or instance-owner relationship, allowed role vocabulary, membership escalation/last-owner guards, tenant-scoped SQL. | `TestOrgRPCsActInTheCallersOrg`, `TestSetMembershipRefusesUnknownRole`, org HTTP tests |
| Personal API tokens: `webui/api_personal_tokens.go`, `staterpc/personal_tokens.go`, `postgres/personal_tokens.go` | Token owner comes from principal; store only token hash; revoke only caller's binding. | `TestPersonalTokensWithoutPerson`, `TestPersonalTokenOwner` |
| gRPC caller attribution: `rpcidentity/identity.go` | Authenticated service may forward a principal; State Store resolves memberships/org itself. Task grant metadata is stripped. | `TestCallerAttribution` |
| Agent/task gRPC: `staterpc/task_grants.go` | Durable task-scoped grant, explicit allowed RPC and target task, no definition-pin replacement, no account RPCs. | `TestTaskCredentialsCannotManageAccounts`, `TestTaskCredentialCannotReplaceItsPin`, `TestRecordUsageAuthority`, `TestWorkerPresenceAuthority` |
| Chat HTTP: `webui/api_chat.go` | Server stamps sender and person thread; lists/read/turns/cancel/persona verify session ownership. Browser cannot submit another sender identity. | `TestWebChatOwnership`, `TestWebChatSenderCannotBeSuppliedByBrowser`; HTTP deny matrix |
| Chat history, slash commands and model session tools: `gateway/session_store_postgres.go` | Store filters `Get`, `List`, `GetByChannel`; shared read/write guards check person ownership as well as org. A saved session cannot change its conversation source to claim another person's history. Service curation runs without a person principal. | `TestSessionVisibility`; PostgreSQL smoke for history isolation |
| Chat questions/approvals: `webui/api_chat_ask.go` | Waiting question is bound to the initiating person, in addition to its unguessable ID. | `TestChatQuestionBelongsToInitiatingPerson` |
| Chat downloads: `webui/api_chat_files.go` | Offered file token expires and is bound to the initiating person; requests cannot supply a filesystem path. | `TestChatFileDownload` |
| Per-person memory: `archiegateway/chat_identity.go`, gateway memory tools, `sessioncurator` | Verified web sender identity scopes reads/writes. Curator refuses unidentified or mixed participants instead of guessing a person. | Gateway memory and session-curator tests |
| Workflow/task actions: `webui/api_tasks.go`, `domain/taskactions`, `staterpc` | Policy and stored workspace before action; domain transition, authority and durable dispatch guards remain in force. | HTTP deny matrix, task action/domain tests, task grant tests |
| Incoming webhooks: `captureintake`, access delivery engine | Verify HMAC before parsing; derive source/org from stored source; evaluate source delivery policies and egress rules. No browser-user credential is inferred. | Capture tests, `TestAuthorizeDelivery` |
| Control-plane configuration, secrets, harness and extensions | Browser policy and instance-only restrictions where registered; service contracts carry principal/org; task grants cannot invoke administrative RPCs. | HTTP deny matrix, `TestAdministrationRoutes`, `TestChannelReloadRoute`, `TestConfineHarnessOrg` |
| Audit feed: `webui/api_audit.go`, `domain/audit` | `read_audit` on the `audit` resource; org scope and the instance-wide exception come from the authenticated principal, never the query string. Export carries the same grant, needs an explicit range of at most a year, and is rate-limited per identity, one at a time. Redaction runs in the State Store adapter before an entry crosses gRPC. | `TestReadAuditRoleBoundary`, `TestAuditRoutesFollowTheReadAuditRole`, `TestHTTPPolicyCannotBeBypassed`, `TestAuditErrorMapping`, `TestAuditCSVCellNeutralisesFormulas` |
| Live HTTP/SSE and diagnostics | Authenticated policy gate applies before stream creation; org-scoped event reads; instance logs require administrative visibility. | HTTP deny matrix, instance-only tests, `TestServiceLogsRequireInstanceCredential` |
| Background schedules, dispatch, curation | Service/agent authority, not an implicit browser user. Task-scoped grants and org scopes remain distinct from initiating operator attribution. | Existing dispatch, grant, memory and org-scope tests |
| Live HTTP/SSE and diagnostics | Authenticated policy gate applies before stream creation; org-scoped event reads; instance logs require administrative visibility. | HTTP deny matrix, instance-only tests, `TestServiceLogsRequireInstanceCredential` |
| Background schedules, dispatch, curation | Service/agent authority, not an implicit browser user. Task-scoped grants and org scopes remain distinct from initiating operator attribution. | Existing dispatch, grant, memory and org-scope tests |
The policy HTTP matrix enumerates each registered protected route. It checks
both anonymous refusal and refusal by an explicit Cedar forbid, using the real
handler stack. Separate tests exercise allowed requests and personal ownership.
A denied-request matrix alone is not proof that a workflow works end to end.
handler stack. Separate tests exercise allowed requests and personal ownership;
a denied-request matrix alone is not proof that a workflow works end to end.
## Public and personal routes
Public protocol entry points are `GET /api/auth/status`, `POST /api/auth/setup`,
`POST /api/auth/login`, `POST /api/auth/logout`, `POST /api/auth/recover`,
`POST /api/auth/passkey/begin` and `POST /api/auth/passkey/finish`. The
remaining entry points are `GET /oauth2/login`, `GET /oauth2/callback`, health
probes and signed webhook intake. Each has its own protocol checks. Static
embedded app assets are public. They do not contain user data.
`/health/detailed` remains protected.
`POST /api/auth/passkey/begin`, `POST /api/auth/passkey/finish`,
`GET /oauth2/login`, `GET /oauth2/callback`, health probes and signed webhook
intake. Each has its own protocol checks. Static embedded app assets are public;
they do not contain user data. `/health/detailed` remains protected.
Personal routes under `/api/account/` require an active signed-in person and
server-derived ownership. They cover password change, recovery-secret
generation, and passkey begin/finish/list/delete. They do not require an
organisation administrator role. `POST /api/accounts` and `/api/authentication`
are administrative policy routes.
server-derived ownership: password change, recovery-secret generation, passkey
begin/finish/list/delete. They do not require an organization administrator
role. `POST /api/accounts` and `/api/authentication` are administrative policy
routes.
## HTTP route inventory
The test `TestHTTPPolicyCannotBeBypassed` covers the following routes. It lives
in `internal/webui/authorization_surfaces_test.go`. `authorize.go` maps each to
its action/resource. The handler may impose a stricter record or instance
boundary.
The following routes are covered by `TestHTTPPolicyCannotBeBypassed` in
`internal/webui/authorization_surfaces_test.go`. `authorize.go` maps each to its
action/resource; the handler may impose a stricter record or instance boundary.
| Method | Route example |
| ------ | ----------------------------------------------------- |
@@ -148,6 +146,8 @@ boundary.
| GET | `/api/event-types` |
| GET | `/api/extensions` |
| GET | `/api/extensions/catalogue` |
| GET | `/api/harness/bindings` |
| GET | `/api/harness/terminal` |
| GET | `/api/identities` |
| GET | `/api/logs` |
| GET | `/api/mappings` |
@@ -228,23 +228,21 @@ boundary.
## Verification limits
A synthetic browser authenticator checks protocol behaviour. It does not test a
physical security key or every operating system. An OIDC unit test is not
acceptance against a deployed provider. Disposable PostgreSQL smoke checks
verify real SQL. They keep database tests out of the fast unit suite.
A synthetic browser authenticator verifies protocol behavior, not a physical
security key or every operating system. An OIDC unit test is not acceptance
against a deployed provider. Disposable PostgreSQL smoke checks verify real SQL
without putting database-dependent tests in the fast unit suite.
The Gateway retains existing anonymous conversations but does not silently
assign them to a new person. Existing service credentials remain privileged.
This inventory does not claim that all internal gRPC methods have independent
Cedar gates.
Existing anonymous conversations are retained but are not silently assigned to a
new person. Existing service credentials remain privileged; this inventory does
not claim that all internal gRPC methods have independent Cedar gates.
When changing a user-facing operation, update its inventory entry and its
allow/deny behaviour cases. Include another user in the same organisation, a
caller in another organisation, a missing principal, unavailable policy storage,
allow/deny behavior cases. Include another user in the same organization, a
caller in another organization, a missing principal, unavailable policy storage,
and the applicable owner/workspace/instance restrictions.
Bootstrap runs without authentication until the operator creates the first
administrator account. Complete setup before exposing a new installation to
untrusted users. A separate issue, `archie-core-d7avc`, tracks
last-active-owner protection for identity suspension/retirement.
Membership-policy guards are not that lifecycle guard.
Bootstrap is unauthenticated until the first administrator is created. Complete
setup before exposing a new installation to untrusted users. Last-active-owner
protection for identity suspension/retirement is tracked separately as
`archie-core-d7avc`; membership-policy guards are not that lifecycle guard.
+2
View File
@@ -0,0 +1,2 @@
node_modules/
out/
+115
View File
@@ -0,0 +1,115 @@
# e2e
Validation of the whole stack, run by hand or by an agent, never by
`task check` or CI. It needs PostgreSQL 18, five services, Vite and a browser,
which the gate must not. Docker is not needed: without it tasks queue and
park, which is useful data for the dashboard.
| File | What it does |
| --- | --- |
| `stack.sh` | Starts PostgreSQL 18 (port 55432) and the five services as local processes, then Vite on 5173 |
| `seed.sh` | Seeds the stack through the dashboard API; safe to rerun |
| `run.cjs` | Runs `checks/*.cjs` in Chromium; screenshots, manifest and `report.html` to `out/<stamp>/` |
| `checks/` | One module per behaviour |
| `results/` | One committed report per release |
## Run
```bash
task e2e:up # build, start everything, seed
task e2e:check # list available checks (no stack needed)
task e2e:check -- list # explicitly list checks
task e2e:check -- audit-redirect # one check
task e2e:check -- all # all checks
task e2e:check -- --headed accessibility # watch a check in Chromium
task e2e:check -- --headed all # watch every check
task e2e:down # stop; e2e/stack.sh reset also deletes the data
```
Headless is the default. `--headed` opens visible Chromium and slows browser
actions to 150ms so you can follow them; assertions and saved evidence are the
same in both modes. The terminal prints each check before it starts. Headed mode
requires a graphical desktop.
Nothing reads the installed config: `stack.sh` points the XDG directories at
`${ARCHIE_DEV_DIR:-~/.local/state/archie-dev}` and writes its overlay from
`deployments/dev.toml`. Logs are in its `logs/`. `e2e/stack.sh restart archied`
restarts one service. Run `task e2e:down` before starting again: startup refuses
occupied service ports and checks that each launched process stays alive.
The seed creates a local test administrator: `operator@example.test`, password
`archie-local-e2e-password`. Use it at `http://localhost:5173`; the browser
checks sign in with the same account. These are test fixtures for this
loopback-only stack. To use an existing test account, set `ARCHIE_E2E_EMAIL`
and `ARCHIE_E2E_PASSWORD` for both seeding and browser checks. Seeding never
resets an existing account or deletes test data.
The first run needs `pnpm install --dir e2e` and `pnpm --dir e2e exec playwright
install chromium`. In the cloud environment, Chromium and Playwright are
preinstalled; run with `NODE_PATH=$(pnpm root -g)`.
## Release evidence
```bash
node e2e/run.cjs --record v1.54.0 all
```
writes `results/v1.54.0.md`, the pass, fail or skip of every check for
that release. Commit it with the release. Screenshots stay in `out/`.
## Writing a check
A module in `checks/` exports `async ({ page, go, shot, fail, skip, settled, attach, tolerate })`.
- `go(path)` loads a dashboard route: `waitUntil: 'load'` plus 1200ms.
Wait for elements, never for `networkidle`: the event stream never goes idle.
- `shot(label)` saves `<check>-<kebab>[-<w>x<h>].png` after a short settle,
and records `{file, w, h, check}` in the manifest. The label is slugified,
so `shot('/')` becomes `routes-home.png`; a viewport other than the
1440x900 default adds a suffix (`-390x844`). Repeated labels get `-2`,
`-3`, so every capture is kept.
- `fail(msg)` records a problem without stopping.
- `skip(reason)` stops the check and records a skip: a missing
precondition, never a failure.
- `tolerate(re)` ignores console errors matching `re`, for a response the page is designed to survive.
- `attach(name, data)` saves a non-image artifact as `<check>-<name>`.
- `settled(sel?)` waits for a selector or URL, then settles briefly.
It is the harness-owned wait; checks need no capture wrapper or
ad-hoc sleeps around screenshots.
Each check gets a fresh page at 1440x900 with the login `storageState`;
a check that needs a phone viewport resizes it itself to 390x844.
Those are the only two viewports in use. A throw, a `fail`, or any
console or page error fails the check. One module covers one behaviour;
families share a prefix: `audit-*` for the audit page (redirect,
filters, revert, runtime, views-export, retention-live, phone),
`workflow-*` for the canvas (loading, validation, phone-layout, logic),
`chat-composer` for chat input.
`routes` loads every static route and flags text with stray leading,
trailing or doubled spaces. `seeded` checks the seed is visible.
`/logs` is visited but skipped by the whitespace lint: log lines are
data, not copy.
## Output
Every run writes `out/<stamp>/` with the screenshots,
`results.json` (the manifest: `{check, ok, ms, problems, artifacts[]}`,
plus `skipped`/`skipReason` for skips) and `report.html`: a self-contained
test record with the commit, totals and one row per check (status, time,
message and that check's artifacts, screenshots inline). `attach(name, data)`
adds a non-image artifact to the current check; a failed check also gets a
`failure` screenshot.
Exits: 0 when every check passes or skips, 1 when any check fails,
2 when the harness itself errors. `ARCHIE_E2E_URL` points the run at
a dashboard other than `http://localhost:5173`.
## Pitfalls
| Symptom | Cause | Fix |
| --- | --- | --- |
| State Store exits: server is older than PostgreSQL 18 | another server answered | `stack.sh` uses port 55432; set `ARCHIE_DEV_PGPORT` if that is taken |
| Startup says a port is in use | a stack or another process already owns it | Run `task e2e:down`, then `task e2e:up`; inspect any remaining listener with `ss -ltnp` |
| Your own shell is killed (exit 144) | `pkill -f` matched its own command line | `stack.sh stop` or `restart`, which kill by PID |
| Postgres aborts in the cloud | `/tmp/claude-0` is reset to mode 700 | `stack.sh` keeps the root cluster in `/var/lib/archie-dev` |
+176
View File
@@ -0,0 +1,176 @@
// Keyboard and phone access: the task dialog fits and tabs in order, pages
// title correctly, the skip link and palette focus main content, and
// query-only tab switches keep focus where it is. Then the audit's two
// static sweeps (#1767): no unnamed controls on any route, and every keyboard
// focus stop's indicator clears 3:1 against the background behind it.
const assert = require('node:assert/strict');
const { staticRoutes } = require('./helpers/routes.cjs');
module.exports = async ({ page, go, shot, fail, settled, tolerate }) => {
// The extension catalogue 502 is a stack-environment issue, not this check.
tolerate(/extensions\/catalogue/);
await page.setViewportSize({ width: 390, height: 844 });
await go('/tasks');
await page.getByRole('button', { name: 'Jump to', exact: true }).click();
await page.getByRole('option', { name: 'New task', exact: true }).click();
const dialog = page.getByRole('dialog');
await dialog.waitFor();
await settled();
const bounds = await dialog.boundingBox();
assert.ok(bounds.y >= 0 && bounds.y + bounds.height <= 844, 'New task dialog extends outside viewport');
await shot('phone-task-dialog-top');
const start = dialog.getByRole('button', { name: 'Start task', exact: true });
await start.scrollIntoViewIfNeeded();
const button = await start.boundingBox();
assert.ok(button.y >= 0 && button.y + button.height <= 844, 'Start task cannot be reached by scrolling');
await shot('phone-task-dialog');
const close = dialog.getByRole('button', { name: 'Close', exact: true });
await dialog.getByRole('button', { name: 'Cancel', exact: true }).focus();
await page.keyboard.press('Tab');
assert.ok(await close.evaluate(el => el === document.activeElement), 'Close is missing from keyboard tab order');
const closeBounds = await close.boundingBox();
assert.ok(closeBounds.y >= 0 && closeBounds.y + closeBounds.height <= 844, 'Close cannot be reached by keyboard');
await page.keyboard.press('Escape');
for (const [path, title] of [['/tasks', 'Tasks'], ['/events', 'Events'], ['/account', 'Your account'], ['/settings/models', 'Models | Instance'], ['/org/models', 'Models | Organisation']]) {
await go(path);
assert.equal(await page.title(), `${title} | Archie`);
}
await page.keyboard.press('Tab');
const skip = page.getByRole('link', { name: 'Skip to main content', exact: true });
assert.ok(await skip.evaluate(el => el === document.activeElement), 'Skip link is not the first keyboard stop');
await page.keyboard.press('Enter');
assert.equal(await page.evaluate(() => document.activeElement?.id), 'main-content');
await page.getByRole('button', { name: 'Toggle Sidebar', exact: true }).click();
await page.getByRole('navigation', { name: 'Sections', exact: true }).getByRole('link', { name: 'Tasks', exact: true }).click();
await page.waitForFunction(() => document.activeElement?.id === 'main-content', null, { timeout: 5000 }).catch(() => {});
assert.equal(await page.evaluate(() => document.activeElement?.id), 'main-content', 'route navigation did not focus main');
await page.getByRole('button', { name: 'Jump to', exact: true }).click();
await page.getByRole('option', { name: 'Events', exact: true }).click();
await page.waitForFunction(() => document.activeElement?.id === 'main-content', null, { timeout: 5000 }).catch(() => {});
assert.equal(await page.evaluate(() => document.activeElement?.id), 'main-content', 'palette navigation did not focus main');
// The conversation panel is only open on some entries to this page; the
// focus check below needs it closed either way.
const hide = page.getByRole('button', { name: 'Hide conversation', exact: true });
if (await hide.count()) await hide.click();
const tab = page.getByRole('tab', { name: /^Map/ });
await tab.click();
assert.ok(await tab.evaluate(el => el === document.activeElement), 'query-only navigation stole focus');
await page.setViewportSize({ width: 1440, height: 900 });
// Unnamed controls: every visible input, textarea, select, button or
// widget role on each static route needs an accessible name (accname
// order: labelledby, label, content, value, placeholder, title).
for (const r of staticRoutes()) {
await go(r);
const unnamed = await page.evaluate(() => {
const name = (el) => {
const by = el.getAttribute('aria-labelledby');
if (by) {
const t = by.split(/\s+/).map((id) => (document.getElementById(id)?.textContent || '')).join(' ').trim();
if (t) return t;
}
const al = el.getAttribute('aria-label');
if (al && al.trim()) return al.trim();
if (el.id) {
const l = document.querySelector(`label[for="${CSS.escape(el.id)}"]`);
if (l && l.textContent.trim()) return l.textContent.trim();
}
const wrap = el.closest('label');
if (wrap && wrap.textContent.trim()) return wrap.textContent.trim();
if (el.tagName === 'BUTTON' || el.getAttribute('role') === 'button' || el.getAttribute('role') === 'tab' || el.getAttribute('role') === 'switch') return el.textContent.trim();
if (el.tagName === 'INPUT') {
const t = (el.getAttribute('type') || 'text').toLowerCase();
if (t === 'submit' || t === 'button' || t === 'reset') return el.value.trim();
if (t === 'image') return (el.getAttribute('alt') || '').trim();
}
return (el.getAttribute('placeholder') || el.getAttribute('title') || '').trim();
};
return [...document.querySelectorAll('button, input, textarea, select, [role="button"], [role="tab"], [role="switch"], [role="checkbox"]')]
.filter((el) => el.type !== 'hidden' && el.getClientRects().length)
.filter((el) => !name(el))
.map((el) => `${el.tagName.toLowerCase()}${el.id ? '#' + el.id : ''}: ${el.outerHTML.slice(0, 120)}`);
});
for (const u of unnamed) fail(`unnamed control on ${r}: ${u}`);
}
// Focus contrast: Tab through each static route; the focused element's
// outline or ring must clear 3:1 against the effective background behind it.
const focusProbe = () => page.evaluate(() => {
const el = document.activeElement;
if (!el || el === document.body || el === document.documentElement) return null;
const cs = getComputedStyle(el);
const parse = (c) => {
c = String(c).trim();
let m = c.match(/rgba?\(([^)]+)\)/);
if (m) {
const p = m[1].split(',').map(Number);
return { r: p[0], g: p[1], b: p[2], a: p.length > 3 ? p[3] : 1 };
}
m = c.match(/^#([0-9a-f]{3,8})$/i);
if (m) {
let h = m[1];
if (h.length === 3 || h.length === 4) h = [...h].map((x) => x + x).join('');
const n = parseInt(h.slice(0, 6), 16);
return { r: (n >> 16) & 255, g: (n >> 8) & 255, b: n & 255, a: h.length === 8 ? parseInt(h.slice(6, 8), 16) / 255 : 1 };
}
return null;
};
const bgBehind = (start) => {
for (let n = start; n; n = n.parentElement) {
const c = parse(getComputedStyle(n).backgroundColor);
if (c && c.a > 0) return c;
}
return { r: 255, g: 255, b: 255, a: 1 };
};
// An outer ring or outline is painted over the parent's background; an
// inset one over the element's own. Score against whichever is higher.
const bgSelf = bgBehind(el);
const bgParent = bgBehind(el.parentElement);
const over = (fg, bg) => {
const a = fg.a + bg.a * (1 - fg.a);
if (a === 0) return { r: 0, g: 0, b: 0 };
return { r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / a, g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / a, b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / a };
};
const lum = (c) => {
const f = (v) => { v /= 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); };
return 0.2126 * f(c.r) + 0.7152 * f(c.g) + 0.0722 * f(c.b);
};
const ratio = (c1, c2) => {
const l1 = lum(c1), l2 = lum(c2);
return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
};
let fg = null;
// The ring lives in --tw-ring-shadow on :focus-visible; read the var
// directly, then fall back to outline, any shadow layer, focus border.
if (el.matches(':focus-visible')) {
const m = cs.getPropertyValue('--tw-ring-shadow').match(/rgba?\([^)]+\)|#[0-9a-f]{3,8}\b/i);
if (m) { const c = parse(m[0]); if (c && c.a > 0) fg = c; }
}
if (!fg && cs.outlineStyle !== 'none' && parseFloat(cs.outlineWidth) > 0) fg = parse(cs.outlineColor === 'currentcolor' ? cs.color : cs.outlineColor);
if (!fg && cs.boxShadow && cs.boxShadow !== 'none') {
for (const m of cs.boxShadow.matchAll(/rgba?\([^)]+\)|#[0-9a-f]{3,8}\b/gi)) {
const c = parse(m[0]);
if (c && c.a > 0) { fg = c; break; }
}
}
if (!fg && el.matches(':focus-visible') && parseFloat(cs.borderTopWidth) > 0) {
const c = parse(cs.borderTopColor);
if (c && c.a > 0) fg = c;
}
const sig = `${el.tagName}#${el.id}:${(el.textContent || '').trim().slice(0, 30)}`;
if (!fg) return { sig, ratio: 0 };
return { sig, ratio: Math.max(ratio(over(fg, bgSelf), bgSelf), ratio(over(fg, bgParent), bgParent)) };
});
for (const r of staticRoutes()) {
await go(r);
let prev = '';
for (let i = 0; i < 40; i++) {
await page.keyboard.press('Tab');
const info = await focusProbe();
if (!info || info.sig === prev) break;
prev = info.sig;
if (info.ratio < 3) fail(`focus indicator under 3:1 on ${r} at ${info.sig} (ratio ${info.ratio.toFixed(2)})`);
}
}
};
+113
View File
@@ -0,0 +1,113 @@
// Audit filters are server-evaluated through the URL contract: search,
// category, time range, back/forward restore, denied, and the actor filter.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail }) => {
const { requestMatching, waitForUrl } = trackAudit(page);
await go('/org/audit');
const status = await page.evaluate(async () => (await fetch('/api/auth/status')).json());
const actor = status?.user?.id;
assert.ok(actor, 'signed-in identity has no id');
const search = page.getByLabel('Search events', { exact: true });
let request = await requestMatching(
() => search.fill('repository'),
(u) => u.searchParams.get('q') === 'repository',
);
assert.ok(request, 'search issued no matching /api/audit request');
await waitForUrl((u) => u.searchParams.get('q') === 'repository');
assert.equal((await search.inputValue()), 'repository');
await go('/org/audit');
request = await requestMatching(
() => page.getByRole('button', { name: 'Runtime', exact: true }).click(),
(u) => u.searchParams.get('categories') === 'runtime',
);
assert.ok(request, 'category filter issued no matching /api/audit request');
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
assert.equal(
await page.getByRole('button', { name: 'Runtime', exact: true }).getAttribute('aria-pressed'),
'true',
);
// Time: Any time drops the window from the request rather than guessing one.
await page.getByRole('combobox', { name: 'Time range', exact: true }).click();
request = await requestMatching(
() => page.getByRole('option', { name: 'Any time', exact: true }).click(),
(u) => u.searchParams.get('from') === null && u.searchParams.get('categories') === 'runtime',
);
assert.ok(request, 'Any time issued no matching /api/audit request');
await waitForUrl((u) => u.searchParams.get('since') === 'any');
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Any time');
// Back/forward restore the controls the URL describes.
const backRequest = page.waitForRequest(
(r) => {
const u = new URL(r.url());
return u.pathname === '/api/audit' && u.searchParams.get('categories') === 'runtime' && !!u.searchParams.get('from');
},
{ timeout: 8000 },
);
await page.goBack();
await backRequest;
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime' && u.searchParams.get('since') === null);
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Last 30 days');
assert.equal(
await page.getByRole('button', { name: 'Runtime', exact: true }).getAttribute('aria-pressed'),
'true',
'back did not restore the category toggle',
);
const forwardRequest = page.waitForRequest(
(r) => {
const u = new URL(r.url());
return u.pathname === '/api/audit' && u.searchParams.get('categories') === 'runtime' && u.searchParams.get('from') === null;
},
{ timeout: 8000 },
);
await page.goForward();
await forwardRequest;
await waitForUrl((u) => u.searchParams.get('since') === 'any');
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Any time');
// Denied reaches the server through the same URL contract as the other
// filters. It must both update the URL and issue a request.
await go('/org/audit');
const denied = page.getByRole('button', { name: 'Denied', exact: true });
request = await requestMatching(
() => denied.click(),
(u) => u.searchParams.get('outcome') === 'denied',
3000,
);
const deniedUrl = new URL(page.url());
if (!request || deniedUrl.searchParams.get('outcome') !== 'denied') {
await shot('denied');
fail(
`Denied filter did not reach the server: URL ${page.url()} has outcome=${deniedUrl.searchParams.get('outcome') ?? 'absent'}, ` +
`aria-pressed=${await denied.getAttribute('aria-pressed')}, no /api/audit request with outcome=denied`,
);
} else {
assert.equal(await denied.getAttribute('aria-pressed'), 'true');
}
// Advanced actor filter: server-evaluated, in the URL, shown as a chip.
await go('/org/audit');
await page.getByRole('button', { name: 'Filters', exact: true }).click();
const actorInput = page.getByLabel('Actor', { exact: true });
request = await requestMatching(
async () => {
await actorInput.fill(actor);
await actorInput.press('Enter');
},
(u) => u.searchParams.get('actor') === actor,
);
assert.ok(request, 'advanced actor filter issued no matching /api/audit request');
await waitForUrl((u) => u.searchParams.get('actor') === actor);
assert.match(
await page.locator('ul[aria-label="Active filters"] li', { hasText: 'Actor:' }).first().innerText(),
new RegExp(actor),
);
await shot('filters');
await page.keyboard.press('Escape');
};
+42
View File
@@ -0,0 +1,42 @@
// The audit page at phone width: secondary columns collapse, and the list,
// an expanded row and the filters dialog fit without horizontal overflow.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail, settled }) => {
trackAudit(page);
await page.setViewportSize({ width: 390, height: 844 });
await go('/org/audit');
const assertNoOverflow = async (label) => {
const { scrollWidth, innerWidth } = await page.evaluate(() => ({
scrollWidth: document.documentElement.scrollWidth,
innerWidth,
}));
if (scrollWidth > innerWidth) {
fail(`${label} overflows 390px: documentElement.scrollWidth=${scrollWidth} > innerWidth=${innerWidth}`);
}
};
await page.locator('[data-row-key]').first().waitFor();
await assertNoOverflow('audit list');
assert.equal(
await page.locator('thead th', { hasText: 'Target' }).first().evaluate((el) => getComputedStyle(el).display),
'none',
'secondary columns are still rendered on the phone',
);
await shot('list');
const phoneRow = page.locator('[data-row-key]').first();
await phoneRow.focus();
await page.keyboard.press('Enter');
await settled();
assert.equal(await phoneRow.getAttribute('aria-expanded'), 'true', 'phone row did not expand');
await assertNoOverflow('expanded change set');
await shot('expanded');
await page.getByRole('button', { name: 'Filters', exact: true }).click();
await page.getByRole('dialog').first().waitFor();
await settled();
await assertNoOverflow('advanced filters');
await shot('filters');
};
+50
View File
@@ -0,0 +1,50 @@
// A deep link to the old history route redirects to the audit page keeping
// section, actor, since and the hash, and the feed loads with filter chips.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail }) => {
const { lastRequest } = trackAudit(page);
await go('/org/audit');
const status = await page.evaluate(async () => (await fetch('/api/auth/status')).json());
const actor = status?.user?.id;
assert.ok(actor, 'signed-in identity has no id');
const deepLink = `/settings/history?section=container-runtime-policies&actor=${encodeURIComponent(actor)}&since=30d#deep`;
await go(deepLink);
assert.match(page.url(), /\/org\/audit\?/, 'history did not redirect to the audit route');
assert.match(page.url(), /section=container-runtime-policies/, 'redirect dropped section');
assert.match(page.url(), new RegExp(`actor=${encodeURIComponent(actor)}`), 'redirect dropped actor');
assert.match(page.url(), /since=30d/, 'redirect dropped since');
assert.match(page.url(), /#deep$/, 'redirect dropped the hash');
const redirected = lastRequest();
assert.ok(redirected, 'the redirect issued no /api/audit request');
assert.equal(redirected.searchParams.get('kind'), 'container-runtime-policies');
assert.equal(redirected.searchParams.get('actor'), actor);
// The feed must be readable before anything below can mean anything. A 500
// here is the whole page: say what the server answered instead of timing out.
const probe = await page.evaluate(async () => {
const response = await fetch('/api/audit?limit=1');
return { status: response.status, body: await response.text() };
});
if (probe.status !== 200) {
await shot('unavailable');
fail(`GET /api/audit returned ${probe.status}: ${probe.body.slice(0, 200)}`);
return;
}
const kindChip = page.locator('ul[aria-label="Active filters"] li', { hasText: 'Kind:' });
await kindChip.first().waitFor({ timeout: 8000 });
assert.match(await kindChip.first().innerText(), /Container runtime policies/, 'kind chip missing its catalog title');
assert.match(
await page.locator('ul[aria-label="Active filters"] li', { hasText: 'Actor:' }).first().innerText(),
new RegExp(actor),
'actor chip missing',
);
await shot('redirect');
await go('/org/audit');
await page.locator('[data-row-key]').first().waitFor();
await shot('desktop');
};
+148
View File
@@ -0,0 +1,148 @@
// Audit retention reads the stored resource, the live tail prepends new rows
// without a reload and holds them behind a button while scrolled away, and a
// retention save persists. The save stays last: it must not stop the rest.
const assert = require('node:assert/strict');
const { trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail, settled }) => {
const { loadCount } = trackAudit(page);
await go('/org/audit');
const resourceResponse = await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`);
assert.equal(resourceResponse.status(), 200, 'audit-retention resource is unreadable');
const retentionResource = await resourceResponse.json();
const retentionHours = (value) => {
const match = String(value || '').match(/^(\d+)h$/);
return match ? Number(match[1]) : 0;
};
const originalHours = retentionHours(retentionResource.resource.value.runtime_event_retention);
const openRetention = async () => {
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
await page.getByRole('menuitem', { name: 'Retention', exact: true }).click();
const dialog = page.getByRole('dialog');
await dialog.waitFor();
await dialog.getByLabel('Runtime event retention (hours)', { exact: true }).waitFor();
return dialog;
};
let retentionDialog = await openRetention();
assert.match(await retentionDialog.innerText(), /Audit retention/);
assert.equal(
await retentionDialog.getByLabel('Runtime event retention (hours)', { exact: true }).inputValue(),
String(originalHours),
'retention dialog did not read the stored resource',
);
await retentionDialog.getByRole('button', { name: 'Cancel', exact: true }).click();
await retentionDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
assert.ok(!(await retentionDialog.isVisible().catch(() => false)), 'Cancel left the retention dialog open');
// ---- live tail -----------------------------------------------------------
await go('/org/audit');
await page.evaluate(() => window.scrollTo(0, 0));
await settled();
const topKey = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
const loadsBeforeWrite = loadCount();
let resource = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
const toggleRetention = async () => {
const current = retentionHours(resource.resource.value.runtime_event_retention);
const next = current === 2160 ? 2161 : 2160;
const written = await page.request.post(
`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention/commands/replace`,
{
headers: { 'X-Archie-CSRF': '1', Origin: new URL(page.url()).origin },
data: { value: { runtime_event_retention: `${next}h` }, expected_version: resource.resource.version },
},
);
const body = await written.text();
assert.equal(written.status(), 200, `retention write answered ${written.status()}: ${body.slice(0, 200)}`);
resource = JSON.parse(body);
};
await toggleRetention();
let liveKey = null;
for (let attempt = 0; attempt < 40; attempt += 1) {
const key = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
if (key !== topKey) {
liveKey = key;
break;
}
await page.waitForTimeout(300);
}
if (!liveKey) {
fail('live tail did not show a new row within 12s of a write');
await shot('live');
} else {
assert.equal(loadCount(), loadsBeforeWrite, 'the live row required a page reload');
assert.match(
await page.locator(`[data-row-key="${liveKey}"]`).innerText(),
/audit-retention/i,
'the live row is not the write that caused it',
);
await shot('live');
}
// Scrolled away, a new event is held behind a button instead of jumping the
// list under the operator.
await page.evaluate(() => window.scrollTo(0, 900));
await settled();
const scrolledTo = await page.evaluate(() => window.scrollY);
assert.ok(scrolledTo > 80, 'the feed is too short to test held new events');
const heldTop = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
await toggleRetention();
const heldButton = page.getByRole('button', { name: /^\d+ new events?$/ }).first();
let held = false;
for (let attempt = 0; attempt < 40; attempt += 1) {
if ((await heldButton.count()) && (await heldButton.isVisible().catch(() => false))) {
held = true;
break;
}
await page.waitForTimeout(300);
}
if (!held) {
fail('held new events did not appear while scrolled away');
await shot('held');
} else {
assert.equal(
await page.locator('[data-row-key]').first().getAttribute('data-row-key'),
heldTop,
'a new row was prepended while the operator was scrolled away',
);
await shot('held');
await heldButton.click();
await page.waitForFunction(
(top) => document.querySelector('[data-row-key]')?.getAttribute('data-row-key') !== top,
heldTop,
{ timeout: 8000 },
).catch(() => {});
await settled();
assert.notEqual(
await page.locator('[data-row-key]').first().getAttribute('data-row-key'),
heldTop,
'showing held events did not prepend the new row',
);
assert.ok((await page.evaluate(() => window.scrollY)) < 10, 'showing held events did not return to the top');
}
// ---- retention: save -----------------------------------------------------
// Kept last: the page error this currently raises must not stop the rest.
await go('/org/audit');
retentionDialog = await openRetention();
const hoursField = retentionDialog.getByLabel('Runtime event retention (hours)', { exact: true });
const beforeSave = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
const beforeHours = retentionHours(beforeSave.resource.value.runtime_event_retention);
const wanted = beforeHours === 2160 ? 2161 : 2160;
await hoursField.fill(String(wanted));
await retentionDialog.getByRole('button', { name: 'Save', exact: true }).click();
await retentionDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
const stillOpen = await retentionDialog.isVisible().catch(() => false);
const afterSave = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
const afterHours = retentionHours(afterSave.resource.value.runtime_event_retention);
if (stillOpen || afterHours !== wanted) {
await shot('retention-save');
fail(
`retention save did not complete: dialog ${stillOpen ? 'stayed open' : 'closed'}, ` +
`stored retention is ${afterHours}h (wanted ${wanted}h), URL ${page.url()}`,
);
}
};
+69
View File
@@ -0,0 +1,69 @@
// A revertable change set expands to its Before/After diff, offers one Revert
// action whose dialog cancels cleanly, and toggles from the keyboard.
const assert = require('node:assert/strict');
const { DEFAULT_WINDOW_MS, trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail, settled }) => {
trackAudit(page);
await go('/org/audit');
await page.locator('[data-row-key]').first().waitFor();
const from = new Date(Date.now() - DEFAULT_WINDOW_MS).toISOString();
// The feed page size is 100: only rows in this response are rendered.
const feed = await page.evaluate(
async (iso) => (await fetch(`/api/audit?limit=100&from=${encodeURIComponent(iso)}`)).json(),
from,
);
const records = feed.records || [];
assert.ok(records.length, 'the seeded feed is empty');
const changeSet = records.find(
(row) =>
row.target?.kind === 'resource' &&
(row.detail?.fields || []).length > 0 &&
(row.detail?.version ?? 0) > 1,
);
if (!changeSet) {
fail('no revertable settings change set in the feed; cannot exercise the diff or Revert');
return;
}
const row = page.locator(`[data-row-key="${changeSet.id}"]`);
await row.waitFor();
await row.scrollIntoViewIfNeeded();
await row.locator('td').first().click();
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'click did not expand the change set');
const detail = row.locator('xpath=following-sibling::tr[1]');
await detail.getByText('Before:', { exact: false }).first().waitFor();
assert.match(await detail.innerText(), /After:/, 'expanded change set has no after value');
assert.equal(
await detail.getByRole('button', { name: /^Revert \S/ }).count(),
0,
'the audit diff offers a per-field revert',
);
const revertAll = page.getByRole('button', { name: 'Revert', exact: true });
assert.ok((await revertAll.count()) > 0, 'no Revert action on a revertable change set');
await shot('change-set');
await revertAll.first().click();
const dialog = page.getByRole('alertdialog');
await dialog.waitFor();
assert.match(await dialog.innerText(), /Revert this change\?/);
assert.match(await dialog.innerText(), /previous version opens for review/i);
await dialog.getByRole('button', { name: 'Cancel', exact: true }).click();
await dialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
assert.ok(!(await dialog.isVisible().catch(() => false)), 'Cancel left the revert dialog open');
assert.equal(
await page.getByRole('region', { name: 'Unsaved changes' }).count(),
0,
'Cancel touched the save bar',
);
// Enter is the keyboard equivalent of clicking the row.
await row.click();
assert.equal(await row.getAttribute('aria-expanded'), 'false', 'the row did not collapse');
await row.focus();
await page.keyboard.press('Enter');
await settled();
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'Enter did not expand the change set');
};
+36
View File
@@ -0,0 +1,36 @@
// A runtime event with a task target expands to its metadata and links to
// the task. The seed's work requests park and record the event; the feed is
// filtered to it so settings noise cannot push it off the page. Without it
// there is nothing to exercise, so the check skips instead of failing.
const assert = require('node:assert/strict');
const { DEFAULT_WINDOW_MS, trackAudit } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, skip }) => {
trackAudit(page);
await go('/org/audit?kind=parked');
await page.locator('[data-row-key]').first().waitFor();
const from = new Date(Date.now() - DEFAULT_WINDOW_MS).toISOString();
// The feed page size is 100: only rows in this response are rendered.
const feed = await page.evaluate(
async (iso) => (await fetch(`/api/audit?limit=100&kind=parked&from=${encodeURIComponent(iso)}`)).json(),
from,
);
const records = feed.records || [];
const runtime = records.find((row) => row.category === 'runtime' && row.target?.kind === 'task' && row.target?.id);
if (!runtime) {
skip('no runtime event with a task target in the feed');
}
const row = page.locator(`[data-row-key="${runtime.id}"]`);
await row.waitFor();
await row.scrollIntoViewIfNeeded();
await row.locator('td').first().click();
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'runtime row did not expand');
const detail = row.locator('xpath=following-sibling::tr[1]');
await detail.locator('dl dt', { hasText: 'Target' }).first().waitFor();
assert.match(await detail.innerText(), /Table/, 'runtime metadata has no table row');
const link = detail.getByRole('link', { name: runtime.target.label || runtime.target.id, exact: true });
assert.equal(await link.count(), 1, 'runtime target is not a link');
assert.equal(await link.getAttribute('href'), `/tasks/${runtime.target.id}`);
};
+50
View File
@@ -0,0 +1,50 @@
// Audit saved views round-trip through the URL, and CSV/JSON exports carry
// the resolved window and arrive as attachments.
const assert = require('node:assert/strict');
const { trackAudit, exportOnce } = require('./helpers/audit-helpers.cjs');
module.exports = async ({ page, go, shot, fail, settled }) => {
const { waitForUrl } = trackAudit(page);
await go('/org/audit');
await page.getByRole('button', { name: 'Runtime', exact: true }).click();
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
const viewName = `e2e-view-${Date.now()}`;
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
await page.getByRole('menuitem', { name: 'Save view…', exact: true }).click();
const saveDialog = page.getByRole('dialog');
await saveDialog.waitFor();
await saveDialog.getByLabel('Name', { exact: true }).fill(viewName);
await saveDialog.getByRole('button', { name: 'Save', exact: true }).click();
await settled();
await saveDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
const savedView = page.getByRole('combobox', { name: 'Saved view', exact: true });
await savedView.waitFor();
assert.equal((await savedView.innerText()).trim(), viewName);
await shot('saved-view');
await page.getByRole('button', { name: 'Runtime', exact: true }).click();
await waitForUrl((u) => u.searchParams.get('categories') === null);
await savedView.click();
await page.getByRole('option', { name: viewName, exact: true }).click();
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
assert.equal((await savedView.innerText()).trim(), viewName, 'applying the saved view did not restore it');
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
await page.getByRole('menuitem', { name: 'Delete view', exact: true }).click();
await savedView.waitFor({ state: 'detached', timeout: 5000 }).catch(() => {});
assert.equal(await savedView.count(), 0, 'deleting the saved view left it in the picker');
await go('/org/audit');
await page.getByRole('button', { name: 'Export', exact: true }).click();
await page.getByRole('menuitem', { name: 'CSV', exact: true }).waitFor();
await shot('export');
await page.keyboard.press('Escape');
const csvBody = await exportOnce(page, fail, 'CSV', 'csv');
if (csvBody !== null) assert.ok(csvBody.split('\n')[0].trim().length > 0, 'CSV export is empty');
const jsonBody = await exportOnce(page, fail, 'JSON', 'json');
if (jsonBody !== null) assert.ok(jsonBody.trimStart().startsWith('['), 'JSON export is not an array');
};
Loaded 100 of 1774 files, more files were not shown because too many files have changed in this diff. Show more