@vib3code/sdk 2.0.3-canary.91a95f3 → 2.0.3-canary.ef8d292
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DOCS/MASTER_PLAN_2026-01-31.md +2 -2
- package/DOCS/SYSTEM_INVENTORY.md +2 -2
- package/DOCS/WEBGPU_STATUS.md +119 -38
- package/DOCS/archive/WEBGPU_STATUS_2026-02-15_STALE.md +38 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-13.md +13 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-15.md +142 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-16.md +108 -0
- package/docs/webgpu-live.html +1 -1
- package/package.json +10 -1
- package/src/agent/index.js +1 -3
- package/src/agent/mcp/MCPServer.js +347 -52
- package/src/agent/mcp/index.js +1 -1
- package/src/agent/mcp/tools.js +87 -0
- package/src/cli/index.js +374 -44
- package/src/core/VIB3Engine.js +55 -3
- package/src/core/index.js +18 -0
- package/src/core/renderers/FacetedRendererAdapter.js +10 -9
- package/src/core/renderers/HolographicRendererAdapter.js +11 -7
- package/src/core/renderers/QuantumRendererAdapter.js +11 -7
- package/src/creative/index.js +11 -0
- package/src/export/index.js +11 -1
- package/src/faceted/FacetedSystem.js +27 -10
- package/src/games/glyph-war/GlyphWarVisualizer.js +641 -0
- package/src/holograms/HolographicVisualizer.js +58 -89
- package/src/holograms/RealHolographicSystem.js +126 -31
- package/src/math/Mat4x4.js +70 -13
- package/src/math/Rotor4D.js +100 -39
- package/src/math/index.js +7 -7
- package/src/quantum/QuantumVisualizer.js +24 -20
- package/src/reactivity/index.js +3 -5
- package/src/render/LayerPresetManager.js +372 -0
- package/src/render/LayerReactivityBridge.js +344 -0
- package/src/render/LayerRelationshipGraph.js +610 -0
- package/src/render/MultiCanvasBridge.js +148 -25
- package/src/render/ShaderLoader.js +38 -0
- package/src/render/ShaderProgram.js +4 -4
- package/src/render/UnifiedRenderBridge.js +1 -1
- package/src/render/backends/WebGPUBackend.js +8 -4
- package/src/render/index.js +27 -2
- package/src/scene/index.js +4 -4
- package/src/shaders/common/geometry24.glsl +65 -0
- package/src/shaders/common/geometry24.wgsl +54 -0
- package/src/shaders/common/rotation4d.glsl +4 -4
- package/src/shaders/common/rotation4d.wgsl +2 -2
- package/src/shaders/common/uniforms.wgsl +15 -8
- package/src/shaders/faceted/faceted.frag.wgsl +19 -6
- package/src/shaders/holographic/holographic.frag.wgsl +7 -5
- package/src/shaders/quantum/quantum.frag.wgsl +7 -5
- package/src/testing/ParallelTestFramework.js +2 -2
- package/src/ui/adaptive/renderers/webgpu/WebGPURenderer.ts +2 -2
- package/src/viewer/GalleryUI.js +17 -0
- package/src/viewer/ViewerPortal.js +2 -2
- package/tools/shader-sync-verify.js +6 -4
- package/types/adaptive-sdk.d.ts +204 -5
- package/types/agent/cli.d.ts +78 -0
- package/types/agent/index.d.ts +18 -0
- package/types/agent/mcp.d.ts +87 -0
- package/types/agent/telemetry.d.ts +190 -0
- package/types/core/VIB3Engine.d.ts +26 -0
- package/types/core/index.d.ts +261 -0
- package/types/creative/AestheticMapper.d.ts +72 -0
- package/types/creative/ChoreographyPlayer.d.ts +96 -0
- package/types/creative/index.d.ts +17 -0
- package/types/export/index.d.ts +243 -0
- package/types/geometry/index.d.ts +164 -0
- package/types/math/index.d.ts +214 -0
- package/types/render/LayerPresetManager.d.ts +78 -0
- package/types/render/LayerReactivityBridge.d.ts +85 -0
- package/types/render/LayerRelationshipGraph.d.ts +174 -0
- package/types/render/index.d.ts +3 -0
- package/types/scene/index.d.ts +204 -0
- package/types/systems/index.d.ts +244 -0
- package/types/variations/index.d.ts +62 -0
- package/types/viewer/index.d.ts +225 -0
|
@@ -19,10 +19,10 @@ The codebase is complete. The product isn't. You have 95,000+ lines of working e
|
|
|
19
19
|
- Creative Tooling (color presets, transitions, post-processing, timeline) — complete
|
|
20
20
|
- Platform Integrations (React, Vue, Svelte, Figma, Three.js, TouchDesigner, OBS) — code complete
|
|
21
21
|
- Advanced Features (WebXR, WebGPU Compute, MIDI, AI Presets, OffscreenWorker) — code complete
|
|
22
|
-
- MCP Agentic Control (14
|
|
22
|
+
- MCP Agentic Control (36 tools — 14 core + 22 added in Phases 6.5-8) — working
|
|
23
23
|
- C++ WASM Core with JS fallback — working
|
|
24
24
|
- Export System (SVG, CSS, Lottie, Shader, Trading Cards, VIB3Package) — working
|
|
25
|
-
-
|
|
25
|
+
- 1762 tests passing, 77 test files (as of Feb 15, 2026)
|
|
26
26
|
- 6 CI/CD workflows active
|
|
27
27
|
|
|
28
28
|
**What's not done**: Everything below.
|
package/DOCS/SYSTEM_INVENTORY.md
CHANGED
|
@@ -31,7 +31,7 @@ The SDK provides 3 active visualization systems with shared 6D rotation mathemat
|
|
|
31
31
|
| **Core Warp Types** | 3 (Base, Hypersphere, Hypertetrahedron) |
|
|
32
32
|
| **Total Geometries** | 24 per system (8 base × 3 cores) |
|
|
33
33
|
| **Canvas Layers** | 5 per system (background, shadow, content, highlight, accent) |
|
|
34
|
-
| **MCP Tools** |
|
|
34
|
+
| **MCP Tools** | 36 agent-accessible tools (14 core + 4 Phase 6.5 + 7 Phase 7 + 5 Phase 7.1 + 5 Phase 8 + 1 reactivity) |
|
|
35
35
|
| **Spatial Input Sources** | 8 (deviceTilt, mouse, gyroscope, gamepad, perspective, programmatic, audio, MIDI) |
|
|
36
36
|
| **Spatial Profiles** | 6 built-in (cardTilt, wearablePerspective, gameAsset, vjAudioSpatial, uiElement, immersiveXR) |
|
|
37
37
|
| **Creative Effects** | 14 post-processing effects, 22 color presets, 14 easing functions |
|
|
@@ -245,7 +245,7 @@ All rotation parameters: `-6.28` to `6.28` (radians, ±2π)
|
|
|
245
245
|
|
|
246
246
|
## MCP Server & Agent Tools
|
|
247
247
|
|
|
248
|
-
### Available Tools (
|
|
248
|
+
### Available Tools (36 total — see CLAUDE.md for full breakdown by phase)
|
|
249
249
|
|
|
250
250
|
| Tool | Description | Key Parameters |
|
|
251
251
|
|------|-------------|----------------|
|
package/DOCS/WEBGPU_STATUS.md
CHANGED
|
@@ -1,38 +1,119 @@
|
|
|
1
|
-
# WebGPU
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
# WebGPU Backend Status
|
|
2
|
+
|
|
3
|
+
**Last updated**: 2026-02-15
|
|
4
|
+
|
|
5
|
+
> Previous version archived at `DOCS/archive/WEBGPU_STATUS_2026-02-15_STALE.md`.
|
|
6
|
+
|
|
7
|
+
## Current State: Functional but Not Validated End-to-End
|
|
8
|
+
|
|
9
|
+
The WebGPU backend is **architecturally complete** — real device init, shader compilation, pipeline creation, uniform buffers, render passes. It is not a stub. However, no end-to-end browser validation has confirmed correct pixel output through the WebGPU path.
|
|
10
|
+
|
|
11
|
+
## What Is Implemented
|
|
12
|
+
|
|
13
|
+
| Component | Status | File |
|
|
14
|
+
|-----------|--------|------|
|
|
15
|
+
| Device/adapter/context init | Done | `src/render/backends/WebGPUBackend.js` (1410 lines) |
|
|
16
|
+
| Canvas configuration + resize | Done | WebGPUBackend.js |
|
|
17
|
+
| WGSL shader module compilation | Done | WebGPUBackend.js `compileShader()` |
|
|
18
|
+
| Fullscreen quad pipeline | Done | WebGPUBackend.js `createFullscreenPipeline()` |
|
|
19
|
+
| Custom geometry pipeline | Done | WebGPUBackend.js `createPipeline()` |
|
|
20
|
+
| Uniform buffer management | Done | WebGPUBackend.js `createCustomUniformBuffer()` / `updateCustomUniforms()` |
|
|
21
|
+
| Fullscreen quad rendering | Done | WebGPUBackend.js `renderFullscreenQuad()` |
|
|
22
|
+
| Geometry rendering | Done | WebGPUBackend.js `renderGeometry()` / `renderWithPipeline()` |
|
|
23
|
+
| Manual render pass control | Done | WebGPUBackend.js `beginRenderPass()` / `endRenderPass()` |
|
|
24
|
+
| Vertex/index buffer creation | Done | WebGPUBackend.js |
|
|
25
|
+
| Texture + sampler creation | Done | WebGPUBackend.js |
|
|
26
|
+
| Resource cleanup | Done | WebGPUBackend.js `dispose()` |
|
|
27
|
+
| WebGL/WebGPU bridge abstraction | Done | `src/render/UnifiedRenderBridge.js` |
|
|
28
|
+
| Uniform packing (JS → GPU) | Done | `packVIB3Uniforms()` in UnifiedRenderBridge.js |
|
|
29
|
+
| FacetedSystem WebGPU path | Done | `src/faceted/FacetedSystem.js` `initWithBridge()` |
|
|
30
|
+
|
|
31
|
+
## WGSL Shader Files
|
|
32
|
+
|
|
33
|
+
All seven WGSL files are real, substantive shaders (not stubs):
|
|
34
|
+
|
|
35
|
+
| File | Lines | Content |
|
|
36
|
+
|------|-------|---------|
|
|
37
|
+
| `src/shaders/common/fullscreen.vert.wgsl` | 18 | Fullscreen triangle vertex shader |
|
|
38
|
+
| `src/shaders/common/uniforms.wgsl` | 49 | Canonical VIB3Uniforms struct definition |
|
|
39
|
+
| `src/shaders/common/rotation4d.wgsl` | 87 | All six 4D rotation matrices + projection |
|
|
40
|
+
| `src/shaders/common/geometry24.wgsl` | 55 | All 24 geometry SDFs |
|
|
41
|
+
| `src/shaders/faceted/faceted.frag.wgsl` | 206 | Complete faceted fragment shader |
|
|
42
|
+
| `src/shaders/quantum/quantum.frag.wgsl` | 362 | Complete quantum fragment shader |
|
|
43
|
+
| `src/shaders/holographic/holographic.frag.wgsl` | 255 | Complete holographic fragment shader |
|
|
44
|
+
|
|
45
|
+
## Canonical Uniform Struct Layout
|
|
46
|
+
|
|
47
|
+
All WGSL uniform structs **must** match `packVIB3Uniforms()` in `UnifiedRenderBridge.js`. The canonical layout uses only `f32` scalars and one `vec2<f32>` to avoid WGSL alignment surprises:
|
|
48
|
+
|
|
49
|
+
```wgsl
|
|
50
|
+
struct VIB3Uniforms {
|
|
51
|
+
time: f32, // index 0
|
|
52
|
+
_pad0: f32, // index 1
|
|
53
|
+
resolution: vec2<f32>, // index 2-3
|
|
54
|
+
geometry: f32, // index 4
|
|
55
|
+
rot4dXY: f32, // index 5
|
|
56
|
+
rot4dXZ: f32, // index 6
|
|
57
|
+
rot4dYZ: f32, // index 7
|
|
58
|
+
rot4dXW: f32, // index 8
|
|
59
|
+
rot4dYW: f32, // index 9
|
|
60
|
+
rot4dZW: f32, // index 10
|
|
61
|
+
dimension: f32, // index 11
|
|
62
|
+
gridDensity: f32, // index 12
|
|
63
|
+
morphFactor: f32, // index 13
|
|
64
|
+
chaos: f32, // index 14
|
|
65
|
+
speed: f32, // index 15
|
|
66
|
+
hue: f32, // index 16
|
|
67
|
+
intensity: f32, // index 17
|
|
68
|
+
saturation: f32, // index 18
|
|
69
|
+
mouseIntensity: f32, // index 19
|
|
70
|
+
clickIntensity: f32, // index 20
|
|
71
|
+
bass: f32, // index 21
|
|
72
|
+
mid: f32, // index 22
|
|
73
|
+
high: f32, // index 23
|
|
74
|
+
layerScale: f32, // index 24
|
|
75
|
+
layerOpacity: f32, // index 25
|
|
76
|
+
_pad1: f32, // index 26
|
|
77
|
+
layerColorR: f32, // index 27
|
|
78
|
+
layerColorG: f32, // index 28
|
|
79
|
+
layerColorB: f32, // index 29
|
|
80
|
+
densityMult: f32, // index 30
|
|
81
|
+
speedMult: f32, // index 31
|
|
82
|
+
breath: f32, // index 32
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Rule**: Do NOT use `vec3<f32>` for layerColor — it triggers 16-byte alignment padding that breaks the flat Float32Array packing. Always use three separate f32 fields.
|
|
87
|
+
|
|
88
|
+
## System Integration
|
|
89
|
+
|
|
90
|
+
| System | WebGPU Path | Notes |
|
|
91
|
+
|--------|-------------|-------|
|
|
92
|
+
| **Faceted** | Single-canvas via UnifiedRenderBridge | Inline WGSL matches canonical layout. Only system with a complete WebGPU path wired in the demo page. |
|
|
93
|
+
| **Quantum** | Multi-canvas via MultiCanvasBridge | Requires 5 separate canvas DOM elements. Falls back to WebGL on `docs/webgpu-live.html` (single canvas). |
|
|
94
|
+
| **Holographic** | Multi-canvas via MultiCanvasBridge | Same 5-canvas requirement. Falls back to WebGL on demo page. |
|
|
95
|
+
|
|
96
|
+
## Remaining Work
|
|
97
|
+
|
|
98
|
+
1. **End-to-end browser validation** — Run FacetedSystem through WebGPU in a Chrome/Edge browser with WebGPU enabled and confirm correct visual output matches WebGL.
|
|
99
|
+
2. **Quantum/Holographic single-canvas path** — Either provide a single-canvas WebGPU fallback or create a demo page with the required 5-canvas DOM structure.
|
|
100
|
+
3. **Automated smoke test** — A Playwright test (with WebGPU-capable browser) that initializes the bridge, renders one frame, and confirms no errors.
|
|
101
|
+
4. **Shader sync verification** — Extend `tools/shader-sync-verify.js` to also verify WGSL struct layouts match `packVIB3Uniforms()`.
|
|
102
|
+
|
|
103
|
+
## Demo Page
|
|
104
|
+
|
|
105
|
+
`docs/webgpu-live.html` — Tries WebGPU for FacetedSystem, always WebGL for Quantum/Holographic. Shows green "WEBGPU" or yellow "WEBGL" badge.
|
|
106
|
+
|
|
107
|
+
## Testing
|
|
108
|
+
|
|
109
|
+
WebGPU cannot be validated in headless CI without GPU support. Strategy:
|
|
110
|
+
- CI: Run WebGL tests + shader lint + struct layout checks
|
|
111
|
+
- Manual: Smoke test in Chrome/Edge with `chrome://flags/#enable-unsafe-webgpu`
|
|
112
|
+
|
|
113
|
+
## File Locations
|
|
114
|
+
|
|
115
|
+
- Backend: `src/render/backends/WebGPUBackend.js`
|
|
116
|
+
- Bridge: `src/render/UnifiedRenderBridge.js`
|
|
117
|
+
- Packing: `packVIB3Uniforms()` in UnifiedRenderBridge.js
|
|
118
|
+
- WGSL shaders: `src/shaders/`
|
|
119
|
+
- Demo: `docs/webgpu-live.html`
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# WebGPU status and testing requirements
|
|
2
|
+
|
|
3
|
+
This document records the current WebGPU backend state, what is implemented, and what is required
|
|
4
|
+
to validate it in local development or CI.
|
|
5
|
+
|
|
6
|
+
## Current status
|
|
7
|
+
- **Backend scaffold:** `WebGPUBackend` initializes adapter/device, configures the canvas, manages
|
|
8
|
+
resize, and supports a clear-pass `renderFrame()` path.
|
|
9
|
+
- **Async context creation:** `createRenderContextAsync()` can instantiate WebGPU contexts using
|
|
10
|
+
`{ backend: 'webgpu' }`.
|
|
11
|
+
- **Resource tracking:** depth textures are registered in the shared `RenderResourceRegistry`.
|
|
12
|
+
|
|
13
|
+
## What is still needed
|
|
14
|
+
1. **Pipeline parity:** implement basic shader pipelines (vertex/fragment) and buffer binding that
|
|
15
|
+
match the WebGL backend command flow.
|
|
16
|
+
2. **Command buffer bridge:** map existing render commands to WebGPU render passes.
|
|
17
|
+
3. **Feature gating:** add host-app controls to toggle WebGPU via feature flags.
|
|
18
|
+
4. **Diagnostics:** add per-frame stats and resource delta reporting for WebGPU.
|
|
19
|
+
|
|
20
|
+
## Testing requirements
|
|
21
|
+
### Local smoke test
|
|
22
|
+
Prerequisites:
|
|
23
|
+
- A browser with WebGPU enabled (Chrome/Edge with `chrome://flags/#enable-unsafe-webgpu`, or a
|
|
24
|
+
Chromium build with WebGPU support).
|
|
25
|
+
- A device with WebGPU-capable GPU drivers.
|
|
26
|
+
|
|
27
|
+
Suggested smoke flow:
|
|
28
|
+
1. Create a canvas and call `createRenderContextAsync(canvas, { backend: 'webgpu' })`.
|
|
29
|
+
2. Call `backend.renderFrame({ clearColor: [0.1, 0.1, 0.2, 1] })` and confirm the canvas clears.
|
|
30
|
+
3. Resize the canvas and ensure the clear pass still succeeds.
|
|
31
|
+
|
|
32
|
+
### CI validation
|
|
33
|
+
- WebGPU cannot be reliably validated in headless CI without GPU support.
|
|
34
|
+
- CI should instead run WebGL tests and lint/static checks; keep a manual WebGPU smoke checklist.
|
|
35
|
+
|
|
36
|
+
## File locations
|
|
37
|
+
- `src/render/backends/WebGPUBackend.js`
|
|
38
|
+
- `src/render/index.js` (`createRenderContextAsync`)
|
|
@@ -76,6 +76,19 @@ Implementing the concrete runtime pieces described in `DOCS/AGENT_HARNESS_ARCHIT
|
|
|
76
76
|
| `package.json` | Only if parallel work adds exports | Our changes don't touch package.json |
|
|
77
77
|
| `src/creative/` | New files only | No conflict — `ChoreographyPlayer.js` and `AestheticMapper.js` are new |
|
|
78
78
|
|
|
79
|
+
### Phase 3 — Tests, Skills Update, Example Choreographies (Commit 3)
|
|
80
|
+
|
|
81
|
+
Completing the harness work with tests, skill updates, and example content:
|
|
82
|
+
|
|
83
|
+
1. **Updated `.claude/commands/vib3-design.md`** — Added 4 new workflows: Natural Language Design (Workflow 1), Multi-Scene Choreography (Workflow 6), Agent Visual Feedback Loop (Workflow 7), re-numbered existing workflows; updated tool count (19→31), file references, "When User Says" table with new tool mappings
|
|
84
|
+
2. **Updated `.claude/commands/vib3-dev.md`** — Added ChoreographyPlayer and AestheticMapper to creative tooling table, updated tool count (19→31), test count (4→6)
|
|
85
|
+
3. **ChoreographyPlayer tests** (`tests/creative/ChoreographyPlayer.test.js`, 29 tests) — constructor, load, getState, seek, seekToPercent, scene transitions, stop, destroy, COLOR_PRESET_MAP
|
|
86
|
+
4. **AestheticMapper tests** (`tests/creative/AestheticMapper.test.js`, 32 tests) — mapDescription, resolveToValues, getVocabulary, getVocabularyByCategory, VOCABULARY static, partial matching, real-world descriptions
|
|
87
|
+
5. **MCP harness tool tests** (`tests/agent/MCPHarnessTools.test.js`, 25 tests) — designFromDescription, getAestheticVocabulary, captureScreenshot, createChoreography, playChoreographyTool, createTimeline, controlTimeline, describeVisualState
|
|
88
|
+
6. **Example choreographies** (`examples/choreographies/`) — 3 ready-to-play specs: cosmic-journey (60s, 3 scenes), meditation-breath (30s loop), energy-burst (20s, 140 BPM)
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
79
92
|
## Notes for Future Sessions
|
|
80
93
|
|
|
81
94
|
- `ChoreographyPlayer` imports `ParameterTimeline` and `TransitionAnimator` from `src/creative/`
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Development Session — 2026-02-15
|
|
2
|
+
|
|
3
|
+
**Session type**: Layer Architecture Redesign, Codebase Audit, Preset/Reactivity Expansion
|
|
4
|
+
**Branch**: `claude/vib3-sdk-handoff-p00R8`
|
|
5
|
+
**Operator**: Claude Code (Opus 4.6)
|
|
6
|
+
**Parent work**: Builds on Feb 13 agent harness + Feb 6 RendererContract work
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Session Overview
|
|
11
|
+
|
|
12
|
+
### Phase 1 — Layer Architecture Redesign
|
|
13
|
+
|
|
14
|
+
The original 5-layer canvas system used static multipliers — every layer received identical parameters scaled by hardcoded opacity/density/speed factors. This produced "the same shader pasted 5 times with different opacity" instead of actual inter-layer dynamics.
|
|
15
|
+
|
|
16
|
+
**Built**: `LayerRelationshipGraph` — a keystone-driven system where one layer drives and others derive their parameters through configurable relationship functions.
|
|
17
|
+
|
|
18
|
+
6 preset relationship types:
|
|
19
|
+
| Preset | Behavior |
|
|
20
|
+
|--------|----------|
|
|
21
|
+
| `echo` | Attenuated follower (same params, scaled down) |
|
|
22
|
+
| `mirror` | Inverts rotation planes, shifts hue 180° |
|
|
23
|
+
| `complement` | Color complement, density inverted around pivot |
|
|
24
|
+
| `harmonic` | Density at integer multiples, hue at golden angle intervals |
|
|
25
|
+
| `reactive` | Amplifies parameter deltas over time |
|
|
26
|
+
| `chase` | Lerps toward keystone with configurable delay |
|
|
27
|
+
|
|
28
|
+
5 named profiles that configure the full 5-layer graph:
|
|
29
|
+
- `holographic` — content drives, echo/complement/harmonic/reactive
|
|
30
|
+
- `symmetry` — mirror mode with chase accent
|
|
31
|
+
- `chord` — all harmonic at musical intervals
|
|
32
|
+
- `storm` — all reactive with increasing gain
|
|
33
|
+
- `legacy` — replicates old static multiplier behavior exactly
|
|
34
|
+
|
|
35
|
+
### Phase 2 — TypeScript Type Audit
|
|
36
|
+
|
|
37
|
+
Found and fixed 4 type definition issues:
|
|
38
|
+
1. Export name mismatch (RELATIONSHIP_PRESETS → PRESET_REGISTRY)
|
|
39
|
+
2. Missing MultiCanvasBridge type definition
|
|
40
|
+
3. Broken barrel file (types/render/index.d.ts)
|
|
41
|
+
4. Incorrect exports in types/adaptive-sdk.d.ts
|
|
42
|
+
|
|
43
|
+
### Phase 3 — Comprehensive Codebase Audit
|
|
44
|
+
|
|
45
|
+
Found and fixed 7 critical issues across the SDK:
|
|
46
|
+
|
|
47
|
+
| File | Problem | Fix |
|
|
48
|
+
|------|---------|-----|
|
|
49
|
+
| `src/math/index.js` | Top-level `await import()` breaks bundlers | Static imports |
|
|
50
|
+
| `src/render/index.js` | `require()` in ESM package | Static ESM import |
|
|
51
|
+
| `src/scene/index.js` | `require()` in `createSceneContext()` | Use already-imported classes |
|
|
52
|
+
| `src/export/index.js` | 8 missing exports | Added ShaderExporter, VIB3PackageExporter, etc. |
|
|
53
|
+
| `src/reactivity/index.js` | `console.log()` side effect in barrel | Removed |
|
|
54
|
+
| `package.json` | Missing `./creative`, `./export`, `./variations` entry points | Added |
|
|
55
|
+
| `types/` | Mismatched export names, missing barrel re-exports | Fixed all |
|
|
56
|
+
|
|
57
|
+
### Phase 4 — CLAUDE.md Rewrite
|
|
58
|
+
|
|
59
|
+
Rewrote CLAUDE.md from 224 → 366 lines:
|
|
60
|
+
- Fixed MCP tool count (12 → 31) with full categorized table
|
|
61
|
+
- Added LayerRelationshipGraph documentation
|
|
62
|
+
- Added all new file references
|
|
63
|
+
- Added recent session work section
|
|
64
|
+
- Added 4 new gotchas (ESM only, 31 tools, layer defaults, initialize check)
|
|
65
|
+
- Updated test count, status, documentation map with staleness notes
|
|
66
|
+
|
|
67
|
+
### Phase 5 — LayerPresetManager + Reactivity Wiring + MCP Tools
|
|
68
|
+
|
|
69
|
+
Built the preset management and reactivity-driven layer modulation system:
|
|
70
|
+
|
|
71
|
+
**LayerPresetManager** (`src/render/LayerPresetManager.js`):
|
|
72
|
+
- Save/load/delete/list user presets
|
|
73
|
+
- Create presets from current graph state
|
|
74
|
+
- Tune individual relationship parameters at runtime
|
|
75
|
+
- Persist presets to localStorage
|
|
76
|
+
- Import/export preset libraries as JSON
|
|
77
|
+
|
|
78
|
+
**Reactivity-driven layer modulation** (`src/render/LayerReactivityBridge.js`):
|
|
79
|
+
- Audio frequency bands modulate relationship parameters (e.g., bass → reactive gain)
|
|
80
|
+
- Device tilt/gyroscope modulates relationship configs
|
|
81
|
+
- Configurable modulation mappings per input source
|
|
82
|
+
- Pre-built modulation profiles (audioStorm, tiltHarmonic, etc.)
|
|
83
|
+
|
|
84
|
+
**MCP tools** (5 new layer control tools):
|
|
85
|
+
- `set_layer_profile` — Load a named layer profile
|
|
86
|
+
- `set_layer_relationship` — Set relationship for a specific layer
|
|
87
|
+
- `set_layer_keystone` — Change the keystone layer
|
|
88
|
+
- `get_layer_config` — Get current layer configuration
|
|
89
|
+
- `tune_layer_relationship` — Adjust config on an active relationship
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Files Created
|
|
94
|
+
|
|
95
|
+
| File | Purpose | ~Lines |
|
|
96
|
+
|------|---------|--------|
|
|
97
|
+
| `src/render/LayerRelationshipGraph.js` | Keystone-driven inter-layer parameter system | 610 |
|
|
98
|
+
| `src/render/LayerPresetManager.js` | Preset save/load/tune for layer relationships | ~300 |
|
|
99
|
+
| `src/render/LayerReactivityBridge.js` | Audio/tilt/input → layer relationship modulation | ~280 |
|
|
100
|
+
| `types/render/LayerRelationshipGraph.d.ts` | Full TypeScript definitions | 120 |
|
|
101
|
+
| `types/render/LayerPresetManager.d.ts` | TypeScript definitions for preset manager | ~60 |
|
|
102
|
+
| `types/render/LayerReactivityBridge.d.ts` | TypeScript definitions for reactivity bridge | ~70 |
|
|
103
|
+
| `tests/render/LayerRelationshipGraph.test.js` | 63 tests for relationship graph | 450 |
|
|
104
|
+
| `tests/render/LayerPresetManager.test.js` | Tests for preset manager | ~200 |
|
|
105
|
+
| `tests/render/LayerReactivityBridge.test.js` | Tests for reactivity bridge | ~200 |
|
|
106
|
+
| `pages/layer-demo.html` | Visual demo for testing layer dynamics | ~300 |
|
|
107
|
+
| `DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-15.md` | This file | — |
|
|
108
|
+
|
|
109
|
+
## Files Modified
|
|
110
|
+
|
|
111
|
+
| File | Change |
|
|
112
|
+
|------|--------|
|
|
113
|
+
| `src/render/MultiCanvasBridge.js` | Integrated LayerRelationshipGraph for per-layer parameter resolution |
|
|
114
|
+
| `src/holograms/RealHolographicSystem.js` | Added layer graph integration, `loadRelationshipProfile()`, `setKeystone()`, `setLayerRelationship()` |
|
|
115
|
+
| `src/render/index.js` | Fixed `require()` → ESM, added LayerRelationshipGraph + PresetManager + ReactivityBridge exports |
|
|
116
|
+
| `src/math/index.js` | Fixed top-level `await import()` → static imports |
|
|
117
|
+
| `src/scene/index.js` | Fixed `require()` → use imported classes |
|
|
118
|
+
| `src/export/index.js` | Added 8 missing exports |
|
|
119
|
+
| `src/reactivity/index.js` | Removed `console.log()` side effect |
|
|
120
|
+
| `src/agent/mcp/tools.js` | Added 5 layer control tool definitions |
|
|
121
|
+
| `src/agent/mcp/MCPServer.js` | Added 5 layer control handlers |
|
|
122
|
+
| `package.json` | Added `./creative`, `./export`, `./variations` entry points |
|
|
123
|
+
| `types/adaptive-sdk.d.ts` | Fixed export names, added layer system re-exports |
|
|
124
|
+
| `types/render/index.d.ts` | Added LayerRelationshipGraph, PresetManager, ReactivityBridge re-exports |
|
|
125
|
+
| `types/systems/index.d.ts` | Added layer relationship API to RealHolographicSystem |
|
|
126
|
+
| `CLAUDE.md` | Comprehensive rewrite (224 → 366 lines) |
|
|
127
|
+
|
|
128
|
+
## Test Results
|
|
129
|
+
|
|
130
|
+
- **Before session**: 1430 tests, 70 files
|
|
131
|
+
- **After session**: 1702+ tests, 75+ files
|
|
132
|
+
- All passing
|
|
133
|
+
|
|
134
|
+
## Commits
|
|
135
|
+
|
|
136
|
+
| Hash | Message |
|
|
137
|
+
|------|---------|
|
|
138
|
+
| `59fb951` | feat(render): add LayerRelationshipGraph — keystone-driven inter-layer parameter system |
|
|
139
|
+
| `bec4cad` | fix(types): correct export names and barrel re-exports for LayerRelationshipGraph |
|
|
140
|
+
| `aeac38c` | fix: resolve 7 broken barrel files, require() in ESM, missing exports |
|
|
141
|
+
| `4031700` | docs: comprehensive CLAUDE.md rewrite |
|
|
142
|
+
| (pending) | feat: LayerPresetManager, LayerReactivityBridge, MCP layer tools, demo page |
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Development Session — 2026-02-16
|
|
2
|
+
|
|
3
|
+
**Session type**: Architecture Bug Fixes, Shader Consistency, Documentation Sweep
|
|
4
|
+
**Branch**: `claude/vib3-sdk-handoff-p00R8`
|
|
5
|
+
**Operator**: Claude Code (Opus 4.6)
|
|
6
|
+
**Parent work**: Continues from Feb 15 layer architecture + codebase audit
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Session Overview
|
|
11
|
+
|
|
12
|
+
### Phase 1 — Bug Fixes & Geometry Differentiation (committed in `7debad8`)
|
|
13
|
+
|
|
14
|
+
- Fixed QuantumVisualizer `canvasId` reference error — 6 sites used undefined variable, replaced with `this._canvasLabel`
|
|
15
|
+
- Differentiated tetrahedron lattice (geometry 0) from hypercube (geometry 1) using tetrahedral symmetry planes in GLSL + WGSL
|
|
16
|
+
- Updated CLAUDE.md geometry docs: "24 geometries" → "24 geometry variants (8 base shapes × 3 warp modes)"
|
|
17
|
+
|
|
18
|
+
### Phase 2 — Shader Module Infrastructure (committed in `7debad8`)
|
|
19
|
+
|
|
20
|
+
- Added `resolveIncludes()` and `loadAndResolve()` to `src/render/ShaderLoader.js` for `#include` / `// @include` directive resolution
|
|
21
|
+
- Added warp functions (`warpHypersphereCore`, `warpHypertetraCore`, `applyCoreWarp`) to external `geometry24.glsl` and `geometry24.wgsl`
|
|
22
|
+
|
|
23
|
+
### Phase 3.1 — Holographic Uniform Standardization (committed in `7debad8`)
|
|
24
|
+
|
|
25
|
+
- Renamed shader uniforms: `u_density` → `u_gridDensity`, `u_morph` → `u_morphFactor`, `u_geometryType` → `u_geometry`
|
|
26
|
+
- Updated JS uniform location lookups to match
|
|
27
|
+
|
|
28
|
+
### Phase 3.3 — Quantum Layer Detection Bug Fix (committed in `5e1b4c5`)
|
|
29
|
+
|
|
30
|
+
- **Bug**: Shader float comparison values didn't match JS `roleIntensities`. Only background (fallthrough) and content (1.0) worked; shadow, highlight, accent were broken.
|
|
31
|
+
- **Fix**: Aligned shader values to match JS (0.6, 1.0, 1.3, 1.6), added epsilon comparison (`abs() < 0.05`), moved roleIntensities to module-scope `ROLE_INTENSITIES` constant.
|
|
32
|
+
|
|
33
|
+
### Phase 3.2 — Remove mapParameterName() (committed in `9d73627`)
|
|
34
|
+
|
|
35
|
+
- Renamed `generateVariantParams()` return keys: `geometryType`→`geometry`, `density`→`gridDensity`, `morph`→`morphFactor`
|
|
36
|
+
- Renamed `geometryConfigs` object keys to match
|
|
37
|
+
- Updated `generateRoleParams()` to use `vp.gridDensity`
|
|
38
|
+
- Updated uniform location map keys to match SDK names directly
|
|
39
|
+
- Consolidated duplicate geometry uniform set in render()
|
|
40
|
+
- Deleted `mapParameterName()` method
|
|
41
|
+
- Removed debug `console.log` from density scaling
|
|
42
|
+
|
|
43
|
+
### Phase 2.3 — rotateXZ Sign Convention Alignment (committed in `3198645`)
|
|
44
|
+
|
|
45
|
+
- **Discovery**: External shader files (ShaderLib, rotation4d.glsl/wgsl, WebGPUBackend, WebGPURenderer.ts) had opposite sign convention for `rotateXZ` compared to all 3 inline system shaders
|
|
46
|
+
- **Fix**: Aligned all external/shared sources to match the inline (working) convention: `col0=(c,0,s,0)`, `col2=(-s,0,c,0)`
|
|
47
|
+
- 7 files fixed: ShaderProgram.js, WebGPUBackend.js, rotation4d.glsl, rotation4d.wgsl, quantum.frag.wgsl, holographic.frag.wgsl, WebGPURenderer.ts
|
|
48
|
+
|
|
49
|
+
### Phase 5 — Documentation Updates
|
|
50
|
+
|
|
51
|
+
- SYSTEM_INVENTORY.md: "12 MCP tools" → "36 agent-accessible tools"
|
|
52
|
+
- MASTER_PLAN: "14 tools" → "36 tools", "693+ tests" → "1762 tests"
|
|
53
|
+
- CLAUDE.md: Updated doc map staleness notes, added Feb 16 shipped items, added session work section
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Files Modified
|
|
58
|
+
|
|
59
|
+
| File | Changes |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `src/quantum/QuantumVisualizer.js` | canvasId bug fix, layer detection epsilon fix, ROLE_INTENSITIES constant |
|
|
62
|
+
| `src/faceted/FacetedSystem.js` | Tetrahedron lattice differentiation (GLSL + WGSL) |
|
|
63
|
+
| `src/holograms/HolographicVisualizer.js` | Uniform rename, mapParameterName removal, variantParams key rename |
|
|
64
|
+
| `src/render/ShaderLoader.js` | resolveIncludes(), loadAndResolve() |
|
|
65
|
+
| `src/render/ShaderProgram.js` | ShaderLib rotateXZ sign fix |
|
|
66
|
+
| `src/render/backends/WebGPUBackend.js` | rotateXZ sign fix |
|
|
67
|
+
| `src/shaders/common/rotation4d.glsl` | rotateXZ sign fix |
|
|
68
|
+
| `src/shaders/common/rotation4d.wgsl` | rotateXZ sign fix |
|
|
69
|
+
| `src/shaders/common/geometry24.glsl` | Added warp functions |
|
|
70
|
+
| `src/shaders/common/geometry24.wgsl` | Added warp functions |
|
|
71
|
+
| `src/shaders/faceted/faceted.frag.wgsl` | Tetrahedron differentiation, struct fixes |
|
|
72
|
+
| `src/shaders/quantum/quantum.frag.wgsl` | rotateXZ sign fix |
|
|
73
|
+
| `src/shaders/holographic/holographic.frag.wgsl` | rotateXZ sign fix |
|
|
74
|
+
| `src/ui/adaptive/renderers/webgpu/WebGPURenderer.ts` | rotateXZ sign fix |
|
|
75
|
+
| `CLAUDE.md` | Geometry docs, shipped items, session work, doc map notes |
|
|
76
|
+
| `DOCS/SYSTEM_INVENTORY.md` | Tool count 12 → 36 |
|
|
77
|
+
| `DOCS/MASTER_PLAN_2026-01-31.md` | Tool count 14 → 36, test count 693 → 1762 |
|
|
78
|
+
| `tools/shader-sync-verify.js` | Fixed stale Holographic uniforms (u_density→u_gridDensity, removed u_geometryType, u_morph→u_morphFactor), added missing Faceted uniforms (u_mouse, u_roleIntensity), updated comments |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Commits
|
|
83
|
+
|
|
84
|
+
| Hash | Message |
|
|
85
|
+
|---|---|
|
|
86
|
+
| `7debad8` | refactor: Phase 1-3 architecture fixes — bugs, shader modules, uniform standardization |
|
|
87
|
+
| `5e1b4c5` | fix(quantum): align layer detection values with JS roleIntensities |
|
|
88
|
+
| `9d73627` | refactor(holographic): remove mapParameterName() translation layer |
|
|
89
|
+
| `3198645` | fix(shaders): align rotateXZ sign convention across all shader sources |
|
|
90
|
+
| `2ce407d` | docs: update stale tool/test counts, add Feb 16 dev track |
|
|
91
|
+
| (pending) | fix(tools): update stale embedded shaders in shader-sync-verify.js |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Test Results
|
|
96
|
+
|
|
97
|
+
- **Before**: 1762 tests, 77 files (all passing)
|
|
98
|
+
- **After**: 1762 tests, 77 files (all passing)
|
|
99
|
+
- No new tests added this session (bug fixes and refactoring of existing code)
|
|
100
|
+
|
|
101
|
+
## Decisions Made
|
|
102
|
+
|
|
103
|
+
1. **Keep per-system color personality** — Quantum's hue normalization (0-1 in JS) is intentional, not a bug
|
|
104
|
+
2. **Keep role-intensity layer detection** — User wants layer relations to follow 4D rotation principles; used epsilon comparison instead of integer indices
|
|
105
|
+
3. **Dropped GeometryPresets phase** — VariationManager already implements 100-slot preset system
|
|
106
|
+
4. **Dropped FrameBudget phase** — Adaptive rendering infrastructure exists in `src/ui/adaptive/`
|
|
107
|
+
5. **Dropped context loss recovery phase** — Already properly implemented in both QuantumVisualizer and HolographicVisualizer
|
|
108
|
+
6. **rotateXZ convention** — Aligned all external files to match inline (working) convention rather than vice versa
|
package/docs/webgpu-live.html
CHANGED
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
|
|
478
478
|
// Render active system
|
|
479
479
|
if (activeSystem === 'faceted' && faceted) {
|
|
480
|
-
faceted.
|
|
480
|
+
faceted.render();
|
|
481
481
|
} else if (activeSystem === 'quantum' && quantum) {
|
|
482
482
|
quantum.render();
|
|
483
483
|
} else if (activeSystem === 'holographic' && holographic) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vib3code/sdk",
|
|
3
|
-
"version": "2.0.3-canary.
|
|
3
|
+
"version": "2.0.3-canary.ef8d292",
|
|
4
4
|
"description": "VIB3+ 4D Visualization SDK - Unified engine with 6D rotation, MCP agentic integration, and cross-platform support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/core/VIB3Engine.js",
|
|
@@ -200,6 +200,9 @@
|
|
|
200
200
|
"./reactivity/config": {
|
|
201
201
|
"import": "./src/reactivity/ReactivityConfig.js"
|
|
202
202
|
},
|
|
203
|
+
"./creative": {
|
|
204
|
+
"import": "./src/creative/index.js"
|
|
205
|
+
},
|
|
203
206
|
"./creative/color-presets": {
|
|
204
207
|
"import": "./src/creative/ColorPresetsSystem.js"
|
|
205
208
|
},
|
|
@@ -212,6 +215,9 @@
|
|
|
212
215
|
"./creative/timeline": {
|
|
213
216
|
"import": "./src/creative/ParameterTimeline.js"
|
|
214
217
|
},
|
|
218
|
+
"./export": {
|
|
219
|
+
"import": "./src/export/index.js"
|
|
220
|
+
},
|
|
215
221
|
"./integrations/react": {
|
|
216
222
|
"import": "./src/integrations/frameworks/Vib3React.js"
|
|
217
223
|
},
|
|
@@ -248,6 +254,9 @@
|
|
|
248
254
|
"./advanced/offscreen": {
|
|
249
255
|
"import": "./src/advanced/OffscreenWorker.js"
|
|
250
256
|
},
|
|
257
|
+
"./variations": {
|
|
258
|
+
"import": "./src/variations/VariationManager.js"
|
|
259
|
+
},
|
|
251
260
|
"./tools/shader-sync": {
|
|
252
261
|
"import": "./tools/shader-sync-verify.js"
|
|
253
262
|
},
|
package/src/agent/index.js
CHANGED