From 78f2e9a57ea168340331a22886d6ce57752ac041 Mon Sep 17 00:00:00 2001 From: carl Date: Sun, 16 Aug 2026 18:12:16 +0800 Subject: [PATCH] style(validate): [ coverage ] say it in one language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 同一個模組裡三筆中文、一筆英文,同一份 validation 報告因此以兩種語言對 operator 說話。零實質引用那筆改成繁體中文,與較早且數量較多的那批一致。 順手把判準寫進 docstring:validation 報告是產品輸出,依 AGENTS.md 的語言政策屬 zh-TW 那一側(英文是教學/推廣文件的語言)。少了這行,下一個新增檢查的人只能各寫各的。 純措辭,無行為變更:issue code 與 severity 不變,benchmark 的 current_issue_classes 只數 code.severity,期望值一格未動。 --- loop_apidoc/validate/coverage.py | 10 +++++++--- tests/validate/test_coverage.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/loop_apidoc/validate/coverage.py b/loop_apidoc/validate/coverage.py index 440c6ba..52871e2 100644 --- a/loop_apidoc/validate/coverage.py +++ b/loop_apidoc/validate/coverage.py @@ -20,6 +20,10 @@ def check_manifest_coverage( issue code 一律用 SOURCE_UNVERIFIED;location 用來源 relative_path (§6 穩定來源識別碼)。修正循環會將之分類為 UNFIXABLE。 + + 訊息一律繁體中文:validation 報告是產品輸出,依 AGENTS.md 的語言政策屬 zh-TW + 那一側(英文是教學/推廣文件的語言)。這裡曾經三筆中文、一筆英文,同一份報告 + 因此以兩種語言對 operator 說話。新增檢查時沿用中文,不要各寫各的。 """ issues: list[Issue] = [] for source in manifest.unreadable(): @@ -69,10 +73,10 @@ def check_manifest_coverage( code=IssueCode.SOURCE_UNVERIFIED, severity=Severity.WARNING, location=document_id, - evidence="source has no material citation in provenance", + evidence="來源在 provenance 中沒有任何實質引用", suggested_fix=( - "Re-read the source and cite its material claims, or explicitly " - "exclude it when it is not API evidence." + "重讀這份來源並引用它的實質主張;" + "若它不是 API 證據,請明確排除。" ), ) ) diff --git a/tests/validate/test_coverage.py b/tests/validate/test_coverage.py index 9a5649d..b16b9d5 100644 --- a/tests/validate/test_coverage.py +++ b/tests/validate/test_coverage.py @@ -64,7 +64,7 @@ def test_supported_source_without_material_citation_is_warning() -> None: assert issues[0].code is IssueCode.SOURCE_UNVERIFIED assert issues[0].severity is Severity.WARNING assert issues[0].location == "codes.pdf" - assert "material citation" in issues[0].evidence + assert "實質引用" in issues[0].evidence def test_successful_standalone_url_without_material_citation_is_warning() -> None: