walk() collected dirents by extension only, then readFileSync'd each — so a broken symlink named *.md (e.g. the gitignored CLAUDE.md worktree symlink whose target is absent in a gsd-test Docker copy) crashed the #1073 guard with ENOENT. It passed on a developer Mac (the symlink resolves) and in GitHub CI (CLAUDE.md is gitignored/absent), failing only on the gsd-test-docker-from-worktree path — a real error hiding behind the local environment, not a flake. Guard the collection with entry.isFile() so symlinks (and other non-regular dirents) are skipped deterministically on every platform; gitignored files are not shipped repo text, so excluding CLAUDE.md is correct. Add a deterministic regression test (dangling *.md symlink fixture, Windows-symlink-guarded with a genuine t.skip) asserting walk() excludes the broken symlink and the read loop never throws ENOENT. Closes #1545. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4.2 KiB
4.2 KiB