Overview
The Logic Validator is Phase 3 of the Omni Architect pipeline. It analyzes the coherence of generated Mermaid diagrams against the original PRD using a weighted scoring system across six quality criteria, producing a detailed validation report.Version: 1.0.0
Author: fabioeloi
Pipeline Phase: 3 of 5
Author: fabioeloi
Pipeline Phase: 3 of 5
Purpose
Validation prevents the generation of Figma assets from inaccurate or incomplete diagrams. By establishing a quality gate with measurable criteria, it ensures that visual outputs accurately represent the product requirements before design investment begins.Inputs & Outputs
Inputs
The structured PRD from Phase 1, used as the source of truth for validation.
Array of generated Mermaid diagrams from Phase 2 to be validated.
Validation workflow mode:
interactive: Present each diagram + score, await approve/reject/modify per diagrambatch: Present all diagrams, await approve_all/reject_all/selectauto: Auto-approve if score >= threshold, otherwise reject
Minimum score (0.0 to 1.0) required for automatic approval when using
auto mode.Outputs
Comprehensive validation report containing:
- overall_score: Weighted average score (0.0 - 1.0)
- status:
approved,rejected, orpending - breakdown: Per-criterion scores and details
- warnings: List of detected issues
- suggestions: Actionable improvement recommendations
Validation Criteria
The validator evaluates diagrams using six weighted criteria:| Criterion | Weight | Verification Method |
|---|---|---|
| Coverage | 0.25 | Each feature/story must be represented in >= 1 diagram |
| Consistency | 0.25 | Same entity must have identical attributes across all diagrams |
| Completeness | 0.20 | Both happy path and sad path (error flows) must be present |
| Traceability | 0.15 | Every Mermaid node must be traceable to a PRD element ID |
| Naming Coherence | 0.10 | No conflicting aliases or naming variations |
| Dependency Integrity | 0.05 | Feature dependency order must be respected in flows |
Score Calculation
Validation Modes
Interactive Mode
Handle Modification
If user selects
modify, capture specific feedback and return to Phase 2 (Mermaid Generator) with instructions.Batch Mode
Await Bulk Decision
Wait for user input:
approve_all, reject_all, or select (choose specific diagrams).Auto Mode
Criterion Details
Coverage (25%)
Measures what percentage of PRD features and user stories are represented across all diagrams.Consistency (25%)
Verifies that entities, attributes, and relationships are identical across all diagram types.Completeness (20%)
Checks that both success paths (happy path) and failure paths (sad path) are documented in flow diagrams.Traceability (15%)
Ensures every diagram node can be traced back to a specific PRD element (feature ID, story ID, entity name).Naming Coherence (10%)
Detects conflicting terminology and naming variations across diagrams.Dependency Integrity (5%)
Validates that feature dependency order from the PRD is respected in flowcharts.Example Validation Report
Usage in Pipeline
The Logic Validator is automatically invoked as Phase 3:Score Interpretation
| Score Range | Status | Action |
|---|---|---|
| 0.90 - 1.0 | Excellent | Proceed to Figma generation |
| 0.85 - 0.89 | Good | Review warnings, proceed |
| 0.70 - 0.84 | Fair | Address major warnings before proceeding |
| 0.0 - 0.69 | Poor | Reject and regenerate diagrams |
Feedback Loop
When validation fails or user requests modifications: Feedback includes:- Specific criterion that failed
- Detailed examples of violations
- Actionable suggestions for improvement
- Reference to original PRD sections
Best Practices
Start with Interactive Mode
Use interactive validation on first run to understand quality patterns.
Calibrate Threshold
Adjust validation_threshold based on team standards (0.80-0.90 typical).
Address Consistency First
Consistency issues cascade; fix entity/naming conflicts before other criteria.
Document Exceptions
If intentionally deviating from PRD, document rationale in validation notes.
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| ”Low coverage score” | Diagrams missing features | Add flowcharts for uncovered features |
| ”Consistency violations” | Entity definitions differ | Standardize entity attributes in PRD |
| ”Traceability failures” | Missing metadata | Ensure Phase 2 includes PRD IDs in comments |
| ”Auto-validation too strict” | Threshold too high | Lower validation_threshold to 0.80 |
| ”All diagrams rejected” | PRD quality issues | Return to Phase 1 and improve PRD completeness |
Next Phase
Once validation is approved, diagrams proceed to:Phase 4: Figma Generator
Generate design assets in Figma from validated Mermaid diagrams.