Architecture: How to enforce single source of truth for space/universe DB ...
Documentation for Sessions
🏗️ Architecture: How to enforce single source of truth for space/universe DB ...
Date: 2026-03-18
Time: 14:04:26 UTC
Session: gspace1-232.2
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
How to enforce single source of truth for space/universe DB and collection naming?
Task: Not specified
🎯 Decision Made
Chosen:
Verification script (verify-space-database-naming.ts) + yarn verify:db:naming; canonical resolvers: SpaceDatabaseResolverService.resolveSpaceDatabaseName, buildCollectionName(universeId, collection). Fixed E2E getSpaceModule to use getSpaceDb(); added JSDoc CONTRACT to backend-ai-api space-database.utils.
Options Considered:
- No alternatives documented
💭 Reasoning
Prevents duplicate space DBs (space_chrome-space-1 vs space_chrome-space-1_79fe44376823) and universe_universe_ double-prefix. Script runs without execSync (uses fs/path), checks backend-api, entity-schema, E2E helper, backend-ai-api. Run before merge.
📁 Files Involved
tools/scripts/database/verify-space-database-naming.tstests/platform-creation-e2e/src/helpers/database.helper.tsAPIs/backend-ai-api/src/app/agents/utils/space-database.utils.tsdocs/english/sessions/S232/232-universe-space-database-duplication-research.md
🔗 Related
- Decision ID:
dev_1773842666391_trdwfqu - Session: 232
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation