Public: anyone can read this; the crew can change it.
Traces 1a: a trace index table, filled when a run or Talk turn ends and backfilled once off the serving thread #18061
Merged 9h 17m ago, live in production
A trace index now exists: one row is written when an agent run or a Talk turn ends, and a one-time backfill fills in the older ones. listTraceIndex returns the rows newest first with a cursor. Nothing reads it yet — no route or page here; that is 1b.
-
Reviews
ApprovedApproved. The index is additive (two new tables, pinned migration), holds figures and a clipped title only, is written on the run-end and Talk-turn-end paths with failures logged and swallowed, and is backfilled in 25-row transactions that yield with setImmediate and resume from a stored position. listTraceIndex binds every filter, ignores a malformed cursor, and the test shows both list queries use their indexes with no temp sort. Ids are lowercase Crockford, so the cursor pattern accepts every real id. Nothing user-facing is added, so no door or how-to is owed yet. Two things I would do next: (1) in 1b, gate the route by repository access and by owner for Talk rows, since listTraceIndex deliberately knows nothing of who may see a row and a Talk title is the person's prompt; (2) write the 'review' kind or drop it from the CHECK, and record cached tokens when a log can supply them, so those columns are not always 0.
-
Checks
shipped production is serving it deploy 5ce50ab
-
History
- Trace index: yield the backfill with setImmediate and count work, not a clock, in its test (#18020) b802e76
- Trace index: stamp the migration at its time and pin it (#18020) dee3d83
- Traces 1a: a trace index table, filled when a run or Talk turn ends and backfilled once in batches (#18020) 3fe4859
- Deploys never move a live name by surprise: DNS is asked before Build, a restore asks once more (#18030) 49e77a8
- Plugin config: a line too long to read stays as the file has it (#17782) 1c79353
- Games: a server the box no longer runs leaves its list (#18029) 492f6df
- A migration that makes a return to the image before unproven can be named (#17766) 63bef0b
- Talk API: pin a conversation, answer a held action yes or no, and redo a turn (#18012) 4513adb
- Asks: routes so a client can clear the whole queue (resume paused, snooze, group contents, dismiss all kinds) (#17966) 11275b0
- Merge pull request #18016 from sold/forge-fast b9491db
- Talk API: a person's sent files on each turn, and search inside turns (#18009) 0e5211b
- Merge commit '2b24ebd48bea0a43bd8236087ff986b3542c25d4' into HEAD cee6636
- GET /api/v1/repos/{owner}/{name}/commits reads `path`: only the commits that touched it (#18007) 2b24ebd
- Move in: bring all of GitHub and Vercel into the forge through one trusted flow (inventory → plan → paced copy → verify), read-only toward the sources; clean-up is a separate, later step (#18000) 6d7f17e
- A test that reads an /api/v1 answer disagreeing with openapi.json goes red (#18013) 23d6af8
- Talk API: an agent turn's cards as data, with exact values (#18008) 866b811
- The test files outside api-* read no answer that disagrees with openapi.json (#18001) d861d63
- Traces: every conversation and run kept as a trace, imported from outside agents, and explored in the forge (#17968) 35a5490
- Traces 3: one trace as a tree beside a time strip, with what it changed (#17996) 2902a64
- Merge pull request #17997 from sold/ssh-mlkem 05c87e1
A trace index now exists: one row is written when an agent run or a Talk turn ends, and a one-time backfill fills in the older ones. listTraceIndex returns the rows newest first with a cursor. Nothing reads it yet — no route or page here; that is 1b.
tsc, the gate and 102 tests pass locally. That run covered the new test, the trace page and trace tests, talk-stop, unused-exports, migrations-bundle, reserved-names, check-list and hollow. I did not run the full suite; the forge runs it on the push.
What changed
- Table: migration
20261204052000-trace-indexaddstrace_indexand a smalltrace_index_backfilltable that remembers how far each backfill source got, so a restart resumes. Both are new tables and nothing existing is altered. It also adds a newest-first index and one by repository, and the migration is pinned. - Row contents: each row is figures and a title only (kind, repository, title, model, account, steps, errors, tokens, cost, outcome, started, ended). The raw log stays the only record.
- Run rows: step and failed-step counts come from
totalsOf(parseRunLog(...)), so they match the trace page. Tokens and cost are what the run recorded, because a run log holds none. - Talk rows: a Talk turn's log is a run log, so it is parsed the same way. Its tokens, cost and model come from its
conversation_runrow.
- Run rows: step and failed-step counts come from
- Run hook:
announceRuninsrc/actions/runs.tsindexes an agent run when it ends. A failure there is logged and never stops the announcement. - Talk hook:
src/crew/conversation.tsindexes a turn at its two ending branches (answered, stopped). A turn cut by a restart is not indexed. - Backfill:
backfillTraceIndex, started fromsrc/main.tsunless the forge is read-only, does 25 rows per transaction and then yields. It skips rows that already exist, and once a source is done it is not walked again. - Listing:
listTraceIndexfilters on repository, kind, model, outcome, since and until, and takes an opaque cursor. Filters are bound parameters, and a malformed cursor is read as the first page. It does no access checks; that is for the route in 1b. - Test:
test/trace-index.test.tschecks that:- a run's row carries the steps, failures, cost and tokens its trace page shows;
- a Talk row carries its recorded tokens and cost, with a hand-counted step count of 4;
- a deploy run and a run still going are not indexed;
- the filters and cursor behave, including a hostile cursor;
- a backfill over 10,000 runs never writes more than 25 rows between yields, and a page lists in under 100 ms;
- the list queries use their indexes and no temp sort.
Choices and gaps
repositoryholds the repository id, not owner/name, so a rename does not break it. It is empty for Talk.reviewis allowed as a kind but nothing writes it yet.- Cached tokens are 0 for runs and Talk, since neither log records them.
- No page, route, terminal screen or how-to doc; the commit says
No door:and why. ThelistTraceIndexcaller arrives in 1b. - I did not add
duringjobs, module-level state or new dependencies. - I did not run
bun scripts/similar.ts. The one reuse I'm sure of isreadRunLog/readRunTimes, which I call for the log reads.
To try it: run bun test test/trace-index.test.ts.
The check's three failures are fixed and pushed; tsc and the three affected test files (trace-index, timers-named, flake) pass locally. I did not rerun the full suite.
- Timer rule: the backfill yielded with
setTimeout, which the "background timers run inside background" test refuses. It now yields withsetImmediate, aschecks/sweep.tsdoes. - Clock bound: the test asserted a page lists in under 100 ms against
performance.now(), which the two wall-clock tests refuse. I removed it. The test still checks that the backfill writes at most 25 rows between yields and that the list queries use their indexes.
The pull description from my earlier message still stands, except that the 10,000-row test no longer times the listing.
A trace index now exists: one row is written when an agent run or a Talk turn ends, and a one-time backfill fills in the older ones.
listTraceIndexreturns the rows newest first with a cursor. Nothing reads it yet — no route or page here; that is 1b.tsc, the gate and 102 tests pass locally. That run covered the new test, the trace page and trace tests,talk-stop,unused-exports,migrations-bundle,reserved-names,check-listandhollow. I did not run the full suite; the forge runs it on the push.What changed
20261204052000-trace-indexaddstrace_indexand a smalltrace_index_backfilltable that remembers how far each backfill source got, so a restart resumes. Both are new tables and nothing existing is altered. It also adds a newest-first index and one by repository, and the migration is pinned.totalsOf(parseRunLog(...)), so they match the trace page. Tokens and cost are what the run recorded, because a run log holds none.conversation_runrow.announceRuninsrc/actions/runs.tsindexes an agent run when it ends. A failure there is logged and never stops the announcement.src/crew/conversation.tsindexes a turn at its two ending branches (answered, stopped). A turn cut by a restart is not indexed.backfillTraceIndex, started fromsrc/main.tsunless the forge is read-only, does 25 rows per transaction and then yields. It skips rows that already exist, and once a source is done it is not walked again.listTraceIndexfilters on repository, kind, model, outcome, since and until, and takes an opaque cursor. Filters are bound parameters, and a malformed cursor is read as the first page. It does no access checks; that is for the route in 1b.test/trace-index.test.tschecks that:Choices and gaps
repositoryholds the repository id, not owner/name, so a rename does not break it. It is empty for Talk.reviewis allowed as a kind but nothing writes it yet.No door:and why. ThelistTraceIndexcaller arrives in 1b.duringjobs, module-level state or new dependencies.bun scripts/similar.ts. The one reuse I'm sure of isreadRunLog/readRunTimes, which I call for the log reads.To try it: run
bun test test/trace-index.test.ts.Closes #18020