feat(gen2): add experience skill reflex lifecycle

This commit is contained in:
m
2026-08-30 21:56:33 +03:00
parent a07aba056d
commit 8ec7c7419f
17 changed files with 523 additions and 32 deletions
+37 -12
View File
@@ -34,7 +34,7 @@ func TestFastPathDeclinesUnsupportedInputAndEscalatesToThinking(t *testing.T) {
}
}
func TestValidatedSkillCanApplyFastPathWhenFreshAndConfident(t *testing.T) {
func TestActiveSkillCanApplyFastPathWhenFreshAndConfident(t *testing.T) {
decision, err := DecideFastPath(skillProfile(), true, 950, false, false, 2000)
if err != nil {
t.Fatal(err)
@@ -58,18 +58,43 @@ func TestUnknownAndSkippedOutcomesDoNotBecomeSkillFailures(t *testing.T) {
}
}
func TestCandidateNeedsIndependentRepeatableValidationBeforeActive(t *testing.T) {
profile := skillProfile()
profile.Status = capability.SkillCandidate
profile.VerifiedOutcomeCount = 1
profile.SupportingExperienceRefs = []capability.SkillEvidenceRef{"experience:1"}
if _, err := ValidateSkill(profile, "evaluation:independent", true, true, 2000); err == nil {
t.Fatal("one success promoted a skill")
}
profile.VerifiedOutcomeCount = 2
profile.SupportingExperienceRefs = append(profile.SupportingExperienceRefs, "experience:2")
validated, err := ValidateSkill(profile, "evaluation:independent", true, true, 2000)
if err != nil || validated.Status != capability.SkillValidated {
t.Fatalf("validation=%#v err=%v", validated, err)
}
active, err := ActivateSkill(validated, 2100)
if err != nil || active.Status != capability.SkillActive {
t.Fatalf("activation=%#v err=%v", active, err)
}
}
func skillProfile() capability.SkillProfile {
return capability.SkillProfile{
ID: "skill-obvious-reminder-response-v1",
Revision: 1,
Name: "Resolve obvious reminder continuation",
Description: "Use a recent unambiguous reminder/attention target for complete/snooze/cancel without cognition.",
ApplicableContext: []string{"continuity:reminder-response"},
ImplementationRef: "continuity:human-response-target-resolver-v1",
ImplementationVersion: "1",
Status: capability.SkillValidated,
ConfidenceMillis: 850,
LastValidatedUnixMillis: 1000,
RecordedAtUnixMillis: 1000,
ID: "skill-obvious-reminder-response-v1",
Revision: 1,
Name: "Resolve obvious reminder continuation",
Description: "Use a recent unambiguous reminder/attention target for complete/snooze/cancel without cognition.",
ApplicableContext: []string{"continuity:reminder-response"},
ImplementationRef: "continuity:human-response-target-resolver-v1",
ImplementationVersion: "1",
Status: capability.SkillActive,
ConfidenceMillis: 850,
LastValidatedUnixMillis: 1000,
RecordedAtUnixMillis: 1000,
SupportingExperienceRefs: []capability.SkillEvidenceRef{"experience:1", "experience:2"},
IndependentEvaluationRefs: []capability.SkillEvidenceRef{"evaluation:independent"},
ValidationEvidenceRefs: []capability.SkillEvidenceRef{"evaluation:independent"},
VerifiedOutcomeCount: 2,
MustNotWorsenSatisfied: true,
}
}