feat(libsy): stage router with handoff notes, per-tier prompts, and LLM fallback - #170
feat(libsy): stage router with handoff notes, per-tier prompts, and LLM fallback#170sabhatinas wants to merge 1 commit into
Conversation
WalkthroughAdds a public ChangesStage Routing
Estimated code review effort: 4 (Complex) | ~60 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
| } | ||
|
|
||
| #[async_trait] | ||
| impl Algorithm<SharedState> for StageRouter { |
There was a problem hiding this comment.
we should use this directly in config.rs
…apability-classifier fallback Signed-off-by: Sabhatina Selvam <sabhatinas@nvidia.com>
e1154ce to
72d8fe6
Compare
| /// | ||
| /// Errors if either threshold in `config` is outside `[0.0, 1.0]` or a tier is | ||
| /// missing from `targets`. | ||
| pub fn stage_router( |
There was a problem hiding this comment.
Do we want a factory function like this or a algorithm::Stage wrapper around FallThrough?
LlmTaskClassifier uses a wrapper. I'm guessing that is easier to configure on the server size?
@nachiketb-nvidia what are your thoughts?
Summary
Adds
StageRouter— signal-driven strong/weak routing for coding agents, assembled from libsy parts rather than a new algorithm:Signals decide most turns for free. Undecided ones go to the capability classifier, reused as-is from the
llm_classifierroute. Anything still undecided lands on the picker's default. Along the way the router can hand the chosen model a handoff note explaining why it got the turn, and a per-tier system prompt.This brings the Rust router to feature parity with the
stage_routerYAML profiles, closing the last two open items on SWITCH-1110 (handoff-note injection and per-tier prompts).What's new
Config
Thresholds and tier names are validated at construction, so a missing tier fails immediately.
Who decides a turn
override/tests_passed/dimensionsllm-classifierfall_openNo classifier call on a turn the signals settle.
Handoff notes
Parity gaps
Testing
llm_classifierroute closes its cascade with the strong tier, keeping its behaviour identical now that the classifier can abstain.Refs SWITCH-982, SWITCH-1110.