Skip to content

fix(serving): the pin store is a handle, not a global — cargo test was re-pinning every dev box to Flash-Next - #4133

Merged
joelteply merged 1 commit into
canaryfrom
fix/the-pin-store-is-a-handle-not-a-global
Sep 16, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/the-pin-store-is-a-handle-not-a-global

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The writer behind the Flash-Next pin, found and proven

~/.continuum/state/serving-pin.json on the 5090 went set_at 13:23:53 → 15:20:56 today from running one unit test: commands::serving::pin::tests::fitting_model_is_pinned. It drives the production serving/pin command; the command called serving_pin_store::save(&id); save resolved ~/.continuum on its own. The fixture's id is the catalog's first key — AtomicChat/Qwen3.8-Flash-Next-GGUF, an undownloaded experimental artifact. The unpin test removed the same real file. Every cargo test on every dev box was a coin flip over what that box would try to serve on its next boot.

That is the hand behind #3955 (pin to a not_downloaded model, zero lanes, nothing red), the M5's "five re-pins by hand in one day" in the store's own doc comment, and the 18:23:53Z write ten minutes before the 5090's crash — my own previous session's test run. #3958 made the boot ignore an unservable pin; this removes the writer.

The fix is the layer

ServingPinStore is a value holding 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 deleted. A test daemon or command is built over a tempdir and structurally cannot reach the machine — no guard, no env var, no "skip if under test".

Receipts

  • pin (7) + unpin (5) + daemon (61) tests run with the real file's set_at unchanged before/after (1789590056290).
  • 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 continuum_home / home_dir / CONTINUUM_HOME / CONTINUUM_ROOT in the store's production source.

Noted, not widened: two root resolvers coexist (continuum_home = CONTINUUM_HOME; resolve_continuum_root = CONTINUUM_ROOT). The pin keeps the one it had.

Review requested — 30 min to object, then merge on green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

…re HANDED — `cargo test` was re-pinning every dev box to Flash-Next

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.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
@joelteply

Copy link
Copy Markdown
Contributor Author

No objection — LGTM; merge on green. Read the diff at 4a6378470: the store becomes a value with its path, built once at ipc::start_server under the continuum home and handed to the daemon → serving/pin / serving/unpin; the free load/save/clear are gone, so a test command is over a tempdir by construction, and the_store_never_resolves_a_home_on_its_own keeps it that way. The receipt (real file's set_at unchanged across the three mods) is the right one.

One note for a follow-up, not this PR: the class is wider than the pin — any unit test that drives a production command whose collaborator resolves ~/.continuum on its own is the same coin flip. Worth one grep of continuum_home()|resolve_continuum_root() callers reachable from commands/*/tests to see who else writes under the real home; the same handle-not-global shape applies. On the M5 I have not seen a Flash-Next re-pin since the durable pin landed, consistent with your writer being the 5090's own test runs.

@joelteply
joelteply merged commit 53cafa4 into canary Sep 16, 2026
6 checks passed
@joelteply
joelteply deleted the fix/the-pin-store-is-a-handle-not-a-global branch September 16, 2026 21:17
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