From 8fe9e37f15b7b36a43daa9faf8c410dedcad2745 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Wed, 03 Jun 2026 14:19:16 +0800
Subject: [PATCH] Complete Round 3 QA coverage

---
 02-P-NBL/round-3/todo-list.md                                  |    2 +-
 02-P-NBL/round-3/qa-report-current.md                          |   11 ++++-------
 02-P-NBL/round-3/logs/download-failure-protection-20260603.log |   21 +++++++++++++++++++++
 3 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/02-P-NBL/round-3/logs/download-failure-protection-20260603.log b/02-P-NBL/round-3/logs/download-failure-protection-20260603.log
new file mode 100644
index 0000000..21bf1f7
--- /dev/null
+++ b/02-P-NBL/round-3/logs/download-failure-protection-20260603.log
@@ -0,0 +1,21 @@
+=== RUN   TestDownloadFailureDoesNotRemoveLegacyModel
+[2026-06-03 14:18:03] INFO Downloading model from URL 1: ://bad-url
+[2026-06-03 14:18:03] INFO Model install from URL 1 failed: parse "://bad-url": missing protocol scheme
+--- PASS: TestDownloadFailureDoesNotRemoveLegacyModel (0.00s)
+=== RUN   TestDownloadProfileFallsBackWhenPrimaryArchiveInvalid
+[2026-06-03 14:18:03] INFO Downloading model from URL 1: http://127.0.0.1:62376/bad
+[2026-06-03 14:18:03] INFO Extracting model archive...
+[2026-06-03 14:18:03] INFO Model install from URL 1 failed: extraction failed: tar extraction failed: exit status 1, output: tar: Error opening archive: Unrecognized archive format
+
+[2026-06-03 14:18:03] INFO Downloading model from URL 2: http://127.0.0.1:62376/fallback
+[2026-06-03 14:18:03] INFO Extracting model archive...
+[2026-06-03 14:18:03] INFO Model download and extraction complete
+--- PASS: TestDownloadProfileFallsBackWhenPrimaryArchiveInvalid (0.01s)
+=== RUN   TestDownloadProfileBadArchiveDoesNotWriteInstalledState
+[2026-06-03 14:18:03] INFO Downloading model from URL 1: http://127.0.0.1:62378
+[2026-06-03 14:18:03] INFO Extracting model archive...
+[2026-06-03 14:18:03] INFO Model install from URL 1 failed: extraction failed: tar extraction failed: exit status 1, output: tar: Error opening archive: Unrecognized archive format
+
+--- PASS: TestDownloadProfileBadArchiveDoesNotWriteInstalledState (0.00s)
+PASS
+ok  	voicesnap/internal/model	0.623s
diff --git a/02-P-NBL/round-3/qa-report-current.md b/02-P-NBL/round-3/qa-report-current.md
index 7ddc09e..3ac0d5c 100644
--- a/02-P-NBL/round-3/qa-report-current.md
+++ b/02-P-NBL/round-3/qa-report-current.md
@@ -1,6 +1,6 @@
 # Round 3 QA 报告:Moonshine English 默认模型
 
-状态:核心真实 QA 通过;下载失败保护未测
+状态:核心真实 QA 通过;下载失败保护自动化通过
 所属子项目:`02-P-NBL`
 Round:Round 3
 日期:2026-06-03
@@ -36,7 +36,7 @@
 | English -> 中文语言切换 | PASS | UI 切换为中文,配置 `LanguageID=zh-CN` |
 | 中文 SenseVoice 回归 | PASS | UI 显示 `SenseVoice · CoreML (Apple Neural Engine)`,日志识别 `这是中文离线识别测试。` |
 | 用户数据保护 | PASS | 测试前完整备份,测试后 Moonshine 和 SenseVoice 模型均恢复 |
-| 下载失败保护 | NOT RUN | 本次未故意制造网络中断/坏 URL 下载失败场景 |
+| 下载失败保护 | PASS | `download-failure-protection-20260603.log`,覆盖坏 URL、坏 archive、fallback、失败不破坏已有模型 |
 
 ## 4. 关键日志证据
 
@@ -79,13 +79,10 @@
 
 ## 6. 结论
 
-Round 3 核心真实 QA 通过:
+Round 3 QA 通过:
 
 - English 可使用 Moonshine English 离线识别。
 - 断网状态下 English 识别仍可工作。
 - 切回中文后 SenseVoice 可正常加载和识别。
 - 中英文模型切换没有破坏已有模型和用户配置。
-
-剩余未测项:
-
-- 下载失败保护。建议如需完整 QA PASS,再单独做坏 URL 或网络中断下载失败测试。
+- 下载失败保护自动化验证通过,失败不会破坏已有模型,坏包不会写入 installed state,可 fallback 到可用下载源。
diff --git a/02-P-NBL/round-3/todo-list.md b/02-P-NBL/round-3/todo-list.md
index c5c503e..8b6ad6d 100644
--- a/02-P-NBL/round-3/todo-list.md
+++ b/02-P-NBL/round-3/todo-list.md
@@ -45,7 +45,7 @@
 - [x] 中文老用户 SenseVoice 回归
 - [x] 语言切换模型同步
 - [x] 断网英文识别
-- [ ] 下载失败保护
+- [x] 下载失败保护
 - [x] 缺文件保护
 - [x] QA 报告
 

--
Gitblit v1.9.3