Repository navigation
feat(deck): notesMode keep|strip|export — speaker notes policy for the PPTX build - #666
Conversation
…e PPTX build
deck.json "notesMode" decides what the build does with each slide's "notes":
"keep" (default, unchanged) writes them as speaker notes; "strip" leaves them
out of the .pptx; "export" leaves them out and writes <output stem>.notes.md
next to the .pptx (one "## pageNN — title" section per slide, {{...}} styling
removed), returned as notes_path by generate / generate_pptx.
A deck handed to an audience must not carry the presenter's script, which
imported slides often bring along in their original notes. The slide files keep
their notes, so composing and check_specs are unchanged; an invalid value is a
check_specs error and stops the build (no silent default). Partial builds
(only_slugs / iso.pptx) write no notes file.
- engine/schema: NOTES_MODES, deck_notes_mode(), validate_specs error
- engine/builder: PPTXBuilder(write_notes=...)
- engine/notes.py: plain_notes_text, speaker_notes_markdown
- api: BuildConfig.notes_mode, generate() export + notes_path
- guide slide-json-spec.md, CHANGELOG, tests/test_notes_mode.py (22)
|
🤖 KiroCrew automated comment: review drafted by KiroCrew on behalf of the maintainers. It does not approve or merge.
|
…e notes file cleanup; PPTX-only note Review on aws-samples#666: 1. servers/remote generate_pptx built into a temp workspace and uploaded only the .pptx, so "export" silently acted like "strip" on the AWS stack. The notes file now goes to pptx/<deckId>/<build>.notes.md (same build id as the .pptx), the deck record gets notesS3Key (cleared on a keep/strip rebuild), the superseded notes object is deleted like the old .pptx, and the result carries notesS3Key plus a signed notesUrl. 2. A full build in keep/strip mode deletes a <stem>.notes.md left by an earlier export build; partial builds never touch it. 3. Guide: PPTX decks only (HTML decks keep their <aside class="notes">). Tests: test_mcp_generate (export upload + keep clears), test_notes_mode (stale cleanup).
|
Thanks for the review. All three points addressed in the follow-up commit:
CHANGELOG updated. |
|
Thanks, @hmkim. All three points from round 1 are addressed with tests: the remote A few small follow-ups we will handle on our side after merge, so nothing more is needed from you:
|
* feat(deck)!: speakerNotes pptx|markdown replaces notesMode deck.json "notesMode" (keep|strip|export, #666, unreleased) becomes "speakerNotes": "pptx" (default, notes written as speaker notes) or "markdown" (left out of the .pptx, written to <output stem>.notes.md). "strip" is removed; no compatibility for the old key or values: a leftover "notesMode" is ignored like any unknown key. SPEAKER_NOTES / deck_speaker_notes() replace NOTES_MODES / deck_notes_mode(); BuildConfig.speaker_notes, _notes_markdown_path(). CHANGELOG [Unreleased] rewritten for the new name and values, plus the deck-json-spec guide entry. Verified: make lint (ruff) passed; make test 3673 passed, 18 skipped (run on the full PR 1 tree; the icon catalog was linked in from the downloaded assets, without it test_svg_icon_is_inlined_with_prefixed_ids fails on the missing catalog). * feat(guides): deck-json-spec guide, returned by start_presentation as static.deck_spec New guide deck-json-spec lists every deck.json field of PPTX and HTML decks (template, fonts, defaultTextColor, defaultBackground, slideSize, outputFormat, title, language, speakerNotes, autoSpacing): required or optional, default, who writes it, which format it affects, and that the style fields stay fixed after apply_style. slide-json-spec and slide-html-spec keep the folder figure and point to it. start_presentation returns it as static.deck_spec (preloaded with the other references); the L4 orchestrator modes place it in the system prompt right after the role document, before the cache point. orchestrator.md is unchanged. Verified: make lint (ruff) passed; make test 3673 passed, 18 skipped. New tests: test_entry_tools (static.deck_spec, slide specs point to the guide), test_agent_modes (deck_spec part before the cache point in orchestrator/vibe/spec; resolved system prompt contains it with one start_presentation call), test_agent_assembly (text reaches the agent).
* feat(deck)!: speakerNotes pptx|markdown replaces notesMode deck.json "notesMode" (keep|strip|export, #666, unreleased) becomes "speakerNotes": "pptx" (default, notes written as speaker notes) or "markdown" (left out of the .pptx, written to <output stem>.notes.md). "strip" is removed; no compatibility for the old key or values: a leftover "notesMode" is ignored like any unknown key. SPEAKER_NOTES / deck_speaker_notes() replace NOTES_MODES / deck_notes_mode(); BuildConfig.speaker_notes, _notes_markdown_path(). CHANGELOG [Unreleased] rewritten for the new name and values, plus the deck-json-spec guide entry. Verified: make lint (ruff) passed; make test 3673 passed, 18 skipped (run on the full PR 1 tree; the icon catalog was linked in from the downloaded assets, without it test_svg_icon_is_inlined_with_prefixed_ids fails on the missing catalog). * feat(guides): deck-json-spec guide, returned by start_presentation as static.deck_spec New guide deck-json-spec lists every deck.json field of PPTX and HTML decks (template, fonts, defaultTextColor, defaultBackground, slideSize, outputFormat, title, language, speakerNotes, autoSpacing): required or optional, default, who writes it, which format it affects, and that the style fields stay fixed after apply_style. slide-json-spec and slide-html-spec keep the folder figure and point to it. start_presentation returns it as static.deck_spec (preloaded with the other references); the L4 orchestrator modes place it in the system prompt right after the role document, before the cache point. orchestrator.md is unchanged. Verified: make lint (ruff) passed; make test 3673 passed, 18 skipped. New tests: test_entry_tools (static.deck_spec, slide specs point to the guide), test_agent_modes (deck_spec part before the cache point in orchestrator/vibe/spec; resolved system prompt contains it with one start_presentation call), test_agent_assembly (text reaches the agent). * feat(engine): strip_speaker_notes removes notes from a stored PPTX sdpm.engine.notes.strip_speaker_notes(source, target) drops every slide's notes-slide relationship and saves the copy (no rebuild); returns how many notes slides it removed. shared.artifact_keys.no_notes_pptx_key names the cached copy beside its build: pptx/<deck>/<build>.nonotes.pptx. Ran: uv run pytest -q tests/test_speaker_notes.py tests/test_artifact_keys.py (35 passed) * fix(remote): run_python rebuild uploads speakerNotes markdown and updates notesS3Key PptxRefresh.notes_path carries the Markdown the full build wrote with speakerNotes "markdown". _refresh_pptx_artifact uploads it beside the PPTX (same build id) and sets notesS3Key (cleared with "pptx"), as generate_pptx does. Both delete the superseded build's .notes.md and .nonotes.pptx copy. Ran: uv run pytest -q tests/test_refresh_pptx.py tests/test_run_python_pptx_characterization.py tests/test_mcp_generate.py tests/test_run_python_semantics.py (all passed) * feat(api): PPTX download without speaker notes GET /decks/{id}/pptx?notes=without signs a copy of the stored PPTX without speaker notes. The first such request makes it with sdpm.engine.notes.strip_speaker_notes and keeps it beside the build (pptx/<deck>/<build>.nonotes.pptx); later requests reuse it. Same read permission and 404s as the plain download. The deck list items and the deck detail carry speakerNotes ("markdown" when the record has notesS3Key). Ran: uv run pytest -q tests/test_api_html_routes.py tests/test_api_public_decks.py (51 passed) * feat(web-ui): local PPTX download without speaker notes GET /api/decks/{id}/pptx?notes=without runs sdpm.engine.notes.strip_speaker_notes through uv run (servers/local environment) into a fresh temp dir, serves the copy with the same headers and removes the dir; an engine failure is a 500. The local deck list and detail carry speakerNotes ("markdown" when output.notes.md sits beside output.pptx). Ran: cd web-ui && npx vitest run src/app/api/decks (all passed; the uv-backed route.engine.test.ts ran, not skipped) * feat(web-ui): download PPTX with or without notes The deck card "..." menu has two download items, with notes and without notes (both modes). The cloud deck view's PPTX link becomes a small menu with the same two choices; each asks for a fresh signed URL. The local "Open PPTX" button is unchanged. "With notes" is disabled for a deck whose stored PPTX was built with speakerNotes "markdown"; both items show for a deck without notes. en/ja messages added (deckCard, carousel). Ran (web-ui): npx eslint src/ --quiet && npx tsc --noEmit && npm test (133 files, 1535 tests passed) && npm run build:cloud (ok); en/ja key parity check OK; package-lock.json unchanged * docs: changelog and storage layout for the PPTX download without notes Full verification of PR 2 on this commit: - make lint: passed (ruff, all checks) - make test: 3693 passed, 18 skipped (with the icon catalog linked into sdpm/assets, as test_html_assemble needs it; without it that one test fails) - web-ui: npx eslint src/ --quiet && npx tsc --noEmit && npm test (133 files, 1535 tests) && npm run build:cloud: all passed; the uv-backed route.engine.test.ts ran (not skipped) - en/ja key parity: OK; package-lock.json unchanged * fix(web-ui): say "speaker notes" in the PPTX download items "Notes" alone could be read as other notes or comments in the app. en: "Download PPTX (with/without speaker notes)", carousel "With/Without speaker notes"; ja: 「PPTX をダウンロード(スピーカーノート付き/なし)」, carousel 「スピーカーノート付き」「スピーカーノートなし」. The aria labels are the same text plus ": {name}". Key names unchanged. The deck card menu was w-64 (256px); the longest label measures about 302px (ja) and 260px (en) at 14px in headless Chromium, so the menu now sizes to its content (w-max). The carousel menu already had no fixed width. Checks: en/ja parity OK, eslint pass, tsc pass, npm test 133 files / 1535 tests passed, build:cloud pass.
Follow-ups to this PR are mergedThanks again for this feature. Building on it, two follow-ups are now on
|
Summary
Adds a speaker-notes policy to
deck.json:"notesMode": "keep" | "strip" | "export".keep(default, absent = keep): unchanged behaviour, slidenotesbecome speaker notes.strip: the.pptxis built without speaker notes.export: the.pptxis built without speaker notes and they are written to<output stem>.notes.mdnext to it (output.pptx→output.notes.md; one## pageNN — title <!-- slug -->section per slide,{{...}}styling removed, links kept astext <URL>).generate/generate_pptxreturn the file asnotes_path.Why: a deck handed to an audience must not carry the presenter's script. This matters most for imported slides (
import_attachment→pptx_to_json), whose original notes often hold internal guidance that the composer never sees. Today the only way to ship such a deck is to edit everyslides/*.jsonby hand before the build, which also throws the notes away for the presenter.The slide files are never touched, so composing,
check_specsand round-trips are unchanged. An invalid value is acheck_specserror and stops the build (no silent default). Partial builds (only_slugs/iso.pptx) write no notes file, so a composer's isolated rebuild cannot overwrite the deck's export.Changes:
engine/schema(NOTES_MODES,deck_notes_mode,validate_specserror),engine/builder(PPTXBuilder(write_notes=...)), newengine/notes.py(plain_notes_text,speaker_notes_markdown),api(BuildConfig.notes_mode, export ingenerate), guideslide-json-spec.md, CHANGELOG.Checklist
make allpasses (ruff + pytest) —make lintclean;make test: 3658 passed, 19 skipped, 4 failures that also fail on untouchedmainin my environment (test_image_label_width::test_latin_label_width,test_tool_descriptions::test_description_budget[local|acp|remote]), unrelated to this changeash scan --mode local --fail-on-findings— ran with the scanners available here (bandit, checkov, cdk-nag, cfn-nag, detect-secrets, npm-audit, semgrep); no finding in any file touched by this PRsdpm/references/guides/slide-json-spec.md(deck.json section)CHANGELOG.md[Unreleased]updated for user-facing changesTesting
tests/test_notes_mode.py(22 tests): schema default/explicit/invalid values,validate_specs/check_specs, a 3-slide deck built in each mode (speaker notes present / absent in the.pptx,notes_pathreturned only forexport, Markdown content with styling removed and a(no notes)slide), partial build writes no file, invalid mode stopsgenerate, Markdown rendering without title/slugs.test_deck_spec,test_builder_notes_master,test_roundtrip,test_accessibility_metadatastill pass.Boundaries touched
sdpm/references/— one bullet added toguides/slide-json-spec.md(deck.json fields); no workflow document changed