Skip to content

WS-ART-001-03B3B3C: bounded PPTX guide extraction - #235

Merged
abiorh-claw merged 3 commits into
mainfrom
codex/ws-art-001-03b3b3c-pptx-extractor
Jul 31, 2026
Merged

WS-ART-001-03B3B3C: bounded PPTX guide extraction#235
abiorh-claw merged 3 commits into
mainfrom
codex/ws-art-001-03b3b3c-pptx-extractor

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

WS-ART-001-03B3B3C PR Trust Bundle

Chunk

WS-ART-001-03B3B3C — PPTX Extractor (L1).

Goal and human-approved intent

Add deterministic, bounded PPTX slide and notes extraction after exact PPTX
classification and the merged OOXML security boundary. Preserve original
verified guide bytes as authoritative. This hidden chunk must not activate
AUTH, invoke guide sufficiency, add XLSX/image behavior, or touch contributor
submission ZIPs.

What changed and why

  • Added an isolated PPTX adapter with exact presentation-order slide and notes
    extraction, deterministic compact JSON, and fixed omission evidence.
  • Advanced PPTX evidence to guide-extraction-v4 and bound its complete result
    schema to immutable persistence and replay checks.
  • Reused the worker-owned shared OOXML validator and kept the PPTX adapter
    import confined to the isolated child.
  • Added the canonical semantic lane, architecture and worker-order proofs,
    DB-backed replay cases, and the exact storage-service contract.

Design chosen and alternatives rejected

The adapter accepts only bytes that pass the shared OOXML boundary. It resolves
the exact presentation relationship graph, traverses only approved shape-tree
text bodies and tables, and returns canonical content plus a fixed omission
map. Rejected alternatives were request-path parsing, direct provider access,
generic ZIP handling, raw binary agent input, broad XML scanning, partial
output, or a second authorization/OOXML protocol.

Scope control and product behavior

Only hidden guide-source extraction changes. There is no route, authorization
activation, Celery continuation, sufficiency invocation, provider read, guide
binding, submission, checker, review, contribution, payment, or reputation
change. Artifact/parser failures remain bounded internal outcomes rather than
guide-insufficiency decisions.

Acceptance criteria proof

  • Presentation order, grouped shapes, tables, notes ownership, exact paragraph
    semantics, Strict/Transitional relationships, and empty structures have
    deterministic canonical-output tests.
  • Masters, comments, hidden metadata, passive non-text objects, and embedded
    objects use an exact boolean omission schema bound to v4 evidence.
  • Malformed relationship roots, duplicates, dangling/cross-root targets,
    orphans, shared ownership, namespace mixing, and invalid parts fail closed.
  • Exactly 300 slides pass; 301 slides, depth beyond 64, and output beyond 4 MiB
    fail without partial agent input.
  • The isolated runner proves v4 protocol transport and scratch cleanup;
    architecture tests prove worker-only adapter imports.
  • Persistence tests bind canonical output and complete omission facts and reject
    obsolete PPTX policy evidence as a replay target.

Tests and checks

  • Ruff and approved extractor-dependency gate — pass.
  • Focused OOXML/PPTX/extraction/architecture/lane suite — pass.
  • PPTX module branch coverage — 94.43 percent (21 tests).
  • Stale artifact contracts, Markdown links, lane integrity, and
    git diff --check — pass.
  • Hosted Backend/Agent Gates retain DB-backed replay, repository-wide coverage,
    and semantic-lane proof; no local full-suite run was used.

Test delta and CI integrity

No test, assertion, lane, workflow, dependency rule, or coverage threshold was
removed, skipped, or weakened. The new PPTX module joins the existing
shared_foundations lane. No dependency or workflow file changed.

Reviewer results

Architecture, security, senior engineering, CI integrity, test delta, and docs
pass. QA, product/ops, and reuse/dedup pass with only documented low risks. All
blocking traversal, non-text leakage, relationship, visibility, depth, and
contract/test findings were repaired and re-reviewed.

External review

CodeRabbit and hosted GitHub checks have not yet run on the committed PR head.
They remain required before human merge approval.

Remaining risks and follow-up

DB-backed replay and repository-wide coverage evidence is hosted-only. If the
next XLSX adapter repeats the small OOXML loader or serializer patterns, assess
a bounded shared helper then rather than widening this chunk. XLSX, image,
durable sufficiency continuation, AUTH activation, and legacy cutover remain
separate later chunks.

Human review focus and merge ownership

Review exact relationship ownership/order, structure-aware text eligibility,
omission semantics, v4 replay identity, depth/output limits, and absence of AUTH
or sufficiency activation. A human owns merge approval; the agent will not
merge this PR.

Summary by CodeRabbit

  • New Features

    • Added PowerPoint (PPTX) artifact extraction.
    • Extracted slide and speaker-note content is presented in deterministic order.
    • Added omission metadata to indicate content that could not be extracted.
    • Added validation for malformed files, unsupported relationships, excessive nesting, slide counts, and output size.
  • Documentation

    • Updated artifact-storage specifications with PPTX behavior, output rules, metadata, and extraction limits.
  • Tests

    • Added comprehensive coverage for PPTX extraction, validation, limits, hidden slides, and failure scenarios.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Abiorh001, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ade488ef-9ee1-4d79-93e8-f3884be7ba94

📥 Commits

Reviewing files that changed from the base of the PR and between c3d8fd3 and e89037d.

📒 Files selected for processing (4)
  • .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-03B3B3C-external-review-response.md
  • .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-03B3B3C-pr-trust-bundle.md
  • backend/app/modules/artifacts/guide_pptx.py
  • backend/tests/test_guide_pptx.py
📝 Walkthrough

Walkthrough

Adds bounded PPTX slide and notes extraction with deterministic JSON output, omission facts, shared OOXML validation, isolated-worker dispatch, policy versioning, architecture constraints, focused tests, and updated artifact-storage specifications.

Changes

PPTX extraction

Layer / File(s) Summary
PPTX policy and extraction contract
.agent-loop/.../chunks/*, backend/app/modules/artifacts/guide_extraction.py, docs/spec_artifact_storage_service.md
Defines guide-extraction-v4, PPTX omission facts, relationship rules, canonical output, and extraction limits.
Bounded PPTX adapter
backend/app/modules/artifacts/guide_pptx.py
Validates OOXML structure and relationships, extracts ordered slide and notes text, records omissions, and enforces output and traversal limits.
Isolated worker integration
backend/app/modules/artifacts/guide_extraction_worker.py
Adds PPTX dispatch, adapter loading, shared validation, failure mapping, and worker execution ordering.
PPTX verification and review evidence
backend/tests/test_guide_pptx.py, backend/tests/test_guide_extraction.py, backend/tests/test_guide_bindings.py, backend/tests/test_artifact_architecture.py, backend/scripts/run_test_lanes.py, .agent-loop/.../reviews/*
Adds fixtures and coverage for extraction, malformed relationships, limits, isolation, policy identity, architecture, and review validation.
Estimated code review effort: 4 (Complex) ~60 minutes

Possibly related PRs

Suggested reviewers: abiorh-claw

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the workstream and the primary change: bounded PPTX guide extraction.
Description check ✅ Passed The description explains the goal, design, scope, tests, risks, review status, and merge ownership, with only minor template structure differences.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ws-art-001-03b3b3c-pptx-extractor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@abiorh-claw
abiorh-claw self-requested a review July 31, 2026 19:55
abiorh-claw
abiorh-claw previously approved these changes Jul 31, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
backend/tests/test_guide_pptx.py (1)

205-267: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse _replace_member instead of hand-rebuilding the ZIP archive.

In test_relationship_conflicts_and_orphans_fail_closed, the mixed, wrong_type, and relationship_root scenarios each manually read every member, mutate one entry, and rewrite a new ZIP archive. The file already defines _replace_member for this exact purpose (see lines 104-112), and the sibling test test_complete_relationship_identity_and_ownership_matrix_fails_closed (lines 282-333) consistently uses it. Reuse _replace_member here to remove the duplicated boilerplate.

♻️ Proposed refactor for the `mixed` scenario (apply the same pattern to `wrong_type` and `relationship_root`)
-    mixed = _package(
-        [_slide()],
-        notes={1: _notes()},
-        family=_TRANSITIONAL,
-    )
-    with zipfile.ZipFile(BytesIO(mixed)) as source:
-        members = {info.filename: source.read(info) for info in source.infolist()}
-    members["ppt/slides/_rels/slide1.xml.rels"] = _relationships(
-        [("rIdNotes", f"{_STRICT}/notesSlide", "../notesSlides/notesSlide1.xml")]
-    )
-    output = BytesIO()
-    with zipfile.ZipFile(output, "w", zipfile.ZIP_DEFLATED) as archive:
-        for name, body in members.items():
-            archive.writestr(name, body)
+    mixed = _replace_member(
+        _package([_slide()], notes={1: _notes()}, family=_TRANSITIONAL),
+        "ppt/slides/_rels/slide1.xml.rels",
+        _relationships([("rIdNotes", f"{_STRICT}/notesSlide", "../notesSlides/notesSlide1.xml")]),
+    )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/tests/test_guide_pptx.py` around lines 205 - 267, Refactor
test_relationship_conflicts_and_orphans_fail_closed to use the existing
_replace_member helper for the mixed, wrong_type, and relationship_root archive
mutations. Remove the repeated ZipFile member-reading and archive-rebuilding
boilerplate while preserving each scenario’s modified relationship content and
expected PptxExtractionFailure assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@backend/app/modules/artifacts/guide_pptx.py`:
- Around line 317-323: Move the hidden-slide visibility check from the
_ordered_parts loop to _canonical_slides, where the parsed slide root element is
available, and read its show attribute there. Remove the ineffective
slide_id.get("show") guard while preserving hidden_metadata["hidden_metadata"]
updates for values 0, false, off, or no.
- Around line 180-199: Update _paragraph_text to accept the current traversal
depth as an argument and start its nested walk from that value instead of
resetting to 0. Modify the _paragraphs.walk call site to pass its current depth,
preserving the existing MAXIMUM_NESTING_DEPTH check across the entire traversal.

---

Nitpick comments:
In `@backend/tests/test_guide_pptx.py`:
- Around line 205-267: Refactor
test_relationship_conflicts_and_orphans_fail_closed to use the existing
_replace_member helper for the mixed, wrong_type, and relationship_root archive
mutations. Remove the repeated ZipFile member-reading and archive-rebuilding
boilerplate while preserving each scenario’s modified relationship content and
expected PptxExtractionFailure assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1dc7c54d-e930-41ae-afc4-74e8169ffc41

📥 Commits

Reviewing files that changed from the base of the PR and between 99dc0b3 and c3d8fd3.

📒 Files selected for processing (13)
  • .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/STATUS.md
  • .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-03B3B3C-pptx-extractor.md
  • .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-03B3B3C-internal-review-evidence.md
  • .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-03B3B3C-pr-trust-bundle.md
  • backend/app/modules/artifacts/guide_extraction.py
  • backend/app/modules/artifacts/guide_extraction_worker.py
  • backend/app/modules/artifacts/guide_pptx.py
  • backend/scripts/run_test_lanes.py
  • backend/tests/test_artifact_architecture.py
  • backend/tests/test_guide_bindings.py
  • backend/tests/test_guide_extraction.py
  • backend/tests/test_guide_pptx.py
  • docs/spec_artifact_storage_service.md

Comment thread backend/app/modules/artifacts/guide_pptx.py Outdated
Comment thread backend/app/modules/artifacts/guide_pptx.py Outdated
@Abiorh001

Copy link
Copy Markdown
Collaborator Author

CodeRabbit review repair pushed in e89037df:

  • preserved one continuous 64-level traversal depth through paragraph text;
  • moved hidden-slide detection to the parsed p:sld root;
  • replaced repeated ZIP reconstruction with _replace_member;
  • corrected the wrong-type fixture to retain the referenced rId1, proving the relationship-type rejection path.

Validation: 21 PPTX tests passed at 94.94% branch coverage; the broader affected suite passed 165 tests; Ruff, dependency approval, stale-contract, Markdown-link, and diff checks passed. Focused security, QA, and test-delta re-reviews found no remaining blocker. The hosted gates and CodeRabbit re-review are now running on this head.

@abiorh-claw
abiorh-claw self-requested a review July 31, 2026 21:30
@abiorh-claw
abiorh-claw merged commit 24362e5 into main Jul 31, 2026
8 of 9 checks passed
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