Repository navigation
Conversation
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS A reproduced ordering defect fixed at its cause — the container's ordering metadata replaces filename sorting — with every behavior delta declared. What this change shipsIntent: make PPTX text extraction show slides in the order the presentation actually plays, with correct labels — a FIX.
The fix sits at cause level: filename N was never display order per the PresentationML spec, and the change reads WatchItem 5 is the one regression a human should weigh: a deck whose [FIRST-PRINCIPLES-REVIEWED] 552be51 |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Reviewing PR #9235: a fix so PPTX text extraction follows The problem is real (filename order silently diverges from presentation order after a reorder, mislabeling slides and letting a capped preview drop the actual opening slides), and the fix targets the root cause by reading the container's own ordering manifest rather than patching the sort. Failure behavior is deliberate and tested: missing manifest keeps the old best-effort scan, present-but-broken manifest fails closed rather than inventing an order, repeated references are deduped, and the metadata reads reuse the existing bounded ZIP reader and defusedxml. The spec doc is updated in the same commit. No scope creep; description matches the diff in both directions. Design-Verdict: PASS Root-cause fix using the format's own ordering manifest, with deliberate, tested failure modes and unchanged parser contract. [DESIGN-REVIEWED] 552be51 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
d3d3e82 to
552be51
Compare
|
Kiro Crew [operator: chenmingwei23#de330d0c] Triaged as solvable and claimed for the drive-to-green pipeline. The red backend lanes are not caused by this branch. The failing run is from Remaining real blocker is the merge conflict. Plan: rebase onto current main so CI Content security scan passed with no findings. |
|
Thank you @leonlaiyc for this fix — correctly previewing reordered .pptx decks in true presentation order (OOXML To carry it cleanly through the in-repo CI + review lanes, I opened an in-repo replacement PR that supersedes this one, preserving your authorship (your commit is cherry-picked with a
Every review lane is green there (GPT 5.6, Opus 5, Design, First Principles, UX, Security Scope) and all backend/build/integration checks pass. Closing this fork PR in favor of #14876; full credit for the fix is yours. 🙏 |
Problem / Motivation
Reordering a PowerPoint deck does not rename its slide parts.
doc_parsersortsppt/slides/slideN.xmland uses N as the displayed slide number, so the Officetext preview silently restores filename order instead of showing the presentation.
Reproduced on
mainat91513fa01with a valid three-slide deck, saved andindependently reopened using python-pptx:
With
max_chars=1, extraction keeps onlyDetailed appendix. The fixed codereturns
Executive summaryas Slide 1 in both full and capped extraction.Why it matters
The dashboard's
/api/file-office-previewuses this parser through an already-openarchive and a text budget. A reordered deck therefore has incorrect slide labels,
and a long preview can omit its actual opening slides. The shared attachment
extractor also uses this parser when supplying document text to the agent.
What changed (motivation → approach → change)
Read
p:sldIdLstfromppt/presentation.xml, resolve its internal sliderelationships, and number results by presentation position. This follows the
PresentationML structure.
The new metadata reads use the existing bounded ZIP reader and defusedxml parser.
Blank or unresolved entries keep their positions; unreferenced parts are omitted.
Each resolved ZIP part is extracted only once, so repeated references in malformed
metadata cannot multiply decompression or retained text beyond the vetted inventory.
The extraction budget still prevents later slides from being read. Incomplete
containers without a presentation manifest retain the existing best-effort
filename scan, while present-but-unreadable metadata does not fall back to an
invented order. No new dependency or endpoint change.
Tests
control passed against
main.callers, capped reads, blank and unreferenced slides, internal relationship
targets, unreadable relationships, bounded metadata, and malformed/DTD XML.
cover distinct relationship IDs targeting the same slide part.
The focused command was:
A broader local run was not clean: the full backend suite hit timeouts and was
stopped, and whole-tree lint/type runs reported findings in unchanged files with
newer local tool versions. This PR does not claim whole-repository validation.
Manual verification
Generated a valid deck with python-pptx, moved its first slide to the end, saved
and reopened it with that independent reader, then ran the public
extract_textAPI against the same file before and after the fix. Both full and capped output
now agree with the reopened presentation. python-pptx was used only for this probe;
the committed regression fixtures use the standard library.
Related Issues
Found by inspection. Checked all 371 open PRs at admission, refreshed the full
inventory after rebasing, and checked targeted issue/PR searches and local claims.
No open PR touches
doc_parser.pyor coverspresentation-order extraction. #4650 concerns a separate File Explorer viewer.
Pattern harvest
Rule candidate: review-prompt
Pattern: an archive member's filename or identifier is not its display order;
follow the container's ordering metadata and test a reordered valid document.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)