Repository navigation
get_pg_logging_audit/get_pg_io_stats/get_pg_wait_sampling move reading guidance off tools/list (#3898) - #4081
Merged
Conversation
…g guidance off tools/list (#3898) Refs #3898. Splits each description at the <<GUIDE>> marker: tools/list now serves a short head (546-610 served chars, down from 2,032-2,086) plus the get_tool_guide pointer, and get_tool_guide serves the full original prose as the tail. No sentence dropped; D4 removed one issue-ref parenthetical from get_pg_logging_audit's wire text (kept in this commit message instead). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014nCo36doEcUWapnXbJvY7L
erikdarlingdata
marked this pull request as ready for review
September 23, 2026 21:56
erikdarlingdata
enabled auto-merge (squash)
September 23, 2026 21:56
This was referenced Sep 23, 2026
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
A client that loads Darling's whole MCP catalog pays for every tool description before it asks a
question.
get_pg_logging_audit,get_pg_io_statsandget_pg_wait_samplingserved 2,032 to 2,086characters each. This PR moves the reading guidance in those three descriptions off
tools/list. It goesinto
get_tool_guide, which serves it on request. Nothing was deleted.What changes
Each tool's
Descriptionliteral now carries the<<GUIDE>>marker.tools/listserves the text beforethe marker (the head) plus the standard pointer sentence.
get_tool_guideserves the text after themarker (the tail). The tail is the tool's full original prose, verbatim, minus one issue reference removed
under D4. See below for that removal.
Before and after (Darling only)
None of the three tools has a Lite twin.
get_pg_logging_auditget_pg_io_statsget_pg_wait_sampling(Tail lengths are the raw text
get_tool_guideserves, before its own JSON wrapping.)D2 parameter cap
get_pg_io_stats'slimitparameter description was 235 characters. That is over the 200-character capfor a converted tool's parameters. I tightened the wording from
This is what bounds the page, read truncated to know whether the window held moretoBounds the page, read truncated for more. The newtext is 194 characters. No fact was dropped. Nothing needed to move to the tail.
Corrections
None. I checked each description's claims against the tool body and found nothing wrong.
D4 removals
get_pg_logging_audit's original text read...says PLANNED where that consumer does not ship yet (#3601/#3602/#3603).... The parenthetical issue list came off the wire. The sentence still says PLANNEDwithout naming the issues. The CHANGELOG keeps those issue numbers.
No other issue references, anecdotes, or WIRE CHANGE notices were present in these three descriptions.
Re-pointed pins
DarlingMcpPgLoggingAuditToolsTests.TheToolDescription_StatesWhatItJudges_AndThatItReadsStoredConfigused to read the raw, unsplit
Descriptionattribute. I split its assertions by kind. Five guardrailfacts now assert against the served head. They are the stored snapshot, never the live server, LATEST IS A TIME,
captured_at, and what
partialmeans. Four narrative facts assert against the tail instead. They are the fullseven-setting roster, the RDS/Aurora remedy syntax, the
get_pg_plan_capture_readinesshand-off, andPLANNED. Reading the raw attribute passed by accident. The head and tail are one string at the attribute
level. Splitting it confirms which facts actually reach
tools/list.PgWaitInstrumentDisclosureTests.BothToolDescriptions_NameTheThreeTierscovers bothget_pg_wait_sampling(mine) andget_pg_wait_stats(a different, still-unconverted lane's tool). Ire-pointed only the
get_pg_wait_samplinghalf.extension_sampled,service_sampledandFLOORnowassert against the head. The "Aurora native > ... > service sampler" ordering asserts against the tail.
I left the
get_pg_wait_statshalf reading the raw literal, since that tool is out of this PR's scope.Left unmodified, verified still green by construction:
McpPageContractTests.EveryPercentTool_NamesItsDenominator_AndItsPageBound_InItsDescriptionreads theraw
Descriptionattribute across all fivePercentToolsentries. Three of them (get_pg_top_queries,get_pg_wait_stats,get_pg_kernel_stats) belong to a different, in-flight lane.SHARES ARE OF THE WINDOW, NOT OF THE PAGEand every required key name are present in my two tools' heads or tails. Thistest passes without changes. I left its mechanism alone. Editing it risks changing behavior for tools
outside this PR.
McpLatestSnapshotStampTestsalready listsget_pg_logging_auditunderDarlingOnlyStampedand readsthe raw attribute.
LATEST IS A TIMEandcaptured_atare both in the head, so no change was needed.CrossAppMcpToolInventoryPinTests,ServerPageTabsTests, and others):my three tools were already listed by name. Nothing was renamed, added, or removed (D8), so these needed
no edits.
D9 traps
get_pg_logging_auditshowslog_lock_waitsasunknown. Is lock-wait logging off?Correct:
unknownmeans the setting is missing from the stored snapshot. Nothing is inferred aboutits real state. This is not the same as
off.Prevents it: the head's
unknown means the setting is missing from the snapshot, not the same as off, and nothing is inferred.get_pg_logging_auditrateslog_min_duration_statementaspartial. Should it be raised toinstrumented?Correct: no. For this one setting, the threshold is the recommended posture. Setting it to 0 logs
every statement the server runs.
Prevents it: the head's
partial means a THRESHOLD is filtering; for log_min_duration_statement that threshold IS the recommended posture, not a shortfall.get_pg_logging_auditwas read five minutes after a config change. Does it reflect the change?Correct: not necessarily. It reads the stored hourly snapshot, never the live server.
Prevents it: the head's
STORED configuration snapshot pg_server_config already collects hourly, never the live serverandLATEST IS A TIME: captured_at is when that snapshot was taken.get_pg_io_statsshowsread_time_ms: nullon every row. Is the disk instant?Correct: no.
track_io_timingis off by default in PostgreSQL, so time fields are null whenuntracked. A false
0.000reads as an impossibly fast disk.Prevents it: the head's
track_io_timing is OFF by default... never a false 0.000.get_pg_io_statsshowswrites: nullfor a combination. Were there no writes?Correct: unmeasured, not zero. Write counters are always null on Amazon Aurora.
Prevents it: the head's
Write counters are always null on Aurora, never a true zero.get_pg_io_statsrows showpct_of_total_readsadding up to 40%. Did the rest of theactivity happen outside this window?
Correct: no. The percentages divide by the whole window's
total_reads. That total is computed onthe same statement as the rows, so a truncated page never sums to 100%. The other 60% is combinations
past the cap, in the same window.
Prevents it: the head's
SHARES ARE OF THE WINDOW, NOT OF THE PAGE: pct_of_total_reads/ pct_of_total_read_time divide by total_reads/total_read_time_ms.get_pg_wait_samplinganswers withinstrument: service_sampled. Is that as reliable as theextension?
Correct: no.
service_sampledis a floor, not parity. It undercounts sub-second waits.Prevents it: the head's
instrument says extension_sampled (10ms profile) or service_sampled (a FLOOR that undercounts sub-second waits).get_pg_wait_samplingshowsestimated_wait_ms: 5000for one event. Is that a measuredduration?
Correct: no. It is the sample count multiplied by the instrument's period. That is an estimate, not
a measured duration.
Prevents it: the head's
Results are SAMPLE COUNTS, not measured durations: estimated_wait_ms = samples x period.get_pg_wait_sampling's busiest row hasevent_type: CPU. Does that mean the busiest wait isCPU-related?
Correct: no. A CPU row means the backend was running, not waiting at all.
Prevents it: the head's
event_type CPU means running, not waiting.get_pg_wait_samplingpage'spct_of_samplesvalues add up to 55%. Is the other 45%unaccounted for?
Correct: no. Those are samples from series that did not make this page's cap. The denominator is
the window's
total_samples, not the page's own sum.Prevents it: the head's
SHARES ARE OF THE WINDOW, NOT OF THE PAGE: pct_of_samples divides by total_samples, not the page sum.get_pg_logging_auditagainst a SQL Server target. Will it audit that server'serror log settings?
Correct: no. The tool is PostgreSQL-only.
Prevents it: the head's trailing
PostgreSQL-only.get_pg_io_statsis called withlimit=3on a server with 50 active combinations. Do thosethree rows represent the whole window's I/O?
Correct: no.
combinations_returned/truncatedsay whether more exist. The window totals coverevery combination, not only the page.
Prevents it: the head's
THE PAGE IS BOUNDED BY limit: combinations_returned/truncated.Test plan
dotnet build Darling/Darling.Tests/Darling.Tests.csproj -c Debug: build succeeded, 0 warnings, 0 errors.McpToolsListBudgetTests,McpToolGuideHeadsPgB*,DarlingMcpPgLoggingAuditToolsTests,PgWaitInstrumentDisclosureTests,McpPageContractTests,DarlingMcpPgIoToolsTests,McpToolGuideTests):Total 116, Errors 0, Failed 0.
dropcheck.py origin/dev HEAD get_pg_logging_audit get_pg_io_stats get_pg_wait_sampling): all three showmissing=0.Darling.Testssuite, run by the coordinator after the lane: Total 13254, Errors 0, Failed 0,Skipped 631 (the live-PostgreSQL classes).
python C:/Users/edarl/.claude/skills/plain-english/check.pyagainst thisbody and fixed every real hit. The remaining hits are the allowed D9 labels.
DARLING_TEST_PGset, which is expected per the common brief.Coordinator verification
origin/devwas already merged into the branch. The shared checkout was clean.missing=0for all three tools. The one D4 removal is the(#3601/#3602/#3603)list.All 12 answers were correct. Two answers (Q3, Q5) said "not stated" but cited the right head phrase, so
they are not misreads.
Darling.Testssuite: Total 13254, Failed 0, Skipped 631.PerformanceMonitor.Commonfile. CI runs the Lite suite anyway.
DarlingMcpPgLoggingAuditToolsTests.csshows as a whole-file change. Ondev, that file was stored withCRLF line endings, and one line ended in CR CR LF. This PR stores it with LF, as
.gitattributes(
* text=auto eol=crlf) expects. The content change is 29 lines added and 11 removed(
git diff --ignore-cr-at-eol).limitparameter was reworded rather than moved to the tail. Every fact stayed: the page bound,reading
truncated, and shares of the whole window.Handoff
Darling.Testssuite. See Coordinator verification.PR, not deferred. No new issue was filed.