137 lines
5.8 KiB
Go
137 lines
5.8 KiB
Go
package epistemics
|
|
|
|
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"
|
|
VerificationVerified VerificationState = "VERIFIED"
|
|
VerificationRejected VerificationState = "REJECTED"
|
|
VerificationUnknown VerificationState = "UNKNOWN"
|
|
VerificationNotApplicable VerificationState = "NOT_APPLICABLE"
|
|
|
|
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
|
|
ClaimedBy string
|
|
ClaimExpiresAtUnixMillis int64
|
|
}
|