Skip to content

office: XML parts first, skip instead of break, guard mkdir (#28) - #30

Merged
dexRand merged 2 commits into
mainfrom
fix/28-office-xml-first
Nov 17, 2026
Merged

dexRand merged 2 commits into
mainfrom
fix/28-office-xml-first

Conversation

@dexRand

@dexRand dexRand commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Closes #28

What: OfficeAnalyzer reads XML-like parts (.xml/.rels/.vml) before media, so media can no longer eat the 20 MB budget or the 200-part cap; an entry that does not fit is skipped (continue) instead of ending the loop; mkdir is inside the per-entry try, so one bad entry no longer turns the result into error.

How it was worked (mechanus): builder (Sonnet) in its own worktree; arbiter (Opus) round 1 rejected deepseek's 7f02128 (footer lost after 3x7.9 MB media); round 2 approved the code and rejected two tests that did not kill their mutants; fixed in 93c03be — each mutant (sort removed, continue->break, mkdir outside try) is now killed by exactly one test.

L1: unit 517 passed, lint clean. L2: this PR's CI.

Residual risk: with more than 200 XML-like parts, media is never read (by design).

🤖 Generated with Claude Code

dexRand added a commit that referenced this pull request Nov 16, 2026
…S); AGENTS: never git stash in worktrees

L2 on PRs #30/#31 and on main: fixtures 33/33, real core 32-33/35, the misses
were client-side 900 s timeouts (dolls.jpg, corrupted_file, try_me.pcap): the
runner analyses ~6x slower than local (11003 s vs 1826 s for the 35 core cases).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dexRand and others added 2 commits November 16, 2026 17:26
The 20 MB budget and 200-part cap were spent in zip order on binary media,
then the loop broke, losing later footer/comment XML. Now XML-like parts
(.xml/.rels/.vml) go first, an entry that does not fit is skipped, and
mkdir+write sit in one per-entry try/except OSError (a file entry `word`
before `word/footer1.xml` no longer turns the result into error).
Tests: media-before-footer, file-blocks-dir, lying-header.

Old code on the new tests: 2 failed, 14 passed.
L1: 516 passed in 36.55s. L0: [ok] lint clean.

Refs #28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Split the media test in two (sort vs continue) and give the mkdir test
XML-like names so the sort cannot mask it. Mutants on copies:
  sort removed        -> 1 failed (media_before_xml_does_not_hit_the_part_cap)
  continue -> break   -> 1 failed (entry_over_budget_is_skipped_not_fatal)
  mkdir outside try   -> 1 failed (file_entry_blocking_a_directory...)
  unmutated           -> 17 passed
L0: [ok] lint clean. L1: 517 passed in 29.30s.

Refs #28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dexRand
dexRand force-pushed the fix/28-office-xml-first branch from 93c03be to 611a51b Compare November 16, 2026 16:27
@dexRand
dexRand merged commit 13593fa into main Nov 17, 2026
6 checks passed
@dexRand
dexRand deleted the fix/28-office-xml-first branch November 17, 2026 08:25
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.

office: 20 MB budget spent on media drops later XML parts

1 participant