Skip to content

feat(review): let a risk score of 1 narrow the dispatch behind an opt-in flag - #1246

Draft
guyoron1 wants to merge 2 commits into
fullsend-ai:mainfrom
guyoron1:feat/review-risk-routing
Draft

feat(review): let a risk score of 1 narrow the dispatch behind an opt-in flag#1246
guyoron1 wants to merge 2 commits into
fullsend-ai:mainfrom
guyoron1:feat/review-risk-routing

Conversation

@guyoron1

Copy link
Copy Markdown

Stacked on #1245 (its commit is the first on this branch; review only the top commit).

ADR 0089 / #861 compute the composite risk score and leave acting on it for later. This is the smallest later: REVIEW_RISK_ROUTING_ENABLED (default "false"). When on, risk-assessment runs first instead of in the step-4 batch, and a score of exactly 1 with no degraded marker narrows the dispatch to correctness and security (intent-coherence, docs-currency, style-conventions, cross-repo-contracts are skipped; security-triage and challenger untouched). No model is changed anywhere — models are owned by the consuming repo's .fullsend/config.yaml since fullsend-ai/fullsend#7116 — and the orchestrator's own model is never touched. Any other score, a missing or unparseable score, or degraded present → the full selection (fail open).

Routing keys on the composite rather than tier 1 because, over the 246 production PRs that carry both a risk comment and a review (fullsend-ai/fullsend#4698), composite == 1 had 0/53 with a major or critical finding while a tier-1-only gate would have narrowed 6/104 that did. Draft until Marta has looked at the numbers; the paired cheaper-model comparison is still to run.

Refs fullsend-ai/fullsend#4698.

@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.

…grade instead of drop, keep history

ADR 0089 leaves tier 1 to a bash script but has the sub-agent re-emit it,
which is how the same PR scored 1, 2, 1 across three re-reviews (fullsend-ai#1037).
risk-tier1.sh now ends with TIER1_SCORE and RISK_FLOOR — the SKILL.md
table computed once, deterministically — and the sub-agent copies them
into tier1_score / risk_floor instead of re-deriving.

RISK_FLOOR is 2 whenever a security-sensitive path is touched.
post-review.sh enforces it from the echoed field, so risk/low cannot be
applied to a security PR whatever the LLM returned. Over the 246
production PRs measured on fullsend#4698, no score-1 PR touched such a
path, so the floor changes nothing today and closes the gap for later.

When the sub-agent fails, the orchestrator no longer drops the score: it
runs the script itself and emits max(round(TIER1_SCORE), RISK_FLOOR) with
degraded: "tier1-only". Four production reviews since 08-25 lost their
score to "claude-sonnet-4-5@20250929 is not available" (the error behind
fullsend#6922, visible from 08-25); consumers must treat degraded as no
score.

The sticky risk comment now carries the tier 1 value, the degraded
marker, and a per-head-SHA history table carried forward from the prior
comment (GitHub only, 20 rows, rows re-admitted only when they match the
exact shape this script writes), so drift across re-reviews is visible
on the PR instead of only in run artifacts.

Tests: risk-tier1-test.sh covers score_tier1, _score_size,
has_source_files, risk_floor and both e2e fixtures; post-review-test.sh
covers floor raises/never lowers, degraded header, history row,
garbage provenance dropped, and legacy results unchanged. Baseline
ceilings for the two SKILL.md files bumped for the added prose.

Refs fullsend-ai#1037, fullsend-ai/fullsend#4698

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

ADR 0089 / fullsend-ai#861 compute the composite risk score and leave acting on it
for later. This is the smallest later: REVIEW_RISK_ROUTING_ENABLED
(default "false"). When on, risk-assessment runs first instead of in the
step-4 batch, and a composite score of exactly 1 keeps only correctness
and security, dropping intent-coherence, docs-currency,
style-conventions and cross-repo-contracts. No model changes anywhere:
since fullsend#7116 models are owned by the consuming repo's
.fullsend/config.yaml, and the orchestrator's own model is never
touched. A missing or unparseable score, or one marked degraded
("tier1-only", the orchestrator's fallback when the sub-agent failed),
fails open and leaves the full review in place.

Routing keys on the composite rather than on tier 1 alone because, over
the 246 production PRs that carry both a risk comment and a review,
composite == 1 had 0/53 with a major or critical finding while a
tier-1-only gate would have narrowed 6/104 that did. The pre-pass
latency is the price of that.

Bumps the pr-review context-budget ceiling for the added text.

Refs fullsend-ai/fullsend#4698

Signed-off-by: guy oron <goron@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant