yangyu666/dsh-jev-prune
Jev-judged context compaction for DeepSeek Harness: semantic tool-result pruning + deterministic receipt compaction
Project Overview项目介绍
dsh-jev-prune is a native Cordis plugin for DeepSeek Harness (MIT-licensed) that replaces DSH's built-in two-layer context compaction with TypeSafe Jev structured judgments. At the first interception point, ctx.toolResultPruner.pruneSession, the plugin asks Jev's noul/choice endpoint, which returns calibrated probabilities, whether each tool result is still needed; needed results are never trimmed however large, stale ones are trimmed however small, and absence of a judgment falls back to DSH's original volumetric behaviour above minCharsToPrune. At the second layer, ctx.compaction.summarize and compactRegion, the plugin does not let the model rewrite history but moves whole read-only tool-call + tool/result pairs out of the surface and injects a deterministic receipt computed by the plugin's own code, listing tool name, command, path, character count and seq, while the original events stay verbatim in the session log.
Typical users are DSH operators running long agent sessions whose context budget keeps collapsing. Installation goes through cordis.patch.yml so the plugin is prepended ahead of the host's compaction-basic; once mounted, the /jev slash command reports runtime status, inspect_session.mjs audits multi-frame zstd JSONL session logs offline, verify_real_shapes.mjs regresses tool-name resolution against real logs, and wire_profile.mjs lets operators wire the plugin by hand on machines without pnpm. Probabilities are consumed as relative quantiles within a session rather than as a fixed cutoff, write-type tools are excluded by a hard rule, an evidence guard never moves results matching error/assert/fail/todo (and follows sourceEventSeqs when layer 1 has already trimmed), and the gate requires compactQuantile on both the result axis and the effect axis, balance of DSH's tool-pairing, savings of at least compactMinChars, and a receipt kept below receiptMaxRatio of the original tokens.
Dependencies and limits are concrete: Node ≥22.19, DSH 0.1.x-rc, and the plugin must replace the host's base bundle; CI only covers pure-function logic, takeover and the append protocol under a fake ctx, plus an integration check that the module loads against the real dependency tree with freezeMessage available, so live-host takeover and event-shape drift between rc versions must be verified with jev_probe_shapes in a real session. By default the plugin sends session history text, including file paths, code snippets and command output, to the TypeSafe API for judgment, so sensitive codebases need a self-hosted swap at the jev.js and state.js replacement points, and the runtime receipt/status strings ship in Chinese today while jev_* tool descriptions are already in English.
dsh-jev-prune 是一款面向 DeepSeek Harness 的原生 Cordis 插件(MIT),专门替换 DSH 内置的两层上下文压缩决策:第一层 ctx.toolResultPruner.pruneSession 改为由 TypeSafe Jev 的结构化输出(noul/choice,含校准概率)逐条判断工具结果是否仍被需要,需要的永不裁剪、过期的即便很短也会裁剪、无判定时回退到 DSH 原生行为;第二层 ctx.compaction.summarize + compactRegion 不再让模型改写历史,而是把只读探测整对移出,并注入由插件 JavaScript 代码生成的确定性回执(工具名、命令、路径、字符数、seq),不含任何模型推断,原文按 seq 完整保存在会话日志中。
典型工作流面向长会话场景下的 DSH 用户:通过 cordis.patch.yml 安装并叠加在宿主 bundle 之上,prepend 在 compaction-basic 之前生效;用户可借 /jev 查看状态、用 inspect_session.mjs 离线审计多帧 zstd JSONL 日志、用 verify_real_shapes.mjs 回归工具名解析、用 wire_profile.mjs 在无 pnpm 机器上手动接线。判定采用 session 内相对分位数而非固定阈值,写类型工具被硬规则排除,证据守卫会扫描原始事件避免误压错误与断言,阈值含 compactMinChars、receiptMaxRatio、compactPreserveRecent、neverCompactTools 等。
依赖与限制:Node ≥22.19、DSH 0.1.x-rc、需替换 base bundle(CI 不覆盖真实宿主内的 service takeover 与 rc 版本间 event shape 漂移,须用 jev_probe_shapes 在真实会话中验证)。插件默认将含文件路径、代码片段与命令输出的会话文本发往 TypeSafe API 做判定,处理敏感代码前需自评;如数据不可出本机,可将 jev.js 与 state.js 替换为自托管模型,回执文案目前为中文,运行时常量以代码生成为准。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-jev-prune(yangyu666/dsh-jev-prune)
仓库:https://github.com/yangyu666/dsh-jev-prune
本站详情页:https://www.yhbd.top/plugins/yangyu666-dsh-jev-prune/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 4 · 最近提交 2026-09-28 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【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 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
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:yangyu666/dsh-jev-prune
把 yangyu666/dsh-jev-prune 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-jev-prune

Jev-judged context compaction for DeepSeek Harness. Structured judgments from TypeSafe Jev drive DSH's two-layer context compaction. The compaction algorithms are untouched; the judgment backend is pluggable (Jev / rules / a self-hosted model).
English · 简体中文
The problem it solves
DSH's built-in context reclamation is purely volumetric. Once a tool result crosses a size threshold, its middle is chopped out and the head and tail are kept; region compaction, meanwhile, has the model write a summary to stand in for old history. The first approach cannot tell "this result is large but I still need it" from "this one is spent", and the second one invites summary hallucination.
This plugin replaces the decision in both places with Jev's structured output (noul / choice, returning calibrated probabilities), under one design rule:
What should not be generated by a model is not generated by a model. Trimming only ever decides keep or discard; the original text is preserved verbatim. Region compaction injects a deterministic receipt produced by code, containing no model inference at all.
The two layers

| Layer | Interception point | DSH default | This plugin |
|---|---|---|---|
| 1 · Result trimming | ctx.toolResultPruner.pruneSession |
Chops the middle once thresholdChars is exceeded |
Jev decides, per tool result, whether it will still be needed. Needed ones are never trimmed, however large; stale ones are trimmed however small (unless shorter than minCharsToPrune); with no judgment available it falls back to DSH's original behaviour |
| 2 · Receipt compaction | ctx.compaction.summarize + compactRegion, or a single-result surface replacement for mixed batches |
The model reads the raw history and writes a summary | Moves fully eligible read-only steps out of the surface. In a parallel batch where only some results qualify, it keeps every call/result envelope and replaces only the eligible result bodies with deterministic receipts. Tool name, command, path, character count and seq are all computed by code |
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