chore(release): remove the canary, release news, changelog and Woodpecker pipelines (#1917)
This commit is contained in:
36 files changed
+59
-7650
No files matched your search
@@ -1,51 +0,0 @@
|
||||
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
|
||||
@@ -2,11 +2,10 @@ name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ["v*"]
|
||||
|
||||
concurrency:
|
||||
group: ${{ startsWith(github.ref, 'refs/tags/') && format('deploy-release-{0}', github.sha) || format('deploy-{0}', github.ref) }}
|
||||
group: deploy-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
@@ -18,46 +17,19 @@ 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@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Resolve archied tag at HEAD
|
||||
- name: Resolve the release
|
||||
id: release_tag
|
||||
run: |
|
||||
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"
|
||||
echo "archied_version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
||||
echo "sha=$(git rev-parse "${GITHUB_REF}^{commit}")" >> "$GITHUB_OUTPUT"
|
||||
|
||||
gate:
|
||||
needs: plan
|
||||
if: needs.plan.outputs.run == 'true'
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -105,14 +77,9 @@ jobs:
|
||||
env:
|
||||
RELEASE_VERSION: ${{ needs.plan.outputs.archied_version }}
|
||||
run: |
|
||||
# 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
|
||||
# The binaries the release ships are built in the same task run, so
|
||||
# the tree that passed is the tree that is published.
|
||||
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
|
||||
@@ -120,39 +87,11 @@ 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
|
||||
if: needs.plan.outputs.archied_version != ''
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-binaries
|
||||
@@ -185,21 +124,17 @@ jobs:
|
||||
context: .
|
||||
file: Dockerfile.archied
|
||||
push: true
|
||||
# The first line is empty for a build of main; empty lines are ignored.
|
||||
tags: |
|
||||
${{ 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:v${{ needs.plan.outputs.archied_version }}
|
||||
git.catlow.cloud/sam/archied:sha-${{ needs.plan.outputs.sha }}
|
||||
build-args: |
|
||||
GATEWAY_VERSION=${{ needs.plan.outputs.component }}
|
||||
RUNTIME_VERSION=${{ needs.plan.outputs.component }}
|
||||
GATEWAY_VERSION=${{ needs.plan.outputs.archied_version }}
|
||||
RUNTIME_VERSION=${{ needs.plan.outputs.archied_version }}
|
||||
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
|
||||
@@ -235,13 +170,14 @@ jobs:
|
||||
cache-to: type=gha,mode=max,scope=archie-agent
|
||||
|
||||
dist-zip:
|
||||
# archied-image is needed so a release never reaches the canary without it.
|
||||
# archied-image is needed so a release is never published 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@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# The gate built these from the tree it checked; nothing is compiled here.
|
||||
- name: Download the release binaries
|
||||
@@ -265,7 +201,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 CHANGELOG.md "$name/"
|
||||
cp deployments/INSTRUCTIONS.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"
|
||||
@@ -307,15 +243,8 @@ jobs:
|
||||
prerelease=false
|
||||
case "$version" in *-*) prerelease=true ;; esac
|
||||
notes="$(mktemp)"
|
||||
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
|
||||
previous="$(git describe --tags --abbrev=0 --match 'v*' "$tag^" 2>/dev/null || true)"
|
||||
git log --no-merges --format='- %s' ${previous:+"$previous.."}"$tag" > "$notes"
|
||||
api="https://git.catlow.cloud/api/v1"
|
||||
repo="sam/archie"
|
||||
auth="Authorization: token $DEPLOY_TOKEN"
|
||||
@@ -327,12 +256,6 @@ 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 }}
|
||||
|
||||
@@ -4,7 +4,7 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "release the canary is expected to run; must match what it runs"
|
||||
description: "published release to move stable to, such as 1.63.0"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
@@ -18,27 +18,22 @@ 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 published archied
|
||||
# The deploy workflow already built this binary. edge is the newest
|
||||
# main that passed the gate.
|
||||
- name: Fetch the release's archied
|
||||
run: |
|
||||
set -e
|
||||
image=git.catlow.cloud/sam/archied:edge
|
||||
image="git.catlow.cloud/sam/archied:v${{ inputs.version }}"
|
||||
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 the canary's release
|
||||
env:
|
||||
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
|
||||
- name: Promote to stable
|
||||
run: |
|
||||
"$RUNNER_TEMP/archied" release canary promote -dashboard "${{ vars.CANARY_URL }}" \
|
||||
"$RUNNER_TEMP/archied" release promote \
|
||||
-version "${{ inputs.version }}" \
|
||||
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
|
||||
@@ -23,7 +23,7 @@ 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 commit and 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 tag. Set the secret here, or dispatch the release from the Gitea primary."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -52,4 +52,4 @@ jobs:
|
||||
task release RELEASE="$RELEASE"
|
||||
|
||||
- name: Push the release
|
||||
run: git push --atomic origin main "$(git describe --exact-match --match 'v*' HEAD)"
|
||||
run: git push origin "$(git describe --exact-match --match 'v*' HEAD)"
|
||||
@@ -1,67 +0,0 @@
|
||||
# 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
|
||||
@@ -1,337 +0,0 @@
|
||||
# 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"
|
||||
@@ -1,50 +0,0 @@
|
||||
# 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
|
||||
@@ -1,69 +0,0 @@
|
||||
# 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
|
||||
@@ -1,53 +0,0 @@
|
||||
# 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"
|
||||
-2923
File diff suppressed because it is too large.
Load diff
@@ -35,6 +35,5 @@ 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"]
|
||||
+33
-238
@@ -1,261 +1,56 @@
|
||||
# Releasing
|
||||
|
||||
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.
|
||||
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. Nothing is released from a
|
||||
laptop.
|
||||
|
||||
## 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`:
|
||||
|
||||
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.
|
||||
`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.
|
||||
|
||||
## What a release publishes
|
||||
|
||||
The tag push runs `deploy.yml`:
|
||||
|
||||
- **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.
|
||||
- **Gate.** `task check dist TEST_FLAGS=-count=1` and `govulncheck`. The
|
||||
binaries the zip ships are built in the same run, so nothing is compiled
|
||||
again after the gate.
|
||||
- **Images.** `archied:v<version>` and `archie-agent:v<version>`, plus
|
||||
`sha-<commit>` tags. `:latest` moves only on promotion.
|
||||
- **The signed release.** `archied release publish` signs a statement
|
||||
(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-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.
|
||||
- **The release page** on Gitea, listing the commit subjects since the
|
||||
previous tag. The statement links to it.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## The canary
|
||||
## Promote
|
||||
|
||||
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:
|
||||
|
||||
| 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
|
||||
```
|
||||
|
||||
### Promote
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
```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 \
|
||||
archied release promote -version 1.63.0 \
|
||||
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
|
||||
```
|
||||
|
||||
## Secrets
|
||||
|
||||
| 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 |
|
||||
+1
-27
@@ -69,16 +69,6 @@ tasks:
|
||||
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:
|
||||
@@ -88,7 +78,6 @@ tasks:
|
||||
desc: Run golangci-lint
|
||||
cmds:
|
||||
- golangci-lint run ./...
|
||||
- cd tools && golangci-lint run ./...
|
||||
|
||||
ui:deps:
|
||||
desc: Install dashboard dependencies
|
||||
@@ -233,13 +222,6 @@ tasks:
|
||||
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]
|
||||
@@ -334,7 +316,6 @@ tasks:
|
||||
internal: true
|
||||
deps:
|
||||
- task: proto:lint
|
||||
- task: news:check
|
||||
- task: vet
|
||||
- task: lint
|
||||
- task: build
|
||||
@@ -342,7 +323,7 @@ tasks:
|
||||
- task: test:ui
|
||||
|
||||
release:
|
||||
desc: "Turn [Unreleased] into a release, then commit and tag it (RELEASE=major|minor|patch|1.2.3)"
|
||||
desc: "Tag main as a release (RELEASE=major|minor|patch|1.2.3)"
|
||||
requires:
|
||||
vars: [RELEASE]
|
||||
cmds:
|
||||
@@ -361,12 +342,5 @@ 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"
|
||||
@@ -1,224 +0,0 @@
|
||||
{
|
||||
"/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/"
|
||||
}
|
||||
@@ -1,557 +0,0 @@
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
@@ -18,12 +18,7 @@ const releaseUsage = `usage: archied release <command>
|
||||
|
||||
keygen -seed FILE write a new signing key's seed to FILE and print its public key
|
||||
publish sign a release and push it to a release source's next channel
|
||||
promote -version V point stable at a published release by hand
|
||||
canary status show the canary's channel, installed release, window and verdict (read-only)
|
||||
canary start point the canary at next and install a release on it, queued behind one being judged
|
||||
canary check judge the release the canary runs: promote it, pick up a newer next, or roll back
|
||||
canary promote promote the release the canary runs now, if its signals pass
|
||||
canary unpin return the canary to the next channel from any pin`
|
||||
promote -version V point stable at a published release`
|
||||
|
||||
// RunRelease is the publisher's side of a release source: it makes the key
|
||||
// a source signs with and pushes signed releases to it.
|
||||
@@ -39,8 +34,6 @@ func RunRelease(args []string, out, stderr io.Writer) int {
|
||||
return runReleasePublish(args[1:], out, stderr)
|
||||
case "promote":
|
||||
return runReleasePromote(args[1:], out, stderr)
|
||||
case "canary":
|
||||
return runReleaseCanary(args[1:], out, stderr)
|
||||
default:
|
||||
fmt.Fprintln(stderr, releaseUsage)
|
||||
return 2
|
||||
@@ -107,7 +100,7 @@ func runReleasePublish(args []string, out, stderr io.Writer) int {
|
||||
}
|
||||
req.Signer = ed25519.NewKeyFromSeed(seed)
|
||||
public := distribution.EncodeKey(ed25519.PublicKey(req.Signer[ed25519.SeedSize:]))
|
||||
// stable moves only when the canary promotes the release.
|
||||
// stable moves only when the release is promoted.
|
||||
req.Channels = []string{"next"}
|
||||
statement, err := releaseupdate.Publish(context.Background(), req)
|
||||
if err != nil {
|
||||
@@ -119,8 +112,7 @@ func runReleasePublish(args []string, out, stderr io.Writer) int {
|
||||
return 0
|
||||
}
|
||||
|
||||
// runReleasePromote moves stable without a canary verdict, under the same
|
||||
// rules the canary promotes by.
|
||||
// runReleasePromote moves stable to a published release.
|
||||
func runReleasePromote(args []string, out, stderr io.Writer) int {
|
||||
flags := flag.NewFlagSet("release promote", flag.ContinueOnError)
|
||||
flags.SetOutput(stderr)
|
||||
|
||||
@@ -1,656 +0,0 @@
|
||||
package archied
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"oras.land/oras-go/v2/errdef"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/distribution"
|
||||
"github.com/samcharles93/archie-core/internal/releaseupdate"
|
||||
)
|
||||
|
||||
// canaryInstallWait bounds how long an install on the canary may take,
|
||||
// including the watchdog's health wait and a rollback.
|
||||
const canaryInstallWait = 20 * time.Minute
|
||||
|
||||
// migrationsDir holds the schema migrations; a release that changes it can't
|
||||
// be rolled back without restoring the database snapshot.
|
||||
const migrationsDir = "internal/infrastructure/postgres/migrations"
|
||||
|
||||
func runReleaseCanary(args []string, out, stderr io.Writer) int {
|
||||
if len(args) == 0 {
|
||||
fmt.Fprintln(stderr, releaseUsage)
|
||||
return 2
|
||||
}
|
||||
switch args[0] {
|
||||
case "status":
|
||||
return runCanaryStatus(args[1:], out, stderr)
|
||||
case "start":
|
||||
return runCanaryStart(args[1:], out, stderr)
|
||||
case "check":
|
||||
return runCanaryCheck(args[1:], out, stderr)
|
||||
case "promote":
|
||||
return runCanaryPromote(args[1:], out, stderr)
|
||||
case "unpin":
|
||||
return runCanaryUnpin(args[1:], out, stderr)
|
||||
default:
|
||||
fmt.Fprintln(stderr, releaseUsage)
|
||||
return 2
|
||||
}
|
||||
}
|
||||
|
||||
// addCanaryFlags registers the flags every canary subcommand takes.
|
||||
func addCanaryFlags(flags *flag.FlagSet) (dashboardURL, tokenEnv *string) {
|
||||
dashboardURL = flags.String("dashboard", "", "canary dashboard URL")
|
||||
tokenEnv = flags.String("token-env", "ARCHIE_CANARY_TOKEN", "environment variable holding a dashboard API token for the canary")
|
||||
return dashboardURL, tokenEnv
|
||||
}
|
||||
|
||||
// addSourceFlags registers the flags naming the release source.
|
||||
func addSourceFlags(flags *flag.FlagSet) (reference, key *string) {
|
||||
reference = flags.String("source", "", "OCI repository releases are published to; blank is the official releases")
|
||||
key = flags.String("key", "", "base64 ed25519 public key the source signs with")
|
||||
return reference, key
|
||||
}
|
||||
|
||||
func canaryDashboard(url, tokenEnv string) (releaseupdate.CanaryDashboard, error) {
|
||||
if url == "" {
|
||||
return releaseupdate.CanaryDashboard{}, errors.New("-dashboard is required")
|
||||
}
|
||||
return releaseupdate.CanaryDashboard{URL: url, Token: os.Getenv(tokenEnv)}, nil
|
||||
}
|
||||
|
||||
func canarySource(reference, key string) (distribution.Source, error) {
|
||||
return distribution.Parse(reference, key, distribution.DefaultReleases())
|
||||
}
|
||||
|
||||
// fetchChannel fetches a channel tag; found is false when the channel has no
|
||||
// release yet.
|
||||
func fetchChannel(ctx context.Context, source distribution.Source, tag string) (release releaseupdate.Release, found bool, err error) {
|
||||
release, err = releaseupdate.Fetch(ctx, source, tag)
|
||||
if errors.Is(err, errdef.ErrNotFound) {
|
||||
return releaseupdate.Release{}, false, nil
|
||||
}
|
||||
return release, err == nil, err
|
||||
}
|
||||
|
||||
// publishedChannels are the releases the source currently publishes.
|
||||
type publishedChannels struct {
|
||||
next, stable releaseupdate.Release
|
||||
hasNext, hasStable bool
|
||||
}
|
||||
|
||||
func fetchChannels(ctx context.Context, source distribution.Source) (publishedChannels, error) {
|
||||
var channels publishedChannels
|
||||
var err error
|
||||
if channels.next, channels.hasNext, err = fetchChannel(ctx, source, "next"); err != nil {
|
||||
return channels, err
|
||||
}
|
||||
if channels.stable, channels.hasStable, err = fetchChannel(ctx, source, "stable"); err != nil {
|
||||
return channels, err
|
||||
}
|
||||
return channels, nil
|
||||
}
|
||||
|
||||
// canaryRun is the release the canary actually runs: its version, when it was
|
||||
// installed and its fetched release statement.
|
||||
type canaryRun struct {
|
||||
version string
|
||||
installedAt time.Time
|
||||
release releaseupdate.Release
|
||||
found bool
|
||||
}
|
||||
|
||||
// readCanaryRun reads what the canary runs. A host that doesn't record install
|
||||
// times (it updated before they were tracked) degrades to the release
|
||||
// statement's issue time.
|
||||
func readCanaryRun(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source) (canaryRun, error) {
|
||||
var run canaryRun
|
||||
version, installedAt, _, err := dashboard.Installed(ctx)
|
||||
if err != nil {
|
||||
return run, err
|
||||
}
|
||||
run.version, run.installedAt = version, installedAt
|
||||
release, found, err := fetchChannel(ctx, source, releaseupdate.Tag("exact-pin", version))
|
||||
if err != nil {
|
||||
return run, err
|
||||
}
|
||||
run.release, run.found = release, found
|
||||
if run.installedAt.IsZero() && found {
|
||||
run.installedAt = release.Statement.IssuedAt
|
||||
}
|
||||
return run, nil
|
||||
}
|
||||
|
||||
// newerIssued reports whether release a was issued after b. IssuedAt, not
|
||||
// semver order: Promote refuses a release issued before the one stable names,
|
||||
// so the judge must agree with that replay rule.
|
||||
func newerIssued(a, b releaseupdate.Release) bool {
|
||||
return a.Statement.IssuedAt.After(b.Statement.IssuedAt)
|
||||
}
|
||||
|
||||
func displayVersion(version string) string {
|
||||
if version == "" {
|
||||
return "unknown"
|
||||
}
|
||||
return version
|
||||
}
|
||||
|
||||
func displayRelease(release releaseupdate.Release, found bool) string {
|
||||
if !found {
|
||||
return "none"
|
||||
}
|
||||
return release.Statement.Version
|
||||
}
|
||||
|
||||
func printVerdict(out io.Writer, version string, verdict releaseupdate.CanaryVerdict) {
|
||||
fmt.Fprintf(out, "%s: %s\n", displayVersion(version), verdict.Decision)
|
||||
for _, reason := range verdict.Reasons {
|
||||
fmt.Fprintf(out, " %s\n", reason)
|
||||
}
|
||||
}
|
||||
|
||||
func runCanaryStatus(args []string, out, stderr io.Writer) int {
|
||||
flags := flag.NewFlagSet("release canary status", flag.ContinueOnError)
|
||||
flags.SetOutput(stderr)
|
||||
dashboardURL, tokenEnv := addCanaryFlags(flags)
|
||||
reference, key := addSourceFlags(flags)
|
||||
window := flags.Duration("window", releaseupdate.CanaryWindow, "window a release is judged over, counted from its install")
|
||||
if err := flags.Parse(args); err != nil {
|
||||
return 2
|
||||
}
|
||||
dashboard, err := canaryDashboard(*dashboardURL, *tokenEnv)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary status:", err)
|
||||
return 2
|
||||
}
|
||||
source, err := canarySource(*reference, *key)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary status:", err)
|
||||
return 2
|
||||
}
|
||||
if err := printCanaryStatus(context.Background(), dashboard, source, *window, out); err != nil {
|
||||
fmt.Fprintln(stderr, "release canary status:", err)
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// printCanaryStatus reports the canary's channel, installed release, the
|
||||
// published channels, window progress and the verdict the current signals
|
||||
// would give, without acting on anything.
|
||||
func printCanaryStatus(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source, window time.Duration, out io.Writer) error {
|
||||
channel, pin, err := dashboard.Channel(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
channels, err := fetchChannels(ctx, source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
run, err := readCanaryRun(ctx, dashboard, source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printCanaryState(out, channel, pin, run, channels, window)
|
||||
return printCanaryVerdict(ctx, dashboard, run, window, out)
|
||||
}
|
||||
|
||||
func printCanaryState(out io.Writer, channel, pin string, run canaryRun, channels publishedChannels, window time.Duration) {
|
||||
fmt.Fprintf(out, "channel: %s\n", channelDisplay(channel, pin))
|
||||
fmt.Fprintf(out, "installed: %s", displayVersion(run.version))
|
||||
if run.installedAt.IsZero() {
|
||||
fmt.Fprintln(out, " (installed_at not reported)")
|
||||
} else {
|
||||
fmt.Fprintf(out, " since %s\n", run.installedAt.Format(time.RFC3339))
|
||||
}
|
||||
fmt.Fprintf(out, "stable: %s\n", displayRelease(channels.stable, channels.hasStable))
|
||||
fmt.Fprintf(out, "next: %s\n", displayRelease(channels.next, channels.hasNext))
|
||||
if run.installedAt.IsZero() {
|
||||
fmt.Fprintln(out, "window: unknown, no install time to count from")
|
||||
} else {
|
||||
elapsed := time.Since(run.installedAt)
|
||||
fmt.Fprintf(out, "window: %s of %s elapsed since the install\n", elapsed.Round(time.Minute), window)
|
||||
}
|
||||
}
|
||||
|
||||
func printCanaryVerdict(ctx context.Context, dashboard releaseupdate.CanaryDashboard, run canaryRun, window time.Duration, out io.Writer) error {
|
||||
if run.installedAt.IsZero() {
|
||||
fmt.Fprintln(out, "verdict: unknown, no install time to judge from")
|
||||
return nil
|
||||
}
|
||||
now := time.Now().UTC()
|
||||
signals, err := dashboard.Signals(ctx, run.installedAt, now, window)
|
||||
if err != nil {
|
||||
return fmt.Errorf("read canary signals: %w", err)
|
||||
}
|
||||
printSignals(out, signals)
|
||||
verdict := releaseupdate.JudgeCanary(run.version, run.installedAt, now, window, signals)
|
||||
fmt.Fprintf(out, "verdict on %s: %s (read-only)\n", displayVersion(run.version), verdict.Decision)
|
||||
for _, reason := range verdict.Reasons {
|
||||
fmt.Fprintf(out, " %s\n", reason)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printSignals(out io.Writer, s releaseupdate.CanarySignals) {
|
||||
fmt.Fprintf(out, "signals: runs %q, ready=%t, new action alerts=%d\n", s.Installed, s.Ready, len(s.NewActionAlerts))
|
||||
fmt.Fprintf(out, " tasks finished %d, parked or died %d (baseline %d, %d)\n",
|
||||
s.Canary.Finished, s.Canary.Bad, s.Baseline.Finished, s.Baseline.Bad)
|
||||
fmt.Fprintf(out, " error lines %d, log covers %s (baseline %d, covers %s)\n",
|
||||
s.Canary.Errors, s.Canary.Covered.Round(time.Minute), s.Baseline.Errors, s.Baseline.Covered.Round(time.Minute))
|
||||
}
|
||||
|
||||
func channelDisplay(channel, pin string) string {
|
||||
if pin != "" {
|
||||
return channel + " (pinned to " + pin + ")"
|
||||
}
|
||||
return channel
|
||||
}
|
||||
|
||||
func runCanaryStart(args []string, out, stderr io.Writer) int {
|
||||
flags := flag.NewFlagSet("release canary start", flag.ContinueOnError)
|
||||
flags.SetOutput(stderr)
|
||||
dashboardURL, tokenEnv := addCanaryFlags(flags)
|
||||
reference, key := addSourceFlags(flags)
|
||||
version := flags.String("version", "", "release to install on the canary")
|
||||
force := flags.Bool("force", false, "install even when the canary is still judging a newer release")
|
||||
if err := flags.Parse(args); err != nil {
|
||||
return 2
|
||||
}
|
||||
dashboard, err := canaryDashboard(*dashboardURL, *tokenEnv)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary start:", err)
|
||||
return 2
|
||||
}
|
||||
if *version == "" {
|
||||
fmt.Fprintln(stderr, "release canary start: -version is required")
|
||||
return 2
|
||||
}
|
||||
source, err := canarySource(*reference, *key)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary start:", err)
|
||||
return 2
|
||||
}
|
||||
if err := startCanary(context.Background(), dashboard, source, *version, *force, out); err != nil {
|
||||
fmt.Fprintln(stderr, "release canary start:", err)
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// startCanary points the canary at next — clearing any rollback pin — and
|
||||
// installs version on it. A release published while the canary still judges a
|
||||
// newer one queues behind it, so the running window isn't restarted under a
|
||||
// different release.
|
||||
func startCanary(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source, version string, force bool, out io.Writer) error {
|
||||
// The channel is read before following next: a canary already on next is
|
||||
// judging the release it runs, and a new release queues behind that one.
|
||||
channel, _, err := dashboard.Channel(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := dashboard.Follow(ctx, "next", ""); err != nil {
|
||||
return fmt.Errorf("point the canary at next: %w", err)
|
||||
}
|
||||
if !force {
|
||||
queued, err := queuedBehind(ctx, dashboard, source, channel, version, out)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if queued {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
if err := dashboard.Install(ctx, version, canaryInstallWait); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintf(out, "the canary follows next and runs %s\n", version)
|
||||
return nil
|
||||
}
|
||||
|
||||
// queuedBehind reports whether version must wait: the canary already follows
|
||||
// next and is still judging the release it runs (a judgeable one), which is a
|
||||
// different release from version.
|
||||
func queuedBehind(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source, channel, version string, out io.Writer) (bool, error) {
|
||||
if channel != "next" {
|
||||
return false, nil
|
||||
}
|
||||
run, err := readCanaryRun(ctx, dashboard, source)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if run.version == version {
|
||||
return false, nil
|
||||
}
|
||||
channels, err := fetchChannels(ctx, source)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if judgeable(run, channels) {
|
||||
fmt.Fprintf(out, "%s is queued behind %s, which the canary is still judging\n", version, run.version)
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func runCanaryCheck(args []string, out, stderr io.Writer) int {
|
||||
flags := flag.NewFlagSet("release canary check", flag.ContinueOnError)
|
||||
flags.SetOutput(stderr)
|
||||
dashboardURL, tokenEnv := addCanaryFlags(flags)
|
||||
reference, key := addSourceFlags(flags)
|
||||
latest := flags.String("latest", "", "comma-separated image repositories whose v<version> tag becomes latest on promotion")
|
||||
checkout := flags.String("checkout", ".", "repository checkout with release tags, to see whether a release migrated the database")
|
||||
window := flags.Duration("window", releaseupdate.CanaryWindow, "window the installed release is judged over, counted from its install")
|
||||
if err := flags.Parse(args); err != nil {
|
||||
return 2
|
||||
}
|
||||
dashboard, err := canaryDashboard(*dashboardURL, *tokenEnv)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary check:", err)
|
||||
return 2
|
||||
}
|
||||
source, err := canarySource(*reference, *key)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary check:", err)
|
||||
return 2
|
||||
}
|
||||
code, err := checkCanary(context.Background(), dashboard, source, splitList(*latest), *checkout, *window, out)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary check:", err)
|
||||
return 1
|
||||
}
|
||||
return code
|
||||
}
|
||||
|
||||
// checkCanary judges the release the canary actually runs — not the moving
|
||||
// next tag — and acts on the verdict. The exit code is 1 when the run should
|
||||
// show red: a rollback happened, or the canary is held on a pin that can no
|
||||
// longer be installed.
|
||||
func checkCanary(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source, latest []string, checkout string, window time.Duration, out io.Writer) (int, error) {
|
||||
channels, err := fetchChannels(ctx, source)
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
channel, pin, err := dashboard.Channel(ctx)
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
if channel != "next" {
|
||||
return heldCanary(ctx, source, channel, pin, out)
|
||||
}
|
||||
run, err := readCanaryRun(ctx, dashboard, source)
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
if !judgeable(run, channels) {
|
||||
fmt.Fprintf(out, "nothing to judge: the canary runs %s\n", displayVersion(run.version))
|
||||
return pickupNext(ctx, dashboard, channels, run.version, out)
|
||||
}
|
||||
return judgeInstalled(ctx, dashboard, source, run, channels, latest, checkout, window, out)
|
||||
}
|
||||
|
||||
// judgeable reports whether the installed release is one the canary judges: a
|
||||
// published, non-prerelease release issued after stable's.
|
||||
func judgeable(run canaryRun, channels publishedChannels) bool {
|
||||
if !run.found || run.release.Statement.Prerelease {
|
||||
return false
|
||||
}
|
||||
return !channels.hasStable || newerIssued(run.release, channels.stable)
|
||||
}
|
||||
|
||||
func judgeInstalled(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source, run canaryRun, channels publishedChannels, latest []string, checkout string, window time.Duration, out io.Writer) (int, error) {
|
||||
now := time.Now().UTC()
|
||||
signals, err := dashboard.Signals(ctx, run.installedAt, now, window)
|
||||
if err != nil {
|
||||
return 1, fmt.Errorf("read canary signals: %w", err)
|
||||
}
|
||||
verdict := releaseupdate.JudgeCanary(run.version, run.installedAt, now, window, signals)
|
||||
printVerdict(out, run.version, verdict)
|
||||
switch verdict.Decision {
|
||||
case releaseupdate.CanaryPromote:
|
||||
return 0, promoteJudged(ctx, dashboard, source, run, channels, latest, out)
|
||||
case releaseupdate.CanaryRollBack:
|
||||
return 1, rollBackCanary(ctx, dashboard, source, run, channels, checkout, out)
|
||||
default:
|
||||
return 0, nil
|
||||
}
|
||||
}
|
||||
|
||||
// promoteJudged moves stable to the judged release, then picks up a newer next
|
||||
// queued behind it.
|
||||
func promoteJudged(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source, run canaryRun, channels publishedChannels, latest []string, out io.Writer) error {
|
||||
if _, err := releaseupdate.Promote(ctx, source.Reference, source.Key, run.version, latest); err != nil {
|
||||
return fmt.Errorf("promote %s: %w", run.version, err)
|
||||
}
|
||||
fmt.Fprintf(out, "stable is %s\n", run.version)
|
||||
fresh := channels
|
||||
fresh.stable, fresh.hasStable = run.release, true
|
||||
_, err := pickupNext(ctx, dashboard, fresh, run.version, out)
|
||||
return err
|
||||
}
|
||||
|
||||
// pickupNext installs the next release when it is newer than stable and the
|
||||
// canary doesn't already run it.
|
||||
func pickupNext(ctx context.Context, dashboard releaseupdate.CanaryDashboard, channels publishedChannels, installed string, out io.Writer) (int, error) {
|
||||
if !channels.hasNext || channels.next.Statement.Version == installed {
|
||||
return 0, nil
|
||||
}
|
||||
if channels.hasStable && !newerIssued(channels.next, channels.stable) {
|
||||
return 0, nil
|
||||
}
|
||||
if err := dashboard.Install(ctx, channels.next.Statement.Version, canaryInstallWait); err != nil {
|
||||
return 1, err
|
||||
}
|
||||
fmt.Fprintf(out, "the canary picks up %s from next\n", channels.next.Statement.Version)
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
// heldCanary reports a canary that isn't following next. Its pin must still be
|
||||
// installable: a stranded pin fails the run instead of looking green.
|
||||
func heldCanary(ctx context.Context, source distribution.Source, channel, pin string, out io.Writer) (int, error) {
|
||||
if pin != "" {
|
||||
err := checkPin(ctx, source, pin)
|
||||
if errors.Is(err, errStrandedPin) {
|
||||
fmt.Fprintf(out, "ERROR: the canary is held on %s %s, which is stranded: %v; unpin it or republish the release\n", channel, pin, err)
|
||||
return 1, nil
|
||||
}
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
fmt.Fprintf(out, "held on %s %s, nothing to judge\n", channel, pin)
|
||||
return 0, nil
|
||||
}
|
||||
fmt.Fprintf(out, "held on %s, nothing to judge\n", channel)
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
// errStrandedPin marks a held pin that can no longer be installed.
|
||||
var errStrandedPin = errors.New("pin is stranded")
|
||||
|
||||
// checkPin fails when a held pin can no longer be installed: the release is
|
||||
// gone from the source, or its artifacts are.
|
||||
func checkPin(ctx context.Context, source distribution.Source, pin string) error {
|
||||
release, found, err := fetchChannel(ctx, source, releaseupdate.Tag("exact-pin", pin))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !found {
|
||||
return fmt.Errorf("%w: no release %s in the source", errStrandedPin, releaseupdate.Tag("exact-pin", pin))
|
||||
}
|
||||
if err := releaseupdate.Installable(ctx, source, release); err != nil {
|
||||
return fmt.Errorf("%w: %w", errStrandedPin, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// rollBackCanary returns the canary to stable after a failed verdict. stable
|
||||
// is checked installable before the canary is pinned to it: a pin whose
|
||||
// artifacts are gone would strand the canary, so the run fails loudly and the
|
||||
// canary stays on next. A release that changed the migrations is held on the
|
||||
// failed version instead, because going back past a migration needs the
|
||||
// pre-update database snapshot.
|
||||
func rollBackCanary(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source, run canaryRun, channels publishedChannels, checkout string, out io.Writer) error {
|
||||
failed := run.version
|
||||
if !channels.hasStable {
|
||||
return holdCanary(ctx, dashboard, failed, "there's no stable release to return to", out)
|
||||
}
|
||||
stable := channels.stable
|
||||
if err := releaseupdate.Installable(ctx, source, stable); err != nil {
|
||||
return fmt.Errorf("stable %s is not installable, the canary stays on next: %w", stable.Statement.Version, err)
|
||||
}
|
||||
changed, err := migrated(ctx, checkout, stable.Statement.Version, failed)
|
||||
if err != nil {
|
||||
return holdCanary(ctx, dashboard, failed, err.Error(), out)
|
||||
}
|
||||
if changed {
|
||||
return holdCanary(ctx, dashboard, failed, failed+" changed the database schema", out)
|
||||
}
|
||||
if err := dashboard.Follow(ctx, "exact-pin", stable.Statement.Version); err != nil {
|
||||
return fmt.Errorf("pin the canary to %s: %w", stable.Statement.Version, err)
|
||||
}
|
||||
if err := dashboard.Install(ctx, stable.Statement.Version, canaryInstallWait); err != nil {
|
||||
return fmt.Errorf("return the canary to %s: %w", stable.Statement.Version, err)
|
||||
}
|
||||
fmt.Fprintf(out, "the canary is back on %s and stable is unchanged\n", stable.Statement.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
func holdCanary(ctx context.Context, dashboard releaseupdate.CanaryDashboard, version, why string, out io.Writer) error {
|
||||
if err := dashboard.Follow(ctx, "exact-pin", version); err != nil {
|
||||
return fmt.Errorf("hold the canary on %s: %w", version, err)
|
||||
}
|
||||
fmt.Fprintf(out, "%s: the canary is held on %s and stable is unchanged; fix forward\n", why, version)
|
||||
return nil
|
||||
}
|
||||
|
||||
// runGitDiff runs git diff --quiet between two release tags and reports its
|
||||
// exit code and stderr. It is a variable so tests can drive the three
|
||||
// outcomes without a repository.
|
||||
var runGitDiff = func(ctx context.Context, checkout, from, to string) (int, string, error) {
|
||||
cmd := exec.CommandContext(ctx, "git", "-C", checkout, "diff", "--quiet", "v"+from, "v"+to, "--", migrationsDir)
|
||||
var buf bytes.Buffer
|
||||
cmd.Stderr = &buf
|
||||
err := cmd.Run()
|
||||
if err == nil {
|
||||
return 0, "", nil
|
||||
}
|
||||
if exitErr, ok := errors.AsType[*exec.ExitError](err); ok {
|
||||
return exitErr.ExitCode(), buf.String(), err
|
||||
}
|
||||
return -1, buf.String(), err
|
||||
}
|
||||
|
||||
// migrated reports whether the migrations differ between two release tags.
|
||||
// It returns true, nil when they differ, false, nil when they are identical,
|
||||
// and true, err when git could not answer, with the reason in err. Every
|
||||
// non-identical outcome holds the canary rather than rolls it back.
|
||||
func migrated(ctx context.Context, checkout, from, to string) (bool, error) {
|
||||
code, stderr, runErr := runGitDiff(ctx, checkout, from, to)
|
||||
switch code {
|
||||
case 0:
|
||||
return false, nil
|
||||
case 1:
|
||||
return true, nil
|
||||
}
|
||||
reason := strings.TrimSpace(stderr)
|
||||
if reason == "" && runErr != nil {
|
||||
reason = runErr.Error()
|
||||
}
|
||||
return true, fmt.Errorf("could not tell whether %s changed the database schema: %s", to, reason)
|
||||
}
|
||||
|
||||
func runCanaryPromote(args []string, out, stderr io.Writer) int {
|
||||
flags := flag.NewFlagSet("release canary promote", flag.ContinueOnError)
|
||||
flags.SetOutput(stderr)
|
||||
dashboardURL, tokenEnv := addCanaryFlags(flags)
|
||||
reference, key := addSourceFlags(flags)
|
||||
latest := flags.String("latest", "", "comma-separated image repositories whose v<version> tag becomes latest on promotion")
|
||||
version := flags.String("version", "", "release expected on the canary; must match what it runs")
|
||||
window := flags.Duration("window", releaseupdate.CanaryWindow, "window the signals are read over, counted from the install")
|
||||
if err := flags.Parse(args); err != nil {
|
||||
return 2
|
||||
}
|
||||
dashboard, err := canaryDashboard(*dashboardURL, *tokenEnv)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary promote:", err)
|
||||
return 2
|
||||
}
|
||||
source, err := canarySource(*reference, *key)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary promote:", err)
|
||||
return 2
|
||||
}
|
||||
code, err := promoteCanaryNow(context.Background(), dashboard, source, *version, splitList(*latest), *window, out)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary promote:", err)
|
||||
return 1
|
||||
}
|
||||
return code
|
||||
}
|
||||
|
||||
// promoteCanaryNow promotes the release the canary runs right now, without
|
||||
// waiting out the window: the signals must show no hard failure and no
|
||||
// relative breach. It refuses, with exit 1, when anything fails.
|
||||
func promoteCanaryNow(ctx context.Context, dashboard releaseupdate.CanaryDashboard, source distribution.Source, expectVersion string, latest []string, window time.Duration, out io.Writer) (int, error) {
|
||||
run, err := readCanaryRun(ctx, dashboard, source)
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
channel, pin, err := dashboard.Channel(ctx)
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
fmt.Fprintf(out, "channel: %s\n", channelDisplay(channel, pin))
|
||||
if expectVersion != "" && expectVersion != run.version {
|
||||
return 1, fmt.Errorf("the canary runs %s, not %s", displayVersion(run.version), expectVersion)
|
||||
}
|
||||
if !run.found {
|
||||
return 1, fmt.Errorf("no release %s in the source to promote", displayVersion(run.version))
|
||||
}
|
||||
now := time.Now().UTC()
|
||||
signals, err := dashboard.Signals(ctx, run.installedAt, now, window)
|
||||
if err != nil {
|
||||
return 1, fmt.Errorf("read canary signals: %w", err)
|
||||
}
|
||||
verdict := releaseupdate.JudgeCanaryNow(run.version, now, window, signals)
|
||||
printVerdict(out, run.version, verdict)
|
||||
if verdict.Decision == releaseupdate.CanaryRollBack {
|
||||
fmt.Fprintln(out, "refusing to promote: the canary's signals fail")
|
||||
return 1, nil
|
||||
}
|
||||
if _, err := releaseupdate.Promote(ctx, source.Reference, source.Key, run.version, latest); err != nil {
|
||||
return 1, fmt.Errorf("promote %s: %w", run.version, err)
|
||||
}
|
||||
fmt.Fprintf(out, "stable is %s\n", run.version)
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func runCanaryUnpin(args []string, out, stderr io.Writer) int {
|
||||
flags := flag.NewFlagSet("release canary unpin", flag.ContinueOnError)
|
||||
flags.SetOutput(stderr)
|
||||
dashboardURL, tokenEnv := addCanaryFlags(flags)
|
||||
if err := flags.Parse(args); err != nil {
|
||||
return 2
|
||||
}
|
||||
dashboard, err := canaryDashboard(*dashboardURL, *tokenEnv)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "release canary unpin:", err)
|
||||
return 2
|
||||
}
|
||||
if err := dashboard.Follow(context.Background(), "next", ""); err != nil {
|
||||
fmt.Fprintln(stderr, "release canary unpin:", err)
|
||||
return 1
|
||||
}
|
||||
fmt.Fprintln(out, "the canary follows next again, with no pin")
|
||||
return 0
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package archied
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMigrated(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
code int
|
||||
stderr string
|
||||
wantChanged bool
|
||||
wantErr bool
|
||||
wantSubstr string
|
||||
}{
|
||||
{
|
||||
name: "identical migrations",
|
||||
code: 0,
|
||||
wantChanged: false,
|
||||
},
|
||||
{
|
||||
name: "migrations differ",
|
||||
code: 1,
|
||||
wantChanged: true,
|
||||
},
|
||||
{
|
||||
name: "git cannot answer",
|
||||
code: 128,
|
||||
stderr: "fatal: bad revision 'v1.0.0'\n",
|
||||
wantChanged: true,
|
||||
wantErr: true,
|
||||
wantSubstr: "fatal: bad revision 'v1.0.0'",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
old := runGitDiff
|
||||
runGitDiff = func(context.Context, string, string, string) (int, string, error) {
|
||||
return tt.code, tt.stderr, nil
|
||||
}
|
||||
t.Cleanup(func() { runGitDiff = old })
|
||||
|
||||
changed, err := migrated(context.Background(), ".", "1.0.0", "1.1.0")
|
||||
if changed != tt.wantChanged {
|
||||
t.Fatalf("changed = %v, want %v", changed, tt.wantChanged)
|
||||
}
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Fatalf("err = %v, want err %v", err, tt.wantErr)
|
||||
}
|
||||
if tt.wantErr && !strings.Contains(err.Error(), tt.wantSubstr) {
|
||||
t.Fatalf("err = %q, want substring %q", err, tt.wantSubstr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package access
|
||||
|
||||
import "github.com/samcharles93/archie-core/internal/domain/org"
|
||||
|
||||
// CanaryGrantID is the ID the canary's scoped grant is known by in the policy
|
||||
// store and in denial records. A stored policy must not reuse it: the store's
|
||||
// seeding and the reset command overwrite shipped IDs, and this one is
|
||||
// installed by the operator from CanaryGrantPolicy's text.
|
||||
const CanaryGrantID = "org-canary-grant"
|
||||
|
||||
// CanaryGrantForbidID is the matching forbid's ID: the grant only scopes the
|
||||
// canary if everything else it could reach is forbidden, because the identity
|
||||
// may also carry a role (API-created service accounts are assigned developer)
|
||||
// whose shipped policy permits broadly within the org. A forbid wins within
|
||||
// the level, so the pair scopes the identity regardless of its role.
|
||||
const CanaryGrantForbidID = "org-canary-grant-forbid"
|
||||
|
||||
// canaryGrantActions is the exact action surface the canary needs, as one
|
||||
// Cedar condition shared by the grant's permit and its forbid.
|
||||
func canaryGrantActions() string {
|
||||
return `(
|
||||
(action == Archie::Action::"read" && ["dashboard", "task"].contains(resource.kind)) ||
|
||||
(action == Archie::Action::"read" && resource == Archie::Object::"update-settings") ||
|
||||
(action == Archie::Action::"update" && resource == Archie::Object::"update") ||
|
||||
(action == Archie::Action::"manage_identities" && resource == Archie::Object::"update-settings")
|
||||
)`
|
||||
}
|
||||
|
||||
func canaryPrincipal(identityID string) string {
|
||||
return `principal == Archie::Identity::"` + identityID + `"`
|
||||
}
|
||||
|
||||
// CanaryGrantPolicy is the grant a CI canary carries instead of instance
|
||||
// admin: exactly one named identity may read the dashboard's signal surface
|
||||
// (chat update, alerts, logs, tasks), read and write the update-settings
|
||||
// resource, and trigger an update install or deferral. Install it together
|
||||
// with CanaryGrantForbidPolicy, which forbids the same identity from
|
||||
// everything else. Every clause is guarded by the resource belonging to the
|
||||
// principal's own org, which the engine enforces structurally anyway.
|
||||
func CanaryGrantPolicy(orgID org.OrgID, identityID string) Policy {
|
||||
text := `permit(principal, action, resource) when {
|
||||
resource.org == principal.org &&
|
||||
` + canaryPrincipal(identityID) + ` &&
|
||||
` + canaryGrantActions() + `
|
||||
};`
|
||||
return Policy{ID: CanaryGrantID, Level: LevelOrg, OrgID: orgID, Text: text}
|
||||
}
|
||||
|
||||
// CanaryGrantForbidPolicy forbids the canary identity from everything outside
|
||||
// CanaryGrantPolicy's surface, so a role assigned to the identity (service
|
||||
// accounts created through the API carry developer) cannot widen it.
|
||||
func CanaryGrantForbidPolicy(orgID org.OrgID, identityID string) Policy {
|
||||
text := `forbid(principal, action, resource) when {
|
||||
resource.org == principal.org &&
|
||||
` + canaryPrincipal(identityID) + ` &&
|
||||
!` + canaryGrantActions() + `
|
||||
};`
|
||||
return Policy{ID: CanaryGrantForbidID, Level: LevelOrg, OrgID: orgID, Text: text}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package access
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/org"
|
||||
)
|
||||
|
||||
// TestCanaryGrantPolicy pins the shape of the canary grant: it names exactly
|
||||
// the one identity it is built for, scoped to the org it serves, so a token
|
||||
// carrying it cannot act as anyone else or reach another org.
|
||||
func TestCanaryGrantPolicy(t *testing.T) {
|
||||
p := CanaryGrantPolicy(org.DefaultOrgID, "canary-svc")
|
||||
if err := p.Validate(); err != nil {
|
||||
t.Fatalf("Validate: %v", err)
|
||||
}
|
||||
if p.ID != CanaryGrantID || p.Level != LevelOrg || p.OrgID != org.DefaultOrgID {
|
||||
t.Fatalf("policy = %+v, want ID %q at org level in %q", p, CanaryGrantID, org.DefaultOrgID)
|
||||
}
|
||||
if !strings.Contains(p.Text, `principal == Archie::Identity::"canary-svc"`) {
|
||||
t.Fatalf("text does not name the canary identity:\n%s", p.Text)
|
||||
}
|
||||
other := CanaryGrantPolicy(org.DefaultOrgID, "another")
|
||||
if strings.Contains(other.Text, "canary-svc") || !strings.Contains(other.Text, `Archie::Identity::"another"`) {
|
||||
t.Fatalf("grant for another identity must name that identity only:\n%s", other.Text)
|
||||
}
|
||||
}
|
||||
|
||||
// TestCanaryGrantForbidPolicy pins the forbid that keeps a role assigned to
|
||||
// the canary identity from widening the grant: it names the same identity and
|
||||
// negates exactly the permit's action surface.
|
||||
func TestCanaryGrantForbidPolicy(t *testing.T) {
|
||||
permit := CanaryGrantPolicy(org.DefaultOrgID, "canary-svc")
|
||||
forbid := CanaryGrantForbidPolicy(org.DefaultOrgID, "canary-svc")
|
||||
if err := forbid.Validate(); err != nil {
|
||||
t.Fatalf("Validate: %v", err)
|
||||
}
|
||||
if forbid.ID != CanaryGrantForbidID || forbid.Level != LevelOrg || forbid.OrgID != org.DefaultOrgID {
|
||||
t.Fatalf("forbid = %+v, want ID %q at org level in %q", forbid, CanaryGrantForbidID, org.DefaultOrgID)
|
||||
}
|
||||
if !strings.HasPrefix(forbid.Text, "forbid(") {
|
||||
t.Fatalf("forbid text must be a forbid:\n%s", forbid.Text)
|
||||
}
|
||||
if !strings.Contains(forbid.Text, `principal == Archie::Identity::"canary-svc"`) {
|
||||
t.Fatalf("forbid does not name the canary identity:\n%s", forbid.Text)
|
||||
}
|
||||
// The forbid must negate the permit's surface, not the permit itself.
|
||||
permitBody := strings.TrimSuffix(strings.SplitN(permit.Text, "when {", 2)[1], "};")
|
||||
forbidBody := strings.TrimSuffix(strings.SplitN(forbid.Text, "when {", 2)[1], "};")
|
||||
if !strings.Contains(forbidBody, "!"+canaryGrantActions()) {
|
||||
t.Fatalf("forbid does not negate the grant's action surface:\npermit:%s\nforbid:%s", permitBody, forbidBody)
|
||||
}
|
||||
}
|
||||
@@ -112,84 +112,3 @@ func TestWorkspaceEnvironment(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestCanaryGrant pins the scoped canary grant: the one identity it names may
|
||||
// read the signal surface, read and write update-settings, and trigger an
|
||||
// install -- and nothing else, neither for it nor for anyone else. The canary
|
||||
// principal carries the developer role (API-created service accounts are
|
||||
// assigned it); the grant's forbid must keep the role from widening access.
|
||||
func TestCanaryGrant(t *testing.T) {
|
||||
const canaryID = identity.IdentityID("canary-svc")
|
||||
grant := access.CanaryGrantPolicy(org.DefaultOrgID, string(canaryID))
|
||||
forbid := access.CanaryGrantForbidPolicy(org.DefaultOrgID, string(canaryID))
|
||||
engine := New(append(access.ShippedOrgPolicies(org.DefaultOrgID), grant, forbid))
|
||||
if len(engine.Problems()) != 0 {
|
||||
t.Fatalf("problems = %v, want the canary grant to compile", engine.Problems())
|
||||
}
|
||||
canary := access.Principal{
|
||||
IdentityID: canaryID, Org: org.DefaultOrgID,
|
||||
Memberships: []org.Membership{{IdentityID: canaryID, OrgID: org.DefaultOrgID, Role: org.RoleDeveloper}},
|
||||
}
|
||||
other := access.Principal{IdentityID: "someone-else", Org: org.DefaultOrgID}
|
||||
at := func(kind access.ResourceKind, id string) access.Resource {
|
||||
return access.Resource{Kind: kind, ID: id, Org: org.DefaultOrgID}
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
principal access.Principal
|
||||
action access.Action
|
||||
resource access.Resource
|
||||
allowed bool
|
||||
}{
|
||||
{"read the dashboard", canary, access.ActionRead, at(access.KindDashboard, ""), true},
|
||||
{"read tasks", canary, access.ActionRead, at(access.KindTask, ""), true},
|
||||
{"read one task", canary, access.ActionRead, at(access.KindTask, "7"), true},
|
||||
{"read update-settings", canary, access.ActionRead, at(access.KindPolicy, "update-settings"), true},
|
||||
{"install an update", canary, access.ActionUpdate, at(access.KindDashboard, "update"), true},
|
||||
{"replace update-settings", canary, access.ActionManageIdentities, at(access.KindPolicy, "update-settings"), true},
|
||||
{"read a secret", canary, access.ActionReadSecret, at(access.KindSecret, "github-token"), false},
|
||||
{"delete a task", canary, access.ActionDelete, at(access.KindTask, "7"), false},
|
||||
{"manage policies", canary, access.ActionManagePolicies, at(access.KindPolicy, "org-role-read"), false},
|
||||
{"run a workflow", canary, access.ActionRun, at(access.KindWorkflow, "triage"), false},
|
||||
{"create anything", canary, access.ActionCreate, at(access.KindTask, ""), false},
|
||||
{"update another object", canary, access.ActionUpdate, at(access.KindDashboard, "other"), false},
|
||||
{"read another object", canary, access.ActionRead, at(access.KindPolicy, "other-policy"), false},
|
||||
{"manage identities on another object", canary, access.ActionManageIdentities, at(access.KindIdentity, "someone-else"), false},
|
||||
{"read logs", canary, access.ActionReadLogs, at(access.KindTask, "7"), false},
|
||||
{"read the audit feed", canary, access.ActionReadAudit, at(access.KindAudit, ""), false},
|
||||
{"a resource of another org", canary, access.ActionRead, access.Resource{Kind: access.KindDashboard, Org: "acme"}, false},
|
||||
{"another identity reads the dashboard", other, access.ActionRead, at(access.KindDashboard, ""), false},
|
||||
{"another identity installs an update", other, access.ActionUpdate, at(access.KindDashboard, "update"), false},
|
||||
{"another identity replaces update-settings", other, access.ActionManageIdentities, at(access.KindPolicy, "update-settings"), false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := engine.Authorize(tt.principal, tt.action, tt.resource, access.Context{})
|
||||
if got.Allowed != tt.allowed {
|
||||
t.Fatalf("allowed = %v, want %v (%+v)", got.Allowed, tt.allowed, got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestCanaryGrantValidates pins that the canary grant passes the domain's
|
||||
// structural check and the engine's schema validation, so it can be installed
|
||||
// through the policy store.
|
||||
func TestCanaryGrantValidates(t *testing.T) {
|
||||
grant := access.CanaryGrantPolicy(org.DefaultOrgID, "canary-svc")
|
||||
forbid := access.CanaryGrantForbidPolicy(org.DefaultOrgID, "canary-svc")
|
||||
for _, p := range []access.Policy{grant, forbid} {
|
||||
if err := p.Validate(); err != nil {
|
||||
t.Fatalf("Validate %s: %v", p.ID, err)
|
||||
}
|
||||
}
|
||||
engine := New([]access.Policy{grant, forbid})
|
||||
for _, p := range []access.Policy{grant, forbid} {
|
||||
if err := engine.Validate(p); err != nil {
|
||||
t.Fatalf("engine Validate %s: %v", p.ID, err)
|
||||
}
|
||||
}
|
||||
if len(engine.Problems()) != 0 {
|
||||
t.Fatalf("problems = %v, want none", engine.Problems())
|
||||
}
|
||||
}
|
||||
@@ -1,253 +0,0 @@
|
||||
// Package releaseannounce turns versioned CHANGELOG sections into one-time
|
||||
// upgrade notifications.
|
||||
package releaseannounce
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/fsutil"
|
||||
)
|
||||
|
||||
type Sender = func(ctx context.Context, recipient int64, message string) error
|
||||
|
||||
type Announcer struct {
|
||||
StatePath string
|
||||
Components []Component
|
||||
}
|
||||
|
||||
type Component struct {
|
||||
ID string
|
||||
Label string
|
||||
Version string
|
||||
// Changelog is the CHANGELOG.md text the component's notes are read from.
|
||||
Changelog string
|
||||
}
|
||||
|
||||
func (a Announcer) Announce(ctx context.Context, recipients []int64, send Sender) error {
|
||||
if len(recipients) == 0 {
|
||||
return nil
|
||||
}
|
||||
if !hasReleasedComponent(a.Components) {
|
||||
return nil
|
||||
}
|
||||
if send == nil {
|
||||
return errors.New("release announcement sender is nil")
|
||||
}
|
||||
state, err := loadState(a.StatePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var errs []error
|
||||
for _, recipient := range recipients {
|
||||
if err := a.announceTo(ctx, recipient, send, state); err != nil {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return err
|
||||
}
|
||||
errs = append(errs, err)
|
||||
}
|
||||
}
|
||||
return errors.Join(errs...)
|
||||
}
|
||||
|
||||
func hasReleasedComponent(components []Component) bool {
|
||||
for _, component := range components {
|
||||
if _, valid := parseReleaseVersion(component.Version); valid {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// announceTo sends one recipient the release announcement if it is their
|
||||
// first time, or if their components have changed since the last check.
|
||||
func (a Announcer) announceTo(ctx context.Context, recipient int64, send Sender, state map[string]string) error {
|
||||
prefix := strconv.FormatInt(recipient, 10) + ":"
|
||||
|
||||
if !recipientSeen(state, prefix, a.Components) {
|
||||
return a.baselineRecipient(state, prefix)
|
||||
}
|
||||
|
||||
changed, stateChanged := a.detectChanged(state, prefix)
|
||||
if len(changed) == 0 {
|
||||
if stateChanged {
|
||||
return saveState(a.StatePath, state)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
return a.sendAndRecord(ctx, recipient, send, state, prefix, changed)
|
||||
}
|
||||
|
||||
func recipientSeen(state map[string]string, prefix string, components []Component) bool {
|
||||
for _, component := range components {
|
||||
if _, ok := state[prefix+component.ID]; ok {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (a Announcer) baselineRecipient(state map[string]string, prefix string) error {
|
||||
for _, component := range a.Components {
|
||||
if _, valid := parseReleaseVersion(component.Version); valid {
|
||||
state[prefix+component.ID] = component.Version
|
||||
}
|
||||
}
|
||||
return saveState(a.StatePath, state)
|
||||
}
|
||||
|
||||
// detectChanged finds components whose version has increased since the last
|
||||
// recorded state. It also detects previously-unseen components.
|
||||
func (a Announcer) detectChanged(state map[string]string, prefix string) (changed map[string]bool, stateChanged bool) {
|
||||
changed = make(map[string]bool, len(a.Components))
|
||||
for _, component := range a.Components {
|
||||
current, validCurrent := parseReleaseVersion(component.Version)
|
||||
if !validCurrent {
|
||||
continue
|
||||
}
|
||||
key := prefix + component.ID
|
||||
previousText, seen := state[key]
|
||||
if !seen {
|
||||
state[key] = component.Version
|
||||
stateChanged = true
|
||||
continue
|
||||
}
|
||||
previous, validPrevious := parseReleaseVersion(previousText)
|
||||
if !validPrevious || compareVersions(current, previous) > 0 {
|
||||
changed[component.ID] = true
|
||||
}
|
||||
}
|
||||
return changed, stateChanged
|
||||
}
|
||||
|
||||
// sendAndRecord sends the announcement and updates state on success.
|
||||
func (a Announcer) sendAndRecord(ctx context.Context, recipient int64, send Sender, state map[string]string, prefix string, changed map[string]bool) error {
|
||||
message, err := a.componentMessage(changed)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := ctx.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := send(ctx, recipient, message); err != nil {
|
||||
return fmt.Errorf("notify recipient %d: %w", recipient, err)
|
||||
}
|
||||
for _, component := range a.Components {
|
||||
if changed[component.ID] {
|
||||
state[prefix+component.ID] = component.Version
|
||||
}
|
||||
}
|
||||
if err := saveState(a.StatePath, state); err != nil {
|
||||
return fmt.Errorf("record notification for recipient %d: %w", recipient, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a Announcer) componentMessage(changed map[string]bool) (string, error) {
|
||||
var message strings.Builder
|
||||
message.WriteString("Archie has just been updated.")
|
||||
for _, component := range a.Components {
|
||||
fmt.Fprintf(&message, "\n\n--- %s ---\n\n", component.Label)
|
||||
if !changed[component.ID] {
|
||||
fmt.Fprintf(&message, "No %s changes as part of this release.", component.ID)
|
||||
continue
|
||||
}
|
||||
notes, err := changelogSection(component.Changelog, component.Version)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%s changelog: %w", component.ID, err)
|
||||
}
|
||||
fmt.Fprintf(&message, "%s installed - changes:\n\n%s", component.Version, notes)
|
||||
}
|
||||
return message.String(), nil
|
||||
}
|
||||
|
||||
type releaseVersion [3]uint64
|
||||
|
||||
func parseReleaseVersion(value string) (releaseVersion, bool) {
|
||||
// Release builds are stamped with or without the tag's "v".
|
||||
parts := strings.Split(strings.TrimPrefix(value, "v"), ".")
|
||||
if len(parts) != 3 {
|
||||
return releaseVersion{}, false
|
||||
}
|
||||
var parsed releaseVersion
|
||||
for index, part := range parts {
|
||||
if part == "" || (len(part) > 1 && part[0] == '0') {
|
||||
return releaseVersion{}, false
|
||||
}
|
||||
number, err := strconv.ParseUint(part, 10, 64)
|
||||
if err != nil {
|
||||
return releaseVersion{}, false
|
||||
}
|
||||
parsed[index] = number
|
||||
}
|
||||
return parsed, true
|
||||
}
|
||||
|
||||
func compareVersions(left, right releaseVersion) int {
|
||||
for index := range left {
|
||||
switch {
|
||||
case left[index] < right[index]:
|
||||
return -1
|
||||
case left[index] > right[index]:
|
||||
return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func changelogSection(changelog, version string) (string, error) {
|
||||
headerPrefix := "## [" + strings.TrimPrefix(version, "v") + "]"
|
||||
var lines []string
|
||||
found := false
|
||||
scanner := bufio.NewScanner(strings.NewReader(changelog))
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
if !found {
|
||||
found = strings.HasPrefix(line, headerPrefix)
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(line, "## ") {
|
||||
break
|
||||
}
|
||||
lines = append(lines, line)
|
||||
}
|
||||
if err := scanner.Err(); err != nil {
|
||||
return "", fmt.Errorf("read changelog: %w", err)
|
||||
}
|
||||
notes := strings.TrimSpace(strings.Join(lines, "\n"))
|
||||
if !found || notes == "" {
|
||||
return "", fmt.Errorf("changelog has no notes for release %s", version)
|
||||
}
|
||||
return notes, nil
|
||||
}
|
||||
|
||||
func loadState(path string) (map[string]string, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
return make(map[string]string), nil
|
||||
}
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("read release announcement state: %w", err)
|
||||
}
|
||||
state := make(map[string]string)
|
||||
if err := json.Unmarshal(data, &state); err != nil {
|
||||
return nil, fmt.Errorf("decode release announcement state: %w", err)
|
||||
}
|
||||
return state, nil
|
||||
}
|
||||
|
||||
func saveState(path string, state map[string]string) error {
|
||||
var buf strings.Builder
|
||||
if err := json.NewEncoder(&buf).Encode(state); err != nil {
|
||||
return fmt.Errorf("encode release announcement state: %w", err)
|
||||
}
|
||||
return fsutil.WriteFileAtomic(path, []byte(buf.String()), 0o600)
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
package releaseupdate
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// The canary host installs each release from the next channel. Its behaviour
|
||||
// in the window after a release was installed is compared with its own
|
||||
// behaviour in the window before, because there's only one production host to
|
||||
// compare with.
|
||||
const (
|
||||
// CanaryWindow is the default window a release runs on the canary before
|
||||
// it can be promoted. A day covers one full cycle of schedules and
|
||||
// traffic.
|
||||
CanaryWindow = 24 * time.Hour
|
||||
// canarySettle is how long the install and restart get, counted from when
|
||||
// the release was installed on the canary, before any check can fail the
|
||||
// release.
|
||||
canarySettle = 30 * time.Minute
|
||||
// minFinished is the fewest finished tasks needed to judge the park rate.
|
||||
minFinished = 5
|
||||
// minLogCoverage is how far back into the baseline window the error log
|
||||
// must reach before error counts are compared.
|
||||
minLogCoverage = time.Hour
|
||||
)
|
||||
|
||||
// CanaryDecision is what the evaluation says to do with a release.
|
||||
type CanaryDecision string
|
||||
|
||||
const (
|
||||
CanaryWait CanaryDecision = "wait"
|
||||
CanaryPromote CanaryDecision = "promote"
|
||||
CanaryRollBack CanaryDecision = "roll back"
|
||||
)
|
||||
|
||||
// CanaryWindowSignals is one window's task and error-log counts.
|
||||
type CanaryWindowSignals struct {
|
||||
// Finished counts tasks that reached a terminal or review status; Bad
|
||||
// is those that parked or died.
|
||||
Finished, Bad int
|
||||
// Errors counts error-level log lines within Covered, the part of the
|
||||
// window that the log still reaches.
|
||||
Errors int
|
||||
Covered time.Duration
|
||||
}
|
||||
|
||||
// CanarySignals is what the canary reported at one check.
|
||||
type CanarySignals struct {
|
||||
Installed string
|
||||
Ready bool
|
||||
// NewActionAlerts are open action-severity alerts first raised since
|
||||
// the release was installed.
|
||||
NewActionAlerts []string
|
||||
Baseline CanaryWindowSignals
|
||||
Canary CanaryWindowSignals
|
||||
}
|
||||
|
||||
// CanaryVerdict is a decision and the signals that decided it.
|
||||
type CanaryVerdict struct {
|
||||
Decision CanaryDecision
|
||||
Reasons []string
|
||||
}
|
||||
|
||||
// JudgeCanaryNow decides from the current signals alone, for an operator
|
||||
// promoting without waiting out the window: the settle and window waits are
|
||||
// skipped by construction, every hard and relative check still applies.
|
||||
func JudgeCanaryNow(version string, now time.Time, window time.Duration, s CanarySignals) CanaryVerdict {
|
||||
return JudgeCanary(version, now.Add(-(window + canarySettle)), now, window, s)
|
||||
}
|
||||
|
||||
// JudgeCanary decides what to do with a release, given when it was installed
|
||||
// on the canary host. Once the release has settled, a failed hard check rolls
|
||||
// it back at any time. Error and park rates 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.
|
||||
func JudgeCanary(version string, installedAt, now time.Time, window time.Duration, s CanarySignals) CanaryVerdict {
|
||||
elapsed := now.Sub(installedAt)
|
||||
if elapsed < canarySettle {
|
||||
return CanaryVerdict{Decision: CanaryWait, Reasons: []string{"settling after install"}}
|
||||
}
|
||||
var failed []string
|
||||
if s.Installed != version {
|
||||
failed = append(failed, fmt.Sprintf("canary runs %q, not %s: the install failed or was rolled back", s.Installed, version))
|
||||
}
|
||||
if !s.Ready {
|
||||
failed = append(failed, "readiness is degraded")
|
||||
}
|
||||
for _, alert := range s.NewActionAlerts {
|
||||
failed = append(failed, "new action alert: "+alert)
|
||||
}
|
||||
if len(failed) > 0 {
|
||||
return CanaryVerdict{Decision: CanaryRollBack, Reasons: failed}
|
||||
}
|
||||
var notes []string
|
||||
if reason, ok := judgeErrors(s.Baseline, s.Canary, window); !ok {
|
||||
failed = append(failed, reason)
|
||||
} else {
|
||||
notes = append(notes, reason)
|
||||
}
|
||||
if reason, ok := judgeParks(s.Baseline, s.Canary); !ok {
|
||||
failed = append(failed, reason)
|
||||
} else {
|
||||
notes = append(notes, reason)
|
||||
}
|
||||
if len(failed) > 0 {
|
||||
return CanaryVerdict{Decision: CanaryRollBack, Reasons: failed}
|
||||
}
|
||||
if elapsed < window {
|
||||
reasons := append([]string{fmt.Sprintf("%s of %s elapsed since the install", elapsed.Round(time.Minute), window)}, notes...)
|
||||
return CanaryVerdict{Decision: CanaryWait, Reasons: reasons}
|
||||
}
|
||||
return CanaryVerdict{Decision: CanaryPromote, Reasons: notes}
|
||||
}
|
||||
|
||||
// judgeErrors fails when the canary logged more than twice the baseline's
|
||||
// error lines plus ten. Each count is scaled up to a full window when the log
|
||||
// covers only part of its window.
|
||||
func judgeErrors(baseline, canary CanaryWindowSignals, window time.Duration) (string, bool) {
|
||||
if baseline.Covered < minLogCoverage || canary.Covered <= 0 {
|
||||
return "error log doesn't reach back over the baseline; error signal skipped", true
|
||||
}
|
||||
scale := func(w CanaryWindowSignals) float64 {
|
||||
return float64(w.Errors) * float64(window) / float64(w.Covered)
|
||||
}
|
||||
before, after := scale(baseline), scale(canary)
|
||||
limit := 2*before + 10
|
||||
if after > limit {
|
||||
return fmt.Sprintf("%.0f error log lines per window against a limit of %.0f (baseline %.0f)", after, limit, before), false
|
||||
}
|
||||
return fmt.Sprintf("%.0f error log lines per window, limit %.0f", after, limit), true
|
||||
}
|
||||
|
||||
// judgeParks fails when the share of finished tasks that parked or died rose
|
||||
// more than ten points over the baseline. Both windows need the minimum
|
||||
// finished tasks before the rates are compared.
|
||||
func judgeParks(baseline, canary CanaryWindowSignals) (string, bool) {
|
||||
if canary.Finished < minFinished || baseline.Finished < minFinished {
|
||||
return fmt.Sprintf("%d finished tasks on the canary and %d in the baseline, fewer than %d each; park signal skipped", canary.Finished, baseline.Finished, minFinished), true
|
||||
}
|
||||
rate := func(w CanaryWindowSignals) float64 {
|
||||
if w.Finished == 0 {
|
||||
return 0
|
||||
}
|
||||
return float64(w.Bad) / float64(w.Finished)
|
||||
}
|
||||
before, after := rate(baseline), rate(canary)
|
||||
if after > before+0.10 {
|
||||
return fmt.Sprintf("%.0f%% of tasks parked or died against %.0f%% before", 100*after, 100*before), false
|
||||
}
|
||||
return fmt.Sprintf("%.0f%% of tasks parked or died, %.0f%% before", 100*after, 100*before), true
|
||||
}
|
||||
@@ -1,337 +0,0 @@
|
||||
package releaseupdate
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// CanaryDashboard reaches the canary through its dashboard API, the same
|
||||
// contract an operator uses: it reads the signals, edits the update settings
|
||||
// through the control plane and installs through the dashboard updater.
|
||||
type CanaryDashboard struct {
|
||||
URL string
|
||||
Token string
|
||||
HTTP *http.Client
|
||||
}
|
||||
|
||||
// Statuses a finished task can be in, and the subset that counts against a
|
||||
// release.
|
||||
var (
|
||||
finishedStatuses = map[string]bool{"completed": true, "merged": true, "pr_open": true, "rejected": true, "closed_wont_do": true, "parked": true, "dead": true}
|
||||
badStatuses = map[string]bool{"parked": true, "dead": true}
|
||||
)
|
||||
|
||||
const updateSettingsPath = "/api/control-plane/resources/update-settings"
|
||||
|
||||
// Signals reads the canary's current state. Tasks and error lines are split
|
||||
// into the window before the release was installed on the canary and the time
|
||||
// since.
|
||||
func (d CanaryDashboard) Signals(ctx context.Context, installedAt, now time.Time, window time.Duration) (CanarySignals, error) {
|
||||
var s CanarySignals
|
||||
var err error
|
||||
if s.Installed, _, _, err = d.Installed(ctx); err != nil {
|
||||
return s, err
|
||||
}
|
||||
if s.Ready, err = d.ready(ctx); err != nil {
|
||||
return s, err
|
||||
}
|
||||
if s.NewActionAlerts, err = d.actionAlerts(ctx, installedAt); err != nil {
|
||||
return s, err
|
||||
}
|
||||
if err := d.tasks(ctx, installedAt, window, &s); err != nil {
|
||||
return s, err
|
||||
}
|
||||
return s, d.errors(ctx, installedAt, now, window, &s)
|
||||
}
|
||||
|
||||
// Installed returns the daemon version the canary runs, when that release was
|
||||
// installed on the canary host (zero when the host doesn't report it), and
|
||||
// the raw update snapshot it offers, which an install request must send back
|
||||
// unchanged.
|
||||
func (d CanaryDashboard) Installed(ctx context.Context) (version string, installedAt time.Time, snapshot json.RawMessage, err error) {
|
||||
var body struct {
|
||||
Snapshot json.RawMessage `json:"snapshot"`
|
||||
}
|
||||
if _, err := d.call(ctx, http.MethodGet, "/api/chat/update", nil, &body); err != nil {
|
||||
return "", time.Time{}, nil, err
|
||||
}
|
||||
var snap Snapshot
|
||||
if err := json.Unmarshal(body.Snapshot, &snap); err != nil {
|
||||
return "", time.Time{}, nil, fmt.Errorf("decode update snapshot: %w", err)
|
||||
}
|
||||
for _, c := range snap.Components {
|
||||
if c.ID == "daemon" {
|
||||
return c.Installed, snap.InstalledAt, body.Snapshot, nil
|
||||
}
|
||||
}
|
||||
return "", time.Time{}, body.Snapshot, errors.New("canary reports no daemon version")
|
||||
}
|
||||
|
||||
func (d CanaryDashboard) ready(ctx context.Context) (bool, error) {
|
||||
var report struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
if _, err := d.call(ctx, http.MethodGet, "/health/detailed", nil, &report); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return report.Status == "ok", nil
|
||||
}
|
||||
|
||||
func (d CanaryDashboard) actionAlerts(ctx context.Context, since time.Time) ([]string, error) {
|
||||
var body struct {
|
||||
Alerts []struct {
|
||||
Kind string `json:"kind"`
|
||||
Severity string `json:"severity"`
|
||||
Title string `json:"title"`
|
||||
FirstRaised time.Time `json:"first_raised"`
|
||||
} `json:"alerts"`
|
||||
}
|
||||
if _, err := d.call(ctx, http.MethodGet, "/api/alerts", nil, &body); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var titles []string
|
||||
for _, a := range body.Alerts {
|
||||
// A task needing a decision is the task's outcome, which the park
|
||||
// rate already judges against the baseline; counting each one as a
|
||||
// hard failure rolls back every release on a busy host.
|
||||
if a.Severity == "action" && !strings.HasPrefix(a.Kind, "task.") && !a.FirstRaised.Before(since) {
|
||||
titles = append(titles, a.Title)
|
||||
}
|
||||
}
|
||||
return titles, nil
|
||||
}
|
||||
|
||||
// tasks reads tasks, newest update first, until it reaches tasks older than
|
||||
// the baseline window.
|
||||
func (d CanaryDashboard) tasks(ctx context.Context, at time.Time, window time.Duration, s *CanarySignals) error {
|
||||
from := at.Add(-window)
|
||||
cursor := ""
|
||||
for range 50 {
|
||||
var page []struct {
|
||||
Status string `json:"status"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
path := "/api/tasks?limit=500"
|
||||
if cursor != "" {
|
||||
path += "&cursor=" + url.QueryEscape(cursor)
|
||||
}
|
||||
header, err := d.call(ctx, http.MethodGet, path, nil, &page)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, t := range page {
|
||||
if t.UpdatedAt.Before(from) || !finishedStatuses[t.Status] {
|
||||
continue
|
||||
}
|
||||
w := &s.Canary
|
||||
if t.UpdatedAt.Before(at) {
|
||||
w = &s.Baseline
|
||||
}
|
||||
w.Finished++
|
||||
if badStatuses[t.Status] {
|
||||
w.Bad++
|
||||
}
|
||||
}
|
||||
cursor = header.Get("X-Next-Cursor")
|
||||
if cursor == "" || len(page) == 0 || page[len(page)-1].UpdatedAt.Before(from) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// errors counts error-level lines in each window. A log read returns a
|
||||
// limited number of lines, so a truncated read only reaches back as far as
|
||||
// its oldest line.
|
||||
func (d CanaryDashboard) errors(ctx context.Context, at, now time.Time, window time.Duration, s *CanarySignals) error {
|
||||
var body struct {
|
||||
Entries []struct {
|
||||
Time time.Time `json:"time"`
|
||||
} `json:"entries"`
|
||||
Truncated bool `json:"truncated"`
|
||||
}
|
||||
if _, err := d.call(ctx, http.MethodGet, "/api/logs?level=error&limit=2000", nil, &body); err != nil {
|
||||
return err
|
||||
}
|
||||
from := at.Add(-window)
|
||||
if body.Truncated {
|
||||
from = now
|
||||
if len(body.Entries) > 0 {
|
||||
from = later(body.Entries[0].Time, at.Add(-window))
|
||||
}
|
||||
}
|
||||
for _, e := range body.Entries {
|
||||
switch {
|
||||
case e.Time.Before(from):
|
||||
case e.Time.Before(at):
|
||||
s.Baseline.Errors++
|
||||
default:
|
||||
s.Canary.Errors++
|
||||
}
|
||||
}
|
||||
s.Baseline.Covered = max(at.Sub(from), 0)
|
||||
s.Canary.Covered = now.Sub(later(from, at))
|
||||
return nil
|
||||
}
|
||||
|
||||
func later(a, b time.Time) time.Time {
|
||||
if a.After(b) {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// Follow sets the canary's update channel, keeping its release source and
|
||||
// key. A pin is used only by exact-pin.
|
||||
func (d CanaryDashboard) Follow(ctx context.Context, channel, pin string) error {
|
||||
var current struct {
|
||||
Resource struct {
|
||||
Version int64 `json:"version"`
|
||||
Value json.RawMessage `json:"value"`
|
||||
} `json:"resource"`
|
||||
}
|
||||
if _, err := d.call(ctx, http.MethodGet, updateSettingsPath, nil, ¤t); err != nil {
|
||||
return err
|
||||
}
|
||||
value := map[string]any{}
|
||||
if len(current.Resource.Value) > 0 && string(current.Resource.Value) != "null" {
|
||||
if err := json.Unmarshal(current.Resource.Value, &value); err != nil {
|
||||
return fmt.Errorf("decode update settings: %w", err)
|
||||
}
|
||||
}
|
||||
value["channel"], value["pin"] = channel, pin
|
||||
_, err := d.call(ctx, http.MethodPost, updateSettingsPath+"/commands/replace",
|
||||
map[string]any{"value": value, "expected_version": current.Resource.Version}, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
// Channel is the canary's update channel and pin.
|
||||
func (d CanaryDashboard) Channel(ctx context.Context) (channel, pin string, err error) {
|
||||
var current struct {
|
||||
Resource struct {
|
||||
Value struct {
|
||||
Channel string `json:"channel"`
|
||||
Pin string `json:"pin"`
|
||||
} `json:"value"`
|
||||
} `json:"resource"`
|
||||
}
|
||||
if _, err := d.call(ctx, http.MethodGet, updateSettingsPath, nil, ¤t); err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
if current.Resource.Value.Channel == "" {
|
||||
return "stable", "", nil
|
||||
}
|
||||
return current.Resource.Value.Channel, current.Resource.Value.Pin, nil
|
||||
}
|
||||
|
||||
// Install has the canary install version through its updater and waits until
|
||||
// it reports running it. The install restarts the dashboard, so a dropped
|
||||
// connection after the request is sent is expected.
|
||||
func (d CanaryDashboard) Install(ctx context.Context, version string, wait time.Duration) error {
|
||||
deadline := time.Now().Add(wait)
|
||||
requested := false
|
||||
for {
|
||||
installed, _, snapshot, err := d.Installed(ctx)
|
||||
switch {
|
||||
case err != nil:
|
||||
// The dashboard drops off while the install restarts it.
|
||||
if !requested {
|
||||
return err
|
||||
}
|
||||
case installed == version:
|
||||
return nil
|
||||
case !requested:
|
||||
// The canary caches its registry lookup, so a release just
|
||||
// published can take a few minutes to be offered.
|
||||
offered, err := offers(snapshot, version)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if offered {
|
||||
_, err := d.call(ctx, http.MethodPost, "/api/chat/update/install", map[string]json.RawMessage{"snapshot": snapshot}, nil)
|
||||
if _, ok := errors.AsType[statusError](err); ok {
|
||||
return err
|
||||
}
|
||||
requested = true
|
||||
}
|
||||
}
|
||||
if !time.Now().Before(deadline) {
|
||||
break
|
||||
}
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
case <-time.After(15 * time.Second):
|
||||
}
|
||||
}
|
||||
if !requested {
|
||||
return fmt.Errorf("canary didn't offer %s within %s", version, wait)
|
||||
}
|
||||
return fmt.Errorf("canary didn't report %s within %s", version, wait)
|
||||
}
|
||||
|
||||
// offers reports whether an update snapshot offers version.
|
||||
func offers(snapshot json.RawMessage, version string) (bool, error) {
|
||||
var offered Snapshot
|
||||
if err := json.Unmarshal(snapshot, &offered); err != nil {
|
||||
return false, fmt.Errorf("decode update snapshot: %w", err)
|
||||
}
|
||||
available := offered.Available()
|
||||
return len(available) > 0 && available[0].Available == version, nil
|
||||
}
|
||||
|
||||
type statusError struct {
|
||||
code int
|
||||
body string
|
||||
}
|
||||
|
||||
func (e statusError) Error() string { return fmt.Sprintf("dashboard answered %d: %s", e.code, e.body) }
|
||||
|
||||
func (d CanaryDashboard) call(ctx context.Context, method, path string, in, out any) (http.Header, error) {
|
||||
var body io.Reader
|
||||
if in != nil {
|
||||
data, err := json.Marshal(in)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
body = bytes.NewReader(data)
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
|
||||
defer cancel()
|
||||
req, err := http.NewRequestWithContext(ctx, method, strings.TrimRight(d.URL, "/")+path, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Header.Set("Authorization", "Bearer "+d.Token)
|
||||
if in != nil {
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
}
|
||||
client := d.HTTP
|
||||
if client == nil {
|
||||
client = http.DefaultClient
|
||||
}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s %s: %w", method, path, err)
|
||||
}
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
if resp.StatusCode/100 != 2 {
|
||||
text, _ := io.ReadAll(io.LimitReader(resp.Body, 512))
|
||||
return nil, fmt.Errorf("%s %s: %w", method, path, statusError{resp.StatusCode, strings.TrimSpace(string(text))})
|
||||
}
|
||||
if out == nil {
|
||||
return resp.Header, nil
|
||||
}
|
||||
if err := json.NewDecoder(resp.Body).Decode(out); err != nil {
|
||||
return nil, fmt.Errorf("%s %s: decode: %w", method, path, err)
|
||||
}
|
||||
return resp.Header, nil
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package releaseupdate
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// A release promotes only after a full window counted from its install with
|
||||
// no hard failure and no relative signal past its threshold; any failure after
|
||||
// settling rolls it back at once, even mid-window.
|
||||
func TestJudgeCanary(t *testing.T) {
|
||||
installed := time.Date(2026, 1, 2, 12, 0, 0, 0, time.UTC)
|
||||
healthy := func() CanarySignals {
|
||||
return CanarySignals{
|
||||
Installed: "1.1.0", Ready: true,
|
||||
Baseline: CanaryWindowSignals{Finished: 20, Bad: 2, Errors: 10, Covered: CanaryWindow},
|
||||
Canary: CanaryWindowSignals{Finished: 20, Bad: 2, Errors: 12, Covered: CanaryWindow},
|
||||
}
|
||||
}
|
||||
with := func(change func(*CanarySignals)) CanarySignals {
|
||||
s := healthy()
|
||||
change(&s)
|
||||
return s
|
||||
}
|
||||
cases := []struct {
|
||||
name string
|
||||
elapsed time.Duration // now minus the install time
|
||||
window time.Duration
|
||||
signals CanarySignals
|
||||
want CanaryDecision
|
||||
}{
|
||||
{"settling counts from the install", 10 * time.Minute, CanaryWindow, with(func(s *CanarySignals) { s.Ready = false }), CanaryWait},
|
||||
{"healthy mid-window waits", 2 * time.Hour, CanaryWindow, healthy(), CanaryWait},
|
||||
{"healthy at the window promotes", CanaryWindow, CanaryWindow, healthy(), CanaryPromote},
|
||||
{"healthy at a custom window promotes", 12 * time.Hour, 12 * time.Hour, healthy(), CanaryPromote},
|
||||
{"the watchdog rolled the install back", 2 * time.Hour, CanaryWindow, with(func(s *CanarySignals) { s.Installed = "1.0.0" }), CanaryRollBack},
|
||||
{"readiness degraded", 2 * time.Hour, CanaryWindow, with(func(s *CanarySignals) { s.Ready = false }), CanaryRollBack},
|
||||
{"a new action alert", 2 * time.Hour, CanaryWindow, with(func(s *CanarySignals) { s.NewActionAlerts = []string{"queue stalled"} }), CanaryRollBack},
|
||||
{"errors past twice the baseline plus ten", CanaryWindow, CanaryWindow, with(func(s *CanarySignals) { s.Canary.Errors = 31 }), CanaryRollBack},
|
||||
{"errors at the limit", CanaryWindow, CanaryWindow, with(func(s *CanarySignals) { s.Canary.Errors = 30 }), CanaryPromote},
|
||||
{"errors scaled from a partly covered log", CanaryWindow, CanaryWindow, with(func(s *CanarySignals) {
|
||||
s.Canary.Errors, s.Canary.Covered = 8, 6*time.Hour
|
||||
}), CanaryRollBack},
|
||||
{"a baseline the log doesn't reach skips errors", CanaryWindow, CanaryWindow, with(func(s *CanarySignals) {
|
||||
s.Baseline.Covered, s.Canary.Errors = 30*time.Minute, 500
|
||||
}), CanaryPromote},
|
||||
{"a mid-window error breach rolls back early", 2 * time.Hour, CanaryWindow, with(func(s *CanarySignals) { s.Canary.Errors = 31 }), CanaryRollBack},
|
||||
{"park rate up more than ten points", CanaryWindow, CanaryWindow, with(func(s *CanarySignals) { s.Canary.Bad = 5 }), CanaryRollBack},
|
||||
{"park rate up ten points", CanaryWindow, CanaryWindow, with(func(s *CanarySignals) { s.Canary.Bad = 4 }), CanaryPromote},
|
||||
{"too few canary tasks skips the park rate", CanaryWindow, CanaryWindow, with(func(s *CanarySignals) { s.Canary = CanaryWindowSignals{Finished: 4, Bad: 4, Covered: CanaryWindow} }), CanaryPromote},
|
||||
{"a thin baseline skips the park rate", CanaryWindow, CanaryWindow, with(func(s *CanarySignals) {
|
||||
s.Baseline.Finished, s.Baseline.Bad = 2, 0
|
||||
s.Canary.Bad = 5
|
||||
}), CanaryPromote},
|
||||
{"a mid-window park breach rolls back early", 2 * time.Hour, CanaryWindow, with(func(s *CanarySignals) { s.Canary.Bad = 5 }), CanaryRollBack},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
got := JudgeCanary("1.1.0", installed, installed.Add(tc.elapsed), tc.window, tc.signals)
|
||||
if got.Decision != tc.want {
|
||||
t.Fatalf("decision = %s, want %s (%v)", got.Decision, tc.want, got.Reasons)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Judging "now" skips the settle and window waits but still applies every
|
||||
// hard and relative check.
|
||||
func TestJudgeCanaryNow(t *testing.T) {
|
||||
healthy := CanarySignals{
|
||||
Installed: "1.1.0", Ready: true,
|
||||
Baseline: CanaryWindowSignals{Finished: 20, Bad: 2, Errors: 10, Covered: CanaryWindow},
|
||||
Canary: CanaryWindowSignals{Finished: 20, Bad: 2, Errors: 12, Covered: CanaryWindow},
|
||||
}
|
||||
now := time.Date(2026, 1, 2, 12, 10, 0, 0, time.UTC)
|
||||
if got := JudgeCanaryNow("1.1.0", now, CanaryWindow, healthy); got.Decision != CanaryPromote {
|
||||
t.Fatalf("healthy now = %s, want promote (%v)", got.Decision, got.Reasons)
|
||||
}
|
||||
degraded := healthy
|
||||
degraded.Ready = false
|
||||
if got := JudgeCanaryNow("1.1.0", now, CanaryWindow, degraded); got.Decision != CanaryRollBack {
|
||||
t.Fatalf("degraded now = %s, want roll back (%v)", got.Decision, got.Reasons)
|
||||
}
|
||||
breached := healthy
|
||||
breached.Canary.Bad = 10
|
||||
if got := JudgeCanaryNow("1.1.0", now, CanaryWindow, breached); got.Decision != CanaryRollBack {
|
||||
t.Fatalf("park breach now = %s, want roll back (%v)", got.Decision, got.Reasons)
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package releaseupdate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"oras.land/oras-go/v2/registry"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/distribution"
|
||||
)
|
||||
|
||||
// Installable reports whether a release can still be installed from source:
|
||||
// the zip blob its statement names must be present in the release repository
|
||||
// and the agent image it pins must still resolve. A canary must never be
|
||||
// pinned to a release whose artifacts are gone, or it would be stranded on a
|
||||
// version it can never install again.
|
||||
func Installable(ctx context.Context, source distribution.Source, release Release) error {
|
||||
zipDigest, err := digest.Parse(release.Statement.Zip.Digest)
|
||||
if err != nil {
|
||||
return fmt.Errorf("zip digest %q: %w", release.Statement.Zip.Digest, err)
|
||||
}
|
||||
repo, err := pushRepository(source.Reference)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
exists, err := repo.Exists(ctx, ocispec.Descriptor{Digest: zipDigest})
|
||||
if err != nil {
|
||||
return fmt.Errorf("resolve zip blob %s in %s: %w", release.Statement.Zip.Digest, source.Reference, err)
|
||||
}
|
||||
if !exists {
|
||||
return fmt.Errorf("zip blob %s (%s) is absent from %s", release.Statement.Zip.Digest, release.Statement.Zip.Name, source.Reference)
|
||||
}
|
||||
image, err := registry.ParseReference(release.Statement.AgentImage)
|
||||
if err != nil {
|
||||
return fmt.Errorf("agent image %q: %w", release.Statement.AgentImage, err)
|
||||
}
|
||||
imageRepo, err := pushRepository(image.Registry + "/" + image.Repository)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := imageRepo.Resolve(ctx, image.Reference); err != nil {
|
||||
return fmt.Errorf("agent image %s: %w", release.Statement.AgentImage, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -44,9 +44,6 @@ type Component struct {
|
||||
type Snapshot struct {
|
||||
Components []Component
|
||||
Deferred bool
|
||||
// InstalledAt is when the installed release was committed on this host,
|
||||
// from its installed.json. Zero when the host doesn't record one.
|
||||
InstalledAt time.Time `json:"installed_at"`
|
||||
}
|
||||
|
||||
func (s Snapshot) Available() []Component {
|
||||
|
||||
@@ -40,7 +40,6 @@ const (
|
||||
journalDir = "transaction"
|
||||
journalFile = "journal.json"
|
||||
snapshotFile = "db.pre-update.dump"
|
||||
installedFile = "installed.json"
|
||||
lockWait = 60 * time.Second
|
||||
)
|
||||
|
||||
@@ -127,39 +126,6 @@ type journal struct {
|
||||
// JournalPath is where an unfinished transaction lives.
|
||||
func JournalPath(stateDir string) string { return filepath.Join(stateDir, journalDir) }
|
||||
|
||||
// installedRecord is the host's durable note of which release it last
|
||||
// committed (or rolled back to) and when, so a canary can count its window
|
||||
// from the actual install rather than the release statement.
|
||||
type installedRecord struct {
|
||||
Version string `json:"version"`
|
||||
CommittedAt time.Time `json:"committed_at"`
|
||||
}
|
||||
|
||||
// recordInstall writes installed.json atomically: the file is the source of
|
||||
// truth for when the running release was installed.
|
||||
func recordInstall(stateDir, version string, at time.Time) error {
|
||||
data, err := json.Marshal(installedRecord{Version: version, CommittedAt: at.UTC()})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return fsutil.WriteFileAtomic(filepath.Join(stateDir, installedFile), data, 0o600)
|
||||
}
|
||||
|
||||
// LastInstall reads the host's installed record. ok is false when the file is
|
||||
// missing or malformed, as on a host that updated before install times were
|
||||
// recorded.
|
||||
func LastInstall(stateDir string) (version string, at time.Time, ok bool) {
|
||||
data, err := os.ReadFile(filepath.Join(stateDir, installedFile))
|
||||
if err != nil {
|
||||
return "", time.Time{}, false
|
||||
}
|
||||
var record installedRecord
|
||||
if err := json.Unmarshal(data, &record); err != nil || record.Version == "" || record.CommittedAt.IsZero() {
|
||||
return "", time.Time{}, false
|
||||
}
|
||||
return record.Version, record.CommittedAt, true
|
||||
}
|
||||
|
||||
// Run drives the transaction in the journal to an outcome. recovering is set
|
||||
// on boot: it never waits for the lock, and a transaction that was prepared
|
||||
// but never started is abandoned rather than started unattended.
|
||||
@@ -192,17 +158,6 @@ func (t *Transaction) Run(ctx context.Context, recovering bool) error {
|
||||
if err := t.startUnits(ctx, j, ""); err != nil {
|
||||
return err
|
||||
}
|
||||
// A crash between the outcome phase and recordInstall must not lose
|
||||
// the install record, so the recovery path writes it too.
|
||||
version := j.Version
|
||||
if j.Phase == phaseRolledBack {
|
||||
version = j.Previous[ComponentDaemon]
|
||||
}
|
||||
if version != "" {
|
||||
if err := recordInstall(t.StateDir, version, time.Now().UTC()); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return t.remove()
|
||||
default:
|
||||
return t.rollback(ctx, j)
|
||||
@@ -227,9 +182,6 @@ func (t *Transaction) promote(ctx context.Context, j journal) error {
|
||||
if err := t.setPhase(&j, phaseCommitted); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := recordInstall(t.StateDir, j.Version, time.Now().UTC()); err != nil {
|
||||
return fmt.Errorf("record the install: %w", err)
|
||||
}
|
||||
return t.remove()
|
||||
}
|
||||
|
||||
@@ -300,12 +252,6 @@ func (t *Transaction) rollback(ctx context.Context, j journal) error {
|
||||
if err := t.setPhase(&j, phaseRolledBack); err != nil {
|
||||
return t.incomplete(err)
|
||||
}
|
||||
// The host is back on the previous release; installed.json follows it.
|
||||
if version := j.Previous[ComponentDaemon]; version != "" {
|
||||
if err := recordInstall(t.StateDir, version, time.Now().UTC()); err != nil {
|
||||
return t.incomplete(err)
|
||||
}
|
||||
}
|
||||
if err := t.startUnits(ctx, j, started); err != nil {
|
||||
return t.incomplete(err)
|
||||
}
|
||||
|
||||
@@ -263,51 +263,10 @@ func TestTransaction(t *testing.T) {
|
||||
found && (got.HealthCheck != tt.want.report || got.RolledBack != (tt.want.report == "failed") || got.RestoredDatabase != tt.want.restoredDatabase) {
|
||||
t.Errorf("report = %+v (found %v), want %+v", got, found, tt.want)
|
||||
}
|
||||
// A transaction that ran to an outcome records which release the
|
||||
// host now runs and when it was installed.
|
||||
if tt.prepare == "" && tt.crashAt == "" {
|
||||
if version, at, ok := LastInstall(tx.StateDir); !ok || version != tt.want.version || at.IsZero() {
|
||||
t.Errorf("installed.json after the transaction = %q, %v, %v; want %s", version, at, ok, tt.want.version)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// installed.json is the host's durable record of which release it last
|
||||
// committed or rolled back to, and when.
|
||||
func TestLastInstall(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
if _, _, ok := LastInstall(dir); ok {
|
||||
t.Fatal("a missing installed.json reports ok")
|
||||
}
|
||||
at := time.Date(2026, 1, 2, 3, 4, 5, 0, time.UTC)
|
||||
if err := recordInstall(dir, "1.2.3", at); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var raw map[string]any
|
||||
data, err := os.ReadFile(filepath.Join(dir, installedFile))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
t.Fatalf("installed.json is not JSON: %v", err)
|
||||
}
|
||||
if raw["version"] != "1.2.3" || raw["committed_at"] != "2026-01-02T03:04:05Z" {
|
||||
t.Fatalf("installed.json = %v, want version 1.2.3 and committed_at 2026-01-02T03:04:05Z", raw)
|
||||
}
|
||||
version, got, ok := LastInstall(dir)
|
||||
if !ok || version != "1.2.3" || !got.Equal(at) {
|
||||
t.Fatalf("LastInstall = %q, %v, %v; want 1.2.3, %v, true", version, got, ok, at)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(dir, installedFile), []byte("{not json"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, _, ok := LastInstall(dir); ok {
|
||||
t.Fatal("a malformed installed.json reports ok")
|
||||
}
|
||||
}
|
||||
|
||||
// releaseHandler serves one release's zip and SHA256SUMS the way GitHub
|
||||
// release downloads are laid out.
|
||||
func releaseHandler(t *testing.T, candidate string, corrupt bool) (http.Handler, ed25519.PublicKey) {
|
||||
|
||||
@@ -16,7 +16,6 @@ import (
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/lifecycle"
|
||||
"github.com/samcharles93/archie-core/internal/domain/messaging"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/configuration"
|
||||
"github.com/samcharles93/archie-core/internal/releaseupdate"
|
||||
)
|
||||
|
||||
@@ -589,11 +588,6 @@ func (a *chatAPI) handleChatUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
a.failUpdateCheck(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
// The snapshot carries when the installed release was committed on this
|
||||
// host, so a canary can count its window from the actual install.
|
||||
if _, at, ok := releaseupdate.LastInstall(updateStateDir()); ok {
|
||||
snapshot.InstalledAt = at
|
||||
}
|
||||
writeJSON(w, map[string]any{
|
||||
"snapshot": snapshot,
|
||||
"available": snapshot.Available(),
|
||||
@@ -601,13 +595,6 @@ func (a *chatAPI) handleChatUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// updateStateDir resolves the host's update state directory the same way the
|
||||
// daemon does, so the dashboard reads the installed.json its transactions
|
||||
// write.
|
||||
func updateStateDir() string {
|
||||
return configuration.UpdateStateDir()
|
||||
}
|
||||
|
||||
func (a *chatAPI) handleChatUpdateDefer(w http.ResponseWriter, r *http.Request) {
|
||||
chat, ok := a.chatReady(w)
|
||||
if !ok {
|
||||
|
||||
@@ -1,424 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Rehearse the release-canary loop against a throwaway local host. Nothing
|
||||
# here touches production: a local OCI registry (docker run registry:2 on a
|
||||
# loopback port), a throwaway signing key, a test release published to that
|
||||
# registry (a stamped archied binary and a real agent image in a proper
|
||||
# distribution zip), and a local stack (state store, gateway, archied,
|
||||
# archie-ui) with its own config, state dir and ports. The loop's commands --
|
||||
# release canary start, release canary status, release canary check and
|
||||
# release canary promote -- are then run against that host, each step printed.
|
||||
# The loop authenticates with a scoped service-account token carrying only
|
||||
# the org-canary-grant policy (#1727), and a step proves that token is denied
|
||||
# everything outside the grant.
|
||||
# The local host has no systemd, so once the install has switched the binary
|
||||
# the script restarts archied itself, the way an unmanaged host's operator
|
||||
# would.
|
||||
#
|
||||
# A step that fails is printed and makes the run exit nonzero, so a rehearsal
|
||||
# never looks greener than it was. The only hard precondition is docker:
|
||||
# without it there is no registry, PostgreSQL or agent image.
|
||||
#
|
||||
# Never part of the gate: task check and CI do not call this.
|
||||
set -eu
|
||||
|
||||
repo=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
work=$(mktemp -d "${TMPDIR:-/tmp}/archie-canary-rehearse.XXXXXX")
|
||||
name=$(basename "$work")
|
||||
bin=$work/bin
|
||||
logs=$work/logs
|
||||
|
||||
pids=""
|
||||
containers=""
|
||||
keep=0 # set when a step fails: the workdir is kept for inspection
|
||||
cleanup() {
|
||||
trap - EXIT INT TERM
|
||||
for pid in $pids; do kill -- "-$pid" 2>/dev/null || kill "$pid" 2>/dev/null || true; done
|
||||
for c in $containers; do docker rm -f "$c" >/dev/null 2>&1 || true; done
|
||||
if [ "$keep" -gt 0 ]; then
|
||||
echo "canary-rehearse: keeping $work for inspection" >&2
|
||||
else
|
||||
rm -rf "$work"
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
die() {
|
||||
echo "canary-rehearse: $*" >&2
|
||||
keep=1
|
||||
exit 1
|
||||
}
|
||||
|
||||
# --- preflight ---------------------------------------------------------------
|
||||
|
||||
for tool in go curl python3 zip sha256sum timeout setsid openssl docker; do
|
||||
command -v "$tool" >/dev/null 2>&1 || die "$tool is required but not on PATH"
|
||||
done
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
die "docker is unavailable (docker info failed): the rehearsal needs it for the local OCI registry and PostgreSQL. Start the docker daemon or skip task canary:rehearse"
|
||||
fi
|
||||
|
||||
release_version=${CANARY_REHEARSE_VERSION:-9.9.9-canary.1}
|
||||
host_version="0.0.0-rehearse"
|
||||
|
||||
# Seven loopback ports, picked by binding port 0.
|
||||
set -- $(python3 -c '
|
||||
import socket
|
||||
ports = []
|
||||
while len(ports) < 7:
|
||||
s = socket.socket()
|
||||
s.bind(("127.0.0.1", 0))
|
||||
ports.append(s.getsockname()[1])
|
||||
s.close()
|
||||
print(" ".join(map(str, ports)))
|
||||
')
|
||||
reg_port=$1 pg_port=$2 web_port=$3 state_port=$4 gw_port=$5 daemon_port=$6 health_port=$7
|
||||
|
||||
# --- registry and PostgreSQL -------------------------------------------------
|
||||
|
||||
echo "== starting local OCI registry on 127.0.0.1:$reg_port and PostgreSQL on 127.0.0.1:$pg_port"
|
||||
timeout 300 docker run -d --name "$name-registry" -p "127.0.0.1:$reg_port:5000" registry:2 >/dev/null ||
|
||||
die "could not start registry:2 (is the image pullable?)"
|
||||
containers="$containers $name-registry"
|
||||
timeout 300 docker run -d --name "$name-pg" \
|
||||
-e POSTGRES_USER=archie -e POSTGRES_PASSWORD=archie -e POSTGRES_DB=archie \
|
||||
-p "127.0.0.1:$pg_port:5432" postgres:18 >/dev/null ||
|
||||
die "could not start postgres:18 (is the image pullable?)"
|
||||
containers="$containers $name-pg"
|
||||
|
||||
# --- build the host's binaries (no_ui: the rehearsal never serves the SPA) ----
|
||||
|
||||
echo "== building archie-state-store, archie-gateway, archied, archie-ui (no_ui)"
|
||||
mkdir -p "$bin" "$logs"
|
||||
ldflags="-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary -X github.com/samcharles93/archie-core/internal/buildinfo.Version=$host_version"
|
||||
for svc in archie-state-store archie-gateway archied archie-ui; do
|
||||
go -C "$repo" build -tags no_ui -trimpath -ldflags "$ldflags" -o "$bin/$svc" "./cmd/$svc" ||
|
||||
die "go build ./cmd/$svc failed"
|
||||
done
|
||||
|
||||
wait_http() { # url label tries
|
||||
i=0
|
||||
while [ "$i" -lt "${3:-30}" ]; do
|
||||
if curl -fsS --max-time 2 "$1" >/dev/null 2>&1; then return 0; fi
|
||||
i=$((i + 1)); sleep 1
|
||||
done
|
||||
die "$2 did not answer at $1 within ${3:-30}s"
|
||||
}
|
||||
wait_http "http://127.0.0.1:$reg_port/v2/" "the local registry" 30
|
||||
|
||||
i=0
|
||||
while ! docker exec "$name-pg" pg_isready -h 127.0.0.1 -p 5432 -U archie >/dev/null 2>&1; do
|
||||
i=$((i + 1))
|
||||
[ "$i" -gt 90 ] && die "PostgreSQL did not become ready within 90s"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# --- throwaway signing key and a test release --------------------------------
|
||||
|
||||
echo "== generating a throwaway release signing key"
|
||||
pub=$("$bin/archied" release keygen -seed "$work/seed") || die "release keygen failed"
|
||||
[ -n "$pub" ] || die "release keygen printed no public key"
|
||||
seed=$(cat "$work/seed")
|
||||
|
||||
# A real agent image in the local registry, so the install's image pull by
|
||||
# digest succeeds. The Dockerfile stamps the agent with the release version.
|
||||
echo "== building and pushing the archie-agent test image (this takes a few minutes)"
|
||||
timeout 1200 docker build -q -f "$repo/Dockerfile" --build-arg RUNTIME_VERSION="$release_version" \
|
||||
-t "127.0.0.1:$reg_port/archie-agent:v$release_version" "$repo" >/dev/null ||
|
||||
die "docker build of the agent image failed"
|
||||
timeout 600 docker push -q "127.0.0.1:$reg_port/archie-agent:v$release_version" >/dev/null ||
|
||||
die "docker push of the agent image failed"
|
||||
agent_image=$(docker image inspect -f '{{range .RepoDigests}}{{println .}}{{end}}' \
|
||||
"127.0.0.1:$reg_port/archie-agent:v$release_version" | grep "^127\.0\.0\.1:$reg_port/" | head -1)
|
||||
[ -n "$agent_image" ] || die "could not resolve the pushed agent image digest"
|
||||
|
||||
# A proper distribution zip, built the way deploy.yml builds it: every binary
|
||||
# the repo's release.json names, each stamped with the release version, plus
|
||||
# the manifest with the agent image pinned in.
|
||||
dist="archie-core-archied-v$release_version-linux-amd64"
|
||||
echo "== building the stamped release binaries and zipping $dist.zip"
|
||||
mkdir -p "$work/dist/$dist"
|
||||
release_ldflags="-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary -X github.com/samcharles93/archie-core/internal/buildinfo.Version=$release_version -X github.com/samcharles93/archie-core/internal/buildinfo.Runtime=$release_version -X github.com/samcharles93/archie-core/internal/app/agentworker.version=$release_version"
|
||||
for cmd in $(python3 -c 'import json; print(" ".join(json.load(open("'"$repo"'/release.json"))["required_topology"]["units"] + json.load(open("'"$repo"'/release.json"))["required_topology"].get("binaries", [])))'); do
|
||||
go -C "$repo" build -tags no_ui -trimpath -ldflags "$release_ldflags" \
|
||||
-o "$work/dist/$dist/$cmd" "./cmd/$cmd" || die "go build of $cmd failed"
|
||||
done
|
||||
python3 -c 'import json, sys
|
||||
m = json.load(open(sys.argv[1])); m["agent_image"] = sys.argv[2]
|
||||
print(json.dumps(m))' "$repo/release.json" "$agent_image" > "$work/dist/$dist/release.json"
|
||||
(CDPATH= cd -- "$work/dist" && zip -q -r "$work/release.zip" "$dist")
|
||||
|
||||
echo "== publishing test release $release_version to 127.0.0.1:$reg_port/archie"
|
||||
ARCHIE_RELEASE_SEED=$seed "$bin/archied" release publish \
|
||||
-source "127.0.0.1:$reg_port/archie" -version "$release_version" \
|
||||
-zip "$work/release.zip" -agent-image "$agent_image" ||
|
||||
die "release publish failed"
|
||||
|
||||
# --- the local host ----------------------------------------------------------
|
||||
|
||||
export XDG_CONFIG_HOME=$work/config XDG_DATA_HOME=$work/data XDG_STATE_HOME=$work/state
|
||||
export ARCHIE_UPDATE_STATE_DIR=$work/update-state
|
||||
# Point XDG_RUNTIME_DIR at a path that doesn't exist, so systemctl --user has
|
||||
# no bus: the rehearsal host reports unmanaged and the install switches the
|
||||
# binaries without trying to restart units through systemd.
|
||||
export XDG_RUNTIME_DIR=$work/no-user-bus
|
||||
mkdir -p "$XDG_CONFIG_HOME/archie" "$XDG_DATA_HOME" "$XDG_STATE_HOME" "$ARCHIE_UPDATE_STATE_DIR"
|
||||
|
||||
cfg=$XDG_CONFIG_HOME/archie/config.toml
|
||||
# A throwaway CA and per-service certificates, the way `task dev:tls` issues
|
||||
# them: archie-ui dials the daemon contract over mTLS even on
|
||||
# loopback, so the host cannot come up without [tls].
|
||||
tls=$work/tls
|
||||
mkdir -p "$tls"
|
||||
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 3650 \
|
||||
-subj "/CN=archie-rehearse-ca" -keyout "$tls/ca-key.pem" -out "$tls/ca.pem" 2>/dev/null ||
|
||||
die "could not create the throwaway CA"
|
||||
for s in archied archie-gateway archie-messaging archie-state-store archie-ui; do
|
||||
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 3650 \
|
||||
-subj "/CN=$s" -addext "subjectAltName=DNS:$s" -addext extendedKeyUsage=serverAuth,clientAuth \
|
||||
-CA "$tls/ca.pem" -CAkey "$tls/ca-key.pem" -keyout "$tls/$s-key.pem" -out "$tls/$s.pem" 2>/dev/null ||
|
||||
die "could not issue a certificate for $s"
|
||||
done
|
||||
sed \
|
||||
-e "s|^# database_url = .*|database_url = \"postgres://archie:archie@127.0.0.1:$pg_port/archie?sslmode=disable\"|" \
|
||||
-e "s|^listen = \"127.0.0.1:8485\"|listen = \"127.0.0.1:$health_port\"|" \
|
||||
-e "s|^listen = \"127.0.0.1:8484\"|listen = \"127.0.0.1:$web_port\"|" \
|
||||
-e "s|^target = \"127.0.0.1:8585\"|target = \"127.0.0.1:$gw_port\"\nlisten = \"127.0.0.1:$gw_port\"|" \
|
||||
-e "s|^target = \"127.0.0.1:9090\"|target = \"127.0.0.1:$state_port\"\nlisten = \"127.0.0.1:$state_port\"|" \
|
||||
"$repo/config.example.toml" > "$cfg"
|
||||
cat >> "$cfg" <<EOF
|
||||
|
||||
[services.daemon]
|
||||
target = "127.0.0.1:$daemon_port"
|
||||
listen = "127.0.0.1:$daemon_port"
|
||||
|
||||
[tls]
|
||||
ca_file = "$tls/ca.pem"
|
||||
cert_dir = "$tls"
|
||||
EOF
|
||||
|
||||
spawn() { # name command...
|
||||
svc=$1; shift
|
||||
setsid "$@" >"$logs/$svc.log" 2>&1 &
|
||||
pids="$pids $!"
|
||||
}
|
||||
|
||||
wait_port() { # port label tries
|
||||
i=0
|
||||
while [ "$i" -lt "${3:-90}" ]; do
|
||||
if python3 -c "import socket,sys; s=socket.socket(); s.settimeout(1); sys.exit(0 if s.connect_ex(('127.0.0.1', $1)) == 0 else 1)"; then
|
||||
return 0
|
||||
fi
|
||||
i=$((i + 1)); sleep 1
|
||||
done
|
||||
die "$2 did not listen on 127.0.0.1:$1; see $logs/$2.log (removed on exit -- rerun to inspect)"
|
||||
}
|
||||
|
||||
host_pids=""
|
||||
start_host() {
|
||||
spawn archie-state-store "$bin/archie-state-store"
|
||||
wait_port "$state_port" archie-state-store
|
||||
# The gateway only listens once archied has published its embedded NATS
|
||||
# endpoint, so the rest start together, as e2e/stack.sh does.
|
||||
spawn archie-gateway "$bin/archie-gateway"
|
||||
spawn archied "$bin/archied"
|
||||
spawn archie-ui "$bin/archie-ui"
|
||||
host_pids="$pids"
|
||||
wait_port "$gw_port" archie-gateway
|
||||
wait_port "$daemon_port" archied
|
||||
wait_port "$web_port" archie-ui
|
||||
}
|
||||
|
||||
echo "== starting the local host (state store, gateway, archied, archie-ui)"
|
||||
start_host
|
||||
|
||||
base="http://127.0.0.1:$web_port"
|
||||
cookie=$work/cookies.txt
|
||||
|
||||
api() { # method path [body]
|
||||
method=$1 path=$2 body=${3-}
|
||||
if [ -n "$body" ]; then
|
||||
curl -sS --max-time 15 -b "$cookie" -c "$cookie" -X "$method" "$base$path" \
|
||||
-H 'Content-Type: application/json' -H 'X-Archie-CSRF: 1' -H "Origin: $base" -d "$body"
|
||||
else
|
||||
curl -sS --max-time 15 -b "$cookie" -c "$cookie" "$base$path"
|
||||
fi
|
||||
}
|
||||
|
||||
py() { python3 -c "import sys, json; d = json.load(sys.stdin); print($1)"; }
|
||||
|
||||
# One throwaway account on the throwaway host, then a personal API token,
|
||||
# which is what the canary commands authenticate with.
|
||||
email="canary-rehearse@example.test"
|
||||
password="archie-canary-rehearse-password"
|
||||
account=$(python3 -c 'import json, sys
|
||||
print(json.dumps(dict(email=sys.argv[1], password=sys.argv[2], display_name="Canary rehearsal",
|
||||
organisation_name="Canary rehearsal", workspace_name="Rehearsal", public_url=sys.argv[3])))' \
|
||||
"$email" "$password" "$base")
|
||||
setup=$(api GET /api/auth/status)
|
||||
if printf '%s' "$setup" | py 'd["setup_required"]' | grep -q True; then
|
||||
api POST /api/auth/setup "$account" >/dev/null || die "account setup failed"
|
||||
else
|
||||
api POST /api/auth/login "$account" >/dev/null || die "login failed: $setup"
|
||||
fi
|
||||
token=$(api POST /api/tokens '{"name":"canary-rehearse","days":7}' | py 'd["token"]') ||
|
||||
die "could not create a personal API token on the local host"
|
||||
|
||||
# Point the host's update settings at the local registry and key.
|
||||
doc=$(api GET /api/control-plane/resources/update-settings)
|
||||
ver=$(printf '%s' "$doc" | py 'd["resource"]["version"]')
|
||||
value=$(python3 -c 'import json, sys
|
||||
print(json.dumps({"channel": "stable", "pin": "", "source": sys.argv[1], "key": sys.argv[2]}))' \
|
||||
"127.0.0.1:$reg_port/archie" "$pub")
|
||||
resp=$(api POST /api/control-plane/resources/update-settings/commands/replace \
|
||||
"{\"value\":$value,\"expected_version\":$ver}")
|
||||
printf '%s' "$resp" | grep -q '"resource"' || die "could not set update-settings on the local host: $resp"
|
||||
|
||||
# --- the scoped canary grant (#1727): a service account, not instance admin --
|
||||
# Create a service_account identity, mint a token for it, install the
|
||||
# org-canary-grant policy, then prove the token can read the signals but
|
||||
# nothing else.
|
||||
echo
|
||||
echo "== creating the canary service account and installing the scoped grant"
|
||||
canary_id=$(api POST /api/identities '{"display_name":"canary","kind":"service_account"}' | py 'd["id"]') ||
|
||||
die "could not create the canary service account"
|
||||
[ -n "$canary_id" ] || die "identity create printed no id"
|
||||
scoped=$(api POST "/api/identities/$canary_id/tokens" '{"name":"canary","days":7}' | py 'd["token"]') ||
|
||||
die "could not mint a token for the canary identity"
|
||||
[ -n "$scoped" ] || die "token create printed no token"
|
||||
grant_policy() { # id prefix permit|forbid -> policy JSON on stdout
|
||||
python3 -c 'import json, sys
|
||||
who, effect, identity = sys.argv[1], sys.argv[2], sys.argv[3]
|
||||
actions = """(
|
||||
(action == Archie::Action::"read" && ["dashboard", "task"].contains(resource.kind)) ||
|
||||
(action == Archie::Action::"read" && resource == Archie::Object::"update-settings") ||
|
||||
(action == Archie::Action::"update" && resource == Archie::Object::"update") ||
|
||||
(action == Archie::Action::"manage_identities" && resource == Archie::Object::"update-settings")
|
||||
)"""
|
||||
body = """ resource.org == principal.org &&
|
||||
principal == Archie::Identity::"%s" &&
|
||||
%s%s""" % (identity, "!" if effect == "forbid" else "", actions)
|
||||
print(json.dumps({"id": "org-canary-grant" + ("-forbid" if effect == "forbid" else ""),
|
||||
"level": "org", "org_id": "org-sys",
|
||||
"text": "%s(principal, action, resource) when {\n%s\n};" % (effect, body)}))' "$1" "$2" "$canary_id"
|
||||
}
|
||||
for effect in permit forbid; do
|
||||
resp=$(api PUT /api/access/policies "$(grant_policy grant "$effect")")
|
||||
printf '%s' "$resp" | grep -q '"version"' || die "could not install the canary grant $effect policy: $resp"
|
||||
done
|
||||
|
||||
bearer() { # path -> curl with the scoped token, prints the status code
|
||||
curl -sS --max-time 15 -o /dev/null -w '%{http_code}' \
|
||||
-H "Authorization: Bearer $scoped" "$base$1"
|
||||
}
|
||||
bearer_body() { # path -> curl with the scoped token, prints the body
|
||||
curl -sS --max-time 15 -H "Authorization: Bearer $scoped" "$base$1"
|
||||
}
|
||||
# The policy chain reloads asynchronously; allow a few seconds for the grant.
|
||||
# The negative probe can run now; the positive one must wait for the canary
|
||||
# loop to switch the channel to next (a missing stable tag is a 502 from the
|
||||
# update check, not an authorization answer).
|
||||
i=0
|
||||
code=000
|
||||
while :; do
|
||||
code=$(bearer /api/access/policies)
|
||||
[ "$code" != "200" ] && break
|
||||
i=$((i + 1)); [ "$i" -gt 45 ] && die "the scoped canary token can read the policies API: the grant is not scoped"
|
||||
sleep 1
|
||||
done
|
||||
echo "scoped token reads /api/access/policies: $code (denied, as intended)"
|
||||
|
||||
# --- the canary loop, each step printed ---------------------------------------
|
||||
|
||||
failed=0
|
||||
run_step() { # description command...
|
||||
desc=$1; shift
|
||||
echo
|
||||
echo "== $desc"
|
||||
printf '$ %s\n' "$*"
|
||||
if "$@" 2>&1; then
|
||||
echo "-- ok"
|
||||
else
|
||||
rc=$?
|
||||
echo "-- FAILED (exit $rc)"
|
||||
failed=$((failed + 1))
|
||||
keep=1
|
||||
fi
|
||||
}
|
||||
|
||||
# The canary loop runs with the scoped service-account token, not the admin
|
||||
# one: that is the point of #1727.
|
||||
export ARCHIE_CANARY_TOKEN=$scoped
|
||||
|
||||
echo
|
||||
echo "== release canary start -- point the host at next and install $release_version"
|
||||
printf '$ archied release canary start -dashboard %s -version %s -source 127.0.0.1:%s/archie -key <pub>\n' \
|
||||
"$base" "$release_version" "$reg_port"
|
||||
timeout 600 "$bin/archied" release canary start -dashboard "$base" -version "$release_version" \
|
||||
-source "127.0.0.1:$reg_port/archie" -key "$pub" >"$work/start.out" 2>&1 &
|
||||
start_pid=$!
|
||||
# The local host has no systemd: the install switches the binary and records
|
||||
# the install time, but nothing restarts the daemon. Restart archied once the
|
||||
# install has committed, the way an unmanaged host's operator would, so the
|
||||
# host reports the new version.
|
||||
i=0
|
||||
while [ ! -f "$ARCHIE_UPDATE_STATE_DIR/installed.json" ]; do
|
||||
kill -0 "$start_pid" 2>/dev/null || break
|
||||
i=$((i + 1)); [ "$i" -gt 300 ] && break
|
||||
sleep 1
|
||||
done
|
||||
if [ -f "$ARCHIE_UPDATE_STATE_DIR/installed.json" ]; then
|
||||
# Restart every service, not just the daemon: the update snapshot reports
|
||||
# the serving binary's version, so the whole host must come back on the
|
||||
# new release.
|
||||
for pid in $host_pids; do kill "$pid" 2>/dev/null || true; done
|
||||
sleep 1
|
||||
pids=""
|
||||
start_host
|
||||
fi
|
||||
start_rc=0
|
||||
wait "$start_pid" || start_rc=$?
|
||||
cat "$work/start.out"
|
||||
if [ "$start_rc" -eq 0 ]; then
|
||||
echo "-- ok"
|
||||
else
|
||||
echo "-- FAILED (exit $start_rc)"
|
||||
failed=$((failed + 1))
|
||||
keep=1
|
||||
fi
|
||||
|
||||
# Now that the canary follows next, the scoped token's positive probe: the
|
||||
# policy chain reloads asynchronously, so allow a few seconds.
|
||||
i=0
|
||||
code=000
|
||||
while :; do
|
||||
code=$(bearer /api/chat/update)
|
||||
[ "$code" = "200" ] && break
|
||||
i=$((i + 1)); [ "$i" -gt 45 ] && die "the scoped canary token never got read access to /api/chat/update (last status $code: $(bearer_body /api/chat/update))"
|
||||
sleep 1
|
||||
done
|
||||
echo "scoped token reads /api/chat/update: 200"
|
||||
|
||||
run_step "release canary status -- what the canary runs and how the window is going" \
|
||||
timeout 120 "$bin/archied" release canary status -dashboard "$base" \
|
||||
-source "127.0.0.1:$reg_port/archie" -key "$pub"
|
||||
|
||||
run_step "release canary check -- judge the installed release (still settling right after the install)" \
|
||||
timeout 300 "$bin/archied" release canary check -dashboard "$base" \
|
||||
-source "127.0.0.1:$reg_port/archie" -key "$pub" -checkout "$repo"
|
||||
|
||||
run_step "release canary promote -- promote $release_version now that its hard checks pass" \
|
||||
timeout 120 "$bin/archied" release canary promote -dashboard "$base" -version "$release_version" \
|
||||
-source "127.0.0.1:$reg_port/archie" -key "$pub"
|
||||
|
||||
echo
|
||||
if [ "$failed" -gt 0 ]; then
|
||||
echo "canary-rehearse: $failed step(s) failed; the steps above show why." >&2
|
||||
if [ "$keep" -gt 0 ] && [ -d "$logs" ]; then
|
||||
for f in "$logs"/*.log; do
|
||||
echo "--- $f" >&2
|
||||
tail -n 20 "$f" >&2
|
||||
done
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
echo "canary-rehearse: every step ran clean; host was $base, registry 127.0.0.1:$reg_port (both torn down)"
|
||||
@@ -1,206 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// changelogPath is the one file the release stream lives in. The two
|
||||
// per-component changelogs were merged into it; their history is a section of
|
||||
// this file rather than a separate source.
|
||||
const changelogPath = "CHANGELOG.md"
|
||||
|
||||
// release is one changelog section: the facts a host needs to render a version.
|
||||
// The per-component detail is inside Body, as labelled level-three sections.
|
||||
type release struct {
|
||||
Version string `json:"version"`
|
||||
Date string `json:"date"`
|
||||
Body string `json:"body"`
|
||||
}
|
||||
|
||||
// releaseHeading matches a changelog release heading. The date is optional in
|
||||
// the pattern so `## [Unreleased]` is recognised and skipped rather than read as
|
||||
// a release with an invented date.
|
||||
var releaseHeading = regexp.MustCompile(`^## \[([^\]]+)\](?:\s*-\s*(\d{4}-\d{2}-\d{2}))?$`)
|
||||
|
||||
// inlineLink matches the target of a Markdown link or image.
|
||||
var inlineLink = regexp.MustCompile(`\]\(([^)]+)\)`)
|
||||
|
||||
// linkScheme matches an absolute link target: a URL scheme, a site-root path or
|
||||
// an in-page anchor. Everything else is relative to the changelog's directory.
|
||||
var linkScheme = regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9+.-]*:`)
|
||||
|
||||
// parseChangelog reads the release sections out of the changelog. `Unreleased`
|
||||
// is skipped, not dropped: it is the one place unfinished work is recorded and
|
||||
// it carries no version to publish.
|
||||
func parseChangelog(source string) ([]release, error) {
|
||||
var releases []release
|
||||
for _, section := range splitSections(source) {
|
||||
if !strings.HasPrefix(section.heading, "## [") {
|
||||
continue
|
||||
}
|
||||
match := releaseHeading.FindStringSubmatch(section.heading)
|
||||
if match == nil {
|
||||
return nil, fmt.Errorf("%s: %q is not a release heading; write `## [<version>] - <date>`", changelogPath, section.heading)
|
||||
}
|
||||
version, date := match[1], match[2]
|
||||
if version == "Unreleased" {
|
||||
continue
|
||||
}
|
||||
if date == "" {
|
||||
return nil, fmt.Errorf("%s: release %s has no date; write `## [<version>] - <date>`", changelogPath, version)
|
||||
}
|
||||
if section.body == "" {
|
||||
return nil, fmt.Errorf("%s: release %s has no notes", changelogPath, version)
|
||||
}
|
||||
if target, ok := relativeLink(section.body); ok {
|
||||
return nil, fmt.Errorf("%s: release %s has a relative link %q; release-notes links must be absolute", changelogPath, version, target)
|
||||
}
|
||||
releases = append(releases, release{
|
||||
Version: version,
|
||||
Date: date,
|
||||
Body: section.body,
|
||||
})
|
||||
}
|
||||
return releases, nil
|
||||
}
|
||||
|
||||
// section is a level-two block: its heading line and the body that follows it.
|
||||
type section struct {
|
||||
heading string
|
||||
body string
|
||||
}
|
||||
|
||||
// splitSections divides a changelog at every level-two heading. Level-three
|
||||
// headings stay inside their section's body, and a `##` line inside a fenced
|
||||
// code block is prose about markdown rather than a heading.
|
||||
func splitSections(source string) []section {
|
||||
var sections []section
|
||||
current := section{}
|
||||
started := false
|
||||
inFence := false
|
||||
for _, raw := range strings.Split(source, "\n") {
|
||||
line := strings.TrimRight(raw, " \t")
|
||||
if isFence(line) {
|
||||
inFence = !inFence
|
||||
}
|
||||
if !inFence && strings.HasPrefix(line, "## ") {
|
||||
if started {
|
||||
current.body = strings.Trim(current.body, "\n")
|
||||
sections = append(sections, current)
|
||||
}
|
||||
current = section{heading: line}
|
||||
started = true
|
||||
continue
|
||||
}
|
||||
if started {
|
||||
current.body += line + "\n"
|
||||
}
|
||||
}
|
||||
if started {
|
||||
current.body = strings.Trim(current.body, "\n")
|
||||
sections = append(sections, current)
|
||||
}
|
||||
return sections
|
||||
}
|
||||
|
||||
// isFence reports whether a line opens or closes a fenced code block.
|
||||
func isFence(line string) bool {
|
||||
trimmed := strings.TrimSpace(line)
|
||||
return strings.HasPrefix(trimmed, "```") || strings.HasPrefix(trimmed, "~~~")
|
||||
}
|
||||
|
||||
// relativeLink returns the first link target in the body that is not absolute.
|
||||
func relativeLink(body string) (string, bool) {
|
||||
for _, match := range inlineLink.FindAllStringSubmatch(body, -1) {
|
||||
target := strings.TrimSpace(match[1])
|
||||
if i := strings.IndexAny(target, " \t"); i >= 0 {
|
||||
target = strings.TrimSpace(target[:i]) // drop an optional link title
|
||||
}
|
||||
target = strings.Trim(target, "<>")
|
||||
if target == "" || strings.HasPrefix(target, "#") || strings.HasPrefix(target, "/") {
|
||||
continue
|
||||
}
|
||||
if linkScheme.MatchString(target) {
|
||||
continue
|
||||
}
|
||||
return target, true
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
// sortReleases orders releases newest first, then by descending version. Every
|
||||
// host renders this order, so the canonical artifact is also the ordering
|
||||
// contract.
|
||||
func sortReleases(releases []release) {
|
||||
sort.SliceStable(releases, func(i, j int) bool {
|
||||
a, b := releases[i], releases[j]
|
||||
if a.Date != b.Date {
|
||||
return a.Date > b.Date
|
||||
}
|
||||
return compareVersions(a.Version, b.Version) > 0
|
||||
})
|
||||
}
|
||||
|
||||
// compareVersions orders dotted versions by their numeric parts, so 1.9.10 is
|
||||
// newer than 1.9.9. A version carrying a prerelease is older than the same
|
||||
// version without one.
|
||||
func compareVersions(a, b string) int {
|
||||
aCore, aPre := splitPrerelease(a)
|
||||
bCore, bPre := splitPrerelease(b)
|
||||
if c := compareDotted(aCore, bCore); c != 0 {
|
||||
return c
|
||||
}
|
||||
switch {
|
||||
case aPre == bPre:
|
||||
return 0
|
||||
case aPre == "":
|
||||
return 1
|
||||
case bPre == "":
|
||||
return -1
|
||||
case aPre < bPre:
|
||||
return -1
|
||||
default:
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
func splitPrerelease(version string) (core, prerelease string) {
|
||||
if i := strings.IndexAny(version, "-+"); i >= 0 {
|
||||
return version[:i], version[i+1:]
|
||||
}
|
||||
return version, ""
|
||||
}
|
||||
|
||||
func compareDotted(a, b string) int {
|
||||
as, bs := strings.Split(a, "."), strings.Split(b, ".")
|
||||
for i := 0; i < len(as) || i < len(bs); i++ {
|
||||
var av, bv string
|
||||
if i < len(as) {
|
||||
av = as[i]
|
||||
}
|
||||
if i < len(bs) {
|
||||
bv = bs[i]
|
||||
}
|
||||
an, aerr := strconv.Atoi(av)
|
||||
bn, berr := strconv.Atoi(bv)
|
||||
switch {
|
||||
case aerr == nil && berr == nil:
|
||||
if an != bn {
|
||||
if an < bn {
|
||||
return -1
|
||||
}
|
||||
return 1
|
||||
}
|
||||
case av != bv:
|
||||
if av < bv {
|
||||
return -1
|
||||
}
|
||||
return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
// Command newsgen generates docs/news/releases.json and redirects.json from
|
||||
// CHANGELOG.md. `newsgen check` fails when the committed files are stale.
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type mode int
|
||||
|
||||
const (
|
||||
modeWrite mode = iota
|
||||
modeCheck
|
||||
)
|
||||
|
||||
// options is a parsed command line.
|
||||
type options struct {
|
||||
mode mode
|
||||
repoRoot string
|
||||
}
|
||||
|
||||
func main() {
|
||||
parsed, err := parseOptions(os.Args[1:])
|
||||
if err != nil {
|
||||
log.Fatalf("newsgen: %v", err)
|
||||
}
|
||||
if parsed.mode == modeCheck {
|
||||
err = check(parsed.repoRoot)
|
||||
} else {
|
||||
err = write(parsed.repoRoot)
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatalf("newsgen: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// parseOptions resolves the optional `check` subcommand and the flags that
|
||||
// follow it. A leftover positional argument is an error rather than something
|
||||
// to ignore: `newsgen --repo-root .. check` would otherwise fall through to the
|
||||
// write path and rewrite the files that check promises not to touch.
|
||||
func parseOptions(args []string) (options, error) {
|
||||
selected := modeWrite
|
||||
if len(args) > 0 && args[0] == "check" {
|
||||
selected = modeCheck
|
||||
args = args[1:]
|
||||
}
|
||||
flags := flag.NewFlagSet("newsgen", flag.ContinueOnError)
|
||||
flags.SetOutput(io.Discard)
|
||||
repoRoot := flags.String("repo-root", "..", "path to the repository root")
|
||||
if err := flags.Parse(args); err != nil {
|
||||
return options{}, err
|
||||
}
|
||||
if extra := flags.Args(); len(extra) > 0 {
|
||||
return options{}, fmt.Errorf("unexpected argument %q", extra[0])
|
||||
}
|
||||
return options{mode: selected, repoRoot: *repoRoot}, nil
|
||||
}
|
||||
|
||||
// load parses the changelog and returns the releases newest first.
|
||||
func load(repoRoot string) ([]release, error) {
|
||||
source, err := os.ReadFile(filepath.Join(repoRoot, changelogPath))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("read %s: %w", changelogPath, err)
|
||||
}
|
||||
releases, err := parseChangelog(string(source))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sortReleases(releases)
|
||||
return releases, nil
|
||||
}
|
||||
|
||||
// write regenerates the owned files, skipping any whose bytes already match so
|
||||
// a re-run cannot dirty a release commit.
|
||||
func write(repoRoot string) error {
|
||||
releases, err := load(repoRoot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
files, err := render(releases)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
updated := 0
|
||||
for path, body := range files {
|
||||
abs := filepath.Join(repoRoot, filepath.FromSlash(path))
|
||||
current, err := os.ReadFile(abs)
|
||||
switch {
|
||||
case err == nil && bytes.Equal(current, body):
|
||||
continue
|
||||
case err != nil && !errors.Is(err, fs.ErrNotExist):
|
||||
return fmt.Errorf("read %s: %w", path, err)
|
||||
}
|
||||
if err := os.MkdirAll(filepath.Dir(abs), 0o755); err != nil {
|
||||
return fmt.Errorf("create %s: %w", filepath.Dir(path), err)
|
||||
}
|
||||
if err := os.WriteFile(abs, body, 0o644); err != nil {
|
||||
return fmt.Errorf("write %s: %w", path, err)
|
||||
}
|
||||
updated++
|
||||
}
|
||||
fmt.Printf("newsgen: %d releases, %d files updated\n", len(releases), updated)
|
||||
return nil
|
||||
}
|
||||
|
||||
// check reports every difference between the committed files and a fresh
|
||||
// derivation, without touching the working tree.
|
||||
func check(repoRoot string) error {
|
||||
releases, err := load(repoRoot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
files, err := render(releases)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var problems []string
|
||||
for path, expected := range files {
|
||||
current, err := os.ReadFile(filepath.Join(repoRoot, filepath.FromSlash(path)))
|
||||
switch {
|
||||
case errors.Is(err, fs.ErrNotExist):
|
||||
problems = append(problems, path+" is missing")
|
||||
continue
|
||||
case err != nil:
|
||||
return fmt.Errorf("read %s: %w", path, err)
|
||||
}
|
||||
if !bytes.Equal(current, expected) {
|
||||
problems = append(problems, path+" does not match the changelog")
|
||||
}
|
||||
}
|
||||
if len(problems) > 0 {
|
||||
sort.Strings(problems)
|
||||
return fmt.Errorf("release notes are stale:\n %s\n fix with `task news`, then commit the result",
|
||||
strings.Join(problems, "\n "))
|
||||
}
|
||||
fmt.Printf("newsgen: %d release notes match the changelog\n", len(releases))
|
||||
return nil
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// releasesJSONPath is the canonical, host-neutral artifact every renderer
|
||||
// reads. It lives with the news it describes, in the one directory this tool
|
||||
// owns end-to-end, so it cannot collide with another generator's output.
|
||||
const releasesJSONPath = "docs/news/releases.json"
|
||||
|
||||
// redirectsJSONPath is the redirect table. The per-component pages were retired,
|
||||
// so every `/news/<component>/<version>/` URL published before the merge is
|
||||
// mapped to the unified page for that version. It is generated beside the
|
||||
// canonical release facts so the two stay in sync.
|
||||
const redirectsJSONPath = "docs/news/redirects.json"
|
||||
|
||||
// legacyComponentDirs are the URL namespaces the per-component pages used. Both
|
||||
// are mapped for every version rather than only the component that released it,
|
||||
// so a published URL resolves whether or not that component ever carried that
|
||||
// version, and the table is derived from the version set instead of a list.
|
||||
var legacyComponentDirs = []string{"archied", "archie"}
|
||||
|
||||
// render returns every generated file keyed by repo-relative path. It is pure:
|
||||
// the same releases always produce the same bytes, so the write path can skip a
|
||||
// file that is already current.
|
||||
func render(releases []release) (map[string][]byte, error) {
|
||||
if releases == nil {
|
||||
releases = []release{}
|
||||
}
|
||||
canonical, err := encodeCanonical(releases)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
redirects, err := encodeRedirects(releases)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
files := map[string][]byte{
|
||||
releasesJSONPath: canonical,
|
||||
redirectsJSONPath: redirects,
|
||||
}
|
||||
return files, nil
|
||||
}
|
||||
|
||||
// encodeCanonical writes the JSON every host reads. HTML escaping is off so
|
||||
// the artifact stays readable to a reviewer and to a non-Go consumer: the
|
||||
// changelogs write `->` and `<memory>`, not `\u003e` and `\u003cmemory\u003e`.
|
||||
func encodeCanonical(releases []release) ([]byte, error) {
|
||||
return encodeJSON(releasesJSONPath, releases)
|
||||
}
|
||||
|
||||
// encodeRedirects writes the old-URL to new-URL table. encoding/json orders map
|
||||
// keys, so the artifact is deterministic.
|
||||
func encodeRedirects(releases []release) ([]byte, error) {
|
||||
table := map[string]string{}
|
||||
for _, r := range releases {
|
||||
for _, component := range legacyComponentDirs {
|
||||
table[fmt.Sprintf("/news/%s/%s/", component, r.Version)] = fmt.Sprintf("/news/%s/", r.Version)
|
||||
}
|
||||
}
|
||||
return encodeJSON(redirectsJSONPath, table)
|
||||
}
|
||||
|
||||
func encodeJSON(path string, value any) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
encoder := json.NewEncoder(&buf)
|
||||
encoder.SetEscapeHTML(false)
|
||||
encoder.SetIndent("", " ")
|
||||
if err := encoder.Encode(value); err != nil {
|
||||
return nil, fmt.Errorf("encode %s: %w", path, err)
|
||||
}
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
@@ -1,186 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { ReadError } from "@/components/ui/read-error";
|
||||
import { MetadataList } from "@/components/ui/metadata-list";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { ApiError, api } from "@/lib/api";
|
||||
import { useSettingsStore } from "@/stores/settings";
|
||||
|
||||
/**
|
||||
* The release canary on this host, read-only: the update settings in force,
|
||||
* the installed release, how long it has been installed and how far through
|
||||
* the default canary window that is. Installing and promoting releases run
|
||||
* in the update UI and CI, not here.
|
||||
*/
|
||||
|
||||
// The wire shape of GET /api/chat/update: Go's default field names, except
|
||||
// installed_at, which the server tags. Zero time means no install recorded.
|
||||
interface UpdateComponent {
|
||||
ID: string;
|
||||
Label: string;
|
||||
Installed: string;
|
||||
Available: string;
|
||||
Reference?: string;
|
||||
Changelog?: string;
|
||||
}
|
||||
|
||||
interface UpdateSnapshot {
|
||||
Components: UpdateComponent[];
|
||||
Deferred?: boolean;
|
||||
installed_at?: string;
|
||||
}
|
||||
|
||||
interface ChatUpdate {
|
||||
snapshot: UpdateSnapshot;
|
||||
available: UpdateComponent[] | null;
|
||||
can_install: boolean;
|
||||
}
|
||||
|
||||
interface UpdateSettings {
|
||||
channel?: string;
|
||||
pin?: string;
|
||||
}
|
||||
|
||||
// The default window a release runs on the canary before it can be promoted,
|
||||
// mirroring releaseupdate.CanaryWindow on the server.
|
||||
const CANARY_WINDOW_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
const KIND = "update-settings";
|
||||
|
||||
const store = useSettingsStore();
|
||||
const update = ref<ChatUpdate | null>(null);
|
||||
const notConfigured = ref(false);
|
||||
const loading = ref(true);
|
||||
const error = ref<string | null>(null);
|
||||
const now = ref(Date.now());
|
||||
let timer: ReturnType<typeof setInterval> | undefined;
|
||||
let alive = true;
|
||||
|
||||
const settingsResource = computed(() => store.stateFor(KIND).resource);
|
||||
const settings = computed(() => (settingsResource.value?.value ?? {}) as UpdateSettings);
|
||||
const channel = computed(() => settings.value.channel || "stable");
|
||||
const pin = computed(() => settings.value.pin || "");
|
||||
const pinned = computed(() => channel.value === "exact-pin");
|
||||
|
||||
const channelLabel: Record<string, string> = {
|
||||
stable: "Stable",
|
||||
next: "Prereleases",
|
||||
"exact-pin": "Pinned",
|
||||
};
|
||||
|
||||
const daemon = computed(() => update.value?.snapshot.Components.find((c) => c.ID === "daemon"));
|
||||
const available = computed(() => update.value?.available ?? []);
|
||||
|
||||
const installedAt = computed(() => {
|
||||
const raw = update.value?.snapshot.installed_at;
|
||||
if (!raw) return null;
|
||||
const at = new Date(raw);
|
||||
// The zero time serialises as year 1: no install was recorded.
|
||||
if (Number.isNaN(at.getTime()) || at.getFullYear() <= 1) return null;
|
||||
return at;
|
||||
});
|
||||
const elapsedMs = computed(() =>
|
||||
installedAt.value ? Math.max(0, now.value - installedAt.value.getTime()) : null,
|
||||
);
|
||||
const windowProgress = computed(() =>
|
||||
elapsedMs.value == null ? null : Math.min(100, (elapsedMs.value / CANARY_WINDOW_MS) * 100),
|
||||
);
|
||||
const elapsedText = computed(() => (elapsedMs.value == null ? "" : elapsed(elapsedMs.value)));
|
||||
|
||||
function elapsed(ms: number): string {
|
||||
const totalMinutes = Math.floor(ms / 60_000);
|
||||
const days = Math.floor(totalMinutes / 1440);
|
||||
const hours = Math.floor((totalMinutes % 1440) / 60);
|
||||
const minutes = totalMinutes % 60;
|
||||
if (days) return `${days}d ${hours}h`;
|
||||
if (hours) return `${hours}h ${minutes}m`;
|
||||
return `${minutes}m`;
|
||||
}
|
||||
|
||||
const rows = computed(() => {
|
||||
const list: { label: string; value?: string; mono?: boolean }[] = [
|
||||
// The settings resource loads asynchronously; until it arrives the channel
|
||||
// is unknown, not "stable".
|
||||
{ label: "Channel", value: settingsResource.value ? (channelLabel[channel.value] ?? channel.value) : "loading…" },
|
||||
{ label: "Installed", value: daemon.value?.Installed || "unknown", mono: true },
|
||||
{ label: "Installed at", value: installedAt.value ? "" : "not recorded" },
|
||||
{
|
||||
label: "Available",
|
||||
value: available.value.length
|
||||
? available.value.map((c) => `${c.Label || c.ID} ${c.Installed || "?"} → ${c.Available}`).join(", ")
|
||||
: "none",
|
||||
mono: true,
|
||||
},
|
||||
];
|
||||
return list;
|
||||
});
|
||||
|
||||
async function load(): Promise<void> {
|
||||
loading.value = true;
|
||||
error.value = null;
|
||||
try {
|
||||
const fresh = await api.updateSnapshot<ChatUpdate>();
|
||||
if (!alive) return;
|
||||
update.value = fresh;
|
||||
notConfigured.value = false;
|
||||
} catch (err) {
|
||||
if (!alive) return;
|
||||
if (err instanceof ApiError && err.status === 501) {
|
||||
notConfigured.value = true;
|
||||
update.value = null;
|
||||
} else {
|
||||
error.value = err instanceof Error ? err.message : String(err);
|
||||
}
|
||||
} finally {
|
||||
if (alive) loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void store.load();
|
||||
void load();
|
||||
timer = setInterval(() => {
|
||||
now.value = Date.now();
|
||||
void load();
|
||||
}, 15_000);
|
||||
});
|
||||
onUnmounted(() => {
|
||||
alive = false;
|
||||
if (timer) clearInterval(timer);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Section title="Release canary">
|
||||
<p v-if="notConfigured" class="text-label text-fg-muted">Update checks not configured.</p>
|
||||
<template v-else>
|
||||
<ReadError v-if="error" :message="error" retry-label="Retry" @retry="load" />
|
||||
<p v-else-if="loading && !update" class="text-label text-fg-muted">Checking…</p>
|
||||
<template v-else>
|
||||
<MetadataList :rows="rows">
|
||||
<template #value="{ row }">
|
||||
<template v-if="row.label === 'Channel' && pinned">
|
||||
<Badge variant="danger" class="mr-2">held</Badge>
|
||||
<span class="font-mono">{{ pin }}</span>
|
||||
</template>
|
||||
<template v-else-if="row.label === 'Installed at' && installedAt">
|
||||
<Timestamp :at="installedAt" absolute /> · {{ elapsedText }} elapsed
|
||||
</template>
|
||||
<template v-else>{{ row.value }}</template>
|
||||
</template>
|
||||
</MetadataList>
|
||||
<div v-if="windowProgress != null" class="mt-3">
|
||||
<Progress :model-value="windowProgress" aria-label="Canary window elapsed" />
|
||||
<p class="mt-1 text-caption text-fg-muted">
|
||||
{{ elapsedText }} of 24h elapsed (default window)
|
||||
</p>
|
||||
</div>
|
||||
<p v-else class="mt-3 text-caption text-fg-muted">Install time not recorded, so the window cannot be measured.</p>
|
||||
</template>
|
||||
</template>
|
||||
</Section>
|
||||
</template>
|
||||
@@ -7,7 +7,6 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { ReadError } from "@/components/ui/read-error";
|
||||
import { MetadataList } from "@/components/ui/metadata-list";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import CanaryStatusCard from "./CanaryStatusCard.vue";
|
||||
import ServicesCard from "./ServicesCard.vue";
|
||||
import UpdateSettingsCard from "./UpdateSettingsCard.vue";
|
||||
import VersionsCard from "./VersionsCard.vue";
|
||||
@@ -38,7 +37,6 @@ onUnmounted(() => clearInterval(timer));
|
||||
<ServicesCard />
|
||||
<VersionsCard />
|
||||
<UpdateSettingsCard />
|
||||
<CanaryStatusCard />
|
||||
<Section v-if="config?.bootstrap && Object.keys(config.bootstrap).length" title="Startup settings">
|
||||
<MetadataList :rows="bootstrapRows" />
|
||||
</Section>
|
||||
|
||||
Reference in new issue
Block a user