dsh-logicprobe
审查设计文档与计划并进行状态机和数据模型验证 适合需要对代码重构、迁移计划进行自动化逻辑审计的开发者。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:AmethystLuna/logicprobe说明文档
阅读完整 README ↗使用
插件在会话首个模型步骤自动注入能力通知。技能在任务匹配其 Use when 描述时激活:
- 设计文档 / 计划审查 — "Review this design document" → 声称枚举与代码库核查
- 行为类问题 — "could this state machine deadlock"、"is this retry limit safe"、"check this timing for bugs" → 主动建议(不自动加载)作为可选验证
- 重构计划 — 管线对比前后模型,标记计划未声明的行为变化
- 数据模型/迁移审查 — "is this migration non-breaking"、"does this copy cover all required fields" → 使用
logicprobe-datamodel技能
技能在 Phase 0 依据计划特征自动分级(LIGHTWEIGHT / STANDARD / ESCALATED),并在计划文件追加 ## Plan Verification 摘要块作为审计痕迹。
Python 可选:已有 LogicModelV1 JSON 时可直接运行独立引擎 skills/logicprobe/references/logicprobe-engine.py(verify 跑 S1-S8/A1-A14/D1-D4,compose 跑 C1/C2 组合,export 生成 UPPAAL/TLA+/PRISM/SPIN 输入——与 dsh 工具逐字节一致,见 tests/python/run.mjs);模型仅为抽取出的状态表时,填充模板 skills/logicprobe/references/verification-harness.py;数据模型验证使用 skills/logicprobe-datamodel/references/data-model-harness.py;不可用(如离线开发机)时,对应 guide 提供手动验证模式。
示例模型见 examples/:订单状态机 before/after、电商数据模型、User 字段迁移。
配置
在 DeepSeek Harness 中,bundle 支持以下配置:
| 键 | 类型 | 默认值 | 说明 |
|---|---|---|---|
enabled | boolean | true | 设为 false 可关闭首步 Gate 注入。 |
gateContent | string | 内置 gate 文本 | 覆盖注入到首轮模型上下文中的文本。 |
interaction | ask | auto | follow-approval | follow-approval | 模型确认策略;follow-approval 在会话 approval policy 为 never 时解析为 auto。 |
在 profile 的 cordis.patch.yml 中按 row id 覆盖:
- insert:
- id: logicprobe
name: 'dsh-logicprobe'
config:
enabled: true
interaction: follow-approval
gateContent: |
...