Repository navigation
Conversation
…ests The hosted AI doors read only model, temperature and maxTokens from the nested options bag (plus tools on /chat for a builder) and dropped the rest, while the spec declared an open record. Close the bag to the keys the doors honour so an unhonoured key is refused at the contract. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbJLbdeQYpUdiyVz7R
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CaYdRXFrGbNEPsbjSo
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 185 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1ac6a8a12f37628e0d207cd096a8bb411ae07df1 && git checkout 1ac6a8a12f37628e0d207cd096a8bb411ae07df1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c99c8a502209f6e924c77e227c2648993f22f3cb ab651bb810ddc3429ed21dbd79cd70ee28d2c74d && git checkout -B drift-repro c99c8a502209f6e924c77e227c2648993f22f3cb && git merge --no-ff ab651bb810ddc3429ed21dbd79cd70ee28d2c74d
node scripts/docs-audit/affected-docs.mjs --json c99c8a502209f6e924c77e227c2648993f22f3cb
|
Requested by Bill · project thread
Fixes #38943
Session:
session_01Utp6CaYdRXFrGbNEPsbjSo(card thread; the commit'sClaude-Sessiontrailer names a wrong id,session_01Utp6CbJLbdeQYpUdiyVz7R, and this line is the correct one)What changes
AiChatRequestSchema.optionsandAiCompleteRequestSchema.options(packages/spec/src/api/protocol.zod.ts) were open records (z.record(z.string(), z.unknown())). They are now closed shapes built withstrictObject:optionskeys acceptedPOST /api/v1/ai/completemodel,temperature,maxTokensPOST /api/v1/ai/chatmodel,temperature,maxTokens,tools(honoured only for a caller with the build permission; dropped for anyone else, as thedescribesays)Any other key (
stop,toolChoice, …) is refused by the schema and is a type error inAiChatRequest/AiCompleteRequest, with the strict-object unknown-key message. The enforcement note sits in the shared helper's docblock, thehistoryof the strict declaration and eachdescribe. The in-processAIRequestOptionsservice interface (contracts/ai-service.ts) is not the wire request and is untouched, as the card scopes.Regenerated:
packages/spec/docs/references/api/protocol.mdand the strictness-ledger counts (docs/audits/2026-07-unknown-key-strictness-ledger.counts/api.md, 555 → 556 sites).check:generatedis clean after--fix.Why
Declaration over implementation (card #38943, triage 7315324797): the schema claimed any key while the hosted doors honour three (plus⚠️ Not re-measured here: this session cannot read
toolson/chat) and silently drop the rest. A closed shape refuses at the contract instead of accepting and ignoring. Source fact: the cloud contract review of cloud PR #5321, comment 7313954867 §②, quoted on the card.objectstack-ai/cloud, so the door behaviour (including thetoolsbuild-permission condition and its array shape,AIToolDefinition[]perAIRequestOptions.tools) rests on that review.No first-party client breaks: the console transport sends no nested
options(ui/packages/plugin-chatbot/src/useObjectChat.ts), andpackages/clientpassesAiChatRequest/AiCompleteRequestthrough unchanged (its tests send nooptions).Verification
packages/spec:vitest run src/api src/shared— 106 files, 3242 tests pass, including new cases inprotocol.test.ts(accepted keys on both doors;stopandtoolsrefused on/complete;toolChoicerefused on/chat).tsc --noEmitonpackages/specclean;check:test-typecheckOK.check:adr-0087-registration,check-empty-changeset,check-changeset-no-majorpass locally.Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill or docs page teaches the nested
optionsof/ai/chator/ai/complete(git grepoverskills/andcontent/docs/finds only the route table incontent/docs/api/plugin-endpoints.mdx, which names no option keys)Narrowing declaration: a published request type and schema now refuse keys they accepted. Per the fleet rule this lands as Tier H and owes a contract-tier L2 before the queue.
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.https://claude.ai/code/session_01Utp6CaYdRXFrGbNEPsbjSo
Generated by Claude Code