Skip to content

feat(plugin-chatbot): the question card takes the composer's place when the AI ends its turn on a question - #38004

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-ctejy8
Nov 27, 2026
Merged

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Refs #37874 (items 1-8)
Clause-②: yes (widening) — widened: parseAskQuestionEnvelope accepts a legacy ask_which reading up to 60 characters and ASK_QUESTION_LIMITS gains legacyReadingMaxLength; ChatbotEnhancedProps gains the optional conversationId; plugin-chatbot exports QUESTION_SKIP_STORAGE_PREFIX; QuestionCardQuestion / QuestionCardOption keep their names and are now the spec envelope types.
Metadata-protocol: none

维护者速读

  • 控制台 AI 对话里,AI 以一个提问结束回合时,输入框的位置换成提问卡,点一个选项就作为下一条消息发出;以前用户只能看纯文字列表再自己打字。
  • 属于「问 AI」专题:让 AI 的澄清提问能一键回答,也让现有的「你指的是哪个」提问(选项较长的那类)能用上卡片。
  • 用户在对话里会碰到;出错时最坏是卡片不出现、回到原来的纯文字提问加输入框,草稿不会丢,回滚即恢复原样。
  • 无。

What changes

Spec (packages/spec/src/ai/ask-question.zod.ts). Per the E1 route on the card (carrier note 7219023636), a legacy ask_which reading has its own limit, ASK_QUESTION_LIMITS.legacyReadingMaxLength = 60, instead of the envelope's 24-character label, so most of today's ask_which questions read as a card. The option rules (no duplicate, no blank, at most one recommended) are now one refineOptions shared by the envelope and the legacy arm. A legacy result with an empty reply is refused, which makes the reply describe true for both arms (L2 N1 on Q1). The new asked envelope keeps its 24-character label.

Wiring (ui/packages/plugin-chatbot).

  • chat/pendingQuestion.ts: findQuestions finds every question the conversation holds (one envelope per segment between user messages, and the segment's last shown text equals its reply), over both shapes a tool-ended turn arrives in: one streamed message, or the tool message plus the text message of a reloaded conversation. findPendingQuestion adds the conditions for the card: the stream has ended, nothing streams, not read-only, no queued typed message, the question is in the last segment, not skipped, and no undecided write approval in the same segment.
  • chat/composerGate.tsx: the composer's place, held by the card or the composer. The composer is never unmounted: it is hidden and inert while the card holds the place, so a draft, attachments and the uncontrolled textarea survive, and focus that was in it returns to it.
  • ChatbotEnhanced.tsx: one click sends the option label through onSendMessage. The card stays mounted while closed, so a refused send that rolls the bubble back reopens it with the choice still made. Skip writes the question's toolCallId under objectstack:ai-chat-question-skip: plus the new optional conversationId prop (chat/questionSkip.ts, every storage access in try/catch). The thread draws the question from its envelope (chat/questionMessage.tsx): pending shows the question alone, past shows a collapsed "AI asks: QUESTION" that expands to its options. Regenerate is hidden on a pending question; Copy still copies the full reply.
  • QuestionCard.tsx: per the Q2a alias note, QuestionCardQuestion and QuestionCardOption keep their exported names and are aliased to AskQuestionParsed / AskQuestionOptionParsed; long labels wrap.

Console (ui/packages/app-shell). ChatPane passes its conversation id, and purgeChatCaches clears the skip prefix on sign-out with the rest of the chat cache.

Checklist and docs. One platform-checklist item, ai.chat-question-card. The plugin-chatbot docs page and the package README gain a paragraph on the card. The README is outside the claimed file surface (reported to the seat). Regenerated: the ask-question spec reference and the strictness-ledger AI counts.

Files to read first, by risk:

  1. ui/packages/plugin-chatbot/src/chat/pendingQuestion.ts: the segment rule and the pending conditions decide when the card replaces the composer.
  2. ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx: the answeredQuestion state that keeps the card after a send, and the gate around PromptInput.
  3. packages/spec/src/ai/ask-question.zod.ts: the legacy arm and its 60-character limit.

Tests

  • packages/spec/src/ai/ask-question.test.ts: the legacy limit at 60 and 61 characters, the envelope still at 24, trimmed duplicates, blank reading, long question, empty reply.
  • ui/packages/plugin-chatbot/src/__tests__/pendingQuestion-37874.test.ts: both turn shapes, the envelope and the legacy result, and every condition that holds the card back (streaming, other final text, a later message, two questions in one batch, a user or HITL message after it, a queued message, an undecided approval, a skip, read-only, a failed tool).
  • ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.questionCard-37874.test.tsx: through the rendered component, the gate (composer mounted, hidden, inert), a draft surviving the card and a skip, a one-click answer, a refused send reopening the card with the choice made, a queued message winning over the card, read-only, skip persistence per conversation, the pending and past message, Regenerate hidden and Copy kept.
  • ui/packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx: sign-out clears the skip key.

Acceptance notes

Two-minute check: pnpm --dir ui exec vitest run packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.questionCard-37874.test.tsx, expect 16 passing tests.

Verification

Head 19d67fd4b3, branched from 57ab08760c (origin/main).

  • Derived gates: dispatch-gates --ran reports 113 derived, 113 run, 0 NOT-MEASURED, every line with its exit code, all exit 0. Two gates first answered exit 3 (prerequisite not built: check:skill-examples wanted client-react dist, check:dual-build-cjs-loads wanted built packages); after pnpm --filter @objectstack/client-react build and the battery's own package build, both re-ran under the verify lock and exited 0.
  • Unit: spec ask-question.test.ts 19/19; UI vitest over plugin-chatbot, the app-shell useChatConversation test and console/ai: 111 files, 1006 tests passed.
  • Type-check and build: plugin-chatbot type-check and build, app-shell type-check, exit 0. check:generated clean after --fix regenerated the two spec artifacts.
  • Overlap: overlap-check --pr=37970 VERDICT clean; the one shared file is ChatPane.tsx.
Ablations (one-off, restored; `git diff HEAD` empty after each)
  • pendingQuestion.ts: drop the queued condition. 2 tests turn red (the unit "typed message is queued" case and the component "message queued during the turn" case), 31 pass.
  • composerGate.tsx: inert={held} to inert={false}. 1 test turns red (the composer is no longer inert), 15 pass.
  • ask-question.zod.ts: a legacy reading held to the 24-character label instead of 60. 1 test turns red ("holds a reading to its own limit"), 18 pass.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibyUpyff7pHe7vkFgA8

@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:ai tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 5 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 parseAskQuestionEnvelope (symbol, a top-level function))
What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 124 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 — 177 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 b5809b323afc1467175a5fecc460aae16f1b49ee → packageMentionDocs.

Which tree this was computed on

This run read content/docs from d48dd333cd4e412e121011205814e624dc38d798 — the merge of head 3a20ecde478fe0712ecbdc1c141d2b1492c20a74 into base b5809b323afc1467175a5fecc460aae16f1b49ee, 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 d48dd333cd4e412e121011205814e624dc38d798 && git checkout d48dd333cd4e412e121011205814e624dc38d798
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b5809b323afc1467175a5fecc460aae16f1b49ee 3a20ecde478fe0712ecbdc1c141d2b1492c20a74 && git checkout -B drift-repro b5809b323afc1467175a5fecc460aae16f1b49ee && git merge --no-ff 3a20ecde478fe0712ecbdc1c141d2b1492c20a74

node scripts/docs-audit/affected-docs.mjs --json b5809b323afc1467175a5fecc460aae16f1b49ee

⚠️ 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 b5809b323afc1467175a5fecc460aae16f1b49ee → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i

Contract review brief — PR #38004 @ 19d67fd4b372d42b3761b88dab5d455f1c5b3b2a (card #37874)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/ai/ask-question.zod.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #37874: its body and EVERY comment (rulings and earlier records included)
· PR #38004: its body, its file list, and the net diff against main at 19d67fd4b372d42b3761b88dab5d455f1c5b3b2a
· the check-runs on 19d67fd4b372d42b3761b88dab5d455f1c5b3b2a: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/ai/ask-question.zod.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is SCRATCHPAD/pr-38004/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 19d67fd4b372d42b3761b88dab5d455f1c5b3b2a
Local-runs: none
Scope: packages/spec/src/ai/ask-question.zod.ts + ui/packages/plugin-chatbot/src/chat/pendingQuestion.ts, ui/packages/plugin-chatbot/src/chat/questionSkip.ts, ui/packages/plugin-chatbot/src/chat/composerGate.tsx, ui/packages/plugin-chatbot/src/chat/questionMessage.tsx, ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx, ui/packages/plugin-chatbot/src/QuestionCard.tsx, ui/packages/plugin-chatbot/src/chat/types.ts, ui/packages/app-shell/src/hooks/useChatConversation.ts, ui/packages/app-shell/src/console/ai/ChatPane.tsx

Read, not reviewed: packages/spec/src/shared/strict-object.ts, ui/packages/plugin-chatbot/src/toolResultParsers.ts (parseResultEnvelope), ui/packages/plugin-chatbot/src/hitlContinuation.ts, ui/packages/app-shell/src/console/ai/AiChatPage.tsx and the message mappers in useChatConversation.ts, all at this head; card #37874 with its five comments (carrier note 7219023636, claim 7220470053, amendments 7220504306 and 7221881624, the os-dev-report 7221811294); topic #37871; the E1 answer 7219010387; the Q1 record 7218887245 and the Q2a L1 note 7218647154. Not readable from this seat: objectstack-ai/cloud (the ask_which producer and the E1 measurement files), so the E1 figures are taken from the answer as written.

Check-runs on this head when read: 66 in total, 22 success, 9 skipped, 0 failed, 35 still in progress. Success so far: Check Changeset, Governed Surface Queue Guard, PR-body guards, Spec property liveness, Type Check · source gates, Lint · ESLint, Build Docs, Check Documentation Links. Not concluded: Test Core (10 shards), Test UI (16 shards), Build Core, Type Check · workspace, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI and four Lint and Type Check families. This record judges the diff by reading; it answers for no gate that has not concluded, and those conclusions are still owed before the PR is queued. The PR is a draft.

① Derived judgments

  • Legacy accept set: a widening, and only a widening. On main a status: 'asked_which' value is read through the loose legacy object, converted, and parsed by AskQuestionEnvelopeSchema. At this head it is read through the same loose object, then through an unexported AskWhichLegacyQuestionSchema. Rule by rule the two agree except one: success: true; reply a non-empty string (was min(1) on the envelope, now reply.length === 0 refuses); question 1 to 120 and not blank; 2 to 4 readings; each reading non-empty and not blank; no duplicate after trimming (the same refineOptions, now shared); unknown top-level keys ignored. The one difference is the reading length: 1 to 24 before, 1 to 60 now. Accepted now and refused before: exactly the legacy results in which at least one reading is 25 to 60 UTF-16 code units long and every other rule already held. Nothing accepted before is refused now. The "empty reply is refused" line in the PR body is not a new refusal: the envelope refused it on main. Right.
  • Output of the reader widens with it. parseAskQuestionEnvelope can now answer an envelope whose option labels run to 60, typed as AskQuestionEnvelopeParsed. The value has the same keys as before (success, status: 'asked', reply, one question with question and options of label only). A reader that relied on labels of at most 24 would see longer ones; the only reader in the tree is the card in this diff, which wraps them. Declared in the changeset. Right.
  • The asked arm does not move. AskQuestionOptionSchema, AskQuestionSchema and AskQuestionEnvelopeSchema keep their shapes and limits; the superRefine callback only gained a name. A label of 25 is still refused there, with a test. Right.
  • ASK_QUESTION_LIMITS gains legacyReadingMaxLength: 60. One added key on an exported constant; nothing removed or re-valued. Right.
  • Public surface of @object-ui/plugin-chatbot, added only. ChatbotEnhancedProps.conversationId (optional) and the export QUESTION_SKIP_STORAGE_PREFIX on the barrel and on /core. QuestionCardOption and QuestionCardQuestion keep their names and fields and become aliases of the spec's parsed types, with options still read-only, as the Q2a L1 note asked. They change from interfaces to type aliases, which matters only to a consumer that merges declarations into them; none exists in the tree. Right.
  • The 60 is the E1 figure. The answer measured 53 readings, 37 over 24, median 29, longest 54, none over 60, and proposed 60 as "the new envelope's description cap". The code sets 60, the same number as descriptionMaxLength, as its own literal, and keeps 24 and 60 for the new envelope. Right.

② Semver level

Clause-②: yes (widening) and Metadata-protocol: none are present and identical in the PR body and in both changesets. none is the right kind: the diff changes what a tool-result reader accepts and adds console props and exports; no published schema changes shape, and no metadata key, value or type is added or removed. By AGENTS.md, none takes patch, and a non-protocol widening ships patch:

  • .changeset/37874-ask-which-reading-length.md: @objectstack/spec patch. Right. Its widening sentence names exactly the delta derived in ①.
  • .changeset/37874-question-card-wiring.md: @object-ui/plugin-chatbot patch and @object-ui/app-shell patch. Right. Its widening sentence names exactly the three surface changes in ①.

The three packages the diff moves are the three the changesets name. No narrowing, so no BREAKING banner and no ADR-0087 disposition is owed. Check Changeset is success.

③ Boundary flags

  • open_questions: empty in the dev report. Nothing to answer.
  • Dev flag, out_of_scope_findings: the plugin-chatbot README paragraph is outside the claimed surface. Answered by claim amendment 2 (7221881624), which adds the README, the generated ask-question.mdx and the strictness-ledger counts to the surface.
  • Dev flag, PR acceptance notes: ChatPane.tsx is also in feat(app-shell): Ask AI opens a new conversation after the user's own close, and the drawer header names the conversation #37970. Answered by amendment 1 (7220504306): a serial constraint, the second to land merges main first. The change here is one prop.
  • Dev flag: Refs #37874, not Fixes. Right: the card's item 9 (the brightrule smoke after release) is not in this PR and is the maintainer's.
  • Dev flag: no new i18n keys. Holds: the one string the new message uses, chatbot.questionCard.aiAsks, is in all 11 locale packs on main.
  • E1, escalated by the Q1 record. Answered by 7219010387 and carried here by the seat route in 7219023636; the diff implements that route and nothing beyond it.
  • SQL push-down: the diff holds no query, no id materialisation and no join. Not applicable.

④ Design judgment

No must-fix, no should-fix.

packages/spec/src/ai/ask-question.zod.ts against the E1 answer, topic decisions D1 and D2, and its first reader in this diff.

  • The legacy arm does what the E1 route says and no more (①). Tried to break the "widening only" claim: an empty reply, a whitespace-only reading, a reading equal to another after trimming, one reading, five readings, a question of 121, a reading of 61, success: false, extra keys. Each answers as it did on main.
  • The reply describe, "The console draws the card only when this equals the last assistant text", now has its reader. questionInSegment in pendingQuestion.ts returns a question only when the segment's last shown assistant text, at or after the message that carries the tool result, equals reply; the card, the in-thread message and the hidden Regenerate all read that one answer. The sentence is true at this head, with the nuance in N1.
  • Q1's N1 closes. (a) The reader exists, as above. (b) The module JSDoc's "peels the wrapper itself (parseResultEnvelope), then hands the object to parseAskQuestionEnvelope" is questionOf line for line, and a null answer leaves the message drawn as its text. (c) The card now reads ASK_QUESTION_LIMITS.maxOptions for its digit keys. "Nothing here is stored as turn state and no endpoint takes an answer" still holds: the answer goes out through onSendMessage.
  • The legacy section of the JSDoc agrees with the code: its own limit for a reading, every other limit the envelope's, and the three refusals it lists.
  • N1 (nit) — "equals" is compared after trimming both sides (content.trim() against reply.trim()), and a test fixes that on purpose. The describe says "equals". A producer reading the describe loses nothing by it; one clause in the describe would make it exact.
  • N2 (nit) — two sentences are looser than the code. The legacyReadingMaxLength comment says "Readings were never held to the label limit"; the producer never held them, but this reader did on main. And a value the legacy arm answers is typed AskQuestionEnvelopeParsed although it would not re-validate against AskQuestionEnvelopeSchema when a label is over 24; the function's JSDoc says so, the type cannot. Left as written.

ui/packages/plugin-chatbot/src/chat/pendingQuestion.ts against the card's item 1 and the envelope contract.

  • One parser. The file imports parseAskQuestionEnvelope and nothing in ui/packages outside tests spells asked_which, asked as a status, or a limit of its own. The legacy arm, the limits and every refusal are therefore the spec's, and a malformed or over-limit result reaches the console as null and draws as text.
  • The eight conditions of item 1, each found in the code: stream ended (status, and no message still streaming); an envelope after the last user message, in both shapes (the segment rule); reply equals the last assistant text; no user message after it (the last segment must end the list, and a HITL continuation is a user message); nothing queued; no undecided approval in the segment; not skipped; not readOnly.
  • Tried to break the gate. A question that is not the last turn: the segment no longer ends the list, no card, and findQuestions still draws it as past. A reply that is not the last assistant text, or a later text message in the same segment: no card and no question message. Two questions in one batch: the count is 2, no card. A failed tool, an input-only state, a result that is not an object or carries no status: no card. A skipped question after a remount with the same conversation id: stays skipped, with a test. The pane is keyed on the conversation id and remounts when the first send mints it, so no question can be skipped under an undefined id in the console. Tool-call ids on a reload are the stored call ids the result rows are merged by, so the skip key matches across the two shapes. Every case I could not make hold errs towards the plain text and the composer, which is topic acceptance 6.
  • The reader keys on the result's status, not on the tool's name. That is the contract as written (D2: the envelope is the one shape), noted so that it is a known property.

ui/packages/plugin-chatbot/src/chat/questionSkip.ts, useChatConversation.ts, ChatPane.tsx, chat/types.ts against item 7.

  • What is stored: one localStorage key per conversation, objectstack:ai-chat-question-skip: plus the conversation id, whose value is a JSON list of tool-call ids. Nothing else: no question text, no option, no answer. This is item 7 word for word, and the prop's JSDoc, the constant's JSDoc and the changeset each say the same. Reads and writes are in try/catch; a value that is not a list reads as empty. The prefix shares no prefix with the two chat-cache prefixes, so no existing loop mistakes it for a message cache, and purgeChatCaches now clears it on sign-out, with a test.
  • The summary stores nothing. It is derived from the message list on each render; the answered-question state that brings the card back after a refused send is component state.
  • N3 (nit) — the skip key outlives its conversation's message cache: only sign-out removes it. It holds ids only. Follow-up material if conversation deletion ever clears local state.

composerGate.tsx, ChatbotEnhanced.tsx, questionMessage.tsx, QuestionCard.tsx against items 3 to 6.

  • The composer is rendered as the gate's child in every state, hidden and inert while the card holds the place, so it is never unmounted (item 3). The card is answered through onSendMessage (item 4), stays mounted but hidden after an answer, and returns with its choice if the answer is rolled back. The message layer draws the question from the envelope, pending without options and past with them, and Copy still copies message.content (item 5). Regenerate is hidden exactly while the question is pending (item 6). On a readOnly transcript there is no card and the question draws as past (topic acceptance 5).
  • N4 (nit) — a message that draws as a question no longer draws its answer blocks, so a chart carried by the same streamed message would not show while the turn reads as a question. A turn that ends on a clarifying question normally has none. Left as is.

Implemented-by: claude/project-thread-ctejy8
Reviewed-by: session_01L9qibvMMgnKA797JY46H9i

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i

L1-c, the seat's L1 thread · 2026-11-27T15:45Z

席位核对 — L1 @ 19d67fd4b372d42b3761b88dab5d455f1c5b3b2a

Verdict: ACCEPT. The contract review on this head is PASS: comment 7222001372 (brief 7221915957), CONTRACT_REVIEW_TIER, no must-fix and no should-fix. The diff is not Tier H: no governed path, no narrowing, 1219 changed lines. The seat lands it once C4 #37970 has landed and this branch has merged main. They share ChatPane.tsx, and a merge-only delta follows that merge.

Checklist

  • Shape and relation. Draft against base main. The first line is Refs #37874 (items 1-8), and no closing keyword binds any card. Refs is right because item 9, the brightrule smoke after release, belongs to the maintainer, so 问题卡专题 Q2b:问题卡接进对话(findPendingQuestion、顶替输入框且不卸载、对话内摘要、隐藏重新生成、跳过记号) #37874 stays open and keeps pm:dispatched.

  • Items 1–8 against the diff.

    1. findPendingQuestion holds every condition in the card's list 1.1–1.8. It keeps one segment rule for both the streamed and reloaded shapes. The fixtures cover the streamed shape, the reloaded shape, queued, HITL, and two questions in one batch (pendingQuestion-37874, 17 cases).
    2. There are two states, pending and past.
    3. ComposerGate keeps PromptInput mounted, hidden and inert, and gives focus back when it closes.
    4. An answer goes through onSendMessage. A rolled-back send brings the card back with its choice: the answeredQuestion keeps its key.
    5. The question is drawn from the envelope in the message layer, not in renderToolDetail. Copy reads the full reply.
    6. A pending question has no Regenerate.
    7. The skip key is objectstack:ai-chat-question-skip:<id>, with every read and write in try/catch. The prefix is added to purgeChatCaches, and the hook test pins it.
    8. One checklist item, ai.chat-question-card, marked blocked(environment), with automated refs.
  • Scope. 23 files, all inside the claim (7220470053) and its amendments 7220504306 (ChatPane.tsx) and 7221881624 (the README paragraph, ask-question.mdx and the ledger counts, both generated). No locale pack is touched.

  • Changesets, read sentence by sentence.

    • 37874-ask-which-reading-length.md (@objectstack/spec patch). Each of the following is true at this head:
      • the widening, stated exactly: a legacy reading of up to 60 characters is accepted, and nothing newly refused;
      • legacyReadingMaxLength: 60;
      • the E1 figures (7219010387: 37 of 53 over 24, max 54);
      • "every other rule still applies". An empty reply was already refused on main through the envelope's reply.min(1).
    • 37874-question-card-wiring.md (@object-ui/plugin-chatbot, @object-ui/app-shell patch). Every bullet is true against pendingQuestion.ts, composerGate.tsx, questionSkip.ts, ChatbotEnhanced.tsx and ChatPane.tsx. Specifically:
      • QuestionCardQuestion and QuestionCardOption keep their names and shape as aliases of the spec types, with options read-only;
      • the new exports are conversationId and QUESTION_SKIP_STORAGE_PREFIX (index and /core).
    • Both levels follow AGENTS.md: Metadata-protocol: none takes patch.
  • Docs. The plugin-chatbot.mdx paragraph and the README paragraph say the same thing, as the page and the package README already do for the card. Every sentence is true at this head. The regenerated ask-question.mdx matches the JSDoc.

  • Test and gate evidence. The os-dev-report (7221811294) is pinned to 19d67fd4:

    • spec 19/19 and UI 1006/1006 (111 files);
    • dispatch-gates 113/113, with 0 NOT-MEASURED;
    • three ablations: the queued condition (2 red), inert (1 red), and the legacy limit (1 red);
    • overlap-check --pr=37970 clean.

    Check-runs at this head: 61 success, 9 expected skip, 0 failed, 0 pending; Lint & Repo Gates and TypeScript Type Check green. No dogfood battery is owed: no ! in the title and no narrowing arm.

Accepted deviations

  • L2 nits N1–N4 (7222001372) are accepted with no head move:

    • N1: "equals" versus a trimmed compare.
    • N2: two loose sentences in ask-question.zod.ts.
    • N3: the skip key outlives its conversation and is cleared at sign-out.
    • N4: a message drawn as a question drops its answer blocks.

    N1 and N2 are prose in a published file. A later spec PR that touches the module can tighten them.

  • The report lists the README paragraph as out of scope. Amendment 7221881624 since covers it.

…-ctejy8

Brings in #37970 (C4), which also changes ui/packages/app-shell/src/console/ai/ChatPane.tsx; auto-merged with no conflict.

Claude-Session: https://claude.ai/code/session_01L9qibyUpyff7pHe7vkFgA8
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 3a20ecde478fe0712ecbdc1c141d2b1492c20a74
Local-runs: none
Scope: packages/spec/src/ai/ask-question.zod.ts + ui/packages/plugin-chatbot/src/chat/pendingQuestion.ts, ui/packages/plugin-chatbot/src/chat/questionSkip.ts, ui/packages/plugin-chatbot/src/chat/composerGate.tsx, ui/packages/plugin-chatbot/src/chat/questionMessage.tsx, ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx, ui/packages/plugin-chatbot/src/QuestionCard.tsx, ui/packages/plugin-chatbot/src/chat/types.ts, ui/packages/app-shell/src/hooks/useChatConversation.ts, ui/packages/app-shell/src/console/ai/ChatPane.tsx

Delta review, merge only, of the record at 19d67fd4b372d42b3761b88dab5d455f1c5b3b2a (comment 7222001372, PASS). What moved is one merge commit, 3a20ecde, whose parents are 19d67fd4 and main 4af32b99 (C4 #37970 landed).

Read, not reviewed: ui/packages/app-shell/src/assistant/writeApprovalPending.ts at this head (C4's counter, from main).

Check-runs on this head when read: 37 in total, 5 success, 9 skipped, 0 failed, 23 still in progress. Not concluded: Check Changeset, Spec property liveness, Build Core, Build Docs, Build UI Deps, every Type Check family, every Lint family, Live E2E UI, and the two shard planners, so no Test Core or Test UI shard exists yet. This record judges the merge by reading; it answers for no gate that has not concluded, and those conclusions are still owed before the PR is queued. The PR is a draft.

① Derived judgments

  • The PR's net diff is unchanged. git diff 57ab0876 19d67fd4 and git diff 4af32b99 3a20ecde have the same stable patch-id, 17184e011872853f935fff039c9d6653ab8fcd7f, re-derived here: 23 files, 1175 insertions, 44 deletions. Every accept-set and public-surface judgment of the earlier record stands as written.
  • The merge brought nothing into the hits file or the code it rests on. Between 19d67fd4 and 3a20ecde, packages/spec is untouched; under ui/packages/plugin-chatbot only CHANGELOG.md and the package.json version moved; useChatConversation.ts, AiChatPage.tsx, toolResultParsers.ts, hitlContinuation.ts and strict-object.ts are byte-identical. Of the scope files, only ChatPane.tsx moved.

② Semver level

Unchanged: @objectstack/spec patch; @object-ui/plugin-chatbot and @object-ui/app-shell patch; Clause-②: yes (widening) and Metadata-protocol: none. The two changesets are inside the unchanged net diff. Check Changeset has not concluded on this head.

③ Boundary flags

④ Design judgment

No must-fix, no should-fix.

packages/spec/src/ai/ask-question.zod.ts and its implementing files in plugin-chatbot: identical to the reviewed head, and so is everything they call. Nothing changed meaning.

ui/packages/app-shell/src/console/ai/ChatPane.tsx: the merge adds 20 lines from C4 and they sit beside this PR's one prop without touching the question gate.

  • C4 adds two imports, a useAuth read, one call to countWritesAwaitingApproval(runtimeMessages, hitl.decisions) and one effect that calls publishPlanApprovalPending. All of it reads; none of it writes to the message list, to hitl.decisions, or to any prop handed to ChatbotEnhanced. conversationId and toolDecisions reach ChatbotEnhanced exactly as before.
  • The gate's own approval check (hasPendingApproval in pendingQuestion.ts) and C4's counter are two readers of the same two inputs with different jobs. They differ on purpose-level detail (the counter needs a pendingActionId and counts a failed decision as waiting; the gate holds the card back for any undecided approval-requested call in the last segment). Neither feeds the other, so the bus publication cannot open or close the card.
  • The effect's dependency on conversationId does not change when the pane remounts or what the skip marks key on.

Nits carried from the earlier record, unchanged and still open as accepted deviations: N1 (the reply describe says "equals", the reader compares trimmed), N2 (two loose sentences in the spec file), N3 (the skip key outlives its conversation's message cache), N4 (a message drawn as a question does not draw its answer blocks).

Implemented-by: claude/project-thread-ctejy8
Reviewed-by: session_01L9qibvMMgnKA797JY46H9i

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i

L1-c, the seat's L1 thread · 2026-11-27T16:52Z

席位核对 — L1 delta @ 3a20ecde478fe0712ecbdc1c141d2b1492c20a74 (merge-only, from 19d67fd4)

Verdict: ACCEPT. It stands on 7222452293.

  • What moved. One merge, 3a20ecde. Its parents are 19d67fd4 and 4af32b99, which is C4 feat(app-shell): Ask AI opens a new conversation after the user's own close, and the drawer header names the conversation #37970 landed on main. There was no rebase and no other commit.
  • The PR's patch is unchanged. git diff 57ab0876 19d67fd4 and git diff 4af32b99 3a20ecde have the same git patch-id --stable, 17184e01: 23 files, +1175/−44.
  • ChatPane.tsx. C4's publishPlanApprovalPending effect (line 437) and this PR's one conversationId prop (line 796) sit apart. The question gate reads toolDecisions and the message list, not the assistant bus, so the two do not interact.
  • The contract review on this head is the merge-only delta PASS by the same reviewer, comment 7223228054. It has no must-fix and no should-fix, and N1–N4 are carried.
  • Checks at this head: 61 success, 9 expected skip, 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check are green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-27T16:53Z · zone o3-askai (seat card thread)
Head-sha: 3a20ecde478fe0712ecbdc1c141d2b1492c20a74

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 16:54
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 8b47659 Nov 27, 2026
71 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-ctejy8 branch November 27, 2026 17:23
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 protocol:ai size/xl 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.

2 participants