Restore host setup and migration guide to current docs

This commit is contained in:
notplants
2026-11-23 20:05:13 +00:00
parent 2e9d1fdba8
commit b56e9daaae
9 changed files with 21 additions and 21 deletions
+4 -4
View File
@@ -1,13 +1,13 @@
# Original cc-ci build archive
This is the historical Builder/Adversary phase build of the cc-ci recipe CI
server and the initial combined-host deployment. The phase work is complete;
these plans and prompts are reference material, not current operating steps.
server. Current host provisioning and migration guidance lives in
[`docs/host-provisioning-and-migration.md`](../../docs/host-provisioning-and-migration.md). The phase work is complete; these plans and prompts are reference material, not current operating steps.
- `cc-ci-plan/`: build plan, phase plans, loop prompts, launchers, and the
original agent configuration and instructions.
- `host-build-guide.md`: the original from-scratch host build narrative moved
from the root README.
- `cc-ci-plan/IDEAS.md`: deferred ideas recorded during the phase build.
- `memory/`: historical phase and earlier host notes.
- `AGENTS.md`: the instructions used while the two build loops were active.
Some old `cc-ci-plan/` paths remain as relative symlinks into this archive.
+210
View File
@@ -0,0 +1,210 @@
# Deferred ideas / future enhancements (orchestrator-tracked)
Post-DONE or "revisit later" ideas that are intentionally **out of scope** for the current build
(§2 Definition of Done). Not active work — parked here so they aren't lost. The loops may pull an
item into the project `BACKLOG.md` as `[idea]` if/when it becomes relevant.
- [ ] **ALT infra-app model: deploy traefik / warm-keycloak / drone the normal Co-op Cloud way,
updated outside Nix via abra by maintainers.** *(operator-flagged 2026-05-29, alternative to the
current Phase-2w design — return to later)*
The **current** design Nix-*reconciles* the infra/warm apps: NixOS systemd oneshots run `abra` to
deploy traefik/keycloak/drone, and a nightly `nixos-rebuild` auto-updates them to latest with a
pre-deploy major/manual-migration gate (WC1.2) + post-deploy health-gated rollback (WC1.1).
**The alternative:** treat the CI server like a normal Co-op Cloud host — traefik, the warm
keycloak, and drone are **plain abra deployments managed by maintainers**, deployed once and
**upgraded by a human via `abra app upgrade`** (using abra's own release-notes / major-bump
caution), with **no Nix reconciler and no nightly auto-update** for them. Nix would provide only
the host substrate (OS, docker/swarm, the harness, secrets), not the infra-app lifecycle.
- *Pros:* simpler — no reconciler/rollback/nightly machinery; idiomatic Co-op Cloud ops (maintainers
manage these exactly like any other coop-cloud app); updates are normal human abra actions; lower
cognitive load (no "infra is special / Nix-driven" layer).
- *Cons:* the infra apps are **no longer reproducible-from-git** — a VM recreate (the D8 throwaway
rebuild) would NOT re-establish traefik/keycloak/drone; they'd need manual redeploy after a
rebuild (D8 then covers only the host + harness, not the infra apps). Loses the automated
nightly-latest + health-gated auto-rollback; infra updates + rollback become manual/operator
discipline. Drifts from the project's "declarative, rebuildable from scratch" ethos.
- *Note:* it's essentially one-or-the-other for the **update path** — a hybrid where Nix bootstraps
them but maintainers also `abra app upgrade` them creates the dual-ownership conflict (the Nix
reconciler would fight/redeploy over the maintainer's version on the next activation).
- *When to revisit:* if the reconciler + rollback + nightly machinery proves high-maintenance or
brittle, or if maintainers strongly prefer normal coop-cloud workflow over the Nix layer — weigh
that against how much we value full reproducibility (D8) + hands-off auto-updates. *Added:* 2026-05-29.
- [ ] **Docker Hub pull-through registry cache (`registry:2` proxy) — deferred; single-host makes it marginal.**
Considered as a Phase-2pc perf win, then **dropped (operator, 2026-05-29):** on a **single host**,
Docker's own local image store already caches pulled images (re-deploys reuse local layers), so the
prune-policy fix (Phase 2pc PC1) recovers ~all the benefit. A separate pull-through cache's
distinctive wins don't apply here — multi-node fan-out (one node), surviving prune/VM-rebuild on
*separate* storage (ours would be co-located, lost on recreate), cache-miss auth (daemon already
PAT-authenticated). **Revisit ONLY if:** (a) cc-ci goes **multi-node**, OR (b) Phase-2b measurement
shows **cold-cache / fresh-deploy pull time** (D8 throwaway-rebuild, fresh-canonical seeding) is a
real bottleneck **AND** the cache lives on **recreate-surviving storage** (Incus volume / host-b1
path, not the VM's ephemeral disk). Otherwise it's complexity without payoff. *Added:* 2026-05-29.
- [ ] **Optional `--extra` flag for heavy / operational tests (opt-in heavy suite).**
Some recipe tests are "more than needed" for the default CI signal — state-management /
long-running-instance / load / helper-script operational tests that don't fit the ephemeral
per-run-deploy model cheaply but are useful occasionally. Today they're deferred to
`cc-ci/machine-docs/DEFERRED.md` (e.g. matrix-synapse `compress_state.sh`,
`test_complexity_limit.sh`, `test_purge.sh`) and don't run.
*Idea:* add an **opt-in `--extra` flag** (e.g. `!testme --extra` on a PR comment, or
a `STAGES=extra` / `EXTRA_TESTS=1` Drone build parameter) that the orchestrator passes through;
recipes declare an `extra/` test dir or mark tests with `@pytest.mark.extra`; on opt-in the
orchestrator runs them **alongside** the default tiers (still one deploy, still teardown). Default
off so default CI stays fast; the operator can ask for the heavy suite when reviewing a PR that
touches an extra-covered area (e.g. matrix-synapse's abra helpers). When implemented, each
matching DEFERRED entry can be CLOSED by porting its test into the recipe's `extra/` and noting
the commit in DEFERRED.md. *Why deferred for now:* default coverage is sufficient; this is a
later breadth/depth knob, not a critical-path feature. *Added:* 2026-05-28.
- [ ] **Optional webhook self-registration (admin-access environments).**
We deliberately made **polling the primary trigger** and require the CI server/bot to run on
**read-level** access only — so the server does **not** auto-register Gitea webhooks (that needs
repo-admin), and webhook setup is a documented manual admin task (§4.1, `docs/enroll-recipe.md`).
*Later*, for environments where the CI server **does** hold admin on the recipe repos (or an
org-level admin token is available), consider adding an **opt-in, off-by-default** feature
(e.g. `WEBHOOK_AUTOREGISTER=1`) that auto-registers and **idempotently reconciles** the
`issue_comment` webhook (URL, events, HMAC secret) on enrolled repos — matching our
declarative-reconcile pattern (§9) — giving low-latency push triggering with zero manual setup.
Must stay off by default and fall back to manual-doc + polling when admin isn't available, so the
least-privilege (read-only) default is preserved. *Why deferred:* polling already satisfies D1 and
the read-only posture is the goal; this is a convenience optimization for a different deployment
profile. *Added:* 2026-05-27.
- **Docker Hub `registry:2` pull-through cache (deferred from Phase 2pc).** A local registry in
proxy/pull-through mode, daemon `registry-mirrors`-wired, so all `docker.io` pulls are cached
locally across recipes/runs/prunes. **Deferred (operator, 2026-05-29):** on the current
**single, PAT-authenticated, non-pruning** host, Docker's own local image store already IS the
cache (redeploys reuse local layers — proven in Phase 2pc), so a separate registry adds a service +
mirror config + cache GC for marginal gain; its distinctive wins (multi-node fan-out, surviving
prune/VM-rebuild on *separate* storage, cache-miss auth) don't apply here. **Revisit ONLY if** (a)
cc-ci goes **multi-node**, OR (b) Phase-2b measurement shows **cold-deploy pull time is a real
bottleneck** (e.g. D8 throwaway-rebuild / fresh-canonical seeding) **AND** the cache lives on
**recreate-surviving storage** (an Incus volume / a path on host b1, not the VM's ephemeral disk).
Otherwise it's complexity without payoff. See DECISIONS.md "Phase 2pc". *Added:* 2026-05-29.
- **Phase-2b empirical performance work (moved out of the 2b phase).** The original Phase 2b was a full
empirical perf program: per-phase timing instrumentation in `results.json`, a cold/warm baseline
across representative recipes, a Pareto attribution, and a menu of software optimizations. **Deferred
(operator, 2026-05-30):** the real deploy-speed bottleneck turned out to be **hardware**, not
software — the cc-ci VM was **2 vCPU on a 4-core host** and **disk-I/O-bound** (load ~8, io pressure
~65%) while running warm-keycloak (JVM) + all infra; RAM was never the constraint. Fixed **directly**:
bumped to **4 vCPU** and made cc-nix-test the **only running VM** on b1. The software micro-opts below
are judged unlikely to move the needle enough to justify the work; revisit ONLY if measurement later
shows a specific software bottleneck. (Phase 2b is narrowed to just confirming the test sequence
already minimizes deploys — see plan-phase2b.) Parked ideas:
- **Per-phase timing instrumentation** + cold/warm **baseline** + **attribution** — do this first if
perf is ever revisited; numbers should drive any change.
- **Image pulls:** local registry pull-through cache (see the item above) and/or pre-pull/warm the
enrolled recipes' image set so the first run doesn't pay the cold pull.
- **Readiness/convergence:** replace fixed sleeps with tight health-endpoint polling; per-recipe
readiness probes; parallelize independent readiness checks within a run.
- **Warm shared SSO provider** (already partly live as warm-keycloak): saves per-run SSO deploy time
but is a steady JVM CPU tax that slows non-SSO recipes — only worth it with proven per-run
isolation; consider start-when-needed / stop-when-idle rather than always-on.
- **Runner/build caching:** persistent nix store + warm flake eval; cache pip/uv wheels + Playwright
browsers in a persistent volume.
- **Concurrency sizing:** tune `MAX_TESTS`/runner capacity + per-recipe weights so light recipes run
concurrently while heavy ones serialize, without overcommitting the node.
- **Resources:** further vCPU/RAM/disk-I/O sizing (the 4-vCPU bump is done; storage I/O on b1 is the
harder co-bottleneck — a faster storage pool if it ever matters).
- **abra/secret overhead:** avoid regenerating/re-inserting secrets redundantly across stages.
*Why deferred:* hardware was the real lever and is fixed; these are speculative software gains best
validated by measurement, not assumed. *Added:* 2026-05-30.
- [ ] **Package cc-ci itself as a Co-op Cloud recipe (deploy it with `abra` like any other app).**
*(operator idea 2026-06-02 — not implementing now)*
Today cc-ci is a NixOS flake that declares the whole server. Idea: split it so the **app layer**
(the `!testme` bridge, dashboard, and runner) ships as a Co-op Cloud **recipe**, on top of a host/
Swarm provided by NixOS (or any existing Co-op Cloud host). It would then be deployed/upgraded/
backed-up via `abra` like any recipe — and could **test itself** (deploy `cc-ci`-the-recipe, run its
own lifecycle = ultimate self-regression; pairs with the regression-canary work).
- *Pros:* dogfooding (cc-ci managed by the same tooling it tests); portability/accessibility (any
Co-op Cloud operator could `abra app deploy cc-ci` instead of needing the flake + a dedicated host);
cleaner host-vs-CI-app separation.
- *Cons / crux:* the runner must orchestrate Swarm deploys of recipes-under-test, which a normal
(unprivileged) recipe can't do — needs either a Docker-socket mount (privileged recipe; test stacks
share the host → blast-radius/isolation risk), DinD (heavy/fragile), or **a control-plane recipe
driving a separate disposable test Swarm over SSH** (cleanest, biggest change). Also loses the
"entire server reproducible from one flake" property (host + CI-app become two artifacts).
- *When to revisit:* after the server regression canaries land (want self-tests before re-architecting
the thing that runs them). Treat as a design spike — the runner's Swarm-access model (socket / DinD /
separate Swarm) is the decision that drives everything else.
- [ ] **Move the upgrader's direct deploy-and-inspect onto SEPARATE infra (isolate it from the cc-ci
server, so it can't tamper with the tests).** *(operator-flagged 2026-06-09)*
The upgrader now has a direct deploy-and-inspect dev loop (`/recipe-upgrade` step 2b): it deploys the
WIP recipe with `abra app deploy --chaos` and reads `docker service logs` to debug an upgrade before
the `!testme` CI gate. **Today that runs on the cc-ci server's own local swarm** — i.e. the autonomous
upgrader (and its subagents) hold `ssh cc-ci` + root + docker + abra on the **same host that owns the
harness, the recipe tests, and the CI verdict**. That's a trust-isolation hole: an agent with write
access to the box that gates it could — by accident, prompt-injection, or reward-hacking — **edit the
tests/harness to make a failing upgrade "pass"** ("hacking the tests"). We can't be fully sure the gate
is honest while the thing being gated can modify the gate.
- *Idea:* give the upgrader a **dedicated, throwaway test server** (a real `cctest`-style host, like
recipe-maintainer's `cctest.autonomic.zone`) for the step-2b deploy/inspect loop, reached with
**scoped, test-only credentials** (its own SSH key/abra context — blast radius limited to that host,
per recipe-maintainer's `test-ssh/` model). The upgrader gets all the live-log feedback there and has
**no write access to the cc-ci server**. The cc-ci `!testme` CI stays the independent, tamper-proof
gate — run by infra the upgrader cannot touch — so a GREEN verdict means the tests it can't edit
passed.
- *Pros:* the CI gate becomes trustworthy under an autonomous/untrusted upgrader (least-privilege:
the agent can deploy + inspect but not alter the harness/tests/verdict); cleaner separation of
"develop the upgrade" (test server) from "verify the upgrade" (cc-ci CI); matches recipe-maintainer's
limited-blast-radius `test-ssh/` posture.
- *Cons / crux:* new infra to provision + keep current (a second Co-op Cloud host or VM, abra
`server add`, scoped SSH creds, its own teardown/orphan-sweep); cost + maintenance; and the harness
deploy path may assume `--server default`/local, so the per-run CI deploys vs the upgrader's
test-server deploys need a clear split. Until then, the local-swarm dev loop + the orphan-sweep are
the interim posture (functional, but NOT isolation-safe against a malicious/compromised upgrader).
- *Interim safeguard (in force now, until this lands):* the upgrader **must NEVER modify the cc-ci
tests or harness (`tests/**`, `runner/**`) unless explicitly invoked with `--with-tests`** — encoded
as an absolute guardrail in `/recipe-upgrade` (and its step-2b direct-deploy loop). It is a written
rule, not an enforced boundary — which is exactly why the separate-infra isolation above is the real
fix.
- *When to revisit:* before running the upgrader fully unattended/untrusted at scale, or alongside the
"package cc-ci as a recipe" spike above (both hinge on a separate disposable test Swarm). *Added:* 2026-06-09.
- [ ] **Fail fast on a crash-looping deploy + don't let one wedged run starve the CI queue.**
*(operator-flagged 2026-06-09, after a live incident)*
Observed live: plausible build 220 — a recipe whose ClickHouse service exits 1 every ~6s — held the
**single serial CI runner for its full `DEPLOY_TIMEOUT` (1200s / 20 min)** while the deploy never
converged. Because the runner is serial, that **starved every other recipe's CI behind it**: immich
PR-2 builds 221/222 sat "pending" for ~12 min without ever starting, and only ran once the wedged
plausible run was manually torn down (SIGINT the harness — its `finally` tore down the stack — which
freed the runner). Two compounding problems:
- **No fail-fast on a crash-loop.** The deploy/health wait polls until `DEPLOY_TIMEOUT`; a service
that is plainly crash-looping (a task repeatedly `Failed "task: non-zero exit (1)"` / restarting
every few seconds with no healthy replica) could be detected and the run **failed early** (e.g.
after N restarts within M seconds) instead of burning the whole 1200s. Faster RED for the broken
recipe AND frees the runner sooner. This is the higher-value, lower-risk half — do it first.
- **Head-of-line blocking on a single serial runner.** One wedged/slow run blocks ALL other recipes'
CI. Options: bump runner concurrency (CAREFULLY — the single-node Swarm is why it's serial today,
to avoid parallel-deploy OOM/collision, per /upgrade-all §safety); a priority/queue policy; or at
minimum surface "queued behind build N" so a pending run isn't mistaken for a stuck/own failure.
- *Interim mitigations (in use):* (a) debug a known-crash-looping recipe via the `/recipe-upgrade`
**step-2b direct dev deploy** (`dev-<recipe>` + `docker service logs`) instead of repeated
`!testme` — diagnoses with full log visibility WITHOUT consuming a 20-min runner slot or starving
other recipes; (b) a wedged run can be manually freed by SIGINT-ing its `run_recipe_ci.py` (the
harness `finally` tears down its stack).
- *When to revisit:* if CI-queue starvation recurs (several recipes in flight, or a legitimately
long deploy wedging others). *Added:* 2026-06-09.
- [ ] **Canonical *history* for a green-verified older upgrade base (design B).** *(operator-flagged
2026-06-17; deferred from the `samever` fix — design A shipped instead)*
Context: the dynamic upgrade-base resolver (phase `prevb`) uses the last-green warm-canonical as the
base. When that canonical version **equals the PR head version** (a non-version-bump PR, or a re-test
after the canonical advanced), phase `samever` (design A) steps back to the **newest published version
strictly older than head** (from `recipe_tags`). That older *published* version isn't guaranteed to
have passed green on cc-ci.
**The improvement (B):** keep a short **history** in the warm-canonical registry — the last N green
`{version, commit}` records, not just the single current one (`canonical.read_registry`/`write_registry`
are single-record today). When stepping back, prefer the most-recent **prior canonical** (green-verified)
over a raw published tag; fall back to design A's published-tag only when no prior canonical exists.
- *Why deferred:* history only accrues going forward (existing recipes have none until they've gone
green ≥2× on cold-on-latest), so design A (published-tag) is the always-present floor and must exist
anyway. B is a quality refinement on top. Requires a registry schema change (single record → bounded
history) + `promote_canonical`/`write_registry` appending instead of overwriting.
- *Re-entry trigger:* when the published-tag fallback proves insufficient — e.g. a recipe's
newest-older-published version is itself undeployable, so we'd rather upgrade from a known-green prior
canonical — or operator request. *Added:* 2026-06-17.
-327
View File
@@ -1,327 +0,0 @@
# Deploying a cc-ci host from scratch
This is the whole path from "nothing" to a working CI server + orchestrator on one Hetzner
server. It was last done on 2026-09-07 for `195.201.88.249` and is written so a person or an LLM
can repeat it. Read it once before starting; the order matters.
## 0. What you need in hand
- A **Hetzner Cloud** project you can create servers in (console login or an API token).
- **SSH keys**: yours, and the orchestrator's own key so the automation can reach the box. The
public keys that get root are tracked in `nix/hosts/cc-ci/ssh-keys` (one per line). Password
login is disabled and fail2ban watches sshd, so a key is the only way in.
- Read access to `recipe-maintainers/cc-ci`, `recipe-maintainers/cc-ci-orchestrator` (both public
read) and the **private** `recipe-maintainers/cc-ci-secrets` (the `autonomic-bot` account has
it; the host gets its own deploy key on that account, §4b/§4c — and the bot password, in
`.testenv`, is what registers it).
- The out-of-band secrets listed in §4. If you are migrating, they come from the old host; if
you are starting fresh you create them (each row says how).
- Control of the DNS zone (Gandi for `commoninternet.net`) for the cutover in §7.
## 1. Provision the server on Hetzner (Debian image)
In the Hetzner Cloud console (or with `hcloud server create`):
| setting | value | why |
|---|---|---|
| Image | **Debian 13** (any recent Debian/Ubuntu works with nixos-infect) | it is replaced by NixOS in §2 |
| Type | **x86**, **8 GB RAM**, 4 vCPU — e.g. `cpx32` (dedicated AMD) or `cx33`. **Never `cax*`** (ARM): the flakes are `x86_64-linux`. | swarm + recipe deploys + 3–6 agent sessions; 4 GB is too small |
| Disk | the type's default 150+ GB NVMe | docker layers alone are ~60 GB after a few weeks |
| Network | public **IPv4** required; IPv6 optional (leave enabled or not, NixOS config ignores it) | cc-ci serves 80/443 and DNS on 53 publicly |
| SSH keys | add every key from `nix/hosts/cc-ci/ssh-keys` you want to log in with, at least the orchestrator's | nixos-infect carries `/root/.ssh/authorized_keys` over |
| Name | `cc-ci` | becomes the hostname |
| Firewall | if a Hetzner Cloud Firewall is attached it must allow **22/tcp, 80/tcp, 443/tcp, 53/tcp, 53/udp** in, and ICMP | the NixOS firewall is separate and is configured by the flake |
Check you can log in: `ssh root@<ip> hostname`.
## 2. Convert Debian → NixOS with nixos-infect
[nixos-infect](https://github.com/elitak/nixos-infect) installs NixOS over the running Debian and
reboots. Run it detached so the SSH session dropping does not kill it:
```bash
ssh root@<ip> 'cat > /root/infect.sh <<"EOF"
#!/usr/bin/env bash
set -euo pipefail
# Pinned nixos-infect revision (same one that built the previous cc-ci hosts).
INFECT_SHA="40f62a680bb0e8f2f607d79abfaaecd99d59401c"
export NIX_CHANNEL="nixos-26.05" # must match the nixpkgs channel in flake.nix
export PROVIDER="hetznercloud" # GRUB + Hetzner networking
export NIXOS_IMPORT="" # the real config comes from the flake in §5
# The Debian 13 cloud image mounts /tmp as tmpfs; nixos-infect makes a temporary swapfile
# there and swapon fails with "Invalid argument". 8 GB RAM needs no extra swap: skip it.
export NO_SWAP=true
curl -fsSL "https://raw.githubusercontent.com/elitak/nixos-infect/${INFECT_SHA}/nixos-infect" | bash -x
EOF
chmod +x /root/infect.sh
nohup /root/infect.sh > /var/log/nixos-infect.log 2>&1 &'
```
It downloads Nix, builds a NixOS system (5–10 min; follow with
`ssh root@<ip> tail -f /var/log/nixos-infect.log`), then reboots. The SSH host key changes:
`ssh-keygen -R <ip>` and confirm `ssh root@<ip> nixos-version` prints a 26.05 version.
### 2a. What went wrong on 2026-09-07, and the fixes (Debian 13 image, NixOS 26.05)
All three bit on the first attempt; the script above and §3 already include the fixes, this is
so you recognise them if they come back in another form.
1. **`swapon: /tmp/nixos-infect.XXXX.swp: Invalid argument`** right at the start, script exits.
The Debian 13 cloud image mounts `/tmp` as tmpfs and a swapfile cannot live there.
Fix: `NO_SWAP=true` (in the script above). An 8 GB box does not need the temporary swap.
2. **The box never comes back after the reboot: it boots NixOS, but nearly every unit fails**
(`dbus`, `systemd-logind`, `sshd`, networking …) with
`Could not start dynamically linked executable: /usr/bin/dbus-daemon` in the journal.
nixos-infect leaves the old Debian root in place and relies on NixOS's first boot to move it
to `/old-root` (`/etc/NIXOS_LUSTRATE`). With NixOS 26.05's systemd-based initrd that
lustration did not happen, so Debian's `/etc/systemd/system/*.service` files shadowed the
NixOS units and started Debian binaries. Fix, from Hetzner **rescue mode**
(`enable_rescue` + `reset` in the API/console, ssh in, `mount /dev/sda1 /mnt/root`):
move everything except `nix`, `boot`, `swapfile`, `lost+found`, `var/log`, `var/empty`,
`etc/nixos`, `etc/resolv.conf`, `etc/NIXOS`, `etc/machine-id`, `etc/ssh/ssh_host_*`,
`root/.nix-*`, `root/.ssh` into `/mnt/root/old-root`, delete `etc/NIXOS_LUSTRATE`, unmount,
`disable_rescue`, `reset`. (`/old-root`, ~1 GB, can be deleted once the host is in service.)
3. **Boots, units fine, but no network.** The generated `networking.nix` has
`defaultGateway = "172.31.1.1";` — a bare string. Since NixOS 25.05 that yields no default
route. Fix: `defaultGateway = { address = "172.31.1.1"; interface = "eth0"; };` (this is what
`nix/hosts/cc-ci/networking.nix` carries). To apply it from rescue mode, chroot into the
mounted root and rebuild the boot entry — the nix sandbox cannot `pivot_root` inside a chroot,
so turn it off for that one build:
```bash
for d in proc sys dev dev/pts; do mount --bind /$d /mnt/root/$d; done
mount -t tmpfs tmpfs /mnt/root/run; cp -L /etc/resolv.conf /mnt/root/etc/resolv.conf
chroot /mnt/root /nix/var/nix/profiles/system/sw/bin/bash -c '
export PATH=/nix/var/nix/profiles/system/sw/bin NIX_REMOTE= HOME=/root
export NIX_PATH=nixos-config=/etc/nixos/configuration.nix:nixpkgs=/root/.nix-defexpr/channels/nixos
ln -sfn /nix/var/nix/profiles/system /run/current-system
nixos-rebuild boot --option sandbox false'
```
The `journalctl -D /mnt/root/var/log/journal -b 0` trick (reading the dead system's journal
from rescue mode) is what told these apart.
> Rescue mode without a console: `POST /servers/<id>/actions/enable_rescue` with your ssh key
> id, then `…/actions/reset`; afterwards `disable_rescue` **and check `rescue_enabled` is false
> before** the next `reset`, or it boots the rescue image again. `scripts/recovery/hetzner.py`
> wraps these (token in `/srv/cc-ci/.hcloud-token`).
## 3. Capture the machine-specific config into this repo
nixos-infect wrote `/etc/nixos/{hardware-configuration,networking,configuration}.nix`. Only the
first two matter; the flake replaces `configuration.nix`.
```bash
scp root@<ip>:/etc/nixos/hardware-configuration.nix nix/hosts/cc-ci/hardware.nix
scp root@<ip>:/etc/nixos/networking.nix nix/hosts/cc-ci/networking.nix
```
Then in `nix/hosts/cc-ci/`:
- `hardware.nix`: keep as generated (GRUB EFI with `efiInstallAsRemovable`, `/boot/efi` by UUID,
`/dev/sda1` root). Do not copy another host's file — the UUIDs are per machine.
- `networking.nix`: keep the static IPv4 + Hetzner gateway `172.31.1.1`. Make sure
`networking.defaultGateway` has **both** `address` and `interface = "eth0"` (§2a item 3). If
the generated IPv6 block has an empty address, delete the IPv6 parts; a real global address
(as on the 2026-09 box) can stay.
- `configuration.nix`: set `cc-ci.publicIPv4` to the server's IPv4 and check `system.stateVersion`
is the release you installed (never change it later).
- `ssh-keys`: the root keys.
Commit on a branch; the rebuild in §5 can use the local checkout before the PR merges.
## 4. Stage the workspace and secrets on the new host
Everything in this section is **outside git**. Do it as root over SSH, in this order.
### 4a. No tailscale
The combined host is NOT on the tailnet (operator decision 2026-09-07): ssh is key-only on the
public IP, the CI front doors are public via traefik, and the opencode UI is public on the same
443 — traefik routes `oc.ci.commoninternet.net` to an nginx vhost on the docker bridge that
enforces basic auth, via traefik labels on a tiny swarm relay stack (`ccci-opencode-ui`, on the weekly sweep's keep-list) that
`opencode-ui-route.service` deploys. (Not via traefik's file *directory* provider: enabling
that in the coop-cloud traefik recipe REPLACES its provider file, which holds the wildcard cert
and the `security` middleware, and every front door goes down — it did, for two minutes, on
2026-09-07.) fail2ban guards sshd and that login
(`nix/hosts/cc-ci/configuration.nix`; the nginx jail bans in the DOCKER-USER chain because the
traffic is docker-forwarded, not host INPUT).
### 4b. The CI server's checkout and its one out-of-band secret
```bash
# the bot deploy key for the private cc-ci-secrets submodule — generated ON this host by loops
# (§4c) and registered on the autonomic-bot Gitea account; root only points at it:
install -d -m700 /root/.ssh
cat > /root/.ssh/config <<'SSHCFG'
Host git.autonomic.zone
Port 2222
User git
IdentityFile /secrets/files/autonomic-bot-cc-ci-ed25519
IdentitiesOnly yes
SSHCFG
# the deployed checkout: nightly-sweep runs from it, sops reads secrets/secrets.yaml from it
git clone --recursive https://git.autonomic.zone/recipe-maintainers/cc-ci.git /etc/cc-ci
# the age identity sops-nix decrypts with. FIRST deploy of a host that is not yet a recipient:
# the master (recovery) key, temporarily. Once the host is a recipient (below): its own
# ssh-host-key-derived identity, and the master key leaves the box.
install -d -m0700 /secrets/host
install -m600 <master-age.txt> /secrets/host/sops-age-key.txt
```
`/etc/cc-ci/secrets/secrets.yaml` is encrypted to the master key and the *previous* hosts' SSH
host keys. The master key is enough for the FIRST deploy. Then make the new host a recipient so
the master key can leave the box again (it belongs off-box, with the operator):
`ssh-to-age < /etc/ssh/ssh_host_ed25519_key.pub` → add it to `.sops.yaml` in cc-ci-secrets AND in
cc-ci, `sops updatekeys secrets.yaml` (needs the master key, so do it where that lives), push,
bump the submodule in cc-ci, `git -C /etc/cc-ci pull --recurse-submodules` on the host, then
replace `/secrets/host/sops-age-key.txt` with the host-derived identity
(`ssh-to-age -private-key -i /secrets/host/ssh_host_ed25519_key`), rebuild, and delete the master
key from the host.
### 4c. The orchestrator's workspace (as the `loops` user — it exists after the first rebuild, so
run §5 once first if this is a fresh host, then come back)
```bash
sudo -iu loops
git clone --recursive https://git.autonomic.zone/recipe-maintainers/cc-ci-orchestrator.git /srv/cc-ci-orch
sudo ln -sfn /srv/cc-ci-orch /srv/cc-ci # every script and unit says /srv/cc-ci
cd /srv/cc-ci-orch
git clone https://git.autonomic.zone/recipe-maintainers/cc-ci.git cc-ci # Builder clone
git clone https://git.autonomic.zone/recipe-maintainers/cc-ci.git cc-ci-adv # Adversary clone
mkdir -p .cc-ci-logs .sops
```
**`/secrets` is the authoritative location for every secret on this host.** Consumers either read
from it directly (where the nix config owns the path) or reach it by a symlink (where the software
fixes the path), so `find /secrets -type f` is the complete inventory — including the ssh host
keys. The directory is `0711` (traversable, not listable) with three subdirectories, each owned by
whoever must read it; the layout is declared in `nix/hosts/cc-ci/configuration.nix`:
| dir | mode | holds |
|---|---|---|
| `/secrets/files` | `loops:users 0700` | the agent's secrets: `.testenv`, opencode auth, its two ssh keys |
| `/secrets/host` | `root:root 0700` | host identity: the ssh **host** keys and the sops age identity |
| `/secrets/nginx` | `root:nginx 0750` | `oc-htpasswd` for the opencode UI (nginx must read it) |
**Only cc-ci's secrets go there** — nothing from other projects (no tailscale, lichen, tangled,
b1, borg…), and every private key is generated **on the host**, never copied from another machine.
`/secrets/README.txt` lists each file, its purpose, and the derived material that legitimately
lives elsewhere (`/run/secrets`, `/root/.docker/config.json`, the ACME cert) so a later sweep does
not "clean" it away.
> **The ed25519 host key is load-bearing beyond ssh.** Its age identity is a recipient of
> `cc-ci-secrets`, so regenerating it makes every cc-ci secret undecryptable. sshd is pointed at
> `/secrets/host/...` directly (not through the `/etc/ssh` symlinks) precisely so it can never
> write a fresh key through a dangling link. To move a host: copy the key, verify
> `ssh-to-age` yields the same identity, then activate.
| runtime path → `/secrets/files/…` | what | source |
|---|---|---|
| `/srv/cc-ci/.testenv` → `cc-ci.testenv` | `GITEA_PASSWORD` (autonomic-bot: PR/API calls), `DOCKERHUB_USERNAME/TOKEN` (harness image pulls). Nothing else: no tailscale key, no third-party model API keys (opencode's own auth is `opencode-auth.json`; add `TINFOIL_API_KEY` back only if `LOOP_MODEL` moves to a tinfoil model). | old host's copy minus the tailscale line; fresh: create each credential |
| `/srv/cc-ci/upgrader.env` (not a secret, lives in the checkout) | `LOOP_TIER`, `LOOP_MODEL`, `REPORT_MODEL`, `SUPERVISOR_MODEL` for the weekly run. This host is on the **OpenCode Go subscription** (`LOOP_TIER=go`, `opencode-go/…` models); the ZEN tier is pay-as-you-go credit and its key is not on this host | old host, or copy the example in `AGENTS.md` |
| `~loops/.ssh/cc-ci-local-ed25519` (+`.pub`) → same names | `ssh cc-ci` as root — to loopback on this host. **Generated on the host**, its pub in `nix/hosts/cc-ci/ssh-keys` | `ssh-keygen -t ed25519 -C cc-ci-loops-to-root@cc-ci` as loops |
| `~loops/.ssh/autonomic-bot-cc-ci-ed25519` (+`.pub`) → same names | pushes recipe branches / PRs as `autonomic-bot`; root's ssh config points at the same file to clone the private cc-ci-secrets submodule. **Generated on the host** and registered on the bot's Gitea account (`POST /api/v1/user/keys` with the bot password) | `ssh-keygen -t ed25519 -C autonomic-bot@cc-ci-host` as loops |
| `~loops/.local/share/opencode/auth.json` → `opencode-auth.json`; `~loops/.config/opencode/opencode.jsonc` (config, not secret — it must contain NO inline `apiKey`) | opencode provider auth + config. Exactly ONE provider, `opencode-go` — the orchestrator AND the weekly upgrader are opencode agents; there is no Claude on this host | old host; fresh: `opencode auth login` as loops |
| `/secrets/nginx/oc-htpasswd` (root:nginx 0640; the bcrypt line only — the plaintext stays with the operator, not on the host) | basic auth for the opencode UI (`https://oc.ci.commoninternet.net`, via traefik); **nginx refuses to start without it**, and its config check runs as the `nginx` user, so `root:nginx 0640` (the `nginx` group exists after the first rebuild — fix ownership then and `systemctl restart nginx`) | old host (`/secrets/files/oc-basic-auth.txt` has the plaintext), or a new `oc:<bcrypt>` line via `mkpasswd -m bcrypt` |
`~loops/.ssh/config` is written by the activation script on first rebuild (`Host cc-ci` →
`127.0.0.1`, `git.autonomic.zone`); it is not overwritten if present.
## 5. Build and activate
From the checkout with the §3 commit (root can build from the loops-owned checkout via sudo):
```bash
# as root, detached (the activation restarts sshd; a dropped session must not kill it).
# Three things the FIRST rebuild on a bare infect system needs, none of which the converged
# host needs afterwards: `git` on PATH (nix's flake fetcher shells out to it and the infect
# system has none — hence nix-shell), HOME=/root (so root's `git config --global
# safe.directory '*'` applies to the loops-owned checkout), and a login shell (`bash -l`, for
# NIX_SSL_CERT_FILE and friends from /etc/set-environment).
git config --global --add safe.directory '*'
systemd-run --unit=ccci-rebuild --collect -E HOME=/root -p WorkingDirectory=/srv/cc-ci-orch \
bash -lc 'nix-shell -p git --run "nixos-rebuild test --flake /srv/cc-ci-orch#cc-ci"'
journalctl -fu ccci-rebuild # ~10 min the first time (image pulls + two OCI image builds)
```
`test` first, always: it activates WITHOUT touching the bootloader, so if the activation breaks
networking or sshd a reboot from the Hetzner console lands on the last known-good generation.
(Earlier hosts were on the tailnet, and their rebuilds had to be detached because activation
restarted tailscale under the session; this one is plain public ssh, but detached is still the
safe habit.)
Later rebuilds are simply `sudo nixos-rebuild test|switch --flake .#cc-ci` from the checkout.
The first activation takes a while: it pulls the traefik/drone/keycloak images, builds the bridge
and dashboard OCI images with Nix, initialises the swarm and runs the serialized reconcile
oneshots (`swarm-init → deploy-proxy → deploy-drone → deploy-bridge → deploy-dashboard →
deploy-reports`, `deploy-backupbot`, `warm-keycloak`). Verify:
```bash
systemctl is-system-running # running — or list-units --failed and read journalctl -u <unit>
docker service ls # traefik app+socket-proxy, drone, bridge, dashboard, reports, backups: 1/1
systemctl status cc-ci-loops cc-ci-orchestrator opencode-web nginx acme-dns fail2ban
fail2ban-client status sshd; fail2ban-client status nginx-http-auth
systemctl list-timers 'cc-ci-*' nightly-sweep
sudo -iu loops tmux ls # cc-ci-orchestrator (+ loops sessions if a phase is active)
# the CI front doors, before DNS points here (expect 200 / 200 / 303 and ssl_verify=0 once
# /var/lib/acme is restored or a cert has been issued):
curl -s --resolve ci.commoninternet.net:443:127.0.0.1 -o /dev/null -w '%{http_code} %{ssl_verify_result}\n' https://ci.commoninternet.net/
curl -s --resolve report.ci.commoninternet.net:443:127.0.0.1 -o /dev/null -w '%{http_code}\n' https://report.ci.commoninternet.net/
curl -s --resolve drone.ci.commoninternet.net:443:127.0.0.1 -o /dev/null -w '%{http_code}\n' https://drone.ci.commoninternet.net/
dig +short @<ip> ns-acme.commoninternet.net # acme-dns answering on the public 53
```
The opencode UI: `curl -s --resolve oc.ci.commoninternet.net:443:<ip> -o /dev/null -w '%{http_code}' https://oc.ci.commoninternet.net/`
→ 401 without credentials, 200 with `-u oc:<password>`; `fail2ban-client status nginx-http-auth`
counts the failures (it reads nginx's journal — NixOS nginx logs to stderr, not to
/var/log/nginx/error.log).
When it is healthy: `sudo nixos-rebuild switch --flake .#cc-ci` (same config, now also the boot
default). **If you are migrating from another host, do §6 before letting it serve anything**: right
after the first activation scale the `!testme` bridge to 0 and mask the two orchestrator timers so
the new box does not process PR comments or start a second weekly run while the old host is live:
```bash
docker service scale ccci-bridge_app=0
systemctl mask --now cc-ci-upgrade-all.timer cc-ci-upgrade-supervisor.timer
```
## 6. Migrating: restore state from the previous host
Over ssh between the hosts (`ssh root@<old> 'tar -C / -cf - <paths>' | ssh root@<new> 'tar -C / -xpf - --numeric-owner'`, or rsync), with the matching service
stopped on the new host while its directory is copied:
| path | holds | notes |
|---|---|---|
| `/var/lib/cc-ci-reports` | the published weekly report pages (`report.ci…`) | |
| `/var/lib/cc-ci-runs` | per-run artifacts the dashboard shows | |
| `/var/lib/ci-warm` | warm-canonical state + alerts | recipe warm *volumes* are caches: not copied, rebuilt by the Sunday sweep / first use |
| `/var/lib/acme` | the Let's Encrypt cert + account **and `acme-dns-accounts.json`** — the account the permanent `_acme-challenge` CNAME points at | without it a fresh registration + a new CNAME at Gandi is needed (registration is disabled in `acme-dns.nix`) |
| `/var/lib/acme-dns` | the acme-dns zone DB | |
| `/var/lib/ci-certs` | the copy traefik is handed | then `systemctl restart cc-ci-acme-traefik-handoff` |
| `/root/.abra` | abra's per-app env files for the deployed stacks | |
| Drone data volume `/var/lib/docker/volumes/drone_ci_commoninternet_net_data` | Drone's DB: the Gitea OAuth grant, repo activation, build history | `docker service scale drone_ci_commoninternet_net_app=0` on the new host, copy, scale back to 1. Otherwise run `scripts/bootstrap-drone-oauth.sh` (cc-ci repo) with the bot password and re-activate repos |
| `/srv/cc-ci-orch/.cc-ci-logs`, `/srv/cc-ci-orch/cc-ci-plan/upstream/`, `REBOOTS.md`, `JOURNAL.md` | orchestrator history, the upgrader's per-recipe release-note registry | as loops; do the final sync after stopping the orchestrator on the old host |
## 7. Cutover and verification
1. **DNS** (operator, Gandi zone `commoninternet.net`): A records `ci`, `*.ci` and `ns-acme` →
the new IPv4. `acme NS ns-acme` and `_acme-challenge.ci CNAME <account>.acme…` stay as they
are. Wait for propagation (`dig +short ci.commoninternet.net`) — the records carry a 3 h TTL,
and resolvers that cached the old answer (the Hetzner ones in particular) keep serving it that
long. The new host must not list such a resolver: with a mixed set, every other lookup of its
own names went to the old server on 2026-09-07 (runner/bridge 404s). `networking.nix` drops
the Hetzner resolvers and `configuration.nix` pins the host's own names.
2. Check the new host answers on the new IP before DNS moves: `dig @<new-ip> ns-acme.commoninternet.net`
(acme-dns), `curl --resolve ci.commoninternet.net:443:<new-ip> https://ci.commoninternet.net/`
(dashboard, valid cert), same for `report.ci` and `drone.ci`.
3. Old host: `docker service scale ccci-bridge_app=0 drone_ci_commoninternet_net_app=0`;
`systemctl disable --now cc-ci-upgrade-all.timer cc-ci-upgrade-supervisor.timer` on the old
orchestrator. New host: `docker service scale ccci-bridge_app=1`;
`systemctl unmask cc-ci-upgrade-all.timer cc-ci-upgrade-supervisor.timer && systemctl start` both.
4. End to end: post `!testme` on an open recipe PR and watch it turn green on the new Drone;
open `https://ci.commoninternet.net` and `https://report.ci.commoninternet.net`.
5. The orchestrator: as loops on the new host `cd /srv/cc-ci-orch && python3 cc-ci-plan/agents.py up orchestrator`
(or just `systemctl restart cc-ci-orchestrator`), attach with `claude --resume` or from
claude.ai/code. Its startup routine (AGENTS.md) reports phase + reboot count.
6. Keep the old host as a cold standby for a week, then delete it (and its tailnet node — the
old servers were on the tailnet; the new one is not).
@@ -0,0 +1,34 @@
---
name: cfold-paused-pending-upgrade
description: "Phase cfold (custom/ folder collapse) is PAUSED until the running /upgrade-all finishes — must serialize, they conflict on CI"
metadata:
node_type: memory
type: project
originSessionId: 85355980-5e4f-4f90-b1ca-d0e4fe82f04b
---
**ACTION REQUIRED on supervision wakes:** the `cfold` phase (collapse functional/ +
playwright/ → custom/, plan-phase-cfold-custom-folder.md) is **PAUSED** — its loops AND
the watchdog were stopped 2026-06-11 ~22:55. phase-idx is preserved at **9** (cfold), spec
is the 10-phase `…drone;cfold`.
**Why paused:** drone completed 22:31 and the watchdog fired the queued weekly `/upgrade-all`
(session `cc-ci-upgrader`) — exactly as the operator queued it. cfold was added ~20 min
later and auto-started, ending up **concurrent** with the upgrade. They CONFLICT: both drive
real CI/`!testme`, cfold edits the harness (`discovery.py` + moves test files) the upgrade's
`!testme` builds depend on, and the upgrade's version bumps would confound cfold's
"levels unchanged" baseline. Must run serially.
**Resume condition:** once the `/upgrade-all` run in `cc-ci-upgrader` is DONE (read its pane/
log/summary to confirm it finished surveying+PRing all recipes — do NOT trust mere idle; a
slow `!testme` build can idle the upgrader for a while), resume cfold by restarting the
watchdog:
```
python3 -c "import sys; sys.path.insert(0,'/srv/cc-ci/cc-ci-plan'); import launch; launch.start_watchdog()"
```
It reads phase-idx=9 + the 10-phase spec → restarts the cfold loops (builder opus? no —
cfold has no per-phase model override, so sonnet). Then delete this memory.
The `cc-ci-upgrader` session must stay UP meanwhile (it's the in-flight upgrade). Note: a
host reboot would auto-restart loops+watchdog (cc-ci-loops.service, RESUME_PHASE=1) and
un-pause cfold prematurely — if a reboot happens before the upgrade finishes, re-pause.
@@ -0,0 +1,43 @@
---
name: launch-system-unification
description: Plan to replace 5 bespoke launcher scripts + ~15 dotfiles with one agents.toml + one agents.py driver
metadata:
node_type: memory
type: project
originSessionId: fc17c9c2-ab6e-4c11-856e-a6a6e160a0ec
---
The cc-ci agent launch system was 5 near-duplicate launchers (`launch.py` loops+watchdog,
`launch-orchestrator.py`, `launch-assistant.py`, `launch-upgrader.py`, `launch-report.py`)
each re-implementing claude/opencode backend plumbing, plus ~15 scattered dotfiles in
`/srv/cc-ci/.cc-ci-logs/` (`.loop-backend`, `.loop-model*`, `.orch-model`, `.phases-spec`,
`.phase-idx`, `.*-session-id`, `.limited-*`, …).
**STATUS: IMPLEMENTED + CUT OVER 2026-06-13 ~05:27 UTC.** agents.toml + agents.py are live;
orchestrator/builder/adversary + watchdog all respawned under the new system and confirmed
working on phase pvfix. launch.py + launch-orchestrator.sh are now shims → agents.py (originals
at *.orig); systemd boot chain (cc-ci-loops-start → launch.sh → launch.py start) drives the new
system. State moved to .cc-ci-logs/state/ (phase-idx, <name>.id resume, limited-*.json). tmux
targeting uses exact match (=name / =name:) to avoid prefix collisions (cc-ci-assistant vs
cc-ci-assistant3). **VERIFIED STABLE over 3 hourly checks (06:30/07:34/08:36 UTC 2026-06-13);
hourly wake ENDED (orchestrator runs its own hourly self-wake via the watchdog).** During
verification the system autonomously ran the build to completion (pvfix→pvcheck→ghost→cf48, an
operator-appended opus review phase) — clean auto-advances, handoff pings, per-phase model
overrides all worked. One port defect found+fixed at check 2: phase_advance_check is now
idempotent once SEQUENCE-COMPLETE exists (no 5-min log spam) and the watchdog keeps death-healing
the orchestrator without restarting the intentionally-stopped finished loops. End state: build
sequence COMPLETE, loops intentionally stopped, orchestrator supervising; 13 recipe PRs await
operator review/merge.
**Original plan (approved 2026-06-13, operator chose TOML + build-now + de-dupe mailu):** one
declarative `cc-ci-plan/agents.toml` (single source of truth: per-agent backend, model,
prompt, kind, watch policy; backends declared as data) + one `cc-ci-plan/agents.py` driver
(up/down/status/watchdog/logs/phase). Watchdog reads the config file, not env. Config vs
state split: declarative config in TOML, runtime state (phase-idx, resume ids, limit
windows) under a `state/` dir. Full design + behavior-mapping + migration in
`cc-ci-plan/plan-unified-launch.md`. Mimic current behavior first, cut over between phases
(old launchers become shims), then retire them. De-dupe note: live `.phases-spec` lists
`mailu` twice (idx 5 & 7); dropping the 2nd shifts current phase cf55 from idx 10→9.
Agent kinds: loop (builder/adversary, phase machine) | persistent (orchestrator resume+wake,
assistant) | task (upgrader/report one-shot slash command) | service (watchdog/cleanlogs).
See [[orchestrator-backend-switch-gotcha]].
@@ -0,0 +1,27 @@
---
name: orchestrator-host-hetzner
description: The cc-ci orchestrator runs on a Hetzner cpx22; key host facts + the git-identity gotcha
metadata:
node_type: memory
type: project
originSessionId: cd772f12-1978-47c3-894b-0ebbe0d2987f
---
The cc-ci orchestrator (loops + watchdog + this session) runs on a **Hetzner cpx22** as of
2026-05-31, replacing the Incus VM (100.116.55.106).
- Since 2026-09-07: ONE Hetzner host for CI server + orchestrator, public **195.201.88.249**,
tailnet **cc-ci**, flake host **`.#cc-ci`** (this repo). Before: orchestrator on Hetzner
134487234 (168.119.126.100 / 100.84.190.30, `cc-ci-orchestrator-hetzner`), shared with notplants.
- Rebuild: `sudo nixos-rebuild switch --flake .#cc-ci` from `/srv/cc-ci-orch`
(`/srv/cc-ci` is a symlink to it). The Bash tool runs as user **loops** (uid 1000, passwordless
sudo) — plain `nixos-rebuild switch` fails on the profile symlink; use `sudo`.
- Reboot-resilience: `cc-ci-loops.service` is **enabled** (wantedBy multi-user.target); ExecStartPre
`reboot-log.sh` auto-logs reboots to REBOOTS.md. Its `script` runs `launch.sh start`, which
**stops+restarts the loops** — so any rebuild that (re)starts the unit bounces the loops (they
re-orient from git; harmless but noticeable).
- **Git-identity gotcha:** the box had no git user.name/email configured; commits fail with "Author
identity unknown". Set per-repo to match prior commits: `autonomic-bot
<autonomic-bot@git.autonomic.zone>`.
Full record: `archive/plans/plan-orchestrator-hetzner-migration.md`.
@@ -0,0 +1,25 @@
---
name: weekly-upgrade-queued-after-phases
description: Weekly /upgrade-all cron skipped for 2026-06-12; queued to auto-run when the current phase queue finishes (drone)
metadata:
node_type: memory
type: project
originSessionId: 85355980-5e4f-4f90-b1ca-d0e4fe82f04b
---
Operator (2026-06-11) cancelled tonight's weekly `/upgrade-all` cron run and queued it to
run once after the current phase queue (…mailu→drone) completes instead.
- `cc-ci-upgrade-all.timer` was STOPPED (couldn't `disable` — /etc/systemd is read-only).
Its persistent stamp was forwarded to `2026-06-12 03:00 UTC` so a reboot/nixos-rebuild
tonight schedules the NEXT run for 06-19, not a catch-up of tonight's slot.
- **GOTCHA:** `systemctl start cc-ci-upgrade-all.timer` fires the service IMMEDIATELY
(Persistent=true). Do NOT `start` it to re-arm — let a host reboot/`nixos-rebuild`
reactivate it (the [[drone-phase-p0-host-deploy]] rebuild will); the forward stamp
prevents a catch-up fire.
- Post-phase auto-run is wired in launch.py (commit 3fa3178): the watchdog launches
`launch-upgrader.py start` when the LAST phase reaches `## DONE`, gated by the one-shot
flag `/srv/cc-ci/.cc-ci-logs/.run-upgrade-on-complete` (set 2026-06-11, consumed on fire).
So when phase `drone` finishes, `/upgrade-all` starts automatically (upgrader on sonnet).
Once this fires (or if the plan changes), this memory is stale — delete it.