Skip to content

Commit 10755db

Browse files
fix(types): the plugin-ai refusal messages carry no tracker number (#27317)
<!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8GropaGfisws7uCMjfztFep)_ Fixes #27290 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:`ui/packages/types/src/zod/ai.zod.ts` 里两条运行时拒收文案(三个已退役 AI 节点类型的处方,和八个 `z.never()` 墓碑名的报错)去掉了 `(objectstack#25921)` 这个工单号;钉住它的测试改为断言退役措辞,并新增「报错里不带工单号」的反向断言。 - 为什么改:根 AGENTS.md 规定作者看到的运行时文字不带工单号,`check:doc-authoring` 不扫 `ui/packages/**`,所以这两条漏过了。 - 风险与回滚:只改报错文字,接受与拒收的内容完全不变;回滚就是 revert 本 PR。 - 先看:`ui/packages/types/src/zod/ai.zod.ts` 两处字符串;`ui/packages/types/src/__tests__/plugin-ai-retired-25921.test.ts` 的 suite 1 与 suite 4;`.changeset/27290-plugin-ai-refusal-no-tracker.md`。 - 两分钟验证:在仓根跑 `pnpm --dir ui exec vitest run packages/types/src/__tests__/plugin-ai-retired-25921.test.ts`,应看到 17 个测试全绿;把工单号放回任一条文案,对应 suite 的反向断言变红。 - 需要你做的:无,席位落地。 ## What changes - `ai.zod.ts`: `PLUGIN_AI_RETIRED` (the remedy every retired node-type refusal carries) and the `retiredExport` text (the message of the eight `@deprecated` `z.never()` names) drop `(objectstack#25921)`. Both still name `@object-ui/plugin-ai` and the remedy. The `@deprecated` JSDoc lines and the test file's `@ts-expect-error` comment are code comments and keep the tracker, as the card says. - `plugin-ai-retired-25921.test.ts`: suite 4 no longer asserts the tracker. It asserts the retirement wording (the name, "mirrored a node type of `@object-ui/plugin-ai`, which retired") and the remedy ("Remove the reference"). Suites 1 and 4 each gain a negative assert that the message matches no tracker shape (`/#\d/`), so the rule is pinned on both strings. - One `patch` changeset for `@object-ui/types`. ## Tests - The pin: `Test Files 1 passed (1)`, `Tests 17 passed (17)`. - Whole `@object-ui/types` suite: `Test Files 391 passed (391)`, `Tests 10662 passed (10662)` (first head `6be5159c`). - Ablation, two one-shot legs through `scripts/ablation-replace.mjs` (anchor 1 to 0, blob changed, restored to the `HEAD` blob with `git diff HEAD` empty after each). The test imports `../zod/index.zod` by relative path, so there is no `dist` leg. - tracker put back into `PLUGIN_AI_RETIRED`: red, `Tests 3 failed | 14 passed (17)`, all three suite 1 cases failing on `not to match /#\d/`. - tracker put back into the `retiredExport` text: red, `Tests 8 failed | 9 passed (17)`, all eight suite 4 cases failing on `not to match /#\d/`. ## Acceptance notes - Other `objectstack#25921` hits under `ui/` (`git grep -n 'objectstack#25921' -- ui/ docs/ content/`) are code comments, test names, ledger reasons in tests, the zod README and `index.ts` comments. None is a runtime string an author is shown, so all are kept. No snapshot or other test reads either string. - The `cloud.zod.ts` and `data-display.zod.ts` sweep is out of this card by triage's ruling. ## Verification Local readings on head `ed4a429f` (merge base `a0aa8a1f`; `origin/main` merged in once after the first head `6be5159c`, the derived list unchanged). Exit codes captured before any pipe; CI owns every other family. <details><summary>34 derived gate families: 34 run, all exit 0; <code>dispatch-gates --ran</code> reconciles 34/34, 0 NOT-MEASURED</summary> ```text node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0 node scripts/check-adr-0087-registration.mjs --self-test :: exit 0 node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0 node scripts/check-closing-keyword-parity.mjs :: exit 0 node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0 node scripts/check-comment-mask-corpus.mjs :: exit 0 node scripts/check-empty-changeset.mjs --base origin/main :: exit 0 node scripts/check-empty-changeset.mjs --self-test :: exit 0 node scripts/check-sdui-manifest.mjs :: exit 0 node scripts/check-sdui-manifest.mjs --self-test :: exit 0 node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0 node scripts/release-pending-publish.mjs --self-test :: exit 0 pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0 pnpm check:changeset-gate-self-tests :: exit 0 pnpm check:closed-ceremony-text :: exit 0 pnpm check:cross-package-test-inputs :: exit 0 pnpm check:dispatcher-error-vocabulary :: exit 0 pnpm check:driver-memory-census :: exit 0 pnpm check:engine-double-contract :: exit 0 pnpm check:gitlink-declared :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:pm-changeset-deadline-census :: exit 0 pnpm check:published-files :: exit 0 pnpm check:query-options-erasure :: exit 0 pnpm check:refd-timer-probe :: exit 0 pnpm check:skill-identifier-liveness :: exit 0 pnpm check:test-source-alias :: exit 0 pnpm check:tier-file-adoption :: exit 0 pnpm check:type-check-coverage :: exit 0 pnpm check:type-check-debt :: exit 0 pnpm check:undeclared-dep-imports :: exit 0 pnpm check:watch-hint-literal :: exit 0 pnpm check:where-matcher :: exit 0 pnpm --dir ui exec vitest run scripts/ :: exit 0 ``` The ui scripts suite read `Test Files 174 passed | 2 skipped (176)`. On the first head it went red in three files that do not read this diff (`unit-registry-absence-collision`, `date-only-zone-pins-10183`: could not resolve `@objectstack/formula` and sibling packages with only the `@object-ui/types` closure built; `check-hand-rolled-comment-mask`: a 15 s timeout while the unlocked gates ran beside it). After building the `@object-ui/console` closure the three read `Tests 66 passed (66)` and the whole suite went green, on both heads. </details> <details><summary>Owed beyond the derived list: the package type-check (it compiles the test through <code>tsconfig.test.json</code>) and the line-citation check</summary> ```text pnpm --filter @object-ui/types run type-check :: exit 0 pnpm --dir ui run check:new-line-citations :: exit 0 ``` `check:new-line-citations` printed `0 new citation(s)`. </details> `dispatch-gates --tier` on this surface: no path-derived mandate (TIER_DEFAULT). Changed lines 23 (+19 / -4). ## 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. (no names added) - [x] 3. No formatter ran; `pnpm lint` passes. (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: 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 (the 维护者速读 block is the dispatch-required Chinese summary). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxbZ79dCKFPpRLLJ8Vgw)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 829fcf2 commit 10755db

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/types': patch
3+
---
4+
5+
fix(types): the plugin-ai refusal messages no longer carry a tracker number
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The refusal for an `ai-form-assist`, `ai-recommendations` or `nl-query` node, and the message of the `@deprecated` `z.never()` names (`AIFormAssistSchema` and the rest under `@object-ui/types/zod`), no longer quote an issue number. They still name `@object-ui/plugin-ai` and the remedy. What they accept and refuse is unchanged. Nothing to do.

‎ui/packages/types/src/__tests__/plugin-ai-retired-25921.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ describe('suite 1 — each retired literal is REFUSED, by name (objectstack#2592
9494
expect(issue?.message).toContain(`\`${node.type}\` is a RETIRED node type`);
9595
expect(issue?.message).toContain('@object-ui/plugin-ai');
9696
expect(issue?.message).toContain('Remove the node from the page');
97+
// Runtime refusal prose carries no tracker number (root AGENTS.md).
98+
expect(issue?.message).not.toMatch(/#\d/);
9799
});
98100
});
99101

@@ -131,7 +133,10 @@ describe('suite 4 — the published zod names are `never` tombstones', () => {
131133
for (const value of [{}, { type: 'ai-form-assist' }, 'x']) {
132134
const result = schema.safeParse(value);
133135
expect(result.success).toBe(false);
134-
expect(result.error?.issues[0]?.message).toContain('objectstack#25921');
136+
const message = result.error?.issues[0]?.message;
137+
expect(message).toContain(`\`${name}\` mirrored a node type of \`@object-ui/plugin-ai\`, which retired`);
138+
expect(message).toContain('Remove the reference');
139+
expect(message).not.toMatch(/#\d/);
135140
}
136141
});
137142

‎ui/packages/types/src/zod/ai.zod.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ import { retiredNodeType } from './tombstone.zod.js';
4444

4545
/** The remedy every refusal in this module carries — one string, both channels. */
4646
const PLUGIN_AI_RETIRED =
47-
'It retired with `@object-ui/plugin-ai` (objectstack#25921): nothing registers it, so the page rendered '
47+
'It retired with `@object-ui/plugin-ai`: nothing registers it, so the page rendered '
4848
+ 'the "Unknown component type" panel in its place. Remove the node from the page; there is no '
4949
+ 'replacement node type.';
5050

5151
/** A published name kept as a `never` tombstone: every parse fails, naming the remedy. */
5252
const retiredExport = (name: string) => {
53-
const text = `RETIRED — \`${name}\` mirrored a node type of \`@object-ui/plugin-ai\`, which retired `
54-
+ '(objectstack#25921), and accepts nothing. Remove the reference.';
53+
const text = `RETIRED — \`${name}\` mirrored a node type of \`@object-ui/plugin-ai\`, which retired, `
54+
+ 'and accepts nothing. Remove the reference.';
5555
return z.never({ error: text }).describe(text);
5656
};
5757

0 commit comments

Comments
 (0)