Investigation: Why are generated universes missing from the space DB and ge...
Documentation for Sessions
📝 Investigation: Why are generated universes missing from the space DB and ge...
Date: 2026-03-27
Time: 15:05:07 UTC
Session: gspace1-276.10
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why are generated universes missing from the space DB and generation manifests showing totalModules: 0?
Task: Analyze why babas universe is missing from space DB and generation pipeline data integrity issues
🎯 Decision Made
Chosen:
Identified 3 root causes: (1) Pipeline never calls POST to create universe in space DB — only PUTs, which fail silently when normalizeUniversePayload throws on missing name. (2) createGenerationManifest is gated inside GitLab commit block — if gitConfig is null, manifest is never created. (3) No universeIds[] consistency — pipeline never adds to spaces.universeIds array.
Options Considered:
- Fix only the manifest gate (partial)
- Add ensureUniverseExists guard + move manifest outside gate + add universeIds consistency (chosen)
- Rewrite entire DEPLOY phase (too risky)
💭 Reasoning
Deep trace through 6 files: deploy.phase.ts (581 lines), structure-builder.service.ts (368 lines), spaces.service.ts (1786 lines), space-database-universe.service.ts (203 lines), preflight.handler.ts, generations.service.ts. Found that universe data is fragmented across 6 locations with no transactional guarantee. The Studio works because getUniverseData has multi-source fallback, masking the bug. The manifest records 0 modules because the manifest creation is inside the GitLab gate — when gitConfig is null (GitLab init failed), the entire block is skipped.
📁 Files Involved
APIs/backend-vitto-api/src/app/module-generation/phases/deploy.phase.tsAPIs/backend-api/src/app/spaces/spaces.service.tsAPIs/backend-api/src/app/spaces/space-database/services/space-database-universe.service.tsAPIs/backend-vitto-api/src/app/module-generation/handlers/structure-builder.service.tsAPIs/backend-api/src/app/generations/generation-manifest.schema.ts
🔗 Related
- Decision ID:
dev_1774623907350_twzv4d3 - Session: 276
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation