Segregate repo-owned scripts under scripts/repo - #87
Merged
Conversation
Fleet repos keep exactly two top-level script directories: scripts/fleet for cascaded, template-owned machinery and scripts/repo for everything this repository owns. scripts/utils and scripts/validate belonged to neither, so they now live at scripts/repo/utils and scripts/repo/validate. Both directories keep their own names, and the moves preserve file history. The relative imports that crossed the old boundary are re-anchored for the new depth: siblings of scripts/repo now reach the helpers through ./utils/, and the validate scripts reach the fleet path constants through ../../fleet/.
Both files reached for REPO_ROOT without a working import, so neither could load. no-link-deps.mts had no import statement at all and threw a ReferenceError the moment it was run, and changed-test-mapper.mts imported ../paths.mts, a file that does not exist anywhere in the tree. Neither break was visible from CI: the typecheck project covers only src and test, and no package.json script or workflow ever invoked these two files. Both now import REPO_ROOT from the fleet path constants like every sibling does, and both load and run clean.
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.
Fleet repos are supposed to keep exactly two top-level directories under
scripts/:scripts/fleet/for the cascaded, template-owned machinery, andscripts/repo/for everything this repository owns itself. This repo had two extra directories that belonged to neither, so nothing about them said who maintained them or whether a cascade would overwrite them. This moves both underscripts/repo/, keeping their own names.Moves
scripts/utils/scripts/repo/utils/scripts/validate/scripts/repo/validate/Both are
git mv, sogit log --followstill works on every file.References fixed
Nothing outside
scripts/named either directory — nopackage.jsonscript, no workflow, no tsconfig, no vitest or coverage glob, no doc. The only references were relative imports insidescripts/, and they only needed re-anchoring because the moves changed how deep the files sit:scripts/repo/(build.mts,claude.mts,clean.mts,ci-validate.mts) reached the helpers through../utils/and now use./utils/.scripts/repo/validate/reached the fleet path constants through../fleet/paths.mtsand now use../../fleet/paths.mts.validatefiles import../utils/error-message.mts, which still resolves unchanged because both directories moved together.Two broken files this surfaced
Reading every moved file turned up two that could not load at all, both broken before this branch:
no-link-deps.mtsusedREPO_ROOTbut had no import for it anywhere in the file. Running it onmainthrewReferenceError: REPO_ROOT is not definedon line 14.changed-test-mapper.mtsimportedREPO_ROOTfrom../paths.mts, and there is noscripts/paths.mtsin the tree.Neither break could show up in CI: the typecheck project only covers
srcandtest, and nopackage.jsonscript or workflow invokes either file. They are fixed in a separate commit, both importingREPO_ROOTthe way every sibling already does. Worth knowing that these two, plus the other fivevalidatescripts, have no caller in this repo at all —pnpm run checkand the fleet scripts cover the same ground now. Deciding whether to keep or delete them is a follow-up, not something to fold into a move.Verification
Run on a clean tree after
pnpm run build:Commands and results
pnpm run lint --allpnpm run typepnpm run test --allpnpm run buildThe same three commands pass identically on an untouched
origin/maintree, so there is no before/after difference to explain.All seven scripts under
scripts/repo/validate/were run directly after the move and all seven exit 0 with their success message. Both files underscripts/repo/utils/were imported and export what they did before.One thing for the template side
scripts/fleet/namesscripts/repo/*paths in 69 files, and 34 of the paths named do not exist in this repo — they are wheelhouse-only scripts such assync-scaffolding/*,gen/npmrc.mts, andcleanup-stranded.mts. None of them touch the two directories this PR moves, so nothing here depends on it. Flagging it because those dangling references are template-side and are not mine to rewrite from a member repo.