Browse Source

Merge branch 'closure/integrate-3axis' into dev

Integrate A–E 3-axis closure lanes, tip TD bitstream, matrix, and three-volume packages.
Prod2U Integrator 3 months ago
parent
commit
503fa89a38
85 changed files with 3484 additions and 617 deletions
  1. 21 33
      ACCEPTANCE_MATRIX.md
  2. 1 1
      AGENTS.md
  3. 29 24
      FINAL_DELIVERY_REPORT.md
  4. 13 14
      OPEN_QUESTIONS.md
  5. 14 11
      PLAN.md
  6. 30 19
      README.zh-CN.md
  7. 1 0
      config/board_viewer_annotations.fcb_fpga_mcu0611.json
  8. 21 0
      config/board_viewer_annotations.fcb_fpga_mcu_v1_2.json
  9. 11 5
      config/pin_inventory.fcb_fpga_mcu0611.json
  10. 280 68
      config/pin_inventory.prod2u_door_temp_v1_2.json
  11. 33 12
      docs/BRD_ANALYSIS_FOR_AGENTS.zh-CN.md
  12. 55 52
      docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md
  13. 41 29
      docs/IO_EVIDENCE_MATRIX.zh-CN.md
  14. 116 29
      docs/REFERENCE-INVENTORY.json
  15. 24 12
      docs/REFERENCE-INVENTORY.md
  16. 43 58
      docs/TD_USAGE.zh-CN.md
  17. 54 0
      docs/historical/ACCEPTANCE_MATRIX-2axis-solenoid-closure-da7b05a.md
  18. 49 0
      docs/historical/FINAL_DELIVERY_REPORT-2axis-solenoid-closure-da7b05a.md
  19. 95 0
      docs/historical/HARDWARE_TEST_ORDER_WAVEFORMS-2axis-solenoid-pre-3axis.zh-CN.md
  20. 25 0
      docs/historical/OPEN_QUESTIONS-2axis-solenoid-closure-da7b05a.md
  21. 21 0
      docs/historical/PLAN-2axis-solenoid-closure-da7b05a.md
  22. 62 0
      docs/historical/README-2axis-solenoid-closure-da7b05a.zh-CN.md
  23. 13 6
      docs/historical/README.md
  24. 4 3
      docs/prod2u-door-temp-protocol.zh-CN.md
  25. 74 1
      package_for_agent_analysis.py
  26. 1 1
      projects/prod2u-door-temp/project.json
  27. 1 1
      projects/prod2u-door-temp/requirements.zh-CN.md
  28. 17 0
      receipts/board-data-con12-rebuild-integrate.json
  29. 36 0
      receipts/prod2u_lane_c_formal_20260806T022109Z.json
  30. 21 0
      receipts/prod2u_lane_c_icarus_20260806T022109Z.json
  31. 56 0
      schemas/board_viewer_annotations.schema.json
  32. 23 0
      schemas/board_viewer_data.schema.json
  33. 5 1
      schemas/project.schema.json
  34. 1 1
      src/generated/host-contract.json
  35. 2 1
      src/modules/door_action_dispatcher.v
  36. 1 4
      src/modules/startup_close_seek.v
  37. 8 8
      src/project/command_controller.v
  38. 2 2
      src/project/project_adapter.v
  39. 1 1
      src/top/prod2u_p4_normal_v3_top.v
  40. 3 3
      tests/board_viewer/fixtures/candidate_count_expectation.json
  41. 13 12
      tests/fixtures/package_adversarial/manifest.json
  42. 0 1
      tests/fixtures/package_adversarial/payloads/Anlogic.lic
  43. 0 1
      tests/fixtures/package_adversarial/payloads/dotenv.env
  44. 0 3
      tests/fixtures/package_adversarial/payloads/id_ed25519
  45. 0 1
      tests/fixtures/package_adversarial/payloads/sneaky-main.brd
  46. 0 1
      tests/fixtures/package_adversarial/payloads/sneaky-schematic.pdf
  47. 0 1
      tests/fixtures/package_adversarial/payloads/sneaky.dsn
  48. 0 1
      tests/fixtures/package_adversarial/payloads/td_release_2026.1_fake.zip
  49. BIN
      tests/fixtures/package_adversarial/payloads/traversal-member.zip
  50. 0 1
      tests/fixtures/package_adversarial/payloads/unicode-cafe-nfc.txt
  51. 0 1
      tests/fixtures/package_adversarial/payloads/unicode-cafe-nfd.txt
  52. 0 1
      tests/fixtures/package_adversarial/payloads/vendor-license.zip
  53. 7 2
      tests/formal/README.md
  54. 2 0
      tests/formal/runtime_limit_hard_stop.sby
  55. 152 3
      tests/formal/runtime_limit_hard_stop_formal.v
  56. 3 1
      tests/formal/startup_close_seek.sby
  57. 135 25
      tests/formal/startup_close_seek_formal.v
  58. 22 6
      tests/sim/door_motor_engine_stop_tb.v
  59. 74 11
      tests/sim/prod2u_p4_normal_v3_top_runtime_limit_tb.v
  60. 1 0
      tests/sim/prod2u_p4_normal_v3_top_startup_tb.v
  61. 1 1
      tests/sim/startup_close_seek_tb.v
  62. 1 1
      tests/sim/startup_motor_stop_tb.v
  63. 56 30
      tests/test_project_structure.py
  64. 43 7
      tests/unit/package_review_compact_contract.py
  65. 126 60
      tests/unit/test_activity_docs_truth.py
  66. 180 0
      tests/unit/test_compact_package_selftest.py
  67. 23 13
      tests/unit/test_package_adversarial_compact.py
  68. 4 1
      tests/unit/test_startup_close_seek.py
  69. 1 2
      tests/unit/test_startup_mutation.py
  70. 94 0
      tests/unit/test_td_source_closure_binding.py
  71. 88 0
      tests/unit/test_test_profiles.py
  72. 16 0
      tests/unit/test_three_axis_door_contract.py
  73. 5 1
      tests/verilator_waivers.vlt
  74. 4 2
      tools/board-viewer/README.zh-CN.md
  75. 7 0
      tools/board-viewer/board_viewer/data.py
  76. 188 10
      tools/board-viewer/refresh_reference_inventory.py
  77. 16 0
      tools/compact-package-selftest.sh
  78. 333 0
      tools/compact_package_selftest.py
  79. 4 1
      tools/generate_project.py
  80. 1 0
      tools/package-review-compact.sh
  81. 266 8
      tools/package_agent_handoff.py
  82. 5 6
      tools/replay_review_compact.py
  83. 119 0
      tools/run-test-profile.sh
  84. 176 0
      tools/test_profiles.py
  85. 10 2
      tools/validate-board-viewer-detached.sh

+ 21 - 33
ACCEPTANCE_MATRIX.md

@@ -1,37 +1,37 @@
-# Acceptance Matrix(活动真相)
+# Acceptance Matrix(活动真相 · 三轴)
 
-> Windows 2026-07-26 全绿矩阵叙述已归档:[`docs/historical/ACCEPTANCE_MATRIX-windows-20260726.md`](docs/historical/ACCEPTANCE_MATRIX-windows-20260726.md)。  
-> 下表为 **当前可声明** 状态;`pass` 仅当有绑定到所述 commit 的收据。
+> 二轴+电磁铁 closure 矩阵已归档:[`docs/historical/ACCEPTANCE_MATRIX-2axis-solenoid-closure-da7b05a.md`](docs/historical/ACCEPTANCE_MATRIX-2axis-solenoid-closure-da7b05a.md)。  
+> Windows 2026-07-26 叙述:[`docs/historical/ACCEPTANCE_MATRIX-windows-20260726.md`](docs/historical/ACCEPTANCE_MATRIX-windows-20260726.md)。  
+> 下表为 **当前可声明** 状态;`pass` 仅当有绑定到最终 tip 的收据。最终 tip TD / bitstream:**已绑定** `54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c` @ `0de9f93988344e3c11931482902196b02ac7a713`。
 
 ## Frozen contract gates
 
 | Area | Contract evidence | Status |
 |---|---|---:|
-| Project configuration | `project.json`:4 FAN + 4 chamber PTC→8 PWM + intake/exhaust doors;UART/I2C/motor/watchdog/limits.startup | pass(源合同) |
-| Schema | 配置节闭合;count/list 漂移拒绝 | pass(源合同) |
-| Protocol model | CRC;duty 0..100;**SET_ALL 11 字节**;旧 14 字节拒绝;马达 `00=stop` / 电磁铁 `00=hold` | pass(源合同) |
-| Generator / ADC | 确定性产物;活动 ADC **25** 脚(含 `intake_solenoid_out`@P2);CON138–141 产品重映射 | pass(源合同) / solenoid **inferred** LOC |
-
-| Startup one-shot | 450 步/burst、1000 step/s、50 ms、最多 10 burst;`startup_done` 后 limit 惰性 | pass(源合同 + 既有 Icarus/formal 目标) |
+| Project configuration | `project.json`:4 FAN + 4 chamber PTC→8 PWM + Z/X/Y doors;UART/I2C/motor/watchdog/六限位 | pass(源合同) |
+| Schema | 配置节闭合;`stop_semantics` enum = truncate | pass(源合同) |
+| Protocol model | CRC;duty 0..100;**SET_ALL 11 字节**;旧 14 字节拒绝;三轴 `00=stop`;无电磁铁 | pass(源合同) |
+| Motors / EN | 450 step jog @ 1000;X/Y/Z 可重叠;EN `permanent_high` @ CON120.2/C11 | pass(源合同) |
+| Limits / hard truncate | 六限位;`runtime_use=true`;`truncate_current_high_pulse_immediately_after_synchronized_limit` | pass(源合同) |
+| Startup one-shot | 5000 close / 500 backoff @ 1000;`startup_done` 后运行期仍硬截断(非惰性) | pass(源合同) |
+| Active IO mapping | X/Y/Z @ CON104/105/106;limits @ CON12 + CON129;**禁止** solenoid / CON68 / CON34 / CON138–141 作活动 IO | pass(源合同) |
 
 ## Offline verification(收据绑定)
 
 | Area | Bound evidence | Status |
 |---|---|---:|
-| Python / contract | final matrix @ `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2` | pass |
-| Formal | final matrix @ `da7b05a…`(BMC vs prove 以各收据为准) | pass |
-| cocotb UART e2e | final matrix @ `da7b05a…` | **pass** |
-| Full matrix @ FINAL_COMMIT | `verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`(RUN_ID `grok45-final-20260805T013238Z`) | **pass**(含 cocotb) |
-| TD + bitstream | Linux `td2026` built @ **`8f28660f176e18e97a015e66bdae0ff747e0fc63`**;bit SHA-256 `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d`;绑定 FINAL_COMMIT(综合输入一致,tip 未强制重跑) | pass |
-| Package / replay | final closure 包已出具;`review-compact` @ tip `445814a…`(RUN_ID `packager-compact-20260805T042343Z`) | pass(closure + compact) |
+| Python / contract | tip `0de9f93…` / 后续 SOURCE-CLOSURE-UNCHANGED tip | pass |
+| Formal / Icarus / cocotb / Verilator | `closure-matrix-final-20260806T023046Z-807dc3` @ `19d588bc…`(SOURCE-CLOSURE-UNCHANGED vs `0de9f93…`) | pass |
+| Full matrix @ FINAL_COMMIT | 软件矩阵 `closure-matrix-final-20260806T023046Z-807dc3` + TD `closure-td-20260806T022723Z-63cb51` | pass(硬件除外) |
+| TD + bitstream | Linux `td2026` Release_2026.1_SP2 Build `6.2.2.200067` @ **`0de9f93988344e3c11931482902196b02ac7a713`**;bit SHA-256 `54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c` | pass |
+| 历史旁路 bit(非 tip) | `45f548ab…` built @ `bb515af` | historical only — **不是** current |
+| Package / replay | firmware + compact + reference 三卷绑定最终 tip | 打包阶段 |
 | Physical hardware | COM/JTAG/烧录未授权 | **`not_run`** |
 
-## Physical / board remaining uncertainties(不升格为 confirmed pass)
+## Physical / board notes
 
-- Intake solenoid:CON141.1/P2 **inferred** LOC;外部驱动/线圈极性未确认。
-- Exhaust X/Y STEP/DIR/EN 在 CON138–139 为 EX_GPIO 产品角色 **inferred**;X 限位 **CON68.3/M6**,Y 限位 **CON34.3/F9**。
-- 历史 A11 与 CON124 装配冲突记录保留;产品 y_limit 已迁至 CON34.3/F9。
-- 详见 [`docs/IO_EVIDENCE_MATRIX.zh-CN.md`](docs/IO_EVIDENCE_MATRIX.zh-CN.md)。
+- 物理路径权威:V1.2 BRD(board-viewer);活动探点见 [`docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md`](docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md)(CON104/105/106/120/12/129)。
+- 旧二轴探点 CON68/CON34/CON138–141 与电磁铁叙事已迁 historical,**不是**活动 IO。
 
 ## Frozen protocol numbers
 
@@ -39,16 +39,4 @@
 - Types:`0x01` / `0x02` / `0x82`。
 - SET_ALL:**11** 字节;Temperature:**27** 值 / 33 字节响应帧。
 - PWM:~19.993602047 Hz;boot PTC=0/FAN=10;watchdog 10 s → PTC=0/FAN=20。
-- Ordinary motor:450 steps @ 1000 step/s;X/Y 可重叠。
-
-## 3-axis closure (`3axis-20260805T171312Z`)
-
-| Lane | Status | Notes |
-|------|--------|-------|
-| python / board_viewer | pass | CON12 remap + detached validate |
-| icarus / verilator / cocotb | pass | 3-axis startup + runtime hard-stop |
-| formal | pass | BMC hard-stop/startup/dispatcher; prove motor-temp contract |
-| td2026 | pass | tip `bb515af…`; bitstream `45f548ab…` |
-| reference ZIP | pass | Linux; Windows handoff blocked |
-| Hardware validation | NOT RUN | COM/JTAG not authorized |
-
+- Ordinary motor:**450** steps @ 1000 step/s;startup close **5000** / backoff **500**;X/Y/Z 可重叠。

+ 1 - 1
AGENTS.md

@@ -58,7 +58,7 @@ Current authority is limited to the above contract files, this `AGENTS.md`, and
   - Y: LS CON12.3 C8, HS CON12.4 A8
   - Z: LS CON129.1 K16, HS CON129.2 J15
 - Motors: X STEP/DIR CON104.2/3 C12/B12; Y CON105.2/3 L12/J11; Z CON106.2/3 L14/K14.
-- Runtime: direction-select limit hard-stop each clock; finish current high half-cycle then no next rising edge; busy ignores new start.
+- Runtime: direction-select limit hard-stop each clock; truncate current STEP high pulse immediately after synchronized limit (`truncate_current_high_pulse_immediately_after_synchronized_limit`); busy ignores new start.
 - Startup (once per power-on/reset/reconfig): PTC 0%, FAN 10%, all axes DIR=1 close; up to 5000 steps @ 1000 steps/s per axis; if limit not hit, 500-step backoff and mark missed; X/Y/Z may move concurrently and stop independently.
 - `startup_done` is sticky until next FPGA power-on, global hardware reset, or reconfiguration.
 - After `startup_done`: startup motor controls idle; ordinary host jog and runtime limit policy apply; limit FSM does not restart.

+ 29 - 24
FINAL_DELIVERY_REPORT.md

@@ -1,49 +1,54 @@
 # Prod2U 门控温度 CPLD — 活动交付状态报告
 
-> 本文件描述 **当前活动真相**(Linux / 11 字节 SET_ALL)。  
-> 2026-07-26 Windows 清理轮次的最终包叙述已归档:[`docs/historical/FINAL_DELIVERY_REPORT-windows-20260726.md`](docs/historical/FINAL_DELIVERY_REPORT-windows-20260726.md)。
+> 本文件描述 **当前活动真相**(Linux / 11 字节 SET_ALL / **三轴 X/Y/Z**)。  
+> 二轴+电磁铁时代 closure 叙述已归档:[`docs/historical/FINAL_DELIVERY_REPORT-2axis-solenoid-closure-da7b05a.md`](docs/historical/FINAL_DELIVERY_REPORT-2axis-solenoid-closure-da7b05a.md)。  
+> Windows 清理轮次:[`docs/historical/FINAL_DELIVERY_REPORT-windows-20260726.md`](docs/historical/FINAL_DELIVERY_REPORT-windows-20260726.md)。
 
 ## 执行摘要
 
-- 产品合同已收敛为 **11 字节 SET_ALL**、进风默认电磁铁、出风 X/Y 步进;旧 14 字节格式拒绝。
-- 权威工具链为 **Linux**(`td2026` + OSS CAD / Python 验证)。Windows 收据与路径不是活动权威。
-- Final software closure tip:`da7b05a340a096ccfb4ccf4f656eb3efe6a957e2`(RUN_ID `grok45-final-20260805T013238Z`)。全矩阵(含 cocotb)**pass**;Hardware **`NOT RUN`**。
-- Packager integrate tip `445814a…`(RUN_ID `packager-compact-20260805T042343Z`)已合入 `dev`:仅打包/文档/测试工具链;不改写本报告中的产品 final commit / 矩阵 / TD / bitstream 真相。
+- 产品合同:**11 字节 SET_ALL**、三轴步进门 X/Y/Z、六限位、普通 jog **450** / startup **5000** / backoff **500**、EN `permanent_high`、限位硬截断 `truncate_current_high_pulse_immediately_after_synchronized_limit`。
+- **无** 电磁铁进风门;活动 IO **不是** CON68 / CON34 / CON138–141。
+- 权威工具链为 **Linux**(`td2026` + OSS CAD / Python 验证)。
+- 最终 tip TD / bitstream:**已绑定**(见下表)。历史旁路 bit `45f548ab…` @ `bb515af` **不是** tip。
+- Hardware **`NOT RUN`**。
 
 ## 关键标识(活动)
 
 | 项目 | 值 |
 |---|---|
-| FINAL_COMMIT | `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2` |
-| 闭合 RUN_ID | `grok45-final-20260805T013238Z` |
-| SET_ALL payload | **11 字节** |
-| Full matrix(含 cocotb) | **pass**(`verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`) |
-| TD built commit | `8f28660f176e18e97a015e66bdae0ff747e0fc63` |
-| Bitstream SHA-256 | `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d` |
-| TD tip 重跑 | **否**(综合输入与 tip 一致;绑定既有位流) |
+| 合同对齐基线 tip | `cdf9f76b22d75f1c2bc1e7ff99a49d2897a8dcb7`(Lane 合并起点) |
+| ARTIFACT-SOURCE-COMMIT(TD / 位流源闭包) | `0de9f93988344e3c11931482902196b02ac7a713` |
+| FINAL-DEV-COMMIT(文档 tip) | `98fdf610e2ebde6b4e0c3ee86ba4fde0afd4f073` |
+| FINAL_COMMIT / ARTIFACT-SOURCE-COMMIT(位流源闭包) | `0de9f93988344e3c11931482902196b02ac7a713`(SOURCE-CLOSURE-UNCHANGED through docs tip) |
+| SET_ALL payload | **11 字节**(Z/X/Y) |
+| stop_semantics | `truncate_current_high_pulse_immediately_after_synchronized_limit` |
+| Full matrix | TD RUN_ID `closure-td-20260806T022723Z-63cb51`;软件矩阵 `closure-matrix-final-20260806T023046Z-807dc3` @ `19d588bc783c1df61e8750653fdd0b0c3eee43bf`(SOURCE-CLOSURE-UNCHANGED vs 位流 tip) |
+| TD built commit | `0de9f93988344e3c11931482902196b02ac7a713` |
+| Bitstream SHA-256 | `54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c` |
+| td2026 | Release_2026.1_SP2 / Build `6.2.2.200067` |
+| TD RUN_ID / path | `closure-td-20260806T022723Z-63cb51` → `$XDG_STATE_HOME/prod2u/runs/closure-td-20260806T022723Z-63cb51` |
+| 历史 firmware bit(非 tip) | `45f548ab…` @ `bb515af` |
 | Hardware validation | **`NOT RUN`** |
 
-## 风门语义摘要
+## 风门与限位摘要
 
-- **马达(exhaust X/Y)`00` = stop**(无新 STEP jog)。
-- **电磁铁(intake)`00` = hold**(保持当前 latch;非“停止脉冲”语义)。
-- `01` = open;`02` = close。细节见协议文档。
+- 三轴门字节 `00` = stop(无新 jog);`01` open;`02` close。
+- 六限位运行期与 startup 均硬截断;runtime limits are **not** inert。
+- EN:FPGA 恒 1(`permanent_high`)。
 
 ## 合法 blocked / not_run
 
-- `intake_solenoid_out`:CON141.1/P2 **inferred** LOC;外部驱动/线圈极性未确认。
-- X/Y STEP/DIR/EN:CON138–139 EX_GPIO 产品角色 **inferred**;X 限位 CON68.3/M6,Y 限位 CON34.3/F9。
-- 历史 A11 vs CON124 装配冲突记录保留;产品 y_limit 已迁至 CON34.3/F9。
 - COM / JTAG / 烧录未授权 → Hardware **`not_run`**。
 
 ## 明确作废的活动声明
 
 以下内容**不得**再当作 tip / 活动 pass:
 
-- Windows 路径下的 “全矩阵 pass + cocotb pass”(`d99f354` / `4ddfbec` 时代叙述)。
-- SET_ALL **14 字节** 为当前合同。
-- 将过期 tip `f82c41e`、失败矩阵 `6f32493`、历史 TD `ead5a3e` / bitstream `a7b5c119…` 当作当前 final closure 证据。
+- 禁止当作 tip:二轴+电磁铁 final closure(`da7b05a` / TD `8f28660` / 旧位流 `ce3157c5…`)。
+- 禁止将 `45f548ab…` 当作 tip 位流(其构建 commit 为 `bb515af`)。
+- 禁止复活:SET_ALL **14 字节**、电磁铁 intake、`00=hold`、limit-inert 政策、CON68/CON34/CON138–141 作活动 IO。
+- 禁止当作 pass:Windows 路径下的虚假全矩阵(`d99f354` / `4ddfbec`)。
 
 ## 结论
 
-软件闭环已完成:FINAL_COMMIT `da7b05a…`,矩阵(含 cocotb)**pass**,TD 位流 `ce3157c5…` 已绑定。物理硬件为 **`NOT RUN`**;物理 blockers 仍开放。
+三轴源码、合同截断语义、独占 TD 位流与离线矩阵已对齐为活动真相。物理硬件为 **`NOT RUN`**。

+ 13 - 14
OPEN_QUESTIONS.md

@@ -1,25 +1,24 @@
 # Open Questions and Accepted Uncertainty
 
-No user product-contract decision currently blocks the **11-byte SET_ALL + solenoid intake** software path.
+No user product-contract decision currently blocks the **11-byte SET_ALL + three-axis X/Y/Z** software path.
 
 ## Accepted uncertainty / explicit status
 
-- **Hardware validation: `NOT RUN`** — COM/JTAG/programming not authorized; board response and real fan load behavior unverified.
-- **FINAL_COMMIT**: `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2` (closure RUN_ID `grok45-final-20260805T013238Z`).
-- **Verification matrix**: full matrix **pass** including cocotb (`verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`).
-- **TD**: built commit `8f28660f176e18e97a015e66bdae0ff747e0fc63`; bitstream SHA-256 `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d` bound to FINAL_COMMIT (identical synthesis inputs; tip rebuild not required).
+- **Hardware validation: `NOT RUN`** — COM/JTAG/programming not authorized.
+- **FINAL_COMMIT / tip TD / bitstream SHA-256**: bound — ARTIFACT-SOURCE-COMMIT `0de9f93988344e3c11931482902196b02ac7a713`; Bitstream SHA-256 `54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c`; td2026 Release_2026.1_SP2 Build `6.2.2.200067`; RUN_ID `closure-td-20260806T022723Z-63cb51`.
+- Prior bypass firmware bitstream `45f548ab…` was built at `bb515af`, **not** tip — not active closure evidence.
+- Contract/source baseline for lanes merge start: `cdf9f76b22d75f1c2bc1e7ff99a49d2897a8dcb7`.
+- Active contract: X/Y/Z, six limits, 450/5000/500, EN `permanent_high`, hard truncate `truncate_current_high_pulse_immediately_after_synchronized_limit`. Runtime limits are **not** inert.
 - PWM ~20 Hz is a protocol/debug target; it does not guarantee a specific fan mechanical speed or torque.
-- Packager integrate tip `445814a…` (`packager-compact-20260805T042343Z`) merged to `dev`; packaging-only — does not reopen the software/TD closure above.
 
 ## Physical / evidence remaining uncertainties
 
-- `intake_solenoid_out` is **inferred-LOC’d** on **CON141.1 / P2** (EX_GPIO33). Connector→series-R→ball is board-data backed; external driver / coil polarity still **unconfirmed**.
-- Exhaust X/Y STEP/DIR/EN on CON138–CON139 are **inferred** EX_GPIO roles; X limit on **CON68.3 / M6**, Y limit on **CON34.3 / F9** (fan-header tach pin3 repurposed).
-- Historical **A11 vs CON124** WATER_COOL conflict remains a board-assembly note; product **y_limit** is CON34.3 / F9 (not A11).
-- Contract prose historically said CON30.3(丝印) for X limit; V1.2 product probe is now **CON68.3 / M6**.
-- CON34/CON68 pin2 (+12V fan rails) and pin1 (GND) must not carry limit signals.
+- Board bring-up and real fan/PTC/motor load behavior remain unverified until hardware is authorized.
+- Active IO probes: CON104/105/106 (STEP/DIR), CON120.2 (EN), CON12 + CON129 (six limits). Solenoid / CON68 / CON34 / CON138–141 are **not** active product IO (see `docs/historical/`).
+- Full KiCad `generate` of SVG layers was **not** re-run (cached PCB reannotate for CON12 board-data); geometry SVGs retained.
 
-## Non-goals for docs lane
+## Non-goals
 
-- Do not treat archived Windows packages (`d99f354` / `4ddfbec`, `C:\Users\...`) as current pass evidence.
-- Do not revive superseded tip claims (`f82c41e`, matrix fail `6f32493`, TD `ead5a3e` / bitstream `a7b5c119…`) as final closure truth.
+- Do not treat archived 2-axis/solenoid closure (`da7b05a`, TD `8f28660`, bitstream `ce3157c5…`) as current tip truth.
+- Do not present `45f548ab…` as tip bitstream.
+- Do not revive Windows packages (`d99f354` / `4ddfbec`, `C:\Users\...`) as current pass evidence.

+ 14 - 11
PLAN.md

@@ -1,21 +1,24 @@
-# Prod2U active plan pointer
+# Prod2U active plan pointer(三轴闭包)
 
-- Final software closure RUN_ID: `grok45-final-20260805T013238Z`
-- FINAL_COMMIT: `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2`
-- Full matrix (incl. cocotb): **pass** (`verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`)
-- TD built commit: `8f28660f176e18e97a015e66bdae0ff747e0fc63`
-- Bitstream SHA-256: `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d`
+- Contract truth: X/Y/Z, six limits, 450/5000/500, EN `permanent_high`, hard truncate `truncate_current_high_pulse_immediately_after_synchronized_limit`
+- ARTIFACT-SOURCE-COMMIT / tip TD: `0de9f93988344e3c11931482902196b02ac7a713`
+- Bitstream SHA-256: `54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c`
+- td2026: Release_2026.1_SP2 Build `6.2.2.200067` (RUN_ID `closure-td-20260806T022723Z-63cb51`)
+- Historical bypass bit `45f548ab…` @ `bb515af` — **not** tip
+- Contract/source baseline tip: `cdf9f76b22d75f1c2bc1e7ff99a49d2897a8dcb7` (docs/contract lane start)
 - Hardware validation: **`not_run`**
-- Physical blocked: intake solenoid ball/ADC; X/Y silk mapping; A11/CON124
+- Active IO: CON104/105/106/120/12/129 — **not** solenoid / CON68 / CON34 / CON138–141; runtime limit **not** inert
 
-## Packager compact (does not reopen product closure evidence)
+## Closure sequence
 
-- Packager integrate tip: `445814ad54467996cb4150651e80db3933cfd582` (RUN_ID `packager-compact-20260805T042343Z`; delivery tip = current `dev` HEAD after docs align)
-- Default upload profile: `review-compact` (no full git bundle; unified `source/` + `evidence/` + `meta/`)
-- Pre-closure docs plan archived: [`docs/historical/PLAN-grok45-final-pre-closure-20260805.md`](docs/historical/PLAN-grok45-final-pre-closure-20260805.md)
+1. ~~Merge parallel lanes~~ done on `closure/integrate-3axis`.
+2. ~~Exclusive `td2026` on clean tip; bind full bitstream SHA-256~~ done.
+3. Full matrix + three-volume package; activity docs identity filled.
+4. Independent read-only review session (parent launches).
 
 ## Authority
 
 - Linux `td2026` + OSS CAD / Python verification
 - Contract: `projects/prod2u-door-temp/project.json`, requirements, protocol, `AGENTS.md`
 - Active status docs: `README.zh-CN.md`, `ACCEPTANCE_MATRIX.md`, `FINAL_DELIVERY_REPORT.md`, `OPEN_QUESTIONS.md`
+- Superseded 2-axis/solenoid plans: [`docs/historical/`](docs/historical/)

+ 30 - 19
README.zh-CN.md

@@ -1,6 +1,6 @@
 # Prod2U 门控温度 CPLD
 
-本仓库实现 `prod2u-door-temp` 门温控:25 MHz 主时钟、UART `115200 8N1`、无流控。统一帧为 `A5 5A type length payload CRC16_LE`。CRC-16/CCITT-FALSE 覆盖 type、length 与 payload,线路低字节在前。
+本仓库实现 `prod2u-door-temp`:**四腔热控 + 腔体 1 三轴步进风门(X/Y/Z)**。25 MHz 主时钟、UART `115200 8N1`、无流控。统一帧为 `A5 5A type length payload CRC16_LE`。CRC-16/CCITT-FALSE 覆盖 type、length 与 payload,线路低字节在前。
 
 **权威执行环境:Linux 容器**(`td2026`、Python/Icarus/Verilator/formal/cocotb)。Windows 路径与旧收据仅作历史参考,见 [`docs/historical/`](docs/historical/)。
 
@@ -8,40 +8,51 @@
 
 | 类型 | 说明 |
 |---|---|
-| `0x01 SET_ALL` | **11 字节** payload:4 FAN + 4 chamber PTC(各复制到 2 路物理 PTC PWM)+ 进风门/出风门 X/出风门 Y;成功无回复。旧 14 字节 length `0x0E` 静默丢弃。 |
+| `0x01 SET_ALL` | **11 字节** payload:4 FAN + 4 chamber PTC(各复制到 2 路物理 PTC PWM)+ Z/X/Y 门字节;成功无回复。旧 14 字节 length `0x0E` 静默丢弃。 |
 | `0x02 GET_TEMPERATURE` | 空 payload;读完 27 项 CT7428 后只回一帧温度。 |
 | `0x82 TEMPERATURE_DATA` | 27 字节 payload,总帧长 33 字节。 |
 
 PTC/FAN 占空为十进制 0..100。PWM ≈20 Hz。PTC active-high;FAN 在 FPGA 输出为 active-low。启动目标 PTC=0、FAN=10;看门狗 10 s → PTC=0、FAN=20。
 
-### 风门字节语义(关键)
+### 门字节语义(三轴步进,无电磁铁)
 
-| 字节 | 执行器 | `00` | `01` | `02` |
+| 字节 | 轴 | `00` | `01` | `02` |
 |---|---|---|---|---|
-| 偏移 8 进风门 | 默认**电磁铁** | **保持(hold)** | open latched | closed latched |
-| 偏移 9/10 出风门 X/Y | **步进马达** | **停止(stop / 无新 jog)** | 开门 DIR=0 | 关门 DIR=1 |
+| 偏移 8 | Z | stop(无新 jog) | open DIR=0 | close DIR=1 |
+| 偏移 9 | X | stop(无新 jog) | open DIR=0 | close DIR=1 |
+| 偏移 10 | Y | stop(无新 jog) | open DIR=0 | close DIR=1 |
 
-马达普通 jog:450 步 @ 1000 step/s;X/Y 可并行。详细合同见 [`docs/prod2u-door-temp-protocol.zh-CN.md`](docs/prod2u-door-temp-protocol.zh-CN.md) 与 `projects/prod2u-door-temp/project.json`。
+普通 jog:**450** 步 @ 1000 step/s;X/Y/Z 可并行。电机 EN:CON120.2 / C11,FPGA `permanent_high`(板级 NPN 反相后座端永久使能)。详细合同见 [`docs/prod2u-door-temp-protocol.zh-CN.md`](docs/prod2u-door-temp-protocol.zh-CN.md) 与 `projects/prod2u-door-temp/project.json`。
 
-## 启动限位(one-shot)
+## 六限位与启动 / 运行期硬截断
 
-上电/`startup_done==0`:X/Y 向 close(DIR=1)间歇寻限位,最多 10 burst × 450 步 @ 1000 step/s,burst 间隔 50 ms;限位 active-high(X: CON68.3/M6,Y: CON34.3/F9;风扇座 pin3 tach 复用,见 IO 证据)。`startup_done` 前主机 UART 被丢弃;完成后限位对普通 jog **惰性**。
+六路限位(FPGA active-high,`runtime_use=true`):
 
-## 当前基线与验证真相(final closure)
+| 轴 | LS | HS |
+|---|---|---|
+| X | CON12.1 A5 | CON12.2 B6 |
+| Y | CON12.3 C8 | CON12.4 A8 |
+| Z | CON129.1 K16 | CON129.2 J15 |
+
+马达:X CON104.2/3 C12/B12;Y CON105.2/3 L12/J11;Z CON106.2/3 L14/K14。
+
+- **Startup(上电一拍)**:PTC=0、FAN=10;三轴 DIR=1 关门寻限,每轴最多 **5000** 步 @ 1000 step/s;未命中则 **500** 步 backoff;`startup_done` 前主机帧丢弃。
+- **硬截断**:`stop_semantics=truncate_current_high_pulse_immediately_after_synchronized_limit`(同步限位后立即截断当前 STEP 高脉冲)。Startup 与运行期均硬停;runtime limits are **not** inert。
+
+活动 IO **不是** 电磁铁 / CON68 / CON34 / CON138–141;旧二轴+电磁铁叙述见 [`docs/historical/`](docs/historical/)。
+
+## 当前基线与验证真相(三轴闭包)
 
 | 项 | 值 |
 |---|---|
-| FINAL_COMMIT | `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2` |
-| 闭合 RUN_ID | `grok45-final-20260805T013238Z` |
-| 全矩阵(含 cocotb) | **pass**(`verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`) |
-| TD built commit | `8f28660f176e18e97a015e66bdae0ff747e0fc63`(生产综合输入与 tip 一致,tip 未强制重跑 TD) |
-| Bitstream SHA-256 | `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d` |
+| 合同 / 源码基线 tip | `cdf9f76b22d75f1c2bc1e7ff99a49d2897a8dcb7`(Lane 合并起点) |
+| ARTIFACT-SOURCE-COMMIT / FINAL_COMMIT(TD 源闭包) | `0de9f93988344e3c11931482902196b02ac7a713` |
+| Bitstream SHA-256 | `54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c` |
+| td2026 | Release_2026.1_SP2 Build `6.2.2.200067`;RUN_ID `closure-td-20260806T022723Z-63cb51` |
+| 历史旁路 firmware bit | `45f548ab…` 构建于 `bb515af`,**不是** tip / 当前闭包证据 |
 | Hardware / JTAG / 烧录 | **`not_run`**(未授权) |
-| 物理 uncertainties | 进风电磁铁外部驱动/线圈极性;CON138–139 马达 EX_GPIO 角色 inferred;限位复用风扇座 pin3(X:CON68 / Y:CON34);历史 A11 vs CON124 |
-
-`packager-compact-20260805T042343Z` 已合入 `dev`(integrate tip `445814a…` + 活动文档对齐;review-compact 打包体系);生产综合输入相对 `da7b05a…` **未变**,**不**改写上表软件/TD/bitstream 闭合证据。
 
-陈旧 Windows 最终交付叙述(`d99f354` / `4ddfbec`、虚假 cocotb 全绿、`C:\Users\...` 包路径)及过期 tip 声明(`f82c41e` / `ead5a3e` / `a7b5c119…`)已移至 [`docs/historical/`](docs/historical/),**不是**当前活动真相。
+陈旧二轴/电磁铁“final closure”(`da7b05a` / `ce3157c5…` / `8f28660…`)及 Windows 叙述已归档,**不是**当前活动真相。
 
 ## 离线验证入口(Linux)
 

+ 1 - 0
config/board_viewer_annotations.fcb_fpga_mcu0611.json

@@ -1,6 +1,7 @@
 {
   "schema": "board-viewer-annotations-v1",
   "board_id": "fcb_fpga_mcu0611",
+  "historical_note": "historical_schematic_side_evidence for FCB_FPGA+MCU0611.pdf only. Not the 20260717 V1.2 board revision. Must not override V1.2 CON104/105/106/120/12/129 activity mapping; V1.2 BRD remains physical-path authority. No V1.2 schematic PDF is provided (missing_by_policy/not_provided).",
   "connector_profiles": {
     "CON_11251W00_NPX_SX_4P": {
       "references": [

+ 21 - 0
config/board_viewer_annotations.fcb_fpga_mcu_v1_2.json

@@ -1,6 +1,27 @@
 {
   "schema": "board-viewer-annotations-v1",
   "board_id": "fcb_fpga_mcu_v1_2_20260717",
+  "io_evidence_policy": {
+    "authoritative_order": [
+      "physical_path_confirmed_by_brd",
+      "product_polarity_confirmed_by_electrical_staff",
+      "hardware_measurement_not_run"
+    ],
+    "physical_path": "confirmed_by_brd",
+    "product_polarity": "confirmed_by_electrical_staff",
+    "hardware_measurement": "not_run",
+    "matrix_doc": "docs/IO_EVIDENCE_MATRIX.zh-CN.md",
+    "historical_schematic_side_evidence": "reference/original/schematics/FCB_FPGA+MCU0611.pdf",
+    "v1_2_schematic_pdf": "missing_by_policy/not_provided",
+    "must_not_override_connectors": [
+      "CON104",
+      "CON105",
+      "CON106",
+      "CON120",
+      "CON12",
+      "CON129"
+    ]
+  },
   "connector_profiles": {
     "CON_11251W00_NPX_SX_4P": {
       "references": [

+ 11 - 5
config/pin_inventory.fcb_fpga_mcu0611.json

@@ -1,12 +1,15 @@
 {
   "schema": "cpld-pin-inventory-v1",
   "board_id": "fcb_fpga_mcu0611",
-  "board_role": "real_fan_ptc_product_diagnostic_board",
-  "status": "reviewed_with_locked_debug_uart_conflicts",
+  "board_role": "historical_schematic_side_evidence",
+  "status": "historical_only_must_not_override_v1_2_activity_map",
   "clock_hz": 25000000,
   "manual_verification_required": true,
   "product_thermal_gate_allowed": false,
-  "electrical_boundary": "FCB_FPGA+MCU0611 schematic review covers function net to FPGA ball mapping only. Current temporary J6/COM7/COM8 UART wiring conflicts with HEAT3/4/17/18/21/22, so full real FAN/PTC bitstream generation must remain fail-closed until that wiring or the target pin map changes.",
+  "evidence_class": "historical_schematic_side_evidence",
+  "authority": "non_authoritative_for_v1_2_product_io",
+  "must_not_override_connectors": ["CON104", "CON105", "CON106", "CON120", "CON12", "CON129"],
+  "electrical_boundary": "HISTORICAL ONLY: FCB_FPGA+MCU0611 schematic review covers function net to FPGA ball mapping for the older schematic PDF. This inventory is historical_schematic_side_evidence and must not override V1.2 BRD activity mapping for CON104/105/106/120/12/129. Current temporary J6/COM7/COM8 UART wiring conflicts with HEAT3/4/17/18/21/22 remain diagnostic context only.",
   "locked_debug_uart_assignments": {
     "bmc_uart_tx": "T4",
     "bmc_uart_rx": "R5",
@@ -27,14 +30,17 @@
       "kind": "schematic_pdf",
       "path": "reference/original/schematics/FCB_FPGA+MCU0611.pdf",
       "pages": [3, 7, 9, 10],
-      "confidence": "manual_pdf_cross_check"
+      "confidence": "historical_schematic_side_evidence",
+      "evidence_class": "historical_schematic_side_evidence",
+      "notes": "Earlier schematic PDF only; not a V1.2 schematic substitute (V1.2 schematic PDF is missing_by_policy/not_provided)."
     },
     {
       "kind": "allegro_brd",
       "path": "reference/original/board/FCB_FPGA_MCU_V1.2_20260717/FCB_FPGA+MCU_V1.2_20260717.brd",
       "sha256": "269b5bab2f2e1215b9392079a003badc34238ae3cbe8e5094c9a11bba8b84ebb",
       "importer": "KiCad 10.0.4 Allegro importer",
-      "confidence": "direct_board_database_import"
+      "confidence": "direct_board_database_import",
+      "notes": "V1.2 BRD is physical-path authority for product IO; this 0611 inventory must not override it."
     },
     {
       "kind": "system_schematic_pdf",

+ 280 - 68
config/pin_inventory.prod2u_door_temp_v1_2.json

@@ -8,24 +8,35 @@
   "product_thermal_gate_allowed": false,
   "matrix_doc": "docs/IO_EVIDENCE_MATRIX.zh-CN.md",
   "matrix_counts": {
-    "confirmed": 17,
-    "inferred": 16,
+    "physical_path_confirmed_by_brd": 30,
+    "product_polarity_confirmed_by_electrical_staff": 30,
+    "hardware_measurement_not_run": 30,
     "blocked": 1,
-    "total_rows": 34
+    "total_active_rows": 30,
+    "total_rows_including_blocked": 31,
+    "legacy_mixed_confirmed_inferred_retired": true
   },
-  "electrical_boundary": "V1.2 CON104–106/120/12/129 used for product 3-axis motor and six-limit remap. Connector→ball paths are board-data backed; product roles remain inferred except legacy confirmed PTC/FAN/UART/I2C. Do not treat 0611 CON30 silkscreen as V1.2 authority.",
+  "io_evidence_grades": {
+    "physical_path": "confirmed_by_brd",
+    "product_polarity": "confirmed_by_electrical_staff",
+    "hardware_measurement": "not_run",
+    "matrix_doc": "docs/IO_EVIDENCE_MATRIX.zh-CN.md"
+  },
+  "electrical_boundary": "V1.2 CON104–106/120/12/129 used for product 3-axis motor and six-limit map. physical_path=confirmed_by_brd from V1.2 BRD/board-data; product_polarity=confirmed_by_electrical_staff from contract/electrical staff; hardware_measurement=not_run. FCB_FPGA+MCU0611.pdf is historical_schematic_side_evidence only and must not override those connectors. No V1.2 schematic PDF (missing_by_policy/not_provided).",
   "source_documents": [
     {
       "kind": "allegro_brd",
       "path": "reference/original/board/FCB_FPGA_MCU_V1.2_20260717/FCB_FPGA+MCU_V1.2_20260717.brd",
       "sha256": "269b5bab2f2e1215b9392079a003badc34238ae3cbe8e5094c9a11bba8b84ebb",
-      "confidence": "confirmed"
+      "confidence": "confirmed_by_brd",
+      "authority": "v1_2_physical_path"
     },
     {
       "kind": "board_viewer_data",
       "path": "tools/board-viewer/generated/board-data.json",
       "sha256": "daecebf7ccc3d0a8be07a01bae86cf73775bc6a269aad6c3bfec66a1acf0cd63",
-      "confidence": "present"
+      "confidence": "present",
+      "evidence_class": "derived_analysis_from_brd_not_rtl_td_source_closure"
     },
     {
       "kind": "schematic_pdf",
@@ -35,13 +46,30 @@
         8,
         10
       ],
-      "confidence": "present"
+      "confidence": "historical_schematic_side_evidence",
+      "evidence_class": "historical_schematic_side_evidence",
+      "authority": "non_authoritative_for_v1_2_product_io",
+      "must_not_override": [
+        "CON104",
+        "CON105",
+        "CON106",
+        "CON120",
+        "CON12",
+        "CON129"
+      ]
+    },
+    {
+      "kind": "v1_2_schematic_pdf",
+      "path": "reference/original/schematics/FCB_FPGA_MCU_V1.2_schematic.pdf",
+      "confidence": "missing_by_policy",
+      "status": "not_provided",
+      "notes": "No V1.2 schematic PDF provided; do not invent or substitute 0611."
     },
     {
       "kind": "system_schematic_pdf",
       "path": "reference/original/schematics/8000高温罩电气图V2.0.pdf",
       "sha256": "7ebd0dced194338ceb97ff5a0abcee2d9790e7f6e7a90d9d4be7de593dca7eb5",
-      "confidence": "confirmed"
+      "confidence": "present"
     }
   ],
   "pins": [
@@ -51,9 +79,15 @@
       "direction": "input",
       "io_standard": "LVCMOS33",
       "product_role": "system_clock",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "pdf_and_existing_adc"
+      "source_confidence": "pdf_and_existing_adc",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "host_uart_rx",
@@ -64,9 +98,15 @@
       "direction": "input",
       "io_standard": "LVCMOS33",
       "product_role": "host_uart_rx",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "host_uart_tx",
@@ -77,9 +117,15 @@
       "direction": "output",
       "io_standard": "LVCMOS33",
       "product_role": "host_uart_tx",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "temp_scl",
@@ -87,9 +133,15 @@
       "direction": "bidir",
       "io_standard": "LVCMOS33",
       "product_role": "ct7428_scl",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_and_product_contract"
+      "source_confidence": "v1_2_board_data_and_product_contract",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "temp_sda",
@@ -97,9 +149,15 @@
       "direction": "bidir",
       "io_standard": "LVCMOS33",
       "product_role": "ct7428_sda",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_and_product_contract"
+      "source_confidence": "v1_2_board_data_and_product_contract",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "ptc_pwm_out[0]",
@@ -110,9 +168,15 @@
       "direction": "output",
       "active_level": "high",
       "product_role": "chamber1_ptc_physical_0",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "ptc_pwm_out[1]",
@@ -123,9 +187,15 @@
       "direction": "output",
       "active_level": "high",
       "product_role": "chamber1_ptc_physical_1",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "ptc_pwm_out[2]",
@@ -136,9 +206,15 @@
       "direction": "output",
       "active_level": "high",
       "product_role": "chamber2_ptc_physical_0",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "ptc_pwm_out[3]",
@@ -149,9 +225,15 @@
       "direction": "output",
       "active_level": "high",
       "product_role": "chamber2_ptc_physical_1",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "ptc_pwm_out[4]",
@@ -162,9 +244,15 @@
       "direction": "output",
       "active_level": "high",
       "product_role": "chamber3_ptc_physical_0",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "ptc_pwm_out[5]",
@@ -175,9 +263,15 @@
       "direction": "output",
       "active_level": "high",
       "product_role": "chamber3_ptc_physical_1",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "ptc_pwm_out[6]",
@@ -188,9 +282,15 @@
       "direction": "output",
       "active_level": "high",
       "product_role": "chamber4_ptc_physical_0",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "ptc_pwm_out[7]",
@@ -201,9 +301,15 @@
       "direction": "output",
       "active_level": "high",
       "product_role": "chamber4_ptc_physical_1",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "fan_pwm_out[0]",
@@ -214,9 +320,15 @@
       "direction": "output",
       "active_level": "low",
       "product_role": "chamber1_fan",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "fan_pwm_out[1]",
@@ -227,9 +339,15 @@
       "direction": "output",
       "active_level": "low",
       "product_role": "chamber2_fan",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "fan_pwm_out[2]",
@@ -240,9 +358,15 @@
       "direction": "output",
       "active_level": "low",
       "product_role": "chamber3_fan",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "fan_pwm_out[3]",
@@ -253,9 +377,15 @@
       "direction": "output",
       "active_level": "low",
       "product_role": "chamber4_fan",
-      "conclusion": "confirmed",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_cross_verified"
+      "source_confidence": "v1_2_board_data_cross_verified",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "motor_en_n",
@@ -266,10 +396,15 @@
       "direction": "output",
       "active_level": "low",
       "product_role": "shared_motor_enable_n_permanent_high",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
       "source_confidence": "v1_2_board_data_product_remap",
-      "conclusion_notes": "CON120.2→C11; NPN open-collector invert at board. FPGA drives constant 1 (permanent_high) so connector EN stays asserted."
+      "conclusion_notes": "CON120.2→C11; NPN open-collector invert at board. FPGA drives constant 1 (permanent_high) so connector EN stays asserted. evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run.",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      }
     },
     {
       "signal": "x_limit_ls",
@@ -279,9 +414,15 @@
       "direction": "input",
       "active_level": "high",
       "product_role": "x_limit_low_side",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "x_limit_hs",
@@ -291,9 +432,15 @@
       "direction": "input",
       "active_level": "high",
       "product_role": "x_limit_high_side",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "y_limit_ls",
@@ -303,9 +450,15 @@
       "direction": "input",
       "active_level": "high",
       "product_role": "y_limit_low_side",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "y_limit_hs",
@@ -315,9 +468,15 @@
       "direction": "input",
       "active_level": "high",
       "product_role": "y_limit_high_side",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "z_limit_ls",
@@ -327,9 +486,15 @@
       "direction": "input",
       "active_level": "high",
       "product_role": "z_limit_low_side",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "z_limit_hs",
@@ -339,9 +504,15 @@
       "direction": "input",
       "active_level": "high",
       "product_role": "z_limit_high_side",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "x_step",
@@ -350,9 +521,15 @@
       "fpga_ball": "C12",
       "direction": "output",
       "product_role": "door_x_step",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "x_dir",
@@ -361,9 +538,15 @@
       "fpga_ball": "B12",
       "direction": "output",
       "product_role": "door_x_dir",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "y_step",
@@ -372,9 +555,15 @@
       "fpga_ball": "L12",
       "direction": "output",
       "product_role": "door_y_step",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "y_dir",
@@ -383,9 +572,15 @@
       "fpga_ball": "J11",
       "direction": "output",
       "product_role": "door_y_dir",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "z_step",
@@ -394,9 +589,15 @@
       "fpga_ball": "L14",
       "direction": "output",
       "product_role": "door_z_step",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "z_dir",
@@ -405,9 +606,15 @@
       "fpga_ball": "K14",
       "direction": "output",
       "product_role": "door_z_dir",
-      "conclusion": "inferred",
+      "conclusion": "physical_path_confirmed_by_brd",
       "manually_verified": true,
-      "source_confidence": "v1_2_board_data_product_remap"
+      "source_confidence": "v1_2_board_data_product_remap",
+      "evidence_grades": {
+        "physical_path": "confirmed_by_brd",
+        "product_polarity": "confirmed_by_electrical_staff",
+        "hardware_measurement": "not_run"
+      },
+      "conclusion_notes": "evidence_grades split: physical_path=confirmed_by_brd; product_polarity=confirmed_by_electrical_staff; hardware_measurement=not_run."
     },
     {
       "signal": "x_limit_connector_con30_pin3_v1_2_silkscreen",
@@ -423,6 +630,11 @@
         "connector_pin": 3,
         "fpga_ball": "B9",
         "remap_confidence": "inferred"
+      },
+      "evidence_grades": {
+        "physical_path": "blocked",
+        "product_polarity": "blocked",
+        "hardware_measurement": "not_run"
       }
     }
   ],

+ 33 - 12
docs/BRD_ANALYSIS_FOR_AGENTS.zh-CN.md

@@ -4,12 +4,13 @@
 
 | 格式 | 其他 Agent 能否直接分析 | 推荐用法 |
 |------|-------------------------|----------|
-| **Allegro `.brd`** | ❌ 一般不能(二进制专有格式) | 作为原始来源保留;分析请用下方 JSON/SVG |
+| **Allegro `.brd`(V1.2)** | ❌ 一般不能(二进制专有格式) | **物理路径权威**;分析请用下方 JSON/SVG,勿手拆二进制 |
 | **`board-data.json`** | ✅ 可以 | **首选**:引脚、网络、证据等级、编程说明 |
 | **`import-report.json`** | ✅ 可以 | BRD 导入统计与焊盘/网络核对 |
 | **`board-*.svg`** | ✅ 可以(视觉) | 铜层、丝印、阻焊外形 |
-| **电气图 PDF** | ✅ 可以(视觉) | 整机/系统边界、8000 高温罩电气图 |
-| **原理图 PDF** | ✅ 可以(视觉) | FCB_FPGA+MCU0611 等 |
+| **系统电气图 PDF** | ✅ 可以(视觉) | `8000高温罩电气图V2.0.pdf`(整机边界) |
+| **0611 原理图 PDF** | ✅ 可以(视觉) | **仅** `historical_schematic_side_evidence` |
+| **V1.2 原理图 PDF** | ❌ 不存在 | `missing_by_policy` / `not_provided`;不得用 0611 冒充 |
 
 本交接包同时包含 **原始 BRD/PDF** 和 **已解析的 board-viewer 产物**,请优先读 JSON,不要试图把 `.brd` 当文本解析。
 
@@ -17,6 +18,22 @@
 
 `reference/original/local_archives/board/FCB_FPGA+MCU_V1.2_20260717.brd` 与规范路径 `reference/original/board/FCB_FPGA_MCU_V1.2_20260717/` 下主副本字节相同;分析打包应只保留一份物理 BRD(规范路径),归档镜像本地保留即可。
 
+## 权威顺序与 0611 边界(重要)
+
+1. **V1.2 BRD**(`FCB_FPGA+MCU_V1.2_20260717.brd`)→ board-viewer 派生 = 活动板物理路径权威(`physical_path = confirmed_by_brd`)。
+2. **产品极性**来自电气确认/现行合同(`product_polarity = confirmed_by_electrical_staff`)。
+3. **硬件实测**本轮为 `hardware_measurement = not_run`。
+
+关于 `FCB_FPGA+MCU0611.pdf`:
+
+- 这是较早的 FCB FPGA+MCU **原理图 PDF**(配合 `config/pin_inventory.fcb_fpga_mcu0611.json`),**不是** `20260717` 的 V1.2 板修订。
+- 证据类:`historical_schematic_side_evidence`。
+- 允许:部分网名、旧页、旧座子对照。
+- **禁止**:覆盖 V1.2 活动映射 CON104 / CON105 / CON106 / CON120 / CON12 / CON129(三轴步进/方向、共享 EN、六限位)。
+- **不宣称**存在 V1.2 专用原理图 PDF;inventory 对该项标 `missing_by_policy` / `not_provided`。
+
+证据等级拆分详见 `docs/IO_EVIDENCE_MATRIX.zh-CN.md`(勿再把物理路径与极性/实测混成单一 `confirmed`)。
+
 ## 证据边界(重要)
 
 `tools/board-viewer/generated/` 下的 `board-*.svg`、`board-data.json`、`build-info.json`、`import-report.json` 都是由 Allegro BRD(经 KiCad 导入/导出)得到的**派生分析证据**,只用于物理连接与板图核对。
@@ -37,10 +54,11 @@ tools/refresh-reference-inventory.sh
 ```
 CPLD/workspace-current/
   reference/original/board/FCB_FPGA_MCU_V1.2_20260717/
-    FCB_FPGA+MCU_V1.2_20260717.brd          # 原始 Allegro 板文件 (~11MB)
+    FCB_FPGA+MCU_V1.2_20260717.brd          # 原始 Allegro 板文件 (~11MB) — 权威
   reference/original/schematics/
     8000高温罩电气图V2.0.pdf                 # 系统电气图
-    FCB_FPGA+MCU0611.pdf                     # 原理图 PDF
+    FCB_FPGA+MCU0611.pdf                     # historical 原理图旁证(非 V1.2)
+    (无 V1.2 原理图 PDF — not_provided)
   tools/board-viewer/                         # 查看器源码
 board-viewer-generated/                       # 外部附加卷(若存在)
   board-data.json                             # ★ 主分析数据
@@ -55,25 +73,28 @@ board-viewer-generated/                       # 外部附加卷(若存在)
 - 每个连接器 `CONxx` / `Jxx` 的焊盘矩阵、网络名、证据等级
 - FPGA 球位与 `cross_verified` 路径(UART、限位、马达等)
 - CT7428、风扇 PWM、PTC、电源等模板化注释
+- 可选 `evidence_grades`(`physical_path` / `product_polarity` / `hardware_measurement`)— 与 IO 矩阵同语义;缺省时仍以矩阵文档为准
 
 配套人工注释 / 证据:
 
-- `config/board_viewer_annotations.fcb_fpga_mcu_v1_2.json`
-- `config/pin_inventory.fcb_fpga_mcu0611.json`(0611 历史清单)
+- `config/board_viewer_annotations.fcb_fpga_mcu_v1_2.json`(V1.2 活动板)
+- `config/pin_inventory.fcb_fpga_mcu0611.json`(**historical** 0611 旁证清单;不得覆盖 V1.2 CON104/105/106/120/12/129)
 - `config/pin_inventory.prod2u_door_temp_v1_2.json`(V1.2 产品接口证据摘要)
-- `docs/IO_EVIDENCE_MATRIX.zh-CN.md`(confirmed / inferred / blocked)
+- `docs/IO_EVIDENCE_MATRIX.zh-CN.md`(拆分证据等级)
 - `docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md`(联调顺序与期望波形;硬件未跑前为 not_run)
 
 ## 本地重新生成 board-viewer 数据(可选)
 
 需要 KiCad 10.0.4 + `kicad-cli`:
 
-```powershell
-cd tools\board-viewer
-py -3.12 board_viewer.py generate --temp-parent C:\Users\Administrator\CodexTemp
-py -3.12 board_viewer.py validate
+```bash
+cd tools/board-viewer
+python3 board_viewer.py generate
+python3 board_viewer.py validate
 ```
 
+(Windows 历史命令仅作参考;权威执行环境为 Linux。)
+
 ## 器件与项目
 
 - **FPGA**:EF2L45BG256B(EF2L45BG256,BG256)

+ 55 - 52
docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md

@@ -1,95 +1,98 @@
-# Prod2U V1.2 硬件测试顺序与期望波形(简版)
+# Prod2U V1.2 硬件测试顺序与期望波形(三轴活动版)
 
-run_id: `con138-141-20260805T061504Z`  
-前提:比特流与 active ADC 含 confirmed PWM/UART/I2C 球 + CON138–141 **inferred** 电机/限位/电磁铁球(共 25);`intake_solenoid_out` **LOC @ P2**。  
+前提:比特流与 active ADC 绑定 tip TD `0de9f93988344e3c11931482902196b02ac7a713`;  
+Bitstream SHA-256 `54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c`(td2026 Release_2026.1_SP2 Build `6.2.2.200067`)。  
+历史旁路 bit `45f548ab…` @ `bb515af` **不是** tip。  
 本文件 **不是** 已执行硬件回执;物理 COM/JTAG 未授权前状态为 `not_run`。
 
-引脚权威见 [`IO_EVIDENCE_MATRIX.zh-CN.md`](IO_EVIDENCE_MATRIX.zh-CN.md)。
+旧二轴+电磁铁探点(CON68/CON34/CON138–141、solenoid)已归档:  
+[`historical/HARDWARE_TEST_ORDER_WAVEFORMS-2axis-solenoid-pre-3axis.zh-CN.md`](historical/HARDWARE_TEST_ORDER_WAVEFORMS-2axis-solenoid-pre-3axis.zh-CN.md)。
 
-## 0. 安全与探点
+引脚权威见 [`IO_EVIDENCE_MATRIX.zh-CN.md`](IO_EVIDENCE_MATRIX.zh-CN.md) 与 `project.json`。
 
-- 逻辑探点优先 FPGA 球侧 3.3 V(或串联 0R 后);风扇/PTC 座为 12 V 功率域。
-- FAN:FPGA 球 **active-low** PWM;座端经板级反相后给风扇。
-- PTC:FPGA 球 **active-high**。
-- 限位:期望 **active-high** 表示已到位(合同);用高阻探头,勿强驱。
-- X 限位探点:**CON68.3 / M6**(FAN_GPIO47;旧 CON140.1/T11、CON125.3/B9 已退役)。
-- Y 限位探点:**CON34.3 / F9**(FAN_GPIO11;旧 CON68.4/L8、CON140.2/P13、CON12.3/A11 已退役)。
-- X 电机:**CON139.1–3** → STEP/DIR/EN_n(R6/R8/T7)。
-- Y 电机:**CON138.1–2** → STEP/DIR(T3/R4)。
-- 进风电磁铁逻辑球:**CON141.1 / P2**(外部功率驱动自备)。
+## 0. 安全与探点(活动 IO)
+
+- 逻辑探点优先 FPGA 球侧 3.3 V;风扇/PTC 座为 12 V 功率域。
+- FAN:FPGA 球 **active-low** PWM;PTC:FPGA 球 **active-high**。
+- 限位:FPGA **active-high**;用高阻探头,勿强驱。
+- **X 限位**:CON12.1/A5(LS)、CON12.2/B6(HS)。
+- **Y 限位**:CON12.3/C8(LS)、CON12.4/A8(HS)。
+- **Z 限位**:CON129.1/K16(LS)、CON129.2/J15(HS)。
+- **X 电机**:CON104.2/3 → STEP/DIR(C12/B12)。
+- **Y 电机**:CON105.2/3 → STEP/DIR(L12/J11)。
+- **Z 电机**:CON106.2/3 → STEP/DIR(L14/K14)。
+- **EN**:CON120.2 / C11;FPGA `permanent_high`(恒 1);板级 NPN 反相后座端永久使能。
+- **禁止**将 solenoid / CON68 / CON34 / CON138–141 当作活动探点。
 
 ## 1. 推荐测试顺序
 
 | 步 | 项目 | 操作摘要 | 通过判据(期望) |
 |---:|------|----------|------------------|
-| 1 | 上电静态 | 上电,不发 UART | PTC 球≈0;FAN 球对应默认 duty≈10%(~20 Hz);EN_n≈0(常使能低);STEP 无边沿 |
-| 2 | Startup 关门寻限位 | 观察 X/Y STEP + 限位 | 见 §2.1;`startup_done` 前主机帧应被丢弃(无 TEMP 响应) |
+| 1 | 上电静态 | 上电,不发 UART | PTC 球≈0;FAN 球对应默认 duty≈10%(~20 Hz);FPGA EN=1;STEP 无边沿 |
+| 2 | Startup 关门寻限位 | 观察 X/Y/Z STEP + 六限位 | 见 §2.1;`startup_done` 前主机帧丢弃 |
 | 3 | UART 冒烟 | startup 完成后发 GET_TEMPERATURE | 收到 `0x82` 27 字节温度载荷 + CRC |
-| 4 | FAN PWM | SET_ALL 单腔风扇 0/50/100 | §2.2;其余腔保持 |
-| 5 | PTC PWM | SET_ALL 单腔 PTC 0/50/100 | §2.3;同腔两路物理 PTC 波形一致 |
-| 6 | 出风门 jog | SET_ALL exhaust X/Y = 01 或 02 | §2.4;450 个 STEP 上升沿 @ 1000 step/s |
-| 7 | 运行期限位惰性 | startup 后拨动限位 | STEP 不被 limit 截断 |
-| 8 | 看门狗 | 停发 SET_ALL ≥10 s | PTC→0,FAN→20;马达停 |
-| 9 | 进风电磁铁 | SET_ALL intake = 01/02/00 | CON141.1/P2 电平随 open/close/hold;**外部驱动必接** |
+| 4 | FAN PWM | SET_ALL 单腔风扇 0/50/100 | §2.2 |
+| 5 | PTC PWM | SET_ALL 单腔 PTC 0/50/100 | §2.3;同腔两路物理 PTC 一致 |
+| 6 | 三轴 jog | SET_ALL Z/X/Y = 01 或 02 | §2.4;每轴最多 450 个 STEP 上升沿 @ 1000 step/s |
+| 7 | 运行期硬截断 | startup 后 jog 时拨动目标限位 | STEP 高脉冲立即截断;无新上升沿(非惰性) |
+| 8 | 看门狗 | 停发 SET_ALL ≥10 s | PTC→0,FAN→20;STEP 停;EN 仍永久使能 |
 
 ## 2. 期望波形
 
-时钟 25 MHz;时间按合同标称(允许晶振/分频误差)。
+时钟 25 MHz;时间按合同标称。
 
 ### 2.1 Startup 关门寻限位
 
-- DIR = 1(关);EN_n = 0。
-- 每轴:最多 10 个 burst;每 burst ≤450 个 STEP **上升沿**;步进率 1000 step/s → 半周期 0.5 ms,周期 1 ms。
-- burst 间隔:STEP 保持低 **50 ms**,再开下一 burst。
-- 限位在 burst 内变高:该轴不再产生新的上升沿;若当前 STEP 为高,完成半周期后落下。
+- DIR = 1(关);FPGA EN = 1(`permanent_high`)。
+- 每轴最多 **5000** 个 STEP 上升沿 @ 1000 step/s;未命中 LS 则 DIR=0 回退最多 **500**(HS 可提前停)。
+- 限位同步变高:该轴 **立即截断** 当前 STEP 高脉冲(`truncate_current_high_pulse_immediately_after_synchronized_limit`),不再产生新上升沿。
 - 限位上电已为高:该轴不运动。
-- X/Y 可重叠,独立停止。
+- X/Y/Z 可重叠,独立停止。
 
 ```text
-STEP  (axis seeking):  ‾|_|‾|_| … (≤450 rises) … |_  (50 ms low)  _|‾|_| …
-LIMIT (active-high):   ____________/‾‾‾‾‾‾  → stop further rises
+STEP  (axis seeking):  ‾|_|‾|_| … (≤5000 rises) …
+LIMIT (active-high):   ____________/‾‾‾‾‾‾  → truncate high immediately
 ```
 
 ### 2.2 FAN PWM(~20 Hz)
 
-- 相位计数 100;slot ≈1042 clk @25 MHz → f≈19.99 Hz,周期≈50.05 ms。
-- duty=D%:FPGA 球上 **低有效** 脉宽约占 D%(再经板级到座)。
-- duty=0:球侧接近常高(风扇停);duty=100:接近常低。
+- 相位计数 100;slot ≈1042 clk @25 MHz → f≈19.99 Hz。
+- duty=D%:FPGA 球上 **低有效** 脉宽约占 D%。
 
 ### 2.3 PTC PWM(~20 Hz)
 
 - 同 ~20 Hz 时基;球侧 **高有效**。
-- 同腔两路(如 G16/F16)占空应一致。
+- 同腔两路占空应一致。
 
 ### 2.4 普通 jog(startup_done 后)
 
-- 步进马达:`01` DIR=0 开门;`02` DIR=1 关门;**`00` = stop**(无新 STEP 边沿 / 不启动新 jog)。
-- 进风电磁铁(若已接线):`01` open latch;`02` closed latch;**`00` = hold**(保持;非马达 stop 语义)。无 FPGA ball 时本步 **blocked / 跳过**。
-- 非零马达命令:固定 **450** 个 STEP 上升沿 @ 1000 step/s(约 450 ms 脉冲列)。
-- 运行期 LIMIT 翻转 **不应** 截断 STEP。
+- `01` DIR=0 开门;`02` DIR=1 关门;`00` = stop(无新 jog)。
+- 非零命令:最多 **450** 个 STEP 上升沿 @ 1000 step/s。
+- 运行期目标限位有效:**硬截断**(非 inert)。
 
 ```text
 DIR   ____/‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-STEP  ....|‾|_|‾|_| … 450 rising edges … |_
-EN_n  0(保持)
+STEP  ....|‾|_|‾|_| … ≤450 rising edges … |_
+EN    1(FPGA permanent_high)
 ```
 
 ### 2.5 UART(115200 8N1)
 
 - bit 宽 = 217 clk @25 MHz ≈ 8.68 µs。
-- 帧:`A5 5A | type | length | payload | CRCL | CRCH`(CRC-16/CCITT-FALSE)。
+- 帧:`A5 5A | type | length | payload | CRCL | CRCH`。
 - GET_TEMPERATURE → `0x82`,payload 27;SET_ALL **无** 应答。
 
-## 3. 探点速查(V1.2)
+## 3. 探点速查(V1.2 活动)
 
-| 信号 | 球 | V1.2 优先探点 | 矩阵等级 |
-|------|----|---------------|----------|
-| UART2 | N11/M10 | CON78.2/1(RS-232 电平!逻辑域在 U23 FPGA 侧) | confirmed |
+| 信号 | 球 | V1.2 优先探点 | 备注 |
+|------|----|---------------|------|
+| UART2 | N11/M10 | CON78.2/1(RS-232 电平!) | confirmed |
 | FAN1–4 | C4/B5/B1/A14 | CON8/24/25/26.7 或球侧 | confirmed |
-| PTC 腔1–4 | F16/G16… | CON18/27/28/29 功率针(危险)或 HEAT 控制侧 | confirmed |
-| X limit | M6 | **CON68.3** | inferred(FAN_GPIO47 tach 复用) |
-| Y limit | F9 | **CON34.3** | inferred(FAN_GPIO11 tach 复用) |
-| X STEP/DIR | R6/R8 | **CON139.1/2** | inferred |
-| Y STEP/DIR | T3/R4 | **CON138.1/2** | inferred |
-| EN_n | T7 | **CON139.3** | inferred |
-| 进风电磁铁 | P2 | **CON141.1** | inferred(外部驱动) |
+| PTC 腔1–4 | F16/G16… | 功率针危险;优先控制侧 | confirmed |
+| X LS/HS | A5/B6 | **CON12.1/2** | runtime_use |
+| Y LS/HS | C8/A8 | **CON12.3/4** | runtime_use |
+| Z LS/HS | K16/J15 | **CON129.1/2** | runtime_use |
+| X STEP/DIR | C12/B12 | **CON104.2/3** | |
+| Y STEP/DIR | L12/J11 | **CON105.2/3** | |
+| Z STEP/DIR | L14/K14 | **CON106.2/3** | |
+| EN | C11 | **CON120.2** | FPGA 恒 1 |

+ 41 - 29
docs/IO_EVIDENCE_MATRIX.zh-CN.md

@@ -4,46 +4,58 @@
 SHA-256:`269b5bab2f2e1215b9392079a003badc34238ae3cbe8e5094c9a11bba8b84ebb`  
 (`reference/original/board/...` 与 `reference/original/local_archives/board/...` 字节相同;打包仅保留一份实体 + alias)
 
-证据等级:`confirmed` = BRD/KiCad 网表追踪到 FPGA 球;`inferred` = 路径确认但外部驱动极性/装配待 bring-up;`blocked` = 不进入活动 ADC。
+## 证据等级(拆分,禁止混装为单一 confirmed)
+
+权威顺序:
+
+1. **physical_path** — 连接器/网表 → FPGA 球的物理路径。活动 IO 以 V1.2 BRD(经 board-viewer/KiCad)为权威 → `confirmed_by_brd`。
+2. **product_polarity** — 产品极性/有效电平与合同角色。来自电气确认或现行产品合同 → `confirmed_by_electrical_staff`。
+3. **hardware_measurement** — 台架/示波器实测 → 本轮一律 `not_run`(不接触 COM/JTAG)。
+
+旁证与禁令:
+
+- `FCB_FPGA+MCU0611.pdf` + `pin_inventory.fcb_fpga_mcu0611.json` = `historical_schematic_side_evidence`:可对照旧网名/旧页,**不得**覆盖 V1.2 CON104/105/106/120/12/129 活动映射。
+- **不存在** V1.2 原理图 PDF(`missing_by_policy` / `not_provided`);不得虚构或用 0611 冒充。
+- `blocked` = 不进入活动 ADC(历史/缺席座子)。
 
 ## 活动产品 IO(三轴六限位)
 
-| # | 信号 | 连接器.针 | 板级网 | FPGA | 等级 | 备注 |
-|---|------|-----------|--------|------|------|------|
-| 1 | sys_clk | — | — | J1 | confirmed | 25 MHz |
-| 2 | host_uart_rx | — | — | N11 | confirmed | |
-| 3 | host_uart_tx | — | — | M10 | confirmed | |
-| 4 | temp_scl | — | — | M8 | confirmed | |
-| 5 | temp_sda | — | — | N9 | confirmed | |
-| 6-13 | ptc_pwm_out[0:7] | CON18/27/28/29 | HEAT* | G16,F16,N1,M1,R16,P16,P9,T9 | confirmed | active-high |
-| 14-17 | fan_pwm_out[0:3] | CON25/8/24/26 | FAN_PWM* | B1,C4,B5,A14 | confirmed | FPGA active-low |
-| 18 | motor_en_n | CON120.2 | ENA → BANK0_GPIO2 | C11 | confirmed | FPGA 恒 1;板级 NPN 反相开集;`inferred` 座端有效电平需 bring-up 确认 |
-| 19 | x_step | CON104.2 | PUL1 → BANK0_GPIO15 | C12 | confirmed | |
-| 20 | x_dir | CON104.3 | DIR1 → BANK0_GPIO16 | B12 | confirmed | |
-| 21 | y_step | CON105.2 | PUL2 | L12 | confirmed | |
-| 22 | y_dir | CON105.3 | DIR2 | J11 | confirmed | |
-| 23 | z_step | CON106.2 | PUL3 | L14 | confirmed | |
-| 24 | z_dir | CON106.3 | DIR3 | K14 | confirmed | |
-| 25 | x_limit_ls (LS1) | CON12.1 | EX_GPIO1 → BANK0_LVDS2_P | A5 | confirmed | active-high;非 GND |
-| 26 | x_limit_hs (HS1) | CON12.2 | EX_GPIO2 → BANK0_LVDS2_N | B6 | confirmed | active-high;非 +12V |
-| 27 | y_limit_ls (LS2) | CON12.3 | EX_GPIO3 → BANK0_LVDS3_P | C8 | confirmed | 非 A11 |
-| 28 | y_limit_hs (HS2) | CON12.4 | EX_GPIO4 → BANK0_LVDS3_N | A8 | confirmed | 非 C11 |
-| 29 | z_limit_ls (LS3) | CON129.1 | EX_GPIO17 → CPLD_GPIO17 | K16 | confirmed | |
-| 30 | z_limit_hs (HS3) | CON129.2 | EX_GPIO18 → CPLD_GPIO18 | J15 | confirmed | |
+| # | 信号 | 连接器.针 | 板级网 | FPGA | physical_path | product_polarity | hardware_measurement | 备注 |
+|---|------|-----------|--------|------|---------------|------------------|----------------------|------|
+| 1 | sys_clk | — | — | J1 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | 25 MHz |
+| 2 | host_uart_rx | — | — | N11 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 3 | host_uart_tx | — | — | M10 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 4 | temp_scl | — | — | M8 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 5 | temp_sda | — | — | N9 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 6-13 | ptc_pwm_out[0:7] | CON18/27/28/29 | HEAT* | G16,F16,N1,M1,R16,P16,P9,T9 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | active-high |
+| 14-17 | fan_pwm_out[0:3] | CON25/8/24/26 | FAN_PWM* | B1,C4,B5,A14 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | FPGA active-low |
+| 18 | motor_en_n | CON120.2 | ENA → BANK0_GPIO2 | C11 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | FPGA 恒 1;板级 NPN 反相开集;座端有效电平仍待 bring-up |
+| 19 | x_step | CON104.2 | PUL1 → BANK0_GPIO15 | C12 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 20 | x_dir | CON104.3 | DIR1 → BANK0_GPIO16 | B12 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 21 | y_step | CON105.2 | PUL2 | L12 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 22 | y_dir | CON105.3 | DIR2 | J11 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 23 | z_step | CON106.2 | PUL3 | L14 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 24 | z_dir | CON106.3 | DIR3 | K14 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 25 | x_limit_ls (LS1) | CON12.1 | EX_GPIO1 → BANK0_LVDS2_P | A5 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | active-high;非 GND |
+| 26 | x_limit_hs (HS1) | CON12.2 | EX_GPIO2 → BANK0_LVDS2_N | B6 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | active-high;非 +12V |
+| 27 | y_limit_ls (LS2) | CON12.3 | EX_GPIO3 → BANK0_LVDS3_P | C8 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | 非 A11 |
+| 28 | y_limit_hs (HS2) | CON12.4 | EX_GPIO4 → BANK0_LVDS3_N | A8 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | 非 C11 |
+| 29 | z_limit_ls (LS3) | CON129.1 | EX_GPIO17 → CPLD_GPIO17 | K16 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
+| 30 | z_limit_hs (HS3) | CON129.2 | EX_GPIO18 → CPLD_GPIO18 | J15 | confirmed_by_brd | confirmed_by_electrical_staff | not_run | |
 
 活动 ADC:**30** 用户脚(上表 1–30;时钟计入约束文件)。无 solenoid。
 
 ## Inventory-only(不进活动控制)
 
-| 信号 | 连接器.针 | FPGA | 备注 |
-|------|-----------|------|------|
-| LS4 | CON129.3 | H15 | 不创建第四轴 |
-| HS4 | CON129.4 | H16 | 不创建第四轴 |
+| 信号 | 连接器.针 | FPGA | physical_path | product_polarity | hardware_measurement | 备注 |
+|------|-----------|------|---------------|------------------|----------------------|------|
+| LS4 | CON129.3 | H15 | confirmed_by_brd | not_applicable | not_run | 不启用第四轴 |
+| HS4 | CON129.4 | H16 | confirmed_by_brd | not_applicable | not_run | 不启用第四轴 |
 
 ## 已退役产品 LOC(勿写回活动 ADC)
 
-CON68.3/M6、CON34.3/F9、CON138–141 电机/电磁铁旧映射、CON12=dual-gpio-12v(A11/C11/GND/+12V) 错误注解、CON140 旧限位探针。
+CON68.3/M6、CON34.3/F9、CON138–141 电机/电磁铁旧映射、CON12=dual-gpio-12v(A11/C11/GND/+12V) 错误注解、CON140 旧限位探针、0611 时代 CON30 丝印限位。
 
 ## Hardware validation
 
-**NOT RUN**(本轮 Linux 收口不接触 COM/JTAG)。
+**NOT RUN**(`hardware_measurement = not_run`;本轮 Linux 收口不接触 COM/JTAG)。

File diff suppressed because it is too large
+ 116 - 29
docs/REFERENCE-INVENTORY.json


File diff suppressed because it is too large
+ 24 - 12
docs/REFERENCE-INVENTORY.md


File diff suppressed because it is too large
+ 43 - 58
docs/TD_USAGE.zh-CN.md


+ 54 - 0
docs/historical/ACCEPTANCE_MATRIX-2axis-solenoid-closure-da7b05a.md

@@ -0,0 +1,54 @@
+# Acceptance Matrix(活动真相)
+
+> Windows 2026-07-26 全绿矩阵叙述已归档:[`docs/historical/ACCEPTANCE_MATRIX-windows-20260726.md`](docs/historical/ACCEPTANCE_MATRIX-windows-20260726.md)。  
+> 下表为 **当前可声明** 状态;`pass` 仅当有绑定到所述 commit 的收据。
+
+## Frozen contract gates
+
+| Area | Contract evidence | Status |
+|---|---|---:|
+| Project configuration | `project.json`:4 FAN + 4 chamber PTC→8 PWM + intake/exhaust doors;UART/I2C/motor/watchdog/limits.startup | pass(源合同) |
+| Schema | 配置节闭合;count/list 漂移拒绝 | pass(源合同) |
+| Protocol model | CRC;duty 0..100;**SET_ALL 11 字节**;旧 14 字节拒绝;马达 `00=stop` / 电磁铁 `00=hold` | pass(源合同) |
+| Generator / ADC | 确定性产物;活动 ADC **25** 脚(含 `intake_solenoid_out`@P2);CON138–141 产品重映射 | pass(源合同) / solenoid **inferred** LOC |
+
+| Startup one-shot | 450 步/burst、1000 step/s、50 ms、最多 10 burst;`startup_done` 后 limit 惰性 | pass(源合同 + 既有 Icarus/formal 目标) |
+
+## Offline verification(收据绑定)
+
+| Area | Bound evidence | Status |
+|---|---|---:|
+| Python / contract | final matrix @ `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2` | pass |
+| Formal | final matrix @ `da7b05a…`(BMC vs prove 以各收据为准) | pass |
+| cocotb UART e2e | final matrix @ `da7b05a…` | **pass** |
+| Full matrix @ FINAL_COMMIT | `verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`(RUN_ID `grok45-final-20260805T013238Z`) | **pass**(含 cocotb) |
+| TD + bitstream | Linux `td2026` built @ **`8f28660f176e18e97a015e66bdae0ff747e0fc63`**;bit SHA-256 `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d`;绑定 FINAL_COMMIT(综合输入一致,tip 未强制重跑) | pass |
+| Package / replay | final closure 包已出具;`review-compact` @ tip `445814a…`(RUN_ID `packager-compact-20260805T042343Z`) | pass(closure + compact) |
+| Physical hardware | COM/JTAG/烧录未授权 | **`not_run`** |
+
+## Physical / board remaining uncertainties(不升格为 confirmed pass)
+
+- Intake solenoid:CON141.1/P2 **inferred** LOC;外部驱动/线圈极性未确认。
+- Exhaust X/Y STEP/DIR/EN 在 CON138–139 为 EX_GPIO 产品角色 **inferred**;X 限位 **CON68.3/M6**,Y 限位 **CON34.3/F9**。
+- 历史 A11 与 CON124 装配冲突记录保留;产品 y_limit 已迁至 CON34.3/F9。
+- 详见 [`docs/IO_EVIDENCE_MATRIX.zh-CN.md`](docs/IO_EVIDENCE_MATRIX.zh-CN.md)。
+
+## Frozen protocol numbers
+
+- Clock 25 MHz;UART 115200 8N1,217 clocks/bit;帧头 `A5 5A`;CRC-16/CCITT-FALSE LE。
+- Types:`0x01` / `0x02` / `0x82`。
+- SET_ALL:**11** 字节;Temperature:**27** 值 / 33 字节响应帧。
+- PWM:~19.993602047 Hz;boot PTC=0/FAN=10;watchdog 10 s → PTC=0/FAN=20。
+- Ordinary motor:450 steps @ 1000 step/s;X/Y 可重叠。
+
+## 3-axis closure (`3axis-20260805T171312Z`)
+
+| Lane | Status | Notes |
+|------|--------|-------|
+| python / board_viewer | pass | CON12 remap + detached validate |
+| icarus / verilator / cocotb | pass | 3-axis startup + runtime hard-stop |
+| formal | pass | BMC hard-stop/startup/dispatcher; prove motor-temp contract |
+| td2026 | pass | tip `bb515af…`; bitstream `45f548ab…` |
+| reference ZIP | pass | Linux; Windows handoff blocked |
+| Hardware validation | NOT RUN | COM/JTAG not authorized |
+

+ 49 - 0
docs/historical/FINAL_DELIVERY_REPORT-2axis-solenoid-closure-da7b05a.md

@@ -0,0 +1,49 @@
+# Prod2U 门控温度 CPLD — 活动交付状态报告
+
+> 本文件描述 **当前活动真相**(Linux / 11 字节 SET_ALL)。  
+> 2026-07-26 Windows 清理轮次的最终包叙述已归档:[`docs/historical/FINAL_DELIVERY_REPORT-windows-20260726.md`](docs/historical/FINAL_DELIVERY_REPORT-windows-20260726.md)。
+
+## 执行摘要
+
+- 产品合同已收敛为 **11 字节 SET_ALL**、进风默认电磁铁、出风 X/Y 步进;旧 14 字节格式拒绝。
+- 权威工具链为 **Linux**(`td2026` + OSS CAD / Python 验证)。Windows 收据与路径不是活动权威。
+- Final software closure tip:`da7b05a340a096ccfb4ccf4f656eb3efe6a957e2`(RUN_ID `grok45-final-20260805T013238Z`)。全矩阵(含 cocotb)**pass**;Hardware **`NOT RUN`**。
+- Packager integrate tip `445814a…`(RUN_ID `packager-compact-20260805T042343Z`)已合入 `dev`:仅打包/文档/测试工具链;不改写本报告中的产品 final commit / 矩阵 / TD / bitstream 真相。
+
+## 关键标识(活动)
+
+| 项目 | 值 |
+|---|---|
+| FINAL_COMMIT | `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2` |
+| 闭合 RUN_ID | `grok45-final-20260805T013238Z` |
+| SET_ALL payload | **11 字节** |
+| Full matrix(含 cocotb) | **pass**(`verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`) |
+| TD built commit | `8f28660f176e18e97a015e66bdae0ff747e0fc63` |
+| Bitstream SHA-256 | `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d` |
+| TD tip 重跑 | **否**(综合输入与 tip 一致;绑定既有位流) |
+| Hardware validation | **`NOT RUN`** |
+
+## 风门语义摘要
+
+- **马达(exhaust X/Y)`00` = stop**(无新 STEP jog)。
+- **电磁铁(intake)`00` = hold**(保持当前 latch;非“停止脉冲”语义)。
+- `01` = open;`02` = close。细节见协议文档。
+
+## 合法 blocked / not_run
+
+- `intake_solenoid_out`:CON141.1/P2 **inferred** LOC;外部驱动/线圈极性未确认。
+- X/Y STEP/DIR/EN:CON138–139 EX_GPIO 产品角色 **inferred**;X 限位 CON68.3/M6,Y 限位 CON34.3/F9。
+- 历史 A11 vs CON124 装配冲突记录保留;产品 y_limit 已迁至 CON34.3/F9。
+- COM / JTAG / 烧录未授权 → Hardware **`not_run`**。
+
+## 明确作废的活动声明
+
+以下内容**不得**再当作 tip / 活动 pass:
+
+- Windows 路径下的 “全矩阵 pass + cocotb pass”(`d99f354` / `4ddfbec` 时代叙述)。
+- SET_ALL **14 字节** 为当前合同。
+- 将过期 tip `f82c41e`、失败矩阵 `6f32493`、历史 TD `ead5a3e` / bitstream `a7b5c119…` 当作当前 final closure 证据。
+
+## 结论
+
+软件闭环已完成:FINAL_COMMIT `da7b05a…`,矩阵(含 cocotb)**pass**,TD 位流 `ce3157c5…` 已绑定。物理硬件为 **`NOT RUN`**;物理 blockers 仍开放。

+ 95 - 0
docs/historical/HARDWARE_TEST_ORDER_WAVEFORMS-2axis-solenoid-pre-3axis.zh-CN.md

@@ -0,0 +1,95 @@
+# Prod2U V1.2 硬件测试顺序与期望波形(简版)
+
+run_id: `con138-141-20260805T061504Z`  
+前提:比特流与 active ADC 含 confirmed PWM/UART/I2C 球 + CON138–141 **inferred** 电机/限位/电磁铁球(共 25);`intake_solenoid_out` **LOC @ P2**。  
+本文件 **不是** 已执行硬件回执;物理 COM/JTAG 未授权前状态为 `not_run`。
+
+引脚权威见 [`IO_EVIDENCE_MATRIX.zh-CN.md`](IO_EVIDENCE_MATRIX.zh-CN.md)。
+
+## 0. 安全与探点
+
+- 逻辑探点优先 FPGA 球侧 3.3 V(或串联 0R 后);风扇/PTC 座为 12 V 功率域。
+- FAN:FPGA 球 **active-low** PWM;座端经板级反相后给风扇。
+- PTC:FPGA 球 **active-high**。
+- 限位:期望 **active-high** 表示已到位(合同);用高阻探头,勿强驱。
+- X 限位探点:**CON68.3 / M6**(FAN_GPIO47;旧 CON140.1/T11、CON125.3/B9 已退役)。
+- Y 限位探点:**CON34.3 / F9**(FAN_GPIO11;旧 CON68.4/L8、CON140.2/P13、CON12.3/A11 已退役)。
+- X 电机:**CON139.1–3** → STEP/DIR/EN_n(R6/R8/T7)。
+- Y 电机:**CON138.1–2** → STEP/DIR(T3/R4)。
+- 进风电磁铁逻辑球:**CON141.1 / P2**(外部功率驱动自备)。
+
+## 1. 推荐测试顺序
+
+| 步 | 项目 | 操作摘要 | 通过判据(期望) |
+|---:|------|----------|------------------|
+| 1 | 上电静态 | 上电,不发 UART | PTC 球≈0;FAN 球对应默认 duty≈10%(~20 Hz);EN_n≈0(常使能低);STEP 无边沿 |
+| 2 | Startup 关门寻限位 | 观察 X/Y STEP + 限位 | 见 §2.1;`startup_done` 前主机帧应被丢弃(无 TEMP 响应) |
+| 3 | UART 冒烟 | startup 完成后发 GET_TEMPERATURE | 收到 `0x82` 27 字节温度载荷 + CRC |
+| 4 | FAN PWM | SET_ALL 单腔风扇 0/50/100 | §2.2;其余腔保持 |
+| 5 | PTC PWM | SET_ALL 单腔 PTC 0/50/100 | §2.3;同腔两路物理 PTC 波形一致 |
+| 6 | 出风门 jog | SET_ALL exhaust X/Y = 01 或 02 | §2.4;450 个 STEP 上升沿 @ 1000 step/s |
+| 7 | 运行期限位惰性 | startup 后拨动限位 | STEP 不被 limit 截断 |
+| 8 | 看门狗 | 停发 SET_ALL ≥10 s | PTC→0,FAN→20;马达停 |
+| 9 | 进风电磁铁 | SET_ALL intake = 01/02/00 | CON141.1/P2 电平随 open/close/hold;**外部驱动必接** |
+
+## 2. 期望波形
+
+时钟 25 MHz;时间按合同标称(允许晶振/分频误差)。
+
+### 2.1 Startup 关门寻限位
+
+- DIR = 1(关);EN_n = 0。
+- 每轴:最多 10 个 burst;每 burst ≤450 个 STEP **上升沿**;步进率 1000 step/s → 半周期 0.5 ms,周期 1 ms。
+- burst 间隔:STEP 保持低 **50 ms**,再开下一 burst。
+- 限位在 burst 内变高:该轴不再产生新的上升沿;若当前 STEP 为高,完成半周期后落下。
+- 限位上电已为高:该轴不运动。
+- X/Y 可重叠,独立停止。
+
+```text
+STEP  (axis seeking):  ‾|_|‾|_| … (≤450 rises) … |_  (50 ms low)  _|‾|_| …
+LIMIT (active-high):   ____________/‾‾‾‾‾‾  → stop further rises
+```
+
+### 2.2 FAN PWM(~20 Hz)
+
+- 相位计数 100;slot ≈1042 clk @25 MHz → f≈19.99 Hz,周期≈50.05 ms。
+- duty=D%:FPGA 球上 **低有效** 脉宽约占 D%(再经板级到座)。
+- duty=0:球侧接近常高(风扇停);duty=100:接近常低。
+
+### 2.3 PTC PWM(~20 Hz)
+
+- 同 ~20 Hz 时基;球侧 **高有效**。
+- 同腔两路(如 G16/F16)占空应一致。
+
+### 2.4 普通 jog(startup_done 后)
+
+- 步进马达:`01` DIR=0 开门;`02` DIR=1 关门;**`00` = stop**(无新 STEP 边沿 / 不启动新 jog)。
+- 进风电磁铁(若已接线):`01` open latch;`02` closed latch;**`00` = hold**(保持;非马达 stop 语义)。无 FPGA ball 时本步 **blocked / 跳过**。
+- 非零马达命令:固定 **450** 个 STEP 上升沿 @ 1000 step/s(约 450 ms 脉冲列)。
+- 运行期 LIMIT 翻转 **不应** 截断 STEP。
+
+```text
+DIR   ____/‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+STEP  ....|‾|_|‾|_| … 450 rising edges … |_
+EN_n  0(保持)
+```
+
+### 2.5 UART(115200 8N1)
+
+- bit 宽 = 217 clk @25 MHz ≈ 8.68 µs。
+- 帧:`A5 5A | type | length | payload | CRCL | CRCH`(CRC-16/CCITT-FALSE)。
+- GET_TEMPERATURE → `0x82`,payload 27;SET_ALL **无** 应答。
+
+## 3. 探点速查(V1.2)
+
+| 信号 | 球 | V1.2 优先探点 | 矩阵等级 |
+|------|----|---------------|----------|
+| UART2 | N11/M10 | CON78.2/1(RS-232 电平!逻辑域在 U23 FPGA 侧) | confirmed |
+| FAN1–4 | C4/B5/B1/A14 | CON8/24/25/26.7 或球侧 | confirmed |
+| PTC 腔1–4 | F16/G16… | CON18/27/28/29 功率针(危险)或 HEAT 控制侧 | confirmed |
+| X limit | M6 | **CON68.3** | inferred(FAN_GPIO47 tach 复用) |
+| Y limit | F9 | **CON34.3** | inferred(FAN_GPIO11 tach 复用) |
+| X STEP/DIR | R6/R8 | **CON139.1/2** | inferred |
+| Y STEP/DIR | T3/R4 | **CON138.1/2** | inferred |
+| EN_n | T7 | **CON139.3** | inferred |
+| 进风电磁铁 | P2 | **CON141.1** | inferred(外部驱动) |

+ 25 - 0
docs/historical/OPEN_QUESTIONS-2axis-solenoid-closure-da7b05a.md

@@ -0,0 +1,25 @@
+# Open Questions and Accepted Uncertainty
+
+No user product-contract decision currently blocks the **11-byte SET_ALL + solenoid intake** software path.
+
+## Accepted uncertainty / explicit status
+
+- **Hardware validation: `NOT RUN`** — COM/JTAG/programming not authorized; board response and real fan load behavior unverified.
+- **FINAL_COMMIT**: `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2` (closure RUN_ID `grok45-final-20260805T013238Z`).
+- **Verification matrix**: full matrix **pass** including cocotb (`verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`).
+- **TD**: built commit `8f28660f176e18e97a015e66bdae0ff747e0fc63`; bitstream SHA-256 `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d` bound to FINAL_COMMIT (identical synthesis inputs; tip rebuild not required).
+- PWM ~20 Hz is a protocol/debug target; it does not guarantee a specific fan mechanical speed or torque.
+- Packager integrate tip `445814a…` (`packager-compact-20260805T042343Z`) merged to `dev`; packaging-only — does not reopen the software/TD closure above.
+
+## Physical / evidence remaining uncertainties
+
+- `intake_solenoid_out` is **inferred-LOC’d** on **CON141.1 / P2** (EX_GPIO33). Connector→series-R→ball is board-data backed; external driver / coil polarity still **unconfirmed**.
+- Exhaust X/Y STEP/DIR/EN on CON138–CON139 are **inferred** EX_GPIO roles; X limit on **CON68.3 / M6**, Y limit on **CON34.3 / F9** (fan-header tach pin3 repurposed).
+- Historical **A11 vs CON124** WATER_COOL conflict remains a board-assembly note; product **y_limit** is CON34.3 / F9 (not A11).
+- Contract prose historically said CON30.3(丝印) for X limit; V1.2 product probe is now **CON68.3 / M6**.
+- CON34/CON68 pin2 (+12V fan rails) and pin1 (GND) must not carry limit signals.
+
+## Non-goals for docs lane
+
+- Do not treat archived Windows packages (`d99f354` / `4ddfbec`, `C:\Users\...`) as current pass evidence.
+- Do not revive superseded tip claims (`f82c41e`, matrix fail `6f32493`, TD `ead5a3e` / bitstream `a7b5c119…`) as final closure truth.

+ 21 - 0
docs/historical/PLAN-2axis-solenoid-closure-da7b05a.md

@@ -0,0 +1,21 @@
+# Prod2U active plan pointer
+
+- Final software closure RUN_ID: `grok45-final-20260805T013238Z`
+- FINAL_COMMIT: `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2`
+- Full matrix (incl. cocotb): **pass** (`verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`)
+- TD built commit: `8f28660f176e18e97a015e66bdae0ff747e0fc63`
+- Bitstream SHA-256: `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d`
+- Hardware validation: **`not_run`**
+- Physical blocked: intake solenoid ball/ADC; X/Y silk mapping; A11/CON124
+
+## Packager compact (does not reopen product closure evidence)
+
+- Packager integrate tip: `445814ad54467996cb4150651e80db3933cfd582` (RUN_ID `packager-compact-20260805T042343Z`; delivery tip = current `dev` HEAD after docs align)
+- Default upload profile: `review-compact` (no full git bundle; unified `source/` + `evidence/` + `meta/`)
+- Pre-closure docs plan archived: [`docs/historical/PLAN-grok45-final-pre-closure-20260805.md`](docs/historical/PLAN-grok45-final-pre-closure-20260805.md)
+
+## Authority
+
+- Linux `td2026` + OSS CAD / Python verification
+- Contract: `projects/prod2u-door-temp/project.json`, requirements, protocol, `AGENTS.md`
+- Active status docs: `README.zh-CN.md`, `ACCEPTANCE_MATRIX.md`, `FINAL_DELIVERY_REPORT.md`, `OPEN_QUESTIONS.md`

+ 62 - 0
docs/historical/README-2axis-solenoid-closure-da7b05a.zh-CN.md

@@ -0,0 +1,62 @@
+# Prod2U 门控温度 CPLD
+
+本仓库实现 `prod2u-door-temp` 门温控:25 MHz 主时钟、UART `115200 8N1`、无流控。统一帧为 `A5 5A type length payload CRC16_LE`。CRC-16/CCITT-FALSE 覆盖 type、length 与 payload,线路低字节在前。
+
+**权威执行环境:Linux 容器**(`td2026`、Python/Icarus/Verilator/formal/cocotb)。Windows 路径与旧收据仅作历史参考,见 [`docs/historical/`](docs/historical/)。
+
+## 正式帧类型
+
+| 类型 | 说明 |
+|---|---|
+| `0x01 SET_ALL` | **11 字节** payload:4 FAN + 4 chamber PTC(各复制到 2 路物理 PTC PWM)+ 进风门/出风门 X/出风门 Y;成功无回复。旧 14 字节 length `0x0E` 静默丢弃。 |
+| `0x02 GET_TEMPERATURE` | 空 payload;读完 27 项 CT7428 后只回一帧温度。 |
+| `0x82 TEMPERATURE_DATA` | 27 字节 payload,总帧长 33 字节。 |
+
+PTC/FAN 占空为十进制 0..100。PWM ≈20 Hz。PTC active-high;FAN 在 FPGA 输出为 active-low。启动目标 PTC=0、FAN=10;看门狗 10 s → PTC=0、FAN=20。
+
+### 风门字节语义(关键)
+
+| 字节 | 执行器 | `00` | `01` | `02` |
+|---|---|---|---|---|
+| 偏移 8 进风门 | 默认**电磁铁** | **保持(hold)** | open latched | closed latched |
+| 偏移 9/10 出风门 X/Y | **步进马达** | **停止(stop / 无新 jog)** | 开门 DIR=0 | 关门 DIR=1 |
+
+马达普通 jog:450 步 @ 1000 step/s;X/Y 可并行。详细合同见 [`docs/prod2u-door-temp-protocol.zh-CN.md`](docs/prod2u-door-temp-protocol.zh-CN.md) 与 `projects/prod2u-door-temp/project.json`。
+
+## 启动限位(one-shot)
+
+上电/`startup_done==0`:X/Y 向 close(DIR=1)间歇寻限位,最多 10 burst × 450 步 @ 1000 step/s,burst 间隔 50 ms;限位 active-high(X: CON68.3/M6,Y: CON34.3/F9;风扇座 pin3 tach 复用,见 IO 证据)。`startup_done` 前主机 UART 被丢弃;完成后限位对普通 jog **惰性**。
+
+## 当前基线与验证真相(final closure)
+
+| 项 | 值 |
+|---|---|
+| FINAL_COMMIT | `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2` |
+| 闭合 RUN_ID | `grok45-final-20260805T013238Z` |
+| 全矩阵(含 cocotb) | **pass**(`verification_run_id` `c43c4201f74517c50bd349fce87f9e0b`) |
+| TD built commit | `8f28660f176e18e97a015e66bdae0ff747e0fc63`(生产综合输入与 tip 一致,tip 未强制重跑 TD) |
+| Bitstream SHA-256 | `ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d` |
+| Hardware / JTAG / 烧录 | **`not_run`**(未授权) |
+| 物理 uncertainties | 进风电磁铁外部驱动/线圈极性;CON138–139 马达 EX_GPIO 角色 inferred;限位复用风扇座 pin3(X:CON68 / Y:CON34);历史 A11 vs CON124 |
+
+`packager-compact-20260805T042343Z` 已合入 `dev`(integrate tip `445814a…` + 活动文档对齐;review-compact 打包体系);生产综合输入相对 `da7b05a…` **未变**,**不**改写上表软件/TD/bitstream 闭合证据。
+
+陈旧 Windows 最终交付叙述(`d99f354` / `4ddfbec`、虚假 cocotb 全绿、`C:\Users\...` 包路径)及过期 tip 声明(`f82c41e` / `ead5a3e` / `a7b5c119…`)已移至 [`docs/historical/`](docs/historical/),**不是**当前活动真相。
+
+## 离线验证入口(Linux)
+
+```bash
+python -B tools/run_verification_matrix.py \
+  --work-root-prefix "${TMPDIR:-/tmp}/prod2u-matrix" \
+  --verification-run-id "<run_id>" \
+  --report-file "${TMPDIR:-/tmp}/prod2u-matrix/matrix-receipt.json"
+```
+
+TD:仅用 `td2026`(Anlogic TD 2026.1 SP2 Linux)。勿把 TD 的 `LD_LIBRARY_PATH` 导出到全局 shell。说明见 [`docs/TD_USAGE.zh-CN.md`](docs/TD_USAGE.zh-CN.md)。
+
+## 合同与工具
+
+- 合同:`projects/prod2u-door-temp/project.json`、`requirements.zh-CN.md`、协议文档、`AGENTS.md`
+- 源码审计包:`package_for_agent_analysis.py`
+- 固件包:`tools/build_firmware_package.py`(需绑定 `--td-root`)
+- IO / 硬件期望:[`docs/IO_EVIDENCE_MATRIX.zh-CN.md`](docs/IO_EVIDENCE_MATRIX.zh-CN.md)、[`docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md`](docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md)

+ 13 - 6
docs/historical/README.md

@@ -1,14 +1,17 @@
 # Historical documents (not active authority)
 
-Files here preserve prior Windows-era or superseded claims for provenance.
+Files here preserve prior Windows-era, **2-axis/solenoid**, or otherwise superseded claims for provenance.
 They are **not** the active product contract.
 
-Active authority:
+Active authority (root / contract — **current 3-axis truth**):
 - `projects/prod2u-door-temp/project.json`
 - `projects/prod2u-door-temp/requirements.zh-CN.md`
 - `docs/prod2u-door-temp-protocol.zh-CN.md`
 - `AGENTS.md`
 - Root active docs: `README.zh-CN.md`, `ACCEPTANCE_MATRIX.md`, `FINAL_DELIVERY_REPORT.md`, `PLAN.md`, `OPEN_QUESTIONS.md`
+- Active hardware order: `docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md`(CON104/105/106/120/12/129)
+
+Root activity docs are **not** the old solenoid/2-axis truth; that narrative lives only in this folder.
 
 Known superseded claims archived here:
 - Windows primary toolchain paths (`C:\Users\...`)
@@ -16,10 +19,14 @@ Known superseded claims archived here:
 - Final commits `d99f354` / package commit `4ddfbec` as tip truth
 - Cocotb / full matrix reported as pass on those Windows cleanup commits
 - Pre-final tip claims: `f82c41e`, matrix fail `6f32493`, TD `ead5a3e` / bitstream `a7b5c119…`
+- **2-axis + intake solenoid “final closure”**: `da7b05a` / TD `8f28660` / bitstream `ce3157c5…`(见 `*-2axis-solenoid-closure-da7b05a*`)
+- Obsolete probes as active IO: solenoid, CON68, CON34, CON138–141;runtime limit inert;`00=hold`
+- Pre-3-axis hardware order: `HARDWARE_TEST_ORDER_WAVEFORMS-2axis-solenoid-pre-3axis.zh-CN.md`
 - Root runtime residue probes (e.g. `evidence-batch-summary-linux-continue-20260804T155114Z.txt`)
 - Pre-closure plan: `PLAN-grok45-final-pre-closure-20260805.md`
 
-Current final closure truth (see active root docs):
-- FINAL_COMMIT `da7b05a340a096ccfb4ccf4f656eb3efe6a957e2`
-- RUN_ID `grok45-final-20260805T013238Z`
-- Matrix pass (incl. cocotb); TD built `8f28660…`; bitstream `ce3157c5…`; hardware `not_run`
+Current activity truth (see **root** docs, not this folder):
+- Three-axis X/Y/Z, six limits, 450/5000/500, EN `permanent_high`, hard truncate
+- FINAL_COMMIT / tip TD / bitstream: see root `FINAL_DELIVERY_REPORT.md` (bound; not pending)
+- Historical bypass bit `45f548ab…` @ `bb515af` is **not** tip
+- Hardware `not_run`

+ 4 - 3
docs/prod2u-door-temp-protocol.zh-CN.md

@@ -43,14 +43,15 @@ busy 期间新的门命令全部忽略(无 latest-wins)。看门狗超时:
 | LS3/HS3 | CON129.1/2 | K16/J15 |
 | LS4/HS4 | CON129.3/4 | H15/H16(仅 inventory) |
 
-限位高有效。运行期与 startup 均硬停:DIR=1 看 LS,DIR=0 看 HS。
+限位高有效。运行期与 startup 均硬停:DIR=1 看 LS,DIR=0 看 HS。  
+`stop_semantics`:`truncate_current_high_pulse_immediately_after_synchronized_limit`(同步限位后立即截断当前 STEP 高脉冲,不再产生新上升沿)。
 
 ## Startup(上电一拍)
 
 1. 六路限位 2FF 同步后:已在 LS 的轴不运动。
-2. 其余轴 DIR=1 关向搜索,最多 **5000** 个 STEP 上升沿;命中 LS 的轴立即停。
+2. 其余轴 DIR=1 关向搜索,最多 **5000** 个 STEP 上升沿;命中 LS 的轴按截断语义立即停。
 3. 仅对仍未命中 LS 的轴做 DIR=0 回退最多 **500** 步(途中 HS 可提前停)。
-4. `startup_done` 粘性置位后才接受主机命令;限位不再用于标定/位置模型。
+4. `startup_done` 粘性置位后才接受主机命令;运行期仍按方向选择限位硬截断(非惰性)。
 
 普通命令 jog = **450** 步 @ 1000 step/s。无电磁铁、无 motor-compat 双 profile。
 

+ 74 - 1
package_for_agent_analysis.py

@@ -940,6 +940,10 @@ def collect_analysis_inputs(
     package_name: str = "pending",
     evidence_root: Path | None = None,
     include_process_evidence: bool = False,
+    bitstream_path: Path | None = None,
+    td_report_paths: list[Path] | None = None,
+    binding_commit: str | None = None,
+    require_bitstream_binding: bool = False,
 ) -> AnalysisCollection:
     root = repo_root.resolve(strict=True)
     temp_root.mkdir(parents=True, exist_ok=True)
@@ -1101,7 +1105,14 @@ def collect_analysis_inputs(
             meta_prefix="meta/git",
             temp_root=temp_root / "sanitized-git",
         )
-        binding = handoff.build_td_source_closure_binding_hook(root)
+        binding = handoff.build_td_source_closure_binding(
+            root,
+            bitstream_path=bitstream_path,
+            td_report_paths=td_report_paths,
+            evidence_root=evidence_root,
+            commit=binding_commit,
+            require_bitstream=require_bitstream_binding,
+        )
         provenance_artifacts["meta/td-source-closure-binding.json"] = handoff.json_bytes(binding)
         purpose = handoff.package_purpose_text(profile, package_name=package_name)
         provenance_artifacts["meta/PACKAGE-PURPOSE.txt"] = purpose.encode("utf-8")
@@ -2878,11 +2889,28 @@ def _create_reference_package_with_cache(
     max_zip_bytes: int,
     target_zip_bytes: int,
     force: bool,
+    repo_root: Path | None = None,
+    refresh_reference_inventory: bool = False,
 ) -> dict[str, object]:
     reference_package_name = f"{package_name}-reference"
     reference_dir = output_root / reference_package_name
     fingerprint_path = reference_dir / "REFERENCE-FINGERPRINT"
 
+    inventory_hook: dict[str, object] | None = None
+    if refresh_reference_inventory and repo_root is not None:
+        # Order: staging of reference sources is complete before this call; refresh
+        # inventory now so the package includes a fresh REFERENCE-INVENTORY.
+        inventory_hook = handoff.run_post_staging_reference_inventory_hook(
+            repo_root,
+            staging_complete=True,
+            enabled=True,
+        )
+        if inventory_hook.get("status") not in {"pass", "skipped_disabled"}:
+            raise PackagingError(
+                "post-staging reference inventory refresh failed: "
+                f"{inventory_hook.get('status')}"
+            )
+
     inventory = _audit_package_items(collection.items)
     fingerprint = _reference_fingerprint(inventory)
 
@@ -2902,6 +2930,7 @@ def _create_reference_package_with_cache(
                     "included_bytes": sum(int(item["size"]) for item in inventory),
                     "fingerprint": fingerprint,
                     "skipped": True,
+                    "reference_inventory_hook": inventory_hook,
                 }
 
     payload = create_analysis_package(
@@ -2917,6 +2946,7 @@ def _create_reference_package_with_cache(
     fingerprint_path.write_text(fingerprint + "\n", encoding="ascii")
     payload["fingerprint"] = fingerprint
     payload["skipped"] = False
+    payload["reference_inventory_hook"] = inventory_hook
     return payload
 
 
@@ -3099,6 +3129,39 @@ def build_parser() -> argparse.ArgumentParser:
         type=Path,
         help="extract target for --replay-package (must not already exist)",
     )
+    parser.add_argument(
+        "--bitstream",
+        type=Path,
+        help=(
+            "optional real bitstream to bind into meta/td-source-closure-binding.json "
+            "(full SHA-256; integrator supplies tip bit later)"
+        ),
+    )
+    parser.add_argument(
+        "--td-report",
+        type=Path,
+        action="append",
+        default=[],
+        dest="td_reports",
+        help="optional TD report/receipt to bind (repeatable)",
+    )
+    parser.add_argument(
+        "--binding-commit",
+        help="optional full 40-char commit override for TD source-closure binding",
+    )
+    parser.add_argument(
+        "--require-bitstream-binding",
+        action="store_true",
+        help="fail binding (status=bind_failed) when no bitstream is available",
+    )
+    parser.add_argument(
+        "--refresh-reference-inventory-after-staging",
+        action="store_true",
+        help=(
+            "for full-profile reference volume: refresh docs/REFERENCE-INVENTORY "
+            "after staging completes (Lane D order hook; Lane E owns generator honesty)"
+        ),
+    )
     return parser
 
 
@@ -3152,6 +3215,14 @@ def main(argv: list[str] | None = None) -> int:
                     if args.evidence_root is not None
                     else None,
                     include_process_evidence=args.include_process_evidence,
+                    bitstream_path=args.bitstream.expanduser().resolve(strict=True)
+                    if args.bitstream is not None
+                    else None,
+                    td_report_paths=[
+                        path.expanduser().resolve(strict=True) for path in args.td_reports
+                    ],
+                    binding_commit=args.binding_commit,
+                    require_bitstream_binding=args.require_bitstream_binding,
                 )
                 preparation = prepare_unsupported_archives(
                     collection.items,
@@ -3201,6 +3272,8 @@ def main(argv: list[str] | None = None) -> int:
                             max_zip_bytes=config.max_zip_bytes,
                             target_zip_bytes=config.target_zip_bytes,
                             force=args.force_overwrite,
+                            repo_root=source_root,
+                            refresh_reference_inventory=args.refresh_reference_inventory_after_staging,
                         )
     except (PackagingError, OSError, ValueError) as exc:
         print(f"error: {exc}", file=sys.stderr)

+ 1 - 1
projects/prod2u-door-temp/project.json

@@ -107,7 +107,7 @@
       "step_rate_hz": 1000,
       "axis_order": ["x", "y", "z"],
       "limit_stop_during_move": true,
-      "stop_semantics": "finish_current_high_pulse_then_no_next_rising_edge",
+      "stop_semantics": "truncate_current_high_pulse_immediately_after_synchronized_limit",
       "additional_rising_edges_after_synchronized_limit": 0,
       "runtime_limit_use": true
     },

+ 1 - 1
projects/prod2u-door-temp/requirements.zh-CN.md

@@ -48,7 +48,7 @@ CRC 为 CRC-16/CCITT-FALSE。正式类型只有 `0x01`、`0x02` 和 `0x82`。
 | Z | CON129.1 K16 | CON129.2 J15 |
 
 - **Startup**:PTC=0、FAN=10;三轴 DIR=1 关门寻限;每轴最多 5000 步 @ 1000 step/s;未触发则回退 500 步后标记 missed;`startup_done` 粘滞。
-- **运行期**:按运动方向选择对应限位;限位有效时该轴硬停(完成当前高半周期后不再产生上升沿);busy 期间忽略新 start。
+- **运行期**:按运动方向选择对应限位;限位有效时该轴硬停(同步限位后立即截断当前 STEP 高脉冲,`stop_semantics=truncate_current_high_pulse_immediately_after_synchronized_limit`);busy 期间忽略新 start。
 - Startup 完成前:SET_ALL / GET_TEMPERATURE 丢弃,看门狗不喂,帧解析器保持 flush。
 
 ## 输出与看门狗

+ 17 - 0
receipts/board-data-con12-rebuild-integrate.json

@@ -0,0 +1,17 @@
+{
+  "schema": "prod2u-board-data-rebuild-receipt-v1",
+  "run_id": "20260806T022709Z",
+  "note": "board-data reannotated from cached KiCad PCB /tmp/brd-con12-KN48/board.kicad_pcb with current Lane E annotations/inventory; SVGs retained (geometry unchanged)",
+  "pcb_cache": "/tmp/brd-con12-KN48/board.kicad_pcb",
+  "annotations_sha256": "208086dfc211e696b99b656cc54cc3981bc717dcba03eb5f1664c6cabbbde5a4",
+  "board_data_sha256": "b6aa980426a2f6472de2a68bf1fa43518973d79aa7b6c23a2d83cf67ac1d6aab",
+  "brd_sha256": "269b5bab2f2e1215b9392079a003badc34238ae3cbe8e5094c9a11bba8b84ebb",
+  "con12_balls": {
+    "1": "A5",
+    "2": "B6",
+    "3": "C8",
+    "4": "A8"
+  },
+  "svg_regenerated": false,
+  "kicad_cli_full_generate": "not_run_used_cached_pcb_reannotate"
+}

+ 36 - 0
receipts/prod2u_lane_c_formal_20260806T022109Z.json

@@ -0,0 +1,36 @@
+{
+  "schema": "prod2u-lane-c-formal-pointer-receipt-v1",
+  "status": "pass",
+  "lane": "closure/lane-c-formal-sim",
+  "base_commit": "67b41e88cef9f612145f135d601ff2729d48834e",
+  "run_id": "lane-c-formal-20260806T021920Z",
+  "stop_semantics_encoded": "truncate_current_high_pulse_immediately_after_synchronized_limit",
+  "mode_honesty": "BMC depth 48 + cover; not unbounded prove",
+  "targets": {
+    "runtime_limit_hard_stop": {
+      "tasks": [
+        "bmc",
+        "cover"
+      ],
+      "status": "pass",
+      "engine": "smtbmc z3",
+      "assertion_count": 24,
+      "cover_hits": 5
+    },
+    "startup_close_seek": {
+      "tasks": [
+        "bmc",
+        "cover"
+      ],
+      "status": "pass",
+      "engine": "smtbmc z3",
+      "assertion_count": 19,
+      "cover_hits": 5
+    }
+  },
+  "full_receipt": "/root/.local/state/prod2u/runs/lane-c-formal-20260806T021920Z/builds/formal-aecfa202/formal-receipt.json",
+  "full_receipt_sha256": "fa65f0e4e6d8918439f4191f7752e46beb9bab2b56aa59d42dd22ad17d876b48",
+  "matrix_report": "/root/.local/state/prod2u/runs/lane-c-formal-20260806T021920Z/receipts/verification-matrix.json",
+  "matrix_report_sha256": "6da082141d6f6577904506f95fe1124e805a329651ec343c0e1c3e78833f1cab",
+  "commit": "67b41e88cef9f612145f135d601ff2729d48834e"
+}

+ 21 - 0
receipts/prod2u_lane_c_icarus_20260806T022109Z.json

@@ -0,0 +1,21 @@
+{
+  "schema": "prod2u-lane-c-icarus-pointer-receipt-v1",
+  "status": "pass",
+  "lane": "closure/lane-c-formal-sim",
+  "base_commit": "67b41e88cef9f612145f135d601ff2729d48834e",
+  "run_id": "lane-c-icarus-20260806T021915Z",
+  "stop_semantics_encoded": "truncate_current_high_pulse_immediately_after_synchronized_limit",
+  "focused_benches": [
+    "door_motor_engine_stop_tb",
+    "prod2u_p4_normal_v3_top_runtime_limit_tb",
+    "startup_close_seek_tb",
+    "startup_motor_stop_tb",
+    "prod2u_p4_normal_v3_top_startup_tb"
+  ],
+  "full_lane_tests": 22,
+  "full_receipt": "/root/.local/state/prod2u/runs/lane-c-icarus-20260806T021915Z/builds/icarus-aecca202/icarus-receipt.json",
+  "full_receipt_sha256": "163bbe12fceb019ede003cb656c80dab6a068145a02e34e6a073b5a869bbd62b",
+  "matrix_report": "/root/.local/state/prod2u/runs/lane-c-icarus-20260806T021915Z/receipts/verification-matrix.json",
+  "matrix_report_sha256": "55fbda191e1be44f23e7a5a08f269292c7af5f609465c68e633be83cdd04a637",
+  "commit": "67b41e88cef9f612145f135d601ff2729d48834e"
+}

+ 56 - 0
schemas/board_viewer_annotations.schema.json

@@ -8,6 +8,8 @@
   "properties": {
     "schema": {"const": "board-viewer-annotations-v1"},
     "board_id": {"type": "string", "minLength": 1},
+    "io_evidence_policy": {"$ref": "#/$defs/ioEvidencePolicy"},
+    "historical_note": {"type": "string", "minLength": 1},
     "connector_profiles": {
       "type": "object",
       "additionalProperties": {"$ref": "#/$defs/connectorProfile"}
@@ -39,6 +41,59 @@
     "evidenceTier": {
       "enum": ["board_database", "cross_verified", "name_inferred", "unknown"]
     },
+    "ioEvidenceGradePhysical": {
+      "enum": ["confirmed_by_brd", "inferred", "blocked", "not_applicable", "unknown"]
+    },
+    "ioEvidenceGradePolarity": {
+      "enum": [
+        "confirmed_by_electrical_staff",
+        "inferred",
+        "blocked",
+        "not_applicable",
+        "unknown"
+      ]
+    },
+    "ioEvidenceGradeMeasurement": {
+      "enum": ["not_run", "pass", "fail", "blocked", "not_applicable", "unknown"]
+    },
+    "ioEvidenceGrades": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": ["physical_path", "product_polarity", "hardware_measurement"],
+      "properties": {
+        "physical_path": {"$ref": "#/$defs/ioEvidenceGradePhysical"},
+        "product_polarity": {"$ref": "#/$defs/ioEvidenceGradePolarity"},
+        "hardware_measurement": {"$ref": "#/$defs/ioEvidenceGradeMeasurement"}
+      }
+    },
+    "ioEvidencePolicy": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": [
+        "authoritative_order",
+        "physical_path",
+        "product_polarity",
+        "hardware_measurement",
+        "matrix_doc"
+      ],
+      "properties": {
+        "authoritative_order": {
+          "type": "array",
+          "minItems": 3,
+          "items": {"type": "string", "minLength": 1}
+        },
+        "physical_path": {"type": "string", "minLength": 1},
+        "product_polarity": {"type": "string", "minLength": 1},
+        "hardware_measurement": {"type": "string", "minLength": 1},
+        "matrix_doc": {"type": "string", "minLength": 1},
+        "historical_schematic_side_evidence": {"type": "string", "minLength": 1},
+        "v1_2_schematic_pdf": {"type": "string", "minLength": 1},
+        "must_not_override_connectors": {
+          "type": "array",
+          "items": {"type": "string", "minLength": 1}
+        }
+      }
+    },
     "touchpointAnnotation": {
       "type": "object",
       "additionalProperties": false,
@@ -112,6 +167,7 @@
         "adc_pulltype": {"type": ["string", "null"], "pattern": "^[A-Z][A-Z0-9_]*$"},
         "active_level": {"type": "string", "minLength": 1},
         "polarity": {"type": "string", "minLength": 1},
+        "evidence_grades": {"$ref": "#/$defs/ioEvidenceGrades"},
         "external_components": {
           "type": "array",
           "items": {"type": "string", "minLength": 1}

+ 23 - 0
schemas/board_viewer_data.schema.json

@@ -94,6 +94,28 @@
       }
     },
     "evidenceTier": {"enum": ["board_database", "cross_verified", "name_inferred", "unknown"]},
+    "ioEvidenceGrades": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": ["physical_path", "product_polarity", "hardware_measurement"],
+      "properties": {
+        "physical_path": {
+          "enum": ["confirmed_by_brd", "inferred", "blocked", "not_applicable", "unknown"]
+        },
+        "product_polarity": {
+          "enum": [
+            "confirmed_by_electrical_staff",
+            "inferred",
+            "blocked",
+            "not_applicable",
+            "unknown"
+          ]
+        },
+        "hardware_measurement": {
+          "enum": ["not_run", "pass", "fail", "blocked", "not_applicable", "unknown"]
+        }
+      }
+    },
     "fpga": {
       "type": "object",
       "additionalProperties": false,
@@ -165,6 +187,7 @@
         "path": {"type": "array", "items": {"type": "string"}},
         "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
         "evidence_sources": {"type": "array", "items": {"type": "string"}},
+        "evidence_grades": {"$ref": "#/$defs/ioEvidenceGrades"},
         "fpga": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/fpga"}]},
         "mcu": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/mcu"}]},
         "programming": {"$ref": "#/$defs/programming"},

+ 5 - 1
schemas/project.schema.json

@@ -445,7 +445,11 @@
                                                                                                                            "type":  "boolean"
                                                                                                                        },
                                                                                             "stop_semantics":  {
-                                                                                                                 "type":  "string"
+                                                                                                                 "type":  "string",
+                                                                                                                 "enum":  [
+                                                                                                                              "truncate_current_high_pulse_immediately_after_synchronized_limit"
+                                                                                                                          ],
+                                                                                                                 "description":  "After synchronized direction-selected limit, truncate the current STEP high pulse immediately; no further rising edges."
                                                                                                              },
                                                                                             "additional_rising_edges_after_synchronized_limit":  {
                                                                                                                                                     "type":  "integer"

+ 1 - 1
src/generated/host-contract.json

@@ -104,7 +104,7 @@
       "limit_stop_during_move": true,
       "runtime_limit_use": true,
       "step_rate_hz": 1000,
-      "stop_semantics": "finish_current_high_pulse_then_no_next_rising_edge"
+      "stop_semantics": "truncate_current_high_pulse_immediately_after_synchronized_limit"
     }
   },
   "motors": {

+ 2 - 1
src/modules/door_action_dispatcher.v

@@ -1,7 +1,8 @@
 `timescale 1ns/1ps
 
 // Multi-axis jog dispatcher. DIR=0 open/up, DIR=1 close/down.
-// Commands: 00 stop, 01 DIR0, 02 DIR1. SET_ALL byte8->Z, byte9->X, byte10->Y.
+// Commands: 00 = no new action (does not emergency-stop a running motor),
+// 01 DIR0 open, 02 DIR1 close. SET_ALL byte8->Z, byte9->X, byte10->Y.
 // Bit packing: bit0=X, bit1=Y, bit2=Z. New door commands are ignored while busy.
 module door_action_dispatcher #(
     parameter integer OPEN_DIR = 0,

+ 1 - 4
src/modules/startup_close_seek.v

@@ -3,6 +3,7 @@
 // Power-on / reconfig close-seek one-shot: close-search toward LS (DIR=1) up to
 // CLOSE_STEPS rising edges, latch found_ls, then optional backoff (DIR=0) up to
 // BACKOFF_STEPS for axes that never saw LS. startup_done is sticky after success.
+// Step pacing uses door_motor_engine tick_500us; this FSM has no local tick port.
 module startup_close_seek #(
     parameter integer CLOSE_STEPS = 5000,
     parameter integer BACKOFF_STEPS = 500,
@@ -16,7 +17,6 @@ module startup_close_seek #(
 ) (
     input  wire       clk,
     input  wire       rst_n,
-    input  wire       tick_500us,
     input  wire       limit_sync_valid,
     input  wire [AXIS_COUNT-1:0] limit_ls_sync,
     input  wire [AXIS_COUNT-1:0] limit_hs_sync,
@@ -40,7 +40,6 @@ module startup_close_seek #(
     localparam [2:0] ST_DONE        = 3'd7;
 
     reg [2:0] state;
-    reg [AXIS_COUNT-1:0] initial_reached;
     reg [AXIS_COUNT-1:0] found_ls;
     reg [AXIS_COUNT-1:0] close_participants;
     wire [AXIS_COUNT-1:0] missed_ls_mask = close_participants & ~found_ls;
@@ -58,7 +57,6 @@ module startup_close_seek #(
             motor_active_mask <= AXIS_ZERO;
             motor_dir_mask <= AXIS_ZERO;
             motor_step_count <= {STEP_COUNT_WIDTH{1'b0}};
-            initial_reached <= AXIS_ZERO;
             found_ls <= AXIS_ZERO;
             close_participants <= AXIS_ZERO;
         end else begin
@@ -73,7 +71,6 @@ module startup_close_seek #(
                 end
                 ST_CHECK: begin
                     motor_start <= 1'b0;
-                    initial_reached <= limit_ls_sync & AXIS_ENABLE_MASK;
                     found_ls <= limit_ls_sync & AXIS_ENABLE_MASK;
                     close_participants <= (~limit_ls_sync) & AXIS_ENABLE_MASK;
                     if ((~limit_ls_sync & AXIS_ENABLE_MASK) == AXIS_ZERO) begin

+ 8 - 8
src/project/command_controller.v

@@ -7,7 +7,7 @@ module command_controller #(
     parameter integer SET_ALL_PAYLOAD_LENGTH = 11,
     parameter integer FAN_OFFSET = 0,
     parameter integer CHAMBER_PTC_OFFSET = 4,
-    parameter integer INTAKE_DOOR_OFFSET = 8,
+    parameter integer Z_DOOR_OFFSET = 8,
     parameter integer EXHAUST_X_OFFSET = 9,
     parameter integer EXHAUST_Y_OFFSET = 10
 ) (
@@ -24,7 +24,7 @@ module command_controller #(
     output reg  [3:0] target_wr_addr,
     output reg  [7:0] target_wr_data,
     output reg        valid_set_all_commit,
-    output reg  [1:0] intake_door_cmd,
+    output reg  [1:0] z_door_cmd,
     output reg  [1:0] exhaust_x_cmd,
     output reg  [1:0] exhaust_y_cmd,
     output reg        door_action_valid,
@@ -37,7 +37,7 @@ module command_controller #(
     localparam [3:0] ST_IDLE = 4'd0;
     localparam [3:0] ST_VALIDATE_FAN = 4'd1;
     localparam [3:0] ST_VALIDATE_PTC = 4'd2;
-    localparam [3:0] ST_VALIDATE_INTAKE = 4'd3;
+    localparam [3:0] ST_VALIDATE_Z = 4'd3;
     localparam [3:0] ST_VALIDATE_X = 4'd4;
     localparam [3:0] ST_VALIDATE_Y = 4'd5;
     localparam [3:0] ST_WRITE_FAN = 4'd6;
@@ -62,7 +62,7 @@ module command_controller #(
         case (state)
             ST_VALIDATE_FAN: payload_read_addr = FAN_OFFSET + validate_index;
             ST_VALIDATE_PTC: payload_read_addr = CHAMBER_PTC_OFFSET + validate_index;
-            ST_VALIDATE_INTAKE: payload_read_addr = INTAKE_DOOR_OFFSET;
+            ST_VALIDATE_Z: payload_read_addr = Z_DOOR_OFFSET;
             ST_VALIDATE_X: payload_read_addr = EXHAUST_X_OFFSET;
             ST_VALIDATE_Y: payload_read_addr = EXHAUST_Y_OFFSET;
             ST_WRITE_FAN: payload_read_addr = FAN_OFFSET + write_index;
@@ -77,7 +77,7 @@ module command_controller #(
             validate_index <= 3'd0;
             write_index <= 3'd0;
             ptc_write_phase <= 2'd0;
-            intake_door_cmd <= 2'd0;
+            z_door_cmd <= 2'd0;
             exhaust_x_cmd <= 2'd0;
             exhaust_y_cmd <= 2'd0;
             valid_set_all_commit <= 1'b0;
@@ -126,17 +126,17 @@ module command_controller #(
                     end else begin
                         ptc_values[validate_index] <= payload_read_data;
                         if (validate_index == CHAMBER_PTC_COUNT - 1) begin
-                            state <= ST_VALIDATE_INTAKE;
+                            state <= ST_VALIDATE_Z;
                         end else begin
                             validate_index <= validate_index + 1'b1;
                         end
                     end
                 end
-                ST_VALIDATE_INTAKE: begin
+                ST_VALIDATE_Z: begin
                     if (payload_read_data > 8'd2) begin
                         state <= ST_DRAIN;
                     end else begin
-                        intake_door_cmd <= payload_read_data[1:0];
+                        z_door_cmd <= payload_read_data[1:0];
                         state <= ST_VALIDATE_X;
                     end
                 end

+ 2 - 2
src/project/project_adapter.v

@@ -50,7 +50,7 @@ module project_adapter #(
         .SET_ALL_PAYLOAD_LENGTH(SET_ALL_PAYLOAD_LENGTH),
         .FAN_OFFSET(FAN_OFFSET),
         .CHAMBER_PTC_OFFSET(CHAMBER_PTC_OFFSET),
-        .INTAKE_DOOR_OFFSET(Z_DOOR_OFFSET),
+        .Z_DOOR_OFFSET(Z_DOOR_OFFSET),
         .EXHAUST_X_OFFSET(EXHAUST_X_OFFSET),
         .EXHAUST_Y_OFFSET(EXHAUST_Y_OFFSET)
     ) controller (
@@ -62,7 +62,7 @@ module project_adapter #(
         .target_wr_en(target_wr_en), .target_wr_addr(target_wr_addr),
         .target_wr_data(target_wr_data),
         .valid_set_all_commit(valid_set_all_commit),
-        .intake_door_cmd(z_door_cmd),
+        .z_door_cmd(z_door_cmd),
         .exhaust_x_cmd(exhaust_x_cmd),
         .exhaust_y_cmd(exhaust_y_cmd),
         .door_action_valid(door_action_valid),

+ 1 - 1
src/top/prod2u_p4_normal_v3_top.v

@@ -275,7 +275,7 @@ module prod2u_p4_normal_v3_top (
         .STEP_COUNT_WIDTH(MOTOR_STEP_WIDTH),
         .CLOSE_DIR_MASK(`P4_STARTUP_DIR_MASK)
     ) u_startup_close_seek (
-        .clk(sys_clk), .rst_n(sys_rst_n), .tick_500us(tick_500us),
+        .clk(sys_clk), .rst_n(sys_rst_n),
         .limit_sync_valid(limit_sync_valid),
         .limit_ls_sync(limit_ls_sync),
         .limit_hs_sync(limit_hs_sync),

+ 3 - 3
tests/board_viewer/fixtures/candidate_count_expectation.json

@@ -3,10 +3,10 @@
   "description": "Curated fail-closed candidate counts bound to generated board-data/build-info digests. Do not relax cross_verified/power/ground/reserved/fixed-load blockers to match counts.",
   "bound_to": {
     "board_data_path": "tools/board-viewer/generated/board-data.json",
-    "board_data_sha256": "70a779a0978b84392ea5a39715e5f0d46f1ecee896b26938fee40959b96ce7f2",
+    "board_data_sha256": "b6aa980426a2f6472de2a68bf1fa43518973d79aa7b6c23a2d83cf67ac1d6aab",
     "build_info_path": "tools/board-viewer/generated/build-info.json",
-    "build_info_sha256": "97bea8dfb1c2c2e471622d1abb445e6c0312a44c7a32f97328bbcb276316e130",
-    "board_data_asset_sha256": "70a779a0978b84392ea5a39715e5f0d46f1ecee896b26938fee40959b96ce7f2",
+    "build_info_sha256": "1f44326d978db54b8887b806938aebabf1f9bc84545d83db8e4e2d74e97eaa9f",
+    "board_data_asset_sha256": "b6aa980426a2f6472de2a68bf1fa43518973d79aa7b6c23a2d83cf67ac1d6aab",
     "brd_sha256": "269b5bab2f2e1215b9392079a003badc34238ae3cbe8e5094c9a11bba8b84ebb"
   },
   "candidate_counts": {

+ 13 - 12
tests/fixtures/package_adversarial/manifest.json

@@ -1,18 +1,19 @@
 {
   "schema": "prod2u-package-adversarial-fixtures-v1",
   "lane": "P6",
-  "description": "Attacker trees for review-compact fail-closed packaging. Payloads are synthetic markers, not real IP.",
+  "description": "Attacker tree vectors for review-compact fail-closed packaging. Payloads are generated in a temp directory by tests; they are not kept long-term under payloads/ and must not ship in compact.",
+  "payload_policy": "generate_in_temp_dir",
   "vectors": [
-    {"id": "pdf-schematic", "path": "payloads/sneaky-schematic.pdf", "expect": "exclude_or_fail_closed"},
-    {"id": "brd-board", "path": "payloads/sneaky-main.brd", "expect": "exclude_or_fail_closed"},
-    {"id": "dsn-orcad", "path": "payloads/sneaky.dsn", "expect": "exclude_or_fail_closed"},
-    {"id": "vendor-installer", "path": "payloads/td_release_2026.1_fake.zip", "expect": "exclude_or_fail_closed"},
-    {"id": "license-archive", "path": "payloads/vendor-license.zip", "expect": "exclude_or_fail_closed"},
-    {"id": "license-file", "path": "payloads/Anlogic.lic", "expect": "exclude_or_fail_closed"},
-    {"id": "private-key", "path": "payloads/id_ed25519", "expect": "exclude_or_fail_closed"},
-    {"id": "dotenv", "path": "payloads/dotenv.env", "expect": "exclude_or_fail_closed"},
-    {"id": "path-traversal-zip", "path": "payloads/traversal-member.zip", "expect": "fail_closed"},
-    {"id": "unicode-conflict-a", "path": "payloads/unicode-cafe-nfc.txt", "expect": "collision_or_normalize"},
-    {"id": "unicode-conflict-b", "path": "payloads/unicode-cafe-nfd.txt", "expect": "collision_or_normalize"}
+    {"id": "pdf-schematic", "temp_name": "sneaky-schematic.pdf", "expect": "exclude_or_fail_closed"},
+    {"id": "brd-board", "temp_name": "sneaky-main.brd", "expect": "exclude_or_fail_closed"},
+    {"id": "dsn-orcad", "temp_name": "sneaky.dsn", "expect": "exclude_or_fail_closed"},
+    {"id": "vendor-installer", "temp_name": "td_release_2026.1_fake.zip", "expect": "exclude_or_fail_closed"},
+    {"id": "license-archive", "temp_name": "vendor-license.zip", "expect": "exclude_or_fail_closed"},
+    {"id": "license-file", "temp_name": "Anlogic.lic", "expect": "exclude_or_fail_closed"},
+    {"id": "private-key", "temp_name": "id_ed25519", "expect": "exclude_or_fail_closed"},
+    {"id": "dotenv", "temp_name": "dotenv.env", "expect": "exclude_or_fail_closed"},
+    {"id": "path-traversal-zip", "temp_name": "traversal-member.zip", "expect": "fail_closed"},
+    {"id": "unicode-conflict-a", "temp_name": "unicode-cafe-nfc.txt", "expect": "collision_or_normalize"},
+    {"id": "unicode-conflict-b", "temp_name": "unicode-cafe-nfd.txt", "expect": "collision_or_normalize"}
   ]
 }

+ 0 - 1
tests/fixtures/package_adversarial/payloads/Anlogic.lic

@@ -1 +0,0 @@
-ADV-LICENSE-KEY

+ 0 - 1
tests/fixtures/package_adversarial/payloads/dotenv.env

@@ -1 +0,0 @@
-SECRET=should-never-pack

+ 0 - 3
tests/fixtures/package_adversarial/payloads/id_ed25519

@@ -1,3 +0,0 @@
------BEGIN PRIVATE KEY-----
-ADVERSARIAL_FIXTURE_NOT_A_REAL_KEY
------END PRIVATE KEY-----

+ 0 - 1
tests/fixtures/package_adversarial/payloads/sneaky-main.brd

@@ -1 +0,0 @@
-%ADV-BRD-FIXTURE%

+ 0 - 1
tests/fixtures/package_adversarial/payloads/sneaky-schematic.pdf

@@ -1 +0,0 @@
-%PDF-1.4 ADV-FIXTURE

+ 0 - 1
tests/fixtures/package_adversarial/payloads/sneaky.dsn

@@ -1 +0,0 @@
-(dsn sneaky)

+ 0 - 1
tests/fixtures/package_adversarial/payloads/td_release_2026.1_fake.zip

@@ -1 +0,0 @@
-PKADV-TD-RELEASE

BIN
tests/fixtures/package_adversarial/payloads/traversal-member.zip


+ 0 - 1
tests/fixtures/package_adversarial/payloads/unicode-cafe-nfc.txt

@@ -1 +0,0 @@
-nfc cafe

+ 0 - 1
tests/fixtures/package_adversarial/payloads/unicode-cafe-nfd.txt

@@ -1 +0,0 @@
-nfd cafe

+ 0 - 1
tests/fixtures/package_adversarial/payloads/vendor-license.zip

@@ -1 +0,0 @@
-PKADV-LICENSE-ZIP

+ 7 - 2
tests/formal/README.md

@@ -12,8 +12,8 @@ SymbiYosys task names match the configured mode. Do **not** treat a task named
 | `frame_command_contract` | `bmc` | BMC (depth 96; wrapper has cover() but no cover task — low-mem) |
 | `frame_tx_contract` | `bmc` | BMC (depth 64) |
 | `simple_frame_contract` | `bmc`, `cover` | BMC + cover (cover depth 32) |
-| `startup_close_seek` | `bmc`, `cover` | BMC + cover |
-| `runtime_limit_hard_stop` | `bmc`, `cover` | BMC + cover (DIR→LS/HS mux) |
+| `startup_close_seek` | `bmc`, `cover` | BMC + cover (real engine + top STEP truncate gate) |
+| `runtime_limit_hard_stop` | `bmc`, `cover` | BMC + cover (real engine + top STEP truncate gate; DIR→LS/HS mux) |
 | `door_action_dispatcher_axis3` | `bmc`, `cover` | BMC + cover (3-axis Z/X/Y) |
 | `output_target_ram_contract` | `prove` | prove |
 | `simple_motor_temperature_contract` | `prove`, `cover` | prove + cover |
@@ -26,6 +26,11 @@ and accepted-byte no-duplicate progression through the early frame stream. Full
 33-byte completion is outside this bounded proof and remains covered by the RTL
 simulation benches.
 
+Lane C stop semantics in formal/sim encode the **ACTUAL RTL** behavior
+`truncate_current_high_pulse_immediately_after_synchronized_limit` (engine clears
+STEP on the stop_mask edge; top combinationally gates the pin). Do not assert
+finish-high pulse completion against these wrappers.
+
 They are offline checks. A solver error, timeout, unknown status, missing
 compiled-property evidence, or unhit required cover is not a pass. Receipts must
 record mode, depth, solver, and cover hits; BMC must never be reported as

+ 2 - 0
tests/formal/runtime_limit_hard_stop.sby

@@ -12,10 +12,12 @@ cover: depth 32
 smtbmc z3
 
 [script]
+read_verilog -formal door_motor_engine.v
 read_verilog -formal runtime_limit_hard_stop_formal.v
 proc
 setundef -zero
 prep -top runtime_limit_hard_stop_formal
 
 [files]
+../../src/modules/door_motor_engine.v
 runtime_limit_hard_stop_formal.v

+ 152 - 3
tests/formal/runtime_limit_hard_stop_formal.v

@@ -1,18 +1,37 @@
-// Runtime limit hard-stop mux: DIR=1 -> LS, DIR=0 -> HS; active only after startup_done.
+// Runtime limit hard-stop BMC against REAL door_motor_engine + top-style
+// external STEP truncate gate (mirrors prod2u_p4_normal_v3_top.v).
+//
+// ACTUAL RTL stop semantics (encode as truncate, not finish-high):
+//   truncate_current_high_pulse_immediately_after_synchronized_limit
+// Engine clears STEP on the stop_mask sampling edge; top combinationally
+// gates engine_step with the direction-selected synchronized limit so the
+// pin cannot stay high after the target-side limit syncs.
+//
+// Mux shell asserts are retained for static contract string checks.
 module runtime_limit_hard_stop_formal (
     input wire clk,
     input wire rst_n,
     input wire startup_done,
+    input wire start,
+    input wire [2:0] active_mask,
     input wire [2:0] motor_dir_mask,
+    input wire tick_500us,
+    input wire abort,
     input wire [2:0] limit_ls_sync,
     input wire [2:0] limit_hs_sync
 );
+    localparam integer FORMAL_MAX_STEPS = 4;
+    localparam integer FORMAL_DIR_SETUP_TICKS = 1;
+    localparam integer AXIS_COUNT = 3;
+
     wire [2:0] runtime_limit_stop_mask;
     reg [2:0] reset_cycles;
+    reg [2:0] prev_gated_step;
+    reg past_valid;
 
     genvar gi;
     generate
-        for (gi = 0; gi < 3; gi = gi + 1) begin : gen_runtime_limit_stop
+        for (gi = 0; gi < AXIS_COUNT; gi = gi + 1) begin : gen_runtime_limit_stop
             assign runtime_limit_stop_mask[gi] =
                 motor_dir_mask[gi] ? limit_ls_sync[gi] : limit_hs_sync[gi];
         end
@@ -20,33 +39,163 @@ module runtime_limit_hard_stop_formal (
 
     wire [2:0] motor_stop_mask = startup_done ? runtime_limit_stop_mask : 3'b000;
 
-    initial reset_cycles = 3'd0;
+    wire busy;
+    wire done;
+    wire [2:0] engine_step;
+    wire [2:0] engine_dir;
+
+    door_motor_engine #(
+        .AXIS_COUNT(AXIS_COUNT),
+        .MAX_STEPS(FORMAL_MAX_STEPS),
+        .DIR_SETUP_TICKS(FORMAL_DIR_SETUP_TICKS)
+    ) u_motor (
+        .clk(clk),
+        .rst_n(rst_n),
+        .start(start && startup_done),
+        .active_mask(active_mask),
+        .dir_mask(motor_dir_mask),
+        .step_count(FORMAL_MAX_STEPS[2:0]),
+        .tick_500us(tick_500us),
+        .abort(abort),
+        .stop_mask(motor_stop_mask),
+        .busy(busy),
+        .done(done),
+        .step(engine_step),
+        .dir(engine_dir)
+    );
+
+    // Top pin gate: immediate truncate of external STEP on target-side sync.
+    wire [2:0] gated_step;
+    assign gated_step[0] = engine_step[0] &
+        ~(engine_dir[0] ? limit_ls_sync[0] : limit_hs_sync[0]);
+    assign gated_step[1] = engine_step[1] &
+        ~(engine_dir[1] ? limit_ls_sync[1] : limit_hs_sync[1]);
+    assign gated_step[2] = engine_step[2] &
+        ~(engine_dir[2] ? limit_ls_sync[2] : limit_hs_sync[2]);
+
+    // Top permanent enable (FPGA ball constant 1 / permanent_high).
+    wire motor_en_n = 1'b1;
+
+    wire [2:0] target_limit_for_engine_dir;
+    assign target_limit_for_engine_dir[0] =
+        engine_dir[0] ? limit_ls_sync[0] : limit_hs_sync[0];
+    assign target_limit_for_engine_dir[1] =
+        engine_dir[1] ? limit_ls_sync[1] : limit_hs_sync[1];
+    assign target_limit_for_engine_dir[2] =
+        engine_dir[2] ? limit_ls_sync[2] : limit_hs_sync[2];
+
+    initial begin
+        reset_cycles = 3'd0;
+        prev_gated_step = 3'b000;
+        past_valid = 1'b0;
+    end
 
     always @(posedge clk) begin
         assume (rst_n == 1'b0 || rst_n == 1'b1);
         assume (startup_done == 1'b0 || startup_done == 1'b1);
+        assume (start == 1'b0 || start == 1'b1);
+        assume (tick_500us == 1'b0 || tick_500us == 1'b1);
+        assume (abort == 1'b0 || abort == 1'b1);
         assume ((^motor_dir_mask) == 1'b0 || (^motor_dir_mask) == 1'b1);
+        assume ((^active_mask) == 1'b0 || (^active_mask) == 1'b1);
         assume ((^limit_ls_sync) == 1'b0 || (^limit_ls_sync) == 1'b1);
         assume ((^limit_hs_sync) == 1'b0 || (^limit_hs_sync) == 1'b1);
+        // Host contract: no new start while busy; dir stable for a run.
+        assume (!busy || !start);
+        if (busy)
+            assume (motor_dir_mask == engine_dir);
         if (!$initstate && $past(rst_n) && $past(startup_done))
             assume (startup_done);
+
         if ($initstate || reset_cycles < 2) begin
             assume (!rst_n);
             reset_cycles <= reset_cycles + 1'b1;
+            past_valid <= 1'b0;
+            prev_gated_step <= 3'b000;
         end else begin
             assume (rst_n);
+            past_valid <= 1'b1;
         end
 
+        // Mux shell (startup gating of runtime stop mask).
         if (rst_n && startup_done) begin
             assert (motor_stop_mask == runtime_limit_stop_mask);
         end
         if (rst_n && !startup_done) begin
             assert (motor_stop_mask == 3'b000);
         end
+
+        if (rst_n) begin
+            // Permanent EN never drops on watchdog / limit paths.
+            assert (motor_en_n == 1'b1);
+
+            if (startup_done) begin
+                // Target-side synchronized limit => external STEP immediately 0
+                // (combinational top gate + engine truncate on stop_mask).
+                if (target_limit_for_engine_dir[0])
+                    assert (gated_step[0] == 1'b0);
+                if (target_limit_for_engine_dir[1])
+                    assert (gated_step[1] == 1'b0);
+                if (target_limit_for_engine_dir[2])
+                    assert (gated_step[2] == 1'b0);
+
+                // Wrong-side limit does not assert stop_mask (leave allowed).
+                if (motor_dir_mask[0] && !limit_ls_sync[0])
+                    assert (motor_stop_mask[0] == 1'b0);
+                if (!motor_dir_mask[0] && !limit_hs_sync[0])
+                    assert (motor_stop_mask[0] == 1'b0);
+                if (motor_dir_mask[1] && !limit_ls_sync[1])
+                    assert (motor_stop_mask[1] == 1'b0);
+                if (!motor_dir_mask[1] && !limit_hs_sync[1])
+                    assert (motor_stop_mask[1] == 1'b0);
+                if (motor_dir_mask[2] && !limit_ls_sync[2])
+                    assert (motor_stop_mask[2] == 1'b0);
+                if (!motor_dir_mask[2] && !limit_hs_sync[2])
+                    assert (motor_stop_mask[2] == 1'b0);
+
+                // Axis independence of stop_mask construction.
+                if (!limit_ls_sync[0] && !limit_hs_sync[0])
+                    assert (motor_stop_mask[0] == 1'b0);
+                if (!limit_ls_sync[1] && !limit_hs_sync[1])
+                    assert (motor_stop_mask[1] == 1'b0);
+                if (!limit_ls_sync[2] && !limit_hs_sync[2])
+                    assert (motor_stop_mask[2] == 1'b0);
+            end
+
+            if (past_valid) begin
+                // Engine truncate: after stop_mask sampled high, registered STEP is 0.
+                if (startup_done && $past(motor_stop_mask[0]) && $past(rst_n))
+                    assert (engine_step[0] == 1'b0);
+                if (startup_done && $past(motor_stop_mask[1]) && $past(rst_n))
+                    assert (engine_step[1] == 1'b0);
+                if (startup_done && $past(motor_stop_mask[2]) && $past(rst_n))
+                    assert (engine_step[2] == 1'b0);
+
+                // No new rising edge on an axis whose target limit was already high.
+                if (startup_done && $past(target_limit_for_engine_dir[0]))
+                    assert (!( !prev_gated_step[0] && gated_step[0] ));
+                if (startup_done && $past(target_limit_for_engine_dir[1]))
+                    assert (!( !prev_gated_step[1] && gated_step[1] ));
+                if (startup_done && $past(target_limit_for_engine_dir[2]))
+                    assert (!( !prev_gated_step[2] && gated_step[2] ));
+
+                // Watchdog abort: next cycle external STEP low; EN still high.
+                if ($past(abort) && $past(rst_n)) begin
+                    assert (engine_step == 3'b000);
+                    assert (gated_step == 3'b000);
+                    assert (motor_en_n == 1'b1);
+                end
+            end
+
+            prev_gated_step <= gated_step;
+        end
     end
 
     always @(posedge clk) begin
         cover (rst_n && startup_done && limit_ls_sync == 3'b001);
         cover (rst_n && startup_done && limit_hs_sync == 3'b001 && motor_dir_mask == 3'b000);
+        cover (rst_n && startup_done && busy && motor_stop_mask[0] && !gated_step[0]);
+        cover (rst_n && startup_done && abort);
+        cover (rst_n && startup_done && engine_step[1] && motor_stop_mask[0] && !motor_stop_mask[1]);
     end
 endmodule

+ 3 - 1
tests/formal/startup_close_seek.sby

@@ -6,13 +6,14 @@ cover
 bmc: mode bmc
 bmc: depth 48
 cover: mode cover
-cover: depth 32
+cover: depth 40
 
 [engines]
 smtbmc z3
 
 [script]
 read_verilog -formal startup_close_seek.v
+read_verilog -formal door_motor_engine.v
 read_verilog -formal startup_close_seek_formal.v
 proc
 setundef -zero
@@ -20,4 +21,5 @@ prep -top startup_close_seek_formal
 
 [files]
 ../../src/modules/startup_close_seek.v
+../../src/modules/door_motor_engine.v
 startup_close_seek_formal.v

+ 135 - 25
tests/formal/startup_close_seek_formal.v

@@ -1,3 +1,6 @@
+// Startup close/seek BMC with REAL door_motor_engine + top-style STEP truncate
+// gate. Stop semantics modeled as ACTUAL RTL truncate (not finish-high):
+//   truncate_current_high_pulse_immediately_after_synchronized_limit
 module startup_close_seek_formal (
     input wire clk,
     input wire rst_n,
@@ -18,11 +21,20 @@ module startup_close_seek_formal (
     wire [AXIS_COUNT-1:0] motor_stop_mask;
     wire [2:0] motor_step_count;
     wire motor_done;
+    wire motor_busy;
+    wire [AXIS_COUNT-1:0] engine_step;
+    wire [AXIS_COUNT-1:0] engine_dir;
 
     reg [2:0] reset_cycles;
-    reg [3:0] start_counter;
-    reg motor_busy;
     reg formal_sync_valid;
+    reg saw_ls_low;
+    reg [AXIS_COUNT-1:0] prev_gated_step;
+    reg past_valid;
+    reg [3:0] backoff_rising_x;
+    reg in_backoff;
+    reg close_phase;
+    reg found_ls_frozen;
+    reg [AXIS_COUNT-1:0] shadow_found_ls;
 
     always @(posedge clk or negedge rst_n) begin
         if (!rst_n) begin
@@ -42,7 +54,6 @@ module startup_close_seek_formal (
     ) u_startup (
         .clk(clk),
         .rst_n(rst_n),
-        .tick_500us(tick_500us),
         .limit_sync_valid(formal_sync_valid),
         .limit_ls_sync(limit_ls_sync),
         .limit_hs_sync(limit_hs_sync),
@@ -55,43 +66,106 @@ module startup_close_seek_formal (
         .motor_done(motor_done)
     );
 
-    reg [3:0] motor_count;
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            motor_busy <= 1'b0;
-            motor_count <= 4'd0;
-            start_counter <= 4'd0;
-        end else begin
-            if (motor_start) start_counter <= start_counter + 1'b1;
-            if (motor_start && !motor_busy) begin
-                motor_busy <= 1'b1;
-                motor_count <= 4'd0;
-            end else if (motor_busy) begin
-                if (motor_count < FORMAL_CLOSE_STEPS + FORMAL_DIR_SETUP_TICKS) begin
-                    motor_count <= motor_count + 1'b1;
-                end else begin
-                    motor_busy <= 1'b0;
-                end
-            end
-        end
-    end
-    assign motor_done = motor_busy && (motor_count == FORMAL_CLOSE_STEPS + FORMAL_DIR_SETUP_TICKS);
+    door_motor_engine #(
+        .AXIS_COUNT(AXIS_COUNT),
+        .MAX_STEPS(FORMAL_CLOSE_STEPS),
+        .DIR_SETUP_TICKS(FORMAL_DIR_SETUP_TICKS)
+    ) u_motor (
+        .clk(clk),
+        .rst_n(rst_n),
+        .start(motor_start),
+        .active_mask(motor_active_mask),
+        .dir_mask(motor_dir_mask),
+        .step_count(motor_step_count),
+        .tick_500us(tick_500us),
+        .abort(1'b0),
+        .stop_mask(motor_stop_mask),
+        .busy(motor_busy),
+        .done(motor_done),
+        .step(engine_step),
+        .dir(engine_dir)
+    );
 
-    initial reset_cycles = 3'd0;
+    // Top-style external STEP truncate gate (dir-select LS/HS).
+    wire [AXIS_COUNT-1:0] gated_step;
+    assign gated_step[0] = engine_step[0] &
+        ~(engine_dir[0] ? limit_ls_sync[0] : limit_hs_sync[0]);
+    assign gated_step[1] = engine_step[1] &
+        ~(engine_dir[1] ? limit_ls_sync[1] : limit_hs_sync[1]);
+    assign gated_step[2] = engine_step[2] &
+        ~(engine_dir[2] ? limit_ls_sync[2] : limit_hs_sync[2]);
+
+    wire motor_en_n = 1'b1;
+
+    initial begin
+        reset_cycles = 3'd0;
+        saw_ls_low = 1'b0;
+        prev_gated_step = 3'b000;
+        past_valid = 1'b0;
+        backoff_rising_x = 4'd0;
+        in_backoff = 1'b0;
+        close_phase = 1'b0;
+        found_ls_frozen = 1'b0;
+        shadow_found_ls = 3'b000;
+    end
 
     always @(posedge clk) begin
         assume (rst_n == 1'b0 || rst_n == 1'b1);
         assume (tick_500us == 1'b0 || tick_500us == 1'b1);
         assume ((^limit_ls_sync) == 1'b0 || (^limit_ls_sync) == 1'b1);
         assume ((^limit_hs_sync) == 1'b0 || (^limit_hs_sync) == 1'b1);
+
         if ($initstate || reset_cycles < 3) begin
             assume (!rst_n);
             reset_cycles <= reset_cycles + 1'b1;
+            past_valid <= 1'b0;
+            saw_ls_low <= 1'b0;
+            prev_gated_step <= 3'b000;
+            backoff_rising_x <= 4'd0;
+            in_backoff <= 1'b0;
+            close_phase <= 1'b0;
+            found_ls_frozen <= 1'b0;
+            shadow_found_ls <= 3'b000;
         end else begin
             assume (rst_n);
+            past_valid <= 1'b1;
         end
 
         if (rst_n) begin
+            assert (motor_en_n == 1'b1);
+
+            if (limit_ls_sync != 3'b111)
+                saw_ls_low <= 1'b1;
+
+            // Mirror DUT found_ls only during close-wait (freeze on motor_done).
+            if (motor_start && (motor_dir_mask == FORMAL_CLOSE_DIR_MASK)) begin
+                close_phase <= 1'b1;
+                found_ls_frozen <= 1'b0;
+                // Non-participants already sat on LS; OR current LS on first close beat.
+                shadow_found_ls <= (~motor_active_mask) | limit_ls_sync;
+            end else if (close_phase && !found_ls_frozen) begin
+                shadow_found_ls <= shadow_found_ls | limit_ls_sync;
+                if (motor_done)
+                    found_ls_frozen <= 1'b1;
+            end
+            if (startup_done || (motor_start && (motor_dir_mask == 3'b000)))
+                close_phase <= 1'b0;
+
+            // Backoff start: DIR=0 and a new motor_start.
+            if (motor_start && (motor_dir_mask == 3'b000)) begin
+                in_backoff <= 1'b1;
+                backoff_rising_x <= 4'd0;
+                assert (motor_step_count == FORMAL_BACKOFF_STEPS[2:0]);
+                // Axes that already found LS during close must not enter backoff.
+                assert ((motor_active_mask & shadow_found_ls) == 3'b000);
+            end
+            if (startup_done)
+                in_backoff <= 1'b0;
+
+            if (in_backoff && !prev_gated_step[0] && gated_step[0])
+                backoff_rising_x <= backoff_rising_x + 1'b1;
+
+            // Sticky idle after startup_done.
             if (!$initstate && $past(startup_done)) begin
                 assert (startup_done);
                 assert (motor_start == 1'b0);
@@ -100,6 +174,40 @@ module startup_close_seek_formal (
                 assert (motor_stop_mask == 3'b000);
             end
             if ($past(motor_start)) assert (!motor_start);
+
+            // All LS high from reset: no external STEP rising edges.
+            if (!saw_ls_low) begin
+                assert (gated_step == 3'b000);
+                if (past_valid)
+                    assert (!( !prev_gated_step[0] && gated_step[0] ));
+            end
+
+            // Truncate pin path: target-side sync => gated STEP 0 same cycle.
+            if (engine_dir[0] ? limit_ls_sync[0] : limit_hs_sync[0])
+                assert (gated_step[0] == 1'b0);
+            if (engine_dir[1] ? limit_ls_sync[1] : limit_hs_sync[1])
+                assert (gated_step[1] == 1'b0);
+            if (engine_dir[2] ? limit_ls_sync[2] : limit_hs_sync[2])
+                assert (gated_step[2] == 1'b0);
+
+            // Missed-axis backoff budget: at most BACKOFF_STEPS rising edges.
+            assert (backoff_rising_x <= FORMAL_BACKOFF_STEPS[3:0]);
+
+            if (past_valid) begin
+                // Engine truncate: registered STEP cleared the cycle after stop_mask.
+                if ($past(motor_stop_mask[0]) && $past(rst_n))
+                    assert (engine_step[0] == 1'b0);
+                if ($past(motor_stop_mask[1]) && $past(rst_n))
+                    assert (engine_step[1] == 1'b0);
+                if ($past(motor_stop_mask[2]) && $past(rst_n))
+                    assert (engine_step[2] == 1'b0);
+
+                // During backoff, HS can terminate early (no new rise while HS high).
+                if (in_backoff && $past(limit_hs_sync[0]) && !engine_dir[0])
+                    assert (!( !prev_gated_step[0] && gated_step[0] ));
+            end
+
+            prev_gated_step <= gated_step;
         end
     end
 
@@ -107,5 +215,7 @@ module startup_close_seek_formal (
         cover (rst_n && startup_done);
         cover (rst_n && motor_active_mask == 3'b111);
         cover (rst_n && startup_done && limit_ls_sync == 3'b000);
+        cover (rst_n && motor_start && motor_dir_mask == 3'b000);
+        cover (rst_n && !saw_ls_low && startup_done);
     end
 endmodule

+ 22 - 6
tests/sim/door_motor_engine_stop_tb.v

@@ -100,15 +100,31 @@ module door_motor_engine_stop_tb;
         wait_for_done();
         if (y_rises !== HOST_STEPS) $fatal(1, "scenario1: Y did not reach 450");
 
-        // X stopped while STEP high: current pulse completes, no new rising edge.
+        // X stopped while STEP high: ACTUAL RTL truncate (not finish-high) —
+        // truncate_current_high_pulse_immediately_after_synchronized_limit.
         reset_dut();
         start_motor();
         while (step[0] !== 1'b1) pulse_tick();
-        stop_mask = 3'b001;
-        while (step[0] !== 1'b0) pulse_tick();
-        if (x_rises !== 1) $fatal(1, "scenario2: X pulse not completed");
-        repeat (20) pulse_tick();
-        if (x_rises !== 1) $fatal(1, "scenario2: new X rising edge after high-phase stop");
+        begin : truncate_high
+            integer rises_before;
+            @(posedge clk);
+            #1;
+            rises_before = x_rises;
+            if (rises_before < 1)
+                $fatal(1, "scenario2: expected X rising edge before truncate");
+            if (step[0] !== 1'b1)
+                $fatal(1, "scenario2: lost STEP high before truncate");
+            @(negedge clk);
+            stop_mask = 3'b001;
+            @(posedge clk);
+            #1; // NBA settle: truncate clears registered STEP on this edge
+            if (step[0] !== 1'b0)
+                $fatal(1, "scenario2: truncate failed, STEP still high after stop_mask");
+            repeat (20) pulse_tick();
+            if (x_rises !== rises_before)
+                $fatal(1, "scenario2: new X rising edge after high-phase truncate got %0d want %0d",
+                       x_rises, rises_before);
+        end
 
         // Stop during DIR setup: zero steps on stopped axis.
         reset_dut();

+ 74 - 11
tests/sim/prod2u_p4_normal_v3_top_runtime_limit_tb.v

@@ -1,6 +1,12 @@
 `timescale 1ns/1ps
 
-// Runtime limit hard-stop: DIR=1 stops on LS, DIR=0 stops on HS; truncates STEP high.
+// Runtime limit hard-stop: DIR=1 stops on LS, DIR=0 stops on HS.
+// Asserts ACTUAL RTL truncate semantics:
+// truncate_current_high_pulse_immediately_after_synchronized_limit.
+//
+// host_motor_dir_mask/active_mask stay forced for the whole jog so
+// runtime_limit_stop_mask tracks the latched engine direction (top mux uses
+// host_motor_dir_mask while busy).
 module prod2u_p4_normal_v3_top_runtime_limit_tb;
     reg sys_clk = 1'b0;
     reg host_uart_rx = 1'b1;
@@ -70,16 +76,28 @@ module prod2u_p4_normal_v3_top_runtime_limit_tb;
         end
     endtask
 
-    task drive_host_motor;
+    task drain_limit_sync;
+        begin
+            repeat (4) @(posedge sys_clk);
+        end
+    endtask
+
+    task start_host_motor;
         input [2:0] mask;
         input [2:0] dir_mask;
         begin
             @(negedge sys_clk);
-            force dut.host_motor_start = 1'b1;
             force dut.host_motor_active_mask = mask;
             force dut.host_motor_dir_mask = dir_mask;
+            force dut.host_motor_start = 1'b1;
             @(posedge sys_clk);
             @(negedge sys_clk);
+            force dut.host_motor_start = 1'b0;
+        end
+    endtask
+
+    task release_host_motor;
+        begin
             release dut.host_motor_start;
             release dut.host_motor_active_mask;
             release dut.host_motor_dir_mask;
@@ -90,8 +108,8 @@ module prod2u_p4_normal_v3_top_runtime_limit_tb;
         host_x_steps = 0;
         prev_x_step = 1'b0;
 
-        // Z already at LS so startup finishes quickly.
-        x_limit_ls = 1'b0;
+        // All LS high: startup_done without motion (runtime path under test).
+        x_limit_ls = 1'b1;
         x_limit_hs = 1'b0;
         y_limit_ls = 1'b1;
         y_limit_hs = 1'b0;
@@ -102,32 +120,77 @@ module prod2u_p4_normal_v3_top_runtime_limit_tb;
         wait_for_startup_done();
         startup_done_seen = 1'b1;
 
-        // Host close on X (DIR=1): assert LS mid-move -> hard stop before 450.
-        drive_host_motor(3'b001, 3'b001);
+        x_limit_ls = 1'b0;
+        drain_limit_sync();
+
+        // Host close on X (DIR=1): assert LS mid-move -> truncate before 450.
+        start_host_motor(3'b001, 3'b001);
         while (host_x_steps < 5) @(posedge sys_clk);
         x_limit_ls = 1'b1;
+        drain_limit_sync();
+        if (x_step !== 1'b0)
+            $fatal(1, "runtime LS truncate failed: x_step still high after sync");
         while (!dut.u_motor_engine.done) @(posedge sys_clk);
+        release_host_motor();
         if (host_x_steps >= HOST_STEPS)
             $fatal(1, "runtime LS stop failed to truncate X before 450, got %0d", host_x_steps);
         if (host_x_steps < 1)
             $fatal(1, "X never stepped before runtime LS stop");
 
-        // Host open on X (DIR=0): assert HS mid-move -> hard stop before 450.
+        // Wrong-side HS while closing must not stop X.
+        host_x_steps = 0;
+        prev_x_step = 1'b0;
+        x_limit_ls = 1'b0;
+        x_limit_hs = 1'b1;
+        drain_limit_sync();
+        start_host_motor(3'b001, 3'b001);
+        while (host_x_steps < 8) @(posedge sys_clk);
+        if (!dut.u_motor_engine.busy)
+            $fatal(1, "wrong-side HS incorrectly stopped close jog early");
+        while (!dut.u_motor_engine.done) @(posedge sys_clk);
+        release_host_motor();
+        if (host_x_steps !== HOST_STEPS)
+            $fatal(1, "expected full 450 with wrong-side HS held, got %0d", host_x_steps);
+
+        // Host open on X (DIR=0): assert HS mid-move -> truncate before 450.
         host_x_steps = 0;
         prev_x_step = 1'b0;
         x_limit_ls = 1'b0;
         x_limit_hs = 1'b0;
-        drive_host_motor(3'b001, 3'b000);
+        drain_limit_sync();
+        start_host_motor(3'b001, 3'b000);
         while (host_x_steps < 5) @(posedge sys_clk);
         x_limit_hs = 1'b1;
+        drain_limit_sync();
+        if (x_step !== 1'b0)
+            $fatal(1, "runtime HS truncate failed: x_step still high after sync");
         while (!dut.u_motor_engine.done) @(posedge sys_clk);
+        release_host_motor();
         if (host_x_steps >= HOST_STEPS)
             $fatal(1, "runtime HS stop failed to truncate X before 450, got %0d", host_x_steps);
 
+        // Watchdog abort: external STEP low; EN remains permanent_high.
+        host_x_steps = 0;
+        prev_x_step = 1'b0;
+        x_limit_ls = 1'b0;
+        x_limit_hs = 1'b0;
+        drain_limit_sync();
+        start_host_motor(3'b001, 3'b001);
+        while (host_x_steps < 3) @(posedge sys_clk);
+        @(negedge sys_clk);
+        force dut.watchdog_timeout_event = 1'b1;
+        @(posedge sys_clk);
+        #1;
+        if (x_step !== 1'b0)
+            $fatal(1, "watchdog abort left x_step high");
+        if (motor_en_n !== 1'b1)
+            $fatal(1, "motor_en_n dropped after watchdog (expected permanent_high)");
+        @(negedge sys_clk);
+        force dut.watchdog_timeout_event = 1'b0;
+        release_host_motor();
+
         if (!dut.startup_done)
             $fatal(1, "startup_done was not sticky through runtime limit stops");
-        if (dut.motor_stop_mask !== 3'b000 && dut.startup_done)
-            ; // runtime stop mask may be non-zero during move; after done engine idle
 
         $display("prod2u_p4_normal_v3_top_runtime_limit_tb PASS");
         $finish;

+ 1 - 0
tests/sim/prod2u_p4_normal_v3_top_startup_tb.v

@@ -61,6 +61,7 @@ module prod2u_p4_normal_v3_top_startup_tb;
     always @(posedge sys_clk) begin
         prev_x_step <= x_step;
         prev_y_step <= y_step;
+        prev_z_step <= z_step;
         if (startup_phase) begin
             if (!prev_x_step && x_step) startup_x_steps <= startup_x_steps + 1;
             if (!prev_y_step && y_step) startup_y_steps <= startup_y_steps + 1;

+ 1 - 1
tests/sim/startup_close_seek_tb.v

@@ -34,7 +34,7 @@ module startup_close_seek_tb;
         .AXIS_COUNT(AXIS_COUNT),
         .CLOSE_DIR_MASK({AXIS_COUNT{1'b1}})
     ) dut (
-        .clk(clk), .rst_n(rst_n), .tick_500us(tick_500us),
+        .clk(clk), .rst_n(rst_n),
         .limit_sync_valid(limit_sync_valid),
         .limit_ls_sync(limit_ls), .limit_hs_sync(limit_hs),
         .startup_done(startup_done), .motor_start(motor_start),

+ 1 - 1
tests/sim/startup_motor_stop_tb.v

@@ -39,7 +39,7 @@ module startup_motor_stop_tb;
         .AXIS_COUNT(AXIS_COUNT),
         .CLOSE_DIR_MASK({AXIS_COUNT{1'b1}})
     ) u_startup (
-        .clk(clk), .rst_n(rst_n), .tick_500us(tick_500us),
+        .clk(clk), .rst_n(rst_n),
         .limit_sync_valid(limit_valid),
         .limit_ls_sync(limit_ls), .limit_hs_sync(limit_hs),
         .startup_done(startup_done), .motor_start(motor_start),

+ 56 - 30
tests/test_project_structure.py

@@ -3,58 +3,84 @@
 
 from __future__ import annotations
 
+import sys
 import unittest
 from pathlib import Path
 
 
 ROOT = Path(__file__).resolve().parents[1]
+TOOLS = ROOT / "tools"
+if str(TOOLS) not in sys.path:
+    sys.path.insert(0, str(TOOLS))
+
+import test_profiles  # noqa: E402
 
 
 class ProjectStructureTests(unittest.TestCase):
     def test_new_architecture_and_evidence_directories_exist(self) -> None:
-        for relative in (
-            "projects/prod2u-door-temp/project.json",
-            "projects/prod2u-door-temp/requirements.zh-CN.md",
-            "schemas/project.schema.json",
-            "src/common/frame_rx.v",
-            "src/common/frame_tx.v",
-            "src/common/crc16_serial.v",
-            "src/modules/door_motor_engine.v",
-            "src/modules/temperature_reader.v",
-            "src/project/project_adapter.v",
-            "src/top/prod2u_p4_normal_v3_top.v",
-            "src/generated/prod2u_door_temp_params.vh",
-            "tests/sim/prod2u_p4_normal_v3_top_tb.v",
-            "td/prod2u_p4_normal_v3.prj",
-            "td/syn/prod2u_p4_normal_v3.tcl",
-            "td/phy/prod2u_p4_normal_v3.tcl",
-            "td/bitgen/prod2u_p4_normal_v3.tcl",
-            "constraints/prod2u_p4_normal_v3.adc",
-            "constraints/prod2u_p4_normal_v3.sdc",
-            "tools/run_verification_matrix.py",
-            "reference/original/legacy_rtl/prod2u_p4_normal_v3_top_legacy.v",
-        ):
-            with self.subTest(relative=relative):
-                self.assertTrue((ROOT / relative).is_file(), relative)
+        profile = test_profiles.detect_test_profile(ROOT)
+        required = test_profiles.structure_required_paths(profile)
+        for relative in required:
+            with self.subTest(relative=relative, profile=profile):
+                # Compact trees may nest under source/; accept either layout.
+                candidates = (
+                    ROOT / relative,
+                    ROOT / "source" / relative,
+                )
+                self.assertTrue(
+                    any(path.is_file() for path in candidates),
+                    f"{relative} missing under profile={profile}",
+                )
+        if not test_profiles.requires_reference_legacy_rtl(profile):
+            for relative in test_profiles.REFERENCE_ONLY_PATHS:
+                with self.subTest(relative=relative, profile=profile):
+                    # Detached compact must not require excluded legacy_rtl.
+                    self.assertFalse(
+                        test_profiles.requires_reference_legacy_rtl(profile),
+                        "review-compact-detached must not require legacy_rtl",
+                    )
 
     def test_only_canonical_top_is_active(self) -> None:
-        tops = sorted(path.name for path in (ROOT / "src/top").glob("*.v"))
+        top_dirs = (
+            ROOT / "src" / "top",
+            ROOT / "source" / "src" / "top",
+        )
+        top_dir = next((path for path in top_dirs if path.is_dir()), None)
+        self.assertIsNotNone(top_dir, "src/top missing")
+        assert top_dir is not None
+        tops = sorted(path.name for path in top_dir.glob("*.v"))
         self.assertEqual(tops, ["prod2u_p4_normal_v3_top.v"])
 
     def test_active_td_and_build_inputs_exclude_retired_protocol(self) -> None:
+        def _read(*parts: str) -> str:
+            for base in (ROOT, ROOT / "source"):
+                path = base.joinpath(*parts)
+                if path.is_file():
+                    return path.read_text(encoding="utf-8")
+            self.fail(f"missing {'/'.join(parts)}")
+            return ""
+
         active = "\n".join(
             [
-                (ROOT / "td/syn/prod2u_p4_normal_v3.tcl").read_text(encoding="utf-8"),
-                (ROOT / "td/phy/prod2u_p4_normal_v3.tcl").read_text(encoding="utf-8"),
-                (ROOT / "td/prod2u_p4_normal_v3.prj").read_text(encoding="utf-8"),
-                (ROOT / "tools/prod2u_p4_normal_v3_build.py").read_text(encoding="utf-8"),
+                _read("td", "syn", "prod2u_p4_normal_v3.tcl"),
+                _read("td", "phy", "prod2u_p4_normal_v3.tcl"),
+                _read("td", "prod2u_p4_normal_v3.prj"),
+                _read("tools", "prod2u_p4_normal_v3_build.py"),
             ]
         ).casefold()
         for retired in ("binary921", "921600", "response_scheduler", "host_ack", "jog", "motor_compat", "solenoid"):
             self.assertNotIn(retired, active)
 
     def test_phase2_top_port_shape_has_three_axis_and_six_limits(self) -> None:
-        top = (ROOT / "src/top/prod2u_p4_normal_v3_top.v").read_text(encoding="ascii")
+        top_path = None
+        for base in (ROOT, ROOT / "source"):
+            candidate = base / "src" / "top" / "prod2u_p4_normal_v3_top.v"
+            if candidate.is_file():
+                top_path = candidate
+                break
+        self.assertIsNotNone(top_path)
+        assert top_path is not None
+        top = top_path.read_text(encoding="ascii")
         self.assertIn("output wire [7:0] ptc_pwm_out", top)
         self.assertIn("output wire [3:0] fan_pwm_out", top)
         for port in ("z_step", "z_dir", "x_limit_ls", "x_limit_hs", "z_limit_hs"):

+ 43 - 7
tests/unit/package_review_compact_contract.py

@@ -45,8 +45,9 @@ REVIEW_COMPACT_EXCLUDED_BASENAMES: tuple[tuple[str, str], ...] = (
 REVIEW_COMPACT_BLOCKED_SUFFIXES = frozenset({".pdf", ".brd", ".dsn", ".sch"})
 REVIEW_COMPACT_FIXTURE_ALLOW_PREFIXES = (
     "tests/board_viewer/fixtures/",
-    "tests/fixtures/",
 )
+# Adversarial payloads are temp-generated only; never treat them as allowlisted fixtures.
+REVIEW_COMPACT_ADVERSARIAL_PAYLOAD_PREFIX = "tests/fixtures/package_adversarial/payloads"
 
 # Vendor installer / license archive name patterns (basename, casefold).
 VENDOR_INSTALLER_PREFIXES = ("bw_release_", "td_release_", "oss-cad-suite")
@@ -128,6 +129,9 @@ def intended_review_compact_exclusion_reason(relative: str, *, is_dir: bool) ->
     name = _basename(relative)
     suffix = _suffix(relative)
 
+    if is_under(lower, REVIEW_COMPACT_ADVERSARIAL_PAYLOAD_PREFIX):
+        return "adversarial_fixture_payload"
+
     if name == ".env" or (
         name.startswith(".env.")
         and not name.endswith((".example", ".sample", ".template", ".dist"))
@@ -188,17 +192,19 @@ def assert_no_full_git_bundle(members: list[str], *, testcase) -> None:
 
 
 def adversarial_private_key_bytes() -> bytes:
-    """Load PEM-like fixture bytes without embedding secret markers in this module.
+    """Synthetic private-key marker bytes (generated in-memory; not a long-term fixture).
 
-    The payload file basename ``id_ed25519`` is path-excluded from packaging; keeping
-    the PEM text out of this helper avoids content-scan false positives on the helper.
+    Armor tokens are concatenated at runtime so the helper source does not contain a
+    contiguous PEM header for naive content greps. Basename ``id_ed25519`` is also
+    path-excluded from packaging.
     """
-    path = ROOT / "tests" / "fixtures" / "package_adversarial" / "payloads" / "id_ed25519"
-    return path.read_bytes()
+    begin = b"-----BEGIN " + b"OPENSSH PRIVATE KEY-----"
+    end = b"-----END " + b"OPENSSH PRIVATE KEY-----"
+    return begin + b"\nADV-NOT-A-REAL-KEY\n" + end + b"\n"
 
 
 def adversarial_fixture_relatives() -> dict[str, bytes]:
-    """Canonical sneaky paths planted into disposable source trees."""
+    """Canonical sneaky paths planted into disposable temp trees (not long-term on disk)."""
     return {
         "reference/original/board/sneaky-main.brd": b"%ADV-BRD-FIXTURE%\n",
         "reference/original/schematics/sneaky-schematic.pdf": b"%PDF-1.4 ADV-FIXTURE\n",
@@ -229,3 +235,33 @@ def adversarial_fixture_relatives() -> dict[str, bytes]:
         "src/rtl/core.v": b"module core; endmodule\n",
         "tests/board_viewer/fixtures/keep-small.txt": b"allowlisted fixture\n",
     }
+
+
+def materialize_adversarial_payloads(payload_root: Path) -> dict[str, Path]:
+    """Write synthetic adversarial payloads into a temp directory for tests."""
+    mapping = {
+        "sneaky-schematic.pdf": b"%PDF-1.4 ADV-FIXTURE\n",
+        "sneaky-main.brd": b"%ADV-BRD-FIXTURE%\n",
+        "sneaky.dsn": b"(dsn sneaky)\n",
+        "td_release_2026.1_fake.zip": b"PK\x03\x04ADV-TD-RELEASE",
+        "vendor-license.zip": b"PK\x03\x04ADV-LICENSE-ZIP",
+        "Anlogic.lic": b"ADV-LICENSE-KEY\n",
+        "id_ed25519": adversarial_private_key_bytes(),
+        "dotenv.env": b"SECRET=should-never-pack\n",
+        "unicode-cafe-nfc.txt": "café\n".encode("utf-8"),
+        "unicode-cafe-nfd.txt": "café\n".encode("utf-8"),
+    }
+    payload_root.mkdir(parents=True, exist_ok=True)
+    written: dict[str, Path] = {}
+    for name, data in mapping.items():
+        path = payload_root / name
+        path.write_bytes(data)
+        written[name] = path
+    # Minimal zip with a traversal-like member name for fail-closed exercises.
+    import zipfile
+
+    trav = payload_root / "traversal-member.zip"
+    with zipfile.ZipFile(trav, "w") as archive:
+        archive.writestr("../escape.txt", b"ADV-TRAVERSAL\n")
+    written["traversal-member.zip"] = trav
+    return written

+ 126 - 60
tests/unit/test_activity_docs_truth.py

@@ -1,9 +1,9 @@
 #!/usr/bin/env python3
-"""Fail-closed consistency gates for active status docs vs final closure truth.
+"""Fail-closed consistency gates for active status docs vs current 3-axis truth.
 
-Activity docs must agree on FINAL_COMMIT, matrix (incl. cocotb), TD built commit,
-bitstream SHA-256, hardware not_run, and physical blockers. Stale tip / fail-matrix
-/ old-bitstream claims must not reappear as current truth.
+Activity docs must assert X/Y/Z, six limits, 450/5000/500, permanent EN, hard
+truncate, and bound tip-TD/bitstream identity. Stale 2-axis/solenoid IO,
+runtime-limit-inert policy, and old bit/commit-as-current claims must not reappear.
 """
 
 from __future__ import annotations
@@ -17,14 +17,18 @@ from pathlib import Path
 
 ROOT = Path(__file__).resolve().parents[2]
 
-FINAL_COMMIT = "da7b05a340a096ccfb4ccf4f656eb3efe6a957e2"
-FINAL_COMMIT_SHORT = "da7b05a"
-TD_BUILT_COMMIT = "8f28660f176e18e97a015e66bdae0ff747e0fc63"
-TD_BUILT_SHORT = "8f28660"
-BITSTREAM_SHA256 = "ce3157c593858c33c36e9805fe477a3955ba6f380b4a04f5f9236d3fbddb376d"
-BITSTREAM_SHORT = "ce3157c5"
-CLOSURE_RUN_ID = "grok45-final-20260805T013238Z"
-MATRIX_RUN_ID = "c43c4201f74517c50bd349fce87f9e0b"
+ARTIFACT_SOURCE_COMMIT = "0de9f93988344e3c11931482902196b02ac7a713"
+ARTIFACT_SOURCE_SHORT = "0de9f939"
+BITSTREAM_SHA256 = (
+    "54ce967da4dce40d7cbb6821eb1e8d7d95b3bdda27a7edf30cbcad7131cb667c"
+)
+BITSTREAM_SHORT = "54ce967d"
+TD_TOOL_BUILD = "6.2.2.200067"
+TRUNCATE_SEMANTICS = "truncate_current_high_pulse_immediately_after_synchronized_limit"
+PRIOR_BIT_SHORT = "45f548ab"
+PRIOR_BIT_COMMIT = "bb515af"
+BASELINE_TIP_SHORT = "cdf9f76"
+PENDING_MARKER = "pending final tip TD"
 
 ACTIVITY_DOCS = (
     "README.zh-CN.md",
@@ -33,57 +37,102 @@ ACTIVITY_DOCS = (
     "OPEN_QUESTIONS.md",
     "PLAN.md",
     "docs/TD_USAGE.zh-CN.md",
+    "docs/HARDWARE_TEST_ORDER_WAVEFORMS.zh-CN.md",
 )
 
-# Must appear in every activity doc (full or unambiguous short form).
+# Must appear in every activity doc.
 PER_DOC_MARKERS = (
-    FINAL_COMMIT_SHORT,
-    TD_BUILT_SHORT,
+    ARTIFACT_SOURCE_SHORT,
     BITSTREAM_SHORT,
+    PRIOR_BIT_SHORT,
+    PRIOR_BIT_COMMIT,
 )
 
 # Must appear somewhere in the activity-doc corpus.
 CORPUS_REQUIRED = (
-    FINAL_COMMIT,
-    TD_BUILT_COMMIT,
+    ARTIFACT_SOURCE_COMMIT,
     BITSTREAM_SHA256,
-    CLOSURE_RUN_ID,
-    MATRIX_RUN_ID,
-    "cocotb",
-    "intake",
-    "A11",
-    "CON124",
+    TD_TOOL_BUILD,
+    TRUNCATE_SEMANTICS,
+    "permanent_high",
+    "450",
+    "5000",
+    "500",
+    "CON104",
+    "CON105",
+    "CON106",
+    "CON120",
+    "CON12",
+    "CON129",
+    BASELINE_TIP_SHORT,
+    PRIOR_BIT_SHORT,
+    PRIOR_BIT_COMMIT,
+    "ARTIFACT-SOURCE-COMMIT",
 )
 
-# Superseded identifiers that must not be presented as current FINAL/tip truth.
+# Superseded identifiers / policies that must not be presented as current tip truth.
 STALE_AS_CURRENT = (
     (
         re.compile(
-            r"(?i)(?:FINAL_COMMIT|文档对齐 tip|worktree 起点 tip|Full matrix @ tip)\s*[|::]*\s*`?f82c41e"
+            r"(?i)FINAL_COMMIT\s*[|::=]*\s*`?da7b05a[0-9a-f]*`?"
         ),
-        "stale tip f82c41e presented as current FINAL/tip",
+        "stale 2-axis FINAL_COMMIT da7b05a presented as current",
     ),
     (
-        re.compile(r"(?i)最近矩阵绑定 commit\s*[|::]*\s*`?6f32493"),
-        "stale fail-matrix 6f32493 presented as current bind",
+        re.compile(
+            r"(?i)Bitstream SHA-256\s*[|::=]*\s*`?ce3157c5[0-9a-f]*`?"
+        ),
+        "stale bitstream ce3157c5 presented as current",
     ),
     (
         re.compile(
-            r"(?i)(?:TD built commit|最近 TD pass|TD \+ bitstream)[^\n]{0,80}`?ead5a3e"
+            r"(?i)TD built commit\s*[|::=]*\s*`?8f28660[0-9a-f]*`?"
         ),
-        "stale TD ead5a3e presented as current TD evidence",
+        "stale TD 8f28660 presented as current",
     ),
     (
-        re.compile(r"(?i)bitstream SHA-256\s*`?a7b5c119"),
-        "stale bitstream a7b5c119 presented as current",
+        re.compile(
+            r"(?i)(?:(?:as|@)\s*tip|tip\s+(?:bitstream|bit|TD|证据)|"
+            r"当前\s*(?:tip\s*)?(?:bitstream|位流|闭包证据))\s*[`:]?\s*45f548ab"
+        ),
+        "prior bit 45f548ab presented as tip/current",
+    ),
+    (
+        re.compile(
+            r"(?i)(?:runtime\s+limits?\s+are\s+inert|"
+            r"(?<!not\s)(?<!non-)runtime\s+limit\s+inert|"
+            r"限位对普通\s*jog\s*\*?惰性\*?|"
+            r"完成后限位对普通 jog\s*\*?惰性\*?)"
+        ),
+        "runtime limit inert presented as current policy",
+    ),
+    (
+        re.compile(
+            r"(?i)(?:进风(?:门)?默认\*?电磁铁\*?|intake_solenoid_out\s*[::].*\bP2\b|"
+            r"偏移\s*8\s*进风门\s*\|\s*默认\*\*电磁铁\*\*)"
+        ),
+        "solenoid intake presented as active product path",
     ),
     (
-        re.compile(r"(?i)cocotb[^\n]{0,40}\*\*fail\*\*"),
-        "cocotb still marked fail in activity docs",
+        re.compile(
+            r"(?i)(?:X\s*限位[^\n]{0,40}CON68|Y\s*限位[^\n]{0,40}CON34|"
+            r"CON68\.3\s*/\s*M6|CON34\.3\s*/\s*F9|"
+            r"X\s*电机[^\n]{0,20}CON139|Y\s*电机[^\n]{0,20}CON138|"
+            r"进风电磁铁[^\n]{0,20}CON141)"
+        ),
+        "obsolete CON68/CON34/CON138-141 mapping presented as active probe",
+    ),
+    (
+        re.compile(r"(?i)(?:FINAL_COMMIT|文档对齐 tip|worktree 起点 tip|Full matrix @ tip)\s*[|::]*\s*`?f82c41e"),
+        "stale tip f82c41e presented as current FINAL/tip",
+    ),
+    (
+        re.compile(r"(?i)bitstream SHA-256\s*`?a7b5c119"),
+        "stale bitstream a7b5c119 presented as current",
     ),
     (
-        re.compile(r"(?i)Full matrix @ `?6f32493`?[^\n]{0,40}\*\*fail\*\*"),
-        "full matrix still marked fail at stale commit",
+        re.compile(re.escape(PENDING_MARKER)),
+        "unbound pending marker still present in activity docs after tip TD bind",
     ),
 )
 
@@ -103,7 +152,7 @@ class ActivityDocsTruthTests(unittest.TestCase):
         missing = [rel for rel in ACTIVITY_DOCS if not (ROOT / rel).is_file()]
         self.assertEqual(missing, [], f"missing activity docs: {missing}")
 
-    def test_each_activity_doc_carries_final_td_bitstream_markers(self) -> None:
+    def test_each_activity_doc_carries_bound_identity_and_prior_bit_markers(self) -> None:
         for rel in ACTIVITY_DOCS:
             text = _read(rel)
             for marker in PER_DOC_MARKERS:
@@ -113,32 +162,25 @@ class ActivityDocsTruthTests(unittest.TestCase):
                     f"{rel} missing required marker {marker!r}",
                 )
 
-    def test_activity_docs_agree_on_closure_corpus_fields(self) -> None:
+    def test_activity_docs_agree_on_three_axis_corpus(self) -> None:
         corpus = "\n".join(_read(rel) for rel in ACTIVITY_DOCS)
         for marker in CORPUS_REQUIRED:
             self.assertIn(marker, corpus, f"activity corpus missing {marker!r}")
 
-        # Matrix / cocotb / hardware / blockers
-        self.assertRegex(corpus, r"(?i)cocotb[^\n]{0,80}pass")
-        self.assertRegex(corpus, r"(?i)(?:Full matrix|全矩阵)[^\n]{0,80}pass")
+        self.assertRegex(corpus, r"(?i)(?:X\s*/\s*Y\s*/\s*Z|三轴)")
+        self.assertRegex(corpus, r"(?i)(?:六限位|six limits)")
+        self.assertRegex(corpus, r"(?i)(?:硬截断|立即截断|hard truncate)")
         self.assertRegex(corpus, r"(?i)(?:Hardware|硬件)[^\n]{0,80}(?:NOT RUN|not_run)")
-        self.assertRegex(corpus, r"(?i)solenoid")
-        self.assertRegex(corpus, r"(?i)(?:silkscreen|丝印)")
-        self.assertRegex(corpus, r"A11")
-        self.assertRegex(corpus, r"CON124")
-
-        # Cross-doc agreement: every doc that mentions FINAL_COMMIT uses the same hash.
-        for rel in ACTIVITY_DOCS:
-            text = _read(rel)
-            if "FINAL_COMMIT" in text or "da7b05a" in text:
-                self.assertIn(FINAL_COMMIT_SHORT, text)
-                if re.search(r"da7b05a[0-9a-f]*", text):
-                    matches = set(re.findall(r"da7b05a[0-9a-f]*", text))
-                    for match in matches:
-                        self.assertTrue(
-                            FINAL_COMMIT.startswith(match),
-                            f"{rel} has unexpected commit token {match!r}",
-                        )
+        self.assertRegex(
+            corpus,
+            r"(?i)45f548ab[^\n]{0,80}bb515af|bb515af[^\n]{0,80}45f548ab",
+        )
+        # Active mapping must include 3-axis connectors somewhere.
+        self.assertRegex(corpus, r"CON104")
+        self.assertRegex(corpus, r"CON105")
+        self.assertRegex(corpus, r"CON106")
+        self.assertRegex(corpus, r"CON120")
+        self.assertRegex(corpus, r"CON129")
 
     def test_activity_docs_reject_stale_current_claims(self) -> None:
         for rel in ACTIVITY_DOCS:
@@ -149,6 +191,27 @@ class ActivityDocsTruthTests(unittest.TestCase):
                     f"{rel}: {message}",
                 )
 
+    def test_obsolete_io_mentions_are_negated(self) -> None:
+        """If obsolete connectors appear, they must be clearly non-active."""
+        obsolete = ("CON68", "CON34", "CON138", "CON139", "CON140", "CON141", "solenoid", "电磁铁")
+        negate = re.compile(
+            r"(?i)(?:不是|禁止|无|not\b|historical|归档|退役|obsolete|非活动|not\s+active|"
+            r"已迁|作废|superseded|forbid)"
+        )
+        for rel in ACTIVITY_DOCS:
+            text = _read(rel)
+            for token in obsolete:
+                if token.lower() not in text.lower() and token not in text:
+                    continue
+                # Allow token only in sentences/lines that negate active use.
+                for line in text.splitlines():
+                    if token.lower() not in line.lower() and token not in line:
+                        continue
+                    self.assertIsNotNone(
+                        negate.search(line),
+                        f"{rel}: obsolete token {token!r} on non-negated line: {line!r}",
+                    )
+
     def test_root_runtime_residue_not_tracked_or_present(self) -> None:
         for name in ROOT_RESIDUE:
             path = ROOT / name
@@ -163,10 +226,14 @@ class ActivityDocsTruthTests(unittest.TestCase):
         ):
             self.assertIn(token, ignored, f".gitignore missing {token!r}")
 
-        # Migrated historical probe must exist; active root copy must not.
         hist = ROOT / "docs/historical/evidence-batch-summary-linux-continue-20260804T155114Z.txt"
         self.assertTrue(hist.is_file(), "expected migrated evidence-batch summary")
 
+        hist_readme = _read("docs/historical/README.md")
+        self.assertIn(ARTIFACT_SOURCE_SHORT, hist_readme + _read("FINAL_DELIVERY_REPORT.md"))
+        self.assertIn("2-axis", hist_readme.lower() + hist_readme)
+        self.assertRegex(hist_readme, r"(?i)not.*old solenoid|not.*solenoid/2-axis|不是.*solenoid|不是.*电磁铁|Root activity docs are \*\*not\*\*")
+
     def test_cleanup_runtime_residue_helper_removes_root_probes(self) -> None:
         script = ROOT / "tools/cleanup_runtime_residue.py"
         self.assertTrue(script.is_file())
@@ -180,7 +247,6 @@ class ActivityDocsTruthTests(unittest.TestCase):
             (fake_root / ".run_id_linux").write_text("run\n", encoding="utf-8")
             (fake_root / "evidence-batch-summary.txt").write_text("old\n", encoding="utf-8")
             (fake_root / "td_20260804_probe.log").write_text("log\n", encoding="utf-8")
-            # Nested path must not be deleted.
             nested = fake_root / "runs" / "td_20260804_probe.log"
             nested.parent.mkdir()
             nested.write_text("keep\n", encoding="utf-8")

+ 180 - 0
tests/unit/test_compact_package_selftest.py

@@ -0,0 +1,180 @@
+#!/usr/bin/env python3
+"""Unit tests for compact package selftest helpers and binding path safety."""
+
+from __future__ import annotations
+
+import importlib.util
+import json
+import tempfile
+import unittest
+import zipfile
+from pathlib import Path
+from types import ModuleType
+
+
+ROOT = Path(__file__).resolve().parents[2]
+TOOLS = ROOT / "tools"
+
+
+def load_selftest() -> ModuleType:
+    path = TOOLS / "compact_package_selftest.py"
+    spec = importlib.util.spec_from_file_location("compact_package_selftest_lane_d", path)
+    assert spec is not None and spec.loader is not None
+    module = importlib.util.module_from_spec(spec)
+    spec.loader.exec_module(module)
+    return module
+
+
+class CompactPackageSelftestUnitTests(unittest.TestCase):
+    maxDiff = None
+
+    def test_path_safety_rejects_traversal_and_absolute(self) -> None:
+        selftest = load_selftest()
+        failures = selftest.check_path_safety(
+            [
+                "CPLD/source/src/ok.v",
+                "CPLD/source/../escape.v",
+                "/etc/passwd",
+                "CPLD\\bad\\slash.v",
+            ]
+        )
+        self.assertTrue(any(item.startswith("unsafe_path_segment:") for item in failures))
+        self.assertTrue(any(item.startswith("absolute_path:") for item in failures))
+        self.assertTrue(any(item.startswith("backslash_path:") for item in failures))
+
+    def test_forbidden_members_catch_pdf_and_adversarial_payload(self) -> None:
+        selftest = load_selftest()
+        failures = selftest.check_forbidden_members(
+            [
+                "CPLD/source/docs/leak.pdf",
+                "CPLD/source/tests/fixtures/package_adversarial/payloads/sneaky-main.brd",
+                "CPLD/source/src/ok.v",
+                "CPLD/meta/td-source-closure-binding.json",
+            ]
+        )
+        self.assertTrue(any("forbidden_suffix" in item for item in failures))
+        self.assertTrue(any("adversarial_payload_in_compact" in item for item in failures))
+
+    def test_selftest_on_minimal_synthetic_package(self) -> None:
+        selftest = load_selftest()
+        import hashlib
+
+        with tempfile.TemporaryDirectory() as tmp:
+            package_dir = Path(tmp) / "pkg"
+            package_dir.mkdir()
+            zip_path = package_dir / "demo.zip"
+            with zipfile.ZipFile(zip_path, "w") as archive:
+                archive.writestr(
+                    "CPLD/meta/td-source-closure-binding.json",
+                    json.dumps({"schema": "cpld-td-source-closure-binding-v1", "status": "hook_ready"}),
+                )
+                archive.writestr("CPLD/source/src/ok.v", b"module ok; endmodule\n")
+                archive.writestr(
+                    "CPLD/meta/git/HEAD.txt",
+                    b"cdf9f76b22d75f1c2bc1e7ff99a49d2897a8dcb7\n",
+                )
+                archive.writestr("CPLD/meta/git/tree-manifest.json", b"{}\n")
+                archive.writestr(
+                    "CPLD/meta/git/sanitized-snapshot-status.json",
+                    b'{"status":"pass","requested":false}\n',
+                )
+                archive.writestr("CPLD/evidence/.keep", b"\n")
+
+            files = [
+                {
+                    "path": "meta/td-source-closure-binding.json",
+                    "sha256": hashlib.sha256(
+                        json.dumps(
+                            {"schema": "cpld-td-source-closure-binding-v1", "status": "hook_ready"}
+                        ).encode()
+                    ).hexdigest(),
+                    "size": len(
+                        json.dumps(
+                            {"schema": "cpld-td-source-closure-binding-v1", "status": "hook_ready"}
+                        ).encode()
+                    ),
+                },
+                {
+                    "path": "source/src/ok.v",
+                    "sha256": hashlib.sha256(b"module ok; endmodule\n").hexdigest(),
+                    "size": len(b"module ok; endmodule\n"),
+                },
+                {
+                    "path": "meta/git/HEAD.txt",
+                    "sha256": hashlib.sha256(
+                        b"cdf9f76b22d75f1c2bc1e7ff99a49d2897a8dcb7\n"
+                    ).hexdigest(),
+                    "size": len(b"cdf9f76b22d75f1c2bc1e7ff99a49d2897a8dcb7\n"),
+                },
+                {
+                    "path": "meta/git/tree-manifest.json",
+                    "sha256": hashlib.sha256(b"{}\n").hexdigest(),
+                    "size": 3,
+                },
+                {
+                    "path": "meta/git/sanitized-snapshot-status.json",
+                    "sha256": hashlib.sha256(
+                        b'{"status":"pass","requested":false}\n'
+                    ).hexdigest(),
+                    "size": len(b'{"status":"pass","requested":false}\n'),
+                },
+                {
+                    "path": "evidence/.keep",
+                    "sha256": hashlib.sha256(b"\n").hexdigest(),
+                    "size": 1,
+                },
+            ]
+            # Recompute sizes/hashes from ZIP members for accuracy.
+            with zipfile.ZipFile(zip_path) as archive:
+                rebuilt = []
+                for name in archive.namelist():
+                    if name.endswith("/"):
+                        continue
+                    data = archive.read(name)
+                    rel = name[len("CPLD/") :] if name.startswith("CPLD/") else name
+                    rebuilt.append(
+                        {
+                            "path": rel,
+                            "sha256": hashlib.sha256(data).hexdigest(),
+                            "size": len(data),
+                        }
+                    )
+            index = {
+                "profile": "review-compact",
+                "volumes": [{"file": zip_path.name, "sha256": "x"}],
+                "files": rebuilt,
+                "content_dedup": [],
+            }
+            (package_dir / "HANDOFF-INDEX.json").write_text(
+                json.dumps(index), encoding="utf-8"
+            )
+            zip_digest = hashlib.sha256(zip_path.read_bytes()).hexdigest()
+            index["volumes"][0]["sha256"] = zip_digest
+            (package_dir / "HANDOFF-INDEX.json").write_text(
+                json.dumps(index), encoding="utf-8"
+            )
+            sums = [
+                f"{hashlib.sha256((package_dir / 'HANDOFF-INDEX.json').read_bytes()).hexdigest()}  HANDOFF-INDEX.json",
+                f"{zip_digest}  {zip_path.name}",
+            ]
+            # HANDOFF-INDEX changed after first hash — rewrite sums after final index write.
+            final_index_bytes = (package_dir / "HANDOFF-INDEX.json").read_bytes()
+            sums = [
+                f"{hashlib.sha256(final_index_bytes).hexdigest()}  HANDOFF-INDEX.json",
+                f"{zip_digest}  {zip_path.name}",
+            ]
+            (package_dir / "SHA256SUMS.txt").write_text("\n".join(sums) + "\n", encoding="ascii")
+
+            report = selftest.run_compact_package_selftest(
+                package_dir,
+                skip_software=True,
+            )
+            # Path/forbidden/hash should pass; detached software skipped.
+            self.assertEqual(report["checks"]["manifest_and_hashes"], "pass")
+            self.assertEqual(report["checks"]["path_safety"], "pass")
+            self.assertEqual(report["checks"]["forbidden_files"], "pass")
+            self.assertEqual(report["binding_status"], "present")
+
+
+if __name__ == "__main__":
+    unittest.main()

+ 23 - 13
tests/unit/test_package_adversarial_compact.py

@@ -33,6 +33,7 @@ from package_review_compact_contract import (  # noqa: E402
     intended_review_compact_exclusion_reason,
     load_analyzer,
     load_handoff,
+    materialize_adversarial_payloads,
     path_looks_like_full_git_bundle,
     require_review_compact,
     review_compact_available,
@@ -40,7 +41,6 @@ from package_review_compact_contract import (  # noqa: E402
 
 ROOT = Path(__file__).resolve().parents[2]
 FIXTURE_ROOT = ROOT / "tests" / "fixtures" / "package_adversarial"
-PAYLOAD_ROOT = FIXTURE_ROOT / "payloads"
 
 
 def write_file(root: Path, relative: str, data: bytes = b"fixture\n") -> Path:
@@ -72,6 +72,7 @@ class ReviewCompactContractUnitTests(unittest.TestCase):
         self.assertTrue(manifest_path.is_file())
         payload = json.loads(manifest_path.read_text(encoding="utf-8"))
         self.assertEqual(payload["schema"], "prod2u-package-adversarial-fixtures-v1")
+        self.assertEqual(payload.get("payload_policy"), "generate_in_temp_dir")
         ids = {item["id"] for item in payload["vectors"]}
         for required in {
             "pdf-schematic",
@@ -84,10 +85,14 @@ class ReviewCompactContractUnitTests(unittest.TestCase):
             "path-traversal-zip",
         }:
             self.assertIn(required, ids)
-        for item in payload["vectors"]:
-            path = FIXTURE_ROOT / item["path"]
-            self.assertTrue(path.is_file(), f"missing fixture payload {path}")
-            self.assertGreater(path.stat().st_size, 0, f"empty fixture payload {path}")
+        # Payloads are generated in temp; long-term payloads/ must not be required.
+        self.assertFalse((FIXTURE_ROOT / "payloads").exists())
+        with tempfile.TemporaryDirectory() as tmp:
+            written = materialize_adversarial_payloads(Path(tmp) / "payloads")
+            for item in payload["vectors"]:
+                name = item.get("temp_name") or Path(str(item.get("path", ""))).name
+                self.assertIn(name, written)
+                self.assertGreater(written[name].stat().st_size, 0, name)
 
     def test_intended_policy_excludes_sneaky_reference_and_secrets(self) -> None:
         cases = {
@@ -252,10 +257,11 @@ class TipFailClosedAdversarialTests(unittest.TestCase):
         handoff = load_handoff()
         with tempfile.TemporaryDirectory() as tmp:
             source = Path(tmp) / "source"
+            payloads = materialize_adversarial_payloads(Path(tmp) / "payloads")
             archive = write_file(
                 source,
                 "docs/traversal-member.zip",
-                (PAYLOAD_ROOT / "traversal-member.zip").read_bytes(),
+                payloads["traversal-member.zip"].read_bytes(),
             )
             # Tip analysis excludes bare .zip; plant under a path that handoff scan keeps
             # so archive member traversal is exercised via scan_candidate_archive.
@@ -563,13 +569,17 @@ class ReviewCompactProfileAdversarialTests(unittest.TestCase):
                 self.assertEqual(offenders, [], f"leaked {needle}: {offenders}")
 
 
-class DiskFixturePayloadTests(unittest.TestCase):
-    def test_payload_private_key_and_traversal_bytes(self) -> None:
-        key = (PAYLOAD_ROOT / "id_ed25519").read_bytes()
-        self.assertIn(b"PRIVATE KEY", key)
-        with zipfile.ZipFile(PAYLOAD_ROOT / "traversal-member.zip") as archive:
-            members = archive.namelist()
-        self.assertTrue(any(".." in name or name.startswith("../") for name in members))
+class TempAdversarialPayloadTests(unittest.TestCase):
+    def test_payload_private_key_and_traversal_bytes_generated_in_temp(self) -> None:
+        with tempfile.TemporaryDirectory() as tmp:
+            payloads = materialize_adversarial_payloads(Path(tmp) / "payloads")
+            key = payloads["id_ed25519"].read_bytes()
+            self.assertIn(b"PRIVATE KEY", key)
+            with zipfile.ZipFile(payloads["traversal-member.zip"]) as archive:
+                members = archive.namelist()
+            self.assertTrue(any(".." in name or name.startswith("../") for name in members))
+            # Compact must not rely on a long-lived payloads/ tree in the repo.
+            self.assertFalse((FIXTURE_ROOT / "payloads").exists())
 
 
 if __name__ == "__main__":

+ 4 - 1
tests/unit/test_startup_close_seek.py

@@ -27,7 +27,10 @@ class StartupCloseSeekContractTests(unittest.TestCase):
         self.assertEqual(startup["step_rate_hz"], 1000)
         self.assertEqual(startup["axis_order"], ["x", "y", "z"])
         self.assertTrue(startup["limit_stop_during_move"])
-        self.assertEqual(startup["stop_semantics"], "finish_current_high_pulse_then_no_next_rising_edge")
+        self.assertEqual(
+            startup["stop_semantics"],
+            "truncate_current_high_pulse_immediately_after_synchronized_limit",
+        )
         self.assertEqual(startup["additional_rising_edges_after_synchronized_limit"], 0)
         self.assertTrue(startup["runtime_limit_use"])
 

+ 1 - 2
tests/unit/test_startup_mutation.py

@@ -51,7 +51,6 @@ class StartupMutationTests(unittest.TestCase):
 module tb;
     reg clk = 1'b0;
     reg rst_n = 1'b0;
-    reg tick_500us = 1'b0;
     reg [2:0] limit_ls = 3'b000;
     reg [2:0] limit_hs = 3'b000;
     reg limit_sync_valid = 1'b0;
@@ -70,7 +69,7 @@ module tb;
         .BACKOFF_STEPS(4),
         .AXIS_COUNT(3)
     ) dut (
-        .clk(clk), .rst_n(rst_n), .tick_500us(tick_500us),
+        .clk(clk), .rst_n(rst_n),
         .limit_sync_valid(limit_sync_valid),
         .limit_ls_sync(limit_ls), .limit_hs_sync(limit_hs),
         .startup_done(startup_done), .motor_start(motor_start),

+ 94 - 0
tests/unit/test_td_source_closure_binding.py

@@ -0,0 +1,94 @@
+#!/usr/bin/env python3
+"""Tests for TD source-closure binding (hook_ready → bound)."""
+
+from __future__ import annotations
+
+import hashlib
+import json
+import os
+import subprocess
+import tempfile
+import unittest
+from pathlib import Path
+from types import ModuleType
+
+
+ROOT = Path(__file__).resolve().parents[2]
+TOOLS = ROOT / "tools"
+
+
+def load_handoff() -> ModuleType:
+    if str(TOOLS) not in __import__("sys").path:
+        __import__("sys").path.insert(0, str(TOOLS))
+    import package_agent_handoff as handoff  # noqa: WPS433
+
+    return handoff
+
+
+class TdSourceClosureBindingTests(unittest.TestCase):
+    maxDiff = None
+
+    def test_hook_ready_without_bitstream(self) -> None:
+        handoff = load_handoff()
+        binding = handoff.build_td_source_closure_binding(ROOT)
+        self.assertIn(binding["status"], {"hook_ready", "hook_partial"})
+        self.assertEqual(binding["bitstream_binding"], "deferred_to_evidence_receipt")
+        self.assertIsNone(binding["bitstream"])
+        self.assertTrue(
+            str(binding.get("commit_full") or "").startswith("cdf9f76")
+            or len(str(binding.get("commit_full") or "")) == 40
+        )
+        self.assertIsNotNone(binding.get("td_source_manifest_sha256"))
+        self.assertIsNotNone(binding.get("project_config_sha256"))
+
+    def test_bound_with_real_bitstream_and_report(self) -> None:
+        handoff = load_handoff()
+        with tempfile.TemporaryDirectory() as tmp:
+            temp = Path(tmp)
+            bit = temp / "fw.bit"
+            payload = b"FAKE-BITSTREAM-FOR-BINDING-TEST\n" + os.urandom(64)
+            bit.write_bytes(payload)
+            report = temp / "final_td_report.json"
+            report.write_text(
+                json.dumps({"status": "pass", "schema": "test-td-report"}),
+                encoding="utf-8",
+            )
+            commit = subprocess.check_output(
+                ["git", "-C", str(ROOT), "rev-parse", "HEAD"],
+                text=True,
+            ).strip()
+            binding = handoff.build_td_source_closure_binding(
+                ROOT,
+                bitstream_path=bit,
+                td_report_paths=[report],
+                commit=commit,
+            )
+            self.assertEqual(binding["status"], "bound")
+            self.assertEqual(binding["bitstream_binding"], "bound")
+            self.assertEqual(binding["commit_full"], commit)
+            digest = hashlib.sha256(payload).hexdigest()
+            self.assertEqual(binding["bitstream"]["sha256"], digest)
+            self.assertEqual(len(binding["bitstream"]["sha256"]), 64)
+            self.assertEqual(len(binding["td_reports"]), 1)
+            self.assertEqual(binding["td_reports"][0]["status"], "present")
+
+    def test_require_bitstream_fails_closed(self) -> None:
+        handoff = load_handoff()
+        binding = handoff.build_td_source_closure_binding(
+            ROOT,
+            require_bitstream=True,
+        )
+        self.assertEqual(binding["status"], "bind_failed")
+        self.assertEqual(binding["bitstream_binding"], "missing_bitstream")
+
+    def test_post_staging_inventory_hook_blocks_before_staging(self) -> None:
+        handoff = load_handoff()
+        blocked = handoff.run_post_staging_reference_inventory_hook(
+            ROOT,
+            staging_complete=False,
+        )
+        self.assertEqual(blocked["status"], "blocked_staging_incomplete")
+
+
+if __name__ == "__main__":
+    unittest.main()

+ 88 - 0
tests/unit/test_test_profiles.py

@@ -0,0 +1,88 @@
+#!/usr/bin/env python3
+"""Unit tests for the three software test profiles."""
+
+from __future__ import annotations
+
+import importlib.util
+import os
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+from types import ModuleType
+
+
+ROOT = Path(__file__).resolve().parents[2]
+TOOLS = ROOT / "tools"
+
+
+def load_profiles() -> ModuleType:
+    path = TOOLS / "test_profiles.py"
+    spec = importlib.util.spec_from_file_location("test_profiles_lane_d", path)
+    assert spec is not None and spec.loader is not None
+    module = importlib.util.module_from_spec(spec)
+    spec.loader.exec_module(module)
+    return module
+
+
+class TestProfilesUnitTests(unittest.TestCase):
+    maxDiff = None
+
+    def test_profiles_are_registered(self) -> None:
+        profiles = load_profiles()
+        self.assertEqual(
+            profiles.TEST_PROFILES,
+            {
+                "live-repository",
+                "review-compact-detached",
+                "reference-regeneration",
+            },
+        )
+
+    def test_env_override_and_legacy_rtl_gate(self) -> None:
+        profiles = load_profiles()
+        old = os.environ.get(profiles.ENV_TEST_PROFILE)
+        try:
+            os.environ[profiles.ENV_TEST_PROFILE] = "review-compact-detached"
+            self.assertEqual(profiles.detect_test_profile(ROOT), profiles.REVIEW_COMPACT_DETACHED)
+            self.assertFalse(profiles.requires_reference_legacy_rtl())
+            self.assertNotIn(
+                "reference/original/legacy_rtl/prod2u_p4_normal_v3_top_legacy.v",
+                profiles.structure_required_paths(),
+            )
+
+            os.environ[profiles.ENV_TEST_PROFILE] = "live-repository"
+            self.assertTrue(profiles.requires_reference_legacy_rtl())
+            self.assertIn(
+                "reference/original/legacy_rtl/prod2u_p4_normal_v3_top_legacy.v",
+                profiles.structure_required_paths(),
+            )
+
+            os.environ[profiles.ENV_TEST_PROFILE] = "reference-regeneration"
+            self.assertTrue(profiles.allows_reference_regeneration())
+            self.assertTrue(profiles.requires_reference_legacy_rtl())
+        finally:
+            if old is None:
+                os.environ.pop(profiles.ENV_TEST_PROFILE, None)
+            else:
+                os.environ[profiles.ENV_TEST_PROFILE] = old
+
+    def test_detached_tree_infers_compact_profile(self) -> None:
+        profiles = load_profiles()
+        old = os.environ.pop(profiles.ENV_TEST_PROFILE, None)
+        try:
+            with tempfile.TemporaryDirectory() as tmp:
+                root = Path(tmp)
+                (root / "source").mkdir()
+                (root / "meta").mkdir()
+                self.assertEqual(
+                    profiles.detect_test_profile(root),
+                    profiles.REVIEW_COMPACT_DETACHED,
+                )
+        finally:
+            if old is not None:
+                os.environ[profiles.ENV_TEST_PROFILE] = old
+
+
+if __name__ == "__main__":
+    unittest.main()

+ 16 - 0
tests/unit/test_three_axis_door_contract.py

@@ -11,6 +11,8 @@ PROJECT_PATH = ROOT / "projects" / "prod2u-door-temp" / "project.json"
 PARAMS_PATH = ROOT / "src" / "generated" / "prod2u_door_temp_params.vh"
 TOP_PATH = ROOT / "src" / "top" / "prod2u_p4_normal_v3_top.v"
 DISPATCHER_PATH = ROOT / "src" / "modules" / "door_action_dispatcher.v"
+CONTROLLER_PATH = ROOT / "src" / "project" / "command_controller.v"
+ADAPTER_PATH = ROOT / "src" / "project" / "project_adapter.v"
 
 
 class ThreeAxisDoorContractTests(unittest.TestCase):
@@ -42,6 +44,20 @@ class ThreeAxisDoorContractTests(unittest.TestCase):
         self.assertIn("z_door_cmd", source)
         self.assertIn("{z_active, y_active, x_active}", source)
         self.assertNotIn("intake_door_cmd", source)
+        self.assertIn("no new action", source)
+
+    def test_controller_and_adapter_use_z_door_cmd(self):
+        controller = CONTROLLER_PATH.read_text(encoding="utf-8")
+        adapter = ADAPTER_PATH.read_text(encoding="utf-8")
+        self.assertIn("z_door_cmd", controller)
+        self.assertIn("ST_VALIDATE_Z", controller)
+        self.assertIn("Z_DOOR_OFFSET", controller)
+        self.assertNotIn("intake_door_cmd", controller)
+        self.assertNotIn("INTAKE_DOOR", controller)
+        self.assertNotIn("ST_VALIDATE_INTAKE", controller)
+        self.assertIn(".z_door_cmd(z_door_cmd)", adapter)
+        self.assertNotIn("intake_door_cmd", adapter)
+        self.assertNotIn("INTAKE_DOOR", adapter)
 
     def test_top_has_z_axis_and_six_limit_ports(self):
         top = TOP_PATH.read_text(encoding="utf-8")

+ 5 - 1
tests/verilator_waivers.vlt

@@ -7,8 +7,12 @@
 // Combinational locals inside crc_bit() are intentional blocking assigns.
 lint_off -rule BLKSEQ -file "*/src/common/crc16_serial.v"
 
+// door_motor_engine uses blocking assigns to step_next as an intra-cycle
+// scratch in the sequential process (truncate/stop mask path); not NBA race.
+lint_off -rule BLKSEQ -file "*/src/modules/door_motor_engine.v"
+
 // Shared integer loop index across always @(*) and always @(posedge) is a
 // classic Verilog pattern; MULTIDRIVENPROC is a false positive for gen-loop ints.
 lint_off -rule MULTIDRIVENPROC -file "*/src/modules/startup_close_seek.v"
-lint_off -rule MULTIDRIVENPROC -file "*/src/modules/door_motor_engine.v"
 lint_off -rule MULTIDRIVENPROC -file "*/src/modules/door_action_dispatcher.v"
+lint_off -rule MULTIDRIVENPROC -file "*/src/modules/door_motor_engine.v"

+ 4 - 2
tools/board-viewer/README.zh-CN.md

@@ -40,8 +40,10 @@ py -3.12 board_viewer.py generate --temp-parent C:\Users\Administrator\CodexTemp
 ## 数据边界
 
 - 原始物理板来源:`reference/original/board/FCB_FPGA_MCU_V1.2_20260717/FCB_FPGA+MCU_V1.2_20260717.brd`
-- FPGA inventory:`config/pin_inventory.fcb_fpga_mcu0611.json`(仍含可复用的交叉验证映射;V1.2 缺席座子不会强行匹配)
-- 人工交叉验证:`config/board_viewer_annotations.fcb_fpga_mcu_v1_2.json`(由 V1.1 注释裁剪到本板现有座子)
+- FPGA inventory(historical):`config/pin_inventory.fcb_fpga_mcu0611.json`(`historical_schematic_side_evidence`;可复用旧交叉验证映射,但不得覆盖 V1.2 CON104/105/106/120/12/129;V1.2 缺席座子不会强行匹配)
+- 产品 IO 证据摘要:`config/pin_inventory.prod2u_door_temp_v1_2.json` + `docs/IO_EVIDENCE_MATRIX.zh-CN.md`(`physical_path` / `product_polarity` / `hardware_measurement` 拆分)
+- 人工交叉验证:`config/board_viewer_annotations.fcb_fpga_mcu_v1_2.json`(V1.2 活动板;含 `io_evidence_policy`)
+- V1.2 原理图 PDF:不存在(`missing_by_policy` / `not_provided`)
 - `generated/` 下的 SVG/JSON 均由生成器整体替换,禁止手工修改。
 - 页面只证明物理连接和证据等级,不读取当前固件 profile,也不证明当前工程约束没有冲突。
 

+ 7 - 0
tools/board-viewer/board_viewer/data.py

@@ -371,6 +371,13 @@ def _merge_annotation(pin: dict[str, Any], annotation: Mapping[str, object]) ->
     ):
         if key in annotation:
             pin[key] = annotation[key]
+    grades = annotation.get("evidence_grades")
+    if isinstance(grades, Mapping):
+        pin["evidence_grades"] = {
+            "physical_path": str(grades.get("physical_path") or "unknown"),
+            "product_polarity": str(grades.get("product_polarity") or "unknown"),
+            "hardware_measurement": str(grades.get("hardware_measurement") or "unknown"),
+        }
     fpga = annotation.get("fpga")
     if isinstance(fpga, Mapping):
         pin["fpga"] = {

+ 188 - 10
tools/board-viewer/refresh_reference_inventory.py

@@ -20,6 +20,11 @@ CANONICAL_BRD = (
     "FCB_FPGA+MCU_V1.2_20260717.brd"
 )
 ARCHIVE_BRD = "reference/original/local_archives/board/FCB_FPGA+MCU_V1.2_20260717.brd"
+HISTORICAL_0611_PDF = "reference/original/schematics/FCB_FPGA+MCU0611.pdf"
+# Policy placeholder: there is no V1.2 schematic PDF; do not invent a real filename claim.
+V12_SCHEMATIC_PDF_POLICY_PATH = (
+    "reference/original/schematics/FCB_FPGA_MCU_V1.2_schematic.pdf"
+)
 
 
 def sha256_file(path: Path) -> str:
@@ -35,8 +40,9 @@ def item_for(
     relative: str,
     *,
     expected_sha256: str | None = None,
-    confidence: str = "present",
+    confidence: str | None = None,
     notes: dict[str, Any] | None = None,
+    require_file: bool = True,
 ) -> dict[str, Any]:
     path = root / relative
     payload: dict[str, Any] = {
@@ -51,11 +57,42 @@ def item_for(
         payload["hash_match"] = bool(
             path.is_file() and payload.get("sha256") == expected_sha256
         )
+        if confidence is not None:
+            payload["confidence"] = confidence
+        else:
+            payload["confidence"] = (
+                "confirmed"
+                if payload.get("hash_match")
+                else ("missing" if not path.is_file() else "hash_fail")
+            )
+    elif confidence is not None:
+        payload["confidence"] = confidence
+    else:
         payload["confidence"] = (
-            "confirmed" if payload.get("hash_match") else ("missing" if not path.is_file() else "hash_fail")
+            "present" if path.is_file() else ("missing" if require_file else "not_provided")
         )
-    else:
-        payload["confidence"] = confidence if path.is_file() else "missing"
+    if notes:
+        payload.update(notes)
+    return payload
+
+
+def policy_missing_item(
+    relative: str,
+    *,
+    role: str,
+    evidence_class: str,
+    notes: dict[str, Any] | None = None,
+) -> dict[str, Any]:
+    """Inventory row for an asset that is intentionally absent (policy / not provided)."""
+    payload: dict[str, Any] = {
+        "path": relative,
+        "exists": False,
+        "size": 0,
+        "confidence": "missing_by_policy",
+        "status": "not_provided",
+        "role": role,
+        "evidence_class": evidence_class,
+    }
     if notes:
         payload.update(notes)
     return payload
@@ -75,6 +112,8 @@ def build_inventory(root: Path) -> dict[str, Any]:
             expected_sha256=EXPECTED_BRD_SHA256,
             notes={
                 "role": "canonical_brd",
+                "evidence_class": "authoritative_physical_board_database",
+                "authority": "v1_2_physical_path",
                 "packaging_note": (
                     "Canonical physical BRD for analysis packages; "
                     "prefer this path over local_archives duplicate"
@@ -87,6 +126,7 @@ def build_inventory(root: Path) -> dict[str, Any]:
             expected_sha256=EXPECTED_BRD_SHA256,
             notes={
                 "role": "duplicate_archive_mirror",
+                "evidence_class": "authoritative_physical_board_database_mirror",
                 "byte_identical_to_canonical": True,
                 "packaging_recommendation": (
                     "Keep one physical copy in analysis packages: include "
@@ -99,11 +139,89 @@ def build_inventory(root: Path) -> dict[str, Any]:
             root,
             "reference/original/schematics/8000高温罩电气图V2.0.pdf",
             expected_sha256=EXPECTED_PDF_SHA256,
+            notes={
+                "role": "system_electrical_boundary_pdf",
+                "evidence_class": "system_schematic_reference",
+            },
+        ),
+        item_for(
+            root,
+            HISTORICAL_0611_PDF,
+            notes={
+                "role": "historical_schematic_side_evidence",
+                "evidence_class": "historical_schematic_side_evidence",
+                "authority": "non_authoritative_for_v1_2_product_io",
+                "must_not_override": [
+                    "CON104",
+                    "CON105",
+                    "CON106",
+                    "CON120",
+                    "CON12",
+                    "CON129",
+                ],
+                "notes": (
+                    "Earlier FCB FPGA+MCU schematic PDF (not the 20260717 V1.2 board "
+                    "revision). May help with legacy net names / old sheets only; "
+                    "must not override V1.2 BRD activity mapping for motor/limit/EN."
+                ),
+            },
+        ),
+        policy_missing_item(
+            V12_SCHEMATIC_PDF_POLICY_PATH,
+            role="v1_2_schematic_pdf",
+            evidence_class="missing_by_policy",
+            notes={
+                "status": "not_provided",
+                "authority": "none",
+                "notes": (
+                    "No V1.2 schematic PDF was provided. Do not invent one and do not "
+                    "treat FCB_FPGA+MCU0611.pdf as a V1.2 schematic substitute."
+                ),
+            },
         ),
-        item_for(root, "reference/original/schematics/FCB_FPGA+MCU0611.pdf"),
         item_for(root, "reference/original/diagrams/上位机逻辑.svg"),
         item_for(root, "reference/original/diagrams/接长鑫水滴系统.svg"),
-        item_for(root, "config/board_viewer_annotations.fcb_fpga_mcu_v1_2.json"),
+        item_for(
+            root,
+            "config/board_viewer_annotations.fcb_fpga_mcu_v1_2.json",
+            notes={
+                "role": "v1_2_curated_annotations",
+                "evidence_class": "curated_annotation_for_v1_2_brd",
+            },
+        ),
+        item_for(
+            root,
+            "config/pin_inventory.fcb_fpga_mcu0611.json",
+            notes={
+                "role": "historical_schematic_side_evidence",
+                "evidence_class": "historical_schematic_side_evidence",
+                "authority": "non_authoritative_for_v1_2_product_io",
+                "must_not_override": [
+                    "CON104",
+                    "CON105",
+                    "CON106",
+                    "CON120",
+                    "CON12",
+                    "CON129",
+                ],
+            },
+        ),
+        item_for(
+            root,
+            "config/pin_inventory.prod2u_door_temp_v1_2.json",
+            notes={
+                "role": "v1_2_product_interface_evidence",
+                "evidence_class": "product_io_evidence_summary",
+            },
+        ),
+        item_for(
+            root,
+            "docs/IO_EVIDENCE_MATRIX.zh-CN.md",
+            notes={
+                "role": "io_evidence_matrix",
+                "evidence_class": "split_evidence_grades_physical_polarity_measurement",
+            },
+        ),
         item_for(
             root,
             "tools/board-viewer/generated/board-data.json",
@@ -152,7 +270,15 @@ def build_inventory(root: Path) -> dict[str, Any]:
     ]
 
     present = sum(1 for item in items if item.get("exists"))
-    missing = sum(1 for item in items if not item.get("exists"))
+    # Policy-missing rows are intentional absences, not inventory gaps.
+    missing = sum(
+        1
+        for item in items
+        if not item.get("exists") and item.get("confidence") != "missing_by_policy"
+    )
+    policy_missing = sum(
+        1 for item in items if item.get("confidence") == "missing_by_policy"
+    )
     hash_ok = sum(1 for item in items if item.get("hash_match") is True)
     # Missing optional/gitignored mirrors are tracked under `missing`, not hash_fail.
     hash_fail = sum(
@@ -160,6 +286,14 @@ def build_inventory(root: Path) -> dict[str, Any]:
     )
     canonical = next((item for item in items if item.get("role") == "canonical_brd"), None)
     canonical_ok = bool(canonical and canonical.get("hash_match") is True)
+    historical_0611 = next(
+        (
+            item
+            for item in items
+            if item.get("path") == HISTORICAL_0611_PDF
+        ),
+        None,
+    )
 
     return {
         "schema": "prod2u-reference-inventory-v1",
@@ -180,13 +314,34 @@ def build_inventory(root: Path) -> dict[str, Any]:
             ],
             "canonical_brd": CANONICAL_BRD,
             "duplicate_brd_archive": ARCHIVE_BRD,
+            "authoritative_order": [
+                "v1_2_brd_physical_path_confirmed_by_brd",
+                "product_polarity_confirmed_by_electrical_staff",
+                "hardware_measurement_not_run",
+            ],
+            "historical_schematic_side_evidence": HISTORICAL_0611_PDF,
+            "v1_2_schematic_pdf": {
+                "path": V12_SCHEMATIC_PDF_POLICY_PATH,
+                "status": "not_provided",
+                "confidence": "missing_by_policy",
+            },
+            "io_evidence_grades": {
+                "physical_path": "confirmed_by_brd",
+                "product_polarity": "confirmed_by_electrical_staff",
+                "hardware_measurement": "not_run",
+                "matrix_doc": "docs/IO_EVIDENCE_MATRIX.zh-CN.md",
+            },
             "packaging_recommendation": (
                 "Compact/review packages: keep the six board-viewer derived assets "
                 "once under tools/board-viewer/generated/ (derived_evidence); do not "
                 "also materialize a second physical copy via external-source staging. "
-                "Do not ship PDF/BRD/DSN in compact. Archive-local may ship one physical "
-                f"BRD at {CANONICAL_BRD}; treat {ARCHIVE_BRD} as a local-only mirror. "
-                "BRD regeneration remains local-only / not_packaged_by_policy for compact."
+                "Do not ship PDF/BRD/DSN in compact. Archive-local / reference may ship "
+                f"one physical BRD at {CANONICAL_BRD}; treat {ARCHIVE_BRD} as a "
+                "local-only mirror. Include 0611 PDF only as "
+                "historical_schematic_side_evidence; it must not override V1.2 "
+                "CON104/105/106/120/12/129 mapping. V1.2 schematic PDF remains "
+                "missing_by_policy/not_provided. BRD regeneration remains local-only / "
+                "not_packaged_by_policy for compact."
             ),
             "expected_brd_sha256": EXPECTED_BRD_SHA256,
             "reference_regeneration_replay": "not_packaged_by_policy",
@@ -196,9 +351,15 @@ def build_inventory(root: Path) -> dict[str, Any]:
         "summary": {
             "present": present,
             "missing": missing,
+            "policy_missing": policy_missing,
             "hash_ok": hash_ok,
             "hash_fail": hash_fail,
             "canonical_brd_hash_ok": canonical_ok,
+            "canonical_brd_present": bool(canonical and canonical.get("exists")),
+            "historical_0611_present": bool(
+                historical_0611 and historical_0611.get("exists")
+            ),
+            "v1_2_schematic_pdf": "missing_by_policy",
         },
     }
 
@@ -206,6 +367,8 @@ def build_inventory(root: Path) -> dict[str, Any]:
 def render_markdown(inventory: dict[str, Any]) -> str:
     bounds = inventory.get("evidence_boundaries") or {}
     summary = inventory.get("summary") or {}
+    grades = bounds.get("io_evidence_grades") or {}
+    v12_pdf = bounds.get("v1_2_schematic_pdf") or {}
     lines = [
         "# Reference Inventory",
         "",
@@ -213,8 +376,12 @@ def render_markdown(inventory: dict[str, Any]) -> str:
         "",
         f"- present: {summary.get('present', 0)}",
         f"- missing: {summary.get('missing', 0)}",
+        f"- policy_missing: {summary.get('policy_missing', 0)}",
         f"- hash_ok: {summary.get('hash_ok', 0)}",
         f"- hash_fail: {summary.get('hash_fail', 0)}",
+        f"- canonical_brd_hash_ok: {summary.get('canonical_brd_hash_ok')}",
+        f"- historical_0611_present: {summary.get('historical_0611_present')}",
+        f"- v1_2_schematic_pdf: {summary.get('v1_2_schematic_pdf')}",
         "",
         "## Evidence boundaries",
         "",
@@ -223,6 +390,15 @@ def render_markdown(inventory: dict[str, Any]) -> str:
         f"- Duplicate archive BRD: `{bounds.get('duplicate_brd_archive')}` "
         "(byte-identical local mirror; packaging should keep one physical copy)",
         f"- Expected BRD SHA-256: `{bounds.get('expected_brd_sha256')}`",
+        f"- Authoritative order: {', '.join(bounds.get('authoritative_order') or [])}",
+        f"- IO evidence grades: physical_path=`{grades.get('physical_path')}`, "
+        f"product_polarity=`{grades.get('product_polarity')}`, "
+        f"hardware_measurement=`{grades.get('hardware_measurement')}` "
+        f"(see `{grades.get('matrix_doc')}`)",
+        f"- 0611 PDF: `{bounds.get('historical_schematic_side_evidence')}` "
+        "(historical_schematic_side_evidence; must not override V1.2 CON104/105/106/120/12/129)",
+        f"- V1.2 schematic PDF: `{v12_pdf.get('path')}` → "
+        f"{v12_pdf.get('confidence')}/{v12_pdf.get('status')}",
         f"- Packager recommendation: {bounds.get('packaging_recommendation')}",
         "",
         "| Path | Exists | Size | Confidence | Hash notes | Evidence |",
@@ -234,6 +410,8 @@ def render_markdown(inventory: dict[str, Any]) -> str:
             hash_notes = "MATCH"
         elif item.get("hash_match") is False:
             hash_notes = "FAIL"
+        elif item.get("confidence") == "missing_by_policy":
+            hash_notes = "POLICY"
         elif sha:
             hash_notes = sha[:16] + "..."
         else:

+ 16 - 0
tools/compact-package-selftest.sh

@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+# Thin entrypoint: single-ZIP review-compact selftest (manifest/hash/path/forbidden/replay).
+set -euo pipefail
+unset LD_LIBRARY_PATH LD_PRELOAD QT_PLUGIN_PATH || true
+ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+VENV="${PRODU2_VERIFY_VENV:-${XDG_CACHE_HOME:-$HOME/.cache}/prod2u/venvs/verify}"
+PY="${VENV}/bin/python"
+[[ -x "$PY" ]] || PY=python3
+if [[ $# -lt 1 ]]; then
+  echo "usage: $0 <package-dir> [--extract-dir DIR] [--skip-software] [--write-evidence] [--json-out PATH]" >&2
+  exit 2
+fi
+PACKAGE_DIR="$1"
+shift
+export PRODU2_TEST_PROFILE="${PRODU2_TEST_PROFILE:-review-compact-detached}"
+exec "$PY" -B "$ROOT/tools/compact_package_selftest.py" --package-dir "$PACKAGE_DIR" "$@"

+ 333 - 0
tools/compact_package_selftest.py

@@ -0,0 +1,333 @@
+#!/usr/bin/env python3
+"""Single-ZIP selftest for review-compact packages.
+
+Checks:
+- HANDOFF-INDEX / SHA256SUMS presence and hash integrity
+- ZIP member path safety (no absolute / ``..`` / backslash escapes)
+- Forbidden compact members (heavy originals, secrets, vendor installers, raw .git)
+- Optional four-state detached replay via ``replay_review_compact``
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import re
+import sys
+import zipfile
+from datetime import datetime, timezone
+from pathlib import Path
+from typing import Any
+
+
+ROOT = Path(__file__).resolve().parents[1]
+TOOLS = ROOT / "tools"
+if str(TOOLS) not in sys.path:
+    sys.path.insert(0, str(TOOLS))
+
+import package_agent_handoff as handoff  # noqa: E402
+from replay_review_compact import replay_review_compact  # noqa: E402
+
+SHA256_RE = re.compile(r"^[0-9a-f]{64}$")
+FORBIDDEN_MEMBER_MARKERS = (
+    ".git/",
+    "/.git/",
+    "git-history/",
+)
+FORBIDDEN_BASENAMES = frozenset(
+    {
+        ".env",
+        "id_rsa",
+        "id_ed25519",
+        "anlogic.lic",
+    }
+)
+FORBIDDEN_SUFFIXES = frozenset({".pdf", ".brd", ".dsn", ".bundle"})
+FIXTURE_ALLOW_PREFIXES = (
+    "source/tests/board_viewer/fixtures/",
+    "tests/board_viewer/fixtures/",
+)
+
+
+class CompactSelftestError(RuntimeError):
+    """Compact package selftest failure."""
+
+
+def _normalize_member(name: str) -> str:
+    text = name.replace("\\", "/")
+    while text.startswith("./"):
+        text = text[2:]
+    return text
+
+
+def _is_fixture_allowlisted(member: str) -> bool:
+    lower = _normalize_member(member).casefold()
+    if lower.startswith("cpld/"):
+        lower = lower[len("cpld/") :]
+    return any(lower.startswith(prefix) for prefix in FIXTURE_ALLOW_PREFIXES)
+
+
+def _looks_like_full_git_bundle(member: str) -> bool:
+    lower = _normalize_member(member).casefold()
+    if lower.endswith(".bundle") or "/git-history/" in f"/{lower}/":
+        return True
+    return "repo.bundle" in lower or "workspace-current.bundle" in lower
+
+
+def check_path_safety(members: list[str]) -> list[str]:
+    failures: list[str] = []
+    for raw in members:
+        name = _normalize_member(raw)
+        if not name or name.endswith("/"):
+            continue
+        if name.startswith("/") or re.match(r"^[A-Za-z]:/", name):
+            failures.append(f"absolute_path:{raw}")
+            continue
+        parts = name.split("/")
+        if any(part in {"", ".", ".."} for part in parts):
+            failures.append(f"unsafe_path_segment:{raw}")
+        if "\\" in raw:
+            failures.append(f"backslash_path:{raw}")
+    return failures
+
+
+def check_forbidden_members(members: list[str]) -> list[str]:
+    failures: list[str] = []
+    for raw in members:
+        name = _normalize_member(raw)
+        if name.endswith("/"):
+            continue
+        lower = name.casefold()
+        logical = lower[len("cpld/") :] if lower.startswith("cpld/") else lower
+        repo_relative = logical
+        if repo_relative.startswith("source/"):
+            repo_relative = repo_relative[len("source/") :]
+        basename = repo_relative.rsplit("/", 1)[-1]
+        if any(marker in f"/{lower}/" for marker in FORBIDDEN_MEMBER_MARKERS):
+            failures.append(f"raw_git_marker:{raw}")
+        if _looks_like_full_git_bundle(name):
+            failures.append(f"full_git_bundle:{raw}")
+        if basename in FORBIDDEN_BASENAMES or (
+            basename.startswith(".env.")
+            and not basename.endswith((".example", ".sample", ".template", ".dist"))
+        ):
+            failures.append(f"secret_basename:{raw}")
+        suffix = Path(basename).suffix.casefold()
+        if suffix in FORBIDDEN_SUFFIXES and not _is_fixture_allowlisted(logical):
+            failures.append(f"forbidden_suffix:{raw}")
+        if "tests/fixtures/package_adversarial/payloads/" in repo_relative:
+            failures.append(f"adversarial_payload_in_compact:{raw}")
+        reason = handoff.review_exclusion_reason(
+            repo_relative, is_dir=False, profile="review-compact"
+        )
+        if reason and not _is_fixture_allowlisted(logical):
+            if reason in {
+                "heavy_design_original_not_packaged",
+                "credential_or_license_file",
+                "license_material",
+                "vendor_toolchain_archive",
+                "vendor_executable",
+                "license_archive",
+                "adversarial_fixture_payload",
+            } or reason.startswith("compact_excludes_") or reason.startswith(
+                "reference_original_"
+            ):
+                failures.append(f"policy_exclude_present:{reason}:{raw}")
+    return failures
+
+
+def _find_primary_zip(package_dir: Path, index: dict[str, Any]) -> Path:
+    volumes = index.get("volumes") or []
+    for volume in volumes:
+        name = str(volume.get("file") or "")
+        if name.casefold().endswith(".zip"):
+            path = package_dir / name
+            if path.is_file():
+                return path
+    zips = sorted(package_dir.glob("*.zip"))
+    if not zips:
+        raise CompactSelftestError("package directory has no ZIP volume")
+    return zips[0]
+
+
+def run_compact_package_selftest(
+    package_dir: Path,
+    *,
+    extract_root: Path | None = None,
+    skip_software: bool = False,
+    write_evidence: bool = False,
+) -> dict[str, Any]:
+    """Run compact selftest against a published package directory."""
+    package_dir = package_dir.expanduser().resolve(strict=True)
+    failures: list[str] = []
+    index_path = package_dir / "HANDOFF-INDEX.json"
+    sums_path = package_dir / "SHA256SUMS.txt"
+    if not index_path.is_file():
+        failures.append("missing_handoff_index")
+    if not sums_path.is_file():
+        failures.append("missing_sha256sums")
+
+    index: dict[str, Any] = {}
+    if index_path.is_file():
+        index = json.loads(index_path.read_text(encoding="utf-8"))
+
+    if sums_path.is_file():
+        for line in sums_path.read_text(encoding="ascii").splitlines():
+            line = line.strip()
+            if not line or line.startswith("#"):
+                continue
+            digest, _, name = line.partition("  ")
+            if not SHA256_RE.fullmatch(digest) or not name:
+                failures.append(f"invalid_sha256sums_line:{line}")
+                continue
+            member = package_dir / name
+            if not member.is_file():
+                failures.append(f"sha256sums_missing_file:{name}")
+                continue
+            actual = handoff.sha256_file(member)
+            if actual != digest:
+                failures.append(f"sha256sums_mismatch:{name}")
+
+    zip_path: Path | None = None
+    members: list[str] = []
+    if "missing_handoff_index" not in failures and "missing_sha256sums" not in failures:
+        try:
+            zip_path = _find_primary_zip(package_dir, index)
+        except CompactSelftestError as exc:
+            failures.append(str(exc))
+    if zip_path is not None:
+        with zipfile.ZipFile(zip_path, "r", allowZip64=True) as archive:
+            bad = archive.testzip()
+            if bad is not None:
+                failures.append(f"zip_crc_failed:{bad}")
+            members = list(archive.namelist())
+        failures.extend(check_path_safety(members))
+        failures.extend(check_forbidden_members(members))
+
+    binding_status = "missing"
+    if any(
+        _normalize_member(name).endswith("meta/td-source-closure-binding.json")
+        for name in members
+    ):
+        binding_status = "present"
+    else:
+        failures.append("missing_td_source_closure_binding")
+
+    replay_report: dict[str, Any] | None = None
+    # Hash/path/forbidden failures still allow attempting replay only when ZIP is usable.
+    if zip_path is not None and not any(
+        item.startswith(("missing_handoff", "missing_sha256", "zip_crc", "package directory"))
+        for item in failures
+    ):
+        # Strip hard content failures before deciding to run replay: always try if ZIP opens.
+        try:
+            replay_report = replay_review_compact(
+                package_dir,
+                extract_root=extract_root,
+                skip_software=skip_software,
+            )
+            if replay_report.get("status") != "pass":
+                failures.append("detached_replay_failed")
+        except Exception as exc:  # noqa: BLE001 - selftest boundary
+            failures.append(f"detached_replay_error:{exc}")
+    elif skip_software:
+        replay_report = {"status": "not_run", "note": "skipped by --skip-software"}
+
+    status = "pass" if not failures else "fail"
+    report: dict[str, Any] = {
+        "schema": "cpld-review-compact-package-selftest-v1",
+        "generated_at_utc": datetime.now(timezone.utc).isoformat(),
+        "status": status,
+        "package_dir": str(package_dir),
+        "zip_path": str(zip_path) if zip_path is not None else None,
+        "member_count": len(members),
+        "binding_status": binding_status,
+        "failures": failures,
+        "checks": {
+            "manifest_and_hashes": "pass"
+            if not any(
+                item.startswith(
+                    ("missing_", "sha256sums_", "invalid_sha256sums", "zip_crc")
+                )
+                for item in failures
+            )
+            else "fail",
+            "path_safety": "pass"
+            if not any(
+                item.startswith(("absolute_path", "unsafe_path", "backslash_path"))
+                for item in failures
+            )
+            else "fail",
+            "forbidden_files": "pass"
+            if not any(
+                item.startswith(
+                    (
+                        "raw_git",
+                        "full_git",
+                        "secret_",
+                        "forbidden_suffix",
+                        "adversarial_",
+                        "policy_exclude",
+                    )
+                )
+                for item in failures
+            )
+            else "fail",
+            "detached_replay": (
+                "not_run"
+                if skip_software
+                else (
+                    "pass"
+                    if replay_report and replay_report.get("status") == "pass"
+                    else "fail"
+                )
+            ),
+        },
+        "replay": replay_report,
+    }
+
+    if write_evidence:
+        evidence_dir = package_dir / "evidence" / "selftest"
+        evidence_dir.mkdir(parents=True, exist_ok=True)
+        out = evidence_dir / "compact-package-selftest.json"
+        out.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
+        report["evidence_path"] = str(out)
+    return report
+
+
+def build_parser() -> argparse.ArgumentParser:
+    parser = argparse.ArgumentParser(description=__doc__)
+    parser.add_argument("--package-dir", type=Path, required=True)
+    parser.add_argument("--extract-dir", type=Path)
+    parser.add_argument("--skip-software", action="store_true")
+    parser.add_argument(
+        "--write-evidence",
+        action="store_true",
+        help="write evidence/selftest/compact-package-selftest.json under package-dir",
+    )
+    parser.add_argument("--json-out", type=Path)
+    return parser
+
+
+def main(argv: list[str] | None = None) -> int:
+    args = build_parser().parse_args(argv)
+    try:
+        report = run_compact_package_selftest(
+            args.package_dir,
+            extract_root=args.extract_dir,
+            skip_software=args.skip_software,
+            write_evidence=args.write_evidence,
+        )
+    except Exception as exc:  # noqa: BLE001
+        print(f"error: {exc}", file=sys.stderr)
+        return 1
+    text = json.dumps(report, ensure_ascii=False, indent=2)
+    print(text)
+    if args.json_out is not None:
+        args.json_out.parent.mkdir(parents=True, exist_ok=True)
+        args.json_out.write_text(text + "\n", encoding="utf-8")
+    return 0 if report.get("status") == "pass" else 2
+
+
+if __name__ == "__main__":
+    raise SystemExit(main())

+ 4 - 1
tools/generate_project.py

@@ -262,7 +262,10 @@ def _validate_project(payload: Mapping[str, Any]) -> None:
     _require(startup["enabled"] is True, "startup must be enabled")
     _require(startup["direction_meaning"] == "close", "startup direction must be close")
     _require(startup["limit_stop_during_move"] is True, "startup limit stop during move must be enabled")
-    _require(startup["stop_semantics"] == "finish_current_high_pulse_then_no_next_rising_edge", "unsupported stop semantics")
+    _require(
+        startup["stop_semantics"] == "truncate_current_high_pulse_immediately_after_synchronized_limit",
+        "unsupported stop semantics",
+    )
     _require(startup["additional_rising_edges_after_synchronized_limit"] == 0, "additional rising edges after limit must be zero")
     _require(startup["runtime_limit_use"] is True, "startup runtime limit use must be true")
     _integer(startup["direction_value"], "limits.startup.direction_value", minimum=0)

+ 1 - 0
tools/package-review-compact.sh

@@ -1,5 +1,6 @@
 #!/usr/bin/env bash
 # Thin entrypoint for the default remote-agent review-compact package.
+# Optional binding: --bitstream PATH --td-report PATH [--binding-commit FULLSHA]
 set -euo pipefail
 unset LD_LIBRARY_PATH LD_PRELOAD QT_PLUGIN_PATH || true
 ROOT="$(cd "$(dirname "$0")/.." && pwd)"

+ 266 - 8
tools/package_agent_handoff.py

@@ -537,6 +537,11 @@ def review_exclusion_reason(relative: str, *, is_dir: bool, profile: str) -> str
         return "run_id_marker"
     if name in {"evidence-batch-summary.txt"}:
         return "stale_run_summary"
+    # Adversarial payload blobs are generated in temp during tests; never ship them
+    # long-term inside review-compact / review-debug volumes.
+    if is_under(lower, "tests/fixtures/package_adversarial/payloads"):
+        if profile in {"review-compact", "review-debug"}:
+            return "adversarial_fixture_payload"
     for prefix, reason in REVIEW_ORIGINAL_ROOT_EXCLUSIONS.items():
         if is_under(lower, prefix):
             return reason
@@ -1296,34 +1301,286 @@ def _git_bytes(git: str, args: list[str], *, cwd: Path) -> bytes | None:
     return payload
 
 
-def build_td_source_closure_binding_hook(root: Path) -> dict[str, object]:
-    """Record TD source-closure binding hooks without requiring a live bitstream."""
+SHA256_HEX_RE = re.compile(r"^[0-9a-f]{64}$")
+COMMIT_FULL_RE = re.compile(r"^[0-9a-f]{40}$")
+
+
+def _resolve_commit_full(root: Path, commit: str | None = None) -> str | None:
+    if commit and COMMIT_FULL_RE.fullmatch(commit.strip().casefold()):
+        return commit.strip().casefold()
+    git = shutil.which("git")
+    if git is None:
+        return None
+    code, payload = run_capture([git, "rev-parse", "HEAD"], cwd=root)
+    if code != 0:
+        return None
+    text = payload.decode("ascii", errors="replace").strip().casefold()
+    return text if COMMIT_FULL_RE.fullmatch(text) else None
+
+
+def _collect_td_report_bindings(
+    report_paths: Iterable[Path],
+) -> list[dict[str, object]]:
+    rows: list[dict[str, object]] = []
+    for path in report_paths:
+        resolved = path.expanduser().resolve(strict=False)
+        if not resolved.is_file():
+            rows.append(
+                {
+                    "path": str(path),
+                    "status": "missing",
+                    "sha256": None,
+                    "bytes": None,
+                }
+            )
+            continue
+        rows.append(
+            {
+                "path": str(resolved),
+                "status": "present",
+                "sha256": sha256_file(resolved),
+                "bytes": resolved.stat().st_size,
+                "name": resolved.name,
+            }
+        )
+    rows.sort(key=lambda row: str(row.get("path", "")).casefold())
+    return rows
+
+
+def discover_bitstream_candidates(
+    root: Path,
+    *,
+    evidence_root: Path | None = None,
+) -> list[Path]:
+    """Locate candidate bitstreams for optional binding (does not require TD rebuild)."""
+    candidates: list[Path] = []
+    search_roots = []
+    if evidence_root is not None:
+        search_roots.append(evidence_root.expanduser().resolve(strict=False))
+    search_roots.extend(
+        [
+            root / "evidence" / "bitstream",
+            root / "td" / "build",
+        ]
+    )
+    env_bit = os.environ.get("PRODU2_BITSTREAM_PATH", "").strip()
+    if env_bit:
+        candidates.append(Path(env_bit).expanduser())
+    for base in search_roots:
+        if not base.is_dir():
+            continue
+        candidates.extend(sorted(base.rglob("*.bit")))
+        named = base / "prod2u_p4_normal_v3.bit"
+        if named.is_file():
+            candidates.append(named)
+        fw = base / "fw.bit"
+        if fw.is_file():
+            candidates.append(fw)
+    # Deduplicate while preserving order.
+    seen: set[str] = set()
+    unique: list[Path] = []
+    for path in candidates:
+        key = str(path.resolve(strict=False))
+        if key in seen:
+            continue
+        seen.add(key)
+        if path.is_file():
+            unique.append(path)
+    return unique
+
+
+def build_td_source_closure_binding(
+    root: Path,
+    *,
+    bitstream_path: Path | None = None,
+    td_report_paths: Iterable[Path] | None = None,
+    evidence_root: Path | None = None,
+    commit: str | None = None,
+    require_bitstream: bool = False,
+) -> dict[str, object]:
+    """Build TD source-closure binding; bind real bitstream when supplied.
+
+    Without a bitstream the status remains ``hook_ready`` (or ``hook_partial``).
+    When a bitstream (+ optional TD reports) is provided, status becomes ``bound``
+    with full commit SHA, source-manifest SHA, project SHA, and bitstream SHA-256.
+    Integrators supply the real tip bitstream later; this path must not stay
+    forever deferred once artifacts exist.
+    """
+    root = root.expanduser().resolve(strict=True)
     manifest = root / "src" / "generated" / "td-source-manifest.json"
     project = root / "projects" / "prod2u-door-temp" / "project.json"
+    commit_full = _resolve_commit_full(root, commit)
     binding: dict[str, object] = {
-        "schema": "cpld-td-source-closure-binding-hook-v1",
+        "schema": "cpld-td-source-closure-binding-v1",
         "status": "hook_ready",
         "note": (
-            "Bindings are recorded for remote review; recompute against an existing "
-            "bitstream receipt when production inputs are unchanged. Full TD rebuild "
-            "is out of scope for review-compact packaging."
+            "Binding path accepts a real bitstream + full commit + source-manifest + "
+            "TD reports. When those artifacts are absent, status stays hook_ready; "
+            "it must not remain deferred once the integrator supplies them."
         ),
+        "commit_full": commit_full,
+        "commit_short": commit_full[:8] if commit_full else None,
         "td_source_manifest_path": "src/generated/td-source-manifest.json",
         "td_source_manifest_sha256": None,
         "project_config_path": "projects/prod2u-door-temp/project.json",
         "project_config_sha256": None,
+        "bitstream": None,
+        "td_reports": [],
         "bitstream_binding": "deferred_to_evidence_receipt",
+        # Legacy alias kept for older consumers still looking for the hook schema.
+        "legacy_schema_alias": "cpld-td-source-closure-binding-hook-v1",
     }
     if manifest.is_file():
         binding["td_source_manifest_sha256"] = sha256_file(manifest)
     else:
         binding["status"] = "hook_partial"
-        binding["td_source_manifest_sha256"] = None
     if project.is_file():
         binding["project_config_sha256"] = sha256_file(project)
+    else:
+        binding["status"] = "hook_partial"
+
+    resolved_bit = bitstream_path
+    if resolved_bit is None:
+        discovered = discover_bitstream_candidates(root, evidence_root=evidence_root)
+        if len(discovered) == 1:
+            resolved_bit = discovered[0]
+        elif len(discovered) > 1 and evidence_root is not None:
+            # Prefer evidence_root hits when multiple exist.
+            evidence_hits = [
+                path
+                for path in discovered
+                if str(path.resolve(strict=False)).startswith(
+                    str(evidence_root.expanduser().resolve(strict=False))
+                )
+            ]
+            if len(evidence_hits) == 1:
+                resolved_bit = evidence_hits[0]
+
+    report_list = list(td_report_paths or [])
+    if not report_list and evidence_root is not None:
+        evidence = evidence_root.expanduser().resolve(strict=False)
+        for pattern in (
+            "**/td-primary-receipt.json",
+            "**/final_td_report.json",
+            "**/original-final_td_report.json",
+            "**/TD-PROVENANCE.json",
+        ):
+            report_list.extend(sorted(evidence.glob(pattern)))
+    binding["td_reports"] = _collect_td_report_bindings(report_list)
+
+    if resolved_bit is None:
+        if require_bitstream:
+            binding["status"] = "bind_failed"
+            binding["bitstream_binding"] = "missing_bitstream"
+            binding["note"] = "require_bitstream=true but no bitstream was provided or discovered"
+        return binding
+
+    bit_path = resolved_bit.expanduser().resolve(strict=False)
+    if not bit_path.is_file():
+        binding["status"] = "bind_failed"
+        binding["bitstream_binding"] = "missing_bitstream"
+        binding["bitstream"] = {"path": str(resolved_bit), "status": "missing"}
+        return binding
+
+    digest = sha256_file(bit_path)
+    if not SHA256_HEX_RE.fullmatch(digest):
+        binding["status"] = "bind_failed"
+        binding["bitstream_binding"] = "invalid_bitstream_sha256"
+        return binding
+
+    binding["bitstream"] = {
+        "path": str(bit_path),
+        "name": bit_path.name,
+        "sha256": digest,
+        "bytes": bit_path.stat().st_size,
+        "status": "present",
+    }
+    if (
+        commit_full
+        and binding.get("td_source_manifest_sha256")
+        and binding.get("project_config_sha256")
+    ):
+        binding["status"] = "bound"
+        binding["bitstream_binding"] = "bound"
+        binding["note"] = (
+            "Bound to real bitstream SHA-256, full commit, project config, "
+            "td-source-manifest, and any supplied TD reports."
+        )
+    else:
+        binding["status"] = "bind_partial"
+        binding["bitstream_binding"] = "partial"
+        binding["note"] = (
+            "Bitstream hashed but commit/manifest/project identity incomplete; "
+            "not a final closure binding."
+        )
     return binding
 
 
+def build_td_source_closure_binding_hook(
+    root: Path,
+    *,
+    bitstream_path: Path | None = None,
+    td_report_paths: Iterable[Path] | None = None,
+    evidence_root: Path | None = None,
+    commit: str | None = None,
+    require_bitstream: bool = False,
+) -> dict[str, object]:
+    """Compatibility wrapper: bind when artifacts exist, else hook_ready."""
+    return build_td_source_closure_binding(
+        root,
+        bitstream_path=bitstream_path,
+        td_report_paths=td_report_paths,
+        evidence_root=evidence_root,
+        commit=commit,
+        require_bitstream=require_bitstream,
+    )
+
+
+def run_post_staging_reference_inventory_hook(
+    repo_root: Path,
+    *,
+    staging_complete: bool,
+    enabled: bool = True,
+) -> dict[str, object]:
+    """Refresh REFERENCE-INVENTORY only after staging completes (packager order).
+
+    Lane E owns inventory generator honesty / evidence-grade docs. Lane D only
+    enforces call order: inventory refresh must not run before staging finishes.
+    """
+    repo_root = repo_root.expanduser().resolve(strict=True)
+    report: dict[str, object] = {
+        "schema": "cpld-reference-inventory-post-staging-hook-v1",
+        "staging_complete": staging_complete,
+        "enabled": enabled,
+        "status": "not_run",
+        "command": None,
+        "note": (
+            "Packager order: finish reference staging, then refresh inventory, "
+            "then finalize the reference volume."
+        ),
+    }
+    if not enabled:
+        report["status"] = "skipped_disabled"
+        return report
+    if not staging_complete:
+        report["status"] = "blocked_staging_incomplete"
+        report["note"] = "Refusing inventory refresh before staging_complete=true"
+        return report
+
+    refresh_py = repo_root / "tools" / "board-viewer" / "refresh_reference_inventory.py"
+    if not refresh_py.is_file():
+        report["status"] = "blocked_missing_refresher"
+        return report
+
+    command = [sys.executable, "-B", str(refresh_py), "--root", str(repo_root)]
+    report["command"] = command
+    code, payload = run_capture(command, cwd=repo_root, timeout=300)
+    report["returncode"] = code
+    report["output_tail"] = payload.decode("utf-8", errors="replace")[-2000:]
+    report["status"] = "pass" if code == 0 else "fail"
+    return report
+
+
 _SANITIZED_SNAPSHOT_SKIP_PREFIXES = (
     "reference/original/",
     "node_modules/",
@@ -1731,7 +1988,8 @@ def package_purpose_text(profile: str, *, package_name: str) -> str:
                 "Default remote-agent upload package.",
                 "Layout: source/ (active code+tests) + evidence/ (canonical final receipts, derived board-viewer) + meta/.",
                 "Does NOT include a full Git bundle, PDF/BRD/DSN originals, vendor installer zips, or license material.",
-                "Git provenance is commit/status/log-20/tree manifest/per-file SHA-256 plus TD source-closure binding hooks.",
+                "Git provenance is commit/status/log-20/tree manifest/per-file SHA-256 plus TD source-closure binding.",
+                "meta/td-source-closure-binding.json binds real bitstream SHA-256 + full commit + source-manifest + TD reports when supplied; otherwise hook_ready until the integrator provides the tip bit.",
                 "Evidence is physically deduplicated; process lane receipts / matrix reruns require review-debug or --include-process-evidence.",
                 "Result-sensitive logs: PASS/not_run keep summaries; FAIL/BLOCKED/TIMEOUT/CRASH keep full evidence.",
                 "Hardware validation remains not_run unless a future task authorizes it.",

+ 5 - 6
tools/replay_review_compact.py

@@ -16,7 +16,7 @@ import json
 import os
 import subprocess
 import sys
-import tempfile
+import uuid
 from datetime import datetime, timezone
 from pathlib import Path
 from typing import Any
@@ -311,11 +311,10 @@ def replay_review_compact(
     """Run the four-state review-compact replay."""
     package_dir = package_dir.expanduser().resolve(strict=True)
     if extract_root is None:
-        extract_root = Path(
-            tempfile.mkdtemp(
-                prefix="prod2u-review-compact-replay-",
-                dir=os.environ.get("TMPDIR", "/tmp"),
-            )
+        # Must NOT pre-create the directory: replay_analysis_package refuses
+        # extract roots that already exist (exist_ok=False).
+        extract_root = Path(os.environ.get("TMPDIR", "/tmp")) / (
+            "prod2u-review-compact-replay-" + uuid.uuid4().hex
         )
     else:
         extract_root = extract_root.expanduser().resolve(strict=False)

+ 119 - 0
tools/run-test-profile.sh

@@ -0,0 +1,119 @@
+#!/usr/bin/env bash
+# Invoke one of the three software test profiles:
+#   live-repository | review-compact-detached | reference-regeneration
+set -euo pipefail
+unset LD_LIBRARY_PATH LD_PRELOAD QT_PLUGIN_PATH || true
+ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+VENV="${PRODU2_VERIFY_VENV:-${XDG_CACHE_HOME:-$HOME/.cache}/prod2u/venvs/verify}"
+PY="${VENV}/bin/python"
+[[ -x "$PY" ]] || PY=python3
+
+usage() {
+  cat <<'EOF' >&2
+usage:
+  tools/run-test-profile.sh live-repository [-- pytest/unittest args...]
+  tools/run-test-profile.sh review-compact-detached --package-dir DIR [--skip-software]
+  tools/run-test-profile.sh reference-regeneration [--refresh-inventory]
+
+Profiles:
+  live-repository           Full checkout structure + packaging unit tests
+  review-compact-detached   Compact ZIP selftest + four-state detached replay
+  reference-regeneration    Inventory refresh hook order (BRD regen stays local)
+EOF
+}
+
+if [[ $# -lt 1 ]]; then
+  usage
+  exit 2
+fi
+
+PROFILE="$1"
+shift
+export PRODU2_TEST_PROFILE="$PROFILE"
+cd "$ROOT"
+
+case "$PROFILE" in
+  live-repository|live)
+    export PRODU2_TEST_PROFILE=live-repository
+    exec "$PY" -B -m unittest \
+      tests.test_project_structure \
+      tests.unit.test_test_profiles \
+      tests.unit.test_td_source_closure_binding \
+      tests.unit.test_compact_package_selftest \
+      tests.unit.test_package_adversarial_compact \
+      tests.unit.test_package_for_agent_analysis \
+      "$@"
+    ;;
+  review-compact-detached|review-compact|detached|compact)
+    export PRODU2_TEST_PROFILE=review-compact-detached
+    PACKAGE_DIR=""
+    SKIP_SOFTWARE=0
+    EXTRA=()
+    while [[ $# -gt 0 ]]; do
+      case "$1" in
+        --package-dir)
+          PACKAGE_DIR="${2:-}"
+          shift 2 || true
+          ;;
+        --skip-software)
+          SKIP_SOFTWARE=1
+          shift
+          ;;
+        *)
+          EXTRA+=("$1")
+          shift
+          ;;
+      esac
+    done
+    if [[ -z "$PACKAGE_DIR" ]]; then
+      # Unit-level compact profile checks (no package required).
+      exec "$PY" -B -m unittest \
+        tests.unit.test_test_profiles \
+        tests.unit.test_compact_package_selftest \
+        tests.unit.test_td_source_closure_binding \
+        "${EXTRA[@]}"
+    fi
+    SELFTEST_ARGS=(--package-dir "$PACKAGE_DIR")
+    if [[ "$SKIP_SOFTWARE" -eq 1 ]]; then
+      SELFTEST_ARGS+=(--skip-software)
+    fi
+    exec "$PY" -B "$ROOT/tools/compact_package_selftest.py" "${SELFTEST_ARGS[@]}" "${EXTRA[@]}"
+    ;;
+  reference-regeneration|reference|reference-regen)
+    export PRODU2_TEST_PROFILE=reference-regeneration
+    REFRESH=0
+    EXTRA=()
+    while [[ $# -gt 0 ]]; do
+      case "$1" in
+        --refresh-inventory)
+          REFRESH=1
+          shift
+          ;;
+        *)
+          EXTRA+=("$1")
+          shift
+          ;;
+      esac
+    done
+    if [[ "$REFRESH" -eq 1 ]]; then
+      # Order hook: inventory refresh is allowed only under this profile intent.
+      "$PY" -B -c "
+from pathlib import Path
+import sys
+sys.path.insert(0, r'$ROOT/tools')
+import package_agent_handoff as handoff
+report = handoff.run_post_staging_reference_inventory_hook(Path(r'$ROOT'), staging_complete=True)
+print(report)
+raise SystemExit(0 if report.get('status') in {'pass', 'skipped_disabled'} else 1)
+"
+    fi
+    exec "$PY" -B -m unittest \
+      tests.unit.test_test_profiles \
+      tests.test_project_structure \
+      "${EXTRA[@]}"
+    ;;
+  *)
+    usage
+    exit 2
+    ;;
+esac

+ 176 - 0
tools/test_profiles.py

@@ -0,0 +1,176 @@
+#!/usr/bin/env python3
+"""Explicit software test profiles for live repo / compact detached / reference regen.
+
+Profiles (distinct from packaging handoff profiles):
+
+- ``live-repository``: full checkout with raw ``.git`` and reference originals.
+- ``review-compact-detached``: extracted review-compact tree (no BRD/PDF/legacy_rtl).
+- ``reference-regeneration``: local BRD regeneration / inventory refresh path.
+
+Override with ``PRODU2_TEST_PROFILE``. When unset, infer from git mode + tree shape.
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import os
+import sys
+from pathlib import Path
+from typing import Any
+
+TOOLS = Path(__file__).resolve().parent
+ROOT = TOOLS.parent
+if str(TOOLS) not in sys.path:
+    sys.path.insert(0, str(TOOLS))
+
+from git_worktree_mode import (  # noqa: E402
+    DETACHED,
+    LIVE_GIT,
+    SNAPSHOT,
+    detect_git_mode,
+)
+
+LIVE_REPOSITORY = "live-repository"
+REVIEW_COMPACT_DETACHED = "review-compact-detached"
+REFERENCE_REGENERATION = "reference-regeneration"
+TEST_PROFILES = frozenset(
+    {LIVE_REPOSITORY, REVIEW_COMPACT_DETACHED, REFERENCE_REGENERATION}
+)
+ENV_TEST_PROFILE = "PRODU2_TEST_PROFILE"
+
+# Paths that live only in the full repository / reference volume — never required
+# under review-compact-detached.
+REFERENCE_ONLY_PATHS = (
+    "reference/original/legacy_rtl/prod2u_p4_normal_v3_top_legacy.v",
+    "reference/original/legacy_rtl/prod2u_p4_normal_v3_top_legacy_tb.v",
+)
+
+
+def normalize_profile(value: str | None) -> str | None:
+    if value is None:
+        return None
+    text = value.strip().casefold().replace("_", "-")
+    aliases = {
+        "live": LIVE_REPOSITORY,
+        "live-repo": LIVE_REPOSITORY,
+        "live-repository": LIVE_REPOSITORY,
+        "compact": REVIEW_COMPACT_DETACHED,
+        "detached": REVIEW_COMPACT_DETACHED,
+        "review-compact": REVIEW_COMPACT_DETACHED,
+        "review-compact-detached": REVIEW_COMPACT_DETACHED,
+        "reference": REFERENCE_REGENERATION,
+        "reference-regen": REFERENCE_REGENERATION,
+        "reference-regeneration": REFERENCE_REGENERATION,
+    }
+    return aliases.get(text)
+
+
+def detect_test_profile(root: Path | None = None) -> str:
+    """Return active test profile from env or tree shape."""
+    override = normalize_profile(os.environ.get(ENV_TEST_PROFILE))
+    if override is not None:
+        return override
+
+    base = (root or ROOT).resolve()
+    # Explicit regeneration requests (BRD present + inventory tooling) win only
+    # when env asks; otherwise prefer git/compact shape.
+    git_mode = detect_git_mode(base)
+    if git_mode in {DETACHED, SNAPSHOT}:
+        return REVIEW_COMPACT_DETACHED
+    if git_mode == LIVE_GIT:
+        return LIVE_REPOSITORY
+    # Fallback: compact-shaped trees without .git.
+    if (base / "source").is_dir() and (base / "meta").is_dir():
+        return REVIEW_COMPACT_DETACHED
+    return LIVE_REPOSITORY
+
+
+def requires_reference_legacy_rtl(profile: str | None = None) -> bool:
+    """legacy_rtl is excluded from review-compact; only live/reference need it."""
+    active = profile or detect_test_profile()
+    return active in {LIVE_REPOSITORY, REFERENCE_REGENERATION}
+
+
+def allows_reference_regeneration(profile: str | None = None) -> bool:
+    active = profile or detect_test_profile()
+    return active == REFERENCE_REGENERATION
+
+
+def is_compact_detached(profile: str | None = None) -> bool:
+    active = profile or detect_test_profile()
+    return active == REVIEW_COMPACT_DETACHED
+
+
+def structure_required_paths(profile: str | None = None) -> tuple[str, ...]:
+    """Canonical files that structure tests must find for ``profile``."""
+    common = (
+        "projects/prod2u-door-temp/project.json",
+        "projects/prod2u-door-temp/requirements.zh-CN.md",
+        "schemas/project.schema.json",
+        "src/common/frame_rx.v",
+        "src/common/frame_tx.v",
+        "src/common/crc16_serial.v",
+        "src/modules/door_motor_engine.v",
+        "src/modules/temperature_reader.v",
+        "src/project/project_adapter.v",
+        "src/top/prod2u_p4_normal_v3_top.v",
+        "src/generated/prod2u_door_temp_params.vh",
+        "tests/sim/prod2u_p4_normal_v3_top_tb.v",
+        "td/prod2u_p4_normal_v3.prj",
+        "td/syn/prod2u_p4_normal_v3.tcl",
+        "td/phy/prod2u_p4_normal_v3.tcl",
+        "td/bitgen/prod2u_p4_normal_v3.tcl",
+        "constraints/prod2u_p4_normal_v3.adc",
+        "constraints/prod2u_p4_normal_v3.sdc",
+        "tools/run_verification_matrix.py",
+    )
+    active = profile or detect_test_profile()
+    if requires_reference_legacy_rtl(active):
+        return common + REFERENCE_ONLY_PATHS
+    return common
+
+
+def describe_test_profile(root: Path | None = None) -> dict[str, Any]:
+    base = (root or ROOT).resolve()
+    profile = detect_test_profile(base)
+    return {
+        "schema": "cpld-test-profile-v1",
+        "profile": profile,
+        "env_override": os.environ.get(ENV_TEST_PROFILE) or None,
+        "git_mode": detect_git_mode(base),
+        "requires_reference_legacy_rtl": requires_reference_legacy_rtl(profile),
+        "allows_reference_regeneration": allows_reference_regeneration(profile),
+        "is_compact_detached": is_compact_detached(profile),
+        "root": str(base),
+    }
+
+
+def build_parser() -> argparse.ArgumentParser:
+    parser = argparse.ArgumentParser(description=__doc__)
+    parser.add_argument(
+        "--root",
+        type=Path,
+        default=ROOT,
+        help="repository or extracted CPLD/source root",
+    )
+    parser.add_argument(
+        "--json",
+        action="store_true",
+        help="print profile description JSON",
+    )
+    return parser
+
+
+def main(argv: list[str] | None = None) -> int:
+    args = build_parser().parse_args(argv)
+    payload = describe_test_profile(args.root)
+    if args.json:
+        print(json.dumps(payload, ensure_ascii=False, indent=2))
+    else:
+        print(payload["profile"])
+    return 0
+
+
+if __name__ == "__main__":
+    raise SystemExit(main())

+ 10 - 2
tools/validate-board-viewer-detached.sh

@@ -1,10 +1,18 @@
 #!/usr/bin/env bash
 # Thin entrypoint: detached-derived validation for board-viewer six assets.
 # Does not require BRD; never claims BRD regeneration (not_packaged_by_policy).
+# Prefer PRODU2_VERIFY_VENV Python so jsonschema and other verify deps resolve.
 set -euo pipefail
 unset LD_LIBRARY_PATH LD_PRELOAD QT_PLUGIN_PATH || true
-export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PATH:-}"
 ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+VENV="${PRODU2_VERIFY_VENV:-${XDG_CACHE_HOME:-$HOME/.cache}/prod2u/venvs/verify}"
+PY="${VENV}/bin/python"
+if [[ ! -x "$PY" ]]; then
+  PY=python3
+fi
+# Keep a clean system PATH for subprocess tools, but never put it ahead of the
+# selected interpreter (venv must win for site-packages such as jsonschema).
+export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${PATH:+:$PATH}"
 LOG_DIR="${BOARDVIEW_LOG_DIR:-}"
 ARGS=()
 if [[ -n "$LOG_DIR" ]]; then
@@ -12,4 +20,4 @@ if [[ -n "$LOG_DIR" ]]; then
   ARGS+=(--json-out "$LOG_DIR/detached-derived-report.json")
 fi
 cd "$ROOT/tools/board-viewer"
-exec python3 validate_detached_derived.py "${ARGS[@]}" "$@"
+exec "$PY" -B validate_detached_derived.py "${ARGS[@]}" "$@"