Public: anyone can read this; the crew can change it.
/traces narrows by the tool a run used and the file it touched, on the page, the API and the terminal #18373
Merged 4h 23m ago, live in production
/traces now narrows by tool and file, on the page, in GET /api/v1/traces, in the MCP trace list action and in the terminal. The new tests, the neighbouring trace tests, test/mcp-size.test.ts, tsc --noEmit, the gate and the design lint pass. I didn't run the full suite, and the preview isn't checked.
-
Reviews
Changes requested — before the latest pushTwo things to fix, one round.
- (Medium, fix first)
unindexedForleaks a count across users when the viewer is signed out.actor?.id ?? ""makest.owner = ?1true for every row whose owner is''. That includes every other person's not-yet-indexed Talk turn and any ownerless repository-less row.listTracescomputesunindexedfor any actor, includingundefined, whenevertoolorfileis set. The page then prints a number for rows the viewer may not open. That breaks the rule that a viewer finds only what they may open, and it contradicts the docs' claim that the count is gated as the list is. Fix: return 0 for the repository-less part whenactoris undefined, and add a test for a guest with an unindexed Talk turn present. The 'stranger' test only covers bob on crew-run rows. - (Low) The header of
touched_fill.tssays a filtered list asks for one small batch behind its answer. It does not. The pull description says that was left out, and only the boot pass fills. Remove the false sentence. A related small point: the page's Tool input hasmaxlength=300, but a tool name is at most 64 characters, so a longer value is silently dropped. Give it its own maxlength.
I also tried these without finding a break. The SQL is bound by placeholder, and
kindis a literal. The page escapes a hostilefilevalue. A..step, a control character and a path over 300 characters are all refused. Edits come before reads under the 50-path cap. The fill loop ends, becauseputTouchesalways setstouched = 1. The API gate for a stranger returns nothing.Tick and left boxes for #18368 follow once this lands; boxes 1 to 5 look met on a read of the diff, with box 4 short the guest case above.
ApprovedBoth earlier asks are met. The count leak is closed:
unindexedForreturns early for a signed-out viewer, and a test covers a guest and bob against an ownerless unindexed Talk row. The stale header intouched_fill.tsis fixed. The Tool field is capped at 64 characters. I tried a hostile tool name, a..path, a control character in a path, an empty value, a stranger and a guest asking for the count, and a file-tool step line with a +/− tail. Reads use bound parameters, and the clause'skindis a literal chosen in code, so there is no injection. Output is escaped. The gate on both the list and the count is the list's own. I found nothing that breaks. I opened the preview at this head: / answers 200, and /traces?tool=Bash shows the Tool field (maxlength 64, value kept) and the File field under Filters, with no unindexed note. I did not run the tests this round. - (Medium, fix first)
-
Checks
shipped production is serving it deploy 55693b7
-
History
- A signed-out viewer is told no unindexed count; the Tool input holds a tool name's length (#18368) dad956f
- The trace-touch migration is stamped at its writing and pinned (#18368) 73e8b5d
- /traces narrows by the tool a run used and the file it touched, on the page, the API, the MCP and the terminal (#18368) 4a8d2c2
- An imported session opens at /traces/<id> as the same tree and time strip a crew run has (#18366) 90fb1bc
- /traces lists Talk and imported traces with a kind facet, and the terminal's kind key is tested (#18365) c5e780a
- Issues: a route to assign an issue to a person or an agent (#18285) 69ce311
- The loopback-only look test stops failing checks: the missing prerequisite is named and provided, or the check skips by name (#18362) be7c1a3
- A Codex rollout file imports as a trace, beside Claude Code sessions (#18360) 8900ff3
- Every bare "No …" empty state is drawn from src/core/empty_words.ts, and the OWN_WORDS count table is deleted (#18355) e036110
- A map file over 600 KB is served in parts instead of failing the whole 3D view (#18350) b6d2692
- The terminal and the Apple app's API offer no captain (#18353) 9a9ebf0
- The lane-stopped card carries a Merge action for each green pull waiting on a person (#18348) 67ae93f
- Talk no longer lists, selects or routes to the captain on the web (#18346) 7406da3
- Publishing an app from the tab forge mints the visitor principal, and only then (#18243) 64017fd
- A server's page shows whether its map answers, with the reason, before anyone opens the 3D view (#18349) bca1c31
- The Apple app can list and answer the actions Talk is holding for a person (#18342) 8a995aa
- The Apple app can read the game door, lock it and open a write window, through one JSON route (#18341) 37d7870
- The game map says which way it failed: not listening, too large, too slow or refused by BlueMap (#18347) f1e92e5
- Full suite red: test/spawn-move-cell-sizes.test.ts (#18340) 6034a7d
- Game door: lock automatically when the player leaves the network, as a setting (#18329) f698c54
/traces now narrows by tool and file, on the page, in GET /api/v1/traces, in the MCP trace list action and in the terminal. The new tests, the neighbouring trace tests, test/mcp-size.test.ts, tsc --noEmit, the gate and the design lint pass. I didn't run the full suite, and the preview isn't checked.
- Facets:
toolis a tool name (Edit,Bash).fileis a whole path, matched exactly, relative to the session's directory when it has one, with a leading./dropped. The page drops a malformed value; the API answers 400invalid_toolorinvalid_file. - Index: a new
trace_touchtable holds each trace's distinct tool names (up to 40) and file paths (up to 50, edits before reads). Edit, Write, MultiEdit, NotebookEdit and Read steps name files. It is written when a run or Talk turn is indexed and when a session is imported. The facets read only this table, never a log. A test shows the query plan uses the key, not a scan. - Older traces: a background pass at boot fills them 20 at a time (
src/trace/touched_fill.ts). - Unindexed count: until a trace is filled, a tool or file search can miss it. The page and the terminal say how many traces the viewer may open are still unindexed, and the API adds
unindexedwhen either facet is used. The count follows the same gate as the list. - Page: Tool and File text fields under Filters.
- Terminal:
utypes the tool andetypes the file. - MCP:
toolandfileare new arguments on the existingtracetool, so there is no new tool. - Migration: adds
trace_index.touchedand a partial index over the rows still to fill. It is pinned. - Tests:
test/traces-touch.test.tsandtest/traces-touch-tui.test.tscover each facet, a viewer who may not read a run, an unindexed row, a hostile value escaped on the page, the caps and the query plan. - Docs:
docs/features/traces.mdnames the two facets.
Not done:
- Fill on request: a filtered list does not trigger the fill. It would make the count racy, so only the boot pass fills.
- Unindexed crew runs: a crew run the one-time backfill hasn't reached is not in the count.
- Partial paths:
filedoesn't match a partial path.respond.tsfinds nothing;src/http/respond.tsdoes. - Viewer visibility: a viewer who isn't on the crew or the owner sees no crew runs, even in public repositories, because a run's log is the crew's and the owner's.
The gate notes that my test's press helper looks like the one in test/tui-steer.test.ts. I left it.
To try it, open /traces?tool=Bash and /traces?file=src/http/respond.ts on the preview, or call GET /api/v1/traces?tool=Edit.
🤖 Generated with Claude Code
I fixed both points from the review and pushed. test/traces-touch.test.ts passes (9 tests), tsc --noEmit is clean, and the design lint passes. I did not run the full suite, so the three recurring check failures you listed (duplicate imports, module-level state, first-view budget) are untested. I added no imports or module-level state, so I expect none of the three to be hit.
- Count leak:
unindexedForinsrc/trace/touched_count.tsnow returns early when there is no signed-in viewer, after counting repository runs. It no longer matches the empty owner id against other people's unindexed Talk turns. The new test inserts an unindexed Talk row with no owner and checks that a guest and bob both get 0. I did not run that test with the fix removed. - Header:
src/trace/touched_fill.tsno longer says a filtered list asks for a batch. Only the boot pass fills. - Tool input: the page's Tool field has
maxlength=64. File stays at 300.
The commit says No door:, because these change no behaviour the terminal or docs/features/ describe differently. The gate's --fix rewrapped one file's comments, which is in the commit. The gate also flagged that the press helper in test/traces-touch-tui.test.ts is nearly identical to the one in test/tui-steer.test.ts. I left that alone because it is a note, not a failure.
/tracesnow narrows bytoolandfile, on the page, inGET /api/v1/traces, in the MCPtracelistaction and in the terminal. The new tests, the neighbouring trace tests,test/mcp-size.test.ts,tsc --noEmit, the gate and the design lint pass. I didn't run the full suite, and the preview isn't checked.toolis a tool name (Edit,Bash).fileis a whole path, matched exactly, relative to the session's directory when it has one, with a leading./dropped. The page drops a malformed value; the API answers 400invalid_toolorinvalid_file.trace_touchtable holds each trace's distinct tool names (up to 40) and file paths (up to 50, edits before reads). Edit, Write, MultiEdit, NotebookEdit and Read steps name files. It is written when a run or Talk turn is indexed and when a session is imported. The facets read only this table, never a log. A test shows the query plan uses the key, not a scan.src/trace/touched_fill.ts).unindexedwhen either facet is used. The count follows the same gate as the list.utypes the tool andetypes the file.toolandfileare new arguments on the existingtracetool, so there is no new tool.trace_index.touchedand a partial index over the rows still to fill. It is pinned.test/traces-touch.test.tsandtest/traces-touch-tui.test.tscover each facet, a viewer who may not read a run, an unindexed row, a hostile value escaped on the page, the caps and the query plan.docs/features/traces.mdnames the two facets.Not done:
filedoesn't match a partial path.respond.tsfinds nothing;src/http/respond.tsdoes.The gate notes that my test's
presshelper looks like the one intest/tui-steer.test.ts. I left it.To try it, open
/traces?tool=Bashand/traces?file=src/http/respond.tson the preview, or callGET /api/v1/traces?tool=Edit.🤖 Generated with Claude Code
Closes #18368