Skip to content

chore(core): evict runtime R3F from the core barrel + architecture test - #692

Merged
wass08 merged 2 commits into
mainfrom
chore/core-no-runtime-three
Aug 20, 2026
Merged

chore(core): evict runtime R3F from the core barrel + architecture test#692
wass08 merged 2 commits into
mainfrom
chore/core-no-runtime-three

Conversation

@wass08

@wass08 wass08 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

What

Two moves that make the `@pascal-app/core` barrel safe to import from server code, plus a test that keeps it that way:

  • `ElevatorRuntimeSystem` moves to `@pascal-app/nodes` (its only consumer). It was the last runtime `@react-three/fiber` import in core; `stepElevatorRuntimes` stays exported from core, so the nodes package now owns the 10-line `useFrame` wrapper.
  • `useRegistryVersion` export moves from `registry/index.ts` to the core barrel. The registry barrel is reachable from server-safe graphs (schema → spatial grid → registry), and its `react` import crashed Next.js route handlers importing `@pascal-app/core/schema` (found by private-editor's capture-converter server-safety guard against this branch's dist). Public API unchanged — consumers already import the hook from `@pascal-app/core`.
  • New `packages/core/src/architecture.test.ts`: fails core on any runtime `three`/`@react-three/*` import (whole-clause `import type` is erased and allowed). Runs in core's normal `bun test src`, so it gates both this repo and private-editor CI.

Red/green proof

The architecture test was proven red on a probe file exercising all three runtime forms — named import (`import { useFrame } from '@react-three/fiber'`), side-effect import (`import 'three/…'`), and mixed type/value (`import { type Object3D, Group } from 'three'`) — each individually reported, then green on the cleaned tree. Before the elevator move it also flagged the real `elevator-runtime-system.tsx` violation.

Why

Layer rule (AGENTS.md): core is pure logic, no Three.js. A runtime R3F import in the barrel evaluates React client context in every consumer, which 500s Next.js route handlers under the RSC server condition (the capture-upload outage class). Part of the regression-testing program's cheap-invariants slice.

🤖 Generated with Claude Code


Note

Cursor Bugbot is generating a summary for commit cab7f9a. Configure here.

wass08 and others added 2 commits August 20, 2026 08:43
ElevatorRuntimeSystem (a useFrame wrapper) moves to @pascal-app/nodes'
elevator system, its only consumer; stepElevatorRuntimes stays exported
from core. A new architecture test fails core on any runtime three /
@react-three import (type-only imports are erased and allowed) — proven
red on a probe file with named, side-effect, and mixed type/value forms.

Importing the core barrel from a Next.js route handler no longer
evaluates R3F under the RSC server condition (the capture-upload 500
class of bug).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
useRegistryVersion moves its export from registry/index.ts to the core
barrel: the registry barrel is reachable from server-safe graphs
(schema → spatial grid → registry), and the hook's react import crashed
Next.js route handlers that import @pascal-app/core/schema. Public API
unchanged — consumers import it from '@pascal-app/core' as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wass08
wass08 merged commit 2d3650f into main Aug 20, 2026
4 checks passed
wass08 added a commit that referenced this pull request Aug 20, 2026
…ut (#693)

The sweep runs ~5.7s on a 2-core x64 CI runner — past bun's default 5s
per-test budget (2-3s locally on Apple Silicon). First surfaced by
private-editor's quality gate on the #692 submodule bump, the first CI
to ever run this suite.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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