Skip to content

chore: hardening pass and 0.7.21 release prep#106

Merged
georgepwall1991 merged 1 commit into
mainfrom
fix/review-findings
Jul 21, 2026
Merged

chore: hardening pass and 0.7.21 release prep#106
georgepwall1991 merged 1 commit into
mainfrom
fix/review-findings

Conversation

@georgepwall1991

Copy link
Copy Markdown
Owner

Summary

Hardening pass from a full code review, plus 0.7.21 release prep. No diagnostic behavior changes (no diagnostic IDs, severities, messages, or code fixes changed).

Changes

Reliability

  • Fix a potential AD0001 analyzer crash: BindConfiguration(...) registration parsing now handles error-tolerant operations defensively and resolves the configSectionPath argument with a guarded named lookup instead of an unchecked cast and .First() (ConfigContrabandAnalyzer.Registration.cs).

CI honesty

  • Enable the CI analyzer gate: the CI, publish, and CodeQL workflows now build with ContinuousIntegrationBuild=true, so the .NET analyzers actually run as Directory.Build.props always claimed. Triaged every resulting warning (fixed CA1305/CA1822/CA1826/CA1859/CA1861 in src, enabled GenerateDocumentationFile and corrected the latent CS1734/CS0419 it surfaced, suppressed CA1707/IDE0005 for idiomatic test naming). CI-mode builds are now genuinely zero-warning.

Performance

  • Memoize OptionsTypeMetadata per compilation via a ConditionalWeakTable-backed cache (new OptionsMetadataCache.cs), so one registration builds the same options graph once across the validation, nested-validation, and unknown-key passes. Cache is collected with its compilation; thread-safe under EnableConcurrentExecution.
  • Collapse CFG009's HasUnsafeConfigurationUse provenance scan from seven full block traversals to a single document-order walk (ConfigContrabandAnalyzer.ReceiverSemantics.cs).

Robustness

  • Bound the appsettings JSON parser nesting depth (64, matching System.Text.Json) so a pathologically nested additional file is treated as malformed instead of causing an uncatchable StackOverflowException (ConfigurationModel.cs).

Cleanup

  • Remove dead code (empty partial file, three unused helpers, a vestigial local + duplicated receiver-chain walk) and unify four byte-identical traversal predicates into one shared ExecutionScope.ShouldDescend guard.

Showcase

  • Complete the showcase to cover all nine rules: added the missing CFG002, CFG008, and CFG009 examples and regenerated the bundled appsettings.schema.json.

Release

  • Bump to 0.7.21; CHANGELOG, README, analyzer-health.md, and package release notes synchronized.

Verification

  • CI-mode build: 0 warnings, 0 errors
  • Full suite: 930 passed (250 core + 680 analyzer)
  • Formatter gate: pass
  • Both packages pack at 0.7.21 with non-empty releaseNotes
  • Showcase fires all nine rules
  • Independent Codex CLI review: no actionable correctness regressions

- Fix potential AD0001 crash: defensive operation handling and a guarded
  configSectionPath lookup in BindConfiguration registration parsing
- Enable the CI analyzer gate (CI/publish/CodeQL now pass
  ContinuousIntegrationBuild=true) and triage every build warning so
  CI-mode builds are genuinely zero-warning
- Memoize OptionsTypeMetadata per compilation (ConditionalWeakTable) and
  collapse the CFG009 provenance scan to a single traversal
- Bound the appsettings JSON parser nesting depth (64) to avoid an
  uncatchable stack overflow on pathological input
- Remove dead code and unify four duplicate traversal predicates into a
  shared ExecutionScope.ShouldDescend guard
- Complete the showcase to cover all nine rules; regenerate its schema
- Bump to 0.7.21; no diagnostic behavior changes (930 tests green)
@georgepwall1991
georgepwall1991 merged commit 10c42d3 into main Jul 21, 2026
3 checks passed
@georgepwall1991
georgepwall1991 deleted the fix/review-findings branch July 21, 2026 17:36
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