fix: preserve learning evidence integrity
This commit is contained in:
@@ -44,6 +44,20 @@ func TestValidatedSkillCanApplyFastPathWhenFreshAndConfident(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnknownAndSkippedOutcomesDoNotBecomeSkillFailures(t *testing.T) {
|
||||
profile := skillProfile()
|
||||
for _, outcome := range []capability.UsageOutcomeClass{capability.UsageUnknown, capability.UsageSkipped} {
|
||||
next, err := ObserveSkillOutcome(profile, capability.SkillOutcomeObservation{ExperienceRef: capability.SkillEvidenceRef("experience:" + string(outcome)), Outcome: outcome, ObservedAtUnixMillis: profile.RecordedAtUnixMillis + 1})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if next.ObservedFailureCount != profile.ObservedFailureCount || len(next.KnownFailureExperienceRefs) != len(profile.KnownFailureExperienceRefs) || next.ConfidenceMillis != profile.ConfidenceMillis {
|
||||
t.Fatalf("outcome %q was incorrectly recorded as failure: %#v", outcome, next)
|
||||
}
|
||||
profile = next
|
||||
}
|
||||
}
|
||||
|
||||
func skillProfile() capability.SkillProfile {
|
||||
return capability.SkillProfile{
|
||||
ID: "skill-obvious-reminder-response-v1",
|
||||
|
||||
Reference in New Issue
Block a user