Architecture: How to let users validate generation plans before expensive ...

Documentation for Sessions

🏗️ Architecture: How to let users validate generation plans before expensive ...

Date: 2026-03-23
Time: 20:21:08 UTC
Session: gspace1-261.11
Agent: backend
Confidence: 88%
Status: ✅ Documented


📋 Decision Context

Question:

How to let users validate generation plans before expensive EXECUTE phase?

Task: S257: Platform generation pipeline optimization


🎯 Decision Made

Chosen:

Added CONFIRM phase between PLAN and EXECUTE. Emits module-gen.confirm-plan SSE event with plan summary, pauses pipeline via Promise-based gate, auto-approves after 5 min. Uses callback pattern (confirmationGate function from service to executor) to avoid circular dependency. Controller endpoint POST /:sessionId/confirm resolves the gate.

Options Considered:


💭 Reasoning

Each EXECUTE phase costs ~$2 for 5 modules. Showing users the plan before spending money builds trust and prevents wasted generations when the AI misunderstands the request. Inspired by gmodules1's CONFIRM phase. Callback pattern chosen over DI injection to avoid circular deps between ModuleGenerationService and ModuleGenPhaseExecutor.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation