openpencil/apps/web/src
Fini b2f1aff38f refactor(ai): delete dead visual-ref pipeline + simplify design-validation
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.
2026-05-23 19:45:54 +08:00
..
__tests__ V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
canvas feat(pen-core): strip nested card-style decoration on inner frames 2026-05-11 00:17:02 +08:00
components Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
constants V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
hooks V0.7.3 (#111) 2026-04-15 22:19:12 +08:00
i18n V0.7.1 (#102) 2026-04-13 21:30:23 +08:00
lib fix(ai): refresh DeepSeek defaults to v4 model series 2026-04-26 06:29:53 +08:00
routes V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
services refactor(ai): delete dead visual-ref pipeline + simplify design-validation 2026-05-23 19:45:54 +08:00
stores Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
types V0.7.2-bugfix (#109) 2026-04-14 21:42:56 +08:00
uikit V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
utils Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-05 22:51:00 +08:00
variables V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
router.tsx V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
routeTree.gen.ts V0.5.0 (#67) 2026-03-22 09:44:04 +08:00
styles.css V0.7.0 (#95) 2026-04-11 23:25:13 +08:00