dsh-completion-guard 0.3.1 → 0.4.0
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 +48 -10
- package/CHANGELOG.zh-CN.md +48 -10
- package/README.md +49 -59
- package/README.zh-CN.md +50 -60
- package/dist/domain/index.d.ts +2 -2
- package/dist/domain/index.js +2 -2
- package/dist/{domain-CBvBQHTL.js → domain-CHTQFIT8.js} +941 -217
- package/dist/{index-GvKLkTqV.d.ts → index-AtjJOrK8.d.ts} +134 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/COMPATIBILITY.md +144 -11
- package/docs/LOCAL_ACCEPTANCE.md +147 -0
- package/docs/PORTING_NOTES.md +13 -3
- package/docs/SEMANTIC_COMPATIBILITY.md +20 -16
- package/docs/UPSTREAM_BASE.md +8 -1
- package/docs/distribution.md +44 -18
- package/docs/upstream-deltas.json +3 -3
- package/manifests/supported-host.v1.json +903 -59
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. The project is pre-1.0; release versions track the plugin lifecycle, not stabilised API promises.
|
|
4
4
|
|
|
5
|
+
## 0.4.0 - 2026-09-02
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **DSH alpha.3 is the 0.4.0 implementation baseline.** Version 0.4.0 targets DSH `0.1.2-alpha.3` with dshmarket `1.39.0` and Cordis `4.0.2`.
|
|
10
|
+
- **A proof must refer to the work that is still pending and to evidence for the action the user actually requested.** A read or verification result for another target cannot close the item. Empty subject sets, evidence imported from another session, and evidence with the wrong kind, surface, subject, or outcome are rejected.
|
|
11
|
+
- **Damaged proof state fails closed.** Changing the recorded asset set or scope digest makes the proof unusable. The technical contract versions canonical projections, bounded subject readback, scope coverage, state verification, and replayable `sessionQuery` state while excluding raw private logs and asset bytes.
|
|
12
|
+
- **Stage disposition.** The stopped 0.3.3 compatibility candidate is recorded as `superseded_before_candidate`; no 0.3.3 source, artifact, installation, native acceptance, commit, tag, or release existed.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **Compatibility adaptation pauses after alpha.3.** Version 0.4.0 stays frozen on the DSH alpha.3 setup. Alpha.4 and later alpha releases are not new adaptation targets; work resumes with the first upstream RC published after alpha.3. Upstream milestones are listed on the [DeepSeek Harness tags page](https://github.com/deepseek-ai/deepseek-harness/tags).
|
|
17
|
+
|
|
18
|
+
### Validation
|
|
19
|
+
|
|
20
|
+
- The release commit passes the repository matrix and CI on Ubuntu, macOS, and Windows with Node.js 22 and 24. One frozen 26-file tgz is used for native macOS and Windows acceptance and npm publication; the GitHub Release carries its checksum and platform annexes.
|
|
21
|
+
- Earlier 0.4.0 candidate packages remain historical evidence only. Results never transfer to changed package bytes; see [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md).
|
|
22
|
+
|
|
23
|
+
## 0.3.2 - 2026-09-01
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **Two exact DSH setups are recognized.** The `0.1.1-rc.2` + dshmarket `1.36.0` and `0.1.2-alpha.2` + dshmarket `1.38.1` package sets are both checked on macOS and Windows.
|
|
28
|
+
- **The whole package set must match.** Every required package must appear once with the expected version and integrity. Missing, mixed, duplicate, unidentified, or unknown packages make the entire host unavailable instead of leaving part of the Guard enabled. Status now lists missing packages, and switching setups invalidates earlier completion certificates.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- Peer dependencies accept only the two checked version sets (`0.1.1-rc.2 || 0.1.2-alpha.2`, Cordis `4.0.1 || 4.0.2`). A source comparison found no change in the DSH events, Goal calls, tool definitions, or terminal results that the Guard uses.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- **Release packaging now works with Windows tar.** Archive extraction uses paths relative to the temporary working directory instead of passing absolute archive paths, without changing the files placed in the package.
|
|
37
|
+
|
|
38
|
+
### Validation
|
|
39
|
+
|
|
40
|
+
- Candidate commit `22cde610` passed the six-job Ubuntu, macOS, and Windows CI matrix on Node.js 22 and 24. The complete 20-file suite passes 359 tests with one Windows-only skip on macOS, and native Windows matched all 34 alpha.2 package rows with no missing, extra, or duplicate entries.
|
|
41
|
+
- The frozen 26-file package (181157 bytes, SHA-256 `feb7fc29799820e08dfe6d2bdb94823e745df9b5aa7c34d46262e5df30dabac4`) passed the same-byte isolated Web and Headless lifecycle on native macOS and Windows. The annotated tag, npm package, GitHub Release, and downloaded public bytes all resolve to the same commit and artifact; see [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md).
|
|
42
|
+
|
|
5
43
|
## 0.3.1 - 2026-08-31
|
|
6
44
|
|
|
7
45
|
### Fixed
|
|
@@ -11,29 +49,29 @@ All notable changes to this project are documented here. The project is pre-1.0;
|
|
|
11
49
|
|
|
12
50
|
### Validation
|
|
13
51
|
|
|
14
|
-
-
|
|
52
|
+
- The frozen 0.3.1 package passed native macOS and Windows lifecycle checks, was published to npm, and has a matching GitHub Release. Exact artifact and public readback evidence is recorded in [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md).
|
|
15
53
|
|
|
16
54
|
## 0.3.0 - 2026-08-31
|
|
17
55
|
|
|
18
56
|
### Added
|
|
19
57
|
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
58
|
+
- **High-impact changes must match the user's exact request.** Package, file, service, and Git operations are tied to one target and an expected result. A generic successful command cannot certify a different action.
|
|
59
|
+
- **Changes require independent readback.** Install, apply, file editing, restart, Git, and publish operations must show both the intended effect and the resulting saved state before they can close a requirement.
|
|
60
|
+
- **Read-only checks and mutations use separate tools.** Looking up a target never grants permission to change it. Mutations require a current, matching root-user instruction; prohibitions and acceptance checks cannot provide that authority.
|
|
23
61
|
- **Bilingual npm download history.** A daily cumulative chart keeps the renamed `dsh-context-guard` and current `dsh-completion-guard` package totals separate while presenting one project-growth line. Collection reconciles npm range and point responses before publishing English and Simplified Chinese SVGs.
|
|
24
62
|
|
|
25
63
|
### Fixed
|
|
26
64
|
|
|
27
|
-
- Assistant
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- Windows
|
|
65
|
+
- Assistant wording no longer controls whether DSH continues a task. Only a saved wait or deferral state can end the current round without claiming completion.
|
|
66
|
+
- Missing, unknown, or changed DSH package identities keep the affected Guard capabilities unavailable. Direct internal Goal or session writes are reported as integrity problems but are not claimed to be preventable.
|
|
67
|
+
- Host-lock injection is repeatable, folded YAML integrity values are read correctly, and a fresh empty profile can be updated safely.
|
|
68
|
+
- Package publishing and file edits bind the expected destination before making a change and reject changed input or different resulting bytes.
|
|
69
|
+
- Windows actions pin both the command wrapper and the system command interpreter, then reuse those checked paths instead of searching again at execution time.
|
|
32
70
|
- The npm statistics publisher now rejects non-default refs before checkout, isolates read-only collection from the write-capable publication job, does not persist credentials during collection, and pins all official Actions to immutable commits.
|
|
33
71
|
|
|
34
72
|
### Changed
|
|
35
73
|
|
|
36
|
-
- **Package renamed from `dsh-context-guard` to `dsh-completion-guard`.** An unrelated DSH plugin
|
|
74
|
+
- **Package renamed from `dsh-context-guard` to `dsh-completion-guard`.** An unrelated DSH plugin already uses the old name. The internal Cordis bundle id stays `context-guard`, so installed profiles keep their runtime identity; all published versions of the previous npm package are deprecated and point readers to the new package.
|
|
37
75
|
|
|
38
76
|
### Validation
|
|
39
77
|
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的重要变化记录在这里。项目仍处于 1.0 之前;版本号跟踪插件生命周期,不代表 API 已稳定。
|
|
4
4
|
|
|
5
|
+
## 0.4.0 - 2026-09-02
|
|
6
|
+
|
|
7
|
+
### 新增
|
|
8
|
+
|
|
9
|
+
- **DSH alpha.3 成为 0.4.0 的实现基线。** 0.4.0 面向 DSH `0.1.2-alpha.3`、dshmarket `1.39.0` 和 Cordis `4.0.2`。
|
|
10
|
+
- **证明必须对应仍在待办中的工作,也必须对应用户实际要求的操作。** 读取或验证了另一个对象,不能关闭当前事项。对象集合为空、从其他会话带入证据,或证据的类型、表面、对象、结果不匹配时,都会被拒绝。
|
|
11
|
+
- **证明状态被篡改时保持失败关闭。** 资产集合或范围摘要一旦被改动,这份证明就不能再使用。技术层面会版本化 canonical projection、有限 subject readback、scope coverage、state verification 和可重放的 `sessionQuery` 状态,但不保存原始私有日志或资产字节。
|
|
12
|
+
- **阶段处置记录。** 已停止的 0.3.3 兼容候选明确记为 `superseded_before_candidate`;该阶段不存在 0.3.3 源码、工件、安装、原生验收、提交、tag 或 release。
|
|
13
|
+
|
|
14
|
+
### 变更
|
|
15
|
+
|
|
16
|
+
- **alpha.3 之后暂停兼容性适配。** 0.4.0 继续冻结在 DSH alpha.3 环境。alpha.4 及此后的 alpha 版本不作为新的适配目标;上游发布 alpha.3 之后的第一版 RC 时再恢复适配。上游版本进度见 [DeepSeek Harness 标签页](https://github.com/deepseek-ai/deepseek-harness/tags)。
|
|
17
|
+
|
|
18
|
+
### 验证
|
|
19
|
+
|
|
20
|
+
- 发布提交通过仓库矩阵,以及 Ubuntu、macOS、Windows 上的 Node.js 22/24 CI。同一份 26 文件 tgz 用于 macOS、Windows 原生验收和 npm 发布;GitHub Release 附带校验和与平台验收记录。
|
|
21
|
+
- 更早的 0.4.0 候选包只保留为历史证据。包字节变化后,旧结果不会迁移到新包;详见 [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md)。
|
|
22
|
+
|
|
23
|
+
## 0.3.2 - 2026-09-01
|
|
24
|
+
|
|
25
|
+
### 新增
|
|
26
|
+
|
|
27
|
+
- **可识别两套精确的 DSH 环境。** `0.1.1-rc.2` + dshmarket `1.36.0` 与 `0.1.2-alpha.2` + dshmarket `1.38.1` 两套包集合均已在 macOS 和 Windows 检查。
|
|
28
|
+
- **必须完整匹配整套包。** 每个必需包都必须恰好出现一次,并具有预期版本和完整性值。缺包、混装、重复、缺少身份或未知包都会让整个宿主保持不可用,不会只启用部分 Guard。状态会列出缺少的包,切换环境也会使旧完成证书失效。
|
|
29
|
+
|
|
30
|
+
### 变更
|
|
31
|
+
|
|
32
|
+
- peer dependencies 只接受两套已检查版本(`0.1.1-rc.2 || 0.1.2-alpha.2`,Cordis `4.0.1 || 4.0.2`)。源码对比未发现 Guard 使用的 DSH 事件、Goal 调用、工具定义或终端结果发生变化。
|
|
33
|
+
|
|
34
|
+
### 修复
|
|
35
|
+
|
|
36
|
+
- **发布打包现在兼容 Windows tar。** 解包时改用相对于临时工作目录的路径,不再把归档绝对路径传给 tar;包内文件不变。
|
|
37
|
+
|
|
38
|
+
### 验证
|
|
39
|
+
|
|
40
|
+
- 候选提交 `22cde610` 已通过 Ubuntu、macOS、Windows 和 Node.js 22/24 的六项 CI 矩阵。20 个测试文件全量通过 359 项,macOS 跳过 1 项仅适用于 Windows 的测试;Windows 原生核对 alpha.2 的 34 行包清单全部匹配,没有缺失、额外或重复项。
|
|
41
|
+
- 冻结的 26 文件包(181157 字节,SHA-256 `feb7fc29799820e08dfe6d2bdb94823e745df9b5aa7c34d46262e5df30dabac4`)已用同一份字节在原生 macOS 和 Windows 完成隔离 Web 与 Headless 生命周期验收。annotated tag、npm 包、GitHub Release 和重新下载的公开文件均指向同一提交与工件;详见 [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md)。
|
|
42
|
+
|
|
5
43
|
## 0.3.1 - 2026-08-31
|
|
6
44
|
|
|
7
45
|
### 修复
|
|
@@ -11,29 +49,29 @@
|
|
|
11
49
|
|
|
12
50
|
### 验证
|
|
13
51
|
|
|
14
|
-
-
|
|
52
|
+
- 冻结的 0.3.1 包已通过 macOS 和 Windows 原生生命周期检查,并已发布到 npm 和对应 GitHub Release。精确工件与公开读回证据见 [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md)。
|
|
15
53
|
|
|
16
54
|
## 0.3.0 - 2026-08-31
|
|
17
55
|
|
|
18
56
|
### 新增
|
|
19
57
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
58
|
+
- **高影响变更必须匹配用户的精确要求。** 包、文件、服务和 Git 操作会绑定到一个目标和预期结果;普通命令成功不能替代另一个动作的完成证据。
|
|
59
|
+
- **变更后必须独立读回。** 安装、更新、文件修改、重启、Git 和发布操作需要同时证明预期动作与最终保存状态,才能关闭要求。
|
|
60
|
+
- **只读检查和实际变更使用不同工具。** 查询目标不会自动产生修改权限。变更必须对应当前根用户要求;禁止项和验收条件不能提供这份授权。
|
|
23
61
|
- **双语 npm 下载量历史。** 每日累计图分别保留更名前的 `dsh-context-guard` 与当前 `dsh-completion-guard` 包总量,同时呈现一条项目增长曲线。采集器会先核对 npm range 与 point 响应,再发布英文和简体中文 SVG。
|
|
24
62
|
|
|
25
63
|
### 修复
|
|
26
64
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- Windows
|
|
65
|
+
- 助手措辞不再决定 DSH 是否继续任务。只有已保存的等待或延期状态才能结束当前轮次,同时保留未完成要求。
|
|
66
|
+
- DSH 包身份缺失、未知或发生变化时,受影响的 Guard 能力保持不可用。进程内部直接写 Goal/session 会被报告为完整性问题,但不声称一定能够阻止。
|
|
67
|
+
- 宿主身份注入可重复执行,折叠 YAML 中的完整性值可以正确读取,新建空 profile 也能安全更新。
|
|
68
|
+
- 包发布和文件修改会在操作前绑定预期目标,并拒绝已变化的输入或不同的最终字节。
|
|
69
|
+
- Windows 操作会固定命令包装器和系统命令解释器,执行时复用已检查路径,不再重新搜索。
|
|
32
70
|
- npm 统计发布器现在会在 checkout 前拒绝非默认 ref,把只读采集与具有写权限的发布 job 隔离,采集阶段不持久化凭据,并把全部官方 Action 固定到不可变提交。
|
|
33
71
|
|
|
34
72
|
### 变更
|
|
35
73
|
|
|
36
|
-
- **包名由 `dsh-context-guard` 更名为 `dsh-completion-guard`。**
|
|
74
|
+
- **包名由 `dsh-context-guard` 更名为 `dsh-completion-guard`。** 另一个无关 DSH 插件已经使用旧名称。内部 Cordis bundle id 仍为 `context-guard`,已安装 profile 的运行时身份不受影响;旧 npm 包的所有已发布版本均已标为弃用,并引导读者使用新包。
|
|
37
75
|
|
|
38
76
|
### 验证
|
|
39
77
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
An add-on for DeepSeek Harness (DSH) that keeps a task's requirements and checks them before the task is marked complete. It restores the same checklist after a resumed session and accepts only matching saved tool results as evidence.
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
@@ -11,89 +11,74 @@ A task-contract and completion-certification plugin for DeepSeek Harness (DSH).
|
|
|
11
11
|
Install the published plugin into a DSH Web profile:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
dsh plugin --profile web add dsh-completion-guard@0.
|
|
14
|
+
dsh plugin --profile web add dsh-completion-guard@0.4.0
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Before restarting DSH, record and verify the active runtime and profile. Replace the example paths with the absolute paths on your machine:
|
|
18
18
|
|
|
19
|
-
```
|
|
20
|
-
/
|
|
21
|
-
/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Activation is opt-in by default. `status` reports whether the guard is enabled, the current epoch and contract revision, pending and passed item counts, the evidence count, and integrity state. `off` stops capture and gating for the session while preserving its prior history; `clear` supersedes every pending requirement/acceptance under a `CLEAR:` sentinel (prohibitions retained) so an empty-binding checkpoint can certify while the guard stays on; `diagnose` returns a bounded diagnostic view.
|
|
25
|
-
|
|
26
|
-
### Activation modes
|
|
19
|
+
```sh
|
|
20
|
+
DSH_RUNTIME_ROOT=/absolute/path/to/.dsh-runtime
|
|
21
|
+
DSH_PROFILE_ROOT=/absolute/path/to/.dsh/profiles/web
|
|
22
|
+
DSH_COMPOSED_DUMP=/tmp/dsh-web-composed.yml
|
|
23
|
+
GUARD_HOST_LOCK="$DSH_PROFILE_ROOT/node_modules/.bin/dsh-completion-guard-host-lock"
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
"$GUARD_HOST_LOCK" inspect --runtime-root "$DSH_RUNTIME_ROOT" --profile-root "$DSH_PROFILE_ROOT"
|
|
26
|
+
"$GUARD_HOST_LOCK" inject --runtime-root "$DSH_RUNTIME_ROOT" --profile-root "$DSH_PROFILE_ROOT"
|
|
27
|
+
dsh --profile web --dump-config > "$DSH_COMPOSED_DUMP"
|
|
28
|
+
"$GUARD_HOST_LOCK" verify-dump --runtime-root "$DSH_RUNTIME_ROOT" --profile-root "$DSH_PROFILE_ROOT" --dump-config "$DSH_COMPOSED_DUMP"
|
|
29
|
+
```
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| `opt-in` | Default. A session remains unprotected until `/context-guard on` is recorded in that session. |
|
|
33
|
-
| `always` | Starts enabled before the session log is replayed. `/context-guard off` disables the guard for that session until a later `/context-guard on`. |
|
|
31
|
+
On Windows, run the same three subcommands through `dsh-completion-guard-host-lock.cmd` in the profile's `node_modules\.bin` directory and use Windows absolute paths. Repeat this check after a DSH, profile, or package upgrade. The Guard stays unavailable if the active package set is missing, mixed, duplicated, or different from a checked setup.
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
Restart DSH Web, open a session, and enable the Guard:
|
|
36
34
|
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
config:
|
|
41
|
-
activation: always
|
|
35
|
+
```text
|
|
36
|
+
/context-guard on
|
|
37
|
+
/context-guard status
|
|
42
38
|
```
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Once enabled, Context Guard captures direct user requirements and acceptance criteria. Tool results become citable evidence only after DSH persists them. Before the model claims the whole task is complete, it must call the injected `context_guard_checkpoint` tool with matching evidence IDs; an incomplete or stale binding cannot certify completion.
|
|
40
|
+
Activation is opt-in by default. `status` shows whether the Guard is on and how many checks remain. `off` stops protection for the current session without deleting its history. `clear` closes the current checklist while keeping prohibitions. `diagnose` explains why a completion check passed or failed.
|
|
47
41
|
|
|
48
42
|
## What it protects
|
|
49
43
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
44
|
+
- Saves requirements, acceptance checks, prohibitions, and later corrections without overwriting history.
|
|
45
|
+
- Uses only tool calls and results that DSH has saved, and stores a redacted summary rather than full output.
|
|
46
|
+
- Accepts evidence only when the action and result match the requested command, file, or other target.
|
|
47
|
+
- Rechecks completion after a session is rebuilt or resumed, and refuses to certify damaged state.
|
|
48
|
+
- Stops the Guard-owned Goal completion path when the current checklist has not passed. DSH internals can still bypass this path, so the plugin reports those cases rather than claiming to block every possible write.
|
|
55
49
|
|
|
56
50
|
## Status and compatibility
|
|
57
51
|
|
|
58
|
-
Version 0.
|
|
59
|
-
|
|
60
|
-
The `0.3.0` npm artifact passed same-byte native validation, but npm omitted its required `gitHead` metadata because a prebuilt tgz was published. Its version identity cannot be reused, and no GitHub Release is created for `v0.3.0`; `0.3.1` preserves the runtime behavior while repairing the release provenance path.
|
|
61
|
-
|
|
62
|
-
> The project was renamed from `dsh-context-guard` to `dsh-completion-guard` on 2026-08-29 to avoid a name collision with an unrelated DSH plugin (kpl0111/dsh-context-guard, tool-result pruning). The internal Cordis bundle id stays `context-guard`, and the previous npm package `dsh-context-guard` will be deprecated in favor of this package. It targets DSH `0.1.1-rc.2`, Node.js `>=22`, and pnpm `>=11`.
|
|
63
|
-
|
|
64
|
-
### Earlier v0.2.x evidence
|
|
52
|
+
Version 0.4.0 is the current release. Install it from [npm](https://www.npmjs.com/package/dsh-completion-guard); its [GitHub Release](https://github.com/GreenLv/dsh-completion-guard/releases/tag/v0.4.0) carries the exact package checksum and native macOS and Windows acceptance records. It targets DSH `0.1.2-alpha.3` with dshmarket `1.39.0` and Cordis `4.0.2`.
|
|
65
53
|
|
|
66
|
-
|
|
54
|
+
Version 0.3.2 remains available for the checked DSH `0.1.1-rc.2` and `0.1.2-alpha.2` setups. Do not combine packages from different checked setups; the Guard fails closed when the active package set does not match one complete cohort in [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md).
|
|
67
55
|
|
|
68
|
-
|
|
56
|
+
Version 0.4.0 remains frozen on this alpha.3 setup. Alpha.4 and later alpha releases are not new adaptation targets; compatibility work resumes with the first upstream RC published after alpha.3. Track that milestone on the [DeepSeek Harness tags page](https://github.com/deepseek-ai/deepseek-harness/tags).
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
Release packages are built once from a clean commit and published only after those exact bytes pass native macOS and Windows Web and Headless checks. CI, native lifecycle checks, package publication, and public readback remain separate evidence scopes; see [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md).
|
|
71
59
|
|
|
72
|
-
Version 0.3.
|
|
60
|
+
Version 0.3.0 is not recommended. Its package passed native checks, but npm did not record the required source commit, so the version cannot be repaired in place and has no GitHub Release. Use 0.3.2.
|
|
73
61
|
|
|
74
|
-
The
|
|
62
|
+
> The project was renamed from `dsh-context-guard` to `dsh-completion-guard` on 2026-08-29 because an unrelated plugin already used the old name. The internal bundle id remains `context-guard`, and the old npm package points users to this one. Supported DSH setups are listed in [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md); Node.js `>=22` and pnpm `>=11` are required.
|
|
75
63
|
|
|
76
|
-
|
|
64
|
+
## Activation modes
|
|
77
65
|
|
|
78
|
-
|
|
79
|
-
DSH_RUNTIME_ROOT=/absolute/path/to/.dsh-runtime
|
|
80
|
-
DSH_PROFILE_ROOT=/absolute/path/to/.dsh/profiles/web
|
|
81
|
-
DSH_COMPOSED_DUMP=/tmp/dsh-web-composed.yml
|
|
82
|
-
GUARD_HOST_LOCK="$DSH_PROFILE_ROOT/node_modules/.bin/dsh-completion-guard-host-lock"
|
|
66
|
+
The default `opt-in` mode protects a session only after `/context-guard on`. To enable the Guard automatically for a DSH profile, add this override to that profile's `cordis.patch.yml`:
|
|
83
67
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
dsh
|
|
87
|
-
|
|
68
|
+
```yaml
|
|
69
|
+
- id: context-guard
|
|
70
|
+
name: dsh-completion-guard
|
|
71
|
+
config:
|
|
72
|
+
activation: always
|
|
88
73
|
```
|
|
89
74
|
|
|
90
|
-
|
|
75
|
+
Restart the profile, then run `/context-guard status`. In `always` mode, rebuilding an existing session can also capture earlier user messages from its saved log. Keep `opt-in` if protection should start only after an explicit command.
|
|
91
76
|
|
|
92
|
-
|
|
77
|
+
## How completion is checked
|
|
93
78
|
|
|
94
|
-
|
|
79
|
+
Once enabled, the Guard saves direct user requirements and acceptance checks. A saved tool result counts only when it matches the requested command, file, or other target. Before claiming the whole task complete, the model must pass the Guard's checkpoint; missing, stale, or mismatched evidence leaves the task open.
|
|
95
80
|
|
|
96
|
-
|
|
81
|
+
Read-only evidence collection and actions that change packages, files, services, or Git state use separate tools. A successful lookup never grants permission to make a change. Exact command limits and platform evidence are documented in [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md).
|
|
97
82
|
|
|
98
83
|
## Boundaries
|
|
99
84
|
|
|
@@ -103,7 +88,11 @@ Evidence is bounded and redacted. Complete prompts, stdout, file contents, crede
|
|
|
103
88
|
|
|
104
89
|
## Relationship to Codex Context Guard
|
|
105
90
|
|
|
106
|
-
This project
|
|
91
|
+
This project began as a DSH port of deterministic behavior from [`GreenLv/codex-context-guard`](https://github.com/GreenLv/codex-context-guard) v0.8.8. That version is the historical starting point, not the current compatibility level.
|
|
92
|
+
|
|
93
|
+
Current shared behavior is tracked by pinned conformance fixtures and an explicit delta ledger. Version 0.3.2 includes the shared Stop 2.0, digest v3, and conformance work from the Codex 0.9.4 line. Version 0.4.0 adds the stricter task, path, capability, and proof bindings documented in [`docs/SEMANTIC_COMPATIBILITY.md`](docs/SEMANTIC_COMPATIBILITY.md); this is a bounded semantic alignment claim, not full product parity.
|
|
94
|
+
|
|
95
|
+
The two repositories serve different runtimes:
|
|
107
96
|
|
|
108
97
|
- `codex-context-guard` is the Codex Hook/Python implementation with Codex plugin-cache and Hook lifecycle integration.
|
|
109
98
|
- `dsh-completion-guard` is an independent TypeScript implementation over native DSH Session events, commands, tools, and agent lifecycle.
|
|
@@ -114,7 +103,7 @@ They do not share runtime state, installers, caches, or release histories. Fixes
|
|
|
114
103
|
|
|
115
104
|

|
|
116
105
|
|
|
117
|
-
The cumulative chart keeps the old and new npm package totals visibly separate, marks the 2026-08-29 rename, and combines them only for the project growth line. npm download counts measure registry requests; they are not counts of unique users or confirmed installations. The workflow
|
|
106
|
+
The cumulative chart keeps the old and new npm package totals visibly separate, marks the 2026-08-29 rename, and combines them only for the project growth line. npm download counts measure registry requests; they are not counts of unique users or confirmed installations. The workflow updates the chart daily and can also be triggered manually.
|
|
118
107
|
|
|
119
108
|
## Documentation
|
|
120
109
|
|
|
@@ -124,7 +113,8 @@ The cumulative chart keeps the old and new npm package totals visibly separate,
|
|
|
124
113
|
- [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md) — deterministic, isolated, native, and public-package validation scopes.
|
|
125
114
|
- [`docs/distribution.md`](docs/distribution.md) — verified public distribution destinations and the rename note.
|
|
126
115
|
- [`docs/PRIVACY.md`](docs/PRIVACY.md) — stored facts, prohibited data, and failure behavior.
|
|
127
|
-
- [`docs/UPSTREAM_BASE.md`](docs/UPSTREAM_BASE.md) —
|
|
116
|
+
- [`docs/UPSTREAM_BASE.md`](docs/UPSTREAM_BASE.md) — historical starting point and repository authority boundary.
|
|
117
|
+
- [`docs/SEMANTIC_COMPATIBILITY.md`](docs/SEMANTIC_COMPATIBILITY.md) — current shared behavior and known gaps.
|
|
128
118
|
- [`docs/PORTING_NOTES.md`](docs/PORTING_NOTES.md) — behavior retained from Codex and DSH-specific replacements.
|
|
129
119
|
|
|
130
120
|
## Development
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md)
|
|
4
4
|
|
|
5
|
-
面向 DeepSeek Harness(DSH
|
|
5
|
+
面向 DeepSeek Harness(DSH)的任务保护插件。它保存任务要求,并在任务标记完成前逐项核对;会话恢复后仍使用同一份检查表,只有匹配的已保存工具结果才能作为证据。
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
@@ -11,89 +11,74 @@
|
|
|
11
11
|
将已发布插件安装到 DSH Web profile:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
dsh plugin --profile web add dsh-completion-guard@0.
|
|
14
|
+
dsh plugin --profile web add dsh-completion-guard@0.4.0
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
重启 DSH
|
|
17
|
+
重启 DSH 前,先记录并验证当前 runtime 和 profile。请把示例路径替换为本机绝对路径:
|
|
18
18
|
|
|
19
|
-
```
|
|
20
|
-
/
|
|
21
|
-
/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
默认采用 opt-in。`status` 会返回启用状态、当前 epoch 和合同修订、待完成与已通过条目数量、证据数量及完整性状态;`off` 停止本会话的捕获和门禁,但保留已有历史;`clear` 在 `CLEAR:` 哨兵下使所有待完成的 requirement/acceptance 成为 superseded(保留 prohibition),从而让空绑定 checkpoint 也能在 Guard 保持开启的情况下签发证书;`diagnose` 返回有界的诊断信息。
|
|
25
|
-
|
|
26
|
-
### 启用模式
|
|
19
|
+
```sh
|
|
20
|
+
DSH_RUNTIME_ROOT=/absolute/path/to/.dsh-runtime
|
|
21
|
+
DSH_PROFILE_ROOT=/absolute/path/to/.dsh/profiles/web
|
|
22
|
+
DSH_COMPOSED_DUMP=/tmp/dsh-web-composed.yml
|
|
23
|
+
GUARD_HOST_LOCK="$DSH_PROFILE_ROOT/node_modules/.bin/dsh-completion-guard-host-lock"
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
"$GUARD_HOST_LOCK" inspect --runtime-root "$DSH_RUNTIME_ROOT" --profile-root "$DSH_PROFILE_ROOT"
|
|
26
|
+
"$GUARD_HOST_LOCK" inject --runtime-root "$DSH_RUNTIME_ROOT" --profile-root "$DSH_PROFILE_ROOT"
|
|
27
|
+
dsh --profile web --dump-config > "$DSH_COMPOSED_DUMP"
|
|
28
|
+
"$GUARD_HOST_LOCK" verify-dump --runtime-root "$DSH_RUNTIME_ROOT" --profile-root "$DSH_PROFILE_ROOT" --dump-config "$DSH_COMPOSED_DUMP"
|
|
29
|
+
```
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| `opt-in` | 默认值。只有本会话记录了 `/context-guard on` 后才开始保护。 |
|
|
33
|
-
| `always` | 在重放会话日志前就进入启用状态。`/context-guard off` 会关闭本会话的 Guard,直到后续再次执行 `/context-guard on`。 |
|
|
31
|
+
Windows 请通过 profile 的 `node_modules\.bin\dsh-completion-guard-host-lock.cmd` 运行相同的三个子命令,并使用 Windows 绝对路径。DSH、profile 或包升级后需要重新检查。如果当前包集合缺失、混装、重复或不属于已检查环境,Guard 会保持不可用。
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
然后重启 DSH Web,打开会话并启用 Guard:
|
|
36
34
|
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
config:
|
|
41
|
-
activation: always
|
|
35
|
+
```text
|
|
36
|
+
/context-guard on
|
|
37
|
+
/context-guard status
|
|
42
38
|
```
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
启用后,Context Guard 从用户直接给出的要求和验收条件建立合同。工具结果只有在 DSH 持久化后才会成为可引用证据。模型在声称整个任务完成前,必须调用注入的 `context_guard_checkpoint` 工具并绑定匹配的证据 ID;不完整、过期或对象不匹配的绑定不能签发证书。
|
|
40
|
+
默认采用 opt-in。`status` 显示 Guard 是否开启以及还有多少检查项。`off` 停止保护当前会话,但不删除历史。`clear` 关闭当前待办,同时保留禁止项。`diagnose` 说明完成检查为什么通过或失败。
|
|
47
41
|
|
|
48
42
|
## 它保护什么
|
|
49
43
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
44
|
+
- 保存需求、验收条件、禁止项和后续修正,不覆盖旧记录。
|
|
45
|
+
- 只使用 DSH 已保存的工具调用和结果,并保存脱敏摘要而不是完整输出。
|
|
46
|
+
- 只有动作和结果对应指定命令、文件或其他目标时,证据才有效。
|
|
47
|
+
- 会话重建或恢复后重新检查完成状态;记录损坏时拒绝签发证书。
|
|
48
|
+
- 当前检查表尚未通过时,阻止 Guard 自己守卫的 Goal 完成路径。DSH 内部仍可能绕过这条路径,因此插件会报告这些情况,不声称能阻止所有写入。
|
|
55
49
|
|
|
56
50
|
## 状态与兼容性
|
|
57
51
|
|
|
58
|
-
0.
|
|
59
|
-
|
|
60
|
-
`0.3.0` npm 工件已通过原生平台同字节验收,但由于发布的是预构建 tgz,npm 没有写入合同要求的 `gitHead`。该版本身份不能复用,也不会为 `v0.3.0` 创建 GitHub Release;`0.3.1` 保留其运行时行为并修复发布溯源路径。
|
|
61
|
-
|
|
62
|
-
> 本项目于 2026-08-29 由 `dsh-context-guard` 更名为 `dsh-completion-guard`,以避免与无关的 DSH 插件(kpl0111/dsh-context-guard,工具结果剪裁)撞名。内部 Cordis bundle id 保持 `context-guard` 不变;原 npm 包 `dsh-context-guard` 将被 deprecate 并指向本包。目标环境为 DSH `0.1.1-rc.2`、Node.js `>=22`、pnpm `>=11`。
|
|
63
|
-
|
|
64
|
-
### 早期 v0.2.x 证据
|
|
52
|
+
0.4.0 是当前版本,可从 [npm](https://www.npmjs.com/package/dsh-completion-guard) 安装。[GitHub Release](https://github.com/GreenLv/dsh-completion-guard/releases/tag/v0.4.0) 附有精确的包校验和,以及 macOS、Windows 原生验收记录。它面向 DSH `0.1.2-alpha.3`、dshmarket `1.39.0` 和 Cordis `4.0.2`。
|
|
65
53
|
|
|
66
|
-
0.2
|
|
54
|
+
0.3.2 继续支持已经检查过的 DSH `0.1.1-rc.2` 和 `0.1.2-alpha.2` 环境。不要混用不同环境的包;只有当前包集合完整匹配 [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) 中的一套记录时,Guard 才会启用。
|
|
67
55
|
|
|
68
|
-
|
|
56
|
+
0.4.0 的兼容基线继续冻结在这套 alpha.3 环境。alpha.4 及此后的 alpha 版本不作为新的适配目标;兼容性适配将在上游发布 alpha.3 之后的第一版 RC 时恢复。上游版本进度见 [DeepSeek Harness 标签页](https://github.com/deepseek-ai/deepseek-harness/tags)。
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
发布包只从干净提交生成一次;同一份包在 macOS 和 Windows 上完成 Web、Headless 原生检查后才会发布。CI、原生生命周期、包发布和公开读回是四类独立证据,详见 [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md)。
|
|
71
59
|
|
|
72
|
-
|
|
60
|
+
不建议使用 0.3.0。它的包通过了原生检查,但 npm 没有记录所需的源码提交,因此不能原地修复,也没有 GitHub Release。请使用 0.3.2。
|
|
73
61
|
|
|
74
|
-
|
|
62
|
+
> 本项目于 2026-08-29 由 `dsh-context-guard` 更名为 `dsh-completion-guard`,因为另一个无关插件已经使用旧名称。内部 bundle id 仍为 `context-guard`,旧 npm 包会引导用户使用本包。支持的 DSH 环境见 [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md);需要 Node.js `>=22` 和 pnpm `>=11`。
|
|
75
63
|
|
|
76
|
-
|
|
64
|
+
## 启用模式
|
|
77
65
|
|
|
78
|
-
|
|
79
|
-
DSH_RUNTIME_ROOT=/absolute/path/to/.dsh-runtime
|
|
80
|
-
DSH_PROFILE_ROOT=/absolute/path/to/.dsh/profiles/web
|
|
81
|
-
DSH_COMPOSED_DUMP=/tmp/dsh-web-composed.yml
|
|
82
|
-
GUARD_HOST_LOCK="$DSH_PROFILE_ROOT/node_modules/.bin/dsh-completion-guard-host-lock"
|
|
66
|
+
默认 `opt-in` 模式只在会话执行 `/context-guard on` 后开始保护。如需让某个 DSH profile 自动启用 Guard,请在该 profile 的 `cordis.patch.yml` 中增加:
|
|
83
67
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
dsh
|
|
87
|
-
|
|
68
|
+
```yaml
|
|
69
|
+
- id: context-guard
|
|
70
|
+
name: dsh-completion-guard
|
|
71
|
+
config:
|
|
72
|
+
activation: always
|
|
88
73
|
```
|
|
89
74
|
|
|
90
|
-
|
|
75
|
+
重启 profile 后执行 `/context-guard status`。`always` 会在日志重放前启用 Guard,因此重建已有会话时也可能捕获日志中的早期用户消息。如果只希望从显式命令开始保护,请保留 `opt-in`。
|
|
91
76
|
|
|
92
|
-
|
|
77
|
+
## 如何检查完成状态
|
|
93
78
|
|
|
94
|
-
|
|
79
|
+
启用后,Guard 会保存用户直接给出的要求和验收条件。只有已保存的工具结果与指定命令、文件或其他目标一致时,才能作为证据。模型在报告整个任务完成前必须通过 Guard 检查;证据缺失、过期或对象不一致时,任务会保持未完成。
|
|
95
80
|
|
|
96
|
-
|
|
81
|
+
只读证据收集与修改包、文件、服务或 Git 状态的操作使用不同工具。查询成功不会自动产生变更权限。精确命令限制和平台证据见 [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md)。
|
|
97
82
|
|
|
98
83
|
## 边界
|
|
99
84
|
|
|
@@ -103,7 +88,11 @@ Context Guard 负责完成认证;Goal、Todo、Compaction、continuation、权
|
|
|
103
88
|
|
|
104
89
|
## 与 Codex Context Guard 的关系
|
|
105
90
|
|
|
106
|
-
|
|
91
|
+
本项目最初从 [`GreenLv/codex-context-guard`](https://github.com/GreenLv/codex-context-guard) v0.8.8 移植确定性行为。这个版本只是历史起点,不代表当前兼容程度。
|
|
92
|
+
|
|
93
|
+
双方当前共享到哪里,由固定的兼容性测试数据和差异台账记录。0.3.2 已包含 Codex 0.9.4 系列的 Stop 2.0、digest v3 和共享兼容性测试。0.4.0 又加入了更严格的任务、路径、能力和证明绑定,具体范围见 [`docs/SEMANTIC_COMPATIBILITY.md`](docs/SEMANTIC_COMPATIBILITY.md);这里描述的是有明确边界的语义对齐,不代表两个产品完全一致。
|
|
94
|
+
|
|
95
|
+
两个项目服务于不同运行时:
|
|
107
96
|
|
|
108
97
|
- `codex-context-guard` 是面向 Codex Hook 的 Python 实现,负责 Codex 插件缓存和 Hook 生命周期接入。
|
|
109
98
|
- `dsh-completion-guard` 是独立的 TypeScript 实现,基于 DSH 原生 Session 事件、命令、工具和 Agent 生命周期工作。
|
|
@@ -112,9 +101,9 @@ Context Guard 负责完成认证;Goal、Todo、Compaction、continuation、权
|
|
|
112
101
|
|
|
113
102
|
## npm 下载量历史
|
|
114
103
|
|
|
115
|
-

|
|
116
105
|
|
|
117
|
-
|
|
106
|
+
累计图分别显示更名前后的 npm 包下载总量,标记 2026-08-29 的更名,并仅在项目增长曲线中合并两者。npm 下载量统计的是 registry 请求,不等于独立用户数或已确认的真实安装人数。工作流每天自动更新,也可以手动触发。
|
|
118
107
|
|
|
119
108
|
## 文档
|
|
120
109
|
|
|
@@ -124,7 +113,8 @@ Context Guard 负责完成认证;Goal、Todo、Compaction、continuation、权
|
|
|
124
113
|
- [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md) — 确定性、隔离环境、原生平台和公开包验证范围。
|
|
125
114
|
- [`docs/distribution.md`](docs/distribution.md) — 已验证的公开分发去向与更名说明。
|
|
126
115
|
- [`docs/PRIVACY.md`](docs/PRIVACY.md) — 保存的事实、禁止数据和失败行为。
|
|
127
|
-
- [`docs/UPSTREAM_BASE.md`](docs/UPSTREAM_BASE.md) —
|
|
116
|
+
- [`docs/UPSTREAM_BASE.md`](docs/UPSTREAM_BASE.md) — 历史起点与仓库权威边界。
|
|
117
|
+
- [`docs/SEMANTIC_COMPATIBILITY.md`](docs/SEMANTIC_COMPATIBILITY.md) — 当前共享行为和已知差异。
|
|
128
118
|
- [`docs/PORTING_NOTES.md`](docs/PORTING_NOTES.md) — 从 Codex 保留的行为和 DSH 专属替换。
|
|
129
119
|
|
|
130
120
|
## 开发
|