| 1 | --- |
| 2 | description: Main-pipeline control stage for resuming execution in a fresh chat after planning completed. |
| 3 | --- |
| 4 | |
| 5 | # Resume Execute Stage |
| 6 | |
| 7 | > Generate-PPTX control stage for a fresh execution session. Run when [`generate-pptx`](../generate-pptx.md) Step 1–5 completed in a previous chat and the user wants to continue with SVG generation + export. Loads project state from disk and runs Step 6 + Step 7 inside the already selected Generate route. |
| 8 | |
| 9 | This stage is **context-independent**: it owns the execution session starting from a fresh chat — no upstream conversation context required. Persisted project artifacts replace the planning session's confirmation dialogue and image-acquisition history. |
| 10 | |
| 11 | `validation/workflow.log` is a cold command/outcome audit log with optional |
| 12 | important manual entries, not persisted planning state. Do not open or replay |
| 13 | it while resuming. Use the real artifacts in Step 1 to establish current state; |
| 14 | inspect the log only when the user explicitly asks to review the prior run. Run |
| 15 | inherited Python commands normally; their shared CLI bootstrap records a |
| 16 | bounded material outcome selection automatically, not the full console stream. |
| 17 | |
| 18 | ## When to Run |
| 19 | |
| 20 | The user opens a new chat and gives a phrase that names a project path and signals continuation. Recognize any of: |
| 21 | |
| 22 | | Pattern | Example | |
| 23 | |---|---| |
| 24 | | "继续生成 projects/<project_name>" | "继续生成 projects/ppt169_joe_hisaishi" | |
| 25 | | "resume execution projects/<project_name>" | "resume execution projects/ppt169_joe_hisaishi" | |
| 26 | | Project path + any "继续 / 恢复 / 继续做 / 接着做" semantic | "把 projects/ppt169_joe_hisaishi 继续做完" | |
| 27 | |
| 28 | **Prerequisite**: the planning session must have completed in the named project. Verified by file presence in Step 1; do NOT auto-trigger planning on missing state. |
| 29 | |
| 30 | --- |
| 31 | |
| 32 | ## Step 1: Sanity check |
| 33 | |
| 34 | Verify the two root planning artifacts exist before loading their contents: |
| 35 | |
| 36 | | File | Required when | Reason | |
| 37 | |---|---|---| |
| 38 | | `<project_path>/design_spec.md` | Always | Upstream approved design narrative and §IX page outline; its complete read occurs after the Executor role core loads | |
| 39 | | `<project_path>/spec_lock.md` | Always | Downstream execution anchors and routing contract; its complete read follows the Design Spec | |
| 40 | |
| 41 | If either file is missing, report it and stop this stage. Recover through |
| 42 | [`failure-recovery.md`](../governance/failure-recovery.md) §3; do not enter Step |
| 43 | 6, read an orphan lock as authority, or invent a replacement artifact. |
| 44 | |
| 45 | --- |
| 46 | |
| 47 | ## Step 2: Load the Generate authority, proceed from Step 6 |
| 48 | |
| 49 | ``` |
| 50 | Read skills/ppt-master/workflows/generate-pptx.md |
| 51 | ``` |
| 52 | |
| 53 | Then jump to `### Step 6: Executor Phase`. It first loads `executor-base.md`, |
| 54 | then applies that role core's context policy: |
| 55 | |
| 56 | - Read the complete project Design Spec, then the complete `spec_lock.md`, once to establish the fresh execution context |
| 57 | - Resolve the effective Speaker Notes, Custom Animations, and Narration Audio |
| 58 | outcomes from `design_spec.md §I`. Missing outcomes use the workflow defaults |
| 59 | `enabled` / `disabled` / `disabled`; these production decisions never come |
| 60 | from `spec_lock.md` |
| 61 | |
| 62 | Before the first SVG, verify every conditional dependency now discoverable |
| 63 | from that retained pair: |
| 64 | |
| 65 | | File / Directory | Required when | Reason | |
| 66 | |---|---|---| |
| 67 | | `<project_path>/notes/total.md` | Design Spec §X records a supplied final/literal narration script | Frozen verbatim narration input; never reconstruct it from the planning chat | |
| 68 | | `<project_path>/images/` plus files whose row status requires existence | `spec_lock images` references any image | `Existing` / `Generated` / `Sourced` files must exist; an absent `Needs-Manual` file remains allowed until the Step 7 readiness gate | |
| 69 | | `<project_path>/templates/` | `spec_lock page_layouts` references any | Layout / mirror prototypes required by execution | |
| 70 | | Resolver-returned Chart/Table SVG | `spec_lock page_visualizations` or legacy `page_charts` references a live Chart/Table key | Shared page-local SVG selected through the two live catalogs | |
| 71 | |
| 72 | Resolve every live Chart/Table value through the shared catalog resolver. |
| 73 | Validate canonical `family/key` from `page_visualizations` directly; opt into |
| 74 | bare-key resolution only for a live Chart/Table value read from legacy |
| 75 | `page_charts`: |
| 76 | |
| 77 | ```bash |
| 78 | python3 skills/ppt-master/scripts/visualization_recall.py validate \ |
| 79 | <family/key> [<family/key> ...] |
| 80 | python3 skills/ppt-master/scripts/visualization_recall.py validate \ |
| 81 | --legacy-bare <legacy-key> [<legacy-key> ...] |
| 82 | ``` |
| 83 | |
| 84 | Require every returned SVG to exist. Never construct a path from the key, |
| 85 | guess a family directory, or prefer one registry. Failed, missing, or ambiguous |
| 86 | live resolution is a missing planning dependency and stops this stage. A |
| 87 | retired Structure bare key carries semantic intent only and requires no SVG; |
| 88 | recover its relationship from §IX, or return to Step 4 when §IX is insufficient. |
| 89 | |
| 90 | If a conditional dependency is missing, stop before page authoring and recover |
| 91 | by artifact owner: |
| 92 | |
| 93 | - Missing frozen `notes/total.md` when §X declares a final/literal script → return to Generate Step 4's prepared final narration branch; never rewrite the script from memory. |
| 94 | - Missing `images/`, or a file whose status requires existence → recover by provenance: an `Acquire Via: user` / `Status: Existing` file is a required manual artifact, so use `failure-recovery.md` §2 and wait for the user to restore that exact file; a template-bundled bitmap returns to [`generate-pptx`](../generate-pptx.md) Step 3 to restore the selected workspace; an AI, web, or slice output uses its matching row in `failure-recovery.md` §1 to reacquire or derive it. An absent `Needs-Manual` file is not a resume failure. Formula markers are SVG authoring content and never create a required image file. |
| 95 | - Missing `templates/` inputs → restore the selected workspace through [`generate-pptx`](../generate-pptx.md) Step 3 and [`apply-template-workspace`](apply-template-workspace.md). If the workspace is unavailable or invalid, run Create Template again rather than reconstructing a template inside this stage. |
| 96 | |
| 97 | Then continue the documented pipeline: |
| 98 | |
| 99 | - When §X records a final/literal narration script, read the verified frozen `notes/total.md` once and retain its page segments through SVG authoring and the late notes validation |
| 100 | - If resuming mid-deck, read the latest completed SVG and current image metadata after their required paths have been verified |
| 101 | - Read the remaining Step 6 construction core exactly as listed in [`generate-pptx.md`](../generate-pptx.md), then read one locked preset file or only the exact `*_references` of a custom; apply one basis under its behavior or synthesize several by their stated contributions. Never reopen or glob the mode or visual-style catalogs, and load only the branches selected by the condition table |
| 102 | - For each page, make the mandatory Structure decision from retained §IX after its content/communication move is established and before any geometry; a `yes` result loads `executor-structure.md` before realization and creates no artifact or lock row |
| 103 | - Design Parameter Confirmation |
| 104 | - When structured, read the template Design Spec and each selected prototype once; retain unchanged references in the fresh context. A later bounded repair follows [`executor-base.md`](../../references/executor-base.md) §2.1 only while that context remains valid and uncompacted |
| 105 | - Generate pages sequentially from the retained planning artifacts. Use `page-context` only for the on-demand diagnostic/telemetry triggers in Executor §2.1, never as a routine pre-page load |
| 106 | - Quality Check Gate |
| 107 | - Speaker notes generation only when the effective Speaker Notes outcome is enabled |
| 108 | - Conditional custom-animation handling under the effective outcome, |
| 109 | provenance, explicit instruction, and existing-sidecar rules |
| 110 | - Step 7: Post-processing & Export (conditional `total_md_split` → `finalize_svg` |
| 111 | → `svg_to_pptx`; disabled speaker notes use `--no-notes`) |
| 112 | - After the base export, run `generate-audio` when the effective Narration Audio |
| 113 | outcome is enabled; narration implies speaker notes are enabled |
| 114 | |
| 115 | Reload the Generate authority and required execution references; do not reconstruct or replay the earlier planning conversation. |
| 116 | |
| 117 | If the user gives a newer explicit instruction after final Stage 2, update only the |
| 118 | affected effective outcome and provenance in `design_spec.md §I`, then resume at |
| 119 | its owning step. Do not reopen Confirm UI or add the decision to |
| 120 | `spec_lock.md`. Before writing, apply Generate's single notes/audio dependency |
| 121 | gate; at export, apply its sidecar suppression rules. |
| 122 | |
| 123 | **Source verification**: the execution session is fresh. Read only the relevant `sources/` passages needed to resolve explicit `Fact IDs` / source references or verify facts, quotes, names, and data required by the current §IX block. Follow [`executor-base.md`](../../references/executor-base.md) §2.1's content-vs-expression contract; source verification never authorizes a second outline. If §IX lacks executable content or evidence, stop and return to Generate Step 4 for Design Spec repair. |
| 124 | |
| 125 | > Note: this stage does NOT duplicate Step 6 / Step 7 content. `generate-pptx.md` is the authoritative procedure; resume-execute only adds the resumption entry, sanity check, and source-verification guidance. |
| 126 | |
| 127 | --- |
| 128 | |
| 129 | ## Step 3: Hand-back |
| 130 | |
| 131 | When Step 7 completes and `exports/<project_name>_<timestamp>.pptx` is produced, the stage ends. Report the export path to the user. |
| 132 | |
| 133 | If the deck contains data charts, the [`verify-charts`](verify-charts.md) stage runs between Step 6 and Step 7 as documented in [`generate-pptx`](../generate-pptx.md); resume mode handles it the same way as continuous mode. |
| 134 |