Summary
add --type shape happily writes an adjust-value <a:gd> into a preset geometry that has no adjust handles (e.g. rect, ellipse), and validate reports no errors — but PowerPoint refuses to open the file, reporting it as corrupt. This is a silent data-corruption path: all officecli-side checks stay green.
Repro (v1.0.136, macOS)
officecli create repro.pptx
officecli add repro.pptx / --type slide
officecli add repro.pptx '/slide[1]' --type shape \
--prop geometry=rect --prop x=1cm --prop y=1cm --prop width=4cm --prop height=2cm \
--prop text="test" --prop adj="adj:val 14000"
officecli validate repro.pptx
# -> "Validation passed: no errors found."
Resulting slide XML:
<a:prstGeom prst="rect"><a:avLst><a:gd name="adj" fmla="val 14000"/></a:avLst></a:prstGeom>
Opening this file in desktop PowerPoint triggers the "repair/corrupt" dialog.
Expected
Two layers of defense, either of which would have caught this:
add/set should reject adjust values whose name is not legal for the target prst (e.g. rect/ellipse accept none; roundRect/chevron/homePlate/triangle accept adj; round2SameRect and the arrow family accept adj1/adj2, etc.).
validate should flag existing <a:gd> entries whose name is not in the preset's avLst as defined by ECMA-376 presetShapeDefinitions.xml.
The full legal-handle table is mechanical to derive from presetShapeDefinitions.xml (each preset's <avLst> lists its gd names), so this can be a static lookup table.
Impact
High — the file passes validate, unzips fine, and renders fine in view html/screenshot, yet is unopenable in PowerPoint. Agents driving officecli have no way to detect the problem short of regex-auditing the raw XML themselves.
Summary
add --type shapehappily writes an adjust-value<a:gd>into a preset geometry that has no adjust handles (e.g.rect,ellipse), andvalidatereports no errors — but PowerPoint refuses to open the file, reporting it as corrupt. This is a silent data-corruption path: all officecli-side checks stay green.Repro (v1.0.136, macOS)
Resulting slide XML:
Opening this file in desktop PowerPoint triggers the "repair/corrupt" dialog.
Expected
Two layers of defense, either of which would have caught this:
add/setshould reject adjust values whosenameis not legal for the targetprst(e.g.rect/ellipseaccept none;roundRect/chevron/homePlate/triangleacceptadj;round2SameRectand the arrow family acceptadj1/adj2, etc.).validateshould flag existing<a:gd>entries whose name is not in the preset'savLstas defined by ECMA-376presetShapeDefinitions.xml.The full legal-handle table is mechanical to derive from
presetShapeDefinitions.xml(each preset's<avLst>lists itsgdnames), so this can be a static lookup table.Impact
High — the file passes
validate, unzips fine, and renders fine inview html/screenshot, yet is unopenable in PowerPoint. Agents driving officecli have no way to detect the problem short of regex-auditing the raw XML themselves.