-
Notifications
You must be signed in to change notification settings - Fork 0
Accept validated numeric evidence citations #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
evidence_aliases.get(token, token)always returns the alias-mapped source ID whentokenis a decimal string that falls within the count of retrieved documents. If a source ID happens to be a pure decimal string (e.g."3") and the model emits[3]intending backward-compat citation of that document, the lookup resolves instead to the third retrieved record — a different document — whenever three or more records were fetched. Additionally, the resolved document changes when the number of retrieved results crosses the threshold, making behaviour query-dependent. The scenario is unlikely given content-derived IDs, but worth a comment or guard (e.g.if token.isdigit(): ... else: ...) to make the precedence rule explicit.Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evidence aliases intentionally take precedence for decimal bracket tokens. Application-generated source IDs are always content-derived with the
review_prefix, so a pure numeric source ID cannot occur in this runtime. Exact-ID backward compatibility therefore applies to the supported prefixed IDs; interpreting[3]as evidence record 3 is the unambiguous public contract. No code change needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood — with the
review_prefix as an invariant on all application-generated source IDs, a numeric collision is structurally impossible at runtime, so the precedence is safe and the public contract is clear.Worth noting for anyone reading the code cold: a one-line comment such as
would make that invariant self-documenting without requiring any logic change. But that's optional — happy to close this if you'd rather leave it as-is.
Shall I remember this as a rule: "source IDs in this project always carry a
review_prefix, so numeric alias precedence inevidence_aliases.getis intentional and needs no guard"?Tip: You can customize Greptile's behavior for this repo with
.greptile/rules.mdand.greptile/config.json.