refactor(official-sync): 删除误导性的 skipped_this_run 字段并修正措辞

quarantine 条目的 skipped_this_run 字段恒写 true、仅测试读取、不参与任何逻辑,
且名称误导——下载失败是 fail-fast 中止整轮,并非“跳过该 URL 继续”。删除该字段,
并把失败消息中的“跳过本轮”改为“中止本轮同步、不发布不完整资源”以消除歧义。
(quarantine 为瞬时状态文件且未启用 deny_unknown_fields,旧文件多出的键会被忽略。)

对应 issue #18 维护清单 3-2。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-16 09:21:16 -07:00
co-authored by Claude Fable 5
parent 11f4c6c36e
commit 28e9ce5a6f
+1 -4
View File
@@ -575,7 +575,7 @@ impl OfficialResourcePullService {
&error, &error,
)); ));
return Err(format!( return Err(format!(
"官方资源下载中断URL 已进入 quarantine 并跳过本轮,不会发布不完整资源;url={url} quarantine={}{}", "官方资源下载失败URL 已进入 quarantine,中止本轮同步、不发布不完整资源;url={url} quarantine={}{}",
self.download_quarantine_path().display(), self.download_quarantine_path().display(),
error.message error.message
)); ));
@@ -1059,7 +1059,6 @@ impl OfficialResourcePullService {
failure_kind: error.failure_kind().map(ToOwned::to_owned), failure_kind: error.failure_kind().map(ToOwned::to_owned),
http_status: error.http_status(), http_status: error.http_status(),
retryable: error.retryable(), retryable: error.retryable(),
skipped_this_run: true,
last_error: error.message.clone(), last_error: error.message.clone(),
}, },
); );
@@ -1508,7 +1507,6 @@ struct OfficialDownloadQuarantineEntry {
failure_kind: Option<String>, failure_kind: Option<String>,
http_status: Option<u16>, http_status: Option<u16>,
retryable: Option<bool>, retryable: Option<bool>,
skipped_this_run: bool,
last_error: String, last_error: String,
} }
@@ -2826,7 +2824,6 @@ exit 22
assert_eq!(entry.failure_kind.as_deref(), Some("http_not_found")); assert_eq!(entry.failure_kind.as_deref(), Some("http_not_found"));
assert_eq!(entry.retryable, Some(false)); assert_eq!(entry.retryable, Some(false));
assert_eq!(entry.attempts, 1); assert_eq!(entry.attempts, 1);
assert!(entry.skipped_this_run);
assert!(service.read_download_manifest().unwrap().entries.is_empty()); assert!(service.read_download_manifest().unwrap().entries.is_empty());
} }