Skip to content

fix(deploy): rebuild a swept core binary before exec — cache eviction is a supported event (#296) - #2104

Merged
joelteply merged 1 commit into
canaryfrom
fix/296-reboot-selfheals-swept-binary
Aug 2, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/296-reboot-selfheals-swept-binary

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Incident (2026-08-01, glass-boxed)

Disk eviction swept the shared cargo cache's debug/ dir (build/ + deps/ survived). continuum reboot ran an incremental cargo build that printed "Finished dev profile" without restoring debug/continuum-core-server, then tools/scripts/start-server.sh's exec "$CORE_BIN" died with "No such file or directory" and serving stayed down. Fail-loud worked; self-heal didn't. Cache eviction is a SUPPORTED event (CLAUDE.md disk doctrine) — every deploy path must tolerate a swept artifact.

Fix

One shared guard function, ensure_unswept_bin (matches the script's existing function style — stop_existing_core, core_bin_is_stale, start_livekit_rail):

  • if the expected artifact file is missing, print ▶ <bin> missing from cargo cache (swept?) — rebuilding --bin <bin> and re-run the same cargo build invocation the script already uses for that bin (same manifest / $PROFILE_FLAG / $CONTINUUM_FEATURES; a missing output forces cargo to re-link) — no new build shape;
  • if the artifact STILL doesn't exist, return non-zero; the caller decides fatality. No fallback.

Applied to every artifact the script builds and later exec's/copies:

Artifact Guard Fatality
continuum-core-server ($CORE_BIN) between its build and the #194 freshness guard, so #194 asserts against a real file FATAL — ✗ FATAL #296 … refusing to exec a nonexistent binary, exits before touching the running core
continuum CLI ($CONTINUUM_CLI_BIN) before the ~/.local/bin copy non-fatal warn (matches its build's own ⚠ … core still launches)
forge-custodian after its build non-fatal warn (would otherwise fail loud only at first gene conversion)
livekit-bridge rail already rebuilt on missing; added a post-rebuild existence check before nohup "$BRIDGE_BIN" non-fatal (rail is non-fatal by design)

continuum-mcp is untouched: it's neither exec'd nor copied by this script.

Validation (honest scope)

  • bash -n tools/scripts/start-server.sh — clean.
  • The guard function was exercised in isolation: sed-extracted verbatim from the script into a scratchpad harness with a stubbed cargo, covering present / missing-then-restored / missing-still-missing / cargo-nonzero cases. All four behave as designed under set -e, and the stub confirmed the forwarded invocation shape (build --manifest-path … --bin … --release --features x).
  • The live shared cargo cache was deliberately NOT touched to simulate the sweep — the running core depends on it — so there is no end-to-end reproduction in this PR; validation is syntax check + isolated function simulation + careful dry review of variable usage.

Fixes #296.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… is a supported event (#296)

2026-08-01 incident, glass-boxed: disk eviction swept the shared cargo
cache's debug/ dir (build/ + deps/ survived). `continuum reboot` ran an
incremental cargo build that printed "Finished" WITHOUT restoring
debug/continuum-core-server, then start-server.sh's `exec "$CORE_BIN"`
died with "No such file or directory" and serving stayed down.
Fail-loud worked; self-heal didn't. Cache eviction is a SUPPORTED event
(CLAUDE.md disk doctrine) — every deploy path must tolerate a swept
artifact.

The self-heal: one shared guard, `ensure_unswept_bin` — if the expected
artifact file is missing, print a loud "missing from cargo cache
(swept?) — rebuilding" line and re-run the SAME cargo build invocation
the script already uses for that bin (a missing output forces cargo to
re-link); if the artifact STILL doesn't exist, return non-zero so the
caller decides fatality. No new build shape, no fallback.

Applied to every artifact this script builds and later exec's/copies:
- continuum-core-server (FATAL): guarded between its build and the #194
  freshness check, so #194 asserts against a real file and a missing
  binary aborts the deploy loudly instead of at exec — leaving any
  running core untouched.
- continuum CLI (non-fatal, matches its build's own warn): restored
  before the ~/.local/bin copy so the install gets real bytes.
- forge-custodian (non-fatal): restored at build time instead of
  failing loud at first gene conversion.
- livekit-bridge (non-fatal): the rail already rebuilt on missing; now
  it verifies the rebuild actually produced the binary before nohup'ing
  a nonexistent path.

Validation: `bash -n` clean; the guard function was exercised in
isolation (sed-extracted from the script, stubbed `cargo`) across
present / restored / still-missing / build-failed cases — all behave as
designed under `set -e`. The live shared cargo cache was deliberately
NOT touched to simulate the sweep (the running core depends on it).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 433f859 into canary Aug 2, 2026
2 checks passed
@joelteply
joelteply deleted the fix/296-reboot-selfheals-swept-binary branch August 2, 2026 10:41
@joelteply
joelteply restored the fix/296-reboot-selfheals-swept-binary branch August 21, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant