feat(gen2): add experience skill reflex lifecycle
This commit is contained in:
@@ -27,15 +27,30 @@ type StrategyDecision struct {
|
||||
Escalate bool
|
||||
}
|
||||
|
||||
// StrategyEligibility is supplied by Capability lifecycle resolution. It keeps
|
||||
// a requested cheap route from becoming an entitlement to use stale evidence.
|
||||
type StrategyEligibility struct {
|
||||
RuleEligible bool
|
||||
ReflexEligible bool
|
||||
SkillEligible bool
|
||||
}
|
||||
|
||||
func (r StrategyRequest) Select() StrategyDecision {
|
||||
return r.SelectEligible(StrategyEligibility{RuleEligible: true, ReflexEligible: true, SkillEligible: true})
|
||||
}
|
||||
|
||||
func (r StrategyRequest) SelectEligible(eligible StrategyEligibility) StrategyDecision {
|
||||
if r.RiskClass == "HIGH" || r.CostOfError >= 800 {
|
||||
return StrategyDecision{Path: PathStrongLocal, Reason: "high consequence requires deeper reasoning", Escalate: true}
|
||||
}
|
||||
if r.RequiredQuality <= 500 && r.CostBudgetMicros > 0 {
|
||||
if eligible.RuleEligible && r.RequiredQuality <= 500 && r.CostBudgetMicros > 0 {
|
||||
return StrategyDecision{Path: PathRule, Reason: "bounded low-risk path"}
|
||||
}
|
||||
if r.PreferLowLatency {
|
||||
if eligible.ReflexEligible && r.PreferLowLatency {
|
||||
return StrategyDecision{Path: PathReflex, Reason: "latency preference with later escalation"}
|
||||
}
|
||||
return StrategyDecision{Path: PathSkill, Reason: "validated reusable strategy"}
|
||||
if eligible.SkillEligible {
|
||||
return StrategyDecision{Path: PathSkill, Reason: "validated reusable strategy"}
|
||||
}
|
||||
return StrategyDecision{Path: PathSmallLocal, Reason: "no eligible reflex or skill; escalate to reasoning", Escalate: true}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user