dsh-completion-guard 0.2.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 +83 -0
- package/CHANGELOG.zh-CN.md +83 -0
- package/LICENSE +202 -0
- package/README.md +100 -0
- package/README.zh-CN.md +100 -0
- package/cordis.patch.yml +5 -0
- package/dist/domain/index.d.ts +2 -0
- package/dist/domain/index.js +3 -0
- package/dist/domain-BN3_AuUr.js +1997 -0
- package/dist/index-Dk4SkQ8H.d.ts +448 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +1125 -0
- package/docs/ARCHITECTURE.md +42 -0
- package/docs/COMPATIBILITY.md +169 -0
- package/docs/LOCAL_ACCEPTANCE.md +337 -0
- package/docs/PORTING_NOTES.md +14 -0
- package/docs/PRIVACY.md +23 -0
- package/docs/UPSTREAM_BASE.md +22 -0
- package/package.json +70 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Package renamed from `dsh-context-guard` to `dsh-completion-guard`.** An unrelated DSH plugin (kpl0111/dsh-context-guard, tool-result pruning) already uses the name; the rename removes the collision for name-keyed registries and lists. The internal Cordis bundle id stays `context-guard`, so installed profiles keep their runtime identity. The previous npm package `dsh-context-guard` will be deprecated once `dsh-completion-guard` is published.
|
|
10
|
+
|
|
11
|
+
## 0.2.1 - 2026-08-28
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **Clarifications and session talk no longer pollute the contract.** Bare progression phrases (`继续`, `continue`), meta questions (`这个收尾具体要做什么`, `是不是bug`), and meta comments/objections are classified as session-layer talk and never become contract items — including as clauses inside otherwise actionable messages. Real instructions, prohibitions, and task titles are captured exactly as before; the classifier fails closed on uncertain phrasing.
|
|
16
|
+
- **Rejected checkpoints no longer re-inject the same recovery packet.** Recovery injection is content-deduplicated through a digest bound to the packet content, contract revision, and epoch. Resume, compaction, enablement transitions, new evidence, or a new contract revision still always re-remind.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **`/context-guard clear`.** Supersedes every pending requirement and acceptance under a `CLEAR:<revision>` sentinel (prohibitions are retained) and bumps the contract revision, so an empty-binding checkpoint can certify and Goal completion can proceed while the guard stays enabled. The command is replayed from the log like all other state.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- The Goal-completion gate is unchanged (no current certificate, no completion) and is now documented with its explicit remediation routes: `/context-guard off` after the user confirms completion, `/context-guard clear`, or a truthful `update_goal(action=blocked)`.
|
|
25
|
+
|
|
26
|
+
See [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) for the supported grammar and [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md) for release evidence and platform limits.
|
|
27
|
+
|
|
28
|
+
## 0.2.0 - 2026-08-28
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **Cwd-aware evidence.** When a shell tool omits `workdir`, evidence is attributed to the session cwd, so relative file operations and pathless checks can satisfy a contract for the repository where they ran.
|
|
33
|
+
- **More useful checks without widening trust.** Literal `2>&1`, selected read-only inspection commands, and whitelisted PowerShell executables can now produce certifiable evidence. Compound commands, variables, file-target redirects, in-place `sed`, and non-whitelisted executables remain unsupported.
|
|
34
|
+
- **Process actions and diagnostics are certifiable.** Actions such as pull, install, commit, push, publish, and restart map to run evidence; deterministic `python -m unittest`, `doctest`, and `pytest` checks are recognized. Rejected checkpoint bindings now include actionable hints, and structured exit metadata is honored when DSH provides it.
|
|
35
|
+
- **Long sessions are easier to recover.** Informational receipts no longer become accidental tasks, `--help` is treated as inspection rather than a passing check, and oversized recovery packets fold safely while exposing evidence `outcome` and `capabilities`.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- The command surface is defined and validated from one shipped manifest, with regression coverage for real compound shell workflows. Parsing remains fail-closed: unsupported or partially understood syntax produces no certifiable executable or operation.
|
|
40
|
+
|
|
41
|
+
See [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) for the supported grammar and [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md) for release evidence and platform limits.
|
|
42
|
+
|
|
43
|
+
## 0.1.2 - 2026-08-27
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- The clean-success contract now covers the persistent shell renderers' full terminal vocabulary. `[shell exited: code N]`, `[shell killed by signal: S]`, `[shell exited]`, and the persistent timeout report (`Your command timed out after N seconds or experienced an OOM error. Below is partial output:`) are recognised as terminal facts even when followed by their prose reset line (`The persistent bash shell was reset; ...`), so those results can no longer certify as clean success. A clean result that merely echoes the reset prose remains a clean success, and the 0.1.1 session-renderer markers are unchanged.
|
|
48
|
+
|
|
49
|
+
## 0.1.1 - 2026-08-27
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- Completed foreground `bash` results from the pinned DSH renderer now count as successful evidence when no error, timeout, sandbox denial, signal, interruption, or non-zero exit marker is present. Background execution and the unverified generic `shell` alias remain fail-closed, and unsupported command syntax still cannot certify a contract.
|
|
54
|
+
|
|
55
|
+
## 0.1.0 - 2026-08-27
|
|
56
|
+
|
|
57
|
+
Initial task-contract and completion-certification plugin for DeepSeek Harness.
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
|
|
61
|
+
- Contract capture from direct human messages (requirement / acceptance / prohibition), each with a concrete verification subject and surface.
|
|
62
|
+
- Bounded evidence derived only from persisted `tool/call` + `tool/result` pairs (capability, subject, surface, bounded summary hash).
|
|
63
|
+
- Fail-closed completion certification: empty evidence bindings, missing or stale evidence, and unrelated evidence are rejected.
|
|
64
|
+
- Goal-completion gate (`update_goal complete` requires a current certificate while enabled) and turn-stopping gate with a continuation-attempt cap.
|
|
65
|
+
- Recovery packet injection after compaction or resume.
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
|
|
69
|
+
- Initial enablement comes from the effective `activation` configuration; all later persisted Guard state is derived from native DSH session events (`command/run`, `user/message`, `tool/call`, `tool/result`). Context Guard no longer appends custom `context-guard/*` event types, which the current persistence layer would refuse to reload — resuming a guarded session no longer depends on an upstream event-registration seam.
|
|
70
|
+
- Capture sanitizes credentials, bearer tokens, and URL query strings before persisting normalized clause text, matching the privacy contract.
|
|
71
|
+
- Exit-code evidence uses the last recorded marker, so an echoed fake `[exit code: 0]` can no longer mask a real trailing failure; echoed or backgrounded check commands no longer count as deterministic verification.
|
|
72
|
+
- Replay re-verifies certificates: certification is recomputed from the re-derived evidence, and a certificate that no longer re-derives marks the projection `corrupt` (fail closed).
|
|
73
|
+
|
|
74
|
+
### Fixed
|
|
75
|
+
|
|
76
|
+
- Two captured requirements in one scan no longer collide on the same identifier and revision; identical re-statements supersede the earlier capture under a new revision.
|
|
77
|
+
- The Goal-completion gate no longer fires while the guard is disabled.
|
|
78
|
+
- Bare completion confirmations (`Done.`, `搞定了。`) now trigger the gate, and step-level claims followed by continuation intent are no longer treated as whole-task completion.
|
|
79
|
+
- Code-mode dispatch roots are carried through evidence instead of being pinned to the inner call id.
|
|
80
|
+
|
|
81
|
+
### Release materials
|
|
82
|
+
|
|
83
|
+
- Full Apache-2.0 license text, CI workflow, and this changelog; the npm package now includes `docs/`.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
本项目的重要变化记录在这里。项目仍处于 1.0 之前;版本号跟踪插件生命周期,不代表 API 已稳定。
|
|
4
|
+
|
|
5
|
+
## 未发布
|
|
6
|
+
|
|
7
|
+
### 变更
|
|
8
|
+
|
|
9
|
+
- **包名由 `dsh-context-guard` 更名为 `dsh-completion-guard`。** 无关的 DSH 插件(kpl0111/dsh-context-guard,工具结果剪裁)已占用该名称;更名消除按名字建索引的注册面与列表上的冲突。内部 Cordis bundle id 保持 `context-guard` 不变,已安装 profile 的运行时身份不受影响。`dsh-completion-guard` 发布后,原 npm 包 `dsh-context-guard` 将被 deprecate。
|
|
10
|
+
|
|
11
|
+
## 0.2.1 - 2026-08-28
|
|
12
|
+
|
|
13
|
+
### 修复
|
|
14
|
+
|
|
15
|
+
- **澄清提问与会话推进语不再污染合同。** 纯推进语(`继续`、`continue`)、元问题(`这个收尾具体要做什么`、`是不是bug`)与元评论/质疑被归类为会话层话语,不再成为合同条目——混合消息中的会话层分句同样被剔除。真实指令、禁止项与任务标题的捕获行为完全不变;措辞拿不准时分类器保守 fail-closed。
|
|
16
|
+
- **被拒的 checkpoint 不再重复注入同一恢复包。** 恢复注入按内容去重:摘要绑定恢复包内容、合同修订与 epoch。resume、压缩、启用切换、新证据或新合同修订仍必然再次提醒。
|
|
17
|
+
|
|
18
|
+
### 新增
|
|
19
|
+
|
|
20
|
+
- **`/context-guard clear`。** 将当前所有 pending 的 requirement/acceptance 以 `CLEAR:<revision>` 哨兵标记为 superseded(prohibition 保留)并递增合同修订,使空绑定 checkpoint 可以通过认证、Goal completion 在守卫保持开启的情况下放行。该命令与其他状态一样从日志重放。
|
|
21
|
+
|
|
22
|
+
### 变更
|
|
23
|
+
|
|
24
|
+
- Goal 完成门禁语义不变(无当前证书不放行),并补充文档化的三条善后路线:用户确认完成后 `/context-guard off`、`/context-guard clear`、如实记录 `update_goal(action=blocked)`。
|
|
25
|
+
|
|
26
|
+
支持语法见 [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md),发布证据和平台边界见 [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md)。
|
|
27
|
+
|
|
28
|
+
## 0.2.0 - 2026-08-28
|
|
29
|
+
|
|
30
|
+
### 新增
|
|
31
|
+
|
|
32
|
+
- **按会话 cwd 归因证据。** 当 shell 工具未提供 `workdir` 时,证据会归因到会话 cwd,使相对路径操作和无路径检查能够匹配实际运行所在的仓库。
|
|
33
|
+
- **在不扩大信任边界的前提下支持更多检查。** 字面量 `2>&1`、选定的只读检查命令和白名单 PowerShell 外部命令现在可以产生可认证证据;复合命令、变量、文件目标重定向、in-place `sed` 和非白名单可执行文件仍不支持。
|
|
34
|
+
- **过程动作和诊断结果可认证。** 拉取、安装、提交、推送、发布和重启等动作映射到 run 证据;`python -m unittest`、`doctest` 和 `pytest` 的确定性检查会被识别。被拒的 checkpoint 绑定现在提供可执行提示;DSH 提供结构化退出信息时,Guard 会优先使用这些信息。
|
|
35
|
+
- **长会话恢复更清晰。** 信息性回执不再变成意外任务,`--help` 被视为检查说明而不是通过的验证,超长恢复包会安全折叠,同时暴露证据的 `outcome` 和 `capabilities`。
|
|
36
|
+
|
|
37
|
+
### 变更
|
|
38
|
+
|
|
39
|
+
- 命令面集中由一个随包发布的 manifest 定义并自校验,并针对真实复合 shell 工作流保留回归测试。解析继续 fail-closed:无法支持或只能部分理解的语法不会产生可认证的 executable 或 operation。
|
|
40
|
+
|
|
41
|
+
支持语法见 [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md),发布证据和平台边界见 [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md)。
|
|
42
|
+
|
|
43
|
+
## 0.1.2 - 2026-08-27
|
|
44
|
+
|
|
45
|
+
### 修复
|
|
46
|
+
|
|
47
|
+
- 干净成功协议现在覆盖 persistent shell 渲染器的完整终端词汇表:`[shell exited: code N]`、`[shell killed by signal: S]`、`[shell exited]` 以及 persistent 超时报告(`Your command timed out after N seconds or experienced an OOM error. Below is partial output:`)在被其散文重置行(`The persistent bash shell was reset; ...`)包裹时也会被识别为终端事实,不再被误判为干净成功。仅回显重置散文的干净结果仍视为成功;0.1.1 会话渲染器标记保持不变。
|
|
48
|
+
|
|
49
|
+
## 0.1.1 - 2026-08-27
|
|
50
|
+
|
|
51
|
+
### 修复
|
|
52
|
+
|
|
53
|
+
- 对于固定 DSH 渲染器产生的前台 `bash` 完成结果,只要不存在 error、超时、沙箱拒绝、信号、中断或非零退出 marker,现在即可作为成功证据。后台执行和未经验证的通用 `shell` 别名仍然 fail-closed;不受支持的命令语法依旧不能认证合同。
|
|
54
|
+
|
|
55
|
+
## 0.1.0 - 2026-08-27
|
|
56
|
+
|
|
57
|
+
首个面向 DeepSeek Harness 的任务合同与完成认证插件版本。
|
|
58
|
+
|
|
59
|
+
### 新增
|
|
60
|
+
|
|
61
|
+
- 从用户直接消息中捕获 requirement、acceptance 和 prohibition,并为每项建立具体的验证对象与 surface。
|
|
62
|
+
- 只从已持久化的 `tool/call` 和 `tool/result` 事件派生有界证据,包括 capability、subject、surface 和摘要哈希。
|
|
63
|
+
- 采用 fail-closed 完成认证:空证据绑定、缺失或过期证据以及无关对象证据都会被拒绝。
|
|
64
|
+
- 增加 Goal 完成门禁:启用期间,`update_goal complete` 必须持有当前证书;同时增加带续做次数上限的回合停止门禁。
|
|
65
|
+
- 在 compaction 或 resume 后注入恢复信息。
|
|
66
|
+
|
|
67
|
+
### 变更
|
|
68
|
+
|
|
69
|
+
- 初始启用状态来自有效的 `activation` 配置;后续持久化 Guard 状态从 DSH 原生事件派生,包括 `command/run`、`user/message`、`tool/call` 和 `tool/result`。Context Guard 不再追加当前持久层无法重新加载的自定义 `context-guard/*` 事件,因此恢复受保护会话不再依赖上游事件注册接口。
|
|
70
|
+
- 捕获内容在持久化前会脱敏凭证、Bearer token 和 URL query string,与隐私合同保持一致。
|
|
71
|
+
- 退出码证据采用最后一个已记录 marker;回显的伪 `[exit code: 0]` 不能覆盖真实尾部失败,回显或后台运行的检查命令也不能充当确定性验证。
|
|
72
|
+
- 重放时重新验证证书:认证结果从重新派生的证据计算;无法再次成立的证书会把 projection 标记为 `corrupt` 并 fail-closed。
|
|
73
|
+
|
|
74
|
+
### 修复
|
|
75
|
+
|
|
76
|
+
- 同一扫描中捕获的两个 requirement 不再复用同一个 ID 和修订号;相同内容的再次陈述会在新修订中显式 supersede 旧条目。
|
|
77
|
+
- Guard 关闭时不再触发 Goal 完成门禁。
|
|
78
|
+
- 裸完成声明(如 `Done.`、`搞定了。`)会触发门禁;带后续行动意图的阶段性声明不再被当成整任务完成。
|
|
79
|
+
- Code Mode dispatch 的根调用 ID 会随证据保留,不再错误绑定到内部调用 ID。
|
|
80
|
+
|
|
81
|
+
### 发布材料
|
|
82
|
+
|
|
83
|
+
- 完整 Apache-2.0 许可证、CI workflow 和更新日志;npm 包包含 `docs/`。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# dsh-completion-guard
|
|
2
|
+
|
|
3
|
+
[简体中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
A task-contract and completion-certification plugin for DeepSeek Harness (DSH). It preserves requirements, prohibitions, acceptance criteria, later corrections, and bounded evidence so a task can be certified only when current successful evidence matches the current contract.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
Install the published plugin into a DSH Web profile:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
dsh plugin --profile web add dsh-completion-guard@0.2.1
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Restart DSH Web, open a session, and enable the guard:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
/context-guard on
|
|
19
|
+
/context-guard status
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
### Activation modes
|
|
25
|
+
|
|
26
|
+
`activation` accepts two values:
|
|
27
|
+
|
|
28
|
+
| Value | Behavior |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `opt-in` | Default. A session remains unprotected until `/context-guard on` is recorded in that session. |
|
|
31
|
+
| `always` | Starts enabled before the session log is replayed. `/context-guard off` disables the guard for that session until a later `/context-guard on`. |
|
|
32
|
+
|
|
33
|
+
To start Context Guard automatically for sessions in a DSH profile, add an ID-targeted override to that profile's `cordis.patch.yml`. For the default Web profile on macOS or Linux, this file is normally `~/.dsh/profiles/web/cordis.patch.yml`:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
- id: context-guard
|
|
37
|
+
name: dsh-completion-guard
|
|
38
|
+
config:
|
|
39
|
+
activation: always
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Restart that DSH profile after changing the configuration, then run `/context-guard status` in a session to confirm that the guard is enabled. Because `always` enables the guard before replay, applying it to a profile that already has persisted sessions can cause earlier user messages in those sessions to be captured when their logs are rebuilt. Use `opt-in` when protection should begin only after an explicit per-session command.
|
|
43
|
+
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
## What it protects
|
|
47
|
+
|
|
48
|
+
- Captures requirement, acceptance, and prohibition clauses with stable identities and append-only supersession.
|
|
49
|
+
- Derives bounded, redacted evidence from persisted DSH tool calls and results.
|
|
50
|
+
- Requires method, operation, subject, surface, and outcome to match where the contract makes them explicit.
|
|
51
|
+
- Re-verifies certificates when a session is rebuilt or resumed and fails closed on integrity loss.
|
|
52
|
+
- Blocks Goal completion and whole-task completion claims while enabled unless a current certificate exists.
|
|
53
|
+
|
|
54
|
+
## Status and compatibility
|
|
55
|
+
|
|
56
|
+
Version 0.2.1 is available from [npm](https://www.npmjs.com/package/dsh-completion-guard) and the [GitHub release](https://github.com/GreenLv/dsh-completion-guard/releases/tag/v0.2.1).
|
|
57
|
+
|
|
58
|
+
> 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`.
|
|
59
|
+
|
|
60
|
+
The 0.2.1 release suite contains 138 tests (105 domain/core). It attributes shell evidence to the session cwd when the tool omits `workdir`, supports literal `2>&1` diagnostics and read-only inspection commands, maps process verbs to run evidence, and exposes actionable hints when a checkpoint binding is rejected. 0.2.1 adds a session-layer capture filter so clarification questions, meta comments, and bare progression phrases (`继续`, `continue`) never become contract items; de-duplicates repeated recovery notifications; adds `/context-guard clear`; and documents how a goal completes when the guard is disabled or blocked. A macOS live Web run loaded the published profile package and certified a real `pnpm test` result; Windows 0.2.1 native acceptance is still pending.
|
|
61
|
+
|
|
62
|
+
Context Guard recognizes only a small, auditable shell and PowerShell command subset. Unsupported or ambiguous syntax stays incomplete instead of being partially trusted. Compound commands, variables, non-whitelisted executables, file-target redirects, and in-place `sed` remain outside the certifiable surface. See [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) for the exact grammar and platform evidence.
|
|
63
|
+
|
|
64
|
+
## Boundaries
|
|
65
|
+
|
|
66
|
+
Context Guard certifies completion; DSH still owns Goal, Todo, Compaction, continuation, permissions, and tool execution. This plugin is not a security sandbox, semantic proof system, token-pruning tool, or replacement for those DSH facilities.
|
|
67
|
+
|
|
68
|
+
Evidence is bounded and redacted. Complete prompts, stdout, file contents, credentials, Authorization headers, URL query values, image bytes, and raw transcripts are not stored by the guard. See [`docs/PRIVACY.md`](docs/PRIVACY.md).
|
|
69
|
+
|
|
70
|
+
## Relationship to Codex Context Guard
|
|
71
|
+
|
|
72
|
+
This project ports deterministic behavior from [`GreenLv/codex-context-guard`](https://github.com/GreenLv/codex-context-guard), with v0.8.8 as its semantic baseline. The two repositories serve different runtimes:
|
|
73
|
+
|
|
74
|
+
- `codex-context-guard` is the Codex Hook/Python implementation with Codex plugin-cache and Hook lifecycle integration.
|
|
75
|
+
- `dsh-completion-guard` is an independent TypeScript implementation over native DSH Session events, commands, tools, and agent lifecycle.
|
|
76
|
+
|
|
77
|
+
They do not share runtime state, installers, caches, or release histories. Fixes are contributed to the repository that owns the affected runtime and are ported deliberately when the same behavior belongs in both products. See [`docs/UPSTREAM_BASE.md`](docs/UPSTREAM_BASE.md) and [`docs/PORTING_NOTES.md`](docs/PORTING_NOTES.md) for the exact reused and replaced boundaries.
|
|
78
|
+
|
|
79
|
+
## Documentation
|
|
80
|
+
|
|
81
|
+
- [`CHANGELOG.md`](CHANGELOG.md) — versioned user-visible changes.
|
|
82
|
+
- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — ownership, durable state, and certification pipeline.
|
|
83
|
+
- [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) — supported DSH versions and certifiable command subset.
|
|
84
|
+
- [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md) — deterministic, isolated, native, and public-package validation scopes.
|
|
85
|
+
- [`docs/PRIVACY.md`](docs/PRIVACY.md) — stored facts, prohibited data, and failure behavior.
|
|
86
|
+
- [`docs/UPSTREAM_BASE.md`](docs/UPSTREAM_BASE.md) — semantic baseline and repository authority boundary.
|
|
87
|
+
- [`docs/PORTING_NOTES.md`](docs/PORTING_NOTES.md) — behavior retained from Codex and DSH-specific replacements.
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
pnpm install --frozen-lockfile
|
|
93
|
+
pnpm run typecheck
|
|
94
|
+
pnpm test
|
|
95
|
+
pnpm run lint
|
|
96
|
+
pnpm run build
|
|
97
|
+
pnpm run pack:check
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
These commands validate the source and package candidate. CI, native-platform acceptance, npm publication, GitHub release identity, and runtime-profile installation remain separate evidence scopes.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# dsh-completion-guard
|
|
2
|
+
|
|
3
|
+
[English](README.md)
|
|
4
|
+
|
|
5
|
+
面向 DeepSeek Harness(DSH)的任务合同与完成认证插件。它保存需求、禁止项、验收条件、后续修订和有界证据,只有当前成功证据与当前合同匹配时,任务才能获得完成认证。
|
|
6
|
+
|
|
7
|
+
## 快速开始
|
|
8
|
+
|
|
9
|
+
将已发布插件安装到 DSH Web profile:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
dsh plugin --profile web add dsh-completion-guard@0.2.1
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
重启 DSH Web,打开一个会话并启用 Guard:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
/context-guard on
|
|
19
|
+
/context-guard status
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
默认采用 opt-in。`status` 会返回启用状态、当前 epoch 和合同修订、待完成与已通过条目数量、证据数量及完整性状态;`off` 停止本会话的捕获和门禁,但保留已有历史;`clear` 在 `CLEAR:` 哨兵下使所有待完成的 requirement/acceptance 成为 superseded(保留 prohibition),从而让空绑定 checkpoint 也能在 Guard 保持开启的情况下签发证书;`diagnose` 返回有界的诊断信息。
|
|
23
|
+
|
|
24
|
+
### 启用模式
|
|
25
|
+
|
|
26
|
+
`activation` 支持两个值:
|
|
27
|
+
|
|
28
|
+
| 值 | 行为 |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `opt-in` | 默认值。只有本会话记录了 `/context-guard on` 后才开始保护。 |
|
|
31
|
+
| `always` | 在重放会话日志前就进入启用状态。`/context-guard off` 会关闭本会话的 Guard,直到后续再次执行 `/context-guard on`。 |
|
|
32
|
+
|
|
33
|
+
如需让 Context Guard 在某个 DSH profile 中自动启用,请在该 profile 的 `cordis.patch.yml` 中按插件 ID 增加配置覆盖。macOS 或 Linux 默认 Web profile 的文件通常位于 `~/.dsh/profiles/web/cordis.patch.yml`:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
- id: context-guard
|
|
37
|
+
name: dsh-completion-guard
|
|
38
|
+
config:
|
|
39
|
+
activation: always
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
修改后重启对应的 DSH profile,再在会话中执行 `/context-guard status`,确认 Guard 已启用。由于 `always` 会在日志重放前启用 Guard,把已有 profile 改为该模式后,已有会话在重建日志时也可能捕获更早的用户消息。如果只希望从明确的逐会话命令开始保护,请保留 `opt-in`。
|
|
43
|
+
|
|
44
|
+
启用后,Context Guard 从用户直接给出的要求和验收条件建立合同。工具结果只有在 DSH 持久化后才会成为可引用证据。模型在声称整个任务完成前,必须调用注入的 `context_guard_checkpoint` 工具并绑定匹配的证据 ID;不完整、过期或对象不匹配的绑定不能签发证书。
|
|
45
|
+
|
|
46
|
+
## 它保护什么
|
|
47
|
+
|
|
48
|
+
- 以稳定 ID 捕获 requirement、acceptance 和 prohibition,并通过 append-only supersession 保存后续修订。
|
|
49
|
+
- 只从 DSH 已持久化的工具调用与结果派生有界、脱敏的证据。
|
|
50
|
+
- 当合同明确指定时,同时匹配方法、操作、对象、surface 和结果状态。
|
|
51
|
+
- 在会话重建或恢复时重新验证证书,完整性丢失时 fail-closed。
|
|
52
|
+
- 启用期间,如果没有当前有效证书,就阻止 Goal 完成和整任务完成声明。
|
|
53
|
+
|
|
54
|
+
## 状态与兼容性
|
|
55
|
+
|
|
56
|
+
0.2.1 已发布到 [npm](https://www.npmjs.com/package/dsh-completion-guard) 和 [GitHub Release](https://github.com/GreenLv/dsh-completion-guard/releases/tag/v0.2.1)。
|
|
57
|
+
|
|
58
|
+
> 本项目于 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`。
|
|
59
|
+
|
|
60
|
+
0.2.1 版本测试共 138 项,其中 domain/core 105 项。它会在 shell 工具未提供 `workdir` 时使用会话 cwd 归因证据,支持字面量 `2>&1` 和只读检查命令,把过程动词映射为 run 证据,并在 checkpoint 绑定被拒时提供可执行提示。0.2.1 新增会话层捕获过滤,使澄清提问、元评论和纯推进语(`继续`、`continue`)不再成为合同条目;对重复恢复通知做内容去重;新增 `/context-guard clear`;并文档化在 Guard 关闭或阻塞时 goal 如何完成。macOS 真实 Web 会话已加载公开 profile 包并认证 `pnpm test` 结果;Windows 0.2.1 原生验收仍待完成。
|
|
61
|
+
|
|
62
|
+
Context Guard 只识别一小组可审计的 shell 与 PowerShell 命令。无法支持或存在歧义的语法会保持 incomplete,而不会被部分信任。复合命令、变量、非白名单可执行文件、文件目标重定向和 in-place `sed` 仍不在可认证范围内。精确语法和平台证据见 [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md)。
|
|
63
|
+
|
|
64
|
+
## 边界
|
|
65
|
+
|
|
66
|
+
Context Guard 负责完成认证;Goal、Todo、Compaction、continuation、权限和工具执行仍由 DSH 管理。它不是安全沙箱、语义证明系统、token pruning 工具,也不替代这些 DSH 能力。
|
|
67
|
+
|
|
68
|
+
证据采用有界存储和脱敏处理。Guard 不保存完整 prompt、stdout、文件内容、凭证、Authorization header、URL query value、图片字节或原始 transcript。详见 [`docs/PRIVACY.md`](docs/PRIVACY.md)。
|
|
69
|
+
|
|
70
|
+
## 与 Codex Context Guard 的关系
|
|
71
|
+
|
|
72
|
+
本项目从 [`GreenLv/codex-context-guard`](https://github.com/GreenLv/codex-context-guard) 迁移确定性行为,以 v0.8.8 作为语义基线,但两者服务于不同运行时:
|
|
73
|
+
|
|
74
|
+
- `codex-context-guard` 是面向 Codex Hook 的 Python 实现,负责 Codex 插件缓存和 Hook 生命周期接入。
|
|
75
|
+
- `dsh-completion-guard` 是独立的 TypeScript 实现,基于 DSH 原生 Session 事件、命令、工具和 Agent 生命周期工作。
|
|
76
|
+
|
|
77
|
+
两个项目不共享运行时状态、安装器、缓存或发布历史。修复应先进入拥有对应运行时的仓库;只有同一行为确实适用于两侧时,才显式迁移。具体复用与替换边界见 [`docs/UPSTREAM_BASE.md`](docs/UPSTREAM_BASE.md) 和 [`docs/PORTING_NOTES.md`](docs/PORTING_NOTES.md)。
|
|
78
|
+
|
|
79
|
+
## 文档
|
|
80
|
+
|
|
81
|
+
- [`CHANGELOG.zh-CN.md`](CHANGELOG.zh-CN.md) — 面向使用者的版本变化。
|
|
82
|
+
- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — 所有权、持久状态和认证管线。
|
|
83
|
+
- [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) — 支持的 DSH 版本和可认证命令子集。
|
|
84
|
+
- [`docs/LOCAL_ACCEPTANCE.md`](docs/LOCAL_ACCEPTANCE.md) — 确定性、隔离环境、原生平台和公开包验证范围。
|
|
85
|
+
- [`docs/PRIVACY.md`](docs/PRIVACY.md) — 保存的事实、禁止数据和失败行为。
|
|
86
|
+
- [`docs/UPSTREAM_BASE.md`](docs/UPSTREAM_BASE.md) — 语义基线与仓库权威边界。
|
|
87
|
+
- [`docs/PORTING_NOTES.md`](docs/PORTING_NOTES.md) — 从 Codex 保留的行为和 DSH 专属替换。
|
|
88
|
+
|
|
89
|
+
## 开发
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
pnpm install --frozen-lockfile
|
|
93
|
+
pnpm run typecheck
|
|
94
|
+
pnpm test
|
|
95
|
+
pnpm run lint
|
|
96
|
+
pnpm run build
|
|
97
|
+
pnpm run pack:check
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
这些命令验证源码和待打包内容。CI、原生平台验收、npm 发布、GitHub Release 身份和真实 profile 安装仍是相互独立的证据范围。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { $ as extractOperation, A as hasCurrentCertificate, B as UserInteractionKind, C as isVerifyingCapability, Ct as sha256, D as OperationVerbEntry, E as ManifestIssue, F as extractTextContent, G as CaptureScope, H as CheckpointResult, I as extractToolSubject, J as captureClause, K as ClassifiedClause, L as isDeterministicCheck, M as ToolResultInput, N as ToolSubject, O as validateManifest, P as evidenceFromPersistedToolResult, Q as extractMethod, R as withDurability, S as evidenceMatchesItem, St as sanitizeUrl, T as CommandSurfaceManifest, U as RejectedBinding, V as classifyUserInteraction, W as certifyCheckpoint, X as classifyClause, Y as captureItem, Z as extractArtifactPaths, _ as recoveryDigest, _t as createProjection, a as decideTurnStopping, at as DerivedEnvelope, b as bindingSatisfies, bt as normalizeClause, c as ParsedShell, ct as GuardCheckpoint, d as parsePwshCommand, dt as GuardItem, et as isInformationalMessage, f as parseShellCommand, ft as GuardItemKind, g as openItems, gt as VerificationContract, h as closingHint, ht as GuardProjection, i as classifyCompletionClaim, it as DeriveScope, j as ToolCallInput, k as goalCompletionDenial, l as ShellParseStatus, lt as GuardEvidence, m as RecoveryOptions, mt as GuardOperation, n as CompletionDisposition, nt as DeriveConfig, o as isWholeTaskCompletionClaim, ot as EvidenceBinding, p as DEFAULT_RECOVERY_CHAR_BUDGET, pt as GuardItemStatus, q as ClauseSegment, r as TurnStoppingDecision, rt as DeriveResult, s as latestAssistantText, st as EvidenceOutcome, t as supersedeItem, tt as segmentClauses, u as isRunExecutable, ut as GuardIntegrity, v as renderRecoveryPacket, vt as canonicalizePath, w as COMMAND_SURFACE_MANIFEST, x as evidenceCoverage, xt as sanitizeClauseText, y as EvidenceFacetCoverage, yt as digestStrings, z as deriveProjection } from "../index-Dk4SkQ8H.js";
|
|
2
|
+
export { COMMAND_SURFACE_MANIFEST, CaptureScope, CheckpointResult, ClassifiedClause, ClauseSegment, CommandSurfaceManifest, CompletionDisposition, DEFAULT_RECOVERY_CHAR_BUDGET, DeriveConfig, DeriveResult, DeriveScope, DerivedEnvelope, EvidenceBinding, EvidenceFacetCoverage, EvidenceOutcome, GuardCheckpoint, GuardEvidence, GuardIntegrity, GuardItem, GuardItemKind, GuardItemStatus, GuardOperation, GuardProjection, ManifestIssue, OperationVerbEntry, ParsedShell, RecoveryOptions, RejectedBinding, ShellParseStatus, ToolCallInput, ToolResultInput, ToolSubject, TurnStoppingDecision, UserInteractionKind, VerificationContract, bindingSatisfies, canonicalizePath, captureClause, captureItem, certifyCheckpoint, classifyClause, classifyCompletionClaim, classifyUserInteraction, closingHint, createProjection, decideTurnStopping, deriveProjection, digestStrings, evidenceCoverage, evidenceFromPersistedToolResult, evidenceMatchesItem, extractArtifactPaths, extractMethod, extractOperation, extractTextContent, extractToolSubject, goalCompletionDenial, hasCurrentCertificate, isDeterministicCheck, isInformationalMessage, isRunExecutable, isVerifyingCapability, isWholeTaskCompletionClaim, latestAssistantText, normalizeClause, openItems, parsePwshCommand, parseShellCommand, recoveryDigest, renderRecoveryPacket, sanitizeClauseText, sanitizeUrl, segmentClauses, sha256, supersedeItem, validateManifest, withDurability };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { A as classifyClause, B as normalizeClause, C as renderRecoveryPacket, D as isVerifyingCapability, E as evidenceMatchesItem, F as segmentClauses, H as sanitizeUrl, I as COMMAND_SURFACE_MANIFEST, L as validateManifest, M as extractMethod, N as extractOperation, O as captureClause, P as isInformationalMessage, R as canonicalizePath, S as recoveryDigest, T as evidenceCoverage, U as sha256, V as sanitizeClauseText, W as createProjection, _ as classifyUserInteraction, a as goalCompletionDenial, b as closingHint, c as supersedeItem, d as extractToolSubject, f as isDeterministicCheck, g as parseShellCommand, h as parsePwshCommand, i as latestAssistantText, j as extractArtifactPaths, k as captureItem, l as evidenceFromPersistedToolResult, m as isRunExecutable, n as decideTurnStopping, o as hasCurrentCertificate, p as withDurability, r as isWholeTaskCompletionClaim, s as deriveProjection, t as classifyCompletionClaim, u as extractTextContent, v as certifyCheckpoint, w as bindingSatisfies, x as openItems, y as DEFAULT_RECOVERY_CHAR_BUDGET, z as digestStrings } from "../domain-BN3_AuUr.js";
|
|
2
|
+
|
|
3
|
+
export { COMMAND_SURFACE_MANIFEST, DEFAULT_RECOVERY_CHAR_BUDGET, bindingSatisfies, canonicalizePath, captureClause, captureItem, certifyCheckpoint, classifyClause, classifyCompletionClaim, classifyUserInteraction, closingHint, createProjection, decideTurnStopping, deriveProjection, digestStrings, evidenceCoverage, evidenceFromPersistedToolResult, evidenceMatchesItem, extractArtifactPaths, extractMethod, extractOperation, extractTextContent, extractToolSubject, goalCompletionDenial, hasCurrentCertificate, isDeterministicCheck, isInformationalMessage, isRunExecutable, isVerifyingCapability, isWholeTaskCompletionClaim, latestAssistantText, normalizeClause, openItems, parsePwshCommand, parseShellCommand, recoveryDigest, renderRecoveryPacket, sanitizeClauseText, sanitizeUrl, segmentClauses, sha256, supersedeItem, validateManifest, withDurability };
|