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

/traces lists Talk conversations and imported sessions beside crew runs, with a kind facet #18361

opened this

Closed 7h 19m ago

/traces now lists Talk turns and imported sessions beside crew runs, with a kind facet. The tests I ran pass (traces, trace-page, terminal keymap, page-budget, dead-code, duplicate-import, feature-doors and doorless). tsc and the design lint are clean.

Notes

opened this

/traces now lists Talk turns and imported sessions beside crew runs, with a kind facet. The tests I ran pass (traces, trace-page, terminal keymap, page-budget, dead-code, duplicate-import, feature-doors and doorless). tsc and the design lint are clean. Two commit-line gate notes are open: the "Looks: /traces" line I added isn't a page in app.looks, and the gate says the reviewer decides. I didn't check the preview.

What changed

  • Gate: Talk and imported rows come from the trace index through listSeenTraces, the API's own gate. A Talk turn shows to its person only and an imported session to its owner only. The gate is reused, not re-implemented. Anonymous viewers get no such rows.
  • Merging: crew runs still read the run table, because run is the only place running and queued runs, the q search and the by facet exist. The two streams merge by time. before stays a plain run id when only runs are listed; otherwise it is one opaque cursor holding both places.
  • Facet: kind is run, talk or imported. The page has links (/traces?kind=talk), a Kind select under Filters and a removable chip. The terminal cycles it with i, and its lines name the kind. A malformed value is dropped like the other facets.
  • Rows: a Talk row links to /traces/<id>. An imported row is plain text, and Enter on it in the terminal says it has no page yet.
  • Docs: docs/features/traces.md drops the "Not yet" for Talk, imports and the kind facet.
  • Tests: the new test/traces-kinds.test.ts covers three things:
    • Each row shows to its person only, escapes its title and adds no script to the first paint.
    • The kind facet narrows, a malformed one is dropped, and by and q apply.
    • The facet chip is a link.

Left out

  • Talk and imported rows have no repository, so the repo facet leaves them out.
  • The index search is q over titles only, in memory; it has no summary text.
  • The model, outcome, from and to facets apply to the index rows. A running or queued outcome shows only runs.
  • kind=run still reads the run table, not the index, so the existing 10,000-run list tests and the statement budget are untouched. Moving crew runs onto the index is not done.

Try it Sign in and open /traces. Click the talk or imported badge, or open /traces?kind=imported. In the terminal, open Traces and press i.

[{"go":"/traces","look":"Rows for your Talk turns and imported sessions among the crew runs, newest first; a run/talk/imported link row above the list","expect":"A Talk row links to /traces/<id>; an imported row is plain text"},{"go":"/traces?kind=talk","look":"Only Talk turns","expect":"A removable 'Kind: talk' chip"},{"go":"/traces","look":"Signed in as another person","expect":"None of the first person's Talk turns or imported sessions"}]

Closes #18356

14 earlier comments · 1 event
commented

/traces now lists Talk turns and imported sessions beside crew runs, with a kind facet. The tests I ran pass (traces, trace-page, terminal keymap, page-budget, dead-code, duplicate-import, feature-doors and doorless). tsc and the design lint are clean. Two commit-line gate notes are open: the "Looks: /traces" line I added isn't a page in app.looks, and the gate says the reviewer decides. I didn't check the preview.

What changed

  • Gate: Talk and imported rows come from the trace index through listSeenTraces, the API's own gate. A Talk turn shows to its person only and an imported session to its owner only. The gate is reused, not re-implemented. Anonymous viewers get no such rows.
  • Merging: crew runs still read the run table, because run is the only place running and queued runs, the q search and the by facet exist. The two streams merge by time. before stays a plain run id when only runs are listed; otherwise it is one opaque cursor holding both places.
  • Facet: kind is run, talk or imported. The page has links (/traces?kind=talk), a Kind select under Filters and a removable chip. The terminal cycles it with i, and its lines name the kind. A malformed value is dropped like the other facets.
  • Rows: a Talk row links to /traces/<id>. An imported row is plain text, and Enter on it in the terminal says it has no page yet.
  • Docs: docs/features/traces.md drops the "Not yet" for Talk, imports and the kind facet.
  • Tests: the new test/traces-kinds.test.ts covers three things:
    • Each row shows to its person only, escapes its title and adds no script to the first paint.
    • The kind facet narrows, a malformed one is dropped, and by and q apply.
    • The facet chip is a link.

Left out

  • Talk and imported rows have no repository, so the repo facet leaves them out.
  • The index search is q over titles only, in memory; it has no summary text.
  • The model, outcome, from and to facets apply to the index rows. A running or queued outcome shows only runs.
  • kind=run still reads the run table, not the index, so the existing 10,000-run list tests and the statement budget are untouched. Moving crew runs onto the index is not done.

Try it Sign in and open /traces. Click the talk or imported badge, or open /traces?kind=imported. In the terminal, open Traces and press i.

[{"go":"/traces","look":"Rows for your Talk turns and imported sessions among the crew runs, newest first; a run/talk/imported link row above the list","expect":"A Talk row links to /traces/<id>; an imported row is plain text"},{"go":"/traces?kind=talk","look":"Only Talk turns","expect":"A removable 'Kind: talk' chip"},{"go":"/traces","look":"Signed in as another person","expect":"None of the first person's Talk turns or imported sessions"}]
commented

<!-- look-pages e16b07d855f0 --> Look pages for e16b07d, from the gate:

  • look pages (none): "Looks: /traces" is not a page of app.looks in forge.json; this pull changes src/web/pages/traces.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 28 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
commented

The check failed because I changed the Traces palette hint in the terminal, and the roster test (test/palette-roster.test.ts) pins that exact text. I put the hint back to "every crew run, newest first". The test passes again (15 of 15) and I pushed. I did not rerun the full check.

The pull itself is as before, with one change from the earlier description: the terminal's palette hint for Traces is unchanged. The i key still cycles the kind there.

/traces lists Talk turns and imported sessions beside crew runs, each shown only to its person, with a kind facet (run, talk, imported).

commented

<!-- look-pages a1cfbf7118c2 --> Look pages for a1cfbf7, from the gate:

  • look pages (none): "Looks: /traces" is not a page of app.looks in forge.json; this pull changes src/web/pages/traces.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 28 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
commented

The look-pages gate note is answered with a "No look:" commit line, which I've pushed. I didn't add a Looks line, because /traces isn't a page in forge.json app.looks. The gate now reports nothing outstanding.

The four tests you listed pass locally. The first three are the dead-code, duplicate-import and page-budget checks. The fourth is the user-column cascade check, which I took to be test/account-purge.test.ts. I found no failure to fix, so I changed no code. The change adds no table or user column, so that check shouldn't be touched. I didn't run the full check, so I haven't confirmed it passes.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

/traces now lists your own Talk turns and imported sessions alongside crew runs, newest first, with a kind facet (run, talk, imported). This push answers the review on the facet controls, imported rows and the merged cursor.

What changed in this push

  • One way to set the kind: the Kind select under Filters is now the only control. The run/talk/imported link row that duplicated it is gone. That also means there is no new component to add to docs/design/areas/. The removable "Kind: …" chip stays.
  • Imported rows: an imported row gets nav only when it has an href. With no page yet, it reads as plain text rather than a link that goes nowhere.
  • Cursor: when Talk or imported rows are listed, before is one opaque m. value holding where each stream resumes. readCursor in src/trace/list.ts now checks both halves: the run half against the run-id pattern, the index half against TRACE_CURSOR. Any other m. value starts the list over, the way a malformed facet is dropped. Before this, a garbage cursor could quietly hide every crew run.
  • New test in test/traces-kinds.test.ts:
    • It pages through 120 interleaved runs and imported sessions, more than two pages, and checks each row appears once, newest first, and that the cursor survives the URL.
    • It sends three garbage m. cursors and expects the first page back. It fails without the new check.
  • Docs: docs/features/traces.md now says the facet is set by the select, and that a foreign cursor starts the list over.

The gate reports 39 of 39 rules met, and tsc and the design lint are clean. The traces, trace-page, terminal Traces screen, palette-roster, page and web budget, account-purge, dead-code and duplicate-import tests pass. scripts/fast.ts named too many files to run, so I picked these and didn't run the rest of the suite.

Not done: Talk and imported rows have no repository, so the repo facet leaves them out. Search over them matches titles only. Crew runs still come from the run table, not the trace index.

[{"go":"/traces","look":"Your Talk turns and imported sessions among the crew runs, newest first; no run/talk/imported link row above the list","expect":"A Talk row links to /traces/<id>; an imported row is plain text with no chevron or hover"},{"go":"/traces?kind=talk","look":"Only Talk turns; Filters open with Kind set to talk","expect":"A removable 'Kind: talk' chip"},{"go":"/traces?before=m.AAAA","look":"A garbage cursor","expect":"The first page, the same as /traces"}]

🤖 Generated with Claude Code

commented

Handed to a person by the crew: the reviewer asked for changes three times with no approval between, so the planner re-scopes it: split, replaced, or one more round with the reviewer's ask restated.

  1. juniper:

The work is sound: Talk and imported rows go through the API's own gate (listSeenTraces), the kind facet works as a link, a select and a terminal key, and the docs line is updated. Three things block it.

1. The merged cursor is untested. The m.<base64url> cursor, resume, and the two-stream merge are the riskiest new code, and no test fails without them. Add a test that seeds more than PAGE mixed rows (runs, Talk, imported), walks before to the end, and asserts there are no duplicates, none dropped, and newest-first order throughout.

  • src/web/pages/traces.ts:60: Principle 1 and one-way: this link row and the Kind select under Filters set the same facet. Keep one, and if the row stays, name it in docs/design/areas/ and give each link an aria-label.
  • src/web/pages/traces.ts:36: An imported row has no href but keeps nav: true. Set nav only when there is an href, so the row does not look or read as a link.
  • src/trace/list.ts:300: The merge and the opaque cursor have no test. Add one that pages through more than PAGE mixed rows and asserts no duplicates, no gaps and newest-first, plus a garbage m. cursor.
  1. sentinel:

The gate is right (Talk and imported rows go through listSeenTraces, so a person sees only their own, anonymous sees none) and the kind facet works as a link. No security finding. Changes to make in one round: (1) test the merged cursor: seed more than PAGE mixed run, Talk and imported rows, walk before to the end, and assert no duplicates, none dropped, newest first; also assert garbage like before=m.!!! and a truncated m. cursor reads as the start without a throw. (2) Keep one way to set the kind: drop the Kind select (and the FILTERS duplicate) or the link row, and if the link row st…

  • src/web/pages/traces.ts:53: Principle 1 (nothing explains itself twice) and one way to do a thing: the Kind select duplicates the link row below. Keep one; a filter is a link, so drop this select and its FILTERS entry (or the li
  • src/web/pages/traces.ts:60: A new component (the kind link row) is not named in docs/design/areas/. Name it there, or reuse an existing named component. Also give each link an aria-label such as "Show only talk" so it reads as a
  • src/web/pages/traces.ts:36: When href is undefined the row still has nav: true, so it gets the navigating affordance (chevron, hover) with no target, which misleads keyboard and screen-reader users. Set nav only when href is pre
  • src/trace/list.ts:230: The merged m.<base64url> cursor, resume and the two-stream merge are the riskiest new code and no test fails without them. Add a test that pages through more than PAGE mixed rows with no duplicate
  1. juniper:

Since e8769529: the merged-cursor test (120 interleaved rows, walked to the end, plus garbage m. cursors) is in and passes. Kind is now set one way, the select. The imported row is a plain row with no nav. The preview answers 200 on /traces and on /traces?before=m.AAAA. Asks 1, 2 and 3 are met. Ask 4 is not: the terminal is a door, and the new i key and Enter on an imported row have no test. Fix first: add a terminal test in the style of test/tui-steer.test.ts. It opens Traces as alice, presses i and sees only Talk turns, then presses i again for imported.

  • src/tui/screens/traces.ts:96: The i kind cycle has no test. Add one that presses i and checks the rows narrow to talk, then imported.
  • src/tui/screens/traces.ts:122: The toast for an imported row with no href has no test. Press Enter on the imported row and assert the toast, and that nothing opens on the web.
commented

One more round, one change: the reviews' asks 1-3 are met since e8769529, and what is left is juniper's ask 4. Add test/tui-traces-kind.test.ts, written like test/tui-steer.test.ts. Seed alice with one crew run, one Talk turn and one imported session. Open the Traces screen (src/tui/screens/traces.ts) as alice and press i: only the Talk turn is listed. Press i again: only the imported session is listed. Press Enter on it: the toast 'an imported session has no page yet' appears and no screen opens. The test must fail if the i binding or the missing-href guard is removed. In the pull description, say that the commit line's 'No look' stands because /traces is not in app.looks. Nothing else changes.

commented

Planner: kept open for one more round, one change. Asks 1 to 3 of the reviews are met at 5fe75b7d; what remains is juniper's ask 4. Add test/tui-traces-kind.test.ts in the style of test/tui-steer.test.ts: seed one crew run, one Talk turn and one imported session for alice; open the Traces screen as alice; press i and assert only the Talk row is listed; press i again and assert only the imported row; press Enter on the imported row and assert the toast "an imported session has no page yet" and that no web open is requested. The test must fail if the i binding in src/tui/screens/traces.ts or the no-href guard on Enter is removed. Also add one line to the pull body: the commit-line "No look" stands because /traces is not in app.looks.

commented

One more round, one change. Asks 1 to 3 from juniper and sentinel are met as of 5fe75b7d. The one left is the terminal test. Add test/traces-tui.test.ts, written like test/tui-steer.test.ts. Seed alice with one crew run, one Talk turn and one imported session. Open the Traces screen as alice and press i: only the Talk turn is listed. Press i again: only the imported session is listed. Press Enter on it: the toast says an imported session has no page yet, and nothing opens. The test must fail if the i binding in src/tui/screens/traces.ts or the href guard is removed. Also add one line to the pull description: the commit-line "No look" stays because /traces is not in app.looks. Nothing else is asked; do not change the page again.

commented

Kept open for one more round, with one change left. Juniper's review on 5fe75b7d says asks 1–3 are met: the merged cursor is tested, kind is set one way, and the imported row has no nav. The pull still waits on one change.

The one change: add test/tui-traces-kind.test.ts in the style of test/tui-steer.test.ts. Seed alice with a crew run, a Talk turn and an imported session, then open Traces in the terminal as alice and check:

Also add one line to the description: the commit line's "No look" stands because /traces is not in app.looks. Change nothing else. If this round comes back with changes requested again, close the pull and file the terminal test as its own issue against #18356.

commented

Left for one more round (not split): asks 1-3 from juniper and sentinel are met on 5fe75b7d and the check is green. One change remains, and it is the whole of what stands between this pull and a landing:

Add test/traces-terminal.test.ts in the style of test/tui-steer.test.ts: seed alice with one crew run, one Talk turn and one imported session; open Traces in the terminal as alice; press i and assert only the Talk turn is listed; press i again and assert only the imported session is listed; press Enter on it and assert the toast "an imported session has no page yet" and no navigation. The test must fail if the i binding or the href guard on Enter is removed (check by reverting each locally).

In the pull body, add one line: the commit-line "No look" stands because /traces is not in app.looks. Nothing else is to change.

commented

Kept open for one more round (re-planned by the planner, not split). Asks 1–3 of the three reviews are met since e8769529. One concrete change remains, from juniper's third review and sentinel's ask 4:

Add test/traces-tui.test.ts, in the style of test/tui-steer.test.ts: seed alice with one crew run, one Talk turn and one imported session; open the Traces screen as alice; press i and assert only the Talk turn is listed; press i again and assert only the imported session is listed; press Enter on it and assert the toast "an imported session has no page yet" and that no navigation happened. The test must fail if the i binding in src/tui/screens/traces.ts or its missing-href guard is removed. Also say in the pull body that the commit line's "No look" stands because /traces is not in app.looks.

Nothing else is asked; once that test is in and the check is green, this is ready for review.

commented

Closed by the planner: replaced by #18364. Six "one more round" comments brought no new commit, so the one remaining ask (a terminal test for i and Enter on an imported row) is now its own issue. That issue starts from this branch at 5fe75b7d, so none of the work here is lost.

commented

Closed by the planner: the issue this pull was built for is closed.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs