Repository navigation
Health-parser truncation text says how many events were read (#6650) - #6664
Conversation
| public static string HealthParserMessage( | ||
| string eventType, string serverName, int hoursBack, string truncation, | ||
| int eventsRead = 0, string? noneQualifiedBecause = null) |
There was a problem hiding this comment.
Non-blocking, and not a reason to hold the PR.
Two observations about the optional-parameter shape here, both about the next caller rather than these two:
-
eventsRead = 0makes the pre-Health-parser reads say "No ... events were found" while the same answer counts 982 of them (ring-buffer truncation message) #6650 wording the default. A third reader of this helper that forgets the two arguments compiles clean and silently re-emits "No … events were found" over a nonzero count — the exact defect this PR fixes, with no test failing, because the two behaviour tests added here pin the two call sites that do pass them. Both current call sites are correct (Lite/Mcp/McpHealthParserTools.cs:689,Darling/…/DarlingMcpHealthParserTools.cs:899), so nothing is wrong today; required parameters would just make the regression impossible rather than merely untested. -
noneQualifiedBecause ?? "none qualified"(line 127) is unreachable: both call sites thread a non-null gate description down fromEmptyAsync's requiredstring noneQualifiedBecauseparameter, andeventsRead > 0is the only branch that reads it. Harmless as defence; just noting it is not exercised by anything.
There was a problem hiding this comment.
Verdict: LGTM
Claims
- VERIFIED —
HealthParserMessagealways opened "No {type} events were found", even when the read had counted events of that type — the pre-change format string was the only first clause (PerformanceMonitor.Common/RingBufferTruncationNote.cs, the removed line in the diff), while the same rung already published the count it contradicted:eventsInWindow: capturedatLite/Mcp/McpHealthParserTools.cs:690andeventsInWindow: c.RawEventCountatDarling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:900. - VERIFIED — both callers already knew the count and the filter text — Lite's
captured(Lite/Mcp/McpHealthParserTools.cs:676) and its requirednoneQualifiedBecauseparameter (:674); Darling'sc.RawEventCountandnoneQualifiedBecause(DarlingMcpHealthParserTools.cs:884). Neither call adds a query. - VERIFIED —
HealthParserMessagetakes optionalint eventsRead = 0, string? noneQualifiedBecause = null; witheventsRead > 0the first clause is the count-and-filter sentence, at 0 it is the old text —RingBufferTruncationNote.cs:115-133. - VERIFIED — "this is NOT an all-clear" and the truncation text are unchanged — the tail at
RingBufferTruncationNote.cs:135-138is the old format string from", and this is NOT an all-clear"onward, character for character, with the hole renumbered{3}→{0}. - VERIFIED — the callers pass the values —
Lite/Mcp/McpHealthParserTools.cs:689andDarlingMcpHealthParserTools.cs:899, the diff's only two production hunks. Parity is held in the same push, and the sentence itself lives once in Common. - VERIFIED —
RingBufferTruncationSignalTests.HealthParserMessage_WithEventsRead_…asserts count > 0 has no "were found" and carries the count and filter text, and count 0 keeps today's text —Lite.Tests/RingBufferTruncationSignalTests.cs:163-177; both arms are in the one test. - VERIFIED — the Lite and Darling tool tests seed a gated-out event in the window plus a truncated run note and get "1 {type} event(s) were read for …" —
Lite.Tests/McpWindowNoticeSystemHealthToolTests.cs:663-686andDarling/Darling.Tests/DarlingMcpHealthParserToolsWindowNoticeTests.cs:316-342. Both deliberately insert the rawmemory_broker.xmlrather than going throughSeedEventAsync/SeedHealthEventAsync, so the fixture keepsRESOURCE_MEMPHYSICAL_HIGH(Lite.Tests/Fixtures/SystemHealth/memory_broker.xml:13) and the gate drops it — one event counted, zero rows survive, which is the rung under test. - VERIFIED — with only the two callers reverted both tool tests fail — mechanically, from the defaults: a reverted call omits
eventsRead, which defaults to 0, which selects the "No … events were found" branch atRingBufferTruncationNote.cs:128, and both tests open withAssert.StartsWith("1 {eventType} event(s) were read for …"). - UNVERIFIED — Lite:
*RingBufferTruncation*,*McpWindowNoticeSystemHealthToolTests*,*Census*,*Ratchet*,*McpMissMessageParityPin*,*HealthParser*, Total 239 Failed 0 — a test run; this tree is read-only andLite.Testswants Windows and a DuckDB file. - UNVERIFIED — Darling against a throwaway PostgreSQL, Total 662 Failed 0 — the live class skips without
DARLING_TEST_PG(Darling/Darling.Tests/WindowFloorLiveHarness.cs:76), so the new Darling case only executes in the Darling PostgreSQL job.
Riskiest lines
PerformanceMonitor.Common/RingBufferTruncationNote.cs:119— theeventsRead > 0ternary is the whole fix: the wrong side of it either restores the #6650 contradiction or claims "0 event(s) were read" on a genuinely empty window — covered byRingBufferTruncationSignalTests.HealthParserMessage_WithEventsRead_SaysHowManyAndWhyNoneQualified_NotThatNoneWereFound, whose second arm asserts the 0 case keeps "No memory_broker events were found".Lite/Mcp/McpHealthParserTools.cs:689— two new positional arguments on a call whose next-door rung (:700) builds a near-identical sentence from the same two values; a swap or an omission would keep the old wording with nothing else visibly wrong — covered byMcpWindowNoticeSystemHealthToolTests.ATruncatedRingBuffer_WithEventsReadButGatedOut_SaysHowManyWereRead_NotThatNoneWereFound.Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:899— the Darling twin, whereRawEventCountisxmls.Countfrom a different reader than Lite's count, so the two SKUs could agree in wording and disagree in number — covered byDarlingMcpHealthParserToolsWindowNoticeLiveTests.ATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgres, which asserts the literal1; it runs only withDARLING_TEST_PGset.
Traps near this diff
- "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 — both SKUs move in this push (
Lite/Mcp/McpHealthParserTools.cs:689,DarlingMcpHealthParserTools.cs:899) and each gets its own behaviour test; the wire text itself is built once atRingBufferTruncationNote.cs:115. - "Two copies of one definition pinned EQUAL to each other fail only after BOTH have drifted (#3684). Alias, do not copy." — does not apply — the sentence was not duplicated into either SKU;
grep HealthParserMessagefinds exactly one definition and two call sites. - "An empty analysis window is 'unavailable', not an all-clear (#3553)" — does not apply — the rung still answers
unavailablewithsourceObserved: trueand the "NOT an all-clear" clause intact (Lite/Mcp/McpHealthParserTools.cs:687-690,RingBufferTruncationNote.cs:135-138); only the first clause's wording changed, and the four-rung ladder below it is untouched. - "A count taken off the page and named as the population's:
non_default_count = rows.Count(!IsDefault)over the rows fetched reported thelimitas a fact about the snapshot (#3679)" — does not apply — neither number put into the sentence is page-bounded:DarlingSystemHealthReader.SystemHealthEventsByTypeSqlcarries noLIMIT(DarlingSystemHealthReader.cs:52-62) and Lite's count isxmls.Countover the same unlimited read (Lite/Services/LocalDataService.SystemEvents.cs:495) or a type-scopedCOUNT. "event(s)" is also the right noun: both count event rows, not shredded records. - "Never add one, and never answer a trap with a test that reads source text or asserts how code is spelled … A trap is answered with a behaviour test that fails on the defect and passes on the fix" (#5833) — applies, and is satisfied — all three added tests execute the code: one calls the formatter and reads its string (
RingBufferTruncationSignalTests.cs:163), two seed a store and parse the tool's JSON answer (McpWindowNoticeSystemHealthToolTests.cs:663,DarlingMcpHealthParserToolsWindowNoticeTests.cs:316). No census, roster or source-reading pin was added. - "A test that reads the clock twice measures the CI scheduler: the delta-seeder tests failed at 123 and 243 on unrelated PRs (#3676). One anchor owns both ends of an interval." — does not apply — the Lite case hangs every instant off the fixed
Anchorconstant (McpWindowNoticeSystemHealthToolTests.cs:43) and the Darling case off the singleendthe harness hands the body. - "
hours_back,limit,top,days_backare refused when out of range, never clamped — a clamp is a silent lie about the window (#3699)" — does not apply — no window or page parameter is touched;hours_backonly reaches the new code as a number printed into a sentence.
Divergence (blind read vs PR body)
None — the body's account matches the diff on every claim graded above. Two things my read turned up that the body does not mention, neither a disagreement: the noneQualifiedBecause ?? "none qualified" fallback at RingBufferTruncationNote.cs:127 is unreachable from either call site, and the existing #6441 theories (McpWindowNoticeSystemHealthToolTests.cs:641, DarlingMcpHealthParserToolsWindowNoticeTests.cs:293) keep passing only because each seeds its event OUTSIDE the window (WindowStart.AddDays(-1) and end.AddDays(-20) against a 168-hour window), so they still exercise the eventsRead == 0 branch — worth knowing before either of those seeds is ever moved inside the window. Both are in the inline comment on the signature; neither blocks.
Reviewer checklist
- Run the Darling PostgreSQL job (or export
DARLING_TEST_PGlocally) and confirmATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgresactually executed rather than skipped — it is the only coverage of the Darling call site, andWindowFloorLiveHarness.cs:76turns a missing connection string into a green skip. - Build both SKUs (
Liteneeds Windows/WPF) and confirm no new warnings from the two changed call sites, per CONTRIBUTING's "C# code compiles without warnings". - Read one real truncated-and-gated answer end to end from a live MCP client — the new first clause concatenates a gate description that for
get_health_parser_severe_errorshas a database fragment appended (Lite/Mcp/McpHealthParserTools.cs:158-160), so the full sentence underdatabase_nameis worth eyeballing once for sense.
Pull request was converted to draft
There was a problem hiding this comment.
Verdict: LGTM
Claims
- VERIFIED —
HealthParserMessagealways opened "No {type} events were found" even when the read had counted events of that type and its filter left none — the removed line inPerformanceMonitor.Common/RingBufferTruncationNote.cswas the only first clause, and the same rung already published the count that contradicted it:eventsInWindow: capturedatLite/Mcp/McpHealthParserTools.cs:690andeventsInWindow: c.RawEventCountatDarling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:900. - VERIFIED — both callers already knew the count and the filter text — Lite's
captured(McpHealthParserTools.cs:676) and its requirednoneQualifiedBecauseparameter (:674); Darling'sc.RawEventCountandnoneQualifiedBecause(DarlingMcpHealthParserTools.cs:884). Neither call site adds a query. - VERIFIED — the signature takes optional
int eventsRead = 0, string? noneQualifiedBecause = null, andeventsRead > 0selects the count-and-filter clause while 0 keeps the old text —RingBufferTruncationNote.cs:115-133. - VERIFIED — "this is NOT an all-clear" and the truncation text are unchanged — the tail at
RingBufferTruncationNote.cs:135-138is the old format string from", and this is NOT an all-clear"onward, character for character, with the hole renumbered{3}to{0}. - VERIFIED — the callers pass the values —
McpHealthParserTools.cs:689andDarlingMcpHealthParserTools.cs:899are the diff's only two production hunks, both in this push, over one definition in Common. - VERIFIED —
RingBufferTruncationSignalTests.HealthParserMessage_WithEventsRead_...asserts count > 0 carries the count and filter text and no "were found", and count 0 keeps today's text —Lite.Tests/RingBufferTruncationSignalTests.cs:163-177, both arms in one test. - VERIFIED — the Lite and Darling tool tests seed a gated-out event in the window plus a truncated run note and get "1 {type} event(s) were read for ..." —
Lite.Tests/McpWindowNoticeSystemHealthToolTests.cs:663-686andDarling/Darling.Tests/DarlingMcpHealthParserToolsWindowNoticeTests.cs:316-342. Both insert the rawmemory_broker.xmlrather than going through the seed helpers, so the fixture keepsnotification = RESOURCE_MEMPHYSICAL_HIGH(Darling/Darling.Tests/Fixtures/SystemHealth/memory_broker.xml:13) andSystemHealthSignificance.IsSignificant(MemoryBrokerRecord)(PerformanceMonitor.Common/SystemHealthSignificance.cs:144) drops it: one event counted, zero rows survive, which is the rung #6650 named. - VERIFIED — with only the two callers reverted both tool tests fail — a reverted call omits
eventsRead, which defaults to 0, which selects the "No ... events were found" branch atRingBufferTruncationNote.cs:128, while both tests openAssert.StartsWith("1 {eventType} event(s) were read for ..."). - UNVERIFIED — Lite suites, Total 239 Failed 0 — a test run; this tree is read-only and
Lite.Testswants Windows and a DuckDB file. - UNVERIFIED — Darling against a throwaway PostgreSQL, Total 662 Failed 0 — the new Darling case sits in a
live-postgresclass whose harness turns a missingDARLING_TEST_PGinto a green skip (Darling/Darling.Tests/WindowFloorLiveHarness.cs:76), so only the Darling PostgreSQL job executes it.
Riskiest lines
PerformanceMonitor.Common/RingBufferTruncationNote.cs:119— theeventsRead > 0ternary is the entire fix: the wrong side either restores the #6650 contradiction or prints "0 event(s) were read" over a genuinely empty window — covered byRingBufferTruncationSignalTests.HealthParserMessage_WithEventsRead_SaysHowManyAndWhyNoneQualified_NotThatNoneWereFound, whose second arm pins the 0 case.Lite/Mcp/McpHealthParserTools.cs:689— two new positional arguments on a call whose neighbouring rung (:700) builds a near-identical sentence from the same two values, so a wrong count would read as plausible — covered byMcpWindowNoticeSystemHealthToolTests.ATruncatedRingBuffer_WithEventsReadButGatedOut_SaysHowManyWereRead_NotThatNoneWereFound, which asserts the literal1.Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:899— the twin, where the number isxmls.Countfrom a different reader than Lite's count, so the SKUs could agree in wording and disagree in number — covered byDarlingMcpHealthParserToolsWindowNoticeLiveTests.ATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgres, but only whenDARLING_TEST_PGis set.
Traps near this diff
- "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 — both SKUs move in this push (
McpHealthParserTools.cs:689,DarlingMcpHealthParserTools.cs:899), each with its own behaviour test, and the wire text is built once atRingBufferTruncationNote.cs:115. - "Two copies of one definition pinned EQUAL to each other fail only after BOTH have drifted (#3684). Alias, do not copy." — does not apply — the sentence was not duplicated into either SKU; one definition, two call sites.
- "An empty analysis window is 'unavailable', not an all-clear (#3553); a server nothing has banded yet is Unknown, not Healthy (#3635)." — does not apply — the rung still answers
unavailablewithsourceObserved: trueand the "NOT an all-clear" clause intact (McpHealthParserTools.cs:687-690,RingBufferTruncationNote.cs:135-138); only the first clause's wording moved and the ladder below is untouched. - "A count taken off the page and named as the population's:
non_default_count = rows.Count(!IsDefault)over the rows fetched reported thelimitas a fact about the snapshot (#3679)." — does not apply — neither number is page-bounded:DarlingSystemHealthReader.SystemHealthEventsByTypeSqlcarries noLIMIT(DarlingSystemHealthReader.cs:52-63) and Lite's isxmls.Countover the same unlimited read (Lite/Services/LocalDataService.SystemEvents.cs:495) or a type-scopedCOUNT(*)(:600). "event(s)" is also the right noun: both count event rows, not shredded records. - "A default interface member compiles a parity gap away:
DeliverAndReportAsyncwith a default body left Lite's deliverer and fourteen fakes inheriting an answer nobody wrote (#3640)." — does not apply — no interface member here, and both existing call sites pass the new arguments. The analogue is real but weaker and non-blocking:eventsRead = 0means a future third health-parser read that forgets the argument silently gets the #6650 wording back with nothing failing to build. - "Never add one, and never answer a trap with a test that reads source text or asserts how code is spelled ... A trap is answered with a behaviour test that fails on the defect and passes on the fix" (#5833) — applies and is satisfied — all three added tests execute the code: one calls the formatter and reads its output, two seed a store and parse the tool's JSON. No census, roster or source-reading pin was added.
- "A test that reads the clock twice measures the CI scheduler (#3676). One anchor owns both ends of an interval." — does not apply — the Lite case hangs every stamp off the fixed
Anchorconstant (McpWindowNoticeSystemHealthToolTests.cs:43) and the Darling case off the singleendthe harness hands the body (WindowFloorLiveHarness.cs:110).
Divergence (blind read vs PR body)
None — the body's account matches the diff on every claim graded above. Two things my read turned up that the body does not mention, neither a disagreement nor blocking: the noneQualifiedBecause ?? "none qualified" fallback at RingBufferTruncationNote.cs:127 is unreachable from either call site (both pass a non-nullable string), and the pre-existing #6441 theories (McpWindowNoticeSystemHealthToolTests.cs:641, DarlingMcpHealthParserToolsWindowNoticeTests.cs:293) keep passing only because each seeds its event OUTSIDE the 168-hour window (WindowStart.AddDays(-1) and end.AddDays(-20)), so they still exercise the eventsRead == 0 branch — worth knowing before either seed moves inside the window. I also checked that none of the nine noneQualifiedBecause strings contains the word "quiet", which is what keeps those theories' Assert.DoesNotContain("quiet", ...) honest under the new clause.
Reviewer checklist
- Run the Darling PostgreSQL job (or export
DARLING_TEST_PGlocally) and confirmATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgresactually executed rather than skipped — it is the only coverage of the Darling call site, andWindowFloorLiveHarness.cs:76turns a missing connection string into a green skip. - Build both SKUs (Lite needs Windows/WPF) and confirm the two changed call sites raise no new warnings, per CONTRIBUTING's "compiles without warnings".
- Read one real truncated-and-gated answer end to end from a live MCP client, specifically
get_health_parser_severe_errors: its gate description has a database fragment appended (McpHealthParserTools.cs:158-160) while the window count is not database-scoped (LocalDataService.SystemEvents.cs:599-601), so the composed sentence is worth eyeballing once for sense.
Pull request was converted to draft
|
Non-blocking, and strictly a follow-up rather than anything this push should carry: the guide topic that documents this family's empty answers still has no rung for the truncated ring buffer, and the new first clause makes that gap easier to walk into.
The #6441 truncation rung does not fit that: it answers Nothing in this diff caused that — the rung and its witness landed in #6441 — and the wording change here is the right one for #6650. It just seems worth a line in the guide topic (a fifth bullet: truncated ring buffer, |
There was a problem hiding this comment.
Verdict: LGTM
Claims
- VERIFIED —
HealthParserMessagealways opened "No {type} events were found" even when the read had counted events of that type — the deleted line was the only first clause, and the same rung already published the contradicting number (eventsInWindow: captured,Lite/Mcp/McpHealthParserTools.cs:690;c.RawEventCount,Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:900). - VERIFIED — the signature takes optional
int eventsRead = 0, string? noneQualifiedBecause = null;> 0selects the count-and-gate clause, 0 keeps the old text —PerformanceMonitor.Common/RingBufferTruncationNote.cs:115-133. - VERIFIED — "this is NOT an all-clear" and the truncation text are unchanged — the tail at
RingBufferTruncationNote.cs:135-138is the old format string from", and this is NOT an all-clear"onward character for character, hole renumbered{3}→{0}. - VERIFIED — both callers already knew the count and the filter text, so neither adds a query — Lite's
capturedis computed above the branch (McpHealthParserTools.cs:676-677) andnoneQualifiedBecauseis a required parameter (:674); Darling'sRawEventCountis set on the data read (DarlingMcpHealthParserTools.cs:850),noneQualifiedBecauserequired at:884. - VERIFIED — the callers pass the values —
McpHealthParserTools.cs:689andDarlingMcpHealthParserTools.cs:899, the diff's only two production hunks, over one definition in Common. - VERIFIED — the unit test asserts count > 0 carries the count and filter text and no "were found", and count 0 keeps today's text —
Lite.Tests/RingBufferTruncationSignalTests.cs:163-177, both arms in one test. - VERIFIED — the Lite and Darling cases seed a gated-out event plus a truncated run note and get "1 {type} event(s) were read for …" —
Lite.Tests/McpWindowNoticeSystemHealthToolTests.cs:663-686,Darling/Darling.Tests/DarlingMcpHealthParserToolsWindowNoticeTests.cs:316-342. Both insert the rawmemory_broker.xmlrather than using the seed helpers, sonotification = RESOURCE_MEMPHYSICAL_HIGHsurvives (fixture line 13) andSystemHealthSignificance.IsSignificant(MemoryBrokerRecord)(SystemHealthSignificance.cs:144) drops it: one event counted, zero rows survive. - VERIFIED — with only the two callers reverted both tool tests fail — the omitted
eventsReaddefaults to 0 and selects the "No … events were found" branch (RingBufferTruncationNote.cs:128), while both tests openAssert.StartsWith("1 {eventType} event(s) were read for …"). - UNVERIFIED — Lite suites, Total 239 Failed 0 — a test run; read-only tree, and the Lite suite wants Windows and a DuckDB file.
- UNVERIFIED — Darling against throwaway PostgreSQL, Total 662 Failed 0 — the new case is in a
live-postgresclass whose harness turns a missingDARLING_TEST_PGinto a green skip (WindowFloorLiveHarness.cs:76).
Riskiest lines
PerformanceMonitor.Common/RingBufferTruncationNote.cs:119— theeventsRead > 0ternary is the whole fix; the wrong side either restores #6650 or prints "0 event(s) were read" over an empty window — covered byHealthParserMessage_WithEventsRead_SaysHowManyAndWhyNoneQualified_NotThatNoneWereFound(second arm pins the 0 case), and the pre-existingATruncatedRingBuffer_OnTheNewestRun_IsNotCalledQuietstill reads the 0 branch because it seeds outside the window.Lite/Mcp/McpHealthParserTools.cs:689— two new positional arguments on a call whose neighbour rung (:700) builds a near-identical sentence from the same values, so a wrong count reads as plausible — covered byATruncatedRingBuffer_WithEventsReadButGatedOut_SaysHowManyWereRead_NotThatNoneWereFound, which asserts the literal1.Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:899— the twin, where the number isxmls.Countfrom a different reader than Lite'sCOUNT(*), so the SKUs could agree in wording and disagree in number — covered byATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgres, but only withDARLING_TEST_PGset.
Traps near this diff
- "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 — both SKUs move here (
McpHealthParserTools.cs:689,DarlingMcpHealthParserTools.cs:899), each with its own behaviour test, and the text is built once atRingBufferTruncationNote.cs:115. - "Two copies of one definition pinned EQUAL to each other fail only after BOTH have drifted (#3684). Alias, do not copy." — does not apply — one definition, two call sites; no copy of the sentence exists in either tree, so no parity pin needed updating.
- "An empty analysis window is 'unavailable', not an all-clear (#3553); a server nothing has banded yet is Unknown, not Healthy (#3635)." — does not apply — the rung still answers
unavailablewith the "NOT an all-clear" clause intact (McpHealthParserTools.cs:687-690,RingBufferTruncationNote.cs:135-138); only the first clause changed. - "A count taken off the page and named as the population's … reported the
limitas a fact about the snapshot (#3679)." — does not apply — neither number is page-bounded:DarlingSystemHealthReader.ReadEventXmlAsynchas noLIMIT(DarlingSystemHealthReader.cs:66-84), Lite's is a type-scopedCOUNT(*)over the window (LocalDataService.SystemEvents.cs:592-607). "event(s)" is the right noun too — both count event rows, not shredded records. - "A default interface member compiles a parity gap away … (#3640)." — does not apply — no interface member, and both call sites pass the new arguments. The analogue is weaker and non-blocking:
eventsRead = 0lets a future third reader silently get the #6650 wording back; required parameters plus0, nullin the unit test would close it. - "Never answer a trap with a test that reads source text or asserts how code is spelled … a behaviour test that fails on the defect and passes on the fix" (#5833) — applies and is satisfied — all three tests execute the code (
RingBufferTruncationSignalTests.cs:163reads the formatter's output;McpWindowNoticeSystemHealthToolTests.cs:666andDarlingMcpHealthParserToolsWindowNoticeTests.cs:316seed a store and parse the tool's JSON). No census or source-reading pin added. - "A test that reads the clock twice measures the CI scheduler (#3676). One anchor owns both ends of an interval." — does not apply — the Lite case hangs every stamp off the fixed
Anchor(McpWindowNoticeSystemHealthToolTests.cs:43), the Darling case off the singleendthe harness supplies.
Divergence (blind read vs PR body)
None — the body's account matches the diff on every claim graded above. Three things my read added that the body does not mention, none a disagreement: (a) the guide topic still documents four rungs and pairs unavailable with source_observed false only (McpToolGuideTopics.HealthParser.cs:24-37) while this rung is unavailable with sourceObserved: true and now wears a rung-1-shaped clause — pre-existing from #6441, raised as a non-blocking comment; (b) the noneQualifiedBecause ?? "none qualified" fallback (RingBufferTruncationNote.cs:127) is unreachable, since both callers pass a non-nullable string; (c) for get_health_parser_severe_errors the clause composes a server-wide count (LocalDataService.SystemEvents.cs:592-607, no database predicate) with a database-scoped gate description (McpHealthParserTools.cs:158-160) — the same composition rung 1 has shipped at :700, so not a regression.
Reviewer checklist
- Run the Darling PostgreSQL job (or export
DARLING_TEST_PG) and confirmATruncatedRingBufferRun_WithEventsReadButGatedOut_…executed rather than skipped — it is the only coverage of the Darling call site, andWindowFloorLiveHarness.cs:76turns a missing connection string into a green skip. - Build both SKUs (Lite needs Windows/WPF) and confirm the two changed call sites raise no new warnings.
- Read one real truncated-and-gated answer from a live MCP client, specifically
get_health_parser_severe_errorswith adatabasechosen, so the composed sentence gets eyeballed once for sense. -
CHANGELOG.mdanddocs/changelog/are untouched in the diff — the entry in the PR body still needs applying wherever the release process takes it from.
There was a problem hiding this comment.
Verdict: LGTM
Claims
N/A for this pass — no new factual claims accompany this commit; the PR body describes the original fix (774f837), already graded in the prior review.
Riskiest lines
N/A — the only commit in this follow-up range is a merge commit with an empty diff against its own fix-branch parent.
Traps near this diff
N/A — no new diff to hold against the traps file.
Divergence (blind read vs PR body)
None — the PR body describes the health-parser fix from 774f837, which the prior review already verified; this pass adds no new claims to check.
This follow-up range (774f837..2fb94e3) contains exactly one new commit: 2fb94e36d, "Merge branch 'dev' into fix/6650-health-parser-wording." Verified it is a clean, non-conflicting merge with no authored changes of its own:
git diff 774f8376b 2fb94e36d -- <the 6 files 774f8376b touched>is empty — the health-parser fix's files are byte-identical before and after the merge.git diff 324d5db9c 2fb94e36d --stat(324d5db = dev's tip, the merge's other parent) shows only those same 6 files — the merge commit's tree is exactly dev's tree plus the untouched fix-branch diff, i.e. a trivial union merge with no conflict resolution.
So the merge brought in the rest of dev (the large file list in git diff BASE HEAD --stat) without touching or interacting with the fix, per the instruction that a base-branch merge's contents aren't the author's change absent interaction. There's nothing in this range for me to review.
Reviewer checklist
- None beyond what the prior review already asked for — no new code was authored in this range.
Claude posting for Erik Darling.
Closes #6650.
Why
RingBufferTruncationNote.HealthParserMessagealways opened "No {type} events were found", even when the read had counted events of that type and its filter left none (hundreds, in the report). Both callers already knew the count and the filter text.What changes
PerformanceMonitor.Common/RingBufferTruncationNote.cs:HealthParserMessagetakes optionalint eventsRead = 0, string? noneQualifiedBecause = null. WitheventsRead > 0the first clause is "{n} {type} event(s) were read for {server} in the last {h} hour(s), and {noneQualifiedBecause}"; at 0 it is the old "No ... were found" text. "this is NOT an all-clear" and the truncation text are unchanged.Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs(c.RawEventCount,noneQualifiedBecause) andLite/Mcp/McpHealthParserTools.cs(captured,noneQualifiedBecause).Test plan
RingBufferTruncationSignalTests.HealthParserMessage_WithEventsRead_...: count > 0 has no "were found" and has the count and filter text; count 0 keeps today's text.McpWindowNoticeSystemHealthToolTests.ATruncatedRingBuffer_WithEventsReadButGatedOut_...(Lite) andDarlingMcpHealthParserToolsWindowNoticeLiveTests.ATruncatedRingBufferRun_WithEventsReadButGatedOut_...(Darling, live PostgreSQL): a gated-out event in the window plus a truncated run note answers "1 {type} event(s) were read for ...", not "No ... were found". With only the two callers reverted, both fail; with the fix they pass.*RingBufferTruncation*,*McpWindowNoticeSystemHealthToolTests*,*Census*,*Ratchet*,*McpMissMessageParityPin*,*HealthParser*: Total 239, Failed 0.*DarlingMcpHealthParserToolsWindowNoticeTests*(the live class),*Census*,*Ratchet*,*McpMissMessageParityPin*,*HealthParser*: Total 662, Failed 0.pre-push.sh(brief says CI decides).CHANGELOG entry
SECTION: Fixed
ENTRY:
REF:
[Health-parser truncation text says how many events were read (#6650) #6664]: Health-parser truncation text says how many events were read (#6650) #6664