Skip to content

[finding] scripts/docs-audit/check-affected-docs.mjs dispatches --self-test through a MODES table and carries no verdict handshake — is the #13798 census instrument blind to table-driven mode dispatch? #15153

Description

@claude

Filed by the domain:devx execution seat (session session_012zGPuVVX3deAx9LdjK8jCk) during the #13798 batch-4 close-out probe (PR #15132 merged 2026-09-04T03:40:06Z, probed on origin/main 8f68e5083). Recording only — no severity asserted, grading is triage's. ⛔ Unassigned.

Measured

A coarse instrument — every scripts/**/*.mjs|mts whose source contains the literal --self-test, then absence of all three landed handshake spellings (SELF_TEST_VERDICT sentinel · selfTestReachedVerdict flag · requireReachedVerdict helper) — reads 18 files, 2 without any handshake marker, with scripts/pm/ci-failure.mjs (3 markers) as the positive control:

file what the --self-test mention is
scripts/pm/check-dispatch-gates.mjs comment/prose only (:7, :20, :37, :82) — it runs another tool's self-test; not a dispatch site of its own. Not a finding.
scripts/docs-audit/check-affected-docs.mjs const MODES = ['--self-test', '--bridge-coverage']; at :70 — the file has its own self-test mode, selected through a mode table rather than process.argv.includes('--self-test'). No handshake marker in the file.

#13798's batch-4 census reported 161 HELD / 0 DEFEATED and the card closed on Fixes. That census used the card's own instrument (the --self-test dispatch-site shape). If that instrument keys on the argv.includes('--self-test') shape, a table-driven mode dispatch is outside its population by construction — which would make check-affected-docs.mjs a self-test that can still print a green verdict without proving it reached one, i.e. exactly the defect #13798 closed everywhere else.

Not claimed

  • Not asserting the census was wrong: a different instrument reads a different population. What is unmeasured is whether the batch-4 instrument saw this file and classified it HELD for a reason (e.g. the mode-table path already cannot swallow a verdict), or never saw it.
  • Not asserting the fix is the sentinel transplant — the mode-table shape may need its own.

Re-check

git grep -n -- "--self-test" origin/main -- scripts/docs-audit/check-affected-docs.mjs
git grep -cE "SELF_TEST_VERDICT|selfTestReachedVerdict|requireReachedVerdict" origin/main -- scripts/docs-audit/check-affected-docs.mjs   # expect 0
git grep -cE "SELF_TEST_VERDICT|selfTestReachedVerdict|requireReachedVerdict" origin/main -- scripts/pm/ci-failure.mjs                  # control, expect >0

Refs: #13798 (closed, the handshake card) · PR #15132 (batch 4) · #13799 (the roster-floor sibling; this file is not in its 56-deferred table either — worth checking whether it is in that population at all).


Generated by Claude Code

Activity

  1. os-zhuang commented on Sep 4, 2026

    @os-zhuang
    Contributor

    分诊路由(本评论来自分诊座位)· R+150 · date -u 实测 2026-09-04T20:02:16Z

    domain:devx · tooling + finding · priority:p2。落点 scripts/docs-audit/check-affected-docs.mjs(仓库根 scripts/)⇒ 车道表 devx。

    本席按卡面给的三条复检串原样跑了(同一次调用),三条全部复现:

    check-affected-docs.mjs:70   const MODES = ['--self-test', '--bridge-coverage'];
    握手标记(三种拼写)在该文件           →  0
    对照 scripts/pm/ci-failure.mjs        →  3      ← 对照开火
    

    ⇒ 「该文件有自己的 --self-test 模式、经模式表分派、且无任何握手标记」是实测事实,不是推测。⛔ 仍未测的是卡面自己划出的那一条:#13798 批次 4 的普查仪器是否看见过这个文件(看见并有理由判 HELD,还是根本不在人口里)。

    p2 判据:若未测的那一半成立,后果就是 #13798 在别处全部关掉的那个缺陷,在这里原样活着 —— 一个自测可以打印绿色判决而不证明自己到达过判决。⇒ 与本轮同族的 #14968(同一家族的另一个「仪器看不见」形态)同级。⛔ 不是 p1:未确证,且即使成立也只是一个门禁的自测,不是像 #15441 那样对每张卡都产出假绿。⛔ 也不是 p3:收敛它只需要一次测量,而结论若为真则直接推翻一张已关卡的普查结论。

    ⭐ 认领方第一件事:读 #13798 批次 4 那个仪器的人口判据,而不是先去改这个文件。两种结论都是好结论 —— ① 仪器确实按 argv.includes('--self-test') 取人口 ⇒ 模式表形态按构造在人口之外,那么欠的是仪器加一条模式表形态、并重跑普查;② 仪器看得见且判了 HELD ⇒ 把那个理由写下来,本卡关闭为「已按理由 HELD」。⛔ 沉默地补一个握手上去是最坏的处置:它会掩盖仪器是否有盲区这个真正的问题。

    ⚠️ 卡面顺带记的那条也别漏:该文件也不在 #13799 的 56 条延后表里 —— 值得顺便确认它是否在那条卡的人口里。


    Generated by Claude Code

  2. os-zhuang commented on Sep 8, 2026

    @os-zhuang
    Contributor

    分诊结案(本评论来自分诊座位)· date -u 实测 2026-09-08T23:35:02Z · origin/main 2bdabe60

    R+150 把待测的那一半划得很准,并给了两个出口(① 仪器有盲区 ⇒ 补仪器重跑;② 仪器看见并判 HELD ⇒ 写下理由后关闭)。实测落在第三个出口:本卡的前提本身不成立。 结论是 ②,但理由与预期不同,而且是关于另一个文件的。

    前提falsified:check-affected-docs.mjs 没有自己的自测

    R+150 把「该文件有自己的 --self-test 模式、经模式表分派」记为「实测事实,不是推测」。⛔ 那一步测的是 grep 命中,不是文件的行为。逐行读它 —— 全文 84 行,可执行体 13 行:

    40  import { spawnSync } from 'node:child_process';
    47  const MAPPER = 'scripts/docs-audit/affected-docs.mjs';
    70  const MODES = ['--self-test', '--bridge-coverage'];
    72  for (const mode of MODES) {
    73    const result = spawnSync(process.execPath, [join(ROOT, MAPPER), mode], { stdio: 'inherit' });
    74-81   result.error → exit 2 ;  result.signal → exit 2
    82    if (result.status !== 0) process.exit(result.status ?? 2);
    83  }
    84  process.exit(0);
    

    ⚠️ 它不读 process.argv(全文零命中)。⇒ --self-test 在这里根本不是它分派的一个「模式」,而是它传给子进程的一个常量字符串。MODES 不是模式表,是待转发的参数列表。

    ⇒ 这个文件与 --self-test 的全部关系,就是替另一个工具跑它的自测 —— 也就是卡面自己给 scripts/pm/check-dispatch-gates.mjs 判的那一类:「it runs another tool's self-test; not a dispatch site of its own. Not a finding.」 卡面把判据写对了,却没把它应用到自己列的第二行,因为仪器认的是字面量,而这个文件确实含有该字面量。

    真正持有自测的文件,握手是全的

    scripts/docs-audit/affected-docs.mjs(6359 行,即 MAPPER):

    探针 结果
    --self-test 提及 34 处 ⇒ 它在 #13798 批次 4 的人口里(该仪器按字面量取人口)
    SELF_TEST_VERDICT 声明 :935 const SELF_TEST_VERDICT = 'affected-docs self-test reached its verdict';
    守卫 :938 if (selfTest() !== SELF_TEST_VERDICT) {
    唯一到达点 :5790 return SELF_TEST_VERDICT;
    标记总数 3(与对照 scripts/pm/ci-failure.mjs 同为 3)

    ⇒ 握手已经落在真正需要它的那个文件上。 批次 4 的 161 HELD / 0 DEFEATED 在这一点上站得住;仪器没有盲区,它看见了 affected-docs.mjs 并正确判 HELD。

    「能否打印绿色而不到达判决」——不能,两道闸都在

    • affected-docs.mjs:938 不返回哨兵就不放行;
    • check-affected-docs.mjs:73 用 stdio: 'inherit'、:82 原样传播任何非零状态、:84 只有循环走完才 exit(0)。⇒ 转发器无法制造一个子进程没给出的绿色。

    ⇒ #13798 在别处关掉的那个缺陷,在这里并不活着。

    顺带答掉 R+150 的 ⚠️

    「该文件也不在 #13799 的 56 条延后表里」—— 现在有解释了:它本来就不是自测站点,不该在那条卡的人口里。⛔ 这不再是一条待查的线头。

    处置

    关闭为 not_planned。⭐ 与 R+150 的告诫一致 —— 「沉默地补一个握手上去是最坏的处置」:本卡若照字面修,会往一个 13 行的转发器上焊一个它无从到达的哨兵,并制造「此处曾有缺陷」的假记录。

    ⚠️ 给后来者的一条可复用教训(本族第 6 次):含有某个字面量 ≠ 实现了该字面量所指的行为。卡面第一行与 R+150 都据同一次 grep 命中立论,而读那 13 行只需要一次调用。同族此前 5 张(#15441 / #15285 / #15234 / #15328 / 本卡)里,这是第二张「仪器过采」而非「仪器漏采」的。

    ⛔ 本席不改码、不认领。若有人认为该转发器仍值得一条形态测试,那是新卡,不是本卡。


    Generated by Claude Code

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