# v0.2.2 发布与迁移说明 / Release notes

本文件描述 `0.2.2` 源码范围，不表示 npm 已发布。`npm install -g search-boost@latest` 取得的是 npm 已发布版本；仅合并 master 不会发布 npm。Node 最低版本保持 `>=22.13`。

## 本次变更

- **AnySearch**：free 匿名、api 要求 key、hybrid 优先使用配置的 key。显式禁用与旧引擎白名单继续有效；匿名与 keyed 不重复计票。错误响应不回显或保存可能包含的凭据。
- **融合计分**：`scoreVersion: consensus-v2.1`，保留原始一基排名与 provenance，对相关来源的额外命中折扣计入共识。详见 [计分说明](fusion-scoring.md)。这是未经过真实相关性标签校准的冷启动方案，性质测试不代表检索质量已提升。
- **Jev**：兼容旧 `questions` 输入，新增任务上下文、关键词与验收目标；每轮最多三次逻辑 Jev 调用。返回经过审查的 URL、标题和描述，提供进程内 cursor 分页；预算与截止时间仍然限制执行。
- **发布审计修复**：版本要求 `4.2` 不再匹配 `4.20` 或 `1.4.2`，而 `v4.2` 可正确匹配；发布时间戳必须合法且带时区，并转换为 UTC 日期后与时间窗口比较；清空全部缓存也清空分页结果；cursor 参数拒绝非字符串与超长值。
- **doctor 修复**：恢复合并时丢失的 5 个检查（`config_layout`、`codex_web_search_config`、`cursor_hook_config`、`antigravity_mcp_duplication`、`antigravity_permission_config`），registry 19→24；补回 codex/antigravity 检查依赖的辅助函数。修正 `config_paths_writable` 在目录不可写时的假通过和 override 缺父目录时的假失败；`layer_config_valid` 不再对存在但无有效 `layer` 字段的文件静默通过；`doctor --category probe --json` 输出合法 JSON 且 `summary.exitCode` 与实际退出码一致；Node `engines` 支持复合范围写法。

## 输出兼容性：需要留意的变化

`adaptive_search` 的公开输出已由诊断结构改成以下结构。旧 `questions` **输入**仍有效，但直接消费旧输出 `questions` / `uncovered` / `roundLog` 的程序必须更新，不可视为输出完全向后兼容。

```json
{
  "results": [{"url": "https://example.com/doc", "title": "Documentation", "description": "Reviewed source text."}],
  "totalResults": 1,
  "nextCursor": null,
  "expiresAt": "2026-09-22T07:00:00.000Z",
  "coverageComplete": true,
  "stopReason": "all_covered",
  "warnings": []
}
```

这是结构示例，并非一次真实搜索。下一页只传 `cursor` 和可选 `page_size`，不要重复传任务。cursor 只在同一服务进程中有效，默认 30 分钟过期，也可能因容量淘汰或显式清缓存失效。`nextCursor: null` 只表示分页结束，不代表研究完整；以 `coverageComplete` 和 `warnings` 为准。

任务的硬日期条件请放入 `tasks[].time_range`，或在目标 `question` 中明确表述；`context` 中的背景日期、尤其“截至某日”，不会自动变成该日发生事件的硬筛选条件。`basis: published` 检查发布时间，`basis: event` 检查事件日期，二者不互相替代。无时区时间戳或非法时间戳按未知处理；纯日期仍保留日精度。

`fused_search` 的分数尺度也已改变：旧 `min_score` 阈值应重新校准。`engineRanks` 明确为一基提供商排名，不是合并后的位置。分数不是事实可信度或覆盖概率。

## 验证范围

发布门禁沿用 `npm run prepublishOnly`，覆盖网络安全、配置权限、安装/迁移、MCP/Pi/DSH、融合搜索、X、Jev 与回归测试；CI 同时验证 Linux 和 Windows。新增回归会用乐观的模拟 Jev 判断验证硬条件仍能拦截错版本和非法日期，并检查缓存生命周期及发布版本元数据一致性。

这些是确定性测试，不消耗用户真实 AnySearch/Jev/API 额度；不等于所有真实上游服务、代理环境或模型判断都已端到端验证。之前的 v0.2.1 文档保留为历史记录。

## English migration summary

AnySearch, correlation-aware `consensus-v2.1` scoring, and batched adaptive target review are included. Legacy `questions` input remains supported, but adaptive output now uses `results`, `totalResults`, `nextCursor`, `expiresAt`, `coverageComplete`, `stopReason`, and `warnings`. Consumers of the previous diagnostic output must migrate. Recalibrate old `min_score` thresholds; scores are not probabilities. Cursors are process-local, expire, and are invalidated by clearing all caches. Use explicit task time ranges for hard date constraints. Timestamp comparisons use UTC and reject invalid or timezone-less clocks. Doctor also restores five checks dropped during the v0.1.6 merge (config layout, Codex web_search placement, Cursor hooks, Antigravity MCP/permissions), fixes false pass/fail verdicts for config paths and layer files, and keeps `--json` reports machine-readable for empty category selections. Merging source is separate from publishing npm.
