feat(foreman): semantic issueAsk verification instead of verbatim substring#1020
Merged
Merged
Conversation
The reviewer's issueAsk rail previously required the model's stated ask
to be a literal substring of the fetched issue body. This conflated
"paraphrased but correct" with "wrong issue entirely": both produced
`issueAskVerified: false` and demoted GO to NO-GO, including cases
where the reviewer understood the scope faithfully.
Replace the verbatim check with a two-tier gate:
1. Verbatim substring match -> verified immediately (unchanged).
2. Keyword-overlap check between claim and issue body -> verified
if the claim references a sufficient fraction of the issue's
salient nouns/verbs (threshold: 40%, minimum 2 keywords).
3. Neither passes -> archive claim, rewrite from body, mark
unverified (unchanged).
The keyword extractor strips markdown, lowercases, removes common
English stop words, and filters tokens <= 2 chars. It takes the title
plus the first two paragraphs of the body. This is more explainable
than raw embedding similarity and requires no external model.
Surface the method used (`issueAskMethod: semantic` or `rewritten`)
next to `issueAskVerified` so demotions are auditable. Update the
demotion reason strings and docs to reflect the new semantics.
Fixes defilantech#809
Signed-off-by: Christopher Maher <chris@mahercode.io>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Merged
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.
What
Make the reviewer's
issueAskverification semantic instead of verbatim. A faithful paraphrase of the fetched issue is now accepted; only a genuine confabulation is demoted.Why
The
issueAskrail required the reviewer's stated ask to be a literal substring of the fetched issue body. That conflated "paraphrased but correct" with "wrong issue entirely" — both setissueAskVerified: falseand demoted GO → NO-GO, penalizing reviewers who understood the scope but restated it in their own words.How
Two-tier check in
reconcileReviewerIssueAsk:issueAskSemanticallyCoversextracts the issue's salient tokens (title + first two paragraphs, markdown-stripped, stop-words removed, tokens > 2 chars) and verifies when the claim covers ≥40% of them (min 2). Explainable, deterministic, no embedding model.Surfaces
issueAskMethod(semantic/rewritten) alongsideissueAskVerifiedso demotions stay auditable, and updates the compatibility doc.Testing
ParaphraseVerified(faithful paraphrase → verified,method=semantic),HallucinationRewritten(unrelated claim → rejected + rewritten +issueAskClaimedpreserved),ExtractIssueKeywords_Basic/_StopsFiltered,IssueAskSemanticallyCovers_ShortClaim.issueAsktests (verbatim, confabulation, no-fetch, empty-claim, nil-extra) still pass — no regression.go build/go vet/gofmtclean.Checklist
Fixes #809Assisted-by: Claude Code — this change was generated end-to-end by Foreman (LLMKube's agentic coder, running Ornith-35B on the AMD Strix) against #809, then reviewed for correctness (logic, test quality, no confabulation) and DCO-signed by the maintainer before submission.