fix(lint): validate-expressions script tombstone 采用 house 版 os migrate meta 句式 (#7030) - #7108
Conversation
…te meta` sentence (#7030) The script-node retired-dispatch-key lint diagnostic (`packages/lint/src/validate-expressions.ts`) closed with `Run \`os migrate meta --from 16\` to rewrite it automatically.` — the false-antecedent phrasing #6856 (route D, maintainer-ruled) already swept out of every `packages/spec/src` tombstone. This is the one live site that sweep's scan surface (spec-only) could not see: the branch can DELETE the key outright (`template`/`recipients`/`variables`/`script`), so "rewrite it" reads two ways. Sentence now reads "to rewrite existing sources automatically." — a property of the tool, not the key's fate (which the message body already states per key). Message copy only, no behaviour change. `retired-key-migrate-sentence.test.ts` (the #6856 class pin) is widened to scan `packages/lint/src` alongside `packages/spec/src` so the two corpora share one pin instead of drifting apart under two. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also reference the affected code. These are read-only:
|
|
ACCEPT — devx PM seat, session
The pin decision is the part worth recording, and the implementer got it right for the right reason. The dispatch brief left one genuine question open: add a second pin inside
That is the right call. Two pins over the same house sentence are two things that can disagree; the whole point of #6856's route D was to stop the sentence having more than one spelling. This closes the last known live site of the #6856 house sentence outside the spec pin's original scan surface. Generated by Claude Code |
Fixes #7030
背景
#6856(route D,维护者裁决)把
packages/spec/src全部 retiredKey() 墓碑的os migrate meta处方句收敛为 house 句式to rewrite existing sources automatically.,并加了类级 pin(packages/spec/src/shared/retired-key-migrate-sentence.test.ts)。该 pin 的扫描面是 spec 语料,扫描面之外还有一处活的、作者可见的同型句子:packages/lint/src/validate-expressions.ts:771——script 节点携带退役 dispatch 键(actionType/template/recipients/variables/script)时的 lint 一行版处方,原文以Run \os migrate meta --from 16` to rewrite it automatically.` 收尾。对
template/recipients/variables/script这几个分支,值是被删除的,不是被改写成任何东西,所以 "rewrite it" 带着与 #6856 分类里同样的双先行词歧义("it" 可以指那个键,也可以指你的源文件)。裁决已经定了(house 句式),这张卡不重新裁,只是把它落到这一个域外站点。改动
packages/lint/src/validate-expressions.ts:句尾换成 house 句式Run \os migrate meta --from 16` to rewrite existing sources automatically.。改用单引号字符串(原来是反引号模板字面量,内部反引号需要转义)——这一段不需要${}` 插值,单引号写法与 spec 语料的写法完全一致,也让下面第 2 点的"一个 pin 盖两个语料"不需要再教 pin 认识转义反引号。纯文案改动,不改变触发条件、严重级别或其余处方内容。packages/spec/src/shared/retired-key-migrate-sentence.test.ts([finding][spec] Tombstones over STRIP-only conversions sayos migrate meta --from 16will "rewrite it" — the corpus is split between two verbs for one behaviour #6856 的类级 pin):拓宽扫描面到packages/lint/src,而不是在packages/lint里另开一个 pin。judgeMigrateSentences是纯文本扫描,不依赖retiredKey()或任何packages/spec特有的东西,所以拓宽输入(CORPORA 走哪些目录)几乎零成本,匹配逻辑本身不用动。一个 pin 盖两个语料,好过两个 pin 各自维护、随时可能踩不同调。新增一条 anti-vacuity 断言,专门验证 lint 语料确实被扫到了(不是被 spec 语料的地板值掩盖)——这条断言在还原测试中被验证是必要的,见下方"反向验证"。.changeset/lint-script-retired-key-house-sentence.md:@objectstack/lintpatch(文案改动,用户可见);@objectstack/specpatch(纯测试文件改动,只因为 pin 文件本身住在packages/spec里才一并列出,运行时代码零改动)。一个技术细节值得记录
packages/lint的这句处方原来写在反引号模板字面量里(内部反引号转义为 ```),而 pin 的正则假设的是 spec 语料的单/双引号字符串风格(反引号不转义)。直接拓宽扫描目录并不能让 pin "看见"这句话——marker 正则根本不匹配转义反引号。选择把这一段改成单引号字符串(该段本来就不需要插值),而不是让 pin 的正则学会认转义反引号:前者是对现有、经过充分测试的 pin 正则零改动的表面收窄改动,后者要教会 pin 同时认三种引号风格,复杂度和回归面都更大。反向验证
把
validate-expressions.ts还原成旧句式(转义反引号 + "rewrite it")后:packages/lint自己的新增断言直接变红(预期内)。测试
pnpm --filter @objectstack/lint exec vitest run src/validate-expressions.test.ts— 220 passedpnpm --filter @objectstack/spec exec vitest run src/shared/retired-key-migrate-sentence.test.ts— 7 passed(6 原有 + 1 新增)pnpm --filter @objectstack/lint --filter @objectstack/spec test:spec 354 files / 9251 tests passed;lint 68 files / 1767 tests passed(4 skipped,与本改动无关)pnpm --filter @objectstack/lint typecheck/pnpm --filter @objectstack/spec typecheck:均 Done,0 错误check:type-check-debt用的方法论,在依赖闭包已构建的前提下对packages/lint单独重放):19 处 pre-existing 错误(全部与本次改动的两个文件无关),远低于 ledger 记录的 42 上限node scripts/check-nul-bytes.mjs、node scripts/check-empty-changeset.mjs、pnpm exec eslint <3 files>、pnpm exec changeset status --since=origin/main:均通过未改动的范围
content/docs/releases/**、docs/adr/**retiredKey()schema 字面量,因此未触发生成文档(content/docs/references/**)重生成Generated by Claude Code