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: final gate compares the design_spec §IX roster with svg_output; update_spec docs name the hand-edit re-stamp
hugohe3191f4629e541
diff --git a/skills/ppt-master/scripts/docs/update_spec.md b/skills/ppt-master/scripts/docs/update_spec.mdindex c0202a38..c7363b26 100644--- a/skills/ppt-master/scripts/docs/update_spec.md+++ b/skills/ppt-master/scripts/docs/update_spec.md@@ -53,6 +53,8 @@ python3 skills/ppt-master/scripts/update_spec.py projects/acme_ppt169_20260301 \- "Switch an individual page's accent" → just edit that page's SVG directly- "Re-design the palette / type system" → update `spec_lock.md` manually, then the Executor can regenerate affected pages+A colour change rarely ends with the lock key: derived tints (a chart's second series, a highlight on a dark page), pages designed around the old colour (an inverted chapter page), and prose in `design_spec.md` that names the old palette are outside the tool's reach and are edited by hand. The tool re-stamps the native Chart/Table fallback baselines only for the files it rewrote; after any hand edit that touches a fallback, run `python3 skills/ppt-master/scripts/stamp_native_fallbacks.py <project_path>/svg_output --write` before the final quality gate, or the gate stops on an edited baseline.+## Safety- HEX values (e.g. `#005587`) are unique enough in SVG content that literal replacement is safediff --git a/skills/ppt-master/scripts/project_utils.py b/skills/ppt-master/scripts/project_utils.pyindex a4a3b510..72f9488d 100644--- a/skills/ppt-master/scripts/project_utils.py+++ b/skills/ppt-master/scripts/project_utils.py@@ -379,6 +379,90 @@ def validate_communication_trace(return errors+def _outline_slide_numbers(design_text: str) -> List[int] | None:+ """Return the Slide numbers named in design_spec §IX, or None without a §IX."""+ outline_match = re.search(+ r'^##[ \t]+IX\.[ \t]+Content Outline\b.*$',+ design_text,+ flags=re.IGNORECASE | re.MULTILINE,+ )+ if outline_match is None:+ return None+ next_section = re.search(+ r'^##[ \t]+',+ design_text[outline_match.end():],+ flags=re.MULTILINE,+ )+ outline_end = (+ outline_match.end() + next_section.start()+ if next_section+ else len(design_text)+ )+ return [+ int(match.group(1))+ for match in re.finditer(+ r'^#{3,6}[ \t]+Slide[ \t]+([0-9]+)\b',+ design_text[outline_match.end():outline_end],+ flags=re.IGNORECASE | re.MULTILINE,+ )+ ]+++def validate_outline_roster(project_path: str | Path) -> List[str]:+ """Compare the design_spec §IX Slide numbers with the svg_output/ roster.++ A revision round that inserts, drops, or renumbers a page can leave the+ outline naming a page that no SVG carries (or an SVG the outline never+ planned) while every per-file check still passes. Only a complete roster+ is comparable, so callers run this at the final gate; an empty+ ``svg_output/`` (before authoring) is not a mismatch.+ """+ root = Path(project_path)+ design_spec = next(+ (root / name for name in _DESIGN_SPEC_NAMES if (root / name).is_file()),+ None,+ )+ svg_output = root / 'svg_output'+ if design_spec is None or not svg_output.is_dir():+ return []+ svg_numbers = set()+ for svg_file in discover_slide_svgs(svg_output):+ match = re.match(r'(\d+)', svg_file.name)+ if match:+ svg_numbers.add(int(match.group(1)))+ if not svg_numbers:+ return []+ try:+ design_text = design_spec.read_text(encoding='utf-8-sig')+ except OSError as exc:+ return [f'Outline roster: unable to read {design_spec.name}: {exc}']+ outline_numbers = _outline_slide_numbers(design_text)+ if not outline_numbers:+ return []+ planned = set(outline_numbers)+ missing = sorted(planned - svg_numbers)+ extra = sorted(svg_numbers - planned)+ if not missing and not extra:+ return []+ parts = [+ f'Outline roster: {design_spec.name} §IX names {len(planned)} slide(s) '+ f'but svg_output/ holds {len(svg_numbers)};'+ ]+ if missing:+ parts.append(+ 'no SVG for Slide ' + ', '.join(f'{n:02d}' for n in missing) + ';'+ )+ if extra:+ parts.append(+ 'no §IX block for page ' + ', '.join(f'{n:02d}' for n in extra) + ';'+ )+ parts.append(+ 'renumber the outline, the lock page keys, and the sidecar together '+ 'with the pages.'+ )+ return [' '.join(parts)]++def validate_project_structure(project_path: str,verbose: bool = False,diff --git a/skills/ppt-master/scripts/svg_quality/checker.py b/skills/ppt-master/scripts/svg_quality/checker.pyindex 24701051..541f7fe0 100644--- a/skills/ppt-master/scripts/svg_quality/checker.py+++ b/skills/ppt-master/scripts/svg_quality/checker.py@@ -46,11 +46,13 @@ try:from project_utils import (CANVAS_FORMATS,validate_communication_trace,+ validate_outline_roster,)except ImportError:print("Warning: Unable to import project_utils")CANVAS_FORMATS = {}validate_communication_trace = None+ validate_outline_roster = Nonefrom svg_to_pptx.canvas_contract import (CanvasContractError,@@ -7096,6 +7098,11 @@ class SVGQualityChecker:('error', message)for message in validate_communication_trace(project_path))+ if not self.partial_roster and validate_outline_roster is not None:+ self._communication_trace_issues.extend(+ ('error', message)+ for message in validate_outline_roster(project_path)+ )return self.resultsdef _check_pptx_structure_contract(@@ -9439,7 +9446,7 @@ class SVGQualityChecker:"""Print project-level communication trace issues."""if not self._communication_trace_issues:return- print("\n[COMMUNICATION TRACE] Contract and Audience move checks")+ print("\n[COMMUNICATION TRACE] Contract, Audience move, and outline roster checks")for severity, message in self._communication_trace_issues:print(f" [{severity.upper()}] {message}")diff --git a/skills/ppt-master/scripts/tests/test_dogfood_revision_fixes.py b/skills/ppt-master/scripts/tests/test_dogfood_revision_fixes.pynew file mode 100644index 00000000..150b950c--- /dev/null+++ b/skills/ppt-master/scripts/tests/test_dogfood_revision_fixes.py@@ -0,0 +1,77 @@+#!/usr/bin/env python3+"""Regression tests for the 2026-09-12 revision-round dogfood fixes.++A revision round that inserts or drops a page can leave design_spec §IX naming+a page no SVG carries while every per-file check passes; the final gate now+compares the outline roster with svg_output/.+"""++from __future__ import annotations++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 project_utils import validate_outline_roster # noqa: E402++SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 720"></svg>\n'+++def _spec(slides: list[int]) -> str:+ blocks = "".join(+ f"#### Slide {n:02d} - Page {n}\n- **Audience move**: a → b\n"+ f"- **Relationships**: order\n"+ for n in slides+ )+ return "# Spec\n\n## VIII. Image Resource List\n\n## IX. Content Outline\n" + blocks + "\n## X. Notes\n"+++def _project(tmp: str, outline: list[int], pages: list[int]) -> Path:+ root = Path(tmp)+ (root / "design_spec.md").write_text(_spec(outline), encoding="utf-8")+ (root / "svg_output").mkdir()+ for n in pages:+ (root / "svg_output" / f"{n:02d}_page.svg").write_text(SVG, encoding="utf-8")+ return root+++class OutlineRosterTests(unittest.TestCase):+ def test_matching_roster_is_silent(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, [1, 2, 3], [1, 2, 3])+ self.assertEqual(validate_outline_roster(root), [])++ def test_missing_page_is_named(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, [1, 2, 3], [1, 2])+ errors = validate_outline_roster(root)+ self.assertEqual(len(errors), 1)+ self.assertIn("names 3 slide(s) but svg_output/ holds 2", errors[0])+ self.assertIn("no SVG for Slide 03", errors[0])++ def test_unplanned_page_is_named(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, [1, 2], [1, 2, 3])+ errors = validate_outline_roster(root)+ self.assertEqual(len(errors), 1)+ self.assertIn("no §IX block for page 03", errors[0])++ def test_empty_svg_output_before_authoring_is_silent(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, [1, 2, 3], [])+ self.assertEqual(validate_outline_roster(root), [])++ def test_spec_without_outline_is_silent(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, [1, 2], [1, 2])+ (root / "design_spec.md").write_text("# Spec\n\n## I. Goal\n", encoding="utf-8")+ self.assertEqual(validate_outline_roster(root), [])+++if __name__ == "__main__":+ unittest.main()