Documentation
¶
Overview ¶
Package sessionlaunch owns the fixed target-side harness launch boundary. Request data selects only one closed harness specification; it never becomes a shell program or executable name.
Index ¶
- Constants
- Variables
- func NormalizeModel(model string) string
- func NormalizeRuntime(sourceRuntime, requested string) (string, error)
- func PreflightLocal(sourceRuntime string) error
- func RunPrivateLauncher(args []string) int
- func ValidateHarnessSelection(sourceRuntime, requested string) error
- type AttemptFailureError
- type BeforeRelease
- type FailureEvidence
- type HarnessSpec
- type Options
- type Prepared
- type PreparedEvidence
- type Result
Constants ¶
const ( RuntimeCodex = "codex" RuntimeClaudeCode = "claude-code" )
const PrivateLauncherArgument = "--wb-internal-session-launch"
Variables ¶
var ErrNotReleased = errors.New("successor launcher is not released")
ErrNotReleased is the only recovery-safe absence signal. Inspect returns it only when no immutable launch/release exists; missing artifacts after a release remain hard errors and must never fall back to Git replay.
var ErrRetryableLaunch = errors.New("successor launcher has an exactly retryable terminal attempt")
ErrRetryableLaunch means Inspect proved that the latest released attempt has exact terminal failure evidence, a dead PID, and no tmux session. Receive may route this one outcome to Start without touching Git; Start rechecks all gates.
Functions ¶
func NormalizeModel ¶ added in v0.132.0
func NormalizeRuntime ¶ added in v0.132.0
NormalizeRuntime maps spoken harness names to the closed launch runtimes. Empty requested keeps the source runtime. "claude" and "claude-code" both select Claude Code; "codex" selects Codex.
func PreflightLocal ¶ added in v0.67.4
PreflightLocal verifies the fixed local launcher dependencies without creating a launch plan, claiming a resume route, or changing custody.
func RunPrivateLauncher ¶
RunPrivateLauncher is the early-dispatch child started only through the receiver's fixed tmux argv. It registers the preallocated WB identity on its own PID, publishes readiness, waits for the receiver's immutable release, and then replaces itself with the fixed harness executable.
Types ¶
type AttemptFailureError ¶
type AttemptFailureError struct {
Evidence FailureEvidence
}
AttemptFailureError carries exact immutable post-release failure proof.
func (*AttemptFailureError) Error ¶
func (failure *AttemptFailureError) Error() string
type BeforeRelease ¶
BeforeRelease is the Task 5 custody seam. It prepares the successor-owned Work Log before the wrapper is allowed to Exec and returns the durable target Work Log reference that the immutable release must bind to this exact PID.
type FailureEvidence ¶
type FailureEvidence struct {
HandoffID string
RequestDigest sessionmove.Digest
AttemptID string
AttemptIndex uint64
PID int
StartedAt time.Time
FailedAt time.Time
TargetWorkLogReference string
Diagnostic string
// contains filtered or unexported fields
}
FailureEvidence is descriptor-validated immutable launcher evidence for one released attempt. Receivers use it to append Work Log failure lineage without parsing error text or guessing a PID/attempt identity.
func (FailureEvidence) Authenticates ¶
func (e FailureEvidence) Authenticates(handoffID string, digest sessionmove.Digest, targetWorkLogReference string) bool
Authenticates reports whether this value was constructed from descriptor- validated Task4 artifacts and binds the supplied external custody identity.
type HarnessSpec ¶
type Options ¶
type Options struct {
Store sessionmove.Store
ProjectsRoot string
Request sessionmove.Request
RequestDigest sessionmove.Digest
WorktreeDir string
PinnedCommit string
ExecutionLock *sessionmove.ExecutionLock
// Authority/StoreRoot/Fence are the protocol-neutral path used by parked
// bundles. Existing session-move callers leave them zero and are adapted
// byte-for-byte from Request, Store, and ExecutionLock.
Authority *sessionauthority.Launch
StoreRoot string
Fence sessionauthority.Fence
BeforeRelease BeforeRelease
}
type Prepared ¶
type Prepared struct {
Request sessionmove.Request
RequestDigest sessionmove.Digest
Authority sessionauthority.Launch
Session session.Record
AttemptID string
AttemptIndex uint64
WorktreeDir string
PinnedCommit string
}
type PreparedEvidence ¶
type PreparedEvidence struct {
HandoffID string
RequestDigest sessionmove.Digest
AttemptID string
AttemptIndex uint64
PID int
StartedAt time.Time
// contains filtered or unexported fields
}
PreparedEvidence is the narrow recovery identity for a launcher that durably published exact ready/process artifacts but may not yet have a release. It authorizes only that attempt ID at an external custody barrier; Start still decides whether the same wrapper can release or must be replaced.
func InspectPrepared ¶
func InspectPrepared(ctx context.Context, options Options) (PreparedEvidence, error)
InspectPrepared authenticates the most recent descriptor-bound ready attempt when no launch has been released. It never declares success and never chooses retry policy; Start performs the live-wrapper/abandonment checks again while holding the same aggregate fence.
func (PreparedEvidence) Authenticates ¶
func (e PreparedEvidence) Authenticates(handoffID string, digest sessionmove.Digest) bool
type Result ¶
type Result struct {
HandoffID string `json:"handoff_id"`
WBSessionID string `json:"wb_session_id"`
PredecessorWBSessionID string `json:"predecessor_wb_session_id"`
TargetMachine string `json:"target_machine"`
PID int `json:"pid"`
AttemptID string `json:"attempt_id"`
AttemptIndex uint64 `json:"attempt_index"`
TmuxName string `json:"tmux_name"`
Runtime string `json:"runtime"`
Model string `json:"model,omitempty"`
NativeHarnessID string `json:"native_harness_id,omitempty"`
TargetWorkLogRef string `json:"target_work_log_ref,omitempty"`
WorktreeDir string `json:"worktree_dir"`
PinnedCommit string `json:"pinned_commit"`
StartedAt time.Time `json:"started_at"`
Reused bool `json:"reused"`
}