Repository navigation
feat(spec, plugin-chatbot, console): the AI model picker shows each model's cost multiplier and asks before a ×20 pick - #33746
Conversation
…'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
📓 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:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 172 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 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
|
|
domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8 Contract reviewServed-tier: 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 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
② Semver level
③ Boundary flags
④ Design judgment
No must-fix. Two should-fix in the picker and one in the describe, none of which changes the published shape. Implemented-by: VERDICT: PASS |
…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
|
domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8 Contract reviewServed-tier: This is a delta on the round-1 record (PASS on Read: the round-1 record, the delta 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
② Semver level
③ Boundary flags
④ Design judgment
S2. One function,
S3. The pending pick is now an id, and the model is read from the current list on every render.
Round-1 nits:
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: VERDICT: PASS |
…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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pX4G6G9ZLeRqSRoFu
|
domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8 Contract reviewServed-tier: This is a second delta, on delta record 1 (PASS on Read: both earlier records in full, the delta 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
② Semver level
③ Boundary flags
④ Design judgment
Loop safety of the render-time adjustment:
The new pins, read against the guard:
Nits, none on the contract:
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: VERDICT: PASS |
|
domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8 席位核对Verdict: ACCEPT · head
|
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract-review-claim: session_016WV4cy7hQ5MvQ83ByNZ8ZH · head 8e2c2d7 · 2026-11-15T11:36:03Z |
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract reviewServed-tier: This is a delta on delta record 2 (PASS on Why a record and not a Read: the three earlier records in full and the seat's ACCEPT (comment 6893248551); the head's two parents and merge base ( What the merge is, measured:
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
③ Boundary flags
④ Design judgment
No must-fix, no should-fix and no new nit. The PASS of comment 6892921764 carries to this head. Implemented-by: VERDICT: PASS |
… 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>
…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>
Requested by Leehom · project thread
Fixes #33660
Clause-②: yes (widening)
Metadata-protocol: none
Seat
domain:ui#2· os-project-manager · card threadsession_01FEkQ5pX4G6G9ZLeRqSRoFu· claim 6890495150维护者速读
AiModelsResponseSchema的模型条目新增可选字段costMultiplier(正数,默认模型为 1)。service-ai的GET /api/v1/ai/models填写,那是另一张 cloud 卡(本卡为其 Blocked-by)。回滚即还原本 PR。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 的模型会弹确认,点取消模型不变。What changes
AiModelsResponseSchema(packages/spec/src/api/protocol.zod.ts): the object form of a model entry gainscostMultiplier, 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 (thedefault: trueentry carries 1; every other entry carries its model's cost weight divided by the default model's), and names its producer: cloudservice-ai'sGET /api/v1/ai/models. The bare-string entry form is unchanged. The reference pagecontent/docs/references/api/protocol.mdxis regenerated (check:generated --fix, docs only;authorable-surfacedid not move, soMetadata-protocol: none)./ai/models:packages/runtime/src/domains/ai.tsonly dispatches/ai/*to the route table the AI service registers, and with no serveable AI service it answers 501. The only producer is cloudservice-ai(packages/service-ai/src/routes/ai-routes.ts), which fills the member fromcost_weightin a separate cloud card,Blocked-bythis one. No framework number is invented.useAiModelskeepscostMultiplierwhen 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.ChatbotEnhanced'sModelPicker, the one picker every chat host renders):×Nbeside 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;1 - pool.fraction, as a percent, the same reading as the console's usage ring) and that a×Nmodel 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;AlertDialogonce, 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×20and 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.ChatPane(AiChatPage.tsx) readsuseAiUsageonly once some model carries a multiplier, and passespool.fraction(not when unmetered or null) asallowanceUsedFraction. The/aipage, the console dock (ChatDockConversation) and the Studio copilot (StudioCopilotConversation) all renderChatPane, so none of their files changes and none can skip the confirmation.chatbot.modelPickerin the existingchatbotnamespace. en and zh-Hans (zh-CN) as ordered; the other nine packs are filled too, becauseall-locales-key-parity.test.tsrequires every pack to define everyenkey.Clause-②: yes (widening):@objectstack/spec:AiModelsResponseSchemamodel entry membercostMultiplier?: number;@object-ui/plugin-chatbot:ChatbotModelOption.costMultiplier?: number;@object-ui/plugin-chatbot:ChatbotEnhancedProps.allowanceUsedFraction?: number..changeset/33660-ai-model-picker-cost-multiplier.md:@objectstack/spec,@object-ui/plugin-chatbot,@object-ui/i18n,@object-ui/app-shell,@object-ui/consolepatch (a widening withMetadata-protocol: noneshipspatch; app-shell is private and console'sdistships it).content/docs/frontend/plugins/plugin-chatbot.mdx.Tests
ui/packages/app-shell/src/console/ai/__tests__/AiChatPage.modelCostMultiplier-33660.test.tsx: the three hosts (AiChatPageat/ai/build,ChatDockConversation,StudioCopilotConversation), each with the REALChatPane,useAiModels,useAiUsage(over afetchstub answering/ai/modelsand/ai/usage) andChatbotEnhanced, driven through the renderedSelect(keyboard open, option click) and the renderedAlertDialog. Per host:×1 ×5 ×20drawn and nothing for the model the server gives none; a ×20 pick asks, Cancel keepsFast, Confirm switches the trigger to the ×20 model; CONTROL: a ×5 pick switches at once with no dialog; the allowance note reads60%with usage0.4, and is absent when/ai/usageanswers 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×20and asks, 19.994 reads×19.99and applies at once);0.004reads×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 writesopusonce; 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 withcostMultiplier: 20(and0.5) parses and keeps it;0,-1,'20'andNaNare refused; the existing entry without it still parses, as does the bare string.ChatbotEnhanced.modelPicker-11865.test.tsx, exacttextContent) stay green unchanged: absent stays absent.scripts/ablation-replace.mjs(ui vitest aliases@object-ui/plugin-chatbottosrc, no rebuild), each restored with the blob equal to HEAD andgit diff HEADempty:×Nspan's condition always false) 12 failed / 14 passed, every multiplier-drawn pin and the host pins that read the trigger's multiplier; the hook dropscostMultiplier15 failed / 11 passed, every host pin;ChatPanepasses noallowanceUsedFraction3 failed / 23 passed, the "note shows with usage served" pin on each host;×0.004reads×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×Nspan 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/usagereads 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.mdxexcluded), 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-aifillscostMultiplier, every entry lacks it and the picker, the usage read and the confirmation are exactly as before (useAiUsageis 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
maininto 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/objectstackderives 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.--ranreconciliation: 115 derived, 115 run, 0 NOT-MEASURED, 0 UNRUN.pnpm --filter @objectstack/spec check:generated --fixafter the S1.describe()change: onlycheck:docsstale,content/docs/references/api/protocol.mdxregenerated; 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-shelltype-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(fromui/): 0 new citations.ui/with--maxWorkers=2overpackages/plugin-chatbot/,packages/app-shell/src/console/ai/,layout/,views/studio-design/,hooks/andpackages/i18n/on 35f32c7: 829 files, 7593 passed, 13 skipped, 0 failed (lock VERDICT command-exit 0).@objectstack/spec:src/api/protocol.test.tsandsrc/type-alias-convention.pin.test.tson 35f32c7: 256 passed. The full spec suite, the full app-shell suite and the rest of the farm are CI's.zh-hant-generated.test.ts(zh-Hant is generated from zh-Hans), fixed bygen:zh-hantin 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