Files
STM32F4-Base/tools
wandering1 12e0617909 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.
2026-11-16 23:59:49 +08:00
..

tools/ — 开发工具

面向开发者的功能性工具(生成器 / 转换器 / 交互工具)。 与 scripts/(质量门禁与度量)分工不同:本目录产出资产(图、字体、代码、知识库)。

工具一览

目录 工具 产物 文档
arch_diagram/ 架构图 SVG 生成器 docs/images/*.svg docs/架构设计/图形绘制流程.md
font_gen/ 中文字库生成 Drivers/BSP/UI/ui_font_cn_12.c docs/UI设计/UI_中文字体生成与配置.md
menu_gen/ 菜单树代码生成 UI 菜单代码 docs/UI设计/菜单页面设计.md
netlist_semantics/ 网表语义分析 引脚知识库 JSON + 网表报告 docs/硬件平台/
refgraph/ 文件引用关系图 docs/images/引用关系图.* docs/架构设计/引用关系图说明.md

使用方式

# 架构图(精确布局)
& '.venv\Scripts\python.exe' tools/arch_diagram/gen_memory_svg.py

# 中文字体(含新汉字文案后必须重跑)
& '.venv\Scripts\python.exe' tools/font_gen/make_font.py

# 引用关系图
& 'tools\refgraph\gen_refgraph.bat'

# 串口助手(常驻 daemon)
& '.venv\Scripts\python.exe' .dsh/skills/serial-assistant/scripts/serial_tool.py

⚠️ 约定

  • 生成器的产物与脚本一并提交(如 SVG);本地预览产物(如 PNG)不提交
  • 图表选型:精确布局图用 arch_diagram/ 生成器;拓扑图(流程/时序/状态机)用 Mermaid; 勿手绘 ASCII 框图(见 docs/架构设计/图形绘制流程.md)
  • 涉及 UI 改动:走 ui-verify skill 五步门禁;涉及字体:走 font-regen skill

相关文档

  • docs/架构设计/图形绘制流程.md — 配图规范与选型
  • docs/架构设计/引用关系图说明.md
  • docs/测试说明/测试工具/串口助手使用指南.md、docs/测试说明/测试工具/串口助手设计说明.md