You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(client)!: remove the ai namespace — three methods, none of which ever worked (#3718) (#3736)
* feat(client)!: remove the dead SDK surface — the `ai` namespace and `projects.listTemplates` (#3718, #3702)
Four public methods, every one of them building a URL that NO server in any
repo has ever mounted. All four 404ed from the release that shipped them:
client.ai.nlq -> POST /api/v1/ai/nlq
client.ai.suggest -> POST /api/v1/ai/suggest
client.ai.insights -> POST /api/v1/ai/insights
client.projects.listTemplates -> GET /api/v1/cloud/templates
The three `ai.*` were declared in `DEFAULT_AI_ROUTES` — which has no runtime
consumer, only the spec's own test reads it — and typed as optional protocol
methods (`aiNlq?` …) nothing implements. `listTemplates` targeted a control-plane
route that never existed; templates are a filtered `sys_package` view.
All four were found by the #3563 audit's cross-repo guards, which match the URL
each SDK method BUILDS against the routes each surface MOUNTS: `listTemplates`
by the control-plane ledger (#3655), the three `ai.*` by the AI ledger (#3718),
both living in `cloud` because that is the only repo where the mounted route
set and the SDK are both in scope.
REMOVED, NOT DEPRECATED. A typed method that always throws is worse than no
method: it costs a runtime round-trip to discover, where absence is a compile
error. No working code can break, because there was no working behaviour.
Lands in the v17 major `@objectstack/client` is already taking. That is the
right window for removing public API — not a reason to defer it.
Also removed: the `AI_PLANE` prefix exemption added to the capstone hours ago.
With no method targeting `/api/v1/ai/`, an exemption there is a hole with
nothing to cover. The wildcard-only bound stays 0 and now reaches 0 with
nothing exempted to get there.
The four AI tests in `client.test.ts` are replaced rather than deleted. They
were the exact shape this audit family keeps finding behind green suites: mock
`fetch`, assert the URL the client BUILT, never assert anything answered it —
so they passed for three endpoints that did not exist. The replacement asserts
the one thing worth defending: the namespace is gone and must not return
without a route behind it.
`Ai{Nlq,Suggest,Insights}{Request,Response}` stay re-exported straight from
`@objectstack/spec/api`, so anyone holding those types keeps them; retiring the
spec-side declarations is a separate change.
Docs corrected in the same pass: `client-sdk.mdx` carried three copy-pasteable
examples that 404ed, and `plugin-endpoints.mdx` had the AI surface INVERTED —
it tabled the three phantom routes and explicitly denied `/ai/chat`, which is
mounted. It now lists the 12 routes service-ai really serves.
FOLLOW-UP REQUIRED IN `cloud`, and it cannot be done before this merges:
`UNMOUNTED_CLIENT_METHODS` and `UNMOUNTED_AI_CLIENT_METHODS` pin these exact
four methods as existing-but-unmounted. When cloud's `.objectstack-sha` moves
past this commit, those guards go red — correctly, by design — and the pins
must be emptied in the same PR as the pin bump.
client: 173 passed (13 files), tsc --noEmit clean, build 27/27.
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: re-trigger CI
GitHub Actions never fired for this branch — zero workflow runs across every
workflow, only the Vercel check appeared. Close/reopen did not wake it either.
An empty commit forces a `synchronize` event so the breaking change in this PR
is actually verified rather than merged on an untested branch.
Co-Authored-By: Claude <noreply@anthropic.com>
* chore(changeset): rescope to the ai namespace only — main already removed listTemplates
While this branch sat un-CI'd, #3702 landed on main independently and removed
`projects.listTemplates` with near-identical reasoning. That was the merge
conflict: both sides deleted the method and left a comment in its place. Took
main's wording.
So this PR no longer removes four methods, it removes three. The changeset said
four; it now says what the diff does.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
feat(client)!: remove the `ai` namespace — three methods, none of which ever worked (#3718)
6
+
7
+
`client.ai` held exactly three methods, and **no server in any repo has ever
8
+
mounted the URLs they build**:
9
+
10
+
| Removed | Built | Why it 404ed |
11
+
|---|---|---|
12
+
|`client.ai.nlq`|`POST /api/v1/ai/nlq`| declared in `DEFAULT_AI_ROUTES`, which has no runtime consumer — only the spec's own test reads it; `aiNlq?` is an optional protocol method nothing implements |
13
+
|`client.ai.suggest`|`POST /api/v1/ai/suggest`| same |
14
+
|`client.ai.insights`|`POST /api/v1/ai/insights`| same |
15
+
16
+
Found by the AI route ledger (#3718, in `cloud`, where `service-ai` lives),
17
+
which enumerates the table `buildAIRoutes()` returns and matches the SDK's URLs
18
+
against it. The two sets are **disjoint**: the real AI surface is 12 routes —
19
+
`chat`, `chat/stream`, `complete`, `models`, `status`, `effective-model` and six
20
+
`conversations` routes — and the SDK expressed none of them.
21
+
22
+
**Removed, not deprecated.** A typed method that always throws is worse than no
23
+
method: it costs a runtime round-trip to discover, where absence is a compile
24
+
error. No working code can break, because there was no working behaviour. This
25
+
lands in the v17 major `@objectstack/client` is already taking, which is the
26
+
right window for a breaking removal rather than a reason to defer one.
27
+
28
+
Expressing the real surface is tracked on #3718 as **new** API, not a rename of
29
+
what was removed. For chat, `useChat()` (`@ai-sdk/react`) already speaks the
30
+
Data Stream Protocol `POST /api/v1/ai/chat` serves.
31
+
32
+
Also removed: the `AI_PLANE` exemption added to the capstone hours earlier
33
+
(#3727). With no method targeting `/api/v1/ai/`, an exemption there is a hole
34
+
with nothing to cover — the wildcard-only bound stays `0` and now reaches 0
35
+
with nothing exempted to get there.
36
+
37
+
The four AI tests in `client.test.ts` are **replaced, not deleted**. They were
38
+
the exact shape this audit keeps finding behind green suites: mock `fetch`,
39
+
assert the URL the client *built*, never assert that anything answered it. They
40
+
passed for years against three endpoints that did not exist. The replacement
41
+
asserts the one thing worth defending — the namespace is gone and must not
42
+
return without a route behind it.
43
+
44
+
`Ai{Nlq,Suggest,Insights}{Request,Response}` are still re-exported straight
45
+
from `@objectstack/spec/api`, so anyone holding those types keeps them.
46
+
Retiring the spec-side declarations is a separate change.
47
+
48
+
Docs corrected: `client-sdk.mdx` carried three copy-pasteable examples that
49
+
404ed, and `plugin-endpoints.mdx` had the AI surface **inverted** — it tabled
50
+
the three phantom routes and explicitly denied `/ai/chat`, which is mounted. It
0 commit comments