dsh-logicprobe 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +10 -7
- package/README.md +10 -7
- package/package.json +107 -106
package/README.en-US.md
CHANGED
|
@@ -13,12 +13,12 @@ Design documents are not truth — code is. A claim-verification skill that chec
|
|
|
13
13
|
| Phase | What |
|
|
14
14
|
|-------|------|
|
|
15
15
|
| Phase 1-2 | Enumerate every verifiable claim (API names, file paths, enum values, counts, mechanism feasibility) → verify each against the codebase with evidence |
|
|
16
|
-
| Phase 2a | **8 structural checks** on extracted state-machine models: reachability, deadlock, liveness, determinism, event
|
|
17
|
-
| Phase 2b | **14 adversarial probes**: unexpected events, race interleaving, order permutation, pair symmetry (lock/unlock), boundary blast, resource injection, minimal counter-example, idempotent replay, leads-to, sequence, atomicity, budget (worst-case path cost,
|
|
16
|
+
| Phase 2a | **8 structural checks (S1-S8)** on extracted state-machine models: S1 reachability, S2 deadlock, S3 liveness, S4 determinism, S5 event completeness, S6 guard completeness, S7 invariant validity, S8 monotonic variables |
|
|
17
|
+
| Phase 2b | **14 adversarial probes (A1-A14)**: unexpected events, race interleaving, order permutation, pair symmetry (lock/unlock, incl. implicit onEntry/onExit pairing), boundary blast, resource injection, minimal counter-example, idempotent replay, leads-to, sequence, atomicity, budget (A12 worst-case path cost, incl. positive-cost-cycle detection), probability reachability (A13, P(hit) meets a lower bound), deadline (A14, maxTicks + tickEvents) |
|
|
18
18
|
| Refactoring | Before/after model comparison — behavioral preservation, invariant continuity, deadlock regression, complexity claims |
|
|
19
19
|
| Data models | DataModelV1 verification — DS/DA/DD checks, migration coverage, copy consistency, before/after breaking-change regression |
|
|
20
20
|
| Concurrency risk mining | Scans documents/plans for concurrency safety claims (thread-safe, lock-free, race condition, interrupt safety, etc.) and flags them for dedicated verification |
|
|
21
|
-
| Output | Structured findings with exact file:line evidence, severity classification, correction direction — never inline fixes |
|
|
21
|
+
| Output | Structured findings with exact file:line evidence, severity classification, correction direction — never inline fixes; the report carries `coverageNotes` (timing/preemption/hybrid/probability vocabulary routed to UPPAAL / TSan / CBMC / TLA+ / SpaceEx / PRISM, see `skills/logicprobe/references/gap-routing-guide.md`), and the model may carry a natural-language `narrative` (state/event/scenario annotations) echoed verbatim in the report |
|
|
22
22
|
|
|
23
23
|
The model is always shown as a transition table and **confirmed with the user before running** — extraction errors are the dominant failure mode.
|
|
24
24
|
|
|
@@ -70,7 +70,9 @@ Native dsh support ships as a cordis plugin bundle at the repository root (the r
|
|
|
70
70
|
- `logicprobe_concurrency_scan` mines documents/plans for concurrency risk claims (thread-safe, lock-free, race condition, mutex, etc.), flags them for dedicated verification, and attaches tool-routing `suggestions` to absolute claims.
|
|
71
71
|
- `logicprobe_verify` also supports transition `cost` (default 1) with `budget` invariants (A12 worst-case path-cost check incl. positive-cost-cycle detection), and transition `weight` (default 1) with `probability` invariants (A13 probability reachability).
|
|
72
72
|
- State `onEntry`/`onExit` actions are treated by A4 Pair Symmetry as implicit acquire/release; `maxTicks` + `tickEvents` deadlines (A14); report `coverageNotes` routes timing/preemption/hybrid/probability vocabulary to dedicated tools (UPPAAL, TSan/CBMC/TLA+, SpaceEx, PRISM, ...).
|
|
73
|
+
- The engine runs **22 checks (S1-S8 structural + A1-A14 adversarial)**; the model may carry a natural-language `narrative` (state/event/scenario annotations) echoed verbatim in the report.
|
|
73
74
|
- `logicprobe_compose_verify`: composition verification of two or more state machines (rendezvous handshake semantics) reporting C1 composition deadlock / C2 rendezvous never fires.
|
|
75
|
+
- `logicprobe_export`: exports a LogicModelV1 as native input for external tools — UPPAAL (XML `.xta` + queries), TLA+ (TLC module), PRISM (DTMC `.pm` + `.pctl`), SPIN (Promela + ltl) — matching the dimensions covered by `coverageNotes`/gap-routing; exports follow each tool's official syntax so the generated files can be handed straight to the checker (SPIN is verified end-to-end for real).
|
|
74
76
|
- Together with the embedded-workbench bundle's Plan Verification Gate, this closes the claim-verification loop in dsh.
|
|
75
77
|
|
|
76
78
|
Install: see [`.dsh/INSTALL.md`](.dsh/INSTALL.md) (four options, from plain skill copy to `dsh plugin add`).
|
|
@@ -224,11 +226,12 @@ npm run typecheck
|
|
|
224
226
|
npm run build
|
|
225
227
|
```
|
|
226
228
|
|
|
227
|
-
|
|
229
|
+
Test chain:
|
|
228
230
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
- `npm run test:engine` — state-machine / data-model engine regression (`tests/engine`, `tests/data-engine`, `tests/concurrency`, `tests/apply-smoke`, `tests/exporters`, `tests/external`) plus byte-for-byte Python parity (`tests/python/run.mjs`: the same fixtures are compared between the TS engine and `skills/logicprobe/references/logicprobe-engine.py` across reports / composition / exporter output; auto-SKIP when Python is absent)
|
|
232
|
+
- `npm run test:full` — `tests/full-suite.mjs` combined end-to-end suite
|
|
233
|
+
- `npm run test:python` — Python parity only (build + `tests/python/run.mjs`)
|
|
234
|
+
- Trigger tests are under `tests/skill-triggering/`: `bash tests/skill-triggering/run-all.sh`
|
|
232
235
|
|
|
233
236
|
## License & Security
|
|
234
237
|
|
package/README.md
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
| 阶段 | 内容 |
|
|
12
12
|
|------|------|
|
|
13
13
|
| Phase 1-2 | 枚举每个可验证声称(API 名、文件路径、枚举值、数量、机制可行性)→ 逐条对照代码库给出证据 |
|
|
14
|
-
| Phase 2a | 对提取的状态机模型执行 **8
|
|
15
|
-
| Phase 2b | **14
|
|
14
|
+
| Phase 2a | 对提取的状态机模型执行 **8 项结构检查(S1-S8)**:S1 可达性、S2 死锁、S3 活性、S4 确定性、S5 事件完备性、S6 守卫完备性、S7 不变量有效性、S8 单调变量 |
|
|
15
|
+
| Phase 2b | **14 项对抗探针(A1-A14)**:意外事件、竞态交错、顺序置换、配对对称(lock/unlock,含 onEntry/onExit 隐式配对)、边界轰炸、资源注入、最小反例、幂等重放、必达、顺序、原子性、预算(A12 最坏路径代价,含正成本环检测)、概率可达(A13,P(击中) 满足下界)、期限(A14,maxTicks + tickEvents) |
|
|
16
16
|
| 重构模式 | 前后模型对比——行为保持、不变量连续性、死锁回归、复杂度声称 |
|
|
17
17
|
| 数据模型模式 | DataModelV1 数据模型验证——DS/DA/DD 检查,迁移覆盖、copy 一致性、before/after 破坏性变更回归 |
|
|
18
18
|
| 并发风险挖掘 | 扫描文档/计划中的并发安全声称(thread-safe、lock-free、race condition、中断安全等),标记需要专用验证 |
|
|
19
|
-
| 输出 | 结构化发现:精确 file:line
|
|
19
|
+
| 输出 | 结构化发现:精确 file:line 证据、严重性分级、修正方向——绝不在核查中直接改代码;报告含 `coverageNotes`(时序/抢占/混合/概率词汇 → UPPAAL/TSan/CBMC/TLA+/SpaceEx/PRISM 等外部工具路由,见 `skills/logicprobe/references/gap-routing-guide.md`),模型可携带自然语言 `narrative`(状态/事件/场景注释)并被报告原样回显 |
|
|
20
20
|
|
|
21
21
|
模型永远先以转换表形式展示并**经用户确认后才运行**——模型提取错误是验证的头号失败模式。
|
|
22
22
|
|
|
@@ -67,7 +67,9 @@ git clone https://github.com/AmethystLuna/logicprobe.git ~/.claude/plugins/dev/l
|
|
|
67
67
|
- `logicprobe_verify` 支持 `beforeModel` + `stateMapping` 的 BEFORE/AFTER 对比(D1-D4),可直接验证重构/迁移的行为保持、不变量连续性、回归增量和死锁/活性回归。
|
|
68
68
|
- `logicprobe_verify` 还支持:迁移/处理器代价 `cost`(缺省 1)与 `budget` 不变量(A12 最坏路径代价检查,含正成本环检测)、迁移权重 `weight` 与 `probability` 不变量(A13 概率可达)。
|
|
69
69
|
- 状态 `onEntry`/`onExit` 动作(A4 自动纳入配对检查);`maxTicks`+`tickEvents` 期限(A14);报告 `coverageNotes`(时序/抢占/混合/概率词汇 → UPPAAL/TSan/CBMC/TLA+/SpaceEx/PRISM 等外部工具路由)。
|
|
70
|
+
- 引擎共运行 **22 项检查(S1-S8 结构 + A1-A14 对抗)**;模型可带自然语言 `narrative`(状态/事件/场景注释),报告原样回显。
|
|
70
71
|
- `logicprobe_compose_verify`:两台及以上状态机组合验证(握手 rendezvous 语义),报 C1 组合死锁 / C2 握手永不触发。
|
|
72
|
+
- `logicprobe_export`:把 LogicModelV1 导出为外部工具原生输入——UPPAAL(XML `.xta` + queries)、TLA+(TLC 模块)、PRISM(DTMC `.pm` + `.pctl`)、SPIN(Promela + ltl)——与 `coverageNotes`/gap-routing 的维度对应;导出严格遵循各工具官方语法,生成文件可直接提交给对应检查器(SPIN 已做真实端到端验证)。
|
|
71
73
|
- `logicprobe_datamodel_verify` 新增数据模型验证:DataModelV1、迁移覆盖、copy 一致性、DD1-DD4 before/after 数据回归。
|
|
72
74
|
- `logicprobe_concurrency_scan` 扫描文档/计划中的并发风险声称(thread-safe、lock-free、race condition、mutex 等),标记需要专用并发验证。
|
|
73
75
|
- 与 embedded-workbench bundle 的 Plan Verification Gate 配合,在 dsh 中闭环了 claim 验证链路。
|
|
@@ -222,11 +224,12 @@ npm run typecheck
|
|
|
222
224
|
npm run build
|
|
223
225
|
```
|
|
224
226
|
|
|
225
|
-
|
|
227
|
+
测试链:
|
|
226
228
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
- `npm run test:engine` — 状态机/数据模型引擎回归(`tests/engine`、`tests/data-engine`、`tests/concurrency`、`tests/apply-smoke`、`tests/exporters`、`tests/external`)+ Python 逐字节一致性对照(`tests/python/run.mjs`:同一批 fixture 在 TS 引擎与 `skills/logicprobe/references/logicprobe-engine.py` 之间比对报告/组合/导出产物;无 Python 时自动 SKIP)
|
|
230
|
+
- `npm run test:full` — `tests/full-suite.mjs` 端到端合并套件
|
|
231
|
+
- `npm run test:python` — 仅 Python parity(构建 + `tests/python/run.mjs`)
|
|
232
|
+
- 触发测试位于 `tests/skill-triggering/`:`bash tests/skill-triggering/run-all.sh`
|
|
230
233
|
|
|
231
234
|
## 许可证与安全
|
|
232
235
|
|
package/package.json
CHANGED
|
@@ -1,106 +1,107 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-logicprobe",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "Design document & plan claim verification — enumerate claims, verify against codebase facts, then escalate to state-machine verification (S1-S8/A1-A12, including budget/worst-case path-cost checks) and data-model verification (DS/DA/DD) for behavioral claims. Supports before/after regression, idempotency/monotonic/sequence/leads-to/atomicity constraints, and concurrency risk mining. Ships a native DeepSeek Harness (dsh) bundle that injects the claim-verification gate into the first model step.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/types/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./lib/types/index.d.ts",
|
|
11
|
-
"default": "./lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
14
|
-
"./package.json": "./package.json"
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"lib",
|
|
18
|
-
"src",
|
|
19
|
-
"skills",
|
|
20
|
-
"cordis.patch.yml"
|
|
21
|
-
],
|
|
22
|
-
"dsh": {
|
|
23
|
-
"engines": {
|
|
24
|
-
"dsh": ">=0.1.0-rc.7"
|
|
25
|
-
},
|
|
26
|
-
"category": "skill",
|
|
27
|
-
"displayName": "逻辑探针",
|
|
28
|
-
"bundle": {
|
|
29
|
-
"patch": "./cordis.patch.yml"
|
|
30
|
-
},
|
|
31
|
-
"compatibility": {
|
|
32
|
-
"dsh": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-alpha.2 || ^0.1.2-alpha.3 || ^0.1.2-alpha.4 || ^0.1.2-alpha.5 || ^0.1.2-rc.1",
|
|
33
|
-
"dshReleases": {
|
|
34
|
-
"0.1.0-rc.7": "compatible",
|
|
35
|
-
"0.1.0-rc.8": "compatible",
|
|
36
|
-
"0.1.1-rc.1": "compatible",
|
|
37
|
-
"0.1.1-rc.2": "compatible",
|
|
38
|
-
"0.1.2-alpha.2": "compatible",
|
|
39
|
-
"0.1.2-alpha.3": "compatible",
|
|
40
|
-
"0.1.2-alpha.4": "compatible",
|
|
41
|
-
"0.1.2-alpha.5": "compatible",
|
|
42
|
-
"0.1.2-rc.1": "compatible"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"test:
|
|
55
|
-
"test:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"@deepseek-ai/
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"@deepseek-ai/
|
|
69
|
-
"@deepseek-ai/dsh-
|
|
70
|
-
"@deepseek-ai/dsh-
|
|
71
|
-
"@deepseek-ai/dsh-
|
|
72
|
-
"@deepseek-ai/dsh-
|
|
73
|
-
"@deepseek-ai/dsh-
|
|
74
|
-
"@deepseek-ai/dsh-
|
|
75
|
-
"@deepseek-ai/dsh-skill
|
|
76
|
-
"@deepseek-ai/dsh-
|
|
77
|
-
"@deepseek-ai/dsh-
|
|
78
|
-
"@deepseek-ai/dsh-
|
|
79
|
-
"@deepseek-ai/
|
|
80
|
-
"@
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-logicprobe",
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"description": "Design document & plan claim verification — enumerate claims, verify against codebase facts, then escalate to state-machine verification (S1-S8/A1-A12, including budget/worst-case path-cost checks) and data-model verification (DS/DA/DD) for behavioral claims. Supports before/after regression, idempotency/monotonic/sequence/leads-to/atomicity constraints, and concurrency risk mining. Ships a native DeepSeek Harness (dsh) bundle that injects the claim-verification gate into the first model step.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"lib",
|
|
18
|
+
"src",
|
|
19
|
+
"skills",
|
|
20
|
+
"cordis.patch.yml"
|
|
21
|
+
],
|
|
22
|
+
"dsh": {
|
|
23
|
+
"engines": {
|
|
24
|
+
"dsh": ">=0.1.0-rc.7"
|
|
25
|
+
},
|
|
26
|
+
"category": "skill",
|
|
27
|
+
"displayName": "逻辑探针",
|
|
28
|
+
"bundle": {
|
|
29
|
+
"patch": "./cordis.patch.yml"
|
|
30
|
+
},
|
|
31
|
+
"compatibility": {
|
|
32
|
+
"dsh": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-alpha.2 || ^0.1.2-alpha.3 || ^0.1.2-alpha.4 || ^0.1.2-alpha.5 || ^0.1.2-rc.1 || ^0.1.3-alpha.1",
|
|
33
|
+
"dshReleases": {
|
|
34
|
+
"0.1.0-rc.7": "compatible",
|
|
35
|
+
"0.1.0-rc.8": "compatible",
|
|
36
|
+
"0.1.1-rc.1": "compatible",
|
|
37
|
+
"0.1.1-rc.2": "compatible",
|
|
38
|
+
"0.1.2-alpha.2": "compatible",
|
|
39
|
+
"0.1.2-alpha.3": "compatible",
|
|
40
|
+
"0.1.2-alpha.4": "compatible",
|
|
41
|
+
"0.1.2-alpha.5": "compatible",
|
|
42
|
+
"0.1.2-rc.1": "compatible",
|
|
43
|
+
"0.1.3-alpha.1": "compatible"
|
|
44
|
+
},
|
|
45
|
+
"profiles": [
|
|
46
|
+
"headless"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsc -p tsconfig.json",
|
|
52
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
+
"bump": "node scripts/bump-version.mjs",
|
|
54
|
+
"test:engine": "npm run build && node tests/engine/run.mjs && node tests/data-engine/run.mjs && node tests/concurrency/run.mjs && node tests/apply-smoke.mjs && node tests/exporters/run.mjs && node tests/external/run.mjs && node tests/python/run.mjs",
|
|
55
|
+
"test:full": "npm run build && node tests/full-suite.mjs",
|
|
56
|
+
"test:python": "npm run build && node tests/python/run.mjs"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
60
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
|
|
61
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
|
|
62
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.6",
|
|
63
|
+
"@deepseek-ai/dsh-skill-filesystem": "^0.1.0-rc.8",
|
|
64
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
|
|
65
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
69
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
|
|
70
|
+
"@deepseek-ai/dsh-cordis-host-runner": "^0.1.0-rc.8",
|
|
71
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.8",
|
|
72
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
|
|
73
|
+
"@deepseek-ai/dsh-scope": "^0.1.0-rc.6",
|
|
74
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.6",
|
|
75
|
+
"@deepseek-ai/dsh-skill": "^0.1.0-rc.6",
|
|
76
|
+
"@deepseek-ai/dsh-skill-filesystem": "^0.1.0-rc.8",
|
|
77
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
|
|
78
|
+
"@deepseek-ai/dsh-timeout": "^0.1.0-rc.6",
|
|
79
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
|
|
80
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
81
|
+
"@types/node": "^26.4.0",
|
|
82
|
+
"typescript": "^7.0.2"
|
|
83
|
+
},
|
|
84
|
+
"author": {
|
|
85
|
+
"name": "Amethyst Luna",
|
|
86
|
+
"url": "https://github.com/AmethystLuna"
|
|
87
|
+
},
|
|
88
|
+
"license": "MIT",
|
|
89
|
+
"repository": "https://github.com/AmethystLuna/logicprobe",
|
|
90
|
+
"keywords": [
|
|
91
|
+
"verification",
|
|
92
|
+
"fact-check",
|
|
93
|
+
"design-review",
|
|
94
|
+
"plan-review",
|
|
95
|
+
"state-machine",
|
|
96
|
+
"logic-verification",
|
|
97
|
+
"adversarial",
|
|
98
|
+
"refactoring",
|
|
99
|
+
"model-checking",
|
|
100
|
+
"agentskills",
|
|
101
|
+
"plugin",
|
|
102
|
+
"dsh"
|
|
103
|
+
],
|
|
104
|
+
"engines": {
|
|
105
|
+
"node": ">=20"
|
|
106
|
+
}
|
|
107
|
+
}
|