Repository navigation
fix(serving): a restored pin must not be able to take the node dark - #3958
Merged
Merged
Conversation
Twice on this host (#3955), the node came up with zero lanes and zero citizens and NOTHING red: serving.pin.restored model_id=AtomicChat/Qwen3.8-Flash-Next-GGUF serving.plan.candidate_refused <each of the 3 models on disk> reason="another model is pinned — serving/unpin frees the choice" That model's catalog row says `availability: not_downloaded`. So the planner honoured the pin, refused every candidate that could actually serve, and declined to load weights that do not exist. Every component behaved exactly as designed and the machine was useless. Only a hand-run `serving/unpin` recovered it, both times. **`serving/pin` already refuses this shape** — it fit-gates at set time and returns Denied for a model that is "in the catalog but not downloaded". The hole is RESTORE: a pin read back from the state dir had no check at all, and the world moves after a pin is written (weights evicted, a drive unmounted, the file edited, a downgrade writing a row this build reads differently). So the restore verifies before it honours. An unservable stored pin is IGNORED for that boot with a loud `serving.pin.unservable_ignored`, and the node comes up autonomic instead of dark. The pin FILE is deliberately kept. It is durable operator intent and the model may be pulled later, so it is honoured again on the first boot after the weights land; only `serving/unpin` drops the intent. A fix that silently discarded the operator's choice would be its own bug, and a test asserts the file survives. Second half: the refusal now NAMES the pin. `REFUSED_NOT_PINNED` says "another model is pinned" and never said which, so a dark node emitted three refusals a second, none identifying the thing doing the refusing, and finding it took a grep of a different log for `serving.pin.restored`. A rejection reason that states its category but not its cause turns a read into archaeology. I could not attribute who set the bad pin: no probe and no log line records a pin write, and the only writer of the store is the command that refuses this shape. That absence is itself the finding — but the node must not be brickable regardless of who does it, which is what this fixes. ## A false-passing test, caught and fixed `the_serving_daemon_installs_the_admission_authority` (landed in #3957) was BLIND. `include_str!` pulls in the whole file, tests included, so `src.contains("install_lane_admission(")` matched the assertion's own string literal and stayed green with the production call deleted — a check that cannot fail ([[success-signal-that-cannot-report-failure]]). Found because a sibling assertion tripped over the same self-reference. All source assertions now read `production_source()`, everything before `#[cfg(test)]`, and all three were mutation-tested: deleting the install call, renaming the probe class, and dropping the `pinned` field each turn their test red, and green again when restored. Full `--lib`: 43 failures, a subset of the clean base's 44 (GPU, python, screenshot-binary and Windows path tests on this box). `comm -13` empty. Closes #3955. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
joelteply
added a commit
that referenced
this pull request
Sep 16, 2026
…re HANDED — `cargo test` was re-pinning every dev box to Flash-Next (#4133) Proven on the 5090 today: `~/.continuum/state/serving-pin.json` set_at went 13:23:53 → 15:20:56 from running ONE unit test, `commands::serving::pin::tests:: fitting_model_is_pinned`. It drives the production `serving/pin` command, which called `serving_pin_store::save(&id)`, which resolved `~/.continuum` on its own, so the test wrote the real machine's pin — to whichever id sorts first in the catalog: `AtomicChat/Qwen3.8-Flash-Next-GGUF`, an undownloaded experimental artifact. Its twin, `unpin::tests::release_clears_the_pin_and_names_it`, removed the real file. Every `cargo test` on every dev box was a coin flip over what the box would try to serve on its next boot. That is the writer behind: the #3955 brick (pin to a not_downloaded model, zero lanes, nothing red), the M5's "five re-pins by hand in one day", and the 18:23:53Z write ten minutes before the 5090 crashed — my own previous session's test run. #3958 made the boot IGNORE an unservable pin; this removes the hand that keeps writing it. The fix is the layer, not a guard in the test: `ServingPinStore` is a value that holds its path. Production builds it ONCE at boot under the continuum home (ipc::start_server) and hands it to the daemon, which hands it to `serving/pin` and `serving/unpin`. The free `load()/save()/clear()` that consulted a global are gone. A test daemon or command is built over a tempdir and structurally cannot reach the machine. Tests: `fitting_model_is_pinned` now also asserts the pin landed in the command's OWN store; `release_clears_the_pin_and_names_it` asserts the same for clear; `the_store_never_resolves_a_home_on_its_own` pins the absence of any home resolution in the store's production source. Receipt: pin + unpin + 61 daemon tests run with the real file's set_at unchanged (1789590056290 before and after). Noted, not widened: two root resolvers coexist (`continuum_home` = CONTINUUM_HOME, `resolve_continuum_root` = CONTINUUM_ROOT); the pin keeps the one it had. Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc Co-authored-by: Claude Opus 5 <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #3955.
The outage, twice
{ "active_model": null, "lanes": 0, "ready": false, "served_context_window": 0 }That model's catalog row:
availability: "not_downloaded". The planner honoured the pin, refused every candidate that could actually serve, and declined to load weights that do not exist. Zero lanes, zero citizens, nothing red — every component behaved exactly as designed and the machine was useless. A hand-runserving/unpinrecovered it both times.Where the hole was
serving/pinalready refuses this shape — it fit-gates at set time and returnsDeniedfor a model "in the catalog but not downloaded". The gap is restore: a pin read back from the state dir had no check at all, and the world moves after a pin is written (weights evicted, a drive unmounted, the file edited, a downgrade writing a row this build reads differently).The fix
The restore verifies before it honours. An unservable stored pin is ignored for that boot with a loud
serving.pin.unservable_ignored, and the node comes up autonomic instead of dark.The pin file is kept. It is durable operator intent and the model may be pulled later, so it is honoured again on the first boot after the weights land; only
serving/unpindrops the intent. A fix that silently discarded the operator's choice would be its own bug — there's a test asserting the file survives.Second half: the refusal now names the pin.
REFUSED_NOT_PINNEDsaid "another model is pinned" and never which, so a dark node emitted three refusals a second, none identifying the thing doing the refusing, and finding it took a grep of a different log forserving.pin.restored. A rejection reason that states its category but not its cause turns a read into archaeology.What I could not determine
Who set the bad pin. No probe and no log line records a pin write, and the only writer of the store is the command that refuses this shape. I chased it through the rotated logs, the probe stream, and every
save/save_tocall site and came up empty. That absence is its own finding — but the node must not be brickable regardless of who does it, which is what this fixes.A false-passing test, caught and fixed
the_serving_daemon_installs_the_admission_authority, which landed in #3957, was blind.include_str!pulls in the whole file, tests included, sosrc.contains("install_lane_admission(")matched the assertion's own string literal — it stayed green with the production call deleted. A check that cannot fail. Found only because a sibling assertion tripped over the same self-reference.All source assertions now read
production_source()(everything before#[cfg(test)]), and all three were mutation-tested:install_lane_admissioncallserving.pin.unservable_ignoredprobe classpinnedfield from the refusal probeEach green again when restored.
Full
cargo test -p continuum-core --lib: 43 failures, a subset of the clean base's 44 (GPU, python, screenshot-binary and Windows path tests on this box).comm -13against the base is empty.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc