dsh-audit-bundle:为 DeepSeek Harness 证据生成内容寻址审计索引

前言

在 DeepSeek Harness 的插件化流程里,证据通常由不同的 evidence producer 生成。已有做法可以分别产出证据,但还需要一个小的验证层:确认某个 subject ID 和 revision 是否有足够、符合类型要求且来自独立 producer 的固定 JSON 证据,覆盖 manifest 中声明的 controls。

dsh-audit-bundle 提供这个验证层。它不是 SBOM scanner、signer、audit logger、policy engine 或 archive,而是围绕显式 manifest 做 closed verification,并输出内容寻址的 JSON 索引。

这是什么

dongsheng123132/dsh-audit-bundle 是 MIT 许可的 DeepSeek Harness 插件,用于跨独立 DSH evidence producers 建立 content-addressed audit indexes。它要求 Node.js 22 or newer。

一句话定位:给定一份声明了 subject ID、revision、required controls、固定 JSON 证据和 value-hash assertions 的 manifest,它检查证据是否足够且一致,并生成可复核的审计索引。

核心能力

1. 用显式 manifest 声明审计对象

manifest 声明以下内容:

  • 一个 subject ID;
  • 一个 revision;
  • required controls;
  • 用 SHA-256 固定的 evidence files;
  • 用 JSON Pointers 把 evidence file 绑定到 subject 和 revision;
  • value-hash assertions。

2. 验证失败时 fail closed

以下情况会导致验证失败:

  • missing、stale 或 invalid JSON evidence;
  • subject/revision mismatch;
  • failed assertions;
  • disallowed types;
  • insufficient evidence;
  • insufficient independent producers。

3. 输出可复核的索引

输出包含 IDs、types、producers、JSON paths、hashes、statuses、coverage,以及一个 deterministic SHA-256 pair-tree Merkle root。

4. 暴露 DSH 工具和 MCP 服务

DSH bundle 注册 dsh_audit_bundle_inspectdsh_audit_bundle_verify。这些工具会 dereference pinned evidence,并可写 content-addressed index。

Companion stdio MCP server 通过 .mcp.json 注册 audit_bundle_inspectaudit_bundle_verify。它只接受 inline manifest 和 structural JSONL receipts。MCP 不读取文件、不 dereference evidence、不执行动作、不写 artifacts,并报告 evidenceContentVerification: not-performed

安装与启用

先确认运行环境满足 Node.js 22 or newer。下面以 audit-bundle 作为 profile 名称启用插件:

dsh plugin --profile audit-bundle add github:dongsheng123132/dsh-audit-bundle#<commit>

启用后查看当前 profile 配置:

dsh --profile audit-bundle --dump-config

这一步用于确认插件已经出现在该 profile 的配置中。

典型用法

1. 只检查 manifest 和固定证据

示例使用 examples/basic workspace:

node bin/dsh-audit-bundle.mjs inspect --workspace examples/basic --manifest audit.manifest.json

该命令检查指定 workspace 中 manifest 声明的固定 JSON 证据,并输出一个 JSON object。

2. 验证并写入 content-addressed index

node bin/dsh-audit-bundle.mjs verify --workspace examples/basic --manifest audit.manifest.json --artifactDir artifacts

该命令 dereference pinned evidence,在显式指定的 artifactDir 下写入 content-addressed JSON index,随后执行 read-back verification。

退出码如下:

  • 审计验证失败:2
  • 用法无效:1

3. 文件边界

证据文件必须是 workspace-relative regular files。以下情况会被拒绝:

  • symlinks
  • path escape
  • oversized input
  • excessive structure

适用场景与注意

适合使用它的场景:需要证明某个特定 subject/revision 是否有足够、符合类型要求且来自独立 producer 的固定 JSON 证据,覆盖 manifest 声明的 controls。

不适合把它当以下工具使用:

  • SBOM scanner
  • signer
  • audit logger
  • policy engine
  • archive

插件以当前 dsh 进程权限运行,安装前应先检查源码与许可证。本插件许可证为 MIT。

MCP 服务只接受 inline manifest 和 structural JSONL receipts,不进行真实 evidence-content verification。需要做真实证据内容验证时,使用 DSH 工具或 CLI。

插件不做网络调用,不启动子进程;除在显式 artifactDir 下写入 content-addressed JSON index 外,不进行其他写入。

短结尾

dsh-audit-bundle 的价值在于把“证据是否足够、是否一致、是否来自允许的独立 producer”变成一次可复核的 closed verification,并输出带 Merkle root 的内容寻址索引。

目录页:DeepSeek Harness 社区目录(未随此处给出 URL,可按 dsh-audit-bundle 检索)
GitHub 仓库:https://github.com/dongsheng123132/dsh-audit-bundle

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜