Bundle
dsh-turn-review
DSH web plugin: better-sidebar Turn Review tab — a human gate on the diff of the just-finished agent turn (Approve / Request changes per path with comment). Not a rewind.
- Source
- yq04
- License
- BSD-3-Clause
- Updated
- Updated 2 days ago
Readme
# dsh-turn-review [**English**](README_EN.md) · **简体中文** DeepSeek Harness **Web** 插件:在 dsh-better-sidebar(omdsh-dev/DSH-better-sidebar)里增加一个 **本轮审查** Tab——对「刚刚这一回合」的 diff 做 Approve / Request changes 的人闸门。 **不是 /rewind。** 别人做时光机;我们做审查门。 ## 五条特色(v1 缺一条都不算做成) | # | 特色 | 别人通常怎样 | 我们怎样 | |---|---|---|---| | 1 | **只审上一回合** | 检查点时间线、fork 回任意一步 | **只保留「刚结束的这一轮」**;新回合开始,上一张审查过期 | | 2 | **同一条会话** | /rewind 后 fork 子会话 | **不 fork、不剪对话**;评语 `inject` 进当前 log,不 wake | | 3 | **代理归属** | 一堆路径,不知道谁写的 | 按 **主会话 / 子代理 / 未归因(shell 或会话外)** 分组 | | 4 | **按文件点名 + 人话评语** | 整段 restore | 勾选路径 **请求修改**;可选一句评语;inject 里只有路径 + 评语,**没有文件正文、没有 token** | | 5 | **能看 diff 再决定** | 命令行确认就回滚 | 点文件先看 **回合开始快照 vs 现在** 的 unified diff(内嵌本 Tab),再勾选 | 两条质量底线:**回合开始打工作区快照**(shell 改的也进清单);**禁止** `git reset --hard` / `git clean` / 会话 fork / `/rewind` 命令 / 模型工具。 ## 只读历史 Tab 底部可回看最近 20 轮审查:每轮标记 **已通过 / 请求修改(含打回路径与评语)/ 已过期**,展开可见路径清单。**历史永远只读——不能从第 N-3 轮恢复磁盘**,时间线 rewind 不在产品里。 ## 和 /rewind / diff 怎么共存 ```text 本轮审查 = 对刚刚这一回合的 diff 做 Approve / Request changes。 需要回到更早的消息或 fork 会话,请用 /rewind 类插件或 Claude 式检查点。 提交和推送请用 better-sidebar Git Tab 和 Git 远程。 ``` ## 安装 先装 better-sidebar,再装本插件(官方 web profile): ```sh dsh plugin --profile web add dsh-better-sidebar dsh plugin --profile web add git+https://github.com/yq04/dsh-turn-review.git ``` 没有 better-sidebar 时,host 路由仍会挂上,客户端 `inject = ['betterSidebar']`,Tab **不会出现**。卸载: ```sh dsh plugin --profile web remove dsh-turn-review dsh plugin --profile web --dump-config ``` 需要系统 `git`。插件不存 token,inject 文本会把常见 token 形状打成 `***`。 ## 行为边界 | 做 | 不做 | |---|---| | 回合开始快照 + 结束 diff(含子代理与 shell 改动) | 检查点时间线、退到任意 step | | 按路径恢复(unlink / checkout 回合开始 HEAD / 写回快照字节),恢复后再读盘验证 | `git reset --hard`、`git clean`、force-push | | `agent.inject` notice(不 wake) | `sessions.prompt` / followup 自动再跑一轮 | | POST + `application/json` + Host 信任围栏 | 注册模型工具 | | 二进制 / 超大 / 符号链接路径明确拒绝 | 静默跳过、跟随符号链接 | 请求修改必须 `confirm: true`——和 Git 远程的 push 一样,**由人点**。 ## Model Experience 仅当用户 **请求修改** 且 inject 成功时,模型在**下一轮**请求里看到一条 `user` 消息(`source.kind === 'plugin'`)。文案锁定中文,只含路径 + 归属 + 可选评语;文件正文不进、token 脱敏、路径列表截断时注明省略数。**通过**不 inject(避免每轮污染上下文)。磁盘恢复后若模型不可达(`agent-unavailable`),UI 会明示「文件已恢复,但未能写入会话」。 ## 限制 - 不是时光机:不 fork、无 `/rewind`、无检查点时间线;新回合开始旧审查过期。 - 恢复基准是**回合开始的工作区状态**(含回合前已有的脏改动);回合内已被 commit 的新增文件只会删除工作区文件,index/HEAD 请到 Git Tab 处理。 - 非 git 工作区:只列工具归因,不能恢复(UI 明示)。 - 上限常量(`src/config.ts`):单文件快照 1 MiB、共 200 个文件;v1 不支持配置,后续可改为 schemastery Config。 ## 开发 ```sh pnpm install pnpm typecheck pnpm test pnpm build node scripts/verify-self-contained.mjs ``` `dsh.bundle.patch` 在 `cordis.patch.yml`。发布前 `pnpm build`(npm `prepare` 会跑 tsdown)。 ## 许可 BSD-3-Clause(与官方 plugin-template 相同)。
Install
dsh plugin --profile web add github:yq04/dsh-turn-review#d8b9eee879fa6709a12162521efb9d0fa302fe71
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-turn-review from the hub
- This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.