Repository navigation
feat(dashboard): complete interactive evidence link graph - #94
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a bounded link-graph API and updates the dashboard’s provenance view to render an interactive, directed link graph (all relation types) with truncation handling and node previews, supporting Issue #50’s visualization requirements.
Changes:
- Introduces a bounded link-graph projection in the domain layer and exposes it via
ContextSeek.link_graph(). - Adds a
/link_graphHTTP endpoint (with request bounds) and corresponding unit tests. - Updates the dashboard to call
/link_graph, render an interactive ReactFlow graph (colors/arrows/minimap), and extends TS types + i18n strings.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit_tests/test_http_server.py | Adds coverage for /link_graph forwarding and request validation. |
| tests/unit_tests/domain/test_link_graph.py | Adds unit tests for link-graph traversal, missing targets, relation coverage, and truncation. |
| src/contextseek/http/server.py | Adds LinkGraphRequest and a /link_graph endpoint. |
| src/contextseek/domain/link_graph.py | New bounded link-graph data model and builder (build_link_graph). |
| src/contextseek/domain/init.py | Re-exports link-graph types and builder. |
| src/contextseek/client/contextseek.py | Adds ContextSeek.link_graph() implementation and audit emission. |
| dashboard/vite.config.ts | Proxies /link_graph in dev/preview. |
| dashboard/src/panels/ProvenancePanel.tsx | Fetches link graph alongside evidence chain and renders it in the Graph tab. |
| dashboard/src/panels/components/EvidenceGraph.tsx | Reworks graph rendering to visualize the link graph with relation colors, arrows, minimap, and node details. |
| dashboard/src/lib/types.ts | Adds LinkGraph request/response TS types. |
| dashboard/src/lib/i18n.tsx | Adds new localized strings for graph summary/truncation/node details. |
| dashboard/src/lib/ctxClient.ts | Adds ctx.linkGraph() client wrapper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+98
to
+102
| <EmptyState | ||
| loading={chain.loading || graph.loading} | ||
| error={chain.error || graph.error} | ||
| empty={!chain.data || !graph.data} | ||
| > |
Comment on lines
+119
to
+124
| for neighbor_id in sorted(neighbors[item_id]): | ||
| if neighbor_id in depth_by_id: | ||
| continue | ||
| if len(depth_by_id) >= max_nodes: | ||
| truncated = True | ||
| continue |
Comment on lines
+1082
to
+1086
| result = build_link_graph( | ||
| root_item, | ||
| self._load_scope_items(scope=scope), | ||
| max_depth=max_depth, | ||
| max_nodes=max_nodes, |
Comment on lines
+102
to
+107
| class LinkGraphRequest(BaseModel): | ||
| scope: str | ||
| item_id: str | ||
| max_depth: int = Field(default=3, ge=0, le=10) | ||
| max_nodes: int = Field(default=100, ge=1, le=500) | ||
|
|
Comment on lines
+64
to
+69
| <div className="text-left text-slate-900"> | ||
| <div className="truncate font-mono text-[10px] opacity-70">{node.item_id}</div> | ||
| <div className="text-xs font-semibold">{node.stage}</div> | ||
| <div className="text-[10px]"> | ||
| conf {n.effective_confidence.toFixed(2)} | ||
| {n.is_missing && " · missing"} | ||
| confidence {node.confidence.toFixed(2)} | ||
| {node.is_missing && " · missing"} |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/link_graphAPI that traverses incoming and outgoing links while preserving edge directionValidation
uv run ruff check ...uv run --extra http pytest tests/unit_tests/domain/test_link_graph.py tests/unit_tests/test_http_server.py -q -k link_graph(6 passed)npm run buildCloses #50