Expand description
Indexing — walk a checkout, extract symbols, persist incrementally.
Decoupled from search: it only writes. Unchanged files (same content hash) are skipped, and coverage is recorded so search can judge its own confidence.
Structs§
- Stats
- Outcome of an indexing run.
Enums§
- Refresh
- Result of revalidating a single file against what’s on disk.
Functions§
- branch_
changed_ files - Repo-relative files you’re working on this branch: committed changes since the branch diverged from the trunk, plus uncommitted edits. Empty on the trunk itself (where it isn’t a useful signal) or outside git. Feeds the branch ranking boost — necessarily a few git calls, but gated to feature branches.
- detect_
identity - Best-effort repository identity: upstream git remote, else the local path.
- git_
head - The current HEAD commit sha, or
Noneoutside a git work tree. - index_
budgeted - Opportunistic, time-bounded indexing — warm the index a little per call so no
single query blocks on a full walk of a large repo.
active(branch) files are parsed first and ignore the budget (the working set stays fresh); then the walk streams the rest, honoringbudget. Whenqueryis set, files whose path matches it are parsed first (a cheap, in-memory reorder of the candidate list — no file reads), so a relevant symbol indexes fast. A sweep that finishes within budget marks coveragecomplete, elsewarming. - index_
budgeted_ cancellable - Like
index_budgeted, but the pass stops promptly whencancelis set — the interactive cold-start escalation (see the CLI’s search path) runs a long, generous-budget warm and lets the user abort it with Ctrl-C without losing the batches already committed. - index_
path - Index the whole repository rooted at
root. - index_
under - Index
root, or — whensubdirsis non-empty — only those repo-relative subtrees of it. Unbounded: an explicit index is thorough. A whole-repo index also reconciles deletions; a subtree index is a seed (it gets those files in first) that leaves coveragewarming, so normal warming continues over the rest of the repo through use. - is_
dirty - Whether the work tree has uncommitted changes to tracked files (staged or
unstaged).
--untracked-files=noskips the work-tree-wide untracked-file scan — the expensive, cold-cache-sensitive part ofgit statuson a large repo (it walks to classify every path against.gitignore). This runs on every search to gate warming, so the scan dominated query-time variance. - is_
git_ repo - Whether
rootis inside a git work tree. Implicit (opportunistic) indexing is gated on this so a stray query never walks a non-repo directory. Native (nogitfork) — it runs on every search. - parse_
jobs - Parse workers for one indexer pass — the configured value, else
RQ_JOBS, else an auto default. Parsing is CPU-bound but writes serialize through one SQLite writer, so flooding every core rarely pays; the default caps at 8. - refresh_
file - Lazily revalidate one indexed file against disk: re-extract it if its content changed. This is the staleness check search runs over its top results.
- repo_
root - The git work-tree root at or above
path— the nearest ancestor holding a.gitentry — found without shelling out..gitmay be a directory or a file (worktrees, submodules), so we test existence either way.Nonewhenpathis not inside a work tree. - scan
- Live, budgeted scan (search Layer 4): stream-walk
rooton the same fused [stream_walk] engine as the indexer, parsing source files and returning the parsedFileSymbolswithout touching the store — sorqanswers at zero coverage. Bounded and filtered: - set_
parse_ jobs - Set the parse-worker count (from
--jobs/RQ_JOBS); 0 restores auto.