Skip to content

refactor(serving): lane demand is its own submodule of serving_daemon (slice 1 of 11,822 lines) - #4996

Closed
joelteply wants to merge 6 commits into
canaryfrom
dbc9711c/serving-daemon-package
Closed

joelteply wants to merge 6 commits into
canaryfrom
dbc9711c/serving-daemon-package

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

BigMama's step 6, card dbc9711c. serving_daemon.rs mixed every concern of serving in one
11,822-line file. Slice 1 moves the lane-demand authority into serving_daemon/lane_demand.rs:
LaneDemandState, its statics, the pure demand decisions (settles_this_tick, ready_edge,
knee_model, resident_lane_demand, sustained_leased_in), and quiesce/release. Items the parent
still uses are pub(super) and imported once. The external callers (airc_runtime_registry,
benchmark_resume) move to serving_daemon::lane_demand:: with no re-export.

While moving them: the five lock-poison expects now carry their reason. The unjustified
unwrap baseline ratchets DOWN 2257 -> 2253.

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

… (slice 1 of 11,822 lines)

BigMama's step 6, card dbc9711c. serving_daemon.rs mixed every concern of serving in one
11,822-line file. Slice 1 moves the lane-demand authority into serving_daemon/lane_demand.rs:
LaneDemandState, its statics, the pure demand decisions (settles_this_tick, ready_edge,
knee_model, resident_lane_demand, sustained_leased_in), and quiesce/release. Items the parent
still uses are pub(super) and imported once. The external callers (airc_runtime_registry,
benchmark_resume) move to serving_daemon::lane_demand:: with no re-export.

While moving them: the five lock-poison expects now carry their reason. The unjustified
unwrap baseline ratchets DOWN 2257 -> 2253.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
… and snapshot are serving_daemon submodules (slice 2)

Card dbc9711c, BigMama's step 6. serving_daemon.rs goes from 11,822 to 9,863 lines. Six
concerns move into serving_daemon/:
- gates: floor, downshift, lane admission, pin fit;
- host_budget: host budget inputs, steady/ludicrous holds, pool kind;
- vram: governed ceiling, last good reading, engine device bytes, serving attribution;
- prompt_cache: per-launch cache grant, rotating minds, sidecar headroom;
- candidates: servable models, refusals, hardware tier;
- snapshot: sticky window, wedge-heal floor, published snapshot.

Mechanics:
- Private top-level items are pub(super), and the parent imports each submodule once.
- Trait-impl methods keep no visibility.
- External callers move to the new paths, with no re-exports: eval, ai_provider,
  working_set, lane_args, serving_consumer, exam_serving, system_profile.

Found while moving: six production unwraps the unwrap gate never counted, because the
rule treats everything after a file's first #[cfg(test)] as test code, and serving_daemon.rs
has one early. Out of that shadow they count. Each now carries its reason: the 0 or default
is either never used as a quantity or is the documented honest answer. The baseline holds
at 2253.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@github-actions github-actions Bot added size: XL and removed size: L labels Oct 12, 2026
joelteply and others added 4 commits October 12, 2026 16:42
…ost_budget (the one path my rewrite missed)

CI at 4bbdff4: E0603 at commands/agent/solve.rs:385. The caller-rewrite skipped names
followed by '::'; it now handles them, and solve.rs was the only one.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…ring, intent, plan, measure, reconcile, health, publish) beside its state

Slice 3 of card dbc9711c. serving_daemon.rs drops to 5,929 lines. Moving the
methods exposed production unwraps that the hygiene production half had hidden
after the first #[cfg(test)]. Each one now carries a same-line reason. The two
fingerprint-lock unwraps in the health heartbeat could have killed the spawned
heartbeat silently, so they now recover the poisoned value like every other lock
in this module. The serving snapshot's to_value names its boundary: the bus
event that reaches remote subscribers.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
… so a seam is found wherever it moved

CI on 1194287: a_refusal_names_the_pin_that_caused_it and
the_serving_daemon_installs_the_admission_authority failed. They searched only
serving_daemon.rs, and the refusal probe and lane_admission_authority now live in
candidates.rs and plan.rs. The one negative assertion (no pin_store.clear()) was
checked against the package with grep and still holds.

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

#5000 (time::EpochMs) rewrote nine clock sites in serving_daemon.rs, and #4996
had moved most of that code into serving_daemon/. The conflict keeps the split
file, and every #5000 rewrite is applied where its code now lives:
chat::now_ms and trace::now_ms become EpochMs::now().millis() (serving_daemon.rs,
measure.rs, prompt_cache.rs, health.rs, reconcile.rs x3); vram.rs's private
epoch_ms() is deleted and its two callers read EpochMs; snapshot.rs's
ready_verified_at_ms reads EpochMs::read. source-hygiene, including #5000's
wall_clock gate, exits 0.

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

Copy link
Copy Markdown
Contributor Author

Closed in the queue sweep (Fable, 2026-10-24): obsolete: the 6,274-line serving_daemon move predates the crate cuts; the files it moves were split or deleted since. Reopen if this is wrong.

@joelteply joelteply closed this Oct 25, 2026
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