feat(research): add trace-workbench local session-replay UI
A localhost viewer over persisted session JSONL for agent developers and researchers. Three first-class views — Chat (markdown-rendered surface conversation with a second-level inspector), Trajectory (turn/step tree with scroll-spy over a step-grouped event table, inline annotations), and Waterfall (timing summary + aligned time track that deep-links into Trajectory). Subagent sessions group under their parentSession with spawn links and breadcrumbs; failed tool calls are marked in every view; ?session=&view=&sel= makes any selection a shareable deep link. Motion follows an audited restraint baseline (plans/ documents the audit): one strong ease-out token, enter-only animations, press feedback on pushbuttons, prefers-reduced-motion support. AGENTS.md gains the research/ layout entry; the AGENTS.md word ceiling rises 1370 -> 1375 to fit it (one line, relocation not applicable for a top-level layout entry).
This commit is contained in:
39
research/trace-workbench/README.md
Normal file
39
research/trace-workbench/README.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# DeepSeek Harness Trace Workbench
|
||||
|
||||
Localhost UI backed by real DeepSeek Harness persisted session JSONL files.
|
||||
|
||||
```sh
|
||||
node server.js
|
||||
```
|
||||
|
||||
Then open <http://127.0.0.1:5173/>.
|
||||
|
||||
Defaults:
|
||||
|
||||
- Reads sessions from `./.sessions` under the current working directory (set `HARNESS_SESSIONS_ROOT` to point elsewhere)
|
||||
- Serves static UI and API from the same localhost origin
|
||||
- Annotations are appended to `.feedback/*.jsonl` next to the server (local data, not committed)
|
||||
|
||||
Useful overrides:
|
||||
|
||||
```sh
|
||||
HARNESS_SESSIONS_ROOT=/path/to/.sessions PORT=5174 node server.js
|
||||
```
|
||||
|
||||
API:
|
||||
|
||||
- `GET /api/health`
|
||||
- `GET /api/sessions`
|
||||
- `GET /api/sessions/:id`
|
||||
|
||||
Current UI capabilities:
|
||||
|
||||
- Reads real session JSONL, not mock data; replay-only (the composer is disabled until live runtime wiring lands).
|
||||
- Three first-class views; the inspector is second-level and belongs to Chat only:
|
||||
- **Chat** — markdown-rendered surface conversation; clicking a message opens the inspector as an inner column (paired Input/Output, metadata, feedback, Plain/JSON/JSONL/YAML formatting) that squeezes the conversation, never overlays it.
|
||||
- **Trajectory** — self-contained: a structure tree (turn → step, with durations, tool summaries and error dots) navigates a step-grouped event table; lifecycle events are absorbed into the tree and sticky group headers instead of appearing as rows. Expanded rows carry Copy JSON, inline annotations (标注) and the raw event.
|
||||
- **Waterfall** — hotspot finder: a summary strip (total / LLM time / tool time / errors / slowest step / tokens) plus an aligned time track; clicking any bar, label or stat jumps to the matching Trajectory row.
|
||||
- Session list groups subagent sessions under their `parentSession`; a spawning tool call links to the sessions it spawned, and a child session shows a breadcrumb back to its parent.
|
||||
- Failed tool calls are marked in every view (red rail + `← error` chip in Trajectory, red bar in Waterfall, `Tool failed` in Chat).
|
||||
- Panes resize by dragging the dividers (clamped; widths persist), and all panes squeeze each other in one layer.
|
||||
- URL carries `?session=&view=&sel=` so any selection is a shareable deep link.
|
||||
Reference in New Issue
Block a user