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
feat(create-template): compact native SVG metadata
hugohe3240b862a6570
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex 74ef037c..2c69908e 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -728,6 +728,8 @@ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path># Output (default-flow mode):# exports/<project_name>_<timestamp>.pptx ← native pptx (canonical output, reads svg_output/)# backup/<timestamp>/svg_output/ ← Executor SVG source backup (always written)+# backup/<timestamp>/templates/native_payloads.json.gz+# ← copied when compact native metadata refs are used# Add --native-charts-and-tables to replace marked fallbacks with PowerPoint-native Chart/Table objects:# exports/<project_name>_<timestamp>_native_charts_tables.pptx ← native Chart/Table replacements (data-pptx-replace-with markers)# Re-export with --recorded-narration audio (generate-audio stage) embeds per-slide narration:@@ -747,7 +749,10 @@ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>> `--image-sizing display --image-scale 2` only for aggressive size reduction.> The `svg_output/`> snapshot in `backup/<timestamp>/` is always written so the project can be-> re-exported from frozen SVG sources without re-running the LLM. The SVG-rendered+> re-exported from frozen SVG sources without re-running the LLM. When those+> SVGs reference compact native template metadata, the matching+> `templates/native_payloads.json.gz` sidecar is copied into the same backup+> timestamp. The SVG-rendered> preview remains the mandatory `svg_final/` artifact from Step 7.2; it is not> packaged as a second PPTX. Use the default source selection for release> exports. `-s final` is diagnostic-onlydiff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.mdindex 2bc4412e..cc36fb87 100644--- a/skills/ppt-master/references/shared-standards.md+++ b/skills/ppt-master/references/shared-standards.md@@ -280,11 +280,23 @@ attributes, and no separate source-payload opt-in marker exists.| `data-pptx-part="geometry"` | One hidden carrier path | The single native export authority for frame, base fill/line/effect, preset/custom geometry, and object identity. || `data-pptx-part="geometry-preview"` / `geometry-detail` | Visible preview group/paths | Render the preset's independent path fill/stroke layers. A hash-locked preview group may mirror the carrier's one filter so a multi-path preset renders one aggregate imported effect; these elements are never emitted as duplicate PowerPoint shapes. || `data-pptx-preview-sha256` | Logical preset `<g>` and carrier | Detect edits to visible preset paths or paint. A stale preview fails quality check/export instead of silently reusing old native metadata. |-| `data-pptx-geometry-kind="custom"` + `data-pptx-custgeom` | Custom-geometry carrier | Preserve the validated original `a:custGeom` subtree. If the visible path hash is unchanged, export writes formulas, handles, connection sites, text rectangle, and path list exactly; edited paths compile from current SVG geometry. |+| `data-pptx-geometry-kind="custom"` + `data-pptx-custgeom` or `data-pptx-custgeom-ref` | Custom-geometry carrier | Preserve the validated original `a:custGeom` subtree. If the visible path hash is unchanged, export writes formulas, handles, connection sites, text rectangle, and path list exactly; edited paths compile from current SVG geometry. || `data-pptx-start/end-shape-id/site` | Connector logical `<g>` and carrier | Restore `a:stCxn` / `a:endCxn` after scoped shape-id allocation. A connector may retain one zero frame axis; it must not be expanded from visible stroke or marker bounds. |-| `data-pptx-shape-style` | Native carrier | Preserve a relationship-free `p:style` independently of text, including shapes with no visible text. |+| `data-pptx-shape-style` or `data-pptx-shape-style-ref` | Native carrier | Preserve a relationship-free `p:style` independently of text, including shapes with no visible text. || `data-pptx-effect-status="unsupported"` + `data-pptx-effect-reason` | Imported `p:sp` / `p:cxnSp` logical object and native carrier; imported `p:pic` carrier and logical object; imported `p:grpSp` logical group; imported table `p:graphicFrame` logical group | Record why an encountered source object or text-run `effectLst` / `effectDag` cannot enter the registered target-specific effect mapping without changing semantics. Checker and export stop with the recorded reason; these attributes are diagnostics, not a preserved effect payload or authoring syntax. |-| `metadata[data-pptx-part="txbody"]` | Logical shape `<g>` | Preserve unchanged `p:txBody`, including an empty text body. Content, whitespace, positioning, visible typography, or incompatible child-topology edits invalidate the payload. A source payload with run-level effects then blocks checker/export instead of losing those effects; an effect-free payload uses the normal SVG text fallback. |+| `metadata[data-pptx-part="txbody"]` with inline Base64 or `data-pptx-ref` | Logical shape `<g>` | Preserve unchanged `p:txBody`, including an empty text body. Content, whitespace, positioning, visible typography, or incompatible child-topology edits invalidate the payload. A source payload with run-level effects then blocks checker/export instead of losing those effects; an effect-free payload uses the normal SVG text fallback. |++**Hard rule — compact native metadata transport**: Type A mirror+materialization moves `p:txBody`, relationship-free `p:style`, and+`a:custGeom` payloads into the content-addressed+`templates/native_payloads.json.gz` store. It also deduplicates repeated native+restoration fields—object identity, frame, preset/custom-geometry guards,+preview/text hashes, connector endpoints, payload references, and adjustment+formulas—into short `data-pptx-native-ref` records in the same store. Checker,+template-structure validation, and export validate and hydrate both layers in+memory. Keep Master/Layout, placeholder, layer, editable-object, diagnostic,+and editable chart/table metadata inline. Legacy inline Base64 and v1+payload-only stores remain readable.One effect reason remains its existing plain token. If one imported object hasmultiple independent unsupported reasons, both marker copies store the samediff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.mdindex 15bbf04f..00c10cd9 100644--- a/skills/ppt-master/scripts/README.md+++ b/skills/ppt-master/scripts/README.md@@ -113,8 +113,13 @@ inventory, then publishes a complete structured template roster atomically.Unchanged supported Slide-local/slot refs may recover native payload; editedrefs keep their current SVG fallback. Fixed Master/Layout wrappers are expandedmechanically into direct atoms, source visibility flags become canonical root-metadata, and imported vectors are copied once to `icons/imported/`. Bitmap-assets go to `images/`; other referenced source assets go to+metadata, and imported vectors are copied once to `icons/imported/`. Large+opaque `txBody`, shape-style, and custom-geometry payloads are deduplicated into+`templates/native_payloads.json.gz`; repeated native restoration attributes+are stored there as short `data-pptx-native-ref` records. Structural metadata+stays inline, while checker, template-structure validation, and export hydrate+both layers in memory. Legacy inline payload and v1 payload-only stores remain+readable. Bitmap assets go to `images/`; other referenced source assets go to`templates/assets/`. The destination must be empty, and the command does notwrite `templates/design_spec.md`; Template_Designer owns that authored brief.diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.mdindex 02f596f3..836879d2 100644--- a/skills/ppt-master/scripts/docs/svg-pipeline.md+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md@@ -105,7 +105,13 @@ Materialization preserves source page order and emits one definition-onlyIt mechanically expands fixed Master/Layout group wrappers into direct atoms,rehydrates only unchanged converter-supported Slide-local/slot refs, keeps thecurrent SVG fallback for edited refs, preserves explicit text hard breaks, and-removes every IR-only source ref. Source `p:sldLayout@showMasterSp` and+removes every IR-only source ref. Supported opaque `p:txBody`,+relationship-free `p:style`, and `a:custGeom` payloads are deduplicated into+`templates/native_payloads.json.gz`. Repeated native restoration attributes+are stored there as short `data-pptx-native-ref` records; page and+imported-vector SVGs retain only those record ids and content-hash payload+references. Structural Master/Layout, placeholder, layer, and editable-object+fields remain inline. Source `p:sldLayout@showMasterSp` and`p:sld@showMasterSp` facts become canonical root`data-pptx-show-master-shapes` and`data-pptx-show-inherited-shapes` booleans. An imported text placeholder keeps@@ -113,9 +119,13 @@ its authoritative native frame on the `<text data-pptx-frame>` carrier so theSlide-local frame can differ from the reusable Layout bounds without collapsingto glyph bounds.+Checker, template-structure validation, and export hydrate both store layers in+memory; legacy inline payload and v1 payload-only stores remain readable.+The output routes reusable vectors once to `icons/imported/`, bitmaps to`images/`, and other referenced files to `templates/assets/`. The JSON report-is written to stdout only. The command intentionally does not create+reports payload occurrence, native-record, unique-byte, and compressed-store+counts and is written to stdout only. The command intentionally does not create`templates/design_spec.md`; Template_Designer writes that personality and pageroster after materialization. This compiler is for Type A mirror materialization,not `standard` / `fidelity`, loose Type B SVGs, ordinary generation, finalize,diff --git a/skills/ppt-master/scripts/mirror_template_materialize.py b/skills/ppt-master/scripts/mirror_template_materialize.pyindex 1856a331..33514a9b 100644--- a/skills/ppt-master/scripts/mirror_template_materialize.py+++ b/skills/ppt-master/scripts/mirror_template_materialize.py@@ -34,6 +34,17 @@ from urllib.parse import unquote, urlsplit, urlunsplitfrom xml.etree import ElementTree as ETfrom console_encoding import configure_utf8_stdio+from native_payloads import (+ PAYLOAD_STORE_RELATIVE_PATH,+ NativePayloadError,+ NativePayloadStats,+ build_native_attribute_records,+ collect_native_attribute_record_keys,+ externalize_native_attribute_records,+ externalize_native_payloads,+ hydrate_native_payload_refs,+ serialize_native_payload_store,+)from pptx_shapes import svg_preset_preview_fingerprintfrom svg_authoring_view import (AUTHORING_MANIFEST_NAME,@@ -2483,6 +2494,9 @@ def materialize_mirror_template(asset_sources: dict[Path, Path] = {}files: list[MaterializedFile] = []+ output_roots: list[tuple[Path, ET.Element]] = []+ native_payloads: dict[str, bytes] = {}+ native_payload_stats = NativePayloadStats()for relative_path, root in materialized_roots:final_path = template_workspace / relative_path_rewrite_packaged_assets(@@ -2494,7 +2508,15 @@ def materialize_mirror_template()total_stats.detached_connector_endpoints += _sanitize_connector_references(root)_refresh_preset_preview_hashes(root)- files.append(MaterializedFile(relative_path, _serialize_svg(root)))+ try:+ native_payload_stats.merge(+ externalize_native_payloads(root, native_payloads)+ )+ except NativePayloadError as exc:+ raise MirrorMaterializationError(+ f"Cannot externalize native payloads in {relative_path}: {exc}"+ ) from exc+ output_roots.append((relative_path, root))for icon in sorted(referenced_icons):record = vector_assets[icon]@@ -2516,10 +2538,53 @@ def materialize_mirror_template(icon_root)_refresh_preset_preview_hashes(icon_root)- files.append(MaterializedFile(relative_path, _serialize_svg(icon_root)))+ try:+ native_payload_stats.merge(+ externalize_native_payloads(icon_root, native_payloads)+ )+ except NativePayloadError as exc:+ raise MirrorMaterializationError(+ f"Cannot externalize native payloads in {relative_path}: {exc}"+ ) from exc+ output_roots.append((relative_path, icon_root))++ native_record_keys: set[str] = set()+ try:+ for _relative_path, root in output_roots:+ native_record_keys.update(+ collect_native_attribute_record_keys(root)+ )+ native_record_ids, native_records = build_native_attribute_records(+ native_record_keys+ )+ for _relative_path, root in output_roots:+ native_payload_stats.merge(+ externalize_native_attribute_records(root, native_record_ids)+ )+ except NativePayloadError as exc:+ raise MirrorMaterializationError(+ f"Cannot externalize native attribute records: {exc}"+ ) from exc++ for relative_path, root in output_roots:+ files.append(MaterializedFile(relative_path, _serialize_svg(root)))for relative_target, source in sorted(asset_sources.items()):files.append(MaterializedFile(relative_target, source.read_bytes()))+ payload_store: bytes | None = None+ if native_payloads or native_records:+ try:+ payload_store = serialize_native_payload_store(+ native_payloads,+ native_records,+ )+ except NativePayloadError as exc:+ raise MirrorMaterializationError(+ f"Cannot serialize native payload store: {exc}"+ ) from exc+ files.append(+ MaterializedFile(PAYLOAD_STORE_RELATIVE_PATH, payload_store)+ )relative_files = [item.relative_path for item in files]if len(relative_files) != len(set(relative_files)):raise MirrorMaterializationError("Materializer produced duplicate output paths")@@ -2548,7 +2613,15 @@ def materialize_mirror_template() from excfor relative in relative_files:if relative.suffix.lower() == ".svg":- _ensure_no_source_refs(staged_root / relative)+ staged_svg = staged_root / relative+ try:+ hydrate_native_payload_refs(_parse_svg(staged_svg), staged_svg)+ except NativePayloadError as exc:+ raise MirrorMaterializationError(+ f"Materialized native payload reference is invalid: "+ f"{relative}: {exc}"+ ) from exc+ _ensure_no_source_refs(staged_svg)_publish_files(template_workspace,staged_root,@@ -2568,6 +2641,18 @@ def materialize_mirror_template("imported_vector_count": len(referenced_icons),"packaged_asset_count": len(asset_sources),"restoration": total_stats.as_dict(),+ "native_payloads": {+ **native_payload_stats.as_dict(),+ "unique_count": len(native_payloads),+ "unique_record_count": len(native_records),+ "unique_raw_bytes": sum(len(payload) for payload in native_payloads.values()),+ "store_bytes": len(payload_store or b""),+ "store_path": (+ PAYLOAD_STORE_RELATIVE_PATH.as_posix()+ if payload_store is not None+ else None+ ),+ },"files": [item.relative_path.as_posix()for item in sorted(files, key=lambda item: item.relative_path.as_posix())diff --git a/skills/ppt-master/scripts/native_payloads.py b/skills/ppt-master/scripts/native_payloads.pynew file mode 100644index 00000000..a68c94f7--- /dev/null+++ b/skills/ppt-master/scripts/native_payloads.py@@ -0,0 +1,655 @@+#!/usr/bin/env python3+"""+PPT Master - Native SVG Metadata Store++Deduplicate opaque PowerPoint-native payloads and repeated restoration+attributes into one deterministic gzip-compressed workspace store, then+hydrate legacy inline metadata on demand.++Usage:+ Imported by mirror materialization, SVG validation, and SVG-to-PPTX export.++Examples:+ from native_payloads import hydrate_native_payload_refs++Dependencies:+ None (standard library only).+"""++from __future__ import annotations++import base64+import binascii+import gzip+import hashlib+import json+import re+from dataclasses import dataclass+from pathlib import Path, PurePosixPath+from xml.etree import ElementTree as ET+++LEGACY_PAYLOAD_STORE_SCHEMA = "ppt-master.native-payload-store.v1"+PAYLOAD_STORE_SCHEMA = "ppt-master.native-payload-store.v2"+PAYLOAD_STORE_FILENAME = "native_payloads.json.gz"+PAYLOAD_STORE_RELATIVE_PATH = Path("templates") / PAYLOAD_STORE_FILENAME+PAYLOAD_STORE_REFERENCE_PREFIX = (+ f"project:{PAYLOAD_STORE_RELATIVE_PATH.as_posix()}#sha256:"+)++NATIVE_RECORD_REF_ATTRIBUTE = "data-pptx-native-ref"+TXBODY_REF_ATTRIBUTE = "data-pptx-ref"+SHAPE_STYLE_ATTRIBUTE = "data-pptx-shape-style"+SHAPE_STYLE_REF_ATTRIBUTE = "data-pptx-shape-style-ref"+CUSTOM_GEOMETRY_ATTRIBUTE = "data-pptx-custgeom"+CUSTOM_GEOMETRY_REF_ATTRIBUTE = "data-pptx-custgeom-ref"++_SHA256_RE = re.compile(r"[0-9a-f]{64}")+_NATIVE_RECORD_ID_RE = re.compile(r"r(?:0|[1-9][0-9]*)")+_NATIVE_RECORD_ATTRIBUTES = frozenset({+ "data-pptx-custgeom-ref",+ "data-pptx-frame",+ "data-pptx-geometry-kind",+ "data-pptx-geometry-sha256",+ "data-pptx-object",+ "data-pptx-part",+ "data-pptx-preview-sha256",+ "data-pptx-prst",+ "data-pptx-ref",+ "data-pptx-shape-id",+ "data-pptx-shape-name",+ "data-pptx-shape-scope",+ "data-pptx-shape-style-ref",+ "data-pptx-text-sha256",+})+_NATIVE_RECORD_PREFIXES = (+ "data-pptx-av-",+ "data-pptx-end-",+ "data-pptx-start-",+)+++class NativePayloadError(ValueError):+ """Reject malformed, missing, or contradictory native metadata transport."""+++@dataclass+class NativePayloadStats:+ """Count externalized native metadata and its original inline bytes."""++ txbody_count: int = 0+ shape_style_count: int = 0+ custom_geometry_count: int = 0+ inline_bytes: int = 0+ native_record_count: int = 0+ native_attribute_bytes: int = 0++ def merge(self, other: "NativePayloadStats") -> None:+ self.txbody_count += other.txbody_count+ self.shape_style_count += other.shape_style_count+ self.custom_geometry_count += other.custom_geometry_count+ self.inline_bytes += other.inline_bytes+ self.native_record_count += other.native_record_count+ self.native_attribute_bytes += other.native_attribute_bytes++ def as_dict(self) -> dict[str, int]:+ return {+ "txbody_count": self.txbody_count,+ "shape_style_count": self.shape_style_count,+ "custom_geometry_count": self.custom_geometry_count,+ "inline_bytes": self.inline_bytes,+ "native_record_count": self.native_record_count,+ "native_attribute_bytes": self.native_attribute_bytes,+ }+++@dataclass(frozen=True)+class NativePayloadStore:+ """Validated payload and native-attribute records loaded from one store."""++ payloads: dict[str, bytes]+ native_records: dict[str, dict[str, str]]+++_STORE_CACHE: dict[Path, tuple[int, int, NativePayloadStore]] = {}+++def _local_name(name: object) -> str:+ return name.rsplit("}", 1)[-1] if isinstance(name, str) else ""+++def _sha256(payload: bytes) -> str:+ return hashlib.sha256(payload).hexdigest()+++def _decode_base64(value: str, *, context: str) -> bytes:+ try:+ return base64.b64decode(value.strip(), validate=True)+ except (ValueError, binascii.Error) as exc:+ raise NativePayloadError(f"{context} is not valid base64: {exc}") from exc+++def _register_payload(payloads: dict[str, bytes], raw: bytes) -> str:+ digest = _sha256(raw)+ existing = payloads.get(digest)+ if existing is not None and existing != raw:+ raise NativePayloadError(+ f"SHA-256 collision while registering native payload {digest}"+ )+ payloads[digest] = raw+ return PAYLOAD_STORE_REFERENCE_PREFIX + digest+++def _is_native_record_attribute(name: str) -> bool:+ return (+ name in _NATIVE_RECORD_ATTRIBUTES+ or name.startswith(_NATIVE_RECORD_PREFIXES)+ )+++def _native_record_attributes(element: ET.Element) -> dict[str, str]:+ return {+ name: value+ for name, value in element.attrib.items()+ if _is_native_record_attribute(name)+ }+++def _native_record_key(attributes: dict[str, str]) -> str:+ return json.dumps(+ attributes,+ ensure_ascii=True,+ separators=(",", ":"),+ sort_keys=True,+ )+++def collect_native_attribute_record_keys(root: ET.Element) -> set[str]:+ """Return canonical record keys for compressible native attributes."""+ keys: set[str] = set()+ for element in root.iter():+ if NATIVE_RECORD_REF_ATTRIBUTE in element.attrib:+ raise NativePayloadError(+ "native metadata is already externalized; source attributes "+ "must be hydrated before building a new store"+ )+ attributes = _native_record_attributes(element)+ if attributes:+ keys.add(_native_record_key(attributes))+ return keys+++def build_native_attribute_records(+ record_keys: set[str],+) -> tuple[dict[str, str], dict[str, dict[str, str]]]:+ """Assign deterministic short ids to canonical native-attribute records."""+ ids_by_key: dict[str, str] = {}+ records: dict[str, dict[str, str]] = {}+ for index, key in enumerate(sorted(record_keys)):+ try:+ attributes = json.loads(key)+ except json.JSONDecodeError as exc:+ raise NativePayloadError(+ f"Cannot decode canonical native-attribute record: {exc}"+ ) from exc+ if not isinstance(attributes, dict) or not attributes:+ raise NativePayloadError(+ "Canonical native-attribute record must be a non-empty object"+ )+ if any(+ not isinstance(name, str)+ or not isinstance(value, str)+ or not _is_native_record_attribute(name)+ for name, value in attributes.items()+ ):+ raise NativePayloadError(+ "Canonical native-attribute record contains an unsupported field"+ )+ record_id = f"r{index}"+ ids_by_key[key] = record_id+ records[record_id] = attributes+ return ids_by_key, records+++def externalize_native_attribute_records(+ root: ET.Element,+ ids_by_key: dict[str, str],+) -> NativePayloadStats:+ """Replace supported native-attribute groups with deterministic short ids."""+ stats = NativePayloadStats()+ for element in root.iter():+ if NATIVE_RECORD_REF_ATTRIBUTE in element.attrib:+ raise NativePayloadError(+ "native metadata is already externalized; source attributes "+ "must be hydrated before building a new store"+ )+ attributes = _native_record_attributes(element)+ if not attributes:+ continue+ record_id = ids_by_key.get(_native_record_key(attributes))+ if record_id is None:+ raise NativePayloadError(+ "Native-attribute record was not registered before externalization"+ )+ for name in attributes:+ element.attrib.pop(name)+ element.set(NATIVE_RECORD_REF_ATTRIBUTE, record_id)+ stats.native_record_count += 1+ stats.native_attribute_bytes += sum(+ len(name) + len(value) + 4+ for name, value in attributes.items()+ )+ return stats+++def externalize_native_payloads(+ root: ET.Element,+ payloads: dict[str, bytes],+) -> NativePayloadStats:+ """Move supported large inline native payloads into ``payloads``.++ Repeated restoration attributes are handled separately by+ ``externalize_native_attribute_records``. The supported opaque payload+ classes are:++ - ``metadata[data-pptx-part="txbody"]``+ - ``data-pptx-shape-style``+ - ``data-pptx-custgeom``+ """+ stats = NativePayloadStats()+ for element in root.iter():+ if (+ _local_name(element.tag) == "metadata"+ and element.get("data-pptx-part") == "txbody"+ ):+ has_reference = TXBODY_REF_ATTRIBUTE in element.attrib+ reference = element.get(TXBODY_REF_ATTRIBUTE) or ""+ encoded = (element.text or "").strip()+ encoding = element.get("data-pptx-encoding")+ if has_reference:+ if not reference:+ raise NativePayloadError(+ "txbody metadata has an empty payload reference"+ )+ raise NativePayloadError(+ "txbody metadata is already externalized; source payload "+ "must be hydrated before building a new store"+ )+ elif encoded:+ if encoding != "base64":+ raise NativePayloadError(+ "txbody metadata must use base64 before externalization"+ )+ raw = _decode_base64(encoded, context="txbody metadata")+ element.text = None+ element.attrib.pop("data-pptx-encoding", None)+ element.set(TXBODY_REF_ATTRIBUTE, _register_payload(payloads, raw))+ stats.txbody_count += 1+ stats.inline_bytes += len(encoded)+ else:+ raise NativePayloadError(+ "txbody metadata requires inline base64 data or a payload reference"+ )++ has_shape_reference = SHAPE_STYLE_REF_ATTRIBUTE in element.attrib+ shape_reference = element.get(SHAPE_STYLE_REF_ATTRIBUTE) or ""+ shape_encoded = element.get(SHAPE_STYLE_ATTRIBUTE)+ if has_shape_reference and not shape_reference:+ raise NativePayloadError("shape-style metadata has an empty payload reference")+ if has_shape_reference:+ raise NativePayloadError(+ "shape-style metadata is already externalized; source payload "+ "must be hydrated before building a new store"+ )+ if shape_encoded:+ raw = _decode_base64(shape_encoded, context="shape-style metadata")+ element.attrib.pop(SHAPE_STYLE_ATTRIBUTE, None)+ element.set(+ SHAPE_STYLE_REF_ATTRIBUTE,+ _register_payload(payloads, raw),+ )+ stats.shape_style_count += 1+ stats.inline_bytes += len(shape_encoded)++ has_geometry_reference = CUSTOM_GEOMETRY_REF_ATTRIBUTE in element.attrib+ geometry_reference = element.get(CUSTOM_GEOMETRY_REF_ATTRIBUTE) or ""+ geometry_encoded = element.get(CUSTOM_GEOMETRY_ATTRIBUTE)+ if has_geometry_reference and not geometry_reference:+ raise NativePayloadError(+ "custom-geometry metadata has an empty payload reference"+ )+ if has_geometry_reference:+ raise NativePayloadError(+ "custom-geometry metadata is already externalized; source payload "+ "must be hydrated before building a new store"+ )+ if geometry_encoded:+ raw = _decode_base64(geometry_encoded, context="custom-geometry metadata")+ element.attrib.pop(CUSTOM_GEOMETRY_ATTRIBUTE, None)+ element.set(+ CUSTOM_GEOMETRY_REF_ATTRIBUTE,+ _register_payload(payloads, raw),+ )+ stats.custom_geometry_count += 1+ stats.inline_bytes += len(geometry_encoded)+ return stats+++def serialize_native_payload_store(+ payloads: dict[str, bytes],+ native_records: dict[str, dict[str, str]] | None = None,+) -> bytes:+ """Return one deterministic gzip-compressed native metadata store."""+ encoded_payloads: dict[str, str] = {}+ for digest, raw in sorted(payloads.items()):+ if _SHA256_RE.fullmatch(digest) is None or _sha256(raw) != digest:+ raise NativePayloadError(+ f"Native payload store key does not match its content: {digest!r}"+ )+ encoded_payloads[digest] = base64.b64encode(raw).decode("ascii")+ encoded_records: dict[str, dict[str, str]] = {}+ for record_id, attributes in sorted((native_records or {}).items()):+ if _NATIVE_RECORD_ID_RE.fullmatch(record_id) is None:+ raise NativePayloadError(+ f"Native metadata store contains an invalid record id: {record_id!r}"+ )+ if not isinstance(attributes, dict) or not attributes:+ raise NativePayloadError(+ f"Native metadata record {record_id} must be a non-empty object"+ )+ if any(+ not isinstance(name, str)+ or not isinstance(value, str)+ or not _is_native_record_attribute(name)+ for name, value in attributes.items()+ ):+ raise NativePayloadError(+ f"Native metadata record {record_id} contains an unsupported field"+ )+ encoded_records[record_id] = dict(sorted(attributes.items()))+ document = {+ "schema": PAYLOAD_STORE_SCHEMA,+ "hash": "sha256",+ "payloads": encoded_payloads,+ "native_records": encoded_records,+ }+ raw_json = json.dumps(+ document,+ ensure_ascii=True,+ separators=(",", ":"),+ sort_keys=True,+ ).encode("utf-8")+ return gzip.compress(raw_json, compresslevel=9, mtime=0)+++def _parse_reference(value: str) -> tuple[PurePosixPath, str]:+ prefix = "project:"+ marker = "#sha256:"+ if not value.startswith(prefix) or marker not in value:+ raise NativePayloadError(+ f"Unsupported native payload reference: {value!r}"+ )+ path_text, digest = value[len(prefix):].split(marker, 1)+ relative = PurePosixPath(path_text)+ if (+ not path_text+ or relative.is_absolute()+ or any(part in {"", ".", ".."} for part in relative.parts)+ ):+ raise NativePayloadError(+ f"Native payload reference must use a safe project-relative path: {value!r}"+ )+ if _SHA256_RE.fullmatch(digest) is None:+ raise NativePayloadError(+ f"Native payload reference has an invalid SHA-256 digest: {value!r}"+ )+ return relative, digest+++def _resolve_store_path(svg_path: Path, relative: PurePosixPath) -> Path:+ start = Path(svg_path).expanduser().resolve().parent+ relative_path = Path(*relative.parts)+ for base in (start, *start.parents):+ candidate = base / relative_path+ if candidate.is_file():+ return candidate.resolve()+ raise NativePayloadError(+ f"Native payload store not found for {svg_path}: {relative.as_posix()}"+ )+++def _load_store(path: Path) -> NativePayloadStore:+ resolved = path.resolve()+ try:+ stat = resolved.stat()+ except OSError as exc:+ raise NativePayloadError(+ f"Cannot inspect native payload store {resolved}: {exc}"+ ) from exc+ cached = _STORE_CACHE.get(resolved)+ if cached and cached[0] == stat.st_mtime_ns and cached[1] == stat.st_size:+ return cached[2]++ try:+ document = json.loads(gzip.decompress(resolved.read_bytes()).decode("utf-8"))+ except (OSError, UnicodeDecodeError, json.JSONDecodeError) as exc:+ raise NativePayloadError(+ f"Cannot decode native payload store {resolved}: {exc}"+ ) from exc+ if not isinstance(document, dict) or document.get("schema") not in {+ LEGACY_PAYLOAD_STORE_SCHEMA,+ PAYLOAD_STORE_SCHEMA,+ }:+ raise NativePayloadError(+ f"Unsupported native payload store schema in {resolved}"+ )+ if document.get("hash") != "sha256":+ raise NativePayloadError(+ f"Unsupported native payload store hash algorithm in {resolved}"+ )+ encoded_payloads = document.get("payloads")+ if not isinstance(encoded_payloads, dict):+ raise NativePayloadError(+ f"Native payload store must contain a payload object: {resolved}"+ )++ payloads: dict[str, bytes] = {}+ for digest, encoded in encoded_payloads.items():+ if not isinstance(digest, str) or _SHA256_RE.fullmatch(digest) is None:+ raise NativePayloadError(+ f"Native payload store contains an invalid digest key: {digest!r}"+ )+ if not isinstance(encoded, str):+ raise NativePayloadError(+ f"Native payload {digest} must be a base64 string"+ )+ raw = _decode_base64(+ encoded,+ context=f"native payload {digest} in {resolved}",+ )+ if _sha256(raw) != digest:+ raise NativePayloadError(+ f"Native payload {digest} failed content-hash validation"+ )+ payloads[digest] = raw+ schema = document.get("schema")+ if schema == PAYLOAD_STORE_SCHEMA and "native_records" not in document:+ raise NativePayloadError(+ f"Native payload store is missing native_records: {resolved}"+ )+ native_records_value = document.get("native_records", {})+ if schema == PAYLOAD_STORE_SCHEMA and not isinstance(native_records_value, dict):+ raise NativePayloadError(+ f"Native payload store must contain a native_records object: {resolved}"+ )+ if schema == LEGACY_PAYLOAD_STORE_SCHEMA:+ native_records_value = {}++ native_records: dict[str, dict[str, str]] = {}+ for record_id, attributes in native_records_value.items():+ if (+ not isinstance(record_id, str)+ or _NATIVE_RECORD_ID_RE.fullmatch(record_id) is None+ ):+ raise NativePayloadError(+ f"Native payload store contains an invalid record id: {record_id!r}"+ )+ if not isinstance(attributes, dict) or not attributes:+ raise NativePayloadError(+ f"Native metadata record {record_id} must be a non-empty object"+ )+ validated: dict[str, str] = {}+ for name, value in attributes.items():+ if (+ not isinstance(name, str)+ or not isinstance(value, str)+ or not _is_native_record_attribute(name)+ ):+ raise NativePayloadError(+ f"Native metadata record {record_id} contains an unsupported field"+ )+ validated[name] = value+ native_records[record_id] = validated++ store = NativePayloadStore(+ payloads=payloads,+ native_records=native_records,+ )+ _STORE_CACHE[resolved] = (stat.st_mtime_ns, stat.st_size, store)+ return store+++def _payload_for_reference(value: str, svg_path: Path) -> bytes:+ relative, digest = _parse_reference(value)+ store_path = _resolve_store_path(svg_path, relative)+ payload = _load_store(store_path).payloads.get(digest)+ if payload is None:+ raise NativePayloadError(+ f"Native payload {digest} is missing from {store_path}"+ )+ return payload+++def _native_record_for_reference(+ value: str,+ svg_path: Path,+) -> dict[str, str]:+ if _NATIVE_RECORD_ID_RE.fullmatch(value) is None:+ raise NativePayloadError(+ f"Native metadata reference has an invalid record id: {value!r}"+ )+ store_path = _resolve_store_path(+ svg_path,+ PurePosixPath(PAYLOAD_STORE_RELATIVE_PATH.as_posix()),+ )+ record = _load_store(store_path).native_records.get(value)+ if record is None:+ raise NativePayloadError(+ f"Native metadata record {value} is missing from {store_path}"+ )+ return record+++def hydrate_native_payload_refs(root: ET.Element, svg_path: Path) -> int:+ """Restore compact native records and payloads as legacy inline metadata.++ The operation preflights every reference before mutating the tree, so an+ invalid store leaves the caller's parsed SVG unchanged.+ """+ record_operations: list[tuple[ET.Element, dict[str, str]]] = []+ payload_operations: list[tuple[str, ET.Element, bytes]] = []+ for element in root.iter():+ effective_attributes = dict(element.attrib)+ has_native_record = NATIVE_RECORD_REF_ATTRIBUTE in element.attrib+ native_record_ref = element.get(NATIVE_RECORD_REF_ATTRIBUTE) or ""+ if has_native_record:+ if not native_record_ref:+ raise NativePayloadError(+ "native metadata has an empty record reference"+ )+ record = _native_record_for_reference(native_record_ref, svg_path)+ conflicts = sorted(set(record) & set(element.attrib))+ if conflicts:+ raise NativePayloadError(+ "native metadata cannot carry both inline fields and a record: "+ + ", ".join(conflicts)+ )+ effective_attributes.update(record)+ record_operations.append((element, record))++ if (+ _local_name(element.tag) == "metadata"+ and effective_attributes.get("data-pptx-part") == "txbody"+ ):+ has_reference = TXBODY_REF_ATTRIBUTE in effective_attributes+ reference = effective_attributes.get(TXBODY_REF_ATTRIBUTE) or ""+ if has_reference:+ if not reference:+ raise NativePayloadError(+ "txbody metadata has an empty payload reference"+ )+ if (element.text or "").strip() or element.get("data-pptx-encoding"):+ raise NativePayloadError(+ "txbody metadata cannot carry both inline data and a reference"+ )+ payload_operations.append(+ ("txbody", element, _payload_for_reference(reference, svg_path))+ )++ has_shape_reference = SHAPE_STYLE_REF_ATTRIBUTE in effective_attributes+ shape_reference = effective_attributes.get(SHAPE_STYLE_REF_ATTRIBUTE) or ""+ if has_shape_reference:+ if not shape_reference:+ raise NativePayloadError(+ "shape-style metadata has an empty payload reference"+ )+ if effective_attributes.get(SHAPE_STYLE_ATTRIBUTE):+ raise NativePayloadError(+ "shape-style metadata cannot carry both inline data and a reference"+ )+ payload_operations.append(+ (+ "shape-style",+ element,+ _payload_for_reference(shape_reference, svg_path),+ )+ )++ has_geometry_reference = CUSTOM_GEOMETRY_REF_ATTRIBUTE in effective_attributes+ geometry_reference = (+ effective_attributes.get(CUSTOM_GEOMETRY_REF_ATTRIBUTE) or ""+ )+ if has_geometry_reference:+ if not geometry_reference:+ raise NativePayloadError(+ "custom-geometry metadata has an empty payload reference"+ )+ if effective_attributes.get(CUSTOM_GEOMETRY_ATTRIBUTE):+ raise NativePayloadError(+ "custom-geometry metadata cannot carry both inline data and a reference"+ )+ payload_operations.append(+ (+ "custom-geometry",+ element,+ _payload_for_reference(geometry_reference, svg_path),+ )+ )++ for element, record in record_operations:+ element.attrib.pop(NATIVE_RECORD_REF_ATTRIBUTE)+ element.attrib.update(record)++ for kind, element, raw in payload_operations:+ encoded = base64.b64encode(raw).decode("ascii")+ if kind == "txbody":+ element.text = encoded+ element.set("data-pptx-encoding", "base64")+ element.attrib.pop(TXBODY_REF_ATTRIBUTE, None)+ elif kind == "shape-style":+ element.set(SHAPE_STYLE_ATTRIBUTE, encoded)+ element.attrib.pop(SHAPE_STYLE_REF_ATTRIBUTE, None)+ else:+ element.set(CUSTOM_GEOMETRY_ATTRIBUTE, encoded)+ element.attrib.pop(CUSTOM_GEOMETRY_REF_ATTRIBUTE, None)+ return len(record_operations) + len(payload_operations)diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.pyindex ec06dd27..38d66cce 100644--- a/skills/ppt-master/scripts/svg_quality_checker.py+++ b/skills/ppt-master/scripts/svg_quality_checker.py@@ -22,6 +22,7 @@ from collections import Counter, defaultdictfrom xml.etree import ElementTree as ETfrom console_encoding import configure_utf8_stdio+from native_payloads import NativePayloadError, hydrate_native_payload_refsconfigure_utf8_stdio()@@ -1206,6 +1207,16 @@ class SVGQualityChecker:# produce misleading errors on a broken document.root = self._parse_xml_root(content, result)if root is not None:+ try:+ hydrated_payloads = hydrate_native_payload_refs(root, svg_path)+ except NativePayloadError as exc:+ result['errors'].append(+ f"Invalid native payload reference: {exc}"+ )+ else:+ if hydrated_payloads:+ result['info']['native_payload_refs'] = hydrated_payloads+# 1. Check viewBoxself._check_viewbox(root,@@ -3120,6 +3131,19 @@ class SVGQualityChecker:f"Icon not found: {icon_name} (searched {icons_dir}"f"{fallback_msg}){hint}")+ continue+ try:+ icon_root = ET.parse(icon_path).getroot()+ hydrated = hydrate_native_payload_refs(icon_root, icon_path)+ except (OSError, ET.ParseError, NativePayloadError) as exc:+ result['errors'].append(+ f"Icon {icon_name} has invalid native payload metadata: {exc}"+ )+ continue+ if hydrated:+ result['info']['native_icon_payload_refs'] = (+ result['info'].get('native_icon_payload_refs', 0) + hydrated+ )def _check_unsupported_visual_elements(self,diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.pyindex 764796e8..05103169 100644--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py@@ -11,6 +11,7 @@ from pathlib import Pathfrom typing import Anyfrom xml.etree import ElementTree as ET+from native_payloads import NativePayloadError, hydrate_native_payload_refsfrom pptx_shapes import (has_relationship_attributes,resolve_preset_preview_hash,@@ -98,6 +99,16 @@ class SvgNativeConversionError(RuntimeError):"""Raised when an SVG cannot be faithfully converted to native DrawingML."""+def _hydrate_native_payloads(root: ET.Element, svg_path: Path) -> int:+ """Resolve compressed workspace payload references for native conversion."""+ try:+ return hydrate_native_payload_refs(root, svg_path)+ except NativePayloadError as exc:+ raise SvgNativeConversionError(+ f"{svg_path.name}: invalid native payload reference: {exc}"+ ) from exc++def _require_chart_table_marker_attributes(root: ET.Element,svg_path: Path | str,@@ -1396,6 +1407,7 @@ def convert_svg_to_slide_shapes(svg_path = Path(svg_path)tree = ET.parse(str(svg_path))root = tree.getroot()+ _hydrate_native_payloads(root, svg_path)try:parse_project_svg_root(root,@@ -1498,6 +1510,14 @@ def convert_svg_to_slide_shapes(if verbose and expanded:print(f' Expanded {expanded} <use data-icon="..."/> placeholder(s)')if expanded:+ hydrated = _hydrate_native_payloads(root, svg_path)+ if hydrated:+ trace_steps.append({+ 'action': 'hydrate-native-payloads-from-icons',+ 'count': hydrated,+ })+ _mark_unchanged_txbody_groups(root)+ _mark_unchanged_preset_previews(root)_require_project_freeform_geometry(root, svg_path)try: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.pyindex 9506bb73..a0a05c40 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@@ -17,6 +17,7 @@ if str(_SCRIPTS_DIR) not in sys.path:sys.path.insert(0, str(_SCRIPTS_DIR))from console_encoding import configure_utf8_stdio # noqa: E402+from native_payloads import PAYLOAD_STORE_RELATIVE_PATH # noqa: E402from pptx_animations import ( # noqa: E402ANIMATIONS,animation_seconds_to_milliseconds,@@ -978,11 +979,23 @@ Recorded narration:svg_output_dst = backup_dir / "svg_output"try:shutil.copytree(svg_output_src, svg_output_dst)- if verbose:- print(f" svg_output backup: {svg_output_dst}")except Exception as exc:if verbose:print(f" [warn] svg_output backup skipped: {exc}")+ else:+ if verbose:+ print(f" svg_output backup: {svg_output_dst}")+ payload_store_src = project_path / PAYLOAD_STORE_RELATIVE_PATH+ if payload_store_src.is_file():+ try:+ payload_store_dst = backup_dir / PAYLOAD_STORE_RELATIVE_PATH+ payload_store_dst.parent.mkdir(parents=True, exist_ok=True)+ shutil.copy2(payload_store_src, payload_store_dst)+ if verbose:+ print(f" native payload backup: {payload_store_dst}")+ except Exception as exc:+ if verbose:+ print(f" [warn] native payload backup skipped: {exc}")elif verbose:print(f" [info] svg_output/ not found, backup skipped")diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/template_structure.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/template_structure.pyindex 8ae7e895..390c0b01 100644--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/template_structure.py+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/template_structure.py@@ -26,6 +26,7 @@ from pathlib import Pathfrom typing import Anyfrom xml.etree import ElementTree as ET+from native_payloads import NativePayloadError, hydrate_native_payload_refsfrom pptx_to_svg.preset_authoring import (authored_preset_encoding,validate_authored_preset_group,@@ -397,6 +398,13 @@ def _local_tag(elem: ET.Element) -> str:return elem.tag.rsplit("}", 1)[-1] if isinstance(elem.tag, str) else ""+def _parse_svg_root(svg_path: Path) -> ET.Element:+ """Parse one SVG and hydrate compact native metadata in memory."""+ root = ET.parse(svg_path).getroot()+ hydrate_native_payload_refs(root, svg_path)+ return root++def _is_authored_preset_atom(elem: ET.Element) -> bool:"""Return whether one group is a valid compact authored-shape atom."""return (@@ -1223,8 +1231,8 @@ def parse_template_slide() -> TemplateSlideSpec:"""Parse one SVG's explicit template layout and structure elements."""try:- root = ET.parse(svg_path).getroot()- except (OSError, ET.ParseError) as exc:+ root = _parse_svg_root(svg_path)+ except (OSError, ET.ParseError, NativePayloadError) as exc:raise TemplateStructureError(f"{svg_path.name}: unable to parse SVG structure metadata: {exc}") from exc@@ -1737,8 +1745,8 @@ def parse_optional_layout_slides(has_structure_metadata = Falsefor svg_path in svg_files:try:- root = ET.parse(svg_path).getroot()- except (OSError, ET.ParseError) as exc:+ root = _parse_svg_root(svg_path)+ except (OSError, ET.ParseError, NativePayloadError) as exc:raise TemplateStructureError(f"{svg_path.name}: unable to inspect SVG Layout metadata: {exc}") from exc@@ -1805,8 +1813,8 @@ def flat_structure_metadata_errors(svg_files: list[Path]) -> list[str]:errors: list[str] = []for svg_path in svg_files:try:- root = ET.parse(svg_path).getroot()- except (OSError, ET.ParseError) as exc:+ root = _parse_svg_root(svg_path)+ except (OSError, ET.ParseError, NativePayloadError) as exc:errors.append(f"{svg_path.name}: unable to inspect flat-mode metadata: {exc}")@@ -2356,9 +2364,9 @@ def _structure_subtree_signature() -> tuple[tuple[str, tuple[object, ...]], ...]:"""Read structural or literal-visual signatures for direct SVG children."""try:- root = ET.parse(svg_path).getroot()+ root = _parse_svg_root(svg_path)materialize_inline_geometry_properties(root)- except (OSError, ET.ParseError, GeometryStyleError) as exc:+ except (OSError, ET.ParseError, NativePayloadError, GeometryStyleError) as exc:raise TemplateStructureError(f"{svg_path.name}: unable to compare template prototype structure: {exc}") from exc@@ -2401,8 +2409,8 @@ def _structure_subtree_signature(def _mirror_ordinary_slide_ids(spec: TemplateSlideSpec) -> set[str]:"""Return stable ids that are ordinary Slide content in one mirror page."""try:- root = ET.parse(spec.svg_path).getroot()- except (OSError, ET.ParseError) as exc:+ root = _parse_svg_root(spec.svg_path)+ except (OSError, ET.ParseError, NativePayloadError) as exc:raise TemplateStructureError(f"{spec.svg_path.name}: unable to inspect mirror page ownership: {exc}") from exc@@ -2435,9 +2443,9 @@ def _mirror_slide_local_signature(evolved Layout identity to the same stable SVG id."""try:- root = ET.parse(spec.svg_path).getroot()+ root = _parse_svg_root(spec.svg_path)materialize_inline_geometry_properties(root)- except (OSError, ET.ParseError, GeometryStyleError) as exc:+ except (OSError, ET.ParseError, NativePayloadError, GeometryStyleError) as exc:raise TemplateStructureError(f"{spec.svg_path.name}: unable to compare mirror page visuals: {exc}") from exc@@ -2902,8 +2910,8 @@ def _placement_lint_errors(svg_path: Path) -> list[str]:template paint-order violations."""try:- root = ET.parse(svg_path).getroot()- except (OSError, ET.ParseError):+ root = _parse_svg_root(svg_path)+ except (OSError, ET.ParseError, NativePayloadError):return []if _local_tag(root) != "svg":return []diff --git a/skills/ppt-master/templates/README.md b/skills/ppt-master/templates/README.mdindex b3dc2926..dd5ecb9c 100644--- a/skills/ppt-master/templates/README.md+++ b/skills/ppt-master/templates/README.md@@ -44,7 +44,7 @@ initialized project:```text<template_workspace>/-├── templates/ # design_spec.md and any SVG prototypes+├── templates/ # design_spec.md, SVG prototypes, optional native_payloads.json.gz store├── images/ # optional bitmaps├── icons/│ └── imported/ # optional imported vectors, one canonical copydiff --git a/skills/ppt-master/workflows/create-template.md b/skills/ppt-master/workflows/create-template.mdindex f756ada7..c68420c8 100644--- a/skills/ppt-master/workflows/create-template.md+++ b/skills/ppt-master/workflows/create-template.md@@ -502,7 +502,12 @@ publication, the command verifies the layered manifest and source-ref closure,lossless SVG and source-PPTX hashes, complete native/inheritance graph, andextracted-vector inventory. It then stages and publishes the entire roster inone operation. It emits source-ordered page SVGs, unused-Layout definition-SVGs, `icons/imported/`, and referenced `images/` / `templates/assets/`; it does+SVGs, `icons/imported/`, referenced `images/` / `templates/assets/`, and one+deduplicated `templates/native_payloads.json.gz` store when supported native+payload or repeated restoration metadata exists. Template SVGs and imported+vectors keep content-hash payload references plus short+`data-pptx-native-ref` attribute-record ids. Structural Master/Layout,+placeholder, layer, and editable-object fields remain inline. The command doesnot create `design_spec.md`. Template_Designer writes that file from theconfirmed brief and the materialized roster before Step 5. A rerun targets anew empty workspace rather than overwriting a partially reviewed template.@@ -659,7 +664,7 @@ This checker validates the authoring contract, not the compiled OOXML package. T- [ ] Mirror roots preserve source inherited-shape visibility with canonical lowercase `data-pptx-show-master-shapes` and `data-pptx-show-inherited-shapes`; same-key Layouts agree on the former, while each Slide retains its own latter value- [ ] Mirror preflight covered the complete source graph; each unused Layout has one `layout_<layout_key>.svg` definition prototype and each otherwise-unused Master is retained through at least one such Layout- [ ] For `standard` / `fidelity`, no duplicate-Layout-contract warning remains; mirror may keep equivalent source Layout identities when the preservation map explains them-- [ ] All template-creation edits used the authoring IR; Type A mirror used `mirror_template_materialize.py`, validated its manifest/hash/graph/source-ref closure before atomic publication, reused only converter-supported payload for hash-matching Slide-local/slot refs, stripped IR-only source-ref metadata, and kept fixed Master/Layout visuals as direct atoms+- [ ] All template-creation edits used the authoring IR; Type A mirror used `mirror_template_materialize.py`, validated its manifest/hash/graph/source-ref closure before atomic publication, reused only converter-supported payload for hash-matching Slide-local/slot refs, deduplicated supported opaque payload and repeated native restoration attributes into `templates/native_payloads.json.gz`, stripped IR-only source-ref metadata, and kept fixed Master/Layout visuals as direct atoms- [ ] If any SVG references an extracted vector, it uses `data-icon="imported/<name>"` and the sole SVG asset exists at `<template_workspace>/icons/imported/<name>.svg`; `templates/icons/` does not exist and no separate illustration embedding script was added- [ ] For `fidelity` mode: every sprite-sheet asset retains its nested `<svg viewBox=...>` crop wrapper; no image whose file aspect differs from its on-page aspect was flattened to a bare `<image>`- [ ] For `mirror` mode: source-page SVG count equals source page count, while additional files are exactly the required `layout_<layout_key>.svg` definitions for unused source Layouts; source-page filenames follow the `<NNN>_<page_type>.svg` convention; **no new `{{...}}` authoring placeholders were inserted into materialized source-page SVGs**; §V Page Roster lists every emitted file and marks definition-only prototypes explicitly