Repository navigation
feat(spec)!: retire the ask_ai action type (ADR-0160 D7) - #37924
Conversation
Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
…7856) Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
…he read, delete and stored-pass doors (#37856) Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
…name write (#37856) Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
…moval-version pin (#37856) Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
…erted row (#37856) Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
…und the new engine double (#37856) Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
…37856) Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 6 package(s): 19 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 13 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 189 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 e900295bdf07f3680d2c5bef1e0e3be14c48db00 && git checkout e900295bdf07f3680d2c5bef1e0e3be14c48db00
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 581ae76a23c6b3ba8e2b69e7d8a920838bc51194 d8f1d4e55a4578e55ee0caae820d0b2b09364382 && git checkout -B drift-repro 581ae76a23c6b3ba8e2b69e7d8a920838bc51194 && git merge --no-ff d8f1d4e55a4578e55ee0caae820d0b2b09364382
node scripts/docs-audit/affected-docs.mjs --json 581ae76a23c6b3ba8e2b69e7d8a920838bc51194
|
…sts that read a converted row (#37856) Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T12:45Z — the brief handed to the isolated contract reviewer whose record follows, posted for the seat to read before adopting it. Contract review brief — PR #37924 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: Read: card #37856 body and its 3 comments, #37827 body and its 4 comments, the PR body, the net diff ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe narrowing makes the spec's own refusal real; it takes no declared capability away at a consumer. ADR-0160 D7 on main (seventh amendment) retires the type by the maintainer's ruling, and the type was published only on S1 (should-fix) — two stored-row readers outside the diff treat the seam's
S2 (should-fix) — D7.3 charges this card to pin by test that the delete door still reaches such a row, and names that door as the metadata API's delete. The N1 (nit) — the conversion's N2 (nit) — the stored-row conversion warning ends "re-save it (Studio edit, save, or run os migrate meta --stored --apply)". Neither clears an N3 (nit) — the changeset does not name N4 (nit) — Could not read: the withheld security findings; the check-runs still in progress; brightrule, cloud and hotcrm sources. Implemented-by: VERDICT: PASS |
… draft and no overlay The preview-draft arm of the by-name read and the layered read's served, orphan and draft layers took the stored seam's `undefined` (an ask_ai action row, ADR-0160 D7) for a served body. Each now treats it as no row: the preview read falls through to the active item, the layered read reports no overlay and no pending draft. Pinned with the metadata API's delete reaching such a row. The changeset names ActionRunner.bulkRefusal and AiSurfaceState.focusServed among the removals. Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: Delta review of ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentS1: closed N1, N2 and N4 are left as the previous record graded them: nits, accepted as written or for a follow-up card. Nothing in the delta touches them. No must-fix, no should-fix. Tried on the delta and held: a draft row with no item beside an active stored row (the arm is skipped, the active arm reads the stored row); a served overlay with no item under a packaged action ( Could not read: the withheld security findings; the verdicts of the check-runs still in progress, the test shards among them. Implemented-by: VERDICT: PASS |
… row still pins a publish With `withVersion`, the layered read answers the stored active row's token beside `overlay: null`. Kept on purpose and pinned: Studio pins a publish to that token, and a `null` would pin `If-None-Match: *`, which the row still stored at the address refuses 409. Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: Delta review of ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentS3: closed S1, S2 and N3 stay closed: the N1, N2, N4 and N5 stand as graded: nits, accepted or for a follow-up card. The seat accepted N5 as a follow-up at most in 7233005032. No must-fix, no should-fix. Tried on this delta and held: a case the new order makes worse (none found: the removal reads no location word, so nothing it decides depends on the rewrite having run, and an action it keeps over sources is rewritten afterwards exactly as before); the fractional Could not read: the withheld security findings. Nothing else was unreadable at this head. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-28T05:31Z 席位核对 — L1 delta @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T05:37Z · zone
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46113081093 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
… get an agent; the home falls to the next entry (objectstack-ai#37960) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D3PqTGGb1rgoRqKj4rT4Xjk)_ Fixes objectstack-ai#37833 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:部署没开 AI、或本人没有 AI 席位的人,在应用菜单(电脑侧栏、手机应用菜单、命令面板、页面里的菜单块)里不再看到「AI 问询」项;它原本是首页时,打开应用直接进入下一个菜单项,加载期间只显示骨架、不会先闪进问询页再跳走。 - 为什么做:这是「AI 问询首页」专区的收尾一项,替拿不到 AI 的成员挡掉一个点开就是「不可用」的入口。 - 出错会怎样:最坏是有 AI 的人看不到这个入口或首页落到下一项,数据不受影响;直接撤回本 PR 即恢复原状。 - 要你做什么:无。 ## What changes - **The gate** (`useNavMemberGates.ts`, `useNavVisibilityAndReads`): every navigation surface builds its `visible` evaluator here: the sidebar (and so the phone's app menu it draws), the app-root landing, the command palette and the `nav:menu` block. An `ai:chat` entry (`type: 'component'`, `componentRef: AI_CHAT_COMPONENT_REF`) is drawn only when `useAiSurfaceEnabled` answers `enabled`, the access-filtered agent catalog, which is empty on a deployment with no AI and for a member with no AI seat. - **Loading phase, chosen and pinned:** until the catalog answers, the entry is hidden and `readEntry` reports it as `pending`. That reuses the landing's existing pending-read hold (objectui#13097), so the app root shows its skeleton and lands once, either on the page or on the next entry. It never opens one and then jumps to the other. The sidebar never draws the entry and then removes it. - **Declared `landing`** (ruling record 6545223246, letter A) is unchanged. `resolveDeclaredLandingRoute` looks the named entry up among the entries the member is shown, so a landing entry whose `item` is the gated `ai:chat` entry is passed over: the next declared entry that holds lands, and with none, the first entry shown lands. Both are pinned. - **A direct link** to `component/ai/chat` is not gated. The page draws `AiUnavailable`. - **Asked only when needed:** the catalog is read only while an app in the list (or the gated app) carries an `ai:chat` entry, through a new optional `useAiSurfaceEnabled({ enabled })`. Apps without one read nothing new (pinned: no request). - **Prerequisite fix, latch:** `useAgents` (`@object-ui/plugin-chatbot`) now returns `settled`, true once a catalog read for the current `apiBase` has answered or failed. It is additive, and the fields it already returned are unchanged. `useAiSurfaceEnabled` reads it instead of `fetchStartedRef`. See Acceptance notes. - Changeset: `.changeset/37833-hide-ai-chat-entry-without-agent.md` (patch, `@object-ui/app-shell` and `@object-ui/plugin-chatbot`). ### Read first (by risk) 1. `ui/packages/app-shell/src/hooks/useAiSurface.ts`: the latch now reads `settled`. Every `useAiSurfaceEnabled` consumer reads its `isLoading` through this line. 2. `ui/packages/app-shell/src/hooks/useNavMemberGates.ts`: `useNavVisibilityAndReads`, the `aiChat` term in `evaluate` and in `readEntry`. 3. `ui/packages/plugin-chatbot/src/useAgents.ts`: `settledFor` set in the read's `.finally`. ### Two-minute verification `pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.aiChatEntryGate-37833.test.tsx`: expect 13 passed, including the community-edition and no-seat home cases whose router pathname log is exactly `/apps/policy`, `/apps/policy/crm_case`. ## Tests - `AppContent.aiChatEntryGate-37833.test.tsx` (new): real `AppContent` landing, real `ExpressionProvider`, `MePermissionsProvider`, `useNavMemberGates`, `useAiSurfaceEnabled`, `useAgents` over a held `apiFetch`, and the real `AppAskPage`. The cases: - the menu leaves the entry out on community edition (agents route 404) and with no seat (empty catalog); - CONTROLs: a member with an agent sees the entry, and an app list with no `ai:chat` entry fetches nothing; - the home is the next entry on both, with no stop on the page, and with an agent the home is the page with no stop on the next entry; - the two declared-landing cases; - the direct link draws `AiUnavailable`; - three warm-cache cases mounted with React's act environment off. - `useAiSurface.warmCatalog-37833.test.tsx` (new): the hook on a cold read, then on a warm one, with act off. - `useAgents.settledWarmCache-37833.test.tsx` (new): `settled` on a cold read, a warm read, a failed read and a disabled read, with act off. - `useAiSurface.test.ts`: its mocked `useAgents` result now carries `settled`, plus one case for a settled empty answer. - `HomePage.openMarksRead.test.tsx`: its `useAiSurface` mock now also answers `useAiSurfaceEnabled`. The Home bell's roster gates navigation through `useNavMemberGates`, so the old mock went red here (a stale fixture caused by this change; it was the only red in the wide run below). ## Acceptance notes - **Latch defect, fixed here (not filed):** with an empty catalog answered from `useAgents`' module cache (30 s TTL), `isLoading` went true and false within one render. `useAiSurfaceEnabled`'s `fetchStartedRef` latch was never set, so it reported loading for ever. Two effects for a member with no seat after the console's first catalog read: the `ai:chat` page on a direct link stayed on its blank loading state instead of `AiUnavailable` (a defect on `main` since the page landed), and this PR's gate would have held the app-root landing for good. Measured outside act; the pins below fail on the pre-fix code and pass after. - The app-root warm-cache landing case passes on the pre-fix code too, in this harness: the console's other renders in that window flush the loading render. The hook-level and page-level pins are the discriminating ones. - A catalog that serves agents but not `ask` still shows the entry. The gate follows `enabled`, the same value the page's own unavailable check reads, and the page's `AiUnavailable` covers it. - An app whose only entry is `ai:chat` shows a member with no agent the existing no-access empty state, the landing's rule for an app that shows them nothing. - `useAiSurface.ts` is also edited by objectstack-ai#37924 (draft); the two merge cleanly, and this edit is kept to the latch and the `enabled` option. ## Verification All runs are on head `4ca23ec3` unless noted. The `check:*` list ran at `ce385345`; the one later commit changes only a test mock, and the four gates that read test files were re-run on `4ca23ec3`. <details><summary>New and touched pins: 19 passed, and 5 of them red on the pre-fix code</summary> - `vitest run` over `useAgents.settledWarmCache-37833`, `useAiSurface.warmCatalog-37833` and `AppContent.aiChatEntryGate-37833` (`ce385345`): Test Files 3 passed (3), Tests 19 passed (19). - **Reverse check.** `useAgents.ts` and `useAiSurface.ts` were put back to their `868742bf` content in the working tree only (`settled` hits 0/0, latch hits 3). Result: Tests 5 failed, 14 passed (19). The five red cases are useAgents (a), (b) and (c), the hook's warm-catalog case, and the page's warm direct link. Restored with `git checkout HEAD`; `git diff HEAD` empty; both blobs equal to HEAD. - **Gate ablation** (`node scripts/ablation-replace.mjs` at `868742bf`; anchor hits 1 to 0): the `aiChat` term of `evaluate` was replaced by `true`. Result: Tests 8 failed, 4 passed (12). Restored blob equal to HEAD, `git diff HEAD` empty. </details> <details><summary>Wide run and type-check</summary> - `vitest run` over `packages/plugin-chatbot/` and app-shell's `hooks/`, `console/`, `layout/`, `chrome/`, `views/__tests__/` and `providers/` (`ce385345`): Test Files 1 failed, 807 passed (808); Tests 3 failed, 7025 passed (7028). The failing file was `HomePage.openMarksRead` (`No "useAiSurfaceEnabled" export is defined on the mock`), repaired in `4ca23ec3`, where it shows Tests 3 passed (3). - This run is a declared narrowing of app-shell's suite; `Test UI` runs all of it in CI. - `pnpm --filter @object-ui/app-shell --filter @object-ui/plugin-chatbot run type-check`: both Done, and `pnpm --dir ui exec vitest run scripts/` gave Test Files 172 passed, 2 skipped. Lock VERDICT command-exit 0. </details> <details><summary>Derived gates (dispatch-gates --commands, 39 families)</summary> - 38 `check:*` and script families: every one ended with exit 0, except `check:type-check-debt`. Its first run exited 3 while it was queued behind the verification lock; the re-run exited 0 (`--re-measure: OK`, surplus none). - `pnpm --dir ui exec vitest run scripts/`: passed (above). - Reconciliation: `dispatch-gates --ran` printed 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN. - Re-run on `4ca23ec3`: `check:nul-bytes`, `check:test-source-alias`, `check:cross-package-test-inputs` and `check:undeclared-dep-imports` all exit 0. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cwGVgec21LwQTtRY85 --------- Co-authored-by: Claude <noreply@anthropic.com>
…on a record page (objectstack-ai#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 objectstack-ai#37857 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:对外发布的 AI 技能文档不再教作者在记录页自己放 AI 按钮,换成一句话:用页头的「问 AI」入口,它自动带上当前记录。应用的使用者无感。界面技能里动作类型表的那一行这次没动,要等类型本身撤掉才能删。 - 为什么做:「问 AI 入口改造」专题已定全站只留一个入口,「页面里加按钮」的需求作废。 - 出错会怎样:只改了文档和一条评测样例;写错的话,用这份技能的 AI 作者会答错怎么加 AI 按钮,撤回本 PR 即可恢复。 - 要你做什么:批准这个受管 PR。它先合,撤掉该动作类型的 PR(objectstack-ai#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: objectstack-ai#37924 itself, where the member leaves, or a second small pull request on this card after objectstack-ai#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(objectstack-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 objectstack-ai#37924's to build and to word. ## Landing order This pull request lands **before** objectstack-ai#37924 (the pull request that retires the action type); both ship in the same release. Reason, measured by the card thread on objectstack-ai#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 objectstack-ai#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 objectstack-ai#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 objectstack-ai#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 objectstack-ai#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>
… close, and the drawer header names the conversation (objectstack-ai#37970) 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_01AXsQkLFKRdQCqQ3RTr6JaoK5FfvaJPRjBoGxoAHny6iN)_ Fixes objectstack-ai#37860 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:所有用户点「问 AI」时,如果上次是自己关掉的助手(或这个标签页第一次打开),就开一个新会话,旧会话留在历史里;手机上点答案里的链接被自动收起、或有待确认的写入时,仍回到原会话。抽屉顶部改为会话标题、+、历史图标、⋯、×。 - 为什么做:「问 AI」入口改造专题的第四张卡,解决从别的记录再问时落进上一个旧会话、问题被混在一起的问题。 - 出错会怎样:最坏是本该续上的会话开成了新会话(或反过来),用户可从历史里点回原会话,不丢数据;没发消息前不会产生空会话。直接撤回这次改动即恢复原样。 - 要你做什么:无。 ## What changes Implements every row of ui ADR-0057 Amendment A5's open-type table (as merged, `bc173343`). Where the card's text and A5 differ, A5 wins (claim 7218853868). 1. **Who closed the drawer is recorded.** `useConsoleChatDock` writes one per-tab record at each close (sessionStorage, module copy when storage throws): `by: user` for ×, the entry or the keyboard toggle again, and dismissing the phone sheet; `by: console` for the phone sheet's PUSH/POP collapse (objectstack#37556) and the A4 ask-page collapse; plus the conversation the body showed then (`onShownConversationChange`, reported by `ChatDockConversation`). 2. **An opening from the entry** (`openEntry` on the dock handle; the top bar's 「Ask AI」 toggle, the keyboard toggle, Home's 「Ask AI」 through `useAskAiEntry`, and the record pane's button) reads that record through the pure `entryOpening`: - row 1 / row 4: after the user's close, or with no record (first opening in the tab) → a new conversation, target `{ agent?, fresh: true }`, which reaches `useChatConversation` as `forceNew` only (never `resumeMode: 'fresh'`), so no row exists until the first send; - row 2: after the console's close → the same conversation; - row 3: a write awaiting this user's approval in the conversation shown at the close → that conversation (read off the assistant bus with `isApprovalPendingIn`); - row 8: a build thread (a target naming `build` or a package, or `app.defaultAgent: 'build'` with no target agent) → as before; - rows 5, 6, 7, 9 are untouched: `open(target)`, a reload, the bus's `requestAssistantOpen`, filling the window. An entry that names an agent (Home's `ask`) keeps the closed thread only when it is that agent's. 3. **Write approvals reach the bus** (A5's "Not recorded yet" bullet). `ChatPane` counts the tool calls the framework parked as pending actions (`approval-requested` with a `pendingActionId`) that have no decision, or a failed one, in the chat (`countWritesAwaitingApproval`), and publishes the count per conversation with `publishPlanApprovalPending`. The reading outlives the pane, as the bus intends. 4. **The header row**, the same in the rail, the full window and the phone sheet: the conversation's label on the left as its history row reads it (server title, else the latest user message: `useConversationLabel`, the list's own `normalize` on the detail read; the first message stands in until the server answers), "New conversation" (`console.ai.newConversation`, the history list's own fallback) before the first send, nothing while an existing label is read. Right: + (the body's new-conversation action), the history as an icon button with `aria-pressed` and both names (rail and sheet only; the full window keeps the column), ⋯ unchanged, × (the sheet keeps its own ✕ last). No ☆ (C8). 5. **C3's hand-over items.** The record pane's and the record drawer stack's `record-pane-open-assistant` button reads 「Ask AI」 (`home.askAI`) with the chat-bubble icon and opens as the entry does. The drawer is no longer titled "AI Assistant"; the objectstack#34827 pin now pins the new rule. No new i18n key: the title and + reuse `console.ai.newConversation`, the history button keeps `console.ai.dock.history` / `backToChat`. ## Tests - `useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx`, new top-level describe (the hook's shared harness): A5 rows 1 (first opening; ×; entry and keyboard closes; sheet dismissal), 2, 3 (and its control: another conversation, another user), 5, 6 (reload is no opening; the record survives a reload), 7, 8 (defaultAgent build; a build target with a package), Home's 「Ask AI」 after a build thread, and with the drawer open. The stand-ins now report the shown conversation and offer × and dismissal. - `ChatDock.test.tsx`, new describe: the header row in rail / full / sheet, the label, "New conversation", nothing while pending, the history icon's pressed state and names, + calling the body's action and closing the history. - `ChatDock.titleMatchesTopBar-34827.test.tsx` rewritten to "drawer title = the conversation's label, 「新对话」 / "New conversation" before the first send", real packs, every built-in pack. - `writeApprovalPending-37860.test.tsx`: real hydration of stored rows and the real `useHitlInChat` decisions → pending, cleared by an approval, kept by a failed one; control with no parked write. - `AiChatPage.toolLabelsLocale-11667.test.tsx`, new describe: the real `ChatPane` publishes the pending write for its conversation and clears it after the user's reject. - `recordDrawerAssistant-36998.test.tsx`, `ObjectDataPage.openRule-35875.test.tsx`: the pane button's name is 「Ask AI」 and its click is an entry opening. Ablation (on disk, restored from the commit): every entry opening forced to `same` → 7 of 30 cases in the hook harness red (all row-1 cases, the row-3 control, row 6, Home's entry). `ChatPane` publishing `pending: false` → the pane pin red (1 of 3). <details><summary>Readings</summary> - Related suite at `db93e901` + tests (every ui test file naming ChatDock, useConsoleChatDock, AssistantTopBarButton, ChatPane/AiChatPage, Console/Home layout, HomePage, the conversation list or sidebar, recordDrawerStack, ObjectDataPage, assistantBus, chatDockControl, DocsPortalShell): 327 files / 3893 tests passed. - After the last source change (`5d407804`): every ui test file naming ChatDock or useConsoleChatDock, 28 files / 305 tests passed. - `pnpm --filter @object-ui/app-shell run type-check` (src and `tsconfig.test.json`): exit 0, after building the dependency closure. - eslint on the changed files: 0 errors; no new warning on the changed lines. - `overlap-check.mjs` before the first push: clean against main, objectstack-ai#37924 (shares `ChatDockConversation.tsx`) and objectstack-ai#37940 (shares `useConversationList.ts`). </details> ## Acceptance notes - **zh title wording.** C3's note said 「新会话」; A5 says the header reads the history row's label and "New conversation" before the first send. The history list's own fallback is `console.ai.newConversation`, which reads 「新对话」 in zh-Hans, so the header reads 「新对话」. No pack changed. - **The amber marker now also lights for a pending write.** Write approvals reach the bus that the entry's marker (and Studio's 「N 项待确认」 count) read. Its description, `console.ai.dock.planAwaitingApproval`, now reads "An action is waiting for your approval" (「有一项操作等待确认」) in all eleven packs, with the key unchanged. That was L1-c's R1 (7220360349), fixed at `12ae1bed`. - **The record pane's button stays an icon** in the pane's top bar (the bar's own button shape), named 「Ask AI」 with the chat-bubble icon, not the outlined text button of the page header. - **Home's 「Ask AI」 with the drawer already open** is no opening; it opens on the `ask` agent as before. - **Label read.** The header reads the shown conversation's detail once per open and after each send (the same refresh cadence as the history list). That is a second read of a conversation the body already hydrates. - **Reload limits.** The approval reading lives in the page's memory (A5: "in the page's memory only"); after a reload, row 3 holds again once the chat is next mounted on that conversation. - **File surface.** Three files outside the claim's first glob, added to the claim by the seat (7218893089): `views/ObjectDataPage.tsx`, `views/recordDrawerStack.tsx`, `console/ai/ChatPane.tsx`. Plus `assistant/writeApprovalPending.ts` (new, inside the glob). - Ships in the same release as C5 (objectstack#37861), per the card. ## Verification Read first, by risk: 1. `ui/packages/app-shell/src/layout/useConsoleChatDock.tsx`: `entryOpening`, `openEntry`, `closeBy` and which close paths call it. 2. `ui/packages/app-shell/src/layout/ChatDockConversation.tsx`: the shown-conversation report and the header actions. 3. `ui/packages/app-shell/src/console/ai/ChatPane.tsx`: the bus publish effect. Two-minute check: `pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx`. Expected: 30 passed. In the Console: open 「问 AI」, send a message, close with ×, click 「问 AI」 again: the header reads 「新对话」 and the old thread is in history. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibzv3KSUSav5J2uw97s)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
… place from the sidebar (objectstack-ai#38005) 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_01AXsQkLFKRdQCqQ3RTr6JaoHaCR5qtPgmwG5g4Vd9AhVn)_ Fixes objectstack-ai#37863 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:收藏过的 AI 对话出现在侧边栏「收藏」里,点一下就在当前页面右侧的助手抽屉里打开这段对话,页面不跳走;对话已被删除时,这一行会划掉、标「该对话已不可用」,仍可从菜单里移除。对话开始后(发出第一条消息后),抽屉顶部会出现 ☆ 收藏按钮,在侧栏、全屏和手机抽屉里都有;点一下收藏或取消。 - 为什么做:「问 AI」入口改造专题的收藏会话卡,让常回看的对话能一键找回,不用翻历史。 - 出错会怎样:最坏是点收藏没有在抽屉里打开,或误把可用的对话标成不可用;收藏数据本身不会丢,直接撤回这次改动即恢复原样。 - 要你做什么:无。 ## What changes Implements card objectstack-ai#37863 as claimed (claim 7221246375), including the drawer header's ☆. C4 (objectstack-ai#37970, the header row) merged at `4af32b99`; this branch merged `origin/main` with it as a real merge (`8aa37202`, no conflict, no rebase), then added the ☆ (`33463930`) and settled its test on the header (`3141f4db`). 1. **A conversation favourite** (`FavoriteItem.type: 'conversation'`, id `conversation:ID`, new optional fields `conversationId` and `agent`). `href` is the conversation's `/ai…` address (`aiAddressOf`). It is a content favourite, so it counts against the cap of 20 (`capByBucket` unchanged). `conversationFavoriteItem` (new `layout/conversationFavorites.ts`) builds the entry the ☆ will toggle; the agent is stored as its route name (`agentRouteName`). 2. **The sidebar row opens the drawer in place.** In `UnifiedSidebar`'s Favorites rows, a conversation favourite's link click calls `useChatDockControl().open({ agent, conversationId })`, the target a history row opens (ui ADR-0057 A5, row 5), and closes the phone sidebar. The row stays a link: the address is followed with no drawer host, on the app's AI inquiry page (`askPageActive`, A4, where `open` refuses a non-handoff target; seat ruling in the claim), and for a modified click (new tab). 3. **The label follows the conversation; a gone one is marked.** `useUnavailableConversationFavorites` reads each shown conversation favourite once per mount through the new `readConversationRow` (`useConversationList.ts`, the list's own `normalize`). A label that moved (server title, else latest user message, as the history row reads) is written back with `refreshLabel`. A 404 or 403 marks the row unavailable for that mount only (never stored): struck through, `aria-disabled`, a screen-reader suffix from the new `sidebar.conversationUnavailable` key, and a click opens nothing; its ⋯ menu still removes it. Any other failure (5xx, network) marks nothing. 4. **The drawer header's ☆** (`33463930`). `ChatDockConversationActions` gains `agent` (the route name, reported by `ChatDockConversation`). Once a thread exists (after the first send) the ☆ sits before + in the rail, the full window and the phone sheet; nothing is drawn before the first send. A click toggles `conversationFavoriteItem` (label: the header title, or 「New conversation」 while it loads); while favourited it is `aria-pressed`, named by `common.addToFavorites` / `common.removeFromFavorites`. A header title that changes while favourited is written back with `refreshLabel` (through a ref, ui AGENTS objectstack-ai#10). 5. **Icon.** `CONTENT_KIND_ICON.conversation = 'message-circle'`. 6. **i18n.** `sidebar.conversationUnavailable` in all 11 packs (zh-Hant generated by `gen:zh-hant`). Not in this card (seat ruling in the claim): restoring the record focus chip from the conversation's `metadata` is C5's (objectstack-ai#37861); a favourite opens the same target a history row does. ## Tests - New `UnifiedSidebar.conversationFavorites-37863.test.tsx` (15 cases; real `FavoritesProvider`, `NavigationRenderer`, `SidebarItemMenu`; a stand-in drawer handle; stubbed `fetch`): row and glyph; click opens the drawer in place and the address does not move; a backend agent name stores the route name; modified clicks are left to the link; no host and the A4 page follow the address; other favourites keep their link; server title and latest-message labels written back; 404 and 403 drawn unavailable and inert, store untouched; removal from ⋯; 500 and network failure mark nothing; the cap of 20 rolls the oldest content favourite off when a conversation is added. - Ablation, on disk with `scripts/ablation-replace.mjs`, restored to `HEAD` each time: the row's `onClick` removed → 6 of 15 red; `readConversationRow` reading 404/403 as a failure → 3 of 15 red; the label write-back removed → 2 of 15 red. <details><summary>Readings</summary> - New file at `f095b9bd`: 15/15 passed. - Related suite at `f095b9bd`: every app-shell test file naming UnifiedSidebar, FavoritesProvider, useFavorites, contentItemTile/ContentItemTile, useConversationList, SortableFavoriteRows or SidebarItemMenu (122 files) plus all of `ui/packages/i18n/src/__tests__` (110 files): 230 files passed, 2798 tests passed, 13 skipped. - `pnpm --filter @object-ui/app-shell run type-check` (src and `tsconfig.test.json`): exit 0, after `turbo build --filter='@object-ui/app-shell^...'`. - `overlap-check.mjs` at `f095b9bd`: clean against main and open PRs objectstack-ai#37989, objectstack-ai#37970 (auto-found) and objectstack-ai#37924, objectstack-ai#37970, objectstack-ai#37968 (named). - Derived local gates (`dispatch-gates.mjs --commands`): see the report comment; CI runs the full farm. - At `3141f4db`, after the main merge and the ☆: the new header ☆ test file 8/8, green on three runs in a row; ablation (restored to `HEAD`): the ☆ removed → 6 of 8 red, the label follow removed → 2 of 8 red; the related 256 test files green; app-shell type-check exit 0; derived local gates 41/41 exit 0 (merge base `4af32b99`). Report delta: 7223592078. </details> ## Acceptance notes - **Unavailable is read once per mount.** A conversation deleted from history while the sidebar stays mounted is marked on the next mount, not at once. Clicking it before then opens the drawer on a conversation the chat cannot load. - **Reads.** Up to 8 conversation reads per sidebar mount (the shown rows), one per favourite, none repeated within the mount. - **README** (`ui/packages/app-shell/README.md`, user-scoped state section) gained one paragraph per ui `AGENTS.md` commandment objectstack-ai#2; outside the claim's first file list, reported to the seat. - `content/docs/frontend/**` has no page on favourites; nothing to update there. ## Verification Read first, by risk: 1. `ui/packages/app-shell/src/layout/UnifiedSidebar.tsx`: `openConversationFavorite` and the row's link props. 2. `ui/packages/app-shell/src/layout/conversationFavorites.ts`: `useUnavailableConversationFavorites`. 3. `ui/packages/app-shell/src/hooks/useConversationList.ts`: `readConversationRow`. Two-minute check: `pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/UnifiedSidebar.conversationFavorites-37863.test.tsx`. Expected: 15 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibxdwshRvTk3qXc7A6A)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…hat draws as money (objectstack-ai#38100) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoJgGMcVYe3tSvxAWdknWFST)_ Fixes objectstack-ai#37890 repo:objectstack#3 · os-tesla · session_01L9qibvqGhhENZcAuiMxqA7 Clause-②: no Metadata-protocol: none ## 维护者速读 - 手机上看订单行、报价行这类明细列表时,卡片右下角的金额现在显示这一行的总额,不再错显示单价;电脑上的表格不变。 - 属于手机端列表卡片的体验线,替 HotCRM 等有明细行的应用解决金额读错的问题。 - 只改卡片挑哪一列当金额,数据和接口都不变;若挑错,最多是卡片上金额位置显示另一列,可以直接撤回。 - 无 ## What changes - `ui/packages/plugin-grid/src/ObjectGrid.tsx`, `buildMobileCardRenderer`: the amount slot now takes the first shown body column whose value draws as money. That is a `currency` column, or a `formula` / `summary` column for which `resolveFormulaValueType(fieldDef, number)` (the exported `@object-ui/fields` rule the formula cell draws by) answers `currency`: a formula declaring `returnType: 'currency'`, or a summary declaring its currency (`currencyConfig`). The slot is still chosen once for the list, so every card keeps one shape. - Unchanged: a masked column is not promoted; a view that presents the field as another type (column `type`) keeps it a plain value; a number-returning formula is not an amount; view order still picks among several money columns; desktop table untouched. - No new export (seat ruling: option A). `patch` changeset for `@object-ui/plugin-grid`. ## Why On a phone, an order line (2 × 6,000.00, 10% off) showed its unit price 6,000.00 in the amount slot; the line total 10,800.00 is a formula returning currency, which the slot never considered. Reordering columns did not help: the total moved into the subtitle. ## Tests `ui/packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsx`, a new top-level `describe` in the existing harness (390 px): - currency formula shown before the unit price → amount `CN¥10,800.00`, subtitle `2 · CN¥6,000.00`; - currency formula as the only money column → amount `CN¥10,800.00`; - summary declaring its currency → amount `CN¥777.00`; - unit price shown first stays the amount (view order unchanged); - CONTROL: number-returning formula → no amount line; - CONTROL: the currency formula presented as `type: 'text'` → no amount line. <details><summary>Readings (head f800825 = b4dd4f2 + merge of origin/main 815e882..f72f335)</summary> - New describe at b4dd4f2: `Tests 11 passed (11)` for the harness file. - Ablation on the committed fix (ObjectGrid.tsx restored from base 815e882, tree only, then restored from HEAD; `drawsAsMoney` count 0 → 2 on disk): `Tests 3 failed | 8 passed (11)`. The three red are exactly the predicted RED directions; both CONTROLs and all five objectstack-ai#34615 cases stay green. - After merging origin/main (which brought objectstack-ai#37929, also in plugin-grid) and rebuilding the closure (`turbo run build --filter='@object-ui/plugin-grid^...'`, 57/57): `pnpm --filter @object-ui/plugin-grid type-check` exit 0; `pnpm --dir ui exec vitest run packages/plugin-grid/`: `Test Files 319 passed (319)`, `Tests 2805 passed (2805)`. - eslint on the two changed files: 0 errors (155 warnings, none on the changed hunk). - `dispatch-gates --ran` at b4dd4f2: 39 derived, 39 run, all exit 0, 0 NOT MEASURED, 0 unrun. </details> ## Acceptance notes - Premise measured on origin/main 815e882 before writing (390 px probe, readings on the card's pre-claim report): unit price first → slot `CN¥6,000.00`; total first → slot still `CN¥6,000.00`, total in subtitle; formula-only or summary-only → no slot, though the cell already drew currency. - `objectstack-ai#37929` and `objectstack-ai#37924` also touch `ObjectGrid.tsx`, in hunks far from this one; whichever lands later merges main. ## Verification Read first (by risk): 1. `ObjectGrid.tsx`: `drawsAsMoney` and the `amountCol` line under it. 2. The new `describe` in `phoneCardAmount-34615.test.tsx`, especially the two CONTROL cases. Two-minute check: `pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsx` shows 11 passing; replace `drawsAsMoney(c)` with `c.type === 'currency'` and the same command shows 3 failing. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (eslint on the two changed files: 0 errors) - [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: n/a. - [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. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibvqGhhENZcAuiMxqA7)_ Co-authored-by: Claude <noreply@anthropic.com>
…ings its write raised, and the console toast shows them (objectstack-ai#38076) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao3VQSGvy9zYGn6FpGEZRCnJ)_ Fixes objectstack-ai#37867 repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户点「确认订单」这类改状态的按钮时,如果这次写入触发了警告型校验规则,现在会弹出一条警告样式的提示,规则作者写的话就在提示里,撤销按钮照样在;以前只弹成功提示。 - 替用按钮改状态的应用解决:警告规则以前只在编辑表单里生效,最常用的按钮路径静默通过(HotCRM 订单超出框架合同额度就是实例)。 - 写入本身不变,只是应答多带警告、提示换样式;如果有问题,最多是提示样式不对,可以直接撤回。 - 无 ## What changes - `packages/runtime/src/action-execution.ts`: `executeDeclarativeUpdateAction` copies the `warnings` the data-plane update answered (`protocol.updateData`, the data door's own `ValidateDataIssue` elements) onto its result. `DeclarativeUpdateResult` gains an optional `warnings`, present only when the write raised an advisory rule hit, so a write that trips nothing answers byte-for-byte as before. Both action doors (REST `POST /api/v1/actions/...` and MCP `run_action`) go through this executor. The stale roll-up path (`ERR_SUMMARY_RECOMPUTE`) composes from the same `written` answer, so it carries them too. - `ui/packages/core/src/actions/ActionRunner.ts`: for an `operation: 'update'` action only, the runner reads the answer's `warnings` (distinct messages, in answer order). When there are any, the success toast takes the `warning` variant, with the messages as its `description` and the Undo affordance kept. This is one toast, the way a record save raises one (`toastRecordSave`). When the author turned the success toast off (`toast.showOnSuccess: false`, or a result dialog), the warning is still shown, in the rule's own words, so no new runner text is needed. `ToastHandler` options gain an optional `description`. - `ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx`, `ui/packages/app-shell/src/views/RecordDetailView.tsx`: both console toast handlers used to send every non-error toast to `toast.success`. They now honour `type: 'warning'` and call `toast.warning(message, { description, duration, action })` with the same Undo action. - Changeset: `@objectstack/runtime`, `@object-ui/core`, `@object-ui/app-shell` patch. Not changed: `packages/spec` (the action answer has no zod declaration, it is the runtime's TS interface), locale packs (no new text), HotCRM (its `confirm_sales_order` and `framework_quota_exceeded` work as authored). ## Tests - `packages/runtime/src/action-declarative-update.test.ts`, a new top-level `describe` in the shared harness. It puts a `protocol` slot in front of the caller-honouring rig. REST: the 200 answer carries the write's warnings, element for element, beside the record and the undo anchor. MCP `run_action`: the same write gives the same warnings. Control: a write that trips no rule has no `warnings` key. The file gains a module-top `import '@objectstack/metadata'` so the dispatcher's lazy load is paid at collection (`check:test-source-alias`). - `ui/packages/core/src/actions/__tests__/ActionRunner.updateOperation.test.ts`, a new `describe` through the real `createServerActionHandler`: one warning toast with the success message as title and the rule's words as description; repeated messages said once and distinct ones one per line; Undo kept on an undoable action; control with no warnings is a plain success toast with no description; success toast off still warns; reverse pin: a script action without `operation` never reads a `warnings` key. - `ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx` and `ui/packages/app-shell/src/views/RecordDetailView.undoLookupId-11122.test.tsx`, a new `describe` in each, down to `sonner`. On a grid row and on the record page, the update's warnings raise `toast.warning` once with the description and the Undo action, no success toast, and Undo restores the stored value. Both harnesses' route stubs gained an optional answer body. These two test files are a surface amendment to the claim, reported to the seat. ## Acceptance notes - Premise measured on `origin/main` `815e882b` before any edit. Through the real `HttpDispatcher.handleActions` → `executeDeclarativeUpdateAction` → `callData`, the protocol's `updateData` answered `["object","id","record","warnings"]` and the action's 200 body carried `warnings` 0 times. - The same executor also drops the data door's `notice` (a hook's message for the person) and `droppedFields`. Out of scope here; the seat files them. - `ToastHandler` and the action answer each gain one optional member. Nothing is refused or narrowed. ## Verification - Two-minute check: `pnpm --dir ui exec vitest run packages/core/src/actions/__tests__/ActionRunner.updateOperation.test.ts` shows 19 passed, 6 of them the new block. - Read first: `executeDeclarativeUpdateAction`'s result block (`action-execution.ts`), then the success-toast arm of `handlePostExecution` (`ActionRunner.ts`). <details><summary>Local readings at 40c5c82</summary> - New and edited suites: `action-declarative-update.test.ts` 37 passed; `ActionRunner.updateOperation.test.ts` 19 passed; `useConsoleActionRuntime.undoLookupId-11122` 6 passed; `RecordDetailView.undoLookupId-11122` 4 passed. - Full: `pnpm --filter @objectstack/runtime test` Test Files 655 passed, Tests 12316 passed, 25 skipped. ui vitest `packages/core/src/actions`: 58 files, 810 passed. app-shell `useConsoleActionRuntime*` + `RecordDetailView*`: 128 files, 1104 passed. - Typecheck exit 0: `@objectstack/runtime` (test layer 27 files / 183 errors held in the ledger, unchanged), `@object-ui/core` `type-check`, `@object-ui/app-shell` `type-check`. - Ablations through `scripts/ablation-replace.mjs`, each restore blob == HEAD: runtime `warnings` spread removed, 2 failed (REST, MCP); the runner's warnings read emptied, 6 failed (4 core, 2 hosts); each host's warning arm disabled, 1 failed each. - `dispatch-gates --ran` with recorded exit codes: 73 derived, 71 exit 0, 2 NOT MEASURED (exit 3: `check-plugin-teardown-shape --self-test`, fixture commit outside the shallow clone; `check:dual-build-cjs-loads`, needs a full `pnpm build`), 0 unrun. `check:test-source-alias` exit 0 at 40c5c82. - `overlap-check.mjs` VERDICT clean exit 0 against main and objectstack-ai#37929, objectstack-ai#37924, objectstack-ai#37896. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qiby3dfNfCgpXwPkB2Hf)_ <!-- signed: repo:objectstack#3 · os-tesla · session_01L9qiby3dfNfCgpXwPkB2Hf --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…r their amount and subtitle (objectstack-ai#38214) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoAvhxsnErQnmY8cTbgC3beU)_ Fixes objectstack-ai#37891 repo:objectstack#3 · os-tesla · session_01L9qibwy7XB37e8e1P6jRJ3 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:在手机上看列表和相关列表时,卡片按对象声明的「最重要字段」显示:右下角是其中第一个金额(订单明细显示这一行的合计,不再是单价),副标题依次显示后面最多三个字段,数字类带名称,例如「数量 2 · 单价 ¥6,000.00 · 折扣 10.00%」;电脑上的宽表格不变。 - 为什么做:HotCRM 订单明细的手机卡片只写「1 · 2」、右下角是单价,要改只能动宽表格的列顺序;你 11 月 28 日选了「按对象的最重要字段」,不加新配置。 - 出错会怎样:声明了「最重要字段」的对象,手机卡片都会跟着变(事先粗量约 222 处里 180 处,大多在 HotCRM),哪个对象读着不对,调它的「最重要字段」顺序即可;整个改动可以直接撤回。 - 要你做什么:无。 ## What changes Governing ruling: the maintainer chose option A on objectstack-ai#37891 (ruling record 7235312203, 2026-11-28T06:25Z, anchor 7235198146): phone cards follow the object's `highlightFields` (ADR-0085 §1), no new key, no line-number title prefix. Built as the claim (7235321485) and its surface amendment (seat, 2026-11-28T06:31Z) say. - `ui/packages/plugin-grid/src/ObjectGrid.tsx` (`buildMobileCardRenderer`): when the object declares `highlightFields`, the card body is that list, in order (title excluded): the amount is the first entry that draws as money (objectstack-ai#37890's `drawsAsMoney`), the subtitle the next three, skipping the status field and the title formula's reads, empty values dropped (0 is a value), and a number, currency or percent part (a formula or summary by its value type) is drawn under its field label (`grid-card-subtitle-label`). A highlighted field the view shows is drawn through its column draft; one it does not show through the synthesized draft. Masked fields stay masked: never the amount, never a part. An object without `highlightFields` keeps the column-order card (two unlabelled parts). - `ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx`: the synthesized path's per-field draft is now its own callback, `synthesizeFieldColumn` (same body: renderer, translated label, FLS), which `generateColumns` calls and the card reuses. No behaviour change for columns. - Fetches, beside the declared name field and through the same gates (declared, FLS-readable, not draft-only/withheld/redacted), on every viewport so a width change never refetches: - `ui/packages/plugin-grid/src/objectGridRowLoad.ts` `getSelectFields` (the grid's own fetch); - `ui/packages/plugin-list/src/ListView.tsx` harvest (the list page's fetch); - `ui/packages/plugin-detail/src/RelatedList.tsx` `selectFields` (the related list's fetch; derived-columns lists still send no projection). - Changeset: `@object-ui/plugin-grid`, `@object-ui/plugin-list`, `@object-ui/plugin-detail` patch, naming the phone-card change. ## Tests - `plugin-grid` `phoneCardAmount-34615.test.tsx`, new top-level describe (HotCRM order-line fixture at 390 px): amount = highlighted total (CN¥10,800.00) though the table shows the unit price first; subtitle `Quantity 2 · Sales Price CN¥6,000.00 · Discount % 10.00%`; a text part drawn bare; an empty part dropped; a highlighted field no column shows is drawn and is in the grid's `$select`; CONTROL no `highlightFields` keeps `1 · 2` and the unit price, no labels; CONTROL a `password` field first in `highlightFields` is neither amount nor part and its value is never printed. - `plugin-list` `ListView.harness.test.tsx`, new top-level describe: a highlighted field no column shows is in `$select` and not drawn; CONTROL no `highlightFields` sends the old projection. - `plugin-detail` `RelatedList.selectFls-10186.test.tsx`, new top-level describe: a declared, readable highlighted field is requested, an undeclared one never; an FLS-denied one is not requested; CONTROL no `highlightFields` keeps the projection. ## Acceptance notes - The fetches ask for `highlightFields` on desktop too (a few extra columns per row), as they already ask for the name field, so crossing the 768 px breakpoint never refetches. - The status chip is unchanged: drawn when a column shows the status field; the status field is never a subtitle part. - The related list's non-enlarged mobile gallery (`object-gallery`) path is untouched (objectstack-ai#37008 owns its labels). - No "×" joiner and no title prefix, by the ruling. The HotCRM `highlightFields` re-order (order line, quote line, and a review of its other objects) follows in its own card after this lands, per the anchor's 裁后执行. - Measured before the ruling (anchor 7235198146, static simulation): 180 of 222 shipped phone-card surfaces change, 134 of 138 on HotCRM; platform objects only gain a third part. ## Verification Two-minute check: `cd ui && pnpm exec vitest run packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsx -t highlightFields`, expect the objectstack#37891 describe green (7 cases). First files to read (by risk): `ui/packages/plugin-grid/src/ObjectGrid.tsx` (the card body and the label rule); `ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx` (the extracted draft, must be byte-equivalent for columns); `ui/packages/plugin-detail/src/RelatedList.tsx` (the projection arm and its gates). Verification record: every reading below is on `objectstack-ai/objectstack`, base `origin/main` 4f7aa88, through `os-verify-lock.sh`, after rebuilding the closure (`turbo run build --filter='@object-ui/plugin-grid^...' --filter='@object-ui/plugin-list^...' --filter='@object-ui/plugin-detail^...'`, 58/58). <details><summary>Tests</summary> - The three changed test files at 32340f2+: `Test Files 3 passed (3)`, `Tests 168 passed (168)`; the plugin-grid file alone at the fixture fix: `Tests 18 passed (18)`. - Full suites `pnpm --dir ui exec vitest run packages/plugin-grid/ packages/plugin-list/ packages/plugin-detail/` at 5f2eee0 (head 512ad74 changes only test docblock comments): `Test Files 933 passed | 1 skipped (934)`, `Tests 8897 passed | 18 skipped (8915)`, VERDICT command-exit 0. - `type-check` in plugin-grid, plugin-list, plugin-detail: exit 0 each. </details> <details><summary>Shown red without the fix (ablation, restored to HEAD)</summary> - The five source files restored from base 4f7aa88 (tree only; `objectstack#37891` marker count 0 on disk in each), the three test files run: `Tests 9 failed | 159 passed (168)`. Red: all six grid cases with `highlightFields` (the masked control too, on its amount half: the base tree shows the unit price), both RelatedList projection cases, the ListView projection case. Green: the three no-`highlightFields` controls. - Restored with `git checkout HEAD -- PATHS`: marker counts back (2/1/1/1/1), `git diff HEAD` empty, each blob equal to its HEAD blob. </details> <details><summary>Gates</summary> `node scripts/pm/dispatch-gates.mjs --commands` at 512ad74: 39 families derived, all 39 run locally, all exit 0 (two first hit a 240 s per-gate timeout, exit 124, and were re-run to exit 0: `pnpm check:query-options-erasure`, `pnpm --dir ui exec vitest run scripts/` = 172 files passed). `--ran`: `39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED`. `overlap-check` before each push: VERDICT clean, exit 0 (objectstack-ai#38169 and objectstack-ai#37924 share files and merge cleanly). PR check-runs at 512ad74 (`pr-state`): 42 success, 13 expected skip, 0 failed, 0 pending; mergeable_state clean. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibwy7XB37e8e1P6jRJ3 --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibwy7XB37e8e1P6jRJ3)_ <!-- signed: repo:objectstack#3 · os-tesla · session_01L9qibwy7XB37e8e1P6jRJ3 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…k_ai (objectstack-ai#38226) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao3PpF4t89AvwzCmzVRuQMwV)_ Fixes objectstack-ai#37857 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:写界面元数据的作者(以及替他写的 AI)查界面技能文档里的「动作类型」表时,不再看到已经下线的「问 AI」动作类型;表下那句「哪些类型必须填目标」同步去掉了它。应用的使用者无感。 - 为什么做:「问 AI 入口改造」专题已定全站只留页头的「问 AI」一个入口,页面不再自己声明 AI 按钮;这个动作类型已从平台撤掉,这是技能文档里剩下的最后两行。 - 出错会怎样:只改了两行文档和一行额度账;删错的话,作者照文档会少知道一种动作类型,撤回这一个合并即可恢复。 - 要你做什么:批准这个受管的技能文档改动。 ## What changes This is the second and last pull request on the card. The first, objectstack-ai#37937 (the `objectstack-ai` text and its eval case), merged as `4de4e3e9`; objectstack-ai#37924 (the pull request that retired the action type) merged as `9609c137`, the base of this branch. - `skills/objectstack-ui/SKILL.md`, *Action Types*: the `ask_ai` row leaves the table, and the line under the table reads "Every type but `script` requires `target`." (it read "Every type but `script` and `ask_ai` requires `target`."). 1 line added, 2 removed. - `scripts/check-skills-token-ratchet.mjs`: the row of `skills/objectstack-ui/SKILL.md` follows the measurement down, 2262 to 2228, with a three-line note above it. The gate asks for this in the pull request that shrinks the file. - `.changeset/37857-skill-ui-action-types-no-ask-ai.md`: `@objectstack/skills` patch. `skills/**` ships as that package's content. After this, `git grep -n ask_ai -- skills/` prints nothing (exit 1), which is the card's acceptance. **Read first, by risk:** 1. `skills/objectstack-ui/SKILL.md`, the one hunk at line 148: the whole published change. 2. `scripts/check-skills-token-ratchet.mjs`, the one hunk: only the `objectstack-ui` row moves, down, to the measurement. 3. `.changeset/37857-skill-ui-action-types-no-ask-ai.md`: the sentence that ships in the package changelog. **Two-minute verification:** `git grep -n ask_ai -- skills/` prints nothing; then `pnpm check:skill-identifier-liveness && node scripts/check-skills-token-ratchet.mjs` ends with both gates' success lines (quoted under Tests). ## Why 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. D7 retired the `ask_ai` action type, and on `main` `ACTION_TYPE_VALUES` in `packages/spec/src/ui/action.zod.ts` is `script`, `url`, `modal`, `flow`, `api`, `form`. The seat's route for this card (claim amendment 7218076053 on the card) left these two lines for a second pull request after the type left, because the liveness gate held the table to the type's members while the member was still there. The footnote is written from the tree, not from the card: `TARGET_REQUIRED_TYPES` is `ActionType.options` without `script`, so every remaining type but `script` requires `target`. ## Tests Measured at head `47a39aad`, merge base `9609c137` (`origin/main` at dispatch). Published-skills size (lines; tokens in the ratchet's own convention, `ceil(utf8 bytes / 4)`, the release-stamp line not priced): | | before | after | |:--|--:|--:| | `skills/objectstack-ui/SKILL.md`, lines | 165 | 164 | | `skills/objectstack-ui/SKILL.md`, bytes | 9075 | 8937 | | `skills/objectstack-ui/SKILL.md`, tokens | 2262 | 2228 | | all 14 `SKILL.md`, lines | 4953 | 4952 | | ratcheted authored files, tokens | 199880 | 199846 | | whole shipped tree, tokens | 303421 | 303387 | Net lines across `skills/**`: +1 / -2 = -1 (budget: net added lines at most 0). Whole pull request: +15 / -3. <details> <summary>The table binding: green with the row gone, red when a live member's row goes</summary> ```text main 9609c13, file untouched: pnpm check:skill-identifier-liveness :: exit 0 check-skill-identifier-liveness OK — Leg 1: 563 citation(s) over 76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0 ledgered gap(s). head 47a39aa, the ask_ai row and its footnote words gone: pnpm check:skill-identifier-liveness :: exit 0 check-skill-identifier-liveness OK — Leg 1: 562 citation(s) over 76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0 ledgered gap(s). head 47a39aa with the `form` row also deleted on disk (a probe, restored from HEAD, blob hash identical): node scripts/check-skill-identifier-liveness.mjs :: exit 1 [leg2-missing-row] skills/objectstack-ui/SKILL.md — ### Action Types is registered exhaustive over `ACTION_TYPE_VALUES` (packages/spec/src/ui/action.zod.ts) and does not document `form`. restored: node scripts/check-skill-identifier-liveness.mjs :: exit 0 ``` So on this tree the gate holds the table to `ACTION_TYPE_VALUES`, the live members, and the `ask_ai` row is free to leave. The red reading for deleting that row was taken before the type left, on the first pull request's branch (quoted in objectstack-ai#37937, the first pull request on this card). One reading that differs from what a reader might expect: on `main` the gate was green with the retired row still in the table. It reds on a live member with no row; it did not red on a row for a retired member. </details> <details> <summary>Token ratchet: before, after the text edit, after the row moved</summary> ```text main 9609c13: node scripts/check-skills-token-ratchet.mjs :: exit 0 skills/objectstack-ui/SKILL.md 2262 / 2262 (+0) text edited, row not yet moved: node scripts/check-skills-token-ratchet.mjs :: exit 1 ✗ check-skills-token-ratchet: skills/objectstack-ui/SKILL.md is 2228 tokens; its ratchet ceiling is 2262, above the measurement by 34. ... Lower the row to 2228 in this PR: lowering is shrink-only and is every author's to make, no ruling needed. head 47a39aa: node scripts/check-skills-token-ratchet.mjs :: exit 0 skills/objectstack-ui/SKILL.md 2228 / 2228 (+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. ``` Hand audit: `ceil((8937 - 27) / 4) = 2228`, 27 being the release-stamp line's bytes. </details> <details> <summary>Skill gates (each exit code captured before any pipe)</summary> ```text 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-served-sections :: exit 0 ✓ check-skill-served-sections: 24 served section(s), each heading exactly once in its file (6 json, 2 json+ts, 16 neutral); 10 JSON fence(s) parse and pass their spec validators. pnpm --filter @objectstack/spec run check:skill-examples :: exit 0 (outside the derived list) ✅ 351 prose examples type-check across 3 surface(s) pnpm --filter @objectstack/spec run check:skill-refs :: exit 0 (outside the derived list) ✅ 10 generated files in sync with packages/spec ``` `@objectstack/spec` and the `@objectstack/client-react` closure were built first, under the verify lock (47 turbo tasks, `VERDICT command-exit 0`). </details> <details> <summary>Derived gate list and its reconciliation</summary> ```text node scripts/pm/dispatch-gates.mjs --commands → 68 command(s) node scripts/pm/dispatch-gates.mjs --ran RECORD → ✓ dispatch-gates --ran: 68 derived famil(ies) accounted for — 67 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3). ``` 67 exit 0, among them `check-empty-changeset` ("1 declaring changeset(s) added"), `check-changeset-no-major`, `check-adr-0087-registration`, `check:doc-authoring`, `check:nul-bytes` and `check:pm-dispatch-gates`. NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3, "Run `pnpm build` first. This is NOT a pass: nothing was measured." 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 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 21 passed (21) os-verify-lock: VERDICT command-exit 0 ``` </details> No tested behaviour changes (two lines of published prose, one ceiling row, one changeset), so there is no ablation of a fix; the probe above is a reading of the gate, not of this diff. ## Acceptance notes - The card's acceptance, "`git grep -n ask_ai -- skills/` is empty; skill checks pass", is met at `47a39aad`: the grep exits 1 with no output, and the skill gates are quoted above. - The branch `claude/project-thread-q0nzop` was restarted from `origin/main`. It no longer existed on the remote after objectstack-ai#37937 merged, so it was pushed as a new branch; nothing was force-pushed. - Noted, not acted on here: `chore: version packages (next)` (`9d111a7f`) landed on `main` between the first pull request's merge (`4de4e3e9`) and the type retirement's (`9609c137`), and the registry's `next` tag for `@objectstack/skills` reads `19.0.0-next.2`. The reviews of the first pull request carried a landing condition that no release of that package, a prerelease included, fall between those two merges. That prerelease therefore carries the in-between state: the `objectstack-ai` skill says no page declares an AI button, while the `objectstack-ui` table still lists the type and the type still parses. This pull request and the type retirement close it in the next one. What, if anything, to do about `next.2` is the seat's and the maintainer's. - Not taken: the optional review nit on the first pull request (adding one more forbidden token to eval case 10 in the `objectstack-ai` bundle). It is outside this pull request's file surface. - `content/docs/**` and `packages/**` are untouched. No generated artifact moved: `check:skill-docs` and `check:skill-refs` are in sync without regeneration. ## Verification - Local: the gates above, at `47a39aad`. Repo-wide lint, the full type check, `test:repo` and the dogfood battery are CI's runs and were not repeated locally. No dogfood run is owed: the title has no breaking marker and the declaration has no narrowing arm. - This diff touches `skills/**`, a governed surface: it is opened as a draft and waits for its tier's record. Nothing here readies, queues or arms it. ## 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; 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.) - [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 in Chinese by the fleet's rule.) - [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>
…e until its first send, shown as a chip in the composer (objectstack-ai#38230) repo:objectstack#3 · os-tesla · session_01L9qibwivzADop4jGmFZ81y Fixes objectstack-ai#37861 Clause-②: yes (widening) — `@object-ui/plugin-chatbot` `ChatbotEnhanced` gains the optional `promptInputHeaderSlot`; `@object-ui/app-shell` `UseChatConversationReturn` gains `conversationMetadata` and `createdConversationId` Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:在记录页打开问 AI 时,输入框行首直接显示一个「正在问的记录」标签(图标、名称、×),换页会跟着换,第一次发送后固定下来;原来的图钉和「改为问另一条记录?」提示去掉了。 - 为什么做:「问 AI」入口改造专题的第五张卡,让一个会话问的是哪条记录一目了然,且不用用户手动钉。 - 出错会怎样:最坏是会话带错或没带上记录上下文,用户可点 × 去掉、或新开会话;不支持该能力的助手完全不变,直接撤回这次改动即恢复原样。 - 要你做什么:无。 ## What changes Framework ADR-0160 D6, seventh amendment ("The focus of a conversation"), on the client. Only where the agent declares `capabilities.focus: true`; without it nothing changes (no chip, no `focus` key, the page chip where it was). 1. **State `{ focus, dismissed }`** (`layout/chatFocus.ts`, rewritten). A conversation with no id yet is about the page's record (`surfaceRecord()`, moved here from the row), unless dismissed, and follows the page with no prompt. The first send fixes it: the id that send's own create mints (`useChatConversation`'s new `createdConversationId`) takes the focus it had at that moment, in the same render, so the first turn already carries `context.focus`. The mark keeps the `createdConversationId` the hook held when the send was made, and only a newer one takes it. No other arriving id takes it: a thread a send made during the resolve joins, and a history row opened while the create is on the wire, keep their own fixed or dismissed entry, including a thread this dock created at an earlier send. After that, navigation no longer moves it. A conversation sent without one never takes one. 2. **× removes it, and nothing adds it again** in that conversation, before or after the first send. Another dock target while unsent is another conversation, so × does not carry over. 3. **Restore.** A conversation opened again restores its own focus: this tab's `sessionStorage` copy first, else its row's `metadata.focus` (cloud#5113 shape: an array like `context.focus`, `raw[0]` under a string object/id guard, label trimmed; the client applies no length cap and the chip truncates in CSS; absent or malformed means none). `useChatConversation` now returns `conversationMetadata`, the `metadata` of the row it holds, and `createdConversationId`, the row its own create minted last. The request body stays the authority. 4. **The chip sits inside the composer's frame at the start of the line** (`ChatbotEnhanced.promptInputHeaderSlot`, new, drawn in place of the `surfaceContextLabel` chip when given): object icon, record name (else the metadata label, else `object · id`), and ×. × shows on hover, on focus-within, always on a coarse pointer, and has a 24px hit area. Logical margins, so it sits on the right in RTL. With no focus the page chip 「正在看:X」 shows, with no ×. 5. **Removed:** `setChatFocus` callers are already gone with C1 (objectstack-ai#37924); this removes the pin, the 「改为问《X》?」 offer, `declined`, and the four locale keys `console.ai.focus.pin/switchPrompt/switchAccept/switchDecline` from every pack (they shipped only in 19 prereleases; named on their own line in the changeset). `console.ai.focus.pinned` now names the chip for assistive technology, `.remove` labels ×. 6. **Spec:** the `ToolExecutionContext.focus` docblock and the `capabilities.focus` description no longer speak of a pin; no key, type or gate change (`protocol.mdx` regenerated). ## Tests - `layout/__tests__/chatFocus-36999.test.tsx`, rewritten (25 cases): `surfaceRecord`; `chatFocusFromMetadata` (array, absent, malformed); the dock before the first send following the page, × before and after the send, a list start, a target change resetting ×; restore from `sessionStorage`, from metadata in a new tab (with label), absent/malformed metadata, × in this tab beating metadata, a failed create; a send during the resolve joining a found thread that keeps its ×; a history row opened while the create is on the wire keeping its own focus; the same two paths on a thread this dock itself created earlier, keeping its ×; the × reachability classes; the full page (no record, metadata restore); no-capability agents; the no-flag frame chip. - `plugin-chatbot/__tests__/ChatbotEnhanced.promptInputHeaderSlot-37861.test.tsx` (3): the slot sits inside the input group before the textarea and replaces the surface chip. - `i18n/__tests__/de-quote-pairing-3876.test.ts`: count 129 to 128 for the removed key. Ablations (on disk, restored from the commit): metadata restore plus the unsent rule removed → 10 red; carry plus origin removed → 5 red; `markSending` a no-op → 5 red. At `2a9ab800`: the newer-than-at-send check removed → the two cases on a dock-created thread red (2 of 25); that check and the created-id match both removed → 4 of 25 red. The per-target epoch from the previous round is removed: the held send marks again after a target change, so no case could turn on it. <details><summary>Readings</summary> - Head `37dccd4c` (the second review fix `2a9ab800`, then main merged, 18 behind, no conflict): every test file under app-shell `layout`, `console/ai` and `hooks`, plus `plugin-chatbot` and `i18n`: 505 files, 5413 passed, 13 skipped, 2 failed in `designModeMenuSave-36363` under the shared box, as on every earlier head (it passed alone, 47/47, at `fdb5e405`). The diff does not touch design mode. - `pnpm run type-check` in `@object-ui/app-shell`, `@object-ui/plugin-chatbot` and `@object-ui/i18n`: exit 0 each, after building the dependency closure with declarations. - eslint on `chatFocus.ts` and `useChatConversation.ts`: 0 errors. `chatFocus.ts` has one `react-hooks/refs` warning, for the first-send mark read where an id arrives (main had two in this file). - `overlap-check.mjs` at `37dccd4c`: clean. - `dispatch-gates --ran` at `00f98e0c`: 116 accounted, 115 run, 1 NOT-MEASURED (exit 3, built-output prerequisite). - CI at `fdb5e405`: 74 check runs, 0 failure. </details> ## Acceptance notes - **Conflicts with C1 resolved in favour of this branch** in `chatFocus.ts`, its test and `ChatDockConversation.tsx` (C1 had trimmed the same setter and carry code this rewrite replaces). The second main merge (`00f98e0c`) had no conflict. The file surface is unchanged from the claim. - **Review fixes (L1 R1 = L2 S1, then R2).** The first-send mark goes only to an id the hook created after that send; the two paths the review named have a case each on a thread the dock never created and on one it created earlier, red without the fix. - **Metadata label.** The chip prefers the record's own title (read as before); the metadata label stands in only until that read answers, or when it cannot. - **A sent conversation in another tab** with no stored copy and no `metadata.focus` shows the page chip, not a focus: the server row is the only witness there. - Ships in the same release as C4 (objectstack-ai#37970), per the card. ## Verification Read first, by risk: 1. `ui/packages/app-shell/src/layout/chatFocus.ts`: `nextFocusState` (which arrival of an id takes the first send's mark) and `useConversationFocus`'s effective focus. 2. `ui/packages/app-shell/src/hooks/useChatConversation.ts`: `heldMetadata` and when it is set. 3. `ui/packages/app-shell/src/console/ai/ChatFocusRow.tsx`: the chip and the × classes. Two-minute check: `pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/chatFocus-36999.test.tsx`. Expected: 21 passed. In the Console, with an agent that declares `capabilities.focus`: open a record, open 问 AI, the composer line starts with the record's chip; open another record, the chip follows; send, then navigate away, the chip stays. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibwivzADop4jGmFZ81y)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…t ObjectSchema (objectstack-ai#38299) Fixes objectstack-ai#35924 Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: none — every body this refuses at publish is one a save of the same body already refuses; the published skills' procedure (fix what the refusal names, save the item again) is unchanged and is the remedy ## 维护者速读 - 用户能看到什么变化:在 Studio 里发布对象草稿时,若草稿是在某条更严格的对象校验规则上线之前保存的,发布现在会像保存一样拒绝它,草稿原样保留;正常草稿照旧发布。 - 为什么做:替数据域把保存与发布两道门对齐,避免旧草稿绕过新校验规则直接上线(例如封存审计对象缺少组织链列)。 - 出错会怎样:升级时仍有待发布旧草稿的环境,这些草稿发布会被拒(已标为破坏性变更并写入升级指南);作者按提示修正后重新保存即可;改动可直接撤回,不涉及数据迁移。 - 要你做什么:无 ## What changes `ProtocolHistoryAndPublish.promoteDraftForPublish` now asks the save door's spec parse of an object draft before `repo.promoteDraft` writes. This is the one save-door judge the promotion did not re-run. Before this change, an object draft saved before a narrowing `ObjectSchema` refinement landed went live at publish without that refinement judging it. - **New module** `packages/metadata-protocol/src/protocol-promoted-draft-spec-refusal.ts`: `promotedObjectDraftSpecRefusal(name, body)` parses the draft against `resolveOverlaySchema('object')`, the save door's own resolver (it resolves to `getMetadataTypeSchema('object')`). It refuses with the save door's envelope: `INVALID_METADATA` / `422`, `issues[]` from `zodIssuesToMetadataIssues(..., { refusalParams: true })`, and the save door's default-face sentence (`object/NAME failed spec validation: ...`). - **The body judged is the body the publish serves.** A stored row is read and registered through the ADR-0087 chain (`applyConversionsToStoredItem`), so the parse judges `convertStoredItemDetailed('object', body).item`, not the raw stored bytes. A draft stored in a spelling a later release retired, which the chain converts, still publishes exactly as before. Without this step the fix would falsely refuse such drafts (ablation 2 below shows it). - **Placement:** in the object block of the promotion, after the package-mismatch refusal and before the registry's `objectRegistrationRefusal`. That is the order the save door uses, so a body both refuse keeps the structured `issues[]` (objectstack-ai#5364). The block already skips sealed managed items, which the store refuses `NOT_OVERRIDABLE` anyway. The refusal is thrown before the `judgeOnly` return, so the judge pass of a package publish on a store that cannot roll back raises it too. - `scripts/engine-double-contract.pinned.json`: three rows recording the new test's engine-double pins, written by `node scripts/check-engine-double-contract.mjs --write` as the gate prescribes. It adds no other row. - `.changeset/35924-publish-reparses-object-draft.md`: `@objectstack/metadata-protocol` **minor**, `@objectstack/spec` patch, `Metadata-protocol: narrowed`, a **BREAKING** banner and a `FROM → TO` section with the author's fix, and the ADR-0087 disposition `registered publish-refuses-object-draft-the-current-schema-refuses`. - `packages/spec/src/migrations/entries/semantic/19.publish-refuses-object-draft-the-current-schema-refuses.ts`: the upgrade-guide entry that disposition names. It is notice only: no key is removed and no D2 conversion is added, because the fix is the author's choice. This is the shape of the landed `19.publish-refuses-views-and-dashboards-that-save-and-do-not-work.ts`. ## Why The card's Done-when items: 1. **Reach measured once on main.** It reproduces. On `origin/main` at `e3bdc748`, the harness below saved a valid sealed audit object draft and rewrote its stored row to the pre-ADR-0154-D10 body (no `tenant_id` chain column, the checksum the store would write). The save door refuses that body `422 INVALID_METADATA`. Then: - per-item publish answered `{"success":true,"version":"hmac-sha256:a77d...","seq":1,"message":"Published draft — type=object, name=crm_ledger [seq=1]"}`, and the stored rows became `[{"state":"active","package_id":"com.acme.alpha"}]`; - package publish answered `{"success":true,"outcome":"published","publishedCount":1,"failedCount":0,...}` with the same active row. 2. **The promotion parses an object draft against the current `ObjectSchema`** and refuses it before `repo.promoteDraft` writes: the per-item publish answers the save door's `422 INVALID_METADATA` with its `issues[]`, and the package publish answers `outcome: 'refused'` with the draft in `failed[]` under `code: 'INVALID_METADATA'` and the same `issues[]`. Judge-only batches judge it too. 3. **Pins:** a pre-refinement draft is refused at publish (per item, per package, and in the judge-only pass), with CONTROLs where a valid draft still publishes. 4. **Declaration:** a narrowing, by the seat's ruling below. A pending object draft that published before is refused at publish now. The card's triage comment (7049063373), verbatim: "Triage: lands in `domain:server` (metadata publish) · `pm:queue`; rationale: area:data · Bug · a draft saved before an ObjectSchema refinement landed is promoted at publish without being parsed again; latent for every schema narrowing; no wrong answer measured → p3 as filed · size S." The card has no ruling comment. ### Seat ruling — the declaration The claim carried `Metadata-protocol: none`. The card's Done-when 4 says: "Declare it as a narrowing if a body that published before is now refused at publish." That condition holds as measured (the per-item publish answered 200 on main and 422 with the fix; the package publish answered `outcome: 'published'` on main and `outcome: 'refused'` with the fix), so the dev reported the fork rather than shipping it under `none`. The seat (`repo:objectstack#8`, session `session_017xRBcSAaBEfQpU2yJexSJ8`, 2026-11-28T10:00Z) ruled, verbatim: "Q2 = A — narrowed (the card's own Done-when 4 criterion is met as measured)." The declaration lines above, the changeset, the `!` in the title and the upgrade-guide entry follow that ruling. ## Tests New file `packages/metadata-protocol/src/protocol.publish-draft-schema-reparse.test.ts` (9 cases). The harness is the real save, publish and repository paths over a stub engine whose write verbs are held to ObjectQL's own dispatch decisions: - PREMISE: the two fixtures straddle the refinement (one parses, the other does not). - The save door refuses the pre-refinement body `INVALID_METADATA` / `422`, and nothing is stored. - The per-item publish refuses the pre-refinement draft with `code: 'INVALID_METADATA'` and `status: 422`. Its `lifecycle.seal` issues equal the save door's for the same body, and the draft stays a draft. - The package publish refuses it into `failed[]` (`outcome: 'refused'`, `code: 'INVALID_METADATA'`), and nothing is promoted. - The package publish on a store that cannot roll back (judge-only pass) refuses it, and neither it nor a valid sibling draft goes live. - CONTROL: a fresh valid draft publishes per item, per package, and per package on a store that cannot roll back. - CONTROL: a draft stored with the tombstoned `externalSharingModel`, which the chain strips (`object-external-sharing-model-removed`), still publishes. <details><summary>Run readings (local, at the head named)</summary> - New file, with the fix: `Tests 9 passed (9)`, lock `VERDICT command-exit 0`. - Package suite at `c3c5411f`, run as `pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2` (the following commit only adds three JSON ledger rows): `Test Files 373 passed | 9 skipped (382)` · `Tests 23614 passed | 45 skipped (23659)` · `VERDICT command-exit 0`. - `pnpm --filter @objectstack/metadata-protocol typecheck`: `VERDICT command-exit 0`. `tsc --listFiles` lists both new files, so the test is type-checked. - **Ablation 1** (`scripts/ablation-replace.mjs`, anchor `if (specRefusal) throw specRefusal;` deleted; `anchor 1 -> 0, blob 9f79c4b -> e7959dfad426`): `Tests 3 failed | 6 passed (9)`. The three failures are the per-item, package and judge-only refusal pins. The premise, the save-door pin and all four CONTROLs stay green. Restored: `blob == HEAD (9f79c4b) and git diff HEAD is empty`. - **Ablation 2** (the converted body replaced by the raw stored body, `const served = body;`; `anchor 1 -> 0, blob 3528de1 -> 0c1293f4f03d`): `Tests 1 failed | 6 passed (7)`. The one failure is the legacy-spelling CONTROL. This run is from before the judge-only pins were added. Restored: `blob == HEAD (3528de1)`. - The subject is imported as `./protocol.js`, a relative source specifier, so neither ablation needed a `dist/` rebuild. - `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/migrations` (the new ledger entry): `Test Files 5 passed (5)` · `Tests 207 passed (207)` · `VERDICT command-exit 0`. - **Dogfood battery** at `f7534a646` (the title carries `!`), run as CI runs it: the closure was built with `pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build` (`VERDICT command-exit 0`), then `pnpm --filter @objectstack/dogfood test` was run under the lock with no shard and no path. Result: `Test Files 491 passed | 3 skipped (494)` · `Tests 4148 passed | 68 skipped (4216)` · `VERDICT command-exit 0`, with no failures. A first attempt is void and not counted: I mis-spelled the concurrency flag, which forwarded `--concurrency=2` into the CLI's build script and broke it, so the test step ran against a partial closure. I stopped that run. </details> ## Acceptance notes - **Other types (read only, not measured):** the save door parses every type with a registered schema, but the promotion now re-parses only `object`, the type this card names. Whether every type's stored draft should be re-parsed at promotion is not asked here. The stored-draft populations differ: a `flow` is judged through `storedFlowVerdictBody`, and a `view` stores its parsed projection. carrier: none. - **File surface:** beyond the claimed publish path, co-located test and changeset, the diff writes two more files. (1) The three `scripts/engine-double-contract.pinned.json` rows the gate requires for any new pinned engine double, generated by the gate's own `--write`; the diff adds no other row. (2) One file under `packages/spec/src/migrations/entries/semantic/`, the ledger entry `check:adr-0087-registration` requires for a declared narrowing, written on the seat's order ("whatever ADR-0087 registration `check:adr-0087-registration` then demands (ledger entry under semantic/19.*)"). No other file in `packages/spec/src/**` is touched, and no `ObjectSchema` refinement. - `overlap-check.mjs` before each push: `VERDICT clean exit 0`. At the last run it merges cleanly with `origin/main` (`e2a0e9002`); an earlier run also showed it merging cleanly with objectstack-ai#37924, which shares the engine-double ledger file. ## Verification Read first, by risk: 1. `packages/metadata-protocol/src/protocol-promoted-draft-spec-refusal.ts`: the parse, the conversion step and the envelope. 2. The new block in `packages/metadata-protocol/src/protocol-history-and-publish.ts`, right after the `overlayPackageMismatchError` throw in `promoteDraftForPublish`. 3. `packages/metadata-protocol/src/protocol.publish-draft-schema-reparse.test.ts`: the `rewriteStoredDraft` setup and the CONTROLs. Two-minute check: `pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.publish-draft-schema-reparse.test.ts` should show `9 passed`. Delete the `if (specRefusal) throw specRefusal;` line and run it again: the three refusal pins go red. Local gates: the full `dispatch-gates.mjs --commands` list for this diff, 102 families at `f7534a646`, was run and reconciled (`--ran`: `102 derived famil(ies) accounted for`). The 25 families the spec ledger entry added all exit 0, among them `check:spec-changes`, `check:upgrade-guide`, `check:api-surface` (unchanged), `check:authorable-surface`, `check:docs`, `check:liveness` and the CLI's `migrate-meta-engine-guidance` test (3/3). `spec check:generated`: all 14 artifacts are up to date after a spec build. `check:adr-0087-registration`: `1 declared-breaking changeset(s), each carrying an ADR-0087 disposition … registered publish-refuses-object-draft-the-current-schema-refuses (new here …)`. All exit 0 except one that is NOT MEASURED locally and is carried by CI: `check-plugin-teardown-shape --self-test` exits 3 because it needs an unshallow clone. `check:dual-build-cjs-loads` and `check:lean-entry-closure` first exited 3 (no `dist/`); after the dogfood closure build they exit 0 at `f7534a646`. `check:engine-double-contract` went red until its ledger rows were written, then exited 0. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (The only `packages/spec` change is one data-only upgrade-guide entry.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` is left to CI. - [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 (one migration-ledger entry): spec rebuilt and `check:generated` reports all 14 artifacts up to date, so there is nothing to regenerate. The registry it feeds is gitignored. - [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, except the Chinese maintainer summary the repo requires. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017xRBcRoJWF7MQr6HoRgBeC --- _Generated by [Claude Code](https://claude.ai/code/session_017xRBcRoJWF7MQr6HoRgBeC)_ <!-- signed: repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Requested by Tesla · project thread
Fixes #37856
Fixes #37827
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37857
维护者速读
What changes
ADR-0160 D7, seventh amendment:
ask_aileavesActionTypebefore 19.0.0 with no compatibility shim. It was published only on19.0.0-next.0.packages/spec/src/ui/action-ask-ai-retired.ts, not barrel-exported) in every slot that takes an action type:ActionType(nowenumWithRetiredValues, so the dashboard header's derivedactionTyperefuses it too), a declared or inline action'stype,actionTypeonaction:button/action:iconrows, andtypeonaction:group/action:menumembers.action-type-ask-ai-removed(retired from the load path,retiredAfter: '18.6.0') and D3 entryui-action-type-ask-ai-retired.ConversionContext.atResttells the two doors apart:os migrate meta --from 18) a declaredask_aiaction 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'sreportTodocall is not reached in production:os migrate metapasses no context, and at restkeepis always false. L2 N1, 7218663105.) The conversion never deletes a reference.ask_aiaction, row and member is deleted.applyConversionsToStoredItemreturnsundefinedwhen the chain leaves nothing of a row. Its callers inmetadata-protocol(overlay reads, list drafts, registry hydration, diff load, package duplicate/import),metadata(DatabaseLoader),core(authored translation sync) andservice-datasourceserve and register nothing for such a row.DatabaseLoaderstill reads a row's identity (name, object binding) from the stored body, so the delete door reaches it.migrateStoredMetadatalists itskippedwithDELETE /api/v1/meta/action/<name>instead of re-saving it.setAssistantFocusHandler/drawsAction/isAskAiAction;<ActionProvider onAskAi>anduseDrawsAction(); the renderers' drawn-action gates;useAskAiHandler;setChatFocusand its hosts. The conversation pin from conversation focus: a pinned record in the chat request, shown as a chip, kept across navigation #36999 stays, set from the composer chip only. Record page hides everytype: 'ask_ai'action: RecordDetailView's own ActionProvider drops the shell's onAskAi #37827 (the record page dropping the handler) closes because the handler is gone.ActionType's live members are now the non-exportedACTION_TYPE_VALUESarray it wraps.scripts/check-skill-identifier-liveness.mjsbinds the### Action Typestable to it (theSeedModeprecedent). 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 answersundefinedfor an ask_aiactionrow 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,existsanddeletereach 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 rowskippedwith 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
4de4e3e9, and this branch merged it (24857955, headffd87c6a).check:skill-examplesis green on the merged tree (351 examples). The release PR chore: version packages (next) #37661 (30a8047b,19.0.0-next.1) merged between the two, so a next.1 published from that tree has the skills without theask_aiteaching while the spec still parses it. This PR closes that window and should land before the next prerelease. The record is on docs(skills): objectstack-ai no longer teaches an authored AI button on a record page #37937.check:api-surface,check:authorable-surfaceandcheck:generatedare green with no baseline file changed. The reference pages undercontent/docs/references/are regenerated (the enum lists loseask_ai).git grep -n ask_aioutsideskills/**,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.mdand thesetChatFocusline of.changeset/pre/36999-conversation-focus.mdare left as written. This PR's changeset carries the correction. Whether the prerelease texts themselves change is for the release owner.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:fix(lint): regex/JSON Schema 编译不过的校验规则改在发布期拒绝 —— 声明了却什么都不拦的两个静态产物 (#4762) #5027#1, who gets a Notify with the merge sha on pm:mailbox — epic:#5027#1 · hotlong #37634.Verification
Readings
vitest runfull package 976 files / 29,727 tests, 1 red before the pin join (fixed, 68/68 after);src/ui src/conversions src/migrations224 files / 7,701 tests green.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.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'sundefinedin 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).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.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.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK