🎓 DSH 插件运行时验证方法论:无 API Key 验证 waterfall 行为(实证 74 事件/12 waterfall) #462
qing3a
started this conversation in
Show and tell
Replies: 1 comment
|
更正上一条自荐中的包名:插件已发布到 npm,scope 从 @dsh-external 改为 @qing3a(个人 scope,发布权归 qing3a)。 npm 包(可直接安装)
安装: 运行验证成果(2026-08-14)
两个 ✅ 插件已收录进 Verified DSH Plugins 目录(判定站:只收录通过运行时验证的插件)。 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
背景:雷达的运行时验证空白
awesome-dsh-plugins 雷达显示:286 个插件里只有 5 个做过运行时测试,0 个通过。静态检查只能证明"插件能加载",证明不了"插件在真实 agent 循环里不破坏行为"——尤其是 waterfall 事件监听器(
tools/execute、approval/request、fs/write-intent)必须正确透传next(),否则静默吞掉下游默认行为,这类错误只在运行时暴露。传统做法需要真实 LLM API key + token 成本。这里分享一个零成本、可复制的方案:用 DSH 仓库自带的 mock-llm 服务器,无 key 验证插件在完整 agent 循环里的行为。
方案:mock-llm + headless profile + 审计 dump
三步核心命令(完整步骤见下文 + dsh-event-auditor 仓库):
1. 启动 mock-llm(让第一个请求返回"调用 bash 工具",第二个正常回复):
pnpm run mock:llm --port 8000 --api-key mock-key \ --sequence tool_call_success,success --repeat-last \ --tool-name bash --tool-arguments '{"command":"ls"}'2. 跑 headless agent(指向 mock-llm,导出审计):
DEEPSEEK_BASE_URL=http://127.0.0.1:8000/v1 \ DEEPSEEK_API_KEY=mock-key \ DSH_EVENT_AUDIT_DUMP=/tmp/audit.json \ pnpm dsh --profile headless "run the bash tool once and report"3. 分析快照:
byMode同时含 emit + waterfall、waterfall 链完整出现、agent 正常跑完(mock response recovered)= 通过。实证结果(dsh-event-auditor,2026-08-14)
74 事件 / 12 waterfall 全部捕获,完整 agent 生命周期:
关键安全证明:agent 完整跑完了工具调用循环——所有 waterfall 监听器都正确透传了
next(),零副作用。这应该是雷达里第一个完整的运行时验证案例。插件作者要避开的坑(全部实测踩过)
packages vendor native apps website patches scripts docs——缺 vendor/ 会报Cannot find package '@deepseek-ai/cordis'(cordis 全家在 vendor/)build:lib:host+build:lib:client+ web-frontend distctx.inject动态注入:ctx.get('webServer')未注入时直接抛错;inject: ['webServer']会阻塞 headless 加载ctx.httpServer(rc) vsctx.webServer(master)——以实际运行版本lib/types/为准--:pnpm run mock:llm -- --port会把--当位置参数gh apiContents API 逐文件上传(见 push-via-api.mjs)完整方法论
仓库:github.com/qing3a/dsh-event-auditor(dsh-event-auditor 本身就是一个事件审计面板插件,含完整设计文档与验证记录)。
欢迎其他插件作者用本方案验证自己的插件,并把结果贴回来——一起把雷达的"运行时 0 通过"变成过去式。💪
All reactions