You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
discoverFiles processes a file once per include folder it falls under — overlapping includeFolders double every file #59
area: coreTouches core library / runtime source codepriority: mediumShould be addressed in the normal course of developmentsemver: patchThis release contains only backwards-compatible bug fixesstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expected
discoverFiles() (src/core/file-discovery.mjs) walks each entry of includeFolders independently and concatenates the results without de-duplicating. When the include folders overlap — most commonly "." next to subfolders — every file under the overlap is returned, and then processed, once per folder that contains it. Each processed file also runs its own git history/author lookups (src/utils/git.mjs), so the redundant work multiplies the slowest part of a run.
npm run fix:headers reports Files scanned: 1922 for 964 real files, and took 514 s on a loaded machine.
Expected
Each file is discovered and processed once, however the include folders overlap.
Fix
De-duplicate the discovered list by resolved absolute path before returning it (e.g. collect into a Set), and skip a root that is itself inside an earlier root.
Optional follow-up: a way to include a folder non-recursively (e.g. { path: ".", recursive: false }), since "." currently always means the whole tree. Consumers that list "." to mean "root files only" get a whole-repo walk instead. With de-duplication and .gitignore applied that is harmless, so it is not needed to fix the doubling.
area: coreTouches core library / runtime source codepriority: mediumShould be addressed in the normal course of developmentsemver: patchThis release contains only backwards-compatible bug fixesstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expected
Activity
Shinrai commentedon Sep 28, 2026
Merged into
nextvia #60:discoverFiles()returns each file once whenincludeFoldersoverlap (the doubling fix).{ path, recursive: false }to take only that folder's own files.Ships in v1.4.0 (release PR #47); this issue closes when that release lands on
master.release: v2.0.0 - re-cut the release notes as v2.0.0