fix(scripts): fail design-intent fixture mutations that match nothing - #2738
Open
Jamie Kim (jkim323) wants to merge 1 commit into
Open
fix(scripts): fail design-intent fixture mutations that match nothing#2738Jamie Kim (jkim323) wants to merge 1 commit into
Jamie Kim (jkim323) wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2738 +/- ##
==========================================
- Coverage 83.17% 82.88% -0.29%
==========================================
Files 180 169 -11
Lines 32201 32411 +210
Branches 25 0 -25
==========================================
+ Hits 26782 26864 +82
- Misses 5416 5547 +131
+ Partials 3 0 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Contributor
Eval Execution |
Katrien De Graeve (katriendg)
approved these changes
Aug 20, 2026
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.
Pull Request
Description
Set-AuthoredTextinscripts/tests/linting/Validate-DesignIntent.Tests.ps1applied anunchecked regex
-replaceto the authored fixture and wrote the result without verifyingthat anything changed. Three call sites passed multi-line patterns containing bare
\n,but the fixture is CRLF on a Windows checkout. Those patterns never matched, the fixture
was never mutated, and the validator correctly reported no issues.
Two tests failed visibly. A third asserted a negative and therefore passed vacuously.
This PR does two things:
Set-AuthoredTextnow compares the substitution resultagainst the original and throws when nothing changed. This is the durable half: it converts
this entire class of defect from silent-green into loud-red across all 19 call sites, and
prevents recurrence regardless of line endings or platform.
\nsequences became\r?\n.CI was unaffected because Linux runners check out LF, which is why
mainwas green.Related Issue(s)
Fixes #2722
Type of Change
Code & Documentation:
Other:
.ps1,.sh,.py)Testing
npm run test:ps -- -TestPath "scripts/tests/linting/Validate-DesignIntent.Tests.ps1"Should -Contain 'schema-violation'; the test failed. Reverted; green again.npm run lint:psscripts/linting/Validate-DesignIntent.ps1unchangedgit status --shortThe passing count rose from 49 to 51 because the two previously-failing tests now do real
work, not because tests were added.
Checklist
Required Checks
Required Local Checks
npm run validate:local- see Additional Notesnpm run spell-checknpm run lint:md-links- see Additional NotesSecurity Considerations
Additional Notes
npm run validate:localhalts atlint:md-linkson pre-existing external link failures inSUPPORT.mdand several RAI and security skill reference files. None of those files aretouched by this PR, and the failures are unrelated external URL responses. Every other
stage of the aggregate passes, including the stages after the halt when run individually:
lint:frontmatter,lint:design-intent,lint:py, andvalidate:skills.One deliberate non-change: the replacement strings still emit LF-only newlines via
`n,so a mutated CRLF fixture ends up with mixed line endings. The YAML parser does not care and
each test operates on a fresh fixture copy, so this has no effect. Normalizing it would
exceed the scope of the issue.