interaction

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 36 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package interaction contains graph-native composition policy between model preparation and externally visible action. It deliberately knows no privileged fast/slow roles: topology and explicit selection inputs decide which prepared run may advance toward speech.

Index

Constants

View Source
const (
	// OverlapBargeInSchedulerService permits deterministic deadline tests. A
	// production graph normally uses the element-owned system scheduler.
	OverlapBargeInSchedulerService = "interaction.overlap-barge-in.scheduler"
)
View Source
const (
	// PostCommitSilenceSchedulerService lets a host supply the same monotonic
	// scheduler used by a deterministic simulation. Production graphs normally
	// use the lifecycle-owned system scheduler selected by the element.
	PostCommitSilenceSchedulerService = "interaction.post-commit-silence.scheduler"
)

Variables

This section is empty.

Functions

func ArbitrationOutcomeType

func ArbitrationOutcomeType() element.Type

func ControlSerializationQuarantineDescriptor

func ControlSerializationQuarantineDescriptor() element.Descriptor

ControlSerializationQuarantineDescriptor is the typed boundary between raw model text and consumers that can persist or speak it. Its safe outputs are nominally refined types, so raw model output cannot bypass this boundary by structural compatibility. The audit output is a distinct, non-executable event that no action element accepts.

func ControlSerializationQuarantineType

func ControlSerializationQuarantineType() element.Type

func Descriptors

func Descriptors() []element.Descriptor

func FactoryRegistrations

func FactoryRegistrations() ([]graphruntime.FactoryRegistration, error)

func ModelCancelType

func ModelCancelType() element.Type

func ModelCommitOutcomeType

func ModelCommitOutcomeType() element.Type

func ModelOutcomeType

func ModelOutcomeType() element.Type

func ModelResultCommitDescriptor

func ModelResultCommitDescriptor() element.Descriptor

ModelResultCommitDescriptor converts a prepared cognition result into one version-checked trajectory transaction. Store replies remain explicit feedback edges; the adapter owns no canonical state.

func OverlapBargeInDescriptor

func OverlapBargeInDescriptor() element.Descriptor

OverlapBargeInDescriptor turns observable overlap evidence into addressed cancellation. It deliberately has no privileged access to a session: which cognition, segmentation, synthesis, and playback paths it may interrupt is selected solely by graph connections.

Every lifecycle input is explicit. This prevents a policy from cancelling a guessed "current response" and makes queued synthesis, active playback, and still-running cognition independently inspectable. BreaksCycles is required because the cancellation outputs intentionally feed the same components whose lifecycle outputs drive this controller.

func OverlapDecisionType

func OverlapDecisionType() element.Type

func OverlapResolutionType

func OverlapResolutionType() element.Type

func OverlapStateType

func OverlapStateType() element.Type

func PostCommitSilenceDescriptor

func PostCommitSilenceDescriptor() element.Descriptor

PostCommitSilenceDescriptor is an explicit graph-owned wake-up for a period in which no new durable user observation arrives. It never interprets a request or speaks by itself. Once the configured interval elapses, it emits an ordinary ResponseCreate bound to the latest committed trajectory prefix; the connected invocation/model policy still decides what, if anything, the agent should say.

func PostCommitSilenceOutcomeType

func PostCommitSilenceOutcomeType() element.Type

func PostCommitSilenceStateType

func PostCommitSilenceStateType() element.Type

func PreparedTextType

func PreparedTextType() element.Type

func RegisterDescriptors

func RegisterDescriptors(catalog *resolve.Catalog) error

func RegisterFactories

func RegisterFactories(registry *graphruntime.Registry) error

func SafeModelResultType

func SafeModelResultType() element.Type

func SafePreparedTextType

func SafePreparedTextType() element.Type

func SegmentPreparedTextDescriptor

func SegmentPreparedTextDescriptor() element.Descriptor

SegmentPreparedTextDescriptor turns one non-interleaved prepared run into complete safe TTS requests. Cancellation is translated in both directions: to the model run and to each already-emitted speech utterance.

func SegmentationOutcomeType

func SegmentationOutcomeType() element.Type

func SelectionType

func SelectionType() element.Type

func SpeechArbiterDescriptor

func SpeechArbiterDescriptor() element.Descriptor

SpeechArbiterDescriptor is a stream-aware mux. It never chooses based on provider phase or labels; selection/preemption is explicit control input.

func SpeechCancelType

func SpeechCancelType() element.Type

func TextSegmentType

func TextSegmentType() element.Type

func TimeoutType

func TimeoutType() element.Type

Types

type ArbitrationOutcome

type ArbitrationOutcome struct {
	Kind          OutcomeKind `json:"kind"`
	RunID         string      `json:"run_id,omitempty"`
	ReplacedRunID string      `json:"replaced_run_id,omitempty"`
	QueuePosition int         `json:"queue_position,omitempty"`
	BufferedRuns  int         `json:"buffered_runs,omitempty"`
	BufferedBytes int         `json:"buffered_bytes,omitempty"`
	Code          string      `json:"code,omitempty"`
	Message       string      `json:"message,omitempty"`
}

type ControlSerializationDisposition

type ControlSerializationDisposition string
const (
	ControlSerializationComplete  ControlSerializationDisposition = "complete"
	ControlSerializationMalformed ControlSerializationDisposition = "malformed"
	ControlSerializationTruncated ControlSerializationDisposition = "truncated"
	ControlSerializationTooLarge  ControlSerializationDisposition = "candidate_too_large"
	ControlSerializationTooMany   ControlSerializationDisposition = "too_many_blocks"
)

type ControlSerializationQuarantine

type ControlSerializationQuarantine struct {
	RunID        string                          `json:"run_id"`
	Source       ControlSerializationSource      `json:"source"`
	SourceItemID string                          `json:"source_item_id"`
	OutputIndex  int                             `json:"output_index,omitempty"`
	BlockIndex   int                             `json:"block_index"`
	Syntax       ControlSerializationSyntax      `json:"syntax"`
	Disposition  ControlSerializationDisposition `json:"disposition"`
	Bytes        int                             `json:"bytes"`
	SHA256       string                          `json:"sha256"`
}

ControlSerializationQuarantine contains no serialized payload. The digest and causal envelope preserve auditable identity without copying possible secrets or tool arguments onto a normal graph inspection surface.

func (ControlSerializationQuarantine) InspectionCause

type ControlSerializationQuarantineConfig

type ControlSerializationQuarantineConfig struct {
	MaxCandidateBytes int `json:"max_candidate_bytes,omitempty"`
	MaxBlocks         int `json:"max_blocks,omitempty"`
	MaxActiveStreams  int `json:"max_active_streams,omitempty"`
}

type ControlSerializationSource

type ControlSerializationSource string

ControlSerializationSource says which model-authored text surface contained the isolated bytes. It is forensic provenance, never execution authority.

const (
	ControlSerializationPreparedText ControlSerializationSource = "prepared_text"
	ControlSerializationAssistant    ControlSerializationSource = "assistant"
	ControlSerializationReasoning    ControlSerializationSource = "reasoning"
)

type ControlSerializationSyntax

type ControlSerializationSyntax string

ControlSerializationSyntax is deliberately not an action or proposal kind. It names only the text wrapper whose bytes were withheld.

const (
	ControlSyntaxTagged             ControlSerializationSyntax = "tool_call_tag"
	ControlSyntaxPrefixed           ControlSerializationSyntax = "tool_call_prefix"
	ControlSyntaxJSONFence          ControlSerializationSyntax = "json_fence"
	ControlSyntaxPrefixedJSONFence  ControlSerializationSyntax = "tool_call_json_fence"
	ControlSyntaxBareJSON           ControlSerializationSyntax = "bare_json"
	ControlSyntaxCallableExpression ControlSerializationSyntax = "callable_expression"
	ControlSyntaxFunctionTag        ControlSerializationSyntax = "function_tag"
	ControlSyntaxFunctionCallTag    ControlSerializationSyntax = "function_call_tag"
)

type ModelCommitKind

type ModelCommitKind string
const (
	ModelCommitted ModelCommitKind = "committed"
	ModelRejected  ModelCommitKind = "rejected"
	ModelRefused   ModelCommitKind = "refused"
	ModelIgnored   ModelCommitKind = "ignored"
	// ModelSpeechRetained records prepared speech after rejecting the original
	// stale transaction. It does not commit reasoning, proposals, or effects.
	ModelSpeechRetained ModelCommitKind = "speech_retained"
)

type ModelCommitOutcome

type ModelCommitOutcome struct {
	Kind         ModelCommitKind `json:"kind"`
	RunID        string          `json:"run_id,omitempty"`
	RequestID    string          `json:"request_id,omitempty"`
	StoreVersion uint64          `json:"store_version,omitempty"`
	ItemIDs      []string        `json:"item_ids,omitempty"`
	Code         string          `json:"code,omitempty"`
	Message      string          `json:"message,omitempty"`
}

ModelCommitOutcome is the policy-visible terminal result of one prepared result transaction. A result is not canonical until Kind is committed.

type ModelResultCommitConfig

type ModelResultCommitConfig struct {
	MaxPending int `json:"max_pending,omitempty"`
	// RetainRejectedSpeech preserves safe, voice-authorized assistant text after
	// a version conflict. Exact playback receipts still control its visibility.
	RetainRejectedSpeech bool `json:"retain_rejected_speech,omitempty"`
}

type OutcomeKind

type OutcomeKind string
const (
	OutcomeSelected  OutcomeKind = "selected"
	OutcomeQueued    OutcomeKind = "queued"
	OutcomeCompleted OutcomeKind = "completed"
	OutcomePreempted OutcomeKind = "preempted"
	OutcomeCanceled  OutcomeKind = "canceled"
	OutcomeFailed    OutcomeKind = "failed"
	OutcomeRefused   OutcomeKind = "refused"
	OutcomeIgnored   OutcomeKind = "ignored"
)

type OverlapBargeInConfig

type OverlapBargeInConfig struct {
	// Decider selects a deployment-owned enumerated semantic classifier. Empty
	// disables classification and leaves the explicit timeout fallback in sole
	// control; it never silently selects a provider.
	Decider string `json:"decider,omitempty"`
	// HoldMS is the maximum time unclassified overlap may continue before the
	// fallback is applied. Directed semantic evidence may cancel sooner.
	HoldMS int `json:"hold_ms,omitempty"`
	// Unclassified says what to do when the hold expires without backchannel or
	// side-speech evidence. The conservative default yields the floor.
	Unclassified  OverlapFallback `json:"unclassified,omitempty"`
	MaxActiveRuns int             `json:"max_active_runs,omitempty"`
	MaxUtterances int             `json:"max_utterances,omitempty"`
}

type OverlapDecision

type OverlapDecision struct {
	Kind                OverlapDecisionKind             `json:"kind"`
	Trigger             string                          `json:"trigger"`
	StreamID            string                          `json:"stream_id,omitempty"`
	EvidenceItemID      string                          `json:"evidence_item_id,omitempty"`
	SourceRevision      uint64                          `json:"source_revision,omitempty"`
	Evidence            coreinteraction.OverlapEvidence `json:"evidence,omitempty"`
	Policy              string                          `json:"policy"`
	Reason              string                          `json:"reason,omitempty"`
	OverlapStartedNS    uint64                          `json:"overlap_started_ns,omitempty"`
	DeadlineNS          uint64                          `json:"deadline_ns,omitempty"`
	DecidedNS           uint64                          `json:"decided_ns"`
	ActiveRunIDs        []string                        `json:"active_run_ids,omitempty"`
	ActiveUtteranceIDs  []string                        `json:"active_utterance_ids,omitempty"`
	ModelCancels        int                             `json:"model_cancels,omitempty"`
	SegmentationCancels int                             `json:"segmentation_cancels,omitempty"`
	TTSCancels          int                             `json:"tts_cancels,omitempty"`
	PlaybackCancels     int                             `json:"playback_cancels,omitempty"`
}

OverlapDecision is an inspectable control-plane verdict. It intentionally excludes transcript text; the evidence identity and revision are enough to reconstruct an authorized private trace without copying user speech into a general graph inspection surface.

func (OverlapDecision) InspectionCause

func (OverlapDecision) InspectionCause() element.InspectionCauseKind

type OverlapDecisionKind

type OverlapDecisionKind string
const (
	OverlapObserved   OverlapDecisionKind = "observed"
	OverlapClassified OverlapDecisionKind = "classified"
	OverlapKept       OverlapDecisionKind = "kept_speaking"
	OverlapCanceled   OverlapDecisionKind = "canceled"
	OverlapIgnored    OverlapDecisionKind = "ignored"
	OverlapRefused    OverlapDecisionKind = "refused"
)

type OverlapFallback

type OverlapFallback string
const (
	OverlapFallbackCancel OverlapFallback = "cancel"
	OverlapFallbackKeep   OverlapFallback = "keep_speaking"
)

type OverlapPolicyResolution

type OverlapPolicyResolution struct {
	Decider          string                                    `json:"decider,omitempty"`
	Descriptor       *policyelements.SemanticDeciderDescriptor `json:"descriptor,omitempty"`
	DescriptorDigest string                                    `json:"descriptor_digest,omitempty"`
	RegistryRevision uint64                                    `json:"registry_revision,omitempty"`
	HoldMS           int                                       `json:"hold_ms"`
	Unclassified     OverlapFallback                           `json:"unclassified"`
}

type OverlapState

type OverlapState struct {
	UserSpeaking        bool                            `json:"user_speaking"`
	StreamID            string                          `json:"stream_id,omitempty"`
	OverlapActive       bool                            `json:"overlap_active"`
	OverlapStartedNS    uint64                          `json:"overlap_started_ns,omitempty"`
	DeadlineNS          uint64                          `json:"deadline_ns,omitempty"`
	Evidence            coreinteraction.OverlapEvidence `json:"evidence,omitempty"`
	ClassificationOpen  bool                            `json:"classification_open"`
	CancelIssued        bool                            `json:"cancel_issued"`
	ActiveModels        int                             `json:"active_models"`
	ActiveSegmentations int                             `json:"active_segmentations"`
	ActiveTTS           int                             `json:"active_tts"`
	ActivePlayback      int                             `json:"active_playback"`
	AgentOutput         coreinteraction.AgentOutput     `json:"agent_output"`
	Observed            uint64                          `json:"observed"`
	Classified          uint64                          `json:"classified"`
	Kept                uint64                          `json:"kept"`
	Canceled            uint64                          `json:"canceled"`
	Ignored             uint64                          `json:"ignored"`
	Refused             uint64                          `json:"refused"`
}

func (OverlapState) InspectionCause

func (OverlapState) InspectionCause() element.InspectionCauseKind

type PostCommitSilenceConfig

type PostCommitSilenceConfig struct {
	DelayMS int `json:"delay_ms"`
}

type PostCommitSilenceOutcome

type PostCommitSilenceOutcome struct {
	Kind           PostCommitSilenceOutcomeKind `json:"kind"`
	Generation     uint64                       `json:"generation,omitempty"`
	DeadlineNS     uint64                       `json:"deadline_ns,omitempty"`
	ContextVersion uint64                       `json:"context_version,omitempty"`
	ContextItemID  string                       `json:"context_item_id,omitempty"`
	TriggerItemID  string                       `json:"trigger_item_id,omitempty"`
	ResponseID     string                       `json:"response_id,omitempty"`
	Code           string                       `json:"code,omitempty"`
	Message        string                       `json:"message,omitempty"`
	FinishedNS     uint64                       `json:"finished_ns"`
}

type PostCommitSilenceOutcomeKind

type PostCommitSilenceOutcomeKind string
const (
	PostCommitSilenceArmed   PostCommitSilenceOutcomeKind = "armed"
	PostCommitSilenceFired   PostCommitSilenceOutcomeKind = "fired"
	PostCommitSilenceIgnored PostCommitSilenceOutcomeKind = "ignored"
	PostCommitSilenceRefused PostCommitSilenceOutcomeKind = "refused"
)

type PostCommitSilenceState

type PostCommitSilenceState struct {
	Armed                bool   `json:"armed"`
	Generation           uint64 `json:"generation"`
	DeadlineNS           uint64 `json:"deadline_ns,omitempty"`
	ContextVersion       uint64 `json:"context_version"`
	ContextItemID        string `json:"context_item_id,omitempty"`
	TriggerItemID        string `json:"trigger_item_id,omitempty"`
	LatestContextVersion uint64 `json:"latest_context_version"`
	LatestContextItemID  string `json:"latest_context_item_id,omitempty"`
	ArmedCount           uint64 `json:"armed_count"`
	ResetCount           uint64 `json:"reset_count"`
	FiredCount           uint64 `json:"fired_count"`
	IgnoredCount         uint64 `json:"ignored_count"`
	RefusedCount         uint64 `json:"refused_count"`
}

type SegmentPreparedTextConfig

type SegmentPreparedTextConfig struct {
	MinimumRunes int `json:"minimum_runes,omitempty"`
	// MinimumClauseRunes adds a floor at non-sentence punctuation. Omission
	// preserves MinimumRunes; completed source text always flushes in full.
	MinimumClauseRunes int `json:"minimum_clause_runes,omitempty"`
	MaxSegmentBytes    int `json:"max_segment_bytes,omitempty"`
	MaxRunBytes        int `json:"max_run_bytes,omitempty"`
	MaxSegments        int `json:"max_segments,omitempty"`
	TerminalMemory     int `json:"terminal_memory,omitempty"`
}

type SegmentationOutcome

type SegmentationOutcome struct {
	Kind          OutcomeKind `json:"kind"`
	RunID         string      `json:"run_id,omitempty"`
	Segments      int         `json:"segments,omitempty"`
	BufferedBytes int         `json:"buffered_bytes,omitempty"`
	Code          string      `json:"code,omitempty"`
	Message       string      `json:"message,omitempty"`
}

type SelectionMode

type SelectionMode string
const (
	SelectionQueue   SelectionMode = "queue"
	SelectionPreempt SelectionMode = "preempt"
)

type SpeechArbiterConfig

type SpeechArbiterConfig struct {
	MaxPendingRuns    int `json:"max_pending_runs,omitempty"`
	MaxBufferedBytes  int `json:"max_buffered_bytes,omitempty"`
	MaxBufferedDeltas int `json:"max_buffered_deltas,omitempty"`
	MaxDeltaBytes     int `json:"max_delta_bytes,omitempty"`
}

type SpeechSelection

type SpeechSelection struct {
	RunID string        `json:"run_id,omitempty"`
	Mode  SelectionMode `json:"mode,omitempty"`
}

type Timeout

type Timeout struct {
	RunID  string `json:"run_id,omitempty"`
	Reason string `json:"reason,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL