Dashboard › cli › Distillation
b4e53c49-82e0-4b21-bcc4-04a03ac8e5b2["lore_tm_v1_4xOfXuQxqHvbQcy3wwJI7iyDua3UO8hhYJHfb9aogPw","lore_tm_v1_7RcK4P5pEHYlUYM7LVdm5l715__i8W6G1WrjGVsrszk"]
MUST-FIX because caller abort reasons are not preserved across all discovery paths: direct blob downloads preserve arbitrary reasons, but GHCR token/manifest/tag requests and GitHub source probes may normalize, retry, or wrap them./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/ghcr.ts:135-140 as converting every non-Error rejection into a new Error before comparing it with externalSignal.reason; primitive reasons such as "cancelled" therefore cannot pass the identity check and may be retried or converted into UpgradeError./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:317-327 as preserving only errors named AbortError; external abort reasons such as Error("cancelled"), strings, or objects can be wrapped as network failures./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/upgrade.ts:594-596 as replacing an already-aborted signalβs reason with a new AbortError.rethrowExternalAbort() before conversion at ghcr.ts:400-405 and ghcr.ts:442-448.externalSignal?.aborted before normalizing caught values and throwing externalSignal.reason unchanged; applying the same rule in fetchUpgradeProbe(); and throwing signal.reason for an already-aborted signal rather than constructing AbortError.getAnonymousToken() with a primitive reason, have mocked fetch reject that exact reason, and assert identity plus exactly one request. 2. Repeat for resolveUpgradeSource(). 3. Call fetchLatestNightlyVersion() with an already-aborted signal carrying a non-Error object and assert rejection with the exact object. 4. Repeat through fetchManifest() or listTags() to cover fetchWithRetry().PASS β exact pins bypass latest: pinned resolution runs first and the nullish expression does not invoke latest discovery when pinnedTarget exists (commands/cli/upgrade.ts:334-352); command coverage asserts no per_page=100 request at test/commands/cli/upgrade.test.ts:358-403.PASS β target-driven routing: nightly targets migrate every non-curl installation based on isNightlyVersion(target), stable targets retain npm/Homebrew behavior (commands/cli/upgrade.ts:1076-1080), and stable Homebrew pins are rejected at commands/cli/upgrade.ts:257-264.PASS β one-off pinned nightly tracking: artifact channel derives from the target (commands/cli/upgrade.ts:276-281, :1023-1043) while setup receives the existing tracking channel; the npm migration regression verifies --channel stable and unchanged persisted tracking at test/commands/cli/upgrade.test.ts:1128-1206.PASS β stable semantic prereleases: latest discovery excludes both GitHub prerelease flags and semantic prerelease versions before semantic sorting (lib/upgrade.ts:488-514); delta/recent normalization applies the same filters (lib/delta-upgrade.ts:100-120); stable changelog input passes through that normalization (lib/release-notes.ts:594-646).PASS β branded normalized provenance: normalized release arrays carry a non-enumerable symbol whose value is a structural source key containing GitHub repo, GHCR repo, and tag prefix (lib/delta-upgrade.ts:75-120).PASS β raw cross-source data rejected: prefetched releases bypass normalization only when structural provenance matches; all other arrays are normalized against the requested source (lib/release-notes.ts:640-642); test/lib/release-notes.test.ts:361-434 covers copied source objects, raw Toolkit data, and unprefixed cross-source rejection.PASS β exact metadata: stable pins require the exact source-prefixed tag_name and reject malformed successful responses without fallback (lib/upgrade.ts:697-739); nightly annotations require exact numeric X.Y.Z-dev.TIMESTAMP SemVer (lib/ghcr.ts:322-336); pinned manifests must equal the requested version (lib/upgrade.ts:683-708).PASS β 404-only fallback: source probing advances only on HTTP 404 (lib/binary.ts:338-354); nightly GHCR fallback uses typed GhcrManifestHttpError.status === 404 (lib/upgrade.ts:604-633); transport errors, 403s, malformed 200 responses, and message text do not trigger fallback.PASS β source affinity: the selected source flows into changelog, delta, prefetch, token, manifest, blob, and full-download calls, with dispatch evidence at commands/cli/upgrade.ts:898-903, commands/cli/upgrade.ts:1023-1043, lib/delta-upgrade.ts:176-224, lib/delta-upgrade.ts:618+, lib/upgrade.ts:623-624, and lib/upgrade.ts:991-1005.PASS β pagination: next links must use HTTPS, api.github.com, a release-list path, and a canonical positive page number; supplied host/path/query are discarded and the request is rebuilt from the selected source; cycles are rejected (lib/upgrade.ts:488-533).PASS β redirect authorization: GHCR receives the bearer token through manual redirects, while redirected storage receives only User-Agent (lib/ghcr.ts:388-440).PASS β SHA/delta/cache/offline behavior: source forwarding does not alter binpatchβs inline SHA verification, cache, or offline resolution contracts; delta failures still return null for full-download fallback; explicit offline misses still fail instead of accessing the network.PASS β API compatibility: existing argument order remains intact; source parameters were appended or implemented as a backward-compatible UpgradeSource | AbortSignal discriminator; existing public exports remain available.f04818a2473a139b9ba1a0a0c94bb9fb80e9cc23788d06cf666c1deabd365f6e.Error abort coverage as the main residual test gap.DO-NOT-MERGE.