SCBE Monorepo Restructuring Plan (Kernel-First)
This plan turns SCBE-AETHERMOORE into a single monorepo with internal workspaces, while preserving one publishable npm package surface.
Target Package Layout
packages/kernel- Pure math/types seed.
- Zero runtime dependencies.
- Includes core geometry/scaling/types (
GovernanceTier,DimensionalState) and invariant math.
packages/crypto- Cryptographic envelopes, KDF/HMAC, nonce/replay guards.
- Depends on
kernelonly.
packages/brain- 21D brain mapping and higher-order embedding logic.
- Depends on
kernelandcryptowhere needed.
packages/fleet- Agent orchestration, governance tiers, roundtables, runtime coordination.
- Depends on
kernel+brain.
packages/api- Gateway/Lambda/REST adapters.
- Depends on
fleet+crypto.
packages/app- Catch-all integration layer for demos/UI/legacy adapters.
Tests remain rooted in
/testsand are not relocated during migration.
Why Kernel Extraction Comes First
Training and deployment provenance requires a deterministic answer to: “which files ARE the model?”
To support that now, this repo includes a canonical kernel manifest used by CI/training:
training/kernel_manifest.yamltraining/kernel_manifest.py
The Vertex workflow validates this manifest before training and injects a manifest SHA into training job args/labels for traceability.
Seven Migration Phases (One Commit Per Phase)
- Kernel carve-out (lowest risk / highest leverage)
- Move pure math/types into
packages/kernel. - Keep old imports via compatibility re-exports.
- Move pure math/types into
- Crypto separation
- Move crypto primitives to
packages/crypto. - Prohibit app-layer imports into crypto.
- Move crypto primitives to
- Brain modularization
- Move brain/embedding modules to
packages/brain.
- Move brain/embedding modules to
- Fleet extraction
- Move governance/orchestration to
packages/fleet.
- Move governance/orchestration to
- API package formation
- Isolate API transport/runtime concerns in
packages/api.
- Isolate API transport/runtime concerns in
- App catch-all stabilization
- Move demos/UI/integration glue into
packages/app.
- Move demos/UI/integration glue into
- Workspace hardening + release path
- Enforce dependency graph, lint boundaries, CI matrix.
- Keep one public npm package; internal packages remain workspace-private.
Non-Negotiables
- Root tests continue to run during every phase.
- No “big bang” move.
- Every phase must preserve runtime behavior and pass targeted tests.