sessionobs

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 9 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 sessionobs defines transport-neutral session observations and bounded diagnostic snapshots.

Index

Constants

Variables

View Source
var ErrProtocolErrorContent = errors.New("session runtime protocol error content is invalid")

Functions

This section is empty.

Types

type ObservationContext

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

func (ObservationContext) Correlation

func (ObservationContext) ObservedAt

func (fact ObservationContext) ObservedAt() time.Time

type ProtocolErrorContent

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

ProtocolErrorContent contains wire meaning only. The observing boundary owns identity, lane, and send evidence, so migration cannot rewrite error context.

func ProtocolErrorForAuthenticatedReceive

func ProtocolErrorForAuthenticatedReceive(message protocolsession.Message) (ProtocolErrorContent, bool)

func ProtocolErrorForResponse

func ProtocolErrorForResponse(kind protocolsession.MessageKind, body []byte) ProtocolErrorContent

func (ProtocolErrorContent) DiagnosticValue

func (value ProtocolErrorContent) DiagnosticValue() diag.Value

func (ProtocolErrorContent) IsZero

func (content ProtocolErrorContent) IsZero() bool

func (ProtocolErrorContent) RetryAfterMillis

func (content ProtocolErrorContent) RetryAfterMillis() (uint32, bool)

func (ProtocolErrorContent) Retryable

func (content ProtocolErrorContent) Retryable() bool

func (ProtocolErrorContent) WireCode

func (content ProtocolErrorContent) WireCode() uint16

func (ProtocolErrorContent) WireScope

func (content ProtocolErrorContent) WireScope() ProtocolErrorScope

type ProtocolErrorContentSpec

type ProtocolErrorContentSpec struct {
	WireScope        ProtocolErrorScope
	WireCode         uint16
	Retryable        bool
	RetryAfterMillis uint32
	HasRetryAfter    bool
}

type ProtocolErrorScope

type ProtocolErrorScope uint8

func (ProtocolErrorScope) DiagnosticName

func (value ProtocolErrorScope) DiagnosticName() string

DiagnosticName belongs to the source vocabulary; recorders accept new values.

type ProtocolObservation

type ProtocolObservation interface {
	DiagnosticRecord() diagnostics.Record
	Correlation() ProtocolObservationCorrelation
	ObservedAt() time.Time
	// contains filtered or unexported methods
}

type ProtocolObservationContext

type ProtocolObservationContext struct {
	Correlation ProtocolObservationCorrelation
	ObservedAt  time.Time
}

type ProtocolObservationCorrelation

type ProtocolObservationCorrelation struct {
	Role              protocolsession.Role
	ProtocolSessionID protocolsession.ProtocolSessionID
	OperationID       protocolsession.OperationID
	// RequestKind may be zero only on ResponseSendNotStarted when setup had no
	// operation route from which to obtain authenticated request context.
	RequestKind protocolsession.MessageKind
}

type ProtocolObservationTraceFunc

type ProtocolObservationTraceFunc func(ProtocolObservation)

func (ProtocolObservationTraceFunc) TraceProtocolObservation

func (fn ProtocolObservationTraceFunc) TraceProtocolObservation(fact ProtocolObservation)

type ProtocolObservationTracer

type ProtocolObservationTracer interface{ TraceProtocolObservation(ProtocolObservation) }

type ProtocolOperationCause

type ProtocolOperationCause uint8

ProtocolOperationCause is deliberately closed and text-free. Raw transport errors can contain endpoints or provider details that do not belong in a privacy-safe user trace.

const (
	ProtocolOperationCauseNone ProtocolOperationCause = iota
	ProtocolOperationCauseCanceled
	ProtocolOperationCauseDeadline
	ProtocolOperationCauseRuntimeClosed
	ProtocolOperationCauseLaneUnavailable
	ProtocolOperationCauseWriterStopped
	ProtocolOperationCauseOperationClosed
	ProtocolOperationCauseProtocolFailure
	ProtocolOperationCauseSuperseded
)

func (ProtocolOperationCause) DiagnosticName

func (value ProtocolOperationCause) DiagnosticName() string

DiagnosticName belongs to the source vocabulary; recorders accept new values.

func (ProtocolOperationCause) IsLifecycle

func (cause ProtocolOperationCause) IsLifecycle() bool

IsLifecycle identifies causes that alone cannot establish an operation fault. None is included because an empty observation contributes no fault evidence. A normal end still requires the terminal owner's evidence.

func (ProtocolOperationCause) Merge

Merge prefers failure evidence over lifecycle causes so cancellation cannot mask a later authenticated fault or failed cleanup. None contributes no evidence. Within either category, the first non-None cause wins; order matters.

type ProtocolOperationObservation

type ProtocolOperationObservation struct {
	Stage                   ProtocolOperationStage
	Role                    protocolsession.Role
	ProtocolSessionID       protocolsession.ProtocolSessionID
	OperationID             protocolsession.OperationID
	RequestKind             protocolsession.MessageKind
	ResponseKind            protocolsession.MessageKind
	HasResponse             bool
	Lane                    session.LaneIdentity
	HasLane                 bool
	HasSend                 bool
	SendSettled             bool
	SendAdmitted            bool
	SendOutcome             protocolsession.SendOutcome
	ResponseCount           uint64
	DeadlineRemainingMillis uint64
	HasDeadline             bool
	OperationElapsedMillis  uint64
	UsableLanesAtSelection  uint32
	UsableLanesAtSettlement uint32
	Cause                   ProtocolOperationCause
	RequestScheduling       requestlane.Estimate
	BlockWait               contentflow.BlockWaitTimeout
	// contains filtered or unexported fields
}

ProtocolOperationObservation summarizes one RPC boundary. Content decisions carry only opaque coordinator/lease join keys; request bodies, file identities, catalog paths, and raw errors remain intentionally absent.

func (ProtocolOperationObservation) Correlation

func (ProtocolOperationObservation) DiagnosticRecord

func (value ProtocolOperationObservation) DiagnosticRecord() diagnostics.Record

func (ProtocolOperationObservation) ObservedAt

func (fact ProtocolOperationObservation) ObservedAt() time.Time

type ProtocolOperationStage

type ProtocolOperationStage uint8

ProtocolOperationStage identifies the side and terminal observation boundary of one authenticated operation without exposing its request body.

const (
	ProtocolOperationReceiverCompleted ProtocolOperationStage = iota + 1
	ProtocolOperationReceiverFailed
	ProtocolOperationReceiverEnded
	ProtocolOperationSenderRequestReceived
	ProtocolOperationReceiverWaitingActiveCapacity
	ProtocolOperationReceiverWaitingRetainedCapacity
	ProtocolOperationReceiverAdmissionReady
)

func (ProtocolOperationStage) DiagnosticName

func (value ProtocolOperationStage) DiagnosticName() string

DiagnosticName belongs to the source vocabulary; recorders accept new values.

type ReceivedProtocolError

type ReceivedProtocolError struct {
	ObservationContext
	// contains filtered or unexported fields
}

func (ReceivedProtocolError) Content

func (ReceivedProtocolError) DiagnosticRecord

func (value ReceivedProtocolError) DiagnosticRecord() diagnostics.Record

func (ReceivedProtocolError) Lane

type ResponseSendNotStarted

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

func (ResponseSendNotStarted) Content

func (fact ResponseSendNotStarted) Content() ProtocolErrorContent

func (ResponseSendNotStarted) DiagnosticRecord

func (value ResponseSendNotStarted) DiagnosticRecord() diagnostics.Record

func (ResponseSendNotStarted) ResponseKind

func (fact ResponseSendNotStarted) ResponseKind() protocolsession.MessageKind

func (ResponseSendNotStarted) ResponseSequence

func (fact ResponseSendNotStarted) ResponseSequence() uint64

func (ResponseSendNotStarted) Result

func (fact ResponseSendNotStarted) Result() protocolsession.ResponseSendResult

type ResponseSendReturned

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

func (ResponseSendReturned) Content

func (fact ResponseSendReturned) Content() ProtocolErrorContent

func (ResponseSendReturned) DiagnosticRecord

func (value ResponseSendReturned) DiagnosticRecord() diagnostics.Record

func (ResponseSendReturned) ResponseKind

func (fact ResponseSendReturned) ResponseKind() protocolsession.MessageKind

func (ResponseSendReturned) ResponseSequence

func (fact ResponseSendReturned) ResponseSequence() uint64

func (ResponseSendReturned) Result

func (fact ResponseSendReturned) Result() protocolsession.ResponseSendResult

type SendAttemptSettled

type SendAttemptSettled struct {
	ObservationContext
	// contains filtered or unexported fields
}

func (SendAttemptSettled) Attempt

func (SendAttemptSettled) DiagnosticRecord

func (value SendAttemptSettled) DiagnosticRecord() diagnostics.Record

func (SendAttemptSettled) ResponseKind

func (fact SendAttemptSettled) ResponseKind() protocolsession.MessageKind

type SenderContentDecision

type SenderContentDecision struct {
	ObservationContext
	// contains filtered or unexported fields
}

func (SenderContentDecision) Decision

func (SenderContentDecision) DiagnosticRecord

func (value SenderContentDecision) DiagnosticRecord() diagnostics.Record

func (SenderContentDecision) Lane

type SenderSessionTerminalObserver

type SenderSessionTerminalObserver interface {
	ObserveSenderSessionTerminated(SenderSessionTerminated)
}

type SenderSessionTerminalObserverFunc

type SenderSessionTerminalObserverFunc func(SenderSessionTerminated)

func (SenderSessionTerminalObserverFunc) ObserveSenderSessionTerminated

func (function SenderSessionTerminalObserverFunc) ObserveSenderSessionTerminated(
	terminated SenderSessionTerminated,
)

type SenderSessionTerminalProvenance

type SenderSessionTerminalProvenance string
const (
	SenderSessionTerminalProvenanceNormalStop     SenderSessionTerminalProvenance = "normal_stop"
	SenderSessionTerminalProvenanceCallerStop     SenderSessionTerminalProvenance = "caller_stop"
	SenderSessionTerminalProvenanceRemoteClose    SenderSessionTerminalProvenance = "remote_close"
	SenderSessionTerminalProvenanceLaneRetirement SenderSessionTerminalProvenance = "lane_retirement"
	SenderSessionTerminalProvenanceLocalFault     SenderSessionTerminalProvenance = "local_fault"
)

type SenderSessionTerminalTrigger

type SenderSessionTerminalTrigger string
const (
	SenderSessionTerminalTriggerGracefulStop   SenderSessionTerminalTrigger = "graceful_stop"
	SenderSessionTerminalTriggerForcedClose    SenderSessionTerminalTrigger = "forced_close"
	SenderSessionTerminalTriggerPeerTerminal   SenderSessionTerminalTrigger = "peer_terminal"
	SenderSessionTerminalTriggerPathsExhausted SenderSessionTerminalTrigger = "paths_exhausted"
	SenderSessionTerminalTriggerRuntimeFailed  SenderSessionTerminalTrigger = "runtime_failed"
)

type SenderSessionTerminated

type SenderSessionTerminated struct {
	ProtocolSessionID protocolsession.ProtocolSessionID
	Trigger           SenderSessionTerminalTrigger
	Provenance        SenderSessionTerminalProvenance
	Failure           diagnosticerror.Snapshot
}

SenderSessionTerminated is the single causal root for a sender session. The closed pair owns lifecycle classification; Failure is independent, immutable diagnostic evidence captured by the winning failure decision.

func (SenderSessionTerminated) DiagnosticRecord

func (value SenderSessionTerminated) DiagnosticRecord() diag.Record

func (SenderSessionTerminated) Valid

func (terminated SenderSessionTerminated) Valid() bool

type SenderTerminalSendDecision

type SenderTerminalSendDecision string
const (
	SenderTerminalSendDecisionDelivered         SenderTerminalSendDecision = "delivered"
	SenderTerminalSendDecisionNaturalRetirement SenderTerminalSendDecision = "natural_retirement"
	SenderTerminalSendDecisionFailed            SenderTerminalSendDecision = "failed"
)

type SenderTerminalSendObserved

type SenderTerminalSendObserved struct {
	ProtocolSessionID    protocolsession.ProtocolSessionID
	Lane                 session.LaneIdentity
	Settled              bool
	TransportDisposition SenderTerminalSendTransportDisposition
	Outcome              SenderTerminalSendOutcome
	Decision             SenderTerminalSendDecision
}

SenderTerminalSendObserved exposes only stable identities and decisions. The terminal body, cryptographic material, and provider-specific error text stay below this boundary so production logs cannot leak share content or keys.

func (SenderTerminalSendObserved) DiagnosticRecord

func (value SenderTerminalSendObserved) DiagnosticRecord() diag.Record

type SenderTerminalSendObserver

type SenderTerminalSendObserver interface {
	ObserveSenderTerminalSend(SenderTerminalSendObserved)
}

type SenderTerminalSendObserverFunc

type SenderTerminalSendObserverFunc func(SenderTerminalSendObserved)

func (SenderTerminalSendObserverFunc) ObserveSenderTerminalSend

func (function SenderTerminalSendObserverFunc) ObserveSenderTerminalSend(observation SenderTerminalSendObserved)

type SenderTerminalSendOutcome

type SenderTerminalSendOutcome string
const (
	SenderTerminalSendOutcomeDelivered SenderTerminalSendOutcome = "delivered"
	SenderTerminalSendOutcomeDropped   SenderTerminalSendOutcome = "dropped"
	SenderTerminalSendOutcomeUnknown   SenderTerminalSendOutcome = "unknown"
)

type SenderTerminalSendTransportDisposition

type SenderTerminalSendTransportDisposition string
const (
	SenderTerminalSendTransportAccepted   SenderTerminalSendTransportDisposition = "accepted"
	SenderTerminalSendTransportNotReached SenderTerminalSendTransportDisposition = "not_reached"
	SenderTerminalSendTransportUnsettled  SenderTerminalSendTransportDisposition = "unsettled"
	SenderTerminalSendTransportRejected   SenderTerminalSendTransportDisposition = "rejected_before_acceptance"
	SenderTerminalSendTransportRetired    SenderTerminalSendTransportDisposition = "retired_before_acceptance"
)

Jump to

Keyboard shortcuts

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