Skip to content

fix: read the walkthrough leniently and don't guess scores when it fails - #16

Merged
ngoyal16 merged 1 commit into
mainfrom
fix/walkthrough-lenient-scores
Nov 23, 2026
Merged

ngoyal16 merged 1 commit into
mainfrom
fix/walkthrough-lenient-scores

Conversation

@ngoyal16

Copy link
Copy Markdown
Contributor

Fixes #14.

What changes

  • Lenient walkthrough decoding. Each field is decoded on its own. A list or object sent as a JSON-encoded string ("highlights": "[{...}]") is decoded; a field that still doesn't fit ("cohorts": "all files") is ignored and logged as a warning. The rest of the walkthrough is kept, and the review is no longer marked partial for it.
  • No guessed scores. fallbackScores (95 minus a penalty per finding, which hit 1 with 6 majors and 10 minors) is gone. When the walkthrough fails or gives no scores, scores is left out of the JSON result and scores_note says why. The summary says "No scores this time: …", the status and labels carry none, and --approve-min-score treats it as undecided.
  • Anchoring survives a miss. The previous review's scores, SHA and open findings stay in the summary state, so the next review still anchors to them.

Console

scores was already optional there, so a review without scores is recorded without them, and the averages aren't dragged down. scores_note isn't shown in the console yet.

Tests

go test ./... passes. Added walkthrough_test.go, which covers string fields, JSON-in-string, a failed walkthrough carrying the previous scores, and the summary note. Three tests that expected guessed scores now expect none.

🤖 Generated with Claude Code

A string where the walkthrough schema wants a list or object (cohorts,
highlights, score_reasons) failed the whole walkthrough, marked the review
partial and replaced the model's scores with ones derived from the
findings, which went to 1 on large changes. Fields are now decoded one by
one: a list sent as a JSON string is decoded, a field that still doesn't
fit is ignored and logged. When the walkthrough fails or gives no scores,
the review has none (scores_note says why) and the previous scores stay in
the summary state for the next review to anchor to.

Fixes #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ngoyal16
ngoyal16 merged commit e5a3f06 into main Nov 23, 2026
12 checks passed
@ngoyal16
ngoyal16 deleted the fix/walkthrough-lenient-scores branch November 23, 2026 13:41
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.

Walkthrough fails when the model returns a string for cohorts, highlights or score_reasons; the review is marked partial and its scores are unreliable

1 participant