Public: anyone can read this; the crew can change it.

Spike: a search-first reading layer for Talk's agent and the crew, measured a… #16550

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

torque/forge:torque/16549-spike-a-search-first-reading-layer-for-t → main 0 commits fork 2 threads · 2 unresolved

  • Merged. torque/16549-spike-a-search-first-reading-layer-for-t was merged into main as 993eead.

Review

Sign in to review this change.
4 files changed +42 −1
docs/REFERENCE.md +1 −1
@@ -605,7 +605,7 @@ This page is the front door. Everything else is a file of its own under
605605 **Design and records**
606606
607607 - [`docs/DESIGN.md`](DESIGN.md) — the design system's spine; its sections are under `docs/design/sections/`.
608 - [`docs/SPIKE-CLOUDFLARE.md`](SPIKE-CLOUDFLARE.md), [`docs/AUDIT-MANY-HANDS.md`](AUDIT-MANY-HANDS.md), [`docs/BACKLOG.md`](BACKLOG.md) and [`docs/research/`](research/) — a spike, an audit, a pointer to the map and research notes, kept as written.
608 - [`docs/SPIKE-CLOUDFLARE.md`](SPIKE-CLOUDFLARE.md), [`docs/SPIKE-SEARCH-READING.md`](SPIKE-SEARCH-READING.md), [`docs/AUDIT-MANY-HANDS.md`](AUDIT-MANY-HANDS.md), [`docs/BACKLOG.md`](BACKLOG.md) and [`docs/research/`](research/) — a spike, an audit, a pointer to the map and research notes, kept as written.
609609
610610 What the crew's tokens bought is on the board (`/board/returns`), in MCP `returns`, and in the terminal: the palette's Usage carries a Returns line (dollars, runs, changes landed, cost per landed change; `[`/`]` move between 1, 7, 30 and 90 days), and Usage of a repository (`owner/name`) narrows it to one app. On the forge-wide Usage, `f` opens the fleet graph (what `/fleet/graph` shows): one sparkline row per repository for runs and for spend, each with its total at the right, over 24 h by hour or 14 d by day (`w` toggles); past eight series the smallest share "N others", and a short terminal ends with a "+N more rows" line. Who may see spend is the action's rule (`src/actions/fleet-graph.ts`), not the screen's. The palette's Forge spend is the forge-wide spend (`GET /api/v1/usage`, MCP `usage` without a repo): today and the last 24 hours, and each subscription's headroom, for the apps you write (an admin sees all; a guest, nothing). Owner facts only (`src/actions/returns.ts`); see [`docs/OPERATING.md`](OPERATING.md).
611611
docs/SPIKE-SEARCH-READING.md added +33
@@ -0,0 +1,33 @@
1 # Spike: a search-first reading layer (#16549)
2
3 **Status: step 1 (measure) was attempted and stopped. No product change, no index, no external engine.** Nothing below is estimated; each figure says where it came from.
4
5 ## What was measured
6
7 The 30 most recent finished crew agent runs on this forge (read through `GET /api/v1/repos/trevato/forge/runs` and each run's `/log`, by a run that may read only what the API serves). Talk conversations were not measured: their history is not served to a crew run.
8
9 | Per 30 runs | Total | Per run, median |
10 |---|---|---|
11 | Input tokens (`tokensIn`) | 5,707,047 | 125,357 (min 31,388, max 1,269,747) |
12 | Output tokens | 77,177 | |
13 | Wall seconds | 1,411 | |
14 | Tool calls the log lists | 146 | |
15

49 finding + 70 running = 119, not the 117 Bash calls stated in the line above. Recount so the parts sum to 117.

16 The log lists calls by kind: Bash 117, Write 20, Grep 5, Edit 2, Read 1, and 1 logged as lowercase `bash` (146 in all). The 117 Bash calls, sorted by their command line, are 44 finding (grep, find, ls), 3 reading (cat, head, sed -n) and 70 running something (tests, curl, git). Adding the 5 Grep calls gives 49 finding, 4 reading in all.
17
18 ## What this does and does not say
19
20 - **Share spent finding versus reading, in tokens: not measurable.** The run record keeps tokens per run, never per tool call, and the log keeps the call line, not its result size or its seconds. Any split would be an estimate, which the issue forbids.
21 - **Share in calls:** finding is about a third of the listed calls (49 of 146, Grep and Bash together). That is a count of calls, not of tokens; a grep that returns a page costs more than ten that return a line.
22 - **Reads are under-logged:** one `Read` in 30 runs is not credible next to 20 `Write`s; the log likely omits some read calls, so the read share is not known either.

'about 25k of context' is unsourced, an estimate in a doc that says nothing is estimated. Cite where it was read from, or remove the figure and the comparison built on it.

23 - Input tokens per run vary forty-fold (31,388 to 1,269,747), which the call counts alone do not explain; why is not measured here.
24
25 ## Verdict per step
26
27 1. **Measure: not completed.** The gap is the instrument, not the idea: there is nothing to base a "finding versus reading" share on.
28 2. **Ranked passages, batch form, per-run counter: not built.** The counter is the right first change, because it is the missing instrument: record, per tool call, the bytes returned and the seconds taken, on the run, "counted, not estimated". Without it, step 2's savings cannot be shown, so it is built before the passage and batch forms, not after. It is a change to the run log and the MCP's tool wrapper, and deserves its own pull.
29 3. **A ranked index: no, not on this evidence.** Nothing here shows a gap an index would close. The step's guards stand if it is reopened: derived from git and rebuildable, read only what the asker may read (the rule `search` keeps), and any external engine run in a sandbox with no credentials, never on the production host, pinned by checksum and never installed from a piped script. xerj's own numbers are its claims, not ours.
30
31 ## Next
32
33 One pull: per-call result bytes and seconds in the run log, summed on the run page. Then re-run step 1 on 30 runs and Talk questions with it.
src/view/doc_sections.ts +1
@@ -90,6 +90,7 @@ export const DOC_LINES: Record<string, Line> = {
9090 "PLATFORM.md": ["internals", "What production still uses from Open Platform.", "Platform inventory"],
9191 "PROFIT.md": ["internals", "A design: cost against responsiveness.", "Cost and responsiveness"],
9292 "SPIKE-CLOUDFLARE.md": ["internals", "An unapplied experiment.", "Experiment: a forge on Cloudflare"],
93 "SPIKE-SEARCH-READING.md": ["internals", "A measurement that stopped at step 1.", "Experiment: a search-first reading layer"],
9394 "BACKLOG.md": ["internals", "Where ideas live: the map and the Later gate."],
9495 };
9596

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs