Repository navigation
get_daily_summary_range/get_daily_summary move reading guidance off tools/list (#3898) - #4099
Merged
Merged
Conversation
…ools/list (#3898) get_daily_summary and get_daily_summary_range now serve a short head from tools/list, with the full original description available on demand from get_tool_guide. Both tools convert on Darling and Lite (D6 lockstep); the heads are byte-identical, and each product's tail keeps its own original prose verbatim. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QQh8LczP1HGLXQYAx4oTZC
…3898) A day before retention_horizon answers unavailable/purged only when no signal table still holds it; otherwise the tool returns a past_horizon row (band NoData, non-zero counts real). The head now says so, and says a no_run_record band stands with only its collection-error share lacking a denominator (D9 Q3/Q4). Pins re-pointed and added on both products; budget 571 -> 617 on both. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QQh8LczP1HGLXQYAx4oTZC
erikdarlingdata
marked this pull request as ready for review
September 24, 2026 01:26
erikdarlingdata
enabled auto-merge (squash)
September 24, 2026 01:26
erikdarlingdata
added a commit
that referenced
this pull request
Sep 24, 2026
* Add 48 buffered CHANGELOG entries in one splice Adds 48 entries and 48 link refs (#4057, #4077, #4079, #4081, #4082, #4083, #4084, #4085, #4086, #4087, #4088, #4089, #4090, #4091, #4092, #4093, #4095, #4096, #4099, #4100, #4101, #4103, #4105, #4106, #4107, #4108, #4109, #4110, #4111, #4113, #4114, #4115, #4116, #4117, #4118, #4119, #4120, #4121, #4122, #4123, #4124, #4125, #4126, #4127, #4131, #4133, #4136, #4141). Each PR's entry was buffered, and this lands every entry whose PR was merged on origin/dev when it ran. Entries found under a bare section line (none unless the old script ran again) move into the matching ### section, below the new entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QQh8LczP1HGLXQYAx4oTZC * Changelog splice: add #4137's entry, which merged before the splice but was missed #4137 (pg_plan_capture reads csvlog) merged at 05:57Z with a CHANGELOG entry section in its body. It was neither spliced nor listed as needing no entry. Its entry goes under Fixed, right after #4136's, and #4136's last sentence now points to it instead of saying plan capture is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NUU29PuGg9TUFBsACgZg2K --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3898.
Why
Darling's
tools/list(about 330 KB) and Lite's (about 148 KB) load every tool description in full before anagent asks its first question.
get_daily_summaryandget_daily_summary_rangecarried two of the longerdescriptions in the health-overview family. This PR moves each tool's reading guidance behind
get_tool_guide,so
tools/listserves a short head and the full guide is a second call away. Nothing is deleted.What changes
Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpHealthTools.csandLite/Mcp/McpHealthTools.cs:both tools now carry the
<<GUIDE>>marker. The head is new, terse text. The tail is each product's ownoriginal description, unchanged, word for word.
Darling/Darling.Tests/McpToolGuideHeads.SqlCore.csandLite.Tests/McpToolGuideHeads.SqlCore.cs: a newMcpToolGuideHeadsSqlCoreDailySummaryTestsclass in each file, appended after the existingMcpToolGuideHeadsSqlCoreTestsclass. It pins the two heads' guardrail facts and pins the one productdifference in the tails.
Darling/Darling.Tests/McpToolsListBudget/DarlingMcpHealthTools.txtandLite.Tests/McpToolsListBudget/McpHealthTools.txt: the two tools' served-length lines, lowered to match. Noparameter needed trimming. None is over the 200-character cap, so no parameter text moved to a tail.
Per-tool served characters (budget test numbers)
Both heads are byte-identical between Darling and Lite for the same tool. The generic cross-SKU pin in
McpToolGuideTestsalso enforces this.Status routes (every status word the heads state, cited to the code)
get_daily_summary:unavailable,data_state: purged:row.DataState == DailySummaryDataState.Purged, beforeretention_horizon.Darling:
DarlingMcpHealthTools.cs:112. Lite:McpHealthTools.cs:95.empty:!row.HasData. No row exists for the day at all in the nine-source spine: not purged, notno_run_record.DarlingHealthReader.cs:521-537builds a syntheticHasData: falserow only when the rangequery for that single day returned zero rows and the day is not before the horizon. Darling:
DarlingMcpHealthTools.cs:126. Lite:McpHealthTools.cs:109.data_stateiscollected,no_run_recordor, before the horizon while a signal table still holds the day,past_horizon, from the sharedDailySummaryRetention.StateFor(
PerformanceMonitor.Common/DailySummaryDataState.cs:97-103), identical on both products. Ano_run_recordday's zeros are real measurements and the band stands (
DailySummaryDataState.cs:43-49). Its error share hasno denominator, because no run was recorded.
get_daily_summary_range:unavailable:rows.Count == 0andHasAnyCollectionLogAsyncis false. Nothing was ever collectedfor the server. Darling:
DarlingMcpHealthTools.cs:223,243-246. Lite:McpHealthTools.cs:205,224-227.empty:rows.Count == 0and some collection log entry exists, but none inside the requested span.Darling:
DarlingMcpHealthTools.cs:223,239-242. Lite:McpHealthTools.cs:205,220-223.data_state(not a top-level status):collected,no_run_record,past_horizonorpurged, fromthe same shared
DailySummaryRetention.StateFor. A purged row's zeros are absences(
DailySummaryDataState.cs:148-151). Apast_horizonrow's non-zero counts are real, but a zero may beeither a measurement or an absence, because some signal sources still hold the day and some do not
(
DailySummaryDataState.cs:152-155).My first head draft said "zeros are absences" for both states. I checked it against
DailySummaryRetention.Notebefore committing and narrowed the
past_horizonclause to match the code. The original shipped descriptionnever made this over-broad claim, so this is not a D9 correction to prose that shipped; it is a note on how the
new head text was checked.
Corrections
None. Both products' original prose matches the tool bodies.
D4 removals
None. Neither description carried an issue reference or an anecdote.
Re-pointed pins
None needed.
DarlingMcpHealthToolsTests.DailySummaryDescriptions_NameTheHorizon_ThePurgedState_AndTheExactDateFormatreadsthe raw
DescriptionAttribute.Description: head, marker and tail together. Every substring it checks(
retention_horizon,days_before_horizon,data_state=purged,NEVER Healthy,unique_queries=null,unique_queries is null,days_missing) is still present verbatim inside the tail, so the test passesunchanged. No other test file that mentions either tool touches the
Descriptionattribute.D9 traps
Correct: No. Empty means no row exists for that day at all. A day before retention_horizon answers "unavailable" with data_state purged instead.
Prevents it: "status empty: no row for that day."
Correct: There is no way to tell. Before retention_horizon, zeros are absences, not measurements, so no verdict is possible.
Prevents it: "data_state purged, zeros are absences not measurements, no verdict."
Correct: Yes. Inside retention every zero is a real measurement, so the band stands on the counts as read.
Prevents it: "Inside retention: data_state collected or no_run_record; band stands on real zeros."
Correct: Not provably. A no_run_record day's error share has no denominator, so a zero there is not the same guarantee as on a collected day.
Prevents it: "no_run_record's error share has no denominator."
Correct: No. The range's top-level unavailable means the server has never had any collection recorded. A purged day still appears as an ordinary row inside days.
Prevents it: "status unavailable: nothing was ever collected."
Correct: No. Empty means no collected day fell inside this span. The server can have history outside it.
Prevents it: "status empty: no collected day in range but the server has history elsewhere."
Correct: No. Any day with any collection at all appears, even a quiet one, so a missing day is a collection gap, not a quiet day.
Prevents it: "A day with ANY collection appears here even if quiet (Healthy), so a gap is a COLLECTION gap."
Correct: It cannot be read from the field alone. Past_horizon rows are real where non-zero, but a zero there may be either a measurement or an absence.
Prevents it: "past_horizon rows are real but a zero may be either."
Correct: No. A purged row's zeros are absences, because the per-signal tables were purged for that day.
Prevents it: "data_state purged rows' zeros are absences."
Correct: Only for days the store holds. A collection gap means fewer rows than days_back.
Prevents it: "so a gap is a COLLECTION gap."
Correct: Now, the present moment. Not an error, and not a fixed epoch.
Prevents it: "ending at as_of (default now)."
Correct: No. Each row carries the same per-day fields: health band, wait time, queries, deadlocks, blocking, CPU, memory, errors and alerts.
Prevents it: "same per-day fields as get_daily_summary."
Correct: No, it is seconds.
Prevents it: "wait time (sec)."
Test plan
dotnet build Darling/Darling.Tests/Darling.Tests.csproj -c Debug: Build succeeded, 0 Warning(s), 0 Error(s).dotnet build Lite.Tests/Lite.Tests.csproj -c Debug: Build succeeded, 0 Warning(s), 0 Error(s).McpToolGuide*,McpToolsListBudget*,DarlingMcpHealthToolsTests,DailyHealthBandTests,DailySummaryNotCarriedTests,DailySummaryReadShapeTests,DarlingDailySummaryRangeTests,ServerPageTabsTests, and the newMcpToolGuideHeadsSqlCoreDailySummaryTests. Total 294, 0 failed, 5 skipped (live PostgreSQL, no rig here).McpToolGuide*,McpToolsListBudget*,McpMissMessageParityPinTests,DailyHealthBandTests,DailySummaryRangeToolTests. Total 195, 0 failed, 0 skipped.McpToolGuideHeadsSqlCoreDailySummaryTestsfailed asexpected. Restored from git and rebuilt green.
missing=0in all four rows.long-sentence, semicolon, contraction and Latin-abbreviation hits are fixed in this version.
Coordinator verification
missing=0in all four rows. paramcheck: no parameter changed.get_daily_summaryhead saidthat a day before
retention_horizonalways answersunavailablewithdata_statepurged. That is true onlywhen no signal table still holds the day.
DailySummaryRetention.StateFor(DailySummaryDataState.cs:97-103)returns
past_horizonwhen one does. Both tools then return the row with band NoData, because theunavailablebranch checks onlyPurged(DarlingMcpHealthTools.cs:112,McpHealthTools.cs:95). The headnow names
past_horizon, and the Status routes table above names it too.past_horizon): 1 misread, on Q4. My own interim editcaused it, because it took the no_run_record error-share clause out of the head. The clause is back.
cannot be trusted. The head now says that the band stands for no_run_record too, and that only its
collection-error share has no denominator. I did not run a third round.
"collection errors and alert count", and "composite", "type" and "events" are gone. The tail keeps the full
original text.
past_horizonand no_run_record clauses on bothproducts. Budget:
get_daily_summarygoes from 571 to 617 on both.McpToolsListBudgetTests. I edited the budget file while the Lite suite ran, so the test compared the olderbinary with the newer budget line. On the final build the targeted classes pass, that test included: Darling
307 (0 failed, 7 skipped) and Lite 208 (0 failed).
Handoff