docs(spec,client): stop documenting bare POST /ai/chat as agent-resolved - #10617
Conversation
Both docblocks asserted runtime behaviour that does not exist: the bare chat route loads no agent and never reads context.appName. The default-agent resolution chain is driven by the assistant chat route. Refs #10510
📓 Docs Drift CheckThis PR changes 2 package(s): 10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 129 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 07fd0f9a3d221da94c8f78a6b339519a2814977c && git checkout 07fd0f9a3d221da94c8f78a6b339519a2814977c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bde0ab95de0c5b3f2f18a6960dfda1ff06f7cd82 954e1430266679fbf819be0ec559a5dfa0abbc09 && git checkout -B drift-repro bde0ab95de0c5b3f2f18a6960dfda1ff06f7cd82 && git merge --no-ff 954e1430266679fbf819be0ec559a5dfa0abbc09
node scripts/docs-audit/affected-docs.mjs --json bde0ab95de0c5b3f2f18a6960dfda1ff06f7cd82
|
POST /api/v1/ai/chat as agent-resolved — it resolves no agent at all
#10510
Fixes #10510
Two shipped docblocks described a resolution step the bare chat route does not
perform. Both read as a security-relevant scoping guarantee — an agent-resolved
endpoint would have its tool offer scoped by that agent's skills (ADR-0063
§1/§5) — so a reader auditing "which endpoints are surface-scoped?" got the
wrong answer at both sites. Per the triage direction on the card, this corrects
the documentation; making the bare endpoint agent-resolved is a behaviour change
in another repo, is explicitly not this card, and would need its own decision.
Site 1 —
packages/client/src/index.ts(client.ai.agentsJSDoc)Was: "
/ai/chattalks to the environment's default agent; these talk to one youname." Now states that these are the only SDK methods that reach an agent, and
that
POST /ai/chat(ai.chat/ai.chatStream) is a raw chat plane thatresolves no agent at all, so nothing about that call is scoped by an agent's
skills.
Site 2 —
packages/spec/src/ui/app.zod.ts(App.defaultAgentJSDoc)Was: "the ambient chat endpoint (
POST /api/v1/ai/chatwithcontext.appName)auto-resolves to this agent". Now attributes the resolution chain (explicit >
defaultAgentof the named app > first active) to the assistant chat endpoint,POST /api/v1/ai/assistant/chat, and says plainly that the bare route is notpart of that chain and never reads
context.appName.This repo corroborates the corrected attribution independently of the cloud
sources the card records:
content/docs/ai/actions-as-tools.mdxnames/api/v1/ai/assistant/chatand/api/v1/ai/agents/:agentName/chatas thein-product chat routes that resolve the principal and forward tool-execution
context.
Scope
Documentation text only. The diff is comment lines in both files — no schema
key, no
.describe(), no parse behaviour and no runtime path changes; theclause-② expectation of
noholds. TheApp.defaultAgent.describe()stringis deliberately untouched: it says the key binds a platform agent to the app's
ambient chat, which stays true once the endpoint attribution is corrected, and
it is the string that reaches
content/docs/references/.Verification
pnpm --filter @objectstack/spec check:generatedreports all 14 generatedartifacts up to date,
check:docsamong them — TSDoc on a schema property doesnot reach
content/docs/references/(only.describe()does), so noregeneration was required.
Gate set re-derived against the actual diff with
node scripts/pm/dispatch-gates.mjs(no paths passed — the script takes its ownchange set from the merge base). It reproduced the dispatch-named families and
added
node scripts/check-dev-prereqs.mjs, plus the five changeset familiesonce
.changeset/carried a file.Green union re-run after the final commit, at
954e143: eighteen gates —check:cross-package-test-inputs,check:doc-formula-expressions,check:empty-state,check:liveness,check:merge-driver,check:slot-lookup,check:spec-parsed-alias,check:strictness-ledger,check:test-source-alias,check:type-source-resolution,check:variant-docs,check-affected-docs.mjs,check:changeset-gate-self-tests,check:objectui-changeset,check-adr-0087-registration.mjs,check-changeset-no-major.mjs,check-empty-changeset.mjs,check-nul-bytes.mjs.@objectstack/specand@objectstack/clienttypecheckboth pass.
One declared exception:
node scripts/check-dev-prereqs.mjsis red locally, andits own verdict says why — "The workspace is not built — 1 unmet precondition,
not a list of problems", listing 36 of 67 packages whose
dist/entry point isabsent. That is a fact about this worktree's build state, not about the diff:
the gate reads built entry points, and a diff of comment lines adds no package
and no entry point. CI builds the workspace before its gates run, so it is
satisfied there structurally. A full
pnpm buildwas deliberately not run forthis — it would hold the shared verify lock for many minutes across a container
of parallel agents to satisfy a precondition unrelated to a two-docblock change.
Generated by Claude Code