Skip to content

refactor(router): import the owners inside kv-router and deprecate its shim paths - #186

Closed
ishandhanani wants to merge 3 commits into
idhanani/rs2-12-host-rewritefrom
idhanani/rs2-13-kv-router-thins
Closed

ishandhanani wants to merge 3 commits into
idhanani/rs2-12-host-rewritefrom
idhanani/rs2-13-kv-router-thins

Conversation

@ishandhanani

Copy link
Copy Markdown
Owner

Router split v2, unit 13 of 17. Stacked on #185 (unit 12).

Summary

Step 7d: kv-router stops using its own shims and marks them deprecated. #155 moves the twenty tier-1 inline paths the 8a rewrite skipped (a name followed by ::assoc, {, or ,) onto the prelude; #156 makes kv-router's own code (29 files: src, benches, integration tests) import the kernel, the stages, and the vocabulary crates instead of the shim modules it keeps for external callers; #157 puts #[deprecated(since = "1.7.0")] on every shim path (74 notes), moves the five tests the protocols shim carried to their owners, and aliases queue/selector to the kernel modules so every dynamo_kv_router::queue::X path still resolves. Rule applied: a shim is a one-release compatibility surface, never an import path anything in-tree uses; the workspace builds with -D warnings and no deprecated path in use. Unit 17 removes the shims. Replaces fork PRs #155, #156, #157.

What moves

Dependency edges

None; scripts/router_layering_check.sh is unchanged in this range.

Validation

No unit-level move-diff: the replaced fork PRs move no code (two are import re-points, one adds attributes and relocates five tests it describes verbatim), so no --from/--to lists exist for this unit.

Chain v2, full mode, on the rebased stack head ebd31cdf4d (every unit's commits are ancestors of it; the chain ran once on the head, not per unit), log /tmp/rr-split/srebase-validation.log: stage 1, the 13 router crates (clippy under default and all features, cargo test 1,247 passed / 5 ignored, rustdoc with all features), 1 min 50 s; stage 2, kv-router (clippy, bench check, 229 tests including the prelude test), 1 min 20 s; stage 3, workspace clippy, 4 min 58 s; stage 4, hosts (dynamo-llm lib alone, its kv_router 492 / discovery 275 / pool_relay 261 tests, 13 host crates clippy, bindings clippy; the pre-existing kvbm-consolidator manifest failure is the one non-zero exit), 29 min 21 s; stage 5, gates (every kv-router feature alone and together, 6 public-API snapshots unchanged with kv-router at 918 items, layering gate 47 checks and --host 66 checks with 0 failures, codeowners 7590/7590, fmt, 3 lockfiles --locked), 3 min 06 s; 40 min 35 s total, exit 0.

Each replaced fork PR carried its own validation chain; see its body.

Tickets

Part of DYNO-180

Step 7d-0 of the router split (DYNO-180). The 8a rewrite of the builtin
plugin crate missed fully qualified paths whose name is followed by an
associated function, a brace, or a comma: twenty sites in its tests,
benches, and the thunderagent module still named kv-router's root
re-exports and shim modules (DefaultWorkerSelector, SharedCacheHits,
WorkerInputs, WorkerLoadProjection, KvSchedulerError,
WorkerSelectionPolicy, the kv_hints types, one protocols type,
KvRouterConfig). They now name plugins::prelude, the
kernel's host module (the reference selector), or config, so that 7d-2
can deprecate the root re-exports without a warning in tree.

Validation: kv-router clippy -D warnings --all-targets over seven
feature sets (none, full, the standalone aliases, each adapter alone)
and its full-feature tests; workspace clippy --all-targets -D warnings
(default features); eleven hosts and examples checked alone with
--all-targets; Python bindings clippy (kv-indexer, slot-tracker,
select-service) and C bindings clippy; cargo hack --each-feature on
kv-router (15 configurations); public-api snapshot unchanged (1392
items); layering gate --host 42 checks; codeowners strict; fmt; rustdoc
-D warnings on kv-router.

Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
…wn shims

Step 7d-1 of the router split (DYNO-180). kv-router's own code reached
the kernel, the stages, and the vocabulary crates through the shim
modules it keeps for external callers (scheduling::*, protocols,
identity, indexer, kv_hints, sequences, recovery, conditional_disagg,
zmq_wire) and through its own root re-exports (crate::WorkerType,
crate::WorkerSelectionPolicy, the tracking-hash types), and its own
benches and integration tests did the same through dynamo_kv_router::.
Every such import now names the owner directly, the same way the hosts
do since step 8 (the frozen tests/plugin_api_compat.rs is untouched); kv-router's own items (the flat config, policy_config, the
plugin surface, tracking_hash_context) keep their paths. No item moves and
no behavior changes; this is what lets 7d-2 mark the shims deprecated
without kv-router warning at itself.

Validation: kv-router clippy -D warnings --all-targets over seven
feature sets (none, full, the standalone aliases, each adapter alone)
and its full-feature tests; workspace clippy --all-targets -D warnings;
eleven hosts and examples checked alone with --all-targets; Python and
C bindings clippy; cargo hack --each-feature on kv-router (15
configurations); public-api snapshot unchanged (1392 items); layering
gate --host 42 checks; codeowners strict; fmt; rustdoc -D warnings.

Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Step 7d-2 of the router split (DYNO-180). dynamo-kv-router is the
composition crate: the flat configuration and its parsers, the plugin
registry and plugins::prelude, SelectionService and its builder, and the
adapters behind features. Every other path it still exposes is a shim
over a stage or the kernel, kept so that callers outside this tree have
one release to move. Those paths now carry #[deprecated] notes naming
the owner: the root re-exports of stage and kernel items, the shim
modules (scheduling's kernel re-exports and submodules, protocols,
identity, indexer, kv_hints, sequences and its aliases, recovery,
worker_type, conditional_disagg, zmq_wire, session_prefix_index, the
indexer aliases), and services::selection's kernel re-exports with its
TODO(v1.7) compatibility block. Nothing in this tree uses a deprecated
path (the workspace builds with -D warnings); the frozen
tests/plugin_api_compat.rs and the selection service's HTTP test
module (which glob-imports the module) allow them on purpose. Two
consequences: the root `queue` and `selector` aliases now name the
kernel modules directly instead of the deprecated shim submodules
(same paths for every consumer), and the five tests the protocols shim
carried for types it only re-exports move verbatim to their owners
(protocol's block_hash.rs, worker-selection's shared_cache.rs). The
public-api snapshot and the README's path table follow. The
standalone-* feature aliases stay one more release, as 7b documented.

Validation: kv-router clippy -D warnings --all-targets over seven
feature sets and its full-feature tests; workspace clippy --all-targets
-D warnings (no deprecation warning anywhere in tree); eleven hosts and
examples checked alone with --all-targets; Python and C bindings
clippy; cargo hack --each-feature on kv-router (15 configurations); the
five relocated tests pass in their owners; public-api snapshot
regenerated (1390 items: the two root module aliases change form, no
consumer path changes); layering gate --host 42 checks; codeowners
strict; fmt; rustdoc -D warnings.

Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
@ishandhanani

Copy link
Copy Markdown
Owner Author

Landed upstream as ai-dynamo#18055 (squash commit 79692cf on main, 2026-11-11). Closing this fork review unit.

This branch had an error being deployed

1 failed deployment
external_collaborator — 81ace25c Deployed Nov 2, 2026 by ishandhanani via ok-to-test #525
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant