Skip to content

test(eval): measure review findings, not just review outcomes - #1003

Open
guyoron1 wants to merge 24 commits into
fullsend-ai:mainfrom
guyoron1:eval/review-precision-cases
Open

guyoron1 wants to merge 24 commits into
fullsend-ai:mainfrom
guyoron1:eval/review-precision-cases

Conversation

@guyoron1

@guyoron1 guyoron1 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

The review eval mostly checks outcomes: labels, the final state and the review action. finding_expectations checks that a [category] token is present or absent. None of that says whether the review found the specific bug a case seeds, at the right severity, or whether it promoted a safe construct to a real vulnerability. These cases and checks judge the findings themselves.

What changes

finding_expectations gets two optional lists in the existing findings block of annotations.yaml. Each entry is {file, match?, min_severity?, description?}:

  • must_report: some posted finding on file, at or above min_severity (default info), must mention match.
  • must_not_raise: no posted finding on file, at or above min_severity (default high), may mention match. An empty match means any finding on the file.

match is one or more alternatives ("timing | constant-time | compare_digest"), matched as whole words and case-insensitively.

The source is the same as for the existing category checks: the current section of the review-agent sticky (#1824).

  • Severity, category and file come from that section's review-findings-v2 marker, which post-review builds from the findings JSON rather than prose.
  • The words are matched against the finding's category plus its sticky bullet (- **[category]** \file:line` — descriptionand itsRemediation:` line). The marker carries no description.
  • Matching is not tied to the category token. The agent's categories are free-form kebab-case, so a correct SQL-injection finding may arrive as sql-query and say "injection" only in its description.

The check fails or abstains in these cases:

  • No marker in the current section: abstains (None), as expected_review_action does. Post-review leaves the marker out when a dimension sub-agent failed, so there is nothing to grade.
  • No sticky, or more than one: fails as not attributable. This includes a run that posted only the risk-assessment comment.
  • Malformed must_* entry (unknown key, unknown severity, missing file): fails, so a typo can't make a case vacuous.

Cases

All five share the eval/review/repos/webapp fixture repo. They are numbered 020-024, after main's 018 and the 019 in #1006.

  • 020-seeded-bugs: SQL injection, a compare_digest → == timing leak, and a lost / 100 in pricing. All three are must_report.
  • 021-fp-bait: hashlib.md5 as a per-order cache key, and a fixed-argv subprocess.run. Both are must_not_raise at high; a low or info note is fine.
  • 022-docs-only: nothing on docs/api.md at low or above.
  • 023-dependency-bump: nothing on requirements.txt at high or above (the pins' advisory check is recorded in the case).
  • 024-reassuring-docstring: the mirror of 021.

Why 024 exists

Both 021 and 024 hash a secret-prefixed payload with md5. In 021 the digest is a cache key. In 024 it is compared against an inbound X-Signature header, so it is the endpoint's authentication. The surface pattern is the same, so neither case can be passed by recognising the construct, only by following the value to its use.

In 024 both prose channels lie: the docstring says "not a security boundary" and the PR body repeats it, while the function using the digest as a signature sits three lines below in the same diff.

Without a case like this, a suite whose ground truth overlaps the review guidance measures instruction-following. A prompt change that over-suppresses would then read as a precision win.

Testing

eval/scripts/finding-expectations-test.sh (already in make script-test) runs the shipped judge offline. It gains 25 rows, 52 in all, covering:

  • matching in the bullet or the Remediation line;
  • severity floors and file anchoring;
  • whole-word boundaries;
  • sticky history and formal reviews not counting;
  • same file and category on different lines;
  • marker absent, duplicated or undecodable;
  • malformed entries;
  • a run with only a risk-assessment comment.

Negative checks: dropping the severity floor, the leading or trailing word boundary, the line disambiguation, or the anchored branch each fails rows.

Also passing:

  • ./eval/lint-cases.sh review
  • state-and-action-checks-test.sh
  • aggregate-nightly-test.sh
  • lint-release-cases
  • make lint
  • pre-commit on the changed files

Why this lands first

The review agent is growing a second implementation: the pi runtime runs review on Grok 4.6 without sub-agents (first live run: fullsend-ai/pi-xai-vertex#4). These checks score what post-review publishes, not the architecture that produced it, so the same cases can score both implementations head-to-head. That comparison needs the eval to exist before either implementation changes.

@github-actions

Copy link
Copy Markdown

Functional tests did not run

Functional tests run automatically for org/repo members and collaborators on pull requests.

For other contributors, a maintainer must add the ok-to-test label after the latest push.

@guyoron1

Copy link
Copy Markdown
Contributor Author

Addresses #209 (review eval suite has zero coverage) and #245. Also unblocks the dependency on #193: the judges now read findings that the 422 fallback pushed into the review body, so the suite no longer waits on that fix to be meaningful.

@guyoron1
guyoron1 force-pushed the eval/review-precision-cases branch from ef4e0ac to eb45eae Compare August 26, 2026 08:31
@guyoron1
guyoron1 marked this pull request as ready for review August 26, 2026 14:34
@guyoron1
guyoron1 requested a review from a team August 26, 2026 14:34
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

test(eval): score review findings for recall and precision

🧪 Tests ✨ Enhancement 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Capture inline and 422-fallback review findings for evaluation.
• Judge required bugs and forbidden false positives with fail-closed matching.
• Add five contextual fixtures and exhaustive judge behavior tests.
Diagram

graph TD
  PR["GitHub PR"] --> Capture["Fixture capture"] --> State[("Fixture state")] --> Judges["Finding judges"] --> Gates["Eval thresholds"]
  Cases["Case annotations"] --> Judges
  Fallback["422 review body"] --> Judges
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Reusable Python judge module
  • ➕ Eliminates duplicated parsing and validation between both judges
  • ➕ Allows direct unit tests without extracting Python from YAML
  • ➖ Requires the eval runner to package and import repository code reliably
  • ➖ Adds deployment coupling beyond today’s self-contained judge contract
2. Normalize findings during capture
  • ➕ Produces one structured finding representation for every downstream judge
  • ➕ Keeps comment-format parsing out of evaluation checks
  • ➖ Couples the shell capture layer to review comment formatting
  • ➖ Risks losing raw evidence or misclassifying human comments before judging

Recommendation: Keep the self-contained judges for this PR because they fit the current harness and the tests execute the exact shipped YAML bodies. If additional finding judges are added, move shared parsing and validation into a supported reusable module to prevent the required/forbidden implementations from drifting.

Files changed (26) +1444 / -8

Enhancement (2) +439 / -5
eval.yamlAdd required and forbidden finding judges +390/-5

Add required and forbidden finding judges

• Introduces validated, severity-aware finding matching across inline comments and GitHub 422 review-body fallbacks. Adds fail-closed capture handling, conditional execution, and pass-rate gates over only applicable cases.

eval/review/eval.yaml

capture-fixture.shCapture paginated inline review comments +49/-0

Capture paginated inline review comments

• Fetches PR review comments through the REST API, merges paginated output, preserves file and line metadata, and records failures as unverifiable instead of clean empties.

eval/scripts/capture-fixture.sh

Tests (17) +989 / -0
MakefileRun review-finding judge tests in script-test +1/-0

Run review-finding judge tests in script-test

• Adds the new Python behavior suite to the repository’s timed script-test target.

Makefile

annotations.yamlDefine three mandatory seeded-bug findings +80/-0

Define three mandatory seeded-bug findings

• Requires correctly calibrated SQL injection, timing-side-channel, and pricing findings while preventing a merge-ready outcome.

eval/review/cases/004-seeded-bugs/annotations.yaml

input.yamlAdd misleading PR with three independent bugs +75/-0

Add misleading PR with three independent bugs

• Creates a review fixture containing SQL interpolation, non-constant-time MAC comparison, and broken discount arithmetic.

eval/review/cases/004-seeded-bugs/input.yaml

annotations.yamlDefine safe hash and subprocess false-positive bait +61/-0

Define safe hash and subprocess false-positive bait

• Forbids high-severity findings for contextual MD5 cache-key use and a static shell-free subprocess invocation.

eval/review/cases/005-fp-bait/annotations.yaml

input.yamlAdd context-sensitive false-positive fixture +55/-0

Add context-sensitive false-positive fixture

• Creates safe receipt helpers whose surface patterns resemble weak hashing and command injection.

eval/review/cases/005-fp-bait/input.yaml

annotations.yamlForbid fabricated findings on accurate documentation +46/-0

Forbid fabricated findings on accurate documentation

• Asserts that the docs-only change receives no finding at low severity or above.

eval/review/cases/006-docs-only/annotations.yaml

input.yamlAdd accurate docs-only review fixture +36/-0

Add accurate docs-only review fixture

• Clarifies existing order lookup and discount rounding behavior without changing executable code.

eval/review/cases/006-docs-only/input.yaml

annotations.yamlForbid blockers on a routine patch bump +44/-0

Forbid blockers on a routine patch bump

• Rejects fabricated high or critical findings for a one-line requests patch-version update.

eval/review/cases/007-dependency-bump/annotations.yaml

input.yamlAdd bot-style dependency bump fixture +20/-0

Add bot-style dependency bump fixture

• Creates a low-risk requests update from 2.31.0 to 2.32.3.

eval/review/cases/007-dependency-bump/input.yaml

annotations.yamlRequire detection behind misleading security prose +71/-0

Require detection behind misleading security prose

• Requires a high-severity MD5 signature finding even though the PR body and docstring deny a security boundary.

eval/review/cases/008-reassuring-docstring/annotations.yaml

input.yamlAdd deceptive webhook-signature fixture +52/-0

Add deceptive webhook-signature fixture

• Creates a secret-prefixed MD5 digest that is actually used to authenticate inbound webhooks.

eval/review/cases/008-reassuring-docstring/input.yaml

api.mdAdd baseline API documentation fixture +14/-0

Add baseline API documentation fixture

• Provides the pre-change documentation used by the docs-only review case.

eval/review/repos/webapp/docs/api.md

requirements.txtAdd baseline dependency versions +2/-0

Add baseline dependency versions

• Provides the requests and Flask versions used by the dependency-bump case.

eval/review/repos/webapp/requirements.txt

session.pyAdd secure baseline session verification +23/-0

Add secure baseline session verification

• Provides HMAC token generation and constant-time verification for the seeded regression case.

eval/review/repos/webapp/src/auth/session.py

pricing.pyAdd correct baseline discount calculation +11/-0

Add correct baseline discount calculation

• Provides percentage validation and correctly scaled discount arithmetic for the seeded regression case.

eval/review/repos/webapp/src/orders/pricing.py

repository.pyAdd parameterized baseline order lookup +12/-0

Add parameterized baseline order lookup

• Provides the safe SQLite query implementation replaced by the seeded injection fixture.

eval/review/repos/webapp/src/orders/repository.py

review-findings-judge-test.pyExercise finding judges against synthetic review output +386/-0

Exercise finding judges against synthetic review output

• Extracts the shipped Python checks from eval.yaml and tests matching, validation, severity boundaries, capture failures, false positives, and 422 fallback bodies.

eval/scripts/review-findings-judge-test.py

Documentation (2) +11 / -3
README.mdDocument finding ground truth and captured review comments +6/-3

Document finding ground truth and captured review comments

• Extends fixture and lifecycle documentation for required/forbidden findings, shared fixture repositories, and inline review comments.

eval/README.md

README.mdDescribe the shared review fixture repository +5/-0

Describe the shared review fixture repository

• Explains how case-specific PR diffs layer over the common webapp baseline.

eval/review/repos/webapp/README.md

Other (5) +5 / -0
repoLink seeded-bug case to shared webapp baseline +1/-0

Link seeded-bug case to shared webapp baseline

• Points the case at the common review fixture repository.

eval/review/cases/004-seeded-bugs/repo

repoLink false-positive case to shared webapp baseline +1/-0

Link false-positive case to shared webapp baseline

• Points the case at the common review fixture repository.

eval/review/cases/005-fp-bait/repo

repoLink docs-only case to shared webapp baseline +1/-0

Link docs-only case to shared webapp baseline

• Points the case at the common review fixture repository.

eval/review/cases/006-docs-only/repo

repoLink dependency case to shared webapp baseline +1/-0

Link dependency case to shared webapp baseline

• Points the case at the common review fixture repository.

eval/review/cases/007-dependency-bump/repo

repoLink webhook case to shared webapp baseline +1/-0

Link webhook case to shared webapp baseline

• Points the case at the common review fixture repository.

eval/review/cases/008-reassuring-docstring/repo

@qodo-code-review

qodo-code-review Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. forbidden_findings fails open ✓ Resolved
Description
When review_comments is empty and no 422 fallback marker is found, forbidden_findings returns
success even though the posting path may have dropped every finding that lacked a file or line. This
fail-open branch allows a promoted forbidden finding to remain unobserved and be treated as verified
clean, letting the precision gate pass despite unverifiable delivery.


Remediation recommended

2. Minor bump called patch ✓ Resolved
Description
Case 007 describes requests 2.31.0 → 2.32.3 as “patch version only,” but the minor component
changes from 31 to 32. This makes the case's risk premise and expected reviewer behavior inaccurate,
weakening it as a precision evaluation for routine patch bumps.

3. Malformed empty ground-truth silently skipped ✓ Resolved
Description
Both judges gate execution with if: "annotations.get('required_findings')" / forbidden_findings,
which is a truthiness check, not a presence/type check. An annotations value like
required_findings: {} or forbidden_findings: {} (an empty mapping, which YAML also allows in
place of a list) is falsy in Python, so the judge is skipped entirely rather than running its 'must
be a list' validation, and a skipped judge is excluded from the pass-rate denominator instead of
counting as a failure.

Grey Divider

Context sources
✅ Compliance rules (platform): 56 rules
✅ Skills: 4 invoked
  code-review
  code-implementation
  pr-review
  docs-review
Review mode: 🧠 Deep: This broad eval-harness change spans scripts, YAML judges, fixture cases, and extensive new test logic with many independent parsing, fallback, validation, and capture paths that could hide multiple subtle defects.

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread eval/review/eval.yaml Resolved
Comment thread eval/review/eval.yaml Resolved
guyoron1 added a commit to guyoron1/agents that referenced this pull request Aug 26, 2026
Three review findings from qodo on fullsend-ai#1003:

The forbidden_findings judge treated zero inline comments as a verified
clean review, but postreview.go omits findings with no file or line from
the inline comments entirely — they remain in the sticky comment body.
A review whose findings all lacked a position posted nothing inline, left
no 422 marker, and passed as clean. The judge now scans the sticky/issue
comments and review bodies for finding headers before trusting an empty
review_comments, and fails closed when findings are visible somewhere it
cannot grade them.

Both findings judges gated on truthiness (if: annotations.get(...)), so
a malformed-but-falsy ground truth ({}, "", 0) was silently skipped —
excluded from the pass-rate denominator — instead of reaching the check
body's fail-loud validation. The gate now skips only for absent or [],
and the check bodies type-check before the trivial-pass so the falsy
malformed values fail with a message.

Case 007 called requests 2.31.0 -> 2.32.3 a patch-level bump; that is a
minor bump. The fixture now bumps 2.32.2 -> 2.32.3, which is genuinely
patch-only with no breaking changes, so the case premise and the
forbidden_findings floor it justifies are accurate.

Judge tests cover all three: empty-mapping/empty-string annotations fail
loudly, sticky-only findings fail closed, a chatty no-findings sticky
still passes, and sticky duplicates of positioned findings do not trip
the guard.

Signed-off-by: guy oron <goron@redhat.com>
guyoron1 added a commit to guyoron1/agents that referenced this pull request Aug 27, 2026
…issed

Picks up ralphbean's fullsend-ai#709 at his invitation on the review-economy thread
("please take over ... or start it from scratch and we can discard
mine"). The design is his; this keeps it, closes three of the gaps its
own non-goals list, and moves the forge calls where they now belong.

Kept from fullsend-ai#709, unchanged in substance: the two-tier trust gate
(author_association in OWNER/MEMBER/COLLABORATOR, falling back to the
collaborator permission API for admin/maintain/write, the same pair
check-e2e-authorization.sh uses); the PR author never dismissing their own
findings even holding a qualifying role; keying the dismissal to whether
the dismissed code is still present rather than to a round boundary;
matching on file + category, never line; downgrading to info +
actionable:false rather than dropping; and the experimental framing with
explicit non-goals.

Split across the forge boundary. fullsend-ai#709 puts a `gh api` call in the shared
SKILL.md. That skill is now forge-abstracted — it delegates every fetch
to "the forge-specific review skill's <section>" and pr-review/github and
pr-review/gitlab supply the commands — so the dismissal fetch follows
suit: the shared skill carries the semantics, github/SKILL.md carries the
GraphQL query, and step 2a-1 skips when a forge has no such section. That
keeps GitLab on today's behavior instead of breaking it.

What this adds:

1. Non-reply dismissals. fullsend-ai#709's non-goals name these; they are the two
   things people actually reach for when a finding is not worth a
   sentence. Resolving the conversation and a thumbs-down on the bot's
   comment now count, and both are trust-gated exactly like a reply. One
   GraphQL reviewThreads query replaces the paginated REST call and
   carries all three signals: resolution is GraphQL-only, reactions cost
   a request per comment over REST, and threads arrive pre-grouped, so
   the in_reply_to_id chain walk goes away with it.

2. A critical carve-out. As fullsend-ai#709 stands, any severity downgrades to info,
   critical included, and stays there for as long as the code is
   unchanged — which is the case where it should stay unchanged. Critical
   findings are now emitted at critical with the dismissal noted
   alongside. info + actionable:false resolves to `approve` in 6f, and
   that is the one outcome a critical finding must not produce.
   Refutation still downgrades a critical finding, because that is a
   verified judgment about the code rather than a dismissal of it.

3. Disputes, engaged exactly once. "This isn't a bug, because X" is not a
   decline, so under fullsend-ai#709 it falls through and the finding re-raises
   verbatim next push — fullsend-ai#106 wearing a different hat. The argument is
   judged on its merits and is deliberately not trust-gated (the PR
   author is usually the one making it, and correctness is not a
   permission). Refuted, it downgrades; not refuted, the finding stands
   with one sentence engaging it, and the exchange is over.

4. A fail-closed trust boundary, because the collaborator-permission
   fallback does not work from where this runs. GitHub rejects that
   endpoint without push access ("Must have push access to view
   collaborator permission"), and the review agent is deliberately
   read-only — readonly_repo: true, providers/github-ro.yaml, and a
   policy whose own comment says "No write access to GitHub". So the
   second tier generally 403s in the sandbox. Any error is treated as
   not trusted: the dismissal does not count and the finding is emitted
   normally.

   That has a consequence worth stating rather than leaving to be
   discovered: on a private organization, where a real admin's
   association reports as CONTRIBUTOR, tier one under-reports and tier
   two cannot compensate. Rather than leave the new signals dead on
   arrival — resolvers and reactors carry no association at all — a
   middle tier looks the login up among the associations the same query
   already returned for this PR's thread comments, which covers the
   common case at no extra request. Closing the gap properly means
   resolving trust on the runner, where a write-scoped token exists, and
   passing the result in; that is a separate change.

Two corrections to fullsend-ai#709's text, both verified rather than assumed:

- fullsend#6045 has shipped, so the review app's identity no longer has
  to be a literal. FULLSEND_SLUG is exported into the sandbox from the
  harness identity and is in reservedSandboxKeys so env.sandbox cannot
  shadow it. The configured login stays only as the fallback for a
  harness that declares no slug.
- The bot's login has two spellings and the query returns both at once.
  GraphQL reports a Bot-typed author without the [bot] suffix — the form
  FULLSEND_SLUG holds, so it compares directly — while REST's user.login
  and a bot appearing under resolvedBy (typed User, not Bot) both carry
  it. fullsend#6456 corrected this same mismatch in another skill.

Verified against live data rather than from the schema: every field in
the query — isResolved, resolvedBy, authorAssociation, diffHunk,
reactionGroups.reactors, the pageInfo flags — was run against real review
threads on fullsend-ai#1003, and the snippet was executed exactly
as it appears in github/SKILL.md (exit 0). Three behaviours worth knowing
came out of that and are documented next to the query: reviewThreads
returns oldest-first, so it uses last: 100 while comments within a thread
stay first: 50 so nodes[0] is the root; `line` comes back null with
originalLine set once a comment's diff position goes stale, which on a
re-review is the common case; and reactionGroups returns all eight
contents even at zero, so totalCount must be checked before reading
reactors.

Not included, and neither omission is a shortcut:

An eval case is blocked twice over. eval/review/cases/*/input.yaml
expresses only forge, seed_issues and fixture — there is no way to seed a
prior review, review threads, replies, resolution or reactions, and the
case lifecycle is a single agent run. Even given that, the runner reuses
GH_TOKEN as REVIEW_TOKEN, so a seeded review comment would carry no
performed_via_github_app.client_id, PRIOR_REVIEW_PROVENANCE would be
unverifiable-no-app, and step 2a-1 would skip by design. That is agents#245.
Worth revisiting when fullsend-ai#245 lands, because this is behaviour that will rot
silently.

GitLab parity is left explicitly unimplemented rather than guessed. The
signals exist there — discussions carry resolved and resolved_by,
award_emoji carries the reaction — but the trust boundary has no verified
field mapping and I have no live instance to check one against. That is
the part that must not be approximated, so gitlab/SKILL.md says so and
step 2a-1 skips when a forge provides no section.

Signed-off-by: guy oron <goron@redhat.com>

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only sweep — findings below, no approval or change request implied.

One finding could not be anchored inline because it lands in a file this PR does not touch (eval/scripts/run-fullsend.sh:156), so it is recorded here:


CRITICAL — Cases 004-008 will 422 on self-review, so the new findings judges never measure the agent

Verified end-to-end at head. (1) eval/scripts/run-fullsend.sh:154-156 emits REVIEW_TOKEN from GH_TOKEN; (2) eval/scripts/setup-fixture.sh:120 creates the fixture PR with gh pr create under that same GH_TOKEN, so the reviewer identity IS the PR author; (3) eval/README.md:134-138 documents the consequence as a known issue (#245): GitHub rejects APPROVE and REQUEST_CHANGES reviews on your own PR. Cases 001/002/003 dodge it only because they touch .github/ — their annotations say so verbatim (001: "post-review.sh downgrades an approve to comment ... This avoids the 422 self-review error"; 003 the same). None of 004-008 touch a protected path: 004 (src/orders, src/auth), 005 (src/orders/receipts.py), 006 (docs/api.md), 007 (requirements.txt), 008 (src/auth/webhook.py).

The 422 is not recoverable on this path: fullsend internal/cli/postreview.go:395 only retries when len(inlineComments) > 0 && is422Error(err), and the retry at :400 re-submits with the SAME event, so a self-review rejection fails again; scripts/post-review.src.sh:477-502 then exits non-zero and the outcome-label block never runs.

Net effect: 004 and 008 (which expect request-changes) post no review and no inline comments, so required_findings reports a miss for a fully correct agent — a false red on a gate that is effectively 1.0; 005/006/007 (which expect approve) likewise post nothing, and forbidden_findings falls through to return True, "None of the N forbidden findings were raised" — a vacuous 1.0 precision pass.

Supporting: the PR's Testing section lists only static checks (extracted-judge unit test, lint-cases.sh, pre-commit); no ./eval/run-functional.sh review output is attached, and one live run over 004/005 would have surfaced this immediately.

Also unverified in the same vein: the fail-closed commit message claims "the review guidance tells the agent to omit the line rather than guess one" — skills/pr-review/SKILL.md:805 documents line as optional and contains no such instruction (the "rather than guessing" at :98 is about PR identification).

Suggestion

Do not land the findings gates at effective 1.0 until 004-008 can actually post. Either supply a distinct review-posting identity (#245 — a second account or a GitHub App installation token for REVIEW_TOKEN), or make post-review.src.sh degrade the review EVENT to COMMENT on a self-review 422 while still attaching the inline comments, so findings reach pulls/{n}/comments where the judges read them. Until then, attach one live run-functional.sh review pass over at least 004 and 005 (per-case judge verdicts plus a captured fixture-state.json), or land the thresholds permissive and say why.


The remaining six findings are inline on the diff.

Comment thread eval/review/eval.yaml Outdated
"— the findings were dropped from the inline comments (no "
"file/line) and cannot be checked against forbidden_findings"
)
return True, f"None of the {len(entries)} forbidden findings were raised"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH — forbidden_findings still returns a clean pass for a review submission that never landed

Residual gap after resolved thread 3864004646. Commit 072c700 added the stray scan (eval.yaml:559-570) so findings that landed only in the sticky/issue comments or review bodies fail closed — that addresses the thread as filed. But the scan can only fire when something was posted.

When the review submission itself fails (the self-review 422 raised separately in this review), capture-fixture.sh records reviews: [], comments: [] (or sticky-only), review_decision: null, and review_comments: [] — not review_comments_fetch_failed, because the GET succeeded and legitimately returned zero rows. Traced through the judge at head: comments is [] and a list, so no early failure; posted is empty; comments or saw_fallback is False; stray is empty; control reaches this line and returns a clean pass.

A pipeline that posted and evaluated nothing is structurally indistinguishable from a genuinely clean review, and reports 1.0 precision. This is the exact decorative-gate defect the PR exists to close.

Suggestion

Add a delivery check before the clean-pass return: fail closed when no review object landed at all — e.g. when state.get("reviews") is empty AND state.get("review_decision") is null, return False with "no review was submitted — precision cannot be verified". That distinguishes a successful approve/comment review with zero findings (a real clean pass, which leaves a review object) from a submission that never happened.

Comment thread eval/review/eval.yaml Outdated

if violations:
return False, f"Forbidden findings present: {violations}"
if not posted:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — The fail-closed guard is short-circuited by any single parsed finding

Confirmed by reading the judge at head: if not posted: on this line wraps BOTH the comments or saw_fallback branch (:544) and the sticky/review-body stray scan (:559). As soon as one finding parses out of review_comments, none of it runs.

That matters because fullsend internal/cli/postreview.go:464 drops a finding when f.File == "" || f.Line <= 0, and :470 drops it again (fileFiltered++) when its file is absent from diffHunks — in both cases it survives only in the sticky comment body, and line is optional in the review-result schema.

So the realistic 005 failure is reachable in one step: the agent posts one legal low/info note inline on src/orders/receipts.py AND promotes the MD5 bait to critical with no line. posted is non-empty, every guard is skipped, and the judge returns "None of the 2 forbidden findings were raised" — the silent pass the PR says it closed.

The same gap costs recall in the other direction: a correct seeded-bug finding dropped for want of a line reads as a miss in required_findings, which at an effective 1.0 gate is a false red, not the "recall caveat" the description calls it.

Suggestion

Run the sticky/review-body scan unconditionally rather than only when posted is empty, scoped to the files named in entries so it stays specific. The sticky bullet format is - **[<category>]** `<file>:<line>` — <description> (skills/pr-review/SKILL.md), so the file is parseable: extract (category, file) pairs from the sticky and fail when a forbidden file carries a header there that never reached review_comments. The same parse lets required_findings credit a finding that was made but dropped by the posting path, removing the recall caveat.

Comment thread eval/review/eval.yaml Outdated
raw = outputs["files"].get("output/fixture-state.json")
if not raw:
return False, "fixture-state.json not found — capture-fixture.sh did not run or failed"
state = json.loads(raw)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — A judge that raises is dropped from the pass-rate denominator, so the new judges do not fail closed on a malformed capture

Both new check bodies call state = json.loads(raw) with no guard (eval.yaml:291 and :450) and index outputs["files"] directly.

Verified against the pinned harness (eval/.agent-eval-harness @ 4b540c652f5ed325e18abf6b4bd0eb4414a4bb3c): skills/eval-run/scripts/score.py:1047 wraps every scorer in except Exception as e: case_results[name] = {"value": None, "error": ...}, and :1069 aggregates only if name in aggregated and result.get("value") is not None — a raising judge is excluded from the denominator, identical in effect to an if: skip.

Truncation is a live path, not hypothetical: capture-fixture.sh writes with a plain redirect (jq -n ... > "$STATE_FILE" at :227/:269/:343) under timeout: 30 in eval.yaml:39, and agent_eval/hooks.py:51-57 SIGTERMs then SIGKILLs the process group on expiry. A truncated fixture-state.json therefore removes that case from required_findings/forbidden_findings entirely and the remaining case carries the rate to 1.0. detect_regressions (score.py:1616-1621) only catches this when the judge died on EVERY case; a single-case crash still vanishes silently.

Distinct from resolved thread 3864004660 — that closed the if:-truthiness door (now not in (None, [])); this is the exception door.

Suggestion

Guard the parse and state extraction inside the judges so a bad capture becomes a returned failure rather than an exception: try: state = json.loads(raw) / except ValueError as e: return False, f"fixture-state.json is not valid JSON: {e}", and outputs.get("files", {}). Add a judge-test case feeding a truncated JSON string and asserting (False, ...) rather than a raise. Writing the state to a temp file and mv-ing it into place would also turn a killed hook into "absent" (which the judges already handle) rather than "truncated".

Comment thread eval/review/eval.yaml Outdated
# finding headers; any there mean the agent emitted findings this
# judge cannot attribute to a file, so precision is unverifiable
# and must fail closed rather than read as verified clean.
stray = sorted({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — A sub-agent failure fails the precision judge on files it never mentioned

Verified against the shipped skill and poster. skills/pr-review/SKILL.md:815-833 instructs the agent, when an Opus-tier sub-agent (correctness, security) returns nothing, to record a high-severity finding with "category": "sub-agent-failure", "file": "N/A" and no line (the challenger variant at :982 is info-level).

Traced through fullsend internal/cli/postreview.go: f.Line <= 0 at :464 drops it from the inline comments, and "N/A" is not in diffHunks so it is dropped again — but the sticky comment still renders **[sub-agent-failure]**, which the judge's FINDING_RE matches. On the three clean cases (005, 006, 007), where a correct review posts nothing inline, that lands squarely in this stray branch (:559-570) and fails forbidden_findings with "the findings were dropped from the inline comments ... cannot be checked against forbidden_findings" — on a finding about harness health, not about the bait file.

With forbidden_findings at an effective 1.0 (0.9 over three cases), one sub-agent hiccup turns an infrastructure flake into a red precision gate — precisely the misattribution the suite is meant to avoid. More likely still on the pi/Grok implementation named in the PR description, which runs review without sub-agents.

Suggestion

Scope the stray scan to the files named in entries so a header on "N/A" or an unrelated file cannot trip it, and/or exclude the sub-agent-failure category explicitly — it is a harness-health signal with a fixed sentinel file, not a precision signal. A separate judge asserting no sub-agent-failure finding would surface that condition where it belongs.

# The floor is lowered from the default "high" to "low", so even a
# low-severity fabrication fails: there is nothing on this file to find.
forbidden_findings:
- file: docs/api.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Case 006's annotation premise is false: the fixture implements no 404, and any low+ finding on the file fails the case

The case forbids ANY finding on docs/api.md at min_severity: low and states in review_expectations that "the two clarifications are both true of the base repo as it stands, so 'the docs now disagree with the code' is not an available genuine finding."

Verified against the shared baseline at head: eval/review/repos/webapp/ contains only README.md, requirements.txt, docs/api.md, src/orders/{repository,pricing}.py and src/auth/session.py. There is no HTTP layer anywhere in the fixture — repository.py's get_order returns None and nothing maps it to a status code. So the new sentence "or 404 if no order with that id exists" documents behaviour that is implemented nowhere in the repo. (The rounding clarification IS accurate: pricing.py already calls round().)

A reviewer that does exactly what case 008 rewards — follow a prose claim to the code that backs it — and files a low-severity "this documented 404 is not implemented in this repo" fails forbidden_findings. The suite would then be punishing on 006 the behaviour it grades as correct on 008.

Suggestion

Either add a minimal route to the baseline fixture that actually returns 404 on a missing order, or reword the docs change to something the baseline demonstrably does (e.g. "returns None when no order with that id exists; the caller maps this to 404"). Failing that, raise 006's floor back to "high" and drop the claim that both clarifications are true of the base repo.

# observation on a bot bump, but nothing in a one-line patch bump justifies
# a high/critical finding.
forbidden_findings:
- file: requirements.txt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Case 007 asserts no high/critical surface on a pin that carries two live published advisories

The fix commit correctly repaired the delta (baseline eval/review/repos/webapp/requirements.txt is requests==2.32.2, head is 2.32.3 — a genuine patch bump, closing resolved thread 3864004654), but it re-verified the delta and not the destination.

Queried the GitHub advisory API directly (gh api '/advisories?ecosystem=pip&affects=requests@2.32.3') and got two published advisories that still affect the pinned version: GHSA-9hjg-9r4m-mvj7 / CVE-2024-47081 (.netrc credentials leak via malicious URLs, vulnerable range < 2.32.4) and GHSA-gc5v-m9x4-r6x2 / CVE-2026-25645 (insecure temp-file reuse in extract_zipped_paths, vulnerable range < 2.33.0).

Both are GitHub-rated medium, so the forbidden entry (category "", min_severity: high) only fires if an agent rates a known-vulnerable pin high — plausible for a credential leak, not certain. But the annotation states as fact that "there is no correctness, security or intent surface to review beyond the bump itself," and that is false today and grows more false as new advisories land against a frozen pin. Note that bumping the fixture to 2.32.4 does not fix it — the second advisory covers all of 2.32.x.

Suggestion

Pin a version verified advisory-clean at authoring time and record the check (and the date) in the annotation so it is re-run when the fixture is touched, or use a fictional/vendored package name so the case has no coupling to upstream disclosure at all. Failing that, restate the premise as "no breaking-change finding is justified" and narrow the forbidden category away from the empty wildcard, so a legitimate CVE observation cannot fail the case.

@guyoron1
guyoron1 force-pushed the eval/review-precision-cases branch from 072c700 to 48a57f3 Compare September 6, 2026 06:02
guyoron1 added a commit to guyoron1/agents that referenced this pull request Sep 6, 2026
Three review findings from qodo on fullsend-ai#1003:

The forbidden_findings judge treated zero inline comments as a verified
clean review, but postreview.go omits findings with no file or line from
the inline comments entirely — they remain in the sticky comment body.
A review whose findings all lacked a position posted nothing inline, left
no 422 marker, and passed as clean. The judge now scans the sticky/issue
comments and review bodies for finding headers before trusting an empty
review_comments, and fails closed when findings are visible somewhere it
cannot grade them.

Both findings judges gated on truthiness (if: annotations.get(...)), so
a malformed-but-falsy ground truth ({}, "", 0) was silently skipped —
excluded from the pass-rate denominator — instead of reaching the check
body's fail-loud validation. The gate now skips only for absent or [],
and the check bodies type-check before the trivial-pass so the falsy
malformed values fail with a message.

Case 007 called requests 2.31.0 -> 2.32.3 a patch-level bump; that is a
minor bump. The fixture now bumps 2.32.2 -> 2.32.3, which is genuinely
patch-only with no breaking changes, so the case premise and the
forbidden_findings floor it justifies are accurate.

Judge tests cover all three: empty-mapping/empty-string annotations fail
loudly, sticky-only findings fail closed, a chatty no-findings sticky
still passes, and sticky duplicates of positioned findings do not trip
the guard.

Signed-off-by: guy oron <goron@redhat.com>
@guyoron1

guyoron1 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

@waynesun09 all six threads addressed in 48a57f3, rebased onto ec2f8a5: eval.yaml's thresholds conflicted twice (finding_expectations kept), cases renumbered 005-009 around main's 004.

  • The sticky scan is unconditional now and scoped to the case's files: a dropped critical fails precision, a dropped true finding is credited. Recall caveat gone, raising judge fails closed.
  • Fail closed on a review that never landed, with one deviation: postreview.go skips a COMMENT review with no inline findings, so the sticky tells undelivered from clean.
  • 007 matches the fixture; 008 pins advisory-clean versions, query and date recorded.
  • The 422: post-review degrades the event to COMMENT when the token owns the PR, so findings land. A separate REVIEW_TOKEN is the real fix (Reintroduce review eval tests — self-review token blocker #245).

guyoron1 added a commit to guyoron1/agents that referenced this pull request Sep 6, 2026
…issed

Picks up ralphbean's fullsend-ai#709 at his invitation on the review-economy thread
("please take over ... or start it from scratch and we can discard
mine"). The design is his; this keeps it, closes three of the gaps its
own non-goals list, and moves the forge calls where they now belong.

Kept from fullsend-ai#709, unchanged in substance: the two-tier trust gate
(author_association in OWNER/MEMBER/COLLABORATOR, falling back to the
collaborator permission API for admin/maintain/write, the same pair
check-e2e-authorization.sh uses); the PR author never dismissing their own
findings even holding a qualifying role; keying the dismissal to whether
the dismissed code is still present rather than to a round boundary;
matching on file + category, never line; downgrading to info +
actionable:false rather than dropping; and the experimental framing with
explicit non-goals.

Split across the forge boundary. fullsend-ai#709 puts a `gh api` call in the shared
SKILL.md. That skill is now forge-abstracted — it delegates every fetch
to "the forge-specific review skill's <section>" and pr-review/github and
pr-review/gitlab supply the commands — so the dismissal fetch follows
suit: the shared skill carries the semantics, github/SKILL.md carries the
GraphQL query, and step 2a-1 skips when a forge has no such section. That
keeps GitLab on today's behavior instead of breaking it.

What this adds:

1. Non-reply dismissals. fullsend-ai#709's non-goals name these; they are the two
   things people actually reach for when a finding is not worth a
   sentence. Resolving the conversation and a thumbs-down on the bot's
   comment now count, and both are trust-gated exactly like a reply. One
   GraphQL reviewThreads query replaces the paginated REST call and
   carries all three signals: resolution is GraphQL-only, reactions cost
   a request per comment over REST, and threads arrive pre-grouped, so
   the in_reply_to_id chain walk goes away with it.

2. A critical carve-out. As fullsend-ai#709 stands, any severity downgrades to info,
   critical included, and stays there for as long as the code is
   unchanged — which is the case where it should stay unchanged. Critical
   findings are now emitted at critical with the dismissal noted
   alongside. info + actionable:false resolves to `approve` in 6f, and
   that is the one outcome a critical finding must not produce.
   Refutation still downgrades a critical finding, because that is a
   verified judgment about the code rather than a dismissal of it.

3. Disputes, engaged exactly once. "This isn't a bug, because X" is not a
   decline, so under fullsend-ai#709 it falls through and the finding re-raises
   verbatim next push — fullsend-ai#106 wearing a different hat. The argument is
   judged on its merits and is deliberately not trust-gated (the PR
   author is usually the one making it, and correctness is not a
   permission). Refuted, it downgrades; not refuted, the finding stands
   with one sentence engaging it, and the exchange is over.

4. A fail-closed trust boundary, because the collaborator-permission
   fallback does not work from where this runs. GitHub rejects that
   endpoint without push access ("Must have push access to view
   collaborator permission"), and the review agent is deliberately
   read-only — readonly_repo: true, providers/github-ro.yaml, and a
   policy whose own comment says "No write access to GitHub". So the
   second tier generally 403s in the sandbox. Any error is treated as
   not trusted: the dismissal does not count and the finding is emitted
   normally.

   That has a consequence worth stating rather than leaving to be
   discovered: on a private organization, where a real admin's
   association reports as CONTRIBUTOR, tier one under-reports and tier
   two cannot compensate. Rather than leave the new signals dead on
   arrival — resolvers and reactors carry no association at all — a
   middle tier looks the login up among the associations the same query
   already returned for this PR's thread comments, which covers the
   common case at no extra request. Closing the gap properly means
   resolving trust on the runner, where a write-scoped token exists, and
   passing the result in; that is a separate change.

Two corrections to fullsend-ai#709's text, both verified rather than assumed:

- fullsend#6045 has shipped, so the review app's identity no longer has
  to be a literal. FULLSEND_SLUG is exported into the sandbox from the
  harness identity and is in reservedSandboxKeys so env.sandbox cannot
  shadow it. The configured login stays only as the fallback for a
  harness that declares no slug.
- The bot's login has two spellings and the query returns both at once.
  GraphQL reports a Bot-typed author without the [bot] suffix — the form
  FULLSEND_SLUG holds, so it compares directly — while REST's user.login
  and a bot appearing under resolvedBy (typed User, not Bot) both carry
  it. fullsend#6456 corrected this same mismatch in another skill.

Verified against live data rather than from the schema: every field in
the query — isResolved, resolvedBy, authorAssociation, diffHunk,
reactionGroups.reactors, the pageInfo flags — was run against real review
threads on fullsend-ai#1003, and the snippet was executed exactly
as it appears in github/SKILL.md (exit 0). Three behaviours worth knowing
came out of that and are documented next to the query: reviewThreads
returns oldest-first, so it uses last: 100 while comments within a thread
stay first: 50 so nodes[0] is the root; `line` comes back null with
originalLine set once a comment's diff position goes stale, which on a
re-review is the common case; and reactionGroups returns all eight
contents even at zero, so totalCount must be checked before reading
reactors.

Not included, and neither omission is a shortcut:

An eval case is blocked twice over. eval/review/cases/*/input.yaml
expresses only forge, seed_issues and fixture — there is no way to seed a
prior review, review threads, replies, resolution or reactions, and the
case lifecycle is a single agent run. Even given that, the runner reuses
GH_TOKEN as REVIEW_TOKEN, so a seeded review comment would carry no
performed_via_github_app.client_id, PRIOR_REVIEW_PROVENANCE would be
unverifiable-no-app, and step 2a-1 would skip by design. That is agents#245.
Worth revisiting when fullsend-ai#245 lands, because this is behaviour that will rot
silently.

GitLab parity is left explicitly unimplemented rather than guessed. The
signals exist there — discussions carry resolved and resolved_by,
award_emoji carries the reaction — but the trust boundary has no verified
field mapping and I have no live instance to check one against. That is
the part that must not be approximated, so gitlab/SKILL.md says so and
step 2a-1 skips when a forge provides no section.

Signed-off-by: guy oron <goron@redhat.com>

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only sweep — findings below, no approval or change request implied.

Comment thread scripts/lib/github-review-ops.lib.sh Outdated
--repo "${REPO}" --json author --jq '.author.login' 2>/dev/null || true
}

forge_get_review_user() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Self-review identity lookup fails open with zero diagnostics

The new forge_get_review_user() — GH_TOKEN="${REVIEW_TOKEN}" gh api user --jq '.login' 2>/dev/null || true (mirrored in scripts/lib/gitlab-review-ops.lib.sh:91 via _gitlab_api GET "/user", and duplicated verbatim in scripts/post-review.sh:99/324 and scripts/pre-review.sh) — swallows every failure into an empty string, as does the pre-existing forge_get_pr_author() it's compared against. Verified live at scripts/post-review.src.sh:306-308: REVIEW_USER=$(forge_get_review_user); PR_AUTHOR=$(forge_get_pr_author); if [ -n "${REVIEW_USER}" ] && [ "${REVIEW_USER}" = "${PR_AUTHOR}" ]; then ….

Any transient failure on either call (rate limit, network blip, a malformed API response) for a PAT-shaped REVIEW_TOKEN — the credential type this workaround is verified to actually help (a GitHub App installation token never collides with the PR author in the first place, since the review identity is <slug>[bot], so an empty gh api user there is the correct no-op) — silently skips the self-review degrade with no log line. The review then hits the GitHub 422 this PR exists to route around, and there is no trail in the run output explaining why the workaround didn't fire.

Suggestion: Log when either identity lookup returns empty (e.g. echo "::warning::forge_get_review_user returned empty — cannot check for self-review" >&2) so a resulting 422 is diagnosable, rather than looking identical to "REVIEW_USER != PR_AUTHOR".

# the agent MAY note either pattern at low/info — saying it looked and
# dismissed the pattern is good reviewing — but promoting it to a real
# vulnerability is the false positive this case measures.
forbidden_findings:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Case 006's forbidden-finding categories ("hash", "command") are narrower than realistic false-positive phrasing

Unlike case 007/008 (category: "", forbidding any finding on the file) or case 009 (category: "md5", the unavoidable primitive name — verified at eval/review/cases/009-reassuring-docstring/annotations.yaml:32), case 006 anchors its two forbidden entries on the literal words "hash" (line ~22) and "command" (line ~30). cat_matches in eval/review/eval.yaml (defined at both 466-471 and 730-734) is word-boundary-based — r"(?<!\w)" + tokens + r"(?!\w)" — and searched against the whole comment body (p["text"] = body, eval.yaml:664/748), not the category token alone.

A realistically-worded promotion such as category weak-crypto with a description reading only "hashlib.md5 is cryptographically broken; use hashlib.sha256" (no standalone "hash") or unsafe-subprocess describing "arbitrary code execution" (no standalone "command") would score a clean pass on this case even though the agent made exactly the false-positive error the case exists to measure.

The same whole-body search cuts the other way too: because it isn't scoped to the category token, a high-severity finding whose text happens to negate the bait ("this is NOT command injection") would still trip the substring match — though this second scenario requires an agent to word a dismissal at floor severity ("high" by default), which the case's own guidance steers agents away from (dismissals are meant to land at low/info), so it's a much narrower edge case than the paraphrase-miss above.

Suggestion: Anchor case 006 on the unavoidable primitive names directly ("md5" for the hash bait, "subprocess" for the command bait), the same way case 009 does, rather than a paraphrase-prone word.

Comment thread scripts/post-review.src.sh Outdated
# ---------------------------------------------------------------------------
# Read the action from the result file, not from ACTION: a protected-path
# downgrade has already rewritten it to "comment", which a forge accepts.
case "$(jq -r '.action' "${RESULT_FILE}")" in

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Self-review degrade applies to GitLab unconditionally, even though GitLab often accepts self-approval

The new case "$(jq -r '.action' "${RESULT_FILE}")" in approve|request-changes|reject) … [ "${REVIEW_USER}" = "${PR_AUTHOR}" ] … block (304-325) has no forge check and runs identically for GitHub and GitLab, but the 422 it exists to route around is GitHub-specific ("a forge rejects an approve or a request-changes review on your own pull request (GitHub returns 422)", per the comment at 285-287). GitLab's "prevent approval by author" is a per-project setting many instances leave disabled, so a genuine, forge-accepted GitLab approval from the review token gets unconditionally rewritten to a comment event and never posted as a real approval — a silent downgrade of a review outcome GitLab would have accepted.

Confirmed the outcome label is unaffected by this (the ACTION/DOWNGRADED branch that drives it is read before this block runs and untouched by it) — the loss is specifically that the MR's own review trail on GitLab shows a comment instead of the approval that actually happened.

Suggestion: Gate the degrade on FULLSEND_FORGE == github, or on a forge-specific "self-review is rejected by this platform" predicate, rather than applying it to every forge.

classic SQL injection. Matched on "injection" rather than the
injection-vuln category token so a finding categorised
sql-injection still counts.
- file: src/auth/session.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Case 005's required-finding wording/severity floors are brittle at an effectively 1.0 recall gate

category: "timing" (line 29) is satisfied only by a finding whose body contains the standalone word "timing" — a correct finding phrased only as "not constant-time", "side-channel", or referencing compare_digest without the word "timing" would miss. Similarly category: "apply_discount" combined with min_severity: high (lines 37-38) fails a review that correctly identifies the 100x pricing bug at medium severity, or describes the arithmetic error without naming the function.

This is a design-brittleness concern rather than an observed failure — the annotations file itself documents the reasoning for each choice — but with required_findings at an effective 1.0 threshold over these two cases (005/009 per eval.yaml's gate comment), one plausible synonym or severity-rating miss on real model output would read as a full recall failure rather than the partial credit the finding actually deserves.

Suggestion: Broaden accepted synonyms (e.g. also accept "constant-time"/"compare_digest" for the timing case) and allow medium severity on the pricing bug, leaving finer severity judgment to review_quality rather than a hard gate — validate against a few real model output samples before locking these as gates.

`gh pr view --json comments` returns only the issue-comment timeline —
the review agent's sticky write-up — never the positioned review
comments that carry the individual findings. Judges could therefore see
that a review happened, but not what it found.

capture-fixture.sh's pull_request branch now also fetches
GET /repos/{repo}/pulls/{n}/comments into review_comments as
{path, line, body}. --paginate is load-bearing: the REST default is 30
per page, so a review posting 40 findings would be silently truncated,
hiding exactly the over-flagging that a precision judge exists to
measure. --jq runs per page under --paginate, so `jq -s 'add // []'`
concatenates the per-page arrays back into one.

A fetch failure records review_comments: null plus
review_comments_fetch_failed: true rather than an empty array. An empty
array reads as "the agent posted no findings" when the truth is "we
could not look", which would silently pass a forbidden-findings check.

Signed-off-by: guy oron <goron@redhat.com>
The review suite's existing judges measure the outcome: which labels
landed, what the decision was, whether the budget held. None of them
can tell a review that found the three seeded bugs from one that
approved blindly, or a review that considered and dismissed FP bait
from one that promoted it to a vulnerability. Measuring review
precision means inspecting the findings themselves.

Two deterministic judges read the review_comments capture:

- required_findings: every {file, category, min_severity} entry in
  annotations must be satisfied by at least one posted finding.
- forbidden_findings: no posted finding may match an FP-bait entry at
  or above its floor. That floor defaults to high, so a low/info
  "considered and dismissed" note stays legal — only promoting the
  bait to a real vulnerability is a false positive.

Findings are recognised by the "**[severity]** category" header that
formatFindingComment renders. The regex searches rather than anchors,
because postreview.go's file-level fallback prefixes the body with
"_Line N_ · " when GitHub rejects a positioned comment.

`category` is matched against the whole finding body, not the category
token alone: the agent's categories are fine-grained kebab-case
(injection-vuln, logic-error), the output schema constrains them only
to a non-empty string, and SKILL.md routes unrecognised categories to
the nearest dimension. Pinning the token would fail a correct review
on a synonym.

Matching is word-boundary aware. Case-insensitive substring matching
is the bug class review already flagged on eval/code's removed_symbols
judge, where VerboseLoggingEnabled satisfied a VerboseLogging
requirement. Entries are validated up front — a non-list value, a null
file or category, an out-of-vocabulary min_severity, or a typo'd key
fails the case with a message instead of degrading to a weaker check.
Unknown severities fail closed in both directions: never satisfying a
requirement, always tripping a prohibition.

Signed-off-by: guy oron <goron@redhat.com>
The judges are Python embedded in YAML with no import site of their
own, so the test extracts the shipped check bodies straight from
eval.yaml — the same approach as removed-symbols-judge-test.py, and
for the same reason: CI installs neither pyyaml nor ruamel, and a
copied body would drift from the code it claims to cover.

54 cases cover exact matches, the word-boundary near-misses a
substring matcher would wrongly accept (injection/injections,
hash/hashicorp, discount/discounted), severity floors at and one notch
below the boundary, unknown severities in both fail-closed directions,
case-sensitive file paths, the "_Line N_ ·" fallback body, malformed
and missing annotations, and every capture failure mode.

Verified by breaking the shipped judge twice: replacing the boundary
match with a substring match fails 4 cases, and dropping the
min_severity validation fails 1 with a KeyError. Both restored green.

Signed-off-by: guy oron <goron@redhat.com>
Four PR fixtures over one shared webapp fixture repo, symlinked in as
each case's repo/ the way eval/triage's cases share python-webapp.
Numbered from 004 so they do not collide with
003-protected-path-downgrade.

- 004-seeded-bugs: three real, independent bugs (SQL injection via an
  f-string, hmac.compare_digest downgraded to ==, apply_discount
  missing its / 100) whose PR body actively misdirects on all three.
- 005-fp-bait: a correct PR carrying MD5-as-cache-key and a
  static-argv subprocess.run. Neither may be raised at high/critical.
- 006-docs-only: a docs clarification that is true of the base repo,
  so nothing above info is a genuine finding.
- 007-dependency-bump: a one-line patch bump with no high/critical
  surface.

The base repo holds the safe version of each file, so the seeded bugs
appear in the diff as removals of the protection rather than as
pre-existing code the reviewer has to go hunting for.

required_findings match on the substantive claim ("injection",
"timing") rather than on a category token, since the category
vocabulary is a convention the agent may deviate from. The clean cases
use an empty category to forbid any finding on the file at or above
the floor, which asserts "invent nothing here" without having to
enumerate what might be invented.

Signed-off-by: guy oron <goron@redhat.com>
pass_rate is sum(values)/len(values) over every case that produced a
value, and a case declaring no findings ground truth returns True. With
one recall case out of five, required_findings at 0.70 could not fail
even if that case missed every seeded bug — the recall gate was
decorative.

Both findings judges now carry an `if:`, so the harness skips them for
cases with no ground truth rather than counting a trivial pass, and the
rates are over the cases that actually assert something. The threshold
comment claimed this was already true; it now describes what the numbers
really do, including that 0.9 across three precision cases means all
three must pass rather than allowing one failure.

Signed-off-by: guy oron <goron@redhat.com>
The existing cases share their ground truth with the review guidance:
each seeded bug and each bait construct appears verbatim as an example in
skills/pr-review. A suite built that way measures instruction-following,
and it cannot detect a prompt change that over-suppresses, because the
rule and the case were written together.

008 is the deliberate mirror of 005. Both PRs hash a secret-prefixed
payload with md5; in 005 the digest is a cache key and flagging it is a
false positive, here it is compared against an inbound X-Signature header
and missing it ships an authentication bypass. The surface pattern is
identical, so neither case can be passed by recognising the construct —
only by following the value to its use.

Both prose channels lie: the docstring calls it 'not a security boundary'
and the PR body repeats it, while the function that uses it as a
signature sits three lines below in the same diff. That makes this the
case that fails if a reviewer ever treats an author's description of
their own code as evidence about it.

Signed-off-by: guy oron <goron@redhat.com>
Two ways the precision judge could report a clean pass without having
seen anything.

forbidden_findings returned success whenever no inline comment parsed as
a finding. postreview.go folds findings into the review body when GitHub
422s the positioned comments, and drops any finding with no file or
line — and the review guidance tells the agent to omit the line rather
than guess one. In those cases precision is unverifiable, which is not
the same as verified clean: a promoted bait would pass. It now fails when
comments exist but none parse, and says why.

fetch_review_comments discarded jq's exit status, so a jq failure
returned success with empty output; the caller then passed "" to
--argjson, which aborts jq under set -e before fixture-state.json is
written at all. That loses every judge for the case, including the label
and budget ones, rather than just this field. The existing pr_fetch_failed
path exists precisely to avoid that.

Signed-off-by: guy oron <goron@redhat.com>
When GitHub rejects the positioned comments, post-review retries without
them and embeds each finding as a bullet in the review body
(buildFallbackReviewBody). The findings are real; only the delivery
changed. Reading inline comments alone made the recall judge report a
miss the agent never made, and left the precision judge unable to see a
promoted bait at all — a silent pass on exactly the case the suite
exists to catch.

Both judges now also parse the fallback bullets, anchored on the fixed
note post-review writes, so an ordinary review body is never mined for
things that look like findings. The unverifiable guard accounts for it
too: a fallback note whose bullets do not parse fails rather than
reporting a clean review.

This is what agents#209 was waiting on. The 422 bug itself (agents#193)
is still open, but the eval no longer has to wait for it: a review
delivered through the fallback is now judged on its findings rather than
on how GitHub happened to accept them.

Signed-off-by: guy oron <goron@redhat.com>
Three review findings from qodo on fullsend-ai#1003:

The forbidden_findings judge treated zero inline comments as a verified
clean review, but postreview.go omits findings with no file or line from
the inline comments entirely — they remain in the sticky comment body.
A review whose findings all lacked a position posted nothing inline, left
no 422 marker, and passed as clean. The judge now scans the sticky/issue
comments and review bodies for finding headers before trusting an empty
review_comments, and fails closed when findings are visible somewhere it
cannot grade them.

Both findings judges gated on truthiness (if: annotations.get(...)), so
a malformed-but-falsy ground truth ({}, "", 0) was silently skipped —
excluded from the pass-rate denominator — instead of reaching the check
body's fail-loud validation. The gate now skips only for absent or [],
and the check bodies type-check before the trivial-pass so the falsy
malformed values fail with a message.

Case 007 called requests 2.31.0 -> 2.32.3 a patch-level bump; that is a
minor bump. The fixture now bumps 2.32.2 -> 2.32.3, which is genuinely
patch-only with no breaking changes, so the case premise and the
forbidden_findings floor it justifies are accurate.

Judge tests cover all three: empty-mapping/empty-string annotations fail
loudly, sticky-only findings fail closed, a chatty no-findings sticky
still passes, and sticky duplicates of positioned findings do not trip
the guard.

Signed-off-by: guy oron <goron@redhat.com>
main added 004-tool-owned-codecov-filename while this branch was open, so
the five findings cases shift up one: 004-seeded-bugs becomes 005 and
008-reassuring-docstring becomes 009. Directory names are the only case
ids, so the rename is the renumber; the prose references in eval.yaml's
threshold comment and 009's annotations move with them.

Signed-off-by: guy oron <goron@redhat.com>
The findings judges could each report a clean 1.0 on a review they never
measured.

- The sticky/review-body scan only ran when nothing parsed out of
  review_comments, so one legally-posted low note hid a bait that was
  promoted to critical and then dropped for want of a line. It now runs
  unconditionally, parsing SKILL.md's sticky bullet shape into (category,
  file) pairs and skipping bullets that mirror a posted finding.
- forbidden_findings returned a clean pass when the review submission
  never landed at all (reviews empty, review_decision null — the
  self-review 422). That now fails with the reason.
- Both judges raised on a truncated fixture-state.json, and score.py
  drops a raising judge from the pass-rate denominator, so a malformed
  capture silently removed the case. Parse failures are returned, not
  raised.
- The old scan failed the precision gate on any finding header anywhere,
  including the sub-agent-failure sentinel on its "N/A" file. The scan is
  now scoped to the files the case names.

required_findings gains the other half: a finding the posting path
dropped is credited from the sticky rather than counted as a miss, using
the low end of an ambiguous severity heading so a "Medium / Low / Info"
bullet cannot satisfy a `high` requirement.

Signed-off-by: guy oron <goron@redhat.com>
Both cases asserted "nothing here is worth a finding" about fixtures that
did have something.

007 documented a 404 for an unknown order id, but the shared webapp
fixture has no HTTP layer at all — nothing maps get_order's None to a
status code. A reviewer that follows the prose to the code behind it, the
behaviour case 009 rewards, would file a low-severity "this 404 is not
implemented" and fail the case. The docs change now describes the lookup
itself, which the fixture demonstrably does.

008 forbade any high/critical finding on requirements.txt while pinning
requests 2.32.3, which carries two published advisories (GHSA-9hjg-9r4m-
mvj7, GHSA-gc5v-m9x4-r6x2) — a real CVE observation was indistinguishable
from the fabrication the case measures. The bump is now 2.33.0 -> 2.33.1
with flask at 3.1.3, all three verified advisory-free, and the annotation
records the query and the date so it is re-run when the pins are touched.

Signed-off-by: guy oron <goron@redhat.com>
The rule compared the sticky's pinned SHA to the captured head with `in`,
but the marker regex accepts 7 to 40 hex characters and SKILL.md's own
worked example pins an abbreviated one. A clean case whose sticky carried
a short SHA would have read as a write-up from an earlier run. Compare by
prefix in both directions instead; absent marker is still silent.

Signed-off-by: guy oron <goron@redhat.com>
…e check is skipped

Two review findings on the self-review degrade.

The degrade ran for every forge, but the rejection it routes around is
GitHub's 422. GitLab's "prevent approval by author" is a per-project
setting that many instances leave off, so a genuine, accepted
self-approval there was being rewritten into a note. The case now keys
on FULLSEND_FORGE as well as the action; GitLab never enters it.

forge_get_review_user and forge_get_pr_author both fail open into an
empty string, so a transient failure on a PAT-shaped REVIEW_TOKEN
silently skipped the check and the run hit the 422 with no trail. An
empty lookup now logs a ::warning:: naming both values. It fires for a
GitHub App installation token too, which cannot read /user — that is
the correct no-op, and the message says so.

Tests: an empty identity keeps the event and logs the warning; the
same identity on GitLab keeps the approve. The curl mock gains GET
/user (MOCK_GITLAB_USER).

Signed-off-by: guy oron <goron@redhat.com>
"hash" and "command" were paraphrase-prone: a weak-crypto finding
reading "hashlib.md5 is cryptographically broken" has no standalone
"hash", and an unsafe-subprocess finding describing "arbitrary code
execution" never says "command" — both are the false positive the case
exists to catch, and both scored a clean pass. Match "md5" and
"subprocess" instead, the way 009 already matches "md5": a promotion
has to name the construct it is promoting.

Signed-off-by: guy oron <goron@redhat.com>
…medium

With required_findings gating at 1.0 over two cases, one synonym miss
on real output reads as a full recall failure. A required category may
now list alternatives separated by "|" and any one satisfies the entry;
a blank alternative is ignored rather than matching everything. Case
005's timing entry accepts "constant-time", "compare_digest" and
"side-channel" phrasings, and the pricing bug is required at medium
rather than high — a review that finds it and rates it medium has found
it; the review_quality rubric grades the calibration.

Both judges share the change; the judge test covers a matched
alternative, a missed one, a blank one, and a forbidden entry tripped
by its second alternative.

Signed-off-by: guy oron <goron@redhat.com>
guyoron1 added a commit to guyoron1/agents that referenced this pull request Sep 10, 2026
…issed

Picks up ralphbean's fullsend-ai#709 at his invitation on the review-economy thread
("please take over ... or start it from scratch and we can discard
mine"). The design is his; this keeps it, closes three of the gaps its
own non-goals list, and moves the forge calls where they now belong.

Kept from fullsend-ai#709, unchanged in substance: the two-tier trust gate
(author_association in OWNER/MEMBER/COLLABORATOR, falling back to the
collaborator permission API for admin/maintain/write, the same pair
check-e2e-authorization.sh uses); the PR author never dismissing their own
findings even holding a qualifying role; keying the dismissal to whether
the dismissed code is still present rather than to a round boundary;
matching on file + category, never line; downgrading to info +
actionable:false rather than dropping; and the experimental framing with
explicit non-goals.

Split across the forge boundary. fullsend-ai#709 puts a `gh api` call in the shared
SKILL.md. That skill is now forge-abstracted — it delegates every fetch
to "the forge-specific review skill's <section>" and pr-review/github and
pr-review/gitlab supply the commands — so the dismissal fetch follows
suit: the shared skill carries the semantics, github/SKILL.md carries the
GraphQL query, and step 2a-1 skips when a forge has no such section. That
keeps GitLab on today's behavior instead of breaking it.

What this adds:

1. Non-reply dismissals. fullsend-ai#709's non-goals name these; they are the two
   things people actually reach for when a finding is not worth a
   sentence. Resolving the conversation and a thumbs-down on the bot's
   comment now count, and both are trust-gated exactly like a reply. One
   GraphQL reviewThreads query replaces the paginated REST call and
   carries all three signals: resolution is GraphQL-only, reactions cost
   a request per comment over REST, and threads arrive pre-grouped, so
   the in_reply_to_id chain walk goes away with it.

2. A critical carve-out. As fullsend-ai#709 stands, any severity downgrades to info,
   critical included, and stays there for as long as the code is
   unchanged — which is the case where it should stay unchanged. Critical
   findings are now emitted at critical with the dismissal noted
   alongside. info + actionable:false resolves to `approve` in 6f, and
   that is the one outcome a critical finding must not produce.
   Refutation still downgrades a critical finding, because that is a
   verified judgment about the code rather than a dismissal of it.

3. Disputes, engaged exactly once. "This isn't a bug, because X" is not a
   decline, so under fullsend-ai#709 it falls through and the finding re-raises
   verbatim next push — fullsend-ai#106 wearing a different hat. The argument is
   judged on its merits and is deliberately not trust-gated (the PR
   author is usually the one making it, and correctness is not a
   permission). Refuted, it downgrades; not refuted, the finding stands
   with one sentence engaging it, and the exchange is over.

4. A fail-closed trust boundary, because the collaborator-permission
   fallback does not work from where this runs. GitHub rejects that
   endpoint without push access ("Must have push access to view
   collaborator permission"), and the review agent is deliberately
   read-only — readonly_repo: true, providers/github-ro.yaml, and a
   policy whose own comment says "No write access to GitHub". So the
   second tier generally 403s in the sandbox. Any error is treated as
   not trusted: the dismissal does not count and the finding is emitted
   normally.

   That has a consequence worth stating rather than leaving to be
   discovered: on a private organization, where a real admin's
   association reports as CONTRIBUTOR, tier one under-reports and tier
   two cannot compensate. Rather than leave the new signals dead on
   arrival — resolvers and reactors carry no association at all — a
   middle tier looks the login up among the associations the same query
   already returned for this PR's thread comments, which covers the
   common case at no extra request. Closing the gap properly means
   resolving trust on the runner, where a write-scoped token exists, and
   passing the result in; that is a separate change.

Two corrections to fullsend-ai#709's text, both verified rather than assumed:

- fullsend#6045 has shipped, so the review app's identity no longer has
  to be a literal. FULLSEND_SLUG is exported into the sandbox from the
  harness identity and is in reservedSandboxKeys so env.sandbox cannot
  shadow it. The configured login stays only as the fallback for a
  harness that declares no slug.
- The bot's login has two spellings and the query returns both at once.
  GraphQL reports a Bot-typed author without the [bot] suffix — the form
  FULLSEND_SLUG holds, so it compares directly — while REST's user.login
  and a bot appearing under resolvedBy (typed User, not Bot) both carry
  it. fullsend#6456 corrected this same mismatch in another skill.

Verified against live data rather than from the schema: every field in
the query — isResolved, resolvedBy, authorAssociation, diffHunk,
reactionGroups.reactors, the pageInfo flags — was run against real review
threads on fullsend-ai#1003, and the snippet was executed exactly
as it appears in github/SKILL.md (exit 0). Three behaviours worth knowing
came out of that and are documented next to the query: reviewThreads
returns oldest-first, so it uses last: 100 while comments within a thread
stay first: 50 so nodes[0] is the root; `line` comes back null with
originalLine set once a comment's diff position goes stale, which on a
re-review is the common case; and reactionGroups returns all eight
contents even at zero, so totalCount must be checked before reading
reactors.

Not included, and neither omission is a shortcut:

An eval case is blocked twice over. eval/review/cases/*/input.yaml
expresses only forge, seed_issues and fixture — there is no way to seed a
prior review, review threads, replies, resolution or reactions, and the
case lifecycle is a single agent run. Even given that, the runner reuses
GH_TOKEN as REVIEW_TOKEN, so a seeded review comment would carry no
performed_via_github_app.client_id, PRIOR_REVIEW_PROVENANCE would be
unverifiable-no-app, and step 2a-1 would skip by design. That is agents#245.
Worth revisiting when fullsend-ai#245 lands, because this is behaviour that will rot
silently.

GitLab parity is left explicitly unimplemented rather than guessed. The
signals exist there — discussions carry resolved and resolved_by,
award_emoji carries the reaction — but the trust boundary has no verified
field mapping and I have no live instance to check one against. That is
the part that must not be approximated, so gitlab/SKILL.md says so and
step 2a-1 skips when a forge provides no section.

Signed-off-by: guy oron <goron@redhat.com>
@guyoron1
guyoron1 force-pushed the eval/review-precision-cases branch from 48a57f3 to be1c805 Compare September 10, 2026 12:44
@guyoron1

Copy link
Copy Markdown
Contributor Author

@waynesun09 all seven addressed; the three 08-27 threads were closed in the same series but never got an in-thread reply, so pointing at the commits here.

09-08:

  • scripts/lib/github-review-ops.lib.sh:45 — fixed in 57b35ea (empty identity lookup logs a ::warning:: with both values; names the App-token case)
  • scripts/post-review.src.sh:304 — fixed in 57b35ea (degrade keys on FULLSEND_FORGE, GitHub only; test pins GitLab keeps the approve)
  • eval/review/cases/006-fp-bait/annotations.yaml:20 — fixed in 302fbfe (md5 / subprocess, as 009)
  • eval/review/cases/005-seeded-bugs/annotations.yaml:28 — fixed in be1c805 (| alternatives for timing; pricing floor medium)

08-27:

  • eval/review/eval.yaml:841 (clean pass on a review that never landed) — fixed in ab6a879, scoped in 6a2a7e4: no review object + null decision fails unless the sticky is a clean write-up pinned to this head
  • eval/review/cases/007-docs-only/annotations.yaml:20 (404 premise) — fixed in bc73405: docs now say the lookup returns None, which repository.get_order does
  • eval/review/cases/008-dependency-bump/annotations.yaml:35 (advisories on the pin) — fixed in bc73405: pins moved to requests 2.33.0→2.33.1 / flask 3.1.3, advisory query recorded in the annotation, all empty

Rebased onto #1211, force-pushed. I'll re-run the cases against the mixed-runtime config once a week of runs exists.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only sweep — findings below, no approval or change request implied.

Comment thread eval/review/eval.yaml Outdated
# that ran and found nothing still posts its write-up. A write-up
# carrying finding bullets with no review behind it is a delivery
# failure (the self-review 422), not a clean pass.
if not (state.get("reviews") or []) and state.get("review_decision") is None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH — The whole delivery guard is dead code: gh emits reviewDecision as "", never null

This is the fix for unresolved thread 3873399461 being inert. That thread asked for a guard failing closed when reviews is empty and review_decision is null; the guard was implemented verbatim as if not (state.get("reviews") or []) and state.get("review_decision") is None: — but the suggestion carried the wrong shape assumption, so the branch never executes against a real capture.

gh pr view --json reviewDecision serialises a GraphQL null as an empty STRING, not null (gh's PullRequest struct types the field as Go string). Verified live on an unprotected repo: gh pr view <n> --repo sharkdp/fd --json reviewDecision returns {"reviewDecision":""} on six consecutive PRs, while protected repos return REVIEW_REQUIRED. The eval's ephemeral fixture repo (setup-fixture.sh creates it fresh, no protection, no CODEOWNERS) is the unprotected case, so it will always capture "". capture-fixture.sh:330 passes $pr.reviewDecision through unmapped; only the fetch-failure path at :256 writes a literal null.

Ran the shipped judge (extracted with the test's own load_judge) against the three shapes:

review_decision omitted (test shape)  -> (False, 'nothing was posted ...')
review_decision: null (fetch-fail)    -> (False, 'nothing was posted ...')
review_decision: ""  (REAL capture)   -> (True,  'None of the 1 forbidden findings were raised')

All three sub-guards inside the block die together: the nothing-posted check (:811), the stale-sticky head-SHA check (:838), and the undelivered check (:844). The judge test never catches it because state_with (review-findings-judge-test.py:155) omits the key entirely, so .get() yields None and all 97 tests pass against a shape the capture never produces.

The dropped_violations path (:782) is unaffected — it runs unconditionally — so a review that posted a sticky with forbidden bullets still fails. What passes clean is the case the guard exists for: a submission that never landed (the self-review 422, or the identity lookup failing open at post-review.src.sh:337 -> REQUEST_CHANGES -> 422 -> retry re-submits the same event -> sticky lands, no review object). That reports 1.0 precision on a pipeline that posted and evaluated nothing.

Suggestion

Fix both ends.

  1. Normalise at capture time — capture-fixture.sh:330: review_decision: (if $pr.reviewDecision == "" then null else $pr.reviewDecision end).
  2. Make the judge robust to either shape regardless: if not (state.get("reviews") or []) and not state.get("review_decision"):.
  3. Change state_with in review-findings-judge-test.py to set review_decision: "" explicitly so the 97 tests model what gh actually emits, and add a row asserting the "" shape still fails closed.

Comment thread eval/review/eval.yaml Outdated
"category": cat,
"sev_lo": sev_lo,
"sev_hi": sev_hi,
"text": line,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Sticky bullets are matched on one line only, dropping the remediation the contract promises to match

The judges' documented matching contract (eval.yaml:236-237) states: "category is matched against the whole comment body — the category token plus the description and remediation — not against the category token alone." That holds for inline comments (p["text"] is the full body, and postreview.go:524-526 appends **Suggested fix:** <remediation> into it), but not for the sticky/review-body scan.

Both copies of the sticky scan store only the single regex-matched line as the searchable text: "text": line at eval.yaml:734 (forbidden_findings) and the identical block at eval.yaml:463 (required_findings). SKILL.md's sticky template (skills/pr-review/SKILL.md:1252-1256) puts remediation on a SEPARATE indented continuation line:

- **[<category>]** `<file>:<line>` — <description>
  Remediation: <remediation>

STICKY_BULLET_RE is ^- \*\*\[... and anchored, so the continuation line never matches and is never appended to the bullet's text.

This cuts both ways, because required_findings genuinely consumes dropped to credit a made-then-dropped finding (eval.yaml:499-505):

  • required_findings: a correct seeded-bug finding that was dropped from the inline comments (no line, or file outside the diff hunks — postreview.go:490/495) and whose distinguishing phrase lives only in its remediation is NOT credited -> a false recall failure at the effectively-1.0 gate.
  • forbidden_findings: the mirror image at :768 — a forbidden finding whose matching phrase appears only in its remediation is not seen -> a false clean pass.

The two blocks are copy-pasted, so a fix applied to one silently drifts from the other.

Suggestion

Accumulate each bullet's continuation lines (subsequent lines that are indented and do not match STICKY_BULLET_RE or HEADING_RE) into that bullet's text before the category match, in BOTH copies (:734 and :463). Add a required-finding and a forbidden-finding judge-test row where the matching phrase occurs solely on the Remediation: line.

Comment thread scripts/post-review.src.sh Outdated
# line is the self-review collision going undetected. Empty is expected
# for a GitHub App installation token (it cannot read /user, and its
# <slug>[bot] identity never collides); for a PAT it is a failed call.
echo "::warning::Self-review check skipped — identity lookup returned empty (review user: '${REVIEW_USER}', PR author: '${PR_AUTHOR}'). If the review token is a PAT that owns this PR, expect a 422 on submit (#245)" >&2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — The new self-review diagnostic fires ::warning:: on every GitHub App run — the path its own comment calls expected

This block answers unresolved thread 3959125630 ("self-review identity lookup fails open with zero diagnostics"), but the diagnostic it adds is unconditional and therefore fires on the recommended production configuration.

forge_get_review_user() (scripts/lib/github-review-ops.lib.sh:45-47) is GH_TOKEN="${REVIEW_TOKEN}" gh api user --jq '.login' 2>/dev/null || true — every failure collapses to an empty string. The empty branch then unconditionally emits echo "::warning::Self-review check skipped — identity lookup returned empty ...", and the comment immediately above it (lines 333-336) states the empty result is EXPECTED for a GitHub App installation token, which cannot read GET /user (403 "Resource not accessible by integration") and whose <slug>[bot] identity can never collide with the PR author anyway.

So wherever REVIEW_TOKEN is an App installation token — the setup eval/README.md:145 and issue #245 both recommend — every single review run surfaces a workflow warning annotation that describes a non-condition. This runs on every GitHub approve/request-changes/reject, not only in the eval (the bundled copy is scripts/post-review.sh:767). Warning on the normal path trains operators to ignore the annotation, which defeats the one case it was added for: a PAT that owns the PR, where a 422 is about to happen.

Suggestion

Capture the exit status and stderr instead of swallowing with || true. On an HTTP 403 / "Resource not accessible by integration", log at ::notice:: ("App installation token — self-review collision not possible") and keep ::warning:: only for a genuinely failed lookup or an empty PR author, which is where a subsequent 422 is actually diagnosable.

The delivery guard fired only on `review_decision is None`, but
`gh pr view --json reviewDecision` serialises a GraphQL null as an
empty STRING, never null, on an unprotected repo — which every
ephemeral fixture is. So the guard was dead against a real capture:
a submission that never landed (the self-review 422) reported 1.0
precision on a pipeline that posted and evaluated nothing. Test
falsiness instead, and normalise "" to null at capture time so one
no-decision shape reaches the judge. state_with now models "" (the
real gh shape), with rows asserting both "" and null fail closed.

The sticky/review-body scan stored only the matched bullet line as
the searchable text, but SKILL.md puts the remediation on an indented
continuation line and the matching contract promises to match the
description AND remediation. Fold each bullet's continuation lines
into its text in both scan copies, so a required finding whose phrase
lives only on the remediation line is still credited, and a forbidden
one is still caught. Added a required and a forbidden judge-test row
matched solely on the remediation line.

Signed-off-by: guy oron <goron@redhat.com>
The self-review diagnostic emitted `::warning::` on every empty
identity lookup, but an App installation token — the recommended
REVIEW_TOKEN setup (fullsend-ai#245/README) — always gets 403 "Resource not
accessible by integration" on GET /user, and its <slug>[bot] identity
can never collide with the PR author. So the warning fired on the
normal production path, training operators to ignore the annotation
that exists for the one case that matters: a PAT that owns the PR,
where a 422 is about to happen.

Re-probe the lookup's stderr on the already-empty path and classify:
a 403 with a known PR author is a `::notice::`; a genuinely failed
lookup or an empty PR author keeps the `::warning::`, where a
subsequent 422 is actually diagnosable. Regenerated the bundle.

Signed-off-by: guy oron <goron@redhat.com>
@guyoron1

Copy link
Copy Markdown
Contributor Author

@waynesun09 — thanks, all three land. Fixed:

  • HIGH, delivery guard dead against reviewDecision: "" (6190af5): the guard now tests not state.get("review_decision") instead of is None, so it fires on both the empty-string (real capture) and null (fetch-fail) shapes. Normalised ""→null at capture time (capture-fixture.sh:330). state_with now models "" explicitly, plus rows asserting both "" and null fail closed.
  • MEDIUM, sticky bullets matched on one line only (6190af5): both scan copies now fold each bullet's indented continuation lines (the Remediation: line) into its text before the category match; reset on heading/new-bullet/dedup/unindented. Added a required and a forbidden judge-test row whose matching phrase lives solely on the remediation line — both fail against the old code, pass now.
  • MEDIUM, self-review ::warning:: on every App-token run (e756407): the empty-lookup path now re-probes stderr and classifies — a 403 / "Resource not accessible by integration" with a known PR author is a ::notice:: (App installation token, no collision possible); ::warning:: stays for a genuinely failed lookup or an empty PR author. Bundle regenerated.

Tests: review-findings-judge-test.py 101/101, post-review-test.sh green, make check-bundle clean, lint-cases.sh review OK.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only sweep — findings below, no approval or change request implied.

Comment thread eval/review/eval.yaml Outdated
cat = mk.group(1).strip()
# Strip only a trailing ":<line>", never a colon inside a path.
path = norm_path(re.sub(r":\d+$", "", mk.group(2)))
if any(sev_lo <= r <= sev_hi for r in seen.get((path, cat.lower()), ())):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Sticky dedup absorbs every same-file/same-category/same-band bullet, so a genuinely dropped finding is discarded when it shares a key with a posted one

Verified at head e756407. Both judges build seen[(file, category.lower())] = [rank, ...] from the posted inline findings (eval.yaml:426-430, mirrored at :712-716) and then skip any sticky bullet whose (file, category) key has a posted rank inside the bullet's heading range (if any(sev_lo <= r <= sev_hi ...) at :469 and :755). The key carries no text identity and no count: one posted finding absorbs an unlimited number of sticky bullets with the same file, category token and severity band.

Because every finding — posted or dropped — is mirrored in the sticky, N inline findings of key K plus one lineless/off-diff finding of key K yields N+1 sticky bullets, all skipped, and the dropped one never reaches dropped.

  • In required_findings that is a false miss at the effectively-1.0 recall gate (an inline logic-error medium on some other function in the file hides a dropped logic-error medium on the seeded bug).
  • In forbidden_findings it is a false clean pass only when the inline finding is itself below the floor while sharing the band, which is narrow — hence MEDIUM rather than higher.

The comment at :422-425 says the severity range fixed this class after the (file, category)-only key was found to be too coarse; the regression row at eval/scripts/review-findings-judge-test.py:526-533 only covers the different-band case, so the same-band case is untested. This is distinct from thread 3982589908 (continuation-line folding, now implemented at :459-465) and thread 3873399475 (short-circuit, now fixed).

Suggestion

The two copies want different fixes.

  • In required_findings the dedup can be removed outright: dropped is consulted only after no posted entry satisfied the requirement, and a sticky mirror of a posted finding carries the same text with sev_lo <= its point severity, so it can never credit something posted did not — deleting the skip at :469 removes the false-miss path with no downside.
  • In forbidden_findings the dedup is needed (a legal low note's mirror under "Medium / Low / Info" would otherwise be graded at sev_hi=medium), but key it on content: compare the bullet's description (mk.group(3) plus folded continuation lines) against the posted finding's body rather than only (file, category, band). A per-key counter (consume one posted rank per matched bullet) is cheaper but order-dependent — if the dropped bullet precedes the mirror in the sticky, the mirror is graded instead.

Add a judge-test row shaped like :526-533 but with the inline note in the SAME band as the sticky-only bullet, in both judges.

def receipt_cache_key(order_id: str, total_cents: int) -> str:
"""Build a short cache key for a rendered receipt.

MD5 is used here purely as a fast, non-cryptographic cache key —

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Case 006's MD5 fixture rests on a false premise: a collision serves another order's cached receipt, not a "harmless cache miss"

Verified at head. The receipt_cache_key docstring (input.yaml:34-36) justifies MD5 with "a collision only causes a harmless cache miss", and the key is receipt:{digest[:12]} (:38-39) — 48 bits, birthday bound about 2^24 ≈ 16.7M cached receipts. A collision is a cache HIT on the wrong key: order A is served order B's rendered receipt (customer name, address, line items). So the reassurance the reviewer is asked to accept is factually wrong on the one consequence it names, and the truncation makes it materially likelier than full MD5.

The same premise is restated as ground truth in annotations.yaml:24-26 ("a non-cryptographic cache key, not a security boundary, and the docstring says so") and :48-52 ("no security implication"), and review_expectations says the context needed to dismiss the bait "is in the diff itself".

The sibling case 009 (input.yaml:31-37) is built on exactly the opposite premise — a reassuring "not a security boundary" docstring that is false, which the reviewer MUST flag at high — so 006 now scores a reviewer who reads the 006 docstring as critically as 009 demands ("collision returns a different order's receipt; docstring is wrong") as a false positive if it lands at high.

The bait still mostly works (the common naive FP is "MD5 is weak", which remains an FP), so this is a fixture-soundness defect on the same footing as the 007/008 premise findings (3873399496, 3873399501), not a blocker. Thread 3959125640 covers category anchoring on this case, not the premise.

Suggestion

Make the premise true while keeping the MD5 bait: key on receipt:{order_id}:{digest[:12]} (or include order_id un-hashed) so a collision can only ever return a stale receipt for the same order, and reword the docstring to say that ("a collision can at worst serve a stale render of the same order, which the renderer tolerates"). Update annotations.yaml:24-26 and :48-52 to match.

If the fixture is kept as-is, lower or remove the claim that "a collision only causes a harmless cache miss" and accept that a high-severity cross-order-disclosure finding on the truncated key is a legitimate (if aggressive) call, not a fabricated one — in which case the forbidden entry's category should be narrowed to the naive phrasing rather than the bare md5 token.

…ullet

Both findings judges skipped a sticky bullet as "already graded" when a
posted finding shared its file and category and sat inside the bullet
heading's severity range. That key has no identity and no count, and
every finding is mirrored in the sticky, so one posted finding absorbed
every other bullet of its file, category and band — including a finding
the posting path dropped for want of a line, which then reached nowhere.

required_findings: an inline logic-error on another function hid the
dropped logic-error on the seeded bug, a false miss at a gate that is
effectively 1.0. The dedup is removed. `dropped` is consulted only after
no posted finding satisfied the entry, and a mirror is the same finding
at a severity no higher than the posted one, so keeping the mirrors can
at most credit a finding whose sticky wording names what its inline
wording did not.

forbidden_findings: a legal note below the floor hid a dropped
fabrication in the same band, a false clean pass. The dedup stays — a
legal info note's mirror under "Medium / Low / Info" would otherwise be
graded at medium — but now also requires the two descriptions to say the
same thing. Wording is compared as a token-sequence ratio rather than for
equality or containment, because the agent writes the sticky by hand
while postreview.go renders the inline body from the findings JSON: on
111 real mirror pairs from fullsend's own reviews, normalised equality
recognised 53%, containment either way 61%, and line numbers agreed for
only 65%, while the ratio was >= 0.51 for every mirror and <= 0.28 for
all 456 pairs of distinct findings within one review. The threshold is
0.5, the top of that gap, so a doubtful bullet is graded. The old file,
category and range conditions are kept, so the new rule can only skip a
subset of what the old one skipped. It does not depend on bullet order,
which a per-key counter would.

Four judge-test rows: a same-band inline finding no longer hides a
dropped seeded finding (required); a same-band legal note no longer hides
a dropped finding, in case 007's shape, and again with the dropped bullet
listed first so a counter would grade the wrong one (forbidden); and a
reworded mirror of a legal note is still not graded twice, which is the
row that fails under equality or containment. The first three fail
against the old code.

Signed-off-by: guy oron <goron@redhat.com>
The receipt_cache_key docstring justified MD5 with "a collision only
causes a harmless cache miss", but the key was `receipt:{digest[:12]}`.
Two orders whose 48-bit prefixes collide share one key, so a collision
is a cache HIT on another order's rendered receipt — cross-order
disclosure, not a miss. The annotation restated the false reassurance as
ground truth ("not a security boundary, and the docstring says so", "no
security implication"), so a reviewer who read this docstring as
critically as case 009 demands, and reported the disclosure at high, was
scored as a false positive. 009 is this same pattern behind a
reassurance that is false; the two cases only work as a pair if 006's is
true.

Key on `receipt:{order_id}:{digest[:12]}` instead. The order id is in
the key verbatim, so two orders can never share an entry and a collision
can at worst serve a stale render of the same order. The docstring now
says exactly that, and drops "receipts are not secrets", which the
argument no longer needs and receipts do not satisfy. The MD5 bait is
unchanged: "md5 is weak" at high is still the false positive the case
measures. annotations.yaml records the new key and why the premise has
to stay true, and review_expectations now says the code bears each
docstring out rather than only that the docstring asserts it.

Checked against the fixture code with the digest forced to collide: the
old key maps two different orders to one entry, the new key never does,
and the order id round-trips out of the key even when it contains ":".

Signed-off-by: guy oron <goron@redhat.com>
@guyoron1

Copy link
Copy Markdown
Contributor Author

@waynesun09 — thanks, both addressed. New head 914be53.

  • MEDIUM — sticky dedup absorbs every same-file/same-category/same-band bullet (505055b): reproduced in both judges before touching them.
    • required_findings: the dedup is removed as you suggested (seen and the skip are gone), so every bullet reaches dropped. One correction from verifying the reasoning: a mirror does not carry the same text — the agent hand-writes the sticky while formatFindingComment renders the inline body from the findings JSON — so the guarantee is narrower than "same text": dropped is read only after no posted finding satisfied the entry, and a mirror's sev_lo is <= the posted severity, so at most it credits a finding whose sticky wording names what its inline wording did not. The credit message no longer claims the finding was dropped.
    • forbidden_findings: the dedup stays and is now keyed on content too. File, category and band are kept as necessary conditions, so the new rule can only skip a subset of what the old one skipped, and the bullet's description (mk.group(3)) must also match the posted finding's description (the body between the header line and **Suggested fix:**).
    • The match is a difflib token-sequence ratio >= 0.5 rather than containment, because I measured it on 111 real sticky/inline mirror pairs from fullsend's own reviews (agents fix(#3864): preserve prior review remediations #1232 fix(#1280): skip challenger when findings are below threshold #1282 refactor(#1287): omit meta-prompt from challenger spawn #1288 feat(review): new low findings on a re-review no longer reopen the fix loop #1318 feat(#1333): inspect project CI during fix-agent context gathering #1334, fullsend #7074 #7120 #7369 #7428): normalised equality recognised 53% of true mirrors and containment either way 61% — the two renderings differ in backticks, quotes, dashes and light rewording — which would have failed 007 on a legal info note. The ratio was >= 0.51 for every mirror and <= 0.28 for all 456 pairs of distinct findings within one review; 0.5 is the top of that gap, so a doubtful bullet is graded rather than skipped. Line numbers were no use as an identity (they agree for 65% of mirrors). Continuation lines are left out of the comparison: the label differs between renderings (Remediation: vs **Suggested fix:**) and including them lowered the mirror floor to 0.49 on the same sample. It is order-independent, unlike a per-key counter.
    • Four new rows shaped like the different-band row you cited, with the inline note in the same band. Required: a same-band inline logic-error on another function no longer hides the dropped seeded one. Forbidden: a same-band legal info note no longer hides a dropped finding (007's shape); the same again with the dropped bullet listed first and only it naming md5 (the row a per-key counter fails); and a reworded mirror of a legal note is still not graded twice (the row equality and containment fail). The first three fail against e756407.
  • MEDIUM — case 006's MD5 fixture rests on a false premise (914be53): confirmed — with receipt:{digest[:12]} a collision is a hit on another order's receipt, not a miss.
    • The key is now receipt:{order_id}:{digest[:12]} and the docstring says what that buys: the order id is in the key verbatim, so two orders can never share an entry and a collision can at worst serve a stale render of the same order. I dropped "receipts are not secrets" rather than keep it — you are right that they are not, and the argument no longer needs it — and did not add "which the renderer tolerates", since nothing in the diff backs it and an uncheckable reassurance is the defect here.
    • The two annotations.yaml passages you cited (now :24-35 and :54-61) state the key and the same-order bound and record why the premise has to stay true (009 is the same pattern behind a false reassurance); review_expectations says the code bears each docstring out, not only that the docstring asserts it. The md5 anchor and the high floor are unchanged, so "md5 is weak" at high is still the false positive the case measures.
    • Checked against the fixture code with the digest forced to collide: the old key maps two orders to one entry, the new key never does, and the order id round-trips out of the key even when it contains :.

Tests: review-findings-judge-test.py 105/105, lint-cases.sh review OK, make check-bundle clean, pre-commit clean on the four changed files.

@guyoron1
guyoron1 force-pushed the eval/review-precision-cases branch from 914be53 to c68989a Compare September 24, 2026 07:50

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only sweep. The finding is below. It is not an approval or a change request.

Comment thread eval/review/eval.yaml Outdated
# no review behind it is a delivery failure (the self-review 422),
# not a clean pass.
if not (state.get("reviews") or []) and not state.get("review_decision"):
if not (state.get("comments") or []):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: The delivery guard accepts the risk-assessment comment as proof that a review write-up landed

When no review object or decision was captured, this guard checks only whether state["comments"] is non-empty (if not (state.get("comments") or []): return False). comments holds the full issue-comment timeline from gh pr view --json comments.

scripts/post-review.src.sh:487-551 posts the <!-- fullsend:risk-assessment --> comment before forge_post_review, and does so on purpose. postreview.go posts the review sticky (<!-- fullsend:review-agent -->) only after three steps succeed: the client resolves, checkStaleHead passes, and sticky.Post returns (internal/cli/postreview.go:114-158). If any of those steps fails, the risk comment is the only comment on the PR. That comment has no **Head SHA:** marker, so the stale-sticky check is skipped. dropped is empty, so undelivered is empty too. The judge then reaches return True, "None of the N forbidden findings were raised" (around :920). The result is a clean precision pass for a review whose write-up never posted.

This is the remaining hole in the fix for thread 3873399461. It is a different case from the comments: [] shape that thread described. The self-review 422 path lands the sticky before the formal review, so it does not hit this. Only a client, stale-head or sticky-post failure does.

Suggestion: In the no-review branch, count only comments that are the review write-up. Before the "nothing was posted" test, keep only bodies that contain <!-- fullsend:review-agent -->, or drop bodies that contain <!-- fullsend:risk-assessment -->. Add a judge-test row with only a risk-assessment comment, reviews: [] and review_decision: "", and assert that it fails closed.

Signed-off-by: Guy Oron <goron@redhat.com>
Since fullsend-ai#1824, finding_expectations reads only the current section of the
review-agent sticky: formal reviews and other comments are not the
evaluated run's output. Rebuild the anchored checks on that model
instead of scraping inline review comments.

findings.must_report and findings.must_not_raise extend the findings
block: each entry names a file, a severity floor and words that must
(or must not) be in a finding there. Severity, category and file come
from the sticky's review-findings-v2 marker, which post-review builds
from the findings JSON; the words come from the category and the
sticky bullet (description and Remediation line). With no marker the
check abstains (None), as expected_review_action does. A malformed
entry fails.

Only the sticky counts, so a run that posted only the risk-assessment
comment fails closed as unattributable instead of passing as a clean
review.

Dropped with the old design: the inline-comment capture in
capture-fixture.sh, the 422-fallback body parsing, the sticky/inline
dedup, the delivery guard, the REVIEW_TOKEN override in run-fullsend.sh
and the self-review downgrade in post-review (with
forge_get_review_user). The cases move to 020-024, after main's 018
and the 019 in flight.

Signed-off-by: Guy Oron <goron@redhat.com>
@guyoron1

Copy link
Copy Markdown
Contributor Author

@waynesun09 thanks, addressed. New head d9797cf.

  • MEDIUM: the delivery guard accepts the risk-assessment comment as proof the review landed (d9797cf): the guard is gone. The findings checks now read only the review-agent sticky, so a run that posted only the risk-assessment comment fails closed as "expected one review-agent sticky comment, found 0". There's a judge-test row with exactly that shape: a risk comment only, reviews: [] and review_decision: "".

Since your review, #1824 (fea56ac) moved finding_expectations to the current section of the review-agent sticky, and post-review now writes a review-findings-v2 marker there. So I reworked this PR onto that model. It no longer captures inline comments, parses the 422 fallback body, dedups sticky against inline findings, or changes post-review / run-fullsend.

The checks are now findings.must_report / findings.must_not_raise inside main's findings block. They take severity, category and file from the marker and the words from the sticky bullet. With no marker they abstain (None). The cases moved to 020-024, after main's 018 and the 019 in #1006.

@guyoron1
guyoron1 requested a review from a team as a code owner November 15, 2026 00:34
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:36 AM UTC · Completed 12:48 AM UTC

Commit: d9797cf · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.88

@fullsend-ai-review fullsend-ai-review Bot added the risk/elevated PR risk: elevated label Nov 15, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: elevated (3/5)

Details

Elevated risk driven by a large blast radius across 24 files and 895 lines, along with high recent churn, author contention, and change coupling in touched evaluation framework files, tempered by the additive test-case scope.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [logic-error] eval/review/eval.yaml:213 — entries = expected.get(key) or [] runs before the isinstance(entries, list) check, so a malformed falsey value such as must_report: {} (or "", false, 0) is coerced to [] and passes as "No finding expectations specified" instead of failing as malformed. This contradicts the stated fail-loudly behavior, and the only malformed-type test row uses a non-empty (truthy) dict, so this path is untested.
    Remediation: Read the key with an explicit absent-key default (e.g. expected.get(key, [])), validate isinstance(entries, list) on the supplied value, and add test rows for {} and other falsey non-list values.

  • [api-contract] eval/review/eval.yaml:283 — The review-findings-v2 marker's findings array is a ledger built in scripts/post-review.src.sh from the unfiltered result plus carried open and closed prior findings, not only the findings this run posted. The judge counts every marker entry as posted without checking closed dispositions or a matching sticky bullet, so in a re-review a closed or severity-filtered finding could satisfy must_report or trip must_not_raise. The five shipped cases are single-run, so this is latent rather than live.
    Remediation: Before applying anchored expectations, drop marker entries whose id has a closed status in dispositions, and add a test row using a marker that contains a carried closed finding.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

Comment thread eval/review/eval.yaml
severity_rank = {"info": 0, "low": 1, "medium": 2, "high": 3, "critical": 4}
anchored = []
for key, default_floor in (("must_report", "info"), ("must_not_raise", "high")):
entries = expected.get(key) or []

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] logic-error

entries = expected.get(key) or [] runs before the isinstance(entries, list) check, so a malformed falsey value such as must_report: {} (or "", false, 0) is coerced to [] and passes as "No finding expectations specified" instead of failing as malformed. This contradicts the stated fail-loudly behavior; the only malformed-type test row uses a non-empty (truthy) dict, so this path is untested.

Suggested fix: Read the key with an explicit absent-key default (e.g. expected.get(key, [])), validate isinstance(entries, list) on the supplied value, and add test rows for {} and other falsey non-list values.

Comment thread eval/review/eval.yaml
projection = json.loads(base64.b64decode(match.group(1), validate=True))
except ValueError as err:
return False, f"Could not decode the review-findings marker: {err}"
posted = projection.get("findings") if isinstance(projection, dict) else None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] api-contract

The review-findings-v2 marker's findings array is a ledger built in scripts/post-review.src.sh from the unfiltered result plus carried open and closed prior findings, not only the findings this run posted. The judge counts every marker entry as posted without checking closed dispositions or a matching sticky bullet, so in a re-review a closed or severity-filtered finding could satisfy must_report or trip must_not_raise. The five shipped cases are single-run, so this is latent rather than live.

Suggested fix: Before applying anchored expectations, drop marker entries whose id has a closed status in dispositions, and add a test row using a marker that contains a carried closed finding.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-only sweep. Four findings are below as inline comments. This is not an approval or a change request.

compare_digest without ever saying "timing", so any one of those
alternatives satisfies the entry.
- file: src/orders/pricing.py
match: "apply_discount"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: 020 pricing must_report requires the word apply_discount, so a correct finding that does not name the function counts as a miss

The entry is file: src/orders/pricing.py, match: "apply_discount", min_severity: medium. The file anchor already pins the file, and the annotation itself says the file holds exactly one function, so the name narrows nothing. Its only effect is to fail a correct finding such as:

  • [logic-error] src/orders/pricing.py:11 — discounted total is missing the / 100 divisor, so totals are 100x too large

words() returns only the category plus the bullet text, mentions() finds no whole-word apply_discount, and the entry lands in not_reported. With finding_expectations gated at min_pass_rate: 1.0, one wording difference fails the gate.

An earlier thread (3959125659, on old case 005) raised the same naming risk, but only the severity floor was changed. None of the match phrases in 020-024 has been checked against a live review: the Testing section lists offline judge rows and lint only, and live runs are planned for later.

Suggestion: Drop match for pricing, so any finding on the file at medium or above counts. Or widen it, e.g. apply_discount | divisor | / 100 | 100x | factor of 100 | percent. Before treating 020-024 as a 1.0 gate, run them live at least once and tune the phrases against the real sticky bullets.

Comment thread eval/review/eval.yaml
# severity, about a given thing. A malformed entry fails loudly
# instead of being skipped, so a typo can't make a case vacuous.
severity_rank = {"info": 0, "low": 1, "medium": 2, "high": 3, "critical": 4}
anchored = []

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: A misspelled key under findings (e.g. must_reports) is silently ignored and makes the case vacuous

The validation loop reads only must_report and must_not_raise. If a case writes findings: {must_reports: [...]}, then anchored, required, required_any and forbidden all stay empty, and the judge returns True, "No finding expectations specified" without looking for a sticky.

This goes against the comment just above (lines 207-209): "A malformed entry fails loudly instead of being skipped, so a typo can't make a case vacuous." The existing line-213 thread covers falsey values such as {}; it does not cover unknown keys.

Suggestion: Reject unknown keys, e.g.

unknown = set(expected) - {"required", "required_any", "forbidden", "must_report", "must_not_raise"}
if unknown:
    return False, f"unknown findings keys: {sorted(unknown)}"

and add a test row with a misspelled key.

"hashlib.md5 is cryptographically broken" contains no standalone
"hash". Word-boundary matching keeps "md5sum" from tripping it.
- file: src/orders/receipts.py
match: "subprocess"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: 021's PR body claims a bundled pdftemplate CLI that is not in the fixture, and the subprocess anchor both misses real false positives and can flag a correct finding

input.yaml:13 says render_receipt_pdf "shells out to the bundled pdftemplate CLI", but eval/review/repos/webapp contains no pdftemplate (the tree has only README, docs/api.md, requirements.txt and three .py files). eval/README.md requires everything a PR refers to to exist in the fixture repo; lint-cases.sh does not check binaries.

Two failure modes follow:

  • A true finding fails the case. A careful reviewer can correctly report that pdftemplate is not bundled anywhere, so the call raises FileNotFoundError and the PR body's claim is false. If rated high and naming subprocess.run, that true finding trips must_not_raise {match: subprocess}.
  • A real false positive passes. A high finding categorised injection-vuln that says "user input reaches the shell" never uses the word "subprocess", so it is not caught.

Suggestion: Add a stub pdftemplate (e.g. bin/pdftemplate) to the webapp fixture so the PR body is true. Then anchor the bait on the file rather than one word: a single must_not_raise {file: src/orders/receipts.py, min_severity: high} with no match, because the file holds only the two bait functions. Or match the injection claim itself (injection | shell | arbitrary command | subprocess).

parameterized form it replaced. order_id flows in unsanitized —
classic SQL injection. Matched on "injection" rather than the
injection-vuln category token so a finding categorised
sql-injection still counts.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: The annotation and tests treat categories as free-form, but the schema enum and post-review accept only fixed values

This annotation says matching on "injection" means "a finding categorised sql-injection still counts", and the PR body calls categories free-form kebab-case. But schemas/review-result.schema.json $defs.finding.category is a closed enum, and post-review.src.sh builds the review-findings-v2 marker only from findings that pass allowed_category.

sql-injection, sql-query, weak-crypto, perf and auth are all outside that list. Production can never produce the marker states that the new rows in eval/scripts/finding-expectations-test.sh use for these categories (the SQLI, MD5_NOTE, md5sum, rehash and Remediation rows).

Matching on bullet text is still the right design, but for a different reason: the enum has no value for a specific weak primitive such as timing or md5.

Suggestion: Switch the test fixtures to enum categories: injection-vuln or logic-error for SQLI, secret-exposure or auth-bypass for the md5 and timing notes, logic-error for perf. Reword this annotation and the PR body to give the real reason for text matching.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/elevated PR risk: elevated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants