Skip to content

Commit 4de4e3e

Browse files
docs(skills): objectstack-ai no longer teaches an authored AI button on a record page (#37937)
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_01AXsQkLFKRdQCqQ3RTr6Jao3PpF4t89AvwzCmzVRuQMwV)_ Part of #37857 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:对外发布的 AI 技能文档不再教作者在记录页自己放 AI 按钮,换成一句话:用页头的「问 AI」入口,它自动带上当前记录。应用的使用者无感。界面技能里动作类型表的那一行这次没动,要等类型本身撤掉才能删。 - 为什么做:「问 AI 入口改造」专题已定全站只留一个入口,「页面里加按钮」的需求作废。 - 出错会怎样:只改了文档和一条评测样例;写错的话,用这份技能的 AI 作者会答错怎么加 AI 按钮,撤回本 PR 即可恢复。 - 要你做什么:批准这个受管 PR。它先合,撤掉该动作类型的 PR(#37924,撤类型本身)后合,两者同一个版本发出。 ## What changes - `skills/objectstack-ai/SKILL.md`: the subsection *The Ask AI button* under *Actions as AI Tools* leaves, with its `os:check` `defineAction` example (25 lines). One sentence stands in its place (3 lines): > **No page declares an AI button of its own**, so there is no action to write for one: the shell's 「问 AI」 entry opens the in-app assistant and carries the current record automatically. - `skills/objectstack-ai/evals/skills-tools-knowledge.json`: case 10 keeps its id and its prompt (an Ask AI button on the contract record page) and now expects the opposite answer: no action is written, and the answer names the shell's 「问 AI」 entry. `must_contain` is `问 AI`; `must_not_contain` is `defineAction(` and `locations:`. - `scripts/check-skills-token-ratchet.mjs`: the row of `skills/objectstack-ai/SKILL.md` follows the measurement down, 6799 to 6617. The gate asks for this in the PR that shrinks the file ("Lower the row to 6617 in this PR"). - `.changeset/37857-skill-no-authored-ai-button.md`: `@objectstack/skills` patch. `skills/**` ships as that package's `dist`. **Not in this pull request, and why the first line says `Part of`.** `git grep -n ask_ai -- skills/` still prints two lines, both in `skills/objectstack-ui/SKILL.md` (151, the table row; 153, the sentence under the table). They cannot leave before the type does: `pnpm check:skill-identifier-liveness` holds the *Action Types* table row for row to the members of `ActionType`, and on `main` the member is still there. Measured on this branch with the row deleted: > [leg2-missing-row] skills/objectstack-ui/SKILL.md — ### Action Types is registered exhaustive over `ActionType` (packages/spec/src/ui/action.zod.ts) and does not document `ask_ai`. The gate's other remedy, a gap entry in its ledger, is marked maintainer-only, so it was not taken. The two lines are restored here byte for byte, and the card stays open for them. The seat decides who deletes them: #37924 itself, where the member leaves, or a second small pull request on this card after #37924 merges. ## Why ADR-0160, seventh amendment (2026-11-27), D6 "Entry point": "the shell's 「问 AI」 button, and no other. Its text is the same in every application, and no application renames it. No page declares an AI button of its own". The maintainer's rulings behind it, as the ADR quotes them: 「"页面里加按钮"的需求 作废」 and 「撤掉 ask_ai(#37834 方案 B)」. The card asks for the teaching to leave the published skills and, where a sentence is needed, for one that says the shell's 「问 AI」 entry carries the current record automatically. The replacement sentence says that and nothing about the parse: what a legacy action meets is #37924's to build and to word. ## Landing order This pull request lands **before** #37924 (the pull request that retires the action type); both ship in the same release. Reason, measured by the card thread on #37924's head `ca52b5be`: `pnpm --filter @objectstack/spec run check:skill-examples` is red there with one error, `skills/objectstack-ai/SKILL.md:188:3 TS2322`, the `os:check` example this pull request deletes, which no longer type-checks once `ActionType` loses the member. With this merged first, that example is gone from `main` before #37924 needs it gone. Between the two merges `main` holds a skill that says no page declares an AI button while the type still parses, and the `objectstack-ui` table still lists it. Both ship together, so no published version carries that state. ## Tests Head `7eb79ca6`, merge base `73d5e347`. Published-skills size (lines; tokens in the ratchet's own convention, `ceil(utf8 bytes / 4)`, stamp line excluded): | | before | after | |:--|--:|--:| | `skills/objectstack-ai/SKILL.md`, lines | 487 | 465 | | `skills/objectstack-ai/SKILL.md`, tokens | 6799 | 6617 | | all 14 `SKILL.md`, lines | 4959 | 4937 | | all 14 `SKILL.md`, tokens | 65451 | 65269 | | whole shipped tree, tokens | 301286 | 301061 | Net lines across `skills/**`: +6 / -28 = -22 (the eval file is +3 / -3). <details> <summary>Skill gates (each exit code captured before any pipe)</summary> ```text node scripts/check-skills-token-ratchet.mjs :: exit 0 ✓ check-skills-token-ratchet: 61 authored bundle file(s) within their ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured, not ratcheted. node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0 ✓ check-skills-token-ratchet self-test: 111 cases pass. pnpm check:skill-identifier-liveness :: exit 0 check-skill-identifier-liveness OK — Leg 1: 564 citation(s) over 76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0 ledgered gap(s). pnpm check:skill-links :: exit 0 ✓ check-skill-links: 272 relative link(s) in 76 published skill file(s) resolve; 140 fragment(s) name a real heading under GitHub's slug rule. pnpm check:pm-skill-id-lint :: exit 0 ✓ check-skill-id-lint: 134 file(s) clean pnpm check:skill-compatibility :: exit 0 pnpm check:skill-frame-sync :: exit 0 pnpm --filter @objectstack/spec run check:skill-docs :: exit 0 ✅ Skill docs in sync pnpm --filter @objectstack/spec run check:skill-refs :: exit 0 ✅ 10 generated files in sync with packages/spec pnpm --filter @objectstack/spec run check:skill-examples :: exit 0 ✅ 351 prose examples type-check across 3 surface(s) pnpm --filter @objectstack/spec run check:skill-served-sections :: exit 0 ✓ check-skill-served-sections: 24 served section(s), each heading exactly once in its file ``` The last three are outside the derived list and were run because they read `SKILL.md`. `check:skill-examples` needed `@objectstack/spec` and the `@objectstack/client-react` closure built first (47 turbo tasks, under the verify lock). </details> <details> <summary>Derived gate list and its reconciliation</summary> ```text node scripts/pm/dispatch-gates.mjs --commands → 67 command(s) node scripts/pm/dispatch-gates.mjs --ran RECORD → ✓ dispatch-gates --ran: 67 derived famil(ies) accounted for — 66 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3). ``` 66 exit 0. NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3, "PREREQUISITE NOT MET — this gate reads built output, and some package has no dist/". It needs the whole workspace built; this diff changes no package, so the build was not made for it and CI's run is the reading. </details> <details> <summary>The eval case through the real reader and grader</summary> ```text loadSkillEvalCatalog(skills/): bundles 14 · cases 368 · refusals 0 case objectstack-ai/skills-tools-knowledge#10: must_contain ["问 AI"] · must_not_contain ["defineAction(", "locations:"] its reference answer against its own grader: {"pass":true,"missing":[],"forbidden":[]} an answer that writes the action: {"pass":false,"missing":["问 AI"],"forbidden":["defineAction(","locations:"]} ``` </details> <details> <summary>The test that names the edited gate script</summary> ```text pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 scripts/platform-catalog.test.ts Test Files 1 passed (1) Tests 20 passed (20) os-verify-lock: VERDICT command-exit 0 ``` </details> No behaviour a test pins changed, so no ablation was made. ## Acceptance notes - **Acceptance is met in part.** "`git grep -n ask_ai -- skills/` is empty" is not reachable in a pull request that lands before the type leaves; two lines remain, as said above. "Skill checks pass" holds on this head. - **File surface.** The claim names `skills/**` only. Two files outside it are in the diff, each forced by a gate the card orders green: the ratchet row (one number and a three-line comment in `scripts/check-skills-token-ratchet.mjs`) and the changeset. Neither path is under `packages/**` or `docs/adr/**`. - **Why case 10 is kept and turned, not deleted.** The prompt is the request the maintainer voided, and it is the one an assistant will keep receiving; the case now measures whether the sentence above stops an authored action. The eval reader takes ids as given and asks only that they are unique in a file, so 11 and 12 keep their numbers. A `must_not_contain` on the type's literal name was not available (the card's grep forbids it under `skills/`); `defineAction(` and `locations:` are tokens only an authored action carries, and the reference answer spells neither. - **The entry's name.** The sentence and the eval use 「问 AI」, as the ADR and the card do. The console's English bundle labels the entry `Ask AI` today (`ui/packages/i18n/src/locales/en.ts`, `askAI`). Noted, not acted on: where the button is drawn and what it reads in each locale is #37858's. - **`objectstack-ui` gets no sentence here.** A line saying no page declares an AI button would sit under a table row that teaches the type. It belongs with the deletion of that row. - **Claim.** The seat's `Claim:` comment on #37857 is 7217200370, naming this branch. (The drafter read the card before it landed and saw zero comments; the work ran on the dispatch order's claim block, which is the same text.) ## Verification Read first, by risk: 1. `skills/objectstack-ai/SKILL.md`, the hunk at line 174: the replacement sentence is published text. Check it says no more than ADR-0160 D6 and nothing #37924 has yet to build. 2. `skills/objectstack-ai/evals/skills-tools-knowledge.json`, case 10: the two assertion lists. 3. `scripts/check-skills-token-ratchet.mjs`: one row, 6799 to 6617, lowered only. Two-minute verification: `git grep -n ask_ai -- skills/` prints exactly two lines, both in `skills/objectstack-ui/SKILL.md` (151 and 153), and `node scripts/check-skills-token-ratchet.mjs` ends with its ✓ line. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (no schema touched) - [x] 2. Every name I added uses the casing for its kind. (no name added) - [x] 3. No formatter ran; `pnpm lint` passes. (no formatter ran; the repo-wide lint is CI's run) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched; `check:skill-docs` and `check:skill-refs` report in sync) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. (the maintainer summary is Chinese by the fleet's rule; quoted rulings are kept as written) - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibwetA7wdKM2c8khHDC)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent dc45b1e commit 4de4e3e

4 files changed

Lines changed: 26 additions & 29 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): `objectstack-ai` no longer teaches an authored AI button on a record page
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
ADR-0160, seventh amendment (D6, "Entry point"): the entry to the in-app assistant is the shell's 「问 AI」 entry, and no page declares an AI button of its own.
11+
12+
`skills/objectstack-ai/SKILL.md`: the subsection *The Ask AI button — `type: 'ask_ai'`* under *Actions as AI Tools* is removed, with its `defineAction` example. One sentence stands in its place: no page declares an AI button of its own, so there is no action to write for one, and the shell's 「问 AI」 entry opens the in-app assistant and carries the current record automatically. The file's token ceiling follows the measurement down, 6791 to 6609.
13+
14+
`evals/skills-tools-knowledge.json`: case 10 keeps its prompt, an Ask AI button on the contract record page, and now expects the opposite answer: no action is written, and the answer names the shell's 「问 AI」 entry. Its `must_contain` is that entry's name, and its `must_not_contain` holds `defineAction(` and `locations:`, two tokens that only an authored action carries.
15+
16+
The `objectstack-ui` action-type table is unchanged: it is held row for row to the members of `ActionType`, which still include `ask_ai`.

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@ export const CEILINGS = new Map([
447447
// with `main`. Two retired-key rows name their replacements; one sample
448448
// instruction line left the skill example and over-paid by 4 tokens.
449449
// 6795 -> 6791 (#37782): the `agent.tools` row no longer teaches an aged-out migration; LOWERED to the measurement.
450-
['skills/objectstack-ai/SKILL.md', 6791], // -18 (was 6824), then -5 A2′ (was 6806)
450+
// 6791 -> 6609: the section that taught an authored AI button on a record
451+
// page is replaced by one sentence (ADR-0160 D6, "Entry point": the shell's
452+
// entry is the only one); the row follows the measurement down.
453+
['skills/objectstack-ai/SKILL.md', 6609], // -18 (was 6824), then -5 A2′ (was 6806)
451454
// -12 (was 6331): the `http.server` decision-table row dropped a trailing
452455
// clause that taught `contributes.routes` as a key that "parses but serves
453456
// nothing". The key is retired — an authored entry is now REFUSED, carrying

‎skills/objectstack-ai/SKILL.md‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -170,31 +170,9 @@ decided entirely by the skip rule above — `actionSkipReason(action, ctx)` and
170170
`actionRequiresApproval(action)` (from `@objectstack/service-ai`) answer both
171171
questions, and Studio's "AI exposure" diagnostics use the same predicates.
172172

173-
### The **Ask AI** button — `type: 'ask_ai'` ☁️
174-
175-
Pins the assistant's conversation to the record the action runs on and opens
176-
it, sending no message. Declare it on the object, in
177-
`locations: ['record_header']` or `['record_more']`:
178-
179-
<!-- os:check -->
180-
```typescript
181-
import { defineAction } from '@objectstack/spec';
182-
183-
export default defineAction({
184-
name: 'ask_about_contract',
185-
label: 'Ask AI',
186-
objectName: 'contract',
187-
type: 'ask_ai',
188-
locations: ['record_header'],
189-
});
190-
```
191-
192-
It names nothing and is never a tool: the parse refuses a `target`,
193-
`ai.exposed: true`, and `actionType: 'ask_ai'` on a dashboard header (a header
194-
runs on no record). Nothing serves it headless: `list_actions` skips it,
195-
`run_action` refuses it, and no `action_` tool exists for it. The console draws
196-
it only where the assistant surface is on **and** the AI service honours a
197-
conversation focus; elsewhere it is absent, not disabled.
173+
**No page declares an AI button of its own**, so there is no action to write
174+
for one: the shell's 「问 AI」 entry opens the in-app assistant and carries the
175+
current record automatically.
198176

199177
---
200178

‎skills/objectstack-ai/evals/skills-tools-knowledge.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@
9494
{
9595
"id": 10,
9696
"prompt": "Add an Ask AI button to the contract record page, so a user can ask the assistant about the contract they are looking at. Write the action.",
97-
"expected_output": "Emits a `defineAction` with `type: 'ask_ai'`, `objectName: 'contract'` and `locations: ['record_header']` (or `['record_more']`), with no `target` and no `ai.exposed: true`: the action pins the assistant's conversation to the record and opens it, sending no message. States that it is never a tool (`list_actions` skips it, `run_action` refuses it, no `action_` tool exists for it) and that the console draws it only where the in-app assistant is on and honours a conversation focus; elsewhere it is absent, not disabled.",
97+
"expected_output": "Writes no action: no page declares an AI button of its own. The in-app assistant is opened from the shell's 「问 AI」 entry, which carries the current record automatically, so a user on the contract record page asks about that contract with nothing authored. Adds no `defineAction`, no entry under the object's `actions`, and no button on the page for it.",
9898
"files": [],
9999
"assertions": {
100-
"must_contain": ["ask_ai", "record_header", "locations"],
101-
"must_not_contain": ["target:"]
100+
"must_contain": ["问 AI"],
101+
"must_not_contain": ["defineAction(", "locations:"]
102102
}
103103
},
104104
{

0 commit comments

Comments
 (0)