Repository navigation
fix(deploy): a standing request keeps its ORIGINAL timestamp — elapsed_ms was the tick period, and my #4190 grace compared against it - #4191
Merged
joelteply merged 1 commit intoSep 20, 2026
Conversation
…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
force-pushed
the
c48fc453/deploy-stranded-s-elapsed-ms-is-the-tick
branch
from
September 20, 2026 21:13
affb200 to
77a0c02
Compare
joelteply
enabled auto-merge (squash)
September 20, 2026 21:36
joelteply
deleted the
c48fc453/deploy-stranded-s-elapsed-ms-is-the-tick
branch
September 20, 2026 21:36
joelteply
added a commit
that referenced
this pull request
Sep 20, 2026
Resolutions: - `modules/deploy_tracker.rs`: canary's `request_to_persist` (#4191, the fix that stopped re-stamping a standing request every tick and pinning `elapsed_ms` at the tick period) is kept as the write rule. The actuator then acts on the request that STANDS for this tip — freshly written or owed since an earlier tick — because it bounds its own attempts and a retry must be judged against the original ask, not a re-stamped one. This branch's `request_for_tip` is deleted as superseded, and its test with it: canary already pins the same law in the right place (`runtime::deploy_tracker::a_standing_request_keeps_its_original_timestamp_so_elapsed_is_an_age`). - `docs/architecture/RTOS-DEBUGGER-PROBES.md`: both probe sections kept — the deploy actuator's and the workspace transfer's. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
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.
Every deploy.stranded this node has ever recorded, across three separate deploys:
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-stampingrequested_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 ticksof 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