router: Router.Route consumes NormalizedInput directly (slice 11)

Change Route from (ctx, utterance string, now) to (ctx, input NormalizedInput, now).
The ingress-constructed NormalizedInput now reaches the cascade intact — no
reconstruction downstream. TryFastPath receives the same input, not a rebuilt one.
All callers (production, eval framework, tests) updated to construct NormalizedInput.
This commit is contained in:
2026-09-07 01:32:45 +04:00
parent a1e4743492
commit dad3cd0738
5 changed files with 15 additions and 13 deletions
+4 -4
View File
@@ -74,8 +74,8 @@ func TestLLMRouterBaseline(t *testing.T) {
// llm-only: the LLM stage in isolation. Route returns (Decision, ok, err);
// !ok without an error would be a contract violation, so it is surfaced as
// one rather than silently scored as a miss.
llmOnly := RouterFunc(func(ctx context.Context, u string, now time.Time) (router.Decision, error) {
d, ok, err := lr.Route(ctx, u, now)
llmOnly := RouterFunc(func(ctx context.Context, input router.NormalizedInput, now time.Time) (router.Decision, error) {
d, ok, err := lr.Route(ctx, input.Text, now)
if err != nil {
return d, err
}
@@ -152,8 +152,8 @@ func TestReachWithLLMRouter(t *testing.T) {
lr := router.NewLLMRouter(client)
m := router.DefaultActMatcher{Fns: actFns}
llmOnly := RouterFunc(func(ctx context.Context, u string, now time.Time) (router.Decision, error) {
d, ok, err := lr.Route(ctx, u, now)
llmOnly := RouterFunc(func(ctx context.Context, input router.NormalizedInput, now time.Time) (router.Decision, error) {
d, ok, err := lr.Route(ctx, input.Text, now)
if err != nil {
return d, err
}