
Kyle CarberryandCoder
68e4155fed
feat(agent/filefinder): add plocate-lite file finder package (#22453)
Adds an in-memory trigram-indexed file finder package at
`agent/filefinder`, designed to power a future `FindFiles` HTTP handler
on the WorkspaceAgent.
## What it does
Fast fuzzy file search with VS Code-quality matching across millions of
files. Sub-millisecond search latency at 100K files.
## Architecture
- **Index**: append-only docs slice with trigram + prefix posting lists
- **Snapshot**: lock-free reader view via frozen slice headers +
shallow-copied deleted set
- **Search pipeline**: trigram intersection → fuzzy fallback (prefix
bucket + subsequence) → brute-force scan (capped at 5K docs)
- **Scoring**: subsequence match, basename prefix, boundary hits,
contiguous runs, depth/length penalties
- **Engine**: multi-root with fsnotify watcher (50ms batch coalescing),
atomic snapshot publishing
## Benchmarks (10K files)
| Query Type | Latency |
|---|---|
| exact_basename (`handler.go`) | ~43µs |
| short_query (`ha`) | ~7µs |
| fuzzy_basename (`hndlr`) | ~50µs |
| path_structured (`internal/handler`) | ~29µs |
| multi_token (`api handler`) | ~15µs |
## File inventory (11 files, 3273 lines)
| File | Lines | Purpose |
|---|---|---|
| `text.go` | 264 | Normalization, trigram extraction, scoring |
| `delta.go` | 128 | Index, Snapshot, CRUD operations |
| `query.go` | 272 | Query planning, search strategies, top-K merge |
| `engine.go` | 323 | Multi-root engine, watcher integration |
| `watcher_fs.go` | 201 | fsnotify wrapper with batch coalescing |
| `*_test.go` | 2085 | Unit tests, integration tests, benchmarks |
---------
Co-authored-by: Coder <coder@users.noreply.github.com>
2026-02-28 23:37:07 -05:00
..
2026-02-07 11:37:54 -06:00
2025-03-17 11:10:14 +02:00
2026-02-28 17:02:57 -05:00
2026-02-28 21:58:59 -05:00
2025-03-26 01:56:39 -05:00
2026-01-08 15:24:11 +04:00
2026-02-20 16:27:32 +04:00
2026-01-08 15:24:11 +04:00
2026-02-24 13:26:55 +04:00
2026-01-08 15:24:11 +04:00
2026-02-28 23:37:07 -05:00
2026-01-23 08:20:13 +01:00
2026-02-24 13:26:55 +04:00
2026-02-05 12:32:07 -06:00
2026-01-08 15:24:11 +04:00
2025-11-28 08:33:50 +02:00
2025-03-17 11:10:14 +02:00
2026-01-08 15:24:11 +04:00
2026-01-26 09:42:24 +00:00
2026-02-28 21:58:59 -05:00
2026-02-28 12:33:52 -05:00
2025-05-27 16:05:03 +04:00
2026-01-08 15:24:11 +04:00
2026-01-22 15:06:02 -07:00
2026-01-08 15:24:11 +04:00
2026-01-08 10:29:41 +04:00
2024-08-28 15:39:01 +10:00
2026-01-08 15:24:11 +04:00
2025-11-25 14:25:24 +04:00
2025-11-25 14:25:24 +04:00
2025-11-25 14:25:24 +04:00
2026-01-08 15:24:11 +04:00
2026-01-08 15:24:11 +04:00