| 1 | # 历史搜索 Catalog |
| 2 | |
| 3 | Reasonix 将历史搜索投影保存到 `<cache root>/history-search/v1.sqlite`。 |
| 4 | Session JSONL、event log、metadata、子 Agent transcript 和 archive 仍是唯一权威 |
| 5 | 数据。删除或重建数据库不会删除会话,旧版 Reasonix 也继续读取原有权威文件。 |
| 6 | |
| 7 | Catalog 的 FTS5 只保存规范化检索 token,不保存完整消息正文。英文沿用现有小写与 |
| 8 | 代码符号语义,CJK 沿用重叠 bigram。SQLite 选出最终候选后,snippet 和 `around` |
| 9 | 上下文才从权威文件读取。user、assistant、tool input、tool error、tool output 都会索引, |
| 10 | 但普通 tool output 仍不属于默认搜索种类。 |
| 11 | |
| 12 | 权威会话提交成功且文件锁释放后,保存路径只发送非阻塞、按 path 合并的索引提示。 |
| 13 | 连续 append 只读取 display index 的新增范围;rewrite、通知丢失、外部进程写入或指纹 |
| 14 | 不一致会在后台重建单个 source。完整 transcript decoder 始终单并发,checkpoint 按 |
| 15 | source 持久化,单个坏会话不会阻断其他历史。格式 2 的会话日志通过其选中 head 的 |
| 16 | 派生 transcript 建立索引;切换 head 会改写该 transcript,投影把它当作普通 rewrite |
| 17 | 在后台重建。其他 head 在被设为当前之前不可搜索。 |
| 18 | |
| 19 | Agent 的 `history` 工具与 Desktop 历史管理器共享该投影。搜索不会同步扫描目录;首次 |
| 20 | 索引未完成时立即返回已有结果和明确进度。open、running、current 等运行态只从内存 |
| 21 | 覆盖,SQLite 不能恢复陈旧所有权。面向 provider 的工具名、描述、schema、默认值和 |
| 22 | 顺序保持逐字节不变。 |
| 23 | |
| 24 | 数据库遵循通用可丢弃投影策略:本地盘使用 WAL、`synchronous=NORMAL`、外键、用户 |
| 25 | 私有权限和短 busy timeout;远程或不可用缓存自动退化为内存。完整性或迁移失败只隔离 |
| 26 | 并重建缓存;遇到未来 schema 时保留原库并进入 degraded。 |
| 27 | |
| 28 | 诊断与安全重建命令: |
| 29 | |
| 30 | ```sh |
| 31 | reasonix doctor catalogs [--json] |
| 32 | reasonix catalogs reindex history [--dir PATH ...] [--json] |
| 33 | ``` |
| 34 | |
| 35 | 诊断不会输出 query、token、snippet、消息、tool arguments 或 provider 内容;reindex |
| 36 | 只替换该可丢弃投影。 |
| 37 |