summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/tests/test_baseline_lookup.py
AgeCommit message (Collapse)Author
2026-10-20security-guidance: find the earlier version of a file reached through a ↵mhegazy/sg-baseline-subdirMohamed Hegazy
symlinked folder When the tool's path and the session directory name the same repo through different symlinks (/tmp and /var on macOS), the relative path between the two spellings left the repo and the lookup found nothing, so a rewrite re-reported code that was already in the file. The lookup now tries again with both paths resolved. The first attempt is unchanged.
2026-10-20security-guidance: write the baseline lookup test files as bytesMohamed Hegazy
The fixture wrote its files with write_text, which stores "\n" as "\r\n" on Windows, so the committed text no longer equalled the string the tests compare against. The files are now written as bytes.
2026-10-19security-guidance: find a rewritten file's earlier version from a repo ↵Mohamed Hegazy
subdirectory A full-file Write is checked against the file as it was at the start of the turn, so risky calls that were already there are not reported as new. The lookup passed git a path relative to the session directory, which git reads from the repo root, so it failed for any session started below the root, and on Windows for any path with a separator. Ask for ./<path> with forward slashes. Fixes #5684