Repository navigation
Commit 9609c13
feat(spec)!: retire the ask_ai action type (ADR-0160 D7) (#37924)
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao3kn7MME6XXkhPoFyJyisdQ)_
Fixes #37856
Fixes #37827
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37857
## 维护者速读
- 作者和终端用户:记录页、列表行、仪表盘上不再有「问 AI」动作按钮,进入助手只走页头的「问 AI」入口,它自动带上当前记录。
- 属于「问 AI」入口专题:按维护者裁定,在 19.0.0 正式版之前撤掉只在预发布版出现过的这个动作类型。
-
已写了这种动作的作者会在校验时看到一句处方;升级命令能删的自动删,被引用的留给作者手删;库里已存的这种动作直接不显示,可按名删除。正式版前撤回本
PR 即可恢复。
- 要你做什么:批准合入;请在下一个预发布版之前合入(技能文档那张卡 #37937 已先合,技能示例检查已绿;next.1
已经带上了技能的改动,本 PR 合入后两边才一致)。
## What changes
ADR-0160 D7, seventh amendment: `ask_ai` leaves `ActionType` before
19.0.0 with no compatibility shim. It was published only on
`19.0.0-next.0`.
- **Refusal with one prescription**
(`packages/spec/src/ui/action-ask-ai-retired.ts`, not barrel-exported)
in every slot that takes an action type: `ActionType` (now
`enumWithRetiredValues`, so the dashboard header's derived `actionType`
refuses it too), a declared or inline action's `type`, `actionType` on
`action:button` / `action:icon` rows, and `type` on `action:group` /
`action:menu` members.
- **ADR-0087 kit**: D2 conversion `action-type-ask-ai-removed` (retired
from the load path, `retiredAfter: '18.6.0'`) and D3 entry
`ui-action-type-ask-ai-retired`. `ConversionContext.atRest` tells the
two doors apart:
- over sources (`os migrate meta --from 18`) a declared `ask_ai` action
is deleted only when no string anywhere else in the stack names it; a
named one stays as written with every reference, and is listed by the D3
entry. (The conversion's `reportTodo` call is not reached in production:
`os migrate meta` passes no context, and at rest `keep` is always false.
L2 N1, 7218663105.) The conversion never deletes a reference.
- at rest (stored rows, built artifacts) every `ask_ai` action, row and
member is deleted.
- **Stored seam answers "no item"**: `applyConversionsToStoredItem`
returns `undefined` when the chain leaves nothing of a row. Its callers
in `metadata-protocol` (overlay reads, list drafts, registry hydration,
diff load, package duplicate/import), `metadata` (`DatabaseLoader`),
`core` (authored translation sync) and `service-datasource` serve and
register nothing for such a row. `DatabaseLoader` still reads a row's
identity (name, object binding) from the stored body, so the delete door
reaches it. `migrateStoredMetadata` lists it `skipped` with `DELETE
/api/v1/meta/action/<name>` instead of re-saving it.
- **Removed with the type** (revert of b7dee0e, adapted):
ActionRunner's ask_ai executor and `setAssistantFocusHandler` /
`drawsAction` / `isAskAiAction`; `<ActionProvider onAskAi>` and
`useDrawsAction()`; the renderers' drawn-action gates;
`useAskAiHandler`; `setChatFocus` and its hosts. The conversation pin
from #36999 stays, set from the composer chip only. #37827 (the record
page dropping the handler) closes because the handler is gone.
- `ActionType`'s live members are now the non-exported
`ACTION_TYPE_VALUES` array it wraps.
`scripts/check-skill-identifier-liveness.mjs` binds the `### Action
Types` table to it (the `SeedMode` precedent). This one gate file is
outside the claim's file surface; it is the only way that gate can read
the enum now.
## Tests
- `packages/spec/src/ui/action-ask-ai-retired.test.ts`: the refusal and
its path in each slot, with live-type controls.
- `packages/spec/src/conversions/action-type-ask-ai-removed.test.ts`:
source keeps the named action and deletes the unnamed one, lists the D3
entry, and reports the todo when a context is passed (a test-only path;
see above); at rest deletes both; idempotent; stored seam answers
`undefined` for an ask_ai `action` row and strips only the action from
an object row.
- `packages/spec/src/shared/retired-key-removal-version.pin.test.ts`:
the conversion joined to its prescriptions (names 19.0.0 and `--from
18`).
-
`packages/metadata/src/loaders/database-loader-ask-ai-retired-row.test.ts`
(real SQLite): load serves nothing, `exists` and `delete` reach the row,
and a same-name write keeps the two object bindings apart. Ablation:
reading identity through the converted body turns the last case red.
-
`packages/metadata-protocol/src/protocol.stored-ask-ai-retired-row.test.ts`:
the stored pass lists the row `skipped` with the delete door, an apply
run writes nothing, the list read serves only the live row. Ablation:
removing the skip branch turns two cases red.
## Acceptance notes
- **Landing order**: C1s #37857 (PR #37937) merged first as `4de4e3e9`,
and this branch merged it (`24857955`, head `ffd87c6a`).
`check:skill-examples` is green on the merged tree (351 examples). The
release PR #37661 (`30a8047b`, `19.0.0-next.1`) merged between the two,
so a next.1 published from that tree has the skills without the `ask_ai`
teaching while the spec still parses it. This PR closes that window and
should land before the next prerelease. The record is on #37937.
- **Baselines**: `check:api-surface`, `check:authorable-surface` and
`check:generated` are green with no baseline file changed. The reference
pages under `content/docs/references/` are regenerated (the enum lists
lose `ask_ai`).
- `git grep -n ask_ai` outside `skills/**`, `docs/adr/**`,
`.changeset/pre/` and the CHANGELOGs leaves only the prescription and
its two schema call sites, the conversion and its semantic entry, and
their tests. The Studio canvas strings (`designer.canvas.askAi*`) are
untouched.
- `.changeset/pre/37142-ask-ai-action-type.md` and the `setChatFocus`
line of `.changeset/pre/36999-conversation-focus.md` are left as
written. This PR's changeset carries the correction. Whether the
prerelease texts themselves change is for the release owner.
- **brightrule**: it declares `brightrule_policy_ask` (`type: 'ask_ai'`)
and has to drop it before it moves to a build with this change. It was
not booted here, and this repo cannot read its source. The card's
acceptance line "brightrule boots on the new version" is a release gate,
not a merge gate. It is carried by brightrule's owner, epic:#5027#1, who
gets a Notify with the merge sha on #37634.
## Verification
<details><summary>Readings</summary>
- spec: `vitest run` full package 976 files / 29,727 tests, 1 red before
the pin join (fixed, 68/68 after); `src/ui src/conversions
src/migrations` 224 files / 7,701 tests green.
- typecheck green: spec (`tsc` + `check:test-typecheck`), metadata,
metadata-protocol, core (+ test typecheck), runtime (+ test typecheck),
service-datasource, `@object-ui/core`, `react`, `components`,
`plugin-grid`, `plugin-detail`, `app-shell`.
- metadata `database-loader.test.ts` + new file: 502 green.
metadata-protocol new file: 3 green.
- `dispatch-gates.mjs --commands`: 128 commands run. Red found and
fixed: `check:generated` / `check:test-typecheck` (stored seam's
`undefined` in 4 existing tests), `check:skill-identifier-liveness`,
`check:engine-double-contract` (ledger `--write`),
`check:objectql-double-limit`, `check:test-source-alias`. Prerequisites
cleared: `check:published-readme-exports`, `check-plugin-teardown-shape
--self-test`. Still red: `check:skill-examples` (order above).
- dogfood battery on the final head `ffd87c6a`: passed under the verify
lock (VERDICT command-exit 0), 490 test files passed and 3 skipped, 4144
tests passed and 68 skipped, 0 failed. This is the CI command with no
shard. The os-dev-report for this head is 7222528251.
</details>
Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
src/ui/action-ask-ai-retired.test.ts
src/conversions/action-type-ask-ai-removed.test.ts`. Expect 2 files
green.
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a9901ed commit 9609c13
95 files changed
Lines changed: 1456 additions & 1888 deletions
File tree
- .changeset
- content/docs
- protocol/objectui
- references
- data
- kernel
- ui
- ui
- examples/app-showcase/src
- system/translations
- ui
- actions
- pages
- packages
- core/src/fallbacks
- drivers/driver-sql/src
- metadata-protocol/src
- metadata/src/loaders
- runtime/src
- services/service-datasource/src
- spec/src
- conversions
- entries/19
- data
- migrations/entries/semantic
- ui
- scripts
- ui/packages
- app-shell/src
- console
- __tests__
- ai/__tests__
- home/__tests__
- hooks
- __tests__
- layout
- __tests__
- views
- __tests__
- metadata-admin
- inspectors
- previews
- studio-design
- components/src/renderers
- action
- basic
- complex
- layout
- core/src/actions
- __tests__
- layout/src/__tests__
- plugin-detail/src
- __tests__
- plugin-grid/src
- __tests__
- components
- react/src/context
- __tests__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
225 | 224 | | |
226 | 225 | | |
227 | 226 | | |
228 | | - | |
| 227 | + | |
229 | 228 | | |
230 | 229 | | |
231 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
423 | 422 | | |
424 | 423 | | |
425 | 424 | | |
| |||
430 | 429 | | |
431 | 430 | | |
432 | 431 | | |
433 | | - | |
| 432 | + | |
434 | 433 | | |
435 | 434 | | |
436 | 435 | | |
| |||
0 commit comments