fix: index.extra_ignores is parsed but never applied by the walker #61

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

Source: a1x dogfood session (external agent) on a 235-project .NET repo.

Symptom

Setting extra_ignores = ["obj/", "bin/", ...] in .code-index.toml has no effect — the walker ingests those paths anyway, and startup logs nothing about ignores, so the operator cannot tell it was a no-op.

Root cause

IndexConfig.extra_ignores (crates/indexer/src/config.rs:53) is parsed into the struct but no code ever reads it. walker::walk(root) and walker::Coverage::new(root) build their filter solely from skip_set_for(root) + .code-index-ignore + standard gitignore. Whole-workspace grep found the field only in the struct definition and the code-index init template.

Fix (implemented, pending commit)

  • New walker::extra_ignores_matcher(root) loads the root manifest and compiles index.extra_ignores (gitignore syntax) into a Gitignore.
  • Applied in BOTH walk() (per-entry — prunes ignored dirs) and Coverage::permanently_excluded (via matched_path_or_any_parents) from the ONE shared helper, so the enumerator and the coverage oracle cannot drift (guarded by the existing walk↔coverage agreement test).
  • New config::log_effective_ignores(root, cfg) logs the effective ignore set (skip dirs + extra_ignores) at daemon / mcp / cli-index startup, alongside the size-cap line.
  • Test: walker::tests::extra_ignores_applied_in_walk_and_coverage.

.code-index-ignore already worked as a per-directory override; this makes the documented TOML field work too.

**Source:** a1x dogfood session (external agent) on a 235-project .NET repo. ## Symptom Setting `extra_ignores = ["obj/", "bin/", ...]` in `.code-index.toml` has no effect — the walker ingests those paths anyway, and startup logs nothing about ignores, so the operator cannot tell it was a no-op. ## Root cause `IndexConfig.extra_ignores` (crates/indexer/src/config.rs:53) is parsed into the struct but **no code ever reads it**. `walker::walk(root)` and `walker::Coverage::new(root)` build their filter solely from `skip_set_for(root)` + `.code-index-ignore` + standard gitignore. Whole-workspace grep found the field only in the struct definition and the `code-index init` template. ## Fix (implemented, pending commit) - New `walker::extra_ignores_matcher(root)` loads the root manifest and compiles `index.extra_ignores` (gitignore syntax) into a `Gitignore`. - Applied in BOTH `walk()` (per-entry — prunes ignored dirs) and `Coverage::permanently_excluded` (via `matched_path_or_any_parents`) from the ONE shared helper, so the enumerator and the coverage oracle cannot drift (guarded by the existing walk↔coverage agreement test). - New `config::log_effective_ignores(root, cfg)` logs the effective ignore set (skip dirs + extra_ignores) at daemon / mcp / cli-index startup, alongside the size-cap line. - Test: `walker::tests::extra_ignores_applied_in_walk_and_coverage`. `.code-index-ignore` already worked as a per-directory override; this makes the documented TOML field work too.
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#61
No description provided.