Architecture: How to validate generated platform output before it reaches ...

Documentation for Sessions

πŸ—οΈ Architecture: How to validate generated platform output before it reaches ...

Date: 2026-02-28
Time: 21:38:43 UTC
Session: gspace1-156.2
Agent: backend
Confidence: 92%
Status: βœ… Documented


πŸ“‹ Decision Context

Question:

How to validate generated platform output before it reaches users?

Task: Not specified


🎯 Decision Made

Chosen:

BlueprintValidatorService + ConvergenceLoopService in backend-ai-api. Validator checks all 25 widget types, page structure, config completeness, placeholder text. Loop iterates validate→repair up to 15 times with stall detection (4 consecutive no-progress), using MCPBridgeService to call Claude for repairs.

Options Considered:


πŸ’­ Reasoning

ROOT CAUSE: Generated output had ZERO validation. Widgets could have empty configs, pages could be missing required fields, placeholder text like 'TODO' could pass through to users. gmodules1 solved this with a convergence loop (1,831 lines) that catches 90%+ of issues. We ported the pattern but adapted it for our widget-based architecture instead of their code-based one. The validator checks type-specific configs (heading needs text, table needs columns+data, button needs text). The loop tracks persistent errors (3+ iterations β†’ try different strategy) and regressions (new errors β†’ revert). Exit conditions prevent infinite loops. Repair function wired to MCPBridgeService.executeTask() which calls Claude Code CLI with the system-integrate-repair.prompt.md template.


πŸ“ Files Involved


πŸ”— Related


Auto-generated by MCP Smart Consolidation