Public: anyone can read this; the crew can change it.
Traces 5: compare two traces, and share one with secrets redacted #18017
Merged 6h 51m ago, live in production
Traces 5 is pushed: two runs of one issue can be compared, and an owner can share one trace by a revocable link with secrets redacted. I ran bun x tsc --noEmit, bun scripts/gate.ts and the tests that cover the change, and all pass. I did not run the whole suite; scripts/fast.ts named 3,729 files, too broad to run here.
-
Reviews
Changes requested — before the latest pushSecurity core is sound: secrets are hashed, one gate for owner checks, repo-scoped reads, redaction on the way out, same-origin forms, no-store on the shared page. No high finding. Changes needed, in one round: (1) the terminal
skey replaces the live link at once with no confirmation, so a stray key ends a link already handed out; (2) the compare page explains itself twice (design principle 1, 8); (3) the share-made page hand-rolls an input withsize=70that overflows a phone (principle 2/3, use the named field/mono components); (4) the terminal door has no test; (5) the unauthenticated shared page reads and parses a whole log per request with no cap on cost or rate, so cache the redacted result per run until revoked or add a per-address limit.ApprovedAll earlier asks are met in the diff since 2bc84d81668e. The terminal
snow asks for a second press when a link is live, andsandxdo nothing on the compare screen. The compare page's notes paragraph is gone. The share-made page uses the sharedfieldcomponent. The shared page keeps the redacted trace for 30 seconds per link, keyed by the hash of the secret, and a revoked link is still checked on every request. It is also limited to 60 opens a minute per address, and the address is the forge-named client address, not a client header. Compare links are now anav.bar. Tests cover the new behaviour. Preview as I saw it: / answers 200, /traces answers 200 with the Traces heading, and an unknown /traces/shared/<43 chars> answers 404. The look pictures are PNG files outside my clone, which my tools refuse to open, so I judged the new pages from the code; the look seed has no crew run with a log, so they are not in the pictures anyway. Non-blocking: a run still writing shows its log up to 30 seconds late on the shared page, which the builder accepted for the cost bound. -
Checks
shipped production is serving it deploy a338207
-
History
- Build the key event the terminal test sends 89e0535
- Answer review: confirm replacing a live share link in the terminal, cache and rate-limit the shared page, tidy the pages ecefff9
- Give the trace tool a form in the held-action sentences 2bc84d8
- Cover the trace tool and share table in the route, MCP, ask-first and purge lists 6ec367b
- Say what the trace compare and share pages replace 5dae7c5
- Merge main into the traces compare and share branch 1729b2c
- Traces 2: /traces lists every trace with facets and search (#18015) 1c60934
- List the two new trace routes the page-budget fixture cannot fill (compare, shared) in test/budgets/unfixtured 9eb9c9a
- Traces 1a: a trace index table, filled when a run or Talk turn ends and backfilled once off the serving thread (#18061) 35e4ee2
- Games: pin forge-velocity f7d5d4e72 (/forge words as you type, Yes and No to click, an answer shown once) (#18036) 0003ecb
- Merge pull request #18054 from sold/agent-rollback d6960b3
- Games: a new server's words are searched on Modrinth, not matched against five names (#18041) 31cdee4
- Lists answer next_cursor as a string, as openapi.json declares (full suite red, #18027) (#18040) ab67833
- Game box agent: put a container left as <12 hex>_<service> back to its service name (#18052) 99480aa
- 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
- Game box: a new agent is on trial, and goes back to the one before if it does not check in baf09aa
- Talk API: pin a conversation, answer a held action yes or no, and redo a turn (#18012) 4513adb
11 earlier comments · 1 event
Traces 5 is pushed: two runs of one issue can be compared, and an owner can share one trace by a revocable link with secrets redacted.
I ran bun x tsc --noEmit, bun scripts/gate.ts and the tests that cover the change, and all pass. I did not run the whole suite; scripts/fast.ts named 3,729 files, too broad to run here. I did not try the pages against a running app.
What changed
- Compare:
/traces/<run>/compare/<other>shows steps, failed steps, time, tokens, cost and outcome, with B − A beside each. Time is each run's own start-to-finish clock. Tokens read "not recorded", because a run's log holds none. Cost is shown only to those who may see the owner's facts. Runs of two different issues, or one the viewer can't read, get the not-found a missing run gets. A trace page lists the issue's other runs to compare with. - Share: off until the repository's owner presses Make a share link (same-origin form).
- The link is
/traces/shared/<secret>, shown once; only its hash is kept in a newtrace_sharetable. - Anyone holding it reads the steps and raw lines with no sign-in. Everything is passed through the forge's existing
redactHeldbefore it is parsed. The page shows no cost and no people. - A new link ends the old one, Stop sharing ends it, and a revoked link is the plain not-found.
- The link is
- Terminal: on a run's trace screen,
ccompares with the issue's newest other run,sshares andxstops sharing. Page, terminal and MCP all go through the same owner check insrc/actions/trace_share.ts. - MCP: one new tool,
trace, withactionlist,read,compare(withwith),shareandunshare. Reads are never held; share and unshare are writes.test/mcp-size.test.tspasses. - Tests:
test/trace-share.test.tscompares two recorded runs and checks the difference against a hand calculation: 240 s and $1.50. It plants a token in a log file and checks the shared page serves[redacted]while the file keeps the token. It also checks revoke, non-owner and cross-site refusals, and that a new link withdraws the old. I added a query-plan test for the new read intest/hot-reads-indexed.test.tsand the new routes to the route-list tests. - Reused:
readTraceas the one gate,traceRowsandspanWords,redactHeld,ownsRepo,getRepoRun,readForm, and therun_issueindex. No dependency was added.
What I chose not to do
- No per-step tokens or cost: run logs hold none.
- Compare is for crew runs only, not imported outside-agent sessions, which aren't stored yet.
- No new terminal screen file: the door is the existing
src/tui/screens/trace.ts, so a commit line saysNo door:for that rule. - The look rule is waived with
No look:because the pages need a crew run with a log, which the look seed doesn't have.
Try it
Open a run's trace at /traces/<run id> as the repository owner and press Make a share link. Open the link signed out, then press Stop sharing and confirm the link now 404s. For compare, open /traces/<run>/compare/<other run of the same issue>.
[
{"go": "/traces/<run id>", "look": "the Share form and the compare links under the run's links", "expect": "Make a share link shows for the owner only; other runs of the same issue are listed to compare with"},
{"go": "/traces/<run id>/compare/<other run id>", "look": "the table", "expect": "steps, failed steps, time, tokens, cost and outcome, with B − A beside each"},
{"go": "/traces/shared/<secret from the share form>", "look": "signed out, the steps and raw lines", "expect": "credential shapes read [redacted]; no cost; after Stop sharing the same address is not found"}
]
🤖 Generated with Claude Code
<!-- look-pages 18ed60a062dc --> Look pages for 18ed60a, from the gate:
look pages (none): this pull changes src/web/pages/trace.ts, src/web/pages/trace_compare.ts, src/web/pages/trace_share.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
The check failed because the page-budget test found two new trace routes that its fixture can't fill and that no file listed. I added a file for each under test/budgets/unfixtured/, and the push went through.
- Routes listed:
/traces/:id/compare/:otherand/traces/shared/:token. Each file gives the same reason the existing entries do: no fixture holds the id the route needs. - Tests:
test/pages-budget.test.tsandtest/page-budget-files.test.tspass locally (10 tests). I didn't run the rest of the suite, which the forge runs on the push. - Commit: it says
No door:because only test fixture lists changed. No page, action or API route did.
I haven't checked the new run of the forge's check.
<!-- look-pages 9eb9c9a93ead --> Look pages for 9eb9c9a, from the gate:
look pages (none): this pull changes src/web/pages/trace.ts, src/web/pages/trace_compare.ts, src/web/pages/trace_share.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
Compare two runs of an issue, and share a trace by a link that hides secrets and can be revoked. Both were already in the branch. This push adds only one commit, which carries the Replaces: and Looks: lines the gate asked for. I didn't change the code.
The check had failed 3 times because the page-budget walk found trace routes it couldn't fill. The earlier commit 9eb9c9a93 already lists them under test/budgets/unfixtured/ (/traces/:id/compare/:other, /traces/shared/:token, plus the existing trace ones). I confirmed that fix holds.
The branch on the forge had moved ahead, because main was merged into it. I rebased onto that merge before pushing. After the rebase I ran tsc and these tests, all green:
- The page-budget walk and its file check (
pages-budget,page-budget-files). - The dead-code check (
unused-exports). - The module-state check (
module-state). - The
duringjob-timing check (route-timing-coverage,job-slices). - The share tests (
trace-share).
I did not run the whole suite. I also didn't run the earlier security-floor and OpenAPI checks again after the rebase.
- Door rule: the terminal side is the existing trace screen, where
ccompares,sshares andxstops sharing. A commit line already says so. - Not done:
- Compare and share are not in the page-budget walk, because no fixture holds a crew run with a log. They are listed on purpose.
- The gate's "one implementation?" similarity notes in
src/actions/trace_share.tsandsrc/web/pages/trace_share.tsare advisory, and I didn't merge those functions.
- Try it:
- Open a crew run's trace at
/traces/<run id>. - Press Make a share link, then open the link signed out.
- Press Stop sharing.
- To compare, open
/traces/<run id>/compare/<other run id>for another run of the same issue.
- Open a crew run's trace at
[
{"go":"/traces/<run id>","look":"Make a share link","expect":"A /traces/shared/<token> link appears with secrets redacted"},
{"go":"/traces/shared/<token> (signed out)","look":"the shared trace","expect":"Opens read-only with secrets redacted"},
{"go":"/traces/<run id>","look":"Stop sharing","expect":"The old link now answers not found"},
{"go":"/traces/<run id>/compare/<other run id>","look":"the two traces side by side","expect":"Both runs belong to one issue and their steps line up"}
]
🤖 Generated with Claude Code
The wide background test run was stopped at its time limit, so it never finished. I'm not restarting it, because it was an estimated 5-hour run.
The merge itself is pushed (1729b2c2c). What I did run before the push passed:
- the six trace test files (42 tests)
bun x tsc --noEmit- the gate
The forge's full check on the push will cover the rest.
I fixed the five failing tests and pushed the fix as 6ec367be7. All five failures came from the new trace routes, tool and table missing from the lists that guard them.
When I re-ran them locally, the tests behind four of the failures and the one that had failed alongside the walk test (conversation-holds) passed. tsc --noEmit is clean. I did not run the full suite. The forge's check does that on this push.
bun scripts/gate.ts --fix printed two "one implementation?" similarity notes about traceShare and traceUnshare in src/web/pages/trace_share.ts. I did not act on them or check whether they block the push. If the check flags them, they are the place to look.
- Route walk: the walk test now fills the
:othersegment of/traces/:id/compare/:other. - MCP tool list:
traceis added to the expected tool list in the protocol test. - Mixed reads and writes:
traceis added to the table of tools that mix reads and writes. Itslist,readandcompareactions are never held. - Ask first: the
tracetool now asks for confirmation beforeshareandunshare, since a share link publishes a redacted trace. The other actions never ask. - Account purge:
trace_share.created_byis covered asDELETE, so a share link ends with the account that made it. This follows the existing rule for a game client-pack link.
The failing check is fixed and pushed. The trace tool can write (share and unshare), so it can be held for confirmation, but it had no wording in src/crew/conversation_ask.ts. I added one. I only re-ran test/conversation-ask.test.ts (6 pass), not the full suite.
- New wording:
ASKED_ASnow has atraceentry. It reads "Make a redacted share link for the trace of run X in repo." or, for unshare, "Stop sharing the trace of run X in repo." - Tests: I added both sentences to the
SAIDtable intest/conversation-ask.test.ts. That test requires the table andASKED_ASto list the same tools, so it would fail if either side were missing. - Type check and gate:
bun x tsc --noEmitprinted nothing.bun scripts/gate.ts --fixprinted "one implementation?" similarity warnings and didn't fail. Several concern code from this pull (revokeShare,traceShare,traceUnshare). I left them alone.
To try it, run bun test test/conversation-ask.test.ts.
All five points from the review are addressed, and the branch is pushed. bun test passes for the trace suites, the module-state test and the dead-code test. tsc is clean and design-lint is clean. I ran no browser or preview checks.
What changed
- Terminal
sconfirms (1). When a share link is live,snow asks for a second press and says it ends the old link. Any other key cancels the confirmation. - Terminal
s/xlimited to one trace (1). They no longer act on the compare screen. - Owner refusal. A reader who isn't the owner still gets the "only the repository's owner shares a trace" toast.
- Compare page (2). I dropped the notes paragraph, so it keeps the one "Difference is B − A" sentence.
- Share-made page (3). The hand-rolled
size=70input is now the sharedfieldcomponent,mono, with a hidden label. The one sentence is in the page head and now also says that making another link ends this one. - Terminal test (4).
test/trace-share.test.tsnow coversc,swith its confirm,x, the compare screen having neither key, and the owner refusal. - Shared page cost (5).
src/trace/shared.tskeeps the redacted trace for 30 seconds per link, up to 32 per forge.- It is keyed by the hash of the link's secret, so a new link never reads the old one's.
- The link is still checked on every request, so a revoked one is a 404 at once.
- It is also limited to 60 opens a minute per address, then a 429 with
Retry-After. - Both the cache and the limiter are
WeakMaps keyed by the forge, the same patternreports.tsuses, so the module-state test stays green.
- Compare links on the trace page (6). They are now a
nav.barof rows labelled with the model, state and run date instead of the last six characters of the id. - Docs.
docs/features/traces.mdsays all of this.
Not done
- The gate still prints "one implementation?" notes and a note about
as nevercasts attest/trace-share.test.ts:182. Theas neveron the key event is fixed. The remaining cast is theas unknown as Ctxstub, built the waytest/adapter-tui.test.tsbuilds its own. - A 30-second cache means a run that is still writing shows its log up to 30 seconds late on the shared page. I accepted that for the cost bound.
[
{"go": "/traces/<run id>", "look": "the Compare with row", "expect": "a single bar of links labelled model · state · date"},
{"go": "/traces/<run id>/compare/<other>", "look": "under the table", "expect": "no notes paragraph; one sentence in the head"},
{"go": "POST Make a share link on a trace you own", "look": "the link field on a phone width", "expect": "full width, mono, no horizontal overflow"},
{"go": "terminal: open a trace, press s twice when a link is live", "look": "the toast after the first press", "expect": "asks to press s again; the old link works until the second press"}
]
Traces 5 is pushed: two runs of one issue can be compared, and an owner can share one trace by a revocable link with secrets redacted.
I ran
bun x tsc --noEmit,bun scripts/gate.tsand the tests that cover the change, and all pass. I did not run the whole suite;scripts/fast.tsnamed 3,729 files, too broad to run here. I did not try the pages against a running app.What changed
/traces/<run>/compare/<other>shows steps, failed steps, time, tokens, cost and outcome, with B − A beside each. Time is each run's own start-to-finish clock. Tokens read "not recorded", because a run's log holds none. Cost is shown only to those who may see the owner's facts. Runs of two different issues, or one the viewer can't read, get the not-found a missing run gets. A trace page lists the issue's other runs to compare with./traces/shared/<secret>, shown once; only its hash is kept in a newtrace_sharetable.redactHeldbefore it is parsed. The page shows no cost and no people.ccompares with the issue's newest other run,sshares andxstops sharing. Page, terminal and MCP all go through the same owner check insrc/actions/trace_share.ts.trace, withactionlist,read,compare(withwith),shareandunshare. Reads are never held; share and unshare are writes.test/mcp-size.test.tspasses.test/trace-share.test.tscompares two recorded runs and checks the difference against a hand calculation: 240 s and $1.50. It plants a token in a log file and checks the shared page serves[redacted]while the file keeps the token. It also checks revoke, non-owner and cross-site refusals, and that a new link withdraws the old. I added a query-plan test for the new read intest/hot-reads-indexed.test.tsand the new routes to the route-list tests.readTraceas the one gate,traceRowsandspanWords,redactHeld,ownsRepo,getRepoRun,readForm, and therun_issueindex. No dependency was added.What I chose not to do
src/tui/screens/trace.ts, so a commit line saysNo door:for that rule.No look:because the pages need a crew run with a log, which the look seed doesn't have.Try it Open a run's trace at
/traces/<run id>as the repository owner and press Make a share link. Open the link signed out, then press Stop sharing and confirm the link now 404s. For compare, open/traces/<run>/compare/<other run of the same issue>.🤖 Generated with Claude Code
Closes #17995