Repository navigation
v3.1.0
EN
🔧 Refactoring - Harden Tool Contract and Crawl Reliability
Platform/Crawler Registry Refactor
- Introduced
PlatformRegistryandCrawlerRegistryfor clearer platform-to-crawler mapping - Reduced coupling in
NewsServiceand improved registry-based validation - Makes platform management and future crawler expansion safer and easier
Crawl Outcome Model Hardening
- Added structured per-platform outcome model (
PlatformCrawlOutcome,PlatformCrawlStatus) - Improved partial-failure visibility instead of treating all failures uniformly
- Better operational observability for unstable or blocked platforms
MCP Tool Response Contract Enhancement
get_hot_newsandsearch_newsnow returnpartial_success- Added
failure_countand detailedfailure_details(platform,status,error_code,error_message,latency_ms) - Preserves existing core response fields while giving AI clients richer error context
📄 Documentation & Test Coverage
- Added contract and registry-focused tests (
ToolResponseContractTest, registry validation tests) - Updated README and OpenSpec change artifacts to reflect the hardened behavior
CN
🔧 重构 - 强化工具契约与抓取可靠性
平台/爬虫注册表重构
- 引入
PlatformRegistry与CrawlerRegistry,明确平台与爬虫映射关系 - 降低
NewsService耦合度,并增强基于注册表的校验能力 - 让平台管理和后续爬虫扩展更安全、更易维护
抓取结果模型强化
- 新增结构化平台结果模型(
PlatformCrawlOutcome、PlatformCrawlStatus) - 支持更精细的部分失败表达,而非统一失败处理
- 提升对不稳定平台/被限流平台的可观测性
MCP 工具响应契约增强
get_hot_news与search_news增加partial_success字段- 新增
failure_count与failure_details(包含platform、status、error_code、error_message、latency_ms) - 保持原有核心字段兼容,同时为 AI 客户端提供更完整错误上下文
📄 文档与测试
- 新增契约与注册表相关测试(
ToolResponseContractTest、注册表校验测试) - 更新 README 与 OpenSpec 变更文档,反映强化后的行为