Dashboard › cli › Distillation
4cec821a-15a8-486c-aa4b-cfc56fd7ba60["lore_tm_v1_6SYAh-cB4mjex3sIUUK6N54zT3Osy2-NJRovv7Hzl4Y","lore_tm_v1_mMye0fUBmxZL_ZilDnBp2ZCTi9oRG2Pt9Hlu6teXS4w"]
packages/cli/src/lib/delta-upgrade.ts changes resolveStableChain(currentVersion, targetVersion, signal?, source) to accept source: UpgradeSource = getPrimaryUpgradeSource() and call stableSource(source).resolveChain(...), making stable delta-chain resolution upgrade-source-specific.packages/cli/src/lib/delta-upgrade.ts imports prerelease as semverPrerelease and valid as semverValid from semver, and replaces direct GITHUB_RELEASES_URL/GHCR_REPO use with getGitHubReleasesUrl, PRIMARY_UPGRADE_SOURCE, and UpgradeSource.canAttemptDelta(targetVersion) is false or signal?.aborted; otherwise it resolves a chain from CLI_VERSION to targetVersion and saves chain.steps via getPatchCache().save(chain, chain.steps) only when steps exist and the signal remains unaborted.NIGHTLY_VERSION_RE = /^[\d.]+(?:-\w+)?-dev\.(\d+)$/, matching nightly versions ending in -dev.<unix-seconds>.CHANGELOG_MAX_RELEASES = 30; the comment says this exceeds the delta-upgrade cap of 12, GitHub’s API maximum per_page is 100, and 30 releases cover approximately 6+ months of weekly releases.skipGlobalValueFlagValue(args, i) prevents the spaced value of a global value-taking flag such as --org acme from being mistaken for a command-path segment; it returns the last consumed index and the caller adds 1.cleanupPatchCache() failures are caught and logged with logger.debug("Patch cache cleanup failed (best-effort)", error).checkForUpdateInBackgroundImpl() never throws: errors are caught and reported to Sentry.checkForUpdateInBackgroundImpl() catches failures from shouldCheckForUpdate(), calls Sentry.captureException(error), and returns instead of crashing the CLI.null when up-to-date, cached version information is absent, rate-limited, stderr is non-TTY, or an error occurs.fetchNightlyManifest(token, signal?, source = PRIMARY_UPGRADE_SOURCE) is a convenience wrapper that calls fetchManifest(token, GHCR_TAG, signal, source).getNightlyVersion(manifest) reads manifest.annotations?.version, throws UpgradeError("network_error", "Nightly manifest has no version annotation") when absent, and throws UpgradeError("network_error", "Nightly manifest has invalid version annotation") unless both semverValid(version) succeeds and NIGHTLY_VERSION_REGEX matches.findLayerByFilename(manifest, filename) matches OCI layers by annotations["org.opencontainers.image.title"]; if none matches, it throws UpgradeError("version_not_found", \No nightly build found for ${filename}`)`.downloadNightlyBlob(token, digest, signal?, source = PRIMARY_UPGRADE_SOURCE) constructs ${GHCR_REGISTRY}/v2/${source.ghcrRepo}/blobs/${digest} and initially fetches it with Authorization: Bearer ${token}, "User-Agent": getUserAgent(), redirect: "manual", and buildSignal(GHCR_BLOB_TIMEOUT, signal).200 response or manually handles redirect statuses 301, 302, 307, and 308; a redirect without a Location header throws UpgradeError("network_error", \GHCR blob redirect (${blobResponse.status}) had no Location header`)`.Authorization header because forwarding the bearer token alongside Azure Blob Storage’s signed query credentials causes Azure to return 404; the redirected request sends only "User-Agent": getUserAgent() plus the caller’s signal.AbortSignal.timeout: the fetch covers connection and body streaming, and a 30s timeout for an approximately 30 MB nightly binary would require sustained throughput of approximately 8 Mbps; the initial GHCR timeout handles GHCR latency.rethrowExternalAbort(error, signal) before wrapping non-abort failures as UpgradeError("network_error", ...); GHCR connection failures use Failed to connect to GHCR: ${msg}, while redirected storage failures use Failed to download from blob storage: ${msg}.