Skip to content

feat(library): add private spatial viewer experiment - #724

Merged
crs48 merged 7 commits into
mainfrom
codex/0468-spatial-library
Oct 6, 2026
Merged

crs48 merged 7 commits into
mainfrom
codex/0468-spatial-library

Conversation

@crs48

@crs48 crs48 commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

What

The Library graph currently depends on Electron preload and a desktop camera. This adds an experimental browser viewer with search, source/group filters, stable metre-scale snapshots, metadata cards, and explicit destination travel. WebXR starts stationary; tracked position, rotation and analog range must be observed before controller flight can be armed, and interruption requires rearming with a released trigger.

The Mac can explicitly pair the current selection over trusted private HTTPS. A one-use invitation exchanges for a scoped, expiring read-only capability; revocation, origin/host checks, bounded thumbnails and conversation exclusion keep this separate from the local API and debugger. No identity replacement, test-auth bypass, public hosting or enrichment jobs are introduced.

Changelog

Added the experimental spatial viewer fragment; no syndication.

Verification

  • Full local suite on f22377779: 12,749 passed, four skipped; all 102 workspace build/typecheck tasks passed. Focused flight/snapshot/graph/privacy/TLS tests: 66 passed.
  • Electron main and spatial typechecks and production viewer build pass. Repository lint has no errors.
  • Drove the standalone browser with 1,000 and 56,000 synthetic links, including full-collection search, selection and source/group/neighborhood filtering; no browser console errors.
  • Drove the pairing control in real Electron using an isolated development profile. Transport tests retain normal TLS hostname/certificate validation.
  • Five renderer type errors reproduce unchanged at base commit 9e05bea; the new main/spatial checks are clean.

Hosted verification on f22377779: real CI lint, typecheck, all three test shards, editor UX, Electron smoke tests, conformance, and changelog checks pass. No unresolved review comments remain. The informational dependency audit still reports dependencies already present on main; its baseline is unchanged.

Remaining release gates

This is an experimental implementation targeting main. Its Library dependency, #721, is merged. Exploration 0468 is marked partially implemented. No physical Vision Pro/Sense validation is claimed: actual controller exposure, pinch coexistence, interruption/re-entry behavior, trusted headset pairing, stereo performance/memory and Chris's comfort trial remain pending. Full-pose flight is deliberately gated on that review; native fallback and further rendering optimization depend on measured evidence.

See apps/electron/src/spatial/README.md for the runbook and docs/explorations/0468_[-]_VISION_PRO_SPATIAL_LIBRARY_GRAPH.md for the checked evidence and pending checklist. ADR-47 records the temporary pairing design and its tripwire.

Docs & site sync

  • Docs updated: Electron setup guide and ADR-47 describe the private pairing flow and unverified hardware requirements. The exploration and runbook retain the physical review gates.

Summary by CodeRabbit

  • New Features
    • Added an experimental spatial Library viewer with search, filters, saved-link details, and immersive WebXR support.
    • Share selected Library links with a read-only browser viewer through a one-time pairing link. Access expires automatically and can be revoked.
    • Added navigation and experimental controller flight controls for immersive viewing.
  • Documentation
    • Added setup guidance and notes on network requirements, data access, and unverified headset support.

@crs48
crs48 temporarily deployed to pr-724 October 6, 2026 17:34 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bd4805cd-19de-4e40-aad7-740358e60dfc
📥 Commits

Reviewing files that changed from the base of the PR and between ca81bd4 and f223777.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (38)
  • apps/electron/package.json
  • apps/electron/spatial.vite.config.ts
  • apps/electron/src/library/graph.test.ts
  • apps/electron/src/library/graph.ts
  • apps/electron/src/library/store.test.ts
  • apps/electron/src/library/store.ts
  • apps/electron/src/main/index.ts
  • apps/electron/src/main/spatial-bridge.test.ts
  • apps/electron/src/main/spatial-bridge.ts
  • apps/electron/src/main/spatial-library-ipc.ts
  • apps/electron/src/main/spatial-server.test.ts
  • apps/electron/src/main/spatial-server.ts
  • apps/electron/src/preload/index.ts
  • apps/electron/src/renderer/components/LibraryGraphView.tsx
  • apps/electron/src/renderer/components/library-graph/SpatialPairing.tsx
  • apps/electron/src/renderer/components/library-graph/model.ts
  • apps/electron/src/renderer/components/library-graph/navigation.ts
  • apps/electron/src/shared/library-flight.test.ts
  • apps/electron/src/shared/library-flight.ts
  • apps/electron/src/shared/library-graph/model.ts
  • apps/electron/src/shared/library-graph/navigation.ts
  • apps/electron/src/shared/spatial-library.test.ts
  • apps/electron/src/shared/spatial-library.ts
  • apps/electron/src/spatial/README.md
  • apps/electron/src/spatial/adapter.ts
  • apps/electron/src/spatial/fixtures.ts
  • apps/electron/src/spatial/index.html
  • apps/electron/src/spatial/main.ts
  • apps/electron/src/spatial/panel.ts
  • apps/electron/src/spatial/probe.ts
  • apps/electron/src/spatial/scene.ts
  • apps/electron/src/spatial/style.css
  • apps/electron/tsconfig.spatial.json
  • docs/explorations/0468_[-]_VISION_PRO_SPATIAL_LIBRARY_GRAPH.md
  • site/public/llms-full.txt
  • site/src/content/docs/docs/architecture/decisions.mdx
  • site/src/content/docs/docs/guides/electron.mdx
  • site/src/data/changelog/2026-10-06-explore-a-private-spatial-library-previe.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds an experimental spatial viewer for selected Library links. It includes shared graph and flight utilities, desktop pairing controls, and a read-only HTTPS bridge for browser access. The viewer supports search, resource inspection, and WebXR interaction. Build configuration, tests, and documentation are also added.

Changes

Spatial Library preview

Layer / File(s) Summary
Shared graph and snapshot model
apps/electron/src/library/*, apps/electron/src/shared/library-graph/*, apps/electron/src/shared/spatial-library*, apps/electron/src/renderer/components/library-graph/model.ts, apps/electron/src/renderer/components/library-graph/navigation.ts
Shared graph helpers provide filtering, grouping, search, and deterministic positions. Graph construction now excludes resources with a truthy kind. Spatial snapshots are validated and retain positions when projected.
Pairing bridge and HTTPS transport
apps/electron/src/main/spatial-bridge*, apps/electron/src/main/spatial-server*
The bridge supports one-time invitation redemption and scoped, time-limited reads. The HTTPS server checks network address, host, and origin, and serves mapped assets. Tests cover request restrictions, pairing, and revocation.
Desktop pairing lifecycle and controls
apps/electron/src/main/spatial-library-ipc.ts, apps/electron/src/main/index.ts, apps/electron/src/preload/index.ts, apps/electron/src/renderer/components/LibraryGraphView.tsx, apps/electron/src/renderer/components/library-graph/SpatialPairing.tsx
Electron validates pairing inputs and certificates, starts and stops the listener, and exposes status and pairing operations through IPC. The Library graph UI passes visible link IDs and displays pairing controls.
Spatial viewer, scene, and flight controls
apps/electron/src/shared/library-flight*, apps/electron/src/spatial/*, apps/electron/package.json, apps/electron/spatial.vite.config.ts, apps/electron/tsconfig.spatial.json
The viewer supports fixture or paired data, graph search and filters, detail inspection, and probe reports. Its scene supports desktop and WebXR navigation and guarded controller flight. Spatial build, development, and typecheck scripts are added.
Experiment status and access documentation
apps/electron/src/spatial/README.md, docs/explorations/*, site/src/content/docs/docs/architecture/decisions.mdx, site/src/content/docs/docs/guides/electron.mdx, site/public/llms-full.txt, site/src/data/changelog/*
Documentation records the pairing scope and limits, viewer controls, development procedures, and pending hardware review. The exploration record updates implementation evidence, and the changelog adds a preview entry.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant SpatialPairing
  participant xnet
  participant setupSpatialLibraryIPC
  participant createSpatialServer
  participant createSpatialBridge
  participant spatialMain
  participant pairedAdapter
  SpatialPairing->>xnet: Start with origin and selected link IDs
  xnet->>setupSpatialLibraryIPC: Send spatial start IPC
  setupSpatialLibraryIPC->>createSpatialBridge: Create bridge for scoped snapshot
  setupSpatialLibraryIPC->>createSpatialServer: Start HTTPS listener
  spatialMain->>pairedAdapter: Redeem invitation from URL hash
  pairedAdapter->>createSpatialServer: POST /pair with invitation
  createSpatialServer->>createSpatialBridge: Forward pairing request
  createSpatialBridge-->>pairedAdapter: Return bearer token
  pairedAdapter->>createSpatialServer: Request snapshot with bearer token
  createSpatialServer->>createSpatialBridge: Forward authenticated read
  createSpatialBridge-->>pairedAdapter: Return snapshot
Loading

Merge Risk: ⚪ Minimal · up to f2237

This adds an experimental spatial Library viewer and a scoped, expiring, read-only pairing path. No concrete merge-blocking defect was found. Physical headset behavior still needs to be checked on the device, as the description says.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 28 files. (10 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: an experimental private spatial viewer for the Library.
Full details: Docstring Coverage

Explanation

Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 28 files. (10 skipped: 10 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

xNet Test added 3 commits October 6, 2026 10:35
- Reuse graph filtering, search and deterministic layout outside Electron preload.
- Keep positions paired with snapshot revisions and resource identities.
- Add explicit flight arming, analog acceleration, brakes and interruption rearming.
- Verify frame-rate integration, invalid inputs and full-fixture searchability.

Signed-off-by: xNet Test <test@xnet.dev>
- Exchange one-use invitations for expiring and revocable read-only capabilities.
- Restrict reads to selected link snapshots, details and bounded thumbnails.
- Exclude conversation records from graph projections and test verified TLS revocation.
- Add the native pairing control and record the transport decision with a tripwire.

Signed-off-by: xNet Test <test@xnet.dev>
- Provide searchable synthetic and paired snapshots with stable filters and evidence cards.
- Add stationary overview, explicit travel, return history and guarded controller flight.
- Bound labels, relationship lines and thumbnail loading; export hardware probe observations.
- Document desktop verification and mark exploration 0468 partially implemented.
- Keep physical device review and full-pose flight gates pending.

Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 force-pushed the codex/0468-spatial-library branch from 6891406 to 0892a35 Compare October 6, 2026 17:35
@crs48
crs48 temporarily deployed to pr-724 October 6, 2026 17:35 — with GitHub Actions Inactive
github-actions Bot added a commit that referenced this pull request Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Preview removed for PR #724.

github-actions Bot added a commit that referenced this pull request Oct 6, 2026
@crs48
crs48 marked this pull request as ready for review October 6, 2026 19:41
xNet Test added 2 commits October 6, 2026 12:59
- Include the patched image decoder and refreshed documentation review dates.

- Keep the spatial viewer experimental while hardware validation remains pending.

Signed-off-by: xNet Test <test@xnet.dev>
- Regenerate the documentation export with the spatial pairing guide and ADR-47.
- Verify the generated text matches all 63 source documentation pages.

Signed-off-by: xNet Test <test@xnet.dev>
Base automatically changed from codex/0466-personal-library to main October 6, 2026 20:09
- Include the merged Library dependency before final hosted verification.

Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 temporarily deployed to pr-724 October 6, 2026 20:13 — with GitHub Actions Inactive
- Keep the spatial branch current with the automatic post-merge documentation update.

Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 temporarily deployed to pr-724 October 6, 2026 20:19 — with GitHub Actions Inactive
@crs48
crs48 merged commit 0b2800b into main Oct 6, 2026
22 of 24 checks passed
@crs48
crs48 deleted the codex/0468-spatial-library branch October 6, 2026 20:26
github-actions Bot added a commit that referenced this pull request Oct 6, 2026

This branch was previously deployed

1 inactive deployment
pr-724 — f2237777 Deployed Oct 6, 2026 by crs48 via deploy-preview #1477
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.

1 participant