From 008dbcdbf72e23be4c3469b011c2262a23f16a79 Mon Sep 17 00:00:00 2001
From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com>
Date: Fri, 23 Oct 2026 16:23:25 -0400
Subject: [PATCH 1/2] Web pages say MCP field names and raw collector counts in
words (#6649)
---
.../WebPartialWindowBehaviourTests.cs | 10 +++
Darling/Darling.Tests/WebPlainTextTests.cs | 69 +++++++++++++++++--
.../web-partial-window-harness.mjs | 5 ++
.../Darling.Tests/web-plain-text-harness.mjs | 2 +-
.../wwwroot/js/pages/collector-run.js | 3 +-
.../wwwroot/js/pages/server-tabs.js | 2 +-
.../wwwroot/js/panels.js | 4 +-
.../wwwroot/js/plain-text.js | 48 ++++++++++---
.../wwwroot/js/read-fields.js | 2 +-
.../wwwroot/js/util.js | 5 +-
10 files changed, 128 insertions(+), 22 deletions(-)
diff --git a/Darling/Darling.Tests/WebPartialWindowBehaviourTests.cs b/Darling/Darling.Tests/WebPartialWindowBehaviourTests.cs
index 7fb9543c74..263779e23b 100644
--- a/Darling/Darling.Tests/WebPartialWindowBehaviourTests.cs
+++ b/Darling/Darling.Tests/WebPartialWindowBehaviourTests.cs
@@ -165,6 +165,16 @@ public void AnAlertBodyOnTheWeb_ShowsItsTimeLinesLocal_AndLeavesStatementsAndSer
Assert.Contains("Incident Since: 2026-10-12 23:13:00Z", G("bodyRaw"));
}
+ [Fact]
+ public void TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndLeavesAStatementLineAlone()
+ {
+ // #6649: Alert History printed "in 1 source(s)"; the statement line under it is data and prints as stored.
+ var body = Run().GetProperty("h2").GetProperty("auditBody").GetString()!;
+ Assert.Contains("in 1 source, where usual", body);
+ Assert.DoesNotContain("source(s)", body);
+ Assert.Contains("note = '3 file(s)'", body);
+ }
+
[Fact]
public void ACappedPanelsHeading_DropsItsWindowLabel_AndAnyOtherKeepsIt()
{
diff --git a/Darling/Darling.Tests/WebPlainTextTests.cs b/Darling/Darling.Tests/WebPlainTextTests.cs
index eac1922583..4e2647c422 100644
--- a/Darling/Darling.Tests/WebPlainTextTests.cs
+++ b/Darling/Darling.Tests/WebPlainTextTests.cs
@@ -27,7 +27,7 @@ public sealed class WebPlainTextTests
{
private static string[] Run(string[] inputs, out string notCollectedLine) => RunDoc(inputs, out notCollectedLine).Out;
- private static (string[] Out, string[] Named, string[] Tools, string[] Labels, string[] Actions) RunDoc(string[] inputs, out string notCollectedLine)
+ private static (string[] Out, string[] Named, string[] Tools, string[] Labels, string[] Actions, string[] Counts) RunDoc(string[] inputs, out string notCollectedLine)
{
var psi = new ProcessStartInfo("node") { RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false };
psi.ArgumentList.Add(PathTo("Darling", "Darling.Tests", "web-plain-text-harness.mjs"));
@@ -43,7 +43,7 @@ private static (string[] Out, string[] Named, string[] Tools, string[] Labels, s
{
Assert.Skip("Node is not installed, so the shipped page script cannot be run.");
notCollectedLine = "";
- return ([], [], [], [], []);
+ return ([], [], [], [], [], []);
}
using (proc)
@@ -60,7 +60,7 @@ private static (string[] Out, string[] Named, string[] Tools, string[] Labels, s
using var doc = JsonDocument.Parse(output.Split('\n').First(l => l.StartsWith('{')));
notCollectedLine = doc.RootElement.GetProperty("line").GetString()!;
string[] Strs(string name) => doc.RootElement.GetProperty(name).EnumerateArray().Select(e => e.GetString()!).ToArray();
- return (Strs("out"), Strs("named"), Strs("tools"), Strs("labels"), Strs("actions"));
+ return (Strs("out"), Strs("named"), Strs("tools"), Strs("labels"), Strs("actions"), Strs("counts"));
}
}
@@ -98,6 +98,61 @@ public void CollectorMeasurementCounts_ReadAsWords()
Assert.Equal("latest run: shred gated: 1, events read: 0, report xml empty: 0", o[0]);
}
+ /* #6649: the left-out databases pointer, the baseline window sentence and the memory clerk column name reached the page
+ with the MCP answer's field names in them. */
+ [Fact]
+ public void FieldNamesInTheServicesOwnSentences_ReadAsThePagesWords()
+ {
+ var o = Run(
+ [
+ "No Query Store rows in the 24-hour window for a database this server still has. 29 database(s) the server no longer lists were left out of this read (see databases_left_out).",
+ "Here the window starts at baseline_start, so the baseline holds only the part from effective_start to baseline_end.",
+ "The clerk is in the newest capture's top 25; latest_memory_mb is its current footprint.",
+ "The clerk appeared earlier in the window and has since dropped out of the collector's top 25; latest_memory_mb is its last observed footprint, not its current one.",
+ ], out _);
+ Assert.Equal("No Query Store rows in the 24-hour window for a database this server still has. 29 databases the server no longer lists were left out of this read.", o[0]);
+ Assert.Equal("Here the window starts before the baseline period, so the baseline holds only the part the store has.", o[1]);
+ Assert.Equal("The clerk is in the newest capture's top 25; Latest MB is its current footprint.", o[2]);
+ Assert.Contains("Latest MB is its last observed footprint", o[3]);
+ foreach (var line in o)
+ {
+ Assert.DoesNotContain("_left_out", line);
+ Assert.DoesNotContain("baseline_start", line);
+ Assert.DoesNotContain("effective_start", line);
+ Assert.DoesNotContain("_mb is", line);
+ Assert.DoesNotContain("(s)", line);
+ }
+ }
+
+ /* #6649: a count can be negative or have a fraction, and either ended the run of pairs, so the whole note stayed raw. */
+ [Fact]
+ public void ACountRunWithANegativeOrFractionalValue_StillReadsAsWords()
+ {
+ var o = Run(
+ [
+ "latest run: plans_rendered=0 plans_rendered_bytes=-12 plan_fetch_ms=0.5 deferred_hit=0",
+ "latest run: ring_buffer_truncated=1 ring_buffer_events_hidden=167 newest_visible_event_age_s=4300 statement_scrub_named=0",
+ ], out _);
+ Assert.Equal("latest run: plans rendered: 0, plans rendered bytes: -12, plan fetch ms: 0.5, deferred hit: 0", o[0]);
+ Assert.DoesNotContain("=", o[0]);
+ Assert.DoesNotContain("=0 ", o[1] + " ");
+ Assert.DoesNotContain("=", o[1]);
+ }
+
+ /* #6649: the collection log's Error cell holds a failed run's error and a successful run's note. The note's counts are said in
+ words; a real error message keeps everything else, a lone key=value pair and any tool-looking word included. */
+ [Fact]
+ public void TheCollectionLogMessage_SaysItsCountsInWords_AndLeavesAnErrorAlone()
+ {
+ var (_, _, _, _, _, counts) = RunDoc(
+ [
+ "ring_buffer_truncated=1 ring_buffer_events_hidden=167 newest_visible_event_age_s=4300",
+ "Connection failed (timeout=30): relation \"get_orders\" is not available; widen hours_back",
+ ], out _);
+ Assert.Equal("ring buffer truncated: 1, ring buffer events hidden: 167, newest visible event age s: 4300", counts[0]);
+ Assert.Equal("Connection failed (timeout=30): relation \"get_orders\" is not available; widen the time range", counts[1]);
+ }
+
/* #5644 W8 (live check): the CPU and Memory pages have no bucket control, the Waits and Activity notes print raw field names, and a
window count printed "24 hour(s)". */
[Fact]
@@ -224,7 +279,7 @@ public void TheNamedRules_TouchOnlyTheNamedTokens()
"column \"last_error\" of relation \"x\" does not exist",
"denied_since_last_success is true; move as_of or widen days_back",
];
- var (_, named, _, _, _) = RunDoc(inputs, out _);
+ var (_, named, _, _, _, _) = RunDoc(inputs, out _);
Assert.Equal("Could not find 'dbo.get_orders' (timeout=30); widen the time range or use get_collection_health", named[0]);
/* Round-2 L1: a Last Error can quote a real relation or column, so field and table names are not rewritten here. */
Assert.Equal("latest run: events_read=4 shred_gated=1 and last_error shows it", named[1]);
@@ -293,7 +348,7 @@ public void CapitalsForEmphasis_AreLowerCased_AndAcronymsWaitTypesAndNamesAreNot
[Fact]
public void ThePlainNamedPath_NeverLowerCasesOrDropsAnything()
{
- var (_, named, _, _, _) = RunDoc(["Last error: DID NOT connect; try analyze_server"], out _);
+ var (_, named, _, _, _, _) = RunDoc(["Last error: DID NOT connect; try analyze_server"], out _);
Assert.Equal("Last error: DID NOT connect; try analyze_server", named[0]);
}
@@ -301,7 +356,7 @@ public void ThePlainNamedPath_NeverLowerCasesOrDropsAnything()
public void TheToolNameList_IsExactlyTheRegisteredGetTools()
{
/* The get_ rule rewrites only these names, so the list must be the MCP tool registry's get_ tools, both ways. */
- var (_, _, tools, _, actions) = RunDoc([], out _);
+ var (_, _, tools, _, actions, _) = RunDoc([], out _);
if (tools.Length == 0)
{
return;
@@ -330,7 +385,7 @@ public void TheToolNameList_IsExactlyTheRegisteredGetTools()
[Fact]
public void TheMeasurementLabelList_CoversEveryLabelTheCollectorsWrite()
{
- var (_, _, tools, labels, _) = RunDoc([], out _);
+ var (_, _, tools, labels, _, _) = RunDoc([], out _);
if (tools.Length == 0)
{
return;
diff --git a/Darling/Darling.Tests/web-partial-window-harness.mjs b/Darling/Darling.Tests/web-partial-window-harness.mjs
index 54e25957d4..758d78a68a 100644
--- a/Darling/Darling.Tests/web-partial-window-harness.mjs
+++ b/Darling/Darling.Tests/web-partial-window-harness.mjs
@@ -113,6 +113,10 @@ const alertBody = [
"",
"Newest blocked process sample: 23:12:45 UTC, 5m 20s old",
].join("\n");
+const auditBody = [
+ "Retained history for 2026-10-20 (UTC) fell below half of the usual pace for that hour in 1 source(s), where usual is the median of the 7 days before.",
+ " Blocked Query: SELECT 1 WHERE note = '3 file(s)'",
+].join("\n");
const sample = { source: "blocked process", instant_utc: "2026-10-12T23:12:45.0000000Z", age_seconds: 320 };
out.h2 = {
spaceZ: localizeIsoText("until 2026-10-11 12:48:52Z"),
@@ -130,6 +134,7 @@ out.h2 = {
stripUtc: noticeStrip("until 2026-10-11 12:48:52Z").textContent,
here: { inc: here("2026-10-12T23:13:00Z"), fail: here("2026-10-12T07:00:00Z"), end: here("2026-10-12T08:00:00Z"), samp: here("2026-10-12T23:12:45Z") },
bodyRaw: alertBody,
+ auditBody: localizeAlertDetail(auditBody, null),
};
console.log(JSON.stringify(out));
diff --git a/Darling/Darling.Tests/web-plain-text-harness.mjs b/Darling/Darling.Tests/web-plain-text-harness.mjs
index fb7022ec00..346bca68c9 100644
--- a/Darling/Darling.Tests/web-plain-text-harness.mjs
+++ b/Darling/Darling.Tests/web-plain-text-harness.mjs
@@ -8,4 +8,4 @@ import { pathToFileURL } from "node:url";
const jsDir = process.argv[process.argv.length - 1];
const mod = await import(pathToFileURL(path.join(jsDir, "plain-text.js")).href);
const inputs = JSON.parse(process.env.HARNESS_INPUT);
-console.log(JSON.stringify({ out: inputs.map((t) => mod.plainText(t)), named: inputs.map((t) => mod.plainTextNamed(t)), line: mod.NOT_COLLECTED_LINE, tools: mod.MCP_TOOL_NAMES, labels: mod.MEASUREMENT_LABELS, actions: mod.MCP_ACTION_TOOL_NAMES }));
+console.log(JSON.stringify({ out: inputs.map((t) => mod.plainText(t)), named: inputs.map((t) => mod.plainTextNamed(t)), counts: inputs.map((t) => mod.plainTextCounts(t)), line: mod.NOT_COLLECTED_LINE, tools: mod.MCP_TOOL_NAMES, labels: mod.MEASUREMENT_LABELS, actions: mod.MCP_ACTION_TOOL_NAMES }));
diff --git a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/pages/collector-run.js b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/pages/collector-run.js
index 09e57acb98..271a46c21d 100644
--- a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/pages/collector-run.js
+++ b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/pages/collector-run.js
@@ -15,6 +15,7 @@
import { el, mount, apiGet, apiGetFleet, apiWrite, readTool } from "../util.js";
import { getSession, peekSession } from "../views-api.js";
+import { plainTextCounts } from "../plain-text.js";
const POLL_MS = 2000;
const GIVE_UP_MS = 15 * 60 * 1000;
@@ -158,7 +159,7 @@ function resultTable(rows) {
el("td", {}, [run.collection_time ? new Date(run.collection_time).toLocaleString() : ""]),
el("td", {}, [String(run.status || "")]),
el("td", {}, [run.rows_collected == null ? "" : String(run.rows_collected)]),
- el("td", {}, [run.error_message ? String(run.error_message) : ""]),
+ el("td", {}, [run.error_message ? plainTextCounts(String(run.error_message)) : ""]),
])
);
return el("table", { class: "data-table" }, [el("thead", {}, [head]), el("tbody", {}, body)]);
diff --git a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/pages/server-tabs.js b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/pages/server-tabs.js
index 361c97daf2..9afdebd524 100644
--- a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/pages/server-tabs.js
+++ b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/pages/server-tabs.js
@@ -5515,7 +5515,7 @@ const COLLECTION_LOG_COLUMNS = [
{ key: "sql_store_ms", label: "Store (in SQL)", format: "ms" },
{ key: "store_duration_ms", label: "On Store", format: "ms" },
{ key: "rows_collected", label: "Rows", format: "int" },
- { key: "error_message", label: "Error", wrap: true, localizeText: true },
+ { key: "error_message", label: "Error", wrap: true, localizeText: true, plain: "counts" },
];
/* #5227: the collector picked on the Collectors panel, keyed by server at MODULE scope so the 60 s rebuild of the tab
diff --git a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js
index fc0f22c173..488305f9bf 100644
--- a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js
+++ b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js
@@ -52,7 +52,7 @@ import {
localizeAlertDetail,
} from "./util.js";
import { zoomableLineChart, chartZoomScope, SERIES_COLORS } from "./charts.js";
-import { plainText, plainTextNamed } from "./plain-text.js";
+import { plainText, plainTextNamed, plainTextCounts } from "./plain-text.js";
import { toTsv, toCsv, isListValue, csvFileName, copyText, downloadCsv } from "./grid-tools.js";
import {
VALUE_LIST_MAX_LEN,
@@ -1317,6 +1317,8 @@ function cell(row, c) {
? "—"
: c.plain === "named"
? plainTextNamed(String(raw))
+ : c.plain === "counts"
+ ? plainTextCounts(String(raw))
: c.plain
? plainText(String(raw))
: String(raw);
diff --git a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js
index 64a932f39b..793629f156 100644
--- a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js
+++ b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js
@@ -190,6 +190,35 @@ export function plainTextNamed(text) {
return namedTokenText(text);
}
+/**
+ * A collector's measurement counts put into words (shred_gated=1 events_read=0 -> "shred gated: 1, events read: 0"), and the
+ * underscore form of the same counts. Only these two rules apply to text that may echo a real error message (a collection
+ * log's Error cell holds a failed run's error and a successful run's note in the same column).
+ */
+function measurementCountsText(text) {
+ let t = text;
+
+ /* A collector's measurement counts: shred_gated=1 events_read=0 report_xml_empty=0. A run of two or more pairs, or a
+ lone pair whose label a collector really writes; any other lone pair, such as timeout=30 in a driver message, stays. */
+ t = t.replace(/(?
+ run.includes(" ") || LABEL_SET.has(run.slice(0, run.indexOf("="))) ? pairsToText(run) : run,
+ );
+
+ /* The same counts written with an underscore for the "=": a run of two or more name_digits words. A lone word such as
+ pg_stat_statements_1 is left alone, so a real object name followed by a number is not rewritten. */
+ t = t.replace(/(?
- run.includes(" ") || LABEL_SET.has(run.slice(0, run.indexOf("="))) ? pairsToText(run) : run,
- );
-
- /* The same counts written with an underscore for the "=": a run of two or more name_digits words. A lone word such as
- pg_stat_statements_1 is left alone, so a real object name followed by a number is not rewritten. */
- t = t.replace(/(? plainText(line));
+ out = out.replace(/^(\s*(?:Incident Since|Started|Failed At|Snapshot|From|To|Window): )(.*)$/gm,
(m, lead, value) => lead + localizeIsoText(value));
const at = sample && typeof sample.instant_utc === "string" ? parseUtc(sample.instant_utc) : null;
if (at) {
From ba5ae5564a3ee5ef664a7163438cb1846dd8a922 Mon Sep 17 00:00:00 2001
From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com>
Date: Sat, 24 Oct 2026 03:00:07 -0400
Subject: [PATCH 2/2] Fix the round-1 review findings on the web plain-text
names change (#6649)
The audit alert rewrite matches its own sentence, not the line (the body is one line); all four memory clerk note arms are handled; the C# sentences the page rewrites are read from their owners (one shared constant for Darling and Lite); the cell() counts mode has a behaviour test.
---
.../DarlingQueryStoreRegressionsTests.cs | 4 +--
.../WebClampCellBehaviourTests.cs | 18 ++++++++++
.../Darling.Tests/WebDataStartNoteTests.cs | 2 +-
.../WebPartialWindowBehaviourTests.cs | 33 +++++++++++++++----
Darling/Darling.Tests/WebPlainTextTests.cs | 20 ++++++++---
.../Darling.Tests/web-clamp-cell-harness.mjs | 17 ++++++++++
.../web-partial-window-harness.mjs | 10 +++---
.../Mcp/DarlingMcpQueryStoreClutterTools.cs | 22 ++++++++++---
.../DarlingMcpQueryStoreRegressionTools.cs | 2 +-
.../wwwroot/js/panels.js | 8 ++---
.../wwwroot/js/plain-text.js | 5 ++-
.../wwwroot/js/util.js | 7 ++--
Lite/Mcp/McpQueryTools.cs | 2 +-
.../QueryStoreRegressionRules.cs | 6 ++++
14 files changed, 122 insertions(+), 34 deletions(-)
diff --git a/Darling/Darling.Tests/DarlingQueryStoreRegressionsTests.cs b/Darling/Darling.Tests/DarlingQueryStoreRegressionsTests.cs
index 4e2af91572..69ae867125 100644
--- a/Darling/Darling.Tests/DarlingQueryStoreRegressionsTests.cs
+++ b/Darling/Darling.Tests/DarlingQueryStoreRegressionsTests.cs
@@ -385,8 +385,8 @@ await LiveStoreCleanup.RunAsync(cs!, bodySucceeded, async (cleanup, cleanupCt) =
}
}
- /// The truncated-baseline sentence Lite adds to its note, which this tool copies.
- private const string BaselineTail = "Here the window starts at baseline_start, so the baseline holds only the part from effective_start to baseline_end.";
+ /// The truncated-baseline sentence both products add to the note: one constant in Common (#6649).
+ private const string BaselineTail = PerformanceMonitor.Common.QueryStoreRegressionRules.BaselineWindowTail;
///
/// #4966: the store's first Query Store row comes 40 hours back, inside the 7-day baseline, so the baseline holds only part
diff --git a/Darling/Darling.Tests/WebClampCellBehaviourTests.cs b/Darling/Darling.Tests/WebClampCellBehaviourTests.cs
index ab6a20752a..27cced6474 100644
--- a/Darling/Darling.Tests/WebClampCellBehaviourTests.cs
+++ b/Darling/Darling.Tests/WebClampCellBehaviourTests.cs
@@ -167,6 +167,24 @@ public void TheAlertHistoryDetailColumn_LocalizesItsTimeLines_AndNeverTheSqlLine
Assert.Contains("{ key: \"detail_text\", label: \"Detail\", wrap: true, localizeAlertDetail: true },", fields, StringComparison.Ordinal);
}
+ [Fact]
+ public void ACellsPlainMode_PicksItsOwnPass_CountsKeepsAToolNameInARealError()
+ {
+ // #6649: the Collection Log's Error column is `plain: "counts"`; a mistyped key would fall through to the full pass, which
+ // turns a real error's get_ name into a tab name.
+ var p = Run().GetProperty("plainModes");
+ var raw = p.GetProperty("raw").GetString()!;
+ var counts = p.GetProperty("counts").GetString()!;
+ Assert.Equal("Connection failed (timeout=30): ring buffer truncated: 1, ring buffer events hidden: 167, newest visible event age s: 4300; ask get_collection_health for the time range", counts);
+ var full = p.GetProperty("full").GetString()!;
+ Assert.Contains("ask Collection Health for the time range", full);
+ Assert.DoesNotContain("get_collection_health", full);
+ var named = p.GetProperty("named").GetString()!;
+ Assert.Contains("ring_buffer_truncated=1", named);
+ Assert.Contains("get_collection_health for the time range", named);
+ Assert.Equal(raw, p.GetProperty("asStored").GetString());
+ }
+
[Fact]
public void EnterOpensTheCell_AndOtherKeysDoNot()
{
diff --git a/Darling/Darling.Tests/WebDataStartNoteTests.cs b/Darling/Darling.Tests/WebDataStartNoteTests.cs
index 2f0113b6a9..ea44f1cc26 100644
--- a/Darling/Darling.Tests/WebDataStartNoteTests.cs
+++ b/Darling/Darling.Tests/WebDataStartNoteTests.cs
@@ -397,7 +397,7 @@ public void TheHeatmapAndRegressionsPanels_DrawTheToolsOwnTruncationNote_AsSent(
var note = DarlingMcpWindowNotice.Build(
Utc(2026, 1, 3), Utc(2026, 1, 1), table,
- baselineTail ? "Here the window starts at baseline_start, so the baseline holds only the part from effective_start to baseline_end." : null).TruncationNote!;
+ baselineTail ? PerformanceMonitor.Common.QueryStoreRegressionRules.BaselineWindowTail : null).TruncationNote!;
Assert.DoesNotMatch(@"\d{4}-\d{2}-\d{2}|\d{1,2}:\d{2}", note);
Assert.Contains("this server's raw " + table + " retains", note, StringComparison.Ordinal);
Assert.Equal(baselineTail, note.EndsWith("baseline_end.", StringComparison.Ordinal));
diff --git a/Darling/Darling.Tests/WebPartialWindowBehaviourTests.cs b/Darling/Darling.Tests/WebPartialWindowBehaviourTests.cs
index 263779e23b..cf71332cc4 100644
--- a/Darling/Darling.Tests/WebPartialWindowBehaviourTests.cs
+++ b/Darling/Darling.Tests/WebPartialWindowBehaviourTests.cs
@@ -7,9 +7,12 @@
*/
using System;
+using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
+using System.Linq;
using System.Text.Json;
+using PerformanceMonitor.Darling.Service;
using Xunit;
using static Darling.Tests.RepoFile;
@@ -22,11 +25,12 @@ namespace Darling.Tests;
///
public sealed class WebPartialWindowBehaviourTests
{
- private static JsonElement Run()
+ private static JsonElement Run(string? auditBody = null)
{
var psi = new ProcessStartInfo("node") { RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false };
psi.ArgumentList.Add(PathTo("Darling", "Darling.Tests", "web-partial-window-harness.mjs"));
psi.ArgumentList.Add(PathTo("Darling", "PerformanceMonitor.Darling.Service", "wwwroot", "js"));
+ if (auditBody is not null) psi.ArgumentList.Add(auditBody);
Process proc;
try
@@ -166,13 +170,28 @@ public void AnAlertBodyOnTheWeb_ShowsItsTimeLinesLocal_AndLeavesStatementsAndSer
}
[Fact]
- public void TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndLeavesAStatementLineAlone()
+ public void TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndKeepsEveryOtherClauseAsWritten()
{
- // #6649: Alert History printed "in 1 source(s)"; the statement line under it is data and prints as stored.
- var body = Run().GetProperty("h2").GetProperty("auditBody").GetString()!;
- Assert.Contains("in 1 source, where usual", body);
- Assert.DoesNotContain("source(s)", body);
- Assert.Contains("note = '3 file(s)'", body);
+ // #6649: Alert History printed "in 1 source(s)". The body is CollectionHistoryAudit.Render's own output: ONE line of
+ // ". "-joined clauses (one flagged source, every other real hourly source unread), so only its first sentence may change.
+ var sources = CollectionHistoryAudit.Rollups;
+ var rendered = CollectionHistoryAudit.Render(
+ new DateTime(2026, 10, 20, 0, 0, 0, DateTimeKind.Utc),
+ new (CollectionHistoryAudit.Rollup, IReadOnlyList)[]
+ {
+ (sources[0], new[] { new CollectionHistoryAudit.FlaggedRange(18, 21, 0, 40, 0, 0) }),
+ },
+ sources.Skip(1).ToList());
+ Assert.DoesNotContain('\n', rendered);
+ Assert.Contains("in 1 source(s), where usual", rendered);
+
+ var h2 = Run(rendered).GetProperty("h2");
+ var body = h2.GetProperty("auditBody").GetString()!;
+ Assert.Equal(rendered.Replace("in 1 source(s), where usual", "in 1 source, where usual", StringComparison.Ordinal), body);
+
+ // The match ends at its own sentence: a later clause that the full plain-text pass would rewrite prints as written.
+ var probe = h2.GetProperty("auditBodyWithProbe").GetString()!;
+ Assert.Contains("Probe: 29 database(s) were left out (see databases_left_out).", probe);
}
[Fact]
diff --git a/Darling/Darling.Tests/WebPlainTextTests.cs b/Darling/Darling.Tests/WebPlainTextTests.cs
index 4e2647c422..003661f1d6 100644
--- a/Darling/Darling.Tests/WebPlainTextTests.cs
+++ b/Darling/Darling.Tests/WebPlainTextTests.cs
@@ -12,6 +12,8 @@
using System.Linq;
using System.Reflection;
using System.Text.Json;
+using PerformanceMonitor.Common;
+using PerformanceMonitor.Darling.Service.Mcp;
using Xunit;
using static Darling.Tests.RepoFile;
@@ -98,28 +100,36 @@ public void CollectorMeasurementCounts_ReadAsWords()
Assert.Equal("latest run: shred gated: 1, events read: 0, report xml empty: 0", o[0]);
}
- /* #6649: the left-out databases pointer, the baseline window sentence and the memory clerk column name reached the page
- with the MCP answer's field names in them. */
+ /* #6649: the left-out databases pointer, the baseline window sentence and the memory clerk note's four arms reached the page
+ with the MCP answer's field names in them. The baseline sentence and the clerk notes are read from the C# that owns them
+ (QueryStoreRegressionRules.BaselineWindowTail, DarlingMcpQueryStoreClutterTools.ClerkNote*), so a reword there breaks this
+ test instead of leaving a field name on the page (#3684). The left-out pointer is a generic suffix strip, so its one
+ sentence is typed here. */
[Fact]
public void FieldNamesInTheServicesOwnSentences_ReadAsThePagesWords()
{
var o = Run(
[
"No Query Store rows in the 24-hour window for a database this server still has. 29 database(s) the server no longer lists were left out of this read (see databases_left_out).",
- "Here the window starts at baseline_start, so the baseline holds only the part from effective_start to baseline_end.",
- "The clerk is in the newest capture's top 25; latest_memory_mb is its current footprint.",
- "The clerk appeared earlier in the window and has since dropped out of the collector's top 25; latest_memory_mb is its last observed footprint, not its current one.",
+ QueryStoreRegressionRules.BaselineWindowTail,
+ DarlingMcpQueryStoreClutterTools.ClerkNoteInNewestCapture,
+ DarlingMcpQueryStoreClutterTools.ClerkNoteDroppedOut,
+ DarlingMcpQueryStoreClutterTools.ClerkNoteNoCapture,
+ DarlingMcpQueryStoreClutterTools.ClerkNoteNeverAppeared,
], out _);
Assert.Equal("No Query Store rows in the 24-hour window for a database this server still has. 29 databases the server no longer lists were left out of this read.", o[0]);
Assert.Equal("Here the window starts before the baseline period, so the baseline holds only the part the store has.", o[1]);
Assert.Equal("The clerk is in the newest capture's top 25; Latest MB is its current footprint.", o[2]);
Assert.Contains("Latest MB is its last observed footprint", o[3]);
+ Assert.StartsWith("No memory clerk capture in the window: the collector wrote nothing", o[4]);
+ Assert.Contains("The memory clerks collector stores the top 25 clerks over 1 MB per capture", o[5]);
foreach (var line in o)
{
Assert.DoesNotContain("_left_out", line);
Assert.DoesNotContain("baseline_start", line);
Assert.DoesNotContain("effective_start", line);
Assert.DoesNotContain("_mb is", line);
+ Assert.DoesNotContain("memory_clerks", line);
Assert.DoesNotContain("(s)", line);
}
}
diff --git a/Darling/Darling.Tests/web-clamp-cell-harness.mjs b/Darling/Darling.Tests/web-clamp-cell-harness.mjs
index 0c427a7ee4..dd54a6a4a6 100644
--- a/Darling/Darling.Tests/web-clamp-cell-harness.mjs
+++ b/Darling/Darling.Tests/web-clamp-cell-harness.mjs
@@ -156,4 +156,21 @@ out.alertDetail = {
sqlLine: "Blocked Query: SELECT * FROM t WHERE d = '2026-01-01 00:00:00Z'",
};
+/* #6649: the cell's `plain` modes through the shared renderer. "counts" (the Collection Log's Error column) says the measurement counts in
+ words and leaves a tool name in a real error message; true is the full pass (a tool name becomes its tab); "named" puts only the
+ named tokens into words; no key prints as stored. */
+const modeNote = "Connection failed (timeout=30): ring_buffer_truncated=1 ring_buffer_events_hidden=167 newest_visible_event_age_s=4300; ask get_collection_health for hours_back";
+const pm = VIZ.table({ rows: [{ note: modeNote }] }, {
+ rowsKey: "rows", title: "Plain modes", tools: false,
+ columns: [
+ { key: "note", label: "Counts", wrap: true, plain: "counts" },
+ { key: "note", label: "Full", wrap: true, plain: true },
+ { key: "note", label: "Named", wrap: true, plain: "named" },
+ { key: "note", label: "As stored", wrap: true },
+ ],
+});
+const pmr = pm.findAll((n) => n.tag === "tr").filter((n) => n.parent && n.parent.tag === "tbody")[0];
+const pmt = pmr.children.map((c) => c.textContent);
+out.plainModes = { raw: modeNote, counts: pmt[0], full: pmt[1], named: pmt[2], asStored: pmt[3] };
+
console.log(JSON.stringify(out));
diff --git a/Darling/Darling.Tests/web-partial-window-harness.mjs b/Darling/Darling.Tests/web-partial-window-harness.mjs
index 758d78a68a..868e75748a 100644
--- a/Darling/Darling.Tests/web-partial-window-harness.mjs
+++ b/Darling/Darling.Tests/web-partial-window-harness.mjs
@@ -1,6 +1,6 @@
/* #5644 W12: runs the web dashboard's real windowFloorStrip, cappedReadNote, partialWindowSubtitle and markPartialSubtitle (wwwroot/js/util.js)
on a small fake DOM and prints what each drew as one line of JSON. WebPartialWindowBehaviourTests starts it as
- node web-partial-window-harness.mjs
+ node web-partial-window-harness.mjs [a collection-history audit alert body]
Only the DOM is a stand-in; util.js is the shipped module. */
import { pathToFileURL } from "node:url";
@@ -113,10 +113,8 @@ const alertBody = [
"",
"Newest blocked process sample: 23:12:45 UTC, 5m 20s old",
].join("\n");
-const auditBody = [
- "Retained history for 2026-10-20 (UTC) fell below half of the usual pace for that hour in 1 source(s), where usual is the median of the 7 days before.",
- " Blocked Query: SELECT 1 WHERE note = '3 file(s)'",
-].join("\n");
+/* the collection-history audit's body: the test passes CollectionHistoryAudit.Render's own output (one line of ". "-joined clauses) as argv[3] */
+const auditBody = process.argv[3] ?? "";
const sample = { source: "blocked process", instant_utc: "2026-10-12T23:12:45.0000000Z", age_seconds: 320 };
out.h2 = {
spaceZ: localizeIsoText("until 2026-10-11 12:48:52Z"),
@@ -135,6 +133,8 @@ out.h2 = {
here: { inc: here("2026-10-12T23:13:00Z"), fail: here("2026-10-12T07:00:00Z"), end: here("2026-10-12T08:00:00Z"), samp: here("2026-10-12T23:12:45Z") },
bodyRaw: alertBody,
auditBody: localizeAlertDetail(auditBody, null),
+ /* a later clause that a full plainText pass would rewrite: the audit's match must stop at the end of its own sentence */
+ auditBodyWithProbe: localizeAlertDetail(auditBody + " Probe: 29 database(s) were left out (see databases_left_out).", null),
};
console.log(JSON.stringify(out));
diff --git a/Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpQueryStoreClutterTools.cs b/Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpQueryStoreClutterTools.cs
index 7c03f0f643..76f2cf25f3 100644
--- a/Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpQueryStoreClutterTools.cs
+++ b/Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpQueryStoreClutterTools.cs
@@ -90,6 +90,20 @@ public sealed class DarlingMcpQueryStoreClutterTools
public const string CaptureModeNote =
"query_capture_mode is the query_store_health column added by the V137 rung (#3796) and filled hourly; null means the newest capture predates the rung — never asked, never NONE";
+ /* The four arms of the memory clerk's `note`. The web page's plain-text.js rewrites the field and relation names in them, and
+ WebPlainTextTests feeds these constants through it, so a reword here breaks that test (#6649). */
+ internal const string ClerkNoteNoCapture =
+ "No memory_clerks capture in the window: the collector wrote nothing for this server, so nothing is known about the clerk.";
+
+ internal const string ClerkNoteNeverAppeared =
+ "The clerk never appeared in the window. memory_clerks stores the top 25 clerks over 1 MB per capture, so this is a RANK, not a zero: Query Store's memory was below the collector's floor or outside its top 25 on every capture.";
+
+ internal const string ClerkNoteInNewestCapture =
+ "The clerk is in the newest capture's top 25; latest_memory_mb is its current footprint.";
+
+ internal const string ClerkNoteDroppedOut =
+ "The clerk appeared earlier in the window and has since dropped out of the collector's top 25; latest_memory_mb is its last observed footprint, not its current one.";
+
[McpServerTool(Name = "get_query_store_clutter"), Description(
"The Query Store CLUTTER view for one server, composed from already-collected rows: no new query runs. Clutter (read_cost/plan_churn/config) is per DATABASE; qs_overhead (waits/memory clerk) is per SERVER, never attributed to a database. No rows answers unavailable, never a clean bill. Verdict Unknown means unmeasured, never quietly Healthy. REPLICAS: excluded, verdict Unknown, never a defect. query_capture_mode null means never asked, never NONE. window_truncated is a retention floor, not a page cut: no limit fixes it. fleet_median is null unless include_fleet_median=true. <> The Query Store CLUTTER view for one server, composed from rows already collected — no new query runs against the monitored server. Clutter is per DATABASE and overhead is per SERVER, and the payload keeps the two apart. Each database row carries three decomposed arms with raw numbers, never a bare composite. (a) read_cost, from the query_store collector's fan-out rollup on collection_log: runs_observed (fan-out runs on the server in the window), runs_slowest (runs on which THIS database was the slowest item) and runs_slowest_pct, slowest_item_ms_p50/p95 when it was, run_duration_ms_p50 for scale, slowest_share_pct (median of slowest_item_ms / duration_ms over those runs — the slowest item's share of the whole pass, get_collection_health's verdict figure), and dominance_ratio (this database's median slowest cost over the pooled median of every OTHER database's slowest cost on the same server, null when no other database was ever slowest). dominance_ratio is NOT get_collection_health's dominance (slowest x items / run) — it names a different quantity. The store keeps only the slowest item of each run, so this arm ranks databases by how often and by how much they were the slowest, not by a per-database series. (b) plan_churn, from raw query_store_stats: distinct_queries, distinct_plans (plan_id — the identity MAX_PLANS_PER_QUERY caps and the plan map keys on), plans_per_query_p95 and _max, new_plans_per_day (plans first seen after the database's first collection in the window, per day of the span its collections cover; a plan idle before the window and run again inside it counts as new — the store keeps no first-seen stamp), never_seen_twice_fraction (plans seen under exactly one collection over all plans observed; null under two collections) and collections_observed. (c) config, the newest query_store_health capture per database INSIDE the window, with its own captured_at: actual_state, desired_state, readonly_reason (decoded), storage used vs cap and pct_of_cap, size_based_cleanup_mode, stale_query_threshold_days, max_plans_per_query, interval_length_minutes, and query_capture_mode (the DMV's query_capture_mode_desc spelling verbatim: ALL / AUTO / CUSTOM / NONE) with capture_mode_known beside it — null means the newest capture predates the V137 rung that added the column, which is NEVER ASKED and never NONE. The mode is the one option on that row that names a plan-churn factory, so the churn recommendations name it: ALL beside high churn is the 'switch to AUTO' case, AUTO beside it points at the workload. Per database, verdict is the band canon (Healthy / Warning / Critical / Unknown) with verdict_reasons naming the arm and bar that raised it; the bars are published under thresholds so you can disagree with them on the evidence, and Unknown means unmeasured, never quietly Healthy. recommendations is prose per reason and next_tools names the reads that carry the detail. Rows are ordered worst-first (band, then the read-cost share, then plans per query) and cut at limit, observed off a fetch one past it: truncated is the page cut, databases_returned the page, database_count the whole. REPLICAS: a database whose readonly_reason carries bit 8 (the engine's readable-secondary flag) reads excluded: true, excluded_reason: qs_read_only_replica, verdict Unknown — Query Store on a readable secondary is READ_ONLY by design, its clutter and configuration are its primary's, and it is never a defect here. qs_overhead is the ONE per-server block: wait_stats lists every non-sleep QDS_* wait type in the window with wait_ms_total, waiting_tasks_total and wait_ms_per_hour (rated milliseconds over the measured seconds they accrued over, never over a cadence; null when no interval was knowable), and excluded_wait_types NAMES the four QDS_* sleep waits IgnoredWaitDefaults drops at collection (QDS_ASYNC_QUEUE, QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP, QDS_PERSIST_TASK_MAIN_LOOP_SLEEP, QDS_SHUTDOWN_QUEUE) so the proxy is not mistaken for the whole; memory_clerk is MEMORYCLERK_QUERYDISKSTORE latest and window max, with clerk_in_latest_capture saying whether it is in the collector's current top 25 (its absence is a rank, not a zero); the block ends with the window's baseline discontinuities, the same markers the trend tools publish. The window block carries the requested start and end beside the raw tier's reach. fleet_median is opt-in (include_fleet_median): discrete medians of slowest_share_pct and plans_per_query_p95 over every database on every enabled SQL Server target that is not a replica, and of the QDS wait rate over those servers, each with the population it was drawn from — off by default because it walks two raw hypertables fleet-wide over the window. include_fleet_median's own original wording, unabbreviated: If true, also compute fleet_median: the discrete median of each headline arm over every enabled SQL Server target that is not a replica, so a per-server figure has a reference. Default false — it walks query_store_stats and wait_stats fleet-wide over the window, which on a large store is the read deadline's whole budget. The plan-churn and wait arms read the raw tier only, which on a store with the rollups armed is dropped at 4 days." + McpHelpers.WindowTruncatedDescription)]
public static Task GetQueryStoreClutter(
@@ -401,12 +415,12 @@ on a pre-rung capture makes it false rather than being averaged away. */
latest_capture_at = Stamp(clerk.LatestCapture),
clerk_in_latest_capture = clerk.LatestCapture is { } lc && clerk.LatestClerkCapture is { } lcc && lcc == lc,
note = clerk.Captures == 0
- ? "No memory_clerks capture in the window: the collector wrote nothing for this server, so nothing is known about the clerk."
+ ? ClerkNoteNoCapture
: clerk.ClerkSamples == 0
- ? "The clerk never appeared in the window. memory_clerks stores the top 25 clerks over 1 MB per capture, so this is a RANK, not a zero: Query Store's memory was below the collector's floor or outside its top 25 on every capture."
+ ? ClerkNoteNeverAppeared
: clerk.LatestClerkCapture == clerk.LatestCapture
- ? "The clerk is in the newest capture's top 25; latest_memory_mb is its current footprint."
- : "The clerk appeared earlier in the window and has since dropped out of the collector's top 25; latest_memory_mb is its last observed footprint, not its current one.",
+ ? ClerkNoteInNewestCapture
+ : ClerkNoteDroppedOut,
},
discontinuities = BaselineDiscontinuities.ToPayload(discontinuities),
},
diff --git a/Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpQueryStoreRegressionTools.cs b/Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpQueryStoreRegressionTools.cs
index d3b1af078c..da64e5d149 100644
--- a/Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpQueryStoreRegressionTools.cs
+++ b/Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpQueryStoreRegressionTools.cs
@@ -108,7 +108,7 @@ negative. Unfiltered by database_name (the floor is a property of the table). */
var notice = await DarlingMcpWindowNotice.ReadAsync(
() => DarlingMcpWindowNotice.Probe(postgres, "query_store_stats", resolved.ServerName, baselineStart, end, cancellationToken),
baselineStart, end, "query_store_stats",
- "Here the window starts at baseline_start, so the baseline holds only the part from effective_start to baseline_end.",
+ QueryStoreRegressionRules.BaselineWindowTail,
emptyAnswer: rows.Count == 0, logger: logger, cancellationToken: cancellationToken);
if (rows.Count == 0)
diff --git a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js
index 488305f9bf..e5fe830b5a 100644
--- a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js
+++ b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js
@@ -1318,10 +1318,10 @@ function cell(row, c) {
: c.plain === "named"
? plainTextNamed(String(raw))
: c.plain === "counts"
- ? plainTextCounts(String(raw))
- : c.plain
- ? plainText(String(raw))
- : String(raw);
+ ? plainTextCounts(String(raw))
+ : c.plain
+ ? plainText(String(raw))
+ : String(raw);
/* #5644 W20: a column marked `localizeText` (a message or note: collection-health notes, collector errors) shows any ISO
instant in its sentence in local time, like the grids beside it. Opt-in: query text, statement text, details and
identifiers are data, and a literal such as '2026-01-01T00:00:00' inside them must show as written. */
diff --git a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js
index ec71346a8b..55b12cee9f 100644
--- a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js
+++ b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js
@@ -378,8 +378,11 @@ export function plainText(text) {
/Here the window starts at baseline_start, so the baseline holds only the part from effective_start to baseline_end\./g,
"Here the window starts before the baseline period, so the baseline holds only the part the store has.",
);
- /* The Queries tab's memory clerk column is "Latest MB". */
+ /* The memory clerk note has four arms (memory_clerk.note): two name latest_memory_mb, the Queries tab's "Latest MB" column,
+ and two name the collector's own relation, memory_clerks. */
t = t.replace(/\blatest_memory_mb\b/g, "Latest MB");
+ t = t.replace(/\bmemory_clerks capture\b/g, "memory clerk capture");
+ t = t.replace(/\bmemory_clerks stores\b/g, "The memory clerks collector stores");
/* The system-health "events were captured, none qualified" closing. */
t = t.replace(/so this is the healthy answer for this read rather than missing data/g, "so this is a normal result, not missing data");
diff --git a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/util.js b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/util.js
index 0403c64022..131e195c1f 100644
--- a/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/util.js
+++ b/Darling/PerformanceMonitor.Darling.Service/wwwroot/js/util.js
@@ -284,9 +284,10 @@ export function localizeIsoText(text) {
*/
export function localizeAlertDetail(text, sample) {
if (typeof text !== "string") return text;
- /* #6649: the collection-history audit's sentence says "N source(s)"; the count is known, so the word agrees with it. Only that
- sentence: the rest of a body carries SQL and query text that must print as written. */
- let out = text.replace(/Retained history for .*$/gm, (line) => plainText(line));
+ /* #6649: the collection-history audit's sentence says "N source(s)"; the count is known, so the word agrees with it. The audit's
+ body (CollectionHistoryAudit.Render) is ONE line of ". "-joined clauses, so the match is the sentence, up to its ". " or the
+ end of the text, never the line: the clauses after it (the source names, the ranges, the "Not read" list) print as written. */
+ let out = text.replace(/Retained history for .*?(?:\.(?=\s)|$)/gs, (sentence) => plainText(sentence));
out = out.replace(/^(\s*(?:Incident Since|Started|Failed At|Snapshot|From|To|Window): )(.*)$/gm,
(m, lead, value) => lead + localizeIsoText(value));
const at = sample && typeof sample.instant_utc === "string" ? parseUtc(sample.instant_utc) : null;
diff --git a/Lite/Mcp/McpQueryTools.cs b/Lite/Mcp/McpQueryTools.cs
index a4ef571163..b123a2fa37 100644
--- a/Lite/Mcp/McpQueryTools.cs
+++ b/Lite/Mcp/McpQueryTools.cs
@@ -639,7 +639,7 @@ public static async Task GetQueryStoreRegressions(
var notice = await WindowNoticeAsync(
() => dataService.GetQueryWindowFloorAsync(QueryWindowRelation.QueryStoreStats, resolved.ServerId, baselineStart, windowEnd),
baselineStart, windowEnd, "query_store_stats",
- "Here the window starts at baseline_start, so the baseline holds only the part from effective_start to baseline_end.",
+ QueryStoreRegressionRules.BaselineWindowTail,
emptyAnswer: rows.Count == 0);
if (rows.Count == 0)
diff --git a/PerformanceMonitor.Common/QueryStoreRegressionRules.cs b/PerformanceMonitor.Common/QueryStoreRegressionRules.cs
index a0d5a36363..5c9df6ab13 100644
--- a/PerformanceMonitor.Common/QueryStoreRegressionRules.cs
+++ b/PerformanceMonitor.Common/QueryStoreRegressionRules.cs
@@ -21,6 +21,12 @@ public static class QueryStoreRegressionRules
/// A query qualifies for cost when its Regular CPU per execution is more than this percent above its baseline.
public const int CostGatePercent = 25;
+ /// The closing sentence of the regressions read's truncation_note when the window starts at baseline_start
+ /// and the store holds only part of the baseline. One definition for Darling's and Lite's reads, and the text the web page's
+ /// plain-text.js rewrites, so a reword here breaks the web test instead of leaving a field name on the page (#6649).
+ public const string BaselineWindowTail =
+ "Here the window starts at baseline_start, so the baseline holds only the part from effective_start to baseline_end.";
+
/// A rise in timeouts or errors qualifies when the recent per-hour rate is at least this many times the baseline's.
/// A nonzero recent rate where the baseline had none qualifies whatever the multiple.
public const int FailureRateMultiple = 2;