feat(client): actions surface — the SDK path to server-registered actions (#3563 PR-2) - #3571
Merged
Merged
Conversation
…ions (#3563 PR-2) Closes the largest gap in the #3563 route audit: the whole /actions domain — the documented way to expose custom server-side operations (engine.registerAction) — had no SDK expression at all, so every console hand-rolled fetch for it. - client.actions.invoke(object, action, { recordId, params }) — POST /api/v1/actions/:object/:action. recordId travels in the body, which both server URL shapes honor. The path is fixed (not discovery-routed): actions is not in ApiRoutesSchema, same precedent as projects' /api/v1/cloud. - client.actions.invokeGlobal(action, opts) — the wildcard /actions/global/:action shape. - The handler's own business failure surfaces as { success:false, error } (the dispatcher's inner envelope), deliberately not thrown, so callers can toast it. Unit tests cover URL shape, encoding, body defaults, the global variant, and the inner-failure path. Ledger: all three /actions rows flip to sdk; the gap ratchet drops 27 → 24 — first real exercise of the PR-1 guard. Documentation stops lying (audit findings): - client README: the six phantom methods are gone (meta.getObject, views.share, views.setDefault, workflow.approve/reject, ai.chat — replaced with the real calls where one exists), and the hand-written "all 13 namespaces / FULLY COMPLIANT" claims now defer to the CI-enforced ledger. - CLIENT_SPEC_COMPLIANCE.md: retired to a tombstone. Its verdict was measured against DEFAULT_DISPATCHER_ROUTES — a table nothing in runtime consumes, missing five of the domains it should have been measuring. - content/docs/api/client-sdk.mdx: documents the new actions surface; the automation row now reflects the real method count. Pre-existing, untouched: the bare `tsc -p` TS2741 (routeMap missing graphql) reproduces identically on main — its root is the stale graphql entry in ApiRoutesSchema, tracked as audit follow-up #7 (spec-major territory). Verified: client 122 passed (5 new), runtime 653 passed, both ledger guard halves green, eslint clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LX9ut3MK3KykE11S9bJmv5
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 26 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
marked this pull request as ready for review
July 27, 2026 07:21
This was referenced Jul 27, 2026
os-zhuang
added a commit
that referenced
this pull request
Jul 27, 2026
…xture debris (#3586) (#3595) The const described a route surface that never existed (/workflow, /realtime listed; eight real prefixes missing) and was consumed by nothing in the runtime — only its own tests and api-surface.json. Its one real-world effect was underwriting CLIENT_SPEC_COMPLIANCE.md's false "FULLY COMPLIANT" verdict (retired in #3571). The maintained, guard-enforced source of truth is packages/runtime/src/route-ledger.ts. Since the major train is loading now (#3562, #3581), the removal ships directly instead of the deprecate-first interim step. Also swept what #3562 left behind: registry test fixtures renamed from graphql_api//graphql to honest OData naming, the tautological config.graphql assertions dropped, the stale '"type": "graphql"' JSDoc example corrected. Client's bare tsc -p is verified clean (the TS2741 acceptance item — resolved by #3562's schema change, confirmed here). Closes #3586 Claude-Session: https://claude.ai/code/session_01LX9ut3MK3KykE11S9bJmv5 Co-authored-by: Claude <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.
PR-2 of #3563, closing the largest gap the audit found — and the first real exercise of the PR-1 (#3569) guard: the gap ratchet drops 27 → 24.
The gap
The whole
/actionsdomain — the documented way to expose custom server-side operations (engine.registerAction) — had no SDK expression at all. Every console hand-rollsfetchforPOST /api/v1/actions/...today.The surface
Design points, each matching the dispatcher's actual contract (
handleActions,http-dispatcher.ts:1946-2150):recordIdtravels in the body — the server accepts it in the URL or the body; one client shape serves both server shapes.actionsis not inApiRoutesSchema, sogetRoute()cannot resolve it; same precedent asprojects→/api/v1/cloud, documented at the definition.{ success:false, error }(the dispatcher strips the sandbox wrapper to the business message); callers toast it rather than catch it.Ledger + ratchet
All three
/actionsrows flipgap→sdk; the conformance bound inroute-ledger.conformance.test.tsdrops to 24. The client half of the guard (route-ledger-coverage.test.ts) verifiesactions.invoke/actions.invokeGlobalresolve on a real client instance.Documentation stops lying (audit findings §6)
meta.getObject,views.share,views.setDefault,workflow.approve,workflow.reject,ai.chat), replaced with the real calls where one exists (meta.getItem,client.approvals.*); the "all 13 namespaces / 95+ methods" claims now defer to the CI-enforced ledger.CLIENT_SPEC_COMPLIANCE.md— retired to a tombstone. Its "✅ FULLY COMPLIANT" verdict was measured againstDEFAULT_DISPATCHER_ROUTES, a table nothing in runtime consumes that omits five of the domains it should have been measuring. The file stays so inbound links don't break.content/docs/api/client-sdk.mdx— documents the new surface (with the inner-envelope semantics); the automation row now reflects the real method count (15, not 1); the compliance callout points at the ledger instead of the retired matrix.Test plan
tsc -pTS2741 (routeMapmissinggraphql) reproduces identically onmain; its root is the stalegraphqlentry inApiRoutesSchema, already tracked as audit follow-up Remove explicit pnpm version from workflows to fix version conflict #7 (spec-major territory).🤖 Generated with Claude Code
https://claude.ai/code/session_01LX9ut3MK3KykE11S9bJmv5
Generated by Claude Code