lifecycle

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 19 Imported by: 8

Documentation

Overview

Package lifecycle implements the acp-go.dev/lifecycle extension: the closed event vocabulary, the strict wire decoder, the projection reducer, and the ordered emitter one session incarnation writes through.

The extension carries, in ACP v1 _meta, a prompt lifecycle in which a prompt is answered on acceptance and turns and background work are reported through session updates.

The reducer handles the whole event set, including events a given sibling's configuration never emits, because the same code validates the stream a sibling writes: a validator that only handles what one harness produces cannot detect the case where it produces something else.

Index

Constants

View Source
const (
	VerdictUnsupported = "unsupported"
	VerdictMissing     = "missing"
)

VerdictUnsupported names a value the host sent and the sibling refuses; a present key on a surface that carries none, and a malformed member, are both that. VerdictMissing names a value the contract requires and the host left out.

View Source
const (
	// MetaKey is the family-reserved ACP _meta key every lifecycle value rides
	// under.
	MetaKey = "acp-go.dev/lifecycle"

	// Version is the only envelope version this package implements.
	Version = 1

	// IdentifierBound is the largest opaque identifier the extension carries. An
	// identifier is a correlation handle rather than a payload, so a longer one
	// fails closed.
	IdentifierBound = 4096
)
View Source
const (
	StopReasonEndTurn         = "end_turn"
	StopReasonMaxTokens       = "max_tokens"
	StopReasonMaxTurnRequests = "max_turn_requests"
	StopReasonRefusal         = "refusal"
	StopReasonCancelled       = "cancelled"
)

The standard ACP v1 stop reasons. The extension adds no variant of its own, so an ending transition carries exactly one of these.

Variables

View Source
var ErrNoEnvelope = errors.New("frame carries no lifecycle envelope")

ErrNoEnvelope reports that a frame carries no lifecycle envelope. It is not a violation: ordinary content rides its own surfaces without one.

View Source
var Fixtures embed.FS

Fixtures is the canonical family reducer battery. Every vector is a wire-level expectation: reducing those bytes must reach the stated verdict, whether the reducer is a sibling validating its own emitted stream or a host consuming one.

Functions

func CheckAttribution

func CheckAttribution(negotiated Negotiated, notifications []json.RawMessage) error

CheckAttribution proves, over one session's session/update notification payloads in delivery order, that every content update belongs to the running foreground: it arrives while the foreground is live, and no vendor namespace under its _meta names a turnId or messageId. Envelopes are reduced as a host reduces them, so a refused stream is reported as the reducer's refusal.

func DecodePromptCorrelation

func DecodePromptCorrelation(meta map[string]any, negotiated Negotiated) (Submission, *ParamError)

DecodePromptCorrelation reads the value a session/prompt carries while version 1 is negotiated. The key is required when negotiated and forbidden when not, and either way the verdict is reached before the prompt is dispatched.

func NewIncarnation

func NewIncarnation(sessionID string) string

NewIncarnation names one newly opened lifecycle stream. Session identities survive process restarts, so fresh entropy keeps a resumed source from reopening a stream name an earlier process already published.

func RetainRequestMetadata

func RetainRequestMetadata(meta map[string]any, params json.RawMessage) map[string]any

RetainRequestMetadata preserves only the owned lifecycle value after the SDK request decode. Validation still runs at the method's original semantic stage. Foreign metadata retains the SDK's representation and interpretation.

Types

type ActionKind

type ActionKind string

ActionKind classifies a request that holds work until it is answered.

const (
	ActionPermission  ActionKind = "permission"
	ActionElicitation ActionKind = "elicitation"
)

The closed action-kind vocabulary.

func (ActionKind) Valid

func (k ActionKind) Valid() bool

Valid reports whether the kind is part of the closed action vocabulary.

type ActionRecord

type ActionRecord struct {
	ActionID         string      `json:"actionId"`
	Kind             ActionKind  `json:"kind"`
	State            ActionState `json:"state"`
	Owner            Owner       `json:"owner"`
	RunID            string      `json:"runId,omitempty"`
	BlocksForeground bool        `json:"blocksForeground"`
}

ActionRecord is one action's projection.

type ActionState

type ActionState string

ActionState is one action's state. Everything but pending is terminal.

const (
	ActionPending   ActionState = "pending"
	ActionAccepted  ActionState = "accepted"
	ActionDeclined  ActionState = "declined"
	ActionCancelled ActionState = "cancelled"
	ActionFailed    ActionState = "failed"
)

The closed action-state vocabulary.

func (ActionState) Terminal

func (s ActionState) Terminal() bool

Terminal reports whether the action is resolved.

func (ActionState) Valid

func (s ActionState) Valid() bool

Valid reports whether the state is part of the closed action vocabulary.

type ActionUpdate

type ActionUpdate struct {
	ActionID         string
	Kind             ActionKind
	State            ActionState
	Owner            Owner
	RunID            string
	BlocksForeground *bool
}

ActionUpdate reports one permission or elicitation. Only an action blocking the current foreground cycle bears on requires_action.

BlocksForeground is a pointer because absence and false are different facts: it is required on a first sight, and a later patch that omits it restates nothing.

type ActivityKind

type ActivityKind string

ActivityKind classifies one node of a session's owned activity tree.

const (
	ActivityTask     ActivityKind = "task"
	ActivitySubagent ActivityKind = "subagent"
)

The closed activity-kind vocabulary.

func (ActivityKind) Valid

func (k ActivityKind) Valid() bool

Valid reports whether the kind is part of the closed activity vocabulary.

type ActivityRecord

type ActivityRecord struct {
	ActivityID   string          `json:"activityId"`
	Kind         ActivityKind    `json:"kind"`
	State        ActivityState   `json:"state"`
	ParentID     string          `json:"parentId,omitempty"`
	ToolCallID   string          `json:"toolCallId,omitempty"`
	Cause        Cause           `json:"-"`
	OriginTurnID string          `json:"originTurnId"`
	RunID        string          `json:"runId,omitempty"`
	Progress     json.RawMessage `json:"-"`
}

ActivityRecord is one activity's projection. Immutable identity is fixed on first sight; only state and progress ever change, and progress is rendered rather than reduced.

type ActivityState

type ActivityState string

ActivityState is one activity's state. The last three are terminal, and terminal is immutable.

const (
	ActivityPending        ActivityState = "pending"
	ActivityRunning        ActivityState = "running"
	ActivityRequiresAction ActivityState = "requires_action"
	ActivityCompleted      ActivityState = "completed"
	ActivityFailed         ActivityState = "failed"
	ActivityCancelled      ActivityState = "cancelled"
)

The closed activity-state vocabulary.

func (ActivityState) Terminal

func (s ActivityState) Terminal() bool

Terminal reports whether the activity can never change state again.

func (ActivityState) Valid

func (s ActivityState) Valid() bool

Valid reports whether the state is part of the closed activity vocabulary.

type ActivityUpdate

type ActivityUpdate struct {
	ActivityID   string
	Kind         ActivityKind
	State        ActivityState
	ParentID     string
	ToolCallID   string
	Cause        Cause
	OriginTurnID string
	RunID        string
	// Progress is the one member whose interior this contract does not fix: an
	// opaque object a host renders and never reduces. It is still compared in the
	// duplicate comparison and in the member-wise terminal-restatement comparison.
	Progress json.RawMessage
}

ActivityUpdate reports one activity. A first sight carries every immutable identity field; a later update carries state and progress only.

type CarrierClass

type CarrierClass string

CarrierClass reports whether an envelope rode the one carrier the extension permits. Every other session update carries per-entity reduction semantics a conformant consumer may legally coalesce, which would make the envelope unrecoverable.

const (
	// CarrierUnknown is the zero value: a carrier that has not been classified
	// cannot be proven legal.
	CarrierUnknown CarrierClass = ""
	// CarrierSessionInfo names the identity-only session_info_update.
	CarrierSessionInfo CarrierClass = "session_info_update"
	// CarrierIneligible names every other carrier.
	CarrierIneligible CarrierClass = "ineligible"
)

The closed carrier classification.

type Cause

type Cause string

Cause names what caused a foreground transition or an activity.

const (
	CauseSubmission Cause = "submission"
	CauseActivity   Cause = "activity"
	CauseSession    Cause = "session"
)

The closed cause vocabulary.

func (Cause) Valid

func (c Cause) Valid() bool

Valid reports whether the cause is part of the closed vocabulary.

type Cycle

type Cycle struct {
	TurnID  string
	CycleID string
	Origin  Cause
	// contains filtered or unexported fields
}

Cycle identifies a foreground turn and the native cause that owns it.

type Delivery

type Delivery struct {
	StreamID string
	Sequence uint64
	Carrier  CarrierClass
	Event    Event
	// Frame is the whole delivered notification as a decoded value, envelope and
	// carrier together. Comparing decoded values is what distinguishes an exact
	// retransmission from a conflicting reuse of the same identity. Numbers are
	// retained as their literals so the comparison stays exact.
	Frame any
}

Delivery is one delivered lifecycle event with its ordering identity. That identity is (StreamID, Sequence): StreamID names the native lifecycle source incarnation rather than a transient ACP connection.

func DecodeSessionUpdate

func DecodeSessionUpdate(params json.RawMessage, negotiated Negotiated) (Delivery, error)

DecodeSessionUpdate reads the lifecycle delivery carried by one session/update notification payload. It reports ErrNoEnvelope for a frame with no extension value, and a *ViolationError naming the closed token for every frame it refuses. A frame without an envelope is split into its top-level members only; the whole frame is decoded into a value only when it carries an envelope.

type Event

type Event struct {
	Type           EventType
	Snapshot       *Snapshot
	PromptAccepted *PromptAccepted
	State          *StateTransition
	Activity       *ActivityUpdate
	Action         *ActionUpdate
}

Event is one decoded lifecycle event. Exactly one payload pointer matches Type, and the decoder is the only producer, so a reducer never has to defend against a discriminant without its payload.

type EventType

type EventType string

EventType discriminates one lifecycle event. The set is closed at five.

const (
	EventSnapshot       EventType = "lifecycle_snapshot"
	EventPromptAccepted EventType = "prompt_accepted"
	EventStateUpdate    EventType = "state_update"
	EventActivityUpdate EventType = "activity_update"
	EventActionUpdate   EventType = "action_update"
)

The closed event set.

type Foreground

type Foreground struct {
	State   ForegroundState `json:"state"`
	CycleID string          `json:"cycleId"`
	TurnID  string          `json:"turnId,omitempty"`
	Origin  Cause           `json:"-"`
}

Foreground is one foreground cycle. TurnID is empty while no turn holds it, and Origin names that turn's provenance exactly while it does: a resumed turn with no recorded origin would be a turn a consumer could not attribute. Origin is the snapshot's own member and is not projected; the turn record it opens carries it instead.

type ForegroundState

type ForegroundState string

ForegroundState is one foreground cycle's state. A finished cycle's outcome is recorded on its ending transition, never as an extra state.

const (
	ForegroundRunning        ForegroundState = "running"
	ForegroundIdle           ForegroundState = "idle"
	ForegroundRequiresAction ForegroundState = "requires_action"
)

The closed foreground vocabulary.

func (ForegroundState) Valid

func (s ForegroundState) Valid() bool

Valid reports whether the foreground state is part of the closed vocabulary.

type Negotiated

type Negotiated struct {
	Version              int            `json:"version"`
	UpdatesOutsidePrompt bool           `json:"updatesOutsidePrompt"`
	ActivityKinds        []ActivityKind `json:"activityKinds"`
}

Negotiated carries the lifecycle facts one configuration proved at initialize. Every field is a proven structured fact: an empty activity-kind set and a false UpdatesOutsidePrompt are truthful answers for a configuration whose boundaries prove nothing more.

func Answer

func Answer(proven Negotiated) Negotiated

Answer stamps the accepted current version onto the facts the active configuration proved.

func (Negotiated) Advertisement

func (n Negotiated) Advertisement() map[string]any

Advertisement renders the answer for InitializeResponse._meta. The activity kinds are always an array and never null.

func (Negotiated) Present

func (n Negotiated) Present() bool

Present reports whether the configuration answered the lifecycle key at all. An absent answer makes every envelope, correlation value, and lifecycle fact illegal on the connection.

func (Negotiated) SupportsVersion

func (n Negotiated) SupportsVersion(version int) bool

SupportsVersion reports whether a value is the negotiated version.

func (*Negotiated) UnmarshalJSON

func (n *Negotiated) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes the capability answer strictly: exact integer version, no duplicate or unknown members, and no trailing input.

type Options

type Options struct {
	// Negotiated are the lifecycle facts the source's configuration proved. The
	// reducer refuses anything the configuration did not advertise.
	Negotiated Negotiated
}

Options configures a reducer.

type Outcome

type Outcome string

Outcome is a finished cycle's recorded result.

const (
	OutcomeSuccess   Outcome = "success"
	OutcomeRefused   Outcome = "refused"
	OutcomeCancelled Outcome = "cancelled"
	OutcomeLimit     Outcome = "limit"
	OutcomeFailed    Outcome = "failed"
)

The closed outcome vocabulary.

func (Outcome) Valid

func (o Outcome) Valid() bool

Valid reports whether the outcome is part of the closed vocabulary.

type Owner

type Owner struct {
	Type OwnerType `json:"type"`
	ID   string    `json:"id"`
}

Owner identifies the turn or activity one action belongs to.

type OwnerType

type OwnerType string

OwnerType names what an action belongs to.

const (
	OwnerTurn     OwnerType = "turn"
	OwnerActivity OwnerType = "activity"
)

The closed owner-type vocabulary.

func (OwnerType) Valid

func (t OwnerType) Valid() bool

Valid reports whether the owner type is part of the closed vocabulary.

type ParamError

type ParamError struct {
	// Field is the full request path, from metaPath down to the offending member.
	Field string
	// Verdict is VerdictUnsupported or VerdictMissing.
	Verdict string
}

ParamError refuses a negotiation or correlation value. It names the exact member path so a host can tell which value it got wrong.

func DecodeOffer

func DecodeOffer(meta map[string]any) (bool, *ParamError)

DecodeOffer reads the offer from InitializeRequest._meta and reports whether one was present. An absent offer is not a refusal: the host asked for nothing, and the answer, every envelope, and every correlation read are then omitted for the whole connection.

func RejectKey

func RejectKey(meta map[string]any) *ParamError

RejectKey refuses the reserved literal on a surface that carries no lifecycle value. A family literal is never a foreign namespace and never a no-op, so every inbound surface outside initialize, session/prompt, and the stream refuses it by name.

func (*ParamError) Error

func (e *ParamError) Error() string

Error implements error.

type PromptAccepted

type PromptAccepted struct {
	SubmissionID string
	ClientNonce  string
	TurnID       string
	RunID        string
}

PromptAccepted records that the native dispatcher took durable ownership of a submitted frame. Acceptance is never inferred from a running transition.

type Publisher

type Publisher struct {
	// contains filtered or unexported fields
}

Publisher owns one session's lifecycle incarnation and blocking actions. It serializes its own publications; its zero value is ready. The deliver function given to Open runs synchronously under the publisher's lock, on a context the caller's cancellation does not reach, and MUST NOT call back into the Publisher. A failed delivery fences the stream.

func (*Publisher) Accept

func (p *Publisher) Accept(ctx context.Context, c *Cycle, submission Submission) error

Accept publishes prompt acceptance and opens its foreground cycle.

func (*Publisher) ActionPending

func (p *Publisher) ActionPending(ctx context.Context, c Cycle, actionID string, kind ActionKind) error

ActionPending publishes a blocking action and, for the cycle's first blocker, the requires_action transition.

func (*Publisher) ActionResolved

func (p *Publisher) ActionResolved(ctx context.Context, c Cycle, actionID string, state ActionState) error

ActionResolved terminalizes a blocker and resumes running after the cycle's last one.

func (*Publisher) Active

func (p *Publisher) Active() bool

Active reports whether an unfenced incarnation is open.

func (*Publisher) Correlation

func (p *Publisher) Correlation(c Cycle, actionID string) map[string]any

Correlation returns the metadata for an action owned by the given cycle.

func (*Publisher) Fence

func (p *Publisher) Fence()

Fence ends the current incarnation without asserting a durable terminal idle.

func (*Publisher) Idle

func (p *Publisher) Idle(ctx context.Context, c Cycle, stopReason string, outcome Outcome) error

Idle cancels the cycle's outstanding blockers and ends a durably committed cycle. A failed outcome carries no stop reason.

func (*Publisher) NewAgentCycle

func (p *Publisher) NewAgentCycle() Cycle

NewAgentCycle allocates an immutable identity in the current incarnation. The caller reserves its foreground with this identity before publishing it.

func (*Publisher) NextID

func (p *Publisher) NextID(kind string) string

NextID allocates an identity within this session's ordered native events.

func (*Publisher) Open

func (p *Publisher) Open(ctx context.Context, id string, negotiated Negotiated, deliver func(context.Context, map[string]any) error) error

Open publishes an idle snapshot for a new native incarnation.

func (*Publisher) OpenAgentCycle

func (p *Publisher) OpenAgentCycle(ctx context.Context, c Cycle) error

OpenAgentCycle publishes the reserved native activity in its incarnation.

type Reducer

type Reducer struct {
	// contains filtered or unexported fields
}

Reducer reduces one session's lifecycle stream. It validates ordering identity before reducing, refuses anything it cannot prove, and latches on the first refusal: a stream that failed closed never reduces again.

One reducer follows one session across incarnations. A snapshot bearing a new stream identity supersedes the previous incarnation and starts a fresh projection; every other event on a foreign or fenced stream is stale.

The one advertised fact it cannot check is updatesOutsidePrompt: no fact on the ordered stream expresses whether a prompt is in flight, so that obligation belongs to the emitter's own configuration and to a transport-facing consumer.

A Reducer is not safe for concurrent use; the owner of the stream serializes reduction.

func NewReducer

func NewReducer(opts Options) *Reducer

NewReducer builds a reducer for one session.

func (*Reducer) Activities

func (r *Reducer) Activities() iter.Seq[ActivityRecord]

Activities yields each activity's projection in order. The reducer must not reduce while the sequence is iterated.

func (*Reducer) Close

func (r *Reducer) Close()

Close records that the addressed session's close completed. The session is over: every later event bearing its identity is stale, a would-be new incarnation of it included.

func (*Reducer) Foreground

func (r *Reducer) Foreground() (Foreground, bool)

Foreground returns the foreground projection, when the stream asserted one.

func (*Reducer) Negotiated

func (r *Reducer) Negotiated() Negotiated

Negotiated reports the configuration the reducer validates against.

func (*Reducer) Reduce

func (r *Reducer) Reduce(delivery Delivery) error

Reduce validates and reduces one delivery. Carrier legality is structural, so it is judged before ordering. An exact retransmission of an already-reduced identity is suppressed wholesale and returns nil without changing the projection.

func (*Reducer) ReduceSessionUpdate

func (r *Reducer) ReduceSessionUpdate(params json.RawMessage) error

ReduceSessionUpdate decodes one session/update notification payload and reduces the delivery it carries. A frame carrying no envelope reports ErrNoEnvelope and changes nothing; every other refusal latches the stream, so a caller that stops here holds the projection as it stood at the moment of refusal.

func (*Reducer) Settled

func (r *Reducer) Settled() bool

Settled reports State().Settled.

func (*Reducer) State

func (r *Reducer) State() State

State returns a copy of the projection proved so far. The accessors below read one part of it without copying the rest.

func (*Reducer) StreamID

func (r *Reducer) StreamID() string

StreamID is the incarnation the projection belongs to.

func (*Reducer) Turn

func (r *Reducer) Turn(turnID string) (TurnRecord, bool)

Turn returns one turn's projection.

func (*Reducer) Turns

func (r *Reducer) Turns() iter.Seq[TurnRecord]

Turns yields each turn's projection in order. The reducer must not reduce while the sequence is iterated.

type Snapshot

type Snapshot struct {
	Foreground Foreground
	Activities []ActivityUpdate
	Actions    []ActionUpdate
}

Snapshot opens a stream with the whole truth it can state: the foreground state and cycle and the complete nonterminal activity and action sets.

type State

type State struct {
	StreamID       string `json:"streamId"`
	ReducedThrough uint64 `json:"reducedThrough"`
	// SuppressedRetransmissions counts frames recognized as exact retransmissions
	// of an already-reduced identity.
	SuppressedRetransmissions int              `json:"suppressedRetransmissions"`
	Foreground                *Foreground      `json:"foreground"`
	Turns                     []TurnRecord     `json:"turns"`
	Activities                []ActivityRecord `json:"activities"`
	Actions                   []ActionRecord   `json:"actions"`
	// Closed reports that the addressed session's close completed: no later event
	// is possible from it, and no further incarnation of it exists.
	Closed bool `json:"closed"`
}

State is the projection a reduced stream proves. It is the only surface a lifecycle fact may be read from: nothing in it is inferred from silence, timing, transcript text, or a poll.

A projection belongs to one incarnation and never adopts a prior incarnation's turns, activities, or actions. Its encoded shape is the family fixture battery's: eight members, every one present.

func (State) Action

func (s State) Action(actionID string) (ActionRecord, bool)

Action returns one action's projection.

func (State) Activity

func (s State) Activity(activityID string) (ActivityRecord, bool)

Activity returns one activity's projection.

func (State) Settled

func (s State) Settled() bool

Settled reports whether nothing the stream knows about is live: the foreground is idle and every activity and action is terminal.

func (State) Turn

func (s State) Turn(turnID string) (TurnRecord, bool)

Turn returns one turn's projection.

type StateTransition

type StateTransition struct {
	State      ForegroundState
	CycleID    string
	TurnID     string
	Cause      Cause
	StopReason string
	Outcome    Outcome
}

StateTransition is one foreground state change. Only a transition that ends work carries a stop reason and an outcome.

type Submission

type Submission struct {
	SubmissionID string
	ClientNonce  string
	RunID        string
}

Submission names one accepted client prompt. The client nonce is the host's own input identity, distinct from every JSON-RPC message id.

type TurnRecord

type TurnRecord struct {
	TurnID       string  `json:"turnId"`
	Origin       Cause   `json:"origin"`
	Terminal     bool    `json:"terminal"`
	Outcome      Outcome `json:"outcome,omitempty"`
	SubmissionID string  `json:"-"`
	ClientNonce  string  `json:"-"`
	RunID        string  `json:"-"`
	CycleID      string  `json:"-"`
	StopReason   string  `json:"-"`
}

TurnRecord is one foreground epoch. A terminal turn never reopens. The members beyond the projected four are correlation a consumer needs and the wire projection deliberately does not pin.

type ViolationError

type ViolationError struct {
	Kind     ViolationKind
	StreamID string
	Sequence uint64
	Detail   string
}

ViolationError is one refusal. It names the offending ordering identity so a report can say exactly which frame failed closed.

func (*ViolationError) Error

func (v *ViolationError) Error() string

Error implements error.

func (*ViolationError) Is

func (v *ViolationError) Is(target error) bool

Is matches by kind so a caller can assert a class of refusal without knowing the offending identity.

type ViolationKind

type ViolationKind string

ViolationKind names one fail-closed verdict. The vocabulary is closed at the eighteen tokens below: every rule this package enforces reports one of them, and a condition none of them names is not refusable.

const (
	// ViolationUnsupportedVersion refuses an envelope or correlation value whose
	// version is outside the negotiated set.
	ViolationUnsupportedVersion ViolationKind = "unsupported_version"
	// ViolationUnknownField refuses any unknown member of the negotiation object,
	// the envelope, an event, or a correlation value.
	ViolationUnknownField ViolationKind = "unknown_field"
	// ViolationMalformedEnvelope refuses a missing, wrong-typed, or over-bound
	// member. Structural validity is checked before ordering.
	ViolationMalformedEnvelope ViolationKind = "malformed_envelope"
	// ViolationUnknownEventType refuses an event type outside the closed five.
	ViolationUnknownEventType ViolationKind = "unknown_event_type"
	// ViolationUnnegotiatedFact refuses an event asserting a fact the negotiated
	// answer did not claim, and any envelope at all when the answer omitted the
	// key.
	ViolationUnnegotiatedFact ViolationKind = "unnegotiated_fact"
	// ViolationIllegalCarrier refuses an envelope on any carrier other than the
	// identity-only session_info_update, and a non-object value at the key.
	ViolationIllegalCarrier ViolationKind = "illegal_carrier"
	// ViolationDeltaBeforeSnapshot refuses any event other than a snapshot as a
	// stream's first event.
	ViolationDeltaBeforeSnapshot ViolationKind = "delta_before_snapshot"
	// ViolationConflictingDuplicate refuses a repeated sequence identity whose
	// content differs from the reduced one.
	ViolationConflictingDuplicate ViolationKind = "conflicting_duplicate"
	// ViolationSequenceGap refuses a sequence that skips the expected next
	// number: contiguity is the loss detector.
	ViolationSequenceGap ViolationKind = "sequence_gap"
	// ViolationSequenceRegression refuses a sequence below the stream's reduced
	// range that was never reduced.
	ViolationSequenceRegression ViolationKind = "sequence_regression"
	// ViolationStreamCycle refuses a second snapshot on a live stream.
	ViolationStreamCycle ViolationKind = "stream_cycle"
	// ViolationStaleStream refuses an event from an incarnation already fenced or
	// superseded, and every event for a session whose close completed.
	ViolationStaleStream ViolationKind = "stale_stream"
	// ViolationPostTerminalMutation refuses any carried difference from the
	// reduced terminal record of an activity, action, or turn. A restatement that
	// carries no difference is suppressed rather than refused.
	ViolationPostTerminalMutation ViolationKind = "post_terminal_mutation"
	// ViolationImmutableIdentityChange refuses an update that changes an immutable
	// identity field, a first sight missing one, and an acceptance reusing a turn
	// the stream already introduced.
	ViolationImmutableIdentityChange ViolationKind = "immutable_identity_change"
	// ViolationInconsistentForeground refuses a foreground state with no blocker
	// behind it, a blocker with no foreground state beside it, and a transition
	// that releases or ends a cycle an action still blocks.
	ViolationInconsistentForeground ViolationKind = "inconsistent_foreground"
	// ViolationParentTerminalBeforeChild refuses a parent activity that
	// terminalizes while an owned descendant is nonterminal.
	ViolationParentTerminalBeforeChild ViolationKind = "parent_terminal_before_child"
	// ViolationChildAfterParentTerminal refuses a new child activity naming a
	// terminal parent.
	ViolationChildAfterParentTerminal ViolationKind = "child_after_parent_terminal"
	// ViolationUnknownEntity refuses an event naming an entity the stream never
	// introduced. Unknown references would make parentage, ownership, and
	// terminal-ordering rules unenforceable.
	ViolationUnknownEntity ViolationKind = "unknown_entity"
)

The closed violation vocabulary.

Jump to

Keyboard shortcuts

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