refactor(docs): point entry-file references at their new homes

AGENTS.md stopped being the store of record for build steps, Python env,
hardware pins, doc conventions, log cost and task ownership. Those facts
already live in docs, skills and role files; the entry file now only
points at them. This commit moves every reference that used to name the
entry file to the authoritative landing point, so a reader who follows a
link arrives at the fact instead of at a sentence that no longer exists.

What changed is links and prose, not behaviour. Code, scripts and tests
only have comment and docstring lines touched; the only non-comment edit
in the whole changeset is one note string inside the generated pin table
JSON, and its generator was changed in the same step so the two stay
byte-identical.

New landing points created before the references were retargeted:
- The console single-writer log design doc, section 7.1, is now the single
  authority for log cost: about 90 B flash and 216 B stack per DBG_ line,
  and the rule that deep call chains must predefine DBG_LINE_BUF_MAX.
  It also carries the full list of the twelve translation units that have
  tightened it, plus the grep command that decides the truth if the list
  and the code ever disagree.
- The document writing standard, section 2, now holds the BOM list.
- keil-build skill gains an exit code table: 0 success, 1 build failure,
  2 BuildEnvError, 3 usage, 4 build lock held. This corrects a belief
  that was never actually written down anywhere: exit 2 does not simply
  mean environment error, argparse also exits 2 and the wrapper script
  was remapped so the two no longer collide.

Regenerated and checked byte for byte:
- The end-to-end architecture SVG in docs/images from its generator.
- tools/netlist_semantics/pinout_kb.json from gen_kb.py.
Both are idempotent; running the generators again produces no diff.

Deliberately not touched, because machines read them:
- scripts/check_bom_drift.py joins every line containing BOM and asserts
  four paths are present, so the entry file BOM line must stay one line.
- scripts/gen_task_table.py reads the TASK_TABLE anchors directly.
- scripts/rename_maps and scripts/archive keep their historical wording;
  they describe what happened, not what is true now.

Verified: doc links report the same six pre-existing findings as the base
commit and no new ones, generated-fresh passes, bom drift is clean across
101 files, and AGENTS.md itself is unchanged in this commit.
This commit is contained in:
2026-11-16 19:38:27 +08:00
parent ab20302999
commit e4981aa2f6
134 changed files with 276 additions and 212 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ GRID_LINE = "#cbd5e1"
TITLE = "STM32F407ZGTx 工业 DTU 平台 · 端到端链路总览"
SUBTITLE = ("一个电气量从引脚到 104 报文 / 显存 / 记录文件穿过的框,与「谁在什么时候被谁唤醒」;"
"分层归属与层内模块清单见 项目架构总览.svg,本图只画链路与握手")
FOOTNOTE = ("口径:AGENTS.md「数据主线」+ docs/架构设计/项目架构总览.md(行号级证据在那份文档与代码里)。"
FOOTNOTE = ("口径:docs/架构设计/项目架构总览.md §1「全景分层架构」(含 §1.3 端到端链路鸟瞰;行号级证据在那份文档与代码里)。"
"RS-485 采集未接线:rs485_task 有实现但不建任务,接线后数据进语义取数层;"
"其余行为条件(未标定闭锁 / 就绪位 NoClear / CH395F 单连接 / V0.1 双转换器无共同采样触发)见正文,"
"它们只改变判据与端口、不改变本图的框与连线。")
+1 -1
View File
@@ -19,7 +19,7 @@
## ⚠️ 注意
- 生成产物**勿手改**(会被下次生成覆盖);要改菜单结构改**定义源**后重跑
- 中文字符串字面量须为**纯 ASCII 安全**(见 `AGENTS.md` 编码铁律)——生成后的文案
- 中文字符串字面量须为**纯 ASCII 安全**(见 `docs/文档规范.md` §2 编码铁律)——生成后的文案
如需汉字,须配套重跑字体生成(`tools/font_gen/`)
## 相关文档
+1 -1
View File
@@ -605,7 +605,7 @@ def sync_registration(filenames):
"""把 UI 目录下的 .c 文件名补进 uvprojx 与 CMakeLists 的显式列表,返回实际插入项。
只做定点插入、不重排不改写其余内容:uvprojx 由 UV4 维护,任何无关改动都会污染
diff(AGENTS 铁律"UV4 抖动不入库");已存在则不动(幂等,重复跑不产生 diff)。
diff("UV4 抖动不入库"铁律);已存在则不动(幂等,重复跑不产生 diff)。
"""
inserted = []
+2 -2
View File
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""gen_kb.py - 生成 pinout_kb.json(V0.0 网表知识库)。
运行: & '.venv\\Scripts\\python.exe' tools/netlist_semantics/gen_kb.py
数据来源:V0.0.tel 实测 + docs/芯片手册 + AGENTS.md 硬件引脚表。
数据来源:V0.0.tel 实测 + docs/芯片手册 + docs/架构设计/硬件规格与能力边界.md §2 引脚表。
"""
import json
import os
@@ -232,7 +232,7 @@ KB = {
"SWCLK": {"func": "SWD 时钟", "note": "U17→H2"},
"SWDIO": {"func": "SWD 数据", "note": "U17↔H2"},
"NRST": {"func": "复位", "note": "U17/U1,经 R40/SW1"},
"LED1": {"func": "板级 LED1", "gpio": "PC4", "note": "低有效;顺序按 AGENTS.md 待核"},
"LED1": {"func": "板级 LED1", "gpio": "PC4", "note": "低有效;顺序待核(见 docs/硬件平台/V0.0_网表详细分析报告.md)"},
"LED2": {"func": "板级 LED2", "gpio": "PC5", "note": "低有效"},
"LED3": {"func": "板级 LED3", "gpio": "PB1", "note": "低有效"},
"LED4": {"func": "板级 LED4", "gpio": "PB2", "note": "低有效"},
+1 -1
View File
@@ -863,7 +863,7 @@
"LED1": {
"func": "板级 LED1",
"gpio": "PC4",
"note": "低有效;顺序按 AGENTS.md 待核"
"note": "低有效;顺序待核(见 docs/硬件平台/V0.0_网表详细分析报告.md)"
},
"LED2": {
"func": "板级 LED2",