Skip to content

[finding] validate-list-view-field-refs.test 的 docblock 声称「规则加了位置而表没加行会让计数断言变短」,但那个断言是 toBeGreaterThanOrEqual 地板 ⇒ 该方向什么都不红 —— 正是 #18565 那个洞进来的方向 #18836

Description

@os-bill

⏱️ 本卡所有读数取自同一动作:2026-09-17T23:34Z,树为 origin/main = c993b7c820。承接 #18565 / PR #18833。

一句话

packages/lint/src/validate-list-view-field-refs.test.ts 的 docblock 声明这张表在两个方向上都拦得住,但第二个方向它拦不住 —— 那个断言是 toBeGreaterThanOrEqual(地板),而地板对「规则加了位置、表没加行」永远为真。⭐ 这正是 #18565 那个洞得以存在的方向。

逐字读数

packages/spec 无关;文件是 packages/lint/src/validate-list-view-field-refs.test.ts

:193-197(docblock,逐字):
  /**
   * Every remaining position, with the severity tier it earns. The table is the
   * readable half of the rule's own POSITIONS table: a position dropped from the
   * rule fails here, and a position added to the rule without a row here leaves
   * the count assertion below short.
   */

:281-284(它所指的那个断言,逐字):
  // A floor, so a position quietly dropped from the rule's table cannot pass
  // by simply never being asserted.
  it('covers every position the rule walks', () => {
    expect(cases.length).toBeGreaterThanOrEqual(46);

两个方向,分开判

  • 方向一「a position dropped from the rule fails here」—— 成立。 规则里少走一个位置,该位置对应的 case 就不再产出 finding,逐 case 的断言当场红。⇒ 这一半是真的,而且靠的是 case 断言,⛔ 不是那个计数。
  • 方向二「a position added to the rule without a row here leaves the count assertion below short」—— ⛔ 不成立。 cases.length 数的是测试表自己的行数。规则新增一个位置,cases.length 纹丝不动,≥ 46 照样为真 ⇒ 什么都不红。⚠️ docblock 描述的是一个 toEqual 的行为,而代码写的是 toBeGreaterThanOrEqual。

⚠️ 注意 :281 那条行内注释本身是准确的 —— 它说的是地板防「表被悄悄删行」,那确实是地板能做到的。⇒ 缺陷在 :193-197 那段 docblock 多声明了一个方向,⛔ 不在行内注释。

为什么这不是措辞问题

⭐ #18565 就是这个方向的活证据:KanbanConfigSchema 从 #16894 起声明了 titleField,而 POSITIONS 里没有对应行 —— 这份测试一声没吭,因为它拦不住这个方向,而 docblock 让读者以为它拦得住。⇒ 一个声明了自己没有的保护的 pin,比没有 pin 更坏:它让下一个读者不再去找别的保护。

⚠️ 公道地记一笔:#18833 已把地板从 46 抬到 47。那是对的,但它不改变本卡 —— 抬地板只是让表不缩水,方向二依旧敞着。

建议(⛔ 非裁定)

⭐ 本席倾向 A,理由是 #18565 的洞恰好从这个方向进来,而 B 只是不再撒谎、并不设防。⛔ 由维护者/triage 定。

查重(MCP search_issues,含 closed)

以 计数断言/地板/toBeGreaterThanOrEqual/docblock 声称的保护 等词检索:两条命中 #15231(check-wildcard-fallthrough 自测里一个转抄的 17 cases 与断言的 18 不符)与 #15324(measure-self-test-floor 的探针把非零退出码单独判成 HELD)—— 均已 closed,且都是别的门禁、别的机制。⇒ 无孪生。

出处

domain:spec seat 2(座位贴 #18549)复核 PR #18833 / 卡 #18565 时,dev 在 out_of_scope_findings 里交回(class b)。⭐ 本席核对过它引的那句话确实存在(:196-197,逐字),并把 docblock 的两个方向拆开各自判过,⛔ 不是转述报告。


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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions