Documentation
¶
Overview ¶
Package portable selects an explicitly registered installed runtime. Setup publishes locators after the kernel consumer commit; launch never writes.
Index ¶
- Constants
- Variables
- func ExactCommittedBinding(ledger installruntime.Ledger, b Binding) bool
- func ExactLocator(b Binding) (bool, error)
- func InstalledGlobalConfig(ledger installruntime.Ledger, installationID, controlRoot string) (string, bool, error)
- func InstalledPrimary(ledger installruntime.Ledger, installationID, controlRoot string) (string, bool, error)
- func ParseArgs(args []string) (string, error)
- func PlatformPrimary() string
- func Publish(b Binding) (string, error)
- func ResolvePrimaryExecutable(ledger installruntime.Ledger, primary string) (string, error)
- func RevokeLocator(b Binding) error
- func SameInstalledFile(current, installed string) bool
- func ValidateGlobalConfigParent(path string) error
- type Binding
- type Integration
- type Lease
Constants ¶
const MaxBytes = 16384
Variables ¶
var ErrInvalid = errors.New("portable_binding_invalid")
Functions ¶
func ExactCommittedBinding ¶ added in v1.45.3
func ExactCommittedBinding(ledger installruntime.Ledger, b Binding) bool
ExactCommittedBinding validates one consumer without checking the executable.
func ExactLocator ¶ added in v1.45.3
ExactLocator returns true only for the private, byte-identical locator. A missing locator is allowed during a resumed revoke.
func InstalledGlobalConfig ¶ added in v1.45.3
func InstalledGlobalConfig(ledger installruntime.Ledger, installationID, controlRoot string) (string, bool, error)
InstalledGlobalConfig preserves the config path in a published locator. Changing it changes the consumer key, so existing bindings must keep it until an explicit migration replaces their locator and consumer together.
func InstalledPrimary ¶ added in v1.45.2
func InstalledPrimary(ledger installruntime.Ledger, installationID, controlRoot string) (string, bool, error)
InstalledPrimary preserves the identity of an already committed installation. In particular, old locators used "primary" even though bootstrap never wrote that file. A later add/update/remove must not silently change their identity.
func PlatformPrimary ¶ added in v1.45.2
func PlatformPrimary() string
PlatformPrimary is the regular writer installed by the release bootstrap. Keep the slash-separated locator value independent of the host path separator.
func Publish ¶
Publish writes the exact locator after the kernel consumer already exists. Identical bytes are a no-op; a conflicting file fails closed.
func ResolvePrimaryExecutable ¶ added in v1.45.2
func ResolvePrimaryExecutable(ledger installruntime.Ledger, primary string) (string, error)
ResolvePrimaryExecutable selects a live, ledger-owned writer for setup. Old bindings retain the logical "primary" identity even when that filename was never installed; their helper must use the same owned fallback as launch.
func RevokeLocator ¶
func SameInstalledFile ¶
SameInstalledFile is true when current and installed name the same regular file. Darwin /var vs /private/var aliases compare equal; a copy does not.
func ValidateGlobalConfigParent ¶ added in v1.45.3
ValidateGlobalConfigParent applies launch's read-only parent check during setup, before a binding can be published.
Types ¶
type Binding ¶
type Binding struct {
Version int `json:"version"`
Integration Integration `json:"integration"`
InstallationID string `json:"installationID"`
BindingID string `json:"bindingID"`
ScopeID string `json:"scopeID"`
ComponentID string `json:"componentID"`
Owner string `json:"owner"`
ScopeRoot string `json:"scopeRoot"`
DataRoot string `json:"dataRoot"`
ControlRoot string `json:"controlRoot"`
GlobalConfig string `json:"globalConfig"`
RuntimeRoot string `json:"runtimeRoot"`
Primary string `json:"primary"`
}
Binding is immutable consumer identity. Generation is deliberately excluded: independent consumer updates must not invalidate surviving bindings. The installed snapshot and lease fence current generation at each launch.
func CommittedBindingVariants ¶ added in v1.45.3
func CommittedBindingVariants(ledger installruntime.Ledger, expected Binding) ([]Binding, error)
CommittedBindingVariants is for a controlled transition that temporarily holds the old and replacement consumer for the same UAP binding.
func ResolveCommittedBinding ¶ added in v1.45.3
ResolveCommittedBinding selects the exact historical consumer for a UAP binding. GlobalConfig and Primary may differ from the current defaults: both are part of the registered bytes and must come from the ledger on removal. All other fields are fixed by the UAP receipt and the managed installation.
func (Binding) CheckPrimaryFile ¶ added in v1.45.2
func (b Binding) CheckPrimaryFile(snapshot installruntime.InstalledSnapshot) error
CheckPrimaryFile is used before a new binding is committed. It does not require its consumer record yet, but it requires a live, ledger-owned writer.
func (Binding) CheckSnapshot ¶
func (b Binding) CheckSnapshot(snapshot installruntime.InstalledSnapshot) error
CheckSnapshot keeps an already-running portable service bound to the current consumer on every policy read. Revocation does not require deleting shared data.
func (Binding) Registration ¶
Registration returns the exact consumer record the next setup slice must commit under the component lock/CAS before publishing locator bytes. Calling this pure function does not establish UAP receipt ownership or authorize setup.
type Integration ¶
type Integration string
const ( Codex Integration = "codex" Claude Integration = "claude" )