chore(core): evict runtime R3F from the core barrel + architecture test - #692
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two moves that make the `@pascal-app/core` barrel safe to import from server code, plus a test that keeps it that way:
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.