feat(trace): add diagnosis trace workbench

This commit is contained in:
aruo
2026-07-07 01:24:56 +08:00
parent b3315ead52
commit aa035b828c
9 changed files with 1505 additions and 2 deletions
@@ -0,0 +1,36 @@
## ADDED Requirements
### Requirement: MVP demo SHALL provide a browser trace workbench
The MVP demo SHALL provide a browser-accessible static page for inspecting one
diagnosis trace by session id using the existing read-only Trace API.
#### Scenario: Existing trace renders in the workbench
- **WHEN** a reviewer opens the Trace workbench with a session id that exists
- **THEN** the page SHALL request `GET /api/diagnosis/{sessionId}/trace`
- **AND** it SHALL render session summary, ordered agent steps, ordered tool
invocations, verifier evaluation, and final answer when present
#### Scenario: Trace workbench handles missing or failed traces
- **WHEN** the Trace API returns an error or the session id is empty
- **THEN** the page SHALL show a clear error or empty state without mutating any
diagnosis data
### Requirement: Trace workbench SHALL expose evidence and skill boundaries
The Trace workbench SHALL make tool evidence and skill-loading boundaries visible
without requiring raw JSON inspection first.
#### Scenario: Tool and verifier evidence are inspectable
- **WHEN** a trace includes tool invocations and verifier facts
- **THEN** the page SHALL show tool invocation counts, success status, tool
filters, verifier facts, and evidence references
#### Scenario: RAG details are inspectable for lookup knowledge calls
- **WHEN** a `lookup_knowledge` invocation includes retrieval details
- **THEN** the page SHALL show query transform, retrieval trace, context pack,
rerank trace, and evidence block data where available
#### Scenario: Skill boundary checks are visible
- **WHEN** a trace includes planner, executor, or verifier steps
- **THEN** the page SHALL show best-effort indicators for selected skill,
planner `read_skill` text mentions, executor `read_skill` text mentions, and
verifier `read_skill` text mentions