-
Notifications
You must be signed in to change notification settings - Fork 2
[codex] admit sourceMatch-only citations and downgrade ambiguous matches #460
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
Show all changes
11 commits
Select commit
Hold shift + click to select a range
39ae121
fix(react): an approximate (claimText != sourceMatch) citation is nev…
bensonwong b4e3483
fix(deepcitation): downgrade badge for low-confidence/ambiguous citat…
bensonwong 6b1aa0e
fix(citations): downgrade ambiguous source matches
bensonwong b30f0b8
fix(citation): admit orphan-marker entries with sourceMatch-only (iss…
bensonwong 5e00b9e
test(citation): update stale skip-assertions to reflect issue-235 adm…
bensonwong 1643e80
fix(parsing): detect repeated multi-char tokens in isGeminiGarbage
bensonwong 7a9b287
fix(verification): found_context_missed_source_match downgrades to pa…
bensonwong a7ef798
Merge origin/main into feat/admit-sourceMatch-only-citations
bensonwong 8f07b5d
chore: Auto-update Playwright visual snapshots [skip ci]
github-actions[bot] fe0cb1d
fix(citation): align partial-match review findings
bensonwong aa0ab26
fix(citation): show search log for context-miss partials
bensonwong 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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import { describe, expect, it } from "bun:test"; | ||
| import { cleanRepeatingLastSentence, isGeminiGarbage } from "../parseWorkAround"; | ||
|
|
||
| describe("isGeminiGarbage", () => { | ||
| describe("single-character repetition", () => { | ||
| it("detects all-same-character strings", () => { | ||
| expect(isGeminiGarbage("a".repeat(100))).toBe(true); | ||
| }); | ||
|
|
||
| it("returns false for short all-same-character strings", () => { | ||
| expect(isGeminiGarbage("a".repeat(10))).toBe(false); | ||
| }); | ||
|
|
||
| it("returns false for normal text", () => { | ||
| expect(isGeminiGarbage("The quick brown fox jumps over the lazy dog.")).toBe(false); | ||
| }); | ||
| }); | ||
|
|
||
| describe("multi-character repeating unit", () => { | ||
| it("detects repeated </font> lines", () => { | ||
| const garbage = "</font>\n".repeat(20); | ||
| expect(isGeminiGarbage(garbage)).toBe(true); | ||
| }); | ||
|
|
||
| it("detects repeated HTML tags without trailing newline", () => { | ||
| const lines = Array(20).fill("</font>").join("\n"); | ||
| expect(isGeminiGarbage(lines)).toBe(true); | ||
| }); | ||
|
|
||
| it("detects other repeated multi-char tokens", () => { | ||
| const garbage = Array(15).fill("<br/>").join("\n"); | ||
| expect(isGeminiGarbage(garbage)).toBe(true); | ||
| }); | ||
|
|
||
| it("detects repeated markup separated by blank lines", () => { | ||
| const garbage = Array(15).fill("</font>\n").join("\n"); | ||
| expect(isGeminiGarbage(garbage)).toBe(true); | ||
| }); | ||
|
|
||
| it("returns false when lines differ", () => { | ||
| const normal = ["First sentence.", "Second sentence.", "Third sentence."].join("\n"); | ||
| expect(isGeminiGarbage(normal)).toBe(false); | ||
| }); | ||
|
|
||
| it("does not classify legitimate repeated text rows as garbage", () => { | ||
| const repeatedRows = Array(30).fill("N/A").join("\n"); | ||
| expect(isGeminiGarbage(repeatedRows)).toBe(false); | ||
| }); | ||
|
|
||
| it("returns false when fewer than MIN_REPETITIONS lines", () => { | ||
| expect(isGeminiGarbage("</font>")).toBe(false); | ||
| }); | ||
| }); | ||
|
|
||
| describe("edge cases", () => { | ||
| it("returns false for empty string", () => { | ||
| expect(isGeminiGarbage("")).toBe(false); | ||
| }); | ||
|
|
||
| it("returns false for whitespace-only string", () => { | ||
| expect(isGeminiGarbage(" ")).toBe(false); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
| describe("cleanRepeatingLastSentence", () => { | ||
| it("removes trailing repeated sentence", () => { | ||
| const repeated = "The cat sat on the mat. The dog ran fast. The dog ran fast."; | ||
| expect(cleanRepeatingLastSentence(repeated)).toBe("The cat sat on the mat. The dog ran fast."); | ||
| }); | ||
|
|
||
| it("removes many repetitions keeping one copy", () => { | ||
| const base = "Something happened here."; | ||
| const repeated = base + " The fog rolled in. The fog rolled in. The fog rolled in."; | ||
| expect(cleanRepeatingLastSentence(repeated)).toBe(base + " The fog rolled in."); | ||
| }); | ||
|
|
||
| it("returns text unchanged when no repetition", () => { | ||
| const text = "First sentence. Second sentence. Third sentence."; | ||
| expect(cleanRepeatingLastSentence(text)).toBe(text); | ||
| }); | ||
|
|
||
| it("returns text unchanged when too short to repeat", () => { | ||
| const text = "Hello world."; | ||
| expect(cleanRepeatingLastSentence(text)).toBe(text); | ||
| }); | ||
| }); |
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
Oops, something went wrong.
Oops, something went wrong.
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.
After downgrading
found_context_missed_source_matchto partial (status.partialMatch/amber) inSTATUS_MAP, the fallback path ingetOutcomeSummarystill maps this status tooutcome.exactMatch(src/analysis/narrative.ts, switch at lines 204-207). In cases wheresearchAttemptsis empty or lacksmatchedVariation, users will see conflicting signals (partial status header/color but exact-match summary text), which regresses the intended downgrade behavior and can mislead verification interpretation.Useful? React with 👍 / 👎.