lifecycle

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 34 Imported by: 0 modules, 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 lifecycle owns fixture identity, environment routes, execution descriptors and finalization. Protocol replay and native process behavior stay in their existing packages.

Index

Constants

View Source
const (
	ToolSourceExecutable ToolSource = "executable"
	ToolSourceEmbedded   ToolSource = "embedded"

	ConnectionTransportProcess   = "process"
	ConnectionTransportInProcess = "in-process"
)
View Source
const SchemaVersion = 7

Variables

View Source
var ErrBusy = errors.New("fixture action busy")

Functions

func BaselineRoot added in v0.2.0

func BaselineRoot(fixtureDir string) string

func BaselineWorkspace added in v0.2.0

func BaselineWorkspace(fixtureDir string) string

func CanonicalFixtureDir

func CanonicalFixtureDir(fixtureDir string) (string, error)

CanonicalFixtureDir validates and resolves one prepared-fixture directory.

func ClassifyFailure

func ClassifyFailure(class FailureClass, err error) error

ClassifyFailure returns nil for nil and preserves an existing terminal class.

func ConnectionIDs

func ConnectionIDs(source Source, plan tool.Object) []string

func CurrentArtifact

func CurrentArtifact(fixtureDir string, fixture *Fixture) (*corpus.Material, bool, error)

CurrentArtifact resolves the single current recording. A fixture without a current recording is a valid prepared state and returns present=false.

func ExecutionArtifactRoot added in v0.2.0

func ExecutionArtifactRoot(fixtureDir, executionID, action string) string

func ExecutionDir

func ExecutionDir(fixtureDir, id string) string

func ExecutionOverlayRoot added in v0.2.0

func ExecutionOverlayRoot(fixtureDir, executionID string) string

func Export

func Export(fixtureDir, output string) error

Export copies the exact current package without creating an execution or changing fixture state.

func FixturePath

func FixturePath(fixtureDir string) string

func FixtureReference added in v0.2.0

func FixtureReference(fixtureDir, target string) (string, error)

FixtureReference converts an absolute path inside the fixture into a canonical fixture-root-relative reference.

func IndexPath

func IndexPath(fixtureDir string) string

func LatestArtifact

func LatestArtifact(fixtureDir string, fixture *Fixture) (*corpus.Material, error)

LatestArtifact resolves the single current recording.

func LauncherPath added in v0.2.0

func LauncherPath(fixtureDir, connection string) string

func LoadPlan

func LoadPlan(fixture *Fixture) (tool.Object, error)

func MaterialIndexPath

func MaterialIndexPath(fixtureDir string) string

func MaterialReference added in v0.2.0

func MaterialReference(materialID string) string

MaterialReference derives the fixture-root-relative reference for a material identity. Material contents use references relative to this root.

func MaterialRoot added in v0.2.0

func MaterialRoot(fixtureDir, materialID string) string

func PackageExecutionRoot added in v0.2.0

func PackageExecutionRoot(fixtureDir, materialID, executionID string) string

func PackageReference added in v0.2.0

func PackageReference(fixtureDir, materialID, target string) (string, error)

func PackageRoot added in v0.2.0

func PackageRoot(fixtureDir, materialID string) string

PackageRoot is the single persistent root for one material and its evidence.

func PrivateConfigRoot added in v0.2.0

func PrivateConfigRoot(fixtureDir string) string

func RebindNativePreparationExecution added in v0.2.0

func RebindNativePreparationExecution(fixtureDir string, execution Execution) error

RebindNativePreparationExecution adds final core hashes before the ordinary execution inventory seals. The declaration itself remains immutable.

func RecordEnvironment

func RecordEnvironment(fixture *Fixture) (map[string]string, error)

RecordEnvironment uses the stable normal record route slots. The first agent connection binds these slots to its overlay before protocol I/O starts.

func RefreshRoutes added in v0.2.0

func RefreshRoutes(fixture *Fixture) error

RefreshRoutes writes disposable, non-secret startup views. Persistent evidence never references these files, and no snapshot field supplies mutual exclusion.

func ResolveFixtureReference added in v0.2.0

func ResolveFixtureReference(fixtureDir, reference string) (string, error)

ResolveFixtureReference resolves a fixture-root-relative reference and rejects absolute, non-clean and symlink-escaping values.

func ResolvePackageReference added in v0.2.0

func ResolvePackageReference(fixtureDir, materialID, reference string) (string, error)

func ResourceRoot added in v0.2.0

func ResourceRoot(fixtureDir string) string

func ResultStream

func ResultStream(fd int) (*os.File, error)

ResultStream duplicates a caller-owned descriptor before an execution starts. Close-on-exec prevents the native Agent from keeping the notification pipe open.

func RouteRoot added in v0.2.0

func RouteRoot(fixtureDir, action string) string

func RouteWorkspace added in v0.2.0

func RouteWorkspace(fixtureDir, action string) string

func SaveNativePreparation

func SaveNativePreparation(fixtureDir string, fixture *Fixture, execution Execution, runtimePlan tool.Object, planPath, materialPlanPath string) error

SaveNativePreparation binds observed native preparation to its ordinary execution.

func SourcePlanPath added in v0.2.0

func SourcePlanPath(fixtureDir string) string

func SourceSeedPath added in v0.2.0

func SourceSeedPath(fixtureDir string) string

func TemplateRoot added in v0.2.0

func TemplateRoot(fixtureDir, action string) string

func ToolBindingPath added in v0.2.0

func ToolBindingPath(fixtureDir string) string

func ValidateMockConnection

func ValidateMockConnection(provider string, execution Execution, connection ExecutionConnection) error

ValidateMockConnection checks the ordinary mock's durable facts against its exact material, then applies the official verifier's successful-process policy.

func ValidateMockExecution

func ValidateMockExecution(fixtureDir string, fixture *Fixture, execution Execution) error

ValidateMockExecution requires the normal completed index and connection layout, in addition to the descriptor's public launch contract.

func VerifyHistorySeed added in v0.2.0

func VerifyHistorySeed(fixture *Fixture) error

VerifyHistorySeed checks the entire frozen source closure, including added files. Native runtime history is intentionally outside this inventory.

Types

type ActionResult

type ActionResult struct {
	MaterialID           string
	PublicationCommitted bool
	FixtureID            string
	ExecutionID          string
	ConnectionID         string
	ConnectionStatus     ConnectionStatus
	ExecutionStatus      ExecutionStatus
	ExecutionComplete    bool
	Material             *corpus.Material
	ExecutionPath        string
	ReceiptPath          string
	ProcessReceiptPath   string
	ResultPath           string
}

ActionResult is the shared evidence returned after one record or mock connection call. A passed connection does not imply a complete execution.

type Admission

type Admission struct {
	Index     string `json:"index"`
	Scenarios string `json:"scenarios"`
	Archive   string `json:"archive"`
}

type ClassifiedError

type ClassifiedError struct {
	Class FailureClass
	Err   error
}

ClassifiedError binds one failure class to its diagnostic without erasing the underlying error for callers that need context or I/O matching.

func (*ClassifiedError) Error

func (e *ClassifiedError) Error() string

func (*ClassifiedError) Unwrap

func (e *ClassifiedError) Unwrap() error

type Command

type Command struct {
	Command string   `json:"command"`
	Args    []string `json:"args,omitempty"`
}

func SelfCommand

func SelfCommand() (Command, string, string, error)

type ConnectionReport

type ConnectionReport struct {
	ID     string
	Status ConnectionStatus

	Transport       MockTransport
	FullConsumption bool
	ClientEOF       bool
	NativeLaunched  bool
	CleanupComplete bool
	ExitCode        *int
	Failure         FailureClass
	Error           string

	ReceiptPath        string
	ProcessReceiptPath string
	ResultPath         string
}

ConnectionReport is one connection's durable protocol and process facts.

type ConnectionStatus

type ConnectionStatus string

ConnectionStatus is the durable result of one connection in an action execution.

const (
	ConnectionStatusUnknown ConnectionStatus = "unknown"
	ConnectionStatusPending ConnectionStatus = "pending"
	ConnectionStatusRunning ConnectionStatus = "running"
	ConnectionStatusPassed  ConnectionStatus = "passed"
	ConnectionStatusFailed  ConnectionStatus = "failed"
)

type ConnectionTemplate

type ConnectionTemplate struct {
	ID        string   `json:"id"`
	Transport string   `json:"transport"`
	Command   string   `json:"-"`
	Args      []string `json:"-"`
	Launcher  string   `json:"-"`
}

func (*ConnectionTemplate) UnmarshalJSON

func (c *ConnectionTemplate) UnmarshalJSON(data []byte) error

type Current

type Current struct {
	SchemaVersion         int    `json:"schemaVersion"`
	FixtureID             string `json:"fixtureId"`
	MaterialID            string `json:"materialId,omitempty"`
	MaterialSHA256        string `json:"materialSHA256,omitempty"`
	LegacyInventorySHA256 string `json:"legacyInventorySHA256,omitempty"`
	LegacyFormat          string `json:"legacyFormat,omitempty"`
	ManifestSHA256        string `json:"manifestSHA256,omitempty"`
}

type Execution

type Execution struct {
	SchemaVersion int                   `json:"schemaVersion"`
	ExecutionID   string                `json:"executionId"`
	FixtureID     string                `json:"fixtureId"`
	Command       string                `json:"command"`
	Args          []string              `json:"args,omitempty"`
	NativeArgs    []string              `json:"nativeArgs,omitempty"`
	Source        Source                `json:"source"`
	Executor      string                `json:"executor"`
	Target        string                `json:"target"`
	Provenance    string                `json:"provenance"`
	Workspace     string                `json:"-"`
	ProtocolCwd   string                `json:"protocolCwd,omitempty"`
	Home          string                `json:"-"`
	Config        string                `json:"-"`
	Tmp           string                `json:"-"`
	HistorySeed   string                `json:"-"`
	HistoryFiles  map[string]string     `json:"historyFiles,omitempty"`
	Env           map[string]string     `json:"-"`
	RuntimeEnv    map[string]string     `json:"-"`
	Connections   []ExecutionConnection `json:"connections"`
	ArtifactRoot  string                `json:"-"`
	Artifact      corpus.Material       `json:"artifact"`
	Admission     *Admission            `json:"admission,omitempty"`
	Limits        Limits                `json:"limits"`
	ProgressFD    int                   `json:"progressFd,omitempty"`
	StartedAt     string                `json:"startedAt"`
	// contains filtered or unexported fields
}

func ReadExecution added in v0.2.0

func ReadExecution(fixtureDir string, fixture *Fixture, path string) (*Execution, error)

ReadExecution reads and resolves one execution descriptor without accepting persisted machine-local layout.

func (Execution) MarshalJSON added in v0.2.0

func (e Execution) MarshalJSON() ([]byte, error)

func (*Execution) Resolve added in v0.2.0

func (e *Execution) Resolve(fixture *Fixture, fixtureDir string) error

Resolve derives execution layout from the fixture root and execution ID, and resolves every persisted relative reference.

func (*Execution) UnmarshalJSON added in v0.2.0

func (e *Execution) UnmarshalJSON(data []byte) error

func (Execution) Validate

func (e Execution) Validate(f Fixture) error

type ExecutionConnection

type ExecutionConnection struct {
	ID              string   `json:"id"`
	Transport       string   `json:"transport"`
	Command         string   `json:"-"`
	Args            []string `json:"-"`
	Launcher        string   `json:"-"`
	Material        string   `json:"-"`
	MaterialID      string   `json:"materialId,omitempty"`
	PlanSHA256      string   `json:"planSHA256,omitempty"`
	ManifestSHA256  string   `json:"manifestSHA256,omitempty"`
	RecordingSHA256 string   `json:"recordingSHA256,omitempty"`
	Receipt         string   `json:"receipt"`
	ProcessReceipt  string   `json:"processReceipt,omitempty"`
}

func (*ExecutionConnection) UnmarshalJSON

func (c *ExecutionConnection) UnmarshalJSON(data []byte) error

type ExecutionReport

type ExecutionReport struct {
	FixtureID       string
	ExecutionID     string
	Status          ExecutionStatus
	Complete        bool
	Material        corpus.Material
	ExecutionSHA256 string
	ExecutionPath   string
	Connections     []ConnectionReport
}

ExecutionReport is the validated terminal snapshot returned with a mock connection result. It covers every connection declared by the execution.

func ReadMockExecutionReport

func ReadMockExecutionReport(fixtureDir, executionID string) (*ExecutionReport, error)

type ExecutionStatus

type ExecutionStatus string

ExecutionStatus is the durable result of all declared connections in one action execution.

const (
	ExecutionStatusUnknown ExecutionStatus = "unknown"
	ExecutionStatusRunning ExecutionStatus = "running"
	ExecutionStatusOpen    ExecutionStatus = "open"
	ExecutionStatusPassed  ExecutionStatus = "passed"
	ExecutionStatusFailed  ExecutionStatus = "failed"
)

type FailureClass

type FailureClass string

FailureClass is the machine-readable terminal reason for an action.

const (
	FailureClassCanceled     FailureClass = "canceled"
	FailureClassAborted      FailureClass = "aborted"
	FailureClassTransport    FailureClass = "transport"
	FailureClassStrictReplay FailureClass = "strict-replay"
	FailureClassTimeout      FailureClass = "timeout"
	FailureClassCleanup      FailureClass = "cleanup"
	FailureClassInternal     FailureClass = "internal"
)

func ContextFailureClass

func ContextFailureClass(err error) FailureClass

ContextFailureClass maps caller-context termination to the terminal class used by mock evidence.

func FailureClassOf

func FailureClassOf(err error) FailureClass

FailureClassOf returns the first terminal class carried by an error tree.

type Fixture

type Fixture struct {
	SchemaVersion    int               `json:"schemaVersion"`
	FixtureID        string            `json:"fixtureId"`
	Tool             ToolIdentity      `json:"tool"`
	AgentType        string            `json:"agentType"`
	Source           Source            `json:"source"`
	HistorySeed      string            `json:"-"`
	HistorySeedFiles map[string]string `json:"historySeedFiles,omitempty"`
	ResourceRoot     string            `json:"-"`
	Workspace        string            `json:"-"`
	Home             string            `json:"-"`
	Config           string            `json:"-"`
	Tmp              string            `json:"-"`
	ProtocolCwd      string            `json:"protocolCwd,omitempty"`
	Env              map[string]string `json:"-"`
	Routes           map[string]Route  `json:"routes"`
	Limits           Limits            `json:"limits"`
	// contains filtered or unexported fields
}

func OpenFixture

func OpenFixture(fixtureDir string) (*Fixture, error)

func Prepare

func Prepare(o PrepareOptions) (*Fixture, error)

Prepare creates a caller-owned fixture directory containing its runtime baseline. It never starts a client, SDK, driver or native Agent.

func (Fixture) MarshalJSON added in v0.2.0

func (f Fixture) MarshalJSON() ([]byte, error)

func (*Fixture) Resolve added in v0.2.0

func (f *Fixture) Resolve(fixtureDir string) error

Resolve derives every fixed-layout location from the caller-supplied fixture root and validates persisted relative references.

func (*Fixture) UnmarshalJSON added in v0.2.0

func (f *Fixture) UnmarshalJSON(data []byte) error

func (Fixture) Validate

func (f Fixture) Validate() error

type Index

type Index struct {
	SchemaVersion  int               `json:"schemaVersion"`
	FixtureID      string            `json:"fixtureId"`
	FixtureSHA256  string            `json:"fixtureSha256"`
	Executions     []IndexExecution  `json:"executions"`
	Artifacts      []corpus.Material `json:"-"`
	Descriptorless map[string]bool   `json:"-"`
	LastUpdatedUTC string            `json:"lastUpdatedUtc"`
}

type IndexConnection

type IndexConnection struct {
	ID     string `json:"id"`
	Status string `json:"status"`
}

type IndexExecution

type IndexExecution struct {
	MaterialID       string            `json:"materialId"`
	Publishing       *Publication      `json:"publishing,omitempty"`
	ID               string            `json:"id"`
	Command          string            `json:"command"`
	DescriptorSHA256 string            `json:"descriptorSHA256"`
	Status           string            `json:"status"`
	ArtifactID       string            `json:"artifactId,omitempty"`
	StartedAt        string            `json:"startedAt"`
	UpdatedAt        string            `json:"updatedAt"`
	Connections      []IndexConnection `json:"connections,omitempty"`
}

type Limits

type Limits struct {
	TimeoutNS     int64 `json:"timeoutNs,omitempty"`
	ProtocolBytes int64 `json:"protocolBytes,omitempty"`
	StderrBytes   int64 `json:"stderrBytes,omitempty"`
	MaxFrames     int64 `json:"maxFrames,omitempty"`
	MaxFrameBytes int64 `json:"maxFrameBytes,omitempty"`
}

type Lock

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

func (*Lock) Close

func (l *Lock) Close() error

func (*Lock) Downgrade

func (l *Lock) Downgrade() error

type MaterialIndex

type MaterialIndex struct {
	SchemaVersion  int               `json:"schemaVersion"`
	FixtureID      string            `json:"fixtureId"`
	Materials      []corpus.Material `json:"materials"`
	Descriptorless []string          `json:"descriptorless,omitempty"`
}

MaterialIndex is the immutable-material registry; current.json alone selects the input for actions. Execution bookkeeping never selects a material.

type MockContext

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

MockContext is a read-only snapshot of transaction-owned state.

func (MockContext) Artifact

func (c MockContext) Artifact() corpus.Material

func (MockContext) ArtifactRoot

func (c MockContext) ArtifactRoot() string

func (MockContext) Connection

func (c MockContext) Connection() string

func (MockContext) ConnectionReceipt

func (c MockContext) ConnectionReceipt() string

func (MockContext) Execution

func (c MockContext) Execution() Execution

func (MockContext) ExecutionDir

func (c MockContext) ExecutionDir() string

func (MockContext) Fixture

func (c MockContext) Fixture() Fixture

func (MockContext) FixtureDir

func (c MockContext) FixtureDir() string

func (MockContext) MaterialReference added in v0.2.0

func (c MockContext) MaterialReference() string

MaterialReference is relative to the owning package.

func (MockContext) OverlayRoot

func (c MockContext) OverlayRoot() string

func (MockContext) Plan

func (c MockContext) Plan() tool.Object

func (MockContext) ProcessReceipt

func (c MockContext) ProcessReceipt() string

func (MockContext) Workspace

func (c MockContext) Workspace() string

type MockPolicy

type MockPolicy interface {
	Replay(context.Context, MockContext) error
}

MockPolicy supplies replay for one connection. The transaction owns every lock, index transition, route, receipt, notification, and closure step.

type MockRequest

type MockRequest struct {
	FixtureDir  string
	Connection  string
	ExecutionID string
	NativeArgs  []string
	Timeout     time.Duration
	ProgressFD  int
	ResultFD    int
	Artifact    corpus.Material
	RequireNew  bool
}

MockRequest contains the immutable inputs shared by every connection of one mock execution.

type MockResult

type MockResult struct {
	ActionResult
	Execution *ExecutionReport
}

MockResult identifies the execution and connection completed by one mock call.

func RunMock

func RunMock(ctx context.Context, request MockRequest, policy MockPolicy) (result *MockResult, runErr error)

RunMock owns one mock connection from allocation or join through result delivery and lock release.

type MockStartedPolicy

type MockStartedPolicy interface {
	MockPolicy
	Started(context.Context, MockContext) error
}

MockStartedPolicy optionally observes the claimed connection after running evidence is durable and before protocol replay starts.

type MockTransport

type MockTransport string

MockTransport distinguishes process and in-process mock connections.

const (
	MockTransportInProcess MockTransport = "in-process"
	MockTransportProcess   MockTransport = "process"
)

type OfficialRun

type OfficialRun struct {
	ID, Dir, FixtureDir string
	Fixture             *Fixture
	// contains filtered or unexported fields
}

OfficialRun owns orchestration activity, never a protocol execution or overlay. The action lock is held only while registering, so SDK children can start.

func BeginOfficial

func BeginOfficial(fixtureDir, mode string) (*OfficialRun, error)

func (*OfficialRun) AuthorizeRecord

func (r *OfficialRun) AuthorizeRecord(driverHash string, ids []string) (map[string]string, error)

AuthorizeRecord supplies launch-only context to the existing supervisor. The driver receives no capability; the child must also prove its supervisor PID.

func (*OfficialRun) Complete

func (r *OfficialRun) Complete(result tool.Object) error

Complete is called only after owned processes and final evidence are settled.

func (*OfficialRun) RestoreMockRoute

func (r *OfficialRun) RestoreMockRoute() error

RestoreMockRoute settles the ordinary shared route only after all protocol owners release it. Official verification owns no separate execution overlay.

func (*OfficialRun) TrackProcess

func (r *OfficialRun) TrackProcess(name, state string, pid int) error

Launch intent is durable before Start. A crash between Start and registration leaves an unknown process, so recovery must remain busy instead of guessing.

func (*OfficialRun) WaitDriver

func (r *OfficialRun) WaitDriver(ctx context.Context, cmd *exec.Cmd) error

type PrepareOptions

type PrepareOptions struct {
	FixtureDir       string
	Agent            string
	Case             string
	Plan             string
	Recording        string
	Model            string
	InitialModel     string
	HistorySeed      string
	ProtocolBytes    int64
	StderrBytes      int64
	MaxFrames        int64
	MaxFrameBytes    int64
	EmbeddedTool     bool
	EmbeddedIdentity *version.EmbeddedIdentity
}

type Publication added in v0.2.0

type Publication struct {
	MaterialID         string `json:"materialId"`
	ExecutionID        string `json:"executionId"`
	PreviousMaterialID string `json:"previousMaterialId,omitempty"`
	MaterialSHA256     string `json:"materialSHA256"`
	ManifestSHA256     string `json:"manifestSHA256"`
	Source             string `json:"source"`
	Staging            string `json:"staging"`
	Target             string `json:"target"`
}

Publication is the explicit control journal for the only material move and atomic current replacement. Paths are relative to its identified package.

type RecordContext

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

RecordContext is a read-only snapshot of transaction-owned state.

func (RecordContext) Artifact

func (c RecordContext) Artifact() corpus.Material

func (RecordContext) ArtifactRoot

func (c RecordContext) ArtifactRoot() string

func (RecordContext) Connection

func (c RecordContext) Connection() string

func (RecordContext) ConnectionReceipt

func (c RecordContext) ConnectionReceipt() string

func (RecordContext) Execution

func (c RecordContext) Execution() Execution

func (RecordContext) ExecutionDir

func (c RecordContext) ExecutionDir() string

func (RecordContext) Fixture

func (c RecordContext) Fixture() Fixture

func (RecordContext) FixtureDir

func (c RecordContext) FixtureDir() string

func (RecordContext) IsOfficialCapture

func (c RecordContext) IsOfficialCapture() bool

func (RecordContext) MaterialReference added in v0.2.0

func (c RecordContext) MaterialReference() string

MaterialReference is relative to the owning package.

func (RecordContext) OverlayRoot

func (c RecordContext) OverlayRoot() string

func (RecordContext) Plan

func (c RecordContext) Plan() tool.Object

func (RecordContext) ProcessReceipt

func (c RecordContext) ProcessReceipt() string

func (RecordContext) Workspace

func (c RecordContext) Workspace() string

type RecordPolicy

RecordPolicy supplies action-specific behavior. The transaction owns every lock, index transition, route, receipt, notification, and publication step.

type RecordProbeTracker

type RecordProbeTracker func(state string, pid int) error

RecordProbeTracker records native process state during official preparation. The transaction supplies it separately so RecordContext remains read-only.

type RecordRequest

type RecordRequest struct {
	FixtureDir string
	Connection string
	Args       []string
	NativeArgs []string
	Timeout    time.Duration
	Target     string
	ResultFD   int
}

RecordRequest contains the immutable inputs shared by every connection of one record execution.

type RecordResult

type RecordResult struct {
	ActionResult
}

RecordResult identifies the execution and connection completed by one record call and, on success, the newly selected material.

func RunRecord

func RunRecord(ctx context.Context, request RecordRequest, policy RecordPolicy) (callResult *RecordResult, runErr error)

RunRecord owns one record connection from allocation or join through result delivery and lock release.

type Route

type Route struct {
	Enabled     bool                 `json:"enabled"`
	Executor    string               `json:"executor"`
	Target      string               `json:"target"`
	Provenance  string               `json:"provenance"`
	Workspace   string               `json:"-"`
	ProtocolCwd string               `json:"protocolCwd,omitempty"`
	Env         map[string]string    `json:"-"`
	RuntimeEnv  []string             `json:"runtimeEnv,omitempty"`
	Connections []ConnectionTemplate `json:"connections"`
}

func ResolveRoute added in v0.2.0

func ResolveRoute(fixture *Fixture, action string) (Route, error)

ResolveRoute is shared by public Go runtime objects and private CLI snapshots. Callers coordinate the complete SDK host lifetime before reading either view.

type Source

type Source struct {
	Kind          string `json:"kind"`
	ID            string `json:"id,omitempty"`
	Path          string `json:"path,omitempty"`
	SHA256        string `json:"sha256"`
	Provenance    string `json:"provenance"`
	DriverProfile string `json:"driverProfile,omitempty"`
}

type ToolIdentity

type ToolIdentity struct {
	Source         ToolSource `json:"source"`
	Version        string     `json:"version"`
	Command        string     `json:"-"`
	Args           []string   `json:"-"`
	SHA256         string     `json:"sha256,omitempty"`
	Module         string     `json:"module,omitempty"`
	ModuleSum      string     `json:"moduleSum,omitempty"`
	ModuleRevision string     `json:"moduleRevision,omitempty"`
	ModuleTime     string     `json:"moduleTime,omitempty"`
	GoVersion      string     `json:"goVersion,omitempty"`
}

ToolIdentity is executable or embedded identity. A machine-local executable path is resolved from the running tool and verified against the recorded SHA-256; it is never part of the persisted control plane.

func (ToolIdentity) MarshalJSON added in v0.2.0

func (t ToolIdentity) MarshalJSON() ([]byte, error)

func (*ToolIdentity) Resolve added in v0.2.0

func (t *ToolIdentity) Resolve(fixtureDir string) error

Resolve derives the tool's executable path and verifies that it still matches the recorded identity. A CLI records its runtime launch binding so a library host can still open the fixture with the exact recorded binary.

func (*ToolIdentity) UnmarshalJSON added in v0.2.0

func (t *ToolIdentity) UnmarshalJSON(data []byte) error

func (ToolIdentity) Validate

func (t ToolIdentity) Validate() error

type ToolSource

type ToolSource string

Jump to

Keyboard shortcuts

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