Repository navigation
test(sanitization): reject a workstation path written the way a shell writes it, and a Windows profile that names a person - #101
Merged
Conversation
… writes it, and a Windows profile that names a person The publish check already refuses a workspace path with a drive letter and a backslash. It needed both, so two spellings of the same path went straight past it: - WSL's view of that drive and Git Bash's view of it. Those are precisely the spellings a pasted bash command carries, which is how such a path gets into a published file in the first place - nobody types a Windows path into a document on purpose. - a Windows profile directory under a real user name, which names the operator. The old rule only matched when the next segment was the workspace, so a profile path anywhere else was invisible. Both are now rules in sanitization-patterns.psd1, which means the publisher in the private tree reads them from the same list rather than keeping its own - the drift that made it report "clean" on a tree this suite rejects. The placeholders stay allowed, and have their own test. The README and zconfig.example.json both have to be able to show a reader where their own key lives, and a rule that flags the placeholder along with the real thing does not get tightened later, it gets deleted. A name is matched only when a single separator follows it, so the doubled backslashes of a JSON example are not mistaken for one. Nothing in the repository changes: both rules were run against every publishable file first and found nothing, which is the point - this repo was already clean, and the check is what keeps it that way when the next wholesale copy lands. Verified by planting one of each shape in README.md and watching exactly those two tests go red, then removing them. Full suite: 314 passed, 1 skipped. PSScriptAnalyzer: 0 errors. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…y mistake Invoke-Pester -CI writes testResults.xml into the working tree, it is not in .gitignore, and it was swept into the previous commit. It is build output, not source. 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.
What and why
Part of the fleet sweep that
evo.ehs#1197,evo.provensheet#121andevo.civilcode#55started. This repository had no workstation path toremove — every drive path in its README is an instructional example
(
C:\tools\zscripts,C:\dev\temp,C:\Users\You), which is exactly whatthe public mirror is supposed to contain. So this PR is the check, not a
clean-up.
The publish check already refuses a workspace path with a drive letter and a
backslash. It needed both, so two spellings of the same path went straight
past it:
Both are now rules in
tests/sanitization-patterns.psd1, so the publisher inthe private tree reads them from the same list instead of keeping its own —
the drift that previously made it report "clean" on a tree this suite rejects.
The placeholders stay allowed, and have their own test
README.mdandzconfig.example.jsonboth have to show a reader where theirown key lives. A rule that flags the placeholder along with the real thing
does not get tightened later — it gets deleted. So
C:\Users\You,C:\Users\YourUser,Public,Default,Administratorand the genericUser/Usernameare spared, with three assertions pinning that.A name is matched only when a single separator follows it, so the doubled
backslashes of a JSON example are not mistaken for one.
How it was tested
nothing matched. Nothing in the repository changes.
README.md, watchedexactly those two tests go red with the file and line, removed them, green
again.
Invoke-Pester -Path tests -CI— 314 passed, 1 skipped, 0 failed.Invoke-ScriptAnalyzer -Path . -Recurse— 0 errors (142 pre-existingwarnings, which CI prints and does not gate on).
python scripts/plaintext_twins.py --check— all five twins in sync.🤖 Generated with Claude Code
Note on the commits
Two commits, not one. The first swept in
testResults.xml—Invoke-Pester -CIwrites it into the working tree and it is not in.gitignore— and thesecond removes it. Worth one line in
.gitignoreat some point; left out ofthis PR because it is unrelated to the check.