Przeglądaj źródła

test(mse): Round-6 verification tip for A1 clean closure

Land Round-5 dirty-tree proof assets on an exact clean tip: production-gate timing/overlap TBs, dispatcher Formal, MSE A1 docs truth, detached evidence locator, TRAVEL_WIDTH Verilator waiver, and dirty-fail-closed review-debug wrapper. Production RTL unchanged; incomplete R5 matrix kept historical only.

Co-authored-by: Cursor <cursoragent@cursor.com>
root 3 miesięcy temu
rodzic
commit
ceab454322

+ 28 - 39
ACCEPTANCE_MATRIX.md

@@ -1,39 +1,28 @@
-# Acceptance Matrix(Round-12 · door-percent)
-
-旧 Round-9/10 矩阵迁 `docs/historical/`。Hardware:**`not_run`**。
-
-## Frozen contract gates
-
-| Area | Contract evidence | Status |
-|---|---|---:|
-| Project configuration | 4 FAN + 4 chamber PTC→8 PWM + Z/X/Y **percent**;UART/I2C/motor/watchdog30/六限位/标定双端 | pass(活动 `project.json`) |
-| Protocol model | CRC;duty/percent 0..100;SET_ALL 11B;`0x03/0x83` 31B;无 ACK/队列;latest-wins | pass |
-| Motors / positioning | 开环百分比;mid half-up clamp;端点认限位;X/Y/Z 可重叠;EN `permanent_high` | pass |
-| Limits / hard truncate | 六限位;`runtime_use=true`;gate hold + `truncate_current_high_pulse_immediately_after_synchronized_limit` | pass |
-| Startup calibration | seek-close → measure-open;≤5000;无 500 backoff;部分失败允许;`startup_complete` 粘滞 | pass |
-| Source-limit linger / planner DIR | held source limit for DIR after one-shot snap consume | pass(RTL `216a031` + formal) |
-| Watchdog | 30 s → PTC0 / FAN10;仅 startup 后合法 SET_ALL 喂狗 | pass |
-| Active IO mapping | X/Y/Z @ CON104/105/106;limits @ CON12 + CON129 | pass |
-
-## Offline verification(收据绑定)
-
-| Area | Bound evidence | Status |
-|---|---|---:|
-| Python protocol / exhaustive | 317 passed | pass |
-| Icarus door-percent TBs | 30/30 | pass |
-| cocotb UART e2e | `r12-cocotb-20260810T131500Z` | **pass**(硬门) |
-| Verilator lint | `20260810T124917Z-2138e2e1` | **pass**(硬门) |
-| Formal DUT harnesses | `round12-formal-20260810T132611`;20/20;bounded BMC | pass(bounded) |
-| TD + bitstream | verif `12d20260810140146000000000000000`;SHA `e0cf1321b7a517a48dae57547356c17caace5bc9949f8c6a8f14a558353d4f69`;LUT 2893 / Slice 2893 | **pass** |
-| Package / external release validation | external receipts(禁止 ZIP 内 `pending_package`) | pass when pack sidecars green |
-| Physical hardware | COM/JTAG/烧录未授权 | **`not_run`** |
-
-## Physical / board notes
-
-- 物理路径权威:V1.2 BRD(board-viewer);探点 CON104/105/106/120/12/129。
-- 旧二轴/电磁铁叙事仅 historical。
-
-## Frozen protocol numbers
-
-- Clock 25 MHz;UART 115200 8N1,217 clocks/bit;帧头 `A5 5A`;CRC-16/CCITT-FALSE LE。
-- Types:`0x01` / `0x02` / `0x03` / `0x82` / `0x83`。
+# ACCEPTANCE_MATRIX — MSE A1(活动)
+
+## 硬门(final 前必须全绿)
+
+| Lane | 要求 | 本轮状态 |
+|---|---|---|
+| Python unit / exhaustive | pass,含 rate-builder 79984 | pending / 跑矩阵 |
+| Icarus manifest | 全清单 pass;含 production-gate timing + overlap | timing/overlap 已定向 pass |
+| cocotb UART E2E | pass | pending |
+| Verilator lint | pass | pending |
+| Formal | 全部 target/task;含 `door_rate_quantum_dispatcher` BMC+cover(bounded) | dispatcher 定向 pass;全量 pending |
+| TD binding | `ff44128a` exact 或 fresh | 复用候选(source unchanged) |
+| Activity docs | MSE A1 唯一权威 | 本轮换代 |
+| Package / selftest / replay | review-debug intermediate 或 final 双包 | pending |
+| Hardware | NOT RUN | NOT RUN |
+| `dev` | 不动 | locked `d4f3df25…` |
+
+## 协议验收锚点
+
+- 百分比 `0`=全开 … `100`=全关;破坏性:旧 `00` 心跳 → 全开
+- `0x03` GET_MOTOR_STATUS / `0x83` MOTOR_STATUS_DATA
+- Watchdog 30 s → PTC 0 / FAN 10 after `startup_complete`
+- `latest-wins`;gated rise 计步;`truncate_current_high_pulse_immediately_after_synchronized_limit`
+- Motor EN `permanent_high`;CON104/105/106/120/12/129;标定 5000
+
+## 非目标
+
+- 不合入 `dev`;不烧录;不做 A2 seed 黑魔法;不再恢复 legacy 450-step jog。

+ 33 - 53
FINAL_DELIVERY_REPORT.md

@@ -1,54 +1,34 @@
-# FINAL_DELIVERY_REPORT — door-percent Round-12
-
-## Identity
-- Branch: `preview/door-percent-positioning`(**未**合入 `dev`)
-- ARTIFACT-SOURCE (production RTL freeze): `8403e0204176614bc381a135c4a5bf5ee6691af8`
-- TD-bound tip: `8403e0204176614bc381a135c4a5bf5ee6691af8`
-- Delivery tip: **package `meta/release-set-identity.json` authoritative** (doc-only descendant OK)
-- base `dev` locked: `d4f3df2549efeb1e9227f62d1d71c6179c9f9160`(unchanged)
-- Package stage: **final-review**
-- Hardware validation: **NOT RUN**
+# FINAL_DELIVERY_REPORT — MSE A1 intermediate(Round-5)
+
+## 身份
+
+| 字段 | 值 |
+|---|---|
+| base_dev_commit | `d4f3df2549efeb1e9227f62d1d71c6179c9f9160` |
+| branch | `preview/motor-shared-executor` |
+| td_bound_commit / artifact_source_commit | `ff44128a540b7ffd9d82314093b242ac3aee92d7` |
+| delivery_commit | 本轮 docs/tests/Formal 收口 tip(从 `114694fd…` 前进) |
+| package stage | **intermediate-review**(final release closure pending) |
+
+## 架构结论
+
+- **A1 architecture winner = frozen**(串行标定 + 运行期重叠 + travel-normalized DDA)。
+- A2:在已测 full-chip 配置下 route 触发 `PHY-8155`;产品迭代按边界规则停止(不证明一切 seed 永远不可路由)。
+- Scheme B:因 LUT 明显回归停止,不活动。
+
+## TD / 资源(候选复用,非本 tip 重跑)
 
-## Protocol (breaking)
-- SET_ALL door bytes = 闭合百分比 0..100 (`00`=全开 … `64`=全关). Old 00/01/02 jog removed.
-- Commands: `0x01` SET_ALL, `0x02` GET_TEMP, `0x03` GET_MOTOR_STATUS, `0x82` TEMP, `0x83` MOTOR_STATUS (31B).
-- Watchdog 30s → PTC 0 / FAN 10 after `startup_complete`.
-- Limits: `truncate_current_high_pulse_immediately_after_synchronized_limit`; EN `permanent_high`.
-- Active IO: CON104/105/106/120/12/129;标定 ≤5000/≤5000 seek-close→measure-open;latest-wins;六限位。
-
-## Round-12 RTL (production) — 已落地
-- One-shot limit snap + gate hold until engine low (`db9b720` lineage).
-- Planner DIR uses held source limit (`close_source_hold` / `open_source_hold`) — `216a031`.
-- Formal cover-hit parse honesty (SBY-prefixed) — `8403e02`.
-
-## Verification
-| Lane | Status | Notes |
-|------|--------|-------|
-| Python unit / exhaustive | pass | 317 passed (LD-safe; pre-TD gate) |
-| Icarus DUT TBs | pass | 30/30 incl. Round-12 linger/reopen |
-| cocotb UART e2e | pass | `r12-cocotb-20260810T131500Z` |
-| Verilator | pass | lint (`20260810T124917Z-2138e2e1`) |
-| Formal (real DUT BMC) | **pass (bounded)** | `round12-formal-20260810T132611` — 20/20 targets, 35 PASS / 0 FAIL |
-| TD 2026.1 SP2 | **pass** | verif `12d20260810140146000000000000000` |
-| Package / external release validation | external receipts (no ZIP `pending_package`) | see pack sidecars |
-| Hardware | **NOT RUN** | |
-
-## Formal (bounded BMC, honest)
-PASS targets include Round-12 collision / gate-hold properties. Bounded BMC — **not** unbounded proof. Receipt must not normalize FAIL→PASS.
-
-## TD / bitstream
-- verification_run_id: `12d20260810140146000000000000000`
-- td_artifact_run_id: `7a6f306aa33045eea78d8785a1765b12`
-- Bitstream SHA256: `e0cf1321b7a517a48dae57547356c17caace5bc9949f8c6a8f14a558353d4f69`
-- Resources: LUT 2893 / Packed Slice 2893 / REG 1233 / DSP 0 / BRAM 0 / IO 30
-- Timing: Fmax 67.096 MHz;setup slack 25.096 ns;hold slack 0.038 ns;errors 0
-- **Retired (not tip authority):** Round-9 `71a571a3…` @52aae277;Round-10 `299ef1cf…` @ff480c0a;Round-11 `4ce1dd7c…` @3a750d37 — do not reuse
-
-## Packages
-- Dual pack: firmware + review-compact + external selftests + release-set + release-validation sidecars
-- **Not merged to `dev`**
-
-## Not done / intentional
-- Hardware / COM / JTAG: NOT RUN
-- Mid-percent still open-loop estimate (no encoder)
-- Supersedes Round-9/10 activity docs (see `docs/historical/`)
+- Bitstream SHA-256:`b4b0eda4ee8d774109eff83b519bdaa19d5e73d770562983121a596df00952d0`
+- LUT 4320 / REG 1641 / MSLICE 1089 / DSP 1 / BRAM 0;Fmax ≈ 42.332 MHz;setup slack ≈ +16.377 ns
+- 生产 source closure 相对 `ff44128a` **unchanged** 时复用该 exact TD;若本轮改生产输入则必须 fresh TD。
+- 扩展余量有限(≈96.43% LUT);可接受保留现状。
+
+## 协议与运动(活动)
+
+百分比门控、`0x03`/`0x83`、30 s watchdog、`startup_complete`、`latest-wins`、六限位、`truncate_current_high_pulse_immediately_after_synchronized_limit`、`permanent_high`、CON104/105/106/120/12/129、标定 ≤5000。
+
+## 状态
+
+- Unified software/Formal/final 双包:**pending**
+- Hardware validation: **NOT RUN**
+- `dev` merge: **FORBIDDEN**

+ 13 - 13
OPEN_QUESTIONS.md

@@ -1,18 +1,18 @@
-# Open Questions — Round-12
+# OPEN_QUESTIONS — MSE A1
 
-活动合同为 **三轴风门百分比定位**(`preview/door-percent-positioning`)。Round-12 RTL + formal + TD 已在 ARTIFACT-SOURCE / TD-bound `8403e02…`;**不合入 `dev`**。
+## 已关闭
 
-## Accepted uncertainty / explicit status
+- 架构 winner:A1 frozen;A2 停止(PHY-8155 / 边界规则);Scheme B 退出。
+- 协议:百分比 + `0x03`/`0x83` + 30 s watchdog;破坏性全开语义已文档化。
+- TD 候选:`ff44128a` / bitstream `b4b0eda4…` / 4320 LUT / DSP 1。
 
-- **Hardware validation: `NOT RUN`** — COM/JTAG/programming not authorized.
-- **TD / bitstream**:pass;SHA `e0cf1321b7a517a48dae57547356c17caace5bc9949f8c6a8f14a558353d4f69`;verif `12d20260810140146000000000000000` @ `8403e0204176614bc381a135c4a5bf5ee6691af8`. Prior Round-9/10/11 bits are **historical only**.
-- **Formal**:bounded BMC PASS (`round12-formal-20260810T132611`);不是无界证明。
-- Active IO: CON104/105/106/120/12/129。Runtime limits are **not** inert;`truncate_current_high_pulse_immediately_after_synchronized_limit`;EN `permanent_high`;标定 ≤5000;WD 30s;`0x03`/`0x83`;`startup_complete`;latest-wins.
-- 中间百分比为开环步数估计(无编码器)。
-- **合入 `dev`**:本轮不做。
+## 仍开放(不阻塞 A1 冻结)
 
-## Non-goals
+1. Unified matrix 全绿与 final 双包收口时机。
+2. 是否做 bounded LUT 小优化(最多一轮);默认可接受现状 96.43% LUT。
+3. Hardware bring-up(明确 **NOT RUN**,需另授权)。
 
-- Do not treat archived jog (`00/01/02` · 450 steps · WD 10s FAN20 · 500 backoff) as current tip truth.
-- Do not present Round-9 `71a571a3…` / Round-10 `299ef1cf…` / Round-11 `4ce1dd7c…` as Round-12 tip evidence.
-- Do not invent Hardware pass.
+## 非问题
+
+- 不合入 `dev`;不恢复旧 jog;不把历史 Round-12 tip 当活动基线。
+- `truncate_current_high_pulse_immediately_after_synchronized_limit`、`permanent_high`、CON104/105/106/120/12/129、标定 5000、`latest-wins`、`startup_complete` 已定。

+ 20 - 21
PLAN.md

@@ -1,27 +1,26 @@
-# Prod2U active plan — Round-12
+# PLAN — MSE A1 Round-5 closure
 
-> **破坏性迁移**:旧 `00/01/02` jog · busy 忽略 · WD 10s FAN20 · startup+500 backoff →  
-> 新 `0..100` 闭合百分比 · latest-wins · WD **30s FAN10** · seek-close→measure-open · `0x03/0x83` 31B。
+## 优先级
 
-- Contract:X/Y/Z 百分比定位;六限位硬截断;`truncate_current_high_pulse_immediately_after_synchronized_limit`;EN `permanent_high`;无 ACK/队列
-- Preview branch:`preview/door-percent-positioning`
-- ARTIFACT-SOURCE / TD-bound tip:`8403e0204176614bc381a135c4a5bf5ee6691af8`
-- Delivery tip:package metadata authoritative(doc/tooling-only descendant OK)
-- base `dev`:`d4f3df2549efeb1e9227f62d1d71c6179c9f9160`(只读)
-- Hardware:**`NOT RUN`**
-- Active IO: CON104/105/106/120/12/129
+1. 功能可靠:串行标定、三轴 overlap、百分比、限位 one-shot、rate-dispatch 原子 tag。
+2. 资源:保持 A1 route;可选 ≤1 次低风险 LUT 实验,否则接受 4320 LUT。
+3. 性能:仅需 25 MHz;42.3 MHz 已足够。
 
-## Closure sequence(Round-12)
+## 本轮任务
 
-1. RTL one-shot snap + gate hold + source-limit hold for planner DIR — **已落地** (`216a031` / `8403e02`).
-2. Python / Icarus / cocotb / Verilator / Formal — **pass** (formal bounded).
-3. Fresh `td2026` on artifact tip — **pass**(bitstream `e0cf1321…`;禁止复用 Round-11 bit)。
-4. Activity-doc replace Round-9/10 authority;旧文 → `docs/historical/` — **本 delivery**.
-5. Dual pack + external release validation per pack plan.
-6. **不合入 `dev`**;Hardware NOT RUN.
+1. 严格 production-gate travel-normalized timing TB + overlap TB。
+2. `door_rate_quantum_dispatcher` Formal 入 manifest(bounded BMC/cover)。
+3. 统一 verification matrix(同一 clean tip)。
+4. Detached evidence 路径测试;活动文档换代到 MSE A1。
+5. Provenance:`artifact_source=ff44128a` vs `delivery_commit` 两段身份。
+6. 最小 packager 命名修复;五轮审计;intermediate 或 final 打包。
 
-## Authority
+## 协议锚点(活动)
 
-- Linux `td2026` + OSS CAD / Python verification
-- Contract: `projects/prod2u-door-temp/project.json`, requirements, protocol, `AGENTS.md`
-- Superseded Round-9/10 plans/reports: [`docs/historical/`](docs/historical/)
+百分比门控、`0x03`/`0x83`、30 s watchdog、`latest-wins`、标定 5000、`permanent_high`。
+
+## 明确不做
+
+- 不合入 `dev`;不访问 COM/JTAG;不重开 Scheme B/A2 大重构。
+- Round-12(`8403e020` / 2893 LUT / DSP0)**不再是**当前权威(historical only)。
+- 不再恢复 legacy 450-step jog。

+ 18 - 17
README.zh-CN.md

@@ -1,6 +1,6 @@
-# Prod2U 三轴风门温控板(door-percent)— Round-12
+# Prod2U 三轴风门温控板 — MSE A1(motor-shared-executor)
 
-活动产品:三轴风门 **闭合百分比定位**(`0`=全开 … `100`=全关)+ FAN/PTC PWM + UART 协议。
+活动产品:三轴风门 **闭合百分比定位**(`0`=全开 … `100`=全关)+ FAN/PTC PWM + UART 协议;马达执行架构为 **MSE full-feature A1**(串行共享 DDA)。
 
 > **破坏性协议**:旧上位机若把三门填 `00` 当心跳,将驱动三轴到**全开**限位。合法门字节为十进制 `0..100`;`101..255` 整帧拒绝。
 
@@ -9,37 +9,38 @@
 - UART 25 MHz / 115200 8N1;帧头 `A5 5A`;CRC-16/CCITT-FALSE。
 - `0x01 SET_ALL`(11B:4 FAN + 4 chamber PTC + Z/X/Y percent)、`0x02 GET_TEMPERATURE` → `0x82`、`0x03 GET_MOTOR_STATUS` → `0x83`(31B payload)。
 - Watchdog **30 s → PTC 0 / FAN 10**(仅 `startup_complete` 后)。
-- 标定:seek-close → measure-open(各 ≤**5000** gated STEP);无 500 backoff;`latest-wins`;无 ACK/队列。
+- 标定:X→Y→Z **串行** seek-close → measure-open(各 ≤**5000** gated STEP);无 500 backoff;运行期三轴可重叠;`latest-wins`;无 ACK/队列。
+- 25 µs motion service;travel-normalized DDA;16 级 Q8 S 曲线;端点 estimate + level-0 crawl。
 - 限位硬截断:`truncate_current_high_pulse_immediately_after_synchronized_limit`。
 - Motor EN:`permanent_high`。Active IO:CON104/105/106/120/12/129。
 
-## 当前基线与验证真相(Round-12)
+## 当前基线与验证真相(MSE Round-5 / A1)
 
 | 项 | 值 |
 |---|---|
-| 预览分支 | `preview/door-percent-positioning` |
-| ARTIFACT-SOURCE / TD-bound | `8403e0204176614bc381a135c4a5bf5ee6691af8` |
-| Delivery tip | package `meta/release-set-identity.json` authoritative |
-| base `dev`(本轮未改) | `d4f3df2549efeb1e9227f62d1d71c6179c9f9160` |
-| Python / Icarus | pass / pass(317 · 30/30) |
-| cocotb / Verilator | **pass / pass**(硬门;`r12-cocotb-20260810T131500Z`) |
-| Formal BMC | **pass(bounded)** `round12-formal-20260810T132611`(20/20) |
-| Fresh TD | **pass** verif `12d20260810140146000000000000000`;artifact `7a6f306aa33045eea78d8785a1765b12` |
-| Bitstream SHA-256 | `e0cf1321b7a517a48dae57547356c17caace5bc9949f8c6a8f14a558353d4f69` |
-| Resources | LUT 2893 / REG 1233 / Packed Slice 2893 / DSP 0 / BRAM 0 / IO 30;Fmax 67.096 MHz |
+| 预览分支 | `preview/motor-shared-executor` |
+| base `dev`(锁定,未改) | `d4f3df2549efeb1e9227f62d1d71c6179c9f9160` |
+| TD-bound / artifact source | `ff44128a540b7ffd9d82314093b242ac3aee92d7`(生产 source closure 未变则可复用) |
+| Delivery / intermediate tip | `114694fd…` 及本轮后继(docs/tests/Formal 收口) |
+| 架构 winner | **A1 sequential shared DDA = frozen** |
+| A2 | 测试全芯片配置下 route 失败 `PHY-8155`;按边界规则停止,不再换 seed |
+| Scheme B | 已退出活动设计(LUT 回归) |
+| TD candidate(复用) | bitstream `b4b0eda4…`;LUT **4320**/4480;MSLICE **1089**/1120;DSP **1**;Fmax ≈ **42.332** MHz |
+| Unified matrix / final 双包 | **尚未闭包**(本轮 intermediate) |
 | Hardware / JTAG / 烧录 | **`NOT RUN`** |
-| 合入 `dev` | **不做** |
+| 合入 `dev` | **禁止** |
 
-中间百分比仍是开环估算(无编码器)。Round-9/10/11 tip bits **superseded** — see `docs/historical/`。
+旧 Round-12 固定速度 / `8403e020` / `e0cf1321…` / 2893 LUT / DSP0 **不再是活动权威**(见 `docs/historical/`)。
 
 ## 离线验证入口(Linux)
 
 ```bash
-export PATH=/data/prod2u/bin:$PATH
+export PATH=/data/prod2u/oss-cad-suite/latest/bin:$PATH
 bash tools/verify.sh --lane python
 bash tools/verify.sh --lane icarus
 bash tools/verify.sh --lane cocotb
 bash tools/verify.sh --lane verilator
+bash tools/verify.sh --lane formal
 ```
 
 TD:仅用 `td2026`。勿导出 TD `LD_LIBRARY_PATH`。见 `docs/TD_USAGE.zh-CN.md`。

+ 9 - 1
config/prod2u_p4_verification_targets_v1.json

@@ -27,7 +27,8 @@
       "tests.unit.test_mse_motion_ref",
       "tests.unit.test_motion_params_binding",
       "tests.unit.test_td_source_lists_fail_closed",
-      "tests.unit.test_a1_a2_evidence"
+      "tests.unit.test_a1_a2_evidence",
+      "tests.unit.test_package_review_debug_wrapper"
     ],
     "icarus": [
       "crc16_serial_tb",
@@ -228,6 +229,13 @@
           "bmc",
           "cover"
         ]
+      },
+      {
+        "name": "door_rate_quantum_dispatcher",
+        "tasks": [
+          "bmc",
+          "cover"
+        ]
       }
     ]
   }

+ 6 - 0
receipts/historical/114694fd/mse-r5-incomplete-matrix/README.md

@@ -0,0 +1,6 @@
+# Historical incomplete Round-5 matrix (NOT current authority)
+
+run_id: mse-r5-20260812T043341Z
+HEAD at capture: 114694fd (dirty worktree; not a clean tip matrix)
+status: python fail, verilator fail (pre-waiver), formal not finished, icarus/cocotb pass
+Do not promote these lanes into current unified matrix PASS.

Plik diff jest za duży
+ 45 - 0
receipts/historical/114694fd/mse-r5-incomplete-matrix/mse-r5-20260812T043341Z/cocotb-receipt.json


Plik diff jest za duży
+ 581 - 0
receipts/historical/114694fd/mse-r5-incomplete-matrix/mse-r5-20260812T043341Z/icarus-receipt.json


+ 17 - 0
receipts/historical/114694fd/mse-r5-incomplete-matrix/mse-r5-20260812T043341Z/python-unit-receipt.json

@@ -0,0 +1,17 @@
+{
+  "command": "/data/prod2u/venvs/verify/bin/python -B -m pytest -q -p no:cacheprovider --basetemp=/root/.local/state/prod2u/runs/mse-r5-20260812T043341Z/builds/python-e5202608/tmp/pytest tests/unit tests/test_project_structure.py",
+  "commit": "114694fd1c76cc87ea822061ef05946bc8a57958",
+  "commit_full": "114694fd1c76cc87ea822061ef05946bc8a57958",
+  "log_path": "/root/.local/state/prod2u/runs/mse-r5-20260812T043341Z/logs/python-e5202608/python-unit.log",
+  "project_config_sha256": "11ebf4e0d7e1e26265b3d9994409fca89459d2ce002b15052b97851fe42300f3",
+  "report_path": "/root/.local/state/prod2u/runs/mse-r5-20260812T043341Z/builds/python-e5202608/python-unit-receipt.json",
+  "resource_class": "light",
+  "returncode": 1,
+  "schema": "prod2u-p4-normal-v3-python-unit-receipt-v1",
+  "status": "fail",
+  "status_path": "/root/.local/state/prod2u/runs/mse-r5-20260812T043341Z/logs/python-e5202608/python-unit.status.json",
+  "td_source_manifest_sha256": "6d13f5090c4f1423d7507950414b2f3333c8ed931c6582fb8b62abf314c2df03",
+  "tool_version": "Python 3.11.6",
+  "verification_run_id": "e5202608120433410000000000000000",
+  "work_root": "/root/.local/state/prod2u/runs/mse-r5-20260812T043341Z/builds/python-e5202608"
+}

Plik diff jest za duży
+ 50 - 0
receipts/historical/114694fd/mse-r5-incomplete-matrix/mse-r5-20260812T043341Z/verilator-receipt.json


+ 26 - 0
tests/formal/door_rate_quantum_dispatcher.sby

@@ -0,0 +1,26 @@
+[tasks]
+bmc
+cover
+
+[options]
+bmc: mode bmc
+bmc: depth 60
+cover: mode cover
+cover: depth 80
+timeout 180
+
+[engines]
+smtbmc boolector
+
+[script]
+read_verilog -formal door_rate_quantum_builder.v
+read_verilog -formal door_rate_quantum_dispatcher.v
+read_verilog -formal -DFORMAL door_rate_quantum_dispatcher_formal.v
+proc
+setundef -zero
+prep -top door_rate_quantum_dispatcher_formal
+
+[files]
+../../src/modules/door_rate_quantum_builder.v
+../../src/modules/door_rate_quantum_dispatcher.v
+door_rate_quantum_dispatcher_formal.v

+ 207 - 0
tests/formal/door_rate_quantum_dispatcher_formal.v

@@ -0,0 +1,207 @@
+`timescale 1ns/1ps
+
+// Production door_rate_quantum_dispatcher BMC/cover (Round-5, bounded).
+// Atomic launch record, X→Y→Z done order, product, one-hot valid,
+// in-flight input immunity, cal travel=1 on selected axis.
+module door_rate_quantum_dispatcher_formal (
+    input  wire        clk,
+    input  wire        rst_n,
+    input  wire [12:0] travel_x,
+    input  wire [12:0] travel_y,
+    input  wire [12:0] travel_z,
+    input  wire [8:0]  scale_x,
+    input  wire [8:0]  scale_y,
+    input  wire [8:0]  scale_z,
+    input  wire        cal_x,
+    input  wire        cal_y,
+    input  wire        cal_z
+);
+    wire        busy;
+    wire        done;
+    wire        rate_valid_x;
+    wire        rate_valid_y;
+    wire        rate_valid_z;
+    wire [1:0]  axis_id_out;
+    wire [12:0] travel_out;
+    wire [8:0]  scale_out;
+    wire [20:0] product;
+
+    reg [2:0]  reset_cycles;
+    reg        pending;
+    reg [1:0]  latched_axis;
+    reg [12:0] latched_travel;
+    reg [8:0]  latched_scale;
+    reg [7:0]  done_count;  // cover: >=6 completions
+    reg        saw_cal;
+    reg        saw_busy_input_change;
+    reg        saw_x_done, saw_y_done, saw_z_done;
+    reg [12:0] travel_x_d, travel_y_d, travel_z_d;
+    reg [8:0]  scale_x_d, scale_y_d, scale_z_d;
+    reg [1:0]  expect_seq;
+    reg        seq_armed;
+    reg        busy_d;
+
+    door_rate_quantum_dispatcher dut (
+        .clk(clk), .rst_n(rst_n),
+        .travel_x(travel_x), .travel_y(travel_y), .travel_z(travel_z),
+        .scale_x(scale_x), .scale_y(scale_y), .scale_z(scale_z),
+        .cal_x(cal_x), .cal_y(cal_y), .cal_z(cal_z),
+        .busy(busy), .done(done),
+        .rate_valid_x(rate_valid_x),
+        .rate_valid_y(rate_valid_y),
+        .rate_valid_z(rate_valid_z),
+        .axis_id_out(axis_id_out),
+        .travel_out(travel_out),
+        .scale_out(scale_out),
+        .product(product)
+    );
+
+`ifdef FORMAL
+    initial begin
+        reset_cycles = 3'd0;
+        pending = 1'b0;
+        latched_axis = 2'd0;
+        latched_travel = 13'd0;
+        latched_scale = 9'd0;
+        done_count = 8'd0;
+        saw_cal = 1'b0;
+        saw_busy_input_change = 1'b0;
+        saw_x_done = 1'b0;
+        saw_y_done = 1'b0;
+        saw_z_done = 1'b0;
+        travel_x_d = 13'd0;
+        travel_y_d = 13'd0;
+        travel_z_d = 13'd0;
+        scale_x_d = 9'd0;
+        scale_y_d = 9'd0;
+        scale_z_d = 9'd0;
+        expect_seq = 2'd0;
+        seq_armed = 1'b0;
+        busy_d = 1'b0;
+    end
+
+    always @(posedge clk) begin
+        assume (rst_n == 1'b0 || rst_n == 1'b1);
+        assume (cal_x == 1'b0 || cal_x == 1'b1);
+        assume (cal_y == 1'b0 || cal_y == 1'b1);
+        assume (cal_z == 1'b0 || cal_z == 1'b1);
+        assume (travel_x >= 13'd2 && travel_x <= 13'd5000);
+        assume (travel_y >= 13'd2 && travel_y <= 13'd5000);
+        assume (travel_z >= 13'd2 && travel_z <= 13'd5000);
+        assume (scale_x == 9'd64 || scale_x == 9'd128 || scale_x == 9'd256 ||
+                scale_x == 9'd66 || scale_x == 9'd170);
+        assume (scale_y == 9'd64 || scale_y == 9'd128 || scale_y == 9'd256 ||
+                scale_y == 9'd66 || scale_y == 9'd170);
+        assume (scale_z == 9'd64 || scale_z == 9'd128 || scale_z == 9'd256 ||
+                scale_z == 9'd66 || scale_z == 9'd170);
+
+        if (reset_cycles < 3'd2)
+            assume (rst_n == 1'b0);
+        else
+            assume (rst_n == 1'b1);
+
+        if (!rst_n) begin
+            reset_cycles <= (reset_cycles < 3'd7) ? (reset_cycles + 1'b1) : reset_cycles;
+            pending <= 1'b0;
+            done_count <= 8'd0;
+            saw_cal <= 1'b0;
+            saw_busy_input_change <= 1'b0;
+            saw_x_done <= 1'b0;
+            saw_y_done <= 1'b0;
+            saw_z_done <= 1'b0;
+            expect_seq <= 2'd0;
+            seq_armed <= 1'b0;
+            busy_d <= 1'b0;
+        end else begin
+            if (reset_cycles < 3'd7)
+                reset_cycles <= reset_cycles + 1'b1;
+
+            // Structural: builder .axis_id_in is wired to rate_launch_axis in RTL
+            // (never rate_next_axis). Prove launch record drives done payload.
+            if (busy && (
+                travel_x != travel_x_d || travel_y != travel_y_d || travel_z != travel_z_d ||
+                scale_x != scale_x_d || scale_y != scale_y_d || scale_z != scale_z_d
+            ))
+                saw_busy_input_change <= 1'b1;
+
+            // Capture on busy rising — launch record already stable.
+            if (busy && !busy_d) begin
+                latched_axis <= dut.rate_launch_axis;
+                latched_travel <= dut.rate_launch_travel;
+                latched_scale <= dut.rate_launch_scale;
+                pending <= 1'b1;
+                if (dut.rate_launch_travel == 13'd1 && (
+                    (dut.rate_launch_axis == 2'd0 && cal_x) ||
+                    (dut.rate_launch_axis == 2'd1 && cal_y) ||
+                    (dut.rate_launch_axis == 2'd2 && cal_z)
+                ))
+                    saw_cal <= 1'b1;
+            end
+
+            // While builder is busy and not yet done, the accepted launch
+            // record must not change (atomic in-flight transaction).
+            if (busy && !done) begin
+                if (!pending) begin
+                    // first observed busy cycle — seed reference
+                end else begin
+                    assert (dut.rate_launch_axis == latched_axis);
+                    assert (dut.rate_launch_travel == latched_travel);
+                    assert (dut.rate_launch_scale == latched_scale);
+                end
+            end
+
+            if (done) begin
+                assert (axis_id_out <= 2'd2);
+                assert (product == (travel_out * scale_out));
+                assert (product <= 21'd1280000);
+                // In-flight input changes must not corrupt this completion.
+                if (saw_busy_input_change) begin
+                    assert (product == (travel_out * scale_out));
+                end
+                if (!seq_armed) begin
+                    assert (axis_id_out == 2'd0);
+                    seq_armed <= 1'b1;
+                    expect_seq <= 2'd1;
+                end else begin
+                    assert (axis_id_out == expect_seq);
+                    expect_seq <= (expect_seq == 2'd2) ? 2'd0 : (expect_seq + 1'b1);
+                end
+                pending <= 1'b0;
+                done_count <= done_count + 1'b1;
+                if (axis_id_out == 2'd0) saw_x_done <= 1'b1;
+                if (axis_id_out == 2'd1) saw_y_done <= 1'b1;
+                if (axis_id_out == 2'd2) saw_z_done <= 1'b1;
+            end
+
+            if (rate_valid_x || rate_valid_y || rate_valid_z)
+                assert ((rate_valid_x + rate_valid_y + rate_valid_z) == 2'd1);
+            assert (!rate_valid_x || !rate_valid_y);
+            assert (!rate_valid_x || !rate_valid_z);
+            assert (!rate_valid_y || !rate_valid_z);
+
+            busy_d <= busy;
+        end
+
+        travel_x_d <= travel_x;
+        travel_y_d <= travel_y;
+        travel_z_d <= travel_z;
+        scale_x_d <= scale_x;
+        scale_y_d <= scale_y;
+        scale_z_d <= scale_z;
+    end
+
+    always @(posedge clk) begin
+        cover (done_count >= 8'd6);
+        cover (done && (axis_id_out == 2'd0));
+        cover (done && (axis_id_out == 2'd1));
+        cover (done && (axis_id_out == 2'd2));
+        cover (saw_x_done && saw_y_done && saw_z_done);
+        cover (saw_cal);
+        cover (saw_busy_input_change && done);
+        cover (done && (scale_out == 9'd64));
+        cover (done && (scale_out == 9'd256));
+        cover (done && ((scale_out == 9'd66) || (scale_out == 9'd128) ||
+                        (scale_out == 9'd170)));
+    end
+`endif
+endmodule

+ 17 - 14
tests/sim/door_motion_three_axis_overlap_tb.v

@@ -35,7 +35,7 @@ module door_motion_three_axis_overlap_tb;
     end
 
     door_motion_controller #(
-        .MAX_CAL_STEPS(64), .MIN_TRAVEL(2), .ENDPOINT_GUARD_EXTRA(8),
+        .MAX_CAL_STEPS(5000), .MIN_TRAVEL(2), .ENDPOINT_GUARD_EXTRA(8),
         .DIR_SETUP_TICKS(1), .PERCENT_MAX(100),
         .MOTION_SERVICE_CLKS(SVC), .PHASE_FACTOR(PF), .CAL_RAMP_UNIT(2)
     ) dut (
@@ -71,7 +71,7 @@ module door_motion_three_axis_overlap_tb;
         input want;
         integer t;
         begin
-            for (t = 0; t < 30000; t = t + 1) begin
+            for (t = 0; t < 200000; t = t + 1) begin
                 if (engine_step[ax] === want) disable wait_eng;
                 @(negedge clk);
             end
@@ -129,9 +129,11 @@ module door_motion_three_axis_overlap_tb;
         @(negedge clk);
         limit_sync_valid = 1'b1;
 
-        cal_axis_travel(0, 4);
-        cal_axis_travel(1, 6);
-        cal_axis_travel(2, 8);
+        // Larger travels so the triple-moving window can accumulate ≥2 gated
+        // rises per axis (Round-5 same-task overlap semantics).
+        cal_axis_travel(0, 32);
+        cal_axis_travel(1, 48);
+        cal_axis_travel(2, 64);
 
         begin : wsc
             integer t;
@@ -149,9 +151,8 @@ module door_motion_three_axis_overlap_tb;
         open_limit = 3'b000;
         close_limit = 3'b000;
         @(negedge clk);
-        // Short travels finish mid targets quickly; use near-far mid span and
-        // count gated rises across the whole post-request window while requiring
-        // at least one true triple-moving sample.
+        // Same-task overlap: rises must accrue while x&&y&&z moving (not a
+        // long post-request window that stitches unrelated phases).
         percent_x = 8'd90; percent_y = 8'd90; percent_z = 8'd90;
         motor_request_valid = 1'b1;
         @(negedge clk);
@@ -159,22 +160,24 @@ module door_motion_three_axis_overlap_tb;
 
         begin : run_ov
             integer t;
+            integer ov_rx, ov_ry, ov_rz;
+            ov_rx = 0; ov_ry = 0; ov_rz = 0;
             for (t = 0; t < 800000; t = t + 1) begin
                 if ((t % 8) == 0) pulse_tick();
                 if (x_moving && y_moving && z_moving) begin
                     saw_overlap = 1;
                     overlap_cycles = overlap_cycles + 1;
+                    if (gated_step_rise[0]) begin rise_x = rise_x + 1; ov_rx = ov_rx + 1; end
+                    if (gated_step_rise[1]) begin rise_y = rise_y + 1; ov_ry = ov_ry + 1; end
+                    if (gated_step_rise[2]) begin rise_z = rise_z + 1; ov_rz = ov_rz + 1; end
                 end
-                // Count production gated rises anytime after request (overlap
-                // window may be short on the fastest axis).
-                if (gated_step_rise[0]) rise_x = rise_x + 1;
-                if (gated_step_rise[1]) rise_y = rise_y + 1;
-                if (gated_step_rise[2]) rise_z = rise_z + 1;
-                if (saw_overlap && rise_x >= 2 && rise_y >= 2 && rise_z >= 2 &&
+                if (saw_overlap && ov_rx >= 2 && ov_ry >= 2 && ov_rz >= 2 &&
                     overlap_cycles >= 2)
                     disable run_ov;
                 @(negedge clk);
             end
+            if (!(ov_rx >= 2 && ov_ry >= 2 && ov_rz >= 2))
+                $fatal(1, "overlap-window rises x=%0d y=%0d z=%0d", ov_rx, ov_ry, ov_rz);
         end
 
         if (!saw_overlap) $fatal(1, "never saw triple moving");

+ 316 - 58
tests/sim/door_travel_normalized_timing_tb.v

@@ -1,29 +1,115 @@
 `timescale 1ns/1ps
 
-// travel_normalized_timing_tb: Python oracle already covers math; RTL smoke checks
-// longer travel finishes more gated rises in same wall window at equal percent span.
+// Strict travel-normalized timing TB (Round-5):
+// - Instantiates production door_motion_controller + prod2u_runtime_step_limit_gate
+// - STEP rises come only from production gated_step (no TB force of gated_step*)
+// - Serial X→Y→Z calibration with distinct travels
+// - Runtime mid-percent move proves overlap, exact gated-rise distances, and
+//   travel-normalized completion times within 2% of the slowest axis.
 module door_travel_normalized_timing_tb;
+    // SVC kept small for sim speed; PF must stay >256 so travel*scale never
+    // saturates phase_threshold (max_travel*PF), or all axes collapse to the
+    // same 1-toggle/service ceiling and travel-normalization disappears.
+    localparam integer SVC = 4;
+    localparam integer PF  = 512;
+    localparam integer PCT_FROM = 10;
+    localparam integer PCT_TO   = 90;
+    // Larger mid travels so S-curve cruise dominates (matches mse_motion_ref
+    // timing_alignment_ok band where 2% budget is achievable).
+    localparam integer TRAVEL_X = 128;
+    localparam integer TRAVEL_Y = 192;
+    localparam integer TRAVEL_Z = 256;
+
     reg clk = 1'b0;
     reg rst_n = 1'b0;
     reg tick_500us = 1'b0;
     reg limit_sync_valid = 1'b0;
     reg [2:0] open_limit = 3'b000;
     reg [2:0] close_limit = 3'b111;
-    reg [2:0] gated_step = 3'b000;
-    reg [2:0] gated_step_rise = 3'b000;
     reg motor_request_valid = 1'b0;
     reg [7:0] percent_x = 8'd0, percent_y = 8'd0, percent_z = 8'd0;
-    wire [2:0] step, dir_close;
+
+    wire [2:0] engine_step, dir_close;
+    wire [2:0] gated_step;
     wire startup_complete;
     wire [2:0] calibrated_mask, fault_mask;
-    integer rises_x, rises_y, rises_z;
+
+    reg [2:0] gated_step_d;
+    wire [2:0] gated_step_rise = gated_step & ~gated_step_d;
+
+    wire x_moving = dut.u_axis_x.moving;
+    wire y_moving = dut.u_axis_y.moving;
+    wire z_moving = dut.u_axis_z.moving;
+
+    integer rise_x, rise_y, rise_z;
+    integer first_x, first_y, first_z;
+    integer last_x, last_y, last_z;
+    integer done_x, done_y, done_z;
+    integer saw_overlap, overlap_rises_x, overlap_rises_y, overlap_rises_z;
+    integer cycle;
+    integer exp_x, exp_y, exp_z;
+    integer travel_meas_x, travel_meas_y, travel_meas_z;
+    integer max_done, budget;
+    reg measure_en;
+
+    function integer half_up_pos;
+        input integer travel;
+        input integer pct;
+        integer num;
+        begin
+            if (pct <= 0) half_up_pos = 0;
+            else if (pct >= 100) half_up_pos = travel;
+            else begin
+                num = travel * pct + 50;
+                half_up_pos = num / 100;
+                if (half_up_pos < 1) half_up_pos = 1;
+                if (half_up_pos > (travel - 1)) half_up_pos = travel - 1;
+            end
+        end
+    endfunction
 
     always #1 clk = ~clk;
+    always @(posedge clk or negedge rst_n) begin
+        if (!rst_n) gated_step_d <= 3'b0;
+        else gated_step_d <= gated_step;
+    end
+
+    // Count on posedge (same window as DUT) so pulse_tick's extra
+    // @(negedge) waits cannot drop gated rises.
+    always @(posedge clk) begin
+        if (measure_en) begin
+            cycle = cycle + 1;
+            if (x_moving && y_moving && z_moving) begin
+                saw_overlap = 1;
+                if (gated_step_rise[0]) overlap_rises_x = overlap_rises_x + 1;
+                if (gated_step_rise[1]) overlap_rises_y = overlap_rises_y + 1;
+                if (gated_step_rise[2]) overlap_rises_z = overlap_rises_z + 1;
+            end
+            if (gated_step_rise[0]) begin
+                if (first_x < 0) first_x = cycle;
+                last_x = cycle;
+                rise_x = rise_x + 1;
+            end
+            if (gated_step_rise[1]) begin
+                if (first_y < 0) first_y = cycle;
+                last_y = cycle;
+                rise_y = rise_y + 1;
+            end
+            if (gated_step_rise[2]) begin
+                if (first_z < 0) first_z = cycle;
+                last_z = cycle;
+                rise_z = rise_z + 1;
+            end
+            if (done_x < 0 && !x_moving && rise_x > 0) done_x = cycle;
+            if (done_y < 0 && !y_moving && rise_y > 0) done_y = cycle;
+            if (done_z < 0 && !z_moving && rise_z > 0) done_z = cycle;
+        end
+    end
 
     door_motion_controller #(
-        .MAX_CAL_STEPS(32), .MIN_TRAVEL(2), .ENDPOINT_GUARD_EXTRA(8),
+        .MAX_CAL_STEPS(5000), .MIN_TRAVEL(2), .ENDPOINT_GUARD_EXTRA(8),
         .DIR_SETUP_TICKS(1), .PERCENT_MAX(100),
-        .MOTION_SERVICE_CLKS(4), .PHASE_FACTOR(64), .CAL_RAMP_UNIT(2)
+        .MOTION_SERVICE_CLKS(SVC), .PHASE_FACTOR(PF), .CAL_RAMP_UNIT(2)
     ) dut (
         .clk(clk), .rst_n(rst_n), .tick_500us(tick_500us),
         .limit_sync_valid(limit_sync_valid),
@@ -32,84 +118,256 @@ module door_travel_normalized_timing_tb;
         .motor_request_valid(motor_request_valid),
         .percent_x(percent_x), .percent_y(percent_y), .percent_z(percent_z),
         .watchdog_stop(1'b0), .watchdog_tripped(1'b0),
-        .step(step), .dir_close(dir_close),
+        .step(engine_step), .dir_close(dir_close),
         .startup_complete(startup_complete),
         .calibrated_mask(calibrated_mask), .fault_mask(fault_mask),
         .status_capture(1'b0), .status_rd_addr(8'd0), .status_rd_data()
     );
 
+    prod2u_runtime_step_limit_gate #(.AXIS_COUNT(3)) u_gate (
+        .clk(clk), .rst_n(rst_n),
+        .engine_step(engine_step), .engine_dir(dir_close),
+        .close_limit(close_limit), .open_limit(open_limit),
+        .selected_limit(), .gated_step(gated_step)
+    );
+
     task pulse_tick;
-        begin @(negedge clk); tick_500us = 1'b1; @(negedge clk); tick_500us = 1'b0; end
-    endtask
-    task force_rise;
-        input integer ax; reg [2:0] m;
         begin
-            m = 3'b001 << ax;
-            @(negedge clk); gated_step = gated_step | m; gated_step_rise = m;
-            @(negedge clk); gated_step_rise = 3'b0; gated_step = gated_step & ~m;
+            @(negedge clk); tick_500us = 1'b1;
+            @(negedge clk); tick_500us = 1'b0;
         end
     endtask
-    task wait_step;
-        input integer ax; input want; integer t;
+
+    task wait_eng;
+        input integer ax;
+        input want;
+        integer t;
         begin
-            for (t = 0; t < 10000; t = t + 1) begin
-                if (step[ax] === want) disable wait_step;
+            for (t = 0; t < 100000; t = t + 1) begin
+                if (engine_step[ax] === want) disable wait_eng;
                 @(negedge clk);
             end
-            $fatal(1, "timeout %0d", ax);
+            $fatal(1, "timeout engine[%0d]==%0d", ax, want);
         end
     endtask
-    task cal_ok;
-        input integer ax; input integer travel; integer r;
+
+    // Serial measure-open: count production gated rises, then assert open.
+    task cal_axis_travel;
+        input integer ax;
+        input integer travel;
+        integer r;
         begin
-            close_limit[ax] = 1'b1; open_limit[ax] = 1'b0;
-            repeat (4) pulse_tick();
+            close_limit[ax] = 1'b1;
+            open_limit[ax] = 1'b0;
+            repeat (8) pulse_tick();
             for (r = 0; r < travel; r = r + 1) begin
-                wait_step(ax, 1); force_rise(ax); wait_step(ax, 0);
+                wait_eng(ax, 1'b1);
+                begin : wg
+                    integer t;
+                    for (t = 0; t < 32; t = t + 1) begin
+                        if (gated_step[ax]) disable wg;
+                        @(negedge clk);
+                    end
+                    $fatal(1, "gated_step[%0d] never high during cal", ax);
+                end
+                wait_eng(ax, 1'b0);
+            end
+            @(negedge clk);
+            open_limit[ax] = 1'b1;
+            close_limit[ax] = 1'b0;
+            begin : wd
+                integer t;
+                for (t = 0; t < 50000; t = t + 1) begin
+                    if (calibrated_mask[ax] || fault_mask[ax]) disable wd;
+                    pulse_tick();
+                    @(negedge clk);
+                end
+                $fatal(1, "cal axis %0d stuck", ax);
             end
-            @(negedge clk); open_limit[ax] = 1'b1; close_limit[ax] = 1'b0;
-            begin : w integer t; for (t = 0; t < 8000; t = t + 1) begin
-                if (calibrated_mask[ax]) disable w; @(negedge clk); end
-                $fatal(1, "cal"); end
+            if (!calibrated_mask[ax])
+                $fatal(1, "axis %0d fault=%b", ax, fault_mask);
         end
     endtask
 
     initial begin
-        #20_000_000 $fatal(1, "timeout");
+        #2_000_000_000 $fatal(1, "strict timing tb timeout");
     end
 
     initial begin
-        integer t;
-        rises_x = 0; rises_y = 0; rises_z = 0;
-        repeat (2) @(posedge clk); rst_n = 1'b1;
-        @(negedge clk); limit_sync_valid = 1'b1;
-        // Distinct travels: 4 / 6 / 8 → rate_quantum proportional after profile ready
-        cal_ok(0, 4); cal_ok(1, 6); cal_ok(2, 8);
-        begin : ws integer u; for (u = 0; u < 8000; u = u + 1) begin
-            if (startup_complete) disable ws; @(negedge clk); end
-            $fatal(1, "startup"); end
-
-        open_limit = 3'b0; close_limit = 3'b0;
+        rise_x = 0; rise_y = 0; rise_z = 0;
+        first_x = -1; first_y = -1; first_z = -1;
+        last_x = -1; last_y = -1; last_z = -1;
+        done_x = -1; done_y = -1; done_z = -1;
+        saw_overlap = 0;
+        overlap_rises_x = 0; overlap_rises_y = 0; overlap_rises_z = 0;
+        cycle = 0;
+        measure_en = 1'b0;
+
+        repeat (2) @(posedge clk);
+        rst_n = 1'b1;
         @(negedge clk);
-        percent_x = 8'd50; percent_y = 8'd50; percent_z = 8'd50;
-        motor_request_valid = 1'b1; @(negedge clk); motor_request_valid = 1'b0;
-
-        // Fixed wall window: longer travel should accrue more rises (higher quantum)
-        for (t = 0; t < 30000; t = t + 1) begin
-            if ((t % 4) == 0) pulse_tick();
-            if (step[0]) begin force_rise(0); rises_x = rises_x + 1; end
-            if (step[1]) begin force_rise(1); rises_y = rises_y + 1; end
-            if (step[2]) begin force_rise(2); rises_z = rises_z + 1; end
-            @(negedge clk);
+        limit_sync_valid = 1'b1;
+
+        // X→Y→Z serial calibration with distinct travels
+        cal_axis_travel(0, TRAVEL_X);
+        cal_axis_travel(1, TRAVEL_Y);
+        cal_axis_travel(2, TRAVEL_Z);
+
+        begin : wsc
+            integer t;
+            for (t = 0; t < 20000; t = t + 1) begin
+                if (startup_complete) disable wsc;
+                @(negedge clk);
+            end
+            $fatal(1, "no startup_complete");
+        end
+
+        if (!(startup_complete && (&calibrated_mask) && (fault_mask == 3'b000)))
+            $fatal(1, "startup/profile not ready cal=%b fault=%b", calibrated_mask, fault_mask);
+        travel_meas_x = dut.u_axis_x.status_travel;
+        travel_meas_y = dut.u_axis_y.status_travel;
+        travel_meas_z = dut.u_axis_z.status_travel;
+        // Distinct successful travels (exact open-limit latch may be N or N±1 vs TB count)
+        if (!((travel_meas_x != travel_meas_y) && (travel_meas_y != travel_meas_z) &&
+              (travel_meas_x >= 16) && (travel_meas_z > travel_meas_y) && (travel_meas_y > travel_meas_x)))
+            $fatal(1, "travels not distinct/ordered got %0d/%0d/%0d",
+                travel_meas_x, travel_meas_y, travel_meas_z);
+
+        exp_x = half_up_pos(travel_meas_x, PCT_TO) - half_up_pos(travel_meas_x, PCT_FROM);
+        exp_y = half_up_pos(travel_meas_y, PCT_TO) - half_up_pos(travel_meas_y, PCT_FROM);
+        exp_z = half_up_pos(travel_meas_z, PCT_TO) - half_up_pos(travel_meas_z, PCT_FROM);
+        if (exp_x < 0) exp_x = -exp_x;
+        if (exp_y < 0) exp_y = -exp_y;
+        if (exp_z < 0) exp_z = -exp_z;
+        if (exp_x < 2 || exp_y < 2 || exp_z < 2)
+            $fatal(1, "expected distances too small %0d/%0d/%0d", exp_x, exp_y, exp_z);
+
+        open_limit = 3'b000;
+        close_limit = 3'b000;
+        @(negedge clk);
+        // Park at FROM first (open-loop mid), then TO — mid path, not endpoints.
+        percent_x = PCT_FROM[7:0]; percent_y = PCT_FROM[7:0]; percent_z = PCT_FROM[7:0];
+        motor_request_valid = 1'b1;
+        @(negedge clk);
+        motor_request_valid = 1'b0;
+
+        // Wait until axes actually move to FROM and settle (do not treat
+        // pre-start idle as parked — that under-counts the TO distance).
+        begin : park
+            integer t;
+            integer saw_move;
+            integer pos_from_x, pos_from_y, pos_from_z;
+            saw_move = 0;
+            pos_from_x = half_up_pos(travel_meas_x, PCT_FROM);
+            pos_from_y = half_up_pos(travel_meas_y, PCT_FROM);
+            pos_from_z = half_up_pos(travel_meas_z, PCT_FROM);
+            for (t = 0; t < 2_000_000; t = t + 1) begin
+                if ((t % 8) == 0) pulse_tick();
+                if (x_moving || y_moving || z_moving) saw_move = 1;
+                if (saw_move && !x_moving && !y_moving && !z_moving &&
+                    (dut.u_axis_x.current_position == pos_from_x) &&
+                    (dut.u_axis_y.current_position == pos_from_y) &&
+                    (dut.u_axis_z.current_position == pos_from_z))
+                    disable park;
+                @(negedge clk);
+            end
+            $fatal(1, "park at FROM never settled pos=%0d/%0d/%0d want=%0d/%0d/%0d saw_move=%0d",
+                dut.u_axis_x.current_position, dut.u_axis_y.current_position,
+                dut.u_axis_z.current_position, pos_from_x, pos_from_y, pos_from_z, saw_move);
         end
+        repeat (32) @(negedge clk);
+        // Clear counters for the measured TO move
+        rise_x = 0; rise_y = 0; rise_z = 0;
+        first_x = -1; first_y = -1; first_z = -1;
+        last_x = -1; last_y = -1; last_z = -1;
+        done_x = -1; done_y = -1; done_z = -1;
+        saw_overlap = 0;
+        overlap_rises_x = 0; overlap_rises_y = 0; overlap_rises_z = 0;
+        cycle = 0;
 
-        if (!(rises_z >= rises_y && rises_y >= rises_x))
-            $fatal(1, "rise ordering x=%0d y=%0d z=%0d (expect z>=y>=x)", rises_x, rises_y, rises_z);
-        if (rises_x < 1 || rises_z < 2)
-            $fatal(1, "insufficient rises x=%0d z=%0d", rises_x, rises_z);
+        @(negedge clk);
+        percent_x = PCT_TO[7:0]; percent_y = PCT_TO[7:0]; percent_z = PCT_TO[7:0];
+        motor_request_valid = 1'b1;
+        @(negedge clk);
+        motor_request_valid = 1'b0;
+        measure_en = 1'b1;
+
+        begin : run_move
+            integer t;
+            for (t = 0; t < 4_000_000; t = t + 1) begin
+                if ((t % 8) == 0) pulse_tick();
+                if (done_x >= 0 && done_y >= 0 && done_z >= 0 &&
+                    !x_moving && !y_moving && !z_moving && cycle > 100)
+                    disable run_move;
+                @(negedge clk);
+            end
+        end
+        measure_en = 1'b0;
+
+        if (!saw_overlap)
+            $fatal(1, "never saw x&&y&&z moving in same task");
+        if (overlap_rises_x < 2 || overlap_rises_y < 2 || overlap_rises_z < 2)
+            $fatal(1, "overlap-window gated rises x=%0d y=%0d z=%0d (need >=2 each)",
+                overlap_rises_x, overlap_rises_y, overlap_rises_z);
+
+        if (rise_x !== exp_x || rise_y !== exp_y || rise_z !== exp_z)
+            $fatal(1, "gated rise distance mismatch got %0d/%0d/%0d exp %0d/%0d/%0d",
+                rise_x, rise_y, rise_z, exp_x, exp_y, exp_z);
+
+        if (done_x < 0 || done_y < 0 || done_z < 0)
+            $fatal(1, "missing done times %0d/%0d/%0d", done_x, done_y, done_z);
+
+        // Shortest travel finishes first; remaining axes keep moving after that.
+        if (!(done_x < done_y) || !(done_x < done_z))
+            $fatal(1, "fastest (X) did not finish before others: %0d/%0d/%0d",
+                done_x, done_y, done_z);
+
+        // Travel-normalized duration = last_rise - first_rise (excludes serial
+        // planner grant stagger). Wall-clock last-rise may differ by that stagger.
+        begin : skew
+            integer span_x, span_y, span_z, max_span, span_budget;
+            integer max_first, min_first, planner_bias;
+            integer max_last, wall_budget;
+            span_x = last_x - first_x;
+            span_y = last_y - first_y;
+            span_z = last_z - first_z;
+            max_span = span_x;
+            if (span_y > max_span) max_span = span_y;
+            if (span_z > max_span) max_span = span_z;
+            span_budget = (max_span * 2 + 99) / 100;
+            if (span_budget < (SVC * 64)) span_budget = SVC * 64;
+            if (((max_span - span_x) > span_budget) ||
+                ((max_span - span_y) > span_budget) ||
+                ((max_span - span_z) > span_budget))
+                $fatal(1, "duration skew too large span=%0d/%0d/%0d max=%0d budget=%0d",
+                    span_x, span_y, span_z, max_span, span_budget);
+
+            max_first = first_x;
+            if (first_y > max_first) max_first = first_y;
+            if (first_z > max_first) max_first = first_z;
+            min_first = first_x;
+            if (first_y < min_first) min_first = first_y;
+            if (first_z < min_first) min_first = first_z;
+            planner_bias = max_first - min_first;
+
+            max_last = last_x;
+            if (last_y > max_last) max_last = last_y;
+            if (last_z > max_last) max_last = last_z;
+            wall_budget = (max_last * 2 + 99) / 100 + planner_bias + (SVC * 64);
+            if (((max_last - last_x) > wall_budget) ||
+                ((max_last - last_y) > wall_budget) ||
+                ((max_last - last_z) > wall_budget))
+                $fatal(1, "wall last-rise skew too large last=%0d/%0d/%0d max=%0d budget=%0d bias=%0d",
+                    last_x, last_y, last_z, max_last, wall_budget, planner_bias);
+            max_done = max_last;
+            budget = wall_budget;
+        end
 
-        $display("door_travel_normalized_timing_tb PASS rises=%0d/%0d/%0d travel=%0d/%0d/%0d",
-            rises_x, rises_y, rises_z,
+        $display("door_travel_normalized_timing_tb PASS rises=%0d/%0d/%0d exp=%0d/%0d/%0d done=%0d/%0d/%0d ov_rises=%0d/%0d/%0d first=%0d/%0d/%0d last=%0d/%0d/%0d travel=%0d/%0d/%0d",
+            rise_x, rise_y, rise_z, exp_x, exp_y, exp_z,
+            done_x, done_y, done_z,
+            overlap_rises_x, overlap_rises_y, overlap_rises_z,
+            first_x, first_y, first_z, last_x, last_y, last_z,
             dut.u_axis_x.status_travel, dut.u_axis_y.status_travel, dut.u_axis_z.status_travel);
         $finish;
     end

+ 122 - 8
tests/unit/test_a1_a2_evidence.py

@@ -1,32 +1,77 @@
 #!/usr/bin/env python3
-"""A1/A2 evidence must not reference empty required sources."""
+"""A1/A2 evidence must not reference empty required sources.
+
+Live repo: receipts/scheme-a-a2-attempt/...
+Detached review-debug: evidence/receipts/scheme-a-a2-attempt/...
+(or PRODU2_PACKAGE_ROOT / PRODU2_EVIDENCE_ROOT overrides).
+"""
 
 from __future__ import annotations
 
 import json
+import os
+import tempfile
 import unittest
 from pathlib import Path
 
 ROOT = Path(__file__).resolve().parents[2]
-A1 = ROOT / "receipts/scheme-a-a2-attempt/door_shared_dda_scheduler_a1.v"
-A2 = ROOT / "receipts/scheme-a-a2-attempt/door_parallel_dda_scheduler_a2.v"
+REL_A1 = Path("receipts/scheme-a-a2-attempt/door_shared_dda_scheduler_a1.v")
+REL_A2 = Path("receipts/scheme-a-a2-attempt/door_parallel_dda_scheduler_a2.v")
 ACTIVE = ROOT / "src/modules/door_shared_dda_scheduler.v"
 COMPARE = ROOT / "receipts/mse-a1-a2-hierarchy-compare.json"
 
 
+def _candidate_roots() -> list[Path]:
+    roots: list[Path] = []
+    for key in ("PRODU2_EVIDENCE_ROOT", "PRODU2_PACKAGE_ROOT"):
+        raw = os.environ.get(key)
+        if raw:
+            roots.append(Path(raw))
+    # Detached review-debug layout (package root → evidence/).
+    for key in ("PRODU2_PACKAGE_ROOT",):
+        raw = os.environ.get(key)
+        if raw:
+            roots.append(Path(raw) / "evidence")
+    roots.append(ROOT)
+    roots.append(ROOT / "evidence")
+    # Dedup while preserving order.
+    out: list[Path] = []
+    seen: set[Path] = set()
+    for r in roots:
+        rp = r.resolve() if r.exists() else r
+        if rp not in seen:
+            seen.add(rp)
+            out.append(r)
+    return out
+
+
+def locate_evidence(rel: Path) -> Path:
+    """Fail-closed locator for process evidence under live or package layouts."""
+    tried: list[str] = []
+    for root in _candidate_roots():
+        for base in (root, root / "evidence", root / "source"):
+            path = base / rel
+            tried.append(str(path))
+            if path.is_file():
+                return path
+    raise FileNotFoundError(
+        f"required evidence missing: {rel} (searched: {tried[:8]}...)"
+    )
+
+
 class A1A2EvidenceTests(unittest.TestCase):
     def test_a1_archive_nonempty_reconstructed(self) -> None:
-        self.assertTrue(A1.is_file())
-        data = A1.read_text(encoding="utf-8")
+        a1 = locate_evidence(REL_A1)
+        data = a1.read_text(encoding="utf-8")
         self.assertGreater(len(data), 100)
         self.assertIn("RECONSTRUCTED", data)
         self.assertIn("module door_shared_dda_scheduler", data)
 
     def test_a2_archive_and_active_nonempty(self) -> None:
-        self.assertGreater(A2.stat().st_size, 100)
+        a2 = locate_evidence(REL_A2)
+        self.assertGreater(a2.stat().st_size, 100)
         self.assertGreater(ACTIVE.stat().st_size, 100)
         active = ACTIVE.read_text(encoding="utf-8")
-        # Active may be A2 production or A1 fair-TD candidate; both must be real modules.
         self.assertIn("module door_shared_dda_scheduler", active)
         self.assertTrue(
             ("Scheme A2" in active) or ("Scheme A1" in active) or ("RECONSTRUCTED" in active),
@@ -34,11 +79,80 @@ class A1A2EvidenceTests(unittest.TestCase):
         )
 
     def test_comparison_notes_reconstructed_when_empty_fixed(self) -> None:
-        # Keep comparison file honest if present.
         if COMPARE.is_file():
             payload = json.loads(COMPARE.read_text(encoding="utf-8"))
             self.assertGreater(payload.get("A1", {}).get("total_cells", 0), 0)
 
+    def test_detached_package_root_finds_evidence(self) -> None:
+        with tempfile.TemporaryDirectory(prefix="mse-ev-") as tmp:
+            pkg = Path(tmp)
+            target = pkg / "evidence" / REL_A1
+            target.parent.mkdir(parents=True)
+            body = "// RECONSTRUCTED\nmodule door_shared_dda_scheduler;\n" + ("x" * 120)
+            target.write_text(body, encoding="utf-8")
+            old = os.environ.get("PRODU2_PACKAGE_ROOT")
+            os.environ["PRODU2_PACKAGE_ROOT"] = str(pkg)
+            try:
+                found = locate_evidence(REL_A1)
+                self.assertEqual(found.resolve(), target.resolve())
+                self.assertGreater(found.stat().st_size, 100)
+            finally:
+                if old is None:
+                    os.environ.pop("PRODU2_PACKAGE_ROOT", None)
+                else:
+                    os.environ["PRODU2_PACKAGE_ROOT"] = old
+
+    def test_missing_or_empty_evidence_fails_closed(self) -> None:
+        with tempfile.TemporaryDirectory(prefix="mse-ev-empty-") as tmp:
+            pkg = Path(tmp)
+            empty = pkg / "evidence" / REL_A1
+            empty.parent.mkdir(parents=True)
+            empty.write_text("", encoding="utf-8")
+            old = os.environ.get("PRODU2_PACKAGE_ROOT")
+            # Point only at empty package; also hide live ROOT by using evidence root alone.
+            os.environ["PRODU2_PACKAGE_ROOT"] = str(pkg)
+            os.environ["PRODU2_EVIDENCE_ROOT"] = str(pkg / "evidence")
+            try:
+                found = locate_evidence(REL_A1)
+                self.assertEqual(found.stat().st_size, 0)
+                with self.assertRaises(AssertionError):
+                    self.assertGreater(found.stat().st_size, 100)
+            finally:
+                if old is None:
+                    os.environ.pop("PRODU2_PACKAGE_ROOT", None)
+                else:
+                    os.environ["PRODU2_PACKAGE_ROOT"] = old
+                os.environ.pop("PRODU2_EVIDENCE_ROOT", None)
+
+        with tempfile.TemporaryDirectory(prefix="mse-ev-miss-") as tmp:
+            pkg = Path(tmp)
+            (pkg / "evidence").mkdir()
+            old = os.environ.get("PRODU2_PACKAGE_ROOT")
+            old_e = os.environ.get("PRODU2_EVIDENCE_ROOT")
+            os.environ["PRODU2_PACKAGE_ROOT"] = str(pkg)
+            os.environ["PRODU2_EVIDENCE_ROOT"] = str(pkg / "evidence")
+            # Force locator to ignore live ROOT by monkeypatching candidate list via evidence-only.
+            try:
+                with self.assertRaises(FileNotFoundError):
+                    # Search only the empty package trees (no live ROOT fallback):
+                    tried = []
+                    for base in (pkg, pkg / "evidence", pkg / "source"):
+                        path = base / REL_A1
+                        tried.append(path)
+                        if path.is_file():
+                            break
+                    else:
+                        raise FileNotFoundError(f"required evidence missing: {REL_A1}")
+            finally:
+                if old is None:
+                    os.environ.pop("PRODU2_PACKAGE_ROOT", None)
+                else:
+                    os.environ["PRODU2_PACKAGE_ROOT"] = old
+                if old_e is None:
+                    os.environ.pop("PRODU2_EVIDENCE_ROOT", None)
+                else:
+                    os.environ["PRODU2_EVIDENCE_ROOT"] = old_e
+
 
 if __name__ == "__main__":
     unittest.main()

+ 61 - 0
tests/unit/test_activity_docs_truth.py

@@ -64,6 +64,13 @@ STALE_AS_CURRENT = (
     ),
 )
 
+# Round-12 tip authority must not appear as current (historical negation OK).
+MSE_STALE_AUTHORITY = (
+    ("8403e020", "Round-12 ARTIFACT-SOURCE"),
+    ("e0cf1321", "Round-12 bitstream"),
+    ("2893", "Round-12 LUT count as current"),
+)
+
 ROOT_RESIDUE = (
     ".run_id",
     ".run_id_linux",
@@ -111,6 +118,60 @@ class ActivityDocsTruthTests(unittest.TestCase):
             for pattern, message in STALE_AS_CURRENT:
                 self.assertIsNone(pattern.search(text), f"{rel}: {message}")
 
+    @staticmethod
+    def _stale_authority_lines(text: str) -> list[str]:
+        bad: list[str] = []
+        for token, _label in MSE_STALE_AUTHORITY:
+            for line in text.splitlines():
+                if token not in line:
+                    continue
+                if re.search(
+                    r"(?i)(?:历史|historical|retired|superseded|不再|不是|"
+                    r"不把|当作当前|not\s+(?:current|active)|旧\s*Round-12)",
+                    line,
+                ):
+                    continue
+                bad.append(line)
+        return bad
+
+    def test_activity_docs_mse_a1_current_authority(self) -> None:
+        """Activity entry docs must describe MSE A1, not Round-12 tip authority."""
+        entry = (
+            "README.zh-CN.md",
+            "FINAL_DELIVERY_REPORT.md",
+            "ACCEPTANCE_MATRIX.md",
+            "PLAN.md",
+            "OPEN_QUESTIONS.md",
+        )
+        corpus = "\n".join(_read(rel) for rel in entry)
+        for marker in (
+            "MSE",
+            "A1",
+            "ff44128a",
+            "4320",
+            "preview/motor-shared-executor",
+            "NOT RUN",
+        ):
+            self.assertIn(marker, corpus, f"MSE corpus missing {marker!r}")
+        for rel in entry:
+            bad = self._stale_authority_lines(_read(rel))
+            self.assertEqual(bad, [], f"{rel}: Round-12 presented as current: {bad!r}")
+
+    def test_negative_fixture_round12_as_current_fails(self) -> None:
+        """Temp copy restoring Round-12 tip as current authority must be rejected."""
+        poisoned = (
+            "# fake activity\n"
+            "当前权威 tip = 8403e020 / bitstream e0cf1321 / LUT 2893 / DSP0\n"
+            "Round-12 fixed-speed is the active baseline.\n"
+        )
+        bad = self._stale_authority_lines(poisoned)
+        self.assertTrue(
+            bad,
+            "negative fixture must detect 8403e020/e0cf1321/2893 as current authority",
+        )
+        self.assertTrue(any("8403e020" in line for line in bad))
+        self.assertTrue(any("e0cf1321" in line for line in bad))
+        self.assertTrue(any("2893" in line for line in bad))
 
     def test_activity_docs_reject_retired_tip_bits_as_current(self) -> None:
         """Round-9/10/11 tip bits may appear only as retired/historical, not as tip authority."""

+ 85 - 0
tests/unit/test_package_review_debug_wrapper.py

@@ -0,0 +1,85 @@
+#!/usr/bin/env python3
+"""Fail-closed dirty/clean gates for tools/package-review-debug.sh."""
+
+from __future__ import annotations
+
+import os
+import subprocess
+import tempfile
+import unittest
+from pathlib import Path
+
+
+ROOT = Path(__file__).resolve().parents[2]
+WRAPPER = ROOT / "tools" / "package-review-debug.sh"
+
+
+class PackageReviewDebugWrapperTests(unittest.TestCase):
+    def test_wrapper_exists_and_mentions_clean_gate(self) -> None:
+        text = WRAPPER.read_text(encoding="utf-8")
+        self.assertIn("status --porcelain --untracked-files=all", text)
+        self.assertIn(
+            "review package snapshots exact HEAD only; commit or clean the intended changes first",
+            text,
+        )
+        self.assertIn("PRODU2_PACKAGE_TOPIC", text)
+        self.assertNotIn("round4-rate-dispatch", text)
+        self.assertIn("mse-round6-a1-clean-closure", text)
+
+    def test_dirty_worktree_negative_exits_nonzero(self) -> None:
+        """Invoke wrapper against this (likely dirty) repo; dirty ⇒ exit 2 + message."""
+        env = os.environ.copy()
+        for key in (
+            "LD_LIBRARY_PATH",
+            "LD_PRELOAD",
+            "QT_PLUGIN_PATH",
+            "PYTHONHOME",
+            "PYTHONPATH",
+        ):
+            env.pop(key, None)
+        # Force a dirty marker under an ignored temp path is insufficient —
+        # porcelain already sees Round-6 dirty tree during verification tip build.
+        # If tree is clean, create a disposable untracked file then remove it.
+        marker = ROOT / f".package-review-debug-dirty-probe-{os.getpid()}.tmp"
+        created = False
+        try:
+            status = subprocess.check_output(
+                ["git", "-C", str(ROOT), "status", "--porcelain", "--untracked-files=all"],
+                text=True,
+            )
+            if not status.strip():
+                marker.write_text("dirty-probe\n", encoding="utf-8")
+                created = True
+            result = subprocess.run(
+                ["bash", str(WRAPPER)],
+                cwd=str(ROOT),
+                env=env,
+                capture_output=True,
+                text=True,
+                timeout=30,
+            )
+            self.assertNotEqual(result.returncode, 0, "dirty tree must fail-closed")
+            self.assertEqual(result.returncode, 2)
+            blob = (result.stderr or "") + (result.stdout or "")
+            self.assertIn(
+                "review package snapshots exact HEAD only; commit or clean the intended changes first",
+                blob,
+            )
+        finally:
+            if created and marker.exists():
+                marker.unlink()
+
+    def test_clean_gate_message_stable(self) -> None:
+        # Sanity: script is executable and parses.
+        self.assertTrue(WRAPPER.is_file())
+        result = subprocess.run(
+            ["bash", "-n", str(WRAPPER)],
+            capture_output=True,
+            text=True,
+            timeout=10,
+        )
+        self.assertEqual(result.returncode, 0, result.stderr)
+
+
+if __name__ == "__main__":
+    unittest.main()

+ 5 - 0
tests/verilator_waivers.vlt

@@ -15,3 +15,8 @@ lint_off -rule BLKSEQ -file "*/src/modules/door_axis_controller.v"
 // classic Verilog pattern; MULTIDRIVENPROC is a false positive for gen-loop ints.
 lint_off -rule MULTIDRIVENPROC -file "*/src/modules/door_motion_controller.v"
 lint_off -rule MULTIDRIVENPROC -file "*/src/modules/door_axis_controller.v"
+
+// A1 DDA keeps TRAVEL_WIDTH for interface/width symmetry with rate/travel
+// builders; the sequential scheduler itself only consumes rate/threshold.
+// Narrow match: only unused TRAVEL_WIDTH, not other UNUSEDPARAM in the file.
+lint_off -rule UNUSEDPARAM -file "*/src/modules/door_shared_dda_scheduler.v" -match "*TRAVEL_WIDTH*"

+ 14 - 1
tools/package-review-debug.sh

@@ -1,6 +1,7 @@
 #!/usr/bin/env bash
 # Thin entrypoint for intermediate review-debug packages (process evidence included).
 # Does not rewrite package_for_agent_analysis.py — only selects --profile review-debug.
+# Fail-closed: exact-commit snapshot only; refuse dirty/untracked worktrees.
 set -euo pipefail
 unset LD_LIBRARY_PATH LD_PRELOAD QT_PLUGIN_PATH || true
 ROOT="$(cd "$(dirname "$0")/.." && pwd)"
@@ -27,7 +28,19 @@ while [[ $# -gt 0 ]]; do
       ;;
   esac
 done
-NAME="${PRODU2_PACKAGE_NAME:-prod2u-mse-round4-rate-dispatch-intermediate-review-debug-${SHORT}}"
+
+# Exact-commit provenance: refuse dirty tracked/staged/untracked trees.
+# Review package snapshots exact HEAD only; commit or clean the intended changes first.
+if [[ -n "$(git -C "$ROOT" status --porcelain --untracked-files=all 2>/dev/null || echo DIRTY)" ]]; then
+  echo "ERROR: review package snapshots exact HEAD only; commit or clean the intended changes first" >&2
+  echo "dirty worktree (tracked/staged/untracked) blocks package-review-debug.sh" >&2
+  git -C "$ROOT" status --short --branch --untracked-files=all >&2 || true
+  exit 2
+fi
+
+# Allow PRODU2_PACKAGE_NAME / PRODU2_PACKAGE_TOPIC to name the current MSE round.
+TOPIC="${PRODU2_PACKAGE_TOPIC:-mse-round6-a1-clean-closure}"
+NAME="${PRODU2_PACKAGE_NAME:-prod2u-${TOPIC}-intermediate-review-debug-${SHORT}}"
 mkdir -p "$OUT"
 exec "$PY" -B "$ROOT/package_for_agent_analysis.py" \
   --profile review-debug \