Repository navigation
Darling alert text: the word agrees with the source count (#6700) - #6702
Conversation
|
Blind read first, then the body. The three renderer changes do what the title says, the two new cases are behaviour tests (they call 1. The nearest unfixed sibling is in the same file, and it is not pinned. 2. The stored-row repair is asymmetric, in the direction the body states but readers may not expect. For the audit sentence, a pre-fix row still reads correctly on the web: 3. Reuse, for the record. |
There was a problem hiding this comment.
Verdict: LGTM
Claims
- VERIFIED —
CollectionHistoryAudit.Render: "in 1 source," / "in N sources," —CollectionHistoryAudit.cs:426;CollectionHistoryAuditTests.TheSourceCount_AgreesWithTheWord_ForOneSourceAndForMoreasserts both arms. - VERIFIED —
RenderExternalAlerts: "+ 1 more source." / "+ N more sources." —DarlingSelfAlertEvaluator.cs:5362-5364; the 21-source arm lands on "+ 1 more source.", the 25-source arm on "+ 5 more sources.". - VERIFIED — the short message now reads "1 external alert was not delivered ..." / "N external alerts were not delivered ..." —
DarlingSelfAlertEvaluator.cs:5346. - VERIFIED — "No test pinned the old wording" of that short message — no
external alert(s)survives anywhere in the tree, and the diff only ADDS the assertion atExternalAlertDeliverySelfAlertTests.cs:58; no pin was edited away. - VERIFIED — the test edits the body lists —
ExternalAlertDeliverySelfAlertTests.cs:122,:58,:126-141, andCollectionHistoryAuditTests.cs:402-415. - VERIFIED —
wwwroot/js/util.js(localizeAlertDetail) is untouched — absent fromgh pr diff --name-only; pre-fix rows are still repaired byplain-text.js:357's generic(\d[\d,]*) (...)\(s\)rule, which is a no-op on the new wording, so the path is idempotent either way. - VERIFIED — "Alert rows stored before this fix still hold 'source(s)'" — nothing in the diff touches stored text; the repair is presentation-side only.
- VERIFIED —
git grep "[a-z](s)"over the Darling service and Lite "finds well over 200 sites" — a grep over those two trees returns 643 matches. - VERIFIED — other alert texts are pinned character for character by
AlertEngineTests—Darling/Darling.Tests/AlertEngineTests.cs:1385,:1403,:2759. - VERIFIED — "No shared pluralizer is used:
FactAdvice.Plurallives inPerformanceMonitor.Analysis" —FactAdvice.cs:1015, and it isinternal(test projects only), so the service could not call it; its{n} nounshape also cannot produce "alert was" / "alerts were". - VERIFIED — Seat correction: the web audit test now hands the page a pre-fix row —
WebPartialWindowBehaviourTests.cs:199rewritesRender's output back to "in 1 source(s)" and:205asserts the page shows the agreed form, so the test still exerciseslocalizeAlertDetailrather than its own input. - UNVERIFIED — "Darling.Tests builds, 0 errors (15 warnings ...)" — needs a build.
- UNVERIFIED — "Total 871, Failed 0, Skipped 10" across the named filters — needs a test run. By reading, the new assertions match the new strings, the tuple/
paramsshapes mirror neighbouring cases that already compile, andFireAsyncpassesshortMessagethrough untouched (DarlingSelfAlertEvaluator.cs:8980), so the newAssert.StartsWithhas no prefix to trip on. - UNVERIFIED — "the new cases fail on the old code by construction (not reverted and rerun)" — the direction was reasoned, not executed; confirming it needs the revert-and-run.
Riskiest lines
Darling/PerformanceMonitor.Darling.Service/DarlingSelfAlertEvaluator.cs:5346— the only line here that changes a subject AND its verb, so an off-by-one onTotal == 1reads as a grammar error in e-mail, Slack and the Viewer — covered byUndelivered_TheWordsAgreeWithTheCounts_ForOneAlertAndForOneUnlistedSource(singular) andUndelivered_FiresOnceWithTheCountsPerSource_AndNeverRepeatsASubmittedText(plural, 7).Darling/PerformanceMonitor.Darling.Service/DarlingSelfAlertEvaluator.cs:5364— the tested count is derived (perSource.Count - MaxListedExternalSources), the one number in this diff not already printed elsewhere in its sentence — covered byUndelivered_TheWordsAgreeWithTheCounts_ForOneAlertAndForOneUnlistedSourceandUndelivered_ListsAtMostTwentySources_AndTheCountReflectsAll.Darling/PerformanceMonitor.Darling.Service/CollectionHistoryAudit.cs:426— this sentence is what the web rewrite keys on, so wording here is also a contract withlocalizeAlertDetailfor pre-fix rows — covered byCollectionHistoryAuditTests.TheSourceCount_AgreesWithTheWord_ForOneSourceAndForMoreandWebPartialWindowBehaviourTests.TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndKeepsEveryOtherClauseAsWritten(whose.Replacewould no-op and fail the nextAssert.Containsif the wording moved).
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 texts are Darling-only:
CollectionHistoryAudit.csexists only underDarling/PerformanceMonitor.Darling.Service/, and external-alert ingestion only inDarling/PerformanceMonitor.Darling.Storage/ExternalAlertStore.cs; Lite has no submitter, noexternalalertskey and no retained-history audit. - "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 — both new cases drive real paths:
CollectionHistoryAuditTests.cs:409-414callsRender,ExternalAlertDeliverySelfAlertTests.cs:130-140callsApplyExternalAlertsAsyncand reads the deliverer's outcome. - "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 ternaries are inline word choices in two unrelated sentences, not a second copy of
FactAdvice.Plural(FactAdvice.cs:1015), and no test pins them equal to it. - "An alert evaluated every ~30 s against an observation that changes once per COLLECTION re-fires on every cooldown expiry against the same rows" — does not apply — the gate is untouched:
DarlingSelfAlertEvaluator.cs:5315still routes throughDecideStateAlert/_lastExternalAlertsAlert; only the strings at:5346and:5364changed. - "A history row wearing the colour its alert's NAME implies rather than the tier it fired at (#3635; the PostgreSQL half in #3680)" — does not apply —
DarlingSelfAlertEvaluator.cs:5331still firesAlertSeverityLevel.Warningwith the same metric names andcurrentValue, so no classifier or triage mapping moves. - "A test that reads the clock twice measures the CI scheduler ... One anchor owns both ends of an interval." — does not apply — neither new case reads a clock: the audit case uses the fixed
AuditDay(CollectionHistoryAuditTests.cs:36), the external-alert case asserts only text.
Divergence (blind read vs PR body)
One stale paragraph, retracted by the body itself. "#6670 / WebPartialWindowBehaviourTests" says the test "has no case built from Render (it uses a fixed body in web-partial-window-harness.mjs), so I did not touch it" — the tree contradicts both halves: the file is in the diff, Run(string? auditBody = null) (:28) forwards a body to the harness, and :189 builds that body from CollectionHistoryAudit.Render. Not graded REFUTED: it describes the pre-merge dev base and the body's own "Seat corrections" supersedes it with an account that matches the tree. Two things the diff does that the body does not quite say, both in the posted comment and neither blocking: the fix also repairs the external-alerts short message on the web, where detail_text gets no plainText pass (read-fields.js:589 carries only localizeAlertDetail, which rewrites the Retained history for ... sentence alone), so that text had no presentation-side repair at all before; and the nearest unfixed sibling, DarlingSelfAlertEvaluator.cs:1825's "Extended Events session(s) are missing", is pinned by no test, so the "pinned character for character" rationale is scope rather than test churn for that one.
Reviewer checklist
- Run the full suite and
pre-push.sh— the body marks both unrun ("laptop; CI decides"); the build/warning and 871-test counts are the claims a read-only tree cannot confirm. - Confirm Node is present on the CI leg running
Darling.Tests—RuncallsAssert.Skipwhennodeis missing (WebPartialWindowBehaviourTests.cs:43), and that test is the only thing holdingRender's new wording andlocalizeAlertDetail's old-row rewrite together; a silent skip leaves:199's coupling unverified. - Eyeball one real delivery of each alert at count 1 and count > 1 — the renderers are covered, but the channels wrap
ShortMessageandDetailTextthemselves.
Claude posting for Erik Darling.
Fixes #6700.
Why
Two Darling alert texts printed a count with "source(s)", so one source read "1 source(s)". The text reaches e-mail, Slack, the other delivery routes and the Viewer's alert history.
What changes
CollectionHistoryAudit.Render: "in 1 source," / "in N sources,".DarlingSelfAlertEvaluator.RenderExternalAlerts: "+ 1 more source." / "+ N more sources."ExternalAlertDeliverySelfAlertTests(the line-121 case now expects "+ 5 more sources."; the short message is asserted for 7; a new case covers 1 alert and 1 unlisted source),CollectionHistoryAuditTests(new case for 1 and for 2 sources).wwwroot/js/util.js(localizeAlertDetail) is untouched: alert rows stored before this fix still hold "source(s)".Other "(s)" text
Left, on purpose.
git grep "[a-z](s)"over the Darling service and Lite finds well over 200 sites. Nearly all are log lines, CLI output, tool descriptions and other alert texts ("N blocking session(s)", "N deadlock(s)", "N query(s)" and so on) thatAlertEngineTestsand other classes pin character for character. The issue names two texts; changing the rest is a separate sweep with its own test churn. No shared pluralizer is used:FactAdvice.Plurallives inPerformanceMonitor.Analysisand builds "{n} noun" strings for advice text, not these sentences.#6670 / WebPartialWindowBehaviourTests
#6670 (
fix/6649-web-mcp-names) is still open, so this branched from dev as is. On dev,WebPartialWindowBehaviourTestshas no case built fromRender(it uses a fixed body inweb-partial-window-harness.mjs), so I did not touch it.Test plan
*CollectionHistoryAudit*,*ExternalAlertDeliverySelfAlert*,*WebPartialWindow*,*DarlingSelfAlert*,*Census*,*Ratchet*: Total 871, Failed 0, Skipped 10 (live classes without a store).pre-push.shnot run (laptop); CI decides.cpucap.shandtestslot.shvia PowerShell with Git Bash's full path (the Bash tool refused the wrappers).CHANGELOG
SECTION: Fixed
ENTRY:
REF:
[Darling alert text: the word agrees with the source count (#6700) #6702]: Darling alert text: the word agrees with the source count (#6700) #6702
Seat corrections
WebPartialWindowBehaviourTests.TheCollectionHistoryAuditAlert_AgreesItsSourceCount_AndKeepsEveryOtherClauseAsWrittennow gives the web page an alert row stored before this fix ("in 1 source(s)"), which is the text the web rewrite exists for.