Repository navigation
feat(document): MINT document representation for parsed files - #2
Merged
Merged
Conversation
2 of 5 tasks
avnsh
approved these changes
Jun 24, 2026
Adds encodeDocument/decodeDocument and the MintDocument/MintSection/ MintDocBlock types so MINT can losslessly represent a parsed document (title, metadata, §-level sections, prose, tables, lists, figures with page refs) — the structure produced by parsers like Docling. Headings use § rather than # (reserved for comments), and the document grammar lives in dedicated functions so general-purpose encode/decode is unaffected. Bumps to 1.1.0; SPEC §15 documents the grammar.
avnsh
force-pushed
the
feat/docling-mint-document
branch
from
June 25, 2026 03:28
96a5241 to
973cb11
Compare
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.
Summary
§-level sections, prose, tables, lists, and figures with page references.encodeDocument/decodeDocument+ typesMintDocument,MintSection,MintDocBlock,MintDocTable,MintDocList,MintDocFigure(re-exported from the package entry).§(not#, which is reserved for comments). The document grammar lives in dedicated functions, so general-purposeencode/decodeare unaffected.Why
Downstream (
context-engine) needs to ingest customer files via Docling and inject their content into LLM prompts token-efficiently. MINT's object/table syntax can't express document hierarchy compactly, so this adds the missing representation.Test plan
pnpm --filter @q1k-oss/mint-format test— 54 passing (8 new document round-trip/edge tests)pnpm --filter @q1k-oss/mint-format typecheckpnpm --filter @q1k-oss/mint-format build(dist regenerated)validate(encodeDocument(doc)).valid === trueanddecodeDocument(encodeDocument(doc))deep-equals the inputlintscript is pre-existing-broken (eslint --ext+ missingtypescript-eslint); not touched here.