S4 deep-dive (S4 = pen-ai-skills migration's 4th sub-project) revealed the entire 'visual reference' pipeline is dead code: - executeVisualRefOrchestration has ZERO call sites. ai-chat-handlers → generateDesign() → executeOrchestration() directly. No visual-ref dispatch. - mode: 'visual-ref' (described in older comments + memory note as 'always-triggered since 2026-03-07') does not exist anywhere in src. - design-validation.ts's referenceScreenshot path was wired to getCurrentVisualReference() which was wired to a module-level variable that nobody ever called setCurrentVisualReference on. The hasReference branch was always false. Delete the 4 dead files (~734 LOC) + simplify design-validation: - visual-ref-orchestrator.ts (243 LOC, dead entry) - design-system-generator.ts (174 LOC, only called by dead entry) - design-code-generator.ts (192 LOC, only called by dead entry) - html-renderer.ts (125 LOC, only called by dead entry, browser-only) - design-validation.ts: drop the import + 5 clearVisualReference() calls + the visualRef/hasReference branch in the round loop; pass undefined for referenceScreenshot. The validateDesignScreenshot signature keeps referenceScreenshot? for a future visual-ref source. Rust-side note: the equivalent reference-comparison vision call IS already implemented in crates/op-orchestrator/src/validation.rs (reference_instruction text + timeout-doubling + plumb-through), it just always passes None today — same pattern as ScreenshotProvider: host wires real source when ready. No Rust changes needed for this cleanup. DesignSystem / VisualReference interfaces in ai-types.ts kept as type-only declarations in case a future visual-ref provider lands. |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| canvas | ||
| components | ||
| constants | ||
| hooks | ||
| i18n | ||
| lib | ||
| routes | ||
| services | ||
| stores | ||
| types | ||
| uikit | ||
| utils | ||
| variables | ||
| router.tsx | ||
| routeTree.gen.ts | ||
| styles.css | ||