Documentation
¶
Overview ¶
Package terminaldecision contains deterministic coordination fixtures for terminal-decision platform tests. Fixtures only expose barriers; callers advance them and own any goroutines used by the test.
Index ¶
Constants ¶
const ( TerminalAllowStop = "allow_stop" TerminalCancelled = "cancelled" TerminalContinued = "continued" TerminalClosed = "closed" TerminalDrained = "drained" SettlementB1 = "b1_settled" SettlementB1AfterB2 = "b1_settled_after_b2" SettlementB1Unsettled = "b1_unsettled" SettlementDrained = "request_drained" SettlementNotApplicable = "not_applicable" CleanupNone = "none" CleanupCancelled = "cancelled" CleanupOverlayDeactivated = "overlay_deactivated" CleanupGenerationClosed = "generation_closed" PolicySnapshotUnchanged = "snapshot_unchanged" PolicyOldSnapshot = "old_snapshot" PolicyNewSnapshot = "new_snapshot" StepB1Settlement = "b1_settlement" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Barrier ¶
type Barrier struct {
// contains filtered or unexported fields
}
Barrier is a caller-driven two-phase gate. Arrive and Release are idempotent, so a replayed schedule step cannot panic by closing a channel.
func (*Barrier) Arrive ¶
func (b *Barrier) Arrive()
Arrive publishes that the guarded operation reached the gate.
func (*Barrier) Arrived ¶
func (b *Barrier) Arrived() <-chan struct{}
Arrived is closed after Arrive is called.
type CancellationSchedule ¶
CancellationSchedule exposes the provider, cancellation, and continuation gates for a cancellation-wins race.
func CancellationRaceSchedule ¶
func CancellationRaceSchedule() CancellationSchedule
CancellationRaceSchedule returns the cancellation-wins schedule.
type ContinuationSchedule ¶
ContinuationSchedule exposes B2 admission/publication and B1 settlement gates for both pre-publication and post-publication failure paths.
func B2AdmissionFailureSchedule ¶
func B2AdmissionFailureSchedule() ContinuationSchedule
B2AdmissionFailureSchedule models failure before B2 publication.
func B2PublishedSettlementSchedule ¶
func B2PublishedSettlementSchedule() ContinuationSchedule
B2PublishedSettlementSchedule models B2 becoming current before B1 settlement reports success or loss.
func ContinuationSchedules ¶
func ContinuationSchedules() []ContinuationSchedule
ContinuationSchedules returns both B1/B2 ordering schedules.
type EventKind ¶
type EventKind uint8
EventKind identifies one bounded outcome category recorded by a fixture.
type Fixture ¶
Fixture is shared bookkeeping for named schedules, not a scheduler.
type OverlayCleanupSchedule ¶
OverlayCleanupSchedule exposes external ingress and fixed-overlay cleanup gates for stale state after a crash or restart.
func StaleOverlayCleanupSchedule ¶
func StaleOverlayCleanupSchedule() OverlayCleanupSchedule
StaleOverlayCleanupSchedule models idempotent stale overlay deactivation.
type PolicyRaceSchedule ¶
PolicyRaceSchedule exposes the snapshot/write ordering gates.
func PolicySchedules ¶
func PolicySchedules() []PolicyRaceSchedule
PolicySchedules returns both deterministic linearization orders.
func PolicySnapshotBeforeWriteSchedule ¶
func PolicySnapshotBeforeWriteSchedule() PolicyRaceSchedule
PolicySnapshotBeforeWriteSchedule models a request retaining the old complete state while a later write applies to the next request.
func PolicyWriteBeforeSnapshotSchedule ¶
func PolicyWriteBeforeSnapshotSchedule() PolicyRaceSchedule
PolicyWriteBeforeSnapshotSchedule models a request observing the new complete state.
type ProviderFailureKind ¶
type ProviderFailureKind string
ProviderFailureKind identifies a failure at the provider boundary.
const ( ProviderTimeout ProviderFailureKind = "timeout" ProviderError ProviderFailureKind = "error" ProviderPanic ProviderFailureKind = "panic" ProviderMalformed ProviderFailureKind = "malformed" )
type ProviderFailureSchedule ¶
type ProviderFailureSchedule struct {
Fixture
Kind ProviderFailureKind
Provider *Barrier
}
ProviderFailureSchedule gates provider timeout, error, panic, and malformed result paths. All normalize to one safe terminal and no continuation.
func ProviderFailureSchedules ¶
func ProviderFailureSchedules() []ProviderFailureSchedule
ProviderFailureSchedules returns one independent schedule per boundary failure mode.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder rejects duplicate outcome categories, making exactly-once checks deterministic without polling or timeouts.
func (*Recorder) Events ¶
Events returns a copy in recording order so callers can assert linearization, such as publication before settlement.
type WithdrawalSchedule ¶
WithdrawalSchedule exposes pin, withdrawal, drain, and close barriers.
func GenerationWithdrawalSchedule ¶
func GenerationWithdrawalSchedule() WithdrawalSchedule
GenerationWithdrawalSchedule models an admitted request retaining its immutable generation while new admission is withdrawn.