Skip to content

fix(deploy): a verified prebuilt core launches THROUGH start-server.sh in prebuilt mode — the bare direct launch (#4090) started the M5 with no desktop and no power assertion - #4107

Merged
joelteply merged 3 commits into
canaryfrom
fix/a-prebuilt-core-launches-through-the-same-start-path
Sep 16, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fix/a-prebuilt-core-launches-through-the-same-start-path

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The first warm-build reboot on the M5 (04:36Z) took #4090's direct-launch path: the artifact ran bare, so CONTINUUM_UI_DIST was unset (desktop.dm.unconfigured, :8975 dark — the eye could not open a live call), no caffeinate sleep assertion (the M5 sleeps unattended, 9/7), no llama-server PATH, no derived airc room, no models dir, no daemon ensure, no background desktop rebuild. Two start paths had drifted.

Now there is one. CONTINUUM_PREBUILT_CORE=<artifact> puts start-server.sh in prebuilt mode: every cargo build is a no-op (a shell function shadows it), the stale check is off, CORE_BIN is the artifact, and everything else the script does for the core still runs. The CLI's Prebuilt plan invokes the script with that variable; the bare launch remains only for an installed-only box with no source tree.

Validation: bash -n on the script; cargo check --bin continuum clean. Live: deploying to the M5 now (a bare launch once under the old CLI, then the new CLI's script launch); acceptance = desktop.dm.online and a caffeinate parent on the core after the second launch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…h in prebuilt mode — the bare direct launch (#4090) started the M5 with no desktop and no power assertion

The first warm-build reboot on the M5 (04:36Z) took #4090's direct-launch path: the
artifact ran bare, so CONTINUUM_UI_DIST was unset (desktop.dm.unconfigured — :8975
dark, the eye could not open a live call), no caffeinate sleep assertion (the M5
sleeps unattended: 9/7), no llama-server PATH, no derived airc room, no models dir,
no daemon ensure, no background desktop rebuild. Two start paths had drifted.

Now there is one: `CONTINUUM_PREBUILT_CORE=<artifact>` puts start-server.sh in
prebuilt mode — every `cargo build` is a no-op (a shell function shadows it), the
stale check is off, CORE_BIN is the artifact, everything else the script does for the
core still runs. The CLI's Prebuilt plan invokes the script with that variable; the
bare launch remains only for an installed-only box with no source tree.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… artifact gets its launch environment (first live run: 'no start script', still bare)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@joelteply joelteply left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at head 27e83a2. Read both files in full and traced every cargo build in the script under prebuilt mode.

My verdict, stated unambiguously because I got this wrong twice last night: NO OBJECTION to merging this as-is. The regression it fixes is real and was verified live (dark desktop, dropped power assertion), the direction is right — one start path, not two — and the finding below is non-fatal by the script's own design. I am not gating the merge on it. If you want it in this PR, great; if you'd rather card it, that's fine and I'll write the card.

The finding: the cargo() override is broader than the comment claims

The header says "only the cargo builds are skipped", which is true but understates it. In prebuilt mode the override returns 0 for every cargo build in the script, and CORE_BIN is substituted for exactly one of the five:

line binary prebuilt mode
884/917 continuum-core-server skipped, and substituted — intended
735 continuum-mcp skipped, not substituted
799/803 continuum (the CLI) skipped, not substituted
870 forge-custodian skipped, not substituted
1005 livekit-bridge skipped, not substituted

All four degrade to a warning that ends "core still launches", so nothing crashes — that's why this isn't a blocker. But on a cold or swept machine they are silently absent rather than stale, and the script's own comment at :727 says continuum-mcp "isn't launched by us, so it must exist on disk after npm start" — an MCP client spawns it later. A miss there surfaces a long way from its cause, and #291's rule is that a fresh clone must work with no manual steps.

The part I'd actually change, because it prints something untrue

ensure_unswept_bin (:719) recovers from a swept cache by calling cargo build. Under the override that call is a no-op, so in prebuilt mode the sequence is:

▶ forge-custodian missing from cargo cache (swept?) — rebuilding --bin forge-custodian
  (prebuilt core: skipped cargo build --manifest-path … --bin forge-custodian …)
⚠ forge-custodian still missing after swept-cache rebuild

It announces a rebuild, does not rebuild, and reports the failure as if the rebuild had been attempted. The helper's own header cites [[fallbacks-are-illegal-fail-loud]], and this is the quiet inverse of that — a recovery path that reports it ran when it was disabled underneath it.

Narrowing the override to the one binary the prebuilt artifact actually replaces fixes both halves at once:

cargo() {
  if [ "${1:-}" = "build" ] && [[ " $* " == *" --bin continuum-core-server "* ]]; then
    echo "  (prebuilt core: skipped cargo $*)"
    return 0
  fi
  command cargo "$@"
}

The siblings then build as they always did (fast incrementals on a warm box, correct on a cold one), ensure_unswept_bin keeps working, and the skip stays pointed at the thing you verified.

Checked and fine, so nobody re-checks them

  • [ ! -x "$CONTINUUM_PREBUILT_CORE" ] guards the substitution before anything else — good, and it fails loud.
  • Disabling core_bin_is_stale in prebuilt mode does not reintroduce #194: the CLI resolves a checkout sha for the candidate (prebuilt_checkout_sha, :2107) before LaunchSource::Prebuilt is constructed, so the freshness claim moved upstream rather than disappearing.
  • The None arm keeping direct_core_command for installed-only boxes is the right call — it preserves the no-source-tree case instead of hard-failing.

… bin, the CLI, forge-custodian and the livekit-bridge still build, so a swept or fresh cache never launches green without its voice path (Cormac's review of #4107)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 3a46039 into canary Sep 16, 2026
7 checks passed
@joelteply
joelteply deleted the fix/a-prebuilt-core-launches-through-the-same-start-path branch September 16, 2026 10:00
joelteply added a commit that referenced this pull request Sep 20, 2026
…rgo line, one feature set (card 9174fc83) (#4276)

Measured on the IntelMac deploy of 2026-09-20: start-server.sh ran FOUR
separate `cargo build` invocations, one per bin (continuum-mcp, continuum,
forge-custodian, continuum-core-server), and "Compiling continuum-core"
appeared four times per deploy — 18m16s + 5m41s + 5m14s + 7m46s = 37 minutes.
25 minutes on the M5. Under the stop-first reboot path (the CLI's memory bar)
the serving core is dark for all of it.

Cause: each invocation resolves features, reruns the build scripts and
fingerprints the library for itself. The CLI carried its own feature variable
(CONTINUUM_CLI_FEATURES) on the Linux/Windows arm — `--no-default-features`,
unconditionally — so its fingerprint differed from the other three bins' and
the whole library recompiled for it; per-bin invocations then paid the
build-script re-run and the per-invocation resolution on every bin.

THE LAW: a deploy compiles the library once.

- build_core_bins() is the single place the crate's bins are built: ONE
  `cargo build --manifest-path "$CORE_MANIFEST" --bin … --bin … --bin … --bin …`
  so the lib compiles once and the four links run in parallel. The deploy
  build, the #296 swept-cache restore, the #194 forced rebuild and the
  GPU-free CLI arm all call it; the six literal invocations become one.
- One feature set by default. The CLI shares the core's set everywhere the
  set links no GPU runtime. The only sanctioned separation is the measured
  one — a set carrying cuda/rocm/vulkan makes a socket-client CLI unlaunchable
  on Windows (load-time cublas import, exit 127 with zero bytes, #6) — and
  there the CLI is one extra line, `--bin continuum` alone, with its own set.
  A CPU-only or DirectML-only Linux/Windows box no longer pays a second lib
  compile for a CLI that merely dropped `livekit-webrtc`.
- Every existing behaviour around the builds is kept: the core's failure is
  FATAL and a sidecar's is a warning (on a combined failure the core is built
  alone, warm, and ITS exit code decides), the self-build guard, the loud
  GPU-free→featured CLI fallback, the CLI install, the #296 restores (now for
  continuum-mcp too), the #194 freshness guard, the build-only receipt. The
  prebuilt-core `cargo()` shim — which would have skipped the whole combined
  invocation, sidecars included (the hole Cormac's review of #4107 closed) —
  is replaced by leaving continuum-core-server out of the bin list.
- The memory bar (warm_build_allowed in the CLI) is untouched: with one
  invocation there is no cheap-bins-before-the-big-link ordering to exploit;
  the lib compile IS the memory cost and every bin needs it. Stop-first now
  holds the core for one build instead of four.

Self-running check (tools/scripts/tests/start-server-build-only.test.sh,
already in both CI jobs): the script text carries exactly ONE literal
`cargo build --manifest-path "$CORE_MANIFEST"` (canary had 6); a fixture run
traces one cargo line naming all four bins with one feature set; a cuda set
separates only the CLI, on exactly one extra line; the fixture cargo now
understands a multi-`--bin` command line like real cargo.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Fable 5.1 <[email protected]>
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