docs: the client SDK examples read the resolved payload - #16144
Merged
Conversation
`analytics.query` / `analytics.meta` / `analytics.explain` and
`automation.trigger` resolve to the payload rather than the dispatcher's
`{ success, data }` envelope, but the three places a reader first meets the
SDK showed the calls with nothing reading the resolved value: the page was
neither wrong nor instructive about the shape.
One payload read per example, on all three sites together — the docs site's
Client SDK page, the Data API page's `GET /analytics/meta` prose, and the
`@objectstack/client` README — using the members the contracts declare
(`AnalyticsResult.rows` / `.fields[].name`, the bare `CubeMeta[]`,
`{ sql, params }`, `AutomationResult.status`).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AhooRxUmvwYwcnQ5LATTB7
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 14 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
baozhoutao
marked this pull request as ready for review
September 6, 2026 03:43
baozhoutao
enabled auto-merge
September 6, 2026 03:43
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.
Fixes #14546
analytics.query/analytics.meta/analytics.explainandautomation.triggerstopped handing back the dispatcher's{ success, data }envelope in #13079 (landed by PR #14526): each resolves to the payload itself. The three places a reader first meets the SDK showed those calls with nothing reading the resolved value — so none of them was wrong about the shape, and none of them taught it either. This adds the one read that makes the convention visible, on all three sites together, because the card's value is that a reader meeting the SDK anywhere sees the same convention.What changed
content/docs/api/client-sdk.mdx— one payload read after each of the four calls:result.rows.length, result.fields[0].name,meta[0].name, meta[0].measures.length,explained.sql, explained.params, andwelcome.status(theautomation.triggercall was not even assigned before). Voice matches the neighbouring blocks on the same page, which read their results withconsole.log(x.member)plus a trailing comment.packages/client/README.md— the same treatment for the three calls in its namespace tour (query,meta,trigger; the README never showedexplain).content/docs/api/data-api.mdx— prose, not code:GET /analytics/metais an HTTP endpoint section, and the paragraph already states the wire envelope. It now adds that the envelope is the wire shape only and thatclient.analytics.meta(cube)resolves to the cube array itself, with a pointer to the Client SDK page. The surrounding paragraph supports a clause, not an example.No
.data.read of an SDK result is written anywhere, on any of the three files — the old shape appears in neither code nor prose. The migration table stays where it already lives, in the v17 release notes.The member names are read from the declarations, not from the card
The card guessed
result.rows/run.status; the declarations were re-read on this branch and they agree, with two refinements the card did not state:analytics.queryAnalyticsResult—rows,fields[](name,type, optionallabel/format/currency/percentScale)packages/spec/src/contracts/analytics-service.tsanalytics.metaCubeMeta[]—name,title?,measures[],dimensions[]AnalyticsMetadataResponse['data']analytics.explain{ sql, params }AnalyticsSqlResponse['data']automation.triggerAutomationResult—status?,runId?,screen?,success, ...packages/spec/src/contracts/automation-service.tsChangeset
A
patchchangeset for@objectstack/clientrather than theskip-changesetlabel.packages/client/package.jsonis public and declaresfiles: ["dist", "README.md", "CHANGELOG.md"], so the README edit ships inside the released package — AGENTS.md reserves the label for "a diff that publishes nothing from any released package", which this is not. The docs-site files publish nothing on their own and ride along.Verification
analytics.query/analytics.meta/analytics.explain/automation.triggerthat assigns the awaited value (:312,:322,:326,:436) is followed within a few lines by a read of a payload member (:319,:323,:330,:437), and a grep forresult.data/meta.data/explained.data/welcome.data/report.data/cubes.data/run.dataacross all three files returns nothing.check:skill-examples(the page's own contributor note explains why: they continue Quick Start's impliedclient, so a marker reds with TS2304), so the seven edited bodies were transcribed into one file with thatclientdeclared and compiled understrictagainst the BUILT@objectstack/clientdeclarations: 0 errors. Control leg: replacing one read with a deliberately wrong annotation reds withTS2322: Type 'Record<string, unknown>[]' is not assignable to type 'string'— so tsc really resolvedAnalyticsResultand the green is a measurement, not ananypassthrough.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives for this change set were run at this head. 71 exit 0, includingcheck:empty-changeset --base origin/main,check:adr-0087-registration,check:changeset-no-major,check:docs,check:skill-examples,check:doc-anchors,check:doc-authoring,check:docs-single-h1,check:docs-transcript-drift,check:published-files,check:published-readme-linksandcheck:nul-bytes. The remaining two —check:dts-closureandcheck:dual-build-cjs-loads— both refuse withPREREQUISITE NOT MET(exit 3) without a fullpnpm build; they are declared to CI. This diff contains no source file, so nodistit reads can move.pnpm lintis CI's, and the narrowing is measured: eslint's only broad population is**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}(eslint.config.mjs:971), andeslint --no-inline-config --format jsonover all four changed paths reports 4 results, each a single warning "File ignored because no matching configuration was supplied", 0 errors. No rule here is type-aware over Markdown, so this diff cannot move the verdict on any untouched file.Not addressed here
Two defects found on these same files while working this card are recorded separately and left untouched by this PR: the Data API page's
fields[]callout is stale (#16141), and the client README still documents theai.nlq/ai.suggest/ai.insightsmethods that v17 removed (#16142). Neither is in this card's class.Generated by Claude Code