Skip to content

Scrub temp paths on Windows too, and put Windows in CI - #20

Merged
LuShadowX merged 3 commits into
mainfrom
windows-path-scrubbing
Aug 8, 2026
Merged

Scrub temp paths on Windows too, and put Windows in CI#20
LuShadowX merged 3 commits into
mainfrom
windows-path-scrubbing

Conversation

@LuShadowX

Copy link
Copy Markdown
Owner

The per-run temp directory patterns were POSIX-only: built from /-separated
strings and ending in /[^/]+. A Windows temp path is
C:\Users<user>\AppData\Local\Temp<random>, which none of them could match,
so the varying segment survived into recorded write paths and two runs of
identical code compared unequal. That is false-positive cause 4 from 0.1.0,
returning on a new platform.

Separators are normalised before matching and on the way out, so a path is
recorded the same way whichever OS wrote it. AppData and Windows\Temp are
matched explicitly and case-insensitively, so a recording made on another
machine scrubs too.

windows-latest joins the test matrix, since the claim is not worth making
without it.

Closes #17

The per-run temp directory patterns were POSIX-only: built from /-separated
strings and ending in /[^/]+. A Windows temp path is
C:\Users\<user>\AppData\Local\Temp\<random>, which none of them could match,
so the varying segment survived into recorded write paths and two runs of
identical code compared unequal. That is false-positive cause 4 from 0.1.0,
returning on a new platform.

Separators are normalised before matching and on the way out, so a path is
recorded the same way whichever OS wrote it. AppData and Windows\Temp are
matched explicitly and case-insensitively, so a recording made on another
machine scrubs too.

windows-latest joins the test matrix, since the claim is not worth making
without it.

Closes #17
Given an absolute path, pytest walks up looking for a rootdir. On Windows
that reaches C:\ and dies on the permission-denied "Documents and Settings"
junction, so every test that spawns a pytest subprocess failed on
windows-latest with Python 3.9.
Same Windows rootdir problem as the other two fixtures.
@LuShadowX
LuShadowX merged commit 59a0941 into main Aug 8, 2026
10 checks passed
@LuShadowX
LuShadowX deleted the windows-path-scrubbing branch August 8, 2026 03:38
LuShadowX added a commit that referenced this pull request Aug 8, 2026
* Bring the README's platform, comparator and overhead claims up to date

Windows is tested in CI as of #20, numpy arrays are compared as of #19, and
recording has cost ~8x rather than 15-20x since the back-off work.

* Let check compare two arbitrary refs

check took one ref and always compared it against the working tree, so
reviewing someone else's branch or auditing a release meant checking it out
first. A second optional positional ref is now the candidate:

    nodrift check HEAD~1 HEAD

With no second ref the working tree is still the candidate, which is the
common case.

Closes #11

* Strip compiled bytecode from staged trees

A repository with __pycache__ committed hands the replay bytecode compiled
from other source. Python runs it in preference to the file git archive just
materialised, so both versions behave identically and check reports no
behaviour change while the code genuinely differs.

Found while testing two-ref comparison: a tree staged from a commit
containing POSITIVE replayed as positive, and check called it clean. The
one-ref path had the same hole.

Silent wrongness rather than an error, which is the worst failure this tool
has. Compiled artifacts are now removed from every staged tree, exported or
copied. The regression test commits stale bytecode deliberately and fails
without the fix.
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.

Windows: temp-path scrubbing assumes POSIX separators

1 participant