Skip to content

feat(document): PPTX adapter with presentation projection and export - #51

Merged
1wgrumph merged 5 commits into
mainfrom
feat/22-pptx-adapter
Sep 30, 2026
Merged

1wgrumph merged 5 commits into
mainfrom
feat/22-pptx-adapter

Conversation

@1wgrumph

Copy link
Copy Markdown
Contributor

Summary

PPTX adapter for enterprise-document evidence (#22). It is the last of the four format adapters, registered alongside DOCX, XLSX and PDF in the #25 conformance harness.

  • Import: maps PresentationML to a presentation projection. It covers:

    • deck and slide order, slide identities, sections and layouts;
    • shapes, text, tables, links and grouped elements;
    • speaker notes (with a budget, so shared notes cannot multiply memory), comments, alt text and reading order;
    • theme and style references;
    • images as content-addressed assets;
    • stable slide, shape and text locators.

    Relationship attributes resolve through in-scope namespace bindings; undeclared prefixes are refused. Transitions, animations, charts, SmartArt and media are listed in the fidelity receipt rather than dropped silently.

  • Safety: macros, actions, embedded objects, scripts and media are never executed. External relationships and remote media are never followed. Part-count, relationship, nesting, decompression and byte limits apply.

  • Export: a deterministic PPTX with a fidelity receipt, which the importer accepts back (compression included). DLP and public-boundary checks cover every emitted part, binary images included, before anything is written.

Closes #22

Verification

  • ./tools/ci/check.sh --fast and --full pass on the branch merged with current main: 246 conformance checks in the fast tier, none unavailable. No new dependencies.
  • Readers: python-pptx 1.0.2 and LibreOffice 26.2 open the exports (opt-in reader test).
  • Independent review (Codex GPT-6 Astra) returned REPAIR_REQUIRED with four findings, all fixed in 5d6cfbd with tests that failed first:
    • binary image content bypassed the export DLP rescan;
    • shared notes amplified memory until the process aborted;
    • export produced decks the importer refused;
    • undeclared r attributes were treated as relationship attributes.
  • Merge fallout: main added Json::get, which shadowed the adapter's Field::get trait method. The trait method is renamed to Field::field, and main's reviewed code is unchanged.

Not covered: PowerPoint itself was not available to test. Query/packet selection of document evidence is tracked in #46.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GXsmZAgLAftTb8E5oswz82

Claude Code and others added 5 commits September 30, 2026 06:12
…receipt

Import runs the shared OPC intake, then maps PresentationML into canonical
content: slide order and ids, sections, layout names, shapes in reading
order with groups, text, tables, notes, comments, alt text, links, and
images as content-addressed assets, plus envelope-shaped citation anchors.
Embedded packages, OLE objects, controls, and program, macro, or OLE click
actions are refused. Unsupported transitions, animations, charts, SmartArt,
and media are receipted, never dropped silently. The joined text runs
through the shared DLP check, which catches canaries split across runs.

Export projects the content into a new deck on a generic master, layouts,
and theme with a fidelity receipt part. DLP and public-boundary checks run
on everything the deck would contain before bytes are returned.

The adapter registers with the conformance harness, so the corpus now runs
every PPTX package row through it and the three PPTX adapter rows are
executable. The corpus takes executable rows from each adapter's test
module.

Refs #22
…suite

Add the PPTX adapter document: boundary, canonical content, anchors,
receipt codes, export, test evidence, the two-reader result, and the
acceptance status for #22. Mark the PPTX rows executable in the
conformance suite and fill the PPTX column of the compatibility table.

Refs #22
The shared XML reader now keeps attribute prefixes as written, so the
adapter no longer saw r:id, r:embed, or the relationship id of p:sldId and
refused every deck. Relationship attributes are now keyed by namespace:
any prefix bound to the Transitional or Strict relationship namespace
reads as r:, and r bound to another namespace does not count. The old
digit test that told a slide id from its relationship id is gone.

Canonical content is unchanged: the recorded digest still holds. A new
test covers a renamed prefix and a foreign r binding.

Refs #22
Rescan binary parts with intake DLP, bound cumulative projection work, enforce export budgets and compression ratios, and reject unbound XML prefixes. Preserve and test the four exact reviewer inputs.

Refs #22
# Conflicts:
#	crates/bran-document/src/conformance.rs
#	crates/bran-document/src/lib.rs
#	crates/bran-document/src/zip.rs
#	crates/bran-document/tests/conformance.rs
#	docs/enterprise-document-conformance.md
#	tools/ci/test-budget.json
@1wgrumph
1wgrumph merged commit 7ea4052 into main Sep 30, 2026
5 checks passed
@1wgrumph
1wgrumph deleted the feat/22-pptx-adapter branch September 30, 2026 13:05
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.

PPTX adapter: preserve slide structure, notes, media, and reading order

1 participant