summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/scripts/baseline_diff.py
diff options
context:
space:
mode:
authorMohamed Hegazy <mhegazy@anthropic.com>2026-10-19 16:51:24 +0000
committerClaude <noreply@anthropic.com>2026-10-19 16:51:24 +0000
commit307800f0aaa7b285390bd1702055881f48098b2d (patch)
tree68accc3bb6e2be1f34f8a319c7e25d7fb7668bef /plugins/code-modernization/scripts/baseline_diff.py
parentea10b213686c90bb1984b2016937310e05336cf3 (diff)
security-guidance: do not review against a baseline from another checkoutmhegazy/sg-stop-baseline-checkout
The turn baseline (stash SHA, HEAD, untracked snapshot) is kept per session, and the Stop review used it in whatever checkout the turn ended in. After the session entered another worktree, that worktree's older commits looked like commits made this turn and its files were diffed against the first checkout's, so code committed long before was reviewed and reported again (anthropics/claude-code#102567). The prompt hook now stores the repo root and the prompt time beside the baseline. When the Stop review runs in a different checkout it leaves the baseline out and uses what that checkout can say for itself: its own HEAD when the turn began (from its reflog) for the commit range, HEAD for file contents, and file times to leave out uncommitted files last written before the turn. A baseline taken after a finding records the checkout it was taken in. A prompt in a folder that is not a repo no longer replaces the untracked snapshot of the kept baseline with an empty one, which made every untracked file in the repo look new at the next Stop. Stop rows carry `bl_origin`: 0 same checkout, 1 another worktree, 2 another repository, 3 a folder that is gone, 4 no baseline; plus 10 or 20 when the baseline is an earlier turn's.
Diffstat (limited to 'plugins/code-modernization/scripts/baseline_diff.py')
0 files changed, 0 insertions, 0 deletions