Skip to content

fix(react): match confirmed useRef and missing JSX findings - #65

Merged
lucasbraum merged 1 commit into
mainfrom
codex/react-pack-matchers
Oct 10, 2026
Merged

lucasbraum merged 1 commit into
mainfrom
codex/react-pack-matchers

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Pack

Fix React 18 → 19 rule matching from the classification in #64. Compiler-confirmed useRef signature findings retain the exported symbol path (".":useRef), so the existing TS2554-only matcher left zero-argument calls manual. The rule now recognizes that path while retaining its diagnostic-message guard. Missing global JSX namespace diagnostics (TS2503) now receive the existing agent instructions, with no automatic rewrite.

Sources

Rules and behavior notes

  • use-ref-argument: accepts TS2554 or the confirmed useRef symbol plus the required-argument diagnostic; preserves the existing undefined initialization rewrite.
  • global-jsx-namespace: accepts TS2503 only for the missing JSX namespace, preserves existing JSX diagnostic coverage, and supplies agent guidance.
  • Synthetic fixtures exercise unassigned checker findings through rule selection, planning and rewriting. Negative cases cover other symbols, missing/different diagnostics, ambiguous calls, existing initializers and other missing namespaces. Both regressions failed before the matcher fixes.

Ground-truth repositories

Unchanged. No alanagoyal sites were added: its upgrade is not a completed migration.

  • excalidraw/excalidraw@9ee0b8ffcbd3664a47748a93262860321a203821 — 73 expected findings.
  • tldraw/tldraw@5957867a9c5c205a0b0c3665be443138b8014a79 — 60 expected findings.

uptide pack test output

React's breaking precision remains 100%, with 68.99% recall unchanged (89 true positives, 0 false positives, 40 false negatives). use-ref-argument rule recall improves 80% → 100% (4/5 → 5/5); those locations were already detected, so overall site recall stays unchanged. Overall, including non-breaking findings, precision remains 92.93% and recall remains 69.70%. The existing verification record still matches; no ground truth or verification file was changed.

Pack Result Breaking precision Breaking recall
ai passed 100% 36.36%
react passed 100% 68.99%
stripe passed 100% 90.00%
vitest passed 100% 50.00%
zod passed 100% 71.25%

Commands:

  • pnpm -s uptide pack test react --json on the unchanged matcher baseline, then pnpm -s uptide pack test --json on this commit: every pack passed. The latter reruns React plus AI, Stripe, Vitest and Zod against their existing public ground truth.
  • pnpm -s uptide pack test --fixtures-only --json: all five packs passed.
  • React's 12 focused tests pass; the two regressions failed before the fixes.
  • pnpm lint and pnpm typecheck: passed.
  • TMPDIR=/private/tmp pnpm test --env-mode=loose: 1,043 core + 357 CLI tests passed; 15 opt-in network tests skipped. The macOS temporary path must be canonical, and Turbo must pass it through; the default invocation hit an unrelated /tmp versus /private/tmp assertion.
  • CI test (20), test (22), smoke (20), smoke (22): all green, including the private-material scan in the test jobs. Local strict public:check cannot read the CI-only denylist; the local document-name scan passed.
React pack test output
uptide pack test react · verified
fixtures      4 cases, 7 sites · pass
ground truth
  excalidraw/excalidraw@9ee0b8ffcbd3           react 18.2.0 → 19.0.0  predicted 60, expected 73, false positives 1, false negatives 14
    with @types/react 18.2.47 → 19.0.14, @types/react-dom 18.2.18 → 19.0.6, react-dom 18.2.0 → 19.0.0
  tldraw/tldraw@5957867a9c5c                   react 18.3.1 → 19.2.1  predicted 39, expected 60, false positives 6, false negatives 26
    with @types/react 18.3.23 → 19.2.18, @types/react-dom 18.3.7 → 19.2.7, react-dom 18.3.1 → 19.2.1

  rule                         precision  recall    tp   fp   fn
  element-props-unknown             100%     60%     6    0    4
  generic                             4%     33%     1   25    2
  global-jsx-namespace              100%     51%    20    0   19
  mutable-ref-object                100%    100%     2    0    0
  props-with-ref                    100%    100%     1    0    0
  ref-callback-return               100%    100%     1    0    0
  ref-object-nullable               100%     37%    20    0   34
  removed-react-dom                 100%    100%    18    0    0
  use-ref-argument                  100%    100%     5    0    0
  overall (sites)                    93%     70%    92    7   40
  breaking (sites)                  100%     69%    89    0   40

false positives (7)
  excalidraw/excalidraw@9ee0b8ffcbd3  dev-docs/src/theme/ReactLiveScope/index.js:10  generic (unverified)
  tldraw/tldraw@5957867a9c5c  apps/docs/components/common/newsletter-signup.tsx:32  generic (deprecated)
  tldraw/tldraw@5957867a9c5c  apps/docs/components/docs/docs-feedback-widget.tsx:65  generic (deprecated)
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/tla/components/dialogs/TlaSignInDialog.tsx:124  generic (deprecated)
  tldraw/tldraw@5957867a9c5c  templates/agent/client/components/ChatInput.tsx:17  generic (deprecated)
  tldraw/tldraw@5957867a9c5c  templates/agent/client/components/ChatPanel.tsx:14  generic (deprecated)
  tldraw/tldraw@5957867a9c5c  templates/chat/src/components/ChatInput.tsx:60  generic (deprecated)

false negatives (40)
  excalidraw/excalidraw@9ee0b8ffcbd3  dev-docs/src/components/Homepage/index.tsx:1  generic
  excalidraw/excalidraw@9ee0b8ffcbd3  dev-docs/src/pages/index.tsx:1  generic
  excalidraw/excalidraw@9ee0b8ffcbd3  examples/excalidraw/with-nextjs/src/app/page.tsx:19  global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/ButtonIconCycle.tsx:23  global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/EyeDropper.tsx:210  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/FontPicker/keyboardNavHandlers.ts:7  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/Sidebar/Sidebar.tsx:104  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/Stack.tsx:13  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/TTDDialog/TTDDialogOutput.tsx:16  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/TTDDialog/common.ts:15  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/TTDDialog/common.ts:43  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/canvases/InteractiveCanvas.tsx:20  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx:33  ref-object-nullable
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/hooks/useScrollPosition.ts:8  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/docs/components/content/copy-button.tsx:10  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/fairy/Fairy.tsx:99  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/fairy/fairy-ui/manual/FairyManualPanel.tsx:29  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/fairy/fairy-ui/manual/FairyManualPanel.tsx:30  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/fairy/fairy-ui/manual/FairyManualPanel.tsx:31  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/fairy/fairy-ui/manual/FairyManualPanel.tsx:64  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/fairy/fairy-ui/manual/FairyManualPanel.tsx:83  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/fairy/fairy-ui/manual/FairyManualPanel.tsx:286  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/src/pages/admin.tsx:1032  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  apps/dotcom/client/tsconfig.json:15  global-jsx-namespace
  tldraw/tldraw@5957867a9c5c  apps/examples/src/ExampleWrapper.tsx:111  global-jsx-namespace
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/components/default-components/DefaultBrush.tsx:18  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/components/default-components/DefaultCollaboratorHint.tsx:33  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/components/default-components/DefaultCursor.tsx:28  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/components/default-components/DefaultSelectionBackground.tsx:15  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/components/default-components/DefaultSelectionForeground.tsx:27  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/hooks/useFixSafariDoubleTapZoomPencilEvents.ts:12  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/hooks/useGestureEvents.ts:78  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/hooks/usePassThroughMouseOverEvents.ts:7  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/hooks/useScreenBounds.ts:5  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/license/Watermark.tsx:49  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/editor/src/lib/license/Watermark.tsx:97  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/tldraw/src/lib/ui/components/CursorChatBubble.tsx:80  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/tldraw/src/lib/ui/components/CursorChatBubble.tsx:108  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  packages/tldraw/src/lib/ui/components/primitives/TldrawUiContextualToolbar.tsx:55  ref-object-nullable
  tldraw/tldraw@5957867a9c5c  templates/agent/client/components/ChatInput.tsx:18  ref-object-nullable

reported under another rule (18)
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/App.tsx:1259  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/ButtonIcon.tsx:32  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/dropdownMenu/DropdownMenuItemContent.tsx:17  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/HelpDialog.tsx:109  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/IconPicker.tsx:221  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/MagicButton.tsx:35  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/Sidebar/SidebarTrigger.tsx:39  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/Stack.tsx:17  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/Stack.tsx:39  generic, expected global-jsx-namespace
  excalidraw/excalidraw@9ee0b8ffcbd3  packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx:22  generic, expected global-jsx-namespace
  tldraw/tldraw@5957867a9c5c  apps/docs/components/content/code.tsx:124  generic, expected element-props-unknown
  tldraw/tldraw@5957867a9c5c  apps/docs/components/content/code.tsx:125  generic, expected element-props-unknown
  tldraw/tldraw@5957867a9c5c  apps/docs/components/content/code.tsx:131  generic, expected element-props-unknown
  tldraw/tldraw@5957867a9c5c  apps/docs/components/content/code.tsx:170  generic, expected element-props-unknown
  tldraw/tldraw@5957867a9c5c  packages/tldraw/src/lib/ui/components/HelperButtons/StopFollowing.tsx:16  generic, expected global-jsx-namespace
  tldraw/tldraw@5957867a9c5c  packages/tldraw/src/lib/ui/components/primitives/menus/TldrawUiMenuActionCheckboxItem.tsx:20  generic, expected global-jsx-namespace
  tldraw/tldraw@5957867a9c5c  packages/tldraw/src/lib/ui/components/primitives/menus/TldrawUiMenuActionItem.tsx:14  generic, expected global-jsx-namespace
  tldraw/tldraw@5957867a9c5c  packages/tldraw/src/lib/ui/components/primitives/TldrawUiTooltip.tsx:466  generic, expected global-jsx-namespace

PASS react: verified

Every pack passed.

Checklist

  • Rules come from the existing meta.sources
  • Synthetic positive and negative fixtures; no ground-truth changes
  • Patch changeset; signed-off commit; no new dependencies
  • pnpm lint and pnpm typecheck
  • Full test suite and all-pack ground-truth results recorded

@lucasbraum
lucasbraum marked this pull request as ready for review October 10, 2026 18:09
@lucasbraum
lucasbraum merged commit 35fe251 into main Oct 10, 2026
8 checks passed
@lucasbraum
lucasbraum deleted the codex/react-pack-matchers branch October 10, 2026 18:09
@uptide-release uptide-release Bot mentioned this pull request Oct 10, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant