DeepSeek Harness Hub
← 返回列表

失败复盘助手zzh-newlearner/dsh-postmortem

DeepSeek Harnessspec-screened在 GitHub 查看 ↗
未验证

读取失败会话事件,生成脱敏恢复计划与排查路线

尚未跑自动兼容性验证,可查看页面内的依赖与入口分析。 · 最近上游提交 2026/9/6 · 已提供中文文档

在本地解释失败的 DeepSeek Harness agent 运行,然后生成一份经过脱敏的恢复计划。无需模型。

综合分
29.7
GitHub 分
29.7
用户评分
★ Stars
1
周下载量
安装插件(需先安装 dsh CLI 引擎:npm install -g @deepseek-ai/dsh)
dsh plugin --profile web add zzh-newlearner/dsh-postmortem
该插件未发布到 npm,走 GitHub 源安装(pnpm 若拦截 prepare 脚本,按其提示在 pnpm-workspace.yaml 的 allowBuilds 中放行后重跑)
数据截至 2026/9/16(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh-agent@deepseek-ai/dsh-agent-loop@deepseek-ai/dsh-agent-loop-testkit@deepseek-ai/dsh-commands@deepseek-ai/dsh-llm@deepseek-ai/dsh-session
用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动

README

DSH Postmortem / DSH 事后复盘

Turn a failed DeepSeek Harness run into a redacted recovery plan in seconds. Local-first, read-only, and useful without a model.

在几秒内把失败的 DeepSeek Harness 运行转成脱敏的恢复计划。本地优先、只读,且无需模型即可使用。

dsh-postmortem reads the DSH session events you already have and answers the practical question after a failed run: what failed, what evidence supports it, and what should be checked before the next attempt?

dsh-postmortem 读取已有的 DSH session 事件,在失败后回答三个实际问题:哪里失败、证据是什么、下一次尝试前应检查什么。

See It Work / 立即查看效果

After a failed run, use /postmortem:

任务失败后,执行 /postmortem:

Postmortem: 2 finding(s) in turn 1.
- [error] step 1: Tool shell failed. Check that the requested executable or resource exists before retrying this action.
- [error] step 1: Turn ended with error. Use the earlier tool findings as the first recovery target; do not treat the terminal state as a root cause.

Then use /postmortem-next for one concise route: the primary issue, the first verification, and the right fresh-attempt command for the current DSH runtime. It does not treat an agent's completion text as task success.

随后执行 /postmortem-next 获取一条简洁路线:主问题、第一项验证,以及适合当前 DSH runtime 的新尝试命令。它不会把 agent 的完成文本当作任务成功。

When DSH has an agent runtime, /postmortem-recover turns the redacted handoff into one fresh, lineage-linked DSH session. It never seeds the failed transcript into the new agent. /postmortem-recovery shows local execution state for that attempt. A completed agent turn is deliberately reported as execution completion, not task success: the task's existing CI, command, or verifier remains the source of truth.

当 DSH 提供 agent runtime 时,/postmortem-recover 会将脱敏交接创建为一个新的、带血缘关系的 DSH session;失败 transcript 不会作为 seed 传入新 agent。/postmortem-recovery 用于查看该尝试的本地执行状态。agent turn 完成只表示执行完成,并不等同于任务成功;项目现有的 CI、命令或验证器仍是任务成功的唯一依据。

Use /postmortem-plan when a runner needs the same advice as strict, redacted JSON: every action includes its evidence category, an advisory action, and a verification step. Plans are copy-only and are never executed by this package.

当外部 runner 需要严格、脱敏的 JSON 建议时,使用 /postmortem-plan。每项动作都包含证据类别、建议动作与验证步骤;计划仅供复制,本包永不执行它们。

The output contains no user messages, tool arguments, tool output, files, prompts, credentials, or raw traces. Run the same redacted demonstration locally with npm run build && npm run demo.

输出不包含用户消息、工具参数、工具输出、文件、提示词、凭据或原始轨迹。可通过 npm run build && npm run demo 在本地运行同一脱敏演示。

Install In 60 Seconds / 60 秒安装

dsh plugin --profile  add @huichangzz/dsh-postmortem

This installs the package into the selected DSH profile and registers its bundle layer automatically. Restart that profile, then run /postmortem after a failed turn. No manual Loader entry is needed.

这会将包安装到选定的 DSH profile,并自动注册它的 bundle 层。重启该 profile 后,在失败 turn 后执行 /postmortem。无需手动添加 Loader 条目。

To enable the optional model review, add this override to that profile's cordis.patch.yml:
若要启用可选的模型复盘,将下列覆盖项加入该 profile 的 cordis.patch.yml:

- id: postmortem
config:
model:
enabled: true
provider: your-provider
model: your-model
timeoutMs: 10000

autoOnFailure 默认值为 detected:只打印可行动的已检测故障,不打印普通完成或用户取消。噪声较多的开发场景可设为 false;设为 all 可保留旧版对每个未完成轮次的日志。本包不配置也不存储任何密钥。可选模型层复用 DSH 已配置的 llm 服务;即使模型缓慢、不可用或返回无效内容,确定性报告仍然可用。

你会得到什么

| 失败场景 | 复盘结果 |
| --- | --- |
| 工具返回错误 | 失败步骤、工具名、错误码与重试前的具体检查。 |
| 同一调用反复失败 | 通过单向参数指纹识别三次及以上未变更失败。 |
| 轮次异常结束 | 将终止状态与更早的因果证据区分开。 |
| 用户主动终止 | 报告取消,不杜撰可修复的 agent 故障。 |

命令

| 命令 | 用途 |
| --- | --- |
| /postmortem [turn\|from-to\|--last-failed] | 查看最新、指定、范围或最近失败轮次;首行会区分开放轮次的实时状态与已结束轮次。 |
| /postmortem-next [turn\|--last-failed] | 显示主问题、首个验证步骤,以及一条安全的下一步命令。 |
| /postmortem-plan [turn\|from-to\|--last-failed] | 导出带验证步骤的 schema-v1 仅复制修复动作。 |
| /postmortem-repair [turn\|from-to\|--last-failed] | 复制用于新 agent 尝试的受限恢复提示,不能粘贴进仍在运行的 session。 |
| /postmortem-handoff [turn\|--last-failed] | 为新的 DSH 恢复 session 导出一份脱敏 schema-v1 交接包。 |
| /postmortem-recover [turn\|--last-failed] | 显式基于脱敏交接创建一个新的、带父 session 关系的 DSH agent。 |
| /postmortem-recovery | 查看当前恢复 session 的执行状态;不会声称任务已成功。 |
| /postmortem-export [turn\|from-to\|--last-failed] | 导出脱敏 schema-v2 报告或范围封装,用于提交 issue 或评测。 |
| /postmortem-feedback [turn\|from-to\|--last-failed] | 生成含插件版本与报告的脱敏 issue 模板;不会上传或复制数据。 |

命令使用 recordInput: false:选择历史轮次不会进入 session event log。文本报告最多显示四条 finding,截断时会明确提示完整导出;结构化计划保留全部 finding。/postmortem-next、修复、交接与反馈只返回文本或 JSON。/postmortem-recover 需要显式调用:它从脱敏交接创建一个带父 session 关系的新 agent,绝不会重试或向失败 session 注入内容。

当 DSH 已调度 provider 重试时,/postmortem 会立即返回本地状态,无需等待 turn 终止。它仅保留重试次数、步骤、延迟、模式、有限重试预算和错误码;provider 细节与失败消息都会被丢弃。该实时状态不会调用可选复盘模型,也不会生成 repair prompt。

适合什么,不做什么

它面向需要在 agent 运行失败后获得安全下一步动作的 DSH 用户,是故障解释与恢复规划插件。它可以创建一次显式的新恢复尝试,但任务级成功仍由项目自己的验证器判定。

兼容性目标为 DSH 0.1.1-rc.2 与 Cordis 4.0.1。DSH 仍处于 developer preview;本插件以公开 session event 词汇表作为兼容性边界。

headless collector 可能降级 tool/call 字段。只有非空 callId 能跨事件合并;ID 为空时,每个调用仍独立保留,且同一 DSH step 的空 ID result 会按 FIFO 配对。规范 assistant/message 中的 tool-call block 可补回元数据;否则只会在命令首 token 通过严格白名单时显示它(例如 cat),其余显示为 unknown tool。重试分组只会在仍有可执行输入时忽略 description 等展示性字段;未知工具绝不会被猜成重试环。

隐私与可靠性
本地规则识别失败工具、已结束轮次中的缺失结果、未变更重试、终止原因与用户取消。报告仅保留轮次号、步骤、工具名、不透明 call ID、错误码和事件序号。原始消息、参数、输出、文件、提示词、凭据与 session trace 永不保留或导出。

可选模型复盘最多接收四条脱敏 finding,输出上限为 240 token,默认超时为 10 秒。它只能选择已有 finding,且必须返回严格 JSON;无效、超时或不可用的输出会被丢弃。

有价值的反馈

最能推动插件改进的是一份真实但脱敏的诊断:它错误、不完整,或没有帮助。请通过 issue 提交导出的报告、DSH/插件版本与预期结果;表单明确禁止提交密钥和原始轨迹。

评测与证据

本包包含 24 条版本化 seed 记录:15 条由公开 DSH dsh-v0.1.1-rc.2 snapshot 或测试 fixture 脱敏派生,9 条依据公开 session event 词汇表构造。每条记录都包含来源路径、revision、MIT 许可证与获取日期。来源和脱敏策略见 datasets/README.md。

Seed 标签用于防止确定性 parser 与规则回归,不能作为 precision、recall、模型质量或任务成功率提升的结论。这些结论需要双人审阅或裁决的人工留出集标签,以及配对 runner 评测。已发布 标注、裁决、配对运行 与 修复计划 schema。
datasets/synthetic-paired-v1 是配对评测器的透明合成 fixture。运行 npm run eval:paired 可验证匹配、排除、胜出、平局与失败。其数值输出刻意不是产品成功率指标;只有预注册、匹配的 DSH 任务重放才能支持该结论。

若要声明任务成功率提升,请使用 evaluateVerifiedPairs() 和 严格配对 schema。除非两臂共享 protocol ID、任务指纹、环境指纹和成功判据指纹,否则评测器会排除该配对;baseline 不得有干预,postmortem 臂必须标识修复计划指纹。运行 npm run eval:verified 可查看合成负对照。它检查实验完整性,而不验证任务 runner 本身是否正确。

当成功判据可执行时,该任务成功率指标不需要人工标注,例如测试命令退出状态、checker 结果或确定性的产物断言。应在运行两臂前记录验证器及其指纹,保持工作区与任务输入匹配;除非外部判据通过,否则 agent 的完成文本始终视为未验证。

若要进行 OpenAI-compatible 模型协议 smoke test,可使用下面只发送脱敏 finding 的 runner。它会预检模型、公平轮转任务,并在首个 429 后打开限流熔断。

POSTMORTEM_EVAL_BASE_URL=https://api.example.com/v1 \
POSTMORTEM_EVAL_API_KEY=your-key \
POSTMORTEM_EVAL_MODELS=model-a,model-b \
npm run eval:models

开发

npm install
npm run typecheck
npm test
npm run build
npm run demo
npm run selfcheck:dsh
npm run selfcheck:recovery
npm run selfcheck:recovery-agent
npm run eval:paired
npm run eval:verified
npm pack --dry-run

npm run selfcheck:dsh 通过 DSH 真实的 session、command 与 LLM 服务执行构建产物,验证五个用户命令、工具输入输出脱敏与不注入边界,不调用模型或工具。
npm run selfcheck:recovery 通过真实 DSH 的 session 与 command 服务执行构建产物的恢复命令路径,验证脱敏交接、仅显式创建边界,以及无 agent runtime 时的安全错误;不调用模型或工具。

npm run selfcheck:recovery-agent 使用无密钥测试适配器运行具体 DSH AgentLoop,验证恢复引导、新 session 血缘、脱敏交接与完成后的恢复状态。

回归套件还会重放降级的 headless 事件:空调用不能塌缩,规范 assistant block 必须补回匹配元数据,只有结果的 ID 仍可见,重新生成的描述不能拆散同一可执行重试。发布验收还应运行 DSH 官方无凭据 headless 端到端 fixture,它会以 mock 模型驱动真实 Loader、持久化 SessionEvent 流和本地 bash 工具。

许可证

MIT

上游仓库有新提交时邮件通知你(每天最多一封,无更新不打扰),随时一键退订。

💬 加入 DPharness 群聊

插件用法、部署报错、新插件第一时间同步——群里问,比一个人翻文档快。

点击加入 QQ 群
DPharness 群聊二维码,手机 QQ 扫码进群
扫码进群