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:

  1. Fix only the manifest gate (partial)
  2. Add ensureUniverseExists guard + move manifest outside gate + add universeIds consistency (chosen)
  3. 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


🔗 Related


Auto-generated by MCP Smart Consolidation