Base: upstream main 47f2c8d29e981c7723467efe137ee19e91df924e. Change: only ThreadFind.ts and ThreadFind.test.ts. Synthetic data only; no installed T3 state or credentials used. The gist's current revision replaces the initial rendered-only budget experiment with the reviewed source-aware budget and fresh measurements. GitHub retains older gist revisions as historical evidence.
Use Node v26.12.1 with repository dependencies installed (vp i, respecting AGENTS setup markers). Download this gist to a new disposable directory outside the checkout. Export T3_FIND_REPO as the absolute patched checkout path. In that new directory:
ln -s "$T3_FIND_REPO/apps/server/node_modules" node_modules
git -C "$T3_FIND_REPO" show 47f2c8d29e981c7723467efe137ee19e91df924e:apps/server/src/orchestration-v2/ThreadFind.ts > ThreadFind.baseline.ts
python3 run-benchmarks.pyUse a fresh evidence directory: the driver creates new SQLite databases. The Node import hook substitutes only baseline ThreadFind.ts; every other production module stays identical. Both processes use production ProjectionStore.searchThreadStream and Sqlite.layerFromPath (migrated file-backed SQLite, WAL, reader worker). They append/apply synthetic events through the real EventStore/ProjectionStore. Seeding and module loading are outside timing.
Each process searches 2,600 messages/plans (859,229 source-text code units), using 21 distinct prefixes. The first query is cold; the other 20 search one unchanged committed revision. Query-dependent results contain 520–2,600 matches. The benchmark asserts expected totals/first match and hashes both streamed frames, including navigation and snapshotSequence, for parity. Five separate process pairs alternate baseline/final order. all-runs.json keeps all per-query measurements/hashes; summary.json aggregates the median of each process's warm-query medians.
Observed host: Linux aarch64, Node v26.12.1, 8 CPUs, shared host with substantial contention. Load average at end: 30.15/26.21/16.81. Timings are descriptive of this workload, not production latency guarantees.
| Measurement | Baseline | Final |
|---|---|---|
| Warm changed query, complete (median) | 313.67 ms | 28.89 ms |
| Warm changed query, first frame (median) | 128.78 ms | 3.29 ms |
| Payload batches per warm query | 21 (2,600 rows) | 0 |
| SQL statements per warm query | 27 | 2 |
| Cold query, complete (median) | 2874.17 ms | 3180.98 ms |
All 105 before/after streamed response pairs were identical. The two remaining SQL reads check active-thread/cwd and event revision. The cold path still hydrates/decodes every candidate payload before its first frame; no cold-query improvement is claimed (the final cold median is higher, amid wide variation). For full per-process ranges see summary.json.
Heap observations are not allocation-volume measurements: explicit GC before/after all 21 queries, sampling heapUsed after each query. Median retained growth was 15.76 MB baseline and 8.66 MB final; median sampled high-water heap 233.01 MB and 106.89 MB. These do not measure true peak heap or establish a general heap reduction. Source/segment sharing and GC influence these numbers.
One most-recent completed snapshot, max 8,192 documents and 2,097,152 summed source plus rendered UTF16 code units. Counting source text matters because V8 substring segments may keep the source alive. The new cache stores no raw payloads or decoded items. Query-result entries strip segments/source-length metadata. Existing parsed-text caches remain unchanged. This is a text/item bound, not an exact process-memory cap. Over-budget threads fall back to the existing path. Any thread or fork-ancestor event invalidates reuse. Continuously changing threads do not receive this benefit; concurrent searches across different threads may evict each other's snapshot. A cancelled scan does not populate the snapshot until a full scan finishes, so continuous fast typing may defer reuse until a query completes.
- red.log: on baseline, two different queries over 520 messages made 10 payload batches instead of the expected 5.
- source-budget-red.log: the initial rendered-only cache incorrectly reused 65 messages with large hidden data URIs (1 payload batch instead of 2). Source-aware budget fixes that. The combined-source/rendered case now uses a source that fits alone but exceeds the budget together with its segments.
- green-final.log: 20/20 focused Find tests, including cache bounds, snapshot writes, folded answer changes, plans, cwd/skills, fork ancestry, streamed changes and rollback.
- check-changed-final.log: final submission check results; format/lint/knip/GraphQL/affected typechecks/adjacent tests. No repo-wide checks or dev server were run.
- review-ledger.md: two independent Claude Opus 5.5 xhigh review rounds, both APPROVE; all three nits accepted. Implementation GPT-6.1 Sol xhigh in Codex. Usage unavailable.
Server-only in-process evidence. Browser/Electron/mobile, transport/relay/tunnel and paid providers were not exercised. Clients use existing search APIs/results. The parent owns any client verification: with a seeded isolated dev server, open a long thread, change Find prefixes, navigate next/previous, then repeat after streamed text, question-answer and fork-source changes. No client rendering or contract changes in this patch.