From 4b24fbad98e40d7e709d035f3a23a5786050e7eb Mon Sep 17 00:00:00 2001 From: claude Date: Sun, 6 Sep 2026 21:02:09 +0400 Subject: [PATCH] router: add CapabilitySelection field to Decision (slice 6b) Authoritative record of which executable capability matched, separate from Decision.Intent (what kind of turn) and ActionCandidate (downstream action artifact). Decision.Slots.Fn/Args/HasFn remain as compatibility representations populated from this selection. --- internal/router/intent.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/router/intent.go b/internal/router/intent.go index dde57c0..36d1e30 100644 --- a/internal/router/intent.go +++ b/internal/router/intent.go @@ -150,6 +150,16 @@ type Decision struct { Slots Slots Clarify bool // stage 3: below threshold — ask, don't guess + // CapabilitySelection — the authoritative result of the capability- + // selection stage. Says what executable capability matched, separate + // from what kind of turn this is (Decision.Intent) and separate from + // the downstream action artifact (ActionCandidate). + // + // Decision.Slots.Fn/Args/HasFn remain as compatibility representations + // populated FROM this selection. Later action execution must read the + // candidate produced from this selection, not the compatibility fields. + CapabilitySelection CapabilitySelection + // Producer — which cascade stage produced this decision. Recorded for // observability so a trace can name the winning component directly. Producer RouteProducer