Repository navigation
docs(ui-adr): ADR-0057 Amendment A4 — an app's AI inquiry page - #37825
Conversation
An app may place one `ai:chat` page in its navigation; placed first it is the app's home, and the top-bar robot is hidden while it is the active route. A3's one-container bullet gains an in-place pointer to the exception. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwGVgec21LwQTtRY85
The status block's Amended list said A3 made the drawer the ONLY chat container; without an A4 entry the header contradicted the body. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwGVgec21LwQTtRY85
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwGVgec21LwQTtRY85 Final head for review: |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · head 8735dfe · 2026-11-27T06:01Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: Read for this record: card #37819 (body and all 5 comments), PR #37825 (body, file list, its 2 comments, the net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentFile judged: What holds, checked sentence by sentence:
Findings. No must-fix. Two should-fix, each owing a delta review. S1 (should-fix) — the "never two S2 (should-fix) — the Home bullet is false in two cases the live tree supports. "Placed first in the app's navigation, the page is the app's home" is unconditional. On Nits.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): REWORK (text) at head Contract review. Record posted just above, at What holds. The three rulings are quoted byte-for-byte from #37788 with their times. A2's key, A3's per-tab rule and the Consequences agree with the rest of ADR-0057. No A4 sentence is made false by what #37798 shipped: the Owed, the two should-fix. I checked both against the code on main.
What the text must not decide alone. For S1, whether an already-open drawer closes on arrival and what an The area's question: should A4 name Delta. The original reviewer reads the new head for S1 and S2. I then do the L1 delta. |
…nding rule Round-3 review: the page states the item-7 invariant (drawer closed, robot and keyboard toggle hidden or inert, no address stacks a second ask conversation), home follows the app's existing landing rule with the phone root named open, and the params schema is named. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwGVgec21LwQTtRY85
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwGVgec21LwQTtRY85 Final head for review: |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · head 2818352 · 2026-11-27T06:31Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: DELTA review from ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentS1: closed. The bullet now states the invariant and names the doors. Checked against the first round's three: (a) the keyboard toggle is named and made inert, and "A3's Entry, the top-bar robot and the keyboard toggle" matches A3's Entry bullet, which holds both; (b) "While the page is the active route the drawer is closed" covers a drawer left open on arrival; (c) "No address, the S2: closed. Each sentence of the new Home bullet holds on Nits from the first round:
The three rulings are still byte-identical, each on its own blockquote line. Nothing in the delta decides T5 / T6 or anything #37788 leaves open. No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT (delta) at head Contract review. Delta record posted just above, at What I checked myself.
Checks. 30 success, 17 expected skip, 0 failed; mergeable_state clean. One file, ADR text only, +90/-0 against main. Landing: Tier H ( |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Seat record · 2026-11-27T06:35Z · PR #37825 (Fixes #37819, Refs #37788) · head 维护者速读
Seat opinion: land. 席位核对 — ACCEPT · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: DELTA review from ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentS1 (should-fix): closed S2 (should-fix): closed Nits from the first round:
The three rulings are still byte-identical, each on its own blockquote line. Nothing in the delta decides T5 / T6 or anything #37788 leaves open. No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Seat record · 2026-11-27T06:37Z · PR #37825 (Fixes #37819, Refs #37788) · head 维护者速读
Seat opinion: land. 席位核对 — ACCEPT · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: DELTA review from ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentS1 (should-fix): closed The bullet now states the invariant and names the doors. Checked against the first round's three: (a) the keyboard toggle is named and made inert, and "A3's Entry, the top-bar robot and the keyboard toggle" matches A3's Entry bullet, which holds both; (b) "While the page is the active route the drawer is closed" covers a drawer left open on arrival; (c) "No address, the S2 (should-fix): closed Each sentence of the new Home bullet holds on Nits from the first round:
The three rulings are still byte-identical, each on its own blockquote line. Nothing in the delta decides T5 / T6 or anything #37788 leaves open. No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Seat record · 2026-11-27T06:40Z · PR #37825 (Fixes #37819, Refs #37788) · head 维护者速读
Seat opinion: land. 席位核对 — ACCEPT · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Approval request · Tier H · PR #37825 (Fixes #37819, Refs #37788) · head @os-zhuang — governed |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45956003747 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Queue drop · 2026-11-27T07:26Z · PR #37825 · head @os-zhuang — the queue build failed on
|
…versation, drawer closed there (objectstack-ai#37889) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D71daFMSfEFsgPq1ECrMYCy)_ Fixes objectstack-ai#37788 Clause-②: no Metadata-protocol: none ## 维护者速读 - 是什么:平台通用的「AI 问询」页面上线。应用在菜单里放一个 `ai:chat` 入口(按应用现有的首页规则:没声明 landing 时,电脑上放第一位就是首页;手机上应用首页是菜单),进来先看到应用配置的欢迎语、大输入框和推荐问题;提问后同一页变成对话,刷新能恢复。 - 为什么:落地 ADR-0057 修订 A4(objectstack-ai#37825 已合)。以前这个入口会显示「组件未注册」;现在有页面,而且这一页上右上角机器人隐藏、快捷键无效,不会出现两个对话。 - 出错会怎样:只影响菜单里放了 `ai:chat` 的应用;其他页面抽屉照旧。没开 AI 或没席位的人看到现有的「AI 助手不可用」页。 - 要你做的:无,区内复审后交座位。 ## What changes The `ai:chat` component ref (`AI_CHAT_COMPONENT_REF`, `@objectstack/spec/ui`) gets its page, per ui ADR-0057 Amendment A4 as merged in objectstack-ai#37825. - **`console/ai/AppAskPage.tsx`** (new, +370) — the page, registered lazily in `services/builtinComponents.tsx` (`registerAppComponent` + `lazyPage`, so it stays out of the eager closure; the console build's declared-lazy check passes). Home state: title, subtitle, placeholder and up to four suggestions from the entry's `params`, read through `AiChatNavParamsSchema`; a key the entry omits falls back to neutral platform copy, and nothing is read from the URL. A static badge, 「Answers prefer this app」. Enter sends, Shift+Enter and IME composition do not. The first question turns the same page into the conversation: the existing `ChatPane` (header hidden) on the `ask` agent, a maker included, bound to the app's package (`activeAppPackageId`), under the conversation key `app:PKG:ask`. The first message is held and replayed by the pane's existing deferred-first-send path, so the conversation row is created on first send. - **`?c=ID`** — once the conversation exists the address carries it (`replace`), so a reload restores it. A `?c=` the page did not create is checked with the existing `GET /conversations/:id`: one whose `metadata.activePackageId` is not this app's package, or one that is not the caller's (403/404), opens the home state and is removed from the address; nothing of it is drawn. 「New conversation」 in the page header returns to the home state. - **`console/ai/appAskPageModel.ts`** (new, +128) — the rules without React: finding the app's `ai:chat` entry (navigation, then `areas[].navigation`, through `children`), reading its copy (a record the schema refuses is read as declaring nothing, with one console warning), the conversation key, the create metadata, and the belongs-to-this-app test. - **`hooks/useChatConversation.ts`** — an optional `createMetadata`; the first-send create sends `{ metadata }` when it is set. Only the page sets it (`{ activePackageId: PKG }`); every other caller still sends `{}`. `ServerConversation` gains the `metadata` the GET contract already returns. - **Drawer rule, `layout/**`** — `isAppAskPagePath` (`consoleRoutePaths.ts`) names the page's route; `ConsoleLayout` passes `askPageActive` to `useConsoleChatDock`. While it holds: the drawer renders closed (the stored preference is untouched and comes back off the page), `open()` and the assistant bus are inert, the Ctrl/Cmd+Shift+I effect is not bound, and `AssistantTopBarButton` returns `null` (`ChatDockControl.askPageActive`). A build hand-off still opens the drawer: `open()` with a handoff or a build-agent target passes (`opensBesideAskPage`), and the drawer stays open until it is collapsed or the user leaves the page. On a phone, arriving on the page with the sheet stored open collapses it, so the next page does not bring it back (the sheet already closes on any move away, objectstack-ai#37556); the desktop rail keeps its stored state. - **`@object-ui/i18n`** — one key, `console.ai.askPage.scopeBadge`, in all 11 packs. The other strings reuse existing keys (`console.ai.empty.ask.*`, `console.ai.askAnything`, `console.ai.submit`, `console.ai.newConversation`). - One changeset (`@object-ui/app-shell` and `@object-ui/i18n`, patch). Not touched: `AiChatPage.tsx`, `ChatbotEnhanced.tsx`, `ui/docs/adr/**`, `packages/spec/src`. ## Tests - `console/ai/__tests__/AppAskPage-37788.test.tsx` (11) — the real page, the real `useChatConversation` over a stubbed `fetch`, the real router and registry; stand-ins for the agent catalog, the AI gate, app metadata, `ChatPane` and `AiUnavailable`. It covers: the registry entry; declared copy; fallback copy; no copy from the URL; a suggestion asks it (pane on `ask`, bound to the package, the create body `{ metadata: { activePackageId } }`, the address gains `?c=`); a maker gets `ask`; a reload restores from `?c=`; another app's conversation opens the home state and leaves the address; a 403 opens the home state; New conversation; and the unavailable state. - `console/ai/__tests__/appAskPageModel.test.ts` — finding the entry, copy and fallback, the warning on a refused record, the key, belongs-to-this-app, and `isAppAskPagePath` agreeing with `componentRefToUrlSegments(AI_CHAT_COMPONENT_REF)`. - `layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx` (+7, real dock + control provider + top-bar button): the drawer is closed on the page and back off it; the robot is hidden on the page only; the toggle chord and `ask` opens are inert on the page; control: the chord works off it; a build open still opens the drawer; on a phone, a sheet open on arrival is closed by the page and stays closed on the next page; on a phone, a build hand-off still opens the sheet. - `layout/__tests__/ConsoleLayout.askPageHidesEntry-37788.test.tsx` (new, 2): through the real `ConsoleLayout` wiring, the entry is not drawn on the `ai:chat` route and is back on another; a drawer open elsewhere is closed on the route and comes back after it. - `hooks/__tests__/useChatConversation.test.tsx` (+2): `createMetadata` reaches the create body; the drawer's create is still `{}`. - Ablations: with `AssistantTopBarButton`'s `askPageActive` return removed, "the robot is hidden on the page only" fails; with the phone-collapse branch disabled, the phone case fails (1 failed / 15 passed); with `ConsoleLayout`'s `askPageActive` set to `false`, both wiring cases fail. Restored, all pass. ## Acceptance notes - **Item 10, `context.surface`: not tagged, and why.** A cheap hook does exist: `ChatPane` takes `surfaceContext` and sends it as `context.surface`, and the spec's `pillar` is a free advisory string (`packages/spec/src/contracts/ai-service.ts`, `surfaceContext`). It is left out because the shape is cloud#1610's, and cloud's agent route sanitizes it field by field (`ui/packages/app-shell/src/layout/chatSurfaceContext.ts`, module doc). Which `pillar` value that sanitizer keeps cannot be read from here: the cloud repository is out of this seat's reach. So the page sends no value that cloud might drop, and the console invents no new vocabulary. Evals can still split these turns: every conversation the page creates carries `metadata.activePackageId`, which only this page sets. Once cloud names a value, tagging is a one-prop change on `ChatPane`. - **Location-state hand-offs.** A `/ai…` address with handoff state that lands on the page does not open the drawer. Only `open()` with a build target or a handoff does. - **Phone root** is out of scope, as the ADR names it. - **The entry stays hidden after a hand-off opens the drawer on the page.** That is A4's rule: on the page the triggers are hidden or inert. The drawer closes with its own control, and reopening it there would put a second conversation on the page. - **L1 nits not taken in this delta**, to keep it to the dock hook, the tests, the changeset and this body. They are: a transient error on the `?c=` check is read as foreign; the check fetches the full conversation to read `metadata`; an app with no `_packageId` gets no message; duplicate suggestions share a React key. Each one touches `AppAskPage.tsx`. - **Beyond the order's file list:** the 11 locale packs (one key), the model module `appAskPageModel.ts`, and four files under `layout/**` (`consoleRoutePaths.ts`, `chatDockControl.tsx`, `AssistantTopBarButton.tsx`, `ConsoleLayout.tsx`). ui AGENTS asks for docs updates (README, `content/docs/frontend`); those are outside this PR's surface and are left for a follow-up. - **Overlap:** objectstack-ai#37885 (Ask AI entry button) rewrites `AssistantTopBarButton.tsx`, so the two PRs conflict textually there. The conflict is one early return plus a doc line: `if (control?.askPageActive) return null;` goes at the top of the rewritten component. With objectstack-ai#37885, the entry also appears in page headers, and this return hides it on the page too. Whichever PR lands second rebases. With `origin/main` and objectstack-ai#37676 this branch merges cleanly. ## Verification - At `df8d6f75`: `pnpm exec vitest run` of the AppAskPage, dock, the two ConsoleLayout and the model/conversation test files: all green (AppAskPage 11/11, dock 16/16, ConsoleLayout wiring 2/2, robot 2/2). `app-shell` type-check, both programs: exit 0. eslint on the changed files: 0 errors. - The derived gates (`dispatch-gates --ran`: 41 of 41 run), plus the i18n keys, drift, dead-keys, all-locales parity, product-neutral ratchet, eslint on the changed files and `check:new-line-citations`: all exit 0 (re-read after the L1 delta: the changeset gates, `check:test-source-alias`, cross-package test inputs, the timer probe, ceremony text, the role word and new-line citations, all exit 0). `check:test-source-alias` first flagged that the two edited test files reach `AiChatPage`'s lazy `import('@object-ui/plugin-grid')`; fixed by loading it at module top, as the gate prescribes. - Full `pnpm build`: exit 0. - **Browser** (showcase app, `pnpm dev --fresh`, console on Vite): an `ai:chat` entry was injected first in `showcase_app`'s navigation through a Playwright route on `/api/v1/meta/app`, with no source edit. `/api/v1/ai/**` was stubbed, since OSS has no AI. Results: - The home state draws the declared copy, the badge and four suggestions. - `?c=conv-1` restores the conversation (user question plus a markdown answer) with 「New conversation」 in the header. - The top-bar Ask AI entry counts 0 on the page and 1 on the Capability Map page. - Screenshots, at 1440×900 @2x, of the home state and the restored conversation, are kept with the project. The relay cannot upload images. Both were viewed at L1 (comment 7215194705). --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4czF5gqc48r9LUsmRpw)_ <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4czF5gqc48r9LUsmRpw --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Fixes #37819
Refs #37788
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
One file,
ui/docs/adr/0057-console-ai-chat-one-conversation-docked.md(+90 / -0):## Amendment A4 (2026-11-27, Accepted) — an app's AI inquiry page, placed after Amendment A3 and before "Open design questions", in A3's shape: What it changes · Why · Maintainer ruling (verbatim, not translated, with where it is recorded and the time of each) · Decision · Consequences ("Implemented under objectstack#37788.").ai:chatpage per app (atype: 'component'navigation entry), copy from the entry's declaredparams(AiChatNavParamsSchemain@objectstack/spec/ui, objectstack#37787, merged), never from the URL, platform-generic, a key the entry omits falls back to neutral copy; the page is the app's home by the app's existing landing rule (a declaredAppSchema.landingfirst; with none, from 768 px up the first entry shown lands; below 768 px the app root is the menu); on the page the drawer is closed and its triggers (top-bar robot, keyboard toggle) are hidden or inert, and no address stacks a secondaskconversation there (the invariant of objectstack#37788 item 7, cited); the page runsask(makers too), a build hand-off opens the drawer; conversation keyapp:PKG:ask,?c=IDrestores, a foreign or other-app?c=opens the home state; A3 stands everywhere else. Named open, outside A4 and objectstack#37788: whether a phone's app root should open the page.*(Amendment A4: …)*, so a reader of A3 finds the exception.Nothing decides beyond objectstack#37788's header and its items 1–8: no designer entry (T5), no hide-for-no-seat rule (T6); the Consequences say so in one sentence.
Tests
Docs-only; no tests apply. The three ruling quotes were checked byte-for-byte against objectstack#37788's body: each occurs once there (inside the corner brackets) and once in the ADR as its own blockquote line.
Local gate readings at 2818352
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 16 commands; each run with its exit captured before any pipe:node scripts/check-closing-keyword-parity.mjsexit 0node scripts/check-closing-keyword-parity.mjs --self-testexit 0node scripts/check-comment-mask-corpus.mjsexit 0 (24065 files, 0 disagree)pnpm check:adr-anchorsexit 0pnpm check:adr-indexexit 0 (report-only; its one warning, a stale rootdocs/adr/README.md, is also present on origin/main ff9ee21; the ui-0057 row reads title, status and date, none of which this diff changes)pnpm check:driver-memory-censusexit 0pnpm check:gitlink-declaredexit 0pnpm check:nul-bytesexit 0pnpm check:pm-governed-mergesexit 0pnpm check:published-filesexit 0pnpm check:refd-timer-probeexit 0pnpm check:registry-log-declaredexit 0pnpm check:rest-log-spy-declaredexit 0pnpm check:tier-file-adoptionexit 0pnpm check:undeclared-dep-importsexit 0pnpm check:watch-hint-literalexit 0--ranreconciliation: 16 derived, 16 run, 0 NOT-MEASURED, 0 UNRUN. Everything else is CI's.Acceptance notes
skip-changeset:ui/docs/adr/**ships in no package (ui/package.jsonis private and noui/**/package.jsonlistsdocs), so nothing publishes.ui/docs/adr/**, Tier H): this PR stays draft and is landed by neither the author nor the area; it goes to seat repo:objectstack#1 for the hand-off.scripts/adr-index.mjs) derives the ui-0057 row from title, status and date, which are unchanged.Verification
Read first:
## Amendment A4section (risk: the Decision saying more than the card's items 1–6).Two-minute check:
git diff origin/main...HEAD -- ui/docs/adr/0057-console-ai-chat-one-conversation-docked.mdshows the A4 entry in the header's Amended block, one pointer inside A3's "One container" bullet and one new A4 section between A3's Consequences and "Open design questions", with nothing removed (+90 / -0). Round 3 answered L1-a's REWORK 7211260420 (S1, S2, N1, N2, N4 of record 7211253615); the sentence-by-sentence list is in the dev's delta report on #37819 (comment 7211453346).🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cwGVgec21LwQTtRY85