Skip to content

[finding] check-widening-tells T4 把 ERROR_CODE_LEDGER 的出处行读成扩面 —— 并集实测 282→282、added/removed 皆空,却恒逼出假的 Clause-②: yes #19440

Description

@huangyiirene

Path: none | instrument (scripts/pm/check-widening-tells.mjs T4 — the why sentence :3903 on ERROR_CODE_LEDGER provenance rows; the accept-set limb only) | family with #19221 (same tool); region-parallel with PR #19438 (T2) | graded by domain:skills#2

domain:services 席(session_01AhQASwqJr2Z7XfGWUdvnbF)立卡,证据为本席独立复测,⛔ 非转述。⛔ 未分诊、⛔ 无 domain:*、⛔ 无定级。

缺陷

ERROR_CODE_LEDGER 的分包数组按该文件自己的头部自述是 provenance(出处)不是 identity(身份):「a code emitted by several packages is listed once per emitting package」。因此给已存在的码增加一个发射方包的行,不会让运行时接受的码集变大。

scripts/pm/check-widening-tells.mjsT4 把它读成扩面:

✗ T4 packages/spec/src/api/error-code-ledger.zod.ts:1121 —
   a new registration in a registry / catalog — what the runtime accepts grows with no schema file moving

复现(本席跑的,带对照)

72d68b905(PR #19437),对照基线 origin/main:

$ git diff origin/main...HEAD > d
$ node scripts/pm/check-widening-tells.mjs --declaration no --diff d
✗ T4 … error-code-ledger.zod.ts:1121 ;  exit 4

而该 diff 对去重并集的实际影响,本席单独测过(⛔ 只计数组元素行,排除注释行 —— 新增注释里恰好写了那个码名,把它计进去就是自己制造答案):

去重并集
改动前(origin/main) 282
改动后 282
added / removed [] / []
对照:UNIQUE_VIOLATION 改动前是否已在集内

接受集一个码都没多。T4 的判据文字(「what the runtime accepts grows」)在这个文件上不成立。

后果

check-clause2-carriers --pair 因此退 4(行 C5:申报 no 而 diff 带 tell)。⇒ 今后每一条 ledger 出处行都会逼出一个假的 Clause-②: yes,或者逼出一次人工豁免。lanes/spec.md 的常设承诺明文预批了跨车道 ledger 追加这一整类 —— 预批的类,却在门禁上恒红。

修法(门禁自己点名的那条)

该工具的失败文本逐字写着:「if the tell is FALSE, repair it here in the matcher (scripts/pm/check-widening-tells.mjs, with a --self-test case pinning the shape), or file that repair as its own card when it is out of this PR's scope」。本卡即它点名的那张卡。 修法要点:T4 对 ERROR_CODE_LEDGER 需按并集判定而非按行判定,并配一个 --self-test 用例钉住「加一条既有码的出处行 ⇒ 不是 tell」。

Seam: consumer: none(席位工具面,无运行时/渲染消费者)

查重词

widening-tells T4 ledger provenance false positive · clause2 C5 error-code ledger dedupe · error code provenance row is not identity · check-widening-tells registry entry dedupe · T4 union unchanged 282


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions