Documentation
¶
Overview ¶
Package terminal implements the pure-domain request/attempt terminal owner state machine (requirements 7.1–7.8, design D8, D13).
One CAS Claim(command) wins per owner; the winner snapshots accumulators once and publishes an Outcome. Concurrent losers observe the same result without re-running effects. Domain code has no SQL, HTTP, or filesystem I/O.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccumulatorSnapshot ¶
type AccumulatorSnapshot struct {
// contains filtered or unexported fields
}
AccumulatorSnapshot is an opaque immutable copy of mutable stream accumulators taken by the CAS claim winner.
func NewAccumulatorSnapshot ¶
func NewAccumulatorSnapshot(data []byte, outputCommitted bool) AccumulatorSnapshot
NewAccumulatorSnapshot copies data into an opaque snapshot.
func (AccumulatorSnapshot) Bytes ¶
func (s AccumulatorSnapshot) Bytes() []byte
Bytes returns a defensive copy of the snapshot bytes.
func (AccumulatorSnapshot) Clone ¶
func (s AccumulatorSnapshot) Clone() AccumulatorSnapshot
Clone returns a deep copy.
func (AccumulatorSnapshot) Equal ¶
func (s AccumulatorSnapshot) Equal(o AccumulatorSnapshot) bool
Equal reports whether two snapshots have identical bytes and flags.
func (AccumulatorSnapshot) OutputCommitted ¶
func (s AccumulatorSnapshot) OutputCommitted() bool
OutputCommitted reports whether visible output was committed when snapped.
type Outcome ¶
type Outcome struct {
Code sdk.OutcomeCode
Command sdk.Command
Snapshot AccumulatorSnapshot
SettleCustomer bool // request plane: customer authority
ReleaseConcurrency bool // request plane: logical concurrency / request provider
SettleOperator bool // attempt plane: operator authority
ReleaseAttempt bool // attempt plane: attempt provider / attempt lease
Scope sdk.Scope
}
Outcome is the published terminal result for one owner.
type Owner ¶
type Owner struct {
// contains filtered or unexported fields
}
Owner is a CAS-owned terminal state machine for one request or attempt.
func (*Owner) Claim ¶
func (o *Owner) Claim(cmd sdk.Command, snap AccumulatorSnapshot) Result
Claim competes for the single terminalization outcome.
The winner snapshots accumulators once and publishes the outcome. Concurrent or subsequent callers observe the same outcome without re-running effects.