fix: make audit runs side-effect free - #2
Merged
Merged
Conversation
A tracked note that changes on every run is the same signal the evidence chain uses to say something moved, so the suite must not produce it by itself. Two causes, both removed. The bomb notes carried the milliseconds the run took, which is a fact about the machine rather than about FilePass; the outcome stays in the note and the timing goes to audit/run/, which is not tracked. And resource.test.ts appended to a file sabotage.test.ts truncates at load, so what the file ended up holding depended on which of the two finished last - that append moves to the same untracked run log. .gitattributes pins the generated evidence to LF. The tests write LF, a Windows checkout under core.autocrlf=true holds CRLF, and every run left the whole set looking modified even where not a byte of content had changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An audit run used to rewrite a tracked evidence file. That is the same signal the
evidence chain uses to say something moved, so the suite must not produce it by itself.
What was actually wrong
Measured rather than assumed: a full audit run left eleven files showing as modified,
but
git diff --numstatshowed ten of them byte-identical. Exactly one line ofcontent had changed:
Three separate causes, all removed:
A timing in tracked evidence. Milliseconds are a fact about the machine, not
about FilePass. The outcome (
refused: <message>) stays inaudit/sabotage-notes.txt;the timing goes to
audit/run/, which is now ignored.A foreign append — the latent half.
audit/resource.test.tsappended to a filethat
audit/sabotage.test.tstruncates at module load. What the file ended up holdingdepended on which of the two finished last. In the observed run the line simply
vanished; under another interleaving it would have dirtied the tree instead. That
append moves to the same ignored run log.
Line endings. The remaining ten came from the tests writing LF while a Windows
checkout under
core.autocrlf=trueholds CRLF..gitattributespins the generatedevidence to
eol=lf. Without it, "clean working tree" is permanently a false signalon Windows — worse for an evidence chain than the timing line was.
The rule this establishes
Evidence
Run after the commit, on Windows with
core.autocrlf=true:tsc --noEmitvite buildgit status --porcelainafter a full audit runThe
.gitattributesaddition carries a renormalisation risk, so it was checkedexplicitly rather than assumed:
git ls-files --eolreportsi/lf w/lffor theevidence set, and
git add --renormalize .stages nothing. The commit touches sixfiles and no evidence file was dragged in by EOL normalisation.
Merge gate
Full product and audit suites pass, and a complete audit run leaves the tracked
working tree clean on Windows with
core.autocrlf=true.Known and deliberately not fixed here
Two more instances of the same class, left alone because closing them changes the
layout of evidence files that earlier review rounds cite:
audit/gaps.test.tsappends toaudit/evidence-notes.txt, whichaudit/evidence.test.tswrites.audit/icc-check.test.tsappends toaudit/review-attacks.txt, whichaudit/review-attacks.test.tswrites.Both contents are deterministic; the ordering across test files is not. Tracked as a
follow-up: Evidence-file ownership — one tracked evidence artifact = one writer.
Existing citable evidence stays stable; each test either owns exactly one tracked file
or writes volatile run data to
audit/run/only.No tag, release or deploy is proposed by this PR.
🤖 Generated with Claude Code