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: animation sidecar validation resolves a round-trip workspace roster in page-plan order; edit-native docs state the rebuilt baseline, transition preservation, imported line geometry, and the converter path
hugohe35581c851ec5e
diff --git a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py b/skills/ppt-master/scripts/svg_to_pptx/animation_config.pyindex 2e04dd9c..d1c5f76f 100644--- a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py+++ b/skills/ppt-master/scripts/svg_to_pptx/animation_config.py@@ -318,20 +318,69 @@ def _require_unique_target_ids(raise ValueError(_duplicate_target_error(slide_name, duplicates))+ROUNDTRIP_AUTHORING_DIR = 'authoring-svg-flat'+ROUNDTRIP_PAGE_PLAN = 'page_plan.json'+++def resolve_slide_svg_files(project_path: Path) -> tuple[list[Path], str | None]:+ """Return the project's slide SVGs in output order, or an error message.++ A Generate project keeps its roster in ``svg_output/``. A round-trip+ workspace keeps it in ``authoring-svg-flat/``; when ``page_plan.json``+ exists its ``pages`` order is the output roster (each entry's ``svg``+ name, else the source page's ``slide_NN.svg``), which is the roster the+ round-trip exporter reads the sidecar against. A plan the exporter would+ reject falls back to the authoring files in filename order.+ """+ svg_dir = project_path / 'svg_output'+ if svg_dir.is_dir():+ return discover_slide_svgs(svg_dir), None+ authoring_dir = project_path / ROUNDTRIP_AUTHORING_DIR+ if not authoring_dir.is_dir():+ return [], f'svg_output directory not found: {svg_dir}'+ files = discover_slide_svgs(authoring_dir)+ plan_path = project_path / ROUNDTRIP_PAGE_PLAN+ if not plan_path.is_file():+ return files, None+ by_source: dict[int, Path] = {}+ for path in files:+ match = re.fullmatch(r'slide_(\d+)', path.stem)+ if match:+ by_source[int(match.group(1))] = path+ try:+ pages = json.loads(plan_path.read_text(encoding='utf-8')).get('pages')+ except (OSError, ValueError, AttributeError):+ return files, None+ if not isinstance(pages, list):+ return files, None+ ordered: list[Path] = []+ for raw in pages:+ if not isinstance(raw, dict):+ return files, None+ svg_name = raw.get('svg')+ if isinstance(svg_name, str) and svg_name:+ path = authoring_dir / svg_name+ else:+ path = by_source.get(raw.get('source_slide'))+ if path is None or not path.is_file():+ return files, None+ ordered.append(path)+ return (ordered or files), None++def scan_project_targets(project_path: Path,*,svg_files: list[Path] | None = None,include_hidden: bool = False,) -> tuple[dict[str, list[GroupTarget]], list[str]]:- """Scan selected SVG files, defaulting to ``svg_output/*.svg``."""+ """Scan selected SVG files, defaulting to the project's slide roster."""targets_by_slide: dict[str, list[GroupTarget]] = {}anonymous_groups: list[str] = []if svg_files is None:- svg_dir = project_path / 'svg_output'- if not svg_dir.is_dir():- return targets_by_slide, [f'svg_output directory not found: {svg_dir}']- svg_files = discover_slide_svgs(svg_dir)+ svg_files, error = resolve_slide_svg_files(project_path)+ if error is not None:+ return targets_by_slide, [error]for svg_path in svg_files:targets, anonymous = scan_svg_targets(svg_path, include_hidden=include_hidden)@@ -1653,8 +1702,7 @@ def validate_animation_config(if morph_pairs:scan_files = svg_filesif scan_files is None:- svg_dir = project_path / 'svg_output'- scan_files = discover_slide_svgs(svg_dir) if svg_dir.is_dir() else []+ scan_files, _error = resolve_slide_svg_files(project_path)for svg_path in scan_files:root_primitives_by_slide[svg_path.stem] = scan_root_primitives(svg_path)for pair in morph_pairs:diff --git a/skills/ppt-master/scripts/tests/test_dogfood_edit_native_fixes.py b/skills/ppt-master/scripts/tests/test_dogfood_edit_native_fixes.pynew file mode 100644index 00000000..16bb5449--- /dev/null+++ b/skills/ppt-master/scripts/tests/test_dogfood_edit_native_fixes.py@@ -0,0 +1,107 @@+#!/usr/bin/env python3+"""Regression tests for the 2026-09-12 Edit Native PPTX dogfood fixes.++The animation sidecar validator resolved its slide roster only from+``svg_output/``; a round-trip workspace keeps its pages in+``authoring-svg-flat/`` and orders them by ``page_plan.json``, so every+reference in a workspace sidecar read as a missing slide.+"""++from __future__ import annotations++import json+import sys+import tempfile+import unittest+from pathlib import Path++SCRIPTS_DIR = Path(__file__).resolve().parents[1]+if str(SCRIPTS_DIR) not in sys.path:+ sys.path.insert(0, str(SCRIPTS_DIR))++from svg_to_pptx.animation_config import ( # noqa: E402+ resolve_slide_svg_files,+ validate_animation_config,+)++SVG = (+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 720">'+ '<g id="hero" data-pptx-bounds="100 100 400 200"><rect x="100" y="100" width="400" height="200" fill="#123456"/></g>'+ '</svg>\n'+)+++def _workspace(tmp: str, plan: list[dict] | None) -> Path:+ root = Path(tmp)+ authoring = root / 'authoring-svg-flat'+ authoring.mkdir()+ for n in (1, 2, 3):+ (authoring / f'slide_{n:02d}.svg').write_text(SVG, encoding='utf-8')+ if plan is not None:+ (root / 'page_plan.json').write_text(+ json.dumps({'schema': 'ppt-master.roundtrip-page-plan.v1', 'pages': plan}),+ encoding='utf-8',+ )+ return root+++class RoundtripRosterTests(unittest.TestCase):+ def test_generate_project_still_uses_svg_output(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = Path(tmp)+ (root / 'svg_output').mkdir()+ (root / 'svg_output' / '01_cover.svg').write_text(SVG, encoding='utf-8')+ files, error = resolve_slide_svg_files(root)+ self.assertIsNone(error)+ self.assertEqual([f.name for f in files], ['01_cover.svg'])++ def test_missing_both_rosters_reports_svg_output(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ files, error = resolve_slide_svg_files(Path(tmp))+ self.assertEqual(files, [])+ self.assertIn('svg_output directory not found', error)++ def test_plan_order_is_the_output_order(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _workspace(tmp, [{'source_slide': 1}, {'source_slide': 3}, {'source_slide': 2}])+ files, error = resolve_slide_svg_files(root)+ self.assertIsNone(error)+ self.assertEqual([f.stem for f in files], ['slide_01', 'slide_03', 'slide_02'])++ def test_plan_svg_name_and_identity_fallback(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _workspace(tmp, None)+ (root / 'authoring-svg-flat' / 'kpi_copy.svg').write_text(SVG, encoding='utf-8')+ files, _ = resolve_slide_svg_files(root)+ self.assertEqual(len(files), 4)+ (root / 'page_plan.json').write_text(json.dumps({+ 'schema': 'ppt-master.roundtrip-page-plan.v1',+ 'pages': [{'source_slide': 2}, {'source_slide': 2, 'svg': 'kpi_copy.svg'}],+ }), encoding='utf-8')+ files, _ = resolve_slide_svg_files(root)+ self.assertEqual([f.stem for f in files], ['slide_02', 'kpi_copy'])++ def test_workspace_sidecar_validates_against_plan_order(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _workspace(tmp, [{'source_slide': 1}, {'source_slide': 3}, {'source_slide': 2}])+ config = {+ 'version': 1,+ 'defaults': {'animation': {'effect': 'none'}},+ 'slides': {+ 'slide_03': {'groups': {'hero': {'effect': 'fade', 'order': 1}}},+ 'slide_02': {+ 'transition': {'effect': 'morph', 'duration': 1},+ 'morph': {'from': 'slide_03', 'pairs': {'key': {'from': 'hero', 'to': 'hero'}}},+ },+ },+ }+ messages = validate_animation_config(root, config)+ self.assertEqual(messages, [])+ wrong = json.loads(json.dumps(config))+ wrong['slides']['slide_02']['morph']['from'] = 'slide_01'+ messages = validate_animation_config(root, wrong)+ self.assertTrue(any('immediately preceding slide "slide_03"' in m for m in messages), messages)+++if __name__ == '__main__':+ unittest.main()diff --git a/skills/ppt-master/workflows/edit-native-pptx.md b/skills/ppt-master/workflows/edit-native-pptx.mdindex e1d32612..bf993167 100644--- a/skills/ppt-master/workflows/edit-native-pptx.md+++ b/skills/ppt-master/workflows/edit-native-pptx.md@@ -46,7 +46,7 @@ python3 skills/ppt-master/scripts/pptx_to_svg.py "<source.pptx>" -o "projects/<s| `images/`, `icons/imported/`, `audio/`, `video/`, `sounds/` | Source media and imported vectors | Keep names; changed bytes rebuild every output page whose source graph references that part, and a format mismatch fails export || `notes/slide_NN.md` | Source speaker notes | Edit, delete, or add per output page (§6) || `native-payloads/`, `analysis/` | Immutable native backing and tool-owned contracts | Do not read, edit, or quote |-| `sources/source.pptx` | Exact source package | Read only through `ppt_to_md.py "<workspace>/sources/source.pptx" -o "<workspace>/validation/source_readback.md"` when you need page text without opening every SVG |+| `sources/source.pptx` | Exact source package | Read only through `source_to_md/ppt_to_md.py "<workspace>/sources/source.pptx" -o "<workspace>/validation/source_readback.md"` when you need page text without opening every SVG || `validation/`, `exports/` | Diagnostics and published decks | Tool-written |**Hard rule — source proxies are atomic**: an `<image data-pptx-source-proxy="native-restore">` stands for an unsupported native object (SmartArt, complex effects, media frames). Leave it to restore the original; a Slide-local proxy may be deleted, an inherited Master/Layout proxy stays; editing a proxy or its preview asset fails export.@@ -90,7 +90,7 @@ python3 skills/ppt-master/scripts/svg_authoring_view.py "projects/<slug>_<YYYYMM| Speaker notes | Source notes travel with every page; add or rewrite only where planned | `notes/<svg-stem>.md` || Narration audio | Off unless requested; implies notes on every output page | [`generate-audio`](./stages/generate-audio.md) → `audio/<stem>.*` || Auto-advance from narration | On when narration is requested | `svg_to_pptx.py --use-narration-timings` |-| Page transitions | Preserve source; replace only on request | `svg_to_pptx.py -t <effect>` or per-slide rows in `animations.json` |+| Page transitions | Preserve source; replace only on request — a transition the importer reports as `transition-not-reconstructed` still travels natively with its page until replaced, even though the sidecar default reads `none` | `svg_to_pptx.py -t <effect>` or per-slide rows in `animations.json` || Object animations | Preserve source; author only on explicit request | `animations.json`, [`animations.md`](../references/animations.md) || Native chart / table data | Source data unless the plan edits it | Inline JSON authority; export needs `--native-charts-and-tables` (§7) |@@ -110,6 +110,7 @@ Load [`shared-standards-core.md`](../references/shared-standards-core.md) before|---|---|| Text replacement | Fit the slot's visual capacity from its geometry and font size, not the old placeholder length; resolve overflow by rewriting shorter → splitting across another selected page → choosing a larger source layout; shrinking type is last and never deck-wide || Cover / chapter pages | Replace title, subtitle, author, section label only |+| Imported multi-line text | Continuation lines carry `data-paragraph-line-break` without `x` / `dy`: the exporter reads that model, ordinary renderers stack the lines on one baseline, and the checker flags edited text as unresolved geometry — give each continuation line its own `x` and `dy`; export ignores them and the warning clears || Dense content pages | Compress to the slot count the page has; move overflow to another selected page || Native tables / charts | Imported objects carry `data-pptx-native-authority="json"`: edit cell text or categories/series values in the inline JSON, keep structure and formatting from the source, and export with `--native-charts-and-tables` — without it the stale preview ships || Images | Point the existing `<image>` at a new file under `images/`; keep the frame |@@ -152,9 +153,9 @@ Add `-t <effect> [--transition-duration <s>]` to replace transitions deck-wide;Round-trip export summary: output_pages=N passthrough=P cloned_passthrough=C patched=M rebuilt=R```-`passthrough` = identity page with original XML (referenced, no plan, no overlay); `cloned_passthrough` = planned referenced page on a cloned part; `patched` = source shape XML kept while order, notes, transitions, animation, or narration timing changed; `rebuilt` = visible authoring or a referenced materialized resource changed — exactly the pages marked edited in §4.3 plus pages referencing a changed resource, and a delivery-only job must show `rebuilt=0`.+`passthrough` = identity page with original XML (referenced, no plan, no overlay); `cloned_passthrough` = planned referenced page on a cloned part; `patched` = source shape XML kept while order, notes, transitions, animation, or narration timing changed; `rebuilt` = visible authoring or a referenced materialized resource changed — exactly the pages marked edited in §4.3 plus pages referencing a changed resource, and a delivery-only job must show `rebuilt=0`. Every count is measured against `sources/source.pptx`, so a second round on a delivered deck — more edits or delivery only — starts by importing that delivered PPTX as a new workspace; re-exporting an edited workspace untouched repeats its earlier `rebuilt`.-**Validation**: `pptx_delivery_check.py "<printed_output.pptx>" > ".../validation/<output_stem>.delivery.json"` (no structural errors; review advisories) and `ppt_to_md.py "<printed_output.pptx>" -o ".../validation/readback.md"` — slide count equals the plan length (or source count), key titles and replaced text present, notes count matches, receipt buckets match the confirmed roster.+**Validation**: `pptx_delivery_check.py "<printed_output.pptx>" > ".../validation/<output_stem>.delivery.json"` (no structural errors; review advisories) and `source_to_md/ppt_to_md.py "<printed_output.pptx>" -o ".../validation/readback.md"` — slide count equals the plan length (or source count), key titles and replaced text present, notes count matches, receipt buckets match the confirmed roster.```markdown## ✅ Edit Native PPTX Completediff --git a/skills/ppt-master/workflows/routing.md b/skills/ppt-master/workflows/routing.mdindex 8df63736..24e74d14 100644--- a/skills/ppt-master/workflows/routing.md+++ b/skills/ppt-master/workflows/routing.md@@ -43,13 +43,13 @@ Route selection authority for PPT Master. Select exactly one top-level route, th| Effective delivery purpose is recorded, self-running, or video-directed | Inside the selected runtime, load [`video-design`](../references/video-design.md) before whole-solution/page planning; a design reference, not a profile — notes, animation, audio, and native MP4 stay with their stages || Explicit quick/fast, skip-strategy, or direct SVG-to-PPTX intent without an active fidelity profile | Load [`quick-generate`](./profiles/quick-generate.md) directly without `generate-pptx.md`: prepare sources/resources as needed, decide without interaction, apply at most one exact workspace root per kind supplied for this run (otherwise free design), omit Strategist/Confirm UI/spec/lock, hand-author SVG, run the lockless final checker, export || Topic only, or sources leave planning-critical factual gaps | Run [`topic-research`](./stages/topic-research.md) inside the selected profile's source preparation — immediately for topic-only input, after conversion and reading for source-backed input; research only the identified gaps |-| Existing PPTX must be split, merged, or re-outlined into newly designed pages | Treat the PPTX as source content through the selected Generate authority's intake; Default unless explicit Quick intent |+| Existing PPTX redesigned (split, merged, re-outlined) | Treat the PPTX as source content through the selected Generate authority's intake; Default unless explicit Quick intent || Existing PPTX pages dropped, reordered, or repeated without redesign | Not Generate: Edit Native PPTX, whose `page_plan.json` owns selection, order, and repetition || Default Generate reaches planning | Step 3 prepares template candidates without interaction; Stage 1 confirms the communication contract and free-design/template choice together; only a confirmed non-free choice runs [`apply-template-workspace`](./stages/apply-template-workspace.md) before Stage 2 || Explicit current brand/style/layout/deck workspace root outside Image to PPTX | Default preserves the exact path as a Stage-1 candidate; Quick validates and installs it directly without Steps 3–4 or Confirm UI. Classify as `library` only when the normalized root exactly matches a registered index entry, otherwise `explicit`. Consume the workspace root, never only its inner `templates/` || Split-mode project resumes in a fresh chat | Run [`resume-execute`](./stages/resume-execute.md) inside the active Generate route || Generated project needs a deck-wide `colors.*` or universal `typography.font_family` substitution | Stay in Generate; load [`update_spec.py`](../scripts/docs/update_spec.md), honor its supported-key boundary, then rerun the final quality gate and Step 7 export |-| Delivered project revision | Stay in Generate: [`generate-pptx.md`](./generate-pptx.md) Revision Round (Default) or [`quick-generate.md`](./profiles/quick-generate.md) §4 (Quick) |+| Deck revision | [`generate-pptx.md`](./generate-pptx.md) Revision Round, [`quick-generate.md`](./profiles/quick-generate.md) §4, [`edit-native-pptx.md`](./edit-native-pptx.md) §7 || User explicitly requests spec refinement | Run [`refine-spec`](./stages/refine-spec.md) after Design Spec Gate 1 and before lock Gate 2 || Data charts exist | Run [`verify-charts`](./stages/verify-charts.md) before export || User explicitly requests visual review | Run [`visual-review`](./stages/visual-review.md) before post-processing |