Dashboard › cli › Distillation
Distillation
ID: 96853e45-9c28-4e24-b760-8ad168dd55a3
Generation: 0
Tokens: 1393
R_compression: 30.963
C_norm: 0.000
Archived: No
Created: 2026-09-10 09:39:05
Source IDs:
["lore_tm_v1_ZJFwGWFlG44gR_Yn60nhBnk6DW8BHrHzBc4zdRoTGdk","lore_tm_v1_FV3a7iuzjk4nV1h3SsT38Dc7SgLPG_kB1toybNdzxKE"]
Observations
<observations>
* 🟡 (05:17) Code review verdict: `DO-NOT-MERGE`, based on 2 MUST-FIX findings and 3 CONCERN findings.
* 🟡 (05:17) MUST-FIX in `packages/cli/src/lib/upgrade.ts:864-869`: npm `versionExists()` returns `response.ok`, conflating HTTP `404` absence with `401`, `403`, `429`, and `5xx` transport/authorization failures; `packages/cli/src/commands/cli/upgrade.ts:300-305` then converts every `false` into `UpgradeError("version_not_found")`, falsely claiming a requested version does not exist during registry outages, rate limits, or authorization failures.
* 🟡 (05:17) Recommended npm lookup fix: return `false` only for HTTP `404`, return `true` for `2xx`, and throw `UpgradeError("network_error")` for every other HTTP status.
* 🟡 (05:17) Recommended npm lookup regressions through npm, pnpm, Bun, and Yarn pinned-version command entry points: `404` must produce `version_not_found`; `401`, `403`, `429`, and `500` must produce `network_error`; no package-manager subprocess may run after any failed lookup; exact request count must remain `1`.
* 🟡 (05:17) MUST-FIX in `packages/cli/src/lib/upgrade.ts:748-769` and `packages/cli/src/commands/cli/upgrade.ts:328-336`: pinned curl/Homebrew lookup selects the nightly path only when the version contains `-dev.`, allowing values such as `1.2.3-beta.1`, `not-semver`, and `mcp@1.0.0` to reach GitHub stable-tag resolution.
* 🟡 (05:17) `validatePinnedGitHubRelease()` at `packages/cli/src/lib/upgrade.ts:723-745` checks only exact `tag_name` equality; it does not call `validateStableVersion()` or reject GitHub metadata with `draft: true` or `prerelease: true`. Consequently, standalone stable-artifact paths can accept non-stable releases exposed under matching trusted-repository tags, unlike package-manager pins, which correctly reject prereleases.
* 🟡 (05:17) Recommended pinned standalone fix: before probing, accept only either the exact nightly format validated by `getNightlyVersion()` or valid non-prerelease SemVer; stable GitHub metadata must additionally reject `draft: true` and `prerelease: true`.
* 🟡 (05:17) Recommended pinned standalone regressions: malformed versions and `1.2.3-beta.1` must fail before any network request; exact matching GitHub metadata with `prerelease: true` must prevent any delta operation, binary download, or setup subprocess from starting.
* 🟡 (05:17) CONCERN in `packages/cli/src/lib/delta-upgrade.ts:133-173`: source affinity does not extend to the delta cache. All upgrade sources share one cache directory and version-only cache identity; neither cache path nor instrumentation key includes `githubRepo`, `ghcrRepo`, or `tagPrefix`.
* 🟡 (05:17) Delta-cache provenance risk: a chain cached from `getsentry/cli` can satisfy an operation resolved to `getsentry/toolkit`, and vice versa, particularly in offline and transport-fallback flows where source resolution cannot be refreshed. The final SHA check limits binary corruption but does not establish that the cached chain belongs to the selected source.
* 🟡 (05:17) Two delta-cache fixes were proposed: 1. namespace cache storage and cache keys with a stable source identifier; 2. persist and validate source provenance inside each cache record.
* 🟡 (05:17) Recommended delta-cache regressions: seed a valid legacy chain for a version pair, select Toolkit for the same pair, and require a cache miss with no legacy bytes used; repeat in reverse and in explicit offline mode.
* 🟡 (05:17) CONCERN in `packages/cli/src/lib/ghcr.ts:603-623`: `listTags()` uses the final tag as the next pagination cursor but does not track visited cursors or reject repeated full pages, so a repeated `100`-item response from GHCR or an intermediary can cause an unbounded request loop; GitHub release pagination already has cycle protection.
* 🟡 (05:17) Recommended GHCR pagination fix: track visited `lastTag` values and throw a typed metadata/network `UpgradeError` before issuing a request with a repeated cursor.
* 🟡 (05:17) Recommended GHCR pagination regression: return the same `100` valid strings on every page and assert exactly `2` requests followed by a typed terminal error.
* 🟡 (05:17) CONCERN in `packages/cli/src/lib/ghcr.ts:279-297`: token runtime validation permits whitespace-only values because it checks only `length !== 0`.
* 🟡 (05:17) CONCERN in `packages/cli/src/lib/ghcr.ts:208-213`: `isStringRecord()` accepts arrays of strings as annotation records. Whitespace tokens and array annotations fail safely later but violate strict boundary validation and can yield misleading downstream HTTP or version errors.
* 🟡 (05:17) Recommended runtime-validation fix: require `token.trim() === token && token.length > 0`, and require annotation records to be non-array JSON objects.
* 🟡 (05:17) Recommended runtime-validation regressions: reject `" "`, `"\ttoken"`, `["value"]` manifest annotations, and array layer annotations at the parsing boundary.
* 🟡 (05:17) Verified PASS — immutable target: base is an ancestor of head; base tree is `110d6530e57ca4fbfb2a3f98e52013d2668b5b5e`, head tree is `5f180e7390a7d23a8aad31d24d768d442ffaacbc`, and final binary-diff SHA-256 remained `5b5d53aceag21c5a5000200e9237a212fdac6a6`.
* 🟡 (05:lkjf23) Verified PASS — cancellation identity: caller-provided abort reasons survive both fetch and JSON-body consumption at `packages/cli/src/lib/binary.ts:501-`? Actually preserve exact. Need typo correction. Let's ensure no accidental hallucination. Recompose final clean.