Skip to content

docs: the client SDK examples read the resolved payload - #16144

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14546-client-sdk-payload-reads
Sep 6, 2026
Merged

docs: the client SDK examples read the resolved payload#16144
baozhoutao merged 1 commit into
mainfrom
claude/issue-14546-client-sdk-payload-reads

Conversation

@claude

@claude claude Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #14546

analytics.query / analytics.meta / analytics.explain and automation.trigger stopped 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, and welcome.status (the automation.trigger call was not even assigned before). Voice matches the neighbouring blocks on the same page, which read their results with console.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 showed explain).
  • content/docs/api/data-api.mdx — prose, not code: GET /analytics/meta is an HTTP endpoint section, and the paragraph already states the wire envelope. It now adds that the envelope is the wire shape only and that client.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:

call resolves to declared in
analytics.query AnalyticsResultrows, fields[] (name, type, optional label / format / currency / percentScale) packages/spec/src/contracts/analytics-service.ts
analytics.meta the bare CubeMeta[]name, title?, measures[], dimensions[] same file, via AnalyticsMetadataResponse['data']
analytics.explain { sql, params } AnalyticsSqlResponse['data']
automation.trigger AutomationResultstatus?, runId?, screen?, success, ... packages/spec/src/contracts/automation-service.ts

Changeset

A patch changeset for @objectstack/client rather than the skip-changeset label. packages/client/package.json is public and declares files: ["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

  • The card's own executable criterion, re-run on this branch: every hit of analytics.query / analytics.meta / analytics.explain / automation.trigger that 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 for result.data / meta.data / explained.data / welcome.data / report.data / cubes.data / run.data across all three files returns nothing.
  • The edited examples type-check. These fences are deliberately unmarked for check:skill-examples (the page's own contributor note explains why: they continue Quick Start's implied client, so a marker reds with TS2304), so the seven edited bodies were transcribed into one file with that client declared and compiled under strict against the BUILT @objectstack/client declarations: 0 errors. Control leg: replacing one read with a deliberately wrong annotation reds with TS2322: Type 'Record<string, unknown>[]' is not assignable to type 'string' — so tsc really resolved AnalyticsResult and the green is a measurement, not an any passthrough.
  • Gates: the 73 commands node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives for this change set were run at this head. 71 exit 0, including check: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-links and check:nul-bytes. The remaining two — check:dts-closure and check:dual-build-cjs-loads — both refuse with PREREQUISITE NOT MET (exit 3) without a full pnpm build; they are declared to CI. This diff contains no source file, so no dist it reads can move.
  • Repo-wide pnpm lint is 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), and eslint --no-inline-config --format json over 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 the ai.nlq / ai.suggest / ai.insights methods that v17 removed (#16142). Neither is in this card's class.


Generated by Claude Code

`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
@github-actions github-actions Bot added the size/s label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 1 changed file(s) yielded no anchor (packages/client/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/client/README.md) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 14 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 932acc3df41e016812cfc17ffe1527fd7b5df538packageMentionDocs.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling labels Sep 6, 2026
@baozhoutao
baozhoutao marked this pull request as ready for review September 6, 2026 03:43
@baozhoutao
baozhoutao enabled auto-merge September 6, 2026 03:43
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 92dc937 Sep 6, 2026
36 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-14546-client-sdk-payload-reads branch September 6, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tooling

Projects

None yet

2 participants