Documentation
¶
Overview ¶
Package submission defines the provider-neutral trust boundary for customer submission identity. A frontend or harness adapter supplies the authority; request payload fields never participate in binding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidAuthority identifies malformed or unknown authority data. ErrInvalidAuthority = errors.New("submission: invalid authority") // ErrUntrustedAuthority identifies an authority that did not come from an // accepted authenticated or harness source. ErrUntrustedAuthority = errors.New("submission: untrusted authority") // ErrScopeMismatch identifies a continuation bound to another call, A-leg, // tenant, principal, session, or store. ErrScopeMismatch = errors.New("submission: scope mismatch") // ErrLifecycleConflict identifies an attempt to reuse a closed invocation // for a new follow-up submission. ErrLifecycleConflict = errors.New("submission: lifecycle conflict") // ErrIncomplete identifies trusted attribution that cannot support a strict // submission-priced offer. ErrIncomplete = errors.New("submission: incomplete attribution") )
Functions ¶
Types ¶
type Authority ¶
type Authority struct {
SubmissionID string
// BillingCallID is optional for a trusted continuation. When omitted, the
// runtime may allocate a fresh call grouping while retaining SubmissionID;
// when present, it must be reused rather than replaced.
BillingCallID string
Kind Kind
Source Source
Scope Scope
}
Authority is the trusted, immutable identity supplied by an authenticated frontend current-turn/continuation authority or an explicitly supported harness adapter. It contains no raw credential or request payload data.
func AuthorityFromContext ¶
AuthorityFromContext returns a defensive value copy of the authority carried by WithAuthority. It never reads request payload metadata.
type BindingInput ¶
type BindingInput struct {
Scope Scope
}
BindingInput carries the runtime-owned identity used to validate an authority. The runtime, not the caller payload, builds this input.
type BindingResult ¶
type BindingResult = Result
BindingResult is the descriptive spelling of Result for adapter APIs.
type Kind ¶
type Kind string
Kind describes how a request relates to a customer submission.
const ( KindNewSubmission Kind = "new_submission" KindToolContinuation Kind = "tool_continuation" KindHistoricalReplay Kind = "historical_replay" KindTransportRetry Kind = "transport_retry" KindFollowUp Kind = "follow_up" KindLocalCommand Kind = "local_command" // KindNew is a short spelling for KindNewSubmission. KindNew = KindNewSubmission )
type Result ¶
Result is the immutable result of one attribution attempt.
func Bind ¶
func Bind(input BindingInput, supplied *Authority) (Result, error)
Bind validates and freezes one trusted authority against the runtime-owned scope. A missing authority, or a trusted authority without enough identity material, returns an explicit unsupported/incomplete result so inference can continue without a prompt-priced offer. Malformed, untrusted, or cross-scope authorities are rejected before execution state is opened.
type Scope ¶
type Scope struct {
TenantID string
PrincipalID string
SessionID string
ALegID string
StoreID string
CallID string
}
Scope is the trusted isolation boundary against which a supplied authority is checked. Empty values mean that the corresponding dimension is not known at that boundary; they are never inferred from request payload data.
type Source ¶
type Source string
Source identifies the trusted authority that classified a request.
const ( SourceAuthenticatedCurrentTurn Source = "authenticated_current_turn" SourceAuthenticatedContinuation Source = "authenticated_continuation" SourceHarnessAdapter Source = "harness_adapter" SourceLocalCommand Source = "local_command" // SourceClient is intentionally never accepted by Bind. It is exposed only // so adapters can classify an attempted client override explicitly. SourceClient Source = "client" )