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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user