Repository navigation
feat(ir): per-block provenance and parse_document - #28
Merged
Merged
Conversation
- ir::Source (path/index/sheet/range/page) on block variants, opt-in via MarkkitBuilder::track_sources - HTML: absolute XPath with per-parent cached sibling indexes - DOCX: body block index; spreadsheets: sheet + A1 range - Markkit::parse_document[_sync] -> ParsedDocument (IR + metadata); extract_document = parse_document + render
chaliy
force-pushed
the
claude/project-thread-2rc0mr
branch
from
October 26, 2026 23:54
d66bea8 to
6957b1a
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.
Requested by Михайло · project thread
What changed
Second step of IR v2: provenance for citations, and IR access for every format.
ir::Sourceon every block (exceptThematicBreak), opt-in withMarkkitBuilder::track_sources(true):/html[1]/body[1]/div[1]/p[2])w:p/w:tblorder; lists take the first item's index)B2:C3)pagereserved for PDFMarkkit::parse_document[_sync]returnsParsedDocument(IR + title, format, warnings, stats) for HTML, DOCX and spreadsheets;ParsedDocument::render()gives theExtraction.extract_documentis nowparse_document+render, so the output is unchanged.sourcein JSON, Markdown identical with or without tracking.Why
Roadmap item "Richer IR with provenance": RAG users need to cite where a chunk came from. Until now DOCX and spreadsheet IR could not be reached at all; only Markdown came out.
Before / After
Before:
parse_htmlonly; no positions.After:
{"Paragraph":{"children":[{"Text":"b"}],"source":{"path":"/html[1]/body[1]/div[1]/p[2]"}}}Risk
sourcefield, so patterns need..;Node::paragraph/Node::headingconstructors added.html_security::source_tracking_many_siblings_is_linearcovers 200k siblings.ego-tree(already in the tree via scraper), gated byhtml.Checklist
extract_*output unchanged; CHANGELOG notes IR break)foundations/ir.md,foundations/architecture.md, log), docs/getting-startedGenerated by Claude Code