Skip to content

chore: restructure engine/ folder per Spec C#47

Merged
rulkens merged 8 commits intomainfrom
chore/services-folder-engine
May 8, 2026
Merged

chore: restructure engine/ folder per Spec C#47
rulkens merged 8 commits intomainfrom
chore/services-folder-engine

Conversation

@rulkens
Copy link
Copy Markdown
Owner

@rulkens rulkens commented May 8, 2026

Summary

Pure relocation pass over src/services/engine/ per Spec C. The flat 28-file layout becomes 7 subfolders plus engine.ts + index.ts. No file renames, no module splits, no new abstractions, no re-export shims.

tests/services/engine/ mirrors the new layout one-to-one; the two cross-cutting integration tests (engine.tier-swap-race.test.ts, proceduralDiskEmission.test.ts) stay at the test root.

The gpu/ half of Spec C is deliberately left for a separate PR. The only gpu/ edits in this PR are forced import-path updates in pointRenderer.ts triggered by the bake/ relocation.

What moved where

helpers/      autoLod, scaleBar, pointInfoBuilder
bake/         buildPointInterleavedBuffer (+.worker), computeSchechterRatios (+.worker), computeAngularWeights (+.worker)
subsystems/   thumbnailSubsystem, spaceMouseSubsystem, renderScheduler, loadProgressAggregator, fpsCounter
camera/       tweenManager, focusTween, cameraFraming, resolveFocusTarget, tweenToGalaxy
frame/        runFrame, renderFrame
wiring/       settingsTable, seedSettingsCallbacks, pointSourceRegistry
interaction/  inputBindings, clickHandler
phases/       (already existed, untouched)
(root)        engine.ts, index.ts

Test plan

  • npx tsc --noEmit clean at every commit boundary
  • npx vitest run — 931/931 tests pass at every commit
  • git mv used for every move so blame/history follows files
  • No new barrel files in any subfolder; index.ts re-export of autoLodMask repointed to ./helpers/autoLod
  • Manual smoke check: npm run dev and confirm rendering still works (left for reviewer / merge-time)

Notes for reviewer

  • Each commit is one folder + its test mirror. The diff per commit is mechanical: git mv plus relative-import updates with consistent depth bumps.
  • The user-supplied target taxonomy splits tweenManager etc. into camera/ (vs the spec text which placed tweenManager in subsystems/ and the rest in interaction/). Implementation follows the user's task message.
  • pointRenderer.ts imports updated to point at engine/bake/* — this is a cross-folder import change forced by the relocation; the gpu PR can keep this layout untouched.
  • tools/buildFilaments.ts import similarly updated.

🤖 Generated with Claude Code

rulkens and others added 7 commits May 8, 2026 03:22
Move autoLod, scaleBar, pointInfoBuilder to engine/helpers/ per Spec C.
Mirror tests under tests/services/engine/helpers/. No file renames; only
relative-path import updates.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move buildPointInterleavedBuffer, computeSchechterRatios, computeAngularWeights
plus their .worker.ts siblings into engine/bake/ per Spec C. Mirror tests
under tests/services/engine/bake/. Update consumers in pointRenderer.ts
(forced cross-folder import update) and tools/buildFilaments.ts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move thumbnailSubsystem, spaceMouseSubsystem, renderScheduler,
loadProgressAggregator, fpsCounter to engine/subsystems/ per Spec C.
Mirror tests under tests/services/engine/subsystems/. Update consumers
in @types, in-engine modules, and cross-cutting tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move tweenManager, focusTween, cameraFraming, resolveFocusTarget,
tweenToGalaxy to engine/camera/ per Spec C target taxonomy. Mirror tests
under tests/services/engine/camera/. Update @types, hooks/useFocusUrlSync,
in-engine consumers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move runFrame, renderFrame to engine/frame/ per Spec C. Mirror tests
under tests/services/engine/frame/. Update phases/startLoop import.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move settingsTable, seedSettingsCallbacks, pointSourceRegistry to
engine/wiring/ per Spec C. Mirror tests under tests/services/engine/wiring/.
Update phases/initGpu, phases/wireInput, engine.ts consumers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move inputBindings, clickHandler to engine/interaction/ per Spec C. Mirror
tests under tests/services/engine/interaction/. Update @types and
phases/wireInput consumers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 8, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
skymap 81386cd Commit Preview URL

Branch Preview URL
May 08 2026, 01:38 AM

Two changes to Spec C:

1. New `engine/camera/` subfolder groups the stateful camera-orchestration
   files that were scattered between `subsystems/` and `interaction/` in
   the first draft: tweenManager, focusTween, cameraFraming,
   resolveFocusTarget, tweenToGalaxy.  `subsystems/` shrinks to 5 (drops
   tweenManager).  `interaction/` shrinks to 2 (inputBindings,
   clickHandler) and is recharacterised as "input edge" with the
   camera-side responses moved to camera/.

   Layering note added: services/camera/ holds pure primitives
   (orbitCamera, orbitControls, cameraTween).  engine/camera/ is one
   layer up — uses those primitives plus EngineState.  Two layers, two
   folders.

2. New "Follow-up — subsystem API consistency" section at the end.
   The state.subsystems.* bag groups owned long-lived helpers but
   doesn't enforce a shared API; the EngineSubsystemHandles docstring
   overpromises a `runFrame/apply/connect` contract that doesn't exist.
   Two flavours of follow-up flagged: light-touch consistency
   (suffix-rename + docstring refresh) and a real Subsystem interface
   (Spec D candidate).  Neither in scope here.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rulkens rulkens merged commit 38979bb into main May 8, 2026
1 of 2 checks passed
@rulkens rulkens deleted the chore/services-folder-engine branch May 8, 2026 01:37
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