You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tend-review reviews main-merge changes as the PR's own work #3246
When a PR merges main mid-review, tend-review appears to include the merge-brought-in changes in the diff it reviews, so it critiques code the PR never authored. The review reads as if those changes are the PR's own work.
Example
PR #3232 (migrate logging to native tracing::) merged main to resolve a conflict, which pulled in #3229's statusline rate-limit "lockout" feature (expected_lockout, colorize_pace, lockout_cost, and the Gauss–Hermite quadrature). #3232 authored none of that.
The worktrunk-bot review on head ada0e9156 (submitted 2026-06-25T06:41:40Z) opened with a full paragraph reviewing exactly that lockout math:
The new severity axis (expected_lockout + colorize_pace/lockout_cost) is a clean addition. Splitting the one Bayes update into posterior_lambda so p_over (the show gate) and expected_lockout (the colour axis) can't drift is the right factoring, and the Gauss–Hermite quadrature is sound ...
Only the remaining two paragraphs (the record_i64 coverage gap and the codecov/patch reasoning) were about #3232's actual diff.
Likely cause
A PR's true diff is main...HEAD (three-dot), which excludes anything already on main. #3229 is on main, so it should never appear in #3232's review. Reviewing #3229's content suggests tend-review instead diffs something that includes merge-pulled changes: a two-dot main..HEAD, the merge commit's own diff, or the set of commits in the latest push (which included the merge commit). Worth checking how the review step computes the diff it feeds the model.
Impact
Any PR that merges main during review (common for longer-lived branches) gets reviewed for unrelated code: wasted review budget, misleading feedback, and the risk of flagging or holding on issues in code the PR author can't act on.
Incremental review (step 1, when LAST_REVIEW_SHA exists and differs from HEAD_SHA) reads gh api repos/$REPO/compare/$LAST_REVIEW_SHA...$HEAD_SHA to decide what changed since the last review — and reviews that.
On #3232 the bot reviewed 599700c7 first (06:05Z), then a Merge branch 'main' commit (6eee3f15) landed, then it re-reviewed ada0e915 (06:41Z). The incremental compare 599700c7...ada0e915 spans that merge, so it pulls in everything main brought in — including #3229's lockout feature. That's the diff the bot anchored its review on, which is why the lockout paragraph appeared while the clean gh pr diff would never have surfaced it.
Evidence — counting expected_lockout/colorize_pace/lockout_cost in each diff's statusline.rs patch:
So your three-dot hypothesis is right about the correct diff, but the leak is specifically that the incremental compare uses a two-endpoint A...B that spans a base-merge, not that the full review uses two-dot.
This lives in the bundled tend-ci-runnerreview skill (step 1), so it'd fire for any tend consumer whose PRs merge the default branch mid-review — the fix belongs in the tend review skill, not in worktrunk's code (there's nothing to change here). A conservative fix: when computing incremental changes, exclude anything already on the base — restrict the incremental file/hunk set to files that also appear in the PR's three-dot gh pr diff, or equivalently diff the PR's three-dot surface at the two review points rather than LAST_REVIEW_SHA...HEAD_SHA directly. That keeps "what's new since I last looked" while dropping merge-pulled base changes.
Happy to open this against the tend repo if you'd like it tracked there — just say the word.
Bot reviews on #3232: 599700c7 COMMENTED 06:05:54Z, then ada0e915 COMMENTED 06:41:40Z (the one in this report). Intervening commit: 6eee3f15 Merge branch 'main' into subprocess-log-format.
Filed upstream so it's tracked against the bundled review skill where the fix lives: max-sixty/tend#734. It carries the reproduction, the three-dot-vs-incremental term-count table, and the proposed filter (restrict the compare/$LAST_REVIEW_SHA...$HEAD_SHA file set to files that also appear in gh pr diff). Nothing to change in worktrunk itself.
Activity
worktrunk-bot commentedon Jun 25, 2026
Reproduced — and the root cause is the incremental-review path, not the full-review diff.
The
reviewskill takes two different diffs depending on whether the bot already reviewed an earlier commit:gh pr diff <number>— GitHub's three-dotmain...HEAD. On Add trace.jsonl structured-event sink and migrate logging to native tracing #3232 this correctly shows only the logging migration's touch tostatusline.rs(tracing::debug!lines); the lockout feature is not in it.LAST_REVIEW_SHAexists and differs fromHEAD_SHA) readsgh api repos/$REPO/compare/$LAST_REVIEW_SHA...$HEAD_SHAto decide what changed since the last review — and reviews that.On #3232 the bot reviewed
599700c7first (06:05Z), then aMerge branch 'main'commit (6eee3f15) landed, then it re-reviewedada0e915(06:41Z). The incremental compare599700c7...ada0e915spans that merge, so it pulls in everythingmainbrought in — including #3229's lockout feature. That's the diff the bot anchored its review on, which is why the lockout paragraph appeared while the cleangh pr diffwould never have surfaced it.Evidence — counting
expected_lockout/colorize_pace/lockout_costin each diff'sstatusline.rspatch:gh pr diff 3232(three-dotmain...HEAD)compare/599700c7...ada0e915(incremental)posterior_lambda, Gauss–Hermite,expected_lockout)So your three-dot hypothesis is right about the correct diff, but the leak is specifically that the incremental compare uses a two-endpoint
A...Bthat spans a base-merge, not that the full review uses two-dot.This lives in the bundled
tend-ci-runnerreviewskill (step 1), so it'd fire for any tend consumer whose PRs merge the default branch mid-review — the fix belongs in the tendreviewskill, not in worktrunk's code (there's nothing to change here). A conservative fix: when computing incremental changes, exclude anything already on the base — restrict the incremental file/hunk set to files that also appear in the PR's three-dotgh pr diff, or equivalently diff the PR's three-dot surface at the two review points rather thanLAST_REVIEW_SHA...HEAD_SHAdirectly. That keeps "what's new since I last looked" while dropping merge-pulled base changes.Happy to open this against the tend repo if you'd like it tracked there — just say the word.
Repro commands
Bot reviews on #3232:
599700c7COMMENTED 06:05:54Z, thenada0e915COMMENTED 06:41:40Z (the one in this report). Intervening commit:6eee3f15 Merge branch 'main' into subprocess-log-format.worktrunk-bot commentedon Jun 26, 2026
Filed upstream so it's tracked against the bundled
reviewskill where the fix lives: max-sixty/tend#734. It carries the reproduction, the three-dot-vs-incremental term-count table, and the proposed filter (restrict thecompare/$LAST_REVIEW_SHA...$HEAD_SHAfile set to files that also appear ingh pr diff). Nothing to change in worktrunk itself.fix(review): leak-free incremental review (three-dot diff + git log -…