Skip to content

skills(review): cite code outside the diff by semantic anchor - #477

Merged
max-sixty merged 1 commit into
mainfrom
review-citation-rule
May 14, 2026
Merged

max-sixty merged 1 commit into
mainfrom
review-citation-rule

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Adds a step-4 rule in the review skill: when a finding involves code outside gh pr diff (i.e. code the PR didn't touch but now interacts with), identify it by semantic anchor (selector, function name, declaration text) rather than raw line number, and quote enough property/value that the reader can grep for it.

Why: tend-review checks out refs/pull/N/merge, so it reads the merged tree. The contributor's local branch may be behind main, so line numbers from the merged tree won't match their local checkout. A line-number-first citation of code that only exists at that line in main reads as a hallucination — the contributor checks the cited line, sees different content, and dismisses the review. Happened in #475, where the reviewer correctly flagged that the new 5.5rem rail desynchronized three 6rem indents in .hero, .section-eyebrow, and .section-lead; I posted a (wrong, since-deleted) rebuttal based on a stale local checkout before realizing my branch was significantly behind main.

Why this framing, not a blanket caveat: every review can't open with "your branch may be behind main." The trigger is specific — the citation is outside the diff — so the rule fires narrowly. Findings inside the diff don't need it.

Cross-reference: running-in-ci:352 already says outbound blob/main/...#L42 links must use a commit SHA because line numbers shift. This is the inbound dual: don't lead with a line number when citing code that may have moved.

…ne number

When the bot's review finding involves code the PR didn't touch (e.g. a
selector or function in main that the PR's change now interacts with),
leading with a raw line number reads as a hallucination on any
contributor branch that's behind main — the merged-tree line numbers
won't match their stale local checkout.

Adds a step-4 subsection telling the bot to anchor citations of
outside-the-diff code by selector/function/declaration text, and quote
enough property/value that the reader can grep for it. Cross-references
the existing `blob/main/...#L42` link-fragility rule in `running-in-ci`
— same shifting-line-number problem, opposite direction.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 318755d into main May 14, 2026
6 checks passed
@max-sixty
max-sixty deleted the review-citation-rule branch May 14, 2026 18:47
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.

2 participants