Skip to content

feat!: one read vocabulary — get/list rooted in the operations registry (3a) - #34

Merged
jherr merged 1 commit into
mainfrom
cursor/read-verbs-get-list-a931
Nov 6, 2026
Merged

jherr merged 1 commit into
mainfrom
cursor/read-verbs-get-list-a931

Conversation

@jherr

@jherr jherr commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Implements cms-refactor-plan.md § Phase 3 (3a): item 5 ("One read vocabulary (get/list) rooted in the operations registry"), plus questions 17 and 18.

Merge chain: step 16 of 24. Base: main. Merge it right after #30. The branch is main 3b4a112, then one commit for each PR before this one in the merge order, then this PR's own commit 550fc8f (tree f1763d9).

What

  • One read vocabulary, defined once. @tanstack/cms-core exports readVerbs, the registry of canonical reads. Each verb has a name, a noun, a description and one zod input bag (getInput, listInput). Every surface derives from it:
    • Server: cmsAs(cms, ctx).get(options) and .list(options?), plus getAs(ctx, options) and listAs(ctx, options?) from @tanstack/cms-core/server. The store validates the bag itself.
    • HTTP and Start: public get and list operations in @tanstack/cms-api, with matching Start server functions.
    • Client: client.get(options) and client.list(options?), typed from Register.
    • MCP, WebMCP and cmsTools: get_document (new) and list_documents. Names come from agentToolName(verb), which is <verb>_<noun> (Q18).
  • The bags.
    • get: { collection, id | locator, locale?, populate? }. Exactly one of id or locator must be given, which both the type and a runtime check enforce. It resolves to { id, collection, doc, relations? }, or to null when the document is missing or unreadable.
    • list: { collection?, locale?, where?, sort?, limit?, offset?, cursor?, populate? }. It resolves to { items, total, nextCursor? }. limit defaults to 100, with a maximum of 500. Without a collection, it lists every collection the reader may read.
    • Modes: a live context reads published documents. preview and edit read the working copy, and in those modes get overlays staged changes.
    • populate stays off here. 3b turns it on.
  • search_documents stays its own verb (Q17).
  • read_document is deprecated in favour of get_document. It keeps its input and its bare-document output.
  • The old verbs become wrappers that keep their old defaults: queryDocuments, readDocument, getPublicDocument and listPublishedDocuments, plus their …As forms.
  • Slug reads honour locale.
  • Docs: the core-server, client, core, routes, operations-registry, MCP server, tutorial and agent pages are updated. Upgrading gains a new step, step 26 on the merge chain.
  • Changeset: .changeset/read-verbs-get-list.md, minor for core, api and client.

Breaking changes

  • list_documents takes the list bag and returns { items: [{ id, collection, doc }], total, nextCursor? } instead of an array of summaries. limit defaults to 100. Staged creates are no longer listed; get_document reads them.
  • get and list are reserved operation names.
  • The content-agent prompt now calls get_document before update_document, instead of read_document.

How verified

  • New tests:
    • core tests/read-verbs.test.ts (14), covering modes, locale, hidden collections, the exclusive bag (runtime and type), the limits, the old verbs and the agent tools;
    • api tests/read-verbs.test.ts (5);
    • a client test.
  • Local CI (GitHub Actions is out of billing): on a scratch branch, I merged head 71f3aad into origin/main at 3b4a112. The only conflict was scripts/codemods/index.ts, where I kept both codemods.
Check Result
pnpm install --frozen-lockfile passes
pnpm test:ci (174 tasks) Only the known @tanstack/cms-api:test:oxlint failure on a type cast. Core 590 passed (30 skipped), api 207.
pnpm test:dts clean (224)
pnpm test:dialects exits 0
pnpm test:scripts 66 pass
E2E blog / base 28 / 12 pass

Assumptions (conservative defaults where the plan gives none)

  • Naming:
    • get and list are the names on every surface.
    • The store's forms that take a context argument are getAs and listAs, following 2b's …As convention.
  • list without a collection lists every readable collection, as queryDocuments already did.
  • limit: defaults to 100 with a maximum of 500, the old MCP defaults.
  • locale: filters documents by locale, and locators match per locale.
  • locator: means slug or id until 3c defines locators.
  • Staged changes: get overlays them in preview and edit modes. list reads stored rows only.
  • HTTP get/list read the way the public site does.
  • No codemod, because the result shapes and defaults differ. 3d migrates call sites.

Divergence from plan

  1. read_document is kept as a deprecated alias, rather than removed.
  2. Unchanged, out of scope:
    • the admin editor reads;
    • getPublicDocument, which keeps its cross-collection preferred lookup.
  3. No populate default flip until 3b.

Merge chain (local verification, CI down)

This PR's commits are squashed into one commit on the linear merge chain. That commit holds this PR's own changes, resolved against every PR before it, with the integration rehearsal's fixes for this PR applied. No conflicts. Its upgrading section is renumbered to step 26.

The chain tip's tree is exactly the integration rehearsal plus #46 (c4e6d7c), and the tip passes the full local suite. I simulated merging every PR in order, with a merge commit or a fast-forward at each step, and every step is clean. A plain squash of the next PR would conflict, because the squash commit isn't an ancestor of the next branch. To squash instead, first rebase the branch's one commit onto the new main; that rebase is always clean.

Open in Web Open in Cursor 

@changeset-bot

changeset-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c3c203f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@tanstack/cms-core Minor
@tanstack/cms-api Minor
@tanstack/cms-client Minor
@tanstack/cms-cli Minor
@tanstack/cms-connect-atproto Patch
@tanstack/cms-migrate-wp Patch
@tanstack/cms-skills Patch
@tanstack/cms-media-s3 Minor
@tanstack/search-cms Patch
@tanstack/cms-store-libsql Minor
@tanstack/cms-store-postgres Patch
@tanstack/cms-ui-dom Patch
@tanstack/cms-ui-react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: TanStack/cms
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 7013166
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Free
  • Run ID: f7bc456a-0ba3-40a1-aae8-d7504401ef7f
Commits

Reviewing files that changed from the base of the PR and between 7013166 and c3c203f.

Files selected for processing: 27

  • .changeset/read-verbs-get-list.md
  • docs/agents/content-agent.md
  • docs/agents/review-queue.md
  • docs/api/cms-client.md
  • docs/api/cms-core-server.md
  • docs/api/cms-core.md
  • docs/api/routes-and-endpoints.md
  • docs/deployment/upgrading.md
  • docs/mcp/http-mcp-server.md
  • docs/mcp/operations-registry.md
  • docs/tutorials/mcp-and-webmcp.md
  • packages/api/src/ops.ts
  • packages/api/src/outputs.ts
  • packages/api/src/start.ts
  • packages/api/tests/read-verbs.test.ts
  • packages/client/src/client.ts
  • packages/client/tests/client.test.ts
  • packages/core/src/index.ts
  • packages/core/src/ops.ts
  • packages/core/src/server.ts
  • packages/core/src/server/cms-as.ts
  • packages/core/src/server/cms-ops.ts
  • packages/core/src/server/store.ts
  • packages/core/src/server/store/read.ts
  • packages/core/src/server/store/verbs.ts
  • packages/core/tests/access-context.test.ts
  • packages/core/tests/read-verbs.test.ts

TanStack is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.

  • Ask an admin to upgrade

Open in CodeRabbit

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…ry (3a) (#34)

Chain step 16 of the linear merge chain onto main 3b4a112: this PR's own changes, resolved against the PRs before it in the merge order.

Co-authored-by: jherr <jherr@pobox.com>
@jherr
jherr force-pushed the cursor/read-verbs-get-list-a931 branch from 550fc8f to c3c203f Compare November 6, 2026 15:08
@jherr
jherr merged commit dc7e4ab into main Nov 6, 2026
@jherr
jherr deleted the cursor/read-verbs-get-list-a931 branch November 8, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants