Dashboard › cli › Distillation
07dd81e8-28f3-4e78-bb2c-162e30ce97b6["lore_tm_v1_O72kf6TGBCdzffdKyS0yw5dKxB--UMOWYwNrbI1TbMs","lore_tm_v1_mqW3BeWFJmud9JCY0HJA6vKvvklfP8UmOOAQ1rFl_iQ","lore_tm_v1_fudJ9dWHuKkg9UWKGb623FoxQi4UMjKZtmApB10l3AI","lore_tm_v1_0C09SL4ZR8RaopyIymxXzlAgCUpG7YeR6t1byS9E8WA","lore_tm_v1_5JZDLwSafuPNm6mnTlxUBtjxTen3R3Y8Y1g10k4z8Ck","lore_tm_v1_6-xjzg4bsJGuVhbQn-KuU6G3pXXwSXfydreW5nsC8NE","lore_tm_v1_HtuANpNu9O_VDPI9nO6HBgo6EvZdy9Oq3Msc9ZAM1zI","lore_tm_v1_FbVfhnaaDfcVD3gM9f-8cOA8TTlmUf6yonFgpPsDPdo","lore_tm_v1_M-8-4OURSLIylS4scfgFTc110MvNJu0nKLqwIi7i1d0","lore_tm_v1_81vMelBUuAbecI7rHqpT1fKFvYlwC0nh80Uz3eR14Dc","lore_tm_v1_0TumwClqCpfHn1kvutUbvNGGfhlO-f-qYbHye4Wjh7o","lore_tm_v1_O_SMkDfzhL3e8JW78p59wryRpq9X5ceAPCBqVvcbg-Y","lore_tm_v1_5uZYWufn3VbBM0KPkPzGRz-Qiyw8WnyyKvLOdLIyeMc"]
Date: Sep 10, 2026
packages/cli/src/lib/upgrade.ts: fetchLatestFromGitHub() at line 538, fetchLatestNightlyVersion() at line 637, resolveLatestUpgradeVersion() at line 674, resolveExistingUpgradeVersion() at line 697, versionExists() at line 811, downloadBinaryToTemp() at line 1164, and executeUpgrade() at line 1402.packages/cli/src/lib/ghcr.ts: getAnonymousToken() at line 221, fetchManifest() at line 262, fetchNightlyManifest() at line 298, downloadNightlyBlob() at line 373, and listTags() at line 516.packages/cli/src/lib/delta-upgrade.ts: resolveStableDelta() at line 557, resolveNightlyDelta() at line 576, attemptDeltaUpgrade() at line 595, prefetchNightlyPatches() at line 688, and prefetchStablePatches() at line 696.packages/cli/src/lib/version-check.ts invokes prefetchNightlyPatches(latestVersion, signal, source) at line 242 and prefetchStablePatches(latestVersion, signal, source) at line 244.packages/cli/src/commands/cli/upgrade.ts uses versionExists(lookupMethod, target) at line 297, resolveExistingUpgradeVersion(target) at line 305, resolveLatestUpgradeVersion(channel) at line 337, and source-aware executeUpgrade(...) calls at lines 691 and 777.binpatch package contents under packages/cli/node_modules/binpatch/ are dist/, LICENSE, package.json, and README.md; dist/ contains index.d.ts, index.js, and index.js.map.packages/cli/node_modules/binpatch/dist/index.js defines resolveAndApply() at line 654, ghcrSource() at line 1038, and githubReleaseSource() at line 1225.binpatch constants in packages/cli/node_modules/binpatch/dist/index.js are MAX_STABLE_CHAIN_DEPTH = 10, MAX_NIGHTLY_CHAIN_DEPTH = 30, SIZE_THRESHOLD_RATIO = 0.6, and PATCH_TAG_PREFIX = "patch-".BinpatchError supports reasons and defaults: network_error → "Failed to fetch update information.", execution_failed → "Applying the update failed.", version_not_found → "The specified version was not found.", and offline_cache_miss → "Cannot update offline — no pre-downloaded patch is available.".resolveAndApply(opts) first tries cache.load(currentVersion, targetVersion); a cache hit reports telemetry source "cache" and applies the chain. If offline and no cached chain exists, it calls telemetry?.onOfflineMiss?.() and returns null. Otherwise it resolves from the configured source, reports unavailability if no chain exists, asynchronously saves available chain.steps, reports telemetry source "network", and applies the chain.applyChain() computes total output bytes from each patch header’s newSize, emits "resolve", "apply", and "verify" progress phases plus byte progress, applies patches via applyPatchChainInMemory(), and throws SHA-256 mismatch after patching: got ${sha256}, expected ${chain.expectedSha256} when verification fails; success returns { sha256, patchBytes: chain.totalSize, chainLength: chain.patches.length }.binpatch OCI settings are REQUEST_TIMEOUT = 1e4, MAX_RETRIES = 1, BLOB_TIMEOUT = 3e4, TAGS_PAGE_SIZE = 100, and OCI_MANIFEST_TYPE = "application/vnd.oci.image.manifest.v1+json".TimeoutError, AbortError, and messages containing timeout, econnreset, econnrefused, network, or fetch failed as retryable; buildSignal() combines AbortSignal.timeout(timeout) with an external signal using AbortSignal.any(...).ghcrSource().resolveChain() fetches the target manifest and PATCH_TAG_PREFIX tags concurrently after anonymous authentication, requires a ${binaryName}.gz layer identified by annotation org.opencontainers.image.title, reports "malformed_chain" when absent, and delegates to resolveNightlyChain(). A caught BinpatchError is converted to an unavailable report of "network" and a null result.extractStableChain() requires both target and current releases, with the target appearing before the current release; absent or invalid ordering returns "no_patches". Chains longer than MAX_STABLE_CHAIN_DEPTH return "too_long".sha256: digest and a ${binaryName}.patch asset on every release in the chain; missing data returns "malformed_chain". Patch totals above fullGzSize * SIZE_THRESHOLD_RATIO return "over_budget".{ fromVersion, toVersion }; patch URLs and releases are reversed before step construction so the chain begins at currentVersion and proceeds toward targetVersion.githubReleaseSource() fetches ${releasesUrl}?per_page=${MAX_STABLE_CHAIN_DEPTH + 2}—12 releases with current constants—using headers Accept: "application/vnd.github.v3+json" and "User-Agent": userAgent; fetch exceptions or non-OK responses produce null.githubReleaseSource().resolveChain() reports "network" when release retrieval or any patch download fails, "no_patches" when the target release is absent, and "malformed_chain" when the target lacks ${binaryName}.gz; successful results contain patches, totalSize, expectedSha256, and steps.