前言¶
在 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_inspect 和 dsh_audit_bundle_verify。這些工具會 dereference pinned evidence,並可寫 content-addressed index。
Companion stdio MCP server 通過 .mcp.json 註冊 audit_bundle_inspect 和 audit_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