Skip to content

Commit 3ab44ee

Browse files
cpcloudclaude
andcommitted
fix(review): use ParseVerdict for pass detection in single-result formatting
strings.Contains(marker) was too loose — showed Review Passed even when output also contained severity-labeled findings. Now delegates to storage.ParseVerdict which checks severity labels first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6a726cb commit 3ab44ee

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

internal/review/synthesize.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
"errors"
66
"fmt"
77
"log"
8-
"strings"
98
"time"
109

1110
"github.com/roborev-dev/roborev/internal/agent"
1211
"github.com/roborev-dev/roborev/internal/config"
1312
"github.com/roborev-dev/roborev/internal/git"
13+
"github.com/roborev-dev/roborev/internal/storage"
1414
)
1515

1616
// ErrAllFailed is returned by Synthesize when every review job
@@ -96,7 +96,7 @@ func formatSingleResult(
9696
) string {
9797
var header string
9898
if r.Output == "" || r.Output == "No issues found." ||
99-
strings.Contains(r.Output, config.SeverityThresholdMarker) {
99+
storage.ParseVerdict(r.Output) == "P" {
100100
header = fmt.Sprintf(
101101
"## roborev: Review Passed (`%s`)\n\n",
102102
git.ShortSHA(headSHA))

internal/review/synthesize_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ func TestSynthesize_Formatting(t *testing.T) {
121121
"Review Passed",
122122
},
123123
},
124+
{
125+
name: "ThresholdMetWithFindings",
126+
results: []ReviewResult{
127+
{
128+
Agent: "codex",
129+
ReviewType: "review",
130+
Status: "done",
131+
Output: "SEVERITY_THRESHOLD_MET\n\n- High: critical bug found",
132+
},
133+
},
134+
expectedErr: nil,
135+
expectedTexts: []string{
136+
"Review Complete",
137+
},
138+
},
124139
{
125140
name: "AllQuota",
126141
results: []ReviewResult{

0 commit comments

Comments
 (0)