feat(http): 会话流契约升级——领域游标 + 快照+gap-free follow + 有界上行(#97 的机制补全,借 DSH gateway)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- api, backend-api-design
Research direction
Start by reading #97, which this issue depends on, then compare the cited DSH references: gateway/README.md, gateway/src/stream-server.ts, gateway/src/client/remote-stream.ts, and session-controller/src/history.ts. The issue does not name Recursive entry points or tests, so first locate its session-stream and workspace-file APIs. Done means reconnect restores state with snapshot plus gap-free events, slow consumers get an explicit error, and oversized or out-of-workspace file reads fail.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:depends-on: #97 · 来源:DSH api/gateway 包借鉴(jeffkit 拍板跟进)
基线 HEAD = 4e1aee98。
Summary
与 #97 互补:#97 修的是"lagged 静默丢弃 + 1h 硬超时断裂"的既成缺陷;本单是把会话流契约层升到 DSH gateway 的水准(#97 落地后本单的游标/快照语义才是完整形态,故 depends-on)。
参照 DSH packages/api/:
- 单 WS 多路复用 + 每流有界上行:所有逻辑流走一个 mux;每流自带 Client→Host uplink,Host 侧上行按字节封顶(默认 256KiB),超限以
gateway/uplink-overflow失败该逻辑流而不关 socket(gateway/README.md:35,88;gateway/src/stream-server.ts:303-396);心跳即 Pong 期限。 - 重连层不推断重放、领域自带游标:连接层只做物理重连(jitter 指数退避),换 generation 后由领域校验打开基线(
gateway/src/client/remote-stream.ts:39-140);journal-stream 帧型opened(cursor,page)/entry/replace/prepend(client/journal-stream.ts:16-45)。 - 历史回溯 = 快照 + 无缝隙增量:
page按消息对齐翻页(beforeSeq/throughSeq);follow先给调用方游标处的完整快照,再给 gap-free 持久事件(session-controller/src/history.ts:38,77-140)——recursive 现状是全无此语义(#97)。 - 只读工作区文件服务:行页/字节窗读取,页携带文件
version(可判过期)、超大文件报错而非截断、拒绝末端符号链接、目录列举强制工作区包含、零变更操作(api/workspace-files/README.md)。
建议
- 事件流引入持久序号/游标;重连语义 = 快照@游标 + gap-free 增量(替代重连即丢);
- 慢消费者有界缓冲 + 明确错误(不再静默丢段);
- 有界上行(为未来双向流/多路复用铺路,先定契约不必立刻做 mux);
- 只读工作区文件 API(version 判过期、超大报错、符号链接防护、零变更)。
验收
- 断网重连后客户端状态无损恢复(快照+增量无缝隙,对照测试);
- 慢消费者触发明确错误而非缺段;缓冲上限可配;
- 只读文件服务读不出工作区外路径;过大文件返回错误而非截断。
- 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