Repository navigation
Web pages say MCP field names and raw collector counts in words (#6649) - #6670
Conversation
| let out = text.replace(/^(\s*(?:Incident Since|Started|Failed At|Snapshot|From|To|Window): )(.*)$/gm, | ||
| /* #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)); |
There was a problem hiding this comment.
The comment's guarantee ("Only that sentence: the rest of a body carries SQL and query text that must print as written") does not hold for this alert, because this alert's body has no other line. CollectionHistoryAudit.Render builds the whole detail text on one StringBuilder with ". " separators and never writes a newline (CollectionHistoryAudit.cs:424-464), so /Retained history for .*$/gm — . stopping at a newline that does not exist — matches from the first character to the last. The entire audit body goes through the full plainText() pipeline, not one sentence.
That pipeline is not sentence-safe. withoutToolNames (plain-text.js:259-277) drops a whole sentence that names a registered tool, rewrites <snake_case> collector and collector '<name>' to title case, and lowerEmphasisWords lower-cases any all-caps word in EMPHASIS_WORDS. Nothing is lost today — I checked every source name the body can carry (TimescaleSupport.HourlyAggregates plus the perfmon baseline view: query_store_stats_hourly, query_stats_io_hourly, …) against TOOL_NAME_SET/ACTION_TOOL_SET and none is a registered tool — so this is latent, not broken. But the body is composed in C# from a list that grows, and the first source name or sentence that collides with a tool name silently deletes a sentence of an alert body with no test to catch it.
The count is already known where the sentence is written: findings.Count at CollectionHistoryAudit.cs:426. Fixing it there ({(findings.Count == 1 ? "source" : "sources")}) needs no JS rule, cannot over-reach, and also fixes the surfaces that never pass through plain-text.js — the e-mail and Slack bodies and the WPF Viewer's alert history, all of which still read "in 1 source(s)" after this PR. If the rewrite must stay on the page, anchor it to the sentence rather than the line (e.g. /^Retained history for [^.]*\./) so the guarantee the comment states is the one the code has.
| 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"); |
There was a problem hiding this comment.
This fixture is not a shape the service emits, and the second line is what makes the companion assertion look like a guard. CollectionHistoryAudit.Render (CollectionHistoryAudit.cs:424-464) appends every clause with ". " and never a newline, so a real audit body is exactly one line, and no audit body has ever carried a Blocked Query: statement line. So Assert.Contains("note = '3 file(s)'", body) in TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndLeavesAStatementLineAlone passes on a line that only exists in this harness: against a real body there is no line outside the match, and plainText runs over the whole thing (see my note on util.js:287).
REVIEW-TRAPS: "A test that constructs a 'four maintenance anomalies in one run' fixture is testing a shape no live run produces (#3709...). Fixtures should carry the population the engine actually emits, or say they do not." Build the fixture from CollectionHistoryAudit.Render's real output (or a verbatim single-line copy of it) and assert on what that produces. The in 1 source half of the test is good and would survive the change; only the invented second line needs to go.
| /* The Queries tab's memory clerk column is "Latest MB". */ | ||
| t = t.replace(/\blatest_memory_mb\b/g, "Latest MB"); |
There was a problem hiding this comment.
The clerk sweep stops two branches short, and the two it misses are the ones a quiet server actually shows. memory_clerk.note is a four-way conditional (DarlingMcpQueryStoreClutterTools.cs:403-409); only the two arms that mention latest_memory_mb are fixed here. The other two still name the collector's relation:
:404— "No memory_clerks capture in the window: the collector wrote nothing for this server, so nothing is known about the clerk.":406— "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: ..."
All four reach the page through the same field: noteKey: "qs_overhead.memory_clerk.note" on the "Query Store Memory Clerk" panel (pages/server-tabs.js:2189) → noticeStrip → plainText (util.js:203). memory_clerks is not rewritten by anything — it is not in TOOL_NAME_SET/ACTION_TOOL_SET (the registered tool is get_memory_clerks), the <name> collector rule at :250 needs the literal word "collector" after it, and there is no FIELD_WORDS entry — so "No memory_clerks capture in the window" prints verbatim, which is the exact defect class #6649 is about. The clerk-present arms the PR did fix are the less common ones: these two fire whenever the clerk is below the collector's floor or the collector wrote nothing.
The precedent is right above, at :324: pg_wraparound_stats → "the freeze-headroom collector". One more line beside it does it, e.g.
| /* The Queries tab's memory clerk column is "Latest MB". */ | |
| t = t.replace(/\blatest_memory_mb\b/g, "Latest MB"); | |
| /* The Queries tab's memory clerk column is "Latest MB"; the clerk notes also name the collector's own relation. */ | |
| t = t.replace(/\blatest_memory_mb\b/g, "Latest MB"); | |
| t = t.replace(/\bmemory_clerks\b/g, "the memory clerks collector"); |
(the panel's own emptyText already calls it "the top 25 clerks over 1 MB", so pick whichever wording matches the Memory tab).
| 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 _); |
There was a problem hiding this comment.
These four sentences are copied into the test rather than read from the service, so the test cannot fail the way this fix actually dies. Three of the rules added in plain-text.js are whole-sentence literal matches against strings owned by C#:
DarlingMcpQueryStoreRegressionTools.cs:111(andLite/Mcp/McpQueryTools.cs:642) — the baseline tailDarlingMcpQueryStoreClutterTools.cs:408/:409— the two clerk notesDarlingMcpQueryStoreClutterTools.cs:182,DarlingMcpFinOpsTools.IndexAnalysis.cs:215,PerformanceMonitor.Common/CollectorRunFacts.cs:80—(see databases_left_out)(this one is a generic suffix strip, so it is the safe one)
Reword any of those C# sentences by one character and the JS replace stops matching, the field name is back on the page, and all four assertions here still pass, because they are asserting against this file's own copy of the old wording. REVIEW-TRAPS: "Two copies of one definition pinned EQUAL to each other fail only after BOTH have drifted (#3684). Alias, do not copy."
This file already knows the better way twice: TheEngineGateSentence_NamesAzureSqlDatabase_WhenThatIsTheEngine (:429) and TheTempDbFileIoAzureAnswer_IsNotCollected_AndBecomesTheAzureLine (:440) build their input by calling the producer (CollectorEngineCapability.NotCollectedMessage, DarlingEngineCapability.TempDbFileIoNotCollectedStatus) and then assert the page's words. Lifting these sentences to const on their tool classes and feeding them in the same way makes the drift fail here instead of shipping silently.
| : c.plain === "named" | ||
| ? plainTextNamed(String(raw)) | ||
| : c.plain === "counts" | ||
| ? plainTextCounts(String(raw)) | ||
| : c.plain | ||
| ? plainText(String(raw)) | ||
| : String(raw); |
There was a problem hiding this comment.
Non-blocking: this new branch is the one link in the chain with no behaviour test. cell()'s plain dispatch is exercised only by web-clamp-cell-harness.mjs:50, which sets plain: true; nothing sets plain: "named" or the new plain: "counts". Because the chain falls through to c.plain ? plainText(...) : String(raw), a mistyped descriptor key would quietly route the Collection Log's Error column to full plainText — the mode the PR body explicitly rejects for that column, since a failed run's error can quote a real get_ name — and every new test here would still pass, as they all call plainTextCounts directly rather than through cell(). One row in that harness with { plain: "counts" } over a key=value note would close it.
(Also, the two new lines sit one indent level shallower than the "named" arm above them, which reads as if they belong to a different nesting level than they do.)
There was a problem hiding this comment.
Verdict: CHANGES REQUESTED
Claims
- VERIFIED — "All in
wwwroot/js; the service text is unchanged" — every non-test file in the diff is under the Darling service'swwwroot/js; no producer.cschanged. - VERIFIED — "Lite has no web UI" —
wwwrootandplain-text.jsexist only under Darling; noLite/file referencesplainText. - VERIFIED — "drops
(see databases_left_out)" —plain-text.js:376; verbatim inDarlingMcpQueryStoreClutterTools.cs:182,DarlingMcpFinOpsTools.IndexAnalysis.cs:215,CollectorRunFacts.cs:80. - VERIFIED — the baseline-window sentence rewrite —
plain-text.js:377-380matchesDarlingMcpQueryStoreRegressionTools.cs:111verbatim; it reaches the page astruncation_note→windowFloorStrip(util.js:415) →noticeStrip→plainText(util.js:203). - VERIFIED — "
latest_memory_mbas 'Latest MB', the Queries tab's column label" —plain-text.js:382; label confirmed atpages/server-tabs.js:4161. - VERIFIED — "a negative or fractional value used to end the run and leave the whole note raw" — the pre-image
=\d+cannot cross=-12, and the surviving lone pairs (plans_rendered,plan_fetch_ms,deferred_hit) are absent fromMEASUREMENT_LABELS:106-116, so the gate at:204left each raw. - VERIFIED — the two count rules moved into
measurementCountsText,plainTextCountsexported —plain-text.js:198-220;plainTextcalls it at:327, so the paths cannot drift. - VERIFIED — the Collection Log
Errorcolumn had noplainTextat all — pre-images ofpages/server-tabs.js:5518andread-fields.js:369carry noplainkey. - VERIFIED — "a successful run leaves its counts there, a failed run a real error" —
CollectionHealthStatements.cs:120;DarlingPgStatementReader.cs:262parsesstatements_dealloc=Nback out of the stored column, so presentation-only is the right layer. - VERIFIED — "the Collectors table's Note column was already
plain: true" —pages/server-tabs.js:5618. - VERIFIED — the three
error_messagesurfaces now useplain: "counts"/plainTextCounts—read-fields.js:369,pages/server-tabs.js:5518,pages/collector-run.js:162; grep finds no fourth render site. - VERIFIED — "a lone
timeout=30stays" — theLABEL_SETgate atplain-text.js:204;TheCollectionLogMessage_SaysItsCountsInWords_AndLeavesAnErrorAlonefails if that changes. - VERIFIED — "'1 source(s)' reads '1 source'" —
util.js:287intoplainText, whose(s)rule isplain-text.js:357. - UNVERIFIED — "Revert-proved: all four fail with the old files" — needs the node harness plus xunit; execution was unavailable here. Static reading is consistent for all four.
- UNVERIFIED — "541 run, 0 failed, 1 skipped" — a test run.
- UNVERIFIED — the Collectors Note column "checked by running
plainTextunder node" — the descriptor is confirmed from the tree, the run is not. - UNVERIFIED — "Full suite and
pre-push.shnot run … No live page check" — self-declared; see the checklist. - REFUTED — "Only that line; the other lines of an alert body (SQL, query text) are untouched." —
CollectionHistoryAudit.Render(CollectionHistoryAudit.cs:424-464) appends every clause with". "and never a newline, so this body is one line:/Retained history for .*$/gmmatches first character to last and the whole detail goes through fullplainText,withoutToolNames' sentence drop included. There is no other line to leave untouched.
Riskiest lines
Darling/PerformanceMonitor.Darling.Service/wwwroot/js/util.js:287— a line-scoped match over a body that is one line, so the whole audit detail is rewritten by a pipeline that deletes sentences naming a registered tool — UNCOVERED (the only test uses a two-line fixtureRendercannot produce)Darling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js:203— the widened pairs regex is now shared byplainTextandplainTextCounts, so an over-wide match rewrites a real driver error on the Collection Log — covered byTheCollectionLogMessage_SaysItsCountsInWords_AndLeavesAnErrorAloneandACountRunWithANegativeOrFractionalValue_StillReadsAsWordsDarling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js:1320— the newplain === "counts"arm ofcell(); a mistyped key falls through toc.plain ? plainText(...), the full mode the body rejects for an error column — UNCOVERED (web-clamp-cell-harness.mjs:50setsplain: trueonly; the new tests never go throughcell())
Traps near this diff
- "A test that constructs a 'four maintenance anomalies in one run' fixture is testing a shape no live run produces (#3709...). Fixtures should carry the population the engine actually emits, or say they do not." — applies —
web-partial-window-harness.mjs:116-119joins two lines and the new test asserts the second survives;Renderemits one line and never aBlocked Query:line. - "Two copies of one definition pinned EQUAL to each other fail only after BOTH have drifted (#3684). Alias, do not copy." — applies — the sentence rules at
plain-text.js:377-382are pinned only against literals re-typed atWebPlainTextTests.cs:106-112, not againstDarlingMcpQueryStoreRegressionTools.cs:111/DarlingMcpQueryStoreClutterTools.cs:408-409. - "Lite and Darling ship in parity (CONTRIBUTING's two-store rule): a fix to one SKU's reader, tool, alert or description without the counterpart's is a finding, not a nit" — does not apply —
plain-text.jsis a Darling-web layer with no Lite counterpart (Lite/has nowwwroot), the shared sentence is identical in both SKUs (Lite/Mcp/McpQueryTools.cs:642=DarlingMcpQueryStoreRegressionTools.cs:111), and no reader, tool or payload changed. - "Ruling (#5833): tests are load-bearing. … never answer a trap with a test that reads source text or asserts how code is spelled" — does not apply — all four new tests run the shipped JS under node and assert output (
WebPlainTextTests.cs:102,:134,:149); no census added. - "
.gitattributessaystext=auto eol=crlf: a diff that touches every line of a file is a line-ending conversion until proven otherwise" — does not apply — every hunk is local (plain-text.js+38/-8,util.js+4/-1). - "Every MCP filter is part of the query, not a post-filter on the page (#3641)" / "A
total_*assigned from a.Count(#3699)" / "A JSON number above 2^53 (#3487)" — do not apply — nothing here reads the store or shapes a payload; the MCP answers are byte-identical.
Divergence (blind read vs PR body)
Two places, both on the alert half.
-
"Only that line" describes a guard this alert cannot use. The body and the comment at
util.js:287frame the line-scoped regex as what protects SQL and query text in the rest of a body; for this alert there is no rest, so the regex equals runningplainTexton the wholedetail_text. Nothing is mangled today — every source name the body can carry (TimescaleSupport.HourlyAggregatesminusUnauditedHourlyViews, plus the perfmon baseline view) is absent fromTOOL_NAME_SET/ACTION_TOOL_SET, sowithoutToolNamesreturns early atplain-text.js:259— but stated scope and real scope differ, and the first colliding name deletes a sentence with nothing to catch it. The count is known in C# atCollectionHistoryAudit.cs:426(findings.Count), where one ternary fixes it without over-reach and also reaches the e-mail, Slack and Viewer copies, all of which still read "in 1 source(s)" after this PR — a surface the body does not mention. -
A diff change the body does not mention: the clerk sweep is partial.
memory_clerk.noteis a four-way conditional (DarlingMcpQueryStoreClutterTools.cs:403-409); only the two arms naminglatest_memory_mbare handled. The other two still print "No memory_clerks capture in the window…" and "memory_clerks stores the top 25 clerks over 1 MB per capture…" through the samenoteKey: "qs_overhead.memory_clerk.note"(pages/server-tabs.js:2189) →noticeStrip→plainText, with no rule formemory_clerksanywhere. Those are the arms a quiet server shows, so the half left raw is the half seen more often; one line beside:382, shaped like thepg_wraparound_statsprecedent at:324, closes it.
Everything else matches claim for claim, including the regex diagnosis, the three error_message surfaces, and the deliberate choice of the counts mode over full plainText for an error column.
Reviewer checklist
- Run the suite and
pre-push.sh— both marked unrun, and the four new tests shell out tonode, so confirm the agent has it or they skip rather than pass. - Read the Server Health Collection Log
Errorcell on a server with a partial-failure note, for a successful run (counts in words) and a failed run (timeout=30and anyget_-looking object name intact). - Open the Query Store Memory Clerk panel where the clerk is below the collector's floor or has no capture, and see whether "memory_clerks" is on the page.
- Read a real collection-history audit alert's whole detail in Alert History, then compare the same alert's e-mail/Slack body and the Viewer's copy for "in 1 source(s)".
- Confirm the Queries tab's regressions grid still shows the baseline sentence:
windowNoteText(util.js:508-513) recomposes the note and discards the server's text, baseline tail included, whenwindow_start_utc/window_end_utc/oldest_shown_utcare present.
…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.
There was a problem hiding this comment.
Verdict: LGTM
Claims
- VERIFIED — "util.js audit rewrite: matches the 'Retained history for ...' sentence only (to its '. ' or the end), not the line" —
util.js:290,/Retained history for .*?(?:\.(?=\s)|$)/gs;CollectionHistoryAudit.Render(CollectionHistoryAudit.cs:424-464) is the sole producer and joins every clause with". "into one line, so the new lazy match stops at the audit's own closing period. Proven byWebPartialWindowBehaviourTests.TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndKeepsEveryOtherClauseAsWritten'sauditBodyWithProbecase, which appends a(see databases_left_out)clause after the sentence and asserts it prints verbatim. - VERIFIED — "all four
memory_clerk.notearms are now handled" —DarlingMcpQueryStoreClutterTools.csgainedClerkNoteNoCapture/ClerkNoteNeverAppearedalongside the two already-fixed arms, andplain-text.js:384-385adds thememory_clerks capture/memory_clerks storesrewrites;WebPlainTextTests.FieldNamesInTheServicesOwnSentences_ReadAsThePagesWordsnow runs all four constants through the pipeline and asserts nomemory_clerkssurvives. - VERIFIED — "the C#-owned sentences are read from C#...
QueryStoreRegressionRules.BaselineWindowTail(newpublic constin Common; Darling's regressions read AND Lite'sMcpQueryToolsnow use it)" — confirmed atLite/Mcp/McpQueryTools.cs:642andDarlingMcpQueryStoreRegressionTools.cs:111, both now reference the one Common constant;DarlingQueryStoreRegressionsTests.csandWebDataStartNoteTests.csalias it too. This directly answers the traps file's "#3684: alias, do not copy" line that round 1 flagged against this exact sentence. - VERIFIED — "panels.js: the
counts/plainarms ofcell()are indented as one chain" + new behaviour test for the previously-uncoveredcountsarm —panels.js:1320diff is whitespace-only;WebClampCellBehaviourTests.ACellsPlainMode_PicksItsOwnPass_CountsKeepsAToolNameInARealErrordrivescell()through all threeplainmodes plus the no-key case viaweb-clamp-cell-harness.mjs, and the expected strings line up withmeasurementCountsText/namedTokenText/withoutToolNamesas written. - UNVERIFIED — "685 run, 0 failed, 39 skipped" and the revert-proof claim — a live test run; this tree supports only static reading, which was consistent with every test file reviewed.
- UNVERIFIED — "Full suite and
pre-push.shnot run... No live page check against a running service" — self-declared process state, not checkable read-only.
Riskiest lines
Darling/PerformanceMonitor.Darling.Service/wwwroot/js/util.js:290— the sentence-scoped regex that was round 1's top finding (a line-scoped match over a body that is actually one line) — covered byWebPartialWindowBehaviourTests.TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndKeepsEveryOtherClauseAsWrittenDarling/PerformanceMonitor.Darling.Service/wwwroot/js/plain-text.js:384-385— the two newmemory_clerksrewrites, the other round-1 finding (partial clerk-note sweep) — covered byWebPlainTextTests.FieldNamesInTheServicesOwnSentences_ReadAsThePagesWordsDarling/PerformanceMonitor.Darling.Service/wwwroot/js/panels.js:1320— theplain === "counts"arm ofcell(), round 1's third UNCOVERED line — covered byWebClampCellBehaviourTests.ACellsPlainMode_PicksItsOwnPass_CountsKeepsAToolNameInARealError
Traps near this diff
- "Two copies of one definition pinned EQUAL to each other fail only after BOTH have drifted (#3684). Alias, do not copy." — applies, and this commit is the fix:
QueryStoreRegressionRules.BaselineWindowTailreplaces three re-typed literals (DarlingMcpQueryStoreRegressionTools.cs:111,Lite/Mcp/McpQueryTools.cs:642, and the two test files) with one aliased constant. - "Ruling (#5833): tests are load-bearing... never answer a trap with a test that reads source text or asserts how code is spelled." — does not apply — the new
ACellsPlainMode_PicksItsOwnPass_CountsKeepsAToolNameInARealErrorruns the shippedpanels.js/plain-text.jsunder node viaweb-clamp-cell-harness.mjsand asserts rendered text, not source spelling. - "Lite and Darling ship in parity (CONTRIBUTING's two-store rule)." — applies and holds — the shared baseline sentence is aliased in both SKUs; the memory-clerk note has no Lite counterpart to keep in parity, since Lite registers no
get_query_store_cluttertool (grep -rln query_store_clutter Lite/finds only a config-tools reference, no implementation).
Divergence (blind read vs PR body)
None — the "Round 1 fixes" section of the PR body matches the diff point for point: the sentence-scoped regex, all four clerk-note arms, the shared BaselineWindowTail/ClerkNote* constants, and the new cell() counts-mode test. The body's disclosed non-fix ("the audit alert's e-mail, Slack and Viewer copies still read 'in 1 source(s)'... the C# ternary the review suggested is not in this PR") is accurate: those surfaces never call plainText (it is Darling-web-only), so this is an acknowledged scope limit, not a regression.
Reviewer checklist
- Run
Darling.Tests'WebPlainTextTests,WebPartialWindowBehaviourTests,WebClampCellBehaviourTests,WebDataStartNoteTestsandDarlingQueryStoreRegressionsTestsunder a realnode/xunit run to confirm the 685-run / 0-failed claim and the revert-proof. - On a running service, open the Query Store Memory Clerk panel for a server where the clerk has no capture or never appeared, and confirm neither
memory_clerksphrase reaches the page.
Claude posting for Erik Darling. Round 1 findings fixed; round 2 (5637290416) is LGTM.
Claude posting for Erik Darling.
Closes #6649.
Why
Messages written for MCP callers still reached the web pages with field names a person cannot act on:
(see databases_left_out),baseline_start/effective_start,latest_memory_mb, "in 1 source(s)" in the Alert History audit detail, and rawkey=valuecollector counts.What changes
All in
wwwroot/js; the service text is unchanged, so MCP clients see what they saw before. Lite has no web UI.plain-text.js: drops(see databases_left_out); says the baseline-window sentence as "Here the window starts before the baseline period, so the baseline holds only the part the store has."; sayslatest_memory_mbas "Latest MB", the Queries tab's column label; the count-pair rule now accepts a negative or fractional value (=-?\d+(?:\.\d+)?), which used to end the run and leave the whole note raw. The two count rules moved intomeasurementCountsText, and a newplainTextCounts(named tokens plus counts, nothing else) is exported.Errorcolumn (error_message), which was not run throughplainTextat all. A successful run leaves its counts in that column, a failed run leaves a real error message. The Collectors table's Note column was alreadyplain: true(checked by runningplainTextunder node on the issue's strings). The threeerror_messagesurfaces (read-fields.jsget_collection_log,server-tabs.jsCOLLECTION_LOG_COLUMNS,collector-run.jsresult table) now useplain: "counts"/plainTextCounts, so an error message keeps everything but its counts and the named tokens (a lonetimeout=30stays).plain-text.jsclerk note:memory_clerk.notehas four arms (DarlingMcpQueryStoreClutterTools); the first version of this PR fixed only the two that namelatest_memory_mb. All four are now handled: the other two (No memory_clerks capture ...andmemory_clerks stores the top 25 clerks ...) say "memory clerk capture" and "The memory clerks collector stores ...".util.js localizeAlertDetail: the audit sentence (Retained history for ...) goes throughplainText, so "1 source(s)" reads "1 source". Only that sentence (up to its ". " or the end of the text):CollectionHistoryAudit.Renderwrites the whole body as ONE line of ". "-joined clauses, so a line-scoped match would have run the whole body throughplainText; the clauses after the sentence (source names, ranges, the "Not read" list) print as written.Test plan
FieldNamesInTheServicesOwnSentences_ReadAsThePagesWords,ACountRunWithANegativeOrFractionalValue_StillReadsAsWords,TheCollectionLogMessage_SaysItsCountsInWords_AndLeavesAnErrorAlone(WebPlainTextTests),TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndLeavesAStatementLineAlone(WebPartialWindowBehaviourTests). Revert-proved: all four fail with the oldplain-text.js/util.js, pass with the fix.WebPlainTextTests,WebPartialWindowBehaviourTests,WebClampCellBehaviourTests,WebWordingFixesTests, every*Census*and*Ratchet*class: 541 run, 0 failed, 1 skipped.pre-push.shnot run (laptop at thermal limit; CI decides).Round 1 fixes
Claude posting for Erik Darling. Fixes for the round-1 review (CHANGES_REQUESTED 5636718691):
util.jsaudit rewrite: matches the "Retained history for ..." sentence only (to its ". " or the end), not the line; comment corrected. The harness fixture is nowCollectionHistoryAudit.Render's real output (one flagged source, every other real hourly source in the "Not read" list), passed toweb-partial-window-harness.mjsas an argument. TestTheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndKeepsEveryOtherClauseAsWritten: the rendered body equals itself with only "in 1 source(s)" changed to "in 1 source", and a later clause a fullplainTextpass would rewrite ((see databases_left_out)) stays as written. No real audit body is changed by a whole-bodyplainTextbeyond the count, so that probe clause is the only way to pin the scope; it is labelled as a probe, not as a shape the engine emits.plain-text.js: all fourmemory_clerk.notearms (see What changes).WebPlainTextTests:QueryStoreRegressionRules.BaselineWindowTail(newpublic constin Common; Darling's regressions read AND Lite'sMcpQueryToolsnow use it, so Lite's copy is aliased, not re-typed), andDarlingMcpQueryStoreClutterTools.ClerkNoteNoCapture / ClerkNoteNeverAppeared / ClerkNoteInNewestCapture / ClerkNoteDroppedOut(newinternal const). Two more test copies of the baseline sentence (DarlingQueryStoreRegressionsTests,WebDataStartNoteTests) now alias the constant. The(see databases_left_out)input stays typed in the test: it is a generic suffix strip, three producers share it, and the rule does not depend on the rest of the sentence. Text of every sentence is unchanged.panels.js: thecounts/plainarms ofcell()are indented as one chain. NewACellsPlainMode_PicksItsOwnPass_CountsKeepsAToolNameInARealError(WebClampCellBehaviourTests, viaweb-clamp-cell-harness.mjs): one note throughplain: "counts",true,"named"and no key; counts says the measurement counts in words and keepsget_collection_health, full turns it into "Collection Health", named leaves the counts, none prints as stored.Tests: built
Darling.Tests(Debug, -m:1): 0 errors; the 2 warnings are a null-dereference inDarling.Viewer/MainWindow.xaml.cs(559), a file this PR does not touch. BuiltLite.Tests: 0 errors. RanWebPlainTextTests,*WebPartialWindow*,*WebClampCell*,*CollectionHistoryAudit*,*QueryStoreClutter*,*QueryStoreRegressions*,*WebDataStartNote*, every*Census*and*Ratchet*class: 685 run, 0 failed, 39 skipped (live classes, no rig); Node 22.14 was on PATH so the harness tests ran, not skipped. Revert-proved: with the oldutil.jsandplain-text.jsrestored,FieldNamesInTheServicesOwnSentences_ReadAsThePagesWordsand the audit test both fail. Not run:pre-push.sh, the full suite,Lite.Testsclasses, any live class (CI decides). The cpucap and testslot wrappers were refused by this agent's shell (a git-form check on the bash wrapper; the pwsh route failed with MSB1008), so builds and tests ran as plain commands with -m:1.The audit alert's e-mail, Slack and Viewer copies still read "in 1 source(s)": the page rewrite is the ruled design; the C# ternary the review suggested is not in this PR.
Considered, not added
plainText(full) on the log Error column: a failed run's error can quote a real name or aget_word, which is why Last Error uses the named-only mode; the counts mode keeps that property.CHANGELOG entry
SECTION: Fixed
ENTRY:
baseline_start/effective_startandlatest_memory_mb, Alert History showed "1 source(s)" in the collection-history audit alert, and the Server Health tab's Collection Log showed collector notes as rawkey=valuetext. The page now says these in plain words ("Latest MB", "before the baseline period", "1 source", "ring buffer truncated: 1"), and a count with a negative or decimal value no longer stops the rewrite. The MCP answers are unchanged.REF:
[Web pages say MCP field names and raw collector counts in words (#6649) #6670]: Web pages say MCP field names and raw collector counts in words (#6649) #6670