Assert the PowerShell floor install.ps1 already documents - #704
Merged
Conversation
install.ps1 says at line 44 that Windows PowerShell 5.1 and 7+ both run it and that nothing uses 7-only syntax. That is true today -- no null-coalescing, no ternary, no pipeline chains, no -Parallel -- and nothing enforces it. Which is the shape found repeatedly in this repository this week: the intent is written where a reader looks and the enforcement is somewhere else, or nowhere. The failure it protects against is worse than an ordinary one. PowerShell parses the whole file before executing any of it, so a single `??` fails before the installer's own diagnostics can run. A 5.1 user would not see "Node.js 22.23.2 or newer is required" or "Nothing was installed" -- they would see a syntax error from a file they did not write, about a version nobody told them they needed. CI does run install.ps1 under both powershell.exe and pwsh, and that proves it works on a day someone maintains those jobs. This proves it on the day someone writes `??`. Comments are excluded from the scan so the file can keep naming these constructs while explaining why it avoids them -- which is exactly what line 45 does. Verified by injecting each construct: three injections, three failures, and the restored file green. Limit: a documented floor is enforced, or it is a preference Blast: local Undo: easy Certainty: firm Provenance: authored Record-Id: r-703ps51
CommitLore — record lintTrailers: clean — 1 commit in Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
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.
Closes #703.
install.ps1:44already says it:Measured, and true today —
??,?.,&&/||, ternary,-Parallel,-AsHashtable: zero each. Nothing enforces it.The intent is written where a reader looks and the enforcement is nowhere. Same
shape as everything else found here this week.
Why this floor is worth asserting rather than discovering
PowerShell parses the whole file before executing any of it. A single
??failsat parse time, so the installer's own diagnostics never run — a 5.1 user would
not see Node.js 22.23.2 or newer is required or Nothing was installed. They
would see a syntax error from a file they did not write, about a version nobody
told them they needed.
CI does run
install.ps1under bothpowershell.exeandpwsh. That proves itworks on a day someone maintains those jobs. This proves it on the day someone
writes
??.Details
Comments are excluded from the scan, so the file can keep naming these
constructs while explaining why it avoids them — which is what line 45 does. The
second assertion pins that the file still states the floor in prose, because a
contributor who does not know 5.1 is supported cannot keep it.
Verified by injection:
Test-only; no code, no artifact change.