Repository navigation
fix(repo): ignore the conversions-registry codemod's in-tree scratch dir - #30100
Merged
Merged
Conversation
arraysProof() makes its mkdtemp under packages/spec so the copied src resolves the package's own node_modules (zod and friends), so the dir stays in the tree and gets a tracked ignore rule instead of moving to os.tmpdir(). Clears the exposedScratchDirs self-test case that went red on main at d79eecf. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziUhP2qtBGrqtbPFTj
Contributor
Author
|
domain:devx#1 · os-support-ai · session_01WGufzgBDcBNVmSmo7VFHpj Stamp: 2026-11-04T13:46Z 维护者速读
席位核对
|
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.
Requested by Yibo Wang · project thread
Refs #30078
维护者速读
.gitignore加一条跟踪规则packages/spec/.codemod-arrays-*/(含三行注释),放在packages/spec/src/migrations/registry.ts.*.tmp旁边。只有这 5 行。d79eecfe)给scripts/codemod-split-conversions-registry.mjs加了arraysProof(),它在packages/spec/里mkdtempSync('.codemod-arrays-')。PM dispatch-gates self-test 的exposedScratchDirs用例要求树内每个临时目录都被跟踪的 ignore 规则覆盖,于是 main 的Lint · PM dispatch-gates红了(1 of 2234)。os.tmpdir()」:探针把 spec 的src复制进临时目录再用 tsx 加载,复制出来的源码有 391 处from 'zod',靠从packages/spec/往上找node_modules解析,搬出树外就解析不到。回滚 = revert。.gitignore第 71–74 行。node -e "import('./scripts/pm/dispatch-gates.mjs').then(m=>console.log(m.exposedScratchDirs({}).exposed))":main 上列出两个.codemod-arrays-0osprobe目录,本分支为[]。skip-changeset)。Clause-②: no
Metadata-protocol: none
What changes
.gitignore. Addspackages/spec/.codemod-arrays-*/with a three-line comment, next to the existingregistry.ts.*.tmpstaging rule.git check-ignore -v --no-indexnow answers.gitignore:74:packages/spec/.codemod-arrays-*/for both probe paths the gate asks about (packages/spec/.codemod-arrays-0osprobe/leftover-probeand…/unpack/leftover-probe).Why this fix and not moving the scratch dir
The order offered two remedies: (a) a tracked ignore rule, or (b) moving
arraysProof()'smkdtempSynctoos.tmpdir(). (b) does not work. The probe copiespackages/spec/srcinto the scratch dir and loads it withtsx(cwdpackages/spec). The copied sources importzodat 391 sites, plustypescriptand@objectstack/spec/*self-references, and Node resolves those bare specifiers by walking up from the importing file topackages/spec/node_modules. Underos.tmpdir()that walk finds nothing. So the scratch dir has to stay insidepackages/spec/, and (a) is the smaller sufficient fix. The codemod already removes the dir in afinally; the rule covers a leftover from a killed run.The gate (
exposedScratchDirsinscripts/pm/dispatch-gates.mjs), its self-test and its case list are untouched.Readings
origin/maind79eecfeexposedScratchDirs({}).exposedpackages/spec/.codemod-arrays-0osprobe (scripts/codemod-split-conversions-registry.mjs:843),packages/spec/.codemod-arrays-0osprobe/unpack (…:858)[]; both nowcoveredby.gitignore:74node scripts/pm/dispatch-gates.mjs --self-test(both tiers, as the push run)✗ dispatch-gates self-test: 1 of 2234 case(s) failed., the one ✗ being the EXPOSED line above (33 min)✓ dispatch-gates self-test: 2234 cases pass.(fast 1945 in 509 s, slow 289 in 1465 s), the case reads ✓Gates
node scripts/pm/dispatch-gates.mjs --commandsderives 8 commands for this change set; each ran on the branch:dispatch-gates --ran: 8 derived, 8 run, 0 NOT-MEASURED, 0 UNRUN.Changeset
Root config only, no published package moves:
skip-changeset.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufziUhP2qtBGrqtbPFTj