chore: clear the CodeQL backlog and add codeql.yml query-filters (Standards §4.4, §3.0.1) - #32
Merged
Merged
Conversation
Prepares the repo for NextIteration.Standards §4.12, which requires a code_scanning merge-protection rule at alerts_threshold: all — every open alert blocks merge, so the backlog has to be resolved or dismissed first. §3.0.1 / §4.4 — codeql.yml gains the canonical query-filters block excluding cs/unmanaged-code and cs/call-to-unmanaged-code. This package has no P/Invoke so it matches nothing; it is carried because the workflow must equal the template in non-comment content. Closes the `3.0.1 workflow content` row. Genuine fixes, no suppression hacks: - Path.Combine -> Path.Join, 134 sites across src and tests. Combine returns its last rooted argument and drops what precedes it; Join always concatenates. ValidateAssetName already rejects rooted and separator-bearing asset names, so this is defence in depth, not a live-defect fix. - cs/linq/missed-where + missed-select: DefaultAssetResolver's five matcher loops become FirstOrDefault/Any predicates (the RID walk stays lazy), Sha256SumsManifest.Parse maps with Select, UpdateInstaller.IsPreserved filters with Where/Any behind a named helper. - cs/local-not-disposed: ten test-local TestConsole instances now use `using`. - cs/useless-assignment-to-local: dropped the unread `first` binding. Three cs/local-not-disposed sites are deliberately NOT fixed and now carry a comment saying why: the console escapes its harness method via the return value and the calling test reads console.Output afterwards, so disposing at the creation site closes the writer before the command writes to it. Applying `using` there failed 46 tests with ObjectDisposedException. The 19 cs/catch-of-all-exceptions alerts are all deliberate boundary or best-effort catches, several of them contractual — IUpdateSource's XML docs require implementations to swallow transient failures and return null, and CleanupOldInstall documents that failures are swallowed and retried. Narrowing them would break the documented contract, so they are for dismissal, not fixes. Release build: 0 warnings. 392 tests (196 × net8.0/net10.0) pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Replaces #30, which GitHub auto-closed when its base branch (
chore/standards-style-baseline, #29) was deleted on merge. Same commit, rebased ontomain.Prepares the repo for §4.12, which requires a
code_scanningmerge-protection rule atalerts_threshold: all. Every open alert blocks merge under that rule, so the 177-alert backlog has to be resolved or dismissed before the setting can go on.§3.0.1 / §4.4 —
query-filterscodeql.ymlgains the canonicalquery-filtersblock excludingcs/unmanaged-codeandcs/call-to-unmanaged-code. This package contains no P/Invoke, so the block matches nothing here — it is carried because §3.0.1 requires the workflow to equal the template in non-comment content, and a repo that omits it has forked the template rather than customised it. Closes the3.0.1 workflow contentaudit row.Alerts fixed
cs/path-combinePath.Combine→Path.Join,src+testscs/catch-of-all-exceptionscs/local-not-disposedusing; 3 deliberately not (see below)cs/linq/missed-whereWhere/Anypredicatescs/linq/missed-selectSelectcs/useless-assignment-to-localPath.Join—Path.Combinereturns its last rooted argument and silently discards everything before it. Nothing here was reachable with a rooted segment:ValidateAssetNamerejects rooted and separator-bearing asset names before any path is built. So this is defence in depth on the install-directory path construction, not a fix for a live defect.Three alerts deliberately not fixed
Three
cs/local-not-disposedsites create aTestConsolethat escapes its harness method via the return value; the calling test readsconsole.Outputafter that method returns. Applyingusingat the creation site closes the writer before the command under test writes to it — I tried it, and it failed 46 tests withObjectDisposedException. Those three now carry a comment explaining why they are notusing, and are for dismissal as false positives.The 19 generic catches
All are deliberate boundary or best-effort catches, and several are contractual:
IUpdateSource's XML docs require implementations to swallow transient failures and returnnullrather than throw, andCleanupOldInstalldocuments that failures are swallowed and retried next startup. Narrowing them would convert documented never-throw contracts into throwing paths. These are for dismissal with justification — the same treatment Auth gave its boundary catches — not code changes.Verification
Release build: 0 warnings, 0 errors.
dotnet test --configuration Release: 392 passed, 0 failed (196 ×net8.0/net10.0).No change to the public surface or package contents.
🤖 Generated with Claude Code