Skip to content

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(roundtrip): second dogfood round on two real decks

hugohe3457a75d84c6c
diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.md
index cd7cb180..c8833a43 100644
--- a/skills/ppt-master/scripts/docs/svg-pipeline.md
+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md
@@ -144,8 +144,9 @@ ordinary media may remain shared. An edited copy overlays only its edited
owners onto its cloned source page. Same-deck slide-jump links follow the
page-plan contract: a target must map to exactly one output page. An
omitted or repeated destination is an error; external links remain unchanged.
-Dropping any source slide that owns video, audio, or another opaque native
-payload also fails instead of discarding that relationship.
+Omitting a source slide deliberately drops its private video, audio, or opaque
+native payloads; a kept slide still fails if rebuilding it would discard such
+relationships.
With a plan present, presentation-level `sectionLst` and custom-show rosters
are dropped, output `p:sldId` values are renumbered, and the slide count in
`docProps/app.xml` is updated.
@@ -161,6 +162,8 @@ notes and an absent file keeps them. Deleting inherited source notes only on a
copy is not supported in v1. The same output-stem rule applies to narration
audio.
+When a round-trip recorded-narration export omits `--animation-config`, it uses the workspace `animations.json` when present and otherwise applies no sidecar while preserving source motion.
+
Narration audio is keyed by the output SVG stem. A copied output page uses its
own stem-keyed notes when present and otherwise inherits the declared source
slide's canonical notes.
diff --git a/skills/ppt-master/scripts/pptx_transitions.py b/skills/ppt-master/scripts/pptx_transitions.py
index 2850cf8a..0dcc7030 100644
--- a/skills/ppt-master/scripts/pptx_transitions.py
+++ b/skills/ppt-master/scripts/pptx_transitions.py
@@ -525,7 +525,11 @@ _TRANSITION_EFFECT_OPTIONS: dict[str, dict[str, dict[str, Any]]] = {
),
},
"push": {
- "direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
+ "direction": _attribute_enum(
+ "right",
+ "dir",
+ {**_CARDINAL_DIRECTIONS, "left": "l"},
+ ),
},
"wipe": {
"direction": _attribute_enum("right", "dir", _CARDINAL_DIRECTIONS),
diff --git a/skills/ppt-master/scripts/svg_authoring_view.py b/skills/ppt-master/scripts/svg_authoring_view.py
index 691dd847..46399057 100644
--- a/skills/ppt-master/scripts/svg_authoring_view.py
+++ b/skills/ppt-master/scripts/svg_authoring_view.py
@@ -1897,6 +1897,79 @@ def _rewrite_adopted_fragment_ids(
return replacements
+def _adopted_definition_clones(
+ source_root: ET.Element,
+ source_element: ET.Element,
+) -> list[ET.Element]:
+ """Copy the transitive source definitions referenced by one adopted object."""
+ definitions, selected_owners = _definition_closure(
+ source_root,
+ [source_element],
+ )
+ return [
+ copy.deepcopy(child)
+ for definitions_root in definitions
+ for child in definitions_root
+ if id(child) in selected_owners
+ ]
+
+
+def _append_adopted_definitions(
+ target_root: ET.Element,
+ definitions: list[ET.Element],
+) -> None:
+ if not definitions:
+ return
+ target_defs = next(
+ (
+ child
+ for child in target_root
+ if _local_name(child.tag) == "defs"
+ ),
+ None,
+ )
+ if target_defs is None:
+ target_defs = ET.Element(f"{{{SVG_NS}}}defs")
+ target_root.insert(0, target_defs)
+ target_defs.extend(definitions)
+
+
+def _authoring_source_document_ids(
+ authoring_dir: Path,
+ manifest: dict[str, object],
+ authoring_name: str,
+) -> set[str]:
+ """Return ids hidden behind source refs in one authoring document."""
+ documents = manifest.get("documents")
+ if not isinstance(documents, list):
+ return set()
+ document = next(
+ (
+ item
+ for item in documents
+ if isinstance(item, dict)
+ and item.get("authoring") == authoring_name
+ ),
+ None,
+ )
+ source_root_value = manifest.get("source_root")
+ source_name = document.get("source") if document is not None else None
+ if not isinstance(source_root_value, str) or not isinstance(source_name, str):
+ return set()
+ source_dir = (authoring_dir / source_root_value).resolve()
+ source_path = _authoring_page_path(
+ source_dir,
+ source_name,
+ label="--adopt-object target source",
+ )
+ source_root = _parse_authoring_svg(source_path)
+ return {
+ item_id
+ for item in source_root.iter()
+ if (item_id := item.get("id"))
+ }
+
+
def _strip_adopted_transport(element: ET.Element) -> tuple[set[str], int]:
stripped: set[str] = set()
removed_metadata = 0
@@ -1970,7 +2043,7 @@ def adopt_authoring_object(
authoring_dir = authoring_dir.resolve()
if not authoring_dir.is_dir():
raise ValueError(f"Authoring directory not found: {authoring_dir}")
- _load_authoring_summary_manifest(authoring_dir)
+ manifest, _, _ = _load_authoring_summary_manifest(authoring_dir)
source_name, element_id = _parse_adopt_source(source_spec)
source_path = _authoring_page_path(
authoring_dir,
@@ -2006,6 +2079,10 @@ def adopt_authoring_object(
"source proxies cannot move between pages"
)
+ adopted_definitions = _adopted_definition_clones(
+ source_root,
+ source_element,
+ )
adopted = copy.deepcopy(source_element)
adopted.tail = None
imported_icons = [
@@ -2053,10 +2130,26 @@ def adopt_authoring_object(
for item in target_root.iter()
if (item_id := item.get("id"))
}
- replacements = _rewrite_adopted_fragment_ids(adopted, target_ids)
+ target_ids.update(
+ _authoring_source_document_ids(
+ authoring_dir,
+ manifest,
+ target_name,
+ )
+ )
+ adopted_envelope = ET.Element(f"{{{SVG_NS}}}g")
+ adopted_envelope.append(adopted)
+ adopted_envelope.extend(adopted_definitions)
+ replacements = _rewrite_adopted_fragment_ids(
+ adopted_envelope,
+ target_ids,
+ )
+ adopted = adopted_envelope[0]
+ adopted_definitions = list(adopted_envelope)[1:]
adopted_id = adopted.get("id")
if not adopted_id:
raise ValueError("Adopted object lost its required id")
+ _append_adopted_definitions(target_root, adopted_definitions)
target_root.append(adopted)
original_target = target_path.read_bytes()
@@ -2082,6 +2175,7 @@ def adopt_authoring_object(
"target": target_name,
"adopted_id": adopted_id,
"renamed_ids": dict(sorted(replacements.items())),
+ "copied_definitions": len(adopted_definitions),
"inlined_imported_vectors": inlined_icons,
"stripped_attributes": sorted(stripped),
"removed_native_metadata": removed_metadata,
diff --git a/skills/ppt-master/scripts/svg_quality/checker.py b/skills/ppt-master/scripts/svg_quality/checker.py
index 4567ed3d..54d94f0b 100644
--- a/skills/ppt-master/scripts/svg_quality/checker.py
+++ b/skills/ppt-master/scripts/svg_quality/checker.py
@@ -388,6 +388,7 @@ _BOUNDS_ATTR = 'data-pptx-bounds'
_MORPH_STAGING_ATTR = 'data-pptx-morph-staging'
_BOUNDS_OVERFLOW_TOLERANCE = 1.0
_BOUNDS_OVERFLOW_ERROR_RATIO = 0.05
+_ROUNDTRIP_TEXT_CALIBRATION_CAP = 0.10
_PARAGRAPH_LINE_GAP_MIN_RATIO = 0.9
_PARAGRAPH_LINE_GAP_MAX_RATIO = 2.05
_PARAGRAPH_LINE_X_TOLERANCE = 0.5
@@ -1541,12 +1542,14 @@ class SVGQualityChecker:
root = self._parse_xml_root(content, result)
if root is not None:
self._check_viewbox(root, svg_path, result, None)
- included_text_ids = self._roundtrip_edited_text_ids(
- root,
- source_document,
- baseline_root,
- current_assets,
- baseline_assets,
+ included_text_ids, unchanged_text_ids = (
+ self._roundtrip_text_diff_ids(
+ root,
+ source_document,
+ baseline_root,
+ current_assets,
+ baseline_assets,
+ )
)
result['info']['edited_text_elements'] = len(included_text_ids)
if included_text_ids:
@@ -1577,11 +1580,12 @@ class SVGQualityChecker:
result,
included_text_ids=included_text_ids,
)
- self._check_roundtrip_text_frames(
- root,
- result,
- included_text_ids,
- )
+ self._check_roundtrip_text_frames(
+ root,
+ result,
+ included_text_ids,
+ unchanged_text_ids,
+ )
result['passed'] = len(result['errors']) == 0
except Exception as exc:
result['errors'].append(f"Failed to read file: {exc}")
@@ -1589,14 +1593,14 @@ class SVGQualityChecker:
return self._record_result(result)
@staticmethod
- def _roundtrip_edited_text_ids(
+ def _roundtrip_text_diff_ids(
root: ET.Element,
source_document,
baseline_root: ET.Element,
current_assets,
baseline_assets,
- ) -> set[int]:
- """Return text carriers outside unchanged refs and source proxies."""
+ ) -> tuple[set[int], set[int]]:
+ """Return edited and hash-unchanged source text carrier identities."""
from authoring_roundtrip import (
_definition_changes,
authoring_source_ref_is_unchanged,
@@ -1630,6 +1634,7 @@ class SVGQualityChecker:
}
unchanged_by_owner: Dict[int, bool] = {}
included: set[int] = set()
+ unchanged_text: set[int] = set()
for text_element in root.iter(f'{{{SVG_NS}}}text'):
current: ET.Element | None = text_element
source_owner: ET.Element | None = None
@@ -1670,8 +1675,27 @@ class SVGQualityChecker:
)
unchanged_by_owner[owner_key] = unchanged
if unchanged:
+ unchanged_text.add(id(text_element))
continue
included.add(id(text_element))
+ return included, unchanged_text
+
+ @staticmethod
+ def _roundtrip_edited_text_ids(
+ root: ET.Element,
+ source_document,
+ baseline_root: ET.Element,
+ current_assets,
+ baseline_assets,
+ ) -> set[int]:
+ """Return edited text carrier identities for compatibility callers."""
+ included, _unchanged = SVGQualityChecker._roundtrip_text_diff_ids(
+ root,
+ source_document,
+ baseline_root,
+ current_assets,
+ baseline_assets,
+ )
return included
@staticmethod
@@ -1858,8 +1882,9 @@ class SVGQualityChecker:
root: ET.Element,
result: Dict,
included_text_ids: set[int],
+ unchanged_text_ids: set[int],
) -> None:
- """Report edited text whose estimated width leaves its owning frame."""
+ """Calibrate source text widths, then check edited owning frames."""
helpers = (
_estimate_single_line_text_frame_width,
_parse_project_font_weight,
@@ -1887,6 +1912,59 @@ class SVGQualityChecker:
for parent in root.iter()
for child in list(parent)
}
+ measured_unchanged = 0
+ positive_overflow_ratios: List[float] = []
+ for text_element in root.iter(f'{{{SVG_NS}}}text'):
+ if id(text_element) not in unchanged_text_ids:
+ continue
+ if self._has_non_visual_ancestor(
+ text_element,
+ root,
+ parent_by_id,
+ ):
+ continue
+ if (
+ self._is_hidden_element(text_element, parent_by_id)
+ or self._has_zero_opacity(text_element, parent_by_id)
+ ):
+ continue
+ visible_text = ''.join(text_element.itertext())
+ if (
+ not visible_text.strip()
+ or ('{{' in visible_text and '}}' in visible_text)
+ ):
+ continue
+ estimated = self._estimated_text_bounds(
+ text_element,
+ parent_by_id,
+ font_sizes,
+ letter_spacings,
+ include_headroom=True,
+ )
+ if estimated is None:
+ continue
+ _frame_label, frame, _frame_error, frame_is_inferred = (
+ self._roundtrip_text_frame(
+ text_element,
+ parent_by_id,
+ )
+ )
+ if frame is None or frame_is_inferred:
+ continue
+ measured_unchanged += 1
+ metrics = self._bounds_overflow_metrics(estimated, frame)
+ if metrics is not None and metrics[1] > 0:
+ positive_overflow_ratios.append(metrics[1])
+
+ calibration = min(
+ max(positive_overflow_ratios, default=0.0),
+ _ROUNDTRIP_TEXT_CALIBRATION_CAP,
+ )
+ result['info']['roundtrip_text_calibration'] = {
+ 'factor': calibration,
+ 'measured_unchanged': measured_unchanged,
+ 'positive_unchanged': len(positive_overflow_ratios),
+ }
for text_element in root.iter(f'{{{SVG_NS}}}text'):
if id(text_element) not in included_text_ids:
continue
@@ -1935,14 +2013,27 @@ class SVGQualityChecker:
if metrics is None or metrics[1] <= 0:
continue
_axes, horizontal_ratio, _vertical_ratio = metrics
+ corrected_horizontal_ratio = max(
+ horizontal_ratio - calibration,
+ 0.0,
+ )
+ if corrected_horizontal_ratio <= 0:
+ continue
left, top, right, bottom = estimated
frame_left, frame_top, frame_right, frame_bottom = frame
+ overflow_detail = (
+ f'overflow horizontal {corrected_horizontal_ratio:.1%} after '
+ f'{calibration:.1%} same-page source calibration '
+ f'(raw {horizontal_ratio:.1%})'
+ if calibration > 0
+ else f'overflow horizontal {horizontal_ratio:.1%}'
+ )
finding = (
f'{text_label} exceeds owning frame {frame_label} on the '
f'horizontal axis: estimated text ({left:.1f}, {top:.1f})-'
f'({right:.1f}, {bottom:.1f}), frame ({frame_left:.1f}, '
f'{frame_top:.1f})-({frame_right:.1f}, {frame_bottom:.1f}), '
- f'overflow horizontal {horizontal_ratio:.1%}; shorten or '
+ f'{overflow_detail}; shorten or '
'reflow the edited text, or '
'enlarge its owning frame'
)
@@ -8284,6 +8375,22 @@ class SVGQualityChecker:
info_items = []
if 'viewbox' in result['info']:
info_items.append(f"viewBox: {result['info']['viewbox']}")
+ calibration = result['info'].get(
+ 'roundtrip_text_calibration'
+ )
+ if isinstance(calibration, dict):
+ factor = calibration.get('factor')
+ measured = calibration.get('measured_unchanged')
+ positive = calibration.get('positive_unchanged')
+ if (
+ isinstance(factor, (int, float))
+ and isinstance(measured, int)
+ and isinstance(positive, int)
+ ):
+ info_items.append(
+ f'text calibration: {factor:.1%} '
+ f'({positive}/{measured} unchanged source texts)'
+ )
if info_items:
print(f" {' | '.join(info_items)}")
diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
index 07726cda..b1abf436 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
@@ -9,6 +9,7 @@ import copy
import hashlib
import json
import math
+import posixpath
import re
import shutil
import sys
@@ -17,6 +18,7 @@ import zipfile
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
+from urllib.parse import unquote
from xml.etree import ElementTree as ET
_SCRIPTS_DIR = Path(__file__).resolve().parents[1]
@@ -127,6 +129,7 @@ from .template_structure import (
from ..animation_config import (
animation_group_effect_entries,
load_animation_config,
+ resolve_slide_animation_config,
validate_animation_config,
validate_animation_config_errors,
validate_transition_config,
@@ -494,6 +497,10 @@ def _roundtrip_slide_patches(
animation_config,
pages,
)
+ animation_defaults = _as_dict(animation_config.get("defaults"))
+ default_transition_config = _as_dict(
+ animation_defaults.get("transition")
+ )
documents = authoring_report.get("documents")
if not isinstance(documents, list):
@@ -538,19 +545,26 @@ def _roundtrip_slide_patches(
)
!= expected_animation
)
- motion_changed = force_motion_changed or sidecar_changed
slide_config = _as_dict(
_as_dict(animation_config.get("slides")).get(page.svg_stem)
)
+ slide_transition_config = _as_dict(slide_config.get("transition"))
+ effective_transition_config = resolve_slide_animation_config(
+ default_transition_config,
+ slide_transition_config,
+ )
+ sidecar_transition_applies = (
+ bool(default_transition_config)
+ or "transition" in slide_config
+ )
transition_changed = force_transition_changed or (
- sidecar_changed and "transition" in slide_config
+ sidecar_changed and sidecar_transition_applies
)
- slide_transition_config = _as_dict(slide_config.get("transition"))
transition_replaced = force_transition_replaced or (
sidecar_changed
- and "transition" in slide_config
+ and sidecar_transition_applies
and any(
- key in slide_transition_config
+ key in effective_transition_config
for key in ("effect", "effect_options", "duration", "sound")
)
)
@@ -558,6 +572,11 @@ def _roundtrip_slide_patches(
sidecar_changed
and any(key in slide_config for key in ("animation", "groups"))
)
+ motion_changed = (
+ force_motion_changed
+ or transition_changed
+ or animation_changed
+ )
def _ref_set(field: str) -> frozenset[str]:
value = raw.get(field)
@@ -652,6 +671,152 @@ def _opaque_roundtrip_slide_dependencies(
}
+def _opaque_roundtrip_dependency_owner_refs(
+ project_path: Path,
+ dependencies: dict[int, list[str]],
+) -> dict[int, dict[str, frozenset[str]]]:
+ """Map opaque resource paths to owning Slide-local source refs."""
+ manifest = load_roundtrip_manifest(project_path)
+ if manifest is None:
+ return {}
+ raw_slides = manifest.get("slides")
+ resources = manifest.get("resources")
+ items = resources.get("items") if isinstance(resources, dict) else None
+ if not isinstance(raw_slides, list) or not isinstance(items, list):
+ return {}
+ slide_rows = {
+ int(row["index"]): row
+ for row in raw_slides
+ if isinstance(row, dict) and isinstance(row.get("index"), int)
+ }
+ package_parts: dict[int, dict[str, str]] = {}
+ for item in items:
+ if not isinstance(item, dict):
+ continue
+ workspace_path = item.get("workspacePath")
+ package_part = item.get("packagePart")
+ if not isinstance(workspace_path, str) or not isinstance(
+ package_part,
+ str,
+ ):
+ continue
+ for index in _resource_slide_indices(
+ item,
+ slide_rows,
+ include_structure=False,
+ ):
+ if workspace_path in dependencies.get(index, ()):
+ package_parts.setdefault(index, {})[workspace_path] = (
+ package_part
+ )
+
+ relationship_namespace = (
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+ )
+ presentation_namespace = (
+ "http://schemas.openxmlformats.org/presentationml/2006/main"
+ )
+ shape_tags = {
+ f"{{{presentation_namespace}}}{name}"
+ for name in ("cxnSp", "graphicFrame", "grpSp", "pic", "sp")
+ }
+ owner_paths: dict[int, dict[str, set[str]]] = {}
+ source_path = source_pptx_path(project_path)
+ try:
+ with zipfile.ZipFile(source_path) as archive:
+ names = set(archive.namelist())
+ for index, paths_by_package_part in package_parts.items():
+ row = slide_rows.get(index)
+ source_part = row.get("sourcePart") if row else None
+ if not isinstance(source_part, str):
+ continue
+ rels_part = posixpath.join(
+ posixpath.dirname(source_part),
+ "_rels",
+ posixpath.basename(source_part) + ".rels",
+ )
+ if source_part not in names or rels_part not in names:
+ continue
+ rels_root = ET.fromstring(archive.read(rels_part))
+ paths_by_relationship: dict[str, set[str]] = {}
+ for relationship in rels_root:
+ relationship_id = relationship.get("Id")
+ target = relationship.get("Target")
+ if (
+ not relationship_id
+ or not target
+ or relationship.get("TargetMode") == "External"
+ ):
+ continue
+ target_part = posixpath.normpath(posixpath.join(
+ posixpath.dirname(source_part),
+ unquote(target),
+ ))
+ for workspace_path, package_part in (
+ paths_by_package_part.items()
+ ):
+ if target_part == package_part:
+ paths_by_relationship.setdefault(
+ relationship_id,
+ set(),
+ ).add(workspace_path)
+ if not paths_by_relationship:
+ continue
+ slide_root = ET.fromstring(archive.read(source_part))
+ parent_by_id = {
+ id(child): parent
+ for parent in slide_root.iter()
+ for child in list(parent)
+ }
+ for element in slide_root.iter():
+ relationship_ids = {
+ value
+ for name, value in element.attrib.items()
+ if name.startswith(f"{{{relationship_namespace}}}")
+ and value in paths_by_relationship
+ }
+ if not relationship_ids:
+ continue
+ current: ET.Element | None = element
+ while current is not None:
+ if current.tag in shape_tags:
+ non_visual = next(
+ (
+ candidate
+ for candidate in current.iter()
+ if candidate.tag
+ == f"{{{presentation_namespace}}}cNvPr"
+ ),
+ None,
+ )
+ shape_id = (
+ non_visual.get("id")
+ if non_visual is not None
+ else None
+ )
+ if shape_id:
+ source_ref = f"slide:{shape_id}"
+ for relationship_id in relationship_ids:
+ owner_paths.setdefault(index, {}).setdefault(
+ source_ref,
+ set(),
+ ).update(
+ paths_by_relationship[relationship_id]
+ )
+ current = parent_by_id.get(id(current))
+ except (ET.ParseError, KeyError, OSError, zipfile.BadZipFile) as exc:
+ raise RuntimeError(
+ f"Cannot resolve opaque round-trip resource owners: {exc}"
+ ) from exc
+ return {
+ index: {
+ source_ref: frozenset(paths)
+ for source_ref, paths in refs.items()
+ }
+ for index, refs in owner_paths.items()
+ }
+
+
_PPTX_STRUCTURE_SECTION_RE = re.compile(
r"(?ms)^##[ \t]+pptx_structure[ \t]*\r?\n(.*?)(?=^##[ \t]+|\Z)"
)
@@ -1549,11 +1714,19 @@ def _resolve_animation_config_source(
*,
recorded_narration: bool,
no_animations: bool,
+ roundtrip: bool,
) -> str | None:
"""Resolve the animation sidecar selected for this export."""
if requested_config is not None or not recorded_narration or no_animations:
return requested_config
+ if roundtrip:
+ return (
+ 'animations.json'
+ if (project_path / 'animations.json').is_file()
+ else None
+ )
+
canonical_exists = (project_path / 'animations.json').is_file()
narration_exists = (project_path / 'narration_animations.json').is_file()
if canonical_exists or narration_exists:
@@ -2461,6 +2634,17 @@ Recorded narration:
'slides': sorted(roundtrip_passthrough_slides),
}
if args.roundtrip:
+ roundtrip_external_animation_config = False
+ if args.animation_config is not None:
+ requested_animation_config = Path(args.animation_config)
+ if not requested_animation_config.is_absolute():
+ requested_animation_config = (
+ project_path / requested_animation_config
+ )
+ roundtrip_external_animation_config = (
+ requested_animation_config.resolve()
+ != (project_path / 'animations.json').resolve()
+ )
roundtrip_motion_overridden = any((
args.no_animations,
args.transition is not None,
@@ -2498,7 +2682,7 @@ Recorded narration:
args.animation_duration is not None,
args.animation_stagger is not None,
args.animation_trigger is not None,
- args.animation_config is not None,
+ roundtrip_external_animation_config,
args.inherit_motion_from is not None,
))
try:
@@ -2524,32 +2708,50 @@ Recorded narration:
opaque_dependencies = _opaque_roundtrip_slide_dependencies(
project_path.resolve()
)
+ opaque_dependency_refs = (
+ _opaque_roundtrip_dependency_owner_refs(
+ project_path.resolve(),
+ opaque_dependencies,
+ )
+ )
except RuntimeError as exc:
print(f"Error: {exc}", file=sys.stderr)
return 1
- blocked_dependencies = {
- page.output_index: (
- page.source_slide,
- opaque_dependencies[page.source_slide],
- )
- for page in roundtrip_pages
- if page.source_slide in opaque_dependencies
- and page.output_index not in roundtrip_passthrough_slides
- and page.output_index not in roundtrip_slide_patches
- }
- omitted_opaque_dependencies = (
- {
- source_slide: paths
- for source_slide, paths in opaque_dependencies.items()
- if source_slide not in {
- page.source_slide
- for page in roundtrip_pages
- }
+ blocked_dependencies: dict[int, tuple[int, list[str]]] = {}
+ for page in roundtrip_pages:
+ dependencies = opaque_dependencies.get(page.source_slide)
+ if (
+ not dependencies
+ or page.output_index in roundtrip_passthrough_slides
+ ):
+ continue
+ patch = roundtrip_slide_patches.get(page.output_index)
+ if patch is None:
+ blocked_dependencies[page.output_index] = (
+ page.source_slide,
+ dependencies,
+ )
+ continue
+ owner_refs = opaque_dependency_refs.get(page.source_slide, {})
+ affected_refs = patch.edited_ref_ids | patch.deleted_ref_ids
+ affected_paths = {
+ path
+ for source_ref in affected_refs
+ for path in owner_refs.get(source_ref, ())
}
- if roundtrip_page_plan_present
- else {}
- )
- if blocked_dependencies or omitted_opaque_dependencies:
+ mapped_paths = {
+ path
+ for paths in owner_refs.values()
+ for path in paths
+ }
+ if patch.visual_changed:
+ affected_paths.update(set(dependencies) - mapped_paths)
+ if affected_paths:
+ blocked_dependencies[page.output_index] = (
+ page.source_slide,
+ sorted(affected_paths),
+ )
+ if blocked_dependencies:
print(
"Error: round-trip page export would drop source video, audio, "
"or opaque native payload relationships:",
@@ -2563,14 +2765,6 @@ Recorded narration:
+ ", ".join(paths),
file=sys.stderr,
)
- for source_slide, paths in sorted(
- omitted_opaque_dependencies.items()
- ):
- print(
- f" omitted source slide {source_slide}: "
- + ", ".join(paths),
- file=sys.stderr,
- )
print(
"Keep each listed source slide in page_plan.json, or remove the "
"opaque relationship from the source deck before importing.",
@@ -2876,6 +3070,7 @@ Recorded narration:
args.animation_config,
recorded_narration=bool(args.recorded_narration),
no_animations=args.no_animations,
+ roundtrip=args.roundtrip,
)
if effective_animation_config:
diff --git a/skills/ppt-master/workflows/edit-native-pptx.md b/skills/ppt-master/workflows/edit-native-pptx.md
index eaf8d195..03b58d21 100644
--- a/skills/ppt-master/workflows/edit-native-pptx.md
+++ b/skills/ppt-master/workflows/edit-native-pptx.md
@@ -201,7 +201,7 @@ Skip this section when no module in §4.2 is enabled beyond preserving source no
**Hard rule — spoken prose only**: `svg_to_pptx.py` embeds each note verbatim and `notes_to_audio.py` reads it aloud verbatim, so a heading, bullet, `[tag]`, or duration line is spoken and shown. Write 2–5 natural sentences per content page, one or two for cover / chapter / ending, transitions as prose, one language per deck. Source the content from the page's SVG text or the §3 read-back plus the user material; a note never adds a claim the page or material does not carry.
-**Narration audio**: Run [`generate-audio`](./stages/generate-audio.md) Steps 1–4 with the workspace path after notes are complete. `notes_to_audio.py` resolves the roster from `page_plan.json` (copies inherit source notes) and refuses an incomplete roster, listing the missing stems. Audio lands at `audio/<stem>.*` per output page. Stop after audio generation; §7 integrates it.
+**Narration audio**: Run [`generate-audio`](./stages/generate-audio.md) Steps 1–4 with the workspace path after notes are complete (`notes_to_audio.py "<workspace>" --provider <p> --voice <v> --rate <r>`); the source deck's own media in `audio/` (imported files not named after a page) is left alone. `notes_to_audio.py` resolves the roster from `page_plan.json` (copies inherit source notes) and refuses an incomplete roster, listing the missing stems. Audio lands at `audio/<stem>.*` per output page. Stop after audio generation; §7 integrates it.
**Motion**: Load [`animations.md`](../references/animations.md) when transitions or object animations are requested. `animations.json` rows are keyed by output SVG stem; a copied page inherits its source row unless it has its own.
@@ -218,7 +218,7 @@ python3 skills/ppt-master/scripts/svg_to_pptx.py "projects/<slug>_<YYYYMMDD>" --
| Request | Add |
|---|---|
| Replace transitions deck-wide | `-t <effect> [--transition-duration <s>]` |
-| Narration with auto-advance | `--recorded-narration audio --use-narration-timings` |
+| Narration with auto-advance | `--recorded-narration audio --use-narration-timings` (round-trip export reads the workspace `animations.json` by default) |
| Per-slide motion | `--animation-config animations.json` |
| Object animation policy | `-a <preset>` (default `none`) |
| Strip all notes | `--no-notes` |