Skip to content

refactor(structure): VS foundation — fuse router into routing/classify, move root modules to shared/#230

Merged
Destynova2 merged 1 commit intomainfrom
refactor/vs-foundation
Apr 20, 2026
Merged

refactor(structure): VS foundation — fuse router into routing/classify, move root modules to shared/#230
Destynova2 merged 1 commit intomainfrom
refactor/vs-foundation

Conversation

@Destynova2
Copy link
Copy Markdown
Contributor

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.

  • Audit chore: release v0.11.2 #12src/router/ merged into src/routing/classify/. Nature-inspired routing primitives (RE-1a circuit breaker, RE-1b health check from ADR-0018) now share a common routing parent with the request classification engine. Public types (ComplexityTier, ScoringConfig, ScoringWeights) are re-exported at routing::classify:: to keep call sites readable.
  • Audit chore: release v0.19.2 #35 — cross-cutting modules moved from src/ root to src/shared/: acme, instance, net, otel, pid, message_tracing. All callers updated to crate::shared::foo.
  • pricing.rs intentionally stays at the crate root — per its doc-comment (and a new clarifying note in src/lib.rs), it is a leaf module that both providers::streaming and features::token_pricing depend 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 — clean
  • cargo test --lib — 949 passed, 0 failed
  • cargo clippy --all-targets -- -D warnings — clean
  • RUSTFLAGS="-D warnings" cargo check --no-default-features — clean
  • cargo doc --no-deps --all-features — no new warnings from this change
  • grep -rn "crate::router\b\|use.*router::" src/ tests/ — only historical comments remain
  • ls src/router — does not exist
  • ls src/shared — lists the six moved modules + mod.rs
  • All prek pre-commit hooks pass (fmt, clippy, gitleaks, deny, doc-coverage, audit)

…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.
@Destynova2 Destynova2 enabled auto-merge April 20, 2026 17:59
@Destynova2 Destynova2 merged commit 0f0b2c4 into main Apr 20, 2026
42 checks passed
@Destynova2 Destynova2 deleted the refactor/vs-foundation branch April 20, 2026 18:06
Destynova2 pushed a commit that referenced this pull request Apr 20, 2026
- ADR-0004 description: 'Why redb' -> 'superseded by ADR-0013'
- Storage description: 'Unified redb' -> 'Atomic files + JSONL journals'
- Router path: src/router/mod.rs -> src/routing/classify/mod.rs (post PR #230)

Addresses Phoenix audit 2026-04-20 items #2 and #3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant