fix(gates): close the BOM gate hole that let new files skip the check

The BOM gate claimed to stop BOMs from being stripped, but it only ever
inspected files that were already tracked AND already had a BOM. A new
file under a BOM-listed directory could be born without one and never
be noticed, because the scan never returned it and, even if it had, the
"no HEAD version" branch skipped it. Editing a listed file and losing
its BOM is a real accident that already happened once; creating one
without a BOM was the same accident with no safety net at all.

Measured before and after on the same untracked file with no BOM:

  before: checked 101 files, no drift, exit 0
  after:  FAIL, names the file, exit 1

The count of 101 was itself the symptom: with one more file present the
honest number is 102. The old code was not "silently passing a clean
tree", it was not looking.

The scan now includes untracked files, and a listed file with no HEAD
version must carry a BOM. Files that are tracked without a BOM keep
their historical pass so this does not flood existing code with
failures; instead the two that were listed but had no BOM were given one
so the list means what it says.

That exposed a conflict nobody had hit yet. The font file is generated,
and the generator rewrites it from scratch on every run, so a hand-added
BOM survived until the next regeneration and then vanished. The BOM gate
and the generated-fresh gate could not both pass. The generator now puts
the BOM back as its last step, idempotently, so the two gates agree and
the whole UI directory keeps its uniform encoding. Font content is
untouched: everything after the first three bytes is byte-identical.

The menu generator gains a real read-only mode. It previously had no
options at all and always rewrote its outputs; the arrows it printed
were accurate. That made it easy to mistake for a checker, since an
unchanged tree produces identical bytes and looks untouched. --check now
reports up to date or stale without writing anything, and the
registration tables are checked the same way. Default behaviour and
output are unchanged.

The telemetry page header no longer restates the board's input hardware
facts. They live in the IOBOARD README, which is where the board's
electrical behaviour belongs; the page keeps only what it alone can say:
that the output rows show the shadow register rather than contact
feedback, why an invalid sample draws -- instead of 分, and that these
twelve rows are not in the point table. One fact, one place.

The team rule for experiments now requires the file hash, the located
line number, and both runs. A report once cited a line number that did
not exist in the final file, which left no way to confirm which version
had actually been tested.
This commit is contained in:
2026-11-16 23:59:49 +08:00
parent 515db819ab
commit 12e0617909
14 changed files with 283 additions and 60 deletions
+10
View File
@@ -97,6 +97,16 @@ onToolCallBudget: wrap-up
- **采集必须留原文**。转述"构建成功"无法被复跑推翻,也无法被复跑证实。
- **判定标准必须来自发起方**。执行人可以报告"第 N 行是 X",不能报告"所以通过了"——除非发起方事先把这条写进判据。
**采集层对"实验类证据"的追加要求(变异测试与对照组)**:凡是靠**故意改一个变量**来证明某个东西的证言(变异测试、反向断言自证、对照组/实验组),报告必须同时给出三项,缺一项即按「证据链不完整」处理,不按"已证明"处理:
1. **被测文件的 md5**(证明你测的是哪个版本)
2. **`grep -n` 从最终文件里定位到的那一行**(证明你报告的行号就是最终文件的,不是中间态的)
3. **对照组与实验组的两次输出**(证明两组只差一个变量,而不是各跑了不同版本)
为什么单独提这条:真实失效过一次。执行人报"变异后 120/121,红的行号是 257",验收人独立重跑得到的是行号 322——差 65 行,正好约等于它新增的代码量,说明它引用的是改编号之前的中间态输出。结论没错(失败文案唯一标识了断言),但**那份证据链无法证明它测的是最终文件**,验收人只能靠失败文案去猜。这不是判断题,是采集题:行号对不上,就没人能确认你测的是哪一版。
同一条对 Lead 自己同样适用——Lead 亲自做的实验,也要按这三项交证据,不许因为"我是发起方"就免检。
台架类角色(`bench-runner`)把这条写成了身份约束:它的工具列表里没有 `edit`/`write`,也没有 gate 的 submit/accept 权限,**既不改代码也不给结论**。这是刻意的双锁。
## 五、验收人 ≠ 执行人