Skip to content

feat(dashboard): complete interactive evidence link graph - #94

Merged
Teingi merged 1 commit into
ob-labs:mainfrom
vcvyg:issue-50-evidence-graph
Jul 31, 2026
Merged

Teingi merged 1 commit into
ob-labs:mainfrom
vcvyg:issue-50-evidence-graph

Conversation

@vcvyg

@vcvyg vcvyg commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a bounded /link_graph API that traverses incoming and outgoing links while preserving edge direction
  • visualize every link type with distinct colors, arrow direction, relation strength, pan/zoom controls, and a minimap for larger graphs
  • add node previews, unresolved-target handling, graph-size limits, and truncation feedback
  • keep the existing evidence-chain details and upstream views intact

Validation

  • 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 build
  • broader CPU suite: 460 passed, 3 skipped (excluding unrelated Windows PowerMem cases and three pre-existing order-dependent embedding settings tests)
  • Playwright smoke test with seeded data: 15 nodes, 14 edges, node details and controls verified, no console errors

Closes #50

Copilot AI review requested due to automatic review settings July 17, 2026 11:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_graph HTTP 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"}
@vcvyg

vcvyg commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

#50

@Teingi
Teingi merged commit 028a608 into ob-labs:main Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants