Skip to content

DOCX inference: References Standards subtree — intentional category breakouts + editor-typo lead-in defeat nesting #436

Description

@thewrz

Context

Follow-up to #431 (text-based lead-in nesting). After #431, 1.2 REFERENCES correctly renders its three lead-ins as peers:

A. Abbreviations and Acronyms:   { 1..5 }
B. Definitions:                  { 1, 2 }
C. References Standards:         { ...this subtree... }   ← placement fixed by #431

The subtree under C. References Standards is still parsed incorrectly. Word's own rendering shows the intended structure:

C. References Standards:
   1. Cable:                       ← a numbered category
      a. ICEA S-93-639 / NEMA WC 74-2006 – …
      b. ICEA S-94-649-2021 – …
   2. Cable Sizing:                ← next category
      a. …
   3. Cable Splicing:  /  Cable Test:  /  Cable Terminations:  /  Cable Installation:  …

The parser instead produces the category lead-ins as continuation nodes and the standards as pr4.

Two signals that are hard to correct reliably (why this is deferred)

  1. Editor error: the author accidentally typed a stray 1 in front of Cable:, so the first category reads 1 Cable:. That leading 1 (no dot) defeats the Signal-4 marker match (^\d+\.\s), so 1 Cable: classifies as a continuation instead of a numbered category. Correcting this means guessing that 1 is a typo, not content — not reliably inferrable.
  2. Designer/editor preference: the author intentionally broke the standards into hand-authored categories (Cable, Cable Sizing, Cable Splicing, Cable Test, Cable Terminations, Cable Installation, …). These categories are only distinguishable as ":"-terminated lead-ins with lettered standards beneath them — recovering that grouping reliably (vs. treating them as flat content) is genuinely ambiguous.

Scope

  • Reliably nest the References Standards category subtree (1. Cable: { a., b., … }, 2. Cable Sizing: { … }, …).
  • Must be gated on pnpm fixture:snapshot/fixture:diff (0 structural regressions across the corpus) and carry // KNOWN AMBIGUITY tests per the repo rule.
  • Repro: docs/references/MANUFACTURER_EXAMPLES/more-parsing-examples-fails.docx, article 1.2 REFERENCES, under C. References Standards.

Until then #431 pins this subtree as a KNOWN AMBIGUITY (its own placement as C. is correct; only its internals are deferred).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions