Skip to content

Commit fe2d6f3

Browse files
author
Claude Sonnet (coordinator)
committed
feat(viz): P3 — holon-viz-wasm crate + TypeScript/esbuild build step
- holon-viz-wasm: 8 wasm-bindgen filter/query functions for client-side graph filtering (text, z_layer, semantic_type, edge label, stats) - TypeScript build pipeline: esbuild + @types/cytoscape, hand-authored src/types.ts, legacy JS wrapped for incremental migration - Justfile: build-wasm, ui-install, ui-build, ui-typecheck, ui-watch - PRD-HANDOVER.md: all P1-P3 viz backlog items now shipped
1 parent f7041a3 commit fe2d6f3

18 files changed

Lines changed: 2167 additions & 443 deletions

File tree

.b00t/tasks.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
"id": 2,
1515
"title": "Add autorun + UX test automation with countdown timer",
1616
"description": "ledgrrr window has white screen. Need autorun with countdown timer (10s idle). UX test automation script parametrizes the countdown. Auto-stay-active after 10s idle.",
17-
"status": "pending",
17+
"status": "in-progress",
1818
"priority": 1,
1919
"tags": [],
20-
"created_at": "2026-05-03T17:36:40Z"
20+
"created_at": "2026-05-03T17:36:40Z",
21+
"updated_at": "2026-05-13T14:40:54Z"
2122
},
2223
{
2324
"id": 3,
@@ -94,4 +95,4 @@
9495
}
9596
],
9697
"version": "1"
97-
}
98+
}

Cargo.lock

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ members = [
2020
"kani-proofs",
2121
"crates/holon-viz",
2222
"crates/ledgerr-model-server",
23+
"crates/holon-viz-wasm",
2324
]
2425
resolver = "2"
2526

Justfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,28 @@ test-holon-viz:
119119
test-holon-viz-fast:
120120
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "D:\Projects\l3dg3rr\scripts\test-holon-viz.ps1" -SkipBuild
121121

122+
# Build WASM package for holon-viz filtering
123+
build-wasm:
124+
cd crates/holon-viz-wasm && wasm-pack build --target web --out-dir pkg
125+
126+
# ─── UI build (TypeScript / esbuild) ──────────────────────────────────────────
127+
128+
# Install UI dependencies
129+
ui-install:
130+
cd crates/ledgerr-host/ui && npm install
131+
132+
# Build UI TypeScript bundle
133+
ui-build: ui-install
134+
cd crates/ledgerr-host/ui && npm run build
135+
136+
# Type-check UI
137+
ui-typecheck: ui-install
138+
cd crates/ledgerr-host/ui && npm run typecheck
139+
140+
# Watch UI for development
141+
ui-watch:
142+
cd crates/ledgerr-host/ui && npm run watch
143+
122144
# ─── Local model assets ───────────────────────────────────────────────────────
123145

124146
# Install Microsoft Foundry Local on Windows, then print version and service status.

PRD-HANDOVER.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ Priority legend: **P1** = current sprint / unblocked, **P2** = next sprint, **P3
124124
| ~~P2~~ | ~~`MutationRecord` dead code~~ | Shipped 2026-05-14. Unified into canonical owned struct in `workbook.rs`; `append_mutation_record()` wired; `classify.rs` re-exports. 3 call sites converted. |
125125
| ~~P2~~ | ~~Seed ↔ `HasVisualization` gap detector~~ | Shipped 2026-05-14. `seed_typed_nodes_cover_all_has_visualization_impls` in `holon-viz/src/type_graph.rs`; 23 typed_node IDs checked. Also fixed seed gap: MetaCtx and Disposition were missing. |
126126
| ~~P2~~ | ~~Rhai DSL validation~~ | Shipped 2026-05-14. `all_viz_spec_rhai_dsl_has_valid_syntax` in `ledger-core/src/iso_objects.rs`; 22/22 pass. Fixed 12 invalid DSL strings (reserved keywords, struct literals, tuple syntax). |
127-
| P2 | `HasVisualization` trait wiring | Wire `HasVisualization` implementations from `ledger-core/src/iso_objects.rs` into Cytoscape node metadata (ZLayer → node color, SemanticType → node shape) |
128-
| P3 | `holon-viz-wasm` crate | `wasm-bindgen` on `VizGraph` for client-side filtering (e.g., filter-by-kind). Add when filter UX is a P1 item. Do not add speculatively. |
129-
| P3 | TypeScript build step for UI | `cytoscape@3` has built-in TS types; add `esbuild` build step to `ui/` when ready |
127+
| ~~P2~~ | ~~`HasVisualization` trait wiring~~ | Shipped 2026-05-14. `z_layer`/`semantic_type` on `TypeNode`/`CytoscapeNodeData`; 21 types annotated; `z_layer` CSS selectors in `main.js`. |
128+
| ~~P3~~ | ~~`holon-viz-wasm` crate~~ | Shipped 2026-05-14. `crates/holon-viz-wasm` — 8 `wasm-bindgen` filter/query functions; native `#[test]`s + `wasm_bindgen_test` suite; `just build-wasm` recipe. |
129+
| ~~P3~~ | ~~TypeScript build step for UI~~ | Shipped 2026-05-14. `crates/ledgerr-host/ui/` — esbuild + TypeScript + `@types/cytoscape`; `ui-build`/`ui-typecheck`/`ui-watch` recipes; hand-authored `src/types.ts`; legacy JS wrapped during incremental migration. |
130130

131131
---
132132

133-
*Last updated: 2026-05-13 (PM-4 session)*
133+
*Last updated: 2026-05-14 (P3 viz infrastructure session)*
134134

135135
---
136136

@@ -265,6 +265,28 @@ Both are tooling constraints, not delegation failures. Coordinator did inline Py
265265
- CDP test `just test-holon-viz-fast`**7/7 PASS**: 47 nodes, 21 z_layer-typed, 57 edges, hierarchy confirmed
266266

267267
### Backlog Status
268-
All P2 items shipped. Only P3 items remain (holon-viz-wasm, TS build step).
268+
All P2 items shipped. P3 items remaining (holon-viz-wasm, TS build step).
269+
270+
---
271+
272+
## Session Log — 2026-05-14 (P3 viz infrastructure session)
273+
274+
### Shipped
275+
276+
| Item | Details |
277+
|------|---------|
278+
| **`holon-viz-wasm` crate** | `crates/holon-viz-wasm/` — new workspace member. 8 `wasm-bindgen` filter functions: `filter_nodes_by_text`, `filter_nodes_by_z_layer`, `filter_nodes_by_semantic_type`, `filter_edges_by_label`, `get_unique_edge_labels`, `get_unique_z_layers`, `get_unique_semantic_types`, `get_graph_stats`. All stateless (JSON in → JSON out). 6 native `#[test]`s + 5 `wasm_bindgen_test` browser tests. `just build-wasm` recipe. |
279+
| **TypeScript/esbuild build step** | `crates/ledgerr-host/ui/``package.json` (esbuild + typescript + @types/cytoscape), `tsconfig.json`, `build.mjs` (esm bundle, CDN externals), `src/types.ts` (hand-authored `CytoscapeGraph` interfaces), `src/main.ts` (legacy wrapper). `main.js` renamed to `main-legacy.js`; esbuild produces new `main.js` (91.6kb, functionally identical). Justfile: `ui-install`, `ui-build`, `ui-typecheck`, `ui-watch`. |
280+
281+
### Build Status
282+
- `cargo check -p holon-viz-wasm` — clean
283+
- `cargo check -p holon-viz` — clean
284+
- `cargo check -p ledgerr-host --bin host-tauri` — clean
285+
- `npm run build` — 212ms, 91.6kb output
286+
- `npm run typecheck` — clean
287+
- `just check-drift` — all 3 artifacts pass
288+
289+
### Backlog Status
290+
All P1–P3 viz items shipped. Post-MVP viz roadmap complete.
269291

270-
*Last updated: 2026-05-14 (KerML codegen session)*
292+
*Last updated: 2026-05-14 (P3 viz infrastructure session)*

crates/holon-viz-wasm/Cargo.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "holon-viz-wasm"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
6+
description = "WASM bindings for holon-viz graph filtering — client-side Cytoscape graph queries compiled to WebAssembly"
7+
repository = "https://github.com/PromptExecution/ledgrrr"
8+
9+
[lib]
10+
crate-type = ["cdylib", "rlib"]
11+
12+
[dependencies]
13+
wasm-bindgen = "0.2"
14+
holon-viz = { path = "../holon-viz" }
15+
serde.workspace = true
16+
serde_json.workspace = true
17+
js-sys = "0.3"
18+
web-sys = { version = "0.3", features = ["console"] }
19+
20+
[dev-dependencies]
21+
wasm-bindgen-test = "0.3"
22+
23+
[lints.rust]
24+
unsafe_code = "deny"

0 commit comments

Comments
 (0)