feat(session): 会话检索族——FTS5 派生索引 + 关系追踪 + 工作区授权检索工具 + 导出(借 DSH session-query)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by comparing the existing JSONL transcript and sessions list/rewind flow with the referenced DSH files: session-query-sqlite/src/schema.ts, session-query/src/observation.ts, tracing.ts, and tool-session-query/src/index.ts. Read session-log-export/README.md for the export behavior. Done means the derived index can be rebuilt with consistent results, cross-session search enforces cwd boundaries, and exports include child sessions and attachments with only one simultaneous download per session.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P2 · 依赖:无 · 来源:DSH session-query 包借鉴(jeffkit 拍板跟进)
基线 HEAD = 4e1aee98。
Summary
recursive 的会话面只有 JSONL transcript + sessions list/rewind:模型无跨会话检索、无关系追踪、无导出。相关但不重合:#93(向量记忆未接线)/ #80(知识检索域拆层)/ #122(OTel span 覆盖)。
参照 DSH packages/session-query/:
- 可丢弃派生索引 + 就地重置:SQLite FTS5 只当派生读模型——
application_id+user_version识别自有库,版本不符原地重建;持久表存已落盘会话、TEMP 表存活跃会话;库 0600/目录 0700(session-query-sqlite/src/schema.ts:8-11,46-101)。 - 冷读缓存键 = 实例身份 + stat 修订号:修订未变不重读日志;活跃租约条目不被 LRU 驱逐(
session-query/src/observation.ts:56-78,98-150)。 - 关系追踪语义:replacementChain(事件被后续替换的链)/ source→derived——"为什么历史变成现在这样"的可解释查询(
tracing.ts:64-111)。 - 模型面工具 + 工作区授权:session_search / session_event_search / session_trace / session_event_trace / session_event_read;跨会话搜索要求调用方会话有 cwd(工作区边界),结果上限 100(
tool-session-query/src/index.ts:21-25,56-120)。 - 导出:认证路由流式 ZIP 整棵会话树(含子会话+附件),单会话单下载(
session-log-export/README.md)。
建议
- 派生索引层(可随时丢弃重建,与主 transcript 解耦);
- 关系追踪(替换链/来源链)——审计与可解释性的基础;
- 模型检索工具集 + cwd 工作区边界授权;
- 流式导出(含子会话与附件)。
验收
- 删库重建后检索结果与重建前一致(索引纯派生);
- 模型可跨会话检索但受 cwd 边界限制(越界被拒有测试);
- 导出产物含子会话与附件、单会话同时仅一个下载。
- Dominant language
- Rust
- Stars
- 4
- Forks
- 0
- Avg merge
- 5h 32m
- Merged PRs (30d)
- 7
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jeffkit/recursive
-
Difficulty 3/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
jeffkit/recursive#141 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
jeffkit/recursive#138 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
jeffkit/recursive#134 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 1 day
All issues in jeffkit/recursive
Similar issues
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 90/100
fastrevmd-lab/rustmistmcp#161 ·
-
arch-audit refactor
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
SocketDev/socket-patch#1011 ·
Maintainers usually reply within 1 day
-
bug user-priority/P2
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
opencode: an unanswered --version probe launches opencode 2 without per-session service isolationOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
security-advisory
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
MinBZK/regelrecht#1686 ·
Maintainers usually reply within 1 day