前言¶
DSH 的插件机制把 profile、依赖声明和 bundle 组织成可组合的能力。实际维护 profile 时,常见的问题是:声明里写了什么依赖,pnpm lock 里锁了什么,安装的包 manifest 里又是什么,以及每个包声明的 dsh.bundle.patch 是否对得上。
dsh-profile-lock-proof 针对这个边界,生成一份内容寻址、机器可读的证明。它的范围比 SBOM、CVE 扫描、签名校验或安装器更窄:不执行包、不联网、不修改 profile,也不返回 manifest、lockfile、patch、脚本命令或 secret 内容。
这是什么¶
dsh-profile-lock-proof 是 dongsheng123132 维护的 DSH 插件,MIT 许可,要求 Node.js >=22,当前版本为 0.2.0。
它提供一组 CLI 命令和 DSH/MCP 工具,用于检查一份显式 proof manifest 所描述的 profile 依赖声明、pnpm lock importer、已安装包 manifests 和 dsh.bundle.patch 是否一致。
0.2.0 移除了 bundled DSH tool runtime,以及被 stock Cordis Loader 误分类的 default export;bundle 现在通过 namespace export 暴露 host-neutral tool definitions。
核心能力¶
证明内容¶
该插件生成机器可读证明,覆盖以下内容是否一致:
- DSH profile 依赖声明
- pnpm lock importer
- 已安装包 manifests
- 每个包声明的
dsh.bundle.patch
依赖 specifier 只接受 exact semver 或 github:owner/repo#<40-hex-commit>。
输入与失败策略¶
插件对输入证据采用 fail closed:
- 输入路径必须是 workspace-relative regular file,拒绝 traversal 和 symlinks。
- profile 和 lockfile 的 bytes 必须匹配显式 proof manifest 中的 SHA-256 值。
- 会检查 pnpm importer specifier、installed name/version/package hash、bundle patch path/hash,以及 lifecycle hooks 的缺失。
- 遇到 missing、stale、invalid、mutable、mismatched 或带有 lifecycle script 的证据,会失败。
输出与权限¶
证明输出只包含 identities、classifications、hashes、status 和 disclosure。报告会原子写入显式的 artifactDir,并读回验证。
插件不执行包、不访问网络、不修改 profile,也不返回 manifest、lockfile、patch、脚本命令或 secret 内容。
安装与启用¶
将插件安装到一个独立 profile,并固定 commit:
dsh plugin --profile profile-lock add github:dongsheng123132/dsh-profile-lock-proof#<commit>
<commit> 需要替换为要使用的 40 位 commit。安装前建议检查源码、许可证和入口文件;该插件以当前 dsh 进程权限运行。
典型用法¶
下面命令在 workspace 根目录检查一份 proof.json:
dsh-profile-lock-proof inspect --workspace . --manifest proof.json
inspect 用于 workspace proof checking。
dsh-profile-lock-proof verify --workspace . --manifest proof.json --artifactDir artifacts
verify 用于 verification,并允许把报告写入显式的 artifactDir。
退出码含义:
0:验证通过,得到 verified proof。2:verification 或输入失败。
MCP / DSH 工具¶
插件提供 DSH/MCP 工具:
dsh_profile_lock_inspectdsh_profile_lock_verify- MCP aliases:
profile_lock_inspect、profile_lock_verify
MCP 面权限更低:只接受 bounded inline evidence,不读也不写文件,并与 CLI 共享 validation core。DSH/CLI 面只能写入显式的 workspace-relative artifactDir,并且要求原子写入和读回验证。
本地自检¶
在插件源码仓库中,可以运行以下命令做本地验证:
npm ci
npm test
npm run check
npm run smoke:plugin
npm run smoke:mcp
npm run smoke:web-loader # requires DSH_CHECKOUT and isolated DSH_HOME
适用场景与注意¶
适合以下使用:
- 需要证明某个 DSH profile 的依赖声明、pnpm lock 和已安装包之间一致。
- 需要在不执行包、不联网、不返回敏感文件内容的前提下生成机器可读证明。
- 需要在 workspace 中用固定 commit 安装插件并复核 bundle patch。
需要注意的是:
- 它不是 SBOM、CVE scanner、signature verifier 或 installer,只覆盖上述一致性边界。
- 输入文件必须来自 workspace 内的 regular file;路径越界、symlink、可变更或内容不匹配都会 fail closed。
- 插件以当前
dsh进程权限运行,安装前应检查源码、许可证和工具行为。
相关链接¶
- GitHub:https://github.com/dongsheng123132/dsh-profile-lock-proof
- 插件线索目录页:https://www.skillhub.cn/plugins/dongsheng123132/dsh-profile-lock-proof(目录页内容未核实)