DEV-000067 experience reflection skill foundation
CI / test (push) Successful in 18s
CI / test (pull_request) Successful in 16s

This commit is contained in:
m
2026-08-17 18:11:23 +03:00
parent d4640d7617
commit e7b32be1e0
15 changed files with 1029 additions and 7 deletions
+61
View File
@@ -9,6 +9,8 @@ type CapabilityImplementationID ids.ID
type CapabilityResolutionID ids.ID
type CapabilityGapID ids.ID
type CapabilityUsageObservationID ids.ID
type SkillProfileID ids.ID
type SkillEvidenceRef string
type RequirementRef string
type OriginalIntentRef string
type SourceUtteranceRef string
@@ -21,6 +23,9 @@ type CapabilityResolutionStatus string
type GapReason string
type AcquisitionStrategyKind string
type UsageOutcomeClass string
type SkillLifecycleStatus string
type FastPathDecisionState string
type FastPathDeclineReason string
const (
ImplementationInternalFunction ImplementationKind = "INTERNAL_FUNCTION"
@@ -61,6 +66,24 @@ const (
UsageFailed UsageOutcomeClass = "FAILED"
UsageSkipped UsageOutcomeClass = "SKIPPED"
UsageUnknown UsageOutcomeClass = "UNKNOWN"
SkillCandidate SkillLifecycleStatus = "CANDIDATE"
SkillEvaluating SkillLifecycleStatus = "EVALUATING"
SkillValidated SkillLifecycleStatus = "VALIDATED"
SkillDegraded SkillLifecycleStatus = "DEGRADED"
SkillSuspended SkillLifecycleStatus = "SUSPENDED"
SkillRetired SkillLifecycleStatus = "RETIRED"
FastPathApplied FastPathDecisionState = "APPLIED"
FastPathDeclined FastPathDecisionState = "DECLINED"
FastPathEscalate FastPathDecisionState = "ESCALATE_TO_THINK"
FastPathNotApplicable FastPathDeclineReason = "NOT_APPLICABLE"
FastPathLowConfidence FastPathDeclineReason = "LOW_CONFIDENCE"
FastPathOutOfDistribution FastPathDeclineReason = "OUT_OF_DISTRIBUTION"
FastPathConflict FastPathDeclineReason = "CONFLICT"
FastPathStale FastPathDeclineReason = "STALE"
FastPathImplementationDown FastPathDeclineReason = "IMPLEMENTATION_UNAVAILABLE"
)
// CapabilityDescriptor names what Domovoy can obtain or do. CapabilityKind is
@@ -160,3 +183,41 @@ type CapabilityUsageObservation struct {
LatencyMillis *int64
ObservedAtUnixMillis int64
}
// SkillProfile describes a reusable approach/pattern/capability composition.
// It is derived from evidence and is never authority by itself.
type SkillProfile struct {
ID SkillProfileID
Revision int64
Name string
Description string
ApplicableContext []string
ImplementationRef string
ImplementationVersion string
Status SkillLifecycleStatus
SupportingExperienceRefs []SkillEvidenceRef
KnownFailureExperienceRefs []SkillEvidenceRef
ConfidenceMillis int64
LastValidatedUnixMillis int64
ObservedFailureCount int64
ObservedCorrectionCount int64
RecordedAtUnixMillis int64
}
type SkillOutcomeObservation struct {
ExperienceRef SkillEvidenceRef
Outcome UsageOutcomeClass
UserCorrected bool
ObservedAtUnixMillis int64
}
// FastPathDecision is an explicit optimization decision. Decline/escalation is
// successful safety behavior, not a failure to answer.
type FastPathDecision struct {
SkillProfileID SkillProfileID
Decision FastPathDecisionState
DeclineReason FastPathDeclineReason
RequiresCognition bool
Explanation string
ObservedAtUnixMillis int64
}
+114
View File
@@ -5,8 +5,25 @@ import "git.cin.su/m/Assistant/platform/ids"
type ObservationID ids.ID
type ClaimID ids.ID
type BeliefID ids.ID
type SystemExpectationID ids.ID
type ExperienceRecordID ids.ID
type ReflectionCandidateID ids.ID
type VerificationState string
type ClaimSourceKind string
type EvidenceRef string
type ContextRef string
type OriginalIntentRef string
type SourceUtteranceRef string
type HumanResponseRef string
type CapabilityImplementationRef string
type CapabilityUsageObservationRef string
type CapabilityGapRef string
type SkillRef string
type ExperienceSourceKind string
type HelpMethodKind string
type OutcomeClass string
type ReflectionTriggerKind string
type ReflectionCandidateState string
const (
VerificationUnverified VerificationState = "UNVERIFIED"
@@ -17,4 +34,101 @@ const (
ClaimSourceAuthenticatedHuman ClaimSourceKind = "AUTHENTICATED_HUMAN"
ClaimSourceTrustedObservation ClaimSourceKind = "TRUSTED_OBSERVATION"
ExperienceSourceInteraction ExperienceSourceKind = "INTERACTION"
ExperienceSourceContinuity ExperienceSourceKind = "CONTINUITY"
ExperienceSourceCapability ExperienceSourceKind = "CAPABILITY"
ExperienceSourceCognitiveAdvisory ExperienceSourceKind = "COGNITIVE_ADVISORY"
HelpMethodDeterministicFastPath HelpMethodKind = "DETERMINISTIC_FAST_PATH"
HelpMethodCapabilityExecution HelpMethodKind = "CAPABILITY_EXECUTION"
HelpMethodCognitiveAdvisory HelpMethodKind = "COGNITIVE_ADVISORY"
HelpMethodClarification HelpMethodKind = "CLARIFICATION"
HelpMethodFallback HelpMethodKind = "FALLBACK"
OutcomeSuccess OutcomeClass = "SUCCESS"
OutcomePartialSuccess OutcomeClass = "PARTIAL_SUCCESS"
OutcomeFailed OutcomeClass = "FAILED"
OutcomeUnknown OutcomeClass = "UNKNOWN"
OutcomeUserCorrected OutcomeClass = "USER_CORRECTED"
OutcomeUnexpected OutcomeClass = "UNEXPECTED_OUTCOME"
OutcomeNotApplicable OutcomeClass = "NOT_APPLICABLE"
OutcomeLowConfidence OutcomeClass = "LOW_CONFIDENCE"
OutcomeOutOfDistribution OutcomeClass = "OUT_OF_DISTRIBUTION"
OutcomeConflict OutcomeClass = "CONFLICT"
OutcomeStale OutcomeClass = "STALE"
ReflectionUnexpectedOutcome ReflectionTriggerKind = "UNEXPECTED_OUTCOME"
ReflectionFailure ReflectionTriggerKind = "FAILURE"
ReflectionUserCorrection ReflectionTriggerKind = "USER_CORRECTION"
ReflectionContradiction ReflectionTriggerKind = "CONTRADICTION"
ReflectionLowConfidence ReflectionTriggerKind = "LOW_CONFIDENCE"
ReflectionRepeatedDegradation ReflectionTriggerKind = "REPEATED_DEGRADATION"
ReflectionEnvironmentChange ReflectionTriggerKind = "ENVIRONMENT_CHANGE"
ReflectionImplementationChanged ReflectionTriggerKind = "IMPLEMENTATION_CHANGED"
ReflectionStaleSkill ReflectionTriggerKind = "STALE_SKILL"
ReflectionSampledAudit ReflectionTriggerKind = "SAMPLED_AUDIT"
ReflectionCandidateOpen ReflectionCandidateState = "OPEN"
ReflectionCandidateEvaluating ReflectionCandidateState = "EVALUATING"
ReflectionCandidateSuperseded ReflectionCandidateState = "SUPERSEDED"
ReflectionCandidateResolved ReflectionCandidateState = "RESOLVED"
)
// SystemExpectation records what Domovoy expected a meaningful help path to
// accomplish before the outcome was known. It is evidence context, not a
// commitment or verified fact.
type SystemExpectation struct {
ID SystemExpectationID
OriginalIntentID OriginalIntentRef
SourceUtteranceID SourceUtteranceRef
ExpectedOutcome OutcomeClass
ExpectedEffect string
ConfidenceMillis int64
EvidenceBasis []EvidenceRef
RecordedAtUnixMillis int64
}
// ExperienceRecord is append-only evidence about an interaction/help episode.
// It stores typed references to other owners and never copies their canonical
// state or grants authority.
type ExperienceRecord struct {
ID ExperienceRecordID
SourceKind ExperienceSourceKind
OriginalIntentID OriginalIntentRef
SourceUtteranceID SourceUtteranceRef
ContextRefs []ContextRef
HelpMethod HelpMethodKind
HelpMethodRef string
CapabilityImplementationRef CapabilityImplementationRef
CapabilityUsageObservationRef CapabilityUsageObservationRef
CapabilityGapRef CapabilityGapRef
SkillRef SkillRef
ExpectationID SystemExpectationID
ExpectedOutcome OutcomeClass
ActualOutcome OutcomeClass
OutcomeRef string
OutcomeDetail string
HumanResponseRef HumanResponseRef
CorrectionUtteranceID SourceUtteranceRef
VerificationEvidence []EvidenceRef
ConfidenceMillis int64
RecordedAtUnixMillis int64
}
// ReflectionCandidate records that broader reflection may be warranted.
// Cognitive reflection, if used, must go through Cognitive Gateway/Router and
// produce candidates only; it cannot directly rewrite canonical state.
type ReflectionCandidate struct {
ID ReflectionCandidateID
Trigger ReflectionTriggerKind
State ReflectionCandidateState
SourceExperienceID ExperienceRecordID
OriginalIntentID OriginalIntentRef
SourceUtteranceID SourceUtteranceRef
Summary string
EvidenceRefs []EvidenceRef
RequiresCognition bool
RecordedAtUnixMillis int64
Revision int64
}