diff --git a/AGENTS.md b/AGENTS.md index dcdcf1f1..18861c1b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -166,7 +166,7 @@ Per-code severity and the structured-routing fields (`target_file`/`field_path`/ - Python `>=3.11`, managed with `uv` (no `pip`). Deps: typer, pydantic v2, httpx, pyyaml, openapi-spec-validator, jsonschema, pymupdf. - Prefer immutable patterns (return new values; pure functions outside the I/O modules above). -- The skill file `skills/loop-apidoc/SKILL.md` is written in **English** (token economy); generated *product* output remains `zh-TW`. +- The skill file `skills/loop-apidoc/SKILL.md` is written in **English** (token economy); generated *product* output remains `zh-TW`. Validation issue text (`evidence`, `suggested_fix`, `fix_once`) is product output, so it is `zh-TW` too — one report must not address the operator in two languages, which is what happened while `validate/coverage.py` and `validate/response_contract.py` each chose their own. - Docsentry governs the selected Markdown documents in `.docsentry.json`: it checks local links and documented package scripts against checked-in evidence. It does not validate HTML manuals, external URLs, prose style, translations, or generated run output. - **Documentation language policy (for wider adoption/promotion):** teaching, promotion, and reference docs are **English-primary, Traditional-Chinese-secondary** — write the canonical copy in English so the project reaches the broadest audience, and provide zh-TW as the supporting/localized layer (e.g. `README.md` zh-TW ↔ `README.en.md` English). This applies to the human-facing docs listed under "Release: keep teaching & promotion docs in sync". The only content that stays `zh-TW`-first is *generated product output* (the `api-guide.zh-TW.md` guide and other run artifacts). diff --git a/loop_apidoc/validate/response_contract.py b/loop_apidoc/validate/response_contract.py index aef7595f..179da88e 100644 --- a/loop_apidoc/validate/response_contract.py +++ b/loop_apidoc/validate/response_contract.py @@ -142,10 +142,10 @@ def analyze_response_contracts(openapi: dict) -> ResponseContractAnalysis: code=IssueCode.REQUIRED_INFO_MISSING, severity=Severity.WARNING, location=location, - evidence="successful response has no usable schema contract", + evidence="成功 response 沒有可用的 schema 契約", suggested_fix=( - "Re-read the endpoint response envelope and record its schema; " - "when the source is silent, keep this delivery gap visible." + "重讀這個端點的回應封包並記下它的 schema;" + "若來源確實未載明,就讓這個交付缺口留在報告裡。" ), target_file="endpoints/", field_path="responses", diff --git a/tests/validate/test_validator.py b/tests/validate/test_validator.py index 1eaa81bf..0a326905 100644 --- a/tests/validate/test_validator.py +++ b/tests/validate/test_validator.py @@ -74,9 +74,7 @@ def test_hollow_success_response_warns_at_operation_boundary(): if issue.location == "paths./users.get" and issue.field_path == "responses" ] assert len(response_warnings) == 1 - assert response_warnings[0].evidence == ( - "successful response has no usable schema contract" - ) + assert response_warnings[0].evidence == "成功 response 沒有可用的 schema 契約" def test_missing_method_makes_report_not_ok():