fix: classify_walked reports "too large" for ineligible extensions (order-dependent skip reason) #62

Closed
opened 2026-08-05 12:37:14 +02:00 by buildagent · 0 comments
Member

Source: a1x dogfood — two fonts in one directory reported different skip reasons purely by size.

Symptom

In a font/.otf directory, one file logs reason="too large" and another reason="ineligible extension" for the same extension. The reported reason depends on file size rather than on the size-independent fact that the extension is never indexed.

Root cause

classify_walked (crates/indexer/src/index.rs) applied the size cap BEFORE the eligibility check, so a large file whose extension no plugin claims and that isn't text-eligible was attributed "too large" instead of "ineligible extension".

Fix (implemented, pending commit)

Reordered: decide eligibility (plugin-claimed OR text-eligible) first, then apply the size cap only to files we would otherwise index. Large source/text files still report "too large"; ineligible extensions always report "ineligible extension" regardless of size.
Test: index::tests::large_ineligible_extension_reports_extension_not_size.

**Source:** a1x dogfood — two fonts in one directory reported different skip reasons purely by size. ## Symptom In a font/`.otf` directory, one file logs `reason="too large"` and another `reason="ineligible extension"` for the same extension. The reported reason depends on file size rather than on the size-independent fact that the extension is never indexed. ## Root cause `classify_walked` (crates/indexer/src/index.rs) applied the size cap BEFORE the eligibility check, so a large file whose extension no plugin claims and that isn't text-eligible was attributed `"too large"` instead of `"ineligible extension"`. ## Fix (implemented, pending commit) Reordered: decide eligibility (plugin-claimed OR text-eligible) first, then apply the size cap only to files we would otherwise index. Large source/text files still report `"too large"`; ineligible extensions always report `"ineligible extension"` regardless of size. Test: `index::tests::large_ineligible_extension_reports_extension_not_size`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#62
No description provided.