dsh-git-worktree 0.4.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +98 -0
- package/NOTICE +14 -0
- package/README.en.md +74 -266
- package/README.md +78 -286
- package/cordis.patch.yml +7 -3
- package/lib/adapters/git.js +8 -0
- package/lib/adapters/git.js.map +1 -1
- package/lib/adapters/registry.js +100 -1
- package/lib/adapters/registry.js.map +1 -1
- package/lib/checkpoint.d.ts +3 -0
- package/lib/checkpoint.js +29 -0
- package/lib/checkpoint.js.map +1 -0
- package/lib/client/WorktreeReviewRow.d.ts +1 -1
- package/lib/client/WorktreeReviewRow.js +32 -4
- package/lib/client/WorktreeReviewRow.js.map +1 -1
- package/lib/client/actions.d.ts +25 -1
- package/lib/client/actions.js.map +1 -1
- package/lib/client/console-remote/adapter.js +11 -3
- package/lib/client/console-remote/adapter.js.map +1 -1
- package/lib/client/index.d.ts +1 -1
- package/lib/client/index.js +3 -1
- package/lib/client/index.js.map +1 -1
- package/lib/client/pre-session/controller.js +9 -0
- package/lib/client/pre-session/controller.js.map +1 -1
- package/lib/client/review-console/PreflightStatus.d.ts +3 -2
- package/lib/client/review-console/PreflightStatus.js +3 -3
- package/lib/client/review-console/PreflightStatus.js.map +1 -1
- package/lib/client/review-console/ReviewActions.js +566 -27
- package/lib/client/review-console/ReviewActions.js.map +1 -1
- package/lib/client/review-console/WorktreeReviewPanel.js +18 -3
- package/lib/client/review-console/WorktreeReviewPanel.js.map +1 -1
- package/lib/client/review-console/preflight-cache.d.ts +2 -0
- package/lib/client/review-console/preflight-cache.js +18 -5
- package/lib/client/review-console/preflight-cache.js.map +1 -1
- package/lib/client/review-console/preview-recovery-cache.d.ts +20 -0
- package/lib/client/review-console/preview-recovery-cache.js +103 -0
- package/lib/client/review-console/preview-recovery-cache.js.map +1 -0
- package/lib/client/review-console/recovery-continuation.d.ts +53 -0
- package/lib/client/review-console/recovery-continuation.js +483 -0
- package/lib/client/review-console/recovery-continuation.js.map +1 -0
- package/lib/client/review-console/review-console.styles.js +9 -1
- package/lib/client/review-console/review-console.styles.js.map +1 -1
- package/lib/client/styles.js +61 -0
- package/lib/client/styles.js.map +1 -1
- package/lib/client/target-console/TargetStatusAction.js +2 -2
- package/lib/client/target-console/TargetStatusAction.js.map +1 -1
- package/lib/client/target-console/WorktreeConsoleView.js +1 -1
- package/lib/client/target-console/WorktreeConsoleView.js.map +1 -1
- package/lib/client/target-console/WorktreeReviewStatus.js +19 -6
- package/lib/client/target-console/WorktreeReviewStatus.js.map +1 -1
- package/lib/client/workspace-sidebar/index.d.ts +33 -0
- package/lib/client/workspace-sidebar/index.js +127 -0
- package/lib/client/workspace-sidebar/index.js.map +1 -0
- package/lib/client/workspace-sidebar/model.d.ts +37 -0
- package/lib/client/workspace-sidebar/model.js +88 -0
- package/lib/client/workspace-sidebar/model.js.map +1 -0
- package/lib/client.js +4511 -106
- package/lib/console-contract.d.ts +124 -1
- package/lib/console-contract.js.map +1 -1
- package/lib/console-host/control-plane.d.ts +7 -1
- package/lib/console-host/control-plane.js +264 -9
- package/lib/console-host/control-plane.js.map +1 -1
- package/lib/console-host/errors.d.ts +2 -2
- package/lib/console-host/errors.js +21 -5
- package/lib/console-host/errors.js.map +1 -1
- package/lib/console-host/projection.js +60 -1
- package/lib/console-host/projection.js.map +1 -1
- package/lib/console-host/service.d.ts +11 -5
- package/lib/console-host/service.js +54 -6
- package/lib/console-host/service.js.map +1 -1
- package/lib/console-remote/descriptors.js +40 -3
- package/lib/console-remote/descriptors.js.map +1 -1
- package/lib/console-remote/remote.d.ts +11 -5
- package/lib/console-remote/remote.js.map +1 -1
- package/lib/console-remote/schemas.d.ts +104 -1
- package/lib/console-remote/schemas.js +161 -5
- package/lib/console-remote/schemas.js.map +1 -1
- package/lib/index.d.ts +13 -2
- package/lib/index.js.map +1 -1
- package/lib/ports.d.ts +76 -1
- package/lib/session-checkout-apply.d.ts +76 -0
- package/lib/session-checkout-apply.js +608 -143
- package/lib/session-checkout-apply.js.map +1 -1
- package/lib/session-checkout-module.js +759 -124
- package/lib/session-checkout-module.js.map +1 -1
- package/lib/tools.js +1 -1
- package/lib/tools.js.map +1 -1
- package/lib/types.d.ts +93 -2
- package/lib/types.js.map +1 -1
- package/package.json +22 -14
- package/scripts/check-publish.mjs +17 -2
- package/scripts/check-workspace-sidebar-version.mjs +14 -0
- package/scripts/dev-dsh-lib.mjs +1 -1
- package/scripts/workspace-sidebar-upstream.d.mts +8 -0
- package/scripts/workspace-sidebar-upstream.mjs +160 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,99 @@
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.7.1] - 2026-08-28
|
|
8
|
+
|
|
9
|
+
`0.7.1` 修正项目聚合侧边栏的 Managed owner 菜单边界:恢复安全的会话整理操作,隐藏尚不具备 Worktree 生命周期语义的普通 Fork,并继续阻止会破坏唯一 owner 不变量的入口。
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Managed owner 恢复官方重命名与归档;归档仅影响侧边栏可见性,不放弃任务、不清理 Worktree,也不改变交付状态。
|
|
14
|
+
- 普通 Fork 从 Managed 菜单隐藏;Managed Workspace 的“新会话”和跨归属拖动继续被阻止,非法操作不再弹出浏览器原生提示框。
|
|
15
|
+
- 强化冲突 Workspace 的 fail-open 防护,并更新项目聚合、Ready 界面截图与双语使用说明。
|
|
16
|
+
|
|
17
|
+
## [0.7.0] - 2026-08-28
|
|
18
|
+
|
|
19
|
+
`0.7.0` 新增项目聚合侧边栏,将 Managed Worktree 的唯一 owner Session 直接显示为原 Local 项目下的任务行,同时以 fail-open 拓扑、生命周期操作限制和上游版本门禁保持官方 Workspace 行为兼容。
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- 新增项目聚合侧边栏:Local Workspace 继续承载普通多会话,每个 Managed Worktree 则直接显示为唯一 owner Session 任务行,并展示进行中、待验收、预览、恢复、已完成或已放弃状态。
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Managed Workspace 不再以 UUID 长路径重复占用顶级项目;cleanup 后的历史 owner Session 继续依据插件 Registry 归入原 Local 项目。
|
|
28
|
+
- Managed 任务行仅用于打开 owner Session,普通重命名、Fork、归档和拖动会被阻止,避免产生第二个会话或绕过 Worktree 生命周期;非托管 Workspace 保留官方操作,拓扑不可用时完整回退到原 Workspace 列表。
|
|
29
|
+
- 修复项目聚合 Browser 的两阶段真实启动回归:先消除重复 `sidebar.workspaces.directoryFlow` 声明,再改为版本与 SHA-256 门禁的官方 Workspace Client 单次衍生加载,保留 `renderSlot`/目录选择授权,避免 shadow 崩溃后静默回退官方侧栏。
|
|
30
|
+
- Managed Workspace 中可证明为空的预会话 launcher 不再阻止聚合;真实第二个 Session 仍 fail-open,物理 Workspace 未归并时也会禁止通过官方“新会话”入口创建第二个 Session。
|
|
31
|
+
- Managed owner 行改用官方 Branch Icon 与独立状态 Badge,任务标题保持原文;窄侧栏会优先保留 Worktree 身份和交付状态,而不是把状态截断在标题末尾。
|
|
32
|
+
|
|
33
|
+
## [0.6.1] - 2026-08-28
|
|
34
|
+
|
|
35
|
+
`0.6.1` 统一 Preview 与最终保存的用户文案,修复 pre-session source launcher 对并发 Worktree 创建的阻塞,并让普通 Local Checkout 正确使用正常助手回复结束任务;同时将项目首页和完整使用指南重新分层。
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Review 主操作改为更直接的任务文案:Ready 使用“预览修改”,Preview 使用“确认并保存”,Direct Finish 使用“跳过预览并保存”;同步更新恢复、Checkpoint 与确认弹窗文案,不改变 Host 交付语义。
|
|
40
|
+
- 将中英文 README 收敛为 Mermaid 驱动的项目首页,新增双语 Usage 指南承接完整操作、恢复、命令与排错;同时修正 Checkpoint 迁移状态,并明确项目级 Worktree 插件与 Domi 桌面工作台之间的产品边界。
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- pre-session handoff 成功后自动归档已清空的 Local source launcher,防止 Harness 的 New Session 复用该 reserved source 并错误阻塞下一项并发 Worktree 任务;owner Session 与项目级 Preview 串行约束保持不变。
|
|
45
|
+
- 普通 Local Checkout 现在明确使用正常助手回复结束,不再被引导调用 Worktree-only Ready 工具;若模型仍误调用,Client 会隐藏预期的 `target_unselected` 结果,同时保留其他真实 Worktree 错误。
|
|
46
|
+
|
|
47
|
+
## [0.6.0] - 2026-08-25
|
|
48
|
+
|
|
49
|
+
`0.6.0` 为长任务增加 Host-authoritative Worktree Checkpoint:用户可以把精确 Ready/Preview 阶段保存为隔离 Worktree 内部 Commit,清理当前施工状态后继续开发,同时保持 Local 完全不参与阶段提交,最终仍只交付一个累计任务 Commit。
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- Review 卡新增“保存阶段并继续”;active Preview 使用“撤回 Preview,保存阶段并继续”,两者都通过同一个 Host mutation 完成,不由 Client 拆分撤回与保存请求。
|
|
54
|
+
- checkpoint domain、registry metadata、operation journal、内部 artifact retention 与 `recoverCheckpoint` 支持重启后收敛 HEAD/index,无法证明完整回滚时保留 `index.lock` 与恢复证据。
|
|
55
|
+
- strict Host/Remote/Client contract 新增 generation-bound `checkpoint` 方法;请求绑定 exact owner、checkout、revision、review、generation 与 single-flight request ID,完成请求支持精确幂等重放。
|
|
56
|
+
- Review 与关联 Manager 投影展示已保存阶段数量/摘要;Manager 继续只提供状态、导航和 owner lifecycle,不新增 Checkpoint mutation。
|
|
57
|
+
|
|
58
|
+
### Safety
|
|
59
|
+
|
|
60
|
+
- Checkpoint 只提交 managed Worktree 当前 staged、unstaged 与 untracked 的精确验收快照;Local branch/HEAD、refs、index、staged、unstaged、untracked 与 working-tree bytes 不被纳入阶段 Commit。
|
|
61
|
+
- active Preview 必须先在 Host 锁内安全撤回;acceptance holder、identity、revision/review/generation、Worktree fingerprint 与最终 CAS 任一变化都在写入前 fail closed。
|
|
62
|
+
- prepared Commit 先持久化 journal,再保留内部 ref;写后复验 detached HEAD、clean index 与 checkpoint tree。迟到请求、重复点击、旧 generation、外来 Session 和空阶段均被拒绝或安全去重。
|
|
63
|
+
- Checkpoint 会使旧 Review、Preview、Delivery/Recovery proof 失效并恢复 Working;多次阶段 Commit 仍只作为 Worktree 内部历史,最终 Finish/Finalize 向 Local 生成一个累计任务增量 Commit。
|
|
64
|
+
- strict Remote schema 保持 path-free,拒绝未知字段、危险路径和内部 `refs/dsh` 泄漏。
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
|
|
68
|
+
- 包版本升级为 `0.6.0`;发布门禁与 Loader 方法面同步要求 `checkpoint` descriptor。
|
|
69
|
+
- 中英文 README、架构与发布 smoke 补充 Checkpoint 状态、不变量、恢复和人工验证边界。
|
|
70
|
+
|
|
71
|
+
## [0.5.0] - 2026-08-25
|
|
72
|
+
|
|
73
|
+
`0.5.0` 完成冲突与 detached Preview 的 Host 权威恢复闭环:恢复决策绑定 durable proof、严格 Remote contract 与写前后 CAS 复验,并将运行基线统一升级到 DeepSeek Harness `0.1.1-rc.2`。
|
|
74
|
+
|
|
75
|
+
### Compatibility
|
|
76
|
+
|
|
77
|
+
- 将全部直接 DeepSeek Harness 依赖与完整 peer 图从 `0.1.0-rc.8` 统一升级到 `0.1.1-rc.2`,避免 rc.8/rc.2 混合 runtime。
|
|
78
|
+
- rc.1 引入视觉模型支持并修复 Bubblewrap 可经宿主 `/proc/<pid>/root` 绕过文件约束的问题;插件不直接实现 sandbox,但使用修复后的统一 Host 包线。
|
|
79
|
+
- rc.2 继续收敛图片 Files API、预处理与 attachment pipeline;本项目接触的 Commands wire 仅新增可选 `originalDimensions`,现有 Worktree 协议不消费该字段。
|
|
80
|
+
- 验证结构化 Web Client 启动/inject、Session projection state/view 重构、Typert namespace 原子注册与 Connection transport hooks,不改变现有 Worktree Session Target、Recovery 与 Local 安全边界。
|
|
81
|
+
- 移除已过期的 rc.8 `minimumReleaseAgeExclude`;rc.2 依赖图现可直接通过仓库供应链冷却策略。
|
|
82
|
+
|
|
83
|
+
### Added
|
|
84
|
+
|
|
85
|
+
- `preview_detached` 新增 Host-authoritative Recovery Preflight:严格只读核对 durable receipt、四个 retained refs、Local HEAD/ref/tree/index/fingerprint、acceptance holder,并分别给出 rollback/finalize 的可证明结论与 64 位 generation。
|
|
86
|
+
- detached Preview 在同分支安全快进后可安全撤回或直接提交到最新 Local HEAD;写操作在 Host 锁内重算 proof/CAS,并保留后续 Commit、staged、unstaged 与 untracked 层。
|
|
87
|
+
- 无法证明安全时,Review Recovery surface 可显式请求精确 owner Agent 只读分析,或创建基于最新 Local HEAD 的 fresh managed Worktree handoff;旧 Worktree、Local、receipt 与 retained evidence 保持不变。
|
|
88
|
+
- Review Preflight 冲突新增显式“让 Agent 解决冲突”:先强制重检结构化 conflict identity,再通过 owner-only `resumeRevision` 恢复 Working,并使用 Harness 官方 `ISession.prompt()` 将 Local HEAD 与冲突文件交回精确 owner Session;不会自动 Preview、Finalize 或写入 Local。
|
|
89
|
+
- `stale_isolated` 新增独立的“重新生成验收结果”链路:保持 Ready 与严格 Read Only,不恢复 Working、不修改文件,只要求 Agent 等待后台写入停止、重新验证并生成新的 Ready Review。
|
|
90
|
+
- Preview/direct Finish 写前竞态返回 strict `worktree_apply_conflict` continuation,包含可去重的冲突 request ID、checkout/review/revision、Local HEAD 与受限冲突文件列表;显式恢复后由 Host 另行签发持久恢复 proof。
|
|
91
|
+
|
|
92
|
+
### Fixed
|
|
93
|
+
|
|
94
|
+
- rollback/finalize 增加独立写后 HEAD/ref/index/tree/fingerprint 验证;无法证明成功或完整回滚时保留 journal/artifacts 并进入 `recovery_required`,reconcile 不再仅凭 Commit HEAD 误报成功。
|
|
95
|
+
- detached Recovery Remote contract 使用 strict schemas,拒绝未知字段、非法 OID/generation、绝对/父级冲突路径与越界身份;Client 使用 identity-keyed single-flight cache,并在每次写操作、分析或 handoff 前强制重检。
|
|
96
|
+
- Recovery continuation 增加 Host-authoritative 持久 proof:conflict 在 mutation lock 内重跑 Preflight/CAS 后绑定 Ready/Working revision、review、Local HEAD 与安全相对冲突路径;`stale_isolated` 通过独立只读 Host 授权保持 Ready。浏览器持久请求严格穷举 kind 与精确字段,并在发送前逐字段复验 Host proof、cwd 与 active Session,关闭伪造 kind 绕过显式授权的路径。
|
|
97
|
+
- Recovery continuation 支持持久未发送请求、single-flight、重复点击去重、Session loading/streaming 延迟、Session 切换中止、旧请求被新请求替换,以及发送结果未知或失败后的显式重试。
|
|
98
|
+
- acceptance slot 从 `waiting` 释放为 `available` 时废弃旧 busy Preflight;自动预检失败不再因重渲染循环重试,改为用户显式“重新检查”。
|
|
99
|
+
|
|
7
100
|
## [0.4.0] - 2026-08-20
|
|
8
101
|
|
|
9
102
|
`0.4.0` 将 Worktree 验收升级为可预检、可恢复、可核验的交付闭环,并把关联 Worktree 的状态与导航入口集中到 Session Header;同时适配 DeepSeek Harness `0.1.0-rc.8` 与新的 Node.js 运行要求。
|
|
@@ -141,6 +234,11 @@
|
|
|
141
234
|
|
|
142
235
|
- 发布初版生产级 Worktree 管理、基础 apply/finish/discard 生命周期和安全清理。
|
|
143
236
|
|
|
237
|
+
[0.7.1]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.0...v0.7.1
|
|
238
|
+
[0.7.0]: https://github.com/wloops/dsh-git-worktree/compare/v0.6.1...v0.7.0
|
|
239
|
+
[0.6.1]: https://github.com/wloops/dsh-git-worktree/compare/v0.6.0...v0.6.1
|
|
240
|
+
[0.6.0]: https://github.com/wloops/dsh-git-worktree/compare/v0.5.0...v0.6.0
|
|
241
|
+
[0.5.0]: https://github.com/wloops/dsh-git-worktree/compare/v0.4.0...v0.5.0
|
|
144
242
|
[0.4.0]: https://github.com/wloops/dsh-git-worktree/compare/v0.3.2...v0.4.0
|
|
145
243
|
[0.3.2]: https://github.com/wloops/dsh-git-worktree/compare/v0.3.1...v0.3.2
|
|
146
244
|
[0.3.1]: https://github.com/wloops/dsh-git-worktree/compare/v0.3.0...v0.3.1
|
package/NOTICE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
dsh-git-worktree
|
|
2
|
+
|
|
3
|
+
The generated browser bundle includes software derived at build time from:
|
|
4
|
+
|
|
5
|
+
@deepseek-ai/dsh-client-ui-workspace 0.1.1-rc.2
|
|
6
|
+
Copyright (c) 2026 DeepSeek
|
|
7
|
+
Licensed under the MIT License
|
|
8
|
+
https://www.npmjs.com/package/@deepseek-ai/dsh-client-ui-workspace
|
|
9
|
+
|
|
10
|
+
The upstream browser bundle is version- and SHA-256-gated by
|
|
11
|
+
scripts/workspace-sidebar-upstream.mjs. Its official Workspace Browser,
|
|
12
|
+
WorkspacePicker, locale dictionaries, stores, and directory-flow declarations
|
|
13
|
+
are preserved. dsh-git-worktree wraps the Browser projection and applies
|
|
14
|
+
fail-closed Managed owner row decorations for Worktree identity and status.
|
package/README.en.md
CHANGED
|
@@ -1,304 +1,127 @@
|
|
|
1
1
|
# dsh-git-worktree
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/dsh-git-worktree)
|
|
4
|
+
[](https://www.npmjs.com/package/dsh-git-worktree)
|
|
4
5
|
[](https://github.com/wloops/dsh-git-worktree/actions/workflows/ci.yml)
|
|
5
6
|
[](LICENSE)
|
|
6
7
|
|
|
7
|
-
**Let agents work in real Git worktrees, preview
|
|
8
|
+
**Let agents work in real Git worktrees, preview changes in Local, and save only after explicit human confirmation.**
|
|
8
9
|
|
|
9
|
-
`dsh-git-worktree` is an experimental Session Target plugin for [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness). Each coding task
|
|
10
|
+
`dsh-git-worktree` is an experimental Session Target plugin for [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness). Each coding task receives an independent checkout, Workspace, and Session so agent construction state does not leak into the user-controlled Local checkout.
|
|
10
11
|
|
|
11
|
-
This is an
|
|
12
|
+
This is an independently maintained community plugin. It is not an official DeepSeek project and does not imply endorsement, partnership, or authorization.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
[中文](README.md) · [Full usage guide](docs/USAGE.en.md) · [Architecture](docs/WORKTREE-CONSOLE-ARCHITECTURE.md)
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
## Why use it?
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
When an agent edits Local directly, task changes can mix with existing staged, unstaged, and untracked work. Multiple tasks may also compete for the same checkout. This plugin separates construction from delivery:
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- task changes mix with existing staged, unstaged, and untracked Local state;
|
|
24
|
-
- multiple agent tasks sharing one checkout can overwrite files, switch branches, or contaminate each other's commit boundaries;
|
|
25
|
-
- multiple tasks writing results into Local at the same time can interfere with Preview, conflict handling, and cleanup;
|
|
26
|
-
- it becomes difficult to tell which bytes belong to the current task;
|
|
27
|
-
- “show me the result” may already mean an irreversible write into Local;
|
|
28
|
-
- commit, cleanup, and recovery decisions may depend too heavily on model judgment;
|
|
29
|
-
- starting another coding round often means losing the original conversation or rebuilding its context.
|
|
30
|
-
|
|
31
|
-
This plugin separates a coding task into two explicit boundaries:
|
|
32
|
-
|
|
33
|
-
1. **The agent implements and validates in an Isolated Worktree.**
|
|
34
|
-
2. **The user reviews the result in Local and decides whether to commit it.**
|
|
20
|
+
- the agent edits and tests only inside an isolated Worktree;
|
|
21
|
+
- the user first inspects a reversible Local Preview;
|
|
22
|
+
- the Host saves only the current task delta, excluding unrelated Local work;
|
|
23
|
+
- if safety cannot be proven, writes stop and recovery evidence is preserved.
|
|
35
24
|
|
|
36
25
|
## Highlights
|
|
37
26
|
|
|
38
|
-
- **
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
42
|
-
- **
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
- **Review-to-edit recovery** — an unsynced review does not block discussion; stale or conflicting reviews can return to the current Worktree with a prefilled request to revalidate and prepare a new review.
|
|
48
|
-
- **Verifiable Delivery Proof** — after Finalize, the UI shows the Commit OID, Local branch/HEAD, file and validation summaries, and cleanup/retention results.
|
|
49
|
-
- **Fail-closed recovery** — stale reviews, Local drift, branch changes, concurrent Previews, and uncertain cleanup stop instead of overwriting data.
|
|
50
|
-
|
|
51
|
-
> The current scope is a project-scoped Worktree Session workflow, not a cross-project global Worktree Manager. The project is still experimental; use it first in Git repositories that you can recover independently.
|
|
27
|
+
- **Project-grouped sidebar**: each Managed owner appears under its original Local project with a Branch Icon and status Badge; ordinary Local Sessions keep the official behavior.
|
|
28
|
+
- **Real isolation**: every task gets its own Git Worktree, Workspace, and unique owner Session.
|
|
29
|
+
- **Human acceptance**: Ready lets the user choose **Preview changes**, **Confirm and save**, or another explicit action.
|
|
30
|
+
- **Reversible Preview**: changes reach Local without an immediate Commit and can be rolled back safely.
|
|
31
|
+
- **Task-only save**: final delivery creates one Commit for the accumulated task delta.
|
|
32
|
+
- **Save checkpoint and continue**: checkpoints remain inside the managed Worktree and still collapse into one final delivery.
|
|
33
|
+
- **Safe recovery**: handles Local drift, conflicts, `preview_detached`, restarts, and interrupted cleanup.
|
|
34
|
+
- **Parallel construction, serialized acceptance**: many Worktrees can run concurrently while each Local project accepts one Preview at a time.
|
|
35
|
+
- **Continuous iterations**: after delivery and cleanup, the same Session and conversation can begin another round.
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Multiple tasks can edit, test, and prepare reviews concurrently in separate Worktrees, Workspaces, and Sessions without sharing one checkout. Local acceptance is deliberately serialized: one canonical Local project has one acceptance slot. Until the active Preview is committed or rolled back, another task receives `project_acceptance_busy` instead of layering another write into Local.
|
|
56
|
-
|
|
57
|
-
“Parallel tasks” does not mean “automatically merge every conflict.” If a task overlaps Local changes, its review becomes stale, the branch moves non-fast-forward, or the Host cannot prove that Rollback/Finalize will preserve unrelated work, the operation stops and retains recovery evidence for the user to resolve.
|
|
37
|
+
> The scope is a **project-scoped Worktree Session delivery plugin**, not a cross-project global Worktree Manager.
|
|
58
38
|
|
|
59
39
|
## Workflow
|
|
60
40
|
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
│ └─ Roll back and continue editing
|
|
74
|
-
├─ Skip Preview and commit directly
|
|
75
|
-
└─ Discard
|
|
76
|
-
│
|
|
77
|
-
└─ After cleanup: start iteration + 1 in the same Session
|
|
41
|
+
```mermaid
|
|
42
|
+
flowchart LR
|
|
43
|
+
A[Local Session] -->|Create Worktree| B[Worktree Session]
|
|
44
|
+
B --> C[Agent edits and validates]
|
|
45
|
+
C --> D[Ready for Review]
|
|
46
|
+
D -->|Preview changes| E[Local Preview]
|
|
47
|
+
E -->|Confirm and save| F[Iteration delivered]
|
|
48
|
+
F -->|cleanup| G[Start next iteration]
|
|
49
|
+
|
|
50
|
+
D -.->|Save checkpoint and continue| H[Save checkpoint<br/>Return to editing]
|
|
51
|
+
E -.->|Undo this preview| I[Return to editing]
|
|
52
|
+
D -.->|Skip preview and save| F
|
|
78
53
|
```
|
|
79
54
|
|
|
80
|
-
###
|
|
81
|
-
|
|
82
|
-
In a blank/new Local Session, enable **Worktree** and confirm creation. Nothing is created before confirmation. After confirmation, the unsent text and image draft is transferred to the new isolated Session.
|
|
83
|
-
|
|
84
|
-
An existing Local Session may also ask the model to call `worktree_create`. The source Session remains Local and is never silently switched to another cwd.
|
|
85
|
-
|
|
86
|
-
### 2. Work inside the Worktree
|
|
87
|
-
|
|
88
|
-
The agent reads, edits, and validates only inside the isolated cwd. That cwd is a real Git worktree and is registered as a Harness Workspace, so Harness Workspace and Session boundaries remain authoritative.
|
|
89
|
-
|
|
90
|
-
### 3. Prepare the review
|
|
91
|
-
|
|
92
|
-
When implementation and validation are complete, the agent calls `worktree_ready_for_review` with:
|
|
93
|
-
|
|
94
|
-
- a change summary;
|
|
95
|
-
- changed files;
|
|
96
|
-
- validation status and test commands;
|
|
97
|
-
- a suggested commit message.
|
|
98
|
-
|
|
99
|
-
This stores a review report. It does not write to Local and does not create a commit. Once Ready appears, the dedicated Review card and composer dock automatically run a strictly read-only Preflight that shows Local/Worktree HEAD, effective base, changed-file count, conflicts, and the acceptance slot. Both surfaces share the same read result, but Preview and direct Finalize always force a fresh check; cached display state is never write authorization.
|
|
100
|
-
|
|
101
|
-
### 4. Choose how to deliver
|
|
102
|
-
|
|
103
|
-
The user can then:
|
|
104
|
-
|
|
105
|
-
- **Sync to Local for review** — create an uncommitted, reversible Preview;
|
|
106
|
-
- **Accept and commit** — commit only the task delta;
|
|
107
|
-
- **Roll back and continue editing** — remove the Preview and return to the Worktree;
|
|
108
|
-
- **Skip review and commit directly** — use the guarded direct-delivery path after explicit confirmation;
|
|
109
|
-
- **Discard** — clean up the task environment when all safety conditions pass.
|
|
110
|
-
|
|
111
|
-
If Preflight reports `stale_local`, `stale_isolated`, or a conflict, old Preview/Finalize actions are disabled immediately. The user can check again or return to the current Worktree to revalidate and prepare a new review. `project_acceptance_busy` exposes only a path-free holder summary; navigation happens only after the Host re-proves checkout, owner Session, and canonical cwd identity. After Finalize, the Review surface retains a Delivery Proof rather than collapsing to a generic success message.
|
|
112
|
-
|
|
113
|
-
### 5. Start the next round in the same conversation
|
|
114
|
-
|
|
115
|
-
After a successful commit and cleanup, the current Worktree cwd is removed, but the Session and conversation remain. When the user requests more code or file changes, the plugin can recreate the immutable cwd from the latest Local HEAD and start the next iteration safely.
|
|
116
|
-
|
|
117
|
-
Retained, cleanup-pending, and recovery states are never removed silently. They must be handled before another iteration can begin.
|
|
118
|
-
|
|
119
|
-
## Screenshots
|
|
120
|
-
|
|
121
|
-
The following screenshots show the primary delivery flow in the order a task normally follows it.
|
|
122
|
-
|
|
123
|
-
### Create a Worktree Session
|
|
124
|
-
|
|
125
|
-
After Worktree is enabled in a new Local Session, Harness explains the Session-switch boundary. The isolated Session is created and selected only after explicit confirmation.
|
|
126
|
-
|
|
127
|
-

|
|
128
|
-
|
|
129
|
-
### Prepare the review
|
|
130
|
-
|
|
131
|
-
When implementation and validation finish, the agent prepares a Ready for Review report. The user can inspect the summary and validation evidence before syncing anything to Local.
|
|
132
|
-
|
|
133
|
-

|
|
134
|
-
|
|
135
|
-
### Review the Local Preview
|
|
136
|
-
|
|
137
|
-
After synchronization, the task delta waits in Local as a reversible Preview. The user can commit it, roll it back and continue editing, or discard the task.
|
|
138
|
-
|
|
139
|
-

|
|
55
|
+
### Which action should I choose?
|
|
140
56
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
The default path confirms the Commit Message and cleans up the Worktree after submission. When further investigation is useful, the frozen runtime environment can instead be retained for the selected period.
|
|
144
|
-
|
|
145
|
-
| Commit and clean up | Commit and retain the runtime environment |
|
|
57
|
+
| Goal | Action |
|
|
146
58
|
| --- | --- |
|
|
147
|
-
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-

|
|
154
|
-
|
|
155
|
-
## Design foundation and Harness adaptation
|
|
156
|
-
|
|
157
|
-
The Worktree lifecycle and Git delivery engine are adapted from a mature desktop implementation that has been exercised in real workflows. The goal is not to copy its UI, but to preserve proven safety invariants:
|
|
158
|
-
|
|
159
|
-
- managed checkout registry and revision CAS;
|
|
160
|
-
- canonical path, Git common-dir, and git-dir identity checks;
|
|
161
|
-
- complete fingerprints for staged, unstaged, untracked, binary, and deleted files;
|
|
162
|
-
- receipt-first Local Preview, Rollback, and Finalize;
|
|
163
|
-
- task-only commits that preserve unrelated Local work;
|
|
164
|
-
- internal refs, journal recovery, retention, quarantine, and conservative cleanup;
|
|
165
|
-
- fail closed whenever the Host cannot prove that a write is safe.
|
|
166
|
-
|
|
167
|
-
DeepSeek Harness has a different Host and Session model from the original desktop host, so the integration was adapted rather than copied mechanically:
|
|
59
|
+
| Inspect the result in Local first | **Preview changes** |
|
|
60
|
+
| The Preview looks correct | **Confirm and save** |
|
|
61
|
+
| Preserve progress during a long task | **Save checkpoint and continue** |
|
|
62
|
+
| Ask the agent for more edits | **Continue editing** or **Undo this preview** |
|
|
63
|
+
| Deliver without a Preview | **Skip preview and save** |
|
|
168
64
|
|
|
169
|
-
|
|
170
|
-
- Host capabilities are exposed through strict Typert Remote, while browser UI uses public Harness Client Slots;
|
|
171
|
-
- Local source and Isolated target always use separate Sessions;
|
|
172
|
-
- cleanup does not mutate Harness's persisted Session cwd; the next iteration recreates the same path only after strict identity checks;
|
|
173
|
-
- the model creates targets, resumes editing, and prepares reviews, while user-controlled surfaces own Local writes, commits, and cleanup.
|
|
65
|
+
See the [full usage guide](docs/USAGE.en.md) for detailed actions, recovery scenarios, and commands.
|
|
174
66
|
|
|
175
|
-
|
|
67
|
+
## Quick start
|
|
176
68
|
|
|
177
|
-
|
|
69
|
+
### Requirements
|
|
178
70
|
|
|
179
|
-
- Node.js `^22.19.0 || >=24.0.0
|
|
180
|
-
- DeepSeek Harness `0.1.
|
|
181
|
-
- Harness Web Client
|
|
182
|
-
-
|
|
71
|
+
- Node.js `^22.19.0 || >=24.0.0`
|
|
72
|
+
- DeepSeek Harness `0.1.1-rc.2` package line
|
|
73
|
+
- Harness Web Client
|
|
74
|
+
- A Git Workspace
|
|
183
75
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
Install the npm package:
|
|
76
|
+
### Install
|
|
187
77
|
|
|
188
78
|
```bash
|
|
189
79
|
dsh plugin --profile web add dsh-git-worktree
|
|
190
80
|
```
|
|
191
81
|
|
|
192
|
-
Or install a specific
|
|
82
|
+
Or install a specific version:
|
|
193
83
|
|
|
194
84
|
```bash
|
|
195
|
-
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
With pnpm 10 or newer, a Git install may require this entry in the profile's `pnpm-workspace.yaml` before retrying:
|
|
199
|
-
|
|
200
|
-
```yaml
|
|
201
|
-
allowBuilds:
|
|
202
|
-
dsh-git-worktree: true
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Start Harness normally after installation and open a Git repository as the Workspace.
|
|
206
|
-
|
|
207
|
-
## Model tools and user controls
|
|
208
|
-
|
|
209
|
-
### Model tools
|
|
210
|
-
|
|
211
|
-
| Tool | Purpose |
|
|
212
|
-
| --- | --- |
|
|
213
|
-
| `worktree_create` | Create a managed Worktree from a Local Session and reserve a distinct target Session |
|
|
214
|
-
| `worktree_list` | List Worktrees visible to the current Session in the original project |
|
|
215
|
-
| `worktree_resume_revision` | Invalidate an unsynced review and resume the current iteration without touching Local |
|
|
216
|
-
| `worktree_begin_next_iteration` | Recreate the Worktree cwd for a delivered and successfully cleaned Session |
|
|
217
|
-
| `worktree_ready_for_review` | Save the delivery report and stop for explicit human acceptance |
|
|
218
|
-
|
|
219
|
-
Finish, Discard, Remove, and Local Preview are not model tools. Ordinary discussion leaves a Ready review unchanged; only new code or file work needs to resume Working.
|
|
220
|
-
|
|
221
|
-
### User controls
|
|
222
|
-
|
|
223
|
-
The Web UI provides the normal create, Preview, rollback, commit, retention, continue-editing, and discard actions. The `Local / Worktree · status` capsule in the Session Header opens the current-target controls and the Linked Worktrees manager directly; a source Session or any linked target Session can view the same source-linked tasks, navigate to their Sessions, and manage its own Worktree without returning to the original project. The manager stays focused on status, navigation, and owner lifecycle actions and does not regain inspect/review expansion. Automatic Preflight, stale/conflict recovery, acceptance-slot navigation, and Delivery Proof remain in the dedicated Review card and composer dock. Equivalent Host-controlled operations are also available through `/worktree` commands:
|
|
224
|
-
|
|
225
|
-
```text
|
|
226
|
-
/worktree status
|
|
227
|
-
/worktree list
|
|
228
|
-
/worktree continue
|
|
229
|
-
/worktree next
|
|
230
|
-
/worktree finalize [<reviewId> <revision>] [cleanup|retain_24h|retain_3d|retain_manual]
|
|
231
|
-
/worktree finish <commit message>
|
|
232
|
-
/worktree discard
|
|
233
|
-
/worktree remove <checkoutId>
|
|
85
|
+
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.7.1
|
|
234
86
|
```
|
|
235
87
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
## Safety model
|
|
88
|
+
Open a Git Workspace and enable **Worktree** when creating a Session. An existing Local Session can also let the model call `worktree_create`.
|
|
239
89
|
|
|
240
|
-
|
|
90
|
+
For the first run, complete one full create → Preview changes → Confirm and save → cleanup cycle.
|
|
241
91
|
|
|
242
|
-
|
|
92
|
+
If pnpm build approval blocks a Git-source install, or you need complete commands and troubleshooting, see [Installation and troubleshooting](docs/USAGE.en.md#installation-and-troubleshooting).
|
|
243
93
|
|
|
244
|
-
|
|
245
|
-
- an active target Workspace must canonicalize to the managed root recorded by the Host;
|
|
246
|
-
- one canonical Local project can have only one active Preview; a waiting owner keeps read-only Preflight but loses Preview/Finalize capability;
|
|
247
|
-
- an acceptance-slot blocker exposes only a path-free checkout/Session/state summary; opening it requires a fresh inspect plus owner and canonical-cwd verification;
|
|
248
|
-
- automatic Preflight creates no plan, slot, Git ref, or Local write; Preview and direct Finalize bypass display caches and check again;
|
|
249
|
-
- Preview receipts and internal refs are persisted before Local writes;
|
|
250
|
-
- Preview, Rollback, Finalize, Discard, and resume-editing paths bind checkout, revision, review, and fingerprint identity;
|
|
251
|
-
- Rollback removes only the delta proven to belong to the Preview and preserves separable Local changes made during review;
|
|
252
|
-
- branch switches, non-fast-forward history, overlapping conflicts, committed Preview bytes, or additional drift enter recovery instead of being overwritten;
|
|
253
|
-
- cleanup verifies managed-path identity, Git metadata, and the final fingerprint; uncertain residue is retained or quarantined;
|
|
254
|
-
- durable Delivery Proof is bound to the exact Review and records Commit, Local branch/HEAD, changed files, and validation evidence; dynamic history evidence grants no mutation capability;
|
|
255
|
-
- historical records from the old irreversible Apply flow are not automatically finished or discarded.
|
|
94
|
+
## Screenshots
|
|
256
95
|
|
|
257
|
-
|
|
96
|
+
### Project grouping and task status
|
|
258
97
|
|
|
259
|
-
|
|
98
|
+

|
|
260
99
|
|
|
261
|
-
|
|
262
|
-
- The linked Worktree Manager opens from the Session Header control; a persistent `conversation.view` tab is still not mounted.
|
|
263
|
-
- Harness still presents Local and Worktree Sessions as separate Workspaces by canonical cwd. The plugin manager shows the `sourceSessionId` relationship without changing native sidebar grouping.
|
|
264
|
-
- Workflow `agent({ isolation })` integration is not available in the verified Harness `0.1.0-rc.8` line.
|
|
265
|
-
- Subagents inherit their parent Session cwd; they share the isolated boundary only when the parent is already a Worktree Session.
|
|
266
|
-
- Dependency snapshot/restore and the complete collaborator handoff UI have not yet been implemented.
|
|
267
|
-
- A reviewed stage cannot yet be saved as an internal checkpoint before continuing development.
|
|
268
|
-
- An Isolated Session cannot yet request a bounded transaction to repair the real Local checkout directly.
|
|
269
|
-
- Cleanup removes the current Worktree cwd, but a delivered Session can recreate the path and start another iteration after strict validation.
|
|
100
|
+
### Prepare the review
|
|
270
101
|
|
|
271
|
-
|
|
102
|
+

|
|
272
103
|
|
|
273
|
-
|
|
104
|
+
See the [full usage guide](docs/USAGE.en.md#complete-delivery-example) for the complete flow.
|
|
274
105
|
|
|
275
|
-
|
|
106
|
+
## Safety boundary
|
|
276
107
|
|
|
277
|
-
|
|
278
|
-
- Continue hardening Ready, Preview, Rollback, Finalize, cleanup, and iteration recovery.
|
|
279
|
-
- Improve error categories, recovery guidance, and compatibility across real Harness releases.
|
|
280
|
-
- Re-evaluate whether a persistent Worktrees tab is still useful in addition to the Header Manager.
|
|
108
|
+
The Host rechecks every Local write at execution time. Browser caches and model output are never write authority. The plugin validates Session, checkout, revision, Git identity, Preview receipt, and Local state; branch switches, overlapping conflicts, unknown residue, or insufficient recovery evidence fail closed.
|
|
281
109
|
|
|
282
|
-
|
|
110
|
+
For the full state machine, CAS, and recovery invariants, see:
|
|
283
111
|
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
- Port dependency snapshot/restore to reduce repeated setup across Worktrees.
|
|
287
|
-
- Complete the collaborator/subagent handoff lifecycle so delegated work can be released and delivered safely.
|
|
288
|
-
- Continue enriching linked Worktree listing, inspection, retention, and cleanup management.
|
|
289
|
-
- Improve review presentation with clearer diff and validation information without weakening Host authority.
|
|
112
|
+
- [Worktree Console architecture](docs/WORKTREE-CONSOLE-ARCHITECTURE.md)
|
|
113
|
+
- [Session Target porting notes](docs/PORTING.md)
|
|
290
114
|
|
|
291
|
-
|
|
115
|
+
## Current boundaries
|
|
292
116
|
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
117
|
+
- A normal Managed owner is grouped under its original Local project. If the owner is missing, another Session exists, or membership conflicts, the original Workspace remains visible instead of hiding uncertain data.
|
|
118
|
+
- Managed owners can be renamed and archived. Worktree-aware Fork is not implemented yet, so the ordinary Fork action is hidden in this release.
|
|
119
|
+
- Child agents inherit the parent Session cwd; the plugin does not create per-child Worktrees.
|
|
120
|
+
- Checkpoint does not support editing, deleting, reordering, or arbitrary rollback of history.
|
|
121
|
+
- Domi's global Manager, Local Maintenance, dependency snapshots, and full collaborator lifecycle are outside this plugin's scope.
|
|
297
122
|
|
|
298
123
|
## Local development
|
|
299
124
|
|
|
300
|
-
Install dependencies and run the standard checks:
|
|
301
|
-
|
|
302
125
|
```bash
|
|
303
126
|
pnpm install
|
|
304
127
|
pnpm run typecheck
|
|
@@ -307,34 +130,19 @@ pnpm run build
|
|
|
307
130
|
pnpm run check:publish
|
|
308
131
|
```
|
|
309
132
|
|
|
310
|
-
|
|
133
|
+
Run the local end-to-end environment:
|
|
311
134
|
|
|
312
135
|
```bash
|
|
313
136
|
pnpm run dev:dsh
|
|
314
137
|
```
|
|
315
138
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
Useful variants:
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
# Install and verify the snapshot without starting Web
|
|
322
|
-
pnpm run dev:dsh:install
|
|
323
|
-
|
|
324
|
-
# Verify the already-installed profile
|
|
325
|
-
pnpm run dev:dsh:smoke
|
|
326
|
-
|
|
327
|
-
# Select another Git root, port, profile, or Harness source checkout
|
|
328
|
-
pnpm run dev:dsh -- --repo G:/path/to/repo --port 4090 --profile web
|
|
329
|
-
|
|
330
|
-
# Remove the development install and cached local archives
|
|
331
|
-
pnpm run dev:dsh:remove
|
|
332
|
-
```
|
|
139
|
+
See the [full usage guide](docs/USAGE.en.md#local-development) for more development commands and the [release checklist](docs/RELEASE.md) before publishing.
|
|
333
140
|
|
|
334
141
|
## Documentation
|
|
335
142
|
|
|
336
|
-
- [
|
|
143
|
+
- [Full usage guide](docs/USAGE.en.md)
|
|
337
144
|
- [Worktree Console architecture](docs/WORKTREE-CONSOLE-ARCHITECTURE.md)
|
|
145
|
+
- [Session Target porting notes](docs/PORTING.md)
|
|
338
146
|
- [UI development notes](docs/UI-DEVELOPMENT.md)
|
|
339
147
|
- [Release checklist](docs/RELEASE.md)
|
|
340
148
|
- [Changelog](CHANGELOG.md)
|