Skip to content

feat(animations): object animations and slide transitions, with a PPTX round trip - #595

Draft
naohito2000 wants to merge 88 commits into
mainfrom
feat/pptx-animations-transitions
Draft

naohito2000 wants to merge 88 commits into
mainfrom
feat/pptx-animations-transitions

Conversation

@naohito2000

@naohito2000 naohito2000 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Object animations and slide transitions, opt-in per deck, with the import side closing the
loop: a GUI-edited deck round-trips instead of losing its motion.

A slide JSON file can carry transition (how that slide enters, including Morph by object /
word / character) and animations (a main sequence plus one interactive sequence per trigger
shape). deck.json carries the two independent switches animations.enabled and
transitions.enabled. Both default to off, an absent switch is off, and a deck written
before this builds byte-identically
— the regression gate below is what holds that.

What came with it:

  • Effect descriptions on read_guides, not a tool of their own:
    read_guides(["effect:flyIn"]) answers what a gallery animation actually does, measured
    from PowerPoint rather than guessed. A bare effect: returns the routing table (which
    effects move, resize, recolour, rotate, fade, wipe or follow a path); an effect name returns
    every behaviour it writes with keyframes and durations; a transition name returns the
    parameters sets it accepts; category:emphasis returns a gallery. A name the routing
    table shows qualified is asked for that way (effect:entrance.bounce, a different effect
    from motionPath.bounce). The MCP tool count stays 20, which is what AGENTS.md and
    both getting-started pages say. It was briefly a 21st tool, describe_effects; a tool's
    description is sent on every turn of every conversation, including decks that carry no
    animation, so it came off the tool surface. "Catching up to main" below records both steps.
  • storyboard() (CLI: storyboard <deck>) renders one still frame per click. The
    ordinary preview draws every element where it is authored, which is exactly why it cannot
    show build order: an element revealed too early, never revealed, or hidden at the end of
    its own build all look correct in it. Each frame carries notes for what a still cannot show.
  • Two guides. read_guides(["animations"]) is the authoring contract and is loaded only
    when a switch is on or a slide already carries those fields, so still decks pay no context
    for it. read_guides(["animation-craft"]) is how much to move and when, as recommendations
    rather than rules, split by who controls the pace — presenter and cinematic.
  • Authoring coverage is deliberately partial and the guide says exactly where. 12 entrance
    and 12 exit effects, media play, all 53 transition effects and all three Morph variants
    generate today. Effect directions, emphasis and motion-path galleries, after-animation
    effects, sounds and four timing options are preserved on import but refused at generation
    by their catalog key rather than approximated
    .

Reading the diff

149 files, +282,279 / -75, counted against the merge base ff157278 — the same numbers
GitHub shows. Most of it is not meant to be read line by line:

files lines
engine + servers 31 +10,874
tests (code) 29 +20,032
capture scripts (scripts/animation_catalog/) 16 +23,605
docs 8 +1,531
generated catalog + capture evidence 65 +226,237

Buckets are by path: everything under scripts/animation_catalog/ is a capture script,
tests/fixtures/ and powerpoint-animation-catalog.json are the generated row, the rest of
tests/ is test code, remaining .md files are docs, and everything else is engine and
servers.

The last row is machine output, kept because it is the evidence: the catalog
(powerpoint-animation-catalog.json) is what describe_effects answers from and what the
generator refuses unsupported keys by, and the fixtures under
tests/fixtures/animations/ are what the round-trip asserts against. Reviewing them by
eye is not the intent; tests/test_animation_catalog.py is.

Start with sdpm/sdpm/engine/timing/ (reader.py and writer.py are the two halves),
then sdpm/references/guides/animations.md for the contract they implement.

The regression gate: every invertible animation and transition field written is read
back and compared. 469 of 469 equal, failed checks: []. A field that cannot survive the
file format is reported rather than silently dropped — the text-build check added here is
one of those reports.

Checklist

  • make all passes (ruff + pytest) — 4,906 passed; see Testing for the four failures
    that are not this branch
  • ash scan --mode local --fail-on-findings — 8 findings → 2, and the 2 are not this
    branch; see Testing
  • Docs updated if behavior/paths changed (README, docs/en, AGENTS.md)
  • CHANGELOG.md [Unreleased] updated for user-facing changes
  • Commit messages follow Conventional Commits

Testing

make lint clean. make smoke clean. pytest tests/ on 38e8ce6e: 4,906 passed, 27 skipped, 3 xfailed, 4 failed. The same four fail on 92e62efd with the hardening commit stashed, so they are not it.

Every CI check on this PR passes — python, scan, e2e, browser, unix on Linux and
macOS, windows, the four release-channel jobs and CodeQL. The one red check is "Blog
label (contributors: ignore this if it fails)", whose name says what to do with it.

Correction to what this section used to say. It claimed every remaining failure
reproduces on main. For the description budget that was wrong and the review was right:
the failure CI reported was the total (_TOTAL_MAX), at 17,140 against a 16,000 ceiling,
with describe_effects contributing 1,300. It is no longer a tool — the effect descriptions
are reached through read_guides — so the total is back under the ceiling, and CI confirms
it rather than arithmetic. bandit B314 is fixed with defusedxml.ElementTree.

The four failures that remain fail only on this machine. They pass in CI on Linux,
macOS and Windows, from byte-identical source with a lockfile-exact venv:

  • test_description_budget[local|acp|remote] — here start_composing measures 581 against
    a 560 cap, and run_python 717 against 700 on the remote server. That docstring is 581
    characters on origin/main too and the caps are main's, so whatever makes CI measure less
    is in my environment, not in the diff. I could not account for it and did not want to
    report it as resolved; CI is the authority.
  • test_html_assemble.py::test_svg_icon_is_inlined_with_prefixed_ids — passes alone, fails
    when test_assets_not_installed.py runs first. An order-dependent leak that only shows
    where the AWS icon pack is installed locally. This branch touches neither test, nor
    knowledge/assets/, nor engine/html/.

test_html_browser_check.py::test_timeout_note_names_a_slow_start[0.5] also fails here
intermittently: the test sleeps 0.5 s and asserts the note names "0.5 s", and this machine
sometimes measures 0.6. Both the test and engine/html/browser_check.py are byte-identical
to origin/main.

ASH went from 8 actionable findings to 2. Six were detect-secrets reading the animation
catalog's provenance block: the git commit ids of the two external references read while
deriving the catalog, and a sha256 of the fixture corpus the facts were checked against.
Those are published on purpose — the attribution is meant to be checkable, and
test_catalog_provenance_names_every_external_reference_without_vendoring asserts them, so
a silently changed provenance block fails. Suppressed in .ash.yaml with a reason and an
expiry, following the precedent already there for the reveal.js CSP hash.

The remaining 2 are the zod < 4.6.6 advisory (GHSA-mrhx-c7xc-m3w5) and its transitive via
@shadcn/ui, in node_modules. This branch changes no package.json, lockfile or
pyproject.toml, and GitHub reports the same two highs on the default branch — Dependabot's,
not this PR's.

Beyond the suite, the measured facts the implementation rests on were taken from PowerPoint
rather than assumed: PowerPoint has no bézier easing (acceleration / deceleration are
duration fractions, and Smooth Start/End record 0.5); there is no overshoot or spring, so
anticipation has to be one multi-segment motion path rather than two chained effects; a
motion path is slide fractions relative to the authored position. Four sample decks were
built and inspected frame by frame through storyboard().

Catching up to main

This branch left main on 2026-10-30. Main moved 162 commits to v0.14.0, and 31 more after
it, so there are two merges.

The second merge had two conflicts, both the same function grown on each side:
BuildConfig gained this branch's two motion switches and main's title / language, and
PPTXBuilder.save gained main's two keyword arguments beside this branch's transition and
timing writers. Both sides are kept in both files; that commit message records the detail.

It had to come first rather than last, which is worth recording: while a PR is
CONFLICTING, GitHub cannot build the merge ref, so no pull_request workflow runs at
all
. The fixes before it were only confirmed by arithmetic until the merge landed.

The v0.14.0 merge

Seven files conflicted and three conflicted on substance;
the merge commit message records each resolution and why. Seven files conflicted and three conflicted on substance; the merge
commit message records each resolution and why. The three worth knowing about here:

  • A new deck.json no longer carries the two switches. They were being written into
    every new workspace, which broke test_api_init_pptx_deck_json_is_byte_identical —
    main's deliberate contract that a new PPTX deck.json holds exactly the four skeleton
    keys, the same rule outputFormat follows. Nothing is lost: an absent switch already
    reads as off, so a deck opts in by adding the switch itself.
  • describe_effects was bound on the local server only, which main's new
    test_both_servers_expose_the_tool_contract_and_nothing_else caught. It is no longer a
    tool at all
    : its description and schema cost 1,300 characters of the per-turn budget for
    a lookup a composer makes rarely, so the logic moved to
    sdpm.engine.timing.describe.effects(). It was documented as reached through run_python
    at that merge, and the re-review found that route never worked —
    servers/local/sandbox.py rejects every import at parse time and the Cloud runner has no
    sdpm installed, while the tests imported the function directly and so passed without
    exercising it. It now rides on read_guides (read_guides(["effect:flyIn"]), with
    transition: and category: routing the same way, and the same prefixes from the CLI), on
    names rather than a parameter of its own because a new schema property measures about 150
    characters of the per-turn tool budget against 65 for widening one description. The MCP tool
    count is 20 again, which is what AGENTS.md and both getting-started pages already say.
  • claude_plugin_installed kept the injectable probe form rather than main's
    self-contained one, because _probe already carries the same timeout and error handling,
    so the behaviour is identical and the seam keeps the test off the machine.

XML hardening of the animation sidecars

The maintainer follow-up on 2026-11-21 found a defense-in-depth gap in code this PR adds:
a sidecar's XML was checked for DTDs by searching the raw bytes, and then parsed a second
time with lxml's default parser. All four suggested fixes are in 38e8ce6e, with one
deviation.

  • The byte search is kept, as a fast path, next to the new check rather than replaced
    by it. The suggestion was to reject on docinfo.doctype instead of the byte search, and
    that check is now there and is the guarantee — but the byte search is the only thing that
    catches a bare <!ENTITY payload "x"> with no DOCTYPE around it. That document is not
    well-formed, so without the byte search it comes back as an XML syntax error rather than
    as the refusal the existing test asserts. It also carries the precise diagnostic. The
    docstring at model.py:410 says why both are there.
  • validate_xml_resource_limits and enforce_xml_limits now return the parsed root
    (-> None before), and remap_fragment uses it instead of calling etree.fromstring on
    the same bytes. This is an interface change on two internal functions; of the nine call
    sites only raw.py:496 reads the value, and the rest are unaffected by a wider return
    type.
  • lxml>=5 in sdpm/pyproject.toml, with the reason in the comment, and the lockfile's
    requires-dist line follows.
  • Two tests in tests/test_animation_security.py: a UTF-16 and a UTF-32 document carrying a
    DOCTYPE, each asserting first that the byte search cannot see it, and one that the limits
    check hands back the tree it parsed. Both UTF-16 and UTF-32 here are the BOM-carrying
    spellings, because those are the wide encodings lxml detects from the bytes alone; a
    BOM-less utf-16-le document is refused too, but by the parser as "Document is empty".

A merge artifact in the CHANGELOG

Worth flagging because it was invisible from the diff: this branch's entry was written into
[Unreleased], and a later merge from main renamed that heading to [0.16.0] - 2026-11-12
with the branch's 45 lines still inside it. The CHANGELOG therefore claimed object
animations and slide transitions had shipped in 0.16.0, which they have not. The block is
moved back under [Unreleased]; nothing of main's 0.16.0 content is touched
(git diff <merge-base> -- CHANGELOG.md removes no line).

Boundaries touched

  • sdpm/references/ (workflow dependency chain — see AGENTS.md)

sdpm/templates/*.pptx and infra/config.yaml are untouched.

Naohito Yoshikawa added 30 commits October 30, 2026 23:53
…ntract

Pin PowerPoint forced-object naming and p159 Morph variants before the general timing writer is introduced.

SPEC: 20261030-2256_pptx-animations-transitions-roundtrip

Task: 1
…tracts

Add independent feature switches, animation and transition validation, semantic asset rules, and bounded XML parsing.

SPEC: 20261030-2256_pptx-animations-transitions-roundtrip

Task: 2
…otion capabilities

Freeze the independent GUI universe, compile an explicit 435-candidate PowerPoint oracle, and generate a provenance-aware capability catalog.

SPEC: 20261030-2256_pptx-animations-transitions-roundtrip

Task: 3
…ng OOXML

Add the shape/effect identity layer and the semantic animation/transition
writer core.

- stable element/effect identity with extension-backed IDs and
  deterministic fallback, remapped across every spid-bearing node
- main sequence and interactive sequences with valid cTn ID/order
- transition writer including all Morph variants and advance modes
- gap-safe generation: capture-required mappings refuse with their
  stable catalog key instead of emitting guessed XML
- animation-off preserves media timing; transition-off leaves object
  and media timing unchanged
…ally

Add the inverse direction: a GUI-edited package becomes semantic slide JSON,
and anything not fully understood is preserved rather than partially decoded.

- all-or-nothing classification; one uninvertible attribute sends the whole
  tree to a raw sidecar instead of emitting lossy semantic JSON
- mc:Choice evaluated in document order against the supported namespace set,
  then mc:Fallback, then raw or a deterministic error
- hashed dependency manifest with shape/relationship remapping; a missing
  target or relationship fails before output instead of emitting a dangling
  rId or stale spid
- media-only reconstruction for animation-off from a mixed raw tree
- import derives the deck switches and preserves explicit ones
- bounded parsing with IMPORT_LIMIT_EXCEEDED, no DTD or external entities,
  and hostile fixtures asserting zero network/filesystem/subprocess calls
…sure, diff

Expose the feature through every surface and replay preserved motion.

- independent animation_mode / transition_mode (inherit|on|off) on the API,
  the CLI and both MCP servers; caller beats deck.json and no override
  rewrites it
- PPTXBuilder now replays _rawTiming / _rawTransition, which was implemented
  in Task 5 but never called, so an imported raw slide kept losing its motion
- remote _prepare_workspace materializes the validated manifest closure
  instead of scanning slide JSON strings
- diff reports transition field changes and animation add/remove/move by
  stable effect ID, summarizing raw by digest and target names
…tion guide

Keep the detailed contract out of always-loaded composer context.

- animations.md is the single canonical contract; the always-loaded slide
  spec gets a short pointer only
- composer loads it only when a deck switch is on or an assigned slide
  already carries motion; the orchestrator owns the switches
- import and hand-edit sync describe semantic extraction, the raw sidecar,
  and switch derivation vs preservation
- the guide states what round-trips today and names the catalog key of every
  refused setting, rather than promising what the writer declines to emit
- a slide must carry its whole meaning with motion off
…ance gate

Add the release gate and make the remaining gaps countable.

- coverage-matrix.json is derived from the catalog by rule, not curated, so
  no one picks the interesting cases; two runs are byte-identical
- accept.py writes every accepted fragment, re-imports it, and checks cTn
  uniqueness, schema order, spid/rId validity and the eight fixture packages
- the --powerpoint read-back path is implemented, bounded by a hard timeout,
  and never approximated; this sandbox reports it as blocked, not passed
- exits non-zero while any gap remains, printing each one with its stable
  catalog key so the list is a work queue
…ured duration

Every gallery tile's semantic JSON carried the generic 500 ms carrier default
regardless of its own capture, and only 35 of 104 happened to agree. Four
tiles whose sole behaviour child is the normative visibility p:set are
instantaneous in the capture, so the claim contradicted the evidence the
entry came from and broke the round-trip the acceptance harness measures.

- derive a tile's timing.durationMs from its own observedChildDurationMs,
  emitting null only when the effect is a lone visibility toggle
- give the writer's exit path the symmetric rule: with no accompanying
  animation there is no active duration to hide one millisecond before, so
  the state change sits at the effect start as an entrance does
- derive the raw manifest root in PPTXBuilder the same way the remote
  workspace derives it, so the two sides cannot disagree about where a
  declared part lives
- drop a reference to list_guides(), which no longer exists

Round-trip equality is 118/118 and the partial-round-trip gap is now zero.
The exit-delay rule is inferred from the captured rationale, not measured;
Task 8 PowerPoint read-back has to confirm it.
…apture loop

Apple Events are refused in this sandbox, but the Accessibility API is not, so
the oracle was reachable after all. One capture was driven end to end as proof:
sdpm generates the deck, PowerPoint applies the effect through the ribbon, the
file is saved, and --parse-oracle merges the extracted OOXML.

- record the measured driving mechanics: element_index works for menu items
  but never for the main window, app_post clicks are ignored by the custom
  ribbon, and the pointer tooltip refuses a repeated click at one point
- record the gallery position formula, confirmed against the tree, so a batch
  can sweep by page instead of probing
- Box / From Right carries the direction in isInverted, not a dir attribute,
  which is the question Step 1 exists to answer
- the deck opened with no repair prompt and only the targeted slide changed

Two things this does NOT do. It promotes no catalog entry: the GUI applies by
label, so a capture maps a tile and an Effect Options label to OOXML, while the
262 capture-required entries are keyed by scripting enumerator, and bridging
those is a name correspondence rather than a measurement. And it leaves Box's
defaultDurationMs at the recorded 1000 even though PowerPoint wrote 1600,
until the other three directions say whether 1600 is the tile's default.
… oracle

Run from a Terminal holding the Automation grant, the scripting oracle probed
357 candidates and closed every transition gap the catalog was guessing at.

- all 61 capture-required EPPEntryEffect entries now have measured OOXML:
  box down is p14:prism dir="d" isInverted="1", airplane right is
  p15:prstTrans prst="airplane"
- the 196 rejections are the legacy per-shape entry effects the catalog
  already accounts for out of scope, so they are an answer, not a gap
- applying by enumerator code gives the enumerator -> OOXML mapping the
  catalog is keyed on, which the GUI route cannot: GUI "From Right" wrote
  isInverted with no dir, so the GUI label is not the scripting enumerator

Animations captured nothing. All 150 MsoAnimEffect candidates were rejected
with "main sequence ... doesn't understand the add effect message": the sdef
declares it, 16.113.1 does not implement it. The animation side has to go
through the GUI procedure instead, and no terminology fix will change that.

The run aborted before savePackage on a bare enumerator name that collides
with a PowerPoint property, so this package was saved by hand from the
still-open deck. Both defects are recorded but not yet fixed.
…the catalog

Make the captured oracle evidence a generator input, so every transition the
catalog describes now stands on what PowerPoint wrote rather than on a guess
read off the enumerator's name.

- capture-required entries drop from 262 to 203; the transition surface has
  one refusal left, and it is not waiting on a capture
- the capture corrects 16 mappings the catalog had inferred from names: cube
  right is dir="u" not "r", the glitter pairs were swapped, and invX belongs
  to the LEFT prstTrans variants, the opposite of what was recorded
- flashbulb no longer leans on a same-shaped tile; PowerPoint wrote p14:flash
  for the enumerator itself
- 15 entries keep an attribute PowerPoint omitted, recorded as keptAttributes
  with the fact that their being schema defaults is not measured
- the captured p14:dur is NOT taken as an effect default: all 160 transitions
  report 2000, which is the probe slide's own duration, and taking it would
  have overwritten 22 distinct measured defaults with one artefact

Fix the two defects that nearly cost the whole capture run:

- the generated constants arrays carried bare enumerator terms, four of which
  are also PowerPoint property names, so evaluating one raised -1728. They now
  carry codes. A «data …» literal was the obvious fix and is wrong twice over:
  the descriptor type must be the enumeration's own code, and a «data …» value
  is not equal to the read-back constant, so every record would have reported
  applied: null. horizontal and vertical turn out to have been binding to a
  different enumeration entirely, which failed silently.
- one failed probe used to discard every candidate applied before it. Each
  probe is now contained and records its failure, the package is written after
  every probe, and savePackage always runs.
…nscriptable

PowerPoint.sdef declares two ways to create an animation effect. Neither is
implemented in 16.113.1, so the oracle's animation half was never going to
work and no terminology fix reaches it.

Each route got its own slide and shape, and the saved package is an
independent check: four slides, one shape each, no p:timing and no p:cTn.

- add effect on main sequence -> -1708, not understood
- make new effect at main sequence -> -2710, Can't make class effect
- make new effect at sequence 1 -> -2710, same
- add effect on sequence 1 -> -1728, because an indexed sequence does not
  exist until an effect does, so it is not an alternative address

An earlier run of this probe appeared to say two effects had been created and
I passed that on. It was wrong: AppleScript's return is a carriage return, the
terminal overwrote each verdict with the next, and the digit came from an
overwritten line — in a version that also shared one slide across all four
routes, so no count could have been attributed anyway. This version writes
JSONL to a file instead of printing.

Every remaining capture is animation-side and has to go through the GUI.
AXPress through computer_perform_action applies a ribbon gallery tile by
element index, including a tile scrolled outside the visible band, and it
works on main-window elements. Pressing Entrance Effects' "Basic Swivel" at
window x=1448 inside a 320-pixel gallery applied it, flipped the thumbnail to
Has Animation, and set Start: On Click with Duration 05.00.

This morning's note said only a real-pointer click drives the ribbon and that
a batch therefore occupies the machine for hours. That was tested with
computer_click alone, which does always fail on the main window; the
limitation belongs to that one tool, not to the accessibility route. So the
capture needs no coordinate arithmetic, no gallery paging, no tooltip
avoidance, and no pointer takeover, and the operator keeps their machine.

Also recorded: a gallery lazily materializes its tiles. A first read of
Entrance Effects returned 22, and after one press the same read returned five
tiles that had not been there. Never cache a first read as the whole gallery.
AXShowMenu on the gallery reports success and opens nothing, so there is no
full-grid shortcut.
Step 6 listed @path, @origin and @pathEditMode as the values no available
capture contained. All three are now measured, with a presetID the catalog
did not have:

  <p:cTn id="5" presetID="42" presetClass="path" presetSubtype="0"
         accel="50000" decel="50000" fill="hold" grpId="0"
         nodeType="clickEffect">
    <p:animMotion origin="layout" path="M 0 0 L 0 0.25 E"
                  pathEditMode="relative" ptsTypes=""/>

Record the two tool rules that caused most of this session's GUI friction,
neither of which is a PowerPoint limitation:

- perform_action needs one explicit computer_get_state immediately before it,
  with nothing in between. A click's refreshed tree does not register, and
  until you provoke the honest "no state ... call computer_get_state first"
  the symptom is the misleading "element N is no longer present", which reads
  like PowerPoint invalidating its own elements.
- a popup's window is invisible to a click's own refreshed tree and appears on
  the next explicit read, so a click's output is not evidence that the popup
  failed to open.

accel/decel at 50000 arrived with the path preset and is NOT promoted to
animation.timing.smoothStart/smoothEnd: that is this preset's default, not a
measurement of those controls.
…ally costs

Two measured constraints that rule out the obvious shortcuts.

A gallery press REPLACES the shape's effect rather than adding one; there is
no Add Animation button on this build. Pressing three tiles onto one shape
leaves one effect, the last. So a batch needs one slide per value.

Indices shift as soon as a press scrolls the gallery. perform_action does keep
state across consecutive actions, so presses can share one read, but only
while the tile list holds still — and a press breaks that. After one press the
Entrance gallery scrolled and materialized five tiles, so the index that had
been Checkerboard was Shape. A press aimed by a stale index applies the wrong
effect while the record names the intended one, which corrupts evidence
instead of failing, so re-read before every press.

The cost per value is four calls: select slide, select shape, read, press —
and the two clicks invalidate the state the press needs.
… loop

Driving the ribbon by hand costs four agent round trips per value, which does
not fit a session. The accessibility API is reachable from Python here
(AXIsProcessTrusted is true), so the loop becomes one script.

- gui_capture.py drives it: resolve every control BY TITLE against a fresh
  read before each press, because a press scrolls a gallery and renumbers it,
  and a press aimed by a stale index applies the wrong value while the record
  names the right one
- a target that is absent, ambiguous or unverified becomes a rejected record
  and the run continues; every wait is bounded. One bad term cost the
  AppleScript run all 357 of its applied candidates
- the click point for the canvas shape is derived from the package geometry,
  the live pane frame and the live zoom, never hardcoded
- gui_capture_plan.py derives the target list from the catalog's own gaps, so
  re-emitting after a run yields a shorter plan with no edit, and sorts every
  capture-required entry into one of four named lists rather than dropping any
- 76 runnable targets, 51 deferred with a stated reason, 185 scripting
  enumerators set aside because the GUI applies by label and closing those
  would assert a name correspondence rather than measure a value
- the accessibility layer is injected, so 84 new tests run with a fake and CI
  needs neither PowerPoint nor pyobjc
…exposed

Both were invisible offline and both made every target fail.

Pressing a ribbon tab that is ALREADY active collapses the ribbon, taking
every control on it out of the tree. A run against a deck whose Animations
tab was already selected pressed it anyway and all 76 targets then waited for
a gallery that had stopped existing. The tab is now pressed only when its own
controls are not already reachable.

The editor pane was chosen as the largest element of a fixed role, which
returns the outer split holding the navigator and the notes — 254 px too wide
and 188 px too tall. It is now the framed container holding the element that
titles itself "Slide Editor Pane". The inner area's own frame lags a ribbon
expand or collapse, measured once as y=89 h=594 while its container already
reported the settled y=144 h=540, so the container is what gets measured.

Still failing, and recorded rather than papered over: the driver cannot find
the Quick Access "Save" button from the document window, so the attribution
gate never gets a package to read; and the canvas clicks miss the 100x22 pt
shapes, which leaves the previous shape selected so the next press overwrites
ITS effect. A live run produced 71 presses and five effects, one of them an
entrance class on a shape whose target was an emphasis value. The driver
rejected all 76, which is the gate working.
…on captures

Nine targets captured with their spid matching the shape the plan aimed at,
so these are measurements rather than hopeful presses: entrance flyIn is
presetID 2 subtype 4, zoom is 53/16, basicSwivel 19/10, flip 56, peekIn 12/4,
pinwheel 35, spiralIn 15, and emphasis underline 18 and wave 34.

Three defects fixed, each found only by running it:

- the shapes were 77x22 pt and a click's accuracy is bounded by the SHORT
  side. Squarer cells and a one-line label take it to 43.5 pt. The key is not
  lost: it is in the plan, and attribution is by spid
- the ribbon tab was selected AFTER the shape click, but the click is
  confirmed by that tab's gallery becoming enabled and a gallery on an
  inactive tab is not in the tree at all, so a freshly opened deck starting on
  Home timed out all 76 targets before clicking anything
- PowerPoint publishes TWO AXWindows with the SAME document title and only one
  carries the ribbon. Taking the first non-popup picked them inconsistently:
  one run reached Save on target 1 then failed every later one with "no
  element titled 'Animations'". The document window is now the one holding the
  ribbon tab strip

Two causes remain, both named by the records rather than guessed at. A
compound effect writes more than one p:cTn, so the "exactly one more effect"
gate is too strict and reports effectNotAdded with "0 before and 3 after". And
some clicks still do not change the selection, which shows up as "3 before, 3
after, spids that appeared: none". Five more are a derived tile label that
does not match the live one, which the record names.
… run 76

43 of 76 animation values captured, every one attributed to the shape its plan
aimed at. Previous best was 2 of 12.

Selecting a shape by clicking a derived point does not work: the operator
watched the pointer land correctly while the shape stayed unselected, and
pacing the synthetic click properly took it from 2/12 to no better. Shapes
have no accessibility element, but their Selection Pane rows do, and a row
carries the shape's name and a settable AXSelected. So the driver opens the
pane once and selects by name. The coordinate click is gone, with the canvas
geometry it needed, and the driver no longer moves the pointer at all.

Then it was four minutes a target, and measurement said why: a full window
walk costs 6.4 s because every attribute read is an IPC round trip, the
window is 907 nodes of which 762 are pane rows, and document_window walked
every one of five same-titled windows looking for the ribbon. Lookups are now
scoped to the toolbar, the ribbon tab group or the pane outline, found by a
depth-bounded search; document_window reads direct children. 8.9x fewer reads
per target, asserted as a budget so it cannot creep back. Saving turned out
to be ~1% of it — batching it ten at a time is still in, and it gives up
crash granularity and the ability to separate two targets inside one batch
that swapped effects, so the misattribution gate runs at batch size 1.

76 targets in 11.5 minutes, resumable.

Two live-only facts the offline tests could not have found. Opening the
Selection Pane adds a SECOND AXTabGroup to the window, so the ribbon needs
its own first tab to be identified. And the pane publishes only the rows
scrolled into view — 62 of 152, then 47 — which is what the remaining 26
controlNotFound failures are, each naming the names it did see.
…dex, not name

A row's name is published only once it has been scrolled into view, so one run's
batches read 80 names then 54 from the same 152 rows and 11 targets were rejected
as 'no Selection Pane row is named ...' for rows that were selectable throughout.

Rows are now addressed by index - the shape's position in reverse z-order, read
offline from the package - verified against the live pane twice at 152 rows with
0 mismatches. The name is kept as a check on that order when the pane publishes
one. A count check guards the index: the pane must publish exactly one row per
shape or the selection refuses, which costs the ability to isolate a single
missing row and buys refusing to apply a value to the wrong shape.

The fake inflates the slide rather than the pane, models rows that publish no
name, and runs the whole plan with zero readable names.
…own AXIndex

Addressing a row by its offset in AXRows refused 7 targets: the pane published
43, 54, 61, 63, 74, 88 and 91 rows on consecutive reads of the same 152-shape
slide, because it rebuilds while the application works. An earlier probe that
answered 152 rows had measured a pane scrolled by hand, so both the previous
docstring and the previous notes entry were too strong.

Every row publishes its own AXIndex - measured 0, 1, 76 and 151 at those offsets
- so a row is now found by matching that, a partial read is usable whenever it
holds the row wanted, and a read that does not is retried until the timeout. The
name stays as a check on the order: a row that publishes a name must publish the
one expected at that index, which is what catches a renumbered pane before a
press lands on another shape.

Live: 73 of 76 captured, 0 spid mismatches, 0 row failures. The 3 remaining are
gallery tiles the ribbon does not publish.
…ues captured

Three defects stood between 73 and 76, each measured against the live ribbon:

- the accessibility layer drops a tile's ampersand and keeps the spaces around
  it, so 'Grow & Turn' is published as 'Grow  Turn'. title_variants derives that
  spelling as an alternative, with the exact title still tried first.
- a gallery shows a window of its effects and is moved by the ribbon's own
  'Previous/Next <gallery> gallery' buttons. AXScrollUpByPage and
  AXScrollDownByPage on the gallery's AXScrollArea are accepted and do nothing -
  a run paged 8 each way and no tile appeared - so the scroll_page binding is
  gone and the pagers are pressed by title, bounded, up before down because a
  press leaves the gallery wherever it was.
- pressing a gallery whose palette window is already open CLOSES it, the third
  appearance of a trap that already cost a run twice (an active ribbon tab, the
  Selection Pane). The window's presence is now read, not assumed.

Live: 76 of 76 captured, 76 attributed, 0 spid mismatches.
…animation capture

23 entrance, 24 exit, 24 emphasis and 5 motion paths, every one attributed to
the shape its target named. Not in the catalog yet: generate.py ingests
transition captures only, and the README says so where the files are.
…payloads offline

generate.py --parse-gui-capture joins the driver's read-back with the package it
saved, on attributedSpid, and recovers per effect every behaviour child WITH its
payload: the element and its attributes, p:cBhvr/@additive, the cBhvr/cTn timing
with the delay lifted out of p:stCondLst, the p:attrNameLst names, and the
to/from/by/tavLst value subtrees. 76 records, 76 effects, 76 resolved, 0
unresolved, 311 behaviours.

This is the payload gap that kept 71 tiles capture-required, measured. It needed
no re-run: PowerPoint had already written it into the package.

Nothing is promoted into the catalog here. writer.py writes one behaviour per
distinct tag and synthesises each payload from general rules, and 57 of the 76
measured effects repeat an element, so promotion needs a measured-behaviour path
in the writer first.
…does to the XML

Applying a tile selects the effect (with only the shape selected the Duration
incrementor is disabled and empty), AXIncrement steps it by 0.25 s, and the
saved package says what changed. 4 effects, 41 behaviours, ratios x2, x3/2, x9/8.

Every animated behaviour's dur and delay scale in proportion. The visibility
p:set is exempt: dur stays 1 and its delay is recomputed from the new duration,
not scaled - Fly Out is 499 at 0.50 s and 999, not 998, at 1.00 s. No attribute
changes, and neither does presetID, presetSubtype, the behaviour count or order.

One measured limit: at a fractional ratio, values whose exact product is a half
split both ways (580 down, 1324 up), which is PowerPoint's internal float
precision rather than a tie rule. So output is byte-exact at an effect's
measured default duration and may differ by 1 ms elsewhere.
… paths are measured

Step 6 said no available capture contained a preset path. The GUI capture does,
all five gallery groups verbatim with their presetIDs. Only the More Motion
Paths dialog entries are still open.
…animations

The catalog promotion, the writer path and the reader path that make the GUI
capture usable instead of merely recorded.

Catalog: --parse-gui-capture joins the read-back with the package offline, and
--write folds it in. Each promoted entry carries the measured behaviours in
document order with duplicates (57 of 76 repeat an element), the duration those
timings belong to, and the measured scaling rule with its 1 ms limit. 71 of the
76 identifiers confirm what the catalog had; 5 motion paths fill an empty field.

Writer: emits the measured behaviours verbatim, scaling animated durations and
delays in proportion and leaving the visibility p:set at 1 ms with its delay
recomputed as duration - 1. An effect whose duration is Auto refuses a numeric
durationMs rather than ignoring it.

Reader: matches the measured sequence exactly and inverts the scale to recover
the duration. Without it the promotion produced 64 partial round-trips, because
three p:animRot read as a mismatch against a distinct behaviorChildren list.

accept.py: behaviorPayloads 71 -> 0, round-trip 248 of 248 equal,
partialRoundTrip 0. Writer coverage 343 -> 458 generated. All 95 gallery tiles
generated, none refused. The guide's authorable list goes from 24 to 101.
…no duration is authored

Promoting the GUI capture removed observedChildDurationMs from every measured
entry, and that field was the writer's fallback when a slide names no
durationMs. The value is how far the effect advances the timeline, so an
afterPrevious group's delay is the sum of what came before it: without it, a
slide of click-then-after-previous wrote the second start group at delay 0 while
its first effect ran 500 ms, and the reader refused the result as a timeline it
could not express.

The fallback is measuredDurationMs first - for a measured entry that is the
duration PowerPoint itself applied - then observedChildDurationMs.

Covered by a slide with one shape animated three times across two click groups
and no durationMs anywhere. The existing round-trip slide could not catch it:
every effect in it names an explicit duration, so the fallback never ran.
… and find the direction route

assert_ready required PowerPoint to be frontmost. The document check is what
guards the operator's deck, and every action is an AXPress or attribute write
addressed to a named element, so it reaches an occluded window and takes no
focus. Requiring frontmost cost a run of any length the operator's screen, and
aborted it whenever another app came forward. The inverted test asserts a whole
plan captures while Terminal is frontmost.

Confirmed live by the probe that measured the next route: press the tile (which
selects the effect - Effect Options is disabled until then), press Effect
Options, and a window of that title opens carrying the directions the applied
effect offers. Fly In publishes eight compass points plus the Sequence group.
The labels are per effect, so the plan has to read them live rather than derive
them from the catalog's 45 direction names.
@naohito2000

Copy link
Copy Markdown
Contributor Author

Medium 7-14 are fixed in 629213e1. CI is green on every check again.

Four of the eight turned out to be one theme — the storyboard not knowing what the build knows — so they are fixed together.

The storyboard group

7 — it failed outright on a raw-preserved slide. Fixed as you suggested: all four motion keys are dropped in frame_slide, named in one _MOTION_KEYS tuple with the reason, since animations / transition and the two raw references are dropped for different reasons and the next reader should not have to re-derive the second one.

8 — and said nothing about it. Frame 0 now carries one note per preserved fragment, including the reason the import recorded, so a storyboard of such a slide says "preserved as raw XML, cannot be shown here" rather than rendering as a still with empty notes.

9 — the shared trigger state. Each trigger frame now starts from a copy of the settled main-sequence state. The two consequences you did not list were worth having as well: hiddenBy was never set, so an element a trigger exited was reported as stranded at the end of the deck ("ends with icon off screen (never revealed)") when the author had sent it off on purpose; and after-effects now apply as they do in the main run, except hideOnNextClick, which is reported rather than applied because a trigger has no next click in this model.

Initial visibility now counts interactive entrances too. That one was the most visible defect of the four: an element only a trigger reveals was drawn at frame 0 as though it were already there, which is exactly the thing the storyboard exists to catch.

10 — placeholder, include and override targets. Three parts:

  • _addressable collects element ids and placeholder ids, and frame_slide applies state to a placeholder exactly as it does to an element. The computed state was being discarded, so a placeholder an exit removed stayed on every frame and one an entrance reveals was drawn before its click.
  • api.storyboard resolves overrides and expands includes before building frames, the way the build does.
  • The include expansion moved out of PPTXBuilder.add_slide into expand_includes, so the build and the storyboard read one implementation instead of two that can drift. Behaviour is unchanged, including skipping a missing include file rather than raising — that is what lets check_includes report it as a warning instead of stopping a deck.

The other four

11 — lint before resolution. lint() takes include_motion=False in _resolve_config, and the new lint_motion() runs after resolve_override. I checked both directions rather than just the happy path: the same deck reports unknown-animation-target on the source form and nothing on the resolved one.

An unexpanded include is handled inside validate_slide_motion instead of by ordering, because the element set it contributes is not knowable from the slide: while one is present the target-membership rule is suspended and every other rule still applies. The build still refuses a target that resolves to nothing.

Your note that _lint_motion will need the same treatment in the motion-video work is recorded in that plan, pointing at this pattern.

12 — animated_slides. It now counts exactly what the storyboard can show: object animation, semantic or raw. A transition-only deck gets no nudge, which is the honest answer, since those frames have nothing to show for it.

13 — the dropped morphId. It refuses the import the same way an unmappable id does, naming the values and their source spids. I considered a warning instead, but there is no warning channel on that path, and a silently different morph pairing in the rebuilt deck is the same class of loss the id refusal exists to prevent. If you would rather it warned, that is a small change — it needs somewhere to put the warning.

14 — the text-mode manifest. Written as bytes now, with a test asserting no CRLF. Note that the copy your finding was about is gone for a different reason: H2 replaced the sidecar copy with a bundle-relative reference, so nothing copies a digested file with write_text any more. The manifest was the one file in that subtree whose bytes still depended on the platform that wrote it.

Verification

ruff clean, 4,824 passed / 18 skipped / 4 xfailed. The ten new storyboard tests were each run against the previous implementation first and all ten fail there, so they pin the fixes rather than the fixtures.

Five of the six Low items are next; the sixth (the "1.2 MB catalog" docstrings) landed with the housekeeping.

…g Low findings

Review by ShotaroKataoka, 2026-11-13. The sixth Low item — the "1.2 MB catalog"
docstrings — landed with the housekeeping in `e4f4007e`.

**A still deck was warned about motion it would not get.** `check_text_build`
and `check_morph_pairing` ran unconditionally in `_resolve_config`, before the
switches were resolved at the bottom of it. Both describe what the build will
write, and neither writes anything with its switch off, so a deck built as a
still was told about text builds and unpaired morph identities that were never
going to reach the package. The switches are resolved before the two checks
now and each is gated on its own: text builds on `animations`, Morph on
`transitions`, because Morph is a transition.

**The replay slot came from the bytes rather than the record.**
`apply_raw_fragment` chose between `p:timing` and `p:transition` by scanning
the replayed XML for a `p:transition` anywhere inside it. The manifest's `kind`
is validated to be exactly one of the two, is the kind the import decided, and
is covered by the sidecar's digest, so `_fragment_kind` reads that instead.

For every fragment sdpm writes the two agree, which is why the new test builds
one where they cannot: a sidecar recorded as `timing` carrying a
`p:transition` descendant. On the old code that tree went into the transition
slot and the slide's own timing stayed beside it — two `p:timing` children,
which is the corruption python-pptx issue 954 describes. `_carries` has no
other caller and is removed.

**The media-only sidecar was replayed unverified.** `replay_raw_fragment`
checked the digest only when it read the full sidecar. In tree that was covered
because the builder validates the whole closure against a root first, but this
function also accepts a manifest with no root, and then nothing verified the
file it actually replayed. It now compares `mediaOnlySha256` for the media-only
path, so the check follows whichever file was read.

**`existing_deck` was dead in production.** It was passed only from tests, so
the rule it exists for — preserve an explicit switch, derive only a missing one
— never fired: converting again over a deck turned a switch the user had set to
false back on, and the guide was the only thing keeping it. `pptx_to_json` now
defaults `existing_deck` to the `deck.json` already in `output_dir`, because
converting into a deck directory is a sync whether or not the caller says so. A
fresh import bundle has no `deck.json` there, so nothing changes for one; an
unreadable one falls back to the detected content rather than failing a sync.

**An identity on a group child was inert in silence.** A group is flattened —
its children become ordinary slide shapes at slide coordinates — but neither
the builder's registration walk nor `_element_ids` descends into one, so an
`id` or `morphId` there did nothing. Targeting it failed the build with "known
element ids: none", which does not explain why an id the JSON visibly carries
was not seen. `validate_slide_motion` now reports
`inert-group-child-identity`, nested groups included, and names the fix:
move the element out of the group, which changes no geometry.

Reported rather than supported, deliberately. Registering group children means
threading the identity registry through `_add_group` and deciding what a
`morphId` means on a child of a group that is not a group in the output — a
feature with its own design questions, where this is a one-line authoring
mistake that now says so. Flagged for the reviewer in case they want the
feature instead.

Verified: `ruff` clean, 4830 passed / 18 skipped / 4 xfailed. Each of the six
new tests was run against the previous implementation first and all six fail
there. Two needed correcting to get that far: the slot test asserted
`apply_raw_fragment`'s return value, which is the fragment root and the same
either way, and the media-only test used `nest_media=True`, which makes the
boundary unclassified so no media-only variant exists to tamper with.

The three `test_description_budget` params, the order-dependent
`test_svg_icon_is_inlined_with_prefixed_ids` and the wall-clock
`test_timeout_note_names_a_slow_start[0.5]` fail on this machine and pass in CI
on all three platforms; neither this branch nor this commit touches them.
@naohito2000

Copy link
Copy Markdown
Contributor Author

The five remaining Low items are fixed in 8092aca4, so every item in this review is now answered. CI is green on all 24 checks.

A still deck was warned about motion it would not get. Both checks ran before the switches were resolved at the bottom of _resolve_config. They are gated on their own switch now — text builds on animations, Morph on transitions, since Morph is a transition. The test checks both directions: the same deck reports nothing with the switches off and does report with them on, so the gate is what changed rather than the fixture.

The replay slot came from the bytes rather than the record. _fragment_kind reads the manifest's validated kind. For every fragment sdpm writes the two agree, so the test builds one where they cannot: a sidecar recorded as timing carrying a p:transition descendant. On the old code that tree went into the transition slot and the slide's own timing stayed beside it — two p:timing children, which is exactly the python-pptx issue 954 corruption the rest of this code is careful about. _carries had no other caller and is removed.

The media-only sidecar was replayed unverified. The digest check now follows whichever file was read, using mediaOnlySha256 for the media-only path. Your parenthetical was right that no in-tree caller passes a rootless manifest today; the check is in the function that accepts one rather than in the caller that happens not to.

existing_deck was dead in production. pptx_to_json defaults it to the deck.json already in output_dir: converting into a deck directory is a sync whether or not the caller says so. A fresh import bundle has no deck.json there, so a new import is unchanged, and an unreadable one falls back to the detected content rather than failing a sync. That makes the preserve-an-explicit-switch rule fire without the agent having to follow the guide for it.

An identity on a group child is now reported, not supported. validate_slide_motion emits inert-group-child-identity, nested groups included, and names the fix — move the element out of the group, which changes no geometry since a group is flattened anyway.

I stopped short of making it work, and I want to flag that as a judgement call rather than bury it. Registering group children means threading the identity registry through _add_group and deciding what a morphId means on a child of a group that is not a group in the output. That is a feature with its own design questions, where the thing in front of us is a one-line authoring mistake that used to produce "known element ids: none" and now explains itself. Say the word if you would rather have the feature and I will do it properly.

Verification

ruff clean, 4,830 passed / 18 skipped / 4 xfailed. Each of the six new tests was run against the previous implementation first and all six fail there. Two of them needed correcting to reach that bar, which is worth recording because both would otherwise have been tests that pass for the wrong reason:

  • the slot test first asserted apply_raw_fragment's return value, which is the fragment's root element and identical either way — the slot only shows in where the node was inserted;
  • the media-only test used nest_media=True, which makes the boundary unclassified, so there was no media-only variant to tamper with.

Where this leaves the PR

Items Commits
CI failures 2 940b0acb, 95db8425
Housekeeping 3 e4f4007e
High 6 abcf65d1
Medium 8 629213e1
Low 6 e4f4007e, 8092aca4

Plus db0ba883, the merge that catches the branch up to main past v0.14.0 — which had to come first rather than last, because GitHub runs no pull_request workflow at all while a PR is CONFLICTING, so everything before it was confirmed only by arithmetic.

One deviation from the review stands: transition.gallery.box.fromRight/ is kept, with the README saying why. And one correction of mine stands: the Testing section's claim that every failure reproduced on main was wrong for the total description budget, and the PR body now says so.

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

Thank you for working through every item, and for the care in the replies. Running each new test against the previous implementation first made the fixes easy to trust.

Your three judgement calls

  1. Refusing an unstampable morphId: agreed. A silently different morph pairing is the same loss the id refusal prevents, so refusing is the consistent choice.
  2. Group-child identity reported, not supported: agreed. The diagnostic is enough for this PR. The feature can be a follow-up issue with its own design.
  3. Keeping transition.gallery.box.fromRight/: agreed, with the README saying why.

Re-review of the fix commits

I re-reviewed 940b0acb, 95db8425 and db0ba883..8092aca4 (not the merge itself, the catalogs or the fixtures) with two independent reviewers, as before. Most fixes close their findings. The points below are either new in the fixes or partial closures. References are against 8092aca4.

High

  1. effects() cannot be reached the way the guide says. 95db8425 documents from sdpm.engine.timing.describe import effects through run_python (guides/animations.md:455, the describe.py docstring, CHANGELOG). The local sandbox rejects every import at parse time (servers/local/sandbox.py:26) and its builtins have no __import__. On Cloud, Code Interpreter does not have sdpm installed. The tests import the function directly, so they pass. Options: put effects into both runners' globals next to read_json / write_json, restore it as a tool, or serve it through an existing tool. A test that runs the documented snippet through run_python would pin it.
  2. The storyboard reports a trigger-revealed element as "never revealed". Each trigger frame now starts from a copy of the settled state (storyboard.py:407-414), but the end-state pass (storyboard.py:584-596) still reads the last frame as the end of the slide. With _two_triggers (showB reveals b, hideIcon exits icon), the last frame says ends with b off screen (never revealed). The stranded set could come from the settled main-sequence state, or from visibility across all frames.
  3. _source_provenance still aborts the import on the input B314 was about. It catches defusedxml's ParseError, but defusedxml signals a refusal with EntitiesForbidden / ExternalReferenceForbidden (DefusedXmlException, a ValueError). I checked: an app.xml with an entity declaration raises past the handler, and pptx_to_json calls it unguarded, so the whole conversion fails instead of recording nulls. Catching DefusedXmlException too, with a test for that input, would close it.
  4. High 4 is only partly closed. The measured start-condition check asserts that a delay exists but never compares its value after the duration scale is known (reader.py:2164-2177), so a changed delay still reads as semantic and reverts to the catalog value. On the explicit-behavior path (reader.py:1910-1921), p:cBhvr's own attributes are not checked, and p:cTn/@fill is accepted without being represented. Adding override="childStyle" to an explicit rotation imports with no raw sidecar and loses the attribute.

Medium

  1. The new payload comparison depends on child order. _xml_payload(children) != _catalog_payload(measured) compares ordered tuples, and _catalog_payload walks ("to", "from", "by", "tavLst"). The schema orders p:animScale children cBhvr, by, from, to, and your capture shows PowerPoint writing cBhvr, from, to. entrance.curveUp and exit.curveDown carry both children, so from a PowerPoint file they would import raw rather than semantic. Comparing by element name would fix it without weakening anything.
  2. A media node with no p:stCondLst passes. The guard (reader.py:1232-1245) only runs when the start list is present, so a missing list imports semantically and is rebuilt with delay="indefinite". Requiring the exact node the builder writes would match the rest of the media fix.
  3. The save-path lint still checks the unresolved slide. lint_and_sanitize, which both run_python paths report as lintDiagnostics, still runs _lint_slide_motion on the raw slide. The unexpanded-include case is handled, but override is not, so a target inherited through override is reported as unknown-animation-target on save and is clean on build. Suspending membership when override is present, as for include, would make the two agree.
  4. An include turns off target-membership lint for the whole slide, including in the build path, where expand_includes is already available before lint_motion (api.py:920-936). A misspelled target on such a slide gets no diagnostic. The build could lint the expanded slide, and the suppression could stay for standalone lint only.
  5. lint_diagnostics mixes two slide numberings. lint(data, ...) numbers slides from data["slides"]. On the legacy only_slugs path, lint_motion(resolved_slides) numbers them from a filtered list. Both end up in one list with a bare slide integer.
  6. _fragment_kind falls into the transition branch when kind is missing. str(...get("kind")) becomes "None", and the caller's else removes the transition and leaves the slide's own p:timing in place. That is the two-p:timing case again. The function accepts unvalidated manifests (the rootless case), so refusing anything except "timing" / "transition" would be safer.
  7. No test imports a PowerPoint-authored package. The tests for the stricter reader feed it sdpm's own output, where order and delays agree by construction. That is why 4, 5 and 6 pass the suite. One test that imports a PowerPoint-written package and counts semantic reads would cover this class. The oracle .pptx currently stops earlier, at a p:iterate / p:tmAbs refusal.

Low

  • The mixed-mc:AlternateContent and morphId refusals name no slide. Every sibling error starts with slide {slug!r}:.
  • Now that the transition sound refuses, the import asset path cannot be reached: _asset_name, the assets list in _extract_motion, RawSidecarWriter.add_asset, and the manifest's assets branch. Remove them, or leave one comment saying they stay for the writer's future sound support.
  • inert-group-child-identity is emitted with animations off. The text-build and Morph checks are now gated on their switches.
  • The catalog is 3,054,404 bytes: 3.05 MB or 2.91 MiB, not "2.9 MB".

High 1 to 3 are new in the fixes. High 4 is the remainder of the original finding.

…view findings

Re-review by ShotaroKataoka, 2026-11-16, against `8092aca4`. Three of the four
High findings are regressions the earlier fixes introduced, and each is a case
of a test that passed for the wrong reason.

**H1 — `effects()` could not be reached the way the guide said.** Removing
`describe_effects` as a tool left the animations guide, the `describe` module
docstring and the CHANGELOG documenting
`from sdpm.engine.timing.describe import effects` inside `run_python`. That
route never worked: `servers/local/sandbox.py` rejects every `ast.Import` /
`ast.ImportFrom` at parse time, and the Cloud runner has no `sdpm` installed.
The tests imported the function directly, which is the one thing an author
cannot do — **a test that bypasses the documented route does not test the
documented route**, and that is the lesson worth keeping from this.

It is served by `read_guides` now: `read_guides(["effect:flyIn"])`, with
`transition:` and `category:` routing the same way and anything unprefixed read
as a guide name, so one call can take both. The server answers it, so Local and
Cloud behave identically — which the sandbox route could not.

It rides on `names` rather than taking a parameter of its own because a new
schema property measures at about 150 characters of the per-turn tool budget
and the surface has roughly 160 to spare; widening one description costs 65.
Measured both ways before choosing.

The new tests call the tool, assert the guide names that route, and assert the
sandbox really does reject the old one.

**H2 — the storyboard reported a trigger-revealed element as "never
revealed".** Making each trigger frame independent left the end-of-build pass
reading `slide_frames[-1]`, which is now a trigger's frame. With two triggers
it reported everything the *other* trigger reveals as stranded.

Frames carry `kind: "build" | "trigger"` and the pass reads the last build
frame, by that field rather than by parsing the label. An element a trigger
reveals is excluded as well: it has a reveal path, just not one on the clicker.
Asking "visible in any frame?" instead would have been simpler and wrong — it
would stop reporting the element hidden at the end of its own build, which is
one of the three defects the storyboard exists to catch. The note also lands on
the last build frame now rather than on whatever frame happened to be last.

**H3 — the B314 fix still aborted the import on the input it was about.**
`defusedxml` signals a refusal with `EntitiesForbidden` /
`ExternalReferenceForbidden`, which derive from `ValueError`, not from
`ParseError`. Verified directly: an entity declaration raises
`EntitiesForbidden`, a malformed document raises `ParseError`, and only the
second was caught — so the one input the safe parser was chosen for failed the
whole conversion instead of recording nulls. `DefusedXmlException` is caught
too, with a test that pins the premise so it cannot quietly stop testing
anything.

**H4 — the remainder of the original finding.** The measured path now compares
each behaviour's duration and delay against the capture once the scale is
known, inverting the writer's own rule (`_scaled`, with the visibility `p:set`
keeping its measured duration and having its delay recomputed from the effect
duration). Presence was all the first pass could check, so a *changed* delay
still read as the catalogued preset. On the explicit-behaviour path the carrier
is required to carry no attributes — the writer emits a bare `p:cBhvr`, so an
`override="childStyle"` was being dropped — and `@fill` is no longer accepted
on its `p:cTn`, since the writer emits none and the reader represents none.

**M5 — the payload comparison depended on child order.** The writer appends
`to, from, by, tavLst`, the ECMA-376 sequence for `p:animScale` is
`by, from, to`, and PowerPoint writes `from, to`. So `entrance.curveUp` and
`exit.curveDown` imported semantically from sdpm's own output and raw from a
real file. Both sides key the value subtrees by element name and sort them; the
four names are distinct, so nothing is weakened.

**M6** A media node with no `p:stCondLst` is refused: the guard only ran when
the list was present, so such a node imported semantically and was rebuilt with
the builder's `delay="indefinite"`.

**M7** `lint_and_sanitize` sees one slide and cannot resolve `override`, so an
unresolved `override` now suspends the target-membership rule exactly as an
unexpanded `include` does. The save path and the build path agree about an
inherited target.

**M8** And the build no longer inherits that suppression: it lints the resolved
*and* include-expanded slide, so a misspelled target on a slide with any
include is reported again. The suppression is for the standalone linter, which
cannot read an include.

**M9** `lint_motion` takes the slide numbers from the caller's own list, so the
legacy `only_slugs` path no longer renumbers a filtered list into the same
diagnostics list that `lint` numbered from the full deck.

**M10** `_fragment_kind` refuses anything but `"timing"` / `"transition"`
instead of letting `str(None)` fall into the transition branch. On the in-tree
path `replay_raw_fragment` validates the manifest's shape first, so the guard
covers the rootless, unvalidated case the review named — and the test exercises
it at that seam rather than through `apply_raw_fragment`, which cannot reach it.

**M11 — no test imported a PowerPoint-authored package.** Seven do now, from
the GUI capture fixtures, asserting 23 effects still read as semantic JSON.
They pass before this commit as well as after: the point is not to reproduce a
bug but to pin the calibration, so that tightening a check past what PowerPoint
writes shows up as effects moving from semantic to raw. Without them M4, M5 and
M6 all passed the suite.

**Low.** The mixed-`mc:AlternateContent` and `morphId` refusals name their
slide, like every sibling error. `inert-group-child-identity` is dropped on the
build path when both switches are off, matching the text-build and Morph checks
gated in the previous commit; the save path keeps it, having no switch context.
`_asset_name` is removed — nothing could reach it — while
`SlideMotion.assets`, `add_asset` and the manifest's `assets` branch stay, with
a comment saying why: bundles imported before the transition-sound change carry
`assets` entries and validation has to keep reading them. The catalog is
3,054,404 bytes, which is 3.05 MB or 2.91 MiB; the docstrings said 2.9 MB,
which was MiB labelled MB, and now say 3.0 MB.

Verified: `ruff` clean, 4852 passed / 18 skipped / 4 xfailed. Each of the twelve
new bug-reproducing tests was run against the previous implementation and all
twelve fail there; the seven PowerPoint-package tests are calibration guards and
pass on both. One of the twelve was rewritten after it passed on the old code
for a reason I had not checked — `replay_raw_fragment` already validates the
manifest's shape — so it now tests the seam that is actually exposed.

The three `test_description_budget` params and the order-dependent
`test_svg_icon_is_inlined_with_prefixed_ids` fail on this machine and pass in CI
on all three platforms; neither this branch nor this commit touches them.
@naohito2000

Copy link
Copy Markdown
Contributor Author

All fifteen are fixed in 47efc9b9. CI is green on all 24 checks.

Three of the four High items were regressions my fixes introduced, and all three were tests that passed for the wrong reason. That is the part worth saying plainly before the details.

The three I broke

1 — effects() could not be reached the way I documented it. You are right, and this is the one that bothers me most: I removed the tool, wrote a replacement route into the guide, the module docstring and the CHANGELOG, and never executed it. The tests imported the function directly, which is the one thing an author cannot do. A test that bypasses the documented route does not test the documented route — I have put that in the plan as a standing note rather than just fixing the instance.

It is served by read_guides now, per option (c): read_guides(["effect:flyIn"]), with transition: and category: routing the same way and anything unprefixed read as a guide name, so one call takes both. The server answers it, so Local and Cloud behave identically — which the sandbox route could not have, even with effects in its globals, since Code Interpreter has no sdpm.

It rides on names rather than taking a parameter of its own because I measured both: a new schema property is 156 characters of the per-turn budget and the surface has about 160 to spare, where widening the existing description costs 65. Four characters of headroom is not a margin, and the local/CI discrepancy I could not account for earlier made me unwilling to spend it.

The tests now call the tool, assert the guide names that route, and assert the sandbox really does reject the old one.

2 — the storyboard reported a trigger-revealed element as "never revealed". Exactly as you described; I reproduced it before touching anything. Frames carry kind: "build" | "trigger" and the end-of-build pass reads the last build frame by that field rather than by parsing the label.

I took neither of your two options as stated. "Visibility across all frames" is simpler and wrong: it would stop reporting the element hidden at the end of its own build, which is one of the three defects the storyboard exists to catch. So it is the settled main-sequence state plus excluding anything a trigger reveals — that element has a reveal path, just not one on the clicker. The note also lands on the last build frame now instead of whatever frame happened to be last.

3 — the B314 fix still aborted on the input it was about. Verified directly rather than taking it on trust: an entity declaration raises EntitiesForbidden, an external reference ExternalReferenceForbidden, both DefusedXmlException and both ValueError — and a malformed document raises ParseError. I caught only the second. DefusedXmlException is caught too, and one of the three new tests pins that premise so this cannot quietly stop testing anything.

4 — the remainder of the original finding

The measured path compares each behaviour's duration and delay against the capture once the scale is known, inverting the writer's own _scaled (with the visibility p:set keeping its measured duration and having its delay recomputed from the effect duration rather than scaled). Presence was all the first pass could check, which is exactly why a changed delay survived.

On the explicit-behaviour path the carrier must now carry no attributes — the writer emits a bare p:cBhvr, so override="childStyle" was being dropped — and @fill is no longer accepted on its p:cTn, since the writer emits none and the reader represents none.

Medium

5 Both sides key the value subtrees by element name and sort them. Your diagnosis was precise: the writer appends to, from, ECMA-376 orders by, from, to, and PowerPoint writes from, to, so the comparison agreed with sdpm's own output and disagreed with a real file. The four names are distinct, so keying by them weakens nothing. (Separately: the writer's own append order does not match the schema sequence. I have left that alone — it changes generated bytes — and mention it in case you want it as its own finding.)

6 A media node with no p:stCondLst is refused.

7 An unresolved override suspends the target-membership rule exactly as an unexpanded include does, so lint_and_sanitize and the build agree about an inherited target.

8 And the build no longer inherits that suppression: it lints the resolved and include-expanded slide, so a misspelled target on a slide with an include is reported again.

9 lint_motion takes the slide numbers from the caller's list, so a filtered legacy build no longer renumbers them into a list lint numbered from the full deck.

10 _fragment_kind refuses anything but the two kinds. Worth recording how the test changed: it first passed on the old code, and when I checked why, replay_raw_fragment already validates the manifest's shape, so a kind-less record cannot reach _fragment_kind through apply_raw_fragment. The guard covers the rootless, unvalidated case you named, and the test exercises it at that seam instead of claiming a path that does not exist.

11 Seven PowerPoint-authored packages from the GUI capture fixtures now import in the suite, asserting 23 effects still read as semantic JSON. These pass before this commit as well as after, and that is the point: they are not reproducing a bug, they are pinning the calibration, so a check tightened past what PowerPoint actually writes shows up as effects moving from semantic to raw. You were right that their absence is why 4, 5 and 6 passed the suite.

The oracle .pptx does still stop at the p:iterate / p:tmAbs refusal, so it is not among them; the effect-options-remeasure and motion-paths-complex packages are.

Low

All four. The two refusals name their slide. inert-group-child-identity is dropped on the build path when both switches are off, matching the checks gated in the previous commit; the save path keeps it, having no switch context.

On the dead asset path I split it rather than doing one or the other: _asset_name is removed, since nothing could reach it, while SlideMotion.assets, add_asset and the manifest's assets branch stay with a comment, because bundles imported before the transition-sound change carry assets entries and validation has to keep reading them. Removing the manifest branch would stop those bundles from building.

And the size: 3,054,404 bytes is 3.05 MB or 2.91 MiB. I had written MiB and labelled it MB. The docstrings say 3.0 MB.

Verification

ruff clean, 4,852 passed / 18 skipped / 4 xfailed. Each of the twelve new bug-reproducing tests was run against the previous implementation and all twelve fail there. The seven PowerPoint-package tests are calibration guards and pass on both, as described above.

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

Thank you for 47efc9b9, and for the plain account of the three regressions. Pinning "a test that bypasses the documented route does not test the documented route" as a standing note is the right takeaway, and the calibration tests for the PowerPoint-authored packages are a good addition.

I re-reviewed 8092aca4..47efc9b9 (the fix commit only) with two independent reviewers, as before. Every one of the fifteen findings has a fix in code, and most are fully closed. The items below are either new in this commit or partial closures. References are against 47efc9b9.

Two design decisions

High

  1. The measured-timing check sends some generated decks raw. _read_measured_behaviors recovers the scale as Fraction(int(written), int(source)) (reader.py:2105) from a @dur that _scaled already rounded (writer.py:706-721). When that rounding was inexact, the recovered ratio is not the writer's, and _check_measured_timings (reader.py:2150-2164) misses by one millisecond. Generating every gallery preset at several durations and reading it back, eight combinations that imported as JSON at 8092aca4 import raw at 47efc9b9: entrance.bounce@1234, entrance.centerRevolve@1234, entrance.drop@1234, entrance.drop@300, entrance.drop@700, exit.bounce@1234, exit.centerRevolve@1234, emphasis.teeter@1234. For example, entrance.drop@300 reports p:anim @delay 259 is not the measured 864 at this duration (260). Once duration is known, Fraction(duration, measured_duration) is the writer's exact ratio, so comparing against _scaled(source, that) round-trips by construction. A test that generates each measured preset at a few non-measured durations and asserts the animations come back as JSON would pin it.
  2. Missing or non-numeric timings still import as the catalogued preset. _check_measured_timings skips any value that is None or fails isdigit() (reader.py:2145-2151). _check_carrier pops dur from both sides when the capture records durMs (reader.py:2242-2248), and the start-condition check treats @delay as optional (reader.py:2257-2269). On an entrance.blinds package, delay="indefinite", a deleted @delay, dur="indefinite" and a deleted @dur all import as semantic JSON with no raw sidecar, and the next build writes the catalog numbers over them. The numeric-delay case from the last round is now refused correctly. Treating a missing or non-integer value as a mismatch wherever the capture records that field would close it.

Medium

  1. Reveal-then-hide inside a trigger is still "never revealed". by_trigger admits an element only if it is visible in the trigger frame's final state (storyboard.py:613-620). A trigger entrance with afterEffect: hide, or a later exit in the same trigger, reveals the element and then hides it, so it lands in stranded. The build frame says "(never revealed)" while the trigger frame shows it revealed and hidden. Deriving the set from the trigger's reveal effects rather than its final visibility would fix it. The rest of the change (frame kind, settled state, the note on the last build frame, the own-build case still reported) checks out.
  2. Qualified effect names cannot be looked up. The guide distinguishes entrance.bounce / exit.bounce / motionPath.bounce (animations.md:448-449), but effect:entrance.bounce returns nothing and effect:bounce returns all three. Matching compares only the unqualified tail (describe.py:229-234). Accepting the qualified form would make the guide's names usable.
  3. The lookup's own hints still point at effects(). The unmatched-name hint (describe.py:388-395) and the no-argument next (describe.py:382) tell the caller to call effects(), and CHANGELOG.md:256-262 still says no arguments return the routing table. Neither is reachable through read_guides. They should name the read_guides([...]) form.
  4. The CLI guides subcommand does not route the prefixes. cmd_guides (sdpm/scripts/pptx_builder.py:442-455) calls read_docs directly, so guides effect:flyIn fails with not found in guides/, while SKILL.md:21 says the subcommands match the MCP tools. Binding it to tools.read_guides would bring the no-MCP path along.
  5. One bad entry fails the whole call. An unknown prefix (effects:flyIn) or an empty effect: falls through to read_docs, which raises, so valid lookups in the same call are lost (tools/__init__.py:286-313). The except (KeyError, ValueError) branch at :308-309 is unreachable. Reporting the error per entry, the way unknown effect names already are, would match the rest of the route.
  6. The tightened checks have no tests of their own. Nothing generates a measured preset at a non-measured duration (which is why 1 passed), nothing imports a reordered payload (Medium 5 last round), and the build-time include with a misspelled target (Medium 8) and the only_slugs numbering (Medium 9) are fixed in code but untested. The case at test_animation_schema.py:195-257 covers override, not include.

Low

  • inert-group-child-identity is dropped only when both switches are off (api.py:957-965). A nested id still warns with animations off, and a nested morphId still warns with transitions off. Gating each key on its own switch would match the other checks.
  • category:entrance returns about 17,700 characters, against about 1,300 for one effect. Stating that where category: is documented would keep the "about 140 tokens" claim honest.
  • With override suspending target membership on the save path (model.py:282-296), a misspelled target on an override slide is now reported only at build time. That is a fair trade for Medium 7; a line in the guide would be enough.
  • 3,054,404 bytes is 3.05 MB, which rounds to 3.1 MB at one decimal, not 3.0 MB (three writer docstrings and test_animation_writer.py).
  • model.py:282 builds the suspension reasons and uses only the list's truthiness. Either surface the reason or drop the strings.
  • When the start condition is absent, the media refusal reads "start condition is absent is not the builder's single delay='indefinite'" (reader.py:1273).
  • Includes are expanded twice per build: once in _resolve_config for lint (api.py:950) and again per slide in PPTXBuilder (builder/__init__.py:301).

High 1 and Medium 4–7 are new in this commit. High 2 and Medium 3 are what remains of last round's High 4 and High 2.

Naohito Yoshikawa added 2 commits November 18, 2026 11:05
…ling exactly

Third review by ShotaroKataoka, 2026-11-17, against `47efc9b9`. Both High
findings are in the measured-timing check the previous round added, and both
are mine.

**H1 — the check sent decks sdpm itself had just written to raw.** Eight
gallery presets at some durations: `entrance.drop` at 300, 700 and 1234,
`entrance.bounce`, `entrance.centerRevolve`, `exit.bounce`,
`exit.centerRevolve` and `emphasis.teeter` at 1234.

The ratio was recovered from one behaviour's written `@dur`. `_scaled` had
already rounded that number, so `written / source` sits within half a
millisecond of the writer's fraction without equalling it, and
`measuredDurationMs` times it lands one off: a 300 ms `entrance.drop` came
back as 301, and every later comparison then missed by a millisecond.

Two changes. The ratio is rebuilt as `Fraction(duration, measuredDurationMs)`,
which is the fraction `_duration_scale` hands the writer. And the duration
itself is recovered by intersecting what each written value allows — `_scaled`
is `floor(source × D / M + ½)`, so a written `w` means
`(w − ½) × M / source ≤ D < (w + ½) × M / source`, and the intersection over
every scaled value is exactly the set of durations at which all of them
round-trip. Fixing only the ratio left all eight still raw, because the
recovered *duration* was itself wrong.

The estimate is kept whenever it lands inside the intersection — it is then
provably right, and that is the common case. Taking the lowest integer
unconditionally turned `colorPulse` and `shimmer` from 500 ms effects into
499 ms ones: one distinct timing constrains the duration only loosely, and the
catalogue round-trip caught it.

A millisecond of slack is allowed in the comparison, and only where `_scaled`'s
own docstring records that PowerPoint and this writer may legitimately differ:
an exact half, which PowerPoint's float precision splits both ways. Blanket ±1
would let a deliberately changed delay through.

**H2 — a missing or non-numeric timing imported as the catalogued preset.**
The comparison skipped any written value that was not a run of digits, so
`dur="indefinite"`, a deleted `@dur` and a deleted `@delay` all read back as
the preset and the next build wrote the catalogue's number over a file that
said the effect never ends. A recorded timing the file does not carry as an
integer is refused now.

Refusing inside the comparison was not enough, which is worth recording: the
scaled behaviour's `@dur` is also where the duration is recovered from, so a
non-numeric value there left the scale unrecoverable and the comparison was
skipped altogether. `p:animEffect/@Dur="indefinite"` still imported
semantically after the first attempt. Reading the recorded timings is now one
pass that runs before the duration is known, refuses non-integers, and feeds
both the recovery and the comparison.

Tests. The duration sweep covers all 97 scalable measured presets at four
durations rather than the eight that tripped: which preset breaks depends on
one behaviour's rounding disagreeing with another's, and any single case would
have passed before the fix too. Three of the four durations fail on
`47efc9b9`; 3000 ms trips nothing and is kept as a guard, which the docstring
says. The non-integer tests cover all three recorded locations — the scaled
`p:animEffect` and the visibility `p:set`'s two timings take different
branches — and all six fail on `47efc9b9`.
…um and Low findings

Third review by ShotaroKataoka, 2026-11-17, against `47efc9b9`. The six Medium
and seven Low findings; the two High are in `e9ba4b57`.

**M3 — a trigger that reveals then hides still read as "never revealed".** The
stranded-element pass excluded an element a trigger reveals by reading the
trigger frame's end state, and a trigger entrance carrying
`afterEffect: hide` reveals its target and hides it again within the same
click. It is read off the trigger's effects now, which is the same set that
decides what starts off screen at frame 0 — so the two are derived in one
place rather than two.

**M4 — the names the routing table lists were not the names it accepted.** The
table qualifies a name whenever the bare one is ambiguous, so it lists
`entrance.bounce` and `motionPath.bounce`; the lookup compared the whole
string against the bare tail, which made the listed form the one that returned
nothing while the ambiguous `bounce` returned all three. A qualified name is
split into its category now. The test is generated from the table itself, so it
covers names nobody wrote down.

**M5** The no-argument `next` and the unmatched-name hint named `effects()`,
which is not reachable through `read_guides`. Both name the `read_guides([...])`
form, and the hint also names the qualified form. The CHANGELOG said "no
arguments returns the routing table"; a bare `effect:` is that form, and it
now works (M7).

**M6 — the CLI subcommand did not match the tool it is named after.**
`read_guides` the subcommand read the guide directory itself, so
`read_guides effect:flyIn` reported a missing guide file while
`read_guides(["effect:flyIn"])` answered it — and SKILL.md promises workflow
text that calls a tool applies verbatim to the CLI. It goes through
`tools.read_guides`, prints descriptions and lists the prefixes.

**M7 — one bad name failed the whole call.** `read_docs` raises on the first
name it cannot find, so a single typo returned nothing for the names that were
right; an unknown prefix (`effects:flyIn`) and a bare `effect:` both fell
through to it. Names are read one at a time into an `errors` map, a bare
prefix is the no-argument form, and an unknown prefix says which three exist.
The `except (KeyError, ValueError)` the review called unreachable is gone:
`effects` reports an unknown name as a hint and raises neither — checked, not
assumed.

**M8 — the tightened checks had no tests.** Four now. The measured preset at a
non-measured duration is in `e9ba4b57`. The reordered payload (M5 last round)
asserts schema-order children import as the *same* JSON as writer-order ones.
The build-time include is the case `test_motion_is_validated_after_overrides_resolve`
did not cover: it tests `override`, and the suppression has two triggers. The
`only_slugs` numbering test had to go through `presentation.json` — a deck
directory filters at assembly, so the renumbering the review found is only
reachable on the legacy path, which is worth knowing. All four fail at
`8092aca4`.

**Low** `inert-group-child-identity` is gated per key: `id` on animations,
`morphId` on transitions. Done where the rule is produced rather than by
filtering after, which is the shape the sibling text-build and Morph checks
already have.

`category:` now says what it costs — about 17,700 characters against 1,300 for
one effect — next to the 140-token claim it was undercutting. The guide also
says when a target is checked: a slide with an `include` or an `override`
carries no element list of its own, so that one diagnostic waits for the build.

3,054,404 bytes is 3.1 MB at one decimal, in three writer docstrings and one
test.

The suspension reasons in `validate_slide_motion` are gone, not surfaced: every
return there is a finding and there is no informational channel, so the strings
had nowhere to go. Why the suspension exists stays as a comment.

The media refusal read "start condition is absent is not the builder's single
delay='indefinite'" — it interpolated an empty list into a sentence. The absent
case has its own clause, and the test pins the wording, because a raw fallback
reason is the only account of why a deck went raw.

Includes are still expanded twice, and the second pass is deliberate: one copy
for both would put expanded elements into `BuildConfig.slides`, which the
layout-balance check and the per-slide summary also read. The file read is
cached instead, keyed on mtime and size so an edited file is a different key,
and each caller gets its own copy because the first was free to edit what it
got back.
@naohito2000

Copy link
Copy Markdown
Contributor Author

All fifteen are fixed, in e9ba4b57 (the two High) and 0983d1b7 (the thirteen Medium and Low). 24 checks pass. Thank you — High 1 in particular was a real defect in what I shipped last round, and the measurement that found it is now a test.

High

1 — the measured-timing check sent decks sdpm itself had just written to raw. Reproduced: entrance.drop at 300, 700 and 1234 ms, and entrance.bounce, entrance.centerRevolve, exit.bounce, exit.centerRevolve, emphasis.teeter at 1234.

You named the cause exactly. The ratio was recovered from one behaviour's written @dur, and _scaled had already rounded that number, so written / source sits within half a millisecond of the writer's fraction without equalling it.

Worth recording that fixing the ratio alone was not enough. The ratio is rebuilt as Fraction(duration, measuredDurationMs) now — the fraction _duration_scale hands the writer — but all eight cases were still raw afterwards, because the recovered duration was itself wrong: a 300 ms entrance.drop came back as 301, and every comparison then missed by one.

So the duration is recovered by intersecting what each written value allows. _scaled is floor(source × D / M + ½), so a written w means (w − ½) × M / source ≤ D < (w + ½) × M / source, and the intersection over every scaled value is exactly the set of durations at which all of them round-trip. For entrance.drop at 300 the six behaviours' individual intervals span three milliseconds and meet at [300.0, 300.35).

One thing I got wrong on the first attempt, which the catalogue round-trip caught: taking the intersection's lowest integer unconditionally turned colorPulse and shimmer from 500 ms effects into 499 ms ones. An effect whose timings are all the same value constrains the duration only loosely — colorPulse's single 250 ms admits both. The estimate is kept whenever it lands inside the intersection, where it is provably right, and replaced only when it does not.

The comparison allows one millisecond of slack, and only where _scaled's own docstring records that PowerPoint and this writer may legitimately differ: an exact half, which PowerPoint's float precision splits both ways. Blanket ±1 would let a deliberately changed delay through.

Two more presets import semantically as a result: 251 against 249, with oneWayOnly down to 8.

2 — a missing or non-numeric timing imported as the catalogued preset. Fixed; a recorded timing the file does not carry as an integer is refused.

Refusing inside the comparison was not sufficient, and this is the part worth your attention: the scaled behaviour's @dur is also where the duration is recovered from, so a non-numeric value there left the scale unrecoverable and the comparison was skipped entirely rather than failing. After my first attempt p:animEffect/@dur="indefinite" still imported semantically — my own probe of the three recorded locations found it, not the test I had written. Reading the recorded timings is now one pass that runs before the duration is known, refuses non-integers, and feeds both the recovery and the comparison.

Medium

3 Derived from the trigger's reveal effects, as you suggested. That is the same set that decides what starts off screen at frame 0, so the two are now derived in one place instead of two.

4 A qualified effect is split into its category. The test is generated from axis_table itself rather than listing the names, so it covers every qualified name the table produces, including ones nobody wrote down.

5 Both hints name the read_guides([...]) form, and the unmatched-name hint also names the qualified form. The CHANGELOG's "no arguments returns the routing table" is now true of a bare effect:, which works as of Medium 7.

6 cmd_guides goes through tools.read_guides. It prints descriptions, and the bare listing names the three prefixes.

7 Names are read one at a time into an errors map, so a typo costs that name and not the call. A bare prefix is the no-argument form; an unknown prefix says which three exist instead of being reported as a missing guide file.

You were right that the except (KeyError, ValueError) is unreachable, and it is gone. I checked rather than assumed: effects reports an unknown effect, category and transition as a hint and raises neither.

8 Four tests, each verified to fail on the commit that preceded its fix.

The only_slugs one needed presentation.json: a deck directory filters at assembly, so both numberings start from the same list there and the renumbering you found is reachable only on the legacy path. My first attempt at that test went through a deck directory and asserted the wrong thing.

And you were right that test_animation_schema.py:195-257 covers override only — the suppression has two triggers and the include one had no test.

Low

All seven.

inert-group-child-identity is gated per key, at the point the rule is produced rather than by filtering after, which is the shape the sibling text-build and Morph checks already have.

category: states its cost — about 17,700 characters against 1,300 — next to the 140-token claim it was undercutting. The guide also gained a short section saying when a target is checked, which covers your note about override on the save path.

3.1 MB in three writer docstrings and one test.

The suspension reasons are dropped rather than surfaced: every return from validate_slide_motion is a finding and there is no informational channel, so the strings had nowhere to go. Why the suspension exists stays as a comment.

The media refusal's absent case has its own clause, and the test pins the wording — a raw fallback reason is the only account a reader gets of why a deck went raw.

On the double expansion: the second pass is deliberate and I kept it. One expanded copy for both would put expanded elements into BuildConfig.slides, which the layout-balance check and the per-slide summary also read. The file read is cached instead, keyed on mtime and size so an edited file is a different key, and each caller gets its own copy because the first was free to edit what it got back.

The pattern in these three rounds

Each round, the High findings have been regressions my own fixes introduced, and each one was a test passing for the wrong reason. Round two: a test that bypassed the documented route. Round three: a test that exercised the measured path only at the duration it was measured at.

So the new tests are swept rather than sampled — all 97 scalable presets at four durations, every qualified name the table generates, all three recorded timing locations — and I verified each one fails on the previous implementation before committing. Three of the four durations and all six timing locations do; the cases that do not are marked as guards in their docstrings rather than left looking like reproductions.

ShotaroKataoka
ShotaroKataoka previously approved these changes Nov 18, 2026

@ShotaroKataoka ShotaroKataoka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for e9ba4b57 and 0983d1b7, and for writing up the two places where the first attempt was not enough: the recovered duration being off by one after the ratio was fixed, and the non-numeric @dur that skipped the comparison. Sweeping the tests and checking that each one fails on the previous implementation is what made this round easy to verify.

I re-reviewed 47efc9b9..0983d1b7 with two independent reviewers, as before. All fifteen round-3 findings are closed. No High or Medium items remain, so I'm approving. The Low items below are new in this range, and the first one is worth the one-line fix before merge. References are against 0983d1b7.

Low

  • The half-rounding slack also accepts the value neither writer produces. _check_measured_timings allows abs(written - expected) <= 1 on an exact half (reader.py:2294-2295). _scaled rounds a half up (writer.py:706-721), so expected is already the upper rounding, and the two values PowerPoint or this writer can produce are expected - 1 and expected. expected + 1 is neither, but it passes. Example: entrance.bounce at 300 ms, p:animScale @delay changed from 98 to 99 (650 × 300/2000 = 97.5), imports as entrance.bounce with durationMs: 300 and no raw sidecar, and the next build writes 98. entrance.drop@875 (@dur 137 → 138) and exit.boomerang@201 (@delay 101 → 102) behave the same way. Changing every scaled timing by ±1 and ±2 at 200–2000 ms, about 17,700 of 3.78 million edited files import semantically with a value that is neither rounding of the product. Most are +1; the ±2 cases happen when the edit moves the recovered duration by 1 ms and the slack covers the rest. The loss is at most a millisecond or two, and only on a hand edit, which is why this is Low. It does contradict the reply's "blanket ±1 would let a deliberately changed delay through", though. Accepting only the two roundings (written in (expected - 1, expected) on a half, written == expected otherwise) fixes it, and a package test that changes the Bounce delay from 98 to 99 and expects raw would pin it.
  • The "Related guides" heading is gone. The new ### When a target is checked section replaced ## Related guides instead of going above it (animations.md:986). The four read_guides([...]) bullets at :997-1004 now read as part of the validation subsection. Restoring ## Related guides above :997 fixes it.
  • The invalid-include error now names the absolute path. _include_elements raises Invalid JSON in include file {path} with the resolved path (builder/__init__.py:672). At 47efc9b9 it named the deck-relative src. On the Remote server that is the materialised tmpdir, which means nothing to the agent reading the error. Catching at the call in expand_includes and naming src would restore the old message.

The include double expansion

Your rationale holds. One expanded copy shared by _resolve_config and PPTXBuilder would put expanded elements into BuildConfig.slides and change what the layout-balance check and the per-slide summary read. Avoiding that without a second pass means carrying a second list through BuildConfig, which is more than this point is worth. The cache is correct as written: the key is (path, (st_mtime_ns, st_size)), errors are not cached, each caller gets a deep copy, the size is bounded at 256 for the long-lived servers, and on the Remote server every request gets a fresh tmpdir, so entries cannot cross decks. One limit should be known rather than fixed: a rewrite of an include that keeps the same size within the filesystem's timestamp granularity returns the old content until the process restarts. That only happens with 1-second timestamps (HFS+, FAT, some network filesystems); APFS and ext4 store nanoseconds. Either the cached read or a plain second read is fine with me.

Round-3 findings

# Finding Verdict How it was checked
1 Measured-timing check sends generated decks raw closed All 97 proportional presets plus every non-default measured option (190 variants) at 30 durations, each read back and rebuilt: 5,700 semantic, 0 raw, 0 XML drift (47efc9b9: 219 raw, 6 drift). colorPulse / shimmer stay 500 ms. At odd durations they read back 1 ms high, but the XML at D and D+1 is byte-identical and 47efc9b9 does the same, so nothing is lost.
2 Missing or non-numeric timings import as the preset closed Five presets at three durations, every @dur / @delay set to indefinite, deleted, empty, -1, 1e3, +500, " 500": 882 of 882 refused (47efc9b9: 665 imported as the preset). Includes p:animEffect/@dur="indefinite". _measured_timings (reader.py:1086-1132) runs before duration recovery.
3 Reveal-then-hide inside a trigger is "never revealed" closed afterEffect: hide on a trigger entrance, and an entrance plus an exit in one trigger, no longer print "never revealed"; an element hidden by its own build's afterEffect: hide is still reported. One derivation for frame 0 and by_trigger (storyboard.py:282-302, :645).
4 Qualified effect names cannot be looked up closed effect:entrance.bounce, exit.bounce and motionPath.bounce return one effect each, bare bounce returns three, and every name in the routing table resolves (describe.py:232-237).
5 Hints point at effects() closed Both the routing table's next and the unmatched hint name read_guides([...]) (describe.py:393-406); the CHANGELOG's bare effect: line is now true.
6 CLI does not route the prefixes closed read_guides effect:flyIn, effect:entrance.bounce, effect: and category:emphasis work from the CLI; the bare listing names the prefixes (pptx_builder.py:442-468).
7 One bad entry fails the whole call closed ["effects:flyIn", "effect:flyIn", "animations"] returns both good entries plus a per-name error naming the three prefixes; the dead except is gone (tools/__init__.py:286-335).
8 Tightened checks have no tests closed With the new tests applied to 47efc9b9, 21 of 31 fail, and the ones that pass are those marked as guards. The schema-order payload, include-target and only_slugs tests pass on 47efc9b9 because those fixes were already there; we did not run them against 8092aca4.
9 inert-group-child-identity gated on both switches closed Each key is gated on its own switch (api.py:964-972, model.py:256); both parametrised cases fail on 47efc9b9.
10 category: cost unstated closed animations.md:467-469; measured 17,662 and 1,311 characters.
11 override target checked only at build closed Table note at animations.md:977 and the new section at :986-995 (see the heading item above).
12 3.0 MB closed 3.1 MB in writer.py:377, 559, 967 and test_animation_writer.py:3235; no 3.0 MB left.
13 Unused suspension reasons closed A boolean, with the reason in a comment (model.py:301-312).
14 "is absent is not" wording closed Separate clause for the absent case (reader.py:1390-1396), pinned by a test that fails on 47efc9b9.
15 Includes expanded twice closed (kept by design, read cached) See the section above. Cache tests at tests/test_checks_includes.py:81-132 pass.

make lint is clean. make test has two local failures outside the range: the PowerPoint-only catalog check, which also fails on 47efc9b9, and an HTML icon test that passes on its own.

Thanks again for the careful turnaround. Approving, with the slack fix as the one thing I'd still like to see go in.

…ndings of a half

Approval review by ShotaroKataoka, 2026-11-18, against `0983d1b7`. Three new
Low findings; the first is a real defect and it contradicts what I wrote in the
reply.

**The half slack accepted a value neither writer produces.** I argued that a
blanket ±1 would let a changed delay through, and then allowed exactly that on
a half: `abs(written - expected) <= 1`.

`_scaled` rounds a half up, so `expected` is already the upper rounding and the
only other value a writer can emit is `expected - 1`. The two legitimate values
are not symmetric around `expected`, and `expected + 1` passed. Reproduced on
all three cases the review names: `entrance.bounce` at 300 ms with `@delay`
hand-edited from 98 to 99 (650 × 300/2000 = 97.5) imported as `entrance.bounce`
at 300 ms with no raw sidecar, and the next build wrote 98 back over the edit.
Same for `entrance.drop@875` and `exit.boomerang@201`.

The comparison now lists the values a writer can produce — `(expected - 1,
expected)` on a half, `(expected,)` otherwise — and the refusal message names
both. The lower rounding still imports, which is the case the slack exists for:
PowerPoint's float precision splits an exact half both ways.

Two tests. The three named cases, as the review asked. And a sweep of every
exact half the catalogue produces — 64 locations across 97 presets at three
durations, of which 27 imported semantically before this commit. Which timing
lands on a half depends on the ratio, so these cannot be enumerated by hand;
that is the same reason the duration sweep covers the whole catalogue, and it
is why the three named cases alone would have been the weaker test.

**The "Related guides" heading was gone.** My `### When a target is checked`
section replaced `## Related guides` rather than going above it, so the four
`read_guides([...])` bullets read as part of the validation subsection.
Restored.

**The invalid-include error named the resolved path.** Caching the read moved
the message into the cached function, where only the absolute path is in scope
— and on the Remote server that is a materialised tmpdir, which tells the agent
reading the error nothing. Raised at the call site again, naming the
deck-relative `src`. A test pins that the resolved path does not appear, and
another pins that a read error is still not cached, so fixing the file and
rebuilding works without a restart.

On the cache's one real limit, which the review asked to have known rather than
worked around: a rewrite that keeps the same size within the filesystem's
timestamp granularity is the same key and returns the old content until the
process restarts. That needs one-second timestamps — HFS+, FAT, some network
filesystems — while APFS and ext4 store nanoseconds. Recorded in the
docstring.
@naohito2000

Copy link
Copy Markdown
Contributor Author

Thank you for the approval, and for catching the slack. All three Low items are in 96b04b80; 24 checks pass. The push dismissed the approval under this repo's stale-review rule, so this needs one more look whenever convenient.

The slack

You were right, and it contradicts what I wrote in my last reply. I argued a blanket ±1 would let a changed delay through, and then allowed exactly that on a half. _scaled rounds a half up, so expected is already the upper rounding and the only other value a writer can emit is expected - 1 — the two are not symmetric around expected, which is what I had assumed without checking.

All three of your cases reproduce: entrance.bounce at 300 ms with @delay edited from 98 to 99 imported as entrance.bounce at 300 ms with no raw sidecar, and the next build wrote 98 back over the edit. Same for entrance.drop@875 and exit.boomerang@201.

The comparison now lists the values a writer can produce — (expected - 1, expected) on a half, (expected,) otherwise — and the refusal message names both. The lower rounding still imports, which is the case the slack exists for.

Two tests rather than one. The three named cases, as you asked. Plus a sweep of every exact half the catalogue produces: 64 locations across 97 presets at three durations, 27 of which imported semantically before the fix. Which timing lands on a half depends on the ratio, so the cases cannot be enumerated by hand — and the three named ones alone would have been the weaker test, for the same reason the duration sweep covers the whole catalogue rather than the eight presets that tripped. That is now three rounds where sampling was the thing that hid the defect, so the sweep is the form I am defaulting to.

The heading

Restored above the four read_guides([...]) bullets. The section I added had ## Related guides inside the replaced range rather than after it.

The include error

Raised at the call site again, naming the deck-relative src. Caching the read had moved the message into the cached function, where only the absolute path is in scope. Two tests: one asserts the resolved path does not appear in the message, and one asserts a read error is still not cached, so fixing the file and rebuilding works without a process restart.

The cache limit

Recorded in the docstring rather than worked around, as you suggested — a rewrite keeping the same size within the filesystem's timestamp granularity returns the old content until the process restarts, which needs one-second timestamps (HFS+, FAT, some network filesystems) rather than APFS or ext4. Thank you also for checking the cache properties I had not stated: errors uncached, deep copy per caller, bounded size, fresh tmpdir per Remote request.

On your round-3 verification

Your note that the schema-order, include-target and only_slugs tests pass on 47efc9b9 is right, and my reply was imprecise about it: those three fix round-2 findings, so 47efc9b9 already contains the fixes and 8092aca4 is the commit they fail on. I checked them there, and the commit message says so, but the reply did not.

One thing to flag

The branch is 7 commits behind origin/main (v0.18.0, radar charts, dependency bumps). mergeStateStatus is BEHIND and mergeable is MERGEABLE, so CI ran honestly against the tip, but say the word if you would rather I merge main before you merge this — happy either way, and happy to do it after the re-approval so a merge commit does not dismiss it again.

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

🤖 KiroCrew automated comment

⚠️ NEEDS CHANGES: one item for a maintainer to follow up on; the latest delta looks good

CI ran on 96b04b8, and every check passes except the "Blog label" check, which contributors can ignore.

A maintainer will follow up separately on one item found in this review.

Other notes

  • Delta since the dismissed approval (0983d1b7 → 96b04b80): the reader's measured-timing check now accepts exactly (expected - 1, expected) on a half, instead of abs(...) <= 1 (sdpm/sdpm/engine/timing/reader.py around line 2294). The include-file error is now named by the deck-relative src (sdpm/sdpm/engine/builder/__init__.py around line 708). Both match the explanations in the thread, and the new tests cover them.
  • Branch is behind main by 10 commits. git merge-tree shows no conflicts, but CI should run again on the updated head before merge.
  • The PR description contradicts itself. The Summary still says describe_effects is "a new tool … Bound on both servers, so the MCP tool count goes 20 → 21". The Testing / v0.14.0 sections say it is no longer a tool and the count is 20. "Reading the diff" says 154 files / +287,731, but GitHub shows 147 files / +282,220. Please rewrite the Summary and the table so they describe the current head.

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

🤖 KiroCrew automated comment

⚠️ NEEDS CHANGES: harden XML parsing of animation sidecars (follow-up to the earlier note)

This is the maintainer follow-up mentioned in the previous KiroCrew comment. It is a defense-in-depth gap in code added by this PR; nothing on main or in a release is affected.

Finding

  1. sdpm/sdpm/engine/timing/model.py:414 — validate_xml_resource_limits rejects DTDs by searching the raw bytes for <!DOCTYPE / <!ENTITY. XML encoded as UTF-16 does not contain those byte sequences, so it passes the check.
  2. sdpm/sdpm/engine/timing/raw.py:497 — the same bytes are then parsed again with etree.fromstring(xml_bytes), i.e. lxml's default parser.
  3. sdpm/pyproject.toml lists lxml with no lower bound. With the locked lxml 6.1.3, external entities are not resolved (checked locally), but lxml < 5 resolves them, so an install with an older lxml could read a local file into the generated PPTX via a crafted animations/ sidecar.

Suggested fix

  • Parse once with a hardened parser: etree.XMLParser(resolve_entities=False, load_dtd=False, no_network=True), and reject when root.getroottree().docinfo.doctype is set, instead of the byte search.
  • Reuse that parsed tree in raw.py rather than parsing the bytes a second time.
  • Add lxml>=5 to sdpm/pyproject.toml.
  • Add a test in tests/test_animation_security.py with a UTF-16 encoded document that carries a DOCTYPE.

Naohito Yoshikawa added 2 commits December 3, 2026 02:16
A sidecar's XML was checked for DTDs by searching the raw bytes for
<!DOCTYPE / <!ENTITY, then parsed a second time in remap_fragment with
lxml's default parser. Both halves were weak: the byte search looks for
UTF-8 spellings, so the same document that was refused as UTF-8 passed
as UTF-16 (measured), and the default parser names none of
resolve_entities=False / load_dtd=False / no_network=True, which on
lxml < 5 resolves external entities.

- validate_xml_resource_limits now rejects any document whose
  docinfo.doctype is set, after the hardened parse, whatever the
  encoding. The byte search stays as a fast path: it carries the precise
  diagnostic and is the only thing that catches a bare <!ENTITY with no
  DOCTYPE around it, which is not well-formed and would otherwise come
  back as a syntax error.
- validate_xml_resource_limits and enforce_xml_limits return the parsed
  root, and remap_fragment uses it instead of calling etree.fromstring
  on the same bytes.
- lxml>=5 in sdpm/pyproject.toml.
- tests/test_animation_security.py covers a UTF-16 and a UTF-32 DOCTYPE,
  both of which pass the byte search, and that the limits check hands
  back the tree it parsed.

Addresses the maintainer follow-up on #595.
The entry was written into [Unreleased]. A later merge from main renamed
that heading to [0.16.0] - 2026-11-12 with the branch's 45 lines still
inside it, so the CHANGELOG claimed object animations and slide
transitions had shipped in 0.16.0. They have not shipped at all.

The block moves back under [Unreleased] with its own Added heading.
Nothing of main's 0.16.0 content changes: the diff against the merge base
removes no line.
@naohito2000

Copy link
Copy Markdown
Contributor Author

XML hardening applied, with one deviation — plus the description item from the earlier note

Head is now db684716.

The follow-up finding (2026-11-21)

All four suggestions are in 38e8ce6e.

suggestion state
1 reject on root.getroottree().docinfo.doctype after a hardened parse done (model.py:436)
2 reuse that tree in raw.py instead of a second etree.fromstring done (raw.py:496)
3 lxml>=5 in sdpm/pyproject.toml done, with the reason in the comment; uv.lock's requires-dist follows
4 a UTF-16 test carrying a DOCTYPE done, UTF-16 and UTF-32

I reproduced the bypass before fixing it, so the test is written against a measured failure
rather than a guess:

utf-8    bytes contain '<!DOCTYPE': True    -> refused (TimingXmlLimitError)
utf-16   bytes contain '<!DOCTYPE': False   -> passed the check

Deviation: the byte search stays, next to the new check, rather than being replaced by
it.
The suggestion was to reject on docinfo.doctype instead of the byte search. The
docinfo check is there and it is the guarantee — but the byte search is the only thing
that catches a bare <!ENTITY payload "x"> with no DOCTYPE around it. That document is not
well-formed, so with the byte search gone it comes back as an XML syntax error instead of
the refusal test_a_dtd_or_entity_declaration_is_refused asserts, and the diagnostic gets
vaguer for the case a user is most likely to hit. Both checks and the reason for each are in
the docstring at model.py:410. Say the word if you would rather have the byte search gone
and that existing case re-asserted as a syntax error.

Interface change, since it is not local to one file. validate_xml_resource_limits and
enforce_xml_limits return the parsed root; both were -> None. Nine call sites, and only
raw.py:496 reads the value — the other eight call them for the side effect and are
unaffected by a wider return type.

A note on the test's parametrisation: UTF-16 and UTF-32 there are the BOM-carrying
spellings, because those are the wide encodings lxml detects from the bytes alone. A
BOM-less utf-16-le document is refused too, but by the parser as "Document is empty"
rather than by this check, so asserting the refusal message on it would have been asserting
lxml's behaviour, not ours.

The description item from 2026-11-19

Rewritten against the current head:

  • describe_effects as "a new tool … 20 → 21" is gone from the Summary. The effect
    descriptions ride on read_guides(["effect:flyIn"]) and the tool count stays 20. The
    Summary, the Testing section and "Catching up to main" now say the same thing, and the
    last of those records both steps, including that the run_python route documented at the
    v0.14.0 merge never worked.
  • The counts are the ones GitHub shows: 149 files, +282,279 / -75 against the merge base
    ff157278, and the per-area table is recomputed with its bucketing rule written down so
    it can be checked.
  • Measured gates on this head: make lint clean, make smoke clean, pytest tests/
    4,906 passed, 27 skipped, 3 xfailed, 4 failed — the same four fail with the hardening
    commit stashed, and they are the three description-budget cases and the order-dependent
    SVG icon test already described in Testing.

One more thing I found while in there

db684716. This branch's CHANGELOG entry was written into [Unreleased], and a later merge
from main renamed that heading to [0.16.0] - 2026-11-12 with the branch's 45 lines still
inside it — so the CHANGELOG claimed object animations and slide transitions shipped in
0.16.0. The block is back under [Unreleased]; git diff ff157278 -- CHANGELOG.md removes
no line, so none of main's 0.16.0 content moved.

Still outstanding

The branch is 37 commits behind main and CONFLICTING, so no pull_request workflow
runs on this head. git merge-tree puts the conflicts in six files, all of them functions
that grew on both sides: sdpm/sdpm/api.py, engine/builder/__init__.py,
engine/checks/__init__.py, engine/schema/deck_spec.py, tools/__init__.py,
servers/remote/server.py. I am holding the merge until #711 lands, because that PR touches
four more of the same files and doing it once is cheaper than twice; CI will have a clean
head to run on after it.

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

🤖 KiroCrew automated comment

⚠️ NEEDS CHANGES: the XML hardening and the description are fixed; the branch still conflicts with main

Re-review of 92e62ef..db684716 (38e8ce6e hardening, db684716 CHANGELOG). Thank you for reproducing the bypass before fixing it. The only blocker left is the merge with main, which you already plan after #711.

CI: pending CI. No pull_request workflow has run on db684716 because the PR is CONFLICTING; only CodeQL ran (pass). Safe to run CI: yes (no changes under .github/, scripts/install/, infra/ or templates).

Earlier items

Item State Evidence
1. UTF-16 / UTF-32 DOCTYPE passes the byte search ✅ fixed sdpm/sdpm/engine/timing/model.py:436 rejects on docinfo.doctype after a hardened parse (:431). Probe: UTF-16 DOCTYPE + SYSTEM entity, UTF-32 DOCTYPE, lower-case <!doctype, UTF-7 declaration all refused with TimingXmlLimitError; plain UTF-8/UTF-16 documents still parse.
2. raw.py re-parsed with lxml's default parser ✅ fixed sdpm/sdpm/engine/timing/raw.py:499 uses the tree enforce_xml_limits returns.
3. lxml had no lower bound ✅ fixed sdpm/pyproject.toml:8 lxml>=5; uv.lock requires-dist follows; uv lock --check passes.
4. Test with a wide-encoded DOCTYPE ✅ fixed tests/test_animation_security.py: with the new test file on 92e62ef, 3 tests fail ([utf-16], [utf-32], hands_back_the_tree); on db684716 all 21 pass.
5. PR description contradicts itself (describe_effects, 20 → 21, counts) ✅ fixed Summary now says the tool count stays 20; 149 files matches GitHub. Tiny nit: GitHub shows +282,282, the body says +282,279 (likely the db684716 CHANGELOG move).
6. Branch behind main ❌ not fixed Now 37 commits behind and CONFLICTING. git merge-tree against c43f773 conflicts in 7 files: CHANGELOG.md, sdpm/sdpm/api.py, engine/builder/__init__.py, engine/checks/__init__.py, engine/schema/deck_spec.py, tools/__init__.py, servers/remote/server.py. Holding until #711 is fine; CI must then run on the merged head.

The CHANGELOG fix in db684716 checks out: the block is back under [Unreleased], and git diff ff15727 -- CHANGELOG.md removes no line.

The deviation (byte search kept next to docinfo)

Agreed; it is safe. The byte search only adds refusals, never removes one, and docinfo.doctype is still the guarantee for every encoding. Keeping it gives a clearer message for a bare <!ENTITY ...> in UTF-8. A bare <!ENTITY in UTF-16 is still refused, as a syntax error from the hardened parse, which is fine. Its only cost is a false refusal for <!ENTITY inside a comment or CDATA, which sdpm's own sidecars never contain.

Optional nit: model.py:429 calls xml_bytes.upper() twice, copying the document twice. One upper = xml_bytes.upper() is enough.

Context size (not a blocker; worth a look during the merge)

Measured with main's scripts/context_size.py (tiktoken o200k_base), merge base ff157278 vs db684716:

Loaded Δ tokens
Tool definitions, every session (Local) +105 (generate_pptx +79, read_guides +26)
Orchestrator at start (Local) +389
Composer-pptx at start (Local) +372
animations.md / animation-craft.md 13,578 / 4,046, on demand only

The two new guides are never always-loaded. Only read_guides(["animations"]) reaches them, and the composer reads it only when a motion switch is on. Good.

Since #683, the whole Local tool surface on main is 2,669 tokens, so +105 is about +4% for every client and every session. Two ideas: drop animation_mode / transition_mode from generate_pptx (sdpm/sdpm/tools/__init__.py:159-160), since deck.json already has both switches. Or merge them into one parameter. The new orchestrator paragraph (sdpm/references/workflows/orchestrator.md, 14 lines) could be about half as long. It should keep three rules: off by default, set before dispatching composers, and a deck must read correctly with motion off.

Morph / #724 (note, not a blocker)

The maintainer moved #724 (slide transitions, starting with Morph) into this PR today. The PR body does not link it yet. A Refs #724 (or Closes #724, once the transitions part covers its Ken Burns and cut-away cases) would keep the two together.

Local checks on db684716 (Python 3.13)

  • make lint: pass
  • uv run pytest tests/: 4,906 passed, 31 skipped, 3 xfailed, 0 failed. The 4 failures you described did not happen here.
  • make smoke: pass (20 tools, 2 templates)
  • tests/test_animation_security.py: 21 passed

KiroCrew does not approve or merge; a maintainer decides.

@naohito2000
naohito2000 marked this pull request as draft December 3, 2026 07:46
@naohito2000

Copy link
Copy Markdown
Contributor Author

Parking this as a draft. Not a review request for now.

The plan is to split it rather than land it as one 149-file PR, and the author wants the whole animation area paused while other work goes first. #646 — the p:animScale / p:animClr child order — is parked with it: sdpm/sdpm/engine/timing/ does not exist on main at all, so that defect lives only on this branch and nothing released or cloned carries it. It gets fixed before any part of this lands.

I will mark it ready again when the split is done. Nothing here needs attention in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants