Repository navigation
fix(xerj code): cite real file lines for prose/Markdown hits (#1892) - #1908
Merged
Merged
Conversation
…, text sections) Prose records store no file line, and their lexical passage ordinal counts lines of the re-flowed section, not of the file. So every Markdown hit read `(line unknown)`, or `:1` regardless of where the window was, while the footer asked agents to cite file:line. For a prose section record the renderer now looks the passage's first distinctive line up in the corpus checkout (<root>/corpora/<corpus>/<ax_path>) and cites that line. It never uses the section-relative ordinal, and never opens a path that would leave the checkout. Code records keep the ordinal line. Fixes #1892
Owner
Author
|
Xerj Merger made the fix: |
This was referenced Oct 20, 2026
Closed
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.
Fixes #1892.
Bug:
xerj codecited every Markdown/prose hit asfile:1orfile (line unknown). A prose record is one section, and the passage ordinal counts lines of the re-flowed section text, not lines of the file.Fix (
xccode/render.rs,xccode/mod.rs)RenderOptsgainscheckout: Option<&Path>.xerj codepasses<root>/corpora/<corpus>.citation_inchecks in this order:sectionfield or ans<N>locator), it finds the passage's first distinctive line (at least 12 non-space characters) in the checkout file and cites that real line. A path with non-normal components (.., absolute) is never opened.(line unknown)rather than passing an ordinal off as a line.Tests
prose_section_cites_the_file_line_from_the_checkout, which covers sectioned, single-section and path-escape cases and checks that code is unchanged.xerj-commonlib: 259 passed. clippy-D warningsand fmt are clean.let result: Result<Int, Error> = // ...).