Show the reason for each spelling suggestion in the summary - #115
Merged
Merged
Conversation
Findings must already justify themselves, but the reason was only validated and then discarded. Carry it through to the step summary so the table explains why each correction is right without opening the diff. Reasons are free text, so collapse whitespace and escape pipes to keep each row intact. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jsoref
reviewed
Sep 10, 2026
| for path, number, word, correction, reason, _ in kept: | ||
| link = f"{repository}/blame/{os.environ['HEAD_SHA']}/{path}#L{number}" | ||
| print(f"[{Path(path).name}:{number}]({link})|`{word}`|`{correction}`", file=table) | ||
| cell = " ".join(reason.split()).replace("|", "\\|") |
Contributor
There was a problem hiding this comment.
Do we have to worry about:
| File | Misspelling | Correction | Reason |
|---|---|---|---|
| test.txt | teh | the | something |
Member
Author
There was a problem hiding this comment.
What would be a bad example?
Contributor
There was a problem hiding this comment.
I mean, it could produce:
| File | Misspelling | Correction | Reason | ||
|---|---|---|---|---|---|
| test.txt | teh | the |
|
||
| test.txt | teeh | teeth |
|
Member
Author
There was a problem hiding this comment.
Why should we worry about this? GitHub is making sure JavaScript injection does not happen and that should be enough.
Contributor
There was a problem hiding this comment.
it's more about if the model goes wonky the outputs will be overly tall, but whatever.
Member
Author
There was a problem hiding this comment.
I'd expect the output to be plain text. I will adjust the prompt if otherwise.
jsoref
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
groundedalready required every finding to carry a non-emptyreason, but it dropped the value on the floor. It now keeps the stripped reason alongside the rest of the finding, and the## Spellingstep summary gains a Reason column.Why
The summary table listed file, misspelling, and correction, which tells a reviewer what is being suggested but not why it is right. The reason is exactly that justification, and it was already being collected and validated — surfacing it means the table stands on its own without opening the diff or the inline comments.
Notes for the reviewer
_." ".join(reason.split())) and escapes|to\|— otherwise a newline or pipe in a reason would break the markdown row.