DeepSHPlugins
dsh-dep-audit 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-dep-audit

生態與開發TypeScriptMIT

dsh 專案與 profile 的依賴供應鏈衛生審計:peer 範圍可解析性、壞 dist-tag 檢測(#2763 類)、過期/缺許可證/非登錄檔來源依賴與安裝版本漂移——CLI + agent 可呼叫 dep_audit 工具。

2 Starszoahdev 更新時間 2026-08-18
訪問 GitHub 倉庫
dsh-dep-audit 專案預覽

專案介紹

中文

dsh 專案與 profile 的依賴供應鏈衛生審計:peer 範圍可解析性、壞 dist-tag 檢測(#2763 類)、過期/缺許可證/非登錄檔來源依賴與安裝版本漂移——CLI + agent 可呼叫 dep_audit 工具。

English

Dependency supply-chain hygiene audit for dsh projects and profiles: peer-range resolvability, broken dist-tag detection (#2763 class), stale / missing-license / non-registry dependencies, and installed-vs-declared drift — CLI plus an agent-callable dep_audit tool.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
zoahdev
倉庫
zoahdev/dsh-dep-audit
GitHub Stars
2
Forks
0
開發語言
TypeScript
許可證
MIT
最近推送
2026-08-18
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

57/ 100
維護活躍
84
文件與實用資訊
100
生態關注度
14
安裝便捷訊號
80
專案宣告訊號
100

README 含完整安裝與使用說明;關注度尚低(2)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add github:zoahdev/dsh-dep-audit

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-dep-audit

npm

CI License: MIT dsh-plugin

Dependency supply-chain hygiene audit for DeepSeek Harness (dsh) projects and profiles.

It answers: “can I trust the dependency graph of this dsh plugin / profile?” — peer ranges that resolve to nothing, dist-tags that contradict declared ranges, stale or unlicensed dependencies, non-registry sources, and installed versions that silently drifted from what package.json declares.

Complements the rest of the zoahdev security suite:

ToolFocus
dsh-poison-guardmalware / obfuscation scan of plugin code
dsh-plugin-doctorpublish readiness: manifest/patch/build/pack/install
dsh-dep-auditdependency graph hygiene: resolvability, dist-tags, staleness, sources, licenses, drift

Install

dsh plugin add dsh-dep-audit

Or run it standalone without installing into dsh:

npx dsh-dep-audit .

Checks

CheckWhat it verifiesStatus when triggered
manifestpackage.json exists, parses, declares name / versionfail
peer-resolvableevery peerDependencies range matches at least one published version on the registryfail
dist-tagdist-tags.latest does not contradict a declared range (the broken-latest / ERESOLVE class, e.g. discussion #2763)warn
sourceaudited dependencies use registry specifiers, not git: / file: / link: / workspace:warn
licenseregistry dependencies declare a license in their latest published metadatawarn
freshnessregistry dependencies have a release within the last 365 days (configurable)warn
driftinstalled versions in node_modules satisfy the declared ranges (ERESOLVE / host-shadowing class)fail
outdatedinstalled versions are not behind the registry latestwarn

ok is true only when every check passes (no fail items). Warnings are real signals but not blockers.

CLI

dsh-dep-audit [dir] [options]

  --json               print the machine-readable report
  --offline            skip registry network calls
  --all                include devDependencies
  --registry <url>     npm registry base URL (default: NPM_CONFIG_REGISTRY or registry.npmjs.org)
  --stale-days <n>     warn when latest release is older than n days (default 365)
  --help               show help

Exit codes: 0 all pass, 1 at least one fail, 2 usage/IO error.

npx dsh-dep-audit . --json
npx dsh-dep-audit ~/.dsh/profiles/web --offline

In-harness usage (agent-callable)

After install, ask your dsh agent:

审计一下当前插件的依赖健康:dep_audit,目录指向项目根目录。
Run a dependency audit on this plugin: dep_audit with dir set to the project root.

The agent calls the dep_audit tool (dir, optional options), which returns a dsh-dep-audit/v1 report:

{
  "schema": "dsh-dep-audit/v1",
  "target": ".",
  "offline": false,
  "ok": true,
  "summary": { "total": 8, "pass": 8, "warn": 0, "fail": 0 },
  "checks": [ ... ]
}

Examples

Audit a profile without network access:

npx dsh-dep-audit ~/.dsh/profiles/web --offline

Gate CI on dependency hygiene:

- run: npx dsh-dep-audit .

Why it exists

  • pnpm can silently link an older RC into a plugin's peer slot; “loads fine” ≠ “matches the declared peer range”. drift turns that precondition into a checked fact.
  • The npm latest dist-tag can point at an old, broken build while next has the real release — dsh plugin add <name> then resolves something unexpected for everyone. dist-tag flags the contradiction before it bites (the discussion #2763 failure class).
  • A dependency whose latest release is years old, or that lacks a license, is a red flag in a supply chain that grows by thousands of plugins per week.
  • An unlicensed or stale dependency is not malware — that is poison-guard's job. This plugin is the “healthy diet” half of the supply-chain story.

Report envelope

Every check carries { id, status, title, detail, items }; items are { name, issue, level } with level: warn | fail. The schema version (dsh-dep-audit/v1) is stable and machine-readable for CI.

Development

pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm test:integration

CI runs the dsh-plugin-doctor preflight, unit tests, a packed-artifact integration that installs the real tarball and invokes the real dep_audit handler, and a fresh-profile dsh web boot smoke on Windows.

License

MIT © 2026 zoahdev


dsh-dep-audit(中文)

DeepSeek Harness(dsh)项目与 profile 的依赖供应链卫生审计。

回答一个具体问题:“这个 dsh 插件 / profile 的依赖图能信吗?” —— peer 范围在注册表上解析不到、dist-tag 与声明的范围互相矛盾、依赖长期不更新或没有许可证、用了 git/file/workspace 来源,以及安装版本与 package.json 声明悄悄漂移。

与 zoahdev 安全套件的分工:

工具定位
dsh-poison-guard插件代码的恶意/混淆扫描
dsh-plugin-doctor发布就绪:manifest/patch/build/pack/install
dsh-dep-audit依赖图卫生:可解析性、dist-tag、过期、来源、许可证、漂移

安装

dsh plugin add dsh-dep-audit

不装进 dsh 也能单独用:

npx dsh-dep-audit .

检查项

检查验证内容触发级别
manifestpackage.json 存在、可解析、有 name / versionfail
peer-resolvable每个 peerDependencies 范围在注册表上至少有一个已发布版本fail
dist-tagdist-tags.latest 不与声明范围矛盾(坏 latest / ERESOLVE 一类,见 讨论 #2763)warn
source依赖使用注册表来源,而非 git: / file: / link: / workspace:warn
license注册表依赖的最新元数据声明了许可证warn
freshness注册表依赖在 365 天内有新发布(可配置)warn
driftnode_modules 里的实际版本满足声明范围(ERESOLVE / 宿主遮蔽类)fail
outdated已安装版本不落后于注册表 latestwarn

只有所有检查都没有 fail 项时 ok 才为 true。warn 是真实信号,但不是硬阻塞。

CLI

dsh-dep-audit [dir] [options]

  --json               输出机器可读报告
  --offline            跳过注册表网络请求
  --all                把 devDependencies 也纳入审计
  --registry <url>     npm 注册表地址(默认 NPM_CONFIG_REGISTRY 或 registry.npmjs.org)
  --stale-days <n>     超过 n 天未发布即告警(默认 365)
  --help               帮助

退出码:0 全过,1 有 fail,2 用法/IO 错误。

npx dsh-dep-audit . --json
npx dsh-dep-audit ~/.dsh/profiles/web --offline

在 harness 内使用(agent 可调用)

装好后对 agent 说:

审计一下当前插件的依赖健康:dep_audit,目录指向项目根目录。

agent 会调用 dep_audit 工具(dir,可选 options),返回 dsh-dep-audit/v1 报告:

{
  "schema": "dsh-dep-audit/v1",
  "target": ".",
  "offline": false,
  "ok": true,
  "summary": { "total": 8, "pass": 8, "warn": 0, "fail": 0 },
  "checks": [ ... ]
}

为什么需要它

  • pnpm 可能把旧 RC 静默链进插件的 peer 槽;“能加载”≠“符合声明的 peer 范围”。drift 把这条前置条件变成可核验的事实。
  • npm 的 latest dist-tag 可能指向旧坏包,而 next 才是真版本——dsh plugin add <name> 会让所有人解析到意外结果。dist-tag 在踩坑前先标出矛盾(讨论 #2763 的失败类别)。
  • 最新版本几年没动、或没有许可证的依赖,在以每周千计增长的插件供应链里都是红旗。
  • 没许可证、长期不更新不等于恶意——那是 poison-guard 的事。本插件负责供应链“健康饮食”这一半。

报告结构

每个检查带 { id, status, title, detail, items };items 是 { name, issue, level },level 为 warn | fail。schema 版本 dsh-dep-audit/v1 稳定、可给 CI 解析。

开发

pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm test:integration

CI 跑 dsh-plugin-doctor 预检、单元测试、打包集成(真实安装 tarball 并调用真实 dep_audit handler)、以及 Windows 上全新 profile 的 dsh web 启动冒烟。

许可证

MIT © 2026 zoahdev

Related ecosystem tools

FAQ

  • How do I install? dsh plugin add dsh-dep-audit or run the CLI directly (see README).
  • Does it need an API key? No.
  • Is it read-only? Yes by default; any write/apply is an explicit flag.

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案