Ardig24/dsh-trajectory-ablation
Finds the actual cause of an agent failure by reconstructing, diffing, and ablating its context - a DeepSeek Harness plugin.
Project Overview项目介绍
dsh-trajectory-ablation is a trajectory-attribution debugging plugin built for the DeepSeek Harness (DSH) agent runtime, designed to locate the actual cause of a failure rather than accept the agent's self-explanation. It reconstructs the complete context the model saw before a chosen step, diffs that view against another step without making any model calls, and then proves causality by removing one block of context at a time and replaying the real model call k times; if the decision flips, that block is a cause, otherwise it is bystander context. Installation is performed by mounting it into the user's DSH profile through the cordis.patch.yml file at $DSH_HOME/cordis.patch.yml, adding an insert entry with id trajectory-ablation and name dsh-trajectory-ablation, followed by pnpm install inside the profile directory and a restart. Programmatic use is also supported, importing reconstructContext, diffContext, ablateStep, and screenForInteractions, where the first two need only a session event log and the latter two additionally need a live ctx.llm.
The typical workflow proceeds through four phases — reconstruct, diff, ablate, and screen for interactions — invoked from any DSH session as the slash commands /context-reconstruct, /context-diff, /ablate, and /ablate-interactions. The intended audience is DSH agent developers, prompt and context-debugging engineers, and teams maintaining multi-step toolchains who need verified causal evidence instead of plausible model self-narration. When /ablate reports that no single block is responsible, the developer should run /ablate-interactions to test whether two individually inert pieces jointly caused the decision; this step samples random subsets and applies delta-debugging to narrow down to the minimal responsible group, keeping cost linear rather than quadratic without guaranteeing every pair is found.
The plugin is released under the MIT license and depends on a Node.js plus pnpm environment; the npm run demo command runs the full pipeline against a scripted stale-README failure case without requiring an API key. Its main limitation is that every ablation replay is a real, billable model request, so /ablate and /ablate-interactions both refuse to proceed past an estimated 50 model calls unless the developer raises maxCalls or passes inf to disable the cap entirely. First-run caveats include completing pnpm install in the profile directory, following the cordis.patch.yml.example walkthrough, and restarting DeepSeek Harness so that the four slash commands become available inside sessions; build, type-check, and test commands are also exposed via npm run build, npm run typecheck, and npm test.
dsh-trajectory-ablation 是 DeepSeek Harness(DSH)的轨迹归因调试插件,专为定位智能体失败根因而设计。它通过重建模型在某步骤前看到的完整上下文、对两个步骤做无模型调用的差异比对,并对单块上下文逐项移除后真实回放模型调用 k 次来验证因果,还提供交互筛查步骤以处理两段上下文联合致因的组合情形。安装方式是在 DSH 配置目录的 $DSH_HOME/cordis.patch.yml 中挂载 id 为 trajectory-ablation、name 为 dsh-trajectory-ablation 的插件条目,然后在 profile 目录执行 pnpm install 并重启即可;亦支持程序化引入 reconstructContext、diffContext、ablateStep、screenForInteractions 等 API。
典型工作流分四步——重建、对比、归因、交互筛查——由用户在任意 DSH 会话中调用 /context-reconstruct、/context-diff、/ablate、/ablate-interactions 四条命令完成,目标用户为需要可验证因果证据而非模型自述的 DSH 智能体开发者、提示与上下文调试工程师,以及维护多步工具链团队。当 /ablate 未发现任何单块致因时,建议运行 /ablate-interactions 来排查组合作用。该插件以 MIT 协议开源,依赖 Node 与 pnpm 环境,npm run demo 脚本可在不接入真实模型与 API 密钥的前提下演示完整流水线。
主要限制在于:每次归因都是真实且计费的模型请求,因此 /ablate 与 /ablate-interactions 默认拒绝超过 50 次模型调用的估算,并在需要时通过 maxCalls 或 inf 参数放宽上限以避免意外开销;交互筛查采用随机子集采样而非穷举两两组合,因此保持线性成本但不一定能找出全部成对致因。使用前需在 profile 目录先完成 pnpm install,并按 cordis.patch.yml.example 的完整流程完成挂载,再重启 DSH 以使四条斜杠命令在会话中可用。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-trajectory-ablation(Ardig24/dsh-trajectory-ablation)
仓库:https://github.com/Ardig24/dsh-trajectory-ablation
本站详情页:https://www.yhbd.top/plugins/ardig24-dsh-trajectory-ablation/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-08-26 · 主语言 TypeScript · 未检测到 DSH 插件清单
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
- No DSH plugin manifest detected - it may only carry the dsh-plugin topic, so the install method must be confirmed on the spot未检测到 DSH 插件清单:可能只是打了 dsh-plugin 话题,安装方式要现场确认
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:Ardig24/dsh-trajectory-ablation
把 Ardig24/dsh-trajectory-ablation 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-trajectory-ablation
A debugger that finds the actual cause of an agent failure, instead of guessing.
A plugin for DeepSeek Harness that reconstructs exactly what your agent saw before a given step, diffs that against another step, and — most importantly — proves which piece of context actually caused a decision by removing it and replaying the same model call for real.
See trajectory-ablation.md for the full design rationale.
Why
When an agent does something wrong, most tools show you a transcript and let you guess, or ask the agent to explain itself — which is just the same model generating a plausible-sounding story about its own past decision, not a verified fact. This plugin replaces both with something checkable:
- Reconstruct — the exact, complete list of everything the model saw before a step, grouped by source. No model calls, just reading the log.
- Diff — what changed between two steps: added, removed, compressed, or reordered. No model calls.
- Ablate — remove one piece of context at a time and replay the model call for real, k times per piece. If removing something changes the decision, it's a cause. If it doesn't, it's bystander context.
- Interaction screen — for the case single-block ablation can't see: two pieces that are each individually inert but jointly cause the decision. Testing every pair is quadratic, so this instead samples a few random subsets, and when one flips the decision, narrows it down (delta-debugging) to the minimal responsible group. Won't find every such pair, but stays linear in cost instead of quadratic.
Install
Mount it in your DeepSeek Harness profile ($DSH_HOME/cordis.patch.yml):
- insert:
- id: trajectory-ablation
name: 'dsh-trajectory-ablation'
Then pnpm install in your profile directory and restart. See cordis.patch.yml.example for a fuller walkthrough.
Usage
Once mounted, four commands are available in any session:
/context-reconstruct <turn> <step> — what did the model see before this step?
/context-diff <turnA> <stepA> <turnB> <stepB> — what changed between two steps?
/ablate <turn> <step> [k] [maxCalls|inf] — which block actually caused this decision?
/ablate-interactions <turn> <step> [trials] [maxCalls|inf] — run this when /ablate finds nothing: is it a pair?
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
liangmianya/dsh-synapse
alaliqing/claude-paper
acryldev/acryl
omdsh-dev/dsh-annotation
Anionex/dsh-turn-rewind
Tyan66666/billion-context-dsh
qkycir-123/dsh-run2skill