refactor(scripts): segregate repo-owned script dirs - #309
Closed
John-David Dalton (jdalton) wants to merge 3 commits into
Closed
refactor(scripts): segregate repo-owned script dirs#309John-David Dalton (jdalton) wants to merge 3 commits into
John-David Dalton (jdalton) wants to merge 3 commits into
Conversation
The fleet script layout gives root scripts/ exactly two tiers: scripts/fleet/ for cascaded, template-owned machinery and scripts/repo/ for this repo's own tooling. Seven directories sat loose at the root instead, so nothing said whether a cascade owned them: ci, constants, maintenance, npm, templates, testing, and validation. Each directory keeps its name and moves down one level, so scripts/npm/publish-npm-packages.mts is now scripts/repo/npm/publish-npm-packages.mts. Imports between the moved directories are unchanged because they moved together. Imports that reached out to scripts/fleet gained a level, imports that reached into scripts/repo lost one, and floor-node-smoke.mts walks up one more directory to find the repo root. Six file-doc headers switch from /** to /*. They carry markdown that the formatter strips out of a JSDoc block, and the fleet check that catches this only reads scripts/repo, so the move brought them into view.
Everything that named a moved script now names its new home: the 13 package.json script entries, the npm-publish workflow step, the perf fixture import, and the test suite's imports and read paths. Two path lookups were built segment by segment rather than as one string, so a search for the old text missed them. The weekly update chain resolved update-manifest.mts by joining 'scripts' and 'npm', and three publish tests read their source files the same way. Both now include the repo segment.
CLAUDE.md and the two repo agent docs pointed at the old script locations. The workspace catalog comment pointed at a path that never existed: socket-scopes.mts lives under scripts/fleet/ constants, not scripts/constants, so the move would have carried the mistake forward. It now names the real file.
Collaborator
Author
|
[agent] Closing: fleet members land directly on main rather than through PRs. The work stands unchanged and lands as commits. |
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.
Root
scripts/is meant to hold exactly two tiers:scripts/fleet/for cascaded machinery the template owns, andscripts/repo/for tooling this repo owns. Seven directories sat loose at the root instead, so nothing in the tree said which side of that line they were on. This moves all seven underscripts/repo/, each keeping its own name.Moves
scripts/ci/scripts/repo/ci/scripts/constants/scripts/repo/constants/scripts/maintenance/scripts/repo/maintenance/scripts/npm/scripts/repo/npm/scripts/templates/scripts/repo/templates/scripts/testing/scripts/repo/testing/scripts/validation/scripts/repo/validation/Every move is a
git mv, so blame and history follow the files.What had to change with them
Imports between the seven directories are untouched, because they all moved together and their relative distance never changed. What did change:
Reference sites updated, by kind
scripts/fleet/gained a level (../fleet/to../../fleet/); reaching intoscripts/repo/lost one (../repo/util/to../util/).scripts/repo/that imported the old locations, mostlyscripts/repo/util/*pulling constants.package.jsonscript entries, plus therun:step in.github/workflows/npm-publish-packages.yml.CLAUDE.md, two files underdocs/agents.md/repo/, and apnpm-workspace.yamlcomment.Two lookups built their path one segment at a time rather than as a single string, so searching for the old text did not find them: the weekly update chain resolving
update-manifest.mtsinscripts/repo/update.mts, and three publish tests reading their own source.floor-node-smoke.mtsalso walks one more directory up to reach the repo root.The
pnpm-workspace.yamlcomment pointed atscripts/constants/socket-scopes.mts, which never existed — the file isscripts/fleet/constants/socket-scopes.mts. Rather than carry the mistake forward under a new prefix, it now names the real file.Six file-doc headers switch from
/**to/*. They carry markdown that the formatter strips out of a JSDoc block, andmarkdown-doc-headers-are-plainonly scansscripts/repo/, so the move is what brought them into view.Verification
pnpm run lint --all,pnpm run type, andpnpm test --allare all green (2790 passing).pnpm run checkfails 11 checks, the same 11 that fail on a cleanorigin/mainworktree, with the same findings.Not yet resolved, and both belong upstream in the wheelhouse rather than here.
entry-scripts-are-fail-softcounts 5 unguarded entrypoints onmainand 28 here — the check reads onlyscripts/fleet/andscripts/repo/, so the 23 extra are pre-existing violations the move made visible, not new ones. Separately, the markdownlint ignore glob**/scripts/templates/**in.config/fleet/.markdownlint-cli2.jsoncno longer matches, which adds 6MD041findings on the package-README templates; that config is template-owned, so the glob wants widening at the source.#308 touches
scripts/npm/configure-staged-publishing-browser.mtsand will need a path rebase once this lands.Note
Low Risk
Path-only relocation with broad reference updates; no publish or runtime behavior change intended. Residual risk is a missed stale path or a markdownlint glob still targeting the old
scripts/templates/location.Overview
Moves seven repo-owned script trees from loose
scripts/<name>/paths intoscripts/repo/<name>/(ci,constants,maintenance,npm,templates,testing,validation), soscripts/only exposesfleet/(cascaded) vsrepo/(this registry).Updates every caller of those entrypoints: root
package.jsonscripts, thenpm-publish-packages.ymlstage step, imports across moved files (extra../forscripts/fleet/, shorter paths for repoutil/), tests/perf fixtures, and agent docs (CLAUDE.md,architecture.md,override-impact-analysis.md).pnpm-workspace.yamlnow points Socket-scope soak bypass comments atscripts/fleet/constants/socket-scopes.mtsinstead of a non-existentscripts/constants/path.Small follow-on fixes inside the moved tree:
scripts/repo/update.mtsresolvesupdate-manifest.mtsunderscripts/repo/npm/;floor-node-smoke.mtswalks one more level to the repo root; six file headers switch from/**to/*so markdown in headers survives formatting under repo-owned lint rules.Reviewed by Cursor Bugbot for commit abf28dc. Configure here.