Skip to content

q2 graph notebook: cockpit frontend + Rust binary#1

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/design-graph-notebook-frontend-Pwoqh
Mar 24, 2026
Merged

q2 graph notebook: cockpit frontend + Rust binary#1
AdaWorldAPI merged 3 commits into
mainfrom
claude/design-graph-notebook-frontend-Pwoqh

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Mar 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Cockpit frontend prototype — 3 design variants (pure CSS Grid, Tailwind, polished cockpit) demonstrating the graph notebook UI
  • q2 binary extendedq2 notebook serve (port 2718) and q2 notebook render subcommands
  • MCP over SSE — 10 MCP tools for AI copilot integration
  • Publisher — HTML renderer with dark cockpit theme, PDF via pandoc shelling
  • 6 stub crates — notebook-runtime, notebook-query, notebook-kernel, notebook-render, lance-graph, q2-ndarray

What works

cargo build                           # compiles clean, no warnings
./target/debug/q2 notebook serve      # starts on :2718
curl localhost:2718/health             # {"status":"ok","engine":"lance-graph"}
./target/debug/q2 notebook render --help  # shows render subcommand

Architecture

Server endpoints (axum on :2718)

Route Method Purpose
/ GET Cockpit frontend (placeholder)
/health GET {"status":"ok","version":"0.1.0","engine":"lance-graph"}
/mcp/sse GET MCP over Server-Sent Events
/mcp/message POST MCP tool invocations (JSON-RPC 2.0)

MCP tools

cell_execute, cell_get, cells_list, cell_create, cell_update, cell_delete, dag_get, notebook_save, notebook_load, notebook_export

Language auto-detection

  • g.V() → gremlin
  • MATCH ( → cypher
  • PREFIX / SELECT ? → sparql
  • %>% / <- → r
  • let / fn → rust
  • else → markdown

Publisher

  • q2 notebook render input.nb --format html → self-contained HTML with dark theme, collapsible code, embedded tables
  • q2 notebook render input.nb --format pdf → shells out to pandoc + wkhtmltopdf

Stub crates (under crates/stubs/)

Each marked // TODO: replace when crate is transcoded:

  • notebook-runtime — reactive cell DAG (Runtime, Cell, CellOutput, ExecutionState)
  • notebook-query — language detection + query execution routing
  • notebook-kernel — R kernel protocol stub
  • notebook-render — graph/table/chart/scalar → HTML
  • lance-graph — graph storage + semiring algebra
  • q2-ndarray — SIMD array kernels

Frontend prototypes (cockpit-prototype/)

  • index.html + cockpit.css + cockpit.js — CSS Grid, custom force simulation, 24-node demo graph
  • cockpit-tailwind.html — Tailwind single-file, 3-column layout
  • cockpit-polished.html — Full cockpit with situation panel, sparkline canvas, reactive pulse

Test plan

  • cargo build -p quarto compiles with zero errors
  • q2 notebook serve --port 2719 starts and /health returns OK
  • q2 notebook render --help shows correct CLI interface
  • Open cockpit prototypes in Chrome/Firefox/Safari
  • Test MCP tool calls via POST /mcp/message
  • Test notebook save/load round-trip
  • Test HTML export with sample notebook

https://claude.ai/code/session_01LSbSrej6WdKum1zCxEHE8z

Two design variants for the cockpit UI:
- cockpit.css/js + index.html: Pure CSS Grid layout with custom force-directed
  graph simulation, sortable linked table, properties sidebar, notebook cell
  stack. Dark theme (#0a0e17), teal accents (#00bcd4), Inter + JetBrains Mono.
- cockpit-tailwind.html: Tailwind-based single-file variant with 3-column
  layout (notebook sidebar, graph+table center, inspector right).

Both implement: query bar with language auto-detection, interactive draggable
graph nodes, linked selection (graph <-> table <-> properties), syntax-
highlighted code cells (Gremlin/R/SPARQL), mini chart output, status bar.

https://claude.ai/code/session_01LSbSrej6WdKum1zCxEHE8z
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

claude added 2 commits March 23, 2026 23:56
Third design variant with 4-row, 3-column CSS Grid layout:
situation panel (metrics, filters, example queries), center graph
with force sim + panning/zoom, node intelligence sidebar with
sparkline canvas, full-width result table, reactive cell strip.

https://claude.ai/code/session_01LSbSrej6WdKum1zCxEHE8z
The q2 binary now includes `q2 notebook serve` and `q2 notebook render`:

Server (port 2718):
- GET /           → cockpit frontend (placeholder)
- GET /health     → {"status":"ok","engine":"lance-graph"}
- GET /mcp/sse    → MCP over Server-Sent Events
- POST /mcp/message → MCP tool invocations (JSON-RPC 2.0)

MCP tools: cell_execute, cell_get, cells_list, cell_create,
cell_update, cell_delete, dag_get, notebook_save, notebook_load,
notebook_export

Language auto-detection:
- g.V() → gremlin, MATCH ( → cypher, PREFIX/SELECT ? → sparql
- %>%/<- → r, let/fn → rust, else → markdown

Publisher:
- q2 notebook render input.nb --format html → self-contained HTML
  with dark cockpit theme, collapsible code cells, embedded tables
- q2 notebook render input.nb --format pdf → shells out to pandoc

Stub crates (6): notebook-runtime, notebook-query, notebook-kernel,
notebook-render, lance-graph, q2-ndarray. Each marked TODO for
replacement when real crates are transcoded.

https://claude.ai/code/session_01LSbSrej6WdKum1zCxEHE8z
@AdaWorldAPI AdaWorldAPI changed the title Design: q2 graph notebook cockpit frontend prototype q2 graph notebook: cockpit frontend + Rust binary Mar 24, 2026
@AdaWorldAPI AdaWorldAPI merged commit ab598ee into main Mar 24, 2026
AdaWorldAPI pushed a commit that referenced this pull request Jun 21, 2026
Replace the Phase 0 unimplemented!() bodies with the real impls:
AttributionDataBuilder interns actors once and Arc::clone-s thereafter;
AttributionMap::query_byte_range uses partition_point + a forward walk
to pick the most-recent overlapping run; PreBuiltAttributionProvider::
build re-interns through the builder so transport JSON round-trips
restore Arc<str> ptr-equality; format_supports_attribution matches
FormatIdentifier::Html (covers html, q2-debug, extension HTML);
from_config_value reads meta.attribution.identities into an IdentityMap
with fresh Arc keys so Phase 2's merge can preserve provider keys on
collision. Turns Phase 0 tests #1 + #2 (10 cases) green; the 8 regression
pins stay green.
AdaWorldAPI pushed a commit that referenced this pull request Jun 24, 2026
The frontier-map's highest-leverage [G] probe (Dudzik-Veličković, GNNs are
Dynamic Programmers, 2203.15544: message-passing = DP over a semiring), made
executable. The diplotype→phenotype→recommendation chain `cpic reason` computes
is a single semiring transitive closure (Floyd-Warshall) over the CPIC edge
adjacency; swapping ONLY the semiring switches the reasoning mode on the SAME
graph: Boolean→reachability, MinPlus→cheapest path, Nars→CPIC confidence
(f=f1f2, c=f1f2c1c2), MaxTimes→most-likely path.

Keystone (asserted + unit-tested): the Nars semiring closure reproduces
reason.rs's deduction EXACTLY for CYP2C19 *2/*2 → clopidogrel — f=0.950,
c=0.767, identical. Retrieval and reasoning are the same operation; the mode is
the algebra, not the traversal. Edge truths read from the real CPIC
recommendation classification + pair cpiclevel (same mapping as reason.rs).

Self-contained Floyd-Warshall keeps cpic dep-light; in production this is a
lance-graph GraphBLAS matrix walk at scale. 2 tests (the keystone identity +
four-modes-one-graph). POC over published CPIC rules — NOT clinical decision support.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GJ4NVBSjq1w5h7RmTbVafb
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