DEV-000072 semantic interpretation deferral boundary
CI / test (push) Successful in 18s
CI / test (pull_request) Successful in 17s

This commit is contained in:
m
2026-08-17 23:02:00 +03:00
parent 64870798b9
commit ce666bbc43
22 changed files with 1773 additions and 123 deletions
+48
View File
@@ -97,6 +97,54 @@ type ProviderUsage struct {
OutputUnits int64
}
type InterpretationApplicability string
const (
InterpretationApplicable InterpretationApplicability = "APPLICABLE"
InterpretationLowConfidence InterpretationApplicability = "LOW_CONFIDENCE"
InterpretationMixedIntent InterpretationApplicability = "MIXED_INTENT"
InterpretationNeedsBroader InterpretationApplicability = "NEEDS_BROADER_INTERPRETATION"
InterpretationClarificationRequired InterpretationApplicability = "CLARIFICATION_REQUIRED"
)
type GatewayInterpretationRequest struct {
Version ContractVersion
RequestID RequestID
ActorID identity.ActorID
PrincipalID identity.PrincipalID
ScopeID authority.ScopeID
Message string
Locale string
MaxOutputBytes int
DataPolicy capability.DataPolicy
DeterministicSpeechAct string
DeterministicSecondary string
DeterministicConfidence int64
DeterministicApplicability InterpretationApplicability
RequestedOutcome string
ProjectNames []string
}
type GatewayInterpretationCandidate struct {
PrimarySpeechAct string `json:"primary_speech_act"`
SecondarySpeechAct string `json:"secondary_speech_act,omitempty"`
ConfidenceMillis int64 `json:"confidence_millis"`
Applicability InterpretationApplicability `json:"applicability"`
RequestedOutcome string `json:"requested_outcome,omitempty"`
NeedsCognition bool `json:"needs_cognition"`
Clarification string `json:"clarification"`
SelectionReason string `json:"selection_reason,omitempty"`
CapabilityHints []capability.CapabilityKind `json:"capability_hints,omitempty"`
}
type GatewayInterpretationResponse struct {
Version ContractVersion
RequestID RequestID
Candidate GatewayInterpretationCandidate
FinishReason FinishReason
Usage *ProviderUsage
}
type AdvisoryResponse struct {
Version ContractVersion
RequestID RequestID
+64 -29
View File
@@ -17,40 +17,54 @@ type ConversationState string
type InterpretationState string
type InteractionRelationKind string
type InterpretationID string
type SemanticCandidateID string
type ProjectReferenceID string
type ProjectReferenceRole string
type ClarificationState string
type SemanticApplicability string
type SemanticCandidateSource string
type SemanticCandidateSelectionState string
const (
ChannelWebChat Channel = "WEB_CHAT"
ConversationOpen ConversationState = "OPEN"
ConversationArchived ConversationState = "ARCHIVED"
SpeechActDirective SpeechAct = "DIRECTIVE"
SpeechActAssertion SpeechAct = "ASSERTION"
SpeechActDecision SpeechAct = "DECISION"
SpeechActPreference SpeechAct = "PREFERENCE"
SpeechActQuestion SpeechAct = "QUESTION"
SpeechActHypothesis SpeechAct = "HYPOTHESIS"
SpeechActCorrection SpeechAct = "CORRECTION"
SpeechActRequestToInvestigate SpeechAct = "REQUEST_TO_INVESTIGATE"
SpeechActConfirmation SpeechAct = "CONFIRMATION"
SpeechActRejection SpeechAct = "REJECTION"
SpeechActCancellation SpeechAct = "CANCELLATION"
SpeechActConversational SpeechAct = "CONVERSATIONAL"
SpeechActUnknown SpeechAct = "UNKNOWN"
InterpretationRecorded InterpretationState = "RECORDED"
InterpretationInterpreted InterpretationState = "INTERPRETED"
RelationCorrects InteractionRelationKind = "CORRECTS"
RelationRespondsTo InteractionRelationKind = "RESPONDS_TO"
RelationRequestsCognition InteractionRelationKind = "REQUESTS_COGNITION"
RelationCognitionFallback InteractionRelationKind = "COGNITION_FALLBACK"
RelationSupersedes InteractionRelationKind = "SUPERSEDES"
RelationClarifies InteractionRelationKind = "CLARIFIES"
ProjectRolePrimary ProjectReferenceRole = "PRIMARY"
ProjectRoleRelated ProjectReferenceRole = "RELATED"
ProjectRoleReferenceSource ProjectReferenceRole = "REFERENCE_SOURCE"
ClarificationNotRequired ClarificationState = "NOT_REQUIRED"
ClarificationRequired ClarificationState = "REQUIRED"
ChannelWebChat Channel = "WEB_CHAT"
ConversationOpen ConversationState = "OPEN"
ConversationArchived ConversationState = "ARCHIVED"
SpeechActDirective SpeechAct = "DIRECTIVE"
SpeechActAssertion SpeechAct = "ASSERTION"
SpeechActDecision SpeechAct = "DECISION"
SpeechActPreference SpeechAct = "PREFERENCE"
SpeechActQuestion SpeechAct = "QUESTION"
SpeechActHypothesis SpeechAct = "HYPOTHESIS"
SpeechActCorrection SpeechAct = "CORRECTION"
SpeechActRequestToInvestigate SpeechAct = "REQUEST_TO_INVESTIGATE"
SpeechActConfirmation SpeechAct = "CONFIRMATION"
SpeechActRejection SpeechAct = "REJECTION"
SpeechActCancellation SpeechAct = "CANCELLATION"
SpeechActConversational SpeechAct = "CONVERSATIONAL"
SpeechActUnknown SpeechAct = "UNKNOWN"
InterpretationRecorded InterpretationState = "RECORDED"
InterpretationInterpreted InterpretationState = "INTERPRETED"
RelationCorrects InteractionRelationKind = "CORRECTS"
RelationRespondsTo InteractionRelationKind = "RESPONDS_TO"
RelationRequestsCognition InteractionRelationKind = "REQUESTS_COGNITION"
RelationCognitionFallback InteractionRelationKind = "COGNITION_FALLBACK"
RelationSupersedes InteractionRelationKind = "SUPERSEDES"
RelationClarifies InteractionRelationKind = "CLARIFIES"
ProjectRolePrimary ProjectReferenceRole = "PRIMARY"
ProjectRoleRelated ProjectReferenceRole = "RELATED"
ProjectRoleReferenceSource ProjectReferenceRole = "REFERENCE_SOURCE"
ClarificationNotRequired ClarificationState = "NOT_REQUIRED"
ClarificationRequired ClarificationState = "REQUIRED"
SemanticApplicable SemanticApplicability = "APPLICABLE"
SemanticLowConfidence SemanticApplicability = "LOW_CONFIDENCE"
SemanticMixedIntent SemanticApplicability = "MIXED_INTENT"
SemanticNeedsBroaderInterpret SemanticApplicability = "NEEDS_BROADER_INTERPRETATION"
SemanticCandidateClarify SemanticApplicability = "CLARIFICATION_REQUIRED"
CandidateSourceDeterministic SemanticCandidateSource = "DETERMINISTIC_V2"
CandidateSourceCognitive SemanticCandidateSource = "COGNITIVE_V1"
CandidateSelected SemanticCandidateSelectionState = "SELECTED"
CandidateObserved SemanticCandidateSelectionState = "OBSERVED"
CandidateRejected SemanticCandidateSelectionState = "REJECTED"
)
type Conversation struct {
@@ -94,14 +108,35 @@ type UtteranceInterpretation struct {
ID InterpretationID
UtteranceID HumanUtteranceID
SpeechAct SpeechAct
SecondarySpeechAct SpeechAct
ConfidenceMillis int64
Source string
AssertionVerification string
RequestedOutcome string
Clarification ClarificationState
NeedsCognition bool
Applicability SemanticApplicability
SelectionReason string
RecordedAtUnixMillis int64
}
type SemanticCandidate struct {
ID SemanticCandidateID
UtteranceID HumanUtteranceID
Source SemanticCandidateSource
SelectionState SemanticCandidateSelectionState
PrimarySpeechAct SpeechAct
SecondarySpeechAct SpeechAct
ConfidenceMillis int64
Applicability SemanticApplicability
RequestedOutcome string
Clarification ClarificationState
NeedsCognition bool
SelectionReason string
CapabilityHints []string
RecordedAtUnixMillis int64
}
type ProjectReference struct {
ID ProjectReferenceID
UtteranceID HumanUtteranceID
+4
View File
@@ -300,7 +300,11 @@ type PlanningInput struct {
ProjectProvenance ProjectProvenanceRef
Message string
SpeechAct SpeechActRef
SecondarySpeechAct SpeechActRef
CapabilityHints []capability.CapabilityKind
AssertionVerification epistemics.VerificationState
NeedsCognition bool
RequiresClarification bool
ReceivedAtUnixMillis int64
}