Wall Phase 3 milestone A: registry skeleton (metadata only)

Lays down the wall folder under @pascal-app/nodes with everything needed
to register the kind, but intentionally without runtime wiring:

- schema.ts re-exports WallNode from core (door/window/item still type
  their parentId against WallNode.shape.id, so the schema stays canonical
  there for now).
- parametrics.ts declares thickness / height / curveOffset for the Phase 4
  inspector. Endpoints and host children are edited via affordances, not
  number inputs, so they're not in parametrics.
- definition.ts encodes capabilities (surfaces, selectable, duplicable,
  deletable — no movable since wall's move is bespoke endpoint-drag),
  relations (hosts doors/windows/items, affectsSpatial slabs/ceilings/
  zones, linkedBy endpoint-match, cascadeDelete descendants), and the
  presentation metadata for the palette. Renderer / system / tool fields
  are deliberately absent — the existing wall-renderer.tsx and
  wall-system.tsx keep serving wall until milestone B.
- feature-flag.ts gates the eventual registration via
  NEXT_PUBLIC_USE_REGISTRY_FOR_WALL (same pattern Phase 2 used for spawn).
- wallDefinition is NOT yet appended to builtinPlugin.nodes — registration
  is what flips the Phase 0 dispatch shims, and we don't want that until
  the runtime port lands. Until then this file is metadata-only.

Two type-side changes pulled forward from Phase 4 to make a metadata-only
definition compile:

- NodeDefinition.renderer becomes optional (the three-checkbox model
  documented in wiki/architecture/node-definitions.md already promises
  this). RegistryRenderer in node-renderer.tsx gains a null-guard so an
  undefined renderer cleanly falls through to the legacy switch.

No runtime behavior change. Walls render and behave exactly as before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-05-15 08:48:58 -04:00
co-authored by Claude Opus 4.7
parent 7b946ce8b7
commit 0a723fa1f2
7 changed files with 193 additions and 1 deletions
+12 -1
View File
@@ -27,7 +27,18 @@ export type NodeDefinition<S extends ZodObject<any>> = {
relations?: Relations
parametrics?: ParametricDescriptor<z.infer<S>>
renderer: RendererSource<z.infer<S>>
/**
* Renderer for this kind. Optional under the three-checkbox composition
* model (see `wiki/architecture/node-definitions.md`): when omitted, the
* framework mounts a generic empty-group renderer that the per-kind
* geometry/system fills. Required today only because the generic
* renderer is not yet implemented — Phase 4 lands it, then this field
* becomes truly optional at runtime too. Making the type optional now so
* milestone-A skeletons (like wall) can compile before their runtime
* port; downstream consumers (`<NodeRenderer>`, `RegisteredSystems`)
* already null-guard on `def.renderer` so omitting it is safe.
*/
renderer?: RendererSource<z.infer<S>>
system?: SystemContribution
tool?: LazyComponent
affordances?: Affordance<z.infer<S>>[]