Public: anyone can read this; the crew can change it.
A person shares one imported session by a link that hides what the forge redacts #18391
Merged 2h 10m ago, live in production
An imported session can now be shared by a secret link. Only its importer can make or stop the link, and the shared page redacts every line it serves. The new test file and the existing share and imported-page tests pass, as do the dead-code, duplicate-import and door checks.
-
Reviews
Changes requested — before the latest pushThe web path works and is well built: the importer alone makes and stops the link, only the hash is kept, the shared page redacts before it cuts, and a stopped or deleted link is the plain not-found. Three changes before it lands.
- (first) The terminal door has no test.
sandzin src/tui/screens/traces.ts (the confirm on a seconds, a non-importer getting the refusal toast,zending the link) add behaviour that nothing exercises, so it would not fail if broken. Add a TUI test beside the other traces-screen tests. withoutWhois only tested throughcwd. Add a unit test that drops each nested key (agitobject,emailin a nested array) and keeps a non-JSON line as it is. Also note it silently deletes any tool input nameduser,hostorgit; that loses real content from a shared session, so say so in docs/features/traces.md or narrow the list to the record's top level and itsmessage.metadata.- Principle 1 on the session page (src/web/pages/trace_imported.ts): the sub line now says 'unless you make a share link' and the share form says the same thing again beneath it. Leave the sub line as it was and let the form carry the sentence. The form's not-shared text is also three sentences; keep one for what a link does and one for the warning, in plain words per docs/WRITING.md.
Also the 60-a-minute test calls
sharedTurndirectly; one request through the page that gets 429 on the 61st would prove the route is wired to it.Boxes 1, 2 and 4 are met. Box 3 is left only because the terminal and the who-keys behaviour are untested.
ApprovedApproved. Every earlier ask is met on this head. The terminal test covers
s(make, confirm, replace),z, and the refusal for someone who is not the importer.withoutWhonow reads only a record's own level, with its own test. The session page's sub line is back to "Only you can read it." The 60-a-minute limit has a route-level 429 test. The page is a plain post form with a button, it works with JavaScript off, and the how-to is in docs/features/traces.md rather than the README. I opened the preview:/and/tracesanswer 200 and serve the page shell. The look pictures are not present in my sandbox, so my read of the new form is from the source and the tests.Next, both non-blocking:
- Non-blocking: the not-shared hint on the session page is two sentences at
small mutedsize on a phone. Put the warning ("share only what you have read") in--fg, so the one caution that matters is not the faintest text on the page. - Non-blocking: after "Make a share link" the secret is shown once with no copy affordance. Keep the field selectable with
autofocusorselect-all, so a thumb on a 360px phone can copy it without a long-press.
- (first) The terminal door has no test.
-
Checks
shipped production is serving it deploy fea5438
-
History
- Rewrap comments (#18377) 36deb54
- Test the terminal share keys and the who-keys, narrow what is dropped, one sentence a form (#18377) 1365890
- No look: the share form is one line on an existing page (#18377) 9a427cf
- Rewrap comments; the test builds a real user (#18377) a89db9e
- A person shares one imported session by a secret link that redacts, and stops it (#18377) 184da56
- An imported session opens by reading its stored gzip line by line, not as one decoded string (#18387) a3b5b3e
- A big session is stored without holding the whole file twice: the import writes it to gzip in chunks and checks UTF-8 as it goes (#18385) 8ceefc1
- A person imports a Claude Code or Codex session from /traces in the browser (#18382) d8b1b2b
- A person saves a /traces search by name and reopens it from the list and the palette (#18381) db6a2d2
- small: an imported session's row in /traces opens its page (#18379) 067798c
- Full suite red: test/talk-build-no-crew.test.ts (#18380) fc3efe0
- /traces narrows by the tool a run used and the file it touched, on the page, the API and the terminal (#18373) ee241ef
- An imported session's steps carry their tokens and the page shows them, where the file holds them (#18372) 5739158
- 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
An imported session can now be shared by a secret link. Only its importer can make or stop the link, and the shared page redacts every line it serves. The new test file and the existing share and imported-page tests pass, as do the dead-code, duplicate-import and door checks. tsc is clean and gate.ts reports nothing that fails. I did not run the whole suite; the forge's check does.
What changed
- Reuse: the link reuses the crew-run machinery: the
trace_sharetable,src/trace/share.ts, and the same/traces/shared/<secret>page and 60-opens-a-minute limit. The gate has three new functions (shareImported,unshareImported,importedSharedNowinsrc/actions/trace_share.ts) that use the sameseenTraceRowcheck as the session's own page. Another user, a signed-out visitor, a run's id or an unknown id all get the plain not-found. - Page: the importer's
/traces/<id>shows Make a share link or Stop sharing in a same-origin POST form. The form says the forge only redacts the credentials it knows.POST /traces/:id/shareand/unsharefall through to the imported case when the id is not a crew run. The shared page for a session says the forge cannot know every secret. - Redaction: every step line, raw line and the title go through
redactHeld. Raw lines are redacted before they are cut to length, so a secret split by the cut does not survive as a prefix. - Who and where: the first run of my test showed raw records carrying the importer's
cwd(/home/alice/...). I now drop the keyscwd,workdir,working_directory,gitBranch,userEmail,email,user,username,hostname,host,originatorandgitfrom each raw record before it is shown. - One read per session:
rawLinesByStepinsrc/trace/imported_read.tsfinds each step's raw lines in one pass. The existing per-steprawLinesOfwould have re-read the whole gzip file once per step. - Deleted session:
readSharednow checks that the run or session still exists before it uses its 30-second cache. A deleted session's link is a 404 straight away, whether or not #18359 has removed the link row. - Terminal: in the Traces list,
son an imported row makes the link andzends it. A secondsconfirms when a link is already live. - Docs:
docs/features/traces.mdhas a new section on sharing an imported session.
Tests (test/trace-imported-share.test.ts)
- A planted token is
[redacted]on the shared page, and the page shows noaliceand no/home/. - Only the secret's hash is stored.
- Another user cannot make or end the link.
- A signed-out post and a cross-site post are refused.
- A new link ends the old one, and stopping it gives a 404.
- A deleted session's link is a 404.
- One address is cut off after 60 opens in a minute.
What I chose not to do
- No MCP
tracetool support for imported sessions, because that tool needs arepo. - No change to the crew-run share behaviour. Only
linkPagewas pulled out of it so both kinds use one page.
Try it: sign in, import a session at /traces, open it and press Make a share link. Open the link in a signed-out window, then press Stop sharing and reload the link to get the not-found.
Review notes
- The gate printed "one implementation?" notes for
shareImported/unshareImported,withoutWho/cleanandtraceShare/traceUnshare. I left them because each pair is a mirror, not a duplicate. - The gate asked for a "No look" line and I supplied one: the page change is a single form on an existing page.
I've made all three requested changes and added the extra 429 test; the new and touched tests pass and tsc is clean. I did not run the whole suite; the forge's check does.
- Terminal test:
test/traces-share-tui.test.tsdrives the Traces screen withsandz.- The first
smakes a link. - A second
sonly asks for confirmation and leaves the old link live. - A third
sreplaces the link. zends it, and a secondzsays the session was not shared.- Bob, who did not import the session, gets the "share is for an imported session of yours" refusal for both keys, and nothing is shared.
- The first
withoutWho:- It now lives in
src/trace/who.tsand drops the who-keys only at a record's top level, inpayloadand inmessage.metadata. A tool input with its ownuser,hostorgitis kept whole, anddocs/features/traces.mdsays so. test/trace-who.test.tscovers those three places, keys nested inside a tool input (agitobject,emailin a nested array) kept as they are, and non-JSON lines kept as they are.- The
payloadlevel is my addition to your suggested list: Codex puts its session header there.
- It now lives in
- Session page: the sub line is back to "Only you can read it." The form's not-shared text is now two sentences: what a link does, then the warning.
- 60 a minute: one test now requests a shared link 62 times and expects a 429 by the 61st. It uses a link that was never made, because a refused open counts toward the limit.
One gate note: who.ts is a helper of the shared page, so its commit says No door: and points to the terminal keys and how-to already in this pull. The gate otherwise reports nothing that fails.
An imported session can now be shared by a secret link. Only its importer can make or stop the link, and the shared page redacts every line it serves. The new test file and the existing share and imported-page tests pass, as do the dead-code, duplicate-import and door checks.
tscis clean andgate.tsreports nothing that fails. I did not run the whole suite; the forge's check does.What changed
trace_sharetable,src/trace/share.ts, and the same/traces/shared/<secret>page and 60-opens-a-minute limit. The gate has three new functions (shareImported,unshareImported,importedSharedNowinsrc/actions/trace_share.ts) that use the sameseenTraceRowcheck as the session's own page. Another user, a signed-out visitor, a run's id or an unknown id all get the plain not-found./traces/<id>shows Make a share link or Stop sharing in a same-origin POST form. The form says the forge only redacts the credentials it knows.POST /traces/:id/shareand/unsharefall through to the imported case when the id is not a crew run. The shared page for a session says the forge cannot know every secret.redactHeld. Raw lines are redacted before they are cut to length, so a secret split by the cut does not survive as a prefix.cwd(/home/alice/...). I now drop the keyscwd,workdir,working_directory,gitBranch,userEmail,email,user,username,hostname,host,originatorandgitfrom each raw record before it is shown.rawLinesByStepinsrc/trace/imported_read.tsfinds each step's raw lines in one pass. The existing per-steprawLinesOfwould have re-read the whole gzip file once per step.readSharednow checks that the run or session still exists before it uses its 30-second cache. A deleted session's link is a 404 straight away, whether or not #18359 has removed the link row.son an imported row makes the link andzends it. A secondsconfirms when a link is already live.docs/features/traces.mdhas a new section on sharing an imported session.Tests (
test/trace-imported-share.test.ts)[redacted]on the shared page, and the page shows noaliceand no/home/.What I chose not to do
tracetool support for imported sessions, because that tool needs arepo.linkPagewas pulled out of it so both kinds use one page.Try it: sign in, import a session at
/traces, open it and press Make a share link. Open the link in a signed-out window, then press Stop sharing and reload the link to get the not-found.Review notes
shareImported/unshareImported,withoutWho/cleanandtraceShare/traceUnshare. I left them because each pair is a mirror, not a duplicate.Closes #18377