Skip to content

fix(deploy): the claim must outlive the SLOWEST build, not the fastest — it expired mid-swap on the Intel tier and condemned a healthy deploy - #4190

Merged
joelteply merged 1 commit into
canaryfrom
a476ea14/the-deploy-claim-expires-mid-build-on-th
Sep 18, 2026
Merged

joelteply merged 1 commit into
canaryfrom
a476ea14/the-deploy-claim-expires-mid-build-on-th

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Measured 2026-09-18 on the Intel tier: deploy.stranded fired at 08:56:39Z for a
deploy that came up healthy 25 minutes later.

07:50:26Z  continuum reboot starts, writes the deploy claim
08:51:40Z  deploy.track.request_written  tip=ae5e5a3c8...
08:56:39Z  deploy.stranded  elapsed_ms=300004     <- claim age 66.2 min
~09:00Z    "warm artifact validated in 4197s"     <- build age 70.0 min
~09:2xZ    ae5e5a3c8 answering, healthy

Two defects in one chain.

  1. CLAIM_MAX_AGE_MS was sized against the machines that reported first. Its own doc
    comment said so: "must comfortably exceed a COLD full build ... measured 292s and
    530s here, 772s on BIGMAMA (Fix chat/send sender identity: personas show as themselves (#412) #422). One hour is far above any of those." This tier's
    WARM build is 4,197s — 5.4x the largest of them. So the claim expired at minute 60
    of a 70-minute build: the last ten minutes, which is exactly the swap window the
    claim exists to protect. From there blocks() read false and Fix chat/send sender identity: personas show as themselves (#412) #422's guard against
    an implicit autostart minting a core from the pre-swap image was silently off. An
    expired advisory guard is indistinguishable from no guard.

    The ceiling now sizes against the risk it actually covers. A live claim is already
    gated on owner_alive(pid); age only covers "the reboot was kill -9'd and the pid
    was reused". Four hours is ~3.4x the slowest build on record and still bounded —
    worst case remains a time-limited degradation of an advisory guard, never a wedge.
    SLOWEST_OBSERVED_BUILD_MS is named so that invariant is a test rather than a
    sentence in a doc comment the next slow tier quietly falsifies.

  2. reconcile_request (mine, fix(deploy): close the deploy loop — a recorded DeployRequest is reconciled against the running build #4187) had no grace. It called Stranded on the first tick
    that could not see a build — 300004ms is exactly one tick after the request. The
    claim does not cover a deploy's whole life: stop, handoff, the new core's startup
    compile and boot all run with NO claim and the OLD sha, which is bit-for-bit what a
    dead reboot leaves behind. Only duration separates them, by orders of magnitude.
    STRANDED_GRACE_MS = 20 min, the same shape and reasoning as
    COLD_BOOT_BELOW_FLOOR_GRACE in the serving planner.

    Not cosmetic: "stranded" is the signal to relaunch, and a second build races the
    first on the shared CARGO_TARGET_DIR.

Receipt:
cargo test -p continuum-core --lib --features metal,accelerate -j 2
-- deploy_claim deploy_tracker
15 passed; 0 failed; 8293 filtered out; REAL_EXIT=0
lib test: 75 warnings, none naming deploy_claim or deploy_tracker

The existing a_request_that_did_not_take_is_stranded_not_in_flight asserted Stranded
at 60s with no claim; that assertion WAS the defect, so it now asserts past the grace.
Mutation proof is by construction, not a second 30-minute build: against the pre-fix
constants both new asserts are arithmetically false (3,600,000 >= 4,197,000 fails;
3,600,000 >= 8,394,000 fails) and pre-fix reconcile_request returns Stranded at
300_004 where the test demands InFlight.

The rule worth carrying: a timeout sized against the fastest machines that have
reported is not a bound, it is a race the slow tier loses every time — silently.

Card: a476ea14-0199-421f-87a5-07ef9cdecd50

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

…t — it expired mid-swap on the Intel tier and condemned a healthy deploy

Measured 2026-09-18 on the Intel tier: `deploy.stranded` fired at 08:56:39Z for a
deploy that came up healthy 25 minutes later.

    07:50:26Z  continuum reboot starts, writes the deploy claim
    08:51:40Z  deploy.track.request_written  tip=ae5e5a3c8...
    08:56:39Z  deploy.stranded  elapsed_ms=300004     <- claim age 66.2 min
    ~09:00Z    "warm artifact validated in 4197s"     <- build age 70.0 min
    ~09:2xZ    ae5e5a3 answering, healthy

Two defects in one chain.

1. CLAIM_MAX_AGE_MS was sized against the machines that reported first. Its own doc
   comment said so: "must comfortably exceed a COLD full build ... measured 292s and
   530s here, 772s on BIGMAMA (#422). One hour is far above any of those." This tier's
   WARM build is 4,197s — 5.4x the largest of them. So the claim expired at minute 60
   of a 70-minute build: the last ten minutes, which is exactly the swap window the
   claim exists to protect. From there `blocks()` read false and #422's guard against
   an implicit autostart minting a core from the pre-swap image was silently off. An
   expired advisory guard is indistinguishable from no guard.

   The ceiling now sizes against the risk it actually covers. A live claim is already
   gated on `owner_alive(pid)`; age only covers "the reboot was kill -9'd and the pid
   was reused". Four hours is ~3.4x the slowest build on record and still bounded —
   worst case remains a time-limited degradation of an advisory guard, never a wedge.
   SLOWEST_OBSERVED_BUILD_MS is named so that invariant is a test rather than a
   sentence in a doc comment the next slow tier quietly falsifies.

2. reconcile_request (mine, #4187) had no grace. It called Stranded on the first tick
   that could not see a build — 300004ms is exactly one tick after the request. The
   claim does not cover a deploy's whole life: stop, handoff, the new core's startup
   compile and boot all run with NO claim and the OLD sha, which is bit-for-bit what a
   dead reboot leaves behind. Only duration separates them, by orders of magnitude.
   STRANDED_GRACE_MS = 20 min, the same shape and reasoning as
   COLD_BOOT_BELOW_FLOOR_GRACE in the serving planner.

   Not cosmetic: "stranded" is the signal to relaunch, and a second build races the
   first on the shared CARGO_TARGET_DIR.

Receipt:
    cargo test -p continuum-core --lib --features metal,accelerate -j 2 \
      -- deploy_claim deploy_tracker
    15 passed; 0 failed; 8293 filtered out; REAL_EXIT=0
    lib test: 75 warnings, none naming deploy_claim or deploy_tracker

The existing `a_request_that_did_not_take_is_stranded_not_in_flight` asserted Stranded
at 60s with no claim; that assertion WAS the defect, so it now asserts past the grace.
Mutation proof is by construction, not a second 30-minute build: against the pre-fix
constants both new asserts are arithmetically false (3,600,000 >= 4,197,000 fails;
3,600,000 >= 8,394,000 fails) and pre-fix reconcile_request returns Stranded at
300_004 where the test demands InFlight.

The rule worth carrying: a timeout sized against the fastest machines that have
reported is not a bound, it is a race the slow tier loses every time — silently.

Card: a476ea14-0199-421f-87a5-07ef9cdecd50

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply merged commit 472496d into canary Sep 18, 2026
5 checks passed
@joelteply
joelteply deleted the a476ea14/the-deploy-claim-expires-mid-build-on-th branch September 18, 2026 10:39
joelteply added a commit that referenced this pull request Sep 18, 2026
…ction is a ratchet until its mirror ships (#4201)

Cormac, 2026-09-18, after the fourth one-direction defect of the day: "four one-direction
ratchets found and fixed today by three of us … same shape each time — a measurement or a state
that could only move one way — and each time the fix was the mirror rule and a test with both
directions in it. Worth a doctrine line somewhere the next person will read before they write
the fifth." This is that line, in the list the next person reads: the mirror ships in the same
commit as the mover, keyed on the same number; the test is a round trip. #4195 #4190 #4193 #4199
#4200.


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

Co-authored-by: Claude Fable 5.1 <[email protected]>
joelteply added a commit that referenced this pull request Sep 20, 2026
…d_ms was the tick period, and my #4190 grace compared against it

Every deploy.stranded this node has ever recorded, across three separate deploys:

    09-18 07:41:39   elapsed_ms = 300014
    09-18 08:56:39   elapsed_ms = 300004
    09-18 11:46:07   elapsed_ms = 299882
    tick interval, from 75 consecutive deploy.track.* rows: 300 s

Three deploys, three values within 132 ms of each other, all equal to the tick. That
number was never the age of the request. It was the cadence wearing a duration's name.

Why: on a Deploy verdict, tick() called
`write_deploy_request(&DeployRequest::new(tip, now))` unconditionally — re-stamping
requested_ms every tick for the same tip. And in the STRANDED state decide() returns
Deploy on EVERY tick (tip readable, core answering, tip != running, no hold, no build in
flight, checks green, tree clean — every guard passes). So reconcile_request always read a
request stamped exactly one tick ago. Observed directly: request_written fired at
11:41:07, 11:46:07 and 11:51:07 for the same tip, and the file read requested_ms=11:51:04.

The DeployRequest doc comment promised the fix and the code never had it: "Keyed by
tip_sha so re-recording the same tip is idempotent (the module does not re-emit an
identical pending request every tick)."

What it cost, and the part that is mine:
  before #4190  Stranded fired one tick after the request, always, reporting a constant
                dressed as a duration — misleading, but it fired.
  after #4190   I added STRANDED_GRACE_MS = 20 min and compared elapsed_ms against it.
                300 s is never 20 min, so deploy.stranded became UNREACHABLE. I turned a
                misleading probe into a dead one. The grace was right in intent and wrong
                in what it was measured against.
  also          deploy.settled's waited_ms measured from the LAST re-stamp: this node's
                12:43:58 settle reported 3,171,068 ms (52.9 min) for a request first
                written at 11:41 — off by the ten minutes of re-stamps.

The class is [[the-metric-is-wrong-for-the-decision]]: the gate ran, emitted, and decided
correctly against a number invariant under the thing being decided. I had the evidence
in hand: my own #4190 message says "elapsed_ms=300004 is exactly one tick after the
request" — I SAW the coincidence and filed it as eagerness instead of asking why it could
never be anything else. A third sample was already in the ledger and I never looked.

The fix is the promised idempotence, as a pure function so it is assertable with no
filesystem: `request_to_persist(existing, tip, now)` returns None for an unchanged tip
(leave the original stamp alone — it is the only record of how long this has been owed)
and a fresh request only for a changed one. The module writes, and probes, only when it
returns Some. Now elapsed_ms is an age, the grace means what it says, Stranded fires at 20
minutes on a genuinely stranded deploy, waited_ms is honest, and the per-tick
request_written repeat is gone.

Receipt:
    cargo test -p continuum-core --lib --features metal,accelerate -j 2 \
      -- deploy_tracker deploy_claim
    16 passed; 0 failed; 8293 filtered out; REAL_EXIT=0
    lib test: 75 warnings, none naming either file

New test `a_standing_request_keeps_its_original_timestamp_so_elapsed_is_an_age`: two ticks
of an unchanged tip persist nothing, and — the assertion that fails against the old
behaviour — a request standing past STRANDED_GRACE_MS with nothing building IS Stranded.
Under re-stamping, elapsed_ms could never exceed one tick and that arm was unreachable.

Card: c48fc453-7dfb-451e-ac48-0b0ffc364624

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Sep 20, 2026
…d_ms was the tick period, and my #4190 grace compared against it (#4191)

Every deploy.stranded this node has ever recorded, across three separate deploys:

    09-18 07:41:39   elapsed_ms = 300014
    09-18 08:56:39   elapsed_ms = 300004
    09-18 11:46:07   elapsed_ms = 299882
    tick interval, from 75 consecutive deploy.track.* rows: 300 s

Three deploys, three values within 132 ms of each other, all equal to the tick. That
number was never the age of the request. It was the cadence wearing a duration's name.

Why: on a Deploy verdict, tick() called
`write_deploy_request(&DeployRequest::new(tip, now))` unconditionally — re-stamping
requested_ms every tick for the same tip. And in the STRANDED state decide() returns
Deploy on EVERY tick (tip readable, core answering, tip != running, no hold, no build in
flight, checks green, tree clean — every guard passes). So reconcile_request always read a
request stamped exactly one tick ago. Observed directly: request_written fired at
11:41:07, 11:46:07 and 11:51:07 for the same tip, and the file read requested_ms=11:51:04.

The DeployRequest doc comment promised the fix and the code never had it: "Keyed by
tip_sha so re-recording the same tip is idempotent (the module does not re-emit an
identical pending request every tick)."

What it cost, and the part that is mine:
  before #4190  Stranded fired one tick after the request, always, reporting a constant
                dressed as a duration — misleading, but it fired.
  after #4190   I added STRANDED_GRACE_MS = 20 min and compared elapsed_ms against it.
                300 s is never 20 min, so deploy.stranded became UNREACHABLE. I turned a
                misleading probe into a dead one. The grace was right in intent and wrong
                in what it was measured against.
  also          deploy.settled's waited_ms measured from the LAST re-stamp: this node's
                12:43:58 settle reported 3,171,068 ms (52.9 min) for a request first
                written at 11:41 — off by the ten minutes of re-stamps.

The class is [[the-metric-is-wrong-for-the-decision]]: the gate ran, emitted, and decided
correctly against a number invariant under the thing being decided. I had the evidence
in hand: my own #4190 message says "elapsed_ms=300004 is exactly one tick after the
request" — I SAW the coincidence and filed it as eagerness instead of asking why it could
never be anything else. A third sample was already in the ledger and I never looked.

The fix is the promised idempotence, as a pure function so it is assertable with no
filesystem: `request_to_persist(existing, tip, now)` returns None for an unchanged tip
(leave the original stamp alone — it is the only record of how long this has been owed)
and a fresh request only for a changed one. The module writes, and probes, only when it
returns Some. Now elapsed_ms is an age, the grace means what it says, Stranded fires at 20
minutes on a genuinely stranded deploy, waited_ms is honest, and the per-tick
request_written repeat is gone.

Receipt:
    cargo test -p continuum-core --lib --features metal,accelerate -j 2 \
      -- deploy_tracker deploy_claim
    16 passed; 0 failed; 8293 filtered out; REAL_EXIT=0
    lib test: 75 warnings, none naming either file

New test `a_standing_request_keeps_its_original_timestamp_so_elapsed_is_an_age`: two ticks
of an unchanged tip persist nothing, and — the assertion that fails against the old
behaviour — a request standing past STRANDED_GRACE_MS with nothing building IS Stranded.
Under re-stamping, elapsed_ms could never exceed one tick and that arm was unreachable.

Card: c48fc453-7dfb-451e-ac48-0b0ffc364624


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

Co-authored-by: Claude Opus 5 (1M context) <[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