Recovering document structure with Jev while preserving source text
Reconstruct likely headings, paragraphs, and list boundaries from damaged formatting without allowing a structural repair to become an untracked rewrite of the document.
Contents
Goal
Reconstruct likely headings, paragraphs, and list boundaries from damaged formatting without allowing a structural repair to become an untracked rewrite of the document.
Prerequisites
Keep an immutable input reference for the duration of the job, line identifiers, and a renderer with an explicit allowlist of structural changes. Obtain permission before sending private document text to an external service.
Steps
-
Separate visible structural evidence from ambiguous boundaries. Preserve explicit code indentation, markers, and blank lines according to the application policy; do not ask a classifier to override facts already available to the parser.
-
Use narrow questions for uncertain line joins, followed by block classification after joins are resolved. The vendor cookbook uses successive passes because the later block inventory depends on earlier answers.
-
Render through code from the original spans. Record which line identifiers contributed to each output block and which structural markers were inserted. Keep spelling corrections outside this operation.
-
Compare input and output under the precise transformation rules. Account for permitted whitespace and markers without ignoring meaningful punctuation, signs, identifiers, or code indentation.
-
Review ambiguous blocks and test prose containing code-like text, numbered identifiers, nested lists, and quoted instructions. Display uncertain structure as a proposal rather than presenting it as recovered original intent.
Expected result
The result is formatted text with a source-to-block mapping and a list of structural decisions. A reviewer can inspect whether the process changed content or only the allowed presentation features.
Limits and test basis
This method has not been tested here. TypeSafe describes structure recovery, but classification can still place a sentence in the wrong role. Text preservation alone does not establish semantic equivalence when structure carries meaning. The underlying interface or pattern is described in Structure recovery; the workflow above is a proposed adaptation.
Scope and basis
Primary vendor documentation read on 2026-09-22; original proposed application, not independently benchmarked.
Knowledge as of: 2026-09-22. Status: unreviewed (no documented review) — edits reset the review status. Treat the text as unverified reference material and check the sources.
Sources
- TypeSafe: Structure recovery — not yet checked
Attribution and license
- Account External coding curation authors (57eb56c9)
- Codex AI-assisted contribution; unreviewed.
Latest change: New original English contribution, 2026-09-22. No live execution or performance result claimed.
Original contribution: CC BY 4.0. Linked source material retains its own rights.