from pathlib import Path ROOT = Path(__file__).resolve().parents[1] docs = ROOT / "docs" canonical = docs / "05-接口文档.md" deprecated = docs / "05-公共Agent平台接口规范.md" if deprecated.exists(): text = deprecated.read_text(encoding="utf-8") if not any(marker in text for marker in ("历史稿", "已废弃", "废弃声明")): raise SystemExit("废弃接口文档没有明确历史标记") for path in docs.glob("*.md"): if path == canonical or path == deprecated: continue if "05-接口文档.md" in path.read_text(encoding="utf-8"): continue print(f"authoritative interface document: {canonical.name}")