Repository navigation
Conversation
…n a record ADR-0160 D7. The spec member and the console executor in one change: ActionType gains ask_ai (no target, refused at parse beside a target or ai.exposed: true); the runtime keeps it out of every headless door; the console executor pins the record through setChatFocus and opens the drawer, and the action is absent where the console has no assistant that honours a focus. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
…ard headers Gate action:button, action:icon, action:group and action:menu members with useDrawsAction, refuse `actionType: 'ask_ai'` on a dashboard header (it runs on no record), carry `focusServed` in the AI surface fixtures, and teach the two Studio pin tests that `ask_ai` takes no target. Changeset for #37142. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
skills/objectstack-ui/SKILL.md's Action Types table is registered exhaustive over ActionType (check:skill-identifier-liveness), so it gains the ask_ai row and the "requires target" sentence names its second exception. Three edited test files take module-top side-effect imports so the dependency load is paid during collection (check:test-source-alias). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
📓 Docs Drift CheckThis PR changes 2 package(s): 15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 11 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 181 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 01f4b0175f121659106e6394910aa0e69af9613f && git checkout 01f4b0175f121659106e6394910aa0e69af9613f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8032d958f2f2892d02e7e4b3cb13da2242f747bb 76f9cdab6ad3334c1e5438da6740969d1f202845 && git checkout -B drift-repro 8032d958f2f2892d02e7e4b3cb13da2242f747bb && git merge --no-ff 76f9cdab6ad3334c1e5438da6740969d1f202845
node scripts/docs-audit/affected-docs.mjs --json 8032d958f2f2892d02e7e4b3cb13da2242f747bb
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract-review-claim: session_01JQwxbZeHNsF3RWcWpj7rGj · head 076ed68 · 2026-11-25T04:10Z |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe spec half and the absent-not-disabled draw gate are sound and well tested. The gap is on the three surfaces that hold no single record. There the action is drawn, and then it is disabled, behaves wrongly without saying so, or points at the parent record. Findings
Implemented-by: VERDICT: FAIL |
Review round on #37215. The bulk bar never offers an ask_ai action (its type is on a promoted def's actionDef), ActionRunner.bulkRefusal refuses a per-row run over a selection, and ActionEngine.getBulkActions / executeBulk leave it out. A list header draws it only while exactly one row is selected, rather than greyed out with a reason. A related list's toolbar leaves it out (its rows still draw it). The click opens the drawer on an agent that declares capabilities.focus, so the drawer's pin control is drawn on the record. The page-record path reads recordIdField too. resolveAiApiBase moves to its own module so useAskAiHandler does not import useAiSurface, which layout tests replace with a mock. The showcase app gains an ask_ai action, as its coverage test requires every ActionType. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
…ber) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
…write The list header ask_ai test assigned a module variable inside a component, which the React compiler lint refuses (Lint UI, app-shell). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: 2026-11-25T09:58Z — delta read after the FAIL at Prior findings
Merge sanityAcross both merges, the PR face of the first review's Scope files is unchanged: 19 files, +248 −35. The added and removed lines hash the same at Findings in the delta
Declarations and CI
Implemented-by: VERDICT: FAIL |
…, not the one on screen
With the drawer already open on another conversation, the click pinned the
record to that conversation and then switched away from it: the thread the
drawer moved to had no focus, and the one left behind kept a stray pin.
The handler now opens a fresh thread of the focus-honouring agent first and
pins the record with `setChatFocus(focus, { follow: true })`: a host showing
a conversation keeps that conversation's focus and gives this one to the next
conversation it shows (carried onto the id the first send mints). Pinned
against the real dock body and focus host, with both halves ablated.
bulkRefusal's docblock now says why it reads the type alone.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZNHwt6dj15KeoAPMP
Requested by Warren · project thread
Fixes #37142
维护者速读
type: 'ask_ai'),点了就把站内助手对准这条记录并展开,不发消息、不调服务端。target与ai.exposed: true写在它旁边会在解析时被拒;没有站内助手、或手上不是恰好一条记录(批量栏、相关列表工具栏、列表头未选或多选)时按钮不出现,而不是置灰。What changes
ADR-0160 D7 — an action on one record that focuses the in-app assistant on that record and opens it.
Spec (
@objectstack/spec)ActionTypegainsask_ai. It is outside the target-required set: it takes notarget.ActionSchemaandInlineActionSchemarefuse atargetbeside it (inlinetotoo) at thetargetpath, andai.exposed: trueatai.exposed(falseparses).bodystaysscript-only.DashboardHeaderActionSchemarefusesactionType: 'ask_ai'atactionType: a header runs on no record.WidgetActionTypeSchemastays derived fromActionType.Runtime (
@objectstack/runtime)isHeadlessInvokableActionanswersfalseforask_ai, so MCPlist_actionsskips it and the AI posture of the action door refuses it, whatever a stored row carries beside the type.headlessActionTypeErroranswers the REST door with a sentence about the in-app assistant instead of the generic "opens itstarget".Console
@object-ui/core:ActionRunnergets anask_aiexecutor that hands{ object, id }to the installedAssistantFocusHandler(setAssistantFocusHandler) and nothing else: no registered handler, no fetch, no success toast unlesssuccessMessageis declared. The record is the row a row surface stashed (recordIdFieldhonoured), else the page record, else the one selected row. No record, or several selected, is refused before anyconfirmText; so is a launch with no handler installed.drawsAction()answers whether an action is drawn;ActionEngine.getActionsForLocationandgetBulkActionsleave undrawn actions out.isAskAiActionreadstypeand the legacyactionType.@object-ui/react:<ActionProvider onAskAi>installs the handler (the latest one runs; the gate identity changes only when the handler appears or goes) anduseDrawsAction()answers for every surface under it; with no provider,ask_aiis not drawn.@object-ui/app-shell:useAskAiHandlerreturnsdock.open({ agent, fresh: true })+setChatFocus(focus, { follow: true })only when the layout hosts the chat drawer (useChatDockControl, which is null when the AI surface is off) and an agent in the catalog advertisescapabilities.focus(useAiSurfaceEnabled().focusServed); the console action runtime passes it asonAskAi.ask_aiaction (the type of a promoted def is read off itsactionDef);ActionRunner.bulkRefusalrefuses a per-row run over a selection (the grid's per-record bulk dispatch asks it), andActionEngine.getBulkActions/executeBulkleave it out. A list header draws it only while exactly one row is selected, and leaves it out (not greyed) with none or several. A related list's toolbar leaves it out, because a launch there runs on the parent; its rows still draw it.capabilities.focus(focusAgentName, anaskagent first), so the drawer's pin control, which asks the active agent, is drawn, and pins the record to that thread.setChatFocus(focus, { follow: true })(new option): a host showing a conversation keeps that conversation's focus and gives this one to the next conversation it shows; the first send carries it onto the id it mints, and an unsent fresh thread creates nothing.resolveAiApiBasemoves tohooks/aiApiBase.ts(re-exported fromuseAiSurface), souseAskAiHandlerdoes not import a module many layout tests mock.useDrawsAction()beside its existing gates: record header/DeclaredActionsBar,action:bar,action:button,action:icon,action:group,action:menu, element buttons, container action filters, grid row menu and actions column, data-table row actions, related-list toolbar, bulk action bar.Tests
packages/spec/src/ui/action-ask-ai.test.ts: member, parses with no target, refusals attarget/ai.exposed(both in one parse),ai.exposed: falseaccepted,bodyrefused, inline refusals, neighbours keep their rules.packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts: header refusal, vocabulary still derived, other types still accepted.packages/runtime/src/action-ask-ai-headless.test.ts: not headless-invokable (with or without automation, and for an at-rest row carryingtarget/body/ai.exposed), REST sentence.ui/packages/core/src/actions/__tests__/ActionRunner.askAi-37142.test.ts: click hands the record once and sends nothing (fetch stub, script handler, toast unspied), row / scoped / selected record readings, refusals before confirm, not drawn without a handler,ActionEnginefiltering.ui/packages/react/src/context/__tests__/ActionProvider.askAi-37142.test.tsx: drawn only withonAskAi, gate identity, latest handler runs, no provider.ui/packages/app-shell/src/hooks/__tests__/useAskAiHandler-37142.test.tsx,useAiSurface.test.ts(focusServed),views/__tests__/DeclaredActionsBar.askAi-37142.test.tsx(absent without assistant, drawn and focuses with one; ablation of the filter turns it red).skills/objectstack-ui/SKILL.md: one table row and one sentence (164 → 165 lines); the token ratchet stays under its ceiling.ui/packages/core/src/actions/__tests__/ActionRunner.askAi-37142.test.tsaddsbulkRefusal,getBulkActions/executeBulkand page-recordrecordIdField;plugin-grid/src/__tests__/BulkActionBar.askAi-37142.test.tsx,plugin-detail/src/__tests__/RelatedList.toolbarAskAi-37142.test.tsx,app-shell/src/views/__tests__/objectViewHeaderLaunchGate.askAi-37142.test.tsxpin the three no-single-record surfaces;useAskAiHandler-37142pins the agent it opens.ui/packages/app-shell/src/layout/__tests__/chatFocus-36999.test.tsx(objectstack#37142 block): the real dock body and focus host under a realuseAskAiHandler; a drawer open on another conversation keeps that conversation's focus and the fresh thread's first send carries the record; a drawer on an unsent thread takes it at once. Ablated: withoutfollow, and withopen({ agent })instead of the fresh thread, the first case fails.ActionType.options(spec row-update, undoable, inline; Studio presets and type-switch pins).Acceptance notes
ask_aiin its Type picker (its option list is hand-written); authoring is code / metadata only for now.paramsbesideask_aiare not refused (inert); a record-less location such aslist_toolbaris not refused at parse — the action is absent there unless exactly one row is selected, and the runner refuses a launch that reaches it anyway.ConsoleShellaction runtime sits above the chat dock, soask_aiis absent there; per-view runtimes inside the layout get it. DirectuseActionRunnerowners get no handler, soask_aiis absent for them.form.tsx(update-operation actions only) and the managed-by empty state are not gated.Verification
@objectstack/spec: full suite 892 files / 28329 tests pass.@objectstack/runtime: typecheck pass; ask_ai + declarative-update tests pass.@object-ui/core4789,@object-ui/react1601,@object-ui/components4966,@object-ui/plugin-grid2783,@object-ui/plugin-detail3941 tests pass; type-check passes on all six ui packages.@object-ui/app-shell: hooks, console, metadata-admin, studio-design andDeclaredActionsBartests pass (1204 files after the two pin fixes).076ed686:@object-ui/core248 files / 4792 pass; plugin-grid__tests__+ components 272 files pass; plugin-detail RelatedList / RecordRelatedListRenderer 73 files pass; app-shell layout + hooks + console/home 311 files pass, views 220 files pass;@objectstack/example-showcase49 files / 554 pass; type-check passes on core, plugin-grid, plugin-detail, app-shell. New tests each turn red when their fix is removed (list header 3/3, bulk bar 1/1, related-list toolbar 1/1, and the two CI-red AppHeader files fail again with the old import).scripts/pm/dispatch-gates.mjs --commandsfor this change set (131 commands): all pass except three that could not measure in this container —check-plugin-teardown-shape --self-test(needs an unshallow clone),check:dual-build-cjs-loads(needs every package'sdist/);check:skill-examplespassed on a re-run once the spec build had finished. CI runs them in full.Clause-②: yes
Metadata-protocol: added
Skills-docs: follow-up #37217
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code