Repository navigation
feat(review-anvil): per-finding context as a validated sidecar - #10
Merged
Merged
Conversation
* review-anvil-context: tmux + fzf + bat pane with a finding's code context * review-anvil-comments: PR review comment list that opens each context * context-helper.sh reads hidden context lines, validates every item * other-repo files fetched from GitHub at a full SHA, cached read-only * README, plugin and marketplace descriptions list both skills
* reviewer schema gains optional context locations per finding * synthesis merges, checks and passes context to .inline.json * pr-helper embeds a hidden review-anvil context line before the id marker * other-repo entries need a full SHA; invalid entries dropped with a warning * test covers marker placement, encoding and rejected entries
* shared jq marker def: last non-empty body line, whole-line match only * finding_of, resolve_finding and the comment list use the same rule * quoted markers in prose or suggestions no longer change a comment's ID * sanitize_context rejects an empty-string repo, like the writer
* plugin.json and marketplace.json both at 0.17.0 * ships the context and comments viewer skills and reviewer context
* report ends with a hidden context block: one line per finding, with commit * pr-helper validates and re-encodes the block inside process-inline * local runs keep the report in .review-anvil/report-<UTC>.md * viewer reads PR reports and inline comments, or a local report (--local) * findings pinned to their reviewed commit; ranges highlighted as ranges
* chat copy of the final report drops review-anvil-report markers * context block lines left out of the chat copy too * report file keeps every marker for helpers and viewers * readonly and improve-pr presets surface the chat copy
Drop the tmux/fzf context viewer and local report persistence. Reviewers return a structured context list per finding; the engine writes <report_path>.context.json (versioned schema in report-artifacts.md) and pr-helper.sh embed-context validates it and embeds one hidden line per finding in inline comments and the report. Context never blocks a post. Reproduction verifiers start from the context locations.
Inline comments no longer get context lines: the report block already covers every finding. Trim item validation to the record contract, omit an unknown revision instead of using null, reject a boolean schema version, and always clear stale context lines on retry.
…context # Conflicts: # plugins/review-anvil/skills/review-anvil/references/reproduction-prompt.md
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.
Builds on #9 by @vidriduch: keeps the per-finding context data, drops the viewer. The earlier commits are #9's, rebased onto
main; the last commit is the rework.Why
Each finding should record where its evidence lives, pinned to the commit that was reviewed, so a human reviewer can retrace it and later tools can build on it. #9 showed that reviewers fill this in readily. This PR makes that data a stable interface and leaves rendering for later.
What changes
contexton every finding ([]if the anchor is enough):{kind: file, label, path, lines: [[start, end]], repo?, commit?}or{kind: pr, label, number, repo?}, at most 8. A file in another repository requires a full 40-charcommit. Versioned schema inreferences/report-artifacts.md.<report_path>.context.jsonwith{v: 1, findings: [{id, revision?, items}]}.revisionis the commit that finding's round reviewed. Context never goes through the clarity or action-lock passes.pr-helper.sh embed-contextvalidates every record and adds one hidden line per finding the posted report still lists, at the end of the top-level report before the footer:<!-- review-anvil: context={"v":1,"id":…,"revision":…,"items":[…]} -->. The report is the only place context is posted. It covers every finding, including low/nit findings andreview-anvil-improve-prruns; inline comments are left unchanged.revisionis left out when there's no commit to pin to (an uncommitted working tree).-that comes before another-is escaped, so the hidden comment can't end early.review-anvil-contextandreview-anvil-commentsskills, and the local.review-anvil/report-*.mdfiles, so read-only runs stay side-effect free.Deliberately not included
.context.json.Testing
test-pr-helper.shhas 4 new tests: validation and re-running, never blocking a post, the full post path, and the history parser.ghshows the hidden lines at the end of the report, with artifacts cleaned up afterwards.