Architecture: How to implement the Generation Versioning & Draft System sp...

Documentation for Sessions

🏗️ Architecture: How to implement the Generation Versioning & Draft System sp...

Date: 2026-03-18
Time: 01:25:38 UTC
Session: gspace1-231.6
Agent: backend
Confidence: 90%
Status: ✅ Documented


📋 Decision Context

Question:

How to implement the Generation Versioning & Draft System spec (S231.10) — new GenerationsModule vs extending existing DraftsModule, DEPLOY phase modification strategy, frontend signal architecture?

Task: Implement generation versioning & draft system from spec 2026-03-17


🎯 Decision Made

Chosen:

New GenerationsModule in backend-api with GenerationManifest + DraftSession schemas (separate from existing S49.5 DraftsModule). DEPLOY phase replaces auto-merge with manifest creation POST. Frontend GenerationService with signal-based state, StudioGenerationsPanelComponent as dock panel, VfsSyncService draft branch auto-creation with mutex.

Options Considered:

  1. Extend existing DraftsModule with stale status and universe-scoped routes
  2. Create DraftSession as separate module from GenerationsModule
  3. Keep auto-merge and add manifest as secondary tracking

💭 Reasoning

Existing DraftsModule (S49.5) serves a different purpose: user-initiated branches with preview deployments, version tags, flat routes at @Controller('drafts'). The spec's DraftSession is VFS-initiated, universe-scoped with stale detection — incompatible concerns. Creating a new GenerationsModule keeps the domain cohesive. The DEPLOY phase auto-merge (S230, lines 625-662) is replaced with a manifest creation POST to backend-api, which handles first-gen auto-activate on the backend. VfsSyncService uses a mutex pattern (draftCreationPending + ReplaySubject queue) to prevent concurrent draft branch creation from rapid edits. Frontend uses computed() signals derived from WritableSignal collections — no dual-update problem.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation