sessioncustody

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package sessioncustody owns source-side receipt acknowledgement. Couriers deliver WB protocol values; this package alone seals predecessor custody.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks

type Hooks struct {
	AfterLock      func() error
	AfterReceipt   func() error
	AfterAddress   func() error
	AfterSeal      func() error
	AfterCompleted func() error
}

Hooks are deterministic failure-injection seams at durable boundaries. Production callers leave them empty.

type Options

type Options struct {
	Store             sessionmove.Store
	ProjectsRoot      string
	Request           sessionmove.Request
	RequestDigest     sessionmove.Digest
	Receipt           sessionmove.Receipt
	SourceSession     session.Record
	Now               func() time.Time
	EnsureSourceOffer func(worktrees.ExternalSourceOfferOptions) (worktrees.ExternalSourceOfferResult, error)
	SealWorkLog       func(worktrees.ExternalSourceSealOptions) (worktrees.ExternalSourceSealResult, error)
	Hooks             Hooks
}

Options supplies an already delivered receipt and the exact source aggregate. A zero Receipt is accepted only when the exact local receipt was persisted by an earlier ambiguous attempt; this package never calls a courier.

type Result

type Result struct {
	Receipt sessionmove.Receipt                `json:"receipt"`
	Address sessionmove.SuccessorAddress       `json:"successor_address"`
	WorkLog worktrees.ExternalSourceSealResult `json:"work_log"`
	Replay  bool                               `json:"replay"`
}

Result reports converged source custody and the stable successor address.

func Acknowledge

func Acknowledge(ctx context.Context, options Options) (Result, error)

Acknowledge persists proof before sealing source custody. Every step is replayed in the same order so a crash repairs only missing downstream evidence: receipt -> successor address -> Work Log terminal -> completed.

Jump to

Keyboard shortcuts

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