DeepSeek Harness · guide

What dsh-why is, and when to use it

Two ways dsh fails, two commands that answer them, and one rule that governs every answer: a blind spot is never turned into a red card.

dsh 有两种挂法,两个命令分别回答,以及贯穿所有答案的一条原则:绝不把盲区变成红牌。

What dsh-why isdsh-why 是什么

dsh (DeepSeek Harness) has two ways to fail, and they leave completely different evidence behind. dsh-why answers both, from local files, read-only.

  • npx dsh-whydsh will not start. A plugin's client bundle called require() on a module the shell does not provide, and the loader materialized the whole client plugin tree — so one plugin takes every plugin down. dsh-why reads your actual install and names the plugin, the module, and the fix.
  • npx dsh-why rundsh starts fine, but a run died. The turn is over, you have a symptom, and nothing said why. dsh-why reads your own session logs and turns turn/end.reason into a verdict — plus a health view that separates chronic noise from a real incident.

dsh(DeepSeek Harness)有两种挂法,留下的证据完全不同。dsh-why 两种都答,全部基于本地文件、只读。

  • npx dsh-whydsh 起不来。某个插件的 client bundle require() 了 shell 不提供的模块,而加载器会物化整棵客户端插件树——所以一个插件能把所有插件一起拖下水。dsh-why 读取你真实的安装,点名是哪个插件、哪个模块、怎么修。
  • npx dsh-why rundsh 起得来,但某次 run 挂了。turn 已经结束,你手上只有一个现象,没人告诉你为什么。dsh-why 读取你自己的会话日志,把 turn/end.reason 变成判定——再给一个健康视图,把长期噪声和真正的「事件」分开。

Which one do I run?我该跑哪一个?

What you seeRun this
dsh shows a red screen, a blank page, or will not bootnpx dsh-why
A run stopped, errored, or never finishednpx dsh-why run
You want to know whether your failures are normalnpx dsh-why run --all
You are about to publish a pluginnpx dsh-why --package .
You have an error string and no install handypaste it into the box on the home page
你看到的现象跑这个
dsh 红屏、白屏,或者根本起不来npx dsh-why
某次 run 停了、报错了,或者一直没结束npx dsh-why run
想知道自己的失败率算不算正常npx dsh-why run --all
马上要发布一个插件npx dsh-why --package .
手上只有一句报错,机器上没装 dsh粘进首页的输入框

The verdicts, and why some of them are deliberately vague判定档位,以及为什么有些档位故意说得很含糊

A diagnostic that guesses is worse than one that admits it does not know. Every dsh-why verdict lands on one of these, and a blind spot is never turned into a red card:

VerdictMeans
crashThe evidence is conclusive and something must change (exit 1).
conditionalThe specifier is a built-in graph row: it usually resolves, the ordering is not guaranteed. Not a crash — declaring it in dsh.client.external makes it certain.
stopped by youA deliberate abort. Never a failure, never a red card.
unclassifieddsh-why could not decide — the run was interrupted or the log is truncated, or a --package check read nothing. It says so, and never reports it as a pass (exit 3 for the gate).

That last row is the reason to trust the other three.

一个会猜的诊断工具,比一个承认自己不知道的更糟。dsh-why 的每个判定都落在这几档上,而且绝不把盲区变成红牌:

判定含义
crash证据确凿,必须改点什么(退出码 1)。
conditional该 specifier 是内置图行:通常能解析,但顺序不保证。不是崩溃——在 dsh.client.external 里声明它就变成确定的。
你主动停止主动中断。永远不算故障,永远不给红牌。
无法定性dsh-why 判不出来——run 被中断、日志被截断,或者 --package 什么都没读到。它会明说,绝不当作通过(门禁场景退出码 3)。

最后这一档,才是另外三档可信的理由。

What it can name when a run diesrun 挂掉时,它能定性的东西

The failure vocabulary is closed, which is what makes attribution possible at all. Across a measured corpus of 2,006 turns every failure carried one of these, and they split into two families that need opposite advice — the network family usually clears on its own, the configuration family never does:

失败词汇表是封闭的,而这是「能归因」这件事成立的前提。在一份 2,006 个 turn 的实测语料里,每一次失败都落在这几类上,而且分成两个需要相反建议的族——网络族通常会自己恢复,配置族永远不会:

If you publish a plugin如果你发布插件

dsh does not let your client bundle require() arbitrary npm packages — it resolves against a module table baked into each shell build. dsh ships several times a day. Nothing in your repo tells you when an upstream change would break yours, until your users do.

npx dsh-why --package . is that check, and it works as a CI gate:

npx dsh-why --package . && npm publish   # any non-zero must block the release

Exit 1 is a real crash. Exit 3 means it could not check at all — almost always an unbuilt checkout, since the client bundle is a build artifact. It is deliberately not 0: a gate that passes when it verified nothing is worse than no gate.

Field-tested against 13 popular published plugins: zero false positives, and no plugin was found broken. This gate is quiet on healthy plugins — it is a regression guard against upstream, not a cleanup tool.

Full integration guide: CI recipes, exit codes, and the seed-safe fix pattern →

dsh 不允许你的 client bundle 任意 require() npm 包——它只对照烘焙进每个 shell 构建的模块表解析。而 dsh 每天要发好几次。你的仓库里没有任何东西会告诉你:上游的某次改动会不会打挂你的插件——直到你的用户先撞上。

npx dsh-why --package . 就是这个检查,而且可以直接当 CI 门禁:

npx dsh-why --package . && npm publish   # 任何非 0 都必须拦住发版

退出码 1 是真的崩溃。退出码 3 表示根本没检查成——几乎总是仓库还没构建,因为 client bundle 是构建产物。它故意不是 0:一个什么都没验证却给通过的门禁,比没有门禁更糟。

对 13 个热门已发布插件做过实测:零误报,且没有发现任何一个真的坏。这个门禁在健康插件上是安静的——它是防上游的回归护栏,不是清理工具。

完整接入指南:CI 写法、退出码、以及 seed-safe 修法 →

What it will never do它永远不会做的事

  • Never modifies a file.It diagnoses. Fixing is yours, or your agent's — --prompt produces a paste-ready instruction.
  • Never uploads anything.No account, no telemetry, no session content leaves the machine. --offline skips even the read-only data fetches.
  • Never calls a model.Zero dependencies, no API key, no per-run cost. The whole rule base is local.
  • Never turns "I could not tell" into a failure.It reports it as unclassified and gives it a distinct exit code.
  • 永远不修改任何文件。它只做诊断。修是你的事,或者你的 agent 的事——--prompt 会产出一段可直接粘贴的指令。
  • 永远不上传任何东西。没有账号、没有遥测,会话内容不离开本机。--offline 连只读的数据抓取都跳过。
  • 永远不调用模型。零依赖、不需要 API key、没有按次成本。整套规则库都在本地。
  • 永远不把「我判不出来」变成失败。它报成「无法定性」,并给出一个独立的退出码。

CLI referenceCLI 参考

CommandWhat it does
npx dsh-whydiagnose the current install (loader failures)
npx dsh-why runattribute your latest run from its session log
npx dsh-why run --allfailure mix, your own baseline, and incident days
npx dsh-why --package .plugin-author pre-publish gate
npx dsh-why --error "…"diagnose a pasted error (or pipe via stdin)
npx dsh-why --offlinebundled rule base only, zero network
npx dsh-why --jsonmachine-readable report (CI / an LLM)
命令作用
npx dsh-why诊断当前安装(加载器失败)
npx dsh-why run从会话日志给最近一次 run 定性
npx dsh-why run --all失败构成、你自己的基线、异常日
npx dsh-why --package .插件作者发版门禁
npx dsh-why --error "…"诊断粘贴的报错(或管道输入)
npx dsh-why --offline仅用包内规则库,完全不联网
npx dsh-why --json机器可读输出(CI / 喂给 LLM)

Exit codes退出码

CodeMeaning
0nothing crash-level was found; for a run, no failed run in scope
1a crash-level finding — something will break
3the check could not be performed (--package only)
2usage error or an internal bug
含义
0没有崩溃级问题;run 场景下范围内无失败
1崩溃级问题——有东西会坏
3检查无法执行(仅 --package)
2用法错误或内部 bug

Where to go next接下来去哪