Repository navigation
Conversation
hidb4ai
left a comment
There was a problem hiding this comment.
The standalone parser passes the focused tests and a real generated PPTX with a hidden slide and merged table. The dependency setup issue already noted in the description is reproducible and still needs resolution before merging.
| Span, | ||
| serialize_context_locator, | ||
| ) | ||
| from pc_knowledge_base.pptx import PPTX_ADAPTER |
There was a problem hiding this comment.
[P2] Make the new test module collectable in the CI dependency environment. In a fresh environment, uv run --locked --extra knowledge-base --group knowledge-base-tests pytest tests/knowledge_base/test_pptx.py --collect-only -q fails here with ModuleNotFoundError: No module named defusedxml. The knowledge-base job installs exactly these extras/groups; defusedxml is only in knowledge-base-formats. This new unconditional import therefore prevents the suite from collecting. Coordinate installation of the existing formats extra in the jobs that collect this test, and verify the resulting CI setup before merging.
There was a problem hiding this comment.
Since changes to shared CI configuration are outside the scope of #2854, may I include the minimal CI fix in this PR, or should it be handled by the CI maintainers separately?
|
The affected modules are Knowledge base. @Zxf-xufeng, please coordinate follow-up. Knowledge base: @Zxf-xufeng @Alanxtl. Please coordinate the review of the affected changes. |
| folder = posixpath.dirname(part) | ||
| for relation in _relationships(package, relation_part).values(): | ||
| feature = _RELATION_FEATURES.get(relation.get("Type", "")) | ||
| if feature is None: |
There was a problem hiding this comment.
[P2] Report coverage gaps for inherited slide content
For a slide with local text and visible content inherited from its layout/master, this branch skips the slideLayout relationship, omitting inherited text and images while reporting full coverage without warnings. Inspect the applicable layout/master parts within the resource budgets and report an anchored coverage gap for content left unextracted.
There was a problem hiding this comment.
Fixed in 44c79f03. The parser now checks the applicable layout and master within the existing XML limits, caches shared parts, and reports gaps on the affected slide. Regression tests cover inherited text and images, placeholder prompts, hidden shapes, and background overrides. The PPTX suite and wind.pptx scorer passed locally.
| "".join( | ||
| "\n" if item.tag == f"{_A}br" else item.findtext(f"{_A}t", "") | ||
| for item in paragraph | ||
| if item.tag in (f"{_A}r", f"{_A}fld", f"{_A}br") |
There was a problem hiding this comment.
[P2] Warn when skipping inline equations
When a shape or table cell mixes normal text with an inline a14:m equation, this filter discards the equation and neither caller records a gap, so _extract counts the slide as fully covered without warnings. Detect unhandled inline content and emit an anchored unsupported_content warning that reduces slide coverage.
There was a problem hiding this comment.
Fixed in 44c79f03. Ordinary text stays in order, and skipped inline equations now produce an unsupported_content warning at the original shape or table cell. Regression tests cover both paths, including an equation-only cell. The independent check also verified a native PowerPoint file that wraps the text box in mc:AlternateContent.
Which issue or RFC does this PR close?
Refs #2854 and #2848. Registry and Worker integration are tracked in #2856.
Rationale for this change
The knowledge base needs a bounded PPTX parser that can return source locations and exact slide totals. This change implements the standalone adapter so the integration can consume parsed blocks, coverage, and preflight facts through the shared parser contract.
What changes are included in this PR?
PPTX_ADAPTERinpc_knowledge_base.pptx. Resolve slides through OPC relationships in presentation order, including hidden slides. Resolve ASCII case-equivalent part names consistently and reject ambiguous members and repeated slide references.defusedxmldependency.Are there any user-facing changes?
This patch provides the standalone adapter. Registry selection, upload, Worker processing and publication, and retrieval are part of #2856. Worker preflight should consume the exact
PreflightCounts.slidesvalue for the same input and apply the 1,000-slide product limit before extraction. The adapter supports Transitional PPTX text and tables. Notes, charts, SmartArt, images, and embedded objects report coverage gaps. Geometry and embedded payload extraction remain outside the adapter.How was this change tested?
A-01 through A-04 passed within the standalone parser scope. Local validation used CPython 3.12.14 and the locked
knowledge-baseandknowledge-base-formatsextras. The final patch was also replayed on upstream master0b60e52acfcefe2fe64cca52249db83c98d9a3ba.python -m pytest -q tests/knowledge_base/test_pptx.pypassed 46 tests.python -m pytest -q -rs tests/knowledge_basepassed 96 tests. Six native SQL cases were skipped because the backends were unavailable.wind.pptx, parsed it with the adapter, and ranpython -m evaluation.knowledge_base parse <results> --subset. Text, location, and coverage all matched.ty check --no-force-exclude plugins/knowledge-basepassed. The independent verifier reproduced the case-equivalence defect before the fix and reran the final tests and scorer in a separate checkout.Remote CI has not been verified. The existing general unit and knowledge-base jobs both lack the formats extra. Local pytest collection reproduces
ModuleNotFoundError: No module named 'defusedxml'in both dependency selections. The proposed setup change is to enable the existing locked extra in both test environments. Public confirmation of the updated #2849 evaluation manifest is pending.AI usage statement
OpenAI Codex (GPT-6) assisted with implementation, tests, and documentation. A separate Codex verifier independently reviewed and verified the final patch.