This repository was archived by the owner on Jul 24, 2026. It is now read-only.
test(up): the DECISIVE decoupling test — killing convoy up must not kill its agents - #105
Merged
Conversation
… kill its agents The permanent regression guard for the Nomad invariant after the 2026-07-22 incident (a `convoy up` restart mid-cutover took the whole hetz fleet down, exit 143 across 11). Settles the forensic a-vs-b: (a) a teardown MISUSE vs (b) a real decoupling bug. It stands up real, detached agent daemons via convoy's OWN production spawn primitive (spawnFromPtyFile → spawnDaemon), supervises them with a real `convoy up` subprocess, then kills that subprocess BOTH ways (SIGTERM and SIGKILL) and asserts every agent is still alive at the SAME pid. A fresh `convoy up` must then ADOPT the survivors (same pids, no launch/respawn/replay), and the inverse — `convoy down` — must actually tear them down. Result: all four pass => the decoupling HOLDS in practice, so the incident was misuse (a), NOT bug (b). If these ever fail, this file is the reproduction of (b). Process-level by necessity (real daemons + real signals), scoped to a throwaway XDG_STATE_HOME so it can never touch a live network. Runs in the vitest gate (test.yml, normal runner) — the lane that already shells out to real bin/convoy — not the hermetic nix flake check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014gbfntB6cu21sL4YBp21LF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The permanent regression guard for the Nomad decoupling invariant after the 2026-07-22 incident: a
convoy uprestart mid-cutover self-severed and took the whole hetz fleet down (exit 143 across 11 agents).This settles the forensic a-vs-b the CoS raised:
convoy down/ a session-or-pgroup kill), orHow
A process-level test (by necessity — real daemons + real signals) that:
spawnFromPtyFile→spawnDaemon) — a dummysleepharness so it needs no claude/st on the box.convoy upsubprocess.SIGTERM(clean stop) andSIGKILL(hard crash, no graceful teardown) — and asserts every agent is still alive at the SAME pid.convoy upADOPTS the survivors (same pids; nolaunch/respawn/replayof them in the JSON stream).convoy downdoes tear them down (the one true kill path).Result
All four pass. ⇒ The decoupling holds in practice, so the incident was misuse (a), not bug (b). If these ever fail, this file is the reproduction of (b).
Everything is scoped to a throwaway
XDG_STATE_HOME, so it can never touch a live network. It runs in the vitest gate (test.yml, a normal runner — the lane that already shells out to realbin/convoy), not the hermetic nix flake check.This is part 1 of 4 of the decoupling-hardening task (decisive test → recovery-parking fix →
convoy restart→ self-sever guard).🤖 Generated with Claude Code
https://claude.ai/code/session_014gbfntB6cu21sL4YBp21LF