Documentation
¶
Index ¶
- Constants
- Variables
- func AdoptRetiredChannel(ctx context.Context, request map[string]any) (bool, error)
- func ArmCompletion(ctx context.Context, projectRoot string) (string, error)
- func BackupExisting(paths []string) ([]string, error)
- func BlobID(data []byte, like string) string
- func BootLaunch(ctx context.Context, root string, args []string) (int, bool)
- func BootRecordPath(ctx context.Context, projectRoot string) string
- func ChannelRecord(cfg any, projectRoot string) map[string]any
- func CheckForUpdates(ctx context.Context, opts SourceCheckOptions) (*pyjson.Object, error)
- func CheckMacosFullDiskAccess(w io.Writer) error
- func CheckRuntime(ctx context.Context, projectRoot string) (string, error)
- func CheckoutContains(ctx context.Context, sha string) (bool, error)
- func ClassifyFetchFailure(detail string) string
- func CleanupQuarantinedExes(ctx context.Context, root, scriptsDir string)
- func ClearCompletion(ctx context.Context, root string) error
- func CmdSecurityAudit(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func CmdUpdate(ctx context.Context, u UpdateInvocation) (int, error)
- func CmdUpdateTakeover(ctx context.Context, ns map[string]any, w io.Writer) (int, error)
- func CollectFleetVersions(preRestartPIDs []int, selfRestartPending []int) []*pyjson.Object
- func CompareVersions(a, b string) int
- func CompleteSourceCheckout(ctx context.Context, root string, o SourceCompletion) (bool, error)
- func CompletionPendingPath(ctx context.Context, projectRoot string) string
- func CompletionRetryState(ctx context.Context, projectRoot string, now func() float64) (bool, *big.Int, int64)
- func CurrentInstallIdentity(ctx context.Context, projectRoot string) string
- func DefaultChannel(projectRoot string) (string, error)
- func DescribeActiveWorkUnit(ctx context.Context, unit any, h string) (string, error)
- func DescribeRestartMechanism(mechanism, profile string) string
- func DispatchCustodyLauncher()
- func DoctorCheckConfigFile(ctx context.Context, h, projectRoot string, shouldFix bool, w io.Writer) (int, error)
- func EnsureWindowsBinLaunchers(root string, windows *bool, userPathEntries []string) []string
- func ExposePMGit(ctx context.Context, projectRoot string) error
- func FallbackCheckCommand(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func GatewayDebugLocalReport(ctx context.Context) (string, error)
- func GatewayDebugUploadReply(ctx context.Context) (string, error)
- func GitCount(ctx context.Context, args []string, root string) (int64, bool)
- func GitOperationInProgress(root string) (string, error)
- func GitStdout(args []string, root string) string
- func GitStdoutWithin(ctx context.Context, args []string, root string, timeout time.Duration) (string, bool)
- func GitlockRunGit(ctx context.Context, gitCmd, args []string, o pysubprocess.Options) (*pysubprocess.Completed, error)
- func HandleMetadataArgs(ctx context.Context, stdout io.Writer, installIDFlag bool, setChannel *string, ...) (bool, error)
- func ImportHealthMain(argv []string, stdout io.Writer) int
- func InstallID(projectRoot string) string
- func IsCanaryTag(tag any) bool
- func IsCommitBuild(projectRoot string) bool
- func IsObjectID(value string) bool
- func IsValueError(err error) bool
- func LegacyPostSwapMain(ctx context.Context, handoffPath string, argvTail []string, stderr io.Writer) int
- func MaybeRunBootBootstrap(ctx context.Context, projectRoot string)
- func NeedsBootstrap(ctx context.Context, projectRoot string) string
- func PassiveCheckForUpdates(ctx context.Context, installRoot, home string) (*pyjson.Object, error)
- func PopenPostCommit(ctx context.Context, argv []string, label string, opts ChildOptions) (*exec.Cmd, error)
- func PrepareLaunch(ctx context.Context, projectRoot string, argv []string) (string, error)
- func PrintFleetVersionMatrix(fleet []*pyjson.Object) bool
- func QuarantineStampMS(name string) (int64, bool)
- func ReadGitHead(ctx context.Context, root string) string
- func ReadLastKnown(path string) map[string]any
- func RecoverPausedGateways(ctx context.Context, argv []string)
- func RecoveryClosureDirOf(root, pre string) (string, error)
- func RecoveryClosureVerified(closure, pre string) bool
- func RedactDebugSupportText(value any) string
- func RedactDebugSupportTextCapped(value any, maxChars int) string
- func RefuseForeignOwnedVenv(ctx context.Context, projectRoot string) error
- func RelaunchAfterRestore(argv []string) int
- func RelaunchCommand(binary string, argv []string) []string
- func ResolveUpdateChannel(cfg any, projectRoot string) (string, error)
- func RestoreInterruptedPull(ctx context.Context, projectRoot string, afterFailure bool) bool
- func RestoreInterruptedZipSwap(root string, stream io.Writer) bool
- func RestoreQuarantinedShims(moved [][2]string, stream io.Writer, backoffMS []int) [][2]string
- func RidesDefaultChannel(record map[string]any, channel, projectRoot string) (bool, error)
- func RunBootBootstrap(ctx context.Context, projectRoot string) (map[string]any, error)
- func RunDebug(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func RunDoctor(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func RunDump(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func RunPostUpdateMaintenance(ctx context.Context, o PostUpdateMaintenance) (bool, error)
- func RunSteps(ctx context.Context, steps []PostUpdateStep) map[string]map[string]any
- func SealedSteward(projectRoot string) *string
- func SetHolderValueFlags(source func() []string)
- func SetInstallChannel(ctx context.Context, channel, projectRoot string) (string, error)
- func ShowStatus(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func SourceCompletionMain(ctx context.Context, argv []string, stdout, stderr io.Writer) int
- func SourceUpdateChannel(ctx context.Context, pinned bool, transient *string, projectRoot string) (string, error)
- func StepAdoptBlessedCheckout(ctx context.Context, projectRoot string) (map[string]any, error)
- func StepDropLivePluginCatalog(ctx context.Context) (map[string]any, error)
- func StepExposeCLI(ctx context.Context) (map[string]any, error)
- func StepMigrateConfig(ctx context.Context) (map[string]any, error)
- func StepStateDBGuard(ctx context.Context) (map[string]any, error)
- func StewardUninstallMessage(steward string) string
- func StewardUpdateMessage(steward string) string
- func SweepExpiredPastes(ctx context.Context, now *float64) (int, int, error)
- func SweepStaleBytecodeIfCheckoutChanged()
- func TakeRelaunchMarker(args []string) []string
- func UpdateCompletionMain(ctx context.Context, args []string, stdout, stderr io.Writer) int
- func UpdateFinishMain(ctx context.Context, contextPath, resultPath string, stdout, stderr io.Writer) int
- func UpdateInternalCommand(argv []string) bool
- func UpdateRestartRecoveryMain(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) int
- func ValidateChannelName(value any) (string, error)
- func VenvSyncMain(ctx context.Context, argv []string, stdout, stderr io.Writer) int
- func WarnPendingFleetRestartOnStartup(ctx context.Context, h string, w io.Writer)
- func WithRetryingReads(ctx context.Context) context.Context
- func WriteDurableText(path, text string) error
- func WriteSourceStamp(root string, adopted bool) (*pyjson.Object, error)
- func WriteZipSwapJournal(root, phase string, entries []any, gen string, temps map[string]string) error
- func ZipEntryIdentity(path string, filling bool) string
- type CalledProcessError
- type ChannelError
- type ChannelNotFound
- type ChannelOpener
- type ChannelReader
- type ChannelResolution
- type ChildOptions
- type CompletedProcess
- type Contained
- type DebugShareResult
- type Doctor
- type Finding
- type ImageProvenance
- type KeyError
- type LogSnapshot
- type PauseRefused
- type PostUpdateMaintenance
- type PostUpdateStep
- type RecordLock
- type RuntimeRecord
- type ServicePauseFailed
- type SourceCheckOptions
- type SourceCompletion
- type SourceTarget
- type StaleChannelRecord
- type TidyResult
- type UpdateInvocation
- type UpdatePlan
- type UpdateRefusal
- type UpstreamTargetBroken
- type ValueError
- type VenvSyncResult
- type ZipSwapLock
Constants ¶
const ( ChannelMain = "main" ChannelStable = "stable" ChannelCanary = "canary" )
const ( // Hidden first arguments a main or TestMain routes to the custody launchers through DispatchCustodyLauncher CustodyReapEntry = "__icebath_custody_reap__" CustodyCustodianEntry = "__icebath_custody_custodian__" CustodyJoinEntry = "__icebath_custody_join__" )
const ( RecoveryClosureManifest = "MANIFEST" RecoveryClosureInit = "icebath_cli/__init__.py" )
const ( StewardDocker = "docker" StewardNix = "nix" StewardAptTermux = "apt-termux" StewardHomebrew = "homebrew" StewardScoop = "scoop" StewardWinGet = "winget" StewardDpkg = "dpkg" StewardRPM = "rpm" StewardPacman = "pacman" StewardApk = "apk" StewardChoco = "chocolatey" StewardPip = "pip" )
const ( SourceCompletionEntry = "source-completion" UpdateCompletionEntry = "update-completion" )
Hidden entries that run the completion tails, each a tail process identity
const BootstrapReceipt = ".icebath-bootstrap-complete"
Installers' receipt file a published checkout identity moves with it
const CommitBuildUpdateMessage = "This build doesn't get updates. Ask the developer who gave it to you for a new build."
const CompletionRetryBackoffAttempts = 2
Relaunch driven completion retries back off after this many consecutive failures
const CompletionRetryBackoffSeconds = 15 * 60
Seconds a backed off completion tail waits before it runs again
const CompletionRetryMaxAttempts = 6
Consecutive completion failures after which a launch leaves the tail to an explicit update
const DebugGatewayPrivacyNotice = "⚠️ **Privacy notice:** This uploads system info + recent log tails " +
"(may contain conversation fragments) to a public paste service. " +
"Full logs are NOT included from the gateway — use `icebath debug share` " +
"from the CLI for full log uploads.\n" +
"Pastes auto-delete after 6 hours (dpaste.com fallback pastes: kept for " +
"1 day, cannot be deleted)."
Gateway variant of the privacy notice the debug slash command prints before it uploads
const ImportHealthEntry = pm.ImportHealthEntry
Hidden entry the install binary answers the import health probe on
const InterruptedPullMarker = pm.InterruptedPullMarker
Marker a killed update's git move leaves beside the git dir
const OfficialRepository = "nickheyer/icebath"
const RecoveryClosureDir = "icebath-update-recovery"
Directory under the git dir holding the published repair closure of a commit
const RelaunchedFlag = "--icebath-relaunched"
Hidden leading argument marking the one child a relaunch starts, never the processes it spawns
const SourceOnTermuxUpdateCommand = config.TermuxInstallCommand
const SourceOnTermuxUpdateMessage = "✗ This icebath is a source checkout running under Termux.\n" + "\n" + "Source installs are not supported on Termux — `icebath update` would\n" + "build Python packages on the device. Install icebath in a Debian userland instead:\n" + " " + config.TermuxInstallCommand
const (
StateModules = "pkg/state/*.go"
)
const (
UpdateAvailableNoCount = updaterecord.UpdateAvailableNoCount
)
const UpdateFinishEntry = "update-finish"
Hidden entry finishing an update a historical takeover prepared in the selected checkout
const UpdateRestartRecoveryEntry = "update-restart-recovery"
Hidden entry restarting supervised gateway profiles from a fresh process
const ZipSwapJournal = ".icebath-update-zip-swap"
Journal in the install root naming every entry a ZIP swap stages or renames
Variables ¶
var ( TidyBudgetSeconds = 60.0 PackCountTarget = 50 )
Tidy budget seconds and the promisor pack count the merges work down to, both patched by tests
Passive update check the banner runs, set by the updater and nil in a build without it
var BootHomeSteps = []PostUpdateStep{ {"adopt_blessed_checkout", func(ctx context.Context) (map[string]any, error) { return StepAdoptBlessedCheckout(ctx, "") }}, {"migrate_config", StepMigrateConfig}, {"state_db_guard", StepStateDBGuard}, {"drop_live_plugin_catalog", StepDropLivePluginCatalog}, {"expose_cli", StepExposeCLI}, {"install_default_plugins", defaults.StepInstall}, }
Home steps boot runs in their order, gated by the per home record, every entry point syncing skills itself
var DevNull devNull
Null device stream for ChildOptions Stdin, Stdout or Stderr
var ImageProvenancePath = "/etc/icebath/image-provenance.json"
Marker an image bakes outside the home and the checkout, a var so tests and other image builders repoint it
Installed by cmd/icebath, returns the id and name of every job in the cron store of a home in load order
var QuarantineRestoreBackoffMS = []int{0, 100, 250, 500, 1000}
Backoff in milliseconds between restore attempts of a quarantined shim
var RecoveryClosure = []string{"icebath_cli/_early_recovery.py", "icebath_cli/update_lock.py", "icebath_cli/update_custody.py"}
Files of the repair closure an updater publishes beside the marker
var RunCLIHook func(argv []string) int
Runs the CLI main of this binary over an argv in process and returns its exit status, assigned at startup
var StewardUpdateMessages = map[string]string{ StewardNix: "✗ This icebath runs from the Nix store.\n" + "\n" + "The store path is immutable. Update through your flake:\n" + " nix flake update && rebuild your profile or system", StewardAptTermux: "✗ This icebath runs from a Termux package tree, and no icebath release is a Termux package.\n" + "\n" + "Install icebath in a Debian userland, where the Linux release updates itself:\n" + " " + config.TermuxInstallCommand, StewardHomebrew: "✗ This icebath was installed by Homebrew.\n" + "\n" + "The package manager owns the binary. Update with:\n" + " brew upgrade --cask icebath", StewardScoop: "✗ This icebath was installed by Scoop.\n" + "\n" + "The package manager owns the binary. Update with:\n" + " scoop update icebath", StewardWinGet: "✗ This icebath was installed by WinGet.\n" + "\n" + "The package manager owns the binary. Update with:\n" + " winget upgrade --id nickheyer.icebath", StewardDpkg: "✗ This icebath was installed by a Debian package.\n" + "\n" + "The package manager owns the binary. Update with:\n" + " sudo apt update && sudo apt install --only-upgrade icebath", StewardRPM: "✗ This icebath was installed by an RPM package.\n" + "\n" + "The package manager owns the binary. Update with:\n" + " sudo dnf upgrade icebath", StewardPacman: "✗ This icebath was installed by an Arch package.\n" + "\n" + "The package manager owns the binary. Update through your AUR helper:\n" + " paru -Syu icebath-bin", StewardApk: "✗ This icebath was installed by an Alpine package.\n" + "\n" + "The package manager owns the binary. Update with:\n" + " apk upgrade icebath", StewardChoco: "✗ This icebath was installed by Chocolatey.\n" + "\n" + "The package manager owns the binary. Update with:\n" + " choco upgrade icebath", StewardPip: "✗ This icebath was installed from the icebath-cli wheel.\n" + "\n" + "The package manager owns the binary. Update with:\n" + " pipx upgrade icebath-cli", }
Functions ¶
func AdoptRetiredChannel ¶
Adopts a retired channel's destination after verified completion when the subscription is unchanged
func ArmCompletion ¶
Persists the tail obligation before a new dependency generation is selected
func BackupExisting ¶
Backup copies of the regular files among paths for callers outside the package, in path order
func BootLaunch ¶
Finishes a source update and activates the committed dependencies before the app runs, the exit status when it must stop
func BootRecordPath ¶
Per install and per profile bootstrap record under the default home's installs tree
func ChannelRecord ¶
Returns the path and channel record config holds for the install, empty when absent or malformed
func CheckForUpdates ¶
Presentation ready source update status of one install and profile, never fetching or writing git state
func CheckMacosFullDiskAccess ¶
CheckMacosFullDiskAccess reports the Full Disk Access grant that silences every macOS folder prompt, silent elsewhere
func CheckRuntime ¶
One passive PM verdict on startup, the problem text or empty when the install is current or a developer checkout
func CheckoutContains ¶
True when sha is an ancestor of or equal to the code this checkout runs, false on any probe failure
func ClassifyFetchFailure ¶
One line diagnosis of a release fetch failure text
func CleanupQuarantinedExes ¶
Sweeps and rescues quarantined exe shims of earlier updates, a live update's quarantine left alone
func ClearCompletion ¶
Drops the pending marker and its attempt record
func CmdSecurityAudit ¶
Audits the venv, plugin and MCP pins against OSV, exit 1 when a finding meets the fail on tier
func CmdUpdate ¶
func CmdUpdate(ctx context.Context, u UpdateInvocation) (int, error)
Runs the update command and returns its exit status, an exit raised inside it becoming that status
func CmdUpdateTakeover ¶
Finishes an update a historical updater handed off, returning the status the waiting updater reports
func CollectFleetVersions ¶
Every profile gateway's code identity against the running install, down rows only for pre restart pids
func CompareVersions ¶
Semver precedence of two tags, build metadata ignored and unparseable versions ranked lowest
func CompleteSourceCheckout ¶
Publishes commands then runs post update maintenance under the shared update lock
func CompletionPendingPath ¶
Marker of a source update whose dependency sync committed but whose tail has not finished
func CompletionRetryState ¶
func CompletionRetryState(ctx context.Context, projectRoot string, now func() float64) (bool, *big.Int, int64)
Whether the owed tail may run now, its attempts and the backoff seconds, never failing
func CurrentInstallIdentity ¶
What code this install is, the stamp commit for sealed trees, git HEAD for checkouts, empty for broken trees
func DefaultChannel ¶
Channel an unconfigured install tracks, stable for official releases and main otherwise
func DescribeActiveWorkUnit ¶
One human line of an active work entry, the drain report wording the gateway CLI prints
func DescribeRestartMechanism ¶
Human readable description of a restart mechanism id, the gateway restart command when the table has none
func DispatchCustodyLauncher ¶
func DispatchCustodyLauncher()
Runs a custody launcher and exits when argv carries its entry, otherwise records that this binary handles them
func DoctorCheckConfigFile ¶
func DoctorCheckConfigFile(ctx context.Context, h, projectRoot string, shouldFix bool, w io.Writer) (int, error)
Runs the config file check of one home and project root, returning the number of fixes it applied
func EnsureWindowsBinLaunchers ¶
Re stages the Windows launchers when they vanish or still boot through the venv, the restored paths returned
func ExposePMGit ¶
Puts the pm git on PATH and in its facts for a Windows checkout without a git of its own
func FallbackCheckCommand ¶
func FallbackCheckCommand(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
FallbackCheckCommand is icebath fallback check, the readiness table or JSON of every chain entry without an agent session, 1 when any entry is not ready
func GatewayDebugLocalReport ¶
Redacted share bundle report for a local session's debug local, collected with no network call
func GatewayDebugUploadReply ¶
Uploads only the summary report and returns the chat reply with its link, retention and hints
func GitCount ¶
Integer a successful count style git query in root prints, false when git failed or printed no integer
func GitOperationInProgress ¶
The active Git operation controlling root, empty when none
func GitStdout ¶
Stripped stdout of a read only git query in root within five seconds, empty when git failed
func GitStdoutWithin ¶
func GitStdoutWithin(ctx context.Context, args []string, root string, timeout time.Duration) (string, bool)
Stripped stdout of a read only git query in root within the timeout, false when git failed
func GitlockRunGit ¶
func GitlockRunGit(ctx context.Context, gitCmd, args []string, o pysubprocess.Options) (*pysubprocess.Completed, error)
Runs an updater git for the tools git lock in the update's custody, the run_git the process wiring assigns
func HandleMetadataArgs ¶
func HandleMetadataArgs(ctx context.Context, stdout io.Writer, installIDFlag bool, setChannel *string, projectRoot string) (bool, error)
Prints the install id or persists a channel before any update side effect, true when handled
func ImportHealthMain ¶
Answers the import health probe with the marker and the empty failure list of a binary that started whole
func InstallID ¶
Sixteen hex digit key of the install at projectRoot, the running install when empty
func IsCanaryTag ¶
Reports whether tag is a stable version carrying a full UTC canary build timestamp
func IsCommitBuild ¶
Reports whether the install stamp at projectRoot names a commit build that never updates
func IsObjectID ¶
Whether a value is a commit id and never a revision or a path
func IsValueError ¶
Reports whether err is of the ValueError family, ChannelError included
func LegacyPostSwapMain ¶
func LegacyPostSwapMain(ctx context.Context, handoffPath string, argvTail []string, stderr io.Writer) int
Exit status of a shipped updater's post swap hand off finished by a takeover child, an uncaught failure printed
func MaybeRunBootBootstrap ¶
The one call boot paths use, a bootstrap problem logged and never stopping the launch
func NeedsBootstrap ¶
The new identity when this install changed since its last bootstrap, empty otherwise or for a broken tree
func PassiveCheckForUpdates ¶
Passive source update status of an install for the version output
func PopenPostCommit ¶
func PopenPostCommit(ctx context.Context, argv []string, label string, opts ChildOptions) (*exec.Cmd, error)
Starts a checkout writer after the commit point, a refused job bind is printed and receipted and it still runs
func PrepareLaunch ¶
Finishes a self managed source update before the app runs, the install binary to relaunch into or empty
func PrintFleetVersionMatrix ¶
Prints the post update fleet matrix, true when a gateway is provably stale or down
func QuarantineStampMS ¶
The .old.<unix-ms> stamp of a quarantine file name, false for a name this code never made
func ReadGitHead ¶
Commit SHA of the checkout at root, asked of git, empty when git cannot answer
func ReadLastKnown ¶
The last bootstrap record, empty when missing, unreadable or not an object
func RecoverPausedGateways ¶
Recovers gateways a killed update left paused, the update command and a booting gateway excepted
func RecoveryClosureDirOf ¶
Closure directory of a commit under the git dir, a ValueError for anything but a commit id
func RecoveryClosureVerified ¶
Every closure file present with exactly the bytes its manifest names and nothing missing
func RedactDebugSupportText ¶
Scrubs one debug or support value fail closed, any redactor failure returning the shared sentinel
func RedactDebugSupportTextCapped ¶
Scrubs like RedactDebugSupportText then keeps at most maxChars characters
func RefuseForeignOwnedVenv ¶
Refuses cross user mutation before PM changes the selected environment
func RelaunchAfterRestore ¶
Re runs this command from the restored tree, the exit code of the child on Windows and never returning elsewhere
func RelaunchCommand ¶
Argv re-entering this program through the install binary, its arguments kept and the relaunch marked
func ResolveUpdateChannel ¶
Channel this install updates from, its record first, then the default
func RestoreInterruptedPull ¶
Puts back the files a killed icebath update had half moved to the new commit, true when the tree changed
func RestoreInterruptedZipSwap ¶
Finishes or rolls back a ZIP swap whose owner died, true when the tree changed and a relaunch is due
func RestoreQuarantinedShims ¶
Renames quarantined shims back, retrying a lock, the pairs still quarantined after the retries returned
func RidesDefaultChannel ¶
Reports whether no channel was ever persisted and channel is the install's default
func RunBootBootstrap ¶
Bounds home maintenance to one attempt per installed revision
func RunDoctor ¶
Runs every doctor check in order, then the live probes when asked, and returns one when an issue remains
func RunPostUpdateMaintenance ¶
func RunPostUpdateMaintenance(ctx context.Context, o PostUpdateMaintenance) (bool, error)
Post build housekeeping and the completion line, the SQLite runtime verdict of the next process
func SealedSteward ¶
Steward of a sealed tree, nil for a git checkout, an installer stamped release tree or a WinGet nested install
func SetHolderValueFlags ¶
func SetHolderValueFlags(source func() []string)
Installs the top level parser's value consuming option strings, called by the command tree
func SetInstallChannel ¶
Persists channel for this install in config.yaml and returns its id, refusing commit builds and owned installs
func ShowStatus ¶
One screen summary by default, every section under the full or deep flag
func SourceCompletionMain ¶
Installer and launch entry of the tail, bootstrapping into the checkout's binary before any product work
func SourceUpdateChannel ¶
func SourceUpdateChannel(ctx context.Context, pinned bool, transient *string, projectRoot string) (string, error)
Channel this run updates from, main for a pinned version, then the transient flag, then the install record
func StepAdoptBlessedCheckout ¶
One time adoption of a shipped stampless checkout at a blessed root, writing its birth certificate
func StepDropLivePluginCatalog ¶
Drops the active home's cached live plugin catalog after a code change
func StepExposeCLI ¶
Publishes the durable commands, over this checkout
func StepMigrateConfig ¶
Migrates config.yaml to the current schema non interactively, backups restored when the version does not advance
func StepStateDBGuard ¶
Verifies the active home's state.db is intact, damage reported loudly and never repaired here
func StewardUninstallMessage ¶
The uninstall refusal text for a sealed tree
func StewardUpdateMessage ¶
The icebath update refusal text for a sealed tree
func SweepExpiredPastes ¶
Deletes pending pastes whose expiry passed, returning how many were reaped and how many remain
func SweepStaleBytecodeIfCheckoutChanged ¶
func SweepStaleBytecodeIfCheckoutChanged()
Clears stale bytecode caches once when the checkout fingerprint changed since the last sweep, never failing
func TakeRelaunchMarker ¶
Records a relaunch marker leading the arguments and returns the arguments without it
func UpdateCompletionMain ¶
Entry of the completion process the source update runs in the selected tree, its exit status
func UpdateFinishMain ¶
func UpdateFinishMain(ctx context.Context, contextPath, resultPath string, stdout, stderr io.Writer) int
Finishes a historical takeover in a fresh process of the selected checkout and writes its acknowledgement
func UpdateInternalCommand ¶
Reports an argv the update spawned for one of its children, the hidden verb leading it
func UpdateRestartRecoveryMain ¶
func UpdateRestartRecoveryMain(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) int
Restarts the payload's profiles and prints the outcome JSON, the child exit status
func ValidateChannelName ¶
Returns a lowercase hyphenated channel name of at most 32 characters that names no reserved device
func VenvSyncMain ¶
Reports or syncs a tree's dependencies as text or JSON, nonzero when the sync failed
func WarnPendingFleetRestartOnStartup ¶
Startup hint about a fleet restart a previous update still owes, never restarting and never failing
func WithRetryingReads ¶
Lets channel reads under ctx wait out a CDN blip with the pm bounded retries, explicit updates only
func WriteDurableText ¶
Writes text at path as one durable record through an exclusively created random sibling
func WriteSourceStamp ¶
Replaces install-stamp.json with identity read from the checkout itself, nil when git cannot identify it
func WriteZipSwapJournal ¶
func WriteZipSwapJournal(root, phase string, entries []any, gen string, temps map[string]string) error
Publishes the swap journal with its phase, entries, generation tag and backup temps
func ZipEntryIdentity ¶
The entry's own identity from lstat, empty when absent or unidentifiable, size and mtime added for a settled file
Types ¶
type CalledProcessError ¶
Custody child that exited nonzero under a checked run
func (*CalledProcessError) Error ¶
func (e *CalledProcessError) Error() string
type ChannelError ¶
type ChannelError struct{ Msg string }
func (*ChannelError) Error ¶
func (e *ChannelError) Error() string
type ChannelNotFound ¶
type ChannelNotFound struct{ ChannelError }
ChannelNotFound is the missing channel object, still a ChannelError to every caller
func (*ChannelNotFound) Unwrap ¶
func (e *ChannelNotFound) Unwrap() error
type ChannelOpener ¶
ChannelOpener performs one channel archive request, the urllib opener seam
type ChannelReader ¶
type ChannelReader struct {
// contains filtered or unexported fields
}
ChannelReader reads channel objects over HTTPS from one archive authority with digest checks
func NewChannelReader ¶
func NewChannelReader(baseURL string, repository *string, opener ChannelOpener) (*ChannelReader, error)
Reader for an archive base and an optional repository authority, refusing redirects
func (*ChannelReader) ReadBytes ¶
Bytes of one channel object, size bounded and matched to sha256 when one is pinned
func (*ChannelReader) ReadRecord ¶
Validated record of one named channel under the reader's repository authority
func (*ChannelReader) Resolve ¶
func (r *ChannelReader) Resolve(ctx context.Context, name string) (*ChannelResolution, error)
Requested and terminal records with the verified manifest, a retirement pinned to its qualified destination
type ChannelResolution ¶
Requested record, the record it resolves to, and that record's verified build manifest
type ChildOptions ¶
type ChildOptions struct {
Dir string
Env []string
Input *string
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Capture bool
Text bool
Timeout time.Duration
Check bool
ExtraFiles []*os.File
Attr *syscall.SysProcAttr
}
Subprocess options of one custody child, a nil stream inherits this process's own
type CompletedProcess ¶
Outcome of one finished custody child
func Run ¶
func Run(ctx context.Context, argv []string, inheritLock bool, opts ChildOptions) (*CompletedProcess, error)
Runs argv to completion in the update tree's custody with the lock files for a mutator
func RunGit ¶
func RunGit(ctx context.Context, gitCmd, args []string, opts ChildOptions) (*CompletedProcess, error)
Runs git in the updater's custody, the lock files only into local mutators, a partial clone prefetched first
type Contained ¶
type Contained struct {
Argv []string
ExtraFiles []*os.File
Attr *syscall.SysProcAttr
// contains filtered or unexported fields
}
Command a runner that hides its child starts, kept in checkout custody by a launcher
type DebugShareResult ¶
type DebugShareResult struct {
}
Outcome of a debug share upload, the label to url map, optional upload failures and the redaction flag
func BuildDebugShare ¶
func BuildDebugShare(ctx context.Context, logLines, expiry int, redact bool) (*DebugShareResult, error)
Collects the report and full logs, uploads each and returns their urls, the report upload being required
type Doctor ¶
Doctor is one doctor run, the stdout rows print to plus the home, project root and display home checks read
type Finding ¶
Finding is what one doctor check contributed, auto fixable issues, manual only issues and fixes applied
type ImageProvenance ¶
type ImageProvenance struct {
Schema int
DeploymentKind string
Manager string
Image *string
Version *string
Revision *string
MarkerPath string
Valid bool
Error *string
}
Validated image provenance, or the description of an invalid marker that still means image managed
func ReadImageProvenance ¶
func ReadImageProvenance(markerPath string) *ImageProvenance
Baked image marker at markerPath or the default path, nil when absent, invalid provenance for any defect
type LogSnapshot ¶
Single read snapshot of a log file, the summary tail and the full upload text
type PauseRefused ¶
type PauseRefused struct{ Msg string }
The pause could not be completed and everything it stopped was started again
func (*PauseRefused) Error ¶
func (e *PauseRefused) Error() string
type PostUpdateMaintenance ¶
type PostUpdateMaintenance struct {
AssumeYes, GatewayMode bool
PreUpdateSnapshotID, PreUpdateVersion *string
CompletionMessage *string
Followups *[][2]string
Stdout, Stderr io.Writer
}
Inputs of the post update housekeeping an update or install tail runs
type PostUpdateStep ¶
One named home or machine maintenance step
type RecordLock ¶
Existence as mutex beside a record file, a stale lock broken and retried once
func (*RecordLock) Acquire ¶
func (l *RecordLock) Acquire() bool
Takes the lock, a loser skipping unless the holder's lock is stale
type RuntimeRecord ¶
type RuntimeRecord struct {
Kind string
Profile string
PID *int
Supervisor string
CodeSHA *string
CodeVersion any
RestartVia string
Detail *pyjson.Object
}
One running or expected runtime on this machine
func (*RuntimeRecord) ToDict ¶
func (r *RuntimeRecord) ToDict() *pyjson.Object
Runtime fields as an ordered JSON object in declaration order
type ServicePauseFailed ¶
A gateway service could not be stopped, with what the rollback could not restart
func (*ServicePauseFailed) Error ¶
func (e *ServicePauseFailed) Error() string
func (*ServicePauseFailed) Unwrap ¶
func (e *ServicePauseFailed) Unwrap() error
type SourceCheckOptions ¶
type SourceCheckOptions struct {
InstallRoot string
Home string
Branch *string
Channel *string
CachePath string
Force bool
Passive bool
Git string
}
Inputs of one passive source update check, empty strings and nil pointers take the running install's defaults
type SourceCompletion ¶
type SourceCompletion struct {
AssumeYes, GatewayMode bool
PreUpdateSnapshotID, PreUpdateVersion *string
CompletionMessage *string
Announce string
Followups *[][2]string
BeforeMaintenance func()
Stdout, Stderr io.Writer
}
Options of the tail every source install and update shares
type SourceTarget ¶
type SourceTarget struct {
RequestedChannel string
Channel string
Repository string
Commit string
Branch string
Version string
BuildID string
Ahead bool
}
A pinned source build or a source branch delivery a channel resolves to
func ResolveSourceTarget ¶
func ResolveSourceTarget(ctx context.Context, channel string, gitCmd []string, cwd, repository string, forwardOnly bool) (SourceTarget, error)
Resolves a subscription, pinning an unchosen default to a HEAD that already contains the release
func (SourceTarget) Label ¶
func (t SourceTarget) Label() string
Human label of the target, the waiting notice when this checkout is newer than the release
func (SourceTarget) Retired ¶
func (t SourceTarget) Retired() bool
Reports whether resolution moved the subscription to another channel
type StaleChannelRecord ¶
func StaleChannelRecords ¶
func StaleChannelRecords(ctx context.Context, cfg any) ([]StaleChannelRecord, error)
Doctor's missing, replaced and unclaimed verdicts over update.installs records, in key order
type TidyResult ¶
Counts of one tidy pass
func TidyPartialClonePacks ¶
func TidyPartialClonePacks(ctx context.Context, repoRoot string, budgetSeconds float64) TidyResult
Spends at most the budget erasing redundant and merging small promisor packs, never failing the update
type UpdateInvocation ¶
type UpdateInvocation struct {
Namespace map[string]any
ProjectRoot string
Stdout, Stderr io.Writer
}
Inputs of the update command, its argparse namespace, the checkout it updates and its output streams
type UpdatePlan ¶
type UpdatePlan struct {
InstallMethod string
UpdatableInPlace bool
UpdateMechanism string
ExpectedSHA any
ExpectedVersion any
Profiles []any
Runtimes []*RuntimeRecord
}
Install shape, profiles and runtimes seen before any mutation
func CollectRuntimeInventory ¶
func CollectRuntimeInventory(ctx context.Context) *UpdatePlan
Builds the plan read only, every collector degrading on its own
func NewUpdatePlan ¶
func NewUpdatePlan() *UpdatePlan
Empty plan with the defaults of an unprobed install
func UpdatePlanFromDict ¶
func UpdatePlanFromDict(data any) (*UpdatePlan, error)
Plan rebuilt from its JSON form, unknown keys dropped and rows that are not objects skipped
func (*UpdatePlan) ToDict ¶
func (p *UpdatePlan) ToDict() *pyjson.Object
Plan fields as an ordered JSON object, every runtime as its own object
type UpdateRefusal ¶
type UpdateRefusal struct {
Code, Message, UpdateCommand string
}
Why an in place update is refused, the full text to print and the one line command to run instead
type UpstreamTargetBroken ¶
type UpstreamTargetBroken struct {
SHA, Path, Detail string
}
The fork sync's upstream target fails the startup syntax check and is refused before its move
func (*UpstreamTargetBroken) Error ¶
func (e *UpstreamTargetBroken) Error() string
type ValueError ¶
type ValueError struct{ Msg string }
func (*ValueError) Error ¶
func (e *ValueError) Error() string
type VenvSyncResult ¶
Outcome of one dependency report or sync, detail present only on failure
type ZipSwapLock ¶
Verdict of the ZIP swap owner lock, owned only while this process holds it
Source Files
¶
- boot_bootstrap.go
- bytecode_fingerprint.go
- bytecode_sweep.go
- channel.go
- channel_manager.go
- check.go
- completion_child_unix.go
- configured_features_refresh.go
- contract.go
- custody.go
- custody_base.go
- custody_join.go
- custody_join_other.go
- custody_reap_linux.go
- custody_reap_unix.go
- custody_unix.go
- debug.go
- debug_export.go
- debug_gateway_slash.go
- debug_redaction.go
- doctor.go
- doctor_config.go
- doctor_connectivity.go
- doctor_extras.go
- doctor_live.go
- doctor_platform.go
- doctor_platform_fda.go
- doctor_platform_manager.go
- doctor_report.go
- doctor_state.go
- doctor_tier_extras.go
- doctor_tier_plugins.go
- doctor_tools.go
- downgrade.go
- drain_report.go
- drain_report_export.go
- dump.go
- early_recovery_exec_unix.go
- early_recovery_lock_unix.go
- early_recovery_restore.go
- early_recovery_zip.go
- fallback_check.go
- fleet_checkout.go
- fleet_gatewayless.go
- fleet_obligation.go
- fleet_restart.go
- fleet_restart_launchd.go
- fleet_restart_systemd.go
- fleet_scope.go
- fleet_unit_budget.go
- fleet_verify.go
- fleet_versions.go
- gateway_restart_watcher.go
- git_pack_tidy.go
- gitlock_run_git.go
- holder.go
- image_provenance.go
- install_repair.go
- install_repair_other.go
- launchd_supervision.go
- launchd_supervision_base.go
- log.go
- macos_tcc_anchor.go
- migrate_windows_bin_path.go
- migrate_windows_bin_path_other.go
- post_update.go
- post_update_base.go
- receipt_rows.go
- recovery_attr_unix.go
- release.go
- release_channels.go
- run_channel.go
- security_audit.go
- source_check.go
- source_check_manager.go
- source_completion.go
- source_github.go
- source_github_other.go
- source_releases.go
- source_releases_base.go
- source_stamp.go
- source_stamp_manager.go
- state_db_autorestore.go
- status.go
- status_auth.go
- steward.go
- update_abort_recovery.go
- update_cmd.go
- update_cmd_check.go
- update_cmd_commit.go
- update_cmd_common.go
- update_cmd_complete.go
- update_cmd_config.go
- update_cmd_entry.go
- update_cmd_git.go
- update_cmd_impl.go
- update_cmd_maint.go
- update_cmd_pause_gate.go
- update_cmd_posix_pause.go
- update_cmd_posix_pause_unix.go
- update_cmd_prepare.go
- update_cmd_pull.go
- update_cmd_stale_survivors.go
- update_cmd_stash.go
- update_cmd_validation.go
- update_cmd_windows_gateways.go
- update_cmd_windows_holders.go
- update_cmd_zip.go
- update_cmd_zip_linux.go
- update_cmd_zip_unix.go
- update_completion.go
- update_contract.go
- update_cua_refresh.go
- update_finish.go
- update_internal_commands.go
- update_inventory.go
- update_inventory_outcomes.go
- update_inventory_plan.go
- update_multiplex_notices.go
- update_owning_install.go
- update_relay_runtime.go
- update_release_binary.go
- update_restart_recovery.go
- update_takeover.go
- venv_sync.go
- venv_sync_check.go
- venv_sync_main.go
- venv_sync_unix.go
- windows.go
- windows_gateway_profile_home.go