Skip to content

fix(codemod): use physical filenames for retained registry proofs - #3066

Merged
domgan-oai merged 4 commits into
octanejs:mainfrom
openai-oss-forks:codex/codemod-registry-proof-paths
Nov 18, 2026
Merged

domgan-oai merged 4 commits into
octanejs:mainfrom
openai-oss-forks:codex/codemod-registry-proof-paths

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

After #3045 canonicalized the strict TypeScript proof program, #3052 still looked up the retained registry by its lexical filename. When a project is reached through a parent symlink, that lookup misses the physical source file and the codemod can silently rewrite a retained React createElement import to Octane. Apply the same proof-only filename policy to the registry and local-hook lookups, keeping preserveSymlinks: true lexical.

Follow-up to merged #3052; Refs #2776 and #2851.

Validation

  • pnpm format:check
  • pnpm typecheck
  • pnpm test
  • targeted tests: 38 combined retained-registry, cached-root, workspace-hook, physical/linked, preserve-symlinks, and merged fix(codemod): migrate verified selected context aliases #3055 context-alias/wildcard controls after integrating live main 1931c903f6; the explicit parent-symlink registry regression failed on the merged integration and passes with this repair.
  • Codemod TypeScript build, scoped Prettier, git diff --check, and pnpm sync.
  • Independent complexity review; concise-code: src +6 −2, runtime +0 −0; patch changeset only, no new export. Reuse the existing TypeScript proof-path helper rather than adding another realpath mechanism. Bytes: not applicable.
  • perf-review: not applicable (codemod-only diff).

Risk / follow-ups

Only lookups into the existing strict proof program change. Lexical module resolution, ownership checks, and write guards remain intact; the unrelated TypeScript program is untouched.

Local validation used the managed worktree’s previously installed TSRX packages (@tsrx/core 0.5.5, @tsrx/oxc 0.23.0, esrap 2.3.2). The configured internal registry did not have the upgraded packages, and an alternate public-registry install was not approved. Current-head CI must validate the exact live-main lockfile versions (core 0.6.3, oxc 0.24.0, esrap 2.4.2).

Provenance

  • An agent produced this diff (agent-authored)

Codex task · host com-79386


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Note

Low Risk
Codemod-only change to proof-program source lookups; lexical resolution and write behavior stay the same when preserveSymlinks is enabled.

Overview
Aligns retained React registry and local-hook lookups with the existing strict TypeScript proof program: when preserveSymlinks is not set, program.getSourceFile now uses proofPath (physical path) instead of the lexical path, matching how proof files are registered after #3045.

This fixes a regression where projects reached through a parent directory symlink failed to find registry/hook source files in the proof program, which could incorrectly migrate retained createElement boundaries. Lexical paths are still used when preserveSymlinks: true.

Adds a through a parent symlink retained-registry test case and a patch changeset for @octanejs/codemod.

Reviewed by Cursor Bugbot for commit b113c33. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No byte growth, no added work, and no timing changes beyond ±3%.

Compares 1931c903f, the merge commit's first parent with 9d2ca0dfb on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 2.550 2.483 ±0.0% −0.0% … +1.9% ⚪ within noise
octane-tsrx replace 4.892 5.117 ±0.0% −4.0% … +3.9% ⚪ within noise
octane-tsrx add 2.142 2.242 +4.5% ±0.0% … +4.8% ⚪ within noise
octane-tsrx update 0.094 0.094 +0.9% −1.5% … +1.6% ⚪ within noise
octane-tsrx select 0.006 0.005 −0.5% −3.2% … +1.1% ⚪ within noise
octane-tsrx swap 0.018 0.017 +1.7% +0.6% … +2.8% ⚪ within noise
octane-tsrx remove 0.014 0.013 −3.2% −5.7% … −0.0% ⚪ within noise
octane-tsrx runlots 21.325 22.225 +3.7% −0.2% … +7.1% ⚪ within noise
octane-tsrx select_lots 0.006 0.006 +1.3% +0.5% … +2.7% ⚪ within noise
octane-tsrx clear 48.492 49.250 −0.7% −2.9% … +1.4% ⚪ within noise
octane-jsx run 5.942 6.050 +0.9% −5.8% … +15.1% ⚪ within noise
octane-jsx replace 12.375 11.850 −4.9% −13.2% … +7.3% ⚪ within noise
octane-jsx add 5.158 5.567 +6.7% −9.9% … +14.0% ⚪ within noise
octane-jsx update 0.274 0.271 +0.4% −5.6% … +14.1% ⚪ within noise
octane-jsx select 0.153 0.138 −1.2% −5.1% … +1.2% ⚪ within noise
octane-jsx swap 0.124 0.119 −0.9% −3.8% … +1.0% ⚪ within noise
octane-jsx remove 0.107 0.109 +0.7% −0.3% … +1.3% ⚪ within noise
octane-jsx runlots 29.467 27.825 +1.1% −4.4% … +7.9% ⚪ within noise
octane-jsx select_lots 0.825 0.833 −2.1% −3.2% … −1.0% ⚪ within noise
octane-jsx clear 51.842 51.100 −2.5% −8.4% … +0.0% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

No changes across 111 measured values.

Public-import reachability bundles (bytes)

No changes across 141 measured values.

@domgan-oai
domgan-oai merged commit 410f78d into octanejs:main Nov 18, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant