Skip to content

Strip AI-drafted wait stat content + legacy marker + drop Rule 21 (#215 D3)#266

Merged
erikdarlingdata merged 3 commits into
devfrom
fix/joe-d3-content-strip-and-legacy-marker
Apr 23, 2026
Merged

Strip AI-drafted wait stat content + legacy marker + drop Rule 21 (#215 D3)#266
erikdarlingdata merged 3 commits into
devfrom
fix/joe-d3-content-strip-and-legacy-marker

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • D3: WaitStatsKnowledge Description/HowToFix were AI-drafted without expert review; Joe called this out on the SOS_SCHEDULER_YIELD entry. Stripped all description/fix content; file structure and ShowEffectiveLatency flag stay so content can be filled in by you / Joe later.
  • Framework marker: `IsLegacy` bool on PlanWarning + WarningResult; `LegacyWarningTypes` set in PlanAnalyzer auto-tags rules that predate the benefit-scoring framework. Renderers show a "legacy" badge or `[legacy]` tag across web strip, HTML export, Avalonia plan/node warnings, and text output. Joe's pick: option (a) flipped — tag old rules so new ones don't need re-tagging later.
  • Rule 21 (CTE multi-ref) removed: actual plans already show where time was spent; statement-text pattern-matching on CTE refs is guessing. Dropped the rule, its regex, and helper.
  • Categorization refinements: Joe confirmed Rule 15 is entirely A (no C split); Memory Grant Wait should be B not D (already not in LegacyWarningTypes so it won't carry the legacy tag).

Details

  • `WaitStatsKnowledge.Exact` reduced to the four PAGEIOLATCH entries with only `ShowEffectiveLatency = true` set. Lookup's prefix fallback kept for PAGEIOLATCH_*; everything else returns empty Default.
  • `BenefitScorer.EmitWaitStatWarnings` skips the description separator when empty and nulls `ActionableFix` when HowToFix is empty so renderers don't emit empty "Fix:" blocks.
  • `PlanAnalyzer.MarkLegacyWarnings` runs after AnalyzeStatement + AnalyzeNodeTree per statement. As rules migrate to the new framework, remove their type from `LegacyWarningTypes`.
  • `TextFormatter` grouped-operator path now carries `IsLegacy` through the tuple and emits `[legacy]` when set; also fixed the last two N0 benefit-% formatters that were missed in the v1.7.2 pass.
  • Version 1.7.6 → 1.7.7.

Test plan

  • Text output: Lazy Table Spool (legacy) correctly shows `[legacy]`; new-framework warnings (Filter, Hash Spill, wait entries) do not
  • Wait warnings no longer print description/fix text
  • Build green
  • Visual post-deploy

🤖 Generated with Claude Code

erikdarlingdata and others added 3 commits April 23, 2026 09:49
… 21 (#215 D3, framework marker, Joe's categorization refinements)

D3: WaitStatsKnowledge Description / HowToFix text was AI-drafted without
expert review. Joe flagged the SOS_SCHEDULER_YIELD fix text as misleading
and asked that creative copy come from SQL Server experts, not AI. Stripped
all Description and HowToFix content; kept the file structure and the
ShowEffectiveLatency flag (structural, not creative). Entries are still
emitted but the warning message now shows only the wait name, observed ms
and wait count, and — for PAGEIOLATCH_* — effective latency. Erik / Joe
fill in content over time; the pipeline is ready to render it when they do.

BenefitScorer.EmitWaitStatWarnings now omits the description separator and
sets ActionableFix to null when the entry has no HowToFix, so the renderers
don't print empty "Fix:" prefixes.

Framework marker (option a, flipped): PlanWarning + WarningResult grow an
IsLegacy bool. Joe's preference: tag old rules so new ones don't need
re-tagging when the rest get migrated. A LegacyWarningTypes set in
PlanAnalyzer lists rules that haven't been folded into the benefit-scoring
framework yet; MarkLegacyWarnings post-pass sets IsLegacy = true on matches.
Renderers (web strip, HTML export, Avalonia plan + node warnings,
TextFormatter statement + grouped operator paths) all show a "legacy" badge
or " [legacy]" tag when set.

Rule 21 (CTE referenced multiple times) removed per Joe's feedback —
actual plans already show where time goes; statement-text pattern matching
on CTE references is guessing. Removed the rule, its regex, the rule map
entry, and DetectMultiReferenceCte helper.

TextFormatter operator-warning benefit % now also uses the N1-except-100
formatter so grouped operator output is consistent with the rest of the UI.

Version bump 1.7.6 -> 1.7.7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Prior commit's Python patch script wrote LF line endings. This file is
checked in with CRLF; restoring. No code change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit aabbaa2 into dev Apr 23, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/joe-d3-content-strip-and-legacy-marker branch April 23, 2026 15:22
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