feat(v1.0a): multi-adapter contract + headless Babylon + conformance#37
Merged
Conversation
…ce 设计 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…impl Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…beNode Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tation conformance
- Add dispose() to IRuntimeAdapter (both adapters already implement it);
conformance suite now disposes adapters in afterEach (was leaking a
NullEngine + Scene per Babylon test).
- BabylonAdapter.syncNode('update') on a missing node now throws, matching
ThreeAdapter — keeps the contract symmetric across engines; conformance
asserts the parity.
- Conformance now asserts the rotation round-trip on group/mesh (was
position/scale only), closing a gap that masked engine rotation bugs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <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
v1.0 sub-stage A1 — the foundation for the multi-framework goal: establish
IRuntimeAdapteras a genuine engine-neutral seam and prove the abstraction holds for a second engine (Babylon.js) via a conformance suite. Headless only (no live viewport yet).This is the first step toward switching render engines at runtime and adding new 3D frameworks with minimal change — Three.js is the first engine, not the endpoint.
How (TDD, per-task commits)
NullEngineconstructs headless under vitest/jsdom (the whole approach depended on it; works zero-config).describeNode(): RuntimeNodeInfo | null(+dispose()) toIRuntimeAdapter; ThreeAdapter implementsdescribeNodeby reading the actual engine object (Object3D.position/quaternion/userData.geometryKind+instanceof), not echoing input.@babylonjs/coreNullEngine,syncNodefor group/mesh/light/camera,describeNode; unimplemented methods (pickAt/syncAsset/export/behaviors) throw/reject "not implemented in v1.0a".describeAdapterConformance(makeAdapter, label)run against both ThreeAdapter and BabylonAdapter; identical assertions, both green = contract holds across engines.Plus review fixes:
dispose()formalized on the contract (suite no longer leaks a NullEngine per test),syncNode('update')on a missing node throws in both engines (parity), and conformance now asserts the rotation round-trip on group/mesh.Spec:
docs/superpowers/specs/2026-06-09-v1.0a-multi-adapter-conformance-design.mdPlan:
docs/superpowers/plans/2026-06-09-v1.0a-multi-adapter-conformance-plan.mdScope / known cross-engine gaps (documented, deferred)
A1 asserts full transform on group/mesh; light/camera assert kind/subtype/visible/parent. Building the 2nd adapter surfaced real engine divergences, recorded in roadmap Backlog for when they become in-scope: Babylon camera orientation (Euler, not quaternion) → A2/B; ambient→HemisphericLight has no position → A2/B; prefab_instance kind (Three "mesh" vs Babylon "unknown") → A3. Live engine-switching (host abstraction) is B; spec §8 has the boundary checklist.
Verification
pnpm lint(0 new) ·pnpm typecheck(0) ·pnpm test(498/498)🤖 Generated with Claude Code