-
Notifications
You must be signed in to change notification settings - Fork 16
feat(review): add confidence annotation to review verdicts #396
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -897,6 +897,7 @@ When merging | |
| - Combine descriptions if they add complementary detail | ||
| - Keep the more specific remediation | ||
| - Preserve `actionable: true` if either finding had it | ||
| - Attach merged_from on every 6b merge (confidence.md). | ||
|
|
||
| #### 6c. Preserve distinct-category findings | ||
|
|
||
|
|
@@ -933,7 +934,7 @@ budget section), skip the challenger: keep the merged finding set from | |
|
|
||
| **Part 3 — Context package:** the merged finding set from steps | ||
| 6a–6c (as a JSON array), plus the full PR diff and changed files | ||
| list. Format as: | ||
| list. Strip/restore merged_from via confidence.md. Format as: | ||
|
|
||
| ```markdown | ||
| ## Context | ||
|
|
@@ -984,9 +985,7 @@ budget section), skip the challenger: keep the merged finding set from | |
| part of the standard finding schema. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [MEDIUM] SKILL.md step 6d item 3 (lines 982-985) strips The PR gives No existing thread on this PR covers this: the Suggestion: Retain |
||
| - If `adjudicated_findings` is empty but the set sent to the | ||
| challenger was non-empty, treat this as a challenger failure (fall back | ||
| per the immediate next step below). A legitimate challenger pass | ||
| that removes all findings is unlikely — an empty result more likely | ||
| indicates a parsing error or context truncation. | ||
| per the immediate next step below). | ||
| - Otherwise, replace the challenged subset with the challenger's | ||
| `adjudicated_findings` (then re-append anything withheld). | ||
| - Log any `removed_findings` for transparency but do not include | ||
|
|
@@ -1205,6 +1204,10 @@ require action, because `comment` (COMMENTED review state) does not | |
| block the PR. When the summary language and the verdict action | ||
| contradict each other, escalate the verdict to match the language. | ||
|
|
||
| #### 6g. Confidence | ||
|
|
||
| Follow confidence.md. | ||
|
|
||
| ### 7. Produce the review result | ||
|
|
||
| Compose the review comment using this structure: | ||
|
|
||
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.
[MEDIUM] Confidence annotation is posted against a verdict the post-script already overrode
Verified at head 261f903. The new block reads
.confidenceand appends**Confidence:** <value>to the body, but by that point post-review.src.sh may already have replaced the agent's verdict, and the confidence value is never revisited.Two confirmed override paths run BEFORE the confidence block:
jq 'del(.findings) | .action = "comment"'rewritesrequest-changes/rejecttocomment. This runs beforeACTIONis read, so ACTION is already the rewritten value.jq '.action = "comment" | .body = (.body + $notice)'rewritesapprovetocommentand appends a "human reviewer must approve" notice, settingDOWNGRADED=true. The script explicitly documents that theACTIONshell variable retains the original value here ("ACTION retains the original value for the entire script — not re-read after protected-path downgrade").In both paths the confidence the agent computed for the original verdict is rendered verbatim under the new one. A protected-path downgrade will routinely post
comment+**Confidence:** high— a combination the new rubric says is essentially unreachable (SKILL.md §6g capscomment-onlyat medium unless a narrow corroboration test passes). Per §6g confidence is a property of the action ("how strongly the evidence and sub-agent agreement support this action"), so after a downgrade the posted value describes an action that no longer exists.This is not cosmetic: the PR's stated purpose is to emit this datum for downstream graduated-approval work, and the value is wrong precisely on the protected-path and all-findings-filtered paths — the paths where a human (and any future automation) most needs an accurate signal. Note that
skills/pr-review/is itself a protected path, so this scenario fires on this repo's own reviews of PRs like this one. Neither of the two added tests in post-review-test.sh covers a downgrade combined withconfidence.Suggestion: Re-read the action after the downgrade paths, or gate the annotation on a downgrade flag, and either drop
confidencefrom the body when the post-script changed the verdict or scope it to the agent's original verdict, e.g.**Confidence:** high (agent verdict: approve — downgraded by protected-path check). Note that a flag-based fix must cover BOTH paths:DOWNGRADEDexists only for the protected-path branch, while the severity-filter branch keepsoriginal_actionlocal to its own block. Add post-review-test.sh cases for approve+confidence+protected path and for request-changes+confidence fully filtered, asserting the resulting annotation.