Skip to content

fix(review): gate re-review severity transitions - #1636

Merged
waynesun09 merged 10 commits into
fullsend-ai:mainfrom
csoceanu:codex/aisdlc-118/rereview-severity-gate
Oct 12, 2026
Merged

waynesun09 merged 10 commits into
fullsend-ai:mainfrom
csoceanu:codex/aisdlc-118/rereview-severity-gate

Conversation

@csoceanu

@csoceanu csoceanu commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR implements Workstream B from AISDLC-118 - Re-review Severity Gating.

It reduces re-review noise while preserving actionable findings and safety controls.

Scope

  • New low/info findings do not trigger request-changes or start fix-agent loops during re-review.
  • Prior blocking findings remain protected until dispositioned.
  • Actionable prior medium findings remain blocking; advisory mediums remain advisory.
  • Stricter configured severity thresholds are preserved.
  • The global REVIEW_FINDING_SEVERITY_THRESHOLD default is unchanged.
  • Prior reject and legacy review states require human review before approval.
  • Protected-path and risk-assessment gates continue to apply to approval promotion.
  • Manual-judgment and risk-gated comments remain COMMENT.

Finding ledger

  • Carries stable finding IDs and dispositions across review rounds.
  • Preserves prior severity, category, and actionable state when findings remain open.
  • Keeps the review-findings-v2 marker metadata-only.
  • Does not store prior descriptions or remediation text in the ledger.
  • Adds structured blocker context with finding ID, severity, category, and file/line.
  • Links carried blockers to their original inline review comments when available.
  • Preserves the human-readable review body when severity filtering removes structured findings.

Ticket alignment

This implements the re-review behavior described in agents#1208 and delivers the Workstream B portion of AISDLC-118.

Validation

  • bash scripts/post-review-test.sh
  • make check-bundle
  • pre-commit run --all-files
  • Shell syntax checks
  • git diff --check

All checks pass.

@csoceanu
csoceanu requested a review from a team October 8, 2026 13:31
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Functional tests are running

Authorization passed for this commit. See the Functional Tests workflow for results.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Gate re-review verdicts by severity and prior findings

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Prevent new low/info findings from blocking verified re-reviews or starting fix runs.
• Keep unresolved prior medium-or-higher findings blocking; preserve configured thresholds and
 approval safety gates.
• Carry review actions through the findings ledger and test verdict, filtering, and failure cases.
Diagram

graph TD
  A["Agent review"] --> B["Prior ledger"] --> C["Severity filter"] --> D{"Medium+ open?"}
  D -- "No" --> E{"Approval gates pass?"} --> F["Posted verdict"] --> G["Next projection"]
  D -- "Yes: block" --> F
  G -. "Next re-review" .-> B
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Centralize verdict policy
  • ➕ Could make interactions among severity, ledger, and safety decisions easier to audit.
  • ➖ Would require a broader refactor of established post-review gates, increasing regression risk and scope.

Recommendation: Keep this scoped change within the existing post-review pipeline and findings projection. A unified policy function may be worthwhile later, but refactoring the safety gates alongside this behavior fix would make the transition harder to validate.

Files changed (8) +456 / -10

Bug fix (4) +236 / -8
post-review.shGate posted re-review actions and carry them forward +114/-2

Gate posted re-review actions and carry them forward

• The generated post-review script applies a temporary medium floor after prior approval, rebuilds the posted body from retained findings, and considers prior dispositions before promoting or blocking a verdict. It runs approval safety checks for promotion candidates and includes the effective action in the next findings projection.

scripts/post-review.sh

post-review.src.shImplement re-review severity and safety decisions +114/-2

Implement re-review severity and safety decisions

• Adds the source logic for prior-action handling, effective severity filtering, body normalization, ledger-based verdict transitions, and protected-path and risk checks for potential approvals. Persists the final action in the review-findings-v2 projection.

scripts/post-review.src.sh

pre-review.shAccept validated actions in prior-review projections +4/-2

Accept validated actions in prior-review projections

• The generated pre-review script permits supported action values in a prior projection and carries a validated action into the recovered ledger.

scripts/pre-review.sh

pre-review.src.shPreserve prior verdicts during projection recovery +4/-2

Preserve prior verdicts during projection recovery

• Extends projection validation to reject unsupported action values and retain supported ones when reconstructing the prior-review ledger.

scripts/pre-review.src.sh

Tests (2) +204 / -2
post-review-test.shExercise re-review verdict and projection edge cases +194/-2

Exercise re-review verdict and projection edge cases

• Adds full post-script cases for prior blockers, low-only promotion, stricter thresholds, filtered review bodies, failure preservation, and protected-path and risk gates. Extends projection assertions to cover the effective action.

scripts/post-review-test.sh

pre-review-test.shTest recovery and validation of prior actions +10/-0

Test recovery and validation of prior actions

• Verifies that an approved empty projection retains its action and that a projection with an invalid action is rejected.

scripts/pre-review-test.sh

Documentation (2) +16 / -0
review.mdDefine re-review severity behavior for the review agent +9/-0

Define re-review severity behavior for the review agent

• Documents that new low/info findings do not block verified re-reviews, while unresolved prior medium-or-higher findings do. Explains the temporary post-approval floor without changing the global threshold.

agents/review.md

review.mdDocument host-side re-review verdict rules +7/-0

Document host-side re-review verdict rules

• Describes low/info suppression after approval, continued blocking by unresolved prior findings, and preservation of the configured severity threshold.

docs/review.md

@qodo-code-review

qodo-code-review Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Hidden medium findings force fix runs under a high threshold ✓ Resolved
Description
PRIOR_MEDIUM_PLUS_OPEN_COUNT counts every open prior medium+ row in PRIOR_LEDGER. The projection
writes that ledger from the unfiltered result, so it includes medium findings that a stricter
REVIEW_FINDING_SEVERITY_THRESHOLD (high/critical) dropped from the posted review. On the next
re-review, the new elif branch then turns a comment into request-changes and adds the fix
footer. The author gets a blocking review and a fix run for findings that were never posted, and the
posted review may contain no findings at all.
Code

scripts/post-review.src.sh[R981-985]

+  elif [[ "${ACTION}" = "approve" || "${ACTION}" = "comment" ]] \
+      && [[ "${PRIOR_MEDIUM_PLUS_OPEN_COUNT}" -gt 0 ]] \
+      && { [[ "${DOWNGRADED}" = "false" ]] \
+        || [[ "${REREVIEW_SAFETY_CANDIDATE}" = "true" ]] \
+        || { [[ "${REREVIEW_ORIGINAL_ACTION}" = "approve" ]] && [[ -z "${BLOCKING_IDS}" ]]; }; }; then
Relevance

●●● Strong

Ledger counts ignore configured thresholds, directly violating the documented promise that stricter
thresholds remain effective.

PR-#1049
PR-#1232

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The projection takes $ledger_findings from $unfiltered[0].findings, so medium rows below a
high threshold are stored as open ids. The severity filter (lines 285-326) only removes them from
the posted result and downgrades the verdict to comment. On the next run, the new count at lines
955-960 reads PRIOR_LEDGER without checking the user's threshold, and lines 981-999 then force
request-changes plus the /fs-fix footer. This contradicts the PR's stated promise that stricter
user-configured thresholds are preserved.

scripts/post-review.src.sh[1050-1055]
scripts/post-review.src.sh[301-322]
scripts/post-review.src.sh[955-999]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The re-review gate counts prior open medium+ findings even when the user's `REVIEW_FINDING_SEVERITY_THRESHOLD` is high or critical. Those findings were filtered out of the posted review but still recorded in the ledger. As a result, a later re-review forces `request-changes` and starts a fix run for findings the author never saw.

## Fix Focus Areas
- scripts/post-review.src.sh[955-961]
- scripts/post-review.src.sh[981-1000]
- scripts/post-review.sh[1664-1710]

## Recommended Fix
Only count a prior finding as blocking when its severity rank is at least `max(medium, configured threshold)`. For example, pass `threshold_rank` into the jq and add a `select(rank(.severity) >= max(2; $threshold_rank))` filter. Regenerate the bundled `post-review.sh`. Add a test with `REVIEW_FINDING_SEVERITY_THRESHOLD=high` and a prior open medium finding, and assert that the verdict stays `comment`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Actionable low fixes get approved ✓ Resolved
Description
The re-review promotion checks severity counts but leaves actionable: true and a non-empty
remediation on low findings that remain in the posted result. With a prior non-approved ledger and
a low-threshold re-review, a request-changes result containing such a finding becomes approve,
and the fix agent is not triggered.
Code

scripts/post-review.src.sh[R964-968]

+  if [[ ( "${ACTION}" = "request-changes" || "${ACTION}" = "reject" ) \
+      || ( "${ACTION}" = "comment" && "${PRIOR_ACTION}" = "approve" && "${DOWNGRADED}" = "false" ) ]] \
+      && [[ "${PRIOR_MEDIUM_PLUS_OPEN_COUNT}" -eq 0 ]] \
+      && [[ "${CURRENT_MEDIUM_PLUS_COUNT}" -eq 0 ]] \
+      && [[ "${DOWNGRADED}" = "false" ]]; then
Relevance

●●● Strong

Actionable findings with remediation are established blockers regardless of severity, including low
findings.

PR-#1049

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The rule requires an actionable finding with remediation to block approval. The new gate checks only
prior and current medium-or-higher counts before assigning approve; the schema permits low
findings with both actionable and remediation fields.

scripts/post-review.src.sh[963-980]
schemas/review-result.schema.json[116-130]
Skill: pr-review

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A low finding with `actionable: true` and non-empty `remediation` can remain posted while the re-review gate changes `request-changes` to `approve`.

## Fix Focus Areas
- scripts/post-review.src.sh[963-980]
- scripts/post-review-test.sh[1825-1841]

## Recommended Fix
Before promotion, make newly reported low/info findings non-actionable in the posted result if they are intended as suggestions; otherwise retain `request-changes` for any finding that remains actionable with remediation. Add a regression test that checks both the posted finding and action.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Open blockers produce invalid reviews ✓ Resolved
Description
The re-review gate changes an approve or comment result to request-changes when a prior
medium-or-higher finding remains open, but it does not add the findings array required for that
action. This occurs when the current review has no findings, or severity filtering removes them all,
leaving the posted result outside the review-result schema while the prior blocker exists only in
the ledger marker.
Code

scripts/post-review.src.sh[R995-997]

+    jq --arg notice "${REREVIEW_NOTICE}" --arg footer "${REREVIEW_FOOTER}" \
+      '.action = "request-changes" | .body = ((.body // "") + $notice + $footer)' \
+      "${RESULT_FILE}" > "${REREVIEW_RESULT}"
Relevance

●●● Strong

Converting approval to request-changes without findings violates the schema and can produce an
invalid posted review.

PR-#1608
PR-#1232

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The filter deletes an emptied findings array; the new gate can subsequently set request-changes
without restoring it. The schema requires a nonempty findings array for that action, and the
projection stores prior findings in a body marker rather than in the result's findings array.

scripts/post-review.src.sh[306-320]
scripts/post-review.src.sh[981-1000]
schemas/review-result.schema.json[20-24]
schemas/review-result.schema.json[81-92]
scripts/post-review.src.sh[1103-1121]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Promoting a re-review to request-changes can leave it without the findings required by the review-result schema.

## Fix Focus Areas
- scripts/post-review.src.sh[981-1000]
- schemas/review-result.schema.json[20-24]
- schemas/review-result.schema.json[81-92]

## Recommended Fix
When promoting for an open prior blocker, populate a nonempty, schema-valid findings array representing the blocking prior findings. Add a regression case with an open prior medium finding and no current findings.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (1)
4. New high findings can be approved ✓ Resolved
Description
The re-review gate uses CURRENT_MEDIUM_PLUS_COUNT to prevent promotion of a non-approval, but its
branch for an existing approve checks only open prior findings. If an agent returns approve with
a new high finding after a prior approval, the finding survives the severity floor while the
approval proceeds to posting.
Code

scripts/post-review.src.sh[R981-983]

+  elif [[ "${ACTION}" = "approve" || "${ACTION}" = "comment" ]] \
+      && [[ "${PRIOR_MEDIUM_PLUS_OPEN_COUNT}" -gt 0 ]] \
+      && { [[ "${DOWNGRADED}" = "false" ]] \
Relevance

●●● Strong

Approval must not proceed while newly reported high findings remain; current gating only limits
promotion paths.

PR-#1608

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The rule forbids approval with a high finding. The new current-severity count only limits promotion,
while the later approval branch responds to open prior findings rather than new high findings; the
approved-prior severity floor retains high findings.

scripts/post-review.src.sh[274-283]
scripts/post-review.src.sh[357-366]
scripts/post-review.src.sh[963-1000]
Skill: pr-review

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
An already-approved agent result can bypass the new re-review severity check despite containing a new high finding.

## Fix Focus Areas
- scripts/post-review.src.sh[955-1000]
- scripts/post-review-test.sh[1862-1871]

## Recommended Fix
Before posting a re-review approval, check retained current high and critical findings and change the action to `request-changes` when any exist. Add a test with an approved prior ledger and a current `approve` result containing a new high finding.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

5. Severity audits miss high findings ✓ Resolved
Description
After a prior approval, finding_line rewrites retained findings as - **high** ..., while
autonomy-analysis recognizes severity only in #### High-style headings. If such a review receives
a non-blocking verdict, its mismatch checker can miss a high or critical finding and report no
verdict mismatch.
Code

scripts/post-review.src.sh[337]

+      "- **\(.severity)** \(.category) in \(.file // "PR-level")"
Relevance

●●● Strong

Rewritten inline severities conflict with downstream heading-only parsing and can hide high-severity
mismatches.

PR-#1608

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR replaces the posted body with bold inline severities. Autonomy-analysis extracts severities
exclusively from Markdown level-four headings and uses that extracted set to detect non-blocking
verdict mismatches.

agents -> autonomy-analysis
scripts/post-review.src.sh[328-348]
External repo: fullsend-ai/autonomy-analysis, skills/audit-pr-review-gap/scripts/check-verdict-mismatch.py [30-47]
External repo: fullsend-ai/autonomy-analysis, skills/audit-pr-review-gap/scripts/check-verdict-mismatch.py [60-66]
External repo: fullsend-ai/autonomy-analysis, skills/audit-pr-review-gap/scripts/check-verdict-mismatch.py [103-116]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Rewritten review bodies use a severity format the autonomy-analysis verdict-mismatch checker cannot recognize.
## Fix Focus Areas
- scripts/post-review.src.sh[335-345]
- skills/audit-pr-review-gap/scripts/check-verdict-mismatch.py[32-66]
## Recommended Fix
Render retained findings with the established `#### High`-style severity headings in agents, or coordinate an autonomy-analysis parser update that recognizes the new format. Add a cross-repo regression case for a high finding in a rewritten, non-blocking review.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Blocking re-reviews are lost when the PR file list fails to load ✓ Resolved
Description
On re-reviews with no current medium+ findings, the safety-candidate block now temporarily sets
ACTION="approve" for every request-changes/reject result, and also for comment after a prior
approval. That sends the result through the protected-path check, which exit 1s when
forge_get_pr_files fails or returns nothing twice, or when REVIEW_PROTECTED_PATHS is unset.
Before this change those results never fetched PR files, so a transient forge error now drops the
whole review without posting it. That includes cases where the ledger would have kept
request-changes because a prior medium finding is still open, and in those cases no fix run is
triggered.
Code

scripts/post-review.src.sh[R360-366]

+if [[ "${HAS_VALID_PRIOR_REVIEW}" = "true" ]] \
+    && [[ "${REREVIEW_CURRENT_MEDIUM_PLUS_COUNT}" -eq 0 ]] \
+    && [[ "${ACTION}" = "request-changes" || "${ACTION}" = "reject" || \
+         ( "${ACTION}" = "comment" && "${PRIOR_ACTION}" = "approve" ) ]]; then
+  REREVIEW_SAFETY_CANDIDATE=true
+  ACTION="approve"
+fi
Relevance

●●● Strong

Promotion now exposes transient file-list failures; prior precedent explicitly fixed this approval
reliability regression.

PR-#1196

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Lines 360-366 set ACTION=approve before the ledger decision. The protected-path block at line 375
runs only for approve. It calls forge_get_pr_files, retries once after sleep 10, and then does
exit 1 with "refusing to approve" before anything is posted. The candidate is chosen without
looking at prior open medium findings, so reviews that end up as request-changes take this path
too.

scripts/post-review.src.sh[375-381]
scripts/post-review.src.sh[418-442]
scripts/post-review.src.sh[627-633]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The temporary `ACTION=approve` used for the re-review safety candidate sends non-approval results through the protected-path gate. That gate exits the script when PR files cannot be fetched, so blocking reviews are never posted.

## Fix Focus Areas
- scripts/post-review.src.sh[357-366]
- scripts/post-review.src.sh[418-442]
- scripts/post-review.src.sh[627-633]

## Recommended Fix
When `REREVIEW_SAFETY_CANDIDATE=true` and the PR-files fetch fails (or the protected-paths config is missing), do not `exit 1`. Mark promotion as disallowed instead, for example `DOWNGRADED=true`, or restore `REREVIEW_ORIGINAL_ACTION` and skip promotion, then continue posting the original verdict. Alternatively, compute the prior open medium+ count before choosing the candidate and skip the candidate when promotion is impossible. Mirror the change in `scripts/post-review.sh` and add a test where the files fetch fails for a re-review `request-changes`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Authors lose re-review context ✓ Resolved
Description
post-review.src.sh replaces the entire model-authored body after any prior approval with text
assembled solely from retained finding fields. Even when filtering removes nothing, summaries,
verification details, and caveats present only in the original body are absent from the review
posted to the forge.
Code

scripts/post-review.src.sh[R341-345]

+    .body = if ((.findings // []) | length) == 0 then
+      "Review completed; no findings at or above the configured \($threshold) severity threshold remain in the posted review."
+    else
+      "## Review findings\n\n" + ([.findings[] | finding_line] | join("\n"))
+    end
Relevance

●● Moderate

Context loss is real, but body normalization appears intentional to prevent filtered findings
leaking into posted reviews.

PR-#1608
PR-#1232

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new assignment discards the original body unconditionally after a prior approval. The finding
schema has no fields from which arbitrary body-only review context can be reconstructed, and the
resulting file is the one sent to the forge.

scripts/post-review.src.sh[328-348]
schemas/review-result.schema.json[114-135]
scripts/post-review.src.sh[1116-1121]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Rebuilding the whole review body after a prior approval removes content unrelated to suppressed low-severity findings.

## Fix Focus Areas
- scripts/post-review.src.sh[328-348]
- schemas/review-result.schema.json[114-135]

## Recommended Fix
Preserve the original body when no findings were filtered. When filtering is necessary, retain review context that does not describe suppressed findings while ensuring low/info finding prose cannot appear in the posted review; add tests for both cases.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (1)
8. A rejected PR approach can be turned into an approval ✓ Resolved
Description
The re-review gate treats reject like request-changes. When no current finding is medium or
higher and no prior medium+ finding is open, the gate rewrites it to approve. In the code-review
skill, reject means the approach is fundamentally wrong and the PR should be closed. With this
change, such a PR gets an approving review and the ready-for-merge label instead of being closed
with rejected.
Code

scripts/post-review.src.sh[R964-968]

+  if [[ ( "${ACTION}" = "request-changes" || "${ACTION}" = "reject" ) \
+      || ( "${ACTION}" = "comment" && "${PRIOR_ACTION}" = "approve" && "${DOWNGRADED}" = "false" ) ]] \
+      && [[ "${PRIOR_MEDIUM_PLUS_OPEN_COUNT}" -eq 0 ]] \
+      && [[ "${CURRENT_MEDIUM_PLUS_COUNT}" -eq 0 ]] \
+      && [[ "${DOWNGRADED}" = "false" ]]; then
Relevance

●● Moderate

Reject semantics conflict with approval promotion, but tested low-reject behavior appears
intentional within this scoped change.

PR-#1608

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The skill defines reject as "approach is fundamentally wrong ... Use reject only when no amount
of code-level iteration will make the PR mergeable". That is a design decision, not something
measured by finding severity. The outcome-label code closes the PR on reject and adds
ready-for-merge on an undowngraded approve. The new gate (also the safety candidate at lines
360-366) switches reject to approve on severity alone, and the new test
rereview-low-reject-becomes-approve locks this behaviour in. The tickets only ask that low
findings stop triggering CHANGES_REQUESTED.

skills/pr-review/SKILL.md[1294-1296]
scripts/post-review.src.sh[1161-1167]
scripts/post-review.src.sh[1209-1213]
scripts/post-review.src.sh[360-366]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The re-review severity gate promotes `reject` to `approve` when there are no medium+ findings. `reject` signals a fundamentally wrong approach and should never become an approval because of finding severity.

## Fix Focus Areas
- scripts/post-review.src.sh[360-366]
- scripts/post-review.src.sh[963-968]
- scripts/post-review.sh[1069-1075]
- scripts/post-review.sh[1672-1677]
- scripts/post-review-test.sh[1849-1853]

## Recommended Fix
Remove `reject` from the safety-candidate condition and from the promotion condition, so that only `request-changes` (and `comment` after a prior approval) can be promoted. Regenerate the bundled script. Change the `rereview-low-reject-becomes-approve` test to assert that `reject` is preserved.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 58 rules
✅ Skills: 4 invoked
  code-review
  code-implementation
  pr-review
  docs-review
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/autonomy-analysis (sha: 46717359) — View relationship
  Explored: repo: fullsend-ai/fullsend (sha: d3a153a2) — View relationship
Review mode: Auto: 🧠 Deep: Dense cross-script policy logic with many independent, easy-to-miss review paths.

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved

@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 findings at 9b01035: 2 HIGH, 3 MEDIUM, all in scripts/post-review.src.sh. Each is inline. The two HIGHs are about where the re-review gate now changes the agent's verdict: advisory prior mediums become blockers that start fix runs, and a deliberate comment verdict gets promoted to approve.

Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
@csoceanu

csoceanu commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@waynesun09 , I addressed the five findings from your review in 28aa552: advisory prior mediums remain non-blocking, empty comments are not promoted to approval, direct approvals remain fail-closed, protected-path findings block promotion at any severity, and the unvalidated post-approval medium floor was removed.

@waynesun09

Copy link
Copy Markdown
Member

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:24 PM UTC · Completed 12:36 PM UTC

Commit: 28aa552 · View workflow run →

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

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Oct 9, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

The score stays at 2 (moderate): a large diff (1249 lines, 11 files) changes existing review-gating behavior in protected paths, offset by no security-sensitive, CI or dependency changes, an established human author, a well-scoped linked issue and heavy test coverage; churn in the touched scripts is high, giving a composite of about 2.4.

Previous run

Risk Assessment: moderate (2/5)

Details

Large diff (1124 lines) touching 7 protected paths in the review agent and post-review scripts with modified existing behavior and no flag, offset by no security-sensitive, CI or dependency changes, an established non-bot author, a well-scoped linked issue and moderate file history, giving a composite of about 2.3.

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review

Findings

Medium

  • [logic-error] scripts/post-review.src.sh:1248 — The ledger projection takes actionable from the unfiltered result, which undoes the re-review gate's normalization. Promotion sets actionable=false on new low/info rows in the posted result, but $ledger_findings is built from $unfiltered[0].findings and project_finding (line 1241) copies the raw boolean. A new low finding emitted with actionable:true is posted as advisory but recorded in the marker as actionable:true. On the next re-review, PRIOR_OPEN_BLOCKING_FINDINGS (lines 1116-1120) lets any open prior row with actionable==true through both selects, so that previously advisory low finding now blocks and forces request-changes with no new medium+ finding. This reintroduces the loop the PR is meant to stop.
    Remediation: Persist the host-normalized actionable value in the ledger while keeping unfiltered rows for reclassification and failure accounting. Add a multi-review round-trip test using a projectable category such as naming-convention.

  • [logic-error] scripts/post-review.src.sh:1116 — The (.actionable // false) == true alternative in the first select bypasses REREVIEW_BLOCKING_RANK. With a stricter configured threshold (for example high), an open prior actionable medium or low finding still counts as blocking. The later verdict gate can then switch approve/comment to request-changes and re-insert a below-threshold finding into the posted findings. This contradicts the documented contract that the severity threshold is absolute regardless of actionable.
    Remediation: Require prior blockers to meet the configured global threshold independently of actionable; apply the actionable exception only to the re-review medium floor. Add a test with an actionable prior low/medium finding under a stricter threshold.

  • [fail-open] scripts/post-review.src.sh:1260 — When a prior finding's disposition stays open, the projection pins only severity and category from the prior ledger; actionable still comes from the current row via project_finding. If an open prior actionable finding is re-emitted with actionable:false or without the field, this run still blocks from the prior ledger, but the next ledger drops actionable:true. On the following re-review the blocker filter excludes the still-open low finding, so approval can be reached without a resolution or reclassification. Verified inputs: prior severity and category are protected; prior actionable is not.
    Remediation: Preserve the prior actionable flag alongside severity and category while the effective disposition is open. Add a multi-review regression showing that changing or omitting actionable cannot silently remove an existing blocker.

  • [protected-path] agents/review.md — This PR modifies protected paths: agents/review.md, scripts/post-review.sh, scripts/post-review.src.sh, scripts/post-review-test.sh, scripts/pre-review.sh, scripts/pre-review.src.sh, scripts/pre-review-test.sh, skills/code-review/SKILL.md, skills/pr-review/SKILL.md, skills/pr-review/references/re-review.md. The PR links issue Review agent should raise severity threshold for new findings on re-review iterations #1208 and explains the rationale, but human approval is always required for protected-path changes, regardless of context.

Low

  • [logic-error] scripts/post-review.src.sh:1137 — Approval promotion misses reviews that the severity filter turned from request-changes into comment, unless the previous review was already approve. Example: threshold medium, prior action request-changes with blockers now resolved, only new low findings. The filter sets action=comment; the safety-candidate check (lines 452-455) and the promotion branch (1136-1137) both require request-changes, or comment with PRIOR_ACTION=approve, so the review ends as requires-manual-review instead of approve. It needs a non-default threshold and fails safe (manual review, not a wrong approval).
    Remediation: Track filter-induced downgrades separately from an intentional agent comment and let otherwise eligible verified re-reviews through the safety checks and promotion regardless of the prior action.

  • [scope-creep] scripts/post-review.sh:1033 — The block at lines 1033-1144 (generated from post-review.src.sh) rewrites the review body after an approved re-review when severity filtering removed findings. It is about 110 lines of body-normalization logic beyond the minimal severity gate. It supports the issue's goal (filtered low findings should not appear as blocking), so this is tangential complexity rather than unauthorized scope.
    Remediation: Consider splitting the body normalization into a separate change, or document why the gate requires it.

Earlier findings

  • f_3a061444e12daca3 — resolved_by_change — the blocker selector now treats medium-or-higher prior findings as blocking when the prior action is unknown ($prior_action == "" clause); the rereview-legacy-medium-fails-closed test covers it.
  • f_4c5950409263e382 — resolved_by_change — same change: absent legacy action metadata no longer makes prior medium+ findings advisory.
  • f_e0ec6a7ae3a5ca6a — resolved_by_change — carried actionable findings are included in blocker selection and excluded from low/info normalization; rereview-carried-actionable-low-still-blocks covers it. (The separate ledger regression is reported above.)
  • f_4a220e5b27fb716c — resolved_by_change — docs/review.md now states the high/critical, medium and legacy-projection rules matching the script.
  • f_0bbaeb8ce07f0743 — resolved_by_change — agents/review.md carries the same corrected wording.
  • f_bad66969493968a8 — resolved_by_change — skills/pr-review/SKILL.md verdict section documents re-review low/info handling.
  • f_cbf61123e5e6a083 — resolved_by_change — skills/code-review/SKILL.md outcome rules document the re-review rule.
  • f_b83ac647f9003777 — resolved_by_change — re-review.md now describes action and actionable in the projection.
  • f_826c8fc2508611b1 — resolved_by_change — docs/review.md projection description now lists action and optional actionable.
  • f_d3ce257b04e3e145 — reclassified (medium → low) — the body-normalization block is new in this PR and supports the gate's goal; it is tangential complexity, not unauthorized scope.
  • f_2727e4023ae9253a — reclassified (medium → info) — the protected-path guard is a necessary corollary of the new promotion path, which would otherwise fail open.

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
Previous run

Review

Findings

High

  • [logic-error] scripts/post-review.src.sh:1120 — Legacy v1/v2 projections carry neither action nor per-finding actionable, so the blocking predicate drops every open prior medium finding when PRIOR_ACTION is empty. A re-review with an unanswered legacy medium and only new low findings is promoted from request-changes to approve (with ready-for-merge) while the medium stays open. This violates Review agent should raise severity threshold for new findings on re-review iterations #1208's "no medium+ findings suppressed" criterion. See also the [fail-open] finding at this location.
    Remediation: Treat open prior mediums with unknown blocking provenance as blocking (or withhold promotion when the prior ledger lacks action); add a regression test with a validated legacy projection without action.
  • [fail-open] scripts/post-review.src.sh:1119 — Missing prior blocking metadata permits automatic approval with unresolved medium findings: .actionable is never present in any projection (that predicate branch is unreachable) and PRIOR_ACTION is empty for pre-existing markers. Mitigations: promotion also requires zero current medium+ findings, and prior high/critical stay blocking. Same logic in the bundled post-review.sh. See also the [logic-error] finding at this location.
    Remediation: Fail closed on unknown prior blocking status; carry validated per-finding blocking status through projection and pre-review parsing; add pre/post round-trip tests.

Medium

  • [logic-error] scripts/post-review.src.sh:1147 — The promotion gate does not distinguish NEW low/info findings from carried-forward ones, and clears .actionable on every low/info row. A prior actionable low re-emitted as open is silently made non-blocking and the review approved; Review agent should raise severity threshold for new findings on re-review iterations #1208 limits the exemption to newly discovered lows.
    Remediation: Identify new low/info rows via ids and effective prior dispositions; promote only when no carried-forward actionable finding remains open; add a test.
  • [incorrect-doc] docs/review.md:134 — The added text says a prior "medium-or-higher" finding blocks only when the prior review was request-changes or the finding was actionable. The code (post-review.src.sh:1113-1115) blocks prior high/critical unconditionally; only prior medium is conditional.
    Remediation: Reword to separate unconditional high/critical blocking from the conditional prior-medium rule.
  • [incorrect-doc] agents/review.md:103 — Same "medium-or-higher ... blocks only when" sentence in the agent definition, contradicting the code.
    Remediation: Reword lines 103-106 likewise.
  • [scope-creep] scripts/post-review.sh:1033 — Beyond Review agent should raise severity threshold for new findings on re-review iterations #1208's new-low gate, the PR adds a ~120-line awk/jq body-rewriting pipeline (stripping severity sections from the posted body when the prior action was approve), mirrored in both script copies and not described in the doc additions.
    Remediation: Split into its own issue/PR, or document it and get it authorized.
  • [scope-creep] scripts/post-review.sh:1196 — The PR relaxes carry-forward semantics (an advisory comment-only prior medium no longer blocks), which Review agent should raise severity threshold for new findings on re-review iterations #1208 does not request, and adds a fail-soft fail_rereview_safety_check path that downgrades to comment instead of failing.
    Remediation: Confirm with the issue owner that relaxing prior advisory mediums is authorized, or defer it; document the fail-soft safety path as a deliberate decision.
  • [protected-path] scripts/post-review.src.sh — This PR modifies protected paths: agents/review.md, scripts/post-review.sh, scripts/post-review.src.sh, scripts/post-review-test.sh, scripts/pre-review.sh, scripts/pre-review.src.sh, scripts/pre-review-test.sh. The PR links Review agent should raise severity threshold for new findings on re-review iterations #1208 and explains the rationale, but human approval is always required for protected-path changes, regardless of context.
    Remediation: Obtain human approval from a CODEOWNER.

Low

  • [incomplete-doc] skills/pr-review/SKILL.md:1273 — Step 6f does not mention the new re-review exception for new low/info findings (no behavioral impact; host promotes to approve).
    Remediation: Add the exception to step 6f.
  • [incomplete-doc] skills/code-review/SKILL.md:288 — Outcome determination does not reflect the re-review exception.
    Remediation: Note the exception in the outcome determination.
  • [incomplete-doc] skills/pr-review/references/re-review.md:13 — Step 2a omits the new optional action field of the v2 projection.
    Remediation: Document action (approve, request-changes, comment, reject).
  • [incomplete-doc] docs/review.md:155 — The fullsend:review-findings-v2 field list omits the new action field.
    Remediation: Add action to the list.

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[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@ralphbean

Copy link
Copy Markdown
Member

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:52 PM UTC · Completed 7:03 PM UTC

Commit: e880fc3 · View workflow run →

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

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

Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • scripts/post-review.src.sh (file-level): Line 1248 ·
    [medium] logic-error

The ledger projection takes actionable from the unfiltered result, which undoes the re-review gate's normalization. Promotion sets actionable=false on new low/info rows in the posted result, but $ledger_findings is built from $unfiltered[0].findings and project_finding (line 1241) copies the raw boolean. A new low finding emitted with actionable:true is posted as advisory but recorded in the marker as actionable:true. On the next re-review, PRIOR_OPEN_BLOCKING_FINDINGS (lines 1116-1120) lets any open prior row with actionable==true through both selects, so that previously advisory low finding now blocks and forces request-changes with no new medium+ finding. This reintroduces the loop the PR is meant to stop.

Suggested fix: Persist the host-normalized actionable value in the ledger while keeping unfiltered rows for reclassification and failure accounting. Add a multi-review round-trip test using a projectable category such as naming-convention.

  • scripts/post-review.src.sh (file-level): Line 1260 ·
    [medium] fail-open

When a prior finding's disposition stays open, the projection pins only severity and category from the prior ledger ($row + {severity: $p.severity, category: $p.category}); actionable still comes from the current row via project_finding. If an open prior actionable finding is re-emitted with actionable:false or without the field, this run still blocks from the prior ledger, but the next ledger drops actionable:true. On the following re-review the blocker filter excludes the still-open low finding, so approval can be reached without a resolution or reclassification. Verified inputs: prior severity and category are protected; prior actionable is not.

Suggested fix: Preserve the prior actionable flag alongside severity and category while the effective disposition is open. Add a multi-review regression showing that changing or omitting actionable cannot silently remove an existing blocker.

@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 scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.sh Resolved
@ralphbean

Copy link
Copy Markdown
Member

New findings from the review agent above look legitimate to me (although I didn't trace them to confirm). Carmel, Benjamin - can you take a look?

@csoceanu

Copy link
Copy Markdown
Contributor Author

thanks for the review @ralphbean , addressed in 4c183b5

@csoceanu

Copy link
Copy Markdown
Contributor Author

Hey @ralphbean @waynesun09, could you please clarify the intended verdict for this case -

On a verified re-review where no prior medium+ finding remains open, the agent returns comment with only new low/info findings. Issue #1208 says the review should approve, optionally noting the low findings as suggestions.

I understand @waynesun09's review that an empty/manual-judgment comment must remain comment:
#1636 (comment)

However, in our end-to-end test, the agent returned a visible low-only comment. The host prevented request-changes and the fix-agent loop, but kept the final verdict as COMMENT.

Should visible low/info-only comments be promoted to APPROVE, while empty/manual-judgment comments remain COMMENT? I’d like to confirm this before making any further change to #1636.

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

Re-review at 4c183b5: 3 HIGH, 5 MEDIUM, all in scripts/post-review.src.sh. Each was reproduced by running the bundled post-review.sh at head and on main and comparing verdicts. The two that matter most for the fleet: a critical threshold lets an open prior high auto-approve, and on upgrade every open PR (v2 markers have no action) turns advisory mediums into request-changes + fix runs.

Fixed since my last round: empty comment no longer promoted; protected-path check reads the unfiltered result; post-approval medium floor removed. Note: functional-tests-complete failed on a label-removal race between the two gate jobs, not this PR, so behaviour/functional tests have not run on 4c183b5 yet.

On the open question about promoting low-only comments: I will reply separately.

Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
csoceanu and others added 3 commits October 12, 2026 19:02
Fail closed for legacy prior-review metadata, preserve carried actionable findings, and document the re-review projection contract. Add regression coverage and regenerate bundled scripts.

Co-authored-by: Codex <codex@openai.com>
Signed-off-by: csoceanu <csoceanu@redhat.com>
Trim redundant review guidance without changing re-review behavior.

Co-authored-by: Codex <codex@openai.com>
Signed-off-by: csoceanu <csoceanu@redhat.com>
Keep host-normalized actionable state in the disposition ledger, respect the configured severity threshold, and preserve actionable state for open prior findings. Extend the re-review regression coverage and regenerate the bundled script.

Co-authored-by: Codex <codex@openai.com>
Signed-off-by: csoceanu <csoceanu@redhat.com>
@csoceanu
csoceanu force-pushed the codex/aisdlc-118/rereview-severity-gate branch 2 times, most recently from 4b92b4b to cce4b8d Compare October 12, 2026 16:08
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: csoceanu <csoceanu@redhat.com>
@csoceanu
csoceanu force-pushed the codex/aisdlc-118/rereview-severity-gate branch from cce4b8d to aa820e9 Compare October 12, 2026 16:10
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: csoceanu <csoceanu@redhat.com>
@csoceanu
csoceanu requested a review from waynesun09 October 12, 2026 17:34
@csoceanu

Copy link
Copy Markdown
Contributor Author

Thanks @waynesun09 for the review! addressed all eight findings

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

Re-review at b33f1e6: all eight findings from my last round are fixed within the agreed scope (no ledger schema growth, structured notice with links, body rewrite dropped, ::error + exit 1 on the soft-fail path). post-review-test.sh (331 pass), pre-review-test.sh and make check-bundle pass; functional and behaviour tests are green after ok-to-test.

Two MEDIUMs remain, each reproduced by running the bundled post-review.sh at head and on main. Both are inline. Once they are fixed I will approve.

On the open question (promote visible low/info-only comments?): please do not promote an agent-authored comment in this PR. The host cannot tell a deliberate comment from a filter-downgraded one (second inline finding). Promote only a request-changes whose findings are all new low/info, or that the severity filter downgraded to comment. Keeping visible low-only comments as COMMENT is the safe side; if we want #1208's "approve with suggestions" for that case, it needs an explicit signal from the agent and can be a follow-up issue.

Comment thread scripts/post-review.src.sh Resolved
Comment thread scripts/post-review.src.sh Resolved
Preserve agent-authored comment verdicts and prior reject holds across severity filtering and re-review rounds. Add regressions for filtered comment failures and two-round reject handling.

Co-authored-by: Codex <codex@openai.com>
Signed-off-by: csoceanu <csoceanu@redhat.com>
@csoceanu

Copy link
Copy Markdown
Contributor Author

Thanks @waynesun09 for the review! addressed the two findings

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

Both round-3 findings are fixed in c2a22c0: an agent-authored comment is no longer promoted, and the prior-reject hold now persists across rounds (with tests for both). Local post-review-test.sh (333 pass) and check-bundle are clean. Approving.

This branch was previously deployed

1 inactive deployment
dev — c2a22c0f Deployed Oct 12, 2026 by waynesun09 via behaviour #717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants