Skip to content

Self-mutation with PSMutant 0.8.0's new operators; config paths resolved the same on every PowerShell - #215

Merged
TaekeK merged 3 commits into
mainfrom
ci/psmutant-new-operators
Oct 19, 2026
Merged

TaekeK merged 3 commits into
mainfrom
ci/psmutant-new-operators

Conversation

@TaekeK

@TaekeK TaekeK commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #214 (the PSMutant 0.8.0 pin); merge that first.

The operators

Turns on the four opt-in operators PSMutant 0.8.0 added: ComparisonOperator, CaseSensitivity, BitwiseOperator and StringOperatorRemoval. #211 already killed the survivors they found. Two equivalents are declared, keyed by function:

  • Get-PSCxUnifiedDiff: $Text -join "`n" -> $Text. The joined text is split on line breaks next, and -split on an array splits each element and flattens.
  • Get-PSCxMarkdownDocument: $scope -join ' ' -> $scope. The value goes into a [string[]] cast, which joins an inner array with $OFS, a single space.

The fix this needed: 0.7.1

The first CI run left one survivor on Linux, and it was real. In Get-PSCxConfigFull, removing the -join survived because PowerShell 7.6 made Join-Path -ChildPath a string[] (PowerShell/PowerShell#24677, a deliberate breaking change). On 7.6 the -join did nothing; on 7.0 to 7.5 it was required, and Join-Path refuses an array there. My local run used 7.5.11, which is why it killed the mutant and CI didn't.

The segments now go in through -AdditionalChildPath, which behaves the same from 6.0 on. With no -join left, there's nothing that only an old host can detect. The path a config resolves to is unchanged; a path with no segments, which would differ by a trailing slash, is already refused by validation. This is a src/ change, so it opens 0.7.1 with a CHANGELOG entry.

Measured locally

  • Full self-mutation, PSMutant 0.8.0, 7.5.11, before the fix: 100%, 1517 of 1517.
  • Config.ps1 after the fix: 100%, 197 of 197, on both 7.6.7 and 7.5.11.
  • On 7.6.7: suite 1312 passed, 0 failed; coverage 100%; lint clean; complexity gate passes; release gate consistent at 0.7.1.

The general question of how to handle version differences is in the two issues filed next to this.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L4PLMohmpdckWENoxtHAyn

TaekeK and others added 3 commits October 19, 2026 18:18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4PLMohmpdckWENoxtHAyn
Adds ComparisonOperator, CaseSensitivity, BitwiseOperator and
StringOperatorRemoval, and declares the two equivalent -join removals in
Get-PSCxUnifiedDiff and Get-PSCxMarkdownDocument.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4PLMohmpdckWENoxtHAyn
PowerShell 7.6 made Join-Path -ChildPath a string[], so the -join in
Get-PSCxConfigFull did nothing on 7.6 and was required on 7.0 to 7.5.
StringOperatorRemoval's mutant survived the 7.6 suite for that reason.
The segments now go in through -AdditionalChildPath, which behaves the
same from 6.0 on. Opens 0.7.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4PLMohmpdckWENoxtHAyn
@TaekeK TaekeK changed the title ci: self-mutation with PSMutant 0.8.0's four new operators Self-mutation with PSMutant 0.8.0's new operators; config paths resolved the same on every PowerShell Oct 19, 2026
@TaekeK
TaekeK merged commit 0da5c14 into main Oct 19, 2026
4 checks passed
@TaekeK
TaekeK deleted the ci/psmutant-new-operators branch October 19, 2026 17:59
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.

1 participant