Documentation
¶
Overview ¶
Package prototest provides explicit capability fixtures and the shared wire scenarios for Core–Runtime contract tests.
Index ¶
Constants ¶
const ( DeviceID = "runtime" Credential = "synthetic-contract-credential" HarnessKind = "contract" )
Handshake values. The Runtime dials with DeviceID and Credential; Core accepts that credential for DeviceID.
const ( SessionID = "session" StateKey = "agents-api-session" PreparationID = "prepare" RunID = "run" CancelDeliveryID = "cancel" )
Correlation values the scenarios use.
const ( ExecutorID = "executor" Handle = "handle" ExpiresAt int64 = 1_800_000_000_000 )
Placeholders for values the Runtime generates. Core's side sends them as written; the Runtime's side binds each to the value its Runtime sends.
const ( IncompatibleVersionStatus = http.StatusUpgradeRequired IncompatibleVersionCode = "incompatible_version" )
Core rejects any other protocol version at the upgrade with this status and error code, before any dispatch.
const SilenceWindow = 50 * time.Millisecond
SilenceWindow is how long a Silence or Settle step waits for an unexpected frame.
Variables ¶
This section is empty.
Functions ¶
func CancellationOutcome ¶
func CancellationOutcome() proto.DonePayload
CancellationOutcome is the continuity snapshot a cancelled Turn reports.
func Capabilities ¶
func Capabilities(overrides proto.AgentKindCapabilities) proto.AgentKindCapabilities
Capabilities declares the current contract, then applies explicit overrides. List fields individually: a future field must remain unspecified until this fixture is deliberately updated, so declaration validation fails on omission.
func IncompatibleVersions ¶
func IncompatibleVersions() []string
IncompatibleVersions are Runtime protocol versions Core rejects.
Types ¶
type Action ¶
type Action int
Action is what happens at one scenario step.
const ( // Send: From sends Frame, and the other side receives it next. Send Action = iota // Silence: From sends nothing for SilenceWindow. Silence // Settle: the Runtime's native work settles. The Runtime sends nothing // before that, so no receipt precedes native settlement. Settle // Disconnect: the Runtime loses the connection while work runs. The Runtime // settles its native work and cleanup; Core observes no execution outcome. Disconnect // Reconnect: the Runtime connects again with the same device identity. Reconnect )
type Bindings ¶
Bindings maps each placeholder to the value the Runtime under test sent for it.
type WireScenario ¶
type WireScenario struct {
Name string
// NativeSetupFails makes the Runtime's native Executor setup fail.
NativeSetupFails bool
Steps []Step
}
WireScenario is one ordered exchange.
func WireScenarios ¶
func WireScenarios() []WireScenario
WireScenarios returns every shared exchange.