模型有个习惯,会悄悄毁掉文件。它们不想重打代码,就写一句 // ... existing code ...…
31.5/100
综合分
2
GitHub 星标
—
npm 周下载
—/5
用户评分
数据截至 2026/10/25 · 周下载取自 npm 全网(含 CI / 镜像),非本站安装数;综合分由星标、活跃度与兼容性检查合成。
安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add acus9345/dsh-block-placeholder-edits该包不可直接 npm 安装,改从 GitHub 源安装(明细见下方安装检查)
状态速览
判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态信任档位:需留意
是什么
dsh 原生插件 · security
安全吗
本站尚未对该插件做风险分级
暂未覆盖,不等同于无风险
还在维护吗
活跃:最近一次提交在 7 天前
档位由哪些信号合成
本站实装验证(真实安装 L4 覆盖全站;L5 为运行时冒烟或实机截图,覆盖范围小于 L4) · 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。 下方各区块是它的证据明细。
⚠︎ 实装验证未通过(unknown · 2026/10/30) ——可能是验证环境差异,装前建议到 GitHub 仓库确认最近更新与 issue。
社区实装还没有人打卡 · 装过的第一个就是你
安全扫描自动 · 静态分析源码v2.7.0🟢 扫描:未发现敏感能力尚无人工评估展开查看扫描说明与证据 ↓
安全扫描自动 · 静态分析源码
v2.7.0静态扫描未发现敏感能力:最多只发网络请求、读取自身元数据或只读文件,未发现执行命令、文件写入或敏感信息读取。
扫描于 2026/10/31(1 天前) · 范围 入口闭包 + 发布文件清单 · 来源 GitHub 仓库
静态扫描只反映源码中出现的调用,不构成安全背书;人工评估与自动扫描相互独立、互不覆盖。
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh@deepseek-ai/dsh-agent@deepseek-ai/dsh-fs@deepseek-ai/dsh-llm@deepseek-ai/dsh-session@deepseek-ai/dsh-tools@deepseek-ai/schemastery给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个
DeepSeek Harness 插件,拒绝那些用 // ... existing code ... 占位符删掉真实代码的编辑。
README
由 DeepSeek 最新模型翻译生成dsh-block-placeholder-edits
模型有个习惯,会悄悄毁掉文件。它们不想重打代码,就写一句 // ... existing code ... 顶替,而编辑工具照单全收。于是文件里原本四十行真实代码的位置,现在只剩一条注释。你只有等构建挂了才发现,更糟的是构建没挂。
这个 DeepSeek Harness 插件会在每次 write 和 edit 落地前检查。如果新文本用占位注释顶替代码,或者整文件写入丢掉大文件的大部分内容,调用会被拒绝,文件保持原样。模型会收到明确提示,指出是哪一行出了问题:
dsh-block-placeholder-edits blocked this edit to src/app.ts: the new text contains
placeholder comments that stand in for code instead of the code itself. Writing them
would delete whatever they replace.
line 2: // ... rest of the function unchanged
Fix: write out the full code in place of each placeholder, or use a smaller edit
展开完整文档(README 剩余 1 节)
dsh-block-placeholder-edits
模型有个习惯,会悄悄毁掉文件。它们不想重打代码,就写一句 // ... existing code ... 顶替,而编辑工具照单全收。于是文件里原本四十行真实代码的位置,现在只剩一条注释。你只有等构建挂了才发现,更糟的是构建没挂。
这个 DeepSeek Harness 插件会在每次 write 和 edit 落地前检查。如果新文本用占位注释顶替代码,或者整文件写入丢掉大文件的大部分内容,调用会被拒绝,文件保持原样。模型会收到明确提示,指出是哪一行出了问题:
dsh-block-placeholder-edits blocked this edit to src/app.ts: the new text contains
placeholder comments that stand in for code instead of the code itself. Writing them
would delete whatever they replace.
line 2: // ... rest of the function unchanged
Fix: write out the full code in place of each placeholder, or use a smaller edit
that replaces only the lines you are changing (old_string/new_string) so untouched
code stays as it is.
实际用下来,模型对这套反馈反应不错。它会改用范围更小的 edit,或者老老实实把代码写全。
安装
dsh plugin --profile web add dsh-block-placeholder-edits
这里用的是 web 配置档,也就是你用 dsh web 启动的浏览器界面。如果你用别的方式跑 DSH,就换成 headless(脚本和 CI)或 acp(编辑器集成)。每个配置档各管一份插件列表,所以用到的配置档都要加一遍。装完立即生效。卸载用 dsh plugin --profile web remove dsh-block-placeholder-edits。
从克隆安装
想试本地改动,就打包成 tarball 再装:
git clone https://github.com/acus9345/dsh-block-placeholder-edits
cd dsh-block-placeholder-edits
npm install
npm pack
dsh plugin --profile web add ./dsh-block-placeholder-edits-0.2.0.tgz
什么算占位符
指的是那些在谈论代码、而不是本身就是代码的注释,任何常见注释风格都算(//、#、/* /、、--、;、JSX 的 {/ /}):
// ... existing code ...
rest of the file unchanged
/ ... /
// keep the rest as is
// ... other methods
{/ ... /}
单独一行 ... 也算,但 Python、Markdown 这类 ... 有实际含义的文件除外。
普通注释可以通过,包括那些提到已有代码的注释。旧文本里本来就有的占位符也不算,所以文件里原本就带一个的话,插件不会去烦模型。
第二项检查针对整文件 write 调用。如果一个 40 行及以上的文件被替换成不到一半的行数,写入会被拒绝。这种模式几乎总是意味着模型凭记忆重写了文件,漏掉了一大块。定点编辑不受这项检查影响,新文件也不受影响。
模型确实想这么写的时候
有时候,删掉文件的大部分内容正是目的所在。模型会被告知:可以重复一次完全相同的调用以确认,第二次尝试就会放行。这样真正的重构不会卡住,但模型必须主动选择这么做。如果你更希望由人来决定,就设置 mode: ask。
配置
最简单的办法:打开 DSH 侧边栏里的 Plugins,点击 dsh-block-placeholder-edits,改好你想要的内容,然后按 Save。下一次工具调用就会生效,不用重启。
或者往 ~/.dsh/profiles/<profile>/cordis.patch.yml 里加一行,像下面这样;想对所有配置档生效,就加到 ~/.dsh/cordis.patch.yml。没写的键保持默认值。
- id: block-placeholder-edits
config:
mode: deny # or ask for an approval prompt
shrinkRatio: 0.5 # 0 turns the large-deletion check off
minLinesForShrink: 40 # files shorter than this are never shrink-checked
allowIdenticalRetry: true # false: a refusal is final
extraPatterns: [] # extra regexes for your own placeholder phrasing
ignore: ['docs/*'] # globs to skip entirely
开发
npm install
npm test # detector unit tests
npm run test:e2e # real dsh runs against a scripted local model, no API key needed
安装测试会运行 dsh plugin add,这需要 pnpm 在 PATH 里。
MIT 协议。作者 acus9345。欢迎在 issues 里反馈 bug 和想法。预览分享卡片长什么样 ↓
分享 · DeepSeek Harness Hub
acus9345/dsh-block-placeholder-edits
模型有个习惯,会悄悄毁掉文件。它们不想重打代码,就写一句 // ... existing code ...…
相关插件 · 安全 / 权限
智能体逆向工程morluto/rea
用智能体逆向工程任何东西,从应用行为到原生二进制。
★ 415,267已汉化DSH
73.3
智能体集群框架ruvnet/ruflo
面向 Claude Code 与 Codex 的智能体元基座meta-harness。
★ 80,414已汉化MCP
71.9
WorkBuddy 模型接入corrinehu/dsh-workbuddy-connect
2026 年 10 月 20 日起,WorkBuddy…
★ 1,604已汉化DSH
71.7
破甲一键通z91772524-ai/pojia-next
十五个 AI…
★ 967已汉化DSH
71.6
AI 代理虚拟终端strukto-ai/mirage
Mirage 是给 AI 智能体用的虚拟终端:一层 shell,统管数据、命令行和运行时。Unix…
★ 3,756已汉化DSH
70.8
Agent 操作层agentic-os-org/ANOLISA
ANOLISA(Agentic Nexus Operating Layer & Interface System Architecture)|智能体操作系统,带运行时、安全、可观测性,以及 Tokenless 响应压缩,降低 token 用量与成本。
★ 649已汉化DSH
70.7