feat(risk): add PR risk assessment scoring to review pipeline - #861
Conversation
|
🤖 Review · Commit: |
PR Summary by QodoAdd composite PR risk scoring to the review pipeline
AI Description
Diagram
High-Level Assessment
Files changed (16)
|
c848b26 to
d2f4860
Compare
|
🤖 Finished Review · ✅ Success · Started 8:19 AM UTC · Completed 8:41 AM UTC Commit: |
Code Review by Qodo
1. Empty flag enables assessment
|
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsMedium
Low
Next steps:
Previous run (3)ReviewFindingsMedium
Low
Next steps:
Previous run (4)ReviewFindingsMedium
Low
Previous run (5)ReviewFindingsMedium
Low
Previous run (6)ReviewFindingsMedium
Low
Previous run (7)ReviewFindingsMedium
Low
Previous run (8)ReviewFindingsMedium
Low
Previous run (9)ReviewFindingsMedium
Low
Previous run (10)ReviewFindingsMedium
Low
Previous run (11)ReviewFindingsMedium
Low
Previous run (12)ReviewFindingsMedium
Low
Previous run (13)ReviewFindingsMedium
Low
Previous run (14)ReviewFindingsHigh
Medium
Low
Next steps:
Previous run (15)ReviewFindingsMedium
Low
Next steps:
Previous run (16)ReviewFindingsHigh
Medium
Low
Info
Next steps:
Previous run (17)ReviewFindingsMedium
Low
Info
Previous run (18)ReviewFindingsMedium
Low
Labels: PR adds risk assessment feature to the review pipeline, modifying review agent components Next steps:
|
waynesun09
left a comment
There was a problem hiding this comment.
Review sweep — risk assessment pipeline
Review-only pass. 8 findings are posted inline below; 2 more could not be anchored to a line in this diff and are recorded here.
MEDIUM — scripts/risk-tier1-test.sh is not wired into CI (Makefile:43, not in this diff)
Verified at head: the script-test target (Makefile lines 43–65) enumerates every test script explicitly — bundle-sh-test.sh, post-review-test.sh, pre-review-test.sh, validate-output-schema-test.sh, etc. — with no globbing. scripts/risk-tier1-test.sh is not in the list, so .github/workflows/script-test.yml never executes it. The test plan claims "bash scripts/risk-tier1-test.sh — 30 unit tests pass", but that only happens when a human runs it locally; regressions in the new risk logic will not be caught in CI.
Suggestion: Add $(call run-timed,bash scripts/risk-tier1-test.sh) to the script-test target, and consider chmod +x on the new script and test to match the 100755 mode used by the other scripts in scripts/.
MEDIUM — premature-decision: PR closes #4698 while shipping a strict subset, and the description misstates where the feature flag lives (PR-level)
Verified against the issue and the diff.
(a) The PR body's changes table says the feature flag lives in env/review.env "with shell defaulting" — env/review.env does not exist in this repo at all (ls env/ → gcp-vertex.env, github, gitlab, ssl-cainfo.env), the file is not in the 16-file diff, and grep -rn FULLSEND_RISK_ASSESSMENT_ENABLED finds it only as a hardcoded literal at harness/review.yaml:57 plus prose in skills/pr-review/SKILL.md. There is no ${VAR:-true} anywhere, so the "default true" documented at SKILL.md:563 is a harness literal, not a default.
(b) Closes fullsend-ai/fullsend#4698 auto-closes cross-repo on merge, but the issue asks the score to "Inform review effort: model selection (sonnet vs opus), sub-agent count, and whether human approval is required" and to "Gate auto-merge eligibility: only low-risk PRs qualify", while this PR states "Score is purely informational — does not gate the review outcome". The issue's Architecture recommendation is phase 1 "Tier 1 signals computed in pre-review.sh with no LLM cost", whereas this runs the script inside an LLM sub-agent that also performs the weighted arithmetic. The issue's taxonomy is 1–2 low / 3 medium / 4 high / 5 critical vs the shipped low/moderate/elevated/high/critical, and the issue's path-sensitivity dimension names .pem and .key, which are absent from SECURITY_PATTERNS.
(c) Both end-to-end test-plan boxes ("Run review eval cases", "Manual test: trigger review on a test PR") are unchecked — a single live run would have surfaced the unregistered skill and the depth-1 git history immediately.
Suggestion: Change Closes fullsend-ai/fullsend#4698 to Part of fullsend-ai/fullsend#4698 and add a short "Deviations from the issue" section covering the informational-only scope, the sub-agent-vs-pre-review placement, the level-taxonomy rename, and the dropped .pem/.key patterns, so the remaining phases stay tracked. Correct the changes table to point at harness/review.yaml and drop the "shell defaulting" claim (or implement a real default). Run the two eval cases and one live PR before merge and check the boxes, or mark the PR draft.
Note: the harness/review.yaml comment is anchored on the only changed line in that file; the defect is in the skills: list near line 17.
|
Addressed in b461fe4:
The pagination (>100 files) and path matching refinements are consistent with existing codebase patterns and will be addressed in follow-up work. |
|
🤖 Finished Review · ✅ Success · Started 3:48 PM UTC · Completed 4:07 PM UTC Commit: |
Superseded by updated review
b461fe4 to
bd98ef7
Compare
|
🤖 Finished Review · ✅ Success · Started 4:24 PM UTC · Completed 4:42 PM UTC Commit: |
waynesun09
left a comment
There was a problem hiding this comment.
Review-only sweep (additional pass). 3 findings below; 3 others from this batch were already covered by existing review comments/threads and were skipped as duplicates.
bd98ef7 to
1d69b2c
Compare
|
🤖 Review · Commit: |
1d69b2c to
ec0580f
Compare
|
🤖 Finished Review · ✅ Success · Started 9:45 AM UTC · Completed 10:06 AM UTC Commit: |
ec0580f to
3b315df
Compare
|
🤖 Finished Review · ✅ Success · Started 2:06 PM UTC · Completed 2:28 PM UTC Commit: |
waynesun09
left a comment
There was a problem hiding this comment.
Additional review-only findings (scoring formula and risk-assessment skill design), verified and deduplicated against existing comments on this PR.
Extract remove_stale_risk_labels() helper to deduplicate risk-label removal loops, fix return→exit 0 in pagination test stub, and add array-type guard for gh API edge case in risk-tier1.sh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Marta Anon <manon@redhat.com>
- Add FIRST_TIME_CONTRIBUTOR e2e test coverage (pagination test) - Add *.spec.* to test-file glob patterns with unit test - Specify explicit weight-redistribution percentages for all degenerate tier combinations in SKILL.md - Align protected-path matching to prefix semantics (matches post-review) - Make REVIEW_GIT_FETCH_DEPTH conditional on risk assessment enablement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Marta Anon <manon@redhat.com>
e17e22d to
77b8d15
Compare
|
🤖 Finished Review · ✅ Success · Started 8:02 AM UTC · Completed 8:22 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.51 |
…ocs wording The pre-script runs on the runner and checks REVIEW_RISK_ASSESSMENT_ENABLED to auto-default REVIEW_GIT_FETCH_DEPTH. Without the variable in env.runner, clone deepening never triggers in pipeline runs. Also fix "either variable" wording in docs to "any variable" since the table now has six entries. Signed-off-by: Marta Anon <maruiz93@users.noreply.github.com> Signed-off-by: Marta Anon <manon@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 8:28 AM UTC · Completed 8:46 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $6.59 |
Superseded by updated review
waynesun09
left a comment
There was a problem hiding this comment.
Re-verified at head 1daa21d (local checkout, all prior rounds cross-checked against the code, not the reply text). Everything I raised earlier is confirmed fixed or explicitly deferred (#922):
scripts/risk-tier1-test.shsources the shipped script; e2e stubsghand runsmain✔ ·post-review-test.sh17 distinct risk cases ✔ ·pre-review-test.sh✔ · bundles regenerate byte-identical from.src.sh✔functional-tests (review)on this head: the Tier 1 script demonstrably ran inside the sandbox for all three cases (full 10-signal block in the transcripts —FILES_CHANGED=2/3/1,SECURITY_SENSITIVE_COUNT=2for 002) and real labels landed (risk/lowon 001,risk/moderateon 002). All six judges pass, includingrisk_label_present.- Empirically checked
git fetch --unshallow <url>on a depth-1 SHA checkout: HEAD's history goes 1 → 1165 commits and per-filegit logworks, so Tier 2 is viable.FETCH_HEADis anonymized by git (no token recorded). - The bot's "duplicate truncated test names" finding is a display-masking artifact (#462) — names are unique.
One thing holds my approval (inline on harness/review.yaml): REVIEW_RISK_ASSESSMENT_ENABLED: "true" lives in the top-level env: block, so it is on for GitLab too — contrary to the resolved-thread reply that it is "only set in the GitHub forge section". On a GitLab MR the sub-agent still runs: Tier 1 is all UNKNOWN (no gh/GH_TOKEN), the clone is never deepened (FULLSEND_FORGE != github → Tier 2 unavailable), and SKILL.md's fallback ("all absent → Tier 1 = 3") yields a fabricated risk/elevated label on every MR, while the sticky comment silently fails (fullsend post-comment is GitHub-only). Moving the two keys under forge.github.env makes the deferral to #922 true. I'll approve as soon as that lands.
Known limitation to keep on record (not blocking): both new eval cases still exit 1 at this head — the fixture PR is authored by the reviewing account, and both agents chose request-changes, so the 422 fires regardless of the CODEOWNERS/protected-path downgrade (which only converts approve → comment). Run-level exit is noise; the judges are the real gate, and risk_label_present closes the "no-op passes" hole.
Nits (take or leave):
scripts/validate-output-schema-test.shhas norisk_assessmentcases — the fiveallOfscore↔levelif/thenblocks are untested.agents/review.mdfrontmatterskills:doesn't listpr-risk-assessment(the harnessskills:array is what actually uploads, so this is documentation drift).pre-review.src.shcould keep the token out of argv withgit -c http.extraheader="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$GH_TOKEN" | base64 -w0)" fetch --unshallow origin— FETCH_HEAD is already clean, so this is optional.
Second-opinion pass (Grok) was run on this head; its other findings were checked and refuted against the code: post-scripts only run after schema validation passes (ADR 0022), so a non-string rationale cannot reach the jq slice; and risk_assessment did reach agent-result.json in every eval case.
Move REVIEW_RISK_ASSESSMENT_ENABLED from the top-level env block (which applies to all forges) to forge.github.env.runner and forge.github.env.sandbox. On GitLab, risk-tier1.sh depends on the GitHub API and would produce fabricated scores. Signed-off-by: Marta Anon <manon@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Marta Anon <manon@redhat.com>
|
🤖 Review · Commit: |
- Add 10 risk_assessment test cases to validate-output-schema-test.sh covering all five score↔level allOf constraints plus mismatches, missing rationale, out-of-range score, and additional properties. - Add pr-risk-assessment to agents/review.md frontmatter skills list to match harness/review.yaml. - Pass GH_TOKEN via http.extraheader instead of URL in pre-review.src.sh to keep the token out of /proc/*/cmdline. Signed-off-by: Marta Anon <manon@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Marta Anon <manon@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 4:44 PM UTC · Completed 5:12 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $9.91 |
waynesun09
left a comment
There was a problem hiding this comment.
Approving at head e686204.
Re-verified the two follow-up commits:
e8ae971—REVIEW_RISK_ASSESSMENT_ENABLEDnow lives only underforge.github.env.runner/forge.github.env.sandbox; the top-levelenv:no longer carries it, so GitLab MRs don't run the pre-pass until #922 adds a path. Resolves my one blocking thread.e686204— schema tests now cover the fiveallOfscore↔level pairs plus mismatches, missingrationale, and out-of-range score (script-testgreen in CI, which hasjsonschema);agents/review.mdfrontmatter listspr-risk-assessment; the unshallow fetch useshttp.extraheader(actions/checkout's pattern) so the token is out of argv. I ran that exact command shape locally on a depth-1 SHA checkout: HEAD history 1 → 1167 commits, nothing persisted inFETCH_HEAD/config. Runner default isubuntu-24.04, sobase64 -w0is safe.
Local: risk-tier1-test, pre-review-test, post-review-test all pass; both bundles regenerate byte-identical. Prior-head eval run already proved the sub-agent → Tier 1 script → label path end-to-end; these commits don't touch that path (the eval harness never reaches the deepening branch, hence the local check above).
Known/accepted: eval cases 001/002 exit 1 on the self-review 422 (judges gate); GitLab risk path deferred to #922.
|
🤖 Finished Retro · ✅ Success · Started 5:39 PM UTC · Completed 5:53 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.61 |
Retro: PR #861 — feat(risk): add PR risk assessment scoring to review pipelineTimeline: Aug 18–25 (8 days), 17 commits, merged by author maruiz93. Review participants: Human reviewer waynesun09 (7 rounds, ~40 unique findings), fullsend-ai-review (~35 status comments + ~30 inline findings), qodo-code-review (13 inline findings on initial commit). Review quality deltaThe human reviewer caught 4 CRITICAL and 4 HIGH-severity issues that both automated reviewers missed entirely:
All missed findings share a common trait: they require reasoning about how code is built, deployed, and executed — not just what the code says. The review agent excels at single-file code correctness, pattern-matching for known vulnerability categories, and severity calibration. It struggles with build-artifact provenance, CI environment modeling, and mathematical verification of test expectations. What worked well
Cancelled run waste17 of 36 review runs were cancelled (47%), wasting an estimated 88+ minutes of agent compute. The worst episode was 11 consecutive cancellations in 75 minutes on Aug 21 during a rapid fix-push cycle. This is additional evidence for existing debounce issues: fullsend-ai/fullsend#4960, fullsend-ai/fullsend#1014, fullsend-ai/fullsend#4069. Issue fullsend-ai/fullsend#6573 (debounce during rapid human pushes) was closed on Aug 24, suggesting active progress. Repeated false positivefullsend-ai-review flagged "truncated test names with ellipsis" 4 separate times across different review runs. The author explained this is a context-packaging artifact (tracked in agents#462), not actual truncation. Existing issue evidence
Proposals filed
|
Summary
risk/*labels (with traffic-light colors) and a sticky PR commentREVIEW_RISK_ASSESSMENT_ENABLEDenv var (defaulttruein harness)Changes
skills/pr-risk-assessment/scripts/risk-tier1.shskills/pr-risk-assessment/SKILL.mdskills/pr-review/sub-agents/risk-assessment.mdskills/pr-review/SKILL.mdschemas/review-result.schema.jsonrisk_assessmentfield withrisk_signaldefscripts/post-review.shharness/review.yaml,scripts/pre-review.src.shREVIEW_RISK_ASSESSMENT_ENABLEDin harness sandbox env;REVIEW_GIT_FETCH_DEPTHauto-defaults to"0"when enabledscripts/risk-tier1-test.shscripts/post-review-test.sheval/review/cases/001-risk-low-typo-fix/,002-risk-high-auth-change/docs/review.mdREVIEW_RISK_ASSESSMENT_ENABLEDandREVIEW_GIT_FETCH_DEPTHvariablesDeviations from issue #4698
pre-review.sh); aligns with the orchestrator's skill-dispatch modellow/moderate/elevated/high/critical(5 levels) vs issue'slow/medium/high/critical(4 levels)security-triage.md(e.g.,auth/,rbac/,token/);.pem/.keyextension patterns deferredPart of fullsend-ai/fullsend#4698
Test plan
bash scripts/risk-tier1-test.sh— 30 unit tests passbash scripts/post-review-test.sh— 63 tests pass (6 new risk tests)bash scripts/validate-output-schema-test.sh— 46 schema tests pass001-risk-low-typo-fix,002-risk-high-auth-change)🤖 Generated with Claude Code