Goal
Scale incremental indexing to hundreds of thousands of files and evaluate million-document workloads without retaining the entire changed corpus in memory. Part of Phase 2.5 in #93; follows #138 and coordinates with #139, #140, and #141.
Requirements
- Replace accumulation of all changed evaluations/bodies with bounded batches and disk-backed staging. Define limits in bytes as well as records and document handling of individual oversized files.
- Read and extract each unchanged file version once per refresh across overlapping scopes, while retaining independent type/rule assessments and context-dependent evaluation.
- Refresh persisted document content once per file version; avoid duplicate writes/indexing across scopes.
- Preserve generation checks, concurrent-reader consistency, cancellation, failed-scan retention, parse-error visibility, and publication semantics. Partial staged work must not be presented as a successfully refreshed generation.
- Define staging cleanup and recovery after cancellation or crashes. Keep staging out of collection discovery and watch feedback loops.
- Avoid moving the corpus-sized body cache into the server snapshot or another in-memory layer.
- Benchmark initial indexing, rebuild, unchanged refresh, small updates, and overlapping scopes in metadata-only and FTS modes. Record peak memory, elapsed time, database/staging size, and relevant hardware/corpus characteristics.
- Set explicit measured resource budgets during implementation. Cover 100,000 and one million documents with realistic size distributions; do not infer scalability from document count alone or a 1,000-document test.
Acceptance criteria
Boundaries
Files remain authoritative and filesystem scans are not atomic snapshots. Query-result streaming belongs to #139; bounded server materialization belongs to #141. Preserve pending edits separately from disposable staged/cache data (#142).
Goal
Scale incremental indexing to hundreds of thousands of files and evaluate million-document workloads without retaining the entire changed corpus in memory. Part of Phase 2.5 in #93; follows #138 and coordinates with #139, #140, and #141.
Requirements
Acceptance criteria
Boundaries
Files remain authoritative and filesystem scans are not atomic snapshots. Query-result streaming belongs to #139; bounded server materialization belongs to #141. Preserve pending edits separately from disposable staged/cache data (#142).