refactor(structure): VS foundation — fuse router into routing/classify, move root modules to shared/#230
Merged
Destynova2 merged 1 commit intomainfrom Apr 20, 2026
Merged
Conversation
…classify (T-VS #12 #35) Implements the vertical-slice foundation phase for sprint S6: Audit item #12 — merge `src/router/` into `src/routing/classify/`: - All router files (classify, inference, message, rules, tier_match, tests, mod) are now under `src/routing/classify/` alongside the nature-inspired routing primitives (circuit_breaker, health_check) introduced by ADR-0018. The old `crate::router::` path is gone; all callers now use `crate::routing::classify::`. Key types (ComplexityTier, ScoringConfig, ScoringWeights) are re-exported at `routing::classify::` to keep call sites readable. Audit item #35 — move cross-cutting root modules under `src/shared/`: - acme, instance, net, otel, pid, message_tracing now live in `src/shared/` instead of `src/`. Callers updated (`crate::shared::foo`). - `pricing.rs` INTENTIONALLY stays at the crate root. Its doc-comment and the new comment in lib.rs explain why: it is a leaf module with no internal dependencies that both `providers::streaming` and `features::token_pricing` import from, and keeping it at the root breaks a cycle between those two modules. Docs synced: - CLAUDE.md Module Layout updated. - README.md project structure updated with the new shared/ and routing/ trees. - docs/explanation/architecture.md module table updated. - CONTRACTS.md Router::route module path updated. All 949 lib tests pass. `cargo clippy --all-targets -- -D warnings` is clean; `RUSTFLAGS="-D warnings" cargo check --no-default-features` is clean.
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.
Summary
T-VS (vertical-slice foundation) for sprint S6. Implements the two architectural audit items in a single atomic PR so downstream splits can proceed.
src/router/merged intosrc/routing/classify/. Nature-inspired routing primitives (RE-1a circuit breaker, RE-1b health check from ADR-0018) now share a commonroutingparent with the request classification engine. Public types (ComplexityTier,ScoringConfig,ScoringWeights) are re-exported atrouting::classify::to keep call sites readable.src/root tosrc/shared/:acme,instance,net,otel,pid,message_tracing. All callers updated tocrate::shared::foo.pricing.rsintentionally stays at the crate root — per its doc-comment (and a new clarifying note insrc/lib.rs), it is a leaf module that bothproviders::streamingandfeatures::token_pricingdepend on; keeping it top-level breaks the cycle between those two modules.Documentation synced (CLAUDE.md, README.md, docs/explanation/architecture.md, CONTRACTS.md).
Test plan
cargo build --all-targets— cleancargo test --lib— 949 passed, 0 failedcargo clippy --all-targets -- -D warnings— cleanRUSTFLAGS="-D warnings" cargo check --no-default-features— cleancargo doc --no-deps --all-features— no new warnings from this changegrep -rn "crate::router\b\|use.*router::" src/ tests/— only historical comments remainls src/router— does not existls src/shared— lists the six moved modules + mod.rs