diff --git a/scripts/skill_report_i18n.py b/scripts/skill_report_i18n.py index e3bc514..5700028 100644 --- a/scripts/skill_report_i18n.py +++ b/scripts/skill_report_i18n.py @@ -301,6 +301,16 @@ def en_for(text: str) -> str: match = re.match(r"^继续补齐剩余\s+(\d+)\s+项外部/人工证据,并保持 claim guard 为 pending 状态。$", value) if match: return f"Close the remaining {match.group(1)} external or human evidence item(s) and keep the claim guard pending." + match = re.match( + r"^按 ledger 总量继续补齐\s+(\d+)\s+项待补证据(外部\s+(\d+)\s+项、人工\s+(\d+)\s+项;未展开\s+(\d+)\s+项),并保持 claim guard 为 pending 状态。$", + value, + ) + if match: + return ( + f"Close all {match.group(1)} pending evidence item(s) in the ledger " + f"(external {match.group(2)}, human {match.group(3)}; {match.group(4)} not shown here) " + "and keep the claim guard pending." + ) match = re.match(r"^已生成\s+(\d+)\s+/\s+(\d+)\s+类报告证据。$", value) if match: return f"Generated {match.group(1)} / {match.group(2)} evidence report types." diff --git a/scripts/skill_report_world_class.py b/scripts/skill_report_world_class.py index c8bae35..fffcd96 100644 --- a/scripts/skill_report_world_class.py +++ b/scripts/skill_report_world_class.py @@ -102,6 +102,8 @@ def world_class_roadmap_item(readiness: dict) -> dict | None: pending_count = int(readiness.get("pending_count", 0) or 0) if readiness.get("ready") or pending_count <= 0: return None + external_pending_count = int(readiness.get("external_pending_count", 0) or 0) + human_pending_count = int(readiness.get("human_pending_count", 0) or 0) actions = [] entries = [entry for entry in readiness.get("entries", []) if isinstance(entry, dict)] for entry in entries[:2]: @@ -110,7 +112,11 @@ def world_class_roadmap_item(readiness: dict) -> dict | None: actions.append(f"补齐{label}证据:{summary}") remaining = pending_count - len(actions) if remaining > 0: - actions.append(f"继续补齐剩余 {remaining} 项外部/人工证据,并保持 claim guard 为 pending 状态。") + actions.append( + f"按 ledger 总量继续补齐 {pending_count} 项待补证据" + f"(外部 {external_pending_count} 项、人工 {human_pending_count} 项;" + f"未展开 {remaining} 项),并保持 claim guard 为 pending 状态。" + ) else: actions.append("提交有效 intake packet,并让 ledger 通过 artifact SHA-256 校验。") return { diff --git a/tests/verify_evidence_consistency.py b/tests/verify_evidence_consistency.py index a862ab0..ec5be67 100644 --- a/tests/verify_evidence_consistency.py +++ b/tests/verify_evidence_consistency.py @@ -51,10 +51,38 @@ def refresh_embedded_reports() -> None: ) +def assert_world_class_roadmap_matches_ledger() -> None: + ledger = json.loads((ROOT / "reports" / "world_class_evidence_ledger.json").read_text(encoding="utf-8")) + summary = ledger["summary"] + pending_count = int(summary["pending_count"]) + external_pending_count = int(summary["external_pending_count"]) + human_pending_count = int(summary["human_pending_count"]) + expected_total = f"{pending_count} 项待补证据" + expected_breakdown = f"外部 {external_pending_count} 项、人工 {human_pending_count} 项" + + for report_name in ["skill-overview", "skill-interpretation"]: + report_path = ROOT / "reports" / f"{report_name}.json" + report = json.loads(report_path.read_text(encoding="utf-8")) + serialized = json.dumps(report, ensure_ascii=False) + assert "继续补齐剩余 2 项外部/人工证据" not in serialized, report_name + assert report["world_class_readiness"]["pending_count"] == pending_count, report["world_class_readiness"] + assert report["world_class_readiness"]["external_pending_count"] == external_pending_count, report[ + "world_class_readiness" + ] + assert report["world_class_readiness"]["human_pending_count"] == human_pending_count, report[ + "world_class_readiness" + ] + actions = "\n".join(report["iteration_roadmap"]["items"][0]["actions"]) + if pending_count > 2: + assert expected_total in actions, actions + assert expected_breakdown in actions, actions + + def main() -> None: shutil.rmtree(TMP, ignore_errors=True) TMP.mkdir(parents=True, exist_ok=True) refresh_embedded_reports() + assert_world_class_roadmap_matches_ledger() output_json = TMP / "evidence_consistency.json" output_md = TMP / "evidence_consistency.md" proc = run(