You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(decompose): address 4 Major review findings on PR #241
1. Decompose loop success now triggers on first clean pass.
The prompt previously required BOTH verifiers to return
{verified, needs_review}, but the deterministic verifier only emits
{ok, needs_iteration}. Forced an unnecessary extra iteration even
when deterministic parity already passed.
Fix: prompt now uses each verifier's actual vocabulary —
success := deterministic.status === 'ok'
&& visual.status ∈ {verified, needs_review, unavailable}
Updated both EN and ZH prompts in decomposePrompt.ts.
2. Visual verifier now actually has a source image at runtime.
`verify_ui_kit_visual_parity({slug})` defaults to `source.png`, but
`createRuntimeTextEditorFs` only seeded `index.html` + frames + skills
from FRAME_TEMPLATES + DESIGN_SKILLS. Image attachments lived in
`promptContext.attachments` but were never persisted to the agent's
virtual FS. The visual judge silently degraded to `unavailable` on
every normal run.
Fix: `createRuntimeTextEditorFs` now accepts `sourceAttachments` and
seeds `source.png` from the first image attachment's `imageDataUrl`.
The runtime call site at runGenerate threads `input.attachments`
through.
3. Judge/render failures now fall back to structured `unavailable`.
`renderUiKit()` (Playwright) and `judgeVisualParity()` (vision LLM)
were awaited without try/catch. Empty/non-JSON judge replies threw,
text-only models threw, headless render crashes threw — all bubbled
up and broke the agent loop instead of returning the documented
`status: 'unavailable'` path.
Fix: wrap both awaits in try/catch returning `unavailableReport()`
with the underlying error message. Logged at info level for trace
visibility.
4. Changeset no longer claims `Closes#225`.
PR template says use `Closes` only for fully resolved issues. This
diff stops at emitting a `ui_kits/<slug>/` handoff bundle and
explicitly tells the agent NOT to continue into the prototype flow.
Phase 2 (cross-page flows, state machines, prototype orchestration)
is separate work.
Fix: changeset now says `Refs #225 (Phase 1 of …)` and notes Phase 2
is tracked separately.
Verification:
- npx tsc --noEmit -p packages/core
- npx tsc --noEmit -p apps/desktop
- both clean (0 errors)
Copy file name to clipboardExpand all lines: .changeset/decompose-to-ui-kit.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,4 +6,4 @@
6
6
7
7
Add **Decompose to UI Kit** — one-click in the chat sidebar emits a `ui_kits/<slug>/` folder shaped for coding-agent handoff (`index.html` + `components/*.tsx` + `tokens.css` + `manifest.json` + `README.md`). Built-in deterministic + vision verifiers self-check parity using a 12-question boolean rubric (`parityScore = passCount / totalChecks`, no LLM-fabricated floats) and re-iterate on gaps. Per-decompose cost surfaces inline as a toast.
8
8
9
-
Closes Phase 1 of #225.
9
+
Refs #225 (Phase 1 of the requested image → componentization → prototype workflow). Phase 2 (cross-page flows, state machines, prototype orchestration) is tracked separately.
@@ -68,9 +68,9 @@ export const DECOMPOSE_PROMPT_EN = `Decompose the design you just produced into
68
68
5. Call verify_ui_kit_visual_parity({slug}) — vision-LLM judge with the 12 standard boolean checks (layout / color / typography / content / components dimensions). Each check is yes/no with a reason. parityScore = passCount/12 (derived deterministically).
69
69
- If it returns status="unavailable", the host hasn't injected the judge callback. Proceed with step 4's deterministic report alone.
70
70
- If it returns successfully, read each checks[].passed + reason. Failed checks are the things to fix.
71
-
6. Reconcile both reports:
72
-
- Both status ∈ {verified, needs_review} (12/12 or 11/12 checks passed): call done
73
-
- Either status === 'needs_iteration' or 'failed': merge + dedup gaps from both reports + the failed checks' reasons, re-call decompose_to_ui_kit addressing them
71
+
6. Reconcile both reports (NOTE: the two verifiers use DIFFERENT status vocabularies):
0 commit comments