Architecture: How should the cosmic hierarchy be restructured? The V1 hier...
Documentation for Sessions
🏗️ Architecture: How should the cosmic hierarchy be restructured? The V1 hier...
Date: 2026-03-08
Time: 01:03:27 UTC
Session: gspace1-188.3
Agent: architecture
Confidence: 88%
Status: ✅ Documented
📋 Decision Context
Question:
How should the cosmic hierarchy be restructured? The V1 hierarchy (9 types: universe-root → galaxy → world → page-module → ...) was too complex for non-developers and the generation pipeline.
Task: S188: Studio Complete Workflow — Cosmic hierarchy restructuring
🎯 Decision Made
Chosen:
New hierarchy: Space → Galaxy (project group ABOVE universe) → Universe (project) → module → page → widget + navigation + layout. CosmicModuleTypeV2 = 5 types. Galaxy inverted from inner route-collection to outer project-group.
Options Considered:
- Keep V1 hierarchy (9 types) and simplify UI only
- Remove galaxy/world entirely (flat 5-type, no project groups)
- Galaxy as project group above Universe + flat 5-type inner structure (chosen)
- Gradual migration — deprecate types one at a time over multiple sessions
💭 Reasoning
Root cause: The V1 9-type hierarchy (universe-root, galaxy, world, page-module, feature, widget, navigation, layout, custom) created 5 levels of nesting inside a project. Generated modules already followed a flat module→pages pattern — the galaxy/world layers added complexity without value for non-developers. Moving Galaxy above Universe gives it real business meaning (project grouping, like GitHub Orgs → Repos) while simplifying the inner structure to 3 levels (module → page → widget). All 9 existing generated modules validated this — none referenced galaxies or worlds internally. The V1→V2 converter maps: galaxy→module, world→module, page-module→page, feature→module, custom→module. Both V1 and V2 coexist via additive types (zero breaking changes). DisplayableModuleType union handles UI code that reads old data.
📁 Files Involved
libs/libs-foundational/core-models/src/lib/types/universe-structure.types.tslibs/libs-foundational/core-models/src/lib/utils/universe-structure.utils.tslibs/libs-foundational/core-models/src/lib/types/modules/modules.types.tslibs/libs-foundational/core-models/src/lib/types/space.types.ts
🔗 Related
- Decision ID:
dev_1772931807236_2uxzflf - Session: 188
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation