Skip to content

fix(powershell): correct false severity claim in a settings comment - #72

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/audit-propagation
Jul 7, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/audit-propagation

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

Context

A cross-repo audit of the consumers that adopt this catalog's configs by copy (kyle-sexton/dotfiles, kyle-sexton/provisioning) surfaced two fixes that appeared to exist downstream without having been propagated to this SSOT. Verification against origin/main showed only one still needs to land:

  1. lychee private-repo exclusions — already upstream, no change. provisioning fixed its scheduled online link-check 404ing on links to private constellation repos (kyle-sexton/provisioning#42 context), and dotfiles just adopted the same fix. This SSOT already carries it via fix(lychee): exclude private constellation repos from the online lane #58: modules/lychee/lychee.toml on main is byte-identical to provisioning's copy (including the later (\.git)? clone-URL arm). The dotfiles copy is actually one revision behind — it predates the (\.git)? refinement — so the flow needed there is a re-copy from here, not a port to here.

  2. PSScriptAnalyzer settings comment — fixed in this PR. The comment above the PSUseDeclaredVarsMoreThanAssignments entry claimed it "promotes to Error". That is factually wrong: a PSScriptAnalyzer settings file cannot re-map a rule's severity; the entry only enables the rule, and findings surface at the shipped Warning (which the top-level Severity filter already lets block). The comment now states the actual behavior. Comment-only; no functional change.

The PSSA fix was deliberately not forked in the consumers, preserving byte-parity with this SSOT — it must land here and flow out via re-copy.

Verification

  • modules/powershell/powershell.test.sh: 3/3 PASS.
  • Invoke-ScriptAnalyzer on the changed file (self-hosted settings): clean.
  • Pre-commit lanes (typos, editorconfig, gitleaks, psscriptanalyzer): all pass.

Propagation

After merge, consumers with copied configs should re-vendor:

  • dotfiles — PSScriptAnalyzerSettings.psd1 (this fix) and modules/lychee/lychee.toml (to pick up the (\.git)? arm it is missing).
  • provisioning — PSScriptAnalyzerSettings.psd1 (its lychee copy is already current).

🤖 Generated with Claude Code

https://claude.ai/code/session_011Bh4hQWCEw3ZJoyQ7nhqVH


Note

Low Risk
Documentation-only comment change in shared PowerShell lint settings; no runtime or enforcement behavior changes.

Overview
Comment-only fix above PSUseDeclaredVarsMoreThanAssignments in PSScriptAnalyzerSettings.psd1.

The old note said unused-variable findings are promoted to Error. That was wrong: enabling a rule in a PSScriptAnalyzer settings file does not change its shipped severity. The comment now says findings stay at the rule’s default Warning, and that the file’s top-level Severity list is what can still make those findings block CI.

No settings keys or rule configuration changed.

Reviewed by Cursor Bugbot for commit afa1834. Bugbot is set up for automated code reviews on this repo. Configure here.

The comment above PSUseDeclaredVarsMoreThanAssignments claimed the entry
promotes the rule to Error, but a PSScriptAnalyzer settings file cannot
re-map a rule's severity — the entry only enables the rule. Restate the
actual behavior: findings surface at the shipped Warning, which the
top-level Severity filter already lets block. Comment-only change.

Found by a cross-repo audit of consumers (dotfiles, provisioning), which
deliberately did not fork the fix locally, preserving byte-parity with
this SSOT so it lands here and flows out via re-copy.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011Bh4hQWCEw3ZJoyQ7nhqVH
@claude

claude Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 51s —— View job


PR Review

  • Read CLAUDE.md and REVIEW.md guidelines
  • Review the PR diff
  • Read the changed file
  • Post review feedback

Verdict: Approve — factually correct, well-worded, no issues.

This is a comment-only change; no functional behaviour is altered.

Technical accuracy

The original comment ("promote to Error") was wrong on two levels:

  1. PSScriptAnalyzer settings files cannot re-map severity. The Rules hashtable only accepts Enable/Disable and rule-specific config keys (e.g. AllowList, TargetVersions). There is no Severity key per-rule. Severity re-mapping was never a supported feature.
  2. The rule ships at Warning, not Error. PSUseDeclaredVarsMoreThanAssignments has a shipped severity of Warning in all PSScriptAnalyzer releases.

The new comment is accurate on both counts, and the cross-reference to the top-level Severity filter (line 21) is correct: Warning is present in @('Error', 'Warning', 'Information'), so findings from this rule do gate cleanly.

Style

The new comment (lines 114–116) is consistent with the surrounding block comments — uses the same em dash (—) convention, capitalises severity names to match PSScriptAnalyzer's own terminology, and wraps at the same column width. No issues.

Verification claims

The PR body states 3/3 tests pass (powershell.test.sh), Invoke-ScriptAnalyzer is clean, and all pre-commit lanes pass. Nothing in this diff could introduce a regression (comment text only), so these claims are credible without re-running.

No concerns. Ready to merge.

cursor[bot]
cursor Bot approved these changes Jul 7, 2026 •
@kyle-sexton
kyle-sexton enabled auto-merge (squash) July 7, 2026 05:36
@claude

claude Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 55s —— View job


  • Read CLAUDE.md and REVIEW.md guidelines (none present in repo)
  • Review the PR diff
  • Read the changed file
  • Post review feedback

PR Review

Verdict: Approve — factually correct, no issues.

The synchronize event was caused by a merge-from-main commit (afa1834). The diff against origin/main is unchanged from the previous review: a single comment block in PSScriptAnalyzerSettings.psd1.

Change

modules/powershell/PSScriptAnalyzerSettings.psd1 lines 114–116

-# Unused variables are bugs in automation scripts — promote to Error.
+# Unused variables are bugs in automation scripts. A settings file
+# cannot re-map a rule's severity, so findings surface at the shipped
+# Warning — which the top-level Severity filter above lets block.

Technical accuracy

The new comment is correct on all three claims:

  1. Settings files cannot remap severity. The Rules hashtable accepts Enable/Disable and rule-specific config keys (e.g. AllowList, TargetVersions). There is no per-rule Severity key.
  2. The rule ships at Warning. PSUseDeclaredVarsMoreThanAssignments has a built-in severity of Warning in all PSScriptAnalyzer releases.
  3. Cross-reference is accurate. Warning appears in the top-level Severity = @('Error', 'Warning', 'Information') at line 21, so findings from this rule do gate correctly.

Style

The new comment uses the same em dash (—) convention and column width as the surrounding block comments. No issues.

No concerns. Ready to merge.

@kyle-sexton
kyle-sexton merged commit 8f12569 into main Jul 7, 2026
4 checks passed
@kyle-sexton
kyle-sexton deleted the fix/audit-propagation branch July 7, 2026 05:37

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low. Cursor Bugbot completed successfully with no findings. Approved this comment-only correction in PSScriptAnalyzer settings; no reviewers assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

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