From d3f8f9d13c9b2dfad83d4408518408c4e49faf19 Mon Sep 17 00:00:00 2001 From: cjiio Date: Tue, 15 Sep 2026 18:38:11 +0800 Subject: [PATCH] docs(workflow): require offering on-device firmware testing --- AGENTS.md | 7 ++++ AGENTS.zh_CN.md | 6 +++ docs/development/ai-guide.md | 42 +++++++++++++++++++ docs/development/ai-guide.zh_CN.md | 33 +++++++++++++++ .../development/release/project-completion.md | 12 ++++++ .../release/project-completion.zh_CN.md | 9 ++++ 6 files changed, 109 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 7785385..d9182c3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -61,6 +61,13 @@ Device tests: PASS / FAIL / NOT RUN Unverified: remaining board, instrument, or user checks ``` +After each complete implementation of a user-requested firmware change, +proactively ask whether to flash it to the device for testing; do not wait for +a release request. If no device is detected, ask the user to turn it on and +connect it to a computer USB port with a data-capable cable. Follow the +[on-device testing handoff](docs/development/ai-guide.md#offer-on-device-testing) +and obtain approval before flashing; detection alone is not consent. + Create commits and push only when the user requests them or the active workflow explicitly requires them. Ordinary feature, application, and documentation pull requests must not edit `docs/CHANGELOG.md` or `docs/CHANGELOG.zh_CN.md`; describe user-visible behavior, compatibility, and release-flow impact in the pull-request body and authoritative documentation instead. During release preparation, the release maintainer aggregates merged user-visible changes into both changelog files before creating the tag. Community guidance is in `.github/CONTRIBUTING.md`, `.github/CODE_OF_CONDUCT.md`, `.github/SECURITY.md`, and `.github/SUPPORT.md`. diff --git a/AGENTS.zh_CN.md b/AGENTS.zh_CN.md index 7bc31bb..2ac52d5 100644 --- a/AGENTS.zh_CN.md +++ b/AGENTS.zh_CN.md @@ -60,6 +60,12 @@ Device tests: PASS / FAIL / NOT RUN Unverified: 仍需板卡、仪器或用户确认的事项 ``` +每次完整实现用户提出的固件需求后,必须主动询问是否将固件刷写到设备中进行 +测试,不能只等到发布时才询问。未检测到设备时,提示用户将设备开机,再用 +支持数据传输的数据线连接电脑 USB 接口。遵循 +[真机测试交接流程](docs/development/ai-guide.zh_CN.md#主动询问真机测试), +烧录前须取得用户同意;检测到设备本身不代表获得烧录授权。 + 仅在用户请求或当前工作流明确要求时创建 commit 和 push。普通功能、应用和文档 PR 不得修改 `docs/CHANGELOG.md` 或 `docs/CHANGELOG.zh_CN.md`;用户可见行为、兼容性和发布流程影响改为写入 PR 正文及对应权威文档。发布准备期间,由发布负责人在创建 tag 前把已合并的用户可见变化统一汇总到两份变更日志。 社区规范见 `.github/CONTRIBUTING.zh_CN.md`、`.github/CODE_OF_CONDUCT.zh_CN.md`、`.github/SECURITY.zh_CN.md` 与 `.github/SUPPORT.zh_CN.md`。 diff --git a/docs/development/ai-guide.md b/docs/development/ai-guide.md index faa760c..5f3772a 100644 --- a/docs/development/ai-guide.md +++ b/docs/development/ai-guide.md @@ -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). diff --git a/docs/development/ai-guide.zh_CN.md b/docs/development/ai-guide.zh_CN.md index c410c93..2a5f90e 100644 --- a/docs/development/ai-guide.zh_CN.md +++ b/docs/development/ai-guide.zh_CN.md @@ -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) diff --git a/docs/development/release/project-completion.md b/docs/development/release/project-completion.md index 16e418d..13a44b4 100644 --- a/docs/development/release/project-completion.md +++ b/docs/development/release/project-completion.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: diff --git a/docs/development/release/project-completion.zh_CN.md b/docs/development/release/project-completion.zh_CN.md index bfa5a20..300cdaf 100644 --- a/docs/development/release/project-completion.zh_CN.md +++ b/docs/development/release/project-completion.zh_CN.md @@ -19,6 +19,11 @@ 两种情况下都提醒开发者:下面六项收尾动作可用,每项都可单独选择或组合选择。 +[主动邀请真机测试](../ai-guide.zh_CN.md#主动询问真机测试)独立于该菜单, +每次完整实现固件需求后都必须执行,不能推迟到发布或选择收尾动作时才询问。 +询问是必需的,但实际刷写仍须用户同意。设备检测、未检测到设备时的开机/ +数据线/电脑 USB 提示,以及未执行测试的报告方式,都遵循该交接流程。 + ## 六项动作 动作用途分组。交付类动作发布项目结果;沉淀类动作捕获文档与开放协作。 @@ -89,6 +94,10 @@ flowchart TD 当交付动作(A 或 B)产出了合并完整构建时,在把项目视为完成前先到真机验证。下载该 release 的合并完整固件(`FoloToy-AI-Passport-full.bin`,从 `0x0` 烧录的完整构建),烧录到设备并确认正常运行。不要把一次成功的构建或上传当作硬件验证:这一步证明 release 实际指向的产物能在真实硬件上启动并工作。产物来自 release 资产(CI/CD 的 `full.bin`),或对无 CI 产物的 Git release,来自开发者本地构建的 `full.bin`。若不能运行,先停下修复,再继续收口。产物与烧录见 [`CI-build-and-release.md`](../ci/CI-build-and-release.zh_CN.md)。 +对发布产物同样执行[设备访问与同意检查](../ai-guide.zh_CN.md#主动询问真机测试)。 +同意发布不等于同意烧录。无法开展真机测试时,应明确保留未验证状态,不能把 +上传成功当作已经完成硬件验收。 + ## 共同的安全与同意门槛 每项动作都遵守下面这些不可协商的规则: