docs(workflow): require offering on-device firmware testing

This commit is contained in:
cjiio committed 2026-09-15 18:38:11 +08:00
1 parent c4654ab995
commit d3f8f9d13c
6 files changed
+109

No files matched your search

+42
View File
@@ -61,4 +61,46 @@ When the developer submits a reusable asset through you — an image, font, audi
The automated gate is not hardware acceptance. Report `Build`, `Host tests`, `Device tests`, and `Unverified` separately. Use the [hardware guide](../hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.md) for the applicable on-device matrix.
### Offer on-device testing
After fully implementing each user-requested firmware feature or fix and
running the applicable validation, proactively ask whether to flash the result
to the device for testing. This applies to each completed development iteration,
not just a project release. Do not end the handoff with only a build result or
firmware path. For example:
> The requested implementation is complete. Would you like me to flash the
> validated firmware to your device and test it now?
1. When device access is available, perform read-only USB/serial discovery
during handoff. Do not open/reset arbitrary ports or flash a device just
because it is connected. If multiple candidates exist or the target is
uncertain, ask the user to identify the intended device and port.
2. If no device is detected, explicitly prompt:
> No device was detected. Please turn the device on, then connect it to a
> USB port on your computer using a data-capable USB cable, not a charge-only
> cable. Let me know when it is connected so I can check again.
Recheck after the user connects it. If this environment cannot access the
user's USB devices, state that limitation instead of claiming no device is
connected; guide the user through local detection/flashing and request the
test results.
3. Before writing, confirm the target device, the exact validated firmware,
and its [flashing/data impact](engineering/firmware-layout.md#flashing-and-stored-data),
then obtain explicit approval for this flash. A connected device or a past
approval for another build is not authorization. Do not make a backup of the
original firmware a prerequisite, and do not assume permission for a
full-chip erase.
4. After approved flashing, verify startup and the requested behavior using
the applicable hardware checklist, with user observations where needed.
Successful flashing alone is not `Device tests: PASS`. If the user declines
or postpones testing, no device is available, or access is unavailable,
report `Device tests: NOT RUN` and list the pending checks in `Unverified`.
For documentation-only or other tasks that do not change firmware, explain
that on-device testing is not applicable; do not flash unrelated firmware just
to satisfy this workflow. This test invitation does not authorize commits,
pushes, or any of the optional [project-closing actions](release/project-completion.md).
Related documents: [build and test](engineering/build-and-test.md), [coding conventions](engineering/coding-conventions.md), [hardware guide](../hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.md), [documentation index](../README.md), and [root `AGENTS.md`](../../AGENTS.md).
+33
View File
@@ -80,6 +80,39 @@ Unverified: 仍需板卡、仪器或用户确认的事项
上板验收矩阵按修改类型(引脚、LCD、ADC、codec、I2C、DMA 等)见 [AI 硬件开发指南 §构建与验证](../hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.zh_CN.md#构建与验证),本文档不重复完整验收清单。真机结果要与"编译通过"分开记录。
### 主动询问真机测试
每次完整实现用户提出的固件功能或修复需求,并执行相应验证后,必须主动询问
用户是否将本次固件刷写到设备中进行测试。该要求适用于每轮完整的开发迭代,
不只适用于项目发布;交接时不能只给出编译结果或固件路径。例如:
> 本次需求已完整实现,是否现在将验证通过的固件刷写到设备中进行测试?
1. 当前环境具备设备访问能力时,在交接阶段只读检查 USB/串口设备。不能仅因
设备已连接就打开或复位任意串口,更不能自动烧录。如果存在多个候选设备,
或不能确定目标,先请用户确认要测试的设备和端口。
2. 未检测到设备时,明确提示:
> 暂未检测到设备。请先将设备开机,再使用支持数据传输的数据线(不能是
> 仅充电线)连接电脑的 USB 接口。连接好后告诉我,我会重新检测。
用户连接后重新检测。若当前环境无法访问用户电脑的 USB 设备,应说明访问
能力限制,不能声称设备没有连接;改为指导用户在本机检测、烧录,并反馈
测试结果。
3. 写入前确认目标设备、本次验证通过的具体固件及其
[烧录/数据影响](engineering/firmware-layout.zh_CN.md#烧录与已存数据),
并取得本次烧录的明确同意。设备已连接、以前同意过其他版本烧录,都不构成
本次授权。不得把备份设备原有固件作为前置条件,也不得默认获得全片擦除
授权。
4. 经同意烧录后,按对应硬件验收清单检查启动和用户要求的功能,必要时请用户
观察实机并反馈。仅烧录成功不能报告 `Device tests: PASS`。用户拒绝或暂缓
测试、没有可用设备或无法访问设备时,报告 `Device tests: NOT RUN`,并在
`Unverified` 中列出待验证项目。
纯文档等不改变固件的任务,应说明真机测试不适用,不要为满足流程而烧录无关
固件。邀请真机测试不代表获得 commit、push 或任意可选
[项目收尾动作](release/project-completion.zh_CN.md)的授权。
## 7. 相关文档
- 构建与验证命令:[build-and-test.zh_CN.md](engineering/build-and-test.zh_CN.md)
@@ -27,6 +27,13 @@ Offer the six-action menu when either signal occurs:
In both cases, remind the developer that the following six closing actions are
available, each selectable on its own or with others.
The [on-device testing invitation](../ai-guide.md#offer-on-device-testing)
is required after every completed firmware implementation, independently of
this menu; do not defer it until a release or a closing action is selected.
Asking is mandatory, but flashing still requires the user's approval. Follow
that handoff for device discovery, the power-on/data-cable/USB prompt when no
device is detected, and reporting tests that remain unperformed.
## The six actions
The actions are grouped by purpose. Delivery actions publish the result of the
@@ -122,6 +129,11 @@ stop and fix before closing out. See
[`CI-build-and-release.md`](../ci/CI-build-and-release.md) for the artifact and
flashing.
Apply the same [device-access and consent checks](../ai-guide.md#offer-on-device-testing)
to this release artifact. Approval to publish is not approval to flash. If
device testing cannot proceed, keep it explicitly unverified rather than
treating a successful upload as completed hardware acceptance.
## Shared safety and consent gates
Every action follows the same non-negotiable rules:
Loaded 3 of 6 files, more files were not shown because too many files have changed in this diff. Show more