Repository navigation
refactor(router): add dynamo-router-protocol, the wire vocabulary crate - #111
Closed
ishandhanani wants to merge 1 commit into
Closed
ishandhanani wants to merge 1 commit into
ishandhanani wants to merge 1 commit into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
October 30, 2026 16:23 — with
GitHub Actions
Failure
Extract the identities and worker-facing vocabulary every router crate names into lib/router/protocol: worker and rank ids, partition, pool, owner, and domain identities, WorkerType, the residency vocabulary, the block-hash newtypes, worker load and metadata wire types, KV hint wire types, SessionContext, and AttemptId. lib/kv-router keeps pub use shims at every old path, so no other crate's imports change. AttemptId has no public constructor any more. AttemptIdMinter::mint is the only way to obtain one and yields fresh ids only; the slot tracker's RequestIndex holds the one minter. Tests use for_testing behind the testing feature, benches for_benchmark behind bench. ResidencyOwner's BLAKE3 compact_key is hashing, not wire, so it becomes the ResidencyOwnerKeyExt extension trait in dynamo_kv_router::protocols. The crate depends on exactly serde, serde_json, and thiserror. scripts/router_layering_check.sh enforces that by set equality, forbids behavior in the crate, and fails closed; it runs in pre-commit and, with --host, in the Rust CI job. scripts/router_move_diff.py shows the move is a move: 3,858 lines found, 45 new (minter, extension trait, one test), 9 dropped (the replaced constructor paths). Step 1 of the router split v2 plan. DYNO-170. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-170-router-protocol
branch
from
November 2, 2026 13:29
ebe3e70 to
7663c31
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 2, 2026 13:29 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
November 2, 2026 13:53 — with
GitHub Actions
Failure
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
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.
Step 1 of the router split v2 (DYNO-170). Fork draft; upstream slicing follows the plan.
Summary
Adds
dynamo-router-protocol(lib/router/protocol): the identities and worker-facing wire vocabulary every router crate names, extracted fromlib/kv-routerwithpub useshims left at every old path so no other crate's imports change.What moved, by module:
worker:WorkerId,DpRank,WorkerWithDpRank,WorkerAffinityTargetidentity:RoutingPartitionId/Ref,IdentitySource,CacheSemanticsId,RoutingScopeId,StableDpSlotId,IndexerDomainId,ClusterId,PoolId,CacheOwnerId,IdentityParseError,DEFAULT_ROUTING_GROUP(the indexer identity spec, map, and canonical material stay in kv-router)residency:StorageTier,ResidencyDomain,ResidencyOwner,ResidencyOwnerKey,ResetScope,WireResidencyDomain,UnsupportedResidencyDomainblock_hash:LocalBlockHash,ExternalSequenceBlockHash(the functions that compute them stay in kv-router)load:SchedulerLoad,SchedulerGroup,ActiveLoadmetadata:RouterHintSourceMetadatakv_hints: theKV_HINT_*runtime-config keys,KvHint,KvHintAction,KvSourceLocationsPayloadsession:SessionContext,WorkerSelectionInputTriggerworker_type:WorkerType,ParseWorkerTypeErrorattempt:AttemptIdand the newAttemptIdMinterTwo deliberate non-moves:
AttemptIdloses its#[doc(hidden)] pub fn new. The only way to obtain one isAttemptIdMinter::mint, which yields fresh monotonic ids and never a chosen value; the slot tracker'sRequestIndexholds the one minter. Tests useAttemptId::for_testingbehind thetestingfeature, benchesfor_benchmarkbehindbench. This restores the property the single crate had throughpub(crate).ResidencyOwner::compact_key(BLAKE3) is hashing, not wire. It becomes theResidencyOwnerKeyExtextension trait indynamo_kv_router::protocols; call sites gain oneuseline, including one inlib/llm/src/kv_router/indexer/recovery/state_agent.rs.The crate's dependency contract is exactly
serde,serde_json,thiserror, and the new fail-closedscripts/router_layering_check.shenforces it by set equality plus a grep that forbidsdyn,async,std::fs,anyhow,tracing,derive_builder, and hidden-pub items in the crate.scripts/router_move_diff.pyis the review artifact that shows the move is a move.Design and plan: minamo design notes,
SPLIT_V2.mdandPLAN.mdsection 11.Validation
cargo tree -p dynamo-router-protocol -e normal --depth 1: direct depsserde,serde_json,thiserror; full closure 14 crates.cargo test -p dynamo-router-protocol: 10 passed.cargo check -p dynamo-kv-router: clean, no warnings.cargo test -p dynamo-kv-router: 1,127 passed, 0 failed, 3 ignored (lib 1,126 + integration 1); the protocols test module alone 42 passed.cargo check -p dynamo-llm -p dynamo-mocker -p dynamo-bench -p dynamo-custom-policy-builtin --tests: clean (one warning fixed: thelib/llmextension-trait import belongs in its test module);cargo check -p dynamo-llm --testsclean.scripts/router_layering_check.sh: 5 checks, 0 failures;--hostmode 21 checks, 0 failures (dynamo-llm,dynamo-ext-proc,dynamo-mockeragainst prometheus, axum, hyper, reqwest, zmq).scripts/router_move_diff.py(base91a64d9e14-> worktree): 3,858 normalized lines found; 45 new (the minter, the extension trait,ResidencyOwnerKey::from_digest,is_missingmade public, one minter test); 9 dropped (the replacedAttemptId::newand inherentcompact_keypaths). Per-file fractions: protocols.rs 0.999, identity.rs 1.000, worker_type.rs 1.000, kv_hints.rs 1.000, scheduling/types.rs 0.996, request_maps.rs 0.981.cargo clippy -p dynamo-router-protocol -p dynamo-kv-router --all-targets -- -D warnings: clean;cargo fmtapplied.lib/router/andlib/router/protocol/claimed under the router area;build_codeowners.py --strictandemit_codeowners.pyregenerated;validate_agent_instructions.py: 45 scopes OK.lib/kv-router/src/identity.rs(they exercise id and spec types together) and run through the shim.