Skip to content

fix(plugin-chatbot): explain the plan card's suggested-field mark with a legend line - #33538

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-61kkpw
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-61kkpw

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #33419

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

维护者速读

  • 改了什么:AI 搭建对话的方案卡上,只要有一个字段带虚线「· 补充」标记,字段行下面就多一行说明:「标「补充」的字段是 AI 自行补充的,你没有要求。」(英文 "Fields marked “suggested” were added by the AI; you didn’t ask for them.")。没有补充字段的卡不出这行。说明文字走 i18n 包,11 种语言都有。
  • 为什么改:以前卡上没有任何地方解释「补充」是什么意思,鼠标悬停也只显示字段的机器名(如 category),用户看不出这是 AI 自己加的字段。
  • 风险与回滚:只是在方案卡上多画一行文字,不改数据、不改服务端;芯片的悬停提示仍是机器名。回滚即 revert。
  • 先看:ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx 的 PlanCardObjectRows(anySuggested 与新加的 proposed-plan-suggested-legend 那段);ui/packages/i18n/src/locales/zh-Hans.ts 的 suggestedFieldLegend;新测试 ChatbotEnhanced.planCardSuggestedLegend-33419.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.planCardSuggestedLegend-33419.test.tsx,预期 1 个文件 4 个用例全绿,其中中文用例读到「标「补充」的字段是 AI 自行补充的,你没有要求。」恰好一行。
  • 需要你做的:无,席位落地。

What changes

  • PlanCardObjectRows (ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx, @object-ui/plugin-chatbot). When at least one field of planCard.objects[].fields[] carries suggested: true, the objects block draws one legend line after its last object row (data-testid="proposed-plan-suggested-legend"), from the new key chatbot.plan.suggestedFieldLegend with the existing mark (chatbot.plan.suggestedField) interpolated as mark, so the legend always quotes the same word the chip shows. One line per card, however many fields or objects are suggested. With no suggested field nothing is drawn. The chip itself is unchanged: dashed, ending in 「· 补充」, title still the field's machine name. The ruling allowed the same sentence on the chip tooltip too; it was not added, since the legend is the owed face and the machine name stays the tooltip.
  • @object-ui/i18n: chatbot.plan.suggestedFieldLegend in all eleven shipped locales, each written in the pack's own register (zh-Hans/zh-Hant use 你 as the rest of chatbot.plan does; es uses usted, de Sie, fr vous, as those packs do):
    • en Fields marked “{{mark}}” were added by the AI; you didn’t ask for them.
    • zh-Hans 标「{{mark}}」的字段是 AI 自行补充的,你没有要求。 · zh-Hant 標「{{mark}}」的欄位是 AI 自行補充的,你沒有要求。
    • ja, ko, de, es, fr, pt-BR, ru, ar: one sentence each, same meaning.
  • de-quote-pairing-3876.test.ts (@object-ui/i18n): the de value quotes the mark as „{{mark}}“, one more matched pair, so the census's two literal counts move 118 → 119 with a dated line, as every earlier added pair did.
  • The other title={f.name} site (ChatbotEnhanced.tsx ~L4363) is a different chip: the phase-1 fallback drawn from blueprint.objects[].fields when there is no planCard, which never carries suggested. Not touched.
  • Changeset .changeset/33419-plan-card-suggested-legend.md: @object-ui/plugin-chatbot and @object-ui/i18n patch (both ship dist), with both declaration lines.

Tests

  • New ChatbotEnhanced.planCardSuggestedLegend-33419.test.tsx. Each message goes through the real mapper (uiMessageToChatMessage) from a raw propose_blueprint tool part and renders ChatbotEnhanced inside I18nProvider:
    • zh, one named field (title) and one suggested (category): exactly one legend, text 标「补充」的字段是 AI 自行补充的,你没有要求。, the last child of the objects block; the chips' titles are ['title', 'category'], only category is data-suggested and ends · 补充.
    • en, same card: one legend, Fields marked “suggested” were added by the AI; you didn’t ask for them.
    • two suggested fields on two objects: two data-suggested chips, still one legend.
    • CONTROL: suggested taken off every field: no data-suggested, no legend, and the objects block holds no 「补充」.
  • Measured on base first. With ChatbotEnhanced.tsx and the eleven locale files checked out at f068cde8 (the new test kept): Test Files 1 failed, Tests 3 failed | 1 passed. The three legend cases red with expected [] to have a length of 1 but got +0: nothing on the card explains the mark. The CONTROL passed.
  • Ablation through scripts/ablation-replace.mjs on ChatbotEnhanced.tsx: the legend condition {anySuggested ? ( made always true ({(anySuggested || String("ABL33419").length > 0) ? (), blob 60bc95c2 → 8b8a204f: Tests 1 failed | 3 passed, the red is CONTROL: no suggested field on the card draws no legend. Restored: blob == HEAD, git diff HEAD empty. ui vitest imports the component from source, so no build sits between mutation and run.

Acceptance notes

  • File surface: the claim names ChatbotEnhanced.tsx, its tests, the locale packs and the changeset. ui/packages/i18n/src/__tests__/de-quote-pairing-3876.test.ts was also edited: it is the i18n package's census of de quote pairs, and an added „…“ pair moves its two literal counts.
  • Declaration lines measured on the diff: one key added to the @object-ui/i18n packs, nothing removed or narrowed, no published export changed: Clause-②: yes (widening), Metadata-protocol: none, as the claim opened.

Verification

Run on head 004a1dec (base origin/main f068cde8; origin/main has moved 4 commits since, none touching ui/packages/plugin-chatbot or ui/packages/i18n, and the merge is clean).

Build, tests, type-check and lint
  • Build under the verify lock: pnpm --workspace-concurrency=2 --filter '@objectstack/spec...' --filter '@objectstack/formula...' --filter '@objectstack/client...' --filter '@objectstack/lint...' --filter '@objectstack/sdui-parser...' build, then pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-chatbot^...' build: both VERDICT command-exit 0.
  • New pin on 004a1dec: Test Files 1 passed (1), Tests 4 passed (4).
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-chatbot/ packages/i18n/ on b8efe96b: Test Files 201 passed (201), Tests 2850 passed, 13 skipped (2863). (On ea89a727, before the census bump: 1 file failed, the two de-quote-pairing-3876 counts reading 119 against 118.) 004a1dec changes only the new test file's types.
  • pnpm --filter @object-ui/i18n run type-check: exit 0. pnpm --filter @object-ui/plugin-chatbot run type-check (tsc --noEmit && tsc -p tsconfig.test.json): exit 2 on b8efe96b (TS2322 in the new test's replaced-objects helper), exit 0 on 004a1dec.
  • eslint on ChatbotEnhanced.tsx, the new test and the de census test: exit 0, 0 errors (12 warnings, all on pre-existing lines outside PlanCardObjectRows). pnpm --dir ui run check:new-line-citations: 0 new citations, exit 0.
Derived gates (38)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 38 families, the same 38 on b8efe96b and 004a1dec. All 38 exited 0 on b8efe96b; the first 15 (those that ran before the test-typing edit) were run again on 004a1dec and exited 0, among them pnpm --dir ui exec vitest run scripts/; the other 23, among them pnpm check:type-check-debt, pnpm check:test-source-alias, pnpm check:published-files and pnpm check:type-check-coverage, ran with the edited test file already on disk. --ran reconciliation on 004a1dec: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. Changed lines: under the 3,000 threshold.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5nPjRkNSgKVPP1Y6tw

…h a legend line

A field the user's words did not name is drawn as a dashed chip ending in
the suggested mark, and nothing on the card said what the mark means.
When any field on the card is suggested, one legend line under the field
rows now says the AI added it and the user did not ask for it, through a
new i18n key in all eleven shipped locales.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5nPjRkNSgKVPP1Y6tw
@github-actions github-actions Bot added 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 14, 2026
@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 14, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 004a1decf57e26c16dd980821f0bbc4c86ea2d70
Local-runs: none

Inputs: card #33419 (body, the domain:ui#2 claim, the os-dev-report), PR #33538 (body, 15-file list), the net diff origin/main...004a1dec (15 files, +154 −3), and the 41 check-runs on the head. Nothing was built, run or re-run.

① Derived judgments

  • @object-ui/i18n published type: right, a widening. One key, chatbot.plan.suggestedFieldLegend, is added under chatbot.plan in all eleven packs (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant), one line each. The entry exports en, and TranslationKeys = typeof en, so both gain one member. No key is removed, renamed or reworded, and chatbot.plan.suggestedField is unchanged. Locale packs are plain objects, not annotated against TranslationKeys, so the added key does not narrow anything inside the repo. Earlier @object-ui/i18n key additions in the changelogs (oauth.consent.scope.*, console.settingsHub.adminManaged*, console.studio.accessRequired) were declared the same way: widening, patch.
  • Interpolation contract: right. Every pack keeps the {{mark}} placeholder spelled exactly. The component passes mark: suggestedMark, which is the same t('chatbot.plan.suggestedField') value the chip shows, so the legend always quotes the chip's own word. The defaultValue is the en sentence, so it behaves the same as the pack when no pack is loaded.
  • @object-ui/plugin-chatbot public surface: unchanged. PlanCardObjectRows is module-private: nothing outside ChatbotEnhanced.tsx imports it, and it has one call site, at ~L4334. Its props are unchanged. The one new DOM hook, data-testid="proposed-plan-suggested-legend", is read only by the new test. anySuggested comes from objects[].fields[].suggested, which is already on the wire, and nothing in the diff reads any other field.
  • Accept-sets: none touched. No packages/spec, Zod schema, server, producer or metadata path is in the diff. The card's ⛔ "No producer change" holds. Metadata-protocol: none is right.
  • Card acceptance: met. (a) When any field is suggested, one legend line is drawn after the object rows, saying the AI added the field and the user did not ask for it. It comes from the i18n pack in every shipped locale. (b) The machine name is still reachable: the chip keeps title={f.name}, and the test checks the titles ['title','category']. (c) The pin: one named field plus one suggested field gives exactly one legend, and only the suggested chip carries data-suggested. The CONTROL, with no suggested field, gives no legend and no 「补充」 anywhere in the block. The dev ran the pin red on base (3 fail | 1 pass), and an ablation that forces the condition true turns only the CONTROL red. That is the pin's own evidence, recorded on the card and not re-run here.
  • Check-runs on the head (41): none failed. These completed success: Check Changeset (one of its two runs), Check PR Size, PR-body guards, Governed Surface Queue Guard, Type Check · workspace, Type Check · debt ledger, Test Core, Plan Test UI shards, Dogfood Regression Gate, Auto Label, filter. The skipped ones are opt-in, schedule-gated or matrix placeholders. These were still in_progress when read, with no conclusion: Build UI Deps, the second Check Changeset run, Lint (ESLint; PM dispatch-gates; docs & code guards; repo & tooling gates; CI, release & engine gates; scoped query-options erasure; scoped slot lookup & corpus; scoped tooling self-tests), Type Check · consumer gates, Type Check · source gates, and Live E2E UI. No UI test shard had a check-run on the head yet. This verdict is on the contract. Landing still waits for those runs to finish green; the queue enforces that, and this record does not.

② Semver level

  • Changeset .changeset/33419-plan-card-suggested-legend.md: '@object-ui/plugin-chatbot': patch, '@object-ui/i18n': patch. These are the two packages the diff moves, and both publish dist (version 18.4.0), so a changeset is owed and skip-changeset would be wrong. None was used.
  • The rule is AGENTS.md Post-Task Checklist step 3. With Metadata-protocol: none, the level is patch. A non-protocol widening also ships patch. Both packages are declared patch, which is right.
  • Clause-②: yes (widening) appears line-initial in the PR body, in the changeset body and on the claim, together with Metadata-protocol: none. The arm comes from the closed pair, and the line is not no (widening). It matches the diff: one added published key, nothing removed or narrowed. Right. There is no BREAKING banner and no ADR-0087 marker, and none is owed for a widening.

③ Boundary flags

  • Dev flag: ui/packages/i18n/src/__tests__/de-quote-pairing-3876.test.ts, census 118 → 119, a file the claim does not name. ACCEPTED. The change is forced and bounded. The de value quotes „{{mark}}“, which is exactly one more correctly paired span, and this census pins the pair count as a literal. Both literals move by exactly one: okSpans 118 → 119, and {open, close, rdq} 118/118/0 → 119/119/0. Each move has a dated comment naming AI build chat: the plan card's dashed 「· 补充」 field chip has no legend and its tooltip shows only the machine name, so nothing says what "suggested" means #33419 and the key, the same way every earlier pair was added. The durable identity close === open + rdq is unchanged, so no assertion was weakened. The file is in the same package as the claimed locale files, so this is the claim's "one added key" showing up in that key's own package census, not a surface creep. No other literal-count census under ui/packages/i18n/src/__tests__/ is affected.
  • Dev deviation: PR fix(ui): the AI build chat says what really happened — plan card states, queued sends, preview empty state, customer wording, labels #33333 was read only through the card's quote. ACCEPTED. The card is the input of record, and it quotes the measurement it relies on.
  • Dev deviation: no labels were sent on pr_create. ACCEPTED. The order names no labels. The labels now on the PR (documentation, size/m, tests, tooling, needs:contract-review) were added by automation, not by the dev.
  • open_questions: []. There are none to answer. out_of_scope_findings: [], security_findings: none.
  • The optional tooltip sentence: answered. The card offered a legend line OR a chip tooltip sentence. The dev chose the legend and left title={f.name} alone, which satisfies "the machine name stays reachable". This is within the card's choice and is not a gap.
  • The other title={f.name} site (~L4363): out of scope, correctly. It is the phase-1 blueprint fallback chip, and that path never carries suggested.

Findings:

Implemented-by: claude/project-thread-61kkpw
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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

席位核对

Verdict: ACCEPT · head 004a1dec · 2026-11-15T00:19Z

  1. Shape. Draft → main, Fixes #33419. 15 files, +154/−3:

    • ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx (PlanCardObjectRows: one legend line when any field is suggested)
    • a new rendered test, ChatbotEnhanced.planCardSuggestedLegend-33419.test.tsx
    • one key, chatbot.plan.suggestedFieldLegend, in all eleven @object-ui/i18n packs
    • the de quote-pairing census 118 → 119 (de-quote-pairing-3876.test.ts), forced by the new de value's one quote pair
    • one root changeset (@object-ui/plugin-chatbot + @object-ui/i18n patch)

    On the claimed surface (6885550647), plus the census file, accepted below.

  2. Premise. Re-measured by the dev on f068cde8: nothing on the plan card explained 「· 补充」, and the chip's tooltip is the machine name (3 legend pins red on base).

    • The fix: when at least one field on the card is suggested, one line under the field rows says the AI added those fields and the user did not ask for them, quoting the chip's own word through {{mark}}. The chip keeps title = machine name. ⛔ No producer change.
    • Pins: one named + one suggested field → exactly one legend; CONTROL no suggested field → no legend. Ablation of the condition: the CONTROL red.
  3. Contract record. PASS 6886276580 on this head (TIER_DEFAULT): one additive i18n key, Clause-②: yes (widening), Metadata-protocol: none, patch right.

  4. Gates on head 004a1dec. All 66 check runs are success or skipped. The dev's local --ran is 38/38, 0 NOT-MEASURED.

  5. Accepted deviation and nits.

    • The census bump touches a file the claim did not name; it is the added key's own package census, both counts move by exactly one with a dated comment, and no assertion is weakened.
    • Nits from the record (no change asked): the changeset could also say the exported en / TranslationKeys gain one member; the PR body calls the card's tooltip option a "ruling".
  6. K. 4 first-parent commits since base f068cde8 < 15: no base sync. Path face: not governed; 157 changed lines.

  7. Out of scope. None.

  8. 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 00:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 020ce3d Nov 15, 2026
67 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-61kkpw branch November 15, 2026 03:58
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/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant