Scoped Git searches now share one whole-repo committed index instead of building a separate one per scope. Clean trees skip the dirty layer.
No flag changes. First scoped search after upgrade may rebuild the index once; later scopes reuse it.
What changed
- Scopes share one committed index. A scoped search (
seek 'needle' ./cmd/seek) reuses the repo's whole-repo index and filters by scope at search time — less rebuild churn across subtrees of the same repo. - Clean trees do no dirty work. A clean in-scope tree skips the dirty layer — no dir, no state writes.
- Over-cap repos fall back. When the whole repo exceeds the index caps, search uses the per-scope committed layer instead. A
.git_cap_exceededmarker (keyed by HEAD + cap limits) caches that verdict so the budget isn't re-scanned every search; a HEAD or cap change re-evaluates.
Dev/test
- Shared
committed_sharedlayer on the plan; per-scopecommitted*kept as over-cap fallback.resolveCommittedLayerpicks the layer;prepareAndSearchCorpusOncerepointsplan.committed*and zerosplan.dirty*on a clean tree. - Cap marker:
read/write/removeGitCapMarker+gitCapMarkerValue(treeish + cap limits), best-effort (write failure only warns). - Coverage: shared reuse across scopes, over-cap fallback, clean-tree elision, cap-marker invalidation, state validation skipping the elided dirty layer.