Repository navigation
refactor(router): add dynamo-kv-events for KV event types and the engine codec - #113
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:56 — with
GitHub Actions
Failure
…ine codec Move everything about KV cache events out of lib/kv-router into lib/kv-events: the event types (KvCacheEvents, KvCacheEvent, KvCacheEventData, store, remove, and stored-block data, KvCacheEventError), the RouterEvent envelope and its builders, KV_EVENT_SUBJECT, the engine ZMQ msgpack codec (zmq_wire), the replay cursor (recovery/cursor.rs), and the publisher placement helpers (Placement, PlacementOwner, PlacementEvent). The RouterEvent legacy-wire tests and the router event constructor test move with the types; the codec's tests move with the codec. Both ends of the KV-event wire depend on this crate: workers, sidecars, and the C bindings publish with it, the router's indexer ingests with it. It depends on dynamo-router-protocol and dynamo-kv-hashing plus serde, rmp-serde, rustc-hash, thiserror, and tracing; no sockets, tasks, or servers. lib/kv-router keeps pub use shims at every old path, including the zmq_wire and recovery module paths, so no other crate's imports change. KvCacheEventError is non-exhaustive, which binds only across crates, so kv-router's two exhaustive matches on it (behind the metrics feature) gain a wildcard arm and an "unknown" status counter. The layering gate gains a dynamo-kv-events row; CODEOWNERS claims lib/kv-events and follows the moved extra_keys override. Step 2 of the router split v2 plan. DYNO-172. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-172-kv-events
branch
from
November 2, 2026 13:29
c34afd8 to
acd8bf4
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 2 of the router split v2 (DYNO-172), stacked on #112.
Summary
Adds
dynamo-kv-events(lib/kv-events): everything about KV cache events, for both ends of the wire.event:KvCacheEvents,KvCacheEvent,KvCacheEventData,KvCacheStoreData,KvCacheStoredBlockData,KvCacheRemoveData,KvCacheEventError,RouterEventand its builders,KV_EVENT_SUBJECT.zmq_wire: the engine ZMQ msgpack codec, filters, extra-key and multimodal parsing, moved as a directory with its tests.cursor: the replay cursor a subscriber keeps in step with a publisher.placement: the publisher-sidePlacement,PlacementOwner,PlacementEventhelpers.Dependencies:
dynamo-router-protocol,dynamo-kv-hashing, serde, serde_json, rmp-serde, rustc-hash, thiserror, tracing. No sockets, tasks, or servers; the ZMQ socket isdynamo-zmq(next) and the listener is adynamo-kv-routeradapter.lib/kv-routerkeepspub useshims at every old path, includingdynamo_kv_router::zmq_wireanddynamo_kv_router::recovery, so no other crate changes in this step. Sidecars, the C bindings, kvbm-consolidator, and thelib/llmpublisher switch imports in the host rewrite step.One cross-crate effect, handled:
KvCacheEventErroris#[non_exhaustive], which binds only across crates. kv-router's two exhaustive matches on it (indexer/metrics.rs, behind themetricsfeature) gain a wildcard arm and anunknownstatus counter, pre-registered like the others, so a newerdynamo-kv-eventsreporting a kind this indexer predates is counted rather than refused.lib/llmalready matched it with a wildcard.Validation
cargo test -p dynamo-kv-events: 65 passed (codec tests plus the moved event tests).cargo check -p dynamo-kv-routerandcargo check -p dynamo-kv-router --all-features --tests: clean (the all-features check is what caught the non-exhaustive matches; it is now part of every step's validation).cargo test -p dynamo-kv-router: 1,039 lib + 1 integration passed with default features; 1,049 + 1 with--features metrics,testing(the 65-test drop from refactor(router): move the hash contract to dynamo-kv-hashing #112 is the codec and event tests now in kv-events).cargo check -p dynamo-llm -p dynamo-mocker -p dynamo-bench -p dynamo-custom-policy-builtin -p dynamo-sglang-sidecar --tests: clean.cargo clippyon protocol, kv-hashing, kv-events, kv-router with-D warnings: clean, including--all-featureson kv-events and kv-router.scripts/router_layering_check.sh: 11 checks, 0 failures (kv-events row: router deps == {protocol, kv-hashing}; direct deps == {dynamo-kv-hashing, dynamo-router-protocol, rmp-serde, rustc-hash, serde, serde_json, thiserror, tracing}).scripts/router_move_diff.py e1e8b11db3 WORKTREEover the moved files: 4,782 normalized lines in common; 4 new (twopad_value_for_mm_hashpaths re-spelled todynamo_kv_hashing::routing, themod testswrapper inevent.rs); 2 dropped (the old spellings). Every moved file at fraction 1.000 exceptconvert.rsat 0.998. Theindexer/metrics.rswildcard arms andunknowncounter are a deliberate change outside the move set.lib/kv-events/claimed; thezmq_wireandextra_keys.rsglobs follow the move;build_codeowners.py --strictclean;validate_agent_instructions.py46 scopes OK.