Skip to content

A node held for resident work says so: serving/status and the hourly health carry the hold (card a18452d6) - #5543

Merged
joelteply merged 3 commits into
canaryfrom
a18452d6/a-node-held-for-resident-work-says-so-se
Oct 27, 2026
Merged

joelteply merged 3 commits into
canaryfrom
a18452d6/a-node-held-for-resident-work-says-so-se

Conversation

@joelteply

@joelteply joelteply commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

On enrico, 2026-10-27, Delia's gene training (job f633bd36) held the node's only engine for hours, and no resident could be seated. The node looked dead:

  • serving/status read ready: false, degraded_reason: null;
  • citizen.health.hour read verdict: empty;
  • two consecutive empty-node receipts were raised against it.

The hold had been decided correctly, from the authoritative engine occupancy, but it was only ever probed (serving.reconcile.held_for_resident_work), never published. Assigned by Codex, who specified a typed occupancy field, since_ms kept across observations, clear on release or replacement, no identity inferred from labels, both consumers, and fixtures for held→release and a changed incarnation.

Change

  • continuum-engine llama_server/serving_hold.rs: a typed ServingHold:
    • its fields are since_ms and by, where by is Resident { work: [job, consumer, base_model, engine pid/started_s/port] } | Unknown { reason };
    • it is derived purely by ServingHold::of(occupancy, previous, now) from engine_residency::Occupancy;
    • the same work on the same incarnations keeps since_ms, while a changed incarnation or job starts a new hold and a free engine has none;
    • the record's order is not identity.
  • ServingSnapshot.held_for: a separate field, never degraded_reason, because a hold is not a degradation (one value, one meaning). serving/status returns the snapshot, so it shows the hold.
  • Serving daemon (continuum-serving):
    • it keeps the hold itself (serving_hold), because other publishers replace the snapshot whole;
    • publish_hold runs at the reconcile's existing occupancy decision, inside its ServingOperation, and sets the hold when held, clearing it when the engine is free or when the paging emergency replaces it anyway;
    • it emits only on change.
  • Hourly health (continuum-cognition health_ledger, continuum-core citizen_health): CitizenHealth.held_for is read from the published snapshot. An hour that was held and in which nothing acted reads HELD: the engine hosts live work since <rfc3339> — job <id> (<consumer>) on engine pid <pid>, never EMPTY or IDLE. Minds that acted are judged on their acts.

Tests

Fixture Crate Result (local, macOS x86_64)
a_hold_keeps_its_start_while_it_lasts_and_is_gone_on_release engine pass
a_changed_incarnation_or_job_is_a_new_hold engine pass
the_records_order_is_not_a_new_hold engine pass
a_hold_is_published_keeps_its_start_and_is_cleared_on_release (across a replaced snapshot) serving pass
a_held_engine_reads_held_with_its_work_never_empty core CI's (continuum-core is not built on this resident host)
  • Engine: 76 passed (serving_hold plus llama_server::tests, with the new snapshot field in place).
  • Serving lib: 140 of 142 passed. The 2 failures are host-dependent and pre-existing: serving_budget_plans_around_other_consumers_floors and without_a_past_form_of_ourself_a_six_gigabyte_box_really_does_downshift fail identically on canary without this change on this host, which had about 13 GB held by the training job (card c4d84be3's class).
  • Other checks: the cognition lib check is clean, and the ratchets pass 68/68.
  • ServingSnapshot literals: 15 full literals across the workspace gained held_for: None.

Measured after deploy (owner: Cormac)

On the next node held for resident work, serving/status shows held_for with the job and a stable since_ms, and the hourly health reads HELD. Card a18452d6 stays open until that receipt is posted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

joelteply added a commit that referenced this pull request Oct 27, 2026
…ever called live work (Codex on #5543)

- a_held_engine_reads_held_with_its_work_never_empty was inserted before the
  previous test's closing brace, nested inside it, so the harness never ran it.
  It is now its own top-level #[test].
- The HELD line said "the engine hosts live work" for HoldCause::Unknown too,
  where no work is confirmed. Each cause now has its own words: resident work
  names its jobs; an unreadable record says the engine's ownership is unknown
  and serving holds it. The test asserts the unknown line never claims live work.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Oct 27, 2026
…52d6)

The binding drift check on #5543 (job 122506384418) found ServingSnapshot.ts
without the new held_for field; regenerated by the engine's export_bindings tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Oct 27, 2026
…, not dev/ino (card 005e1676) (#5544)

* A local endpoint's cleanup spares its successor by an ownership token, not dev/ino (card 005e1676)

local_stream::Owned::remove decided whether the endpoint was still its own by the
socket's (dev, ino). Linux reuses an inode number at once, so a predecessor's
cleanup removed its successor's socket:
a_live_owner_is_refused_and_an_old_cleanup_spares_its_successor failed at
mod.rs:134 on canary 107af91 and on every PR's host job (#5543 at cbba67a).

Now each bind writes a fresh ownership token (pid, clock, per-process count) to
the custody sidecar, under custody, and Owned keeps it. remove deletes the socket
only while the sidecar still holds that token, then clears it; a successor's bind
writes its own, so a late predecessor cleanup spares it whatever inode the socket
got. A crashed owner's leftover token is harmless: the next binder reclaims the
stale endpoint and writes its own. The custody wait stays bounded (2 ms poll,
2 s ceiling). The successor test no longer depends on inode reuse, so it is
deterministic on every OS: 60 of 60 stress runs pass on macOS; Linux is CI's.

Taken back from Fable: part a (#5533) is my code.

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

* Cleanup requires both the socket identity and the ownership token: a replacement is spared as well as a successor (Codex on #5544)

The token alone (ee9c615) let an old owner's cleanup remove whatever replaced its
socket outside custody: a regular file, a symlink, or a listener that never wrote
the sidecar. Owned now keeps the socket's (dev, ino) again beside the token, and
remove deletes the path only while it is still a socket with that identity AND the
sidecar holds this bind's token: the identity spares any replacement, the token a
successor whose socket reused the inode number.

Test: an_old_cleanup_never_removes_what_replaced_its_socket (a regular file and a
symlink at the path survive the old cleanup). Proven by mutation: with the
identity check removed it fails ("a regular file at the path survives").
The token's doc no longer claims absolute uniqueness; the stale Owned doc is fixed.
Host: 10 lib + 1 integration pass, 60/60 stress.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
joelteply and others added 3 commits October 27, 2026 18:01
…health carry the hold (card a18452d6)

enrico 2026-10-27: Delia's gene training (f633bd36) held the node's only engine for
hours. serving/status read ready:false, degraded_reason:null and citizen.health.hour
read "empty", so a deliberate hold was chased as a dead node (two empty-node
receipts). The hold was decided from the authoritative occupancy and only probed.

- inference::llama_server::serving_hold: a typed ServingHold { since_ms, by:
  Resident{work: [job, consumer, base_model, engine pid/started_s/port]} |
  Unknown{reason} }, derived PURELY from engine_residency::Occupancy. The same
  work on the same incarnations keeps since_ms; a changed incarnation or job, or
  a free engine, does not. Identity is the record's ids, never a label.
- ServingSnapshot.held_for: a separate field, never degraded_reason (a hold is
  not a degradation). serving/status returns the snapshot, so it shows the hold.
- The serving daemon keeps the hold itself (other publishers replace the
  snapshot whole) and publish_hold runs at the reconcile's occupancy decision:
  set when held, cleared when free or when the paging emergency replaces it.
- citizen.health.hour: CitizenHealth.held_for read from the published
  snapshot; a held hour in which nothing acted reads HELD with the work and its
  start, never EMPTY or IDLE. Minds that acted are judged on their acts.

Fixtures: held then kept then released, a changed incarnation and job, record
order (engine); a hold published across a replaced snapshot and cleared on
release (serving daemon); a held hour reads HELD with the job (core health).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…ever called live work (Codex on #5543)

- a_held_engine_reads_held_with_its_work_never_empty was inserted before the
  previous test's closing brace, nested inside it, so the harness never ran it.
  It is now its own top-level #[test].
- The HELD line said "the engine hosts live work" for HoldCause::Unknown too,
  where no work is confirmed. Each cause now has its own words: resident work
  names its jobs; an unreadable record says the engine's ownership is unknown
  and serving holds it. The test asserts the unknown line never claims live work.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…52d6)

The binding drift check on #5543 (job 122506384418) found ServingSnapshot.ts
without the new held_for field; regenerated by the engine's export_bindings tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the a18452d6/a-node-held-for-resident-work-says-so-se branch from cbba67a to 679c5b7 Compare October 27, 2026 23:01
@joelteply
joelteply merged commit 470e5b0 into canary Oct 27, 2026
33 checks passed
@joelteply
joelteply deleted the a18452d6/a-node-held-for-resident-work-says-so-se branch October 27, 2026 23:18
joelteply added a commit that referenced this pull request Oct 28, 2026
…ing the run (card 9beab2da) (#5551)

* A deploy defers on the node's in-engine training hold instead of killing the run (card 9beab2da)

The windows 5090, 2026-10-28: the supported consumer adopted 84386a at 02:31:56 while
serving/status read held_for genome-train:8b46862c (#5543), and killed its in-engine
run at 41%. The consumer hands off through reboot(force: false), whose guards knew only
mlx_lm pids and eval markers; nothing read the engine's own hold.

- ServingHold::live_work (continuum-engine): the live work a handoff would end, named
  by consumer, base and engine; None for an unknown cause (not evidence of work) or no
  work.
- reboot(): beside the trainer and eval guards, reads the running core's serving/status
  and refuses as PublishedCoreError::Held when it names live work; --force ends it. No
  core answering, or an unreadable snapshot, proceeds and says so: no running core holds
  anything this handoff could end, and the deploy may be its repair.
- PublishedCoreError::Held (continuum-cli-lifecycle): the consumer records it as a
  resource refusal with no attempt charged and no durable deferral, so it rechecks on
  its next pass (a plain error would charge HandoffFailed and give up after three).

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

* An unreadable hold on a live core defers the handoff, --force names what it ends, and a Held refusal is tested to charge nothing (Codex on #5551)

At 6e6a4a1 a serving/status read that timed out or did not decode collapsed into
"nothing held", so a busy training core could still be killed because the guard's read
failed; --force skipped the read, ending work with no receipt.

- deploy_hold (continuum-cli-lifecycle, beside core_bind_guard): the pure verdict over
  HoldObservation { NoCore, Free, LiveWork, Unreadable }. Only Free and NoCore proceed
  on their own; LiveWork and Unreadable defer; --force proceeds through either and says
  what it ends, or that it could not know.
- reboot(): observe_engine_hold reads serving/status always (forced too). A failed read
  is NoCore only when no core process is alive (running_core_pids), else Unreadable.
- deploy_consume: handoff_refusal, the pure charge of a refused handoff (Deferred /
  Blocked / Failed), extracted from the pass with its behaviour unchanged; Held is
  Blocked (no attempt charged, no durable deferral).

The race between the hold read and the teardown (a job admitted in between) is scoped
to card 91921d0f, with S7 stop-drain (920619c5).

Tests: deploy_hold::only_a_confirmed_absence_of_work_proceeds_and_force_names_what_it_
ends (local); deploy_consume_tests::a_held_handoff_charges_no_attempt_and_keeps_no_
deferral (CI).

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

* A decoded hold of unknown cause defers the handoff like an unreadable one (Codex on #5551)

At 04b1aa4 a serving/status hold that decoded with by = Unknown (its residency record
unreadable) went live_work -> None -> Free, so the handoff proceeded past work it could
not see. observation_of (reboot.rs, pure) maps a decoded hold: none is Free, resident
work is LiveWork, an Unknown cause is Unreadable (deferred, --force overrides).

Test: reboot_tests::a_decoded_hold_of_unknown_cause_is_unreadable_never_free, from
held_for's own wire JSON (resident, unknown, empty).

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

* CI's CLI handoff job runs the two new deploy-hold regressions by exact name (Codex on #5551)

The job's exact list held seven tests and neither new one, so a green job never ran them:
tests::reboot_tests::a_decoded_hold_of_unknown_cause_is_unreadable_never_free and
tests::deploy_consume_tests::a_held_handoff_charges_no_attempt_and_keeps_no_deferral. Each
must report '1 passed' or the job fails.

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

---------

Co-authored-by: Claude Opus 5.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