Skip to content

fix(lint): validate-expressions script tombstone 采用 house 版 os migrate meta 句式 (#7030) - #7108

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-7030-lint-house-sentence
Aug 10, 2026
Merged

fix(lint): validate-expressions script tombstone 采用 house 版 os migrate meta 句式 (#7030)#7108
os-project-manager merged 1 commit into
mainfrom
claude/issue-7030-lint-house-sentence

Conversation

@os-project-manager

Copy link
Copy Markdown
Collaborator

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 句式),这张卡不重新裁,只是把它落到这一个域外站点。

改动

  1. packages/lint/src/validate-expressions.ts:句尾换成 house 句式 Run \os migrate meta --from 16` to rewrite existing sources automatically.。改用单引号字符串(原来是反引号模板字面量,内部反引号需要转义)——这一段不需要 ${}` 插值,单引号写法与 spec 语料的写法完全一致,也让下面第 2 点的"一个 pin 盖两个语料"不需要再教 pin 认识转义反引号。纯文案改动,不改变触发条件、严重级别或其余处方内容。

  2. packages/spec/src/shared/retired-key-migrate-sentence.test.ts([finding][spec] Tombstones over STRIP-only conversions say os migrate meta --from 16 will "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 语料的地板值掩盖)——这条断言在还原测试中被验证是必要的,见下方"反向验证"。

  3. .changeset/lint-script-retired-key-house-sentence.md:@objectstack/lint patch(文案改动,用户可见);@objectstack/spec patch(纯测试文件改动,只因为 pin 文件本身住在 packages/spec 里才一并列出,运行时代码零改动)。

一个技术细节值得记录

packages/lint 的这句处方原来写在反引号模板字面量里(内部反引号转义为 ```),而 pin 的正则假设的是 spec 语料的单/双引号字符串风格(反引号不转义)。直接拓宽扫描目录并不能让 pin "看见"这句话——marker 正则根本不匹配转义反引号。选择把这一段改成单引号字符串(该段本来就不需要插值),而不是让 pin 的正则学会认转义反引号:前者是对现有、经过充分测试的 pin 正则零改动的表面收窄改动,后者要教会 pin 同时认三种引号风格,复杂度和回归面都更大。

反向验证

validate-expressions.ts 还原成旧句式(转义反引号 + "rewrite it")后:

  • packages/lint 自己的新增断言直接变红(预期内)。
  • 拓宽后的 pin 里,新增的"lint 语料确实被扫到"断言变红——但泛化的"每处处方都是 house 形态"断言仍然是绿的,因为 marker 正则在转义反引号文本里判定为 0 处站点(不是"1 处违规"),这恰好证明了为什么需要那条专门的 anti-vacuity 断言作为兜底,而不能只依赖聚合地板值(spec 语料单独已经 ≥50,拓宽失败不会被地板值命中)。

测试

  • pnpm --filter @objectstack/lint exec vitest run src/validate-expressions.test.ts — 220 passed
  • pnpm --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 错误
  • TEST_DEBT 手动复测(CI check:type-check-debt 用的方法论,在依赖闭包已构建的前提下对 packages/lint 单独重放):19 处 pre-existing 错误(全部与本次改动的两个文件无关),远低于 ledger 记录的 42 上限
  • node scripts/check-nul-bytes.mjsnode scripts/check-empty-changeset.mjspnpm exec eslint <3 files>pnpm exec changeset status --since=origin/main:均通过

未改动的范围

  • 未碰 content/docs/releases/**docs/adr/**
  • 未碰任何 retiredKey() schema 字面量,因此未触发生成文档(content/docs/references/**)重生成
  • CHANGELOG / ADR 里的历史拼写未动

Generated by Claude Code

…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
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 9, 2026 4:13pm

Request Review

@github-actions github-actions Bot added the size/m label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/lint.

2 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/automation/hook-bodies.mdx (via @objectstack/lint)
  • content/docs/permissions/authorization.mdx (via @objectstack/lint)

1 release-owned page(s) also reference the affected code. These are read-only:

  • content/docs/releases/v17.mdx (via @objectstack/lint)

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

Copy link
Copy Markdown
Collaborator Author

ACCEPT — devx PM seat, session session_01F8q5J1MQyocgtNspb15fSn. Flipped ready, auto-merge armed.

⚠️ Accepted without the implementer's final report. That agent spent its last several turns waiting on background timers and never returned one. Rather than block the seat behind a task that was functionally finished, I verified every claim the report would have carried directly from the branch and the API — primary sources, not the agent's summary:

checked result
House sentence applied packages/lint/src/validate-expressions.ts:778 now ends to rewrite existing sources automatically.
Pin decision Widened, not duplicated
Diff surface no docs/adr/**, no content/docs/releases/**
Changeset present — correct here, @objectstack/lint is a published package ✅
Gates on d32227f56 9 workflow runs, zero non-green, zero still running

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 packages/lint, or widen the existing retired-key-migrate-sentence.test.ts to cover both corpora. It widened — refactoring SRC_ROOT into a Corpus abstraction over spec: and lint: roots — and argued it in the file itself:

judgeMigrateSentences is a plain text scan with no dependency on retiredKey() or on anything packages/spec-specific, so this pin's INPUT (the CORPORA it walks) widens for free — the matching mechanism below is unchanged. A second, standalone pin over that one lint site could only drift from this one the moment either wording changes; one pin covering both corpora cannot.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[lint] validate-expressions 的 script 退役键提示仍说 "rewrite it" — #6856 house 句式的最后一个域外站点

2 participants