Repository navigation
fix(powershell): branch skips [switch]/ForEach-Object; closures count scriptblock values only (#8903) - #9056
squid-protocol wants to merge 4 commits into
Conversation
…ures count scriptblock values only (#8903) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
|
PR #9056 @ 0878eaa: 1 failed check(s) == rosetta-audit (failure) -- real |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (6603944) is not the one a maintainer labelled |
|
No description provided. |
|
No description provided. |
|
PR #9056 @ 6603944: 9 failed check(s) == crucible (cancelled) -- infra == full-suite (cancelled) -- infra == ground-truth (cancelled) -- infra == ground-truth part ${{ matrix.shard }} (cancelled) -- infra == ground-truth-warm (cancelled) -- infra == publish-history (cancelled) -- infra == rosetta-audit (failure) -- real == store the suite's durations (cancelled) -- infra == suite time budget (#5166) (cancelled) -- infra |
|
No description provided. |
…completion/odamex.psm1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (2b1122d) is not the one a maintainer labelled |
|
No description provided. |
|
PR #9056 @ 2b1122d: 13 failed check(s) == crucible (cancelled) -- infra == db2 ${{ matrix.shard }} (cancelled) -- infra == full-suite (cancelled) -- infra == full-suite part ${{ matrix.group }}/${{ needs.shard-plan.outputs.splits }} (cancelled) -- infra == ground-truth (cancelled) -- infra == ground-truth part ${{ matrix.shard }} (cancelled) -- infra == ground-truth-warm (cancelled) -- infra == publish-history (cancelled) -- infra == rosetta-audit (failure) -- real == shard ${{ matrix.shard }} (cancelled) -- infra == shard ${{ matrix.shard }} (${{ matrix.loc }} LOC) (cancelled) -- infra == store the suite's durations (cancelled) -- infra == suite time budget (#5166) (cancelled) -- infra |
|
Rescue review (Opus): the code here is sound, and no change was pushed. At head
|
|
No description provided. |
|
Waiting on an owner decision (asked privately, 2026-11-22). Nothing is needed from contributors; work resumes once it is answered. |
|
No description provided. |
…us odamex and prboom-plus DOOM goldens Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
#9056 #9057 #9058 #9059 #9061 #9067) (#9111) * apply #9053 (non-snapshot changes) * apply #9054 (non-snapshot changes) * apply #9057 (non-snapshot changes) * apply #9059 (non-snapshot changes) * apply #9061 (non-snapshot changes) * apply #9067 (non-snapshot changes) * apply #9055 (non-snapshot changes) * golden: re-bless once for the seven stacked engine fixes (#9053 #9054 #9055 #9057 #9059 #9061 #9067) Each of the seven PRs conflicted with the others in the golden-master snapshots, so merging them one at a time would have re-conflicted the rest each time. One combined branch, one bless (crucible_check.py --update --yes through golden-lock.sh, both legs) plus the dartdoom DOOM golden. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * apply #9056 #9058 (non-snapshot changes) * golden: re-bless with #9056 and #9058 folded in (powershell, perl) plus odamex and prboom-plus DOOM goldens Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Fixes #8903 (part of #8863).
What changed
powershell.py:branch:switchno longer counts when it is a type ([switch],[switch[]]);foreachno longer counts when followed by-(ForEach-Object, left tocomprehensions).closures: counts a scriptblock only where it is a value (after=,|,(,,,&,., a-Paramname, or a cmdlet taking one:ForEach-Object,Where-Object,Start-Job,Invoke-Command, ...).function f {},if/else {}and@{}bodies no longer count. Bounds kept (ReDoS-safe).-notalready counts 0 since feat(families): split boolean operators out of branch into short_circuit (leaf families, computed composites) #8939 (boolean split); pinned by a test.Tests:
test_powershell_strict.pygains a parametrized test per issue case, with must-still-count cases (foreach (...),switch (...), if/else,$f = { }). Three existing assertions that assumed a bare{ $_.Name }is a closure now use| % { }.Golden masters re-blessed through
golden-lock.sh crucible_check.py --update --yes. Drift is powershellbranch/closuresplus its consequences: archetype/composition roll-ups,.ps1files embedded in other-language repos (e.g. NVDA), and global 3D layout coordinates shifting by about 1-2 units elsewhere (spatial mapper is global).Class / Sibling gaps
Class: PowerShell keyword-family validity, a keyword counted by spelling instead of syntactic role (type name, iteration cmdlet, any braced block). Members handled here:
[switch]type,ForEach-Object, closures on function/if/else/hashtable bodies,-not. Sibling gaps:Where-Objectwas never inbranch(nothing to do);break/continueinbranchis the deferred relocation (#2832); closures miss a scriptblock passed to a cmdlet not in the allowlist (no burned-estate program needs it). The keyword-rosetta control corpus may owe a rebless (rosetta:rebless-owed); not run here.Gates
pr_gates --fast9/9,--ratchets9 pass 0 fail, powershell tests 285 passed,scope_check --expect powershell: drift outside powershell is limited to embedded.ps1files and layout coordinates.Cross-repo: possible keyword-rosetta rebless after this merges (its CI checks out this repo's main).
Checklist: none given.
🤖 Generated with Claude Code