Repository navigation
A DOCX document's headings sit under its Title paragraph - #295
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…act holds Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…s before and around it Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…each Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
dp-docx-title
branch
from
November 6, 2026 16:38
94a9f82 to
c0db3b7
Compare
This was referenced Nov 6, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #289
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
In a DOCX with a
Titleparagraph, the reference extractor puts the document's headings under the title, so section paths and heading levels follow the document's outline.Why
A
Titleparagraph and aHeading 1both read as depth 1, so eachHeading 1closed the title's section: the title stood alone and the sections were siblings of it rather than inside it. On the document-parsing bench (#289) heading level accuracy on DOCX was 0.10 on both splits.Scope and risk
extractor/loom_extractor/docxfile.py(PARSER_VERSION3), its test and the DOCX paragraph ofdocs/architecture/document-extraction.md. Once aTitleparagraph is read as a heading, it is depth 1 (whatever outline level it carries) and every other heading after it one level under its own (Heading 1at depth 2, an outline level 0 at depth 2), and a later title is depth 1 again; a document with no title heading (none, an empty one, one set to body text) is read as before, and a heading before the title keeps its level. Headings past depth 9 stay well under the contract's 64 section entries.Compatibility, rollout and rollback
Tests
test_a_docx_title_paragraph_holds_the_headings_under_it: Title, Heading 1, Heading 2 read at depths 1, 2, 3 with the section path through all three; an outline level 0 after a title reads at depth 2; a title with an outline level of its own is depth 1; a heading before the title keeps depth 1; with no title, an empty title paragraph or one set to body text, the levels stay 1, 2; two titles read 1, 2, 1, 2, the second section under the second title. The DOCX tests pass.Document-parsing bench, DOCX files (
python -m bench.docparse runon each build,score ... --split dev|heldout): heading level accuracy 0.111 → 1.000 on dev and 0.101 → 1.000 on held-out; text, headings and table cells unchanged at 1.000.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. I checked the depths against the bench's DOCX gold and the existing DOCX tests.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code