Skip to content

feat(spec, plugin-chatbot, console): the AI model picker shows each model's cost multiplier and asks before a ×20 pick - #33746

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-cv4ljj
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-cv4ljj

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #33660

Clause-②: yes (widening)
Metadata-protocol: none

Seat domain:ui#2 · os-project-manager · card thread session_01FEkQ5pX4G6G9ZLeRqSRoFu · claim 6890495150

维护者速读

  • 改了什么:AI 模型选择器(AI 对话页、控制台对话侧栏、Studio 助手三处共用)在每个模型名旁显示倍数「×N」;服务端提供用量时,下拉列表底部写明「AI 额度还剩 X%,标有 ×N 的模型消耗速度是默认模型的 N 倍」;选择 ×20 及以上的模型时先弹确认,取消则保持原模型,低于 ×20 照旧立即切换。接口定义 AiModelsResponseSchema 的模型条目新增可选字段 costMultiplier(正数,默认模型为 1)。
  • 为什么改:维护者开放付费模型选择的条件是「只要选择时能够看清楚倍数」(cloud#4536);此前选择器只显示名字。
  • 风险与回滚:只新增可选字段与前端显示;服务端未填倍数时界面与今天一致。倍数由 cloud service-ai 的 GET /api/v1/ai/models 填写,那是另一张 cloud 卡(本卡为其 Blocked-by)。回滚即还原本 PR。
  • 先看:ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx(ModelPicker:×N、额度说明、×20 确认)、ui/packages/app-shell/src/console/ai/AiChatPage.tsx(ChatPane 读 /ai/usage 传给选择器)、packages/spec/src/api/protocol.zod.ts(新字段及其说明)。
  • 两分钟验证:在提供多模型且 /ai/models 带 costMultiplier 的环境打开 /ai/build,展开模型下拉:每个模型旁有 ×N,底部有剩余额度说明;选 ×20 的模型会弹确认,点取消模型不变。
  • 需要你做的:无,席位落地(Clause-② 放宽,席位先补契约复审记录)。

What changes

  • Spec. AiModelsResponseSchema (packages/spec/src/api/protocol.zod.ts): the object form of a model entry gains costMultiplier, optional, z.number().positive(). Its .describe() says it is the factor by which one message on the model draws on the AI allowance compared with one on the environment's default model, states the normalisation as contract (the default: true entry carries 1; every other entry carries its model's cost weight divided by the default model's), and names its producer: cloud service-ai's GET /api/v1/ai/models. The bare-string entry form is unchanged. The reference page content/docs/references/api/protocol.mdx is regenerated (check:generated --fix, docs only; authorable-surface did not move, so Metadata-protocol: none).
  • Producer. Nothing in this repository answers /ai/models: packages/runtime/src/domains/ai.ts only dispatches /ai/* to the route table the AI service registers, and with no serveable AI service it answers 501. The only producer is cloud service-ai (packages/service-ai/src/routes/ai-routes.ts), which fills the member from cost_weight in a separate cloud card, Blocked-by this one. No framework number is invented.
  • Hook. useAiModels keeps costMultiplier when it is what the spec declares (a finite positive number) and drops anything else, so a model never shows a multiplier it was not given.
  • Picker (ChatbotEnhanced's ModelPicker, the one picker every chat host renders):
    • each model with a multiplier draws ×N beside its label, in the list and on the trigger; a model with none (or with a non-finite or non-positive value) draws none. The drawn value is rounded to two decimals at 1 and above and to two significant digits below 1, so a small multiplier never reads ×0;
    • with usage served, the open list ends with a note: the share of the allowance left (1 - pool.fraction, as a percent, the same reading as the console's usage ring) and that a ×N model uses it N times as fast as the default. Never a token count (rule D5). Without usage, or with no model carrying a multiplier, there is no note;
    • a pick whose DRAWN multiplier is ×20 or above opens an AlertDialog once, naming the model and its multiplier (and the share left, when known), so what the person reads and whether they are asked always agree (19.996 reads ×20 and asks). Cancel keeps the current model and writes nothing; "Switch model" writes the pick. The dialog holds the picked id and reads the model from the current list: a model that leaves the list while asked, or that the list now draws below ×20 or with no multiplier, is dropped, the question closes and nothing is written. A pick below ×20, or of a model with no multiplier, applies at once as before.
  • Hosts. ChatPane (AiChatPage.tsx) reads useAiUsage only once some model carries a multiplier, and passes pool.fraction (not when unmetered or null) as allowanceUsedFraction. The /ai page, the console dock (ChatDockConversation) and the Studio copilot (StudioCopilotConversation) all render ChatPane, so none of their files changes and none can skip the confirmation.
  • Strings. Six keys under chatbot.modelPicker in the existing chatbot namespace. en and zh-Hans (zh-CN) as ordered; the other nine packs are filled too, because all-locales-key-parity.test.ts requires every pack to define every en key.
  • Published surface, each a Clause-②: yes (widening):
    • @objectstack/spec: AiModelsResponseSchema model entry member costMultiplier?: number;
    • @object-ui/plugin-chatbot: ChatbotModelOption.costMultiplier?: number;
    • @object-ui/plugin-chatbot: ChatbotEnhancedProps.allowanceUsedFraction?: number.
  • Changeset .changeset/33660-ai-model-picker-cost-multiplier.md: @objectstack/spec, @object-ui/plugin-chatbot, @object-ui/i18n, @object-ui/app-shell, @object-ui/console patch (a widening with Metadata-protocol: none ships patch; app-shell is private and console's dist ships it).
  • Docs: one Features bullet on content/docs/frontend/plugins/plugin-chatbot.mdx.

Tests

  • ui/packages/app-shell/src/console/ai/__tests__/AiChatPage.modelCostMultiplier-33660.test.tsx: the three hosts (AiChatPage at /ai/build, ChatDockConversation, StudioCopilotConversation), each with the REAL ChatPane, useAiModels, useAiUsage (over a fetch stub answering /ai/models and /ai/usage) and ChatbotEnhanced, driven through the rendered Select (keyboard open, option click) and the rendered AlertDialog. Per host: ×1 ×5 ×20 drawn and nothing for the model the server gives none; a ×20 pick asks, Cancel keeps Fast, Confirm switches the trigger to the ×20 model; CONTROL: a ×5 pick switches at once with no dialog; the allowance note reads 60% with usage 0.4, and is absent when /ai/usage answers 404.
  • ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.modelCostMultiplier-33660.test.tsx: the picker alone: multipliers per model and none for a model without one; the trigger's multiplier; a fractional ×0.5; the edge (19.996 reads ×20 and asks, 19.994 reads ×19.99 and applies at once); 0.004 reads ×0.004, and NaN, Infinity and 0 draw nothing; Confirm writes the asked-about model after the list reorders, a model that leaves the list while asked closes the question with nothing written and does not ask again when it returns; the same when its multiplier falls to ×5 or is withdrawn while asked; ×20 Cancel writes nothing, Confirm writes opus once; CONTROL: ×1, ×5 and no-multiplier picks write at once; the note and the dialog carry the share left with usage and only the multiplier without it; no note when no model has a multiplier.
  • packages/spec/src/api/protocol.test.ts: an entry with costMultiplier: 20 (and 0.5) parses and keeps it; 0, -1, '20' and NaN are refused; the existing entry without it still parses, as does the bare string.
  • The existing picker pins (ChatbotEnhanced.modelPicker-11865.test.tsx, exact textContent) stay green unchanged: absent stays absent.
  • Ablations through scripts/ablation-replace.mjs (ui vitest aliases @object-ui/plugin-chatbot to src, no rebuild), each restored with the blob equal to HEAD and git diff HEAD empty:
    • on 0fcd2cf, both new pin files (26 tests): no confirmation (the ×20 branch ANDed with an always-false term) 7 failed / 19 passed, every ×20 pin on all three hosts and the unit file; no rendering (the ×N span's condition always false) 12 failed / 14 passed, every multiplier-drawn pin and the host pins that read the trigger's multiplier; the hook drops costMultiplier 15 failed / 11 passed, every host pin; ChatPane passes no allowanceUsedFraction 3 failed / 23 passed, the "note shows with usage served" pin on each host;
    • on 4d3ccb7 (the head's code; 35f32c7 only renames one test case), both pin files (31 tests): the ×20 question compares the raw value instead of the drawn one, 1 failed / 30 passed (the 19.996 edge pin); the drawn value rounds to two decimals below 1 too, 1 failed / 30 passed (×0.004 reads ×0); the line that drops a pick no longer asked about deleted, 3 failed / 28 passed (left the list, fell to ×5, withdrawn: each question comes back); the question keeps a model the list now draws below ×20 (confirming = the listed entry), 2 failed / 29 passed (fell to ×5, withdrawn).

Acceptance notes

  • Patch round 1 (contract review PASS 6891993315 on 387c179, three should-fixes; delta PASS 6892455683 on 098d07e, one more): S1 the normalisation in the .describe() (reference docs regenerated); S2 the question compares the drawn value and nothing reads ×0; S3 Confirm re-resolves the pick by id from the current list; delta: a pick whose model the list now draws below ×20 or with no multiplier is dropped too, so the question never reads "0 times". The optional nit on a non-finite multiplier from a direct host is in (draws nothing). Left as optional: the ×N span sits inside the item text, so the trigger shows it too (intended: the person sees the multiplier of the model in force); and two /ai/usage reads where the console's usage ring is mounted beside the picker, since sharing one read needs a usage provider across the dock and the pane, outside this card's file surface.

  • Line budget. About 826 changed lines at the head (the regenerated protocol.mdx excluded), over the order's ~600: 467 are the two pin files and 89 the i18n keys the parity test forces into all eleven packs. Production code is about 230. The seat agreed to keep ONE PR; a spec+hook / picker+hosts split would have left the second PR at about 680.

  • "Asks once" is read as one confirmation per ×20-or-above pick (asked every time such a pick is made), not once per session.

  • The note's number is the share left, not used, so it reads directly against the multiplier ("75% left; a ×N model uses it N times as fast"). It is derived only from pool.fraction; nothing estimates messages or tokens.

  • No cloud change. Until cloud service-ai fills costMultiplier, every entry lacks it and the picker, the usage read and the confirmation are exactly as before (useAiUsage is not even asked).

  • Not changed: the model list's filtering and plan gating, and how a pick is persisted (the order's ⛔).

Verification

Head: 8e2c2d7, the seat's merge of main into 35f32c7 (the last code commit of this branch). The local readings below are on 35f32c7; CI's check-runs on 8e2c2d7 are the reading of the merged tree.

Local gates, type-check, lint and suites (35f32c7)
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 115 families for this diff (tree 35f32c7, the same 115 as on every earlier head). All 115 exit 0 on 35f32c7, run sequentially after a full workspace build. --ran reconciliation: 115 derived, 115 run, 0 NOT-MEASURED, 0 UNRUN.
  • pnpm --filter @objectstack/spec check:generated --fix after the S1 .describe() change: only check:docs stale, content/docs/references/api/protocol.mdx regenerated; authorable-surface, api-surface, export-origins and declaration-map unchanged.
  • pnpm --filter @object-ui/plugin-chatbot run type-check: exit 0 on 4d3ccb7 (35f32c7 renames one test case). @object-ui/app-shell type-check: exit 0 on 387c179; no app-shell file changed since. ESLint (--no-inline-config) on the changed source and test files: exit 0, no warning on a changed line. pnpm check:new-line-citations (from ui/): 0 new citations.
  • Suites under the lock, from ui/ with --maxWorkers=2 over packages/plugin-chatbot/, packages/app-shell/src/console/ai/, layout/, views/studio-design/, hooks/ and packages/i18n/ on 35f32c7: 829 files, 7593 passed, 13 skipped, 0 failed (lock VERDICT command-exit 0).
  • @objectstack/spec: src/api/protocol.test.ts and src/type-alias-convention.pin.test.ts on 35f32c7: 256 passed. The full spec suite, the full app-shell suite and the rest of the farm are CI's.
  • Earlier heads, for the record: on 0fcd2cf the suites caught zh-hant-generated.test.ts (zh-Hant is generated from zh-Hans), fixed by gen:zh-hant in 387c179; three exit-3 prerequisite reads on 0fcd2cf (teardown-shape --self-test, dual-build-cjs-loads, type-check-debt) measured nothing and exit 0 on every later head.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5pX4G6G9ZLeRqSRoFu


Generated by Claude Code

…'s cost multiplier and asks before a x20 pick

The model entry of AiModelsResponseSchema gains an optional positive
costMultiplier. useAiModels keeps it, ChatbotModelOption carries it, and
the shared ModelPicker draws it beside each label, notes the allowance
left from GET /ai/usage pool.fraction when served, and confirms a pick
at x20 or above before it applies. All three chat hosts render ChatPane,
which reads the usage and passes it to the picker.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pX4G6G9ZLeRqSRoFu
zh-Hant is generated by gen:zh-hant; the hand-written line differed from
the converter's output.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pX4G6G9ZLeRqSRoFu
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 2 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/frontend/plugins/plugin-chatbot.mdx (via /api/v1/ai/models (route, a path literal in AiModelsResponseSchema))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via /api/v1/ai/models (route, a path literal in AiModelsResponseSchema))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 172 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 7844272c47fd4e83cae6f4770b878d70b5a37e13 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8c0365f6d494d8bafe6666cb0f1b26175f49d4fe — the merge of head 8e2c2d79aa60284f45e012e73553d1bb53f83072 into base 7844272c47fd4e83cae6f4770b878d70b5a37e13, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8c0365f6d494d8bafe6666cb0f1b26175f49d4fe && git checkout 8c0365f6d494d8bafe6666cb0f1b26175f49d4fe
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7844272c47fd4e83cae6f4770b878d70b5a37e13 8e2c2d79aa60284f45e012e73553d1bb53f83072 && git checkout -B drift-repro 7844272c47fd4e83cae6f4770b878d70b5a37e13 && git merge --no-ff 8e2c2d79aa60284f45e012e73553d1bb53f83072

node scripts/docs-audit/affected-docs.mjs --json 7844272c47fd4e83cae6f4770b878d70b5a37e13

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 7844272c47fd4e83cae6f4770b878d70b5a37e13 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet objectstack-fleet Bot added the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 387c17942f91721ca9470a679578cc3225b920d8
Local-runs: none
Scope: packages/spec/src/api/protocol.zod.ts + ui/packages/plugin-chatbot/src/useAiModels.ts, ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx, ui/packages/app-shell/src/console/ai/AiChatPage.tsx

Read: card #33660 (body and its 4 comments: priority note 6889533808, triage first touch 6889924748, claim 6890495150, os-dev-report 6891945992), PR #33746 (body, 21 files, net diff against merge-base 5604aeb0), and the check-runs on the head. The remaining 17 files (two pin files, protocol.test.ts, eleven i18n packs, two docs pages, the changeset) are the lane seat's ACCEPT at TIER_DEFAULT and are not judged here.

Check-runs on the head at 2026-11-15T08:55Z: 50 runs: 14 success, 13 skipped, 23 in progress, 0 failed. Green so far: Check Changeset (one of its two runs), Spec property liveness, Governed Surface Queue Guard, PR-body guards, Check Documentation Links, Dogfood Regression Gate. Still running: Build Core / Docs / UI Deps, every Lint family, Type Check (workspace, consumer gates, debt ledger), Test Core 1/8 to 8/8, Live E2E UI, the second Check Changeset run. This record judges the contract; the gate verdicts are not in, and landing waits for them.

① Derived judgments

  • @objectstack/spec AiModelsResponseSchema, object entry gains costMultiplier?: number: right. It is z.number().positive().optional(): additive, and no payload that parsed on main is refused. The bare-string arm of the union is untouched. The spec is on zod ^4.6.6, where z.number() refuses NaN and Infinity, so "positive" also means finite. The accept-set moves by exactly one optional member.
  • Metadata-protocol: none: right. The schema describes a wire response (GET /api/v1/ai/models), not anything a metadata author writes. Spec property liveness is green on the head.
  • @object-ui/plugin-chatbot ChatbotModelOption.costMultiplier?: number: right. Additive optional member on an exported interface.
  • @object-ui/plugin-chatbot ChatbotEnhancedProps.allowanceUsedFraction?: number: right. Additive optional prop; absent keeps today's rendering.
  • useAiModels return shape: right. Each model may now carry costMultiplier; no caller of the old shape breaks.
  • Six i18n keys under chatbot.modelPicker: right, additive. @object-ui/app-shell exports nothing new (ChatPane props are unchanged).
  • Nothing is removed or narrowed. No public-surface change is implied by the diff beyond the three the PR body lists.

② Semver level

  • Clause-②: yes (widening) is right, and it stands line-initial in both the PR body and the changeset body, with Metadata-protocol: none beside it.
  • AGENTS.md step 3: the level follows the metadata-protocol kind alone, and none takes patch. A non-protocol widening ships patch. So patch on @objectstack/spec and @object-ui/plugin-chatbot is right.
  • @object-ui/i18n (new keys) and @object-ui/console (ui/apps/console, which ships the private @object-ui/app-shell) are moved by the diff, and patch is right for both. Naming the private @object-ui/app-shell is harmless.
  • @object-ui/components is only imported from (AlertDialog, already exported), so it rightly has no entry.

③ Boundary flags

  • open_questions: empty. Nothing to answer.
  • Out-of-scope finding, cloud producer: confirmed and escalated to the seat. Nothing in this repository answers /ai/models; the spec's own comment above the AI block says the dispatcher only proxies /api/v1/ai/** and answers 501 with no service. So the member has no producer until cloud service-ai fills it. The seat owes the cloud card (the card's priority comment names cloud#4537), Blocked-by AI model picker: carry each model's cost multiplier to the browser, show it per model, and confirm before switching to an expensive model #33660. That card must carry two sentences from this contract:
    • the value is a ratio against the environment's default model, so the entry with default: true carries exactly 1. cost_weight is on a haiku scale (cloud#4438), so cloud divides by the default model's weight and does not pass the raw weight through;
    • the value is a finite positive number or the member is absent, never 0 or null.
  • Deviation, i18n keys in all 11 packs: accepted; the parity test forces it. It is the lane seat's remainder.
  • Deviation, ChatDockConversation.tsx and StudioAiCopilot.tsx unchanged: right. On the head both render ChatPane (ChatDockConversation.tsx:151, StudioAiCopilot.tsx:124), and ChatPane holds the only useAiModels call in the UI tree (AiChatPage.tsx:2139). No host reaches the picker by another path.
  • Deviation, one bullet on plugin-chatbot.mdx outside the order's file surface: the lane seat's remainder; not a contract matter.
  • Deviation, local suites narrowed, full suites left to CI: noted. The Test Core shards and Live E2E UI are still running on this head.
  • Deviation, no assignees on pr_create: process, not contract.
  • "Asks once" read as once per pick at or above 20, not once per session: agrees with the card ("a pick at ×20 or above asks once before applying"). Held.
  • Line budget, about 718 against about 600: the seat already agreed to one PR. Not a contract matter.

④ Design judgment

packages/spec/src/api/protocol.zod.ts: holds against the card's ruling and against the picker.

  • Optional, positive, and the bare-string entry is kept: yes to all three.
  • The .describe() names its producer (cloud service-ai's GET /api/v1/ai/models, from the model's cost weight) and what absence means. That satisfies ADR-0049 for a member this repo cannot fill, and matches how the surrounding block already declares "the wire, not a protocol this repo serves".
  • The spec's conventions forbid nothing here: camelCase member, .describe() present, inside the existing lazySchema, generated docs regenerated.
  • should-fix: "the default model is 1" is stated as a convention, not a contract. The describe says it in a parenthesis ("the environment's default model (which is 1)"), and "from the model's cost weight" can be read as the raw weight. The schema cannot enforce it across entries. The picker's sentences depend on it: the allowance note and the confirmation both say "N times as fast as the default model". With a raw haiku-scale weight and a non-haiku default, those sentences would be false. The definition as written is still correct, so this is not a must-fix; one clause ("normalised so the default: true entry carries 1") would make it a contract. Until then the cloud card in ③ carries it.

ui/packages/plugin-chatbot/src/useAiModels.ts: agrees.

  • costMultiplierOf keeps a finite positive number and drops everything else ('20', 0, negatives, NaN, Infinity, null), and the key is omitted, not set to undefined. A model never gets a guessed multiplier.
  • Read, not reviewed: normalize drops bare-string entries (it filters on m.id), as it does on main. That predates this card and is outside it.

ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx: agrees, with three findings below must-fix.

  • ×N is drawn only when costMultiplier !== undefined; a model with none draws none; ×1 is drawn only for a served 1.
  • The threshold compares costMultiplier ?? 0 as at-or-above EXPENSIVE_MODEL_MULTIPLIER (20): exactly 20 asks, no off-by-one, and an absent value never asks.
  • The Select is controlled, so the shown model does not move while the question is open. Cancel, Escape and an outside dismiss all go through onOpenChange and write nothing. Confirm writes once and closes.
  • Keyboard: every pick path (Enter in the open list, typeahead on the closed trigger) goes through the same onValueChange, so none skips the question. Re-picking the current model fires nothing.
  • The note uses only allowanceUsedFraction, clamped to 0..1, as a whole percent. No token count and no estimate of messages: rule D5 holds.
  • should-fix: display rounding disagrees with the threshold at its edge. multiplierText rounds to two decimals. A value in 19.995 up to 20 is drawn ×20 and applies with no question; a value below 0.005 is drawn ×0. Compare the rounded value, or draw without rounding up across the threshold.
  • should-fix: the pending pick is a snapshot. confirming holds the option object. If the model list changes while the dialog is open (a refetch, an apiBase change), Confirm still writes that id, and the picker then shows it as the outside item. Re-resolve by id on confirm, or clear confirming when the model leaves the list. The list is fetched once per pane, so this is rare.
  • nit: the picker trusts costMultiplier from a direct host. A host that feeds models itself, without useAiModels, and passes NaN or a negative gets ×NaN drawn. The hook is the guard today; the typed prop makes this the host's error.
  • nit: the ×N span is inside ItemText, so it is part of the item's typeahead text and its announced name. Harmless.

ui/packages/app-shell/src/console/ai/AiChatPage.tsx: agrees.

  • useAiUsage is enabled only once some model carries a multiplier, so an environment whose service fills none makes no new request and looks as it does on main.
  • allowanceUsedFraction is pool.fraction only, and is undefined when the pool is unmetered, the fraction is null, or usage is not served (404, bad shape). useAiUsage already refuses a non-finite fraction.
  • The prop reaches the one ChatbotEnhanced that ChatPane renders, so all three hosts get the multiplier, the note and the question from one place.
  • nit: where the dock's usage ring is also mounted, /ai/usage is read by two hook instances. No effect on correctness.

No must-fix. Two should-fix in the picker and one in the describe, none of which changes the published shape.

Implemented-by: claude/project-thread-cv4ljj
Reviewed-by: session_01FEkQ5oF8GgTHN2jBZoDwz8

VERDICT: PASS

@objectstack-fleet objectstack-fleet Bot removed the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 15, 2026
…on the drawn multiplier, re-resolve the asked pick

- costMultiplier's describe now states the normalisation as contract:
  the default entry carries 1, others their cost weight over the
  default's.
- The picker draws a rounded multiplier (two decimals at 1 and above,
  two significant digits below, never x0) and the x20 question compares
  that drawn value; non-finite or non-positive values draw nothing.
- The confirmation holds the picked id and reads the model from the
  current list; a model that leaves the list while asked is dropped.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pX4G6G9ZLeRqSRoFu
… rounding kept

The i18n formatNumber options carry no maximumSignificantDigits.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pX4G6G9ZLeRqSRoFu
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 098d07e5477e2aadd128431142cbb3a475866a88
Local-runs: none
Scope: packages/spec/src/api/protocol.zod.ts + ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx, ui/packages/plugin-chatbot/src/useAiModels.ts, ui/packages/app-shell/src/console/ai/AiChatPage.tsx

This is a delta on the round-1 record (PASS on 387c17942f91721ca9470a679578cc3225b920d8, comment 6891993315). Everything that record judged and this one does not name stands as written there.

Read: the round-1 record, the delta 387c1794..098d07e5 (two commits, four files: protocol.zod.ts, ChatbotEnhanced.tsx, the regenerated protocol.mdx, the picker's pin file), card #33660 and its 4 comments, the current PR body, and the check-runs on the head. useAiModels.ts and AiChatPage.tsx are unchanged in the delta and were re-read at the head only where the changed picker meets them. The pin file and protocol.mdx are the lane seat's ACCEPT at TIER_DEFAULT. Nothing of the tree was built or run; the rounding cases in ④ were worked through from the two expressions as written, with the arithmetic checked in a standalone node -e that loads nothing from the repository.

Check-runs on the head at 2026-11-15T09:37Z: 68 runs, all completed: 59 success, 9 skipped, 0 failed, 0 in progress. Green: Build Core / Docs / UI Deps, every Lint family, every Type Check family, Test Core 1/8 to 8/8, Test UI 1/16 to 16/16, Build & E2E UI, Live E2E UI, Check Changeset, Spec property liveness, Governed Surface Queue Guard, PR-body guards, Dogfood Regression Gate. The 9 skipped are opt-in or queue-only jobs. Round 1 left the gate verdicts open; they are in now, and green.

① Derived judgments

  • The published shape does not move in the delta. costMultiplier is still z.number().positive().optional(); only its .describe() text changes. The accept-set is the one round 1 judged.
  • No exported symbol is added. drawnMultiplierOf and EXPENSIVE_MODEL_MULTIPLIER are module-private; ChatbotModelOption and ChatbotEnhancedProps are untouched.
  • Metadata-protocol: none: still right. Spec property liveness is green on the head.
  • One behaviour edge moves, and it is the one S2 asked for: a multiplier of 19.995 up to 20 now asks before applying. It is drawn ×20, so the changeset's "a pick at ×20 or above asks" is still a true sentence.

② Semver level

  • Clause-②: yes (widening) and Metadata-protocol: none still stand line-initial in the PR body and in the changeset at the head. The delta does not touch the changeset.
  • patch on all five packages still holds: the delta adds no surface, removes none, and a describe-text change takes no level of its own.

③ Boundary flags

  • Cloud producer card: still owed by the seat, Blocked-by AI model picker: carry each model's cost multiplier to the browser, show it per model, and confirm before switching to an expensive model #33660 (the card's priority comment names cloud#4537). Of the two sentences round 1 asked it to carry, the first (divide by the default model's weight; the default: true entry carries 1) is now in the spec's describe, so the cloud card can cite the schema instead of restating it. The second (finite positive or absent, never 0 or null) is the schema itself.
  • The PR body is behind the head. Its "What changes" still quotes the round-1 describe ("default model (1)", "from the model's cost weight"), describes the threshold on the served value and not on the drawn one, and its verification block names heads 0fcd2cfd and 387c1794. This record judges the tree. Bringing the body up to the head is the seat's; PR-body guards is green.
  • All other round-1 flags (i18n in 11 packs, the two unchanged hosts, the docs bullet, narrowed local suites, "asks once" per pick, the line budget) are untouched by the delta and stand.

④ Design judgment

packages/spec/src/api/protocol.zod.ts: S1 closes. Sentence by sentence against the picker:

  • "Factor by which one message on this model draws on the AI allowance, compared with one message on the environment's default model: 20 means one message here uses as much allowance as 20 on the default." The dialog says "Each message on this model uses N times as much of your AI allowance as one on the default model", and the note says "A model marked ×N uses it N times as fast as the default model". Same quantity, same reference model.
  • "Normalised to the default: the entry with default: true carries 1, and every other entry carries its model's cost weight divided by the default model's cost weight." This is the contract round 1 asked for. The parenthesis is gone, and "from the model's cost weight" can no longer be read as the raw weight: the division is spelled out. With a haiku-scale cost_weight and a non-haiku default, a producer that follows this sentence keeps the picker's sentences true.
  • "Written by cloud service-ai's GET /api/v1/ai/models; absent when the service reports none, and then nothing is shown for it." The producer is still named (ADR-0049), and absence still means what the picker does.
  • nit: the sentence does not say whether the default: true entry may omit the member while other entries carry it. The picker handles either; the cloud card can settle it.

ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx: S2 and S3 close; one new should-fix and two nits.

S2. One function, drawnMultiplierOf, now feeds the ×N text, the dialog's number, the note's condition and the threshold test, so what is drawn and whether the person is asked cannot disagree. Tried against it:

  • exactly 20: drawn ×20, asks.
  • 19.995: 19.995 * 100 rounds to 2000, drawn ×20, asks. 19.996 and 19.99500001: the same.
  • 19.9949 and 19.994: drawn ×19.99, apply at once.
  • 0.004: drawn ×0.004. 0.0045: ×0.0045. 0.5, 0.1, 0.01, 0.001: drawn as written.
  • the seam at 1: 0.995 is drawn ×0.99, 0.996 is drawn ×1, 1.005 is drawn ×1. No value near the seam is drawn ×0 or misses a digit.
  • below 1 the spelling asks for 1 - floor(log10(n)) fraction digits. For a two-significant-digit value that is exactly the digits it has, and an imprecise log10 at a power of ten can only ask for one digit more, never one fewer.
  • 0, a negative, NaN, Infinity: undefined, nothing drawn, never asks.
  • nit: the far ends. A finite multiplier above about 1.8e306 overflows n * 100, is drawn ×∞, and asks (the safe side). 1e21 is spelled ×999,999,999,999,999,900,000. A multiplier below about 5e-21 needs more than the 20 fraction digits the spelling is capped at and is drawn ×0, so the helper's "never reads ×0" is not literally true. No cost-weight ratio comes near any of these; no effect on the contract.

S3. The pending pick is now an id, and the model is read from the current list on every render.

  • Confirm after the list changes (reorder, relabel, a new multiplier): the dialog shows the current entry and Confirm writes an id that is in the list. The outside-item case round 1 described cannot happen.
  • Cancel, Escape and an outside dismiss: onOpenChange(false) clears the id and writes nothing, as before.
  • The pick leaves the list: confirming is undefined, the dialog closes, and the id is cleared in render (the documented adjust-state-during-render shape, guarded so it cannot loop). If the model comes back, the question does not reopen on its own.
  • Two entries with one id: the first is used; the id written is the same either way.
  • should-fix (new, low): a pick that stays in the list but stops being expensive stays asked. The delta drops the pick only when the model leaves the list. If a relist keeps the model and lowers its multiplier below 20, the question stays open, with a true but no longer required sentence. If the relist takes the multiplier away, the body falls to ?? 0 and reads "uses 0 times as much", which is false. Round 1's snapshot could not reach this; the re-resolve can. Clear confirmingId when the current entry's drawn multiplier is below the threshold, the same way as when it leaves. The list is fetched once per pane, so this is as rare as S3 was. Not a must-fix.

Round-1 nits:

  • Closed: the picker trusts costMultiplier from a direct host. drawnMultiplierOf now refuses a non-number, a non-finite value and a non-positive one itself, so a host that feeds models without useAiModels draws nothing for them. The pin file covers NaN, Infinity and 0.
  • Open, nit: the ×N span is still inside ItemText.
  • Open, nit: /ai/usage is still read by two hook instances where the dock's ring is mounted.

ui/packages/plugin-chatbot/src/useAiModels.ts: unchanged, still agrees. costMultiplierOf and drawnMultiplierOf refuse the same values, so the hook and the picker cannot disagree about which model has a multiplier.

ui/packages/app-shell/src/console/ai/AiChatPage.tsx: unchanged, still agrees. It enables useAiUsage on "some model carries a multiplier"; the picker's note now keys on "some model has a drawn multiplier". Behind the hook the two are the same set.

No must-fix. S1, S2 and S3 are closed. One new low should-fix in the picker, and nits; none changes the published shape.

Implemented-by: claude/project-thread-cv4ljj
Reviewed-by: session_01FEkQ5oF8GgTHN2jBZoDwz8

VERDICT: PASS

claude and others added 3 commits November 15, 2026 09:49
…lls below x20 or goes

The question reads the model from the current list; when that list no
longer draws it at x20 or above, the pick is dropped like one whose
model left the list.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pX4G6G9ZLeRqSRoFu
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 35f32c7f10b97cd250404ebba7789823d18e4efc
Local-runs: none
Scope: packages/spec/src/api/protocol.zod.ts + ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx, ui/packages/plugin-chatbot/src/useAiModels.ts, ui/packages/app-shell/src/console/ai/AiChatPage.tsx

This is a second delta, on delta record 1 (PASS on 098d07e5477e2aadd128431142cbb3a475866a88, comment 6892455683), which is itself a delta on the round-1 record (PASS on 387c17942f91721ca9470a679578cc3225b920d8, comment 6891993315). Everything those two records judged and this one does not name stands as written there.

Read: both earlier records in full, the delta 098d07e5..35f32c7f (two commits, 4d3ccb7c and 35f32c7f; two files: ChatbotEnhanced.tsx and the picker's pin file), card #33660 and its 4 comments, the current PR body, and the check-runs on the head. protocol.zod.ts, useAiModels.ts, AiChatPage.tsx and the changeset are unchanged in the delta. ModelPicker was re-read whole at the head. The pin file is the lane seat's ACCEPT at TIER_DEFAULT; it was read here only to judge whether its new pins hold the guard. Nothing of the tree was built or run: the ablation judgment in ④ is by reading, not by a run.

Check-runs on the head at 2026-11-15T10:21Z: 68 runs, all completed: 59 success, 9 skipped, 0 failed, 0 in progress. Green: Build Core / Docs / UI Deps, every Lint family, every Type Check family, Test Core 1/8 to 8/8, Test UI 1/16 to 16/16, Build & E2E UI, Live E2E UI, Check Changeset, Spec property liveness, Governed Surface Queue Guard, PR-body guards, Dogfood Regression Gate. The 9 skipped are opt-in or queue-only jobs.

① Derived judgments

  • The published shape does not move in the delta. No file under packages/spec is touched; costMultiplier is still z.number().positive().optional() with the describe delta 1 judged.
  • No exported symbol is added or changed. The delta is inside the module-private ModelPicker: two new locals (listed, listedDrawn) and a narrower confirming. ChatbotModelOption and ChatbotEnhancedProps are untouched.
  • Metadata-protocol: none: still right. Spec property liveness is green on the head.
  • One behaviour edge moves, and it is the one delta 1 asked for: an open question now closes, writing nothing, when the current list no longer draws the asked model at ×20 or above. No pick that asked before applies without asking now, and no pick that applied at once asks now.

② Semver level

  • Clause-②: yes (widening) and Metadata-protocol: none still stand line-initial in the PR body and in the changeset at the head. The delta does not touch the changeset.
  • patch on all five packages still holds: the delta adds no surface and removes none.

③ Boundary flags

  • The PR body is still behind the head. Read at 2026-11-15T10:21Z (GitHub's updated_at on the PR is 09:51:45Z, the time of the last push); it may still be updated after this read. All three points delta 1 named stand unchanged:
    • "What changes" still quotes the round-1 describe: "default model (1)" and "from the model's cost weight";
    • the threshold is still described on the served value ("a pick at ×20 or above"), with no word that the drawn, rounded value is what is compared;
    • the ablation line still names head 0fcd2cfd, and the verification block still names 387c1794. No commit after 387c1794 (ba111fd5, 098d07e5, 4d3ccb7c, 35f32c7f) is named anywhere in the body.
    • One more, of the same kind: the "Tests" section does not list the pins added since round 1 (the drawn-value edge, the re-resolved pick, the dropped pick).
      This record judges the tree. Bringing the body up to the head is the seat's; PR-body guards is green.
  • Cloud producer card: still owed by the seat, Blocked-by AI model picker: carry each model's cost multiplier to the browser, show it per model, and confirm before switching to an expensive model #33660, as delta 1 left it.
  • All other flags of the two earlier records are untouched by the delta and stand.

④ Design judgment

ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx: the delta-1 should-fix closes, in both cases.

confirming is now the current entry for the asked id only when drawnMultiplierOf of that entry is at or above EXPENSIVE_MODEL_MULTIPLIER. Otherwise it is undefined, the dialog's open is false, and the id is cleared in render.

  • Falls below the threshold (a relist keeps the model at, say, ×5): listedDrawn is 5, confirming is undefined, the question closes and nothing is written. Closed.
  • Multiplier withdrawn (absent, or a value that is no multiplier): listedDrawn is undefined, the same path. The "uses 0 times as much" sentence can no longer be drawn: the dialog's content is rendered only while confirming is set, and that now implies a drawn multiplier of at least 20. Closed.
  • Stays expensive at a new value (×20 becomes ×40): the question stays open and states ×40, the number the list draws now. Right.
  • One predicate on both sides. The pick handler asks on (drawnMultiplierOf(picked) ?? 0) >= EXPENSIVE_MODEL_MULTIPLIER; the render keeps the pick on the same function and the same constant. A pick the handler accepts cannot be dropped by the next render of the same list.
  • The dropped pick is not applied and does not come back. The person keeps the model in force and picks again if they still want the other one. That is the safe side, and it is what the leave-the-list case already did.

Loop safety of the render-time adjustment:

  • The line is if (confirmingId !== null && confirming === undefined) setConfirmingId(null). After it fires, confirmingId is null and the first term is false, so it fires at most once per drop: one extra render, then quiet.
  • The new condition is derived from props and state only (models, confirmingId), with no ref, no effect and no value that changes between two renders of the same input. It cannot alternate.
  • It is the documented adjust-state-during-render shape, on the component's own state, as delta 1 judged it. The delta widens when it fires, not how.

The new pins, read against the guard:

  • it.each over "falls below ×20" (5) and "is withdrawn" (undefined): pick Expert, see the dialog, relist with Expert's multiplier changed, wait for the dialog to go, relist the original list, assert no dialog and no write.
  • Revert the guard (confirming back to the listed entry alone): in both cases the model is still in the list, so the dialog stays open and waitFor(... queryByRole('alertdialog') toBeNull) times out. Both cases turn red. On 098d07e5 the withdrawn case is exactly the "0 times" dialog delta 1 described.
  • Keep the narrowed confirming but remove the clearing line: the dialog closes, the first wait passes, and the relist back to ×20 reopens it, so the second toBeNull turns red. The pin holds the clearing as well as the closing.
  • The pins are behavioural: they drive the rendered Select and AlertDialog and read no source text.
  • 35f32c7f only renames the second case's title ("is withdrawn"); no assertion moves.

Nits, none on the contract:

  • listedDrawn ?? 0 is now a dead fallback at both dialog call sites: inside confirming ? (...) the value is always a number of at least 20.
  • Two entries with one id and different multipliers. The handler reads the picked entry by index; the render reads the first entry with that id. If the first is below ×20 and the picked one is not, the pick is dropped at once: no question, no write. A list with a repeated id is the host's error, and the outcome is the safe one.
  • The two nits delta 1 left open (the ×N span inside ItemText; /ai/usage read by two hook instances) and the far-ends nit are untouched.

packages/spec/src/api/protocol.zod.ts, ui/packages/plugin-chatbot/src/useAiModels.ts, ui/packages/app-shell/src/console/ai/AiChatPage.tsx: unchanged in the delta, still agree as delta 1 wrote.

No must-fix and no should-fix. The delta-1 should-fix is closed in both of its cases and pinned. What remains open is the PR body (③) and nits; none changes the published shape.

Implemented-by: claude/project-thread-cv4ljj
Reviewed-by: session_01FEkQ5oF8GgTHN2jBZoDwz8

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

席位核对

Verdict: ACCEPT · head 8e2c2d79 · 2026-11-15T10:52Z

  1. Shape. Draft → main, Fixes #33660. 21 files, +802/−27:

    • Spec: AiModelsResponseSchema items gain costMultiplier (z.number().positive().optional()), with a describe that states the default-is-1 normalisation. protocol.mdx is regenerated and there is a spec pin.
    • plugin-chatbot: ChatbotModelOption.costMultiplier and ChatbotEnhancedProps.allowanceUsedFraction. The picker draws ×N, asks before a pick at a drawn ×20 or above, and shows the allowance note. useAiModels carries the member through.
    • AiChatPage.tsx: host wiring.
    • 11 locale packs, the plugin-chatbot.mdx sentence, two rendered pin files and one root changeset.

    All of it is on the claimed surface.

  2. Premise and fix. The model picker gave no sign of what a model costs, and a person could switch to an expensive model without seeing what it draws. A model's multiplier is now drawn beside it, and a pick at ×20 or above asks first, saying how much of the allowance is left when usage is served. Only the published /api/v1/ai/models member feeds this. The producer is cloud service-ai (cloud#4537, named on the card).

  3. Declarations. Clause-②: yes (widening) on @objectstack/spec and @object-ui/plugin-chatbot, Metadata-protocol: none, patch: right.

    • Contract records at CONTRACT_REVIEW_TIER, each tier-verified and posted with tier evidence:
      • round 1: PASS 6891993315 on 387c1794;
      • delta 1: PASS 6892455683 on 098d07e5;
      • delta 2: PASS 6892921764 on 35f32c7f.
    • All four should-fixes (S1 to S3 and the delta-1 dropped-pick case) are closed in-tree, with ablations red on 4d3ccb7c.
  4. Left as nits, not filed. These are under the filing gate: no producer is affected and no person can see a wrong result.

    • the ×N span sits inside ItemText;
    • /ai/usage is read twice where the dock's ring is mounted;
    • the far-end spellings (multipliers below 5e-21 or above 1.8e306);
    • the dead ?? 0 fallback;
    • the same-id duplicate entries.
  5. PR body. It now describes the head: the drawn-value threshold, the drop rule and the pins added since round 1. The patch went through the relay issue_patch.

  6. Serial. The seat's Chat answer source block: render dataset provenance (metric and dataset) from query_dataset, not only ObjectQuerySource #33734 holds its local fix (ChatbotEnhanced.tsx type line, useChatConversation write-back) until this merges, then rebases.

  7. Gates on head 8e2c2d79 (the seat's merge of main into 35f32c7f): every check run is success or skipped. The dev's local run on 35f32c7f:

    • 115 derived gates, all exit 0, and --ran reconciles;
    • suites: 829 files, 7593 passed;
    • spec: 256 passed.
  8. K. It was 24 at 10:21Z, so the base was synced at the same time (8e2c2d79). Path face: spec-touching; the contract-review leg is filled above.

  9. Authority. Landing under the maintainer's standing authorisation 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 10:52
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH

Contract-review-claim: session_016WV4cy7hQ5MvQ83ByNZ8ZH · head 8e2c2d7 · 2026-11-15T11:36:03Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 8e2c2d79aa60284f45e012e73553d1bb53f83072
Local-runs: none
Scope: packages/spec/src/api/protocol.zod.ts + ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx, ui/packages/plugin-chatbot/src/useAiModels.ts, ui/packages/app-shell/src/console/ai/AiChatPage.tsx

This is a delta on delta record 2 (PASS on 35f32c7f10b97cd250404ebba7789823d18e4efc, comment 6892921764), which stands on delta record 1 (comment 6892455683) and the round-1 record (comment 6891993315). Everything those three records judged and this one does not name stands as written there. Claim: comment 6893721131.

Why a record and not a Regen-provenance: line: the head is the seat's merge of main (7844272c) into 35f32c7f, and main changed one file of the scope, AiChatPage.tsx (#33727). That is neither a pure regeneration nor a prose-only move, so the earlier record does not carry by itself.

Read: the three earlier records in full and the seat's ACCEPT (comment 6893248551); the head's two parents and merge base (5604aeb0); the PR's own diff before and after the merge; the 24 commits main gained between the merge base and 7844272c, by file list, and its diff to AiChatPage.tsx in full; AiChatPage.tsx, ChatbotEnhanced.tsx and protocol.zod.ts at the head where the two sides meet; the PR body, the changeset, and the check-runs on the head. Nothing of the tree was built or run; the merge and the diff identity were read from git objects only.

What the merge is, measured:

  • The head has exactly two parents, 35f32c7f (the head delta 2 judged) and 7844272c (the PR's base).
  • A fresh three-way merge of those two parents is clean and writes tree 72e8c4b5, which is the head's tree. The merge commit carries no hand edit.
  • The PR's own diff is byte-for-byte the one delta 2 judged: 5604aeb0..35f32c7f and 7844272c..8e2c2d79 have the same stable patch-id (2abc1a0e), 21 files, +802 and -27 on both sides.
  • Of the PR's 21 files, main touched one between the merge base and 7844272c: AiChatPage.tsx. It did not touch protocol.zod.ts, anything under packages/spec/src/api, ChatbotEnhanced.tsx, useAiModels.ts, useAiUsage.ts, the i18n packs, or either docs page.

Check-runs on the head at 2026-11-15T11:35Z: 73 runs, all completed: 62 success, 11 skipped, 0 failed. The 11 skipped are opt-in, queue-only or schedule jobs (the upgrade harness, the packed-tarball smoke, the queue verdicts, Temporal Conformance, UI Published Artifacts, Auto Label, Check PR Size, the Dogfood CLI and matrix placeholders, the schedule gate).

① Derived judgments

② Semver level

  • Clause-②: yes (widening) and Metadata-protocol: none stand line-initial in the PR body and in the changeset at the head. The merge does not touch the changeset.
  • patch on all five packages still holds: the merge adds nothing to this PR's surface.

③ Boundary flags

④ Design judgment

ui/packages/app-shell/src/console/ai/AiChatPage.tsx: the two sides do not interact; still agrees.

  • Different lines, different values. main's side adds the hand-off hook above AiChatPage, one ChatPane prop, one call in ChatPane (noteComposerInput, next to the split-pane hook) and one prop on the rendered ChatbotEnhanced (onInputChange). The PR's side adds the useAiUsage import, the useAiUsage call with the derived allowanceUsedFraction (right after useAiModels), and one prop on the same element (allowanceUsedFraction). No identifier is shared, and neither side reads a value the other writes.
  • useAiUsage is enabled on the same condition as before: some entry of aiModels carries costMultiplier. main changed neither useAiModels nor useAiUsage, so the condition and the fraction are computed from the same inputs delta 2 judged.
  • Hook order is safe. Both calls are unconditional at the top level of ChatPane, and there is no early return before either. main's call is placed before the PR's; each render makes both, in the same order.
  • The two new props on ChatbotEnhanced are independent. onInputChange already existed on ChatbotEnhancedProps before this PR and the PR's diff does not touch it: it is handed to the composer's input. allowanceUsedFraction is handed to the model picker. main's callback takes no argument and only records which conversation the host was asking for; it reads nothing of the model, the usage or the picker.
  • The hand-off does not reach the picker. It reads and writes the composer textarea (textarea[name="message"]) at mount and unmount of a pane. The picker's question is an AlertDialog and holds no textarea of that name, so the hand-off cannot carry or clear a pending model pick, and an open question does not change what the hand-off carries.
  • A pane remount (the case fix(console): AI chat keeps a draft typed before the conversation is known, and gives back a send held when a linked conversation fails to load #33727 is about) leaves this PR's behaviour as judged. The pending pick is the picker's own state, so a remount closes an open question and writes nothing, which is the safe side delta 2 already named for a dropped pick. useAiUsage re-reads on the new pane as any hook does.

packages/spec/src/api/protocol.zod.ts, ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx, ui/packages/plugin-chatbot/src/useAiModels.ts: unchanged by the merge, byte for byte in the PR's diff; still agree as delta 2 wrote.

No must-fix, no should-fix and no new nit. The PASS of comment 6892921764 carries to this head.

Implemented-by: claude/project-thread-cv4ljj
Reviewed-by: session_016WV4cy7hQ5MvQ83ByNZ8ZH

VERDICT: PASS

Merged via the queue into main with commit 0feb5ff Nov 15, 2026
73 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-cv4ljj branch November 15, 2026 11:50
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
… which dataset and metrics it used (objectstack-ai#33870)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XTfnpANDWSRVQfEQTS9xCwV)_

Fixes objectstack-ai#33734

Clause-②: yes (widening)
Metadata-protocol: none

Seat `domain:ui#2` · os-project-manager · card thread
`session_01FEkQ5kWtEXh64E1jg6WPCD` · claim 6892143272

## 维护者速读

- 改了什么:AI 对话里答案下方折叠的「计算方式」块,过去只认对象查询(`query_records` 等)的 `source`;现在 AI
通过 `query_dataset`
按指标回答时,同一位置显示所用的数据集、每个指标(名称旁附机器名与口径说明)、分组维度和问题追加的筛选条件。对象查询的显示完全不变。
- 为什么改:ADR-0149 D3 规定指标答案的来源从工具返回的 `provenance` 块渲染,规格
`DatasetProvenanceSchema` 也写明「An answer renders its source from this
block」,但界面一直只读 `source`,指标答案没有结构化来源块(cloud PR objectstack-ai#4557 的发现)。
- 风险与回滚:纯前端读取与显示;`detectAnswerSource` 的返回类型与导出类型 `AnswerSource`
放宽为两种来源的联合类型(Clause-② 放宽,见下)。浏览器缓存重载时数据集来源写回 `provenance` 键。回滚即还原本 PR。
- 先看:ui/packages/plugin-chatbot/src/AnswerSource.tsx(新增
`DatasetSourceSection`;对象查询的筛选渲染抽成共用的
`AnswerSourceFilter`,输出不变)、ui/packages/plugin-chatbot/src/mapMessages.ts(`detectAnswerSource`
先读
`provenance`)、ui/packages/app-shell/src/hooks/useChatConversation.ts(缓存写回键)。
- 两分钟验证:在已接入 `query_dataset`
的环境问一个指标问题(如「本月营收多少」),展开答案下的「计算方式」:应看到「数据集」「指标」「分组依据」「筛选条件」四行;问一个普通记录问题,块内容与今天相同。
- 需要你做的:无,席位落地(Clause-② 放宽,席位先补契约复审记录)。

## What changes

- **Lift.** `detectAnswerSource` (`mapMessages.ts`) reads a tool
result's top-level `provenance` through `DatasetProvenanceSchema` first,
then the object-query `source` through `ObjectQuerySourceSchema`, as
before. Each is the schema's parse: an undeclared key is stripped, and a
block the schema refuses is no block. `query_dataset` answers only
`provenance`; the object-query tools answer only `source`.
- **Draw.** `AnswerSource.tsx` gains `DatasetSourceSection`, chosen by
the block's `kind: 'dataset'`:
- **Dataset**: the dataset's label (its name where the label is empty);
- **Metrics**: each measure's label, with its name beside it when the
two differ, and its `description` (the business definition ADR-0149 D1
asks for) under it when declared; the name alone where the label is
empty;
  - **Grouped by**: the dimensions' labels, when any were selected;
- **Filter**: `runtimeFilter` lowered to rows exactly as the
object-query filter is (now one shared `AnswerSourceFilter`), or drawn
as served when it does not lower; with no `runtimeFilter`, "No filter
added to the dataset definition", because the dataset's own `filter`
still applies and is never served (the schema says so), so "All records"
would be false.
- No "Only records visible to you" line: the provenance block carries no
scope member, and the block states only what the producer sent.
- **Object-query rendering is unchanged.** `AnswerSourceSection` draws
the same rows, test ids and words; the filter markup moved into
`AnswerSourceFilter` byte for byte. The 31868 pin file passes unchanged.
- **Cache.** `sanitizeChatMessagesForCache` (`useChatConversation.ts`)
writes a dataset lift back under `provenance` (the producer's key), an
object-query lift under `source` as before, so both hydration paths lift
it again on reload.
- **Types.** `AnswerSource` is now declared in `mapMessages.ts` as
`ObjectQuerySource | DatasetProvenance` and re-exported from `index.tsx`
under the same name.
- **Strings.** `chatbot.answerSource.dataset`, `metrics`,
`noAddedFilter` in all 11 packs (`all-locales-key-parity`); zh-Hant
generated from zh-Hans (`gen:zh-hant`). "Grouped by" and "Filter" reuse
the existing keys.
- **Docs.** One sentence in
`content/docs/frontend/plugins/plugin-chatbot.mdx` beside the paragraph
that describes the block (seat amendment 2).
- **Published surface, each a `Clause-②: yes (widening)` on
`@object-ui/plugin-chatbot`:**
- `detectAnswerSource`'s return type: `ObjectQuerySource | undefined` →
`AnswerSource | undefined`;
- the exported type `AnswerSource`: was `ObjectQuerySource`, now
`ObjectQuerySource | DatasetProvenance`;
- `ChatbotEnhancedToolInvocation.answerSource` (in
`ChatbotEnhanced.tsx`, the one type line the seat approved):
`ObjectQuerySource` → `ObjectQuerySource | DatasetProvenance`;
- `AnswerSourceBlockProps.sources[].source` (package-internal, not
exported from the entry): the same union.
- A consumer that reads `object` / `filter` / `scope` off an
`AnswerSource` narrows on `kind` first. In this repository the only
consumer outside the package, `useChatConversation.ts`, does.
- Changeset `.changeset/33734-answer-source-dataset-provenance.md`:
`@object-ui/plugin-chatbot`, `@object-ui/i18n`, `@object-ui/app-shell`,
`@object-ui/console` patch (a widening with `Metadata-protocol: none`
ships `patch`; app-shell is private and console's `dist` ships it).

## Tests

-
`ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.answerSource-dataset-33734.test.tsx`
(turns built from wire parts through `uiMessageToChatMessage` and drawn
by the real `ChatbotEnhanced`, the block opened by clicking its rendered
trigger). The fixture is a `query_dataset` answer
`QueryDatasetOutputSchema` accepts (asserted):
- the lift returns the provenance alone, an undeclared key and the rows
stripped; a provenance the schema refuses (wrong `kind`, string
`measures`, string `dataset`) lifts nothing;
- a `query_dataset` answer shows the dataset, each metric (label, name
beside it, description), the grouping and the filter rows; no
object-query section, no scope line, nothing of the rows or args;
- no `runtimeFilter` and no dimensions: the "no filter added" line, no
grouping row, never "All records";
  - a nested filter is drawn as served;
- a turn with a dataset answer and an object-query answer: one block,
both sections, in call order;
- CONTROL: an object-query answer draws as today (object, filter row,
records, scope) with no dataset section;
  - CONTROL: a `query_dataset` refusal (no provenance) draws no block;
  - the shipped zh pack (数据集 / 指标).
-
`ui/packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx`:
a `query_dataset` provenance survives sanitize, JSON round-trip and both
hydration paths (`hydratedMessagesToChatMessages`,
`uiMessageToChatMessage`), and the cached part's `output` is `{
provenance }`.
- **Red first** on base bd96ec9 (production files restored to base,
tests at head): 7 failed / 84 passed; every positive pin red (the
rendered ones: "Unable to find ... button ... How this was computed";
the lift: "expected undefined to deeply equal { kind: 'dataset', ...
}"); the controls and the refused-provenance pin green, as they must be.
Head: 91/91 over the new file, the 31868 file and
`useChatConversation.test.tsx`.
- **Ablations** through `scripts/ablation-replace.mjs` (ui vitest
aliases `@object-ui/plugin-chatbot` to `src`, no rebuild), each mutation
landing on disk, each restored with the blob equal to HEAD and `git diff
HEAD` empty, running the same three files (91 tests):
- the lift ignores `provenance`: 7 failed — every dataset pin and the
reload pin;
- no dataset section (the branch ANDed with an always-false term): 5
failed — every rendered dataset pin;
- cache writes a dataset lift under `source`: 1 failed — the reload pin;
- metric name beside the label dropped: 1 failed — the "shows the
dataset, each metric" pin;
- CONTROL leg, every block routed to the dataset section: 8 failed — the
new object-query CONTROL, the mixed-turn pin and six 31868 object-query
pins;
- CONTROL leg, the empty-turn guard removed: 6 failed — the
no-provenance CONTROL, the 31868 "no source draws no block" pin and the
off-contract pins.

## Acceptance notes

- **Not delivered: the "non-metric reading" label on a fallback.**
`DatasetProvenanceSchema` has no member that marks a fallback (`kind` is
only `'dataset'`). Per ADR-0149 D3 rule 4 a fallback answer is an
object-query answer (`query_records` / `aggregate_records`), and its
「非指标口径」 words are the producer's, inside `source.line`, which today's
block does not draw. Labelling every `ObjectQuerySource` block would
mislabel plain record reads and change the object-query rendering this
order froze. The seat ruled the leg out of this PR and files the
follow-up (it needs a producer or spec marker first).
- The metric's `description` is drawn because it is the sentence
ADR-0149 D3 says explains what the number includes; the order listed
label, dataset and filters.
- No scope line on a dataset section: the provenance carries none. The
dataset query runs under the caller's context, but the block does not
state what the producer did not send.
- `ChatbotEnhanced.tsx`: two lines only (the type import and the
`answerSource` member type), approved by the seat; this branch is
rebased onto main after objectstack-ai#33746 merged, as the seat ordered.

## Verification

<details><summary>Local gates, type-check, lint and suites</summary>

- Head ee612b4 (rebased onto 4b5024d after objectstack-ai#33746 merged; the rebase
was clean). `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derives 71 families for this diff. All 71
exit 0 on ee612b4, run sequentially after rebuilding the spec, formula,
client, lint, sdui-parser and client-react closures and the
`@object-ui/app-shell^...` closure (lock VERDICT command-exit 0).
`--ran`: 71 derived, 71 run, 0 NOT-MEASURED.
- Suites under the lock, from `ui/` with `--maxWorkers=2`:
`packages/plugin-chatbot/` + `packages/i18n/` 203 files, 2878 passed, 13
skipped; `packages/app-shell/src/hooks/` +
`packages/app-shell/src/console/ai/` 153 files, 1255 passed.
- `pnpm run type-check` in `ui/packages/plugin-chatbot`,
`ui/packages/i18n` and `ui/packages/app-shell`: exit 0 each.
- ESLint on the changed source, test and locale files: 0 errors; the 58
warnings are all on lines this diff does not touch
(`react-refresh/only-export-components` and friends in `index.tsx`,
`ChatbotEnhanced.tsx`, `useChatConversation.ts`). `pnpm
check:new-line-citations` (from `ui/`): exit 0.
- The same union was green on the pre-rebase heads (90a3f1ea for the 40
code families, ac1ae487 for the 31 docs families).
- `origin/main` moved 8 commits after 4b5024d (to c87e2ad), among them
objectstack-ai#33801, which adds `chatbot.tool.list_datasets` / `query_dataset` labels
to the same eleven packs in another block, and the 18.5.0
version-packages commit. `git merge-tree` of HEAD with c87e2ad is
clean; the full app-shell suite and the rest of the farm are CI's.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5kWtEXh64E1jg6WPCD

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5kWtEXh64E1jg6WPCD)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…LOG line, and an 18-5 page erratum (objectstack-ai#34042)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9EaC9kmPYBDw3v97tMkTaQu)_

Fixes objectstack-ai#33903

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:18.5.0 已发布但发布说明漏记的 11 条变更,补进 14 个包的 CHANGELOG 18.5.0 节(私有包
app-shell 补在它这次发的 18.4.1 节),删掉这 11 个 changeset 文件,并在 18-5 发布页加一节勘误。
- 为什么改:18.5.0 的版本提交 `b914e724` 没有消化这 11 个 changeset,代码已随 18.5.0 发出,但
CHANGELOG 和发布页都没写;其中 objectstack-ai#33637 是破坏性变化(`os audit verify` 遇到被两个 checkpoint
同时列出的行,现在报 `listed_twice` 并失败)。按裁决 6896138728「事后补就可以」只做补记。
- 风险与回滚:纯文字,不发布代码;删掉的 changeset 若留着,下一个版本会把它们当新变化再发一遍。回滚即 revert 本 PR。
- 先看:`content/docs/releases/v18/18-5.mdx`
的勘误节;`packages/plugins/plugin-audit/CHANGELOG.md`(破坏性那条);`packages/spec/CHANGELOG.md`(两条,其中一条进
Minor Changes)。
- 两分钟验证:`git grep -c -E '^-
(ac0b9a5|2e1e3b9|fbe349f|2673f59|0feb5ff|1e65a38|e302d32|f8f35db|e0775f7|4b5024d|81371e1):
' -- '*CHANGELOG.md'` 预期 14 个文件共 18 行;`ls .changeset/*.md | wc -l` 比
main 少 11。
- 需要你做的:无,席位落地(Check Changeset 会按规则保持红色,见下方 DELIBERATE CORRECTION)。

## What changes

`packages/*/CHANGELOG.md` and `content/docs/releases/` are
release-owned. AGENTS.md (Documentation Guardrails) routes a factual
error in a released entry, or on a releases page, to a dedicated
docs-only PR, and the maintainer's ruling on this card (comment
6896138728, verbatim: 「没必要,事后补就可以:让发布流程在版本提交之前还有没消化的 changeset
时,拒绝发正式版。」) keeps only the amendment half. This is that PR. Precedent:
objectstack-ai#33925.

The 18.5.0 version commit `b914e724` (objectstack-ai#33097) consumed 283 of the 294
changesets on its parent. The other 11 landed on `main` after the
Version Packages branch point `b76df9a6` and before the merge; each
one's adding commit is an ancestor of `b914e724`, and its file is
byte-identical on `b914e724` and on this branch's base `bc6b7ffd`.

1. **CHANGELOG entries.** Each changeset's entry is added to the release
section `b914e724` wrote for each package it names, in the stock
generator's form (`- SHA7: ` + the summary, continuation lines indented
two spaces), under the commit that added the changeset, in the `###
Minor Changes` or `### Patch Changes` list its bump names, after the
last changeset entry and before the `Updated dependencies` lines. No
dependents line is invented.
2. **The 11 changeset files are deleted**, so the next version commit
does not present them as new.
3. **The 18-5 page** gains `## Erratum — eleven changes 18.5.0 shipped
with no CHANGELOG line [#erratum]`: objectstack-ai#33637's FROM → TO and what an
operator does, one line for each of the other nine, and a pointer from
the release-facts row that said 284 were consumed. objectstack-ai#33725 is already on
the page (自动迁移, "Announced, not yet at any door"); it is checked, not
repeated.

| Changeset | Package | Added to | Commit | 18-5 page |
| :--- | :--- | :--- | :--- | :--- |
| `31908-p4b2-bounded-checkpoints` | `@objectstack/plugin-audit` | `##
18.5.0` › Patch Changes | `ac0b9a5` (objectstack-ai#33637) | Erratum, breaking: FROM →
TO, what to do, rollback note |
| `33186-managed-add-people-actions` | `@objectstack/platform-objects` |
`## 18.5.0` › Patch Changes | `2e1e3b9` (objectstack-ai#33755) | Erratum, one line |
| `33609-related-list-parent-lookup-page` | `@object-ui/console`,
`@object-ui/plugin-detail` | `## 18.5.0` › Patch Changes | `fbe349f`
(objectstack-ai#33780) | Erratum, one line |
| `33649-messaging-preferences-emitting-organization` |
`@objectstack/service-messaging` | `## 18.5.0` › Patch Changes |
`2673f59` (objectstack-ai#33779) | Erratum, one line |
| `33660-ai-model-picker-cost-multiplier` | `@objectstack/spec`,
`@object-ui/plugin-chatbot`, `@object-ui/i18n`, `@object-ui/console`;
`@object-ui/app-shell` | `## 18.5.0` › Patch Changes; app-shell `##
18.4.1` › Patch Changes | `0feb5ff` (objectstack-ai#33746) | Erratum, one line |
| `33689-ai-action-confirmation-elicited` | `@objectstack/spec` | `##
18.5.0` › Minor Changes | `1e65a38` (objectstack-ai#33725) | Already covered (自动迁移
row), not repeated |
| `33724-install-relaxes-declared-not-null` | `@objectstack/driver-sql`,
`@objectstack/cloud-connection`, `@objectstack/driver-turso` | `##
18.5.0` › Patch Changes | `e302d32` (objectstack-ai#33769) | Erratum, one line |
| `33739-scenario-runner-effort` | `@objectstack/scenarios` | `##
18.5.0` › Patch Changes | `f8f35db` (objectstack-ai#33767) | Erratum, one line |
| `33753-scenario-dates-follow-run-date` | `@objectstack/scenarios` |
`## 18.5.0` › Patch Changes | `e0775f7` (objectstack-ai#33776) | Erratum, one line |
| `33754-scenario-grader-written-date` | `@objectstack/scenarios` | `##
18.5.0` › Patch Changes | `4b5024d` (objectstack-ai#33797) | Erratum, one line |
| `a2-skills-docs-32678-32825` | `@objectstack/skills` | `## 18.5.0` ›
Patch Changes | `81371e1` (objectstack-ai#33355) | Erratum, one line |

**DELIBERATE CORRECTION.** This PR adds no changeset and deletes eleven
(`git diff --name-status` over `.changeset/*.md`: 11 × `D`, 0 × `A`).
Each deleted note is already released: its text now stands, unchanged,
as the entry named in the table above, in the 18.5.0 tarballs' release
section. Under ruling D on objectstack-ai#18375 (the Check Changeset step's route 0)
and `.claude/agents/os-dev.md`, `skip-changeset` is not applied to a PR
that deletes an existing changeset, so `Check Changeset` stays red by
design; it is not a required context. The diff publishes nothing until
the next release republishes the tarballs.

## Tests

No source changes, so no test suite moves. The CHANGELOG lines are
generated, not hand-typed: the summary parse and the stock release-line
format were re-implemented in a script and first checked against
`b914e724^`: for every changeset `b914e724` consumed among the first 60
(103 package entries), the generated text is found verbatim in that
package's CHANGELOG; the only miss is `31908-p4b2-bounded-checkpoints`,
the unconsumed one this PR adds. The script asserts, per changeset, one
adding commit, an identical blob at the tag and at the base, the release
section being the top section of the version `b914e724` gave the
package, and the entry not already present. The diff of every CHANGELOG
is insertions only.

## Acceptance notes

1. `@object-ui/app-shell` is private and `b914e724` versioned it
`18.4.1`, not `18.5.0` (the 18-5 page's release facts say so too), so
its entry goes into its `## 18.4.1` section.
2. The 18-5 page still opens with "Release status: 18.4.0 is released,
and 18.5.0 is not yet." and its release facts say no 18.5.0 tag or npm
version exists. Both are stale since the publish. Outside this card's
file surface; left for the seat (noted, not filed).
3. The changeset of objectstack-ai#33649 has no summary line, so its entry opens `-
2673f59: Clause-②: no`, as the stock generator would have written it.

## Verification

<details><summary>Premise readings, at base bc6b7ff and the 18.5.0 spec
tag = b914e72</summary>

- `git ls-tree --name-only b914e72 .changeset/` minus `README.md` and
`config.json`: 11 files, the card's list. `b914e724^` holds 294;
`b914e724` deletes 283.
- For each of the 11: `git rev-parse b914e72:PATH` equals `git
rev-parse bc6b7ff:PATH`; the adding commit (`git log --diff-filter=A`,
one per file) is an ancestor of `b914e724` (`merge-base --is-ancestor`
exit 0, after deepening the shallow clone by 800 commits). The adding
commits all fall between `b76df9a6` (the Version Packages branch point
the 18-5 page names) and `b914e724`.
- Before this PR: `listed_twice`, `ac0b9a5`, `objectstack-ai#33637` each 0 hits on
`content/docs/releases/v18/18-5.mdx`.
- The erratum's wording is read from the changeset text and
`packages/plugins/plugin-audit/src/audit-seal/verifier.ts`
(`listed_twice` fault: `checkpoint N: lists row(s) … that another
checkpoint already lists`), `content/docs/deployment/cli.mdx` § `os
audit verify` (exit 1 when two checkpoints list the same row), and the
18.5.0 entry `f4cafd5` (a late checkpoint leaves out every row a
checkpoint stored in between already lists).
</details>

<details><summary>Gates</summary>

Head `f5754612`. Derived with `node scripts/pm/dispatch-gates.mjs
--commands --repo objectstack-ai/objectstack` (no paths): 99 commands,
each run with stdin from `/dev/null` and its exit captured before any
pipe; `--ran` reconciliation: 99 derived, 99 run, 0 NOT-MEASURED, 0
UNRUN.

- 98 exit 0. Eleven of them first exited 3 (PREREQUISITE NOT MET, no
`dist/` in a fresh worktree) and were re-run exit 0 after the builds
they name, each under `scripts/pm/os-verify-lock.sh` with VERDICT
command-exit 0: the `@objectstack/lint...` closure plus the `check:i18n`
extract closure (64/64 tasks), `@objectstack/client` and `client-react`
(43/43), then `pnpm build` (119/119). Re-run:
`check:doc-formula-expressions`, `check:doc-security-posture`, spec
`check:docs`, spec `check:skill-examples`,
`check:docs-transcript-drift`, `check:i18n`, `check:dts-closure`,
`check:dual-build-cjs-loads`, `check:lean-entry-closure`,
`check:sourcemap-no-sources-content`; and `pnpm --dir ui exec vitest run
scripts/`, which first failed 22 files only on the missing
`@objectstack/spec` `dist/` and then passed (171 files passed, 2
skipped; 5,065 tests passed).
- 1 exit 1, by design: `node scripts/check-empty-changeset.mjs --base
origin/main` refuses the eleven deletions as edits of existing notes
(one `::error` per file). This is the DELIBERATE CORRECTION class
declared above; it stays red, and so does `Check Changeset`.
- Release-text gates all exit 0 on the amended tree:
`check-release-section-coverage` (plain and `--strict`),
`check:release-notes`, `check:release-page-status`,
`check-affected-docs`, `check:doc-authoring`, `check:doc-anchors`,
`check:nul-bytes`, `check-adr-0087-registration --base origin/main`.

`origin/main` moved to `159757ab` while the gates ran; the commits since
the base `bc6b7ffd` touch none of this PR's paths (they add four other
changesets), so no merge was taken.
</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmPfCRZtZTTC4KzLjJR)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmPfCRZtZTTC4KzLjJR

<!-- signed: domain:devx#2 · os-steve · session_01ADHkmQTVjryTSkqydKVS6z
-->

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI model picker: carry each model's cost multiplier to the browser, show it per model, and confirm before switching to an expensive model

1 participant