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 -2
View File
@@ -71,9 +71,11 @@ func New(cfg Config) *Router {
// is flagged Clarify (the daemon asks rather than guesses — same shape as
// since(key)==null → don't fire: a misrouted fact is a confident wrong write,
// worse than a gap).
func (r *Router) Route(ctx context.Context, utterance string, now time.Time) (Decision, error) {
func (r *Router) Route(ctx context.Context, input NormalizedInput, now time.Time) (Decision, error) {
utterance := input.Text
// stage 0 — deterministic fast path. First match wins; grammars are ordered.
fast, err := r.TryFastPath(ctx, NormalizedInput{Text: utterance}, now)
fast, err := r.TryFastPath(ctx, input, now)
if err != nil {
return Decision{}, err
}