Repository navigation
fix: guard companion upgrades, npm peer churn and install progress - #68
Merged
Merged
Conversation
Signed-off-by: Lucas Braum <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
lucasbraum
force-pushed
the
codex/companion-upgrades
branch
from
October 10, 2026 19:09
93aae92 to
8ad6021
Compare
lucasbraum
marked this pull request as ready for review
October 10, 2026 23:14
Merged
lucasbraum
pushed a commit
that referenced
this pull request
Oct 11, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Patch Changes - [#66](#66) [`c5611f4`](c5611f4) Thanks [@lucasbraum](https://github.com/lucasbraum)! - Include every advertised peer upgrade in the preflight's Next command, including blockers pulled along as companions, and replay the complete proposed upgrade set. Group blocker output by package with all rejected peers and preserve them in structured JSON on preflight failures and fix reports. - [#65](#65) [`35fe251`](35fe251) Thanks [@lucasbraum](https://github.com/lucasbraum)! - Match compiler-confirmed React `useRef` symbol findings so zero-argument calls receive the existing initial-value fix. Route missing global `JSX` namespace diagnostics (TS2503) to the React 19 agent guidance without rewriting them automatically. - [#68](#68) [`4ed45ee`](4ed45ee) Thanks [@lucasbraum](https://github.com/lucasbraum)! - Keep already-compatible peer companions at their installed versions, share the lowest compatible peer resolver with preflight, and reject planned downgrades before writing manifests or installing. Keep preflight versions authoritative throughout fix. Bound spinner text to terminal width, summarize install companions by count, and disable animation when stdout is piped. Handle npm's unavoidable reverse-peer re-resolution only when the upgrade stays within every previously declared range, keeps the major version, and never downgrades. List admitted packages and their ranges in the fix report and PR body, while preserving resolutions for other consumers and accounting for identical nested copies. Preserve grouped peer blockers and the complete Next command in JSON when the packaged CLI runs planning in its worker thread. Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion discovery could replace an already-compatible Radix package with an older release just because it shared an exact dependency pin with an explicitly upgraded peer. It could also pull tooltip into another member's companion set at a different version from the preflight recommendation.
This change keeps compatible installed peers in place, carries the whole upgrade's peer targets through companion discovery, and uses one lowest-compatible-release resolver for peer selection. Candidates cannot be below the installed version. Real runtime release pairs and their types remain coordinated. Fix installs the preflight plan instead of merging in a second set of versions from check. An independent invariant checks actual installed copies in every workspace before writing manifests or installing, and rejects planned downgrades with an exit-2 error listing them.
Install progress now says
install · react 19.3.0 with 4 packages. Every spinner frame is truncated below the terminal width (80-column fallback), and redirected stdout disables spinner frames even when stderr is a terminal. Full companion details remain in the final summary, report and upgrade commit.npm also re-resolves reverse peers outside that explicit plan. Targeted installation and
--prefer-dedupeproduce the same lockfile, so the guard now admits only existing peer packages whose newer version stays in the same major and satisfies every old consumer range. It records each admitted placement and range, and still protects other consumers from changed transitive resolutions. The comparison also recognizes identical copies moved into new nested locations. These changes are npm-only.Regression coverage
fromfield.Rebase integration with #66
Rebased onto
c5611f4(current main, #66 merged), with no merge commits. Conflict resolution retains #66's grouped output/JSON and complete Next-command loop, using #68's shared resolver and authoritative plan. Both property regressions pass: 24 Next-command fixture combinations replay without unallowed blockers, and 80 no-downgrade combinations. All commits are signed off.The packaged-CLI rerun also found that the worker boundary discarded structured peer errors. The worker now preserves
peerConflictsandnext; a local mock-registry test exercises the built CLI, asserts one entry per package with apeersarray, and verifies the complete Next command. This test failed against the previous bundle and passes with the fix. The real repository's--jsonoutput has two entries; tooltip contains both rejected React peers.Actual grouped preflight output at
alanagoyal/alanagoyal@fd60b0a, fromuptide fix react --target 19.3.0 --no-llm(exit 2, before cloning):The printed Next command passed preflight and completed installation and verification in the rerun below. No PR or push was made on the public repository or a fork.
Rerun on the public repository
Pinned
alanagoyal/alanagoyal@fd60b0a1d66e112cca9c350da33d4bbb1154aad7, Node 24.21.0 / npm 11.19.0:The original command naming tabs and resizable-panels was also tried: those dependencies were removed from this commit, so that command correctly stops in preflight. The command above uses the dependencies still declared at this ref.
The updated run completes install, mechanical rewriting, types, tests and lint in 1m 00s. It keeps tooltip at the preflight's
1.1.0and does not downgrade compatible Radix packages.The earlier full
npm run checkresult is unchanged: lint and all 181 tests pass, then typecheck stops on the same 12 errors, so its production-build step is not reached.One
useRefsite is mechanically fixed; 22 findings remain manual. No LLM calls. Verification remains failed because 12 type errors remain; the peer compatibility exception is also explicitly reported as a risk. No PR, push or fork was created on the external repository. The produced report and PR-body preview contain the two peer re-resolutions and old ranges.npm invocation experiments
Node 24.21.0 / npm 11.19.0,
alanagoyal/alanagoyal@fd60b0a1d66e112cca9c350da33d4bbb1154aad7. Four independent copies started from the same committed manifest and lockfile, withoutnode_modules, matching the isolated installer. The only manifest changes were the five planned versions plus the authorized emoji-mart peer override. Each variant ran exact resolution, then restored the original range styles and reconciled them with npm.The changed-entry count includes the root importer and license metadata; the 34 version changes include planned packages and their subtrees. All four final lockfiles are byte-identical. The second pass changes only the root importer’s restored range declarations; the unrelated version churn is already present after the first pass. No invocation change is made because neither targeted installation nor
--prefer-dedupeprevents it.Exact npm commands (same scripts and lockfile settings)
plain (2900ms, warm registry cache; run concurrently)
targeted (2888ms, warm registry cache; run concurrently)
dedupe (2889ms, warm registry cache; run concurrently)
targeted-dedupe (2885ms, warm registry cache; run concurrently)
Rejected-record inventory
47 original rejection entries: one importer-resolution summary and 46 package records. Peers below are from the old/new lockfile manifest, intersected with the planned package names.
R= react,D= react-dom,TR= @types/react,TD= @types/react-dom. No record peers on tooltip.Every originally rejected record and its planned-package peer links
importer . resolutionsnode_modules/@radix-ui/react-context-menu (same version, different resolution, dependencies or execution fields)node_modules/@radix-ui/react-dialog (1.1.15 → 1.2.0)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive (removed, was 1.1.3)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs (removed, was 1.1.2)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context (removed, was 1.1.2)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer (removed, was 1.1.11)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id (removed, was 1.1.1)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal (removed, was 1.1.9)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence (removed, was 1.1.5)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive (2.1.3 → 2.1.11)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-callback-ref (removed, was 1.1.1)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state (removed, was 1.2.2)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect (removed, was 1.1.1)node_modules/@radix-ui/react-focus-scope (1.1.7 → 1.2.0)node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs (removed, was 1.1.2)node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive (2.1.3 → 2.1.11)node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-use-callback-ref (removed, was 1.1.1)node_modules/@radix-ui/react-menu (same version, different resolution, dependencies or execution fields)node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-use-controllable-state (removed, was 1.2.2)node_modules/@radix-ui/react-popover (same version, different resolution, dependencies or execution fields)node_modules/react-remove-scroll (2.7.1 → 2.7.2)node_modules/vaul (same version, different resolution, dependencies or execution fields)node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-compose-refs (added at 1.1.2)node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-context (added at 1.1.2)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards (added at 1.1.6)node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot (added at 1.4.0)node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive (added at 2.1.11)node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot (added at 1.4.0)node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-effect-event (added at 0.0.5)node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-slot (added at 1.4.0)node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-compose-refs (added at 1.1.2)node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-context (added at 1.1.2)node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-use-callback-ref (added at 1.1.1)node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-use-layout-effect (added at 1.1.1)node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-primitive (added at 2.1.11)node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-slot (added at 1.4.0)node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/primitive (added at 1.1.3)node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-compose-refs (added at 1.1.2)node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-context (added at 1.1.2)node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-id (added at 1.1.1)node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-use-callback-ref (added at 1.1.1)node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-use-controllable-state (added at 1.2.2)node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-use-layout-effect (added at 1.1.1)node_modules/@radix-ui/react-use-controllable-state/node_modules/@radix-ui/react-use-effect-event (added at 0.0.5)node_modules/@radix-ui/react-use-escape-keydown/node_modules/@radix-ui/react-use-callback-ref (added at 1.1.1)node_modules/@radix-ui/react-use-size/node_modules/@radix-ui/react-use-layout-effect (added at 1.1.1)Bounded npm peer scope
@radix-ui/react-dialog 1.1.15 → 1.2.0: peers on R/D/TR/TD; existing ranges are root^1.1.4and vaul^1.1.1.react-remove-scroll 2.7.1 → 2.7.2: peers on R/TR; existing ranges from dialog, menu and popover are all^2.6.3.react-focus-scope 1.1.7 → 1.2.0is not independently admitted: old consumers pin1.1.7. The new copy belongs to the admitted dialog subtree, while unchanged menu and popover resolve nested copies of1.1.7. Tests require those outside consumers to keep their original resolution.Only existing peer packages with a strictly newer same-major version satisfying every old incoming range are admitted, by exact placement rather than package name. Their old/new subtrees may change, but those changes cannot alter an outside consumer’s transitive resolution. Major changes, downgrades, out-of-range upgrades, newly added peer declarations, same-version integrity changes, and unrelated copies remain rejected. Identical copies moved into new nested locations are recorded as housekeeping; identity, execution fields and resolved dependencies must still match.
The fix JSON, Markdown report, terminal summary and generated PR body name the admitted packages under Re-resolved because a peer changed, including their old ranges in the report and PR. pnpm/Yarn invocation and guard behavior are unchanged; this reproduction is npm-specific, and the new relocation fallback only applies to npm’s physical tree.
Validation
git commit -s.