AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He
fix(confirm-ui): require complete staged design choices
hugohe32578778b464e
diff --git a/skills/ppt-master/references/strategist-template.md b/skills/ppt-master/references/strategist-template.mdindex 24e43a0c..cb8b3539 100644--- a/skills/ppt-master/references/strategist-template.md+++ b/skills/ppt-master/references/strategist-template.md@@ -63,7 +63,7 @@ When the communication contract conflicts with the workspace, choose and state t> Internal note: `content_divergence` controls source reorganization; the AI-derived `template_reuse_scope` records the reused layer; `template_adherence` records whether a structured plan keeps or extends existing Layout identities.-**Template design precedence**: User overrides win. Otherwise lock declared colors and title/body font stacks from the fused template `design_spec.md` directly; skip generic color/font candidates and do not adjust template values to fit an industry default. Keep the workspace's declared icon and image constraints when producing those conditional plans.+**Template design precedence**: User overrides win. Otherwise template colors and title/body stacks are fixed anchors, not industry defaults. Each of ≥3 Stage-2 directions still carries all six palette roles and complete font objects: repeat fixed values and vary only template-open roles. Keep declared icon and image constraints.---diff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.mdindex b39f1cd3..e4dad258 100644--- a/skills/ppt-master/references/strategist.md+++ b/skills/ppt-master/references/strategist.md@@ -38,7 +38,7 @@ Do not force communication intent into one catalog label. A deck may report prog>> **One opt-in exception**: present the spec-refinement line alongside the split-mode note ([`generate-pptx.md`](../workflows/generate-pptx.md) Step 4). It is OFF by default — the above discipline holds unchanged. Only when the user *explicitly* asks to refine the spec do you hand off to the [refine-spec](../workflows/stages/refine-spec.md) stage, which produces the full spec first and stops for user review/revision of any part before generation. Never enter it unprompted.-> **Default presentation surface — Confirm UI.** Deliver the package through the interactive page: write recommendations to `<project>/confirm_ui/recommendations.json`, then launch per [`generate-pptx.md`](../workflows/generate-pptx.md) Step 4. Stage 2 `design_directions` carries **≥3 coordinated candidates** (safe / shifted / bold); each bundles visual style, color, CJK + Latin typography, icons, and conditional generated-image rendering. This is one set of real alternatives, not independent candidate grids that happen to share a screen. Honest-shortfall exception: if the constraints genuinely cannot yield 3 non-conflicting directions, present the smaller set and say why—never pad with duplicates or conflicts. **Always also print the recommendations + URL in chat** as the fallback. On confirm, read `<project>/confirm_ui/result.json` (`generation_mode: "split"` / `refine_spec: true` are explicit user choices). Skip the page if the user wants chat-only. Generate Step 4 owns when to write, wait, and block; [`confirm_ui.md`](../scripts/docs/confirm_ui.md) owns the schema, lifecycle, and fallback contract.+> **Default presentation surface — Confirm UI.** Write `<project>/confirm_ui/recommendations.json` and launch per Generate Step 4. Stage 2 carries ≥3 safe / shifted / bold `design_directions`; each bundles visual style, a six-role HEX palette, CJK + Latin typography, icons, and conditional image rendering. Also print the recommendations + URL in chat as fallback context. Skip launch only for an explicit chat-only request; a chat-question tool is not a substitute. Read the confirmed `result.json`. [`confirm_ui.md`](../scripts/docs/confirm_ui.md) owns schema and lifecycle.> ⛔ **GATE — final confirmation is the Design Spec input contract.** Immediately before authoring `design_spec.md`, re-read the complete final `result.json` with `stage: final` and `status: confirmed`; on a chat path, use the final visible confirmation summary as the equivalent state. Every explicitly present confirmed field is mandatory. Decide only details that remain unconfirmed. Never omit, delete, replace, narrow, weaken, reinterpret, or re-recommend a confirmed value because later analysis, asset inventory, template evidence, or personal judgment suggests another choice. Consume conditional fields according to their declared semantics, and preserve an explicitly cleared prose field as empty. If a confirmed value cannot be honored, keep the requirement visible and follow [`failure-recovery.md`](../workflows/governance/failure-recovery.md) instead of silently changing it.@@ -139,7 +139,7 @@ Record the confirmed visual style and rationale in `design_spec.md` first, then### e. Color Scheme Recommendation-**Hard rule**: User-specified colors are truth. Lock supplied HEX, brand colors, or natural-language color directives directly and skip the recommendation table. When [`strategist-template.md`](./strategist-template.md) is active, apply its inherited-design precedence. Only when neither source exists do you propose a scheme below.+**Hard rule**: User-specified colors are truth. Lock supplied HEX, brand colors, or natural-language directives; templates follow inherited-design precedence. Even direct locks fill all six roles (`background`, `secondary_bg`, `primary`, `accent`, `secondary_accent`, `body_text`) in each of ≥3 directions: repeat fixed roles and vary only open ones. Never emit an empty palette. Only without user/template colors use the table below.Proactively provide a color scheme (HEX values) based on content characteristics and industry.@@ -207,6 +207,7 @@ See [`../templates/icons/README.md`](../templates/icons/README.md) for the curre**Family selection**:- User or active template typography is authoritative. Otherwise present two coherent choices: one concord (safe) and one contrast (more tension). Do not pair title/body families that are merely near-duplicates.+- Every Stage-2 direction carries `heading` / `body` `cjk`, `latin`, `css`, and positive `body_size`; repeat user/template-fixed stacks.- Exported faces must resolve to fonts available in PowerPoint. Safe anchors are CJK `Microsoft YaHei` / `SimHei` / `SimSun` / `FangSong` / `KaiTi`; Latin sans `Arial` / `Calibri` / `Segoe UI`; Latin serif `Times New Roman` / `Georgia` / `Cambria`; mono `Consolas`; display `Impact` / `Arial Black`.- Keep each stack to four families or fewer. A non-installed brand or web face is legal only when the Design Spec explicitly records the install / embed requirement and a safe substitute.- Avoid splitting roles across near-equivalents such as YaHei↔PingFang, SimSun↔Songti, Arial↔Helvetica↔Segoe UI, or Times New Roman↔Times. A cross-platform counterpart may remain inside one fallback stack.diff --git a/skills/ppt-master/scripts/confirm_ui/server.py b/skills/ppt-master/scripts/confirm_ui/server.pyindex 7b6b8383..57072541 100644--- a/skills/ppt-master/scripts/confirm_ui/server.py+++ b/skills/ppt-master/scripts/confirm_ui/server.py@@ -9,9 +9,9 @@ clickable page (color swatches, live font previews, candidate picks). Onsubmit it writes the user's final choices to``<project>/confirm_ui/result.json`` for the AI to read back.-This is the confirmation surface only. The chat fallback always remains valid:-if the browser cannot open (remote / headless / web host), the AI presents the-same Strategist confirmation stage in chat.+This is the default confirmation surface. The chat fallback is used only when+the user explicitly requests chat-only confirmation or the browser launch+fails; it preserves the same staged semantics.See scripts/docs/confirm_ui.md for the round-trip data contract and schema.@@ -80,6 +80,17 @@ RECOMMENDATIONS_NAME = 'recommendations.json'RESULT_NAME = 'result.json'SESSION_NAME = 'session.json'+_PALETTE_ROLES = (+ 'background',+ 'secondary_bg',+ 'primary',+ 'accent',+ 'secondary_accent',+ 'body_text',+)+_TYPOGRAPHY_SIZE_ROLES = ('title', 'subtitle', 'annotation')+_HEX_COLOR_RE = re.compile(r'#?(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})\Z')+# Static option universe served at /api/catalogs (canvas synced live from config)._CATALOGS_PATH = Path(__file__).resolve().parent / 'static' / 'catalogs.json'_ICON_LIBRARY_DIR = Path(__file__).resolve().parents[2] / 'templates' / 'icons'@@ -427,6 +438,139 @@ def _localized_text_present(candidate: dict, field: str) -> bool:)+def _recommended_image_usage(recommendations: dict):+ """Return the Stage 2 image-source recommendation in either schema."""+ recommend = recommendations.get('recommend')+ usage = recommend.get('image_usage') if isinstance(recommend, dict) else None+ if usage is None:+ usage = recommendations.get('image_usage')+ if isinstance(usage, dict):+ usage = usage.get('value')+ return usage+++def _uses_ai_images(recommendations: dict) -> bool:+ """Return whether Stage 2 proposes AI-generated images."""+ usage = _recommended_image_usage(recommendations)+ return 'ai' in usage if isinstance(usage, list) else usage == 'ai'+++def _palette_error(color: object, label: str) -> Optional[str]:+ """Validate one complete user-facing palette."""+ if not isinstance(color, dict):+ return f'{label} must be an object'+ palette = color.get('palette')+ if not isinstance(palette, dict):+ palette = color+ for role in _PALETTE_ROLES:+ value = palette.get(role)+ if role == 'body_text' and value is None:+ value = palette.get('text')+ if not isinstance(value, str) or not _HEX_COLOR_RE.fullmatch(value.strip()):+ return f'{label}.palette.{role} must be a HEX color'+ return None+++def _positive_number(value: object) -> bool:+ """Return whether a JSON value is a positive finite number."""+ try:+ number = float(value)+ except (TypeError, ValueError):+ return False+ return number > 0 and number != float('inf')+++def _typography_error(typography: object, label: str, *, require_sizes: bool) -> Optional[str]:+ """Validate one complete user-facing typography recommendation or choice."""+ if not isinstance(typography, dict):+ return f'{label} must be an object'+ for role in ('heading', 'body'):+ font = typography.get(role)+ if not isinstance(font, dict):+ return f'{label}.{role} must be an object'+ for field in ('cjk', 'latin', 'css'):+ if not isinstance(font.get(field), str) or not font[field].strip():+ return f'{label}.{role}.{field} must be non-empty'+ if not _positive_number(typography.get('body_size')):+ return f'{label}.body_size must be a positive number'+ if not require_sizes:+ return None+ sizes = typography.get('sizes')+ if not isinstance(sizes, dict):+ return f'{label}.sizes must be an object'+ for role in _TYPOGRAPHY_SIZE_ROLES:+ if not _positive_number(sizes.get(role)):+ return f'{label}.sizes.{role} must be a positive number'+ return None+++def _candidate_list(spec: object) -> list:+ """Return candidates from the current or legacy recommendation shape."""+ if not isinstance(spec, dict):+ return []+ candidates = spec.get('candidates')+ if not isinstance(candidates, list):+ candidates = spec.get('options')+ return candidates if isinstance(candidates, list) else []+++def _stage2_design_directions_error(recommendations: dict) -> Optional[str]:+ """Require three complete coordinated Stage 2 design systems."""+ directions = recommendations.get('design_directions')+ if isinstance(directions, dict):+ candidates = _candidate_list(directions)+ if len(candidates) < 3:+ return 'Stage 2 design_directions must include at least 3 candidates'+ for index, candidate in enumerate(candidates, start=1):+ label = f'design_directions.candidates[{index - 1}]'+ if not isinstance(candidate, dict):+ return f'{label} must be an object'+ if not _localized_text_present(candidate, 'name'):+ return f'{label} requires a non-empty localized name'+ for field in ('visual_style', 'icons'):+ if not isinstance(candidate.get(field), str) or not candidate[field].strip():+ return f'{label}.{field} must be non-empty'+ error = _palette_error(candidate.get('color'), f'{label}.color')+ if error:+ return error+ error = _typography_error(+ candidate.get('typography'),+ f'{label}.typography',+ require_sizes=False,+ )+ if error:+ return error+ if _uses_ai_images(recommendations):+ image_strategy = candidate.get('image_strategy')+ if not isinstance(image_strategy, dict) or not str(+ image_strategy.get('rendering') or ''+ ).strip():+ return f'{label}.image_strategy.rendering must be non-empty'+ return None++ # Legacy staged files remain readable, but they must still provide three+ # complete color combinations and at least one complete typography choice.+ colors = _candidate_list(recommendations.get('color'))+ if len(colors) < 3:+ return 'Stage 2 recommendations must include 3 complete color candidates'+ for index, color in enumerate(colors):+ error = _palette_error(color, f'color.candidates[{index}]')+ if error:+ return error+ typography = _candidate_list(recommendations.get('typography'))+ if not typography:+ return 'Stage 2 recommendations must include typography candidates'+ for index, candidate in enumerate(typography):+ error = _typography_error(+ candidate,+ f'typography.candidates[{index}]',+ require_sizes=False,+ )+ if error:+ return error+ return None++def _stage2_custom_candidates_error(recommendations: dict) -> Optional[str]:"""Require visible AI-authored custom alternatives in new Stage 2 files."""candidates = recommendations.get('custom_candidates')@@ -444,14 +588,7 @@ def _stage2_custom_candidates_error(recommendations: dict) -> Optional[str]:f'{prose_field}')- recommend = recommendations.get('recommend')- usage = recommend.get('image_usage') if isinstance(recommend, dict) else None- if usage is None:- usage = recommendations.get('image_usage')- if isinstance(usage, dict):- usage = usage.get('value')- uses_ai = 'ai' in usage if isinstance(usage, list) else usage == 'ai'- if not uses_ai:+ if not _uses_ai_images(recommendations):return Noneimage_candidate = candidates.get('image_strategy')@@ -504,6 +641,9 @@ def _submission_stage_error(recommendation_error = _stage2_custom_candidates_error(recommendations)if recommendation_error:return recommendation_error+ recommendation_error = _stage2_design_directions_error(recommendations)+ if recommendation_error:+ return recommendation_errorallowed_submissions = {1: {'stage1'},@@ -552,6 +692,40 @@ def _custom_selection_error(result: dict) -> Optional[str]:return None+def _stage2_solution_error(result: dict) -> Optional[str]:+ """Reject a Stage 2/final payload with an incomplete design system."""+ color = result.get('color')+ color_error = _palette_error(color, 'color')+ color_custom = (+ isinstance(color, dict)+ and color.get('name') == 'custom'+ and str(color.get('custom') or '').strip()+ )+ if color_error and not color_custom:+ return color_error++ typography = result.get('typography')+ typography_error = _typography_error(+ typography,+ 'typography',+ require_sizes=True,+ )+ typography_custom = (+ isinstance(typography, dict)+ and typography.get('name') == 'custom'+ and str(typography.get('custom') or '').strip()+ and _positive_number(typography.get('body_size'))+ and isinstance(typography.get('sizes'), dict)+ and all(+ _positive_number(typography['sizes'].get(role))+ for role in _TYPOGRAPHY_SIZE_ROLES+ )+ )+ if typography_error and not typography_custom:+ return typography_error+ return None++def _normalize_custom_selections(result: dict) -> None:"""Keep custom prose only for the creative choices actually selected."""if result.get('mode') != 'custom':@@ -1189,6 +1363,9 @@ def create_app(recommendation_error = _stage2_custom_candidates_error(data)if recommendation_error:return jsonify({'error': recommendation_error}), 409+ recommendation_error = _stage2_design_directions_error(data)+ if recommendation_error:+ return jsonify({'error': recommendation_error}), 409# Template application is authored by Strategist from the installed# workspace and current content. Never expose legacy mode fields as# user-facing confirmation controls.@@ -1228,6 +1405,16 @@ def create_app(custom_error = _custom_selection_error(result)if custom_error:return jsonify({'error': custom_error}), 400+ try:+ current_recommendations = _read_json_object(+ confirm_dir / RECOMMENDATIONS_NAME,+ )+ except (OSError, json.JSONDecodeError, ValueError):+ current_recommendations = {}+ if stage == 'stage2' or _recommendation_stage(current_recommendations) == 3:+ solution_error = _stage2_solution_error(result)+ if solution_error:+ return jsonify({'error': solution_error}), 400_normalize_custom_selections(result)locked_values = _apply_locked_recommendations(result,diff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.jsindex 840987cd..0326e686 100644--- a/skills/ppt-master/scripts/confirm_ui/static/app.js+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js@@ -68,6 +68,7 @@ai_custom_candidate: "AI custom proposal",ai_custom_candidate_hint: "Always visible for comparison. It is not selected by default; select it to edit.",custom_behavior_required: "The selected AI custom proposal cannot be blank.",+ design_system_required: "Choose a complete palette and typography system before continuing.",mode_behavior_placeholder: "Describe the act sequence, title voice, page rhythm, and presentation posture.",visual_style_behavior_placeholder: "Describe shape language, composition, decoration density, whitespace, typography character, and texture.",recommended: "Recommended",@@ -205,6 +206,7 @@ai_custom_candidate: "AIカスタム案",ai_custom_candidate_hint: "比較できるよう常に全文を表示します。初期選択はされず、選択後に編集できます。",custom_behavior_required: "選択したAIカスタム案を空欄にはできません。",+ design_system_required: "続行する前に、完全な配色と書体システムを選択してください。",mode_behavior_placeholder: "構成の流れ、タイトルの語り口、ページのリズム、表現姿勢を記述します。",visual_style_behavior_placeholder: "形状言語、構図、装飾密度、余白、書体の性格、質感を記述します。",recommended: "おすすめ",@@ -342,6 +344,7 @@ai_custom_candidate: "AI 自定义方案",ai_custom_candidate_hint: "始终展示完整内容用于比较;默认不选中,选择后可编辑。",custom_behavior_required: "已选择的 AI 自定义方案不能为空。",+ design_system_required: "请先选择完整的配色与字体方案,再继续确认。",mode_behavior_placeholder: "描述叙事阶段、标题语气、页面节奏和表达姿态。",visual_style_behavior_placeholder: "描述形状语言、构图、装饰密度、留白、字体气质和纹理。",recommended: "推荐",@@ -1685,7 +1688,9 @@var col = el("div", "swatch-col");var s = el("div", "swatch"); s.style.background = pal[role];refs[role] = s;- col.appendChild(s); col.appendChild(el("div", "swatch-role", t("role_" + role)));+ col.appendChild(s);+ col.appendChild(el("div", "swatch-role", t("role_" + role)));+ col.appendChild(el("div", "color-hex", normHex(pal[role]) || pal[role]));sw.appendChild(col);});cardSwatchRefs[idx] = refs;@@ -2693,6 +2698,42 @@return !!valid;}+ function positiveNumber(value) {+ var number = parseFloat(value);+ return isFinite(number) && number > 0;+ }++ function designSystemValid(payload) {+ var color = payload.color || {};+ var palette = color.palette || {};+ var completePalette = PALETTE_ROLES.every(function (role) {+ return !!normHex(palette[role]);+ });+ var customPalette = color.name === "custom" && String(color.custom || "").trim();++ var typography = payload.typography || {};+ var completeFontRole = function (role) {+ var font = typography[role] || {};+ return ["cjk", "latin", "css"].every(function (field) {+ return !!String(font[field] || "").trim();+ });+ };+ var completeFamilies = completeFontRole("heading") && completeFontRole("body");+ var customFamilies = typography.name === "custom" &&+ String(typography.custom || "").trim();+ var sizes = typography.sizes || {};+ var completeSizes = positiveNumber(typography.body_size) &&+ ["title", "subtitle", "annotation"].every(function (role) {+ return positiveNumber(sizes[role]);+ });+ var valid = (completePalette || customPalette) &&+ (completeFamilies || customFamilies) && completeSizes;+ if (!valid) {+ document.getElementById("confirm-status").textContent = t("design_system_required");+ }+ return !!valid;+ }+function stage2Payload() {var payload = communicationPayload();payload.stage = "stage2";@@ -2755,6 +2796,7 @@function submitStage2() {var payload = stage2Payload();if (!imageUsageValid(payload.image_usage)) return;+ if (!designSystemValid(payload)) return;if (!customSelectionsValid(payload)) return;submitStage(payload, 3);}@@ -2820,6 +2862,7 @@payload.image_strategy = normalizedImageStrategy(payload.image_strategy);}normalizeCreativePayload(payload);+ if (!designSystemValid(payload)) return;if (!customSelectionsValid(payload)) return;btn.disabled = true;fetch("/api/confirm", {diff --git a/skills/ppt-master/scripts/docs/confirm_ui.md b/skills/ppt-master/scripts/docs/confirm_ui.mdindex 83f78742..0bc6f26f 100644--- a/skills/ppt-master/scripts/docs/confirm_ui.md+++ b/skills/ppt-master/scripts/docs/confirm_ui.md@@ -16,7 +16,7 @@**Hard rule**: Keep detailed Confirm UI behavior here. The Generate route may summarize orchestration, but it should not duplicate the full JSON schema, catalog behavior, or launcher lifecycle.-**Fallback rule**: Browser failure never cancels Step 4. Re-check `result.json` once, then use the chat confirmation path with the same three-stage semantics. Stage-1 chat prompts remain open questions; do not turn the hint vocabulary into a numbered selection.+**Fallback rule**: The page is default. Use chat only on explicit chat-only request or launch failure/timeout after one `result.json` re-check; a chat-question tool is not a launch failure. Preserve all three stages and keep Stage-1 prompts open-ended.## `confirm_ui/server.py`@@ -184,7 +184,7 @@ After Stage 1 is confirmed, overwrite the file with the complete Stage-2 solutio}```-The example abbreviates the ≥3 preset directions. `custom_candidates.mode` / `.visual_style` are mandatory; `.image_strategy` is mandatory when proposed sources include `ai`. Each is separate from the preset bundle and needs localized, non-empty copy. Legacy top-level candidate fields remain read-compatible.+The example abbreviates the required ≥3 directions. Custom mode/style candidates remain mandatory; AI usage also requires the custom image candidate. Stage 2 rejects fewer than three bundles, incomplete six-role palettes, and incomplete heading/body stacks. Legacy grids remain readable only with three complete palettes and complete typography.After Stage 2 is confirmed, overwrite it with Stage-3 production recommendations only:@@ -209,14 +209,14 @@ After Stage 2 is confirmed, overwrite it with Stage-3 production recommendations- `recommend.image_usage` should be an array of source ids when more than one source applies, e.g. `["ai", "provided"]`. A single string is still accepted for backward compatibility. Do not write bare `"custom"` and do not encode a mixed-source plan as prose here; write the prose to top-level `image_notes.value`.- `image_notes` is the initial strategy note shown under the image source chips. Use it for page-role guidance and constraints: which source applies where, what to avoid, which user assets are authoritative, how realistic / abstract the imagery should be, and what can remain as placeholders. It is intent guidance, not a separate finite option.- When confirmed Stage-2 `image_usage` includes `ai`, Stage 3 sets `recommend.image_ai_path` to one of `auto` / `api` / `host-native` / `manual`. Stage 2 never asks for the acquisition mechanism while the user is still deciding the image role.-- **Color candidates carry the user-facing core `palette`**: `background`, `secondary_bg`, `primary`, `accent`, `secondary_accent`, and `body_text`. The page renders labelled swatches and offers per-role override inputs for precise single-role edits, plus a **Custom color card with a free-text box** (parallel to the custom typography box) — the user can describe the palette in words or paste HEX values instead of filling each role; this writes `color: { "name": "custom", "custom": "<text>" }` to `result.json` for the AI to interpret. Legacy `text` is accepted as an alias for `body_text`, but new files should write `body_text`. Strategist derives secondary text, borders, state colors, and visual-style neutral tiers while writing `design_spec.md`, then projects the machine values to `spec_lock.md`; those are not user-facing confirmation choices.+- **Color candidates carry the user-facing core `palette`**: `background`, `secondary_bg`, `primary`, `accent`, `secondary_accent`, and `body_text`. The page renders every role as a labelled swatch with its HEX value visible, and offers per-role override inputs for precise single-role edits, plus a **Custom color card with a free-text box** (parallel to the custom typography box) — the user can describe the palette in words or paste HEX values instead of filling each role; this writes `color: { "name": "custom", "custom": "<text>" }` to `result.json` for the AI to interpret. Legacy `text` is accepted as an alias for `body_text`, but new files should write `body_text`. Strategist derives secondary text, borders, state colors, and visual-style neutral tiers while writing `design_spec.md`, then projects the machine values to `spec_lock.md`; those are not user-facing confirmation choices.- **Candidate display text may be multilingual**: color / typography candidates can provide `name_zh` / `name_en` / `name_ja` and `note_zh` / `note_en` / `note_ja`; the page falls back to legacy `name` / `note`. Labels resolve in the page language first, then fall back across the others (a `ja` page: ja → en → zh; zh/en pages keep their zh↔en fallback and try `_ja` last), so when `lang` is `ja` always include the `_ja` variants — otherwise the candidate labels render in English.- **Typography candidates split CJK and Latin** for both `heading` and `body`; `css` is the fallback preview stack. Each candidate includes topic-matched sample text. Stage 2 is authored once with a reading-mode baseline of `text` 20 · `balanced` 24 · `presentation` 32 px on PPT. Font cards choose family / character and preserve the current sizing state; they do not introduce a competing size recommendation. The page writes px directly. `delivery_purpose` remains the compatibility key only.- **Per-role size override** (parallel to color's per-role HEX override): besides `body_size`, the page exposes editable inputs for `title` / `subtitle` / `annotation`. The browser applies one documented deterministic dependency chain: `reading mode → body baseline → unpinned role sizes` (role ramp: `body ×` the §g ratios). Changing reading mode updates the body and all unpinned roles locally; changing body updates unpinned roles locally. Editing body or a role pins that value, so later reading-mode changes do not overwrite it. Font / direction-card selection preserves all current sizes. This is a browser-only state update: it performs no fetch, asks the backend to author no new recommendations, and a re-render preserves exactly what the user sees. Each role input is labelled as px and shows an approximate pt equivalent (`1px = 0.75pt`) for orientation. The final values are written to `result.json` as `typography.sizes: { "title", "subtitle", "annotation" }` in **px** — every canvas, no pt and no `sizes_pt` provenance. Candidate `sizes` remain accepted for compatibility, but the fresh Stage-2 baseline is normalized through the same local ramp before first render.- **`delivery_purpose` compatibility key / Reading mode** (enumerable, PPT only) decides where meaning is carried, not merely how large type is: `text` makes pages self-contained with complete sentences, short prose, captions, tables, and necessary detail; `balanced` shares explanation between page and presenter; `presentation` uses one idea, concise claims, and visual evidence while speech / notes carry the detail. It therefore governs page grammar, granularity, density / rhythm, and note burden. Reading-mode cards intentionally show **no px value**; the typography section owns the separately visible body / role sizes and applies any local default. It is surfaced in Stage 2 beside the visual system, separate from communication intent. `recommend.delivery_purpose` pre-selects one; `result.json` retains the key, while `spec_lock.md` uses canonical `consumption_mode`. Non-PPT canvases omit it.- **Combined style preview** — a compact live "overall impression" strip sits just above the color section and is **sticky**: it pins under the topbar so it stays visible while the user scrolls through the color / icon / typography sections, keeping the picking controls and their combined effect on screen together. It applies the currently selected color palette **and** typography (heading sample in `primary` over `background`, body sample in `body_text`, an `accent` bar, a `secondary_bg` chip) and repaints on every color / HEX-override / font / `body_size` change. It does not replace the per-candidate swatches or font samples (those stay for picking); it is deliberately an abstract style chip, **not** a slide-layout preview — page layout preview remains the live-preview server's job (Step 6). No schema field; it derives entirely from the existing color + typography selections.- **Generated-image direction** appears only for `image_usage: ai`: up to three preset cards plus one full-width AI custom proposal. Custom has no preset dropdown; selection makes it editable and submits `rendering: "custom"` + `behavior`. The live preview follows the selection. No image palette is written; deck colors remain authoritative, and legacy `image_strategy.palette` is ignored.-- **`design_directions`** is the canonical Stage-2 personality spectrum. Each candidate carries localized name / note, `visual_style`, `color`, `typography`, `icons`, and conditional `image_strategy`. Author ≥3 spanning safe / shifted / bold (honest-shortfall exception applies). Selecting one applies the whole bundle; the component controls below are advanced overrides. The bundle itself is presentation-only—`result.json` stores the actual selected components, not a direction id.+- **`design_directions`** is the canonical Stage-2 spectrum: ≥3 safe / shifted / bold bundles with localized copy, style, icons, conditional image strategy, complete CJK/Latin typography, and HEX `background`, `secondary_bg`, `primary`, `accent`, `secondary_accent`, `body_text`. Selection applies the bundle; component controls override it. `result.json` stores components, not a direction id.- `recommend.generation_mode` and `refine_spec` mirror the two mandatory notes in [`generate-pptx`](../../workflows/generate-pptx.md) Step 4. Confirmed `generation_mode: "split"` / `refine_spec: true` are explicit user choices, equivalent to opting in through chat.- `content_divergence` is a **free-text** Stage-1 source-treatment field. Blank means a balanced default; facts stay sourced at every level. Strategist consumes it while authoring §IX and records it in `design_spec.md §I`; it is not written to `spec_lock.md`. Beautify sends `{ "value": "keep source wording and page structure verbatim", "locked": true }`, so the UI displays it read-only and the server restores it on every staged submit. Template-fill does not use this confirmation flow and does not surface it.- `lang` is a soft default (`zh` / `en` / `ja` — the page UI supports all three); an explicit user language choice in the page (persisted to `localStorage`) wins.@@ -259,7 +259,7 @@ The shape above is final. Selected custom values use `mode: custom` + `mode_beha**Final-result consumption contract.** A final result is the user-confirmed input contract for the Strategist's Design Spec, not another recommendation input. The Strategist re-reads the complete final object, writes and audits `design_spec.md` against every explicitly present field, and may autonomously decide only details that remain unconfirmed. Only after that audit passes does it project `spec_lock.md` from the completed Design Spec; lock authoring is not a second design pass. It must not omit, substitute, narrow, weaken, reinterpret, or re-recommend a confirmed value. If one value cannot be honored, the owning workflow reports or pauses under failure recovery; it never deletes the requirement to keep the pipeline moving.- Bespoke mode / style prose lives only in the required behavior sibling; image custom prose lives in `image_strategy.behavior`. Canvas / icons retain free-text edge cases, color / typography retain `name: "custom"`, and image usage remains a source-id array plus `image_notes`.-- `image_ai_path` and `image_strategy` are omitted from `result.json` unless `image_usage` includes `ai`. Both are honored downstream as confirmed choices — and the page is only a convenience surface over the **canonical chat channel**: the same choices made in chat are honored identically when no `result.json` exists. `image_ai_path` drives the Step 5 generation path (`image-generator.md` §7 — `host-native` forces the host tool even when `IMAGE_BACKEND` is set); the chosen `image_strategy` candidate is locked verbatim by [`strategist-image.md`](../../references/strategist-image.md) §2 (no re-pick).+- `image_ai_path` and `image_strategy` appear only with `image_usage: ai` and remain confirmed downstream. The page is default; explicit/failure chat fallback keeps identical fields. `image_ai_path` selects the Step 5 path, and [`strategist-image.md`](../../references/strategist-image.md) §2 locks the chosen strategy verbatim.- After the user clicks the **final Confirm** (Stage 3, or single-pass), the page saves `result.json` and shuts the server down (auto-close). Stage-1 **Confirm contract & continue** and Stage-2 **Confirm solution & continue** keep the page open while it polls for the once-authored downstream stage. In the default flow, the first `--daemon --wait` returns on the stage-1 result, `--wait-only --wait-stage stage2` returns on the stage-2 result, and the final `--wait-only` returns on the final result; the AI reads each immediately — no extra chat confirmation is required. Chat fallback shows the same initially-unselected custom proposals. Either way, Step 4 ends with a `--shutdown` cleanup so a never-confirmed page cannot keep holding port 5050 ahead of the Step 6 live preview.## Scopediff --git a/skills/ppt-master/workflows/generate-pptx.md b/skills/ppt-master/workflows/generate-pptx.mdindex edbc6639..15aa8139 100644--- a/skills/ppt-master/workflows/generate-pptx.md+++ b/skills/ppt-master/workflows/generate-pptx.md@@ -162,9 +162,9 @@ The core first chooses the proposed Stage 2 source ids. Load the image module be**Confirmation orchestration**: field meaning and recommendation logic belong to the active Strategist modules; [`confirm_ui.md`](../scripts/docs/confirm_ui.md) owns the JSON schema, server lifecycle, staged-result contract, port behavior, and equivalent chat fallback.-⛔ **BLOCKING**: unless the user explicitly delegates confirmation for this run, final confirmation is the single user gate before the planning artifacts are written. Stage 1 and Stage 2 are intermediate handoffs inside one uninterrupted agent turn; after either wait returns, immediately author the next stage without yielding or asking in chat. Each stage is authored once, and the user's submitted value—including an empty string or an unusual mix of overrides—is authoritative.+⛔ **BLOCKING**: Unless explicitly delegated, final confirmation is the single user gate. Keep Stage 1/2 handoffs in one turn; after each wait, author the next stage without chat. Author each stage once; submitted values—including blanks or unusual overrides—are authoritative.-**Confirmation ownership**: By default, only the user confirms. The agent may write `recommendations.json`, operate the server lifecycle, and read the resulting state, but MUST NOT call `/api/confirm`, automate page submission, synthesize a staged payload, or write/replace `result.json` on the user's behalf. If—and only if—the user explicitly says that confirmation is unnecessary and delegates the decisions to the AI, skip the UI, make the complete Stage-1/2/3 decisions, show one concise summary, and continue using that visible chat summary as the confirmation state; do not fabricate UI results. Delegation applies only to the current run. A timeout returns to the same stage in chat, and silence never implies delegation or confirmation.+**Confirmation ownership and surface**: Only the user confirms. Default Stage 1 is `--daemon --wait`; use chat only by explicit chat-only/delegation or after launch failure/timeout plus a `result.json` re-check. Chat tools do not replace launch. The agent may write recommendations, operate the server, and read state, but MUST NOT call `/api/confirm`, automate submission, synthesize a payload, or write/replace `result.json`. Delegation applies only to this run: show the complete three-stage summary and never fabricate UI results. Silence confirms nothing.| Stage | Strategist writes | Completion evidence ||---|---|---|