Skip to content

feat(v1.0a2): cross-engine behavior runtime — Babylon auto-rotate + bob + conformance#38

Merged
longyi-xw merged 7 commits into
mainfrom
feat/v1.0a2-babylon-behaviors
Jun 10, 2026
Merged

feat(v1.0a2): cross-engine behavior runtime — Babylon auto-rotate + bob + conformance#38
longyi-xw merged 7 commits into
mainfrom
feat/v1.0a2-babylon-behaviors

Conversation

@longyi-xw

Copy link
Copy Markdown
Owner

What

v1.0 sub-stage A2 — proves the behavior runtime holds across engines. Formalizes installBehaviors / tickBehaviors / uninstallBehaviors onto IRuntimeAdapter, gives Babylon its own behavior framework (auto-rotate + bob), and validates runtime parity via the shared conformance suite. Headless only.

How (TDD, per-task commits)

  1. Babylon behavior framework (src/runtime/babylon/behaviors/) — BabylonBehaviorRegistry + auto-rotate (quaternion increment) + bob, mirroring the Three structure and sharing the engine-neutral BehaviorDefinition.
  2. ContractinstallBehaviors/tickBehaviors/uninstallBehaviors added to IRuntimeAdapter (ThreeAdapter already satisfied; NoopAdapter stubbed); BabylonAdapter implements them mirroring ThreeAdapter's behaviorRuntime map + error isolation (console.warn+skip for unknown/invalid, console.error+catch on throw); getSupportedBehaviors returns the Babylon registry.
  3. Conformance — one shared describeAdapterConformance run against both engines:
    • bobdescribeNode().position exactly equals base + amp·sin(2π·f·t) (cross-engine identical formula + handle state)
    • auto-rotate → ran / accumulates / freezes on uninstall (rotation semantics differ across engines — not asserted bit-for-bit, consistent with the A1 gap)
    • disabled bindings skipped; unknown types isolated (no throw)

Spec: docs/superpowers/specs/2026-06-10-v1.0a2-babylon-behaviors-design.md
Plan: docs/superpowers/plans/2026-06-10-v1.0a2-babylon-behaviors-plan.md

Scope (deferred, in roadmap)

generateBehaviorCode for Babylon → A3 (export). hover-highlight (pointer/material) + setBehaviorDomElement on the contract → B (render host / event story). dispose() behavior-handle release: A2 handles have no dispose, so behaviorRuntime.clear() suffices; noted in Backlog for when a stateful Babylon behavior lands.

Verification

  • pnpm lint (0 new) · pnpm typecheck (0) · pnpm test (518/518)
  • ✅ Conformance: ThreeAdapter 13/13 + BabylonAdapter 13/13 — same suite, both engines green (incl. 4 behavior cases)
  • N/A visual smoke — A2 is headless, by design

🤖 Generated with Claude Code

@longyi-xw longyi-xw merged commit 8218c9b into main Jun 10, 2026
1 check passed
@longyi-xw longyi-xw deleted the feat/v1.0a2-babylon-behaviors branch June 10, 2026 04:29
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