Commit Graph
20 Commits
Author SHA1 Message Date
sam 50693cf030 fix(release): package and update archie-messaging on a host install
The v1.30.0 extraction moved Telegram, email and webhook out of archied and into
cmd/archie-messaging, and nothing packaged it. dist-zip built and copied only the
five older binaries, and scripts/archie-update-install omitted it from both its
service and binary lists. A host upgraded across v1.30.0 therefore ran on with no
messaging process at all: archied logged that it stopped serving the telegram
gateway at the extraction, nothing replaced it, and the bot was dead for two days
with no error anywhere -- the daemon looked healthy throughout (archie-core-1c01).

Fixed in all four places the host component set was enumerated: the zip's build
loop, the zip's copy list, the installer's GATEWAY_SERVICES (messaging is a
service, so it is installed AND restarted) and its GATEWAY_BINARIES. The comment
claiming every process in the documented deployment ships in the zip is now true,
and says what makes it true.

The duplication was the actual defect, so the sets are pinned to cmd/ instead:
TestHostCommandListsCannotDrift derives the host-run commands from cmd/ and
asserts all four lists, plus the reference runbook's units, agree with it. Adding
a command or extracting one fails the test until it is packaged -- the check that
would have caught this on the day. The installer's own test grew the same
coverage, and the reason it passed while the bug was live is worth recording: its
fixture created only the stale cmd/ set, so the script's `[ -d ./cmd/$cmd ]` guard
silently skipped messaging.

Documentation, because the installer now refuses an update when a service unit is
missing and sends the operator to the runbook -- so a service the runbook omits is
a dead end: a messaging unit in deployments/systemd-user-service.md, the component
list and start sequence in deployments/INSTRUCTIONS.md (which ships inside the
zip), and the packaged-binary list in RELEASING.md.

Verified: task check exit 0, including test:tools and test:ui. Both new guards
were made to fail on purpose: reintroducing each omission produces "missing
archie-messaging" and "no call with fragments [./cmd/archie-messaging]".
2026-09-22 05:42:17 +10:00
sam e108e9dadf fix(build): make formatting and CI converge (#901) 2026-09-20 00:38:51 +10:00
sam 64aeb6c84a fix(build): pin gofumpt and golangci-lint as one matched pair
`task fmt` formats with the standalone gofumpt and `task lint` re-checks that
formatting with the gofumpt golangci-lint vendors. `task check` runs `fmt`
then `lint` without diffing the tree, so `lint` is the only hard failure for
formatting -- and when the two versions differ, any construct they disagree on
makes the gate unsatisfiable: the standalone formatter rewrites a file one way
and lint rejects it, with nothing a contributor can run to satisfy both.

The surfaces had drifted onto three different pairs. This machine ran gofumpt
v0.7.0 against golangci-lint 2.13.2 (vendors v0.11.0), the image pinned
golangci-lint 2.12.2 (vendors v0.9.2) next to gofumpt v0.11.0, and CI
installed gofumpt@latest. `any((Trees)(nil))` in changes_test.go is the
construct that surfaced it: gofumpt <= v0.9.2 keeps the redundant parens,
>= v0.10.0 removes them.

- Dockerfile: golangci-lint 2.13.2, whose vendored gofumpt v0.11.0 now equals
  the pinned GOFUMPT_VERSION, so the image's two formatters agree.
- Dockerfile: fail the build if the pins ever diverge, rather than ship an
  image whose gate cannot pass.
- deploy.yml: gofumpt@v0.11.0 instead of @latest, which drifts ahead of
  whatever golangci-lint vendors.
- Record the invariant where an agent will meet it: AGENTS.md (CLAUDE.md) and
  the build-and-env skill, whose snapshots now name the pinned pair instead of
  calling both unpinned.
2026-09-19 18:52:10 +10:00
sam 58a5ec9058 fix(ci): stop the docs workflow failing on a missing pip manifest
.github/workflows/docs.yml runs actions/setup-python@v6 with cache: pip. That
option hashes a requirements.txt or pyproject.toml to build the cache key and
fails outright when neither exists:

    ##[error]No file in ... matched to
            [**/requirements.txt or **/pyproject.toml]

This repository is Go and has no Python manifest, so the step failed as the
first step of every run triggered by the workflow's pull_request paths: docs/**
filter. mkdocs build --strict therefore never executed: docs changes were not
being verified, and every docs-touching PR was reported as a build failure. It
only surfaced on #878 because #878 touches docs/architecture/; PRs that do not
touch docs report no checks at all.

Drop cache: pip. The only Python use is a single `pip install mkdocs-material`,
so there is nothing worth caching.
2026-09-19 02:24:37 +10:00
sam f5987ccfa2 ci(docs): verify the documentation site builds
Build-only. The site deploys from the Ansible control node via the
vectislabs.automation docs_site role against nebula, so CI has nothing to
publish; what it catches is a docs change that will not build at all, before
it reaches a deploy.

Path-filtered to docs sources, so the ~600 commits a month that touch no
documentation do not run it.
2026-09-18 13:16:09 +10:00
sam 5a778065a8 ci(deploy): publish a GitHub Release with the distribution zip
The dist-zip job built the linux/amd64 zip and uploaded it as an Actions
artifact, then stopped. An artifact is reachable only from the run's page,
behind an Actions login, and expires after 90 days -- so every release since
the zip job landed produced a download an operator could not find. The one
Release on this repo (archied/v1.22.0) was created by hand and carries no
asset at all: nothing in CI has ever created one.

Publish the Release from this job and attach the zip:

- Job-level `permissions: contents: write`. The workflow default is
  contents:read, so a publish step would fail without it; scoping it to this
  job keeps the build-and-push jobs read-only.
- The body is this version's changelog section, extracted from the "## [x.y.z]"
  heading to the next "## [" heading rather than pasting the whole file. The
  changelog stays the single source of truth, and the tag/changelog gate in
  `gate` has already proven the section exists.
- Attached to the archied tag, because the zip is named and versioned for
  archied; `--follow-tags` pushes both tags at one commit, so the runtime
  release is the same commit.
- Idempotent: `gh release view` decides between `create` and
  `upload --clobber`, so a retried or superseded deploy run cannot fail on an
  existing Release or duplicate the asset.
- Fails loudly when the section extracts empty, rather than publishing a
  Release with no notes.
2026-09-17 07:17:27 +00:00
sam e57f3ec125 ci(deploy): produce a complete distribution zip on every release
Two independent faults meant archied v1.23.0 shipped no zip at all.

dist-zip was gated on `startsWith(github.ref, 'refs/tags/archied/v')`. A
release is pushed as main plus both tags at one SHA, the SHA-keyed
concurrency group collapses those three runs into one, and the survivor
is whichever ref started last. For v1.23.0 that was refs/heads/main, so
the job was skipped and both tag runs that would have matched had already
been cancelled: 0 artifacts across all three runs. Resolve the archied
tag from the commit, the way build-and-push already does, and gate on
that instead of on the ref that happened to win the race.

The zip was also incomplete. It carried archied, archie-gateway,
archie-state-store and archie-playbooks, but not archie-ui, which since
1.23.0 is the process that serves the dashboard: a deployment cannot be
stood up from those four. Build every process the reference deployment
runs, and stamp each with the archied version rather than leaving the
state store and playbooks unversioned.

Closes archie-core-803r, archie-core-xi02.
2026-09-12 09:51:44 +10:00
sam 84b326940b chore(docs): remove the VitePress site and its build step
The docs site was never published: GitHub Pages is not configured for this
repository, so the workflow built and uploaded a site nobody served. docs/ is
repository documentation — Markdown read in the repository, an editor, or the
forge's file view — and does not need a renderer.

Removed:

- docs/.vitepress/config.mts, docs/package.json, docs/pnpm-lock.yaml (1620
  lines), docs/pnpm-workspace.yaml
- docs/index.md (the site's landing page)
- .github/workflows/docs.yml (pnpm install, VitePress build, Pages deploy)
- the docs build-artefact ignores from .gitignore

Kept and corrected:

- docs/prds/01-project-management.md linked its decision documents with
  VitePress root-absolute paths (/architecture/...), which only resolve under a
  site build. Repointed to repository-relative paths.
- docs/architecture/generated-documentation.md named VitePress as the renderer
  throughout. Now records the renderer and publishing surface as an open
  decision, with the consequences stated: reference pages unrendered, no link
  checker, no authoring server. Also corrected three claims that were never
  true — the docsgen all/check subcommands and the docs:* tasks do not exist,
  and no pre-commit hook is installed.
- .agents skills: build-and-env and docs-and-writing no longer describe a docs
  site to build; the diagnostics scripts drop .vitepress skip rules and the
  dead github_docs_build scan.

Generated output is unchanged: docs/data/generated/contracts.json and the
docsgen toolchain are untouched, and tools/ remains its own module.
2026-09-12 01:01:12 +10:00
sam 80143e4869 ci(deploy): package archied/archie-gateway/archie-state-store/archie-playbooks as a linux/amd64 zip (archie-core-8cda.4.7.1)
New dist-zip job, independent of build-and-push (no change to the
archied/archie-agent Docker image jobs). Triggers on any archied/vX.Y.Z
tag, so a gateway-only release (RUNTIME=skip) still produces it, keyed
to the archied version alone -- these binaries aren't in
tools/release.sh's two-component split and don't need to be for this.

archie-agent is deliberately excluded: it only ever runs inside the
Docker image build-and-push already publishes, never as a host binary.

Zip contains the four linux/amd64 binaries, the new
deployments/INSTRUCTIONS.md (quickstart + deployment-profile/systemd
pointers), and CHANGELOG.md/CHANGELOG.archied.md/CHANGELOG.archie.md.
README.md is included only if present -- it doesn't exist in this repo
yet, so omitted for now rather than fabricated here.

Verified locally: all four binaries build clean under
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 (modernc.org/sqlite is pure Go,
no cgo sqlite driver to worry about), and the assembled zip's contents
match what the workflow step produces.
2026-09-07 18:10:11 +10:00
sam 3d7666002c feat(contracts): add gateway service seams and protobuf toolchain 2026-09-05 22:57:45 +10:00
sam 267de136eb fix(ci): skip runtime image on gateway-only releases 2026-09-03 06:43:44 +00:00
sam f68f60e713 ci(deploy): key concurrency group on commit SHA, not ref
git push --follow-tags pushes main plus both archied/v* and archie/v*
tags in one operation, all pointing at the same commit. on.push
matches branches and tags, so every release push fired three identical
deploy runs -- observed just now: archied/v1.19.7, archie/v1.19.7, and
main all running in parallel from the same commit. The ref-keyed
concurrency group added earlier couldn't see these as the same work
since github.ref differs per trigger. Key on github.sha instead so all
three collapse into one.
2026-09-02 00:14:57 +10:00
sam 66df4f6337 ci(deploy): cache image layers and cancel superseded deploy runs
Both images built via plain docker build/push with no cache, so every
push to main rebuilt archie-agent's full toolchain (apt packages,
golangci-lint, gofumpt, buf, uv+python, npm globals) from scratch --
several minutes, even when none of those inputs changed. Switch to
docker/build-push-action with GHA-backed layer caching per image.

Also add a concurrency group so a burst of pushes (e.g. a fix commit
immediately followed by its release commit) cancels the superseded
deploy rather than running three in parallel for capacity none of them
can use -- only the last one's :latest push matters anyway.
2026-09-02 00:06:52 +10:00
sam f66824ae08 chore(ci): pin Go version from go.mod and add a govulncheck step
CI's go-version was a floating "1.26" independent of go.mod, so it
could silently drift from the toolchain the project actually builds
with. Switched to go-version-file: go.mod as the single source of
truth, and added `task vuln` (govulncheck) plus a CI scan step -- kept
out of `task check` since it needs network access to the vuln DB.
2026-08-31 21:25:54 +10:00
sam f03e927fe4 ci: strip the v prefix when matching release tags to changelog sections
deploy / gate (push) Failing after 2m15s
deploy / build-and-push (push) Skipped
The gate derived the version with ${tag#archied/}, which leaves "v1.7.0",
then looked for a "## [v1.7.0]" heading. Changelog sections carry no v --
tools/release.sh writes and validates "## [1.7.0]" -- so the gate could
never match and every tagged release failed before the images were built.

This is the gate's first tagged run: it landed in dd9bddc, after the
archied/v1.6.0 tag, so nothing had exercised this branch until v1.7.0.
2026-08-10 02:22:50 +10:00
sam 8b21418e38 fix(build): install ripgrep where grep.go actually needs it on PATH
grepBinary() resolves rg from PATH since the embedded binaries were
dropped, but nothing installed it: not the GitHub Actions runner (CI
grep tests fell back to direct search and failed), and not the
archie-agent image (Dockerfile) that runs grep tool calls for sandboxed
tasks. Production was masked by carina's host already having ripgrep
installed system-wide for archied's own tool execution.

Dockerfile.archied is unused by the current deployment (docker-compose
builds only Dockerfile; archied runs on the host under systemd) --
corrected its stale "ripgrep is embedded" comment rather than adding
the package to an image nothing builds from.
2026-08-09 02:06:20 +10:00
sam 87c4fb91f7 ci: install gofumpt before the quality gate
GitHub's hosted runner has no gofumpt preinstalled, unlike the
self-hosted Gitea runner this workflow was copied from -- gofumpt -w .
failed with "command not found" on the first run.
2026-08-09 02:00:38 +10:00
sam dd9bddc245 ci: build and push images to GHCR, drop the Gitea workflow
Mirrors the existing Gitea deploy workflow's gate (fmt/vet/build/test,
dashboard tests, tag<->changelog check) but publishes to
ghcr.io/samcharles93/{archied,archie-agent} using the built-in
GITHUB_TOKEN. Additive: docker-compose.yml and the carina watchtower
setup are untouched, so production still runs off the Gitea-built
images until that's explicitly cut over.

.gitea/workflows/deploy.yml is removed from this checkout now that the
Gitea remote is gone; the git.catlow.cloud-hosted copy is unaffected
until that repo is pushed to again.
2026-08-09 01:47:57 +10:00
sam 69640b5216 docs: consolidate into a single docs/ tree
Fold the old docs/ into the VitePress site and rename docs-2 -> docs.
The 12 architecture PRDs become first-class pages at docs/architecture/
with sidebar nav, rather than being buried under an archive path.
Historical material stays at docs/archive/. Rewrites every docs-2 and
docs/prds/architecture reference across the repo. Site builds clean.
2026-07-29 03:17:42 +10:00
sam 65aa5b462d chore: cleanup 2026-07-28 18:46:50 +10:00