Skip to content

engine: count pruned directories in the receipt's skip accounting - #84

Merged
dejo1307 merged 1 commit into
mainfrom
fix/engine-count-pruned-directories
Jul 9, 2026
Merged

engine: count pruned directories in the receipt's skip accounting#84
dejo1307 merged 1 commit into
mainfrom
fix/engine-count-pruned-directories

Conversation

@dejo1307

@dejo1307 dejo1307 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

walkRepo returned filepath.SkipDir before reaching skips.count++, so an ignored directory's files landed in no bucket: not files_seen, not files_skipped. The metric counted only ignored FILES the walker reached -- 9 on a tree with ~67k ignored files, naming none of them. A bad ignore glob, the thing this metric exists to catch, is almost always a directory glob.

Count a pruned directory once, in a new dirs_skipped field, rather than walking node_modules/ purely to size it. Each skipped_sample entry now names the glob that matched it, so "why is this file missing?" is a lookup. To get the pattern, matchAnyGlob is split into matchGlob, which returns it; matchAnyGlob wraps it, so both glob lists still share one matcher.

Exclude the configured output dir: .enola/** is itself a directory glob, so counting it would make dirs_skipped differ between a repo's first snapshot and every later one, and land as a phantom delta in diff_snapshot.

No cacheVersion bump -- facts.jsonl is byte-identical across the fix, so no cachecov entry and no golden regeneration. Adds the tests that were missing: nothing asserted files_skipped and no golden fixture contains an ignored directory, which is how this survived 96 bumps.

walkRepo returned filepath.SkipDir before reaching skips.count++, so an
ignored directory's files landed in no bucket: not files_seen, not
files_skipped. The metric counted only ignored FILES the walker reached --
9 on a tree with ~67k ignored files, naming none of them. A bad ignore glob,
the thing this metric exists to catch, is almost always a directory glob.

Count a pruned directory once, in a new dirs_skipped field, rather than
walking node_modules/ purely to size it. Each skipped_sample entry now names
the glob that matched it, so "why is this file missing?" is a lookup. To get
the pattern, matchAnyGlob is split into matchGlob, which returns it;
matchAnyGlob wraps it, so both glob lists still share one matcher.

Exclude the configured output dir: .enola/** is itself a directory glob, so
counting it would make dirs_skipped differ between a repo's first snapshot
and every later one, and land as a phantom delta in diff_snapshot.

No cacheVersion bump -- facts.jsonl is byte-identical across the fix, so no
cachecov entry and no golden regeneration. Adds the tests that were missing:
nothing asserted files_skipped and no golden fixture contains an ignored
directory, which is how this survived 96 bumps.
@dejo1307
dejo1307 merged commit f998f65 into main Jul 9, 2026
4 checks passed
@dejo1307
dejo1307 deleted the fix/engine-count-pruned-directories branch July 18, 2026 06: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.

1 participant