Skip to content

Health-parser truncation text says how many events were read (#6650) - #6664

Merged
erikdarlingdata merged 2 commits into
devfrom
fix/6650-health-parser-wording
Oct 24, 2026
Merged

erikdarlingdata merged 2 commits into
devfrom
fix/6650-health-parser-wording

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Claude posting for Erik Darling.

Closes #6650.

Why

RingBufferTruncationNote.HealthParserMessage always 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: HealthParserMessage takes optional int eventsRead = 0, string? noneQualifiedBecause = null. With eventsRead > 0 the 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.
  • Callers pass the values: Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs (c.RawEventCount, noneQualifiedBecause) and Lite/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) and DarlingMcpHealthParserToolsWindowNoticeLiveTests.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.
  • Lite: *RingBufferTruncation*, *McpWindowNoticeSystemHealthToolTests*, *Census*, *Ratchet*, *McpMissMessageParityPin*, *HealthParser*: Total 239, Failed 0.
  • Darling (throwaway PostgreSQL): *DarlingMcpHealthParserToolsWindowNoticeTests* (the live class), *Census*, *Ratchet*, *McpMissMessageParityPin*, *HealthParser*: Total 662, Failed 0.
  • Not run: full suite, pre-push.sh (brief says CI decides).

CHANGELOG entry

SECTION: Fixed
ENTRY:

@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 24, 2026 01:02
Comment on lines +115 to +117
public static string HealthParserMessage(
string eventType, string serverName, int hoursBack, string truncation,
int eventsRead = 0, string? noneQualifiedBecause = null)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. eventsRead = 0 makes 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.

  2. noneQualifiedBecause ?? "none qualified" (line 127) is unreachable: both call sites thread a non-null gate description down from EmptyAsync's required string noneQualifiedBecause parameter, and eventsRead > 0 is the only branch that reads it. Harmless as defence; just noting it is not exercised by anything.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: LGTM

Claims

  • VERIFIED — HealthParserMessage always 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: captured at Lite/Mcp/McpHealthParserTools.cs:690 and eventsInWindow: c.RawEventCount at Darling/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 required noneQualifiedBecause parameter (:674); Darling's c.RawEventCount and noneQualifiedBecause (DarlingMcpHealthParserTools.cs:884). Neither call adds a query.
  • VERIFIED — HealthParserMessage takes optional int eventsRead = 0, string? noneQualifiedBecause = null; with eventsRead > 0 the 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-138 is 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:689 and DarlingMcpHealthParserTools.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-686 and Darling/Darling.Tests/DarlingMcpHealthParserToolsWindowNoticeTests.cs:316-342. Both deliberately insert the raw memory_broker.xml rather than going through SeedEventAsync / SeedHealthEventAsync, so the fixture keeps RESOURCE_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 at RingBufferTruncationNote.cs:128, and both tests open with Assert.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 and Lite.Tests wants 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

  1. PerformanceMonitor.Common/RingBufferTruncationNote.cs:119 — the eventsRead > 0 ternary 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 by RingBufferTruncationSignalTests.HealthParserMessage_WithEventsRead_SaysHowManyAndWhyNoneQualified_NotThatNoneWereFound, whose second arm asserts the 0 case keeps "No memory_broker events were found".
  2. 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 by McpWindowNoticeSystemHealthToolTests.ATruncatedRingBuffer_WithEventsReadButGatedOut_SaysHowManyWereRead_NotThatNoneWereFound.
  3. Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:899 — the Darling twin, where RawEventCount is xmls.Count from a different reader than Lite's count, so the two SKUs could agree in wording and disagree in number — covered by DarlingMcpHealthParserToolsWindowNoticeLiveTests.ATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgres, which asserts the literal 1; it runs only with DARLING_TEST_PG 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 (Lite/Mcp/McpHealthParserTools.cs:689, DarlingMcpHealthParserTools.cs:899) and each gets its own behaviour test; the wire text itself is built once at RingBufferTruncationNote.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 HealthParserMessage finds 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 unavailable with sourceObserved: true and 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 the limit as a fact about the snapshot (#3679)" — does not apply — neither number put into the sentence is page-bounded: DarlingSystemHealthReader.SystemHealthEventsByTypeSql carries no LIMIT (DarlingSystemHealthReader.cs:52-62) and Lite's count is xmls.Count over the same unlimited read (Lite/Services/LocalDataService.SystemEvents.cs:495) or a type-scoped COUNT. "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 Anchor constant (McpWindowNoticeSystemHealthToolTests.cs:43) and the Darling case off the single end the harness hands the body.
  • "hours_back, limit, top, days_back are 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_back only 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_PG locally) and confirm ATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgres actually executed rather than skipped — it is the only coverage of the Darling call site, and WindowFloorLiveHarness.cs:76 turns a missing connection string into a green skip.
  • Build both SKUs (Lite needs 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_errors has a database fragment appended (Lite/Mcp/McpHealthParserTools.cs:158-160), so the full sentence under database_name is worth eyeballing once for sense.

@erikdarlingdata
erikdarlingdata enabled auto-merge (squash) October 24, 2026 01:20
@erikdarlingdata
erikdarlingdata marked this pull request as draft October 24, 2026 02:37
auto-merge was automatically disabled October 24, 2026 02:37

Pull request was converted to draft

@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 24, 2026 02:37
@erikdarlingdata
erikdarlingdata enabled auto-merge (squash) October 24, 2026 02:38

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: LGTM

Claims

  • VERIFIED — HealthParserMessage always opened "No {type} events were found" even when the read had counted events of that type and its filter left none — the removed line in PerformanceMonitor.Common/RingBufferTruncationNote.cs was the only first clause, and the same rung already published the count that contradicted it: eventsInWindow: captured at Lite/Mcp/McpHealthParserTools.cs:690 and eventsInWindow: c.RawEventCount at Darling/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 required noneQualifiedBecause parameter (:674); Darling's c.RawEventCount and noneQualifiedBecause (DarlingMcpHealthParserTools.cs:884). Neither call site adds a query.
  • VERIFIED — the signature takes optional int eventsRead = 0, string? noneQualifiedBecause = null, and eventsRead > 0 selects 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-138 is 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:689 and DarlingMcpHealthParserTools.cs:899 are 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-686 and Darling/Darling.Tests/DarlingMcpHealthParserToolsWindowNoticeTests.cs:316-342. Both insert the raw memory_broker.xml rather than going through the seed helpers, so the fixture keeps notification = RESOURCE_MEMPHYSICAL_HIGH (Darling/Darling.Tests/Fixtures/SystemHealth/memory_broker.xml:13) and SystemHealthSignificance.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 at RingBufferTruncationNote.cs:128, while both tests open Assert.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.Tests wants Windows and a DuckDB file.
  • UNVERIFIED — Darling against a throwaway PostgreSQL, Total 662 Failed 0 — the new Darling case sits in a live-postgres class whose harness turns a missing DARLING_TEST_PG into a green skip (Darling/Darling.Tests/WindowFloorLiveHarness.cs:76), so only the Darling PostgreSQL job executes it.

Riskiest lines

  1. PerformanceMonitor.Common/RingBufferTruncationNote.cs:119 — the eventsRead > 0 ternary 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 by RingBufferTruncationSignalTests.HealthParserMessage_WithEventsRead_SaysHowManyAndWhyNoneQualified_NotThatNoneWereFound, whose second arm pins the 0 case.
  2. 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 by McpWindowNoticeSystemHealthToolTests.ATruncatedRingBuffer_WithEventsReadButGatedOut_SaysHowManyWereRead_NotThatNoneWereFound, which asserts the literal 1.
  3. Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:899 — the twin, where the number is xmls.Count from a different reader than Lite's count, so the SKUs could agree in wording and disagree in number — covered by DarlingMcpHealthParserToolsWindowNoticeLiveTests.ATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgres, but only when DARLING_TEST_PG is 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 at RingBufferTruncationNote.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 unavailable with sourceObserved: true and 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 the limit as a fact about the snapshot (#3679)." — does not apply — neither number is page-bounded: DarlingSystemHealthReader.SystemHealthEventsByTypeSql carries no LIMIT (DarlingSystemHealthReader.cs:52-63) and Lite's is xmls.Count over the same unlimited read (Lite/Services/LocalDataService.SystemEvents.cs:495) or a type-scoped COUNT(*) (:600). "event(s)" is also the right noun: both count event rows, not shredded records.
  • "A default interface member compiles a parity gap away: DeliverAndReportAsync with 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 = 0 means 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 Anchor constant (McpWindowNoticeSystemHealthToolTests.cs:43) and the Darling case off the single end the 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_PG locally) and confirm ATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgres actually executed rather than skipped — it is the only coverage of the Darling call site, and WindowFloorLiveHarness.cs:76 turns 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.

@erikdarlingdata
erikdarlingdata marked this pull request as draft October 24, 2026 05:21
auto-merge was automatically disabled October 24, 2026 05:21

Pull request was converted to draft

@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 24, 2026 05:21
@erikdarlingdata
erikdarlingdata enabled auto-merge (squash) October 24, 2026 05:21
@claude

claude Bot commented Oct 24, 2026

Copy link
Copy Markdown

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.

McpToolGuideTopics.SystemHealthEmptyWindows (PerformanceMonitor.Common/Mcp/McpToolGuideTopics.HealthParser.cs:24-37) describes exactly four rungs, and the only one it pairs with unavailable is rung 4: "Otherwise it is a dead system_health session or a collector that never ran, or a ring buffer read that cannot tell the two apart; status unavailable with source_observed false." Each tool's own description says the same thing in short form (Lite/Mcp/McpHealthParserTools.cs:434: "status unavailable with source_observed false is no evidence either way").

The #6441 truncation rung does not fit that: it answers unavailable with sourceObserved: true (Lite/Mcp/McpHealthParserTools.cs:687-690, Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:897-900) and now, after this change, with a first clause that is shaped like rung 1's healthy sentence — "N {type} event(s) were read for {server} in the last {h} hour(s), and {gate}" beside rung 1's "N {type} event(s) were captured for {server} in the last {h} hour(s) and {gate}" (:700 / :910). A caller who branches on status is fine, which is what the contract asks for; a caller who went to the guide to learn what unavailable means is told it implies source_observed false, which this rung has never satisfied.

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, unavailable with source_observed true, and the newest events are hidden rather than absent) so the published vocabulary matches all five rungs. Happy for that to be its own issue.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: LGTM

Claims

  • VERIFIED — HealthParserMessage always 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; > 0 selects 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-138 is 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 captured is computed above the branch (McpHealthParserTools.cs:676-677) and noneQualifiedBecause is a required parameter (:674); Darling's RawEventCount is set on the data read (DarlingMcpHealthParserTools.cs:850), noneQualifiedBecause required at :884.
  • VERIFIED — the callers pass the values — McpHealthParserTools.cs:689 and DarlingMcpHealthParserTools.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 raw memory_broker.xml rather than using the seed helpers, so notification = RESOURCE_MEMPHYSICAL_HIGH survives (fixture line 13) and SystemHealthSignificance.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 eventsRead defaults to 0 and selects the "No … events were found" branch (RingBufferTruncationNote.cs:128), while both tests open Assert.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-postgres class whose harness turns a missing DARLING_TEST_PG into a green skip (WindowFloorLiveHarness.cs:76).

Riskiest lines

  1. PerformanceMonitor.Common/RingBufferTruncationNote.cs:119 — the eventsRead > 0 ternary is the whole fix; the wrong side either restores #6650 or prints "0 event(s) were read" over an empty window — covered by HealthParserMessage_WithEventsRead_SaysHowManyAndWhyNoneQualified_NotThatNoneWereFound (second arm pins the 0 case), and the pre-existing ATruncatedRingBuffer_OnTheNewestRun_IsNotCalledQuiet still reads the 0 branch because it seeds outside the window.
  2. 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 by ATruncatedRingBuffer_WithEventsReadButGatedOut_SaysHowManyWereRead_NotThatNoneWereFound, which asserts the literal 1.
  3. Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthParserTools.cs:899 — the twin, where the number is xmls.Count from a different reader than Lite's COUNT(*), so the SKUs could agree in wording and disagree in number — covered by ATruncatedRingBufferRun_WithEventsReadButGatedOut_SaysHowManyWereRead_AgainstDevPostgres, but only with DARLING_TEST_PG 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 here (McpHealthParserTools.cs:689, DarlingMcpHealthParserTools.cs:899), each with its own behaviour test, and the text is built once at RingBufferTruncationNote.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 unavailable with 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 limit as a fact about the snapshot (#3679)." — does not apply — neither number is page-bounded: DarlingSystemHealthReader.ReadEventXmlAsync has no LIMIT (DarlingSystemHealthReader.cs:66-84), Lite's is a type-scoped COUNT(*) 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 = 0 lets a future third reader silently get the #6650 wording back; required parameters plus 0, null in 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:163 reads the formatter's output; McpWindowNoticeSystemHealthToolTests.cs:666 and DarlingMcpHealthParserToolsWindowNoticeTests.cs:316 seed 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 single end the 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 confirm ATruncatedRingBufferRun_WithEventsReadButGatedOut_… executed rather than skipped — it is the only coverage of the Darling call site, and WindowFloorLiveHarness.cs:76 turns 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_errors with a database chosen, so the composed sentence gets eyeballed once for sense.
  • CHANGELOG.md and docs/changelog/ are untouched in the diff — the entry in the PR body still needs applying wherever the release process takes it from.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@erikdarlingdata
erikdarlingdata merged commit b9411a0 into dev Oct 24, 2026
24 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/6650-health-parser-wording branch October 24, 2026 08:44
@github-actions github-actions Bot mentioned this pull request Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant