Add a dedicated /lineage route with custom SVG-based tree visualization of the agent spawn chain. Nodes are colored by agent type (orchestrator, researcher, coder, sysadmin, assistant) and display agent ID, type, and spawn depth. Clicking a node opens a detail panel. Uses sample data since the API does not yet expose lineage information. Closes #15 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
Issue #15: Agent lineage visualization
Status: COMPLETED
Issue: #15
Branch: feature/issue-15-agent-lineage
Acceptance Criteria
- Dedicated
/lineageroute - Tree/graph visualization of agent spawn chain
- Each node displays: agent_id, agent_type, spawn_depth
- Visual hierarchy reflecting parent-child agent relationships
- Custom SVG-based rendering (no external graph library needed)
- Updates as new agents appear in the stream (reactive via
$derived) - Clickable nodes to show agent details
Implementation
New Files
src/lib/types/lineage.ts— lineage types (LineageNode,SimpleAgentIdentifier), tree builder, color/label helpers, sample datasrc/lib/components/LineageTree.svelte— custom SVG tree visualization with horizontal layout, bezier edges, colored nodes by agent type, click selectionsrc/routes/lineage/+page.svelte— dedicated lineage route with tree, legend, and detail panelsrc/routes/lineage/+page.ts— SSR disabled for this route
Modified Files
src/routes/+page.svelte— added navigation links to Chat and Agent Lineagesrc/routes/chat/+page.svelte— added Lineage link in header alongside Config button
Key Decisions
- Uses sample/demo data since the API does not yet expose lineage information (AuditService is write-only, ProcessRequestResponse does not include lineage)
SimpleAgentIdentifiertype decouples the UI from protobuf Message dependency, making it easy to adapt when real data arrives- Horizontal tree layout: root on left, children branching right, computed via recursive leaf-counting algorithm
- SVG bezier curves for edges, rounded rectangles for nodes
- Agent type colors: Orchestrator=blue, Researcher=green, Coder=purple, SysAdmin=orange, Assistant=teal, Unspecified=gray
- Detail panel slides in from right when a node is clicked, showing full agent info and child list
- Tree layout is fully reactive via
$derivedrunes — updating theagentsarray recomputes the tree automatically