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): add model-readable authoring summaries
hugohe38b12093babf6
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex 2c69908e..414b97a9 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -94,7 +94,7 @@ description: >| `${SKILL_DIR}/scripts/latex_render.py` | LaTeX formula rendering (manifest-driven PNG assets) || `${SKILL_DIR}/scripts/image_gen.py` | AI image generation (multi-provider) || `${SKILL_DIR}/scripts/slice_images.py` | Slice one AI illustration sheet into individual spot-illustration elements |-| `${SKILL_DIR}/scripts/svg_authoring_view.py` | Create a lightweight editable authoring IR bundle and compact provenance manifest from PPTX-imported SVGs |+| `${SKILL_DIR}/scripts/svg_authoring_view.py` | Create a lightweight editable authoring IR bundle, model-readable summary, and tool-only provenance manifest from PPTX-imported SVGs || `${SKILL_DIR}/scripts/svg_quality_checker.py` | SVG quality check || `${SKILL_DIR}/scripts/preset_shape_svg.py` | Print one compact registry-backed native PowerPoint preset `<g>` to stdout for page or template insertion || `${SKILL_DIR}/scripts/total_md_split.py` | Speaker notes splitting |@@ -145,10 +145,12 @@ Master/Layout topology is neither preserved nor distilled. `mirror` is anative-preservation path: preserve only the source slide roster/order, visual appearance,Master/Layout parentage and identities, placeholder type/index/bounds, nativeobject ownership, and supported native-shape metadata. The lossless import is-the native-payload backing store; the `authoring-svg/` bundle and its-`authoring_manifest.json` are the only editable template-creation IR. Stable-document-local source references let mirror materialization reuse unchanged-native payload without putting it in model context. Mechanical normalization+the native-payload backing store; editable SVGs under `authoring-svg/` are the+template-creation IR. Models read `authoring_summary.json` for bundle+orientation and do not load `authoring_manifest.json`; the mirror compiler+reads that machine manifest internally. Stable document-local source+references let mirror materialization reuse unchanged native payload without+putting it in model context. Mechanical normalizationmay express the source facts in the current explicit SVG contract and expandfixed-layer group wrappers into direct atoms, but it MUST NOT merge, split,promote, demote, rename, or re-parent source structure. The IR is materializeddiff --git a/skills/ppt-master/references/artifact-ownership.md b/skills/ppt-master/references/artifact-ownership.mdindex 274f2b78..2bb09787 100644--- a/skills/ppt-master/references/artifact-ownership.md+++ b/skills/ppt-master/references/artifact-ownership.md@@ -25,8 +25,9 @@ Global artifact ownership rules for PPT Master projects.| `<import_workspace>/svg/` | Imported native-payload backing | Complete PPTX-derived metadata, hidden carriers, fallback evidence, and source structure | Keep immutable; create-template materialization may resolve a validated source ref against these files, but models do not edit or bulk-read them || `<import_workspace>/svg-flat/` | Optional complete-page verification backing | Self-contained visual composition generated only by explicit `--inheritance-mode both` | Keep immutable when requested; never use as authoring or materialization input || `<import_workspace>/authoring-svg/` | Template-creation author source | Layered editable SVG IR for imported Master, Layout, and Slide objects | Template_Designer reads and edits this bundle; final template SVGs are materialized from it rather than copied from lossless backing |-| `<import_workspace>/authoring-svg/authoring_manifest.json` | Authoring provenance contract | Per-document source/authoring hashes and document-local source-ref paths | Generated atomically with the IR; materialization validates it before reusing native payload; never duplicate raw payload here |-| `<import_workspace>/authoring-svg-flat/` | Optional complete-page verification IR | Self-contained page composition view with its own provenance manifest | Generate only from an explicitly requested `svg-flat/`; use to verify composition, while layered `authoring-svg/` remains the canonical editable source |+| `<import_workspace>/authoring-svg/authoring_summary.json` | Model-readable authoring index | Current SVG roster plus compact per-file canvas, size, text, image, vector, placeholder, and source-ref counts | Models read this before authoring SVGs; regenerate after direct IR edits |+| `<import_workspace>/authoring-svg/authoring_manifest.json` | Tool-only authoring provenance contract | Per-document source/authoring hashes and document-local source-ref paths | Generated atomically with the IR; materialization validates it before reusing native payload; never load it into model context or duplicate raw payload here |+| `<import_workspace>/authoring-svg-flat/` | Optional complete-page verification IR | Self-contained page composition view with its own summary and provenance manifest | Generate only from an explicitly requested `svg-flat/`; use to verify composition, while layered `authoring-svg/` remains the canonical editable source || `<import_workspace>/icons/imported/` | Imported vector pool | One canonical copy of every factored vector subtree | Authoring SVGs reference `data-icon="imported/<name>"`; vector inventories retain source refs so expansion re-establishes IR identity || `confirm_ui/recommendations.json` | Confirmation proposal | Strategist-authored confirmation payload | Confirm UI reads; rewritten between Stage 1, Stage 2, and Stage 3 || `confirm_ui/result.json` | Confirmation result | User-confirmed values | Strategist treats final result as authoritative over recommendations |@@ -50,7 +51,7 @@ Global artifact ownership rules for PPT Master projects.| Design contract | `design_spec.md` explains; `spec_lock.md` executes. Executor must not infer execution values from prose. || Free-design / brand-only packaging authority | `spec_lock.md` declares `pptx_structure.mode: flat` and omits `pptx_masters`, `pptx_layouts`, `page_pptx_layouts`, and `page_layouts`. `svg_output/` owns the complete Slide-local visual design without root Master/Layout identity, fixed-layer ownership, or placeholder metadata. Export materializes one clean project-owned Master plus one Blank Layout, applies the locked theme defaults, removes stock content placeholders/Layout inventory, and retains only the standard date/footer/slide-number capability hooks. || Template structure authority | `page_layouts` owns each page's authoring-input prototype. `pptx_masters` / `pptx_layouts` own the unique reusable output definitions, while `page_pptx_layouts` owns page assignment. Strict keeps the prototype contract; adaptive may create a new Layout definition during page authoring and updates its assignment immediately. Unused definitions may register without a published Slide. Templates validate provenance but never add missing visible page objects during export. |-| Imported-template authoring | `authoring-svg/` plus its `authoring_manifest.json` own edits and source-object identity during create-template. Lossless `svg/` owns immutable native payload and fallback evidence; optional `svg-flat/` owns only complete-page verification. Materialized `templates/*.svg` own the validated deliverable contract and contain no IR-only source refs. |+| Imported-template authoring | Editable SVGs under `authoring-svg/` own create-template edits, `authoring_summary.json` owns model-facing orientation, and `authoring_manifest.json` owns tool-only source-object identity. Lossless `svg/` owns immutable native payload and fallback evidence; optional `svg-flat/` owns only complete-page verification. Materialized `templates/*.svg` own the validated deliverable contract and contain no IR-only source refs. || Legacy template input | Old unmapped/distilled/preserve structured projects and incomplete template packages are not migrated in place. [`create-template`](../workflows/create-template.md) authors a new current workspace: original PPTX Type A may preserve existing native topology in mirror; legacy SVG-only Type B is visual reference for `standard` / `fidelity`. An intentional free-design or brand-only `flat` project is already current. The exporter does not migrate or visually cluster legacy structure. || Image facts | `images/` is live state; `analysis/image_analysis.csv` is a regenerated view, not a durable cache. || SVG source | `svg_output/` is the only author source for generated pages. |@@ -70,6 +71,7 @@ Global artifact ownership rules for PPT Master projects.| Derived artifact | Regenerate from | Command / owner ||---|---|---|| `analysis/image_analysis.csv` | Current `images/` | `python3 ${SKILL_DIR}/scripts/analyze_images.py <project_path>/images` |+| `<import_workspace>/authoring-svg/authoring_summary.json` | Current authoring SVGs plus tool-only manifest roster | `python3 ${SKILL_DIR}/scripts/svg_authoring_view.py <import_workspace>/authoring-svg --refresh-summary`; in-place vector/picture extraction refreshes it automatically || `notes/slide_*.md` | `notes/total.md` | `python3 ${SKILL_DIR}/scripts/total_md_split.py <project_path>` || `svg_final/` | `svg_output/` plus project assets | `python3 ${SKILL_DIR}/scripts/finalize_svg.py <project_path>` || Native PPTX | `svg_output/` plus notes/assets | `python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>` |diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.mdindex cc36fb87..38eb91ab 100644--- a/skills/ppt-master/references/shared-standards.md+++ b/skills/ppt-master/references/shared-standards.md@@ -309,14 +309,15 @@ one. This array is still diagnostic metadata, not an authoring surface.| Representation | Contract ||---|---|| Lossless import SVG | Keep complete native payload, hidden carriers, and preview evidence in the temporary analysis workspace. It is immutable native-payload backing, not the editable template source. |-| Authoring IR bundle | Keep editable SVGs plus `authoring_manifest.json`. Exclude opaque payload and duplicate hidden carriers from model context while retaining visible shape intent and a stable document-local `data-pptx-source-ref` on each imported logical object. The manifest owns source paths and initial hashes; it never duplicates raw payload. |+| Authoring IR bundle | Keep editable SVGs plus model-readable `authoring_summary.json` and tool-only `authoring_manifest.json`. Exclude opaque payload and duplicate hidden carriers from model context while retaining visible shape intent and a stable document-local `data-pptx-source-ref` on each imported logical object. The summary owns the compact current-file index; the manifest owns source paths and initial hashes and never enters model context. || `standard` / `fidelity` output | Use the compact authored-preset contract (§1.5) for newly authored stock shapes; do not transplant opaque import payload or source topology. || `mirror` output | Materialize from the edited authoring IR. Rehydrate supported imported metadata only when a Slide-local/slot object's source ref and initial authoring hash still match; otherwise keep the current SVG fallback. Expand fixed Master/Layout group wrappers into direct semantic atoms while preserving source ownership, paint order, and visible appearance. |**Hard rule — authoring source refs**: `data-pptx-source-ref` is reserved forthe create-template authoring IR. Its value is unique within one authoring SVG,not across the workspace, and must be resolved through that document's-`authoring_manifest.json` record. Moving a referenced subtree into+`authoring_manifest.json` record by the owning tool. Models MUST NOT read that+machine manifest. Moving a referenced subtree into`icons/imported/` for readability must preserve the attribute and record it inthe vector inventory; re-inlining re-establishes the same mapping. Final materializedtemplate SVGs and normal project `svg_output/` must not contain this attribute.diff --git a/skills/ppt-master/references/template-designer.md b/skills/ppt-master/references/template-designer.mdindex 9bb7d76b..8db7571a 100644--- a/skills/ppt-master/references/template-designer.md+++ b/skills/ppt-master/references/template-designer.md@@ -31,7 +31,7 @@ When the workflow provides a PPTX reference source, the effective input package- `svg/slide_NN.svg` — immutable slide-local native-payload backing; do not bulk-read because opaque native payload is retained- `svg/inheritance.json` — which layout / master each slide consumes- optional `svg-flat/slide_NN.svg` — immutable complete-page verification backing generated only when explicitly requested; do not use it as the editable source-- `authoring-svg/` and optional `authoring-svg-flat/` — lightweight non-destructive IR bundles created by `svg_authoring_view.py`; each contains editable SVGs plus `authoring_manifest.json`+- `authoring-svg/` and optional `authoring-svg-flat/` — lightweight non-destructive IR bundles created by `svg_authoring_view.py`; each contains editable SVGs, model-readable `authoring_summary.json`, and tool-only `authoring_manifest.json`- optional screenshots for visual cross-checkingPPTX import interpretation:@@ -44,8 +44,8 @@ Input priority for PPTX-backed template creation depends on replication mode:| Mode | Authoritative inputs | Model-facing inputs ||---|---|---|-| `standard` / `fidelity` | Finalized brief for the newly designed output; `manifest.json` for factual canvas/theme/assets | `authoring-svg/` and optional `authoring-svg-flat/` IR documents plus exported assets as visual references. Source Master/Layout topology is informational only and is not mined into output structure. |-| `mirror` | `manifest.json`, `native_structure.json`, `svg/inheritance.json`, and the authoring manifests | Layered `authoring-svg/` as the editable preservation IR; optional `authoring-svg-flat/` for complete-page verification; matching lossless `svg/` and optional `svg-flat/` only as immutable backing. |+| `standard` / `fidelity` | Finalized brief for the newly designed output; `manifest.json` for factual canvas/theme/assets | `authoring-svg/authoring_summary.json`, layered authoring SVGs, optional flat spot checks, and exported assets as visual references. Do not read `authoring_manifest.json`. Source Master/Layout topology is informational only and is not mined into output structure. |+| `mirror` | `manifest.json`, `native_structure.json`, and `svg/inheritance.json`; the compiler validates the tool-only authoring manifest | `authoring-svg/authoring_summary.json` plus layered authoring SVGs as the editable preservation IR; optional `authoring-svg-flat/` for complete-page verification; matching lossless `svg/` and optional `svg-flat/` only as immutable backing. |Use the compact facts in `manifest.json` for orientation. Open screenshots or the original PPTX only for visual cross-checking.@@ -145,7 +145,7 @@ Extension page types beyond the canonical four (transition / appendix / disclaimWhen the brief sets `Replication mode: mirror`, materialize a new template workspace from validated imported facts rather than designing a new system:-- Authoring source: layered `authoring-svg/*.svg` plus `authoring-svg/authoring_manifest.json`, `svg/inheritance.json`, and `native_structure.json`. When present, use `authoring-svg-flat/` only for full-page verification. Matching lossless `svg/` and optional `svg-flat/` files are immutable backing; materialization resolves only the layered backing.+- Model-facing authoring source: `authoring-svg/authoring_summary.json`, layered `authoring-svg/*.svg`, `svg/inheritance.json`, and `native_structure.json`. Do not read `authoring-svg/authoring_manifest.json`; materialization validates it internally. When present, use `authoring-svg-flat/` only for full-page verification. Matching lossless `svg/` and optional `svg-flat/` files are immutable backing; materialization resolves only the layered backing.- Precondition: the import evidence identifies every source Master/Layout, parent relationship, picker name, placeholder contract, and fixed visual layer. Stop only when required facts or supported geometry are missing; unused identities are not a stop condition.- Output: `<template_workspace>/templates/<NNN>_<page_type>.svg` for every source slide, plus `layout_<layout_key>.svg` for every source Layout unused by all source slides. `<NNN>` is the zero-padded source slide index (3 digits) and `<page_type>` is derived from `manifest.json` `pageTypeCandidates` — `cover` / `toc` / `chapter` / `content` / `ending`. When the page-type heuristic is ambiguous, fall back to `content`. Preserve source slide order via the numeric prefix; definition-only files are not generated pages.- Required preservation: preserve source Master/Layout keys and picker names, Layout-to-Master parentage, slide assignments, placeholder type/index/bounds, supported native-object metadata, geometry, decoration, sprite-sheet wrappers, original example text, chart previews, fonts, effects, and paint order whenever the importer represents them.@@ -323,7 +323,7 @@ If PPTX import output exists:- For `standard`, inspect enough lightweight complete-page IR documents to understand the requested visual direction and reusable assets; do not analyze source topology.- For `fidelity`, inspect every lightweight complete-page IR document so the newly designed roster covers the useful source composition range; do not derive output ownership from source Master/Layout recurrence.-- For `mirror`, verify every authoring Master, Layout, and Slide plus its manifest record against `native_structure.json` and `svg/inheritance.json`, then materialize from the IR with matching lossless payload backing. Before materialization begins, report the verified source slide indexes.+- For `mirror`, verify every authoring Master, Layout, and Slide listed by `authoring_summary.json` against `native_structure.json` and `svg/inheritance.json`, then materialize from the IR with matching lossless payload backing. The compiler validates each machine-manifest record. Before materialization begins, report the verified source slide indexes.### 2.1 PPTX Import Mode Rule@@ -347,7 +347,7 @@ template.| Representation | Purpose | Payload rule ||---|---|---|| Lossless import SVG | Native-payload backing | Retain complete imported metadata, native object boundaries, hidden carriers, and source-scope identity. Keep it immutable and resolve it only through validated source refs. |-| Authoring IR bundle | Editable template-creation source | Omit opaque native payload and duplicate hidden carriers from model context; retain visible shape intent and stable document-local source refs. `authoring_manifest.json` records source paths and initial hashes without duplicating payload. |+| Authoring IR bundle | Editable template-creation source | Omit opaque native payload and duplicate hidden carriers from model context; retain visible shape intent and stable document-local source refs. Models read `authoring_summary.json`; tools read `authoring_manifest.json` for source paths and initial hashes. || `standard` / `fidelity` output | Newly authored contract | Use `preset_shape_svg.py` compact canonical `<g>` output for exact preset matches, with paint from the confirmed brief / `design_spec.md`; use ordinary project SVG for other geometry. Reuse exported image/vector assets, not opaque source shape payload or source topology. || `mirror` output | Materialized preserved contract | Preserve currently supported imported metadata on unchanged Slide-local/slot refs, use the edited SVG fallback otherwise, and normalize fixed structural layers into semantic atoms. Strip IR-only source refs from final templates. |diff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.mdindex 00c10cd9..539f0b16 100644--- a/skills/ppt-master/scripts/README.md+++ b/skills/ppt-master/scripts/README.md@@ -82,6 +82,7 @@ python3 scripts/pptx_template_import.py <template.pptx>python3 scripts/pptx_template_import.py <template.pptx> --manifest-onlypython3 scripts/pptx_template_import.py <template.pptx> --inheritance-mode bothpython3 scripts/svg_authoring_view.py <imported-svg-or-dir> -o <output-dir> --projection-kind layered+python3 scripts/svg_authoring_view.py <authoring-dir> --refresh-summarypython3 scripts/mirror_template_materialize.py <import_workspace> <empty_template_workspace>python3 scripts/template_preview_pptx.py <template_workspace>python3 scripts/template_preview_pptx.py <legacy_template_workspace> --visual-only@@ -99,15 +100,20 @@ copy while retaining visible fallback geometry, text, images, stable elementids, root Master/Layout markers, selected native-shape intent, anddocument-local `data-pptx-source-ref` values.Relative local image references are rewritten so the projected copy still-renders from its new location. The bundle's `authoring_manifest.json` records-source/authoring hashes and object paths without duplicating opaque payload.-The full imported SVG remains unchanged as native-payload backing. Template-creation edits the IR and materializes validated `templates/*.svg`; the IR-directory itself is not a final template or direct release export source.+renders from its new location. The bundle's `authoring_summary.json` is the+model-readable current-file index; `authoring_manifest.json` records+source/authoring hashes and object paths for tools without duplicating opaque+payload and does not enter model context. In-place vector/picture extraction+refreshes the summary automatically; use `--refresh-summary` after other direct+IR edits. The full imported SVG remains unchanged as native-payload backing.+Template creation edits the IR and materializes validated `templates/*.svg`;+the IR directory itself is not a final template or direct release export+source.`mirror_template_materialize.py` is the deterministic Type A mirror compiler.-It consumes only the layered `authoring-svg/` IR as editable input, validates-its manifest against immutable `svg/`, `native_structure.json`,+It consumes only the layered `authoring-svg/` IR as editable input, loads its+tool-only manifest internally, and validates it against immutable `svg/`,+`native_structure.json`,`svg/inheritance.json`, `source_template.pptx`, and any extracted-vectorinventory, then publishes a complete structured template roster atomically.Unchanged supported Slide-local/slot refs may recover native payload; editeddiff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.mdindex 836879d2..6fe29bff 100644--- a/skills/ppt-master/scripts/docs/svg-pipeline.md+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md@@ -21,8 +21,8 @@ python3 scripts/svg_authoring_view.py <svg-file-or-directory> -o <output-dir> \The operation is non-destructive and refuses existing output files unless`--force` is explicit. It never writes back to the source SVG. The JSON reporton stdout records original/projected byte counts and removals by category. The-output directory contains the editable SVGs and one atomic-`authoring_manifest.json` sidecar.+output directory contains the editable SVGs, one model-readable+`authoring_summary.json`, and one tool-only `authoring_manifest.json`.The projected copy:@@ -36,12 +36,22 @@ The projected copy:each imported logical object;- rewrites relative local asset references for the projection's new location.-The manifest stores relative source/authoring filenames, source and initial-authoring hashes, and source element paths. It deliberately does not copy the-opaque payload. The authoring bundle is the editable source for template-creation; the complete imported SVG remains immutable native-payload backing.-Final `templates/*.svg` files are materialized and validated from that pair.-The IR directory itself is not a supported direct input to `svg_to_pptx.py`.+The summary stores the current SVG roster plus compact per-file canvas, size,+text, image, vector, placeholder, icon, and source-ref counts. Models read the+summary and editable SVGs; they do not read the machine manifest. The manifest+stores relative source/authoring filenames, source and initial authoring hashes,+and source element paths. It deliberately does not copy the opaque payload.+The authoring bundle is the editable source for template creation; the complete+imported SVG remains immutable native-payload backing. Final+`templates/*.svg` files are materialized and validated from that pair. The IR+directory itself is not a supported direct input to `svg_to_pptx.py`.++Regenerate the summary after direct edits that do not pass through one of the+in-place normalization tools:++```bash+python3 scripts/svg_authoring_view.py <authoring-dir> --refresh-summary+```This projection is separate from canonical preset authoring. New project SVGsand project-owned templates use the compact authored form: one atomic@@ -80,7 +90,9 @@ the working SVGs reference them as `data-icon="imported/<name>"`. Inventoryentries retain source refs from each extracted subtree, allowing expansion toreconnect the authoring-manifest mapping. A rerun on analready rewritten namespaced projection inventories those references and does-not progressively extract their remaining parent or sibling geometry.+not progressively extract their remaining parent or sibling geometry. An+in-place pass over an authoring bundle refreshes `authoring_summary.json`+automatically.## `mirror_template_materialize.py`@@ -93,7 +105,8 @@ python3 scripts/mirror_template_materialize.py \```The command treats `<import_workspace>/authoring-svg/` as the sole editable-source. It validates the layered authoring manifest, immutable lossless SVG+source. It reads the tool-only layered authoring manifest internally and+validates it against immutable lossless SVGhashes, source PPTX hash, complete Master/Layout/Slide graph, inheritancevisibility facts, source-ref closure, and extracted-vector inventory before itwrites anything. It refuses a non-empty destination and stages the whole result@@ -162,6 +175,8 @@ effect once inside the SVG asset and again to the replacement `<image>`.Scripts, `foreignObject`, SVG animation, remote resources, and external SVGfragment references fail closed; local image/CSS resources must stay insidethe declared `--resource-root` and are embedded into the asset.+An in-place rewrite inside an authoring bundle refreshes+`authoring_summary.json` automatically.This operation belongs only to an explicit `create-template` normalizationdecision in `standard` or `fidelity` mode. It does not choose groups, detectdiff --git a/skills/ppt-master/scripts/extract_svg_assets.py b/skills/ppt-master/scripts/extract_svg_assets.pyindex 64c38d9f..8051f538 100644--- a/skills/ppt-master/scripts/extract_svg_assets.py+++ b/skills/ppt-master/scripts/extract_svg_assets.py@@ -45,6 +45,10 @@ from typing import Optionalfrom xml.etree import ElementTree as ETfrom console_encoding import configure_utf8_stdio+from svg_authoring_view import (+ AUTHORING_MANIFEST_NAME,+ write_authoring_summary,+)configure_utf8_stdio()@@ -840,6 +844,17 @@ def main(argv: Optional[list[str]] = None) -> int:}inventory_path.parent.mkdir(parents=True, exist_ok=True)inventory_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")+ summary_path: Path | None = None+ if args.inplace and (svg_dir / AUTHORING_MANIFEST_NAME).is_file():+ try:+ summary_path = write_authoring_summary(svg_dir)+ except (OSError, ValueError) as exc:+ print(+ f"[ERROR] vector extraction succeeded but authoring summary "+ f"refresh failed: {exc}",+ file=sys.stderr,+ )+ return 1print(f"[OK] extracted {extracted_count} new asset(s), reused {reused_count} asset(s), "f"inventoried {len(inventory)} asset reference(s) -> "@@ -848,6 +863,8 @@ def main(argv: Optional[list[str]] = None) -> int:)if stale_removed:print(f"[OK] removed {len(stale_removed)} stale generated asset(s)", file=sys.stderr)+ if summary_path is not None:+ print(f"[OK] refreshed model-readable summary: {summary_path}", file=sys.stderr)return 0diff --git a/skills/ppt-master/scripts/extract_svg_pictures.py b/skills/ppt-master/scripts/extract_svg_pictures.pyindex 571933fa..1555764d 100644--- a/skills/ppt-master/scripts/extract_svg_pictures.py+++ b/skills/ppt-master/scripts/extract_svg_pictures.py@@ -48,6 +48,10 @@ from urllib.parse import unquote, urlsplit, urlunsplitfrom xml.etree import ElementTree as ETfrom console_encoding import configure_utf8_stdio+from svg_authoring_view import (+ AUTHORING_MANIFEST_NAME,+ write_authoring_summary,+)configure_utf8_stdio()@@ -968,12 +972,22 @@ def _run(args: argparse.Namespace) -> dict[str, object]:plans,)_write_outputs(tree, output, inventory, images_dir, plans, inventory_bytes)+ summary_path: Path | None = None+ if args.inplace and (source.parent / AUTHORING_MANIFEST_NAME).is_file():+ try:+ summary_path = write_authoring_summary(source.parent)+ except (OSError, ValueError) as exc:+ raise SvgPictureError(+ "Picture extraction succeeded but authoring summary refresh "+ f"failed: {exc}"+ ) from excprint(f"Wrote rewritten SVG and {len(plans)} picture asset(s)", file=sys.stderr)return {"source": str(source),"output": str(output),"inventory": str(inventory),"assets": [str(plan.asset_path) for plan in plans],+ "authoring_summary": str(summary_path) if summary_path is not None else None,}diff --git a/skills/ppt-master/scripts/svg_authoring_view.py b/skills/ppt-master/scripts/svg_authoring_view.pyindex 74676e9b..ca17af1b 100644--- a/skills/ppt-master/scripts/svg_authoring_view.py+++ b/skills/ppt-master/scripts/svg_authoring_view.py@@ -21,10 +21,11 @@ Dependencies:None (standard library only).The output directory is an authoring bundle: editable SVGs plus one-`authoring_manifest.json` provenance sidecar. It is the template-creation input,-not a release SVG directory; final templates are materialized from this IR.-Directory runs prepare and stage the complete batch before publishing it, so a-failed page leaves the existing destination set unchanged.+model-readable `authoring_summary.json` and one tool-only+`authoring_manifest.json` provenance sidecar. It is the template-creation+input, not a release SVG directory; final templates are materialized from this+IR. Directory runs prepare and stage the complete batch before publishing it,+so a failed page leaves the existing destination set unchanged."""from __future__ import annotations@@ -50,8 +51,19 @@ configure_utf8_stdio()SVG_NS = "http://www.w3.org/2000/svg"XLINK_NS = "http://www.w3.org/1999/xlink"AUTHORING_MANIFEST_NAME = "authoring_manifest.json"+AUTHORING_SUMMARY_NAME = "authoring_summary.json"AUTHORING_SCHEMA = "ppt-master.svg-authoring-ir.v1"+AUTHORING_SUMMARY_SCHEMA = "ppt-master.svg-authoring-summary.v1"SOURCE_REF_ATTRIBUTE = "data-pptx-source-ref"+_DRAWABLE_TAGS = frozenset({+ "circle",+ "ellipse",+ "line",+ "path",+ "polygon",+ "polyline",+ "rect",+})ET.register_namespace("", SVG_NS)ET.register_namespace("xlink", XLINK_NS)@@ -481,6 +493,211 @@ def _authoring_manifest_bytes().encode("utf-8")+def _authoring_document_kind(path: Path) -> str:+ name = path.name+ if name.startswith("master_"):+ return "master"+ if name.startswith("layout_"):+ return "layout"+ if name.startswith("slide_"):+ return "slide"+ return "generic"+++def _authoring_summary_document(+ path: Path,+ relative_name: str,+) -> dict[str, object]:+ try:+ root = ET.parse(path).getroot()+ except (OSError, ET.ParseError) as exc:+ raise ValueError(f"Cannot summarize authoring SVG {path}: {exc}") from exc+ if _local_name(root.tag) != "svg":+ raise ValueError(f"Authoring document root is not <svg>: {path}")++ elements = list(root.iter())+ icon_references = sorted({+ icon_name+ for element in elements+ if (icon_name := element.get("data-icon"))+ })+ text_elements = [+ element for element in elements+ if _local_name(element.tag) == "text"+ ]+ return {+ "file": relative_name,+ "kind": _authoring_document_kind(path),+ "bytes": path.stat().st_size,+ "viewBox": root.get("viewBox"),+ "elements": len(elements),+ "top_level_elements": len(root),+ "drawables": sum(+ _local_name(element.tag) in _DRAWABLE_TAGS+ for element in elements+ ),+ "text_elements": len(text_elements),+ "text_characters": sum(+ len("".join(element.itertext()))+ for element in text_elements+ ),+ "images": sum(+ _local_name(element.tag) == "image"+ for element in elements+ ),+ "icon_uses": sum(+ element.get("data-icon") is not None+ for element in elements+ ),+ "icon_refs": icon_references,+ "placeholders": sum(+ element.get("data-pptx-placeholder") is not None+ for element in elements+ ),+ "inline_source_refs": sum(+ element.get(SOURCE_REF_ATTRIBUTE) is not None+ for element in elements+ ),+ }+++def _load_authoring_summary_manifest(+ authoring_dir: Path,+) -> tuple[dict[str, object], list[str]]:+ manifest_path = authoring_dir / AUTHORING_MANIFEST_NAME+ try:+ manifest = json.loads(manifest_path.read_text(encoding="utf-8"))+ except FileNotFoundError as exc:+ raise ValueError(+ f"Authoring manifest not found: {manifest_path}"+ ) from exc+ except (OSError, json.JSONDecodeError) as exc:+ raise ValueError(+ f"Cannot decode authoring manifest {manifest_path}: {exc}"+ ) from exc+ if not isinstance(manifest, dict) or manifest.get("schema") != AUTHORING_SCHEMA:+ raise ValueError(+ f"Unsupported authoring manifest schema in {manifest_path}"+ )+ documents = manifest.get("documents")+ if not isinstance(documents, list):+ raise ValueError(+ f"Authoring manifest documents must be an array: {manifest_path}"+ )++ names: list[str] = []+ for index, document in enumerate(documents):+ if not isinstance(document, dict):+ raise ValueError(+ f"Authoring manifest documents[{index}] must be an object"+ )+ name = document.get("authoring")+ relative = Path(name) if isinstance(name, str) else Path()+ if (+ not isinstance(name, str)+ or not name+ or relative.is_absolute()+ or any(part in {"", ".", ".."} for part in relative.parts)+ or relative.suffix.lower() != ".svg"+ ):+ raise ValueError(+ f"Authoring manifest documents[{index}].authoring is invalid"+ )+ names.append(name)+ if len(names) != len(set(names)):+ raise ValueError("Authoring manifest contains duplicate document names")++ actual_names = sorted(+ path.relative_to(authoring_dir).as_posix()+ for path in authoring_dir.rglob("*.svg")+ if path.is_file()+ )+ if sorted(names) != actual_names:+ raise ValueError(+ "Authoring manifest/file roster differs while building summary"+ )+ return manifest, sorted(names)+++def _authoring_summary_bytes(authoring_dir: Path) -> bytes:+ manifest, document_names = _load_authoring_summary_manifest(authoring_dir)+ documents = [+ _authoring_summary_document(authoring_dir / name, name)+ for name in document_names+ ]+ total_icon_assets = {+ icon_name+ for document in documents+ for icon_name in document["icon_refs"]+ }+ totals = {+ "svg_bytes": sum(int(document["bytes"]) for document in documents),+ "elements": sum(int(document["elements"]) for document in documents),+ "top_level_elements": sum(+ int(document["top_level_elements"])+ for document in documents+ ),+ "drawables": sum(int(document["drawables"]) for document in documents),+ "text_elements": sum(+ int(document["text_elements"])+ for document in documents+ ),+ "text_characters": sum(+ int(document["text_characters"])+ for document in documents+ ),+ "images": sum(int(document["images"]) for document in documents),+ "icon_uses": sum(int(document["icon_uses"]) for document in documents),+ "unique_icon_assets": len(total_icon_assets),+ "placeholders": sum(+ int(document["placeholders"])+ for document in documents+ ),+ "inline_source_refs": sum(+ int(document["inline_source_refs"])+ for document in documents+ ),+ "machine_source_refs": manifest.get("source_ref_count"),+ }+ payload = {+ "schema": AUTHORING_SUMMARY_SCHEMA,+ "projection_kind": manifest.get("projection_kind"),+ "authoring_root": ".",+ "machine_manifest": AUTHORING_MANIFEST_NAME,+ "machine_manifest_policy": "tool-only; do not load into model context",+ "file_count": len(documents),+ "totals": totals,+ "documents": documents,+ }+ return (+ json.dumps(payload, ensure_ascii=False, indent=2) + "\n"+ ).encode("utf-8")+++def write_authoring_summary(authoring_dir: Path) -> Path:+ """Regenerate the model-readable summary from the current authoring SVGs."""+ authoring_dir = Path(authoring_dir).resolve()+ if not authoring_dir.is_dir():+ raise ValueError(f"Authoring directory not found: {authoring_dir}")+ payload = _authoring_summary_bytes(authoring_dir)+ summary_path = authoring_dir / AUTHORING_SUMMARY_NAME+ with tempfile.NamedTemporaryFile(+ prefix=f".{AUTHORING_SUMMARY_NAME}.",+ suffix=".tmp",+ dir=authoring_dir,+ delete=False,+ ) as handle:+ temporary_path = Path(handle.name)+ handle.write(payload)+ try:+ temporary_path.chmod(0o644)+ temporary_path.replace(summary_path)+ except OSError:+ temporary_path.unlink(missing_ok=True)+ raise+ return summary_path++def _nearest_existing_directory(path: Path) -> Path:candidate = pathwhile not os.path.lexists(candidate):@@ -632,6 +849,13 @@ def project_svg_batch())staged.append((manifest_path, staged_manifest))+ staged_summary = write_authoring_summary(new_root)+ staged.append(+ (+ output_dir / AUTHORING_SUMMARY_NAME,+ staged_summary,+ )+ )if not output_dir.exists():created: list[Path] = []@@ -699,9 +923,16 @@ def build_parser() -> argparse.ArgumentParser:"-o","--output-dir",type=Path,- required=True,help="Explicit destination directory for projected SVG copies",)+ parser.add_argument(+ "--refresh-summary",+ action="store_true",+ help=(+ "Regenerate authoring_summary.json for an existing authoring "+ "bundle; input must be that bundle directory and -o is omitted"+ ),+ )parser.add_argument("--force",action="store_true",@@ -714,19 +945,41 @@ def build_parser() -> argparse.ArgumentParser:"--projection-kind",choices=("layered", "flat", "generic"),default="generic",- help="Record the IR representation kind in authoring_manifest.json",+ help="Record the IR representation kind in bundle metadata",)return parserdef main(argv: Optional[list[str]] = None) -> int:- args = build_parser().parse_args(argv)+ parser = build_parser()+ args = parser.parse_args(argv)input_path = args.input.resolve()- output_dir = args.output_dir.resolve()if not input_path.exists():print(f"Error: input does not exist: {input_path}", file=sys.stderr)return 1+ if args.refresh_summary:+ if args.output_dir is not None:+ print(+ "Error: --refresh-summary does not accept -o/--output-dir",+ file=sys.stderr,+ )+ return 1+ try:+ summary_path = write_authoring_summary(input_path)+ except (OSError, ValueError) as exc:+ print(f"Error: {exc}", file=sys.stderr)+ return 1+ print(json.dumps({+ "authoring_dir": str(input_path),+ "summary": str(summary_path),+ "summary_bytes": summary_path.stat().st_size,+ }, ensure_ascii=False, indent=2))+ return 0+ if args.output_dir is None:+ parser.error("-o/--output-dir is required unless --refresh-summary is used")+ output_dir = args.output_dir.resolve()+if output_dir.exists() and not output_dir.is_dir():print(f"Error: output path is not a directory: {output_dir}", file=sys.stderr)return 1@@ -749,6 +1002,9 @@ def main(argv: Optional[list[str]] = None) -> int:manifest_path = output_dir / AUTHORING_MANIFEST_NAMEif os.path.lexists(manifest_path):collisions.append(manifest_path)+ summary_path = output_dir / AUTHORING_SUMMARY_NAME+ if os.path.lexists(summary_path):+ collisions.append(summary_path)if collisions and not args.force:print(f"Error: {len(collisions)} output file(s) already exist; "@@ -786,6 +1042,7 @@ def main(argv: Optional[list[str]] = None) -> int:"input": str(input_path),"output_dir": str(output_dir),"manifest": str(output_dir / AUTHORING_MANIFEST_NAME),+ "summary": str(output_dir / AUTHORING_SUMMARY_NAME),"projection_kind": args.projection_kind,"file_count": len(reports),"files": [report.as_dict() for report in reports],diff --git a/skills/ppt-master/workflows/create-template.md b/skills/ppt-master/workflows/create-template.mdindex c68420c8..54a1c480 100644--- a/skills/ppt-master/workflows/create-template.md+++ b/skills/ppt-master/workflows/create-template.md@@ -159,7 +159,14 @@ Only when the import explicitly used `--inheritance-mode both`, create the optiopython3 skills/ppt-master/scripts/svg_authoring_view.py "<import_workspace>/svg-flat" -o "<import_workspace>/authoring-svg-flat" --projection-kind flat```-Each bundle contains editable SVGs plus `authoring_manifest.json`. The projection removes opaque text payload, duplicate hidden geometry carriers, and import-only identity attributes while keeping visible shape intent, compact preset/frame metadata, structure markers, logical ids, valid asset references, and a reserved `data-pptx-source-ref` on each imported logical object. The manifest records relative source files, document hashes, source paths, and initial authoring-subtree hashes; it does not duplicate opaque payload. Source refs are unique within one document and are interpreted together with that document's manifest record.+Each bundle contains editable SVGs, a model-readable `authoring_summary.json`, and a tool-only `authoring_manifest.json`. The projection removes opaque text payload, duplicate hidden geometry carriers, and import-only identity attributes while keeping visible shape intent, compact preset/frame metadata, structure markers, logical ids, valid asset references, and a reserved `data-pptx-source-ref` on each imported logical object. The summary lists the current SVG roster plus per-file canvas, size, text, image, vector, placeholder, and source-ref counts. The machine manifest records relative source files, document hashes, source paths, and initial authoring-subtree hashes; it does not duplicate opaque payload and MUST NOT enter model context. Source refs are unique within one document and are interpreted by tools together with that document's manifest record.++In-place vector and picture normalization refreshes the summary automatically.+After any other direct IR edit, refresh it before the next analysis pass:++```bash+python3 skills/ppt-master/scripts/svg_authoring_view.py "<import_workspace>/authoring-svg" --refresh-summary+````authoring-svg/` is the canonical editable IR for template creation. The lossless trees are read only by materialization when an unchanged referenced object needs supported native payload or fallback evidence. Do not edit or copy the lossless SVGs directly. The IR is not a finished template directory and must be materialized into validated `<template_workspace>/templates/*.svg` before preview or export.@@ -183,7 +190,7 @@ python3 skills/ppt-master/scripts/extract_svg_assets.py "<import_workspace>/authpython3 skills/ppt-master/scripts/extract_svg_assets.py "<import_workspace>/authoring-svg-flat" --icons-dir "<import_workspace>/icons" --icon-namespace imported --reuse-inventory "<import_workspace>/authoring-svg_vector_asset_inventory.json" --inplace --id-prefix flat --min-decoration-bytes 3000 --clean-stale```-The authoring SVGs in `<import_workspace>/authoring-svg/` and, when requested, `<import_workspace>/authoring-svg-flat/` are rewritten in place with compact `<use data-icon="imported/..."/>` placeholders. Extracted assets have one canonical copy under `<import_workspace>/icons/imported/`; never duplicate them under `templates/icons/`. The root `icons/` directory remains a namespace container and must not contain rewritten page SVGs or inventories. The inventory is written beside the processed IR directory and records every preserved `data-pptx-source-ref`; re-inlining an asset therefore re-establishes the referenced object mapping before materialization. The existing icon embedding path re-inlines the extracted assets before final export, preserving multi-color artwork and non-square viewBox geometry as native SVG shapes. Text-bearing groups are never extracted; text must stay readable/editable in the working SVG. Extraction triggers on either many drawable elements or a large pure-vector XML block, so long single-path illustrations are factored out too. Pure-vector decoration runs inside text-bearing groups use a lower size threshold, allowing card borders and decorative paths to be extracted without hiding text. Referenced defs (`gradient` / `pattern` / `filter` / `clipPath` / `marker`) are copied into each asset and namespaced so the asset is self-contained after re-inline. If both layered and flat views are processed into the same icon namespace, keep distinct `--id-prefix` values to avoid asset ID collisions. `--clean-stale` removes only stale generated assets for the current SVG filenames and prefix inside the selected namespace; it is safe in this import workspace but should not be used against a shared hand-curated icon directory without a specific prefix.+The authoring SVGs in `<import_workspace>/authoring-svg/` and, when requested, `<import_workspace>/authoring-svg-flat/` are rewritten in place with compact `<use data-icon="imported/..."/>` placeholders. Each in-place extraction refreshes that bundle's `authoring_summary.json` automatically. Extracted assets have one canonical copy under `<import_workspace>/icons/imported/`; never duplicate them under `templates/icons/`. The root `icons/` directory remains a namespace container and must not contain rewritten page SVGs or inventories. The inventory is written beside the processed IR directory and records every preserved `data-pptx-source-ref`; re-inlining an asset therefore re-establishes the referenced object mapping before materialization. The existing icon embedding path re-inlines the extracted assets before final export, preserving multi-color artwork and non-square viewBox geometry as native SVG shapes. Text-bearing groups are never extracted; text must stay readable/editable in the working SVG. Extraction triggers on either many drawable elements or a large pure-vector XML block, so long single-path illustrations are factored out too. Pure-vector decoration runs inside text-bearing groups use a lower size threshold, allowing card borders and decorative paths to be extracted without hiding text. Referenced defs (`gradient` / `pattern` / `filter` / `clipPath` / `marker`) are copied into each asset and namespaced so the asset is self-contained after re-inline. If both layered and flat views are processed into the same icon namespace, keep distinct `--id-prefix` values to avoid asset ID collisions. `--clean-stale` removes only stale generated assets for the current SVG filenames and prefix inside the selected namespace; it is safe in this import workspace but should not be used against a shared hand-curated icon directory without a specific prefix.The layered pass owns the canonical extracted-vector pool. Each new asset records a source fingerprint before generated ID namespacing. The flat pass MUST consume the layered inventory through `--reuse-inventory`: an exact fingerprint match writes only a `<use>` reference to the existing layered asset, while an unmatched flat-only subtree may create one new asset under the `flat` prefix. Do not independently extract the two views into parallel asset sets. With `--clean-stale`, a rerun also removes obsolete generated `flat_*` duplicates while retaining every reused layered reference.@@ -231,29 +238,32 @@ does not turn those vectors into a picture.| Mode | Required read set ||---|---|-| `standard` / `fidelity` | `manifest.json`, exported assets, `svg/inheritance.json`, `authoring-svg/authoring_manifest.json`, and every cleaned layered IR document (`authoring-svg/master_*.svg` / `layout_*.svg` / `slide_NN.svg`). The layered IR is the complete read surface: it covers Layouts unused by any sample slide (invisible in `svg-flat/` yet still template vocabulary), and per-page composition follows from `inheritance.json`. Cleaned flat pages are optional composition spot checks, not a required second pass over the same shapes. Source topology remains non-binding; the two modes differ in output design (`fidelity` designs a broader roster covering the useful visual range), not in read coverage. |-| `mirror` | `manifest.json`, `native_structure.json`, `svg/inheritance.json`, `authoring-svg/authoring_manifest.json`, and every cleaned layered Master/Layout/Slide IR document. The layered `authoring-svg/` tree is the sole editable and materialization input. Cleaned `authoring-svg-flat/` slides are optional visual composition checks only; never edit or feed them into template materialization. Materialization may resolve unchanged refs against the matching lossless backing without placing opaque payload in model context. |+| `standard` / `fidelity` | `manifest.json`, exported assets, `svg/inheritance.json`, `authoring-svg/authoring_summary.json`, and every cleaned layered IR document (`authoring-svg/master_*.svg` / `layout_*.svg` / `slide_NN.svg`). Do not read `authoring_manifest.json`; it is compiler-only. The layered IR is the complete read surface: it covers Layouts unused by any sample slide (invisible in `svg-flat/` yet still template vocabulary), and per-page composition follows from `inheritance.json`. Cleaned flat pages are optional composition spot checks, not a required second pass over the same shapes. Source topology remains non-binding; the two modes differ in output design (`fidelity` designs a broader roster covering the useful visual range), not in read coverage. |+| `mirror` | `manifest.json`, `native_structure.json`, `svg/inheritance.json`, `authoring-svg/authoring_summary.json`, and every cleaned layered Master/Layout/Slide IR document. Do not read `authoring_manifest.json`; `mirror_template_materialize.py` loads and validates it internally. The layered `authoring-svg/` tree is the sole editable and materialization input. Cleaned `authoring-svg-flat/` slides are optional visual composition checks only; never edit or feed them into template materialization. Materialization may resolve unchanged refs against the matching lossless backing without placing opaque payload in model context. |Use the compact facts in `manifest.json` for orientation. Use screenshots or the original PPTX only for visual cross-checking. Do not bulk-read opaque lossless payload into model context.Interpretation rule (carries forward into Steps 2 and 4):- `manifest.json` is the source of truth for facts about the source deck: slide size, theme colors, fonts, background inheritance, reusable asset inventory, declared source layout/master structure, and slide reuse relationships. It dictates which source facts mirror may preserve during materialization, but not `standard` / `fidelity` output topology.+- `authoring_summary.json` is the model-facing index for the current authoring SVG roster and readability statistics. Regenerate it after direct IR edits before analysis.+- `authoring_manifest.json` is machine-only provenance. Do not open or quote it in model context; the mirror compiler validates it internally against the edited IR and immutable backing.- `native_structure.json` is the source of truth for source PowerPoint identity: stable layout keys, picker names, parent masters, placeholder types/indices, and the source-package hash. Mirror preserves those facts one-to-one. `standard` / `fidelity` do not mine them into the new structure.- `manifest.json`, `native_structure.json`, and `svg/inheritance.json` intentionally overlap only at contract boundaries so materialization can cross-check source identity, graph ownership, and visibility; do not collapse them into a cache or substitute one for another- exported `assets/` are the canonical reusable image pool — `<image>` references in `svg/` already point at these files directly-- exported `icons/imported/*.svg` files are the canonical reusable vector illustration pool, but they are **not** part of the default read set. Read the cleaned SVGs and `*_vector_asset_inventory.json` first; open a specific imported SVG only when the cleaned page or inventory shows that the extracted asset is relevant to the current design decision. This is what makes the SVG work surface smaller.+- exported `icons/imported/*.svg` files are the canonical reusable vector illustration pool, but they are **not** part of the default read set. Use `authoring_summary.json` `icon_refs` and the cleaned SVGs first. Query `*_vector_asset_inventory.json` by an exact asset id only when source-ref or fingerprint detail is required; do not load the complete inventory into model context. Open a specific imported SVG only when that asset affects the current design decision.- cleaned layered authoring SVGs are the mirror editing and verification surface; they expose source ownership without requiring the model to read opaque payload. Do not use them to promote, demote, merge, or split source structure.- cleaned complete-page IR documents are optional composition spot checks for authored modes and verification views for mirror. They never replace the layered editable IR or immutable payload backing.- screenshots remain useful for judging composition and style, but should not override extracted factual metadata unless the import result is clearly incomplete**Mirror complete-graph gate**: compare every `native_structure.json` Layout-and Master with the layered authoring manifest before offering `mirror`.+and Master with the layered `authoring_summary.json` roster before offering `mirror`.Every source Layout—including one unused by all source slides—must have alayered IR document and matching payload backing from which a reusabledefinition SVG can be materialized. Every source Master must own at least one retained Layout. Missing IR documentsor ambiguous parentage are blocking; unused identities themselves are supported-and must not be dropped.+and must not be dropped. The compiler performs the exact source-ref and hash+checks from `authoring_manifest.json`.### Basic norm extraction (mandatory when reference content exists)@@ -274,12 +284,12 @@ Distinguish observed facts from template rules: "`slide_07` uses a left photo cr**Read gate**:-- `standard` / `fidelity`: read and report every layered IR Master, Layout, and Slide plus the inheritance map; flat pages are optional spot checks-- `mirror`: verify and report every layered IR Master, Layout, and Slide plus the authoring manifest and inheritance map, while keeping opaque payload out of model context+- `standard` / `fidelity`: read `authoring_summary.json`, every layered IR Master, Layout, and Slide, and the inheritance map; flat pages are optional spot checks+- `mirror`: read `authoring_summary.json`, verify and report every layered IR Master, Layout, and Slide plus the inheritance map, and leave `authoring_manifest.json` to the compilerDo not treat authoring IR documents as final template assets. `standard` / `fidelity` author new SVGs from the confirmed brief and IR references. Mirror edits the IR and materializes it with lossless native-payload backing.-> **Mirror-mode materialization path** — use `native_structure.json`, `svg/inheritance.json`, and the authoring manifest as structural/provenance authority. The cleaned layered IR is the editable source and lossless layered SVGs are immutable payload backing; optional flat SVGs are verification-only. Preserve only the roster, appearance, ownership, placeholders, converter-supported native metadata, and available SVG fallbacks that are actually present and validated; do not synthesize missing facts or a different graph.+> **Mirror-mode materialization path** — use `native_structure.json` and `svg/inheritance.json` as model-readable structural authority. The cleaned layered IR is the editable source, `authoring_summary.json` is its model-facing index, and lossless layered SVGs are immutable payload backing; optional flat SVGs are verification-only. `mirror_template_materialize.py` consumes the machine manifest internally. Preserve only the roster, appearance, ownership, placeholders, converter-supported native metadata, and available SVG fallbacks that are actually present and validated; do not synthesize missing facts or a different graph.### 1B. Existing SVG assets@@ -297,7 +307,8 @@ that contains both the IR and every local dependency referenced by theselected group. This does not authorize automatic group selection or mutationof the user's original SVG directory.-Then `ls` the analysis workspace and `Read` every cleaned `authoring-svg/*.svg` to extract:+Then read `authoring-svg/authoring_summary.json`, `ls` the analysis workspace,+and read every cleaned `authoring-svg/*.svg` to extract:- canvas size (`viewBox` on the root `<svg>`)- recurring colors (`fill` / `stroke` values; identify the dominant 2–4 hex codes as candidate theme colors)@@ -305,7 +316,12 @@ Then `ls` the analysis workspace and `Read` every cleaned `authoring-svg/*.svg`- placeholder usage (existing `{{...}}` strings, if any)- structural decoration (recurring `<rect>` bars, `<path>` motifs, embedded `<image>` references)-Read the generated `*_vector_asset_inventory.json` before opening individual `<svg_analysis_workspace>/icons/imported/*.svg`; do not bulk-read extracted vectors unless a specific asset affects a design decision or is selected for mirror preservation.+Use `authoring_summary.json` `icon_refs` before opening individual+`<svg_analysis_workspace>/icons/imported/*.svg`. Query the generated+`*_vector_asset_inventory.json` by exact asset id only when provenance,+source-ref, or fingerprint detail is required. Do not bulk-read the inventory+or extracted vectors unless a specific asset affects a design decision or is+selected for mirror preservation.If a `design_spec.md` or `spec_lock.md` accompanies the SVGs, read it too. In mirror it is part of the source contract and must agree with the SVG identities; in `standard` / `fidelity` it is visual/contextual reference only. Record the equivalent of a `manifest.json`'s factual fields in analysis notes so Step 2 can label them `[fact]`.@@ -471,12 +487,12 @@ When the bundle includes Type A, pass the following internal package to the role- `native_structure.json` and `source_template.pptx`- `conversion-report.json` when source-recovery diagnostics exist- exported `assets/`-- `*_vector_asset_inventory.json`, when the vector readability pass extracted assets; do not bulk-read `icons/imported/*.svg`-- editable layered IR documents and manifest from `authoring-svg/`; optional `authoring-svg-flat/` is a visual cross-check only and never a template materialization input+- `*_vector_asset_inventory.json`, when the vector readability pass extracted assets, as an exact-id query surface only; do not load it or `icons/imported/*.svg` wholesale+- `authoring-svg/authoring_summary.json` and editable layered IR documents; keep `authoring_manifest.json` bundled for compiler use but do not load it into the role context; optional `authoring-svg-flat/` is a visual cross-check only and never a template materialization input- for `mirror` only, matching immutable `svg/` payload backing plus `svg/inheritance.json`; immutable `svg-flat/` remains an optional visual cross-check- optional screenshots, if available-When the bundle includes Type B, pass the cleaned SVG file list from the analysis workspace, `*_vector_asset_inventory.json` if extraction ran, any companion `design_spec.md` / `spec_lock.md`, and the analysis notes. Do not bulk-read extracted vectors; open individual `icons/imported/*.svg` files only when needed.+When the bundle includes Type B, pass `authoring_summary.json`, the cleaned SVG file list from the analysis workspace, `*_vector_asset_inventory.json` as an exact-id query surface if extraction ran, any companion `design_spec.md` / `spec_lock.md`, and the analysis notes. Do not bulk-read the inventory or extracted vectors; open individual `icons/imported/*.svg` files only when needed.When the bundle includes Type C, pass the image file list and the visual analysis notes.When the bundle includes Type D, pass the direct text, converted document/website outputs, traceable source list, explicit asset inventory, and analysis notes.For Type E, pass only the finalized brief.@@ -561,9 +577,9 @@ Downstream, both template-adherence choices use `pptx_structure.mode: structured**Mirror-mode materialization contract** (type A or B): when `Replication mode: mirror`, the Template_Designer role:-1. **Materializes one output SVG per source page** in `<template_workspace>/templates/`. Edit and normalize the matching `authoring-svg/` IR document, then materialize it with the authoring manifest, native structure facts, and immutable payload backing. Type A must use `mirror_template_materialize.py`; do not hand-copy or independently rebuild its graph. Preserve the source Master/Layout keys and picker names, Layout parentage, slide assignment, placeholder type/index/bounds, inherited-shape visibility, ownership, paint order, and supported native metadata that are present and validated. Mechanical namespace, root-declaration, asset-path, and fixed-layer group normalization is allowed only when source ownership and appearance remain unchanged.- - Type A authoring source: `<import_workspace>/authoring-svg/` plus its `authoring_manifest.json`; `<import_workspace>/svg/`, `svg/inheritance.json`, and `native_structure.json` provide payload and structural backing. Optional `<import_workspace>/svg-flat/` is verification-only.- - Type B authoring source: `<svg_analysis_workspace>/authoring-svg/` plus its manifest; the complete explicit source SVG contract is immutable backing+1. **Materializes one output SVG per source page** in `<template_workspace>/templates/`. Edit and normalize the matching `authoring-svg/` IR document, then run `mirror_template_materialize.py`; the compiler consumes the tool-only authoring manifest together with native structure facts and immutable payload backing. Do not hand-copy or independently rebuild its graph. Preserve the source Master/Layout keys and picker names, Layout parentage, slide assignment, placeholder type/index/bounds, inherited-shape visibility, ownership, paint order, and supported native metadata that are present and validated. Mechanical namespace, root-declaration, asset-path, and fixed-layer group normalization is allowed only when source ownership and appearance remain unchanged.+ - Type A model-facing source: `<import_workspace>/authoring-svg/authoring_summary.json` plus the editable SVGs; `<import_workspace>/svg/`, `svg/inheritance.json`, and `native_structure.json` provide payload and structural backing. The compiler alone reads `<import_workspace>/authoring-svg/authoring_manifest.json`. Optional `<import_workspace>/svg-flat/` is verification-only.+ - Type B model-facing source: `<svg_analysis_workspace>/authoring-svg/authoring_summary.json` plus its editable SVGs; the complete explicit source SVG contract is immutable backing- For every source Layout unused by all source slides, additionally materialize one definition-only SVG named `layout_<layout_key>.svg` from its layered authoring IR document and payload backing. It carries the exact root identity, fixed atoms, and placeholder contract but is not a generated page assignment. Use source placeholder prompts/carriers; do not invent business content. This definition SVG lets downstream export register the Layout and any otherwise-unused parent Master without retaining an internal carrier slide.2. **Renames each file** using the source-order-first convention `<NNN>_<page_type>.svg`, where `<NNN>` is the source-order index zero-padded to 3 digits and `<page_type>` is typically `cover` / `toc` / `chapter` / `content` / `ending` (fall back to `content` when the type cannot be confidently classified). Examples: `001_cover.svg`, `002_toc.svg`, `003_content.svg`, ..., `050_ending.svg`.- Type A: derive `<page_type>` from `manifest.json.pageTypeCandidates`