Point Nix at relocated CI scripts and remove legacy plan paths

This commit is contained in:
notplants
2026-11-23 20:11:51 +00:00
parent 8b883fb59f
commit 7d1de88657
143 changed files with 64 additions and 185 deletions
+14 -35
View File
@@ -1,6 +1,5 @@
# cc-ci.nix — the cc-ci operator session and weekly-upgrade/hourly-supervisor timers.
# The Builder/Adversary loop unit below is a compatibility path for the completed
# original build. Its plans and launcher live under archive/original-build/.
# The Builder/Adversary build is archived; its old unit name only records reboots.
#
# Exported from this repo's flake as `nixosModules.cc-ci-orchestrator` (and, for the host that
# used to import it under the old name, `nixosModules.cc-ci`). Split out of the shared agent
@@ -14,47 +13,27 @@
# those are host concerns, provided by nix/modules/orchestrator-host.nix, not by this module.
{ config, pkgs, lib, ... }:
{
# Legacy Builder/Adversary boot unit. The phase build is complete; launch.sh
# checks its DONE state and exits without starting those sessions. Keep this
# declaration and path unchanged while the compatibility unit remains enabled.
# Keep the historical unit name for its boot-id-gated reboot record.
# The Builder/Adversary phase loops are complete and never launched.
systemd.services.cc-ci-loops = {
description = "cc-ci Builder/Adversary loops + watchdog (launch.sh start)";
wantedBy = [ "multi-user.target" ]; # enabled after workspace staged (Hetzner cutover)
after = [ "network-online.target" "opencode-install.service" ];
description = "cc-ci reboot record (legacy unit name)";
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig = {
# KillMode=process: this unit only LAUNCHES the tmux server, it does not own it. With the
# default (control-group) systemd kills every leftover process in the cgroup when the unit
# stops — and since one tmux server hosts every agent session on this host, a rebuild that
# merely touched this unit wiped all of them (operator 2026-08-01). Only the (already
# exited) main process is killed now; `systemctl stop` therefore does NOT tear down agents.
KillMode = "process";
Type = "oneshot"; RemainAfterExit = true;
User = "loops"; Group = "users";
WorkingDirectory = "/srv/cc-ci/cc-ci";
# Append one line to REBOOTS.md per genuine reboot (boot_id-gated; not on manual restart).
ExecStartPre = "${pkgs.bash}/bin/bash /srv/cc-ci/cc-ci-plan/reboot-log.sh";
WorkingDirectory = "/srv/cc-ci-orch";
ExecStart = "${pkgs.bash}/bin/bash /srv/cc-ci/scripts/cc-ci/reboot-log.sh";
};
# The loops backend is persisted in .cc-ci-logs/.loop-backend (opencode on the cc-ci host —
# no Claude there since 2026-09-07). The archived build phases are DONE;
# on boot the compatibility launcher only confirms completion and exits.
environment = { RESUME_PHASE = "1"; HOME = "/home/loops"; };
path = [ pkgs.bash pkgs.tmux pkgs.git pkgs.python3 pkgs.openssh pkgs.nettools ];
script = ''
# Put the standalone opencode binary on PATH. On a cold boot this is the env the tmux
# server (and thus every agent session) inherits.
export PATH="/home/loops/.local/bin:$PATH"
[ -x /srv/cc-ci/cc-ci-plan/launch.sh ] && /srv/cc-ci/cc-ci-plan/launch.sh start || \
echo "workspace not staged yet — skipping loop start"
'';
};
# cc-ci-orchestrator supervisor — the operator's steering session. Same shape as
# lichen-orchestrator / project-orchestrator above: this unit only LAUNCHES the orchestrator's
# tmux session via the agent-orchestrator harness (cc-ci-plan/agents.py); it does not own the
# tmux session via the agent-orchestrator harness (scripts/cc-ci/agents.py); it does not own the
# session or the tmux server. This is the current operator steering agent,
# separate from the retired Builder/Adversary loops. Its backend/model are
# declared in cc-ci-plan/agents.toml; it attaches to the shared
# declared in scripts/cc-ci/agents.toml; it attaches to the shared
# opencode web server — opencode-web.service in orchestrator-host.nix — and steered from its
# web UI; no Claude on this host, operator 2026-09-07). The harness watchdog (started by
# `agents.py up`) keeps it alive: heal-only (no stall reboots — a persistent supervisor must not
@@ -78,8 +57,8 @@
export PATH="/home/loops/.local/bin:$PATH"
proj="/srv/cc-ci-orch"
echo "$(cat /proc/sys/kernel/random/boot_id) boot $(date -u +%FT%TZ) — cc-ci-orchestrator up" \
>> "$proj/cc-ci-plan/.ao-boot.log" 2>/dev/null || true
cd "$proj" && python3 cc-ci-plan/agents.py up orchestrator || echo "cc-ci orchestrator agents.py up failed"
>> "$proj/scripts/cc-ci/.ao-boot.log" 2>/dev/null || true
cd "$proj" && python3 scripts/cc-ci/agents.py up orchestrator || echo "cc-ci orchestrator agents.py up failed"
'';
};
@@ -109,7 +88,7 @@
path = [ pkgs.bash pkgs.tmux pkgs.git pkgs.python3 pkgs.openssh pkgs.nettools ];
script = ''
export PATH="/home/loops/.local/bin:$PATH"
python3 /srv/cc-ci/cc-ci-plan/launch-upgrader.py start >> /srv/cc-ci/.cc-ci-logs/upgrader-cron.log 2>&1
python3 /srv/cc-ci/scripts/cc-ci/launch-upgrader.py start >> /srv/cc-ci/.cc-ci-logs/upgrader-cron.log 2>&1
'';
};
@@ -146,7 +125,7 @@
path = [ pkgs.bash pkgs.tmux pkgs.git pkgs.python3 pkgs.openssh pkgs.nettools ];
script = ''
export PATH="/home/loops/.local/bin:$PATH"
python3 /srv/cc-ci/cc-ci-plan/launch-supervisor.py check >> /srv/cc-ci/.cc-ci-logs/supervisor-cron.log 2>&1
python3 /srv/cc-ci/scripts/cc-ci/launch-supervisor.py check >> /srv/cc-ci/.cc-ci-logs/supervisor-cron.log 2>&1
'';
};