Skip to content

test(scripts): skip tracked paths missing from disk in the script gates (#853) - #916

Merged
JArmandoAnaya merged 2 commits into
mainfrom
fix/853-tracked-files-enoent
Oct 12, 2026
Merged

JArmandoAnaya merged 2 commits into
mainfrom
fix/853-tracked-files-enoent

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

Closes #853

The script gates in tests/scripts/ list files with git ls-files and read every entry. The index can name a path that is not on disk (an unstaged rename or delete), so the gate crashed with ENOENT, which reads as a design-token violation rather than a working-tree state.

  • Add tests/scripts/tracked.mjs: trackedFiles(pathspecs, root) lists the index and keeps only paths that exist on disk.
  • Route the gates that read listed files through it (design_tokens, design_system, annotator_boundary, form_buttons, e2e_discipline, cdn_vendor_boundary, media_core_boundary, ui_core_boundary, checks_wiring, cooldown, docs_links).
  • Add tracked.test.mjs, which runs against a scratch repo with an unstaged deletion; removing the existence filter turns it red.

Behaviour change: in docs_links, a link to a file that is in the index but missing from disk is now reported as broken; before it counted as resolved.

Verification: node --test "tests/scripts/*.test.mjs" on Node 24, 172 pass, 0 fail.

JArmandoAnaya and others added 2 commits October 12, 2026 01:36
…es (#853)

The gates listed files with `git ls-files` and read every entry, so an
unstaged rename or delete crashed them with ENOENT. A shared
`trackedFiles` helper now lists the index and keeps only paths that exist
on disk; every gate that reads listed files goes through it.
@JArmandoAnaya
JArmandoAnaya merged commit 3ffa8bd into main Oct 12, 2026
31 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the fix/853-tracked-files-enoent branch October 12, 2026 08:54
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.

Script gates crash with ENOENT when a tracked file is not on disk

1 participant