fix(spec,runtime): the ai slot's remedy stops claiming nothing ships (#4093 follow-up) - #4301
Merged
Merged
Conversation
#4093 follow-up) CORE_SERVICE_PROVIDER recorded `null` for `ai` because no WORKSPACE package provides it, so `serviceUnavailableMessage('ai')` produced "No implementation ships for the 'ai' slot". That is false — `@objectstack/service-ai` registers the slot — and it is the same class of wrong answer this table was introduced to end, one step further out: I conflated "not in this repository" with "does not exist". Worth naming how it got in. The claim that ai's provider is a Cloud/EE package was true, but I asserted it from a doc line and an old code comment without checking — exactly the provenance that made `plugin-search` and `plugin-workflow` wrong. Verified properly now, against the cloud repository: `packages/service-ai/src/plugin.ts` calls `ctx.registerService('ai', …)`, and the package is `private: true`. So something ships AND there is nothing to install — which is why `null` stays correct and why the sentence still must not start with "Install". `ai` gets a REMEDY_DETAIL entry, the mechanism `ui` already used for a slot the simple sentence describes badly. Discovery (`services.ai.message`) and the /ai 501 body both report it. `search`, `workflow` and `graphql` were re-checked the same way — nothing in either repository registers them — so their `null` and their "nothing ships" sentence are accurate, now on evidence from both sides rather than one. This REMOVES code. `/ai`'s domain carried a local message override precisely because the shared sentence was wrong there; correcting the table fixed the domain AND discovery, which an override could never reach. The override and `capabilityUnavailable`'s `message?` parameter are both gone, and the helper now documents why there is no per-call escape hatch: a slot whose sentence is wrong needs the table corrected. check-service-providers keeps its workspace-only rule — it cannot see another repository, and widening it is not the fix — but it no longer REPEATS the conflation in its own output ("N correctly report that nothing ships yet"), and its failure text now tells the next person what to do in exactly this case: use `null` plus a REMEDY_DETAIL sentence when something ships that simply cannot be installed. Verified by pointing the table at the private package and reading the error. Also corrected: three places still describing /ai's absent-service answer as a 404 — docs/api/client-sdk.mdx, docs/releases/v17.mdx, and a comment in packages/client's URL-conformance test. Stale since #4222 made it 501; the drift check had flagged client-sdk.mdx then and I only swept the files that document status codes directly. Verified: full `pnpm test` 132/132 tasks; runtime 954; spec's provider suite 8; build 71/71; pnpm lint, every check:* gate and spec's api-surface clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UNGqBQcdJ2RYHtWgntJ9B
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 114 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…ted sentence The drift check flagged it and a targeted grep found it: http-protocol.mdx's discovery sample printed the `ai` slot's message as "No implementation ships for the 'ai' slot" — the line I wrote in #4204, made stale by this PR correcting the very claim it quotes. The `workflow` entry beside it is left alone: nothing registers that slot in either repository, so its sentence is still true. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UNGqBQcdJ2RYHtWgntJ9B
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.
修 #4204 引入的一处错误 —— 由我自己引入,而且是这张表当初就是为了消灭的那一类,只是往外多走了一步。
现象
CORE_SERVICE_PROVIDER给ai记了null(因为这个 workspace 里没有包提供它),于是 discovery 报:这是假的 ——
@objectstack/service-ai确实注册了这个槽位。我把 "不在这个仓库里" 等同于 "不存在"。这个错误是怎么进来的,值得点名
我当时说"ai 的提供者是 workspace 之外的 Cloud/EE 包" —— 这句是对的,但我是从一行文档和一段旧注释里读来的,没有验证。那正是
plugin-search、plugin-workflow当初错掉的同一种来源。现在按表里其他条目的同一标准、对着 cloud 仓库验证过了:
packages/service-ai/src/plugin.ts:759→ctx.registerService('ai', this.service)✓"private": true—— 不发布所以是东西确实有,但没有任何东西可装 —— 这正是
null依然正确、而句子又绝不能以 "Install" 开头的原因。search/workflow/graphql也用同样方式复查:两个仓库里都没有任何东西注册它们,所以那三个null和"nothing ships"是准确的 —— 现在是双边证据,不是单边。改法(净删代码)
ai加一条REMEDY_DETAIL—— 就是 #4222 里已经为ui建好的那个机制:连锁效果是删代码:
/ai域那个本地文案覆盖,存在的唯一理由就是"共享句在这里是错的"。把表教对之后,域和 discovery 一起修好了 —— 而覆盖永远够不到 discovery。于是覆盖、以及capabilityUnavailable的message?参数一并删除,并在 helper 上写明为什么不留这个逃逸口:句子错了要改表,不是开局部例外。守卫
check:service-providers保留 workspace-only 规则(它看不见另一个仓库,放宽它不是解法),但:null+ 一条 REMEDY_DETAIL。已通过"把表指向那个私有包"实测确认顺带修好三处 #4222 该改而漏掉的
/ai空服务应答在 #4222 已改成 501,但这三处还写着 404:docs/api/client-sdk.mdx、docs/releases/v17.mdx、以及packages/client那条 URL 一致性测试的注释。当时 drift check 提示过 client-sdk.mdx,我只扫了直接记录状态码的文件。验证
全仓
pnpm test132/132;runtime 954;spec provider 套件 8;build 71/71;pnpm lint、全部check:*、spec api-surface 干净。🤖 Generated with Claude Code
https://claude.ai/code/session_018UNGqBQcdJ2RYHtWgntJ9B
Generated by Claude Code