Documentation
¶
Overview ¶
Package sessionobs defines transport-neutral session observations and bounded diagnostic snapshots.
Index ¶
- Constants
- Variables
- type ObservationContext
- type ProtocolErrorContent
- func (value ProtocolErrorContent) DiagnosticValue() diag.Value
- func (content ProtocolErrorContent) IsZero() bool
- func (content ProtocolErrorContent) RetryAfterMillis() (uint32, bool)
- func (content ProtocolErrorContent) Retryable() bool
- func (content ProtocolErrorContent) WireCode() uint16
- func (content ProtocolErrorContent) WireScope() ProtocolErrorScope
- type ProtocolErrorContentSpec
- type ProtocolErrorScope
- type ProtocolObservation
- type ProtocolObservationContext
- type ProtocolObservationCorrelation
- type ProtocolObservationTraceFunc
- type ProtocolObservationTracer
- type ProtocolOperationCause
- type ProtocolOperationObservation
- type ProtocolOperationStage
- type ReceivedProtocolError
- type ResponseSendObserved
- func (fact ResponseSendObserved) Attempts() uint32
- func (fact ResponseSendObserved) Content() ProtocolErrorContent
- func (value ResponseSendObserved) DiagnosticRecord() diagnostics.Record
- func (fact ResponseSendObserved) Lane() session.LaneIdentity
- func (fact ResponseSendObserved) ResponseKind() protocolsession.MessageKind
- func (fact ResponseSendObserved) ResponseSequence() uint64
- func (fact ResponseSendObserved) Status() SendStatus
- type SendStatus
- type SenderContentDecision
- type SenderSessionTerminalObserver
- type SenderSessionTerminalObserverFunc
- type SenderSessionTerminalProvenance
- type SenderSessionTerminalTrigger
- type SenderSessionTerminated
- type SenderTerminalSendDecision
- type SenderTerminalSendObserved
- type SenderTerminalSendObserver
- type SenderTerminalSendObserverFunc
- type SenderTerminalSendOutcome
- type SenderTerminalSendTransportDisposition
Constants ¶
const ( ProtocolErrorDirectory = ProtocolErrorScope(protocolsession.OperationScopeDirectory) ProtocolErrorRevision = ProtocolErrorScope(protocolsession.OperationScopeRevision) ProtocolErrorBlock = ProtocolErrorScope(protocolsession.OperationScopeBlock) ProtocolErrorPeer = ProtocolErrorScope(protocolsession.OperationScopePeer) )
Variables ¶
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 (fact ObservationContext) Correlation() ProtocolObservationCorrelation
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 NewProtocolErrorContent ¶
func NewProtocolErrorContent(spec ProtocolErrorContentSpec) (ProtocolErrorContent, error)
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 when an outbound error occurs before operation lookup succeeds.
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 ProtocolOperationCauseWriterStopped ProtocolOperationCauseOperationClosed ProtocolOperationCauseProtocolFailure ProtocolOperationCauseSuperseded ProtocolOperationCauseReplayWindow )
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 ¶
func (cause ProtocolOperationCause) Merge(next ProtocolOperationCause) ProtocolOperationCause
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
SendStatus SendStatus
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 NewProtocolOperationObservation ¶
func NewProtocolOperationObservation(ctx ProtocolObservationContext, fact ProtocolOperationObservation) ProtocolOperationObservation
func (ProtocolOperationObservation) Correlation ¶
func (fact ProtocolOperationObservation) Correlation() ProtocolObservationCorrelation
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 ProtocolOperationReceiverAdmissionReady ProtocolOperationSenderRequestBelowWindow )
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 NewReceivedProtocolError ¶
func NewReceivedProtocolError(ctx ProtocolObservationContext, content ProtocolErrorContent, lane session.LaneIdentity) ReceivedProtocolError
func (ReceivedProtocolError) Content ¶
func (fact ReceivedProtocolError) Content() ProtocolErrorContent
func (ReceivedProtocolError) DiagnosticRecord ¶
func (value ReceivedProtocolError) DiagnosticRecord() diagnostics.Record
func (ReceivedProtocolError) Lane ¶
func (fact ReceivedProtocolError) Lane() session.LaneIdentity
type ResponseSendObserved ¶ added in v0.1.6
type ResponseSendObserved struct {
ObservationContext
// contains filtered or unexported fields
}
func NewResponseSendObserved ¶ added in v0.1.6
func NewResponseSendObserved( ctx ProtocolObservationContext, sequence uint64, kind protocolsession.MessageKind, lane session.LaneIdentity, status SendStatus, attempts uint32, content ProtocolErrorContent, ) ResponseSendObserved
func (ResponseSendObserved) Attempts ¶ added in v0.1.6
func (fact ResponseSendObserved) Attempts() uint32
func (ResponseSendObserved) Content ¶ added in v0.1.6
func (fact ResponseSendObserved) Content() ProtocolErrorContent
func (ResponseSendObserved) DiagnosticRecord ¶ added in v0.1.6
func (value ResponseSendObserved) DiagnosticRecord() diagnostics.Record
func (ResponseSendObserved) Lane ¶ added in v0.1.6
func (fact ResponseSendObserved) Lane() session.LaneIdentity
func (ResponseSendObserved) ResponseKind ¶ added in v0.1.6
func (fact ResponseSendObserved) ResponseKind() protocolsession.MessageKind
func (ResponseSendObserved) ResponseSequence ¶ added in v0.1.6
func (fact ResponseSendObserved) ResponseSequence() uint64
func (ResponseSendObserved) Status ¶ added in v0.1.6
func (fact ResponseSendObserved) Status() SendStatus
type SendStatus ¶ added in v0.1.6
type SendStatus uint8
SendStatus summarizes the physical transport status of an outbound protocol frame.
const ( SendStatusConfirmed SendStatus = iota + 1 SendStatusNotSent SendStatusUncertain )
func (SendStatus) DiagnosticName ¶ added in v0.1.6
func (value SendStatus) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type SenderContentDecision ¶
type SenderContentDecision struct {
ObservationContext
// contains filtered or unexported fields
}
func NewSenderContentDecision ¶
func NewSenderContentDecision(ctx ProtocolObservationContext, decision contentflow.SenderDecisionTrace, lane session.LaneIdentity, hasLane bool) SenderContentDecision
func (SenderContentDecision) Decision ¶
func (fact SenderContentDecision) Decision() contentflow.SenderDecisionTrace
func (SenderContentDecision) DiagnosticRecord ¶
func (value SenderContentDecision) DiagnosticRecord() diagnostics.Record
func (SenderContentDecision) Lane ¶
func (fact SenderContentDecision) Lane() (session.LaneIdentity, bool)
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" )