dsh-logicprobe 0.7.1 → 0.8.0
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 +89 -58
- package/README.md +76 -46
- package/lib/index.js +11 -4
- package/lib/json-value.js +18 -0
- package/lib/types/json-value.d.ts +21 -0
- package/lib/types/uml-tool.d.ts +14 -0
- package/lib/types/uml.d.ts +167 -0
- package/lib/uml-tool.js +104 -0
- package/lib/uml.js +1544 -0
- package/package.json +11 -10
- package/skills/logicprobe/SKILL.md +36 -1
- package/skills/logicprobe/references/logicprobe-engine.py +1586 -2
- package/skills/logicprobe/references/uml-modeling-guide.md +166 -0
- package/src/compose-tool.ts +2 -1
- package/src/concurrency-tool.ts +2 -1
- package/src/data-tool.ts +2 -1
- package/src/export-tool.ts +2 -1
- package/src/index.ts +11 -4
- package/src/json-value.ts +20 -0
- package/src/tool.ts +2 -1
- package/src/uml-tool.ts +106 -0
- package/src/uml.ts +1461 -0
- package/skills/logicprobe/references/__pycache__/logicprobe-engine.cpython-310.pyc +0 -0
package/README.en-US.md
CHANGED
|
@@ -4,23 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/hashgraph-online/hol-guard)
|
|
6
6
|
|
|
7
|
-
Design documents are not truth
|
|
7
|
+
Design documents are not truth. Code is. This skill checks every verifiable claim in a design document, an architecture spec, or a refactoring plan against the real codebase. For behavioral claims it escalates to executable-model verification.
|
|
8
8
|
|
|
9
|
-
**Cross-platform
|
|
9
|
+
**Cross-platform**: works with Claude Code, Codex CLI, Cursor, Kimi CLI, OpenCode, and ZCode. Built on the [Agent Skills](https://agentskills.io) open standard.
|
|
10
10
|
|
|
11
11
|
## What It Does
|
|
12
12
|
|
|
13
13
|
| Phase | What |
|
|
14
14
|
|-------|------|
|
|
15
|
-
| Phase 1-2 | Enumerate every verifiable claim
|
|
16
|
-
| Phase 2a | **8 structural checks (S1-S8)** on extracted state
|
|
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
|
|
18
|
-
| Refactoring | Before/after model comparison
|
|
19
|
-
| Data models | DataModelV1 verification
|
|
20
|
-
|
|
|
21
|
-
|
|
|
15
|
+
| Phase 1-2 | Enumerate every verifiable claim: API names, file paths, enum values, counts, mechanism feasibility. Verify each one against the codebase with evidence. |
|
|
16
|
+
| Phase 2a | **8 structural checks (S1-S8)** on the extracted state machine: 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), deadline (A14). |
|
|
18
|
+
| Refactoring | Before/after model comparison: behavioral preservation, invariant continuity, deadlock regression, complexity claims. |
|
|
19
|
+
| Data models | DataModelV1 verification (DS/DA/DD): migration coverage, copy consistency, before/after breaking-change regression. |
|
|
20
|
+
| UML modelling and review | Draw a code flow as UML, then review the modelling itself: structural defects, documentation gaps, diagram-versus-model fidelity. |
|
|
21
|
+
| Concurrency risk mining | Scan documents and plans for concurrency safety claims (thread-safe, lock-free, race condition, interrupt safety) and flag them for dedicated verification. |
|
|
22
|
+
| Output | Structured findings with exact file:line evidence, severity, and correction direction. Never an inline fix. The report carries `coverageNotes`, which routes timing, preemption, hybrid-control and probability vocabulary to external tools (UPPAAL, TSan, CBMC, TLA+, SpaceEx, PRISM). See `skills/logicprobe/references/gap-routing-guide.md`. A model may also carry a natural-language `narrative` (state, event and scenario annotations), which the report echoes verbatim. |
|
|
22
23
|
|
|
23
|
-
The model is always shown as a transition table and **confirmed with the user before
|
|
24
|
+
The model is always shown as a transition table first, and **confirmed with the user before it runs**. Extraction errors are the dominant failure mode.
|
|
24
25
|
|
|
25
26
|
## Installation
|
|
26
27
|
|
|
@@ -38,7 +39,7 @@ Add the marketplace to **Claude Code**'s `~/.claude/settings.json`:
|
|
|
38
39
|
}
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
Then install from CLI:
|
|
42
|
+
Then install from the CLI:
|
|
42
43
|
|
|
43
44
|
```bash
|
|
44
45
|
claude plugin install logicprobe@logicprobe
|
|
@@ -50,7 +51,7 @@ claude plugin install logicprobe@logicprobe
|
|
|
50
51
|
git clone https://github.com/AmethystLuna/logicprobe.git ~/.claude/plugins/dev/logicprobe
|
|
51
52
|
```
|
|
52
53
|
|
|
53
|
-
Then enable in `~/.claude/settings.json`:
|
|
54
|
+
Then enable it in `~/.claude/settings.json`:
|
|
54
55
|
|
|
55
56
|
```json
|
|
56
57
|
{
|
|
@@ -62,18 +63,26 @@ Then enable in `~/.claude/settings.json`:
|
|
|
62
63
|
|
|
63
64
|
## DeepSeek Harness (dsh)
|
|
64
65
|
|
|
65
|
-
Native dsh support ships as a cordis plugin bundle at the repository root
|
|
66
|
+
Native dsh support ships as a cordis plugin bundle at the repository root, declared by `dsh.bundle` in the root `package.json`.
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
The bundle does three things:
|
|
69
|
+
|
|
70
|
+
1. **Registers the skills.** They follow the Agent Skills open standard and are discovered as-is by dsh's `skill-filesystem` provider. No extra code.
|
|
71
|
+
2. **Injects the gate text.** The first model step of every session receives the claim-verification gate (1% Rule / Red Flags / proactive suggestion). This is the dsh counterpart of the Claude `SessionStart` hook.
|
|
72
|
+
3. **Registers the native tools and a context.** The tools live on `ctx.tools`. A policy-aware `logicprobe:mode` context lives on `ctx.systemPrompt`. A model-visible catalog entry is available through `cordis_inspect`.
|
|
73
|
+
|
|
74
|
+
The tools:
|
|
75
|
+
|
|
76
|
+
| Tool | What it does |
|
|
77
|
+
|------|------|
|
|
78
|
+
| `logicprobe_verify` | State-machine verification: S1-S8 structural checks plus A1-A14 adversarial probes. Pass `beforeModel` and `stateMapping` to add the D1-D4 before/after regression. |
|
|
79
|
+
| `logicprobe_datamodel_verify` | Data-model verification: DataModelV1, migration coverage, copy consistency, DD1-DD4 data regression. |
|
|
80
|
+
| `logicprobe_concurrency_scan` | Mines concurrency risk claims (thread-safe, lock-free, race condition, mutex) and flags them for dedicated verification. |
|
|
81
|
+
| `logicprobe_compose_verify` | Composition verification of two or more machines (rendezvous handshake semantics): C1 composition deadlock, C2 rendezvous never fires. |
|
|
82
|
+
| `logicprobe_export` | Exports external-tool input: UPPAAL (`.xta` + queries), TLA+ (TLC module), PRISM (DTMC `.pm` + `.pctl`), SPIN (Promela + ltl). |
|
|
83
|
+
| `logicprobe_uml` | Models a code flow as UML and reviews the modelling. See "UML modelling and review" below. |
|
|
84
|
+
|
|
85
|
+
Transition `cost` (default 1) plus a `budget` invariant makes A12 check the worst-case path cost. A reachable cycle with positive cost counts as unbounded. Transition `weight` (default 1) plus a `probability` invariant makes A13 compute probability reachability. State `onEntry`/`onExit` actions enter A4 pair symmetry automatically, and `maxTicks` plus `tickEvents` drive the A14 deadline check.
|
|
77
86
|
|
|
78
87
|
Install (native bundle, recommended):
|
|
79
88
|
|
|
@@ -86,28 +95,48 @@ dsh plugin --profile web add "github:AmethystLuna/logicprobe"
|
|
|
86
95
|
npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-logicprobe
|
|
87
96
|
```
|
|
88
97
|
|
|
89
|
-
Restart the profile
|
|
98
|
+
Restart the profile afterwards. `dsh --profile web --dump-config` must show the `id: logicprobe` row with `enabled: true`. More options (plain skill copy, project-level install) are in [`.dsh/INSTALL.md`](.dsh/INSTALL.md).
|
|
99
|
+
|
|
100
|
+
> Package name note: the npm package is `dsh-logicprobe`, with no scope. In the web profile's `package.json`, both the dependency key and the `dsh.profile.bundles` entry must use that name. On a mismatch the dsh loader cannot find `node_modules/dsh-logicprobe` and the boot fails.
|
|
101
|
+
|
|
102
|
+
## UML Modelling and Review
|
|
90
103
|
|
|
91
|
-
|
|
104
|
+
`logicprobe_uml` draws a LogicModelV1 as UML. It also reads a hand-drawn UML diagram back into a model, and it reviews the modelling itself. It has three actions:
|
|
105
|
+
|
|
106
|
+
- **render**: model to diagram. Mermaid covers state, activity flowchart and sequence views. PlantUML covers state and sequence. Any construct the notation cannot express becomes a warning instead of a silent drop. PlantUML activity is refused, because that syntax cannot carry a graph with merges or cycles faithfully.
|
|
107
|
+
- **parse**: diagram to model. It reads Mermaid and PlantUML state or activity diagrams, so a hand-drawn diagram can go straight into `logicprobe_verify`. A sequence diagram is a trace, not a machine, so parsing one is refused.
|
|
108
|
+
- **review**: audits the modelling. It reports structural defects and documentation gaps. The structural defects are unreachable states, dead ends, ambiguous branches, self-loops with no exit, and duplicate transitions. The documentation gaps are a missing narrative, unbounded variables, states a reader cannot map back to code, and label drift between diagram and narrative. It also runs the fidelity check: it parses the diagram back into a model and reports every structural difference.
|
|
109
|
+
|
|
110
|
+
Fidelity is the core of the feature. Generated diagrams carry `logicprobe:` comment directives for the initial state, the terminal states, aliases and variable kinds. Mermaid and PlantUML ignore those lines; the parser reads them. That is what makes the diagram-versus-model comparison exact.
|
|
111
|
+
|
|
112
|
+
The review covers the modelling, never the behaviour. Every finding names the engine check that settles the behavioural half. The full list (`UML001`-`UML019`), the directive format, a worked example and the limits of each view are in [`skills/logicprobe/references/uml-modeling-guide.md`](skills/logicprobe/references/uml-modeling-guide.md).
|
|
92
113
|
|
|
93
114
|
## Usage
|
|
94
115
|
|
|
95
|
-
The plugin
|
|
116
|
+
The plugin injects a capability notification into the first model step. The skill activates when its `Use when` description matches your task:
|
|
117
|
+
|
|
118
|
+
- **Design doc or plan review** — "Review this design document" → claim enumeration and codebase verification
|
|
119
|
+
- **Behavioral questions** — "could this state machine deadlock", "is this retry limit safe" → the skill is proactively suggested (not auto-loaded) as an optional verification pass
|
|
120
|
+
- **Refactoring plans** — the pipeline compares before/after models and flags undocumented behavioral changes
|
|
121
|
+
- **Data model or migration review** — "is this migration non-breaking" → use the `logicprobe-datamodel` skill
|
|
122
|
+
- **Code-flow modelling** — "draw this state machine", "is this UML diagram right" → use `logicprobe_uml` to draw the diagram and review the modelling, then run `logicprobe_verify` for the behaviour
|
|
123
|
+
|
|
124
|
+
The skill classifies depth (LIGHTWEIGHT / STANDARD / ESCALATED) from plan features in Phase 0, and appends a `## Plan Verification` summary block as the audit trail.
|
|
96
125
|
|
|
97
|
-
|
|
98
|
-
- **Behavioral questions** — "could this state machine deadlock", "is this retry limit safe", "check this timing for bugs" → the skill is proactively suggested (not auto-loaded) as an optional verification pass
|
|
99
|
-
- **Refactoring plans** — the pipeline compares before/after models to flag undocumented behavioral changes
|
|
100
|
-
- **Data model / migration review** — "is this migration non-breaking", "does this copy cover all required fields" → use the `logicprobe-datamodel` skill
|
|
126
|
+
Python is optional. When a LogicModelV1 JSON already exists, run the standalone engine at `skills/logicprobe/references/logicprobe-engine.py`:
|
|
101
127
|
|
|
102
|
-
|
|
128
|
+
- `verify` runs S1-S8 / A1-A14 / D1-D4
|
|
129
|
+
- `compose` runs the C1 / C2 composition
|
|
130
|
+
- `export` emits UPPAAL, TLA+, PRISM and SPIN input
|
|
131
|
+
- `uml-render`, `uml-parse` and `uml-review` cover the UML front end
|
|
103
132
|
|
|
104
|
-
|
|
133
|
+
Its output is byte-identical to the dsh tools, cross-checked by `tests/python/run.mjs`. When the model exists only as extracted tables, fill in `skills/logicprobe/references/verification-harness.py`. Data-model checks use `skills/logicprobe-datamodel/references/data-model-harness.py`. When Python is unavailable, for example on an air-gapped machine, the matching guide describes a manual verification mode.
|
|
105
134
|
|
|
106
|
-
Sample models
|
|
135
|
+
Sample models live under [`examples/`](examples/README.md): an order state machine before/after, an e-commerce data model, and a User field migration.
|
|
107
136
|
|
|
108
137
|
## Codex CLI
|
|
109
138
|
|
|
110
|
-
This plugin also supports OpenAI Codex CLI. Skills follow the Agent Skills standard and work identically
|
|
139
|
+
This plugin also supports OpenAI Codex CLI. Skills follow the Agent Skills standard and work identically on both platforms.
|
|
111
140
|
|
|
112
141
|
### Codex install
|
|
113
142
|
|
|
@@ -125,7 +154,7 @@ Or manually:
|
|
|
125
154
|
git clone https://github.com/AmethystLuna/logicprobe.git ~/.codex/plugins/logicprobe
|
|
126
155
|
```
|
|
127
156
|
|
|
128
|
-
Skills are invoked with `$logicprobe
|
|
157
|
+
Skills are invoked with `$logicprobe`, or selected automatically by Codex from the task context.
|
|
129
158
|
|
|
130
159
|
## Cursor
|
|
131
160
|
|
|
@@ -158,7 +187,7 @@ Skills are invoked with `/skill:logicprobe`.
|
|
|
158
187
|
|
|
159
188
|
## OpenCode
|
|
160
189
|
|
|
161
|
-
Skills are auto-discovered from `.claude/skills/` and `.codex/skills/` paths. Add to your `opencode.json`:
|
|
190
|
+
Skills are auto-discovered from `.claude/skills/` and `.codex/skills/` paths. Add this to your `opencode.json`:
|
|
162
191
|
|
|
163
192
|
```json
|
|
164
193
|
{
|
|
@@ -166,29 +195,29 @@ Skills are auto-discovered from `.claude/skills/` and `.codex/skills/` paths. Ad
|
|
|
166
195
|
}
|
|
167
196
|
```
|
|
168
197
|
|
|
169
|
-
Or install
|
|
198
|
+
Or install through `skop`, which consumes the Claude marketplace manifest. See `.opencode/INSTALL.md`.
|
|
170
199
|
|
|
171
200
|
## ZCode (Z.AI)
|
|
172
201
|
|
|
173
|
-
ZCode 3.0+ follows the Agent Skills standard.
|
|
202
|
+
ZCode 3.0+ follows the Agent Skills standard. It has no plugin marketplace, so copy the skills yourself:
|
|
174
203
|
|
|
175
204
|
```bash
|
|
176
205
|
git clone https://github.com/AmethystLuna/logicprobe.git
|
|
177
206
|
cp -r logicprobe/skills/* .zcode/skills/
|
|
178
207
|
```
|
|
179
208
|
|
|
180
|
-
Skills are invoked with `$logicprobe`. See `.zcode/INSTALL.md
|
|
209
|
+
Skills are invoked with `$logicprobe`. See `.zcode/INSTALL.md`.
|
|
181
210
|
|
|
182
211
|
## Requirements
|
|
183
212
|
|
|
184
|
-
- Claude Code v2.1+ / Codex CLI latest / Cursor 2.5+ / Kimi CLI latest / OpenCode latest / ZCode 3.0+
|
|
185
|
-
- DeepSeek Harness (dsh): dev preview
|
|
186
|
-
- The Web Plugins-page "Gate injection" switch requires **dsh ≥ 0.1.7-alpha.1
|
|
187
|
-
- Python 3.6+ optional
|
|
213
|
+
- Host: Claude Code v2.1+ / Codex CLI latest / Cursor 2.5+ / Kimi CLI latest / OpenCode latest / ZCode 3.0+
|
|
214
|
+
- DeepSeek Harness (dsh): dev preview, declared support for `>= 0.1.0-rc.7`. The latest round measured install, mount, boot and uninstall on 0.2.1-alpha.1. The earlier round measured 0.1.5-rc.2 through 0.2.0-rc.2. Per-release evidence is in [DSH-COMPATIBILITY.md](DSH-COMPATIBILITY.md).
|
|
215
|
+
- The Web Plugins-page "Gate injection" switch requires **dsh ≥ 0.1.7-alpha.1**, because its settings service must be able to project live fields. On older dsh the plugin still loads and still injects. The switch is simply absent, with no error.
|
|
216
|
+
- Python 3.6+ optional, needed only by the automated tools. The manual fallback mode needs no dependencies.
|
|
188
217
|
|
|
189
218
|
## Configuration
|
|
190
219
|
|
|
191
|
-
In DeepSeek Harness
|
|
220
|
+
In DeepSeek Harness the bundle accepts a small configuration object:
|
|
192
221
|
|
|
193
222
|
| Key | Type | Default | Description |
|
|
194
223
|
|---|---|---|---|
|
|
@@ -196,9 +225,9 @@ In DeepSeek Harness, the bundle registers the `logicprobe_verify` tool (through
|
|
|
196
225
|
| `gateContent` | string | built-in gate text | Override the text injected into the first model step. |
|
|
197
226
|
| `interaction` | `ask` \| `auto` \| `follow-approval` | `follow-approval` | Model-confirmation policy. `follow-approval` resolves to `auto` when the session approval policy is `never`. |
|
|
198
227
|
|
|
199
|
-
The switch is editable live in the dsh Web GUI: sidebar **Plugins** → this plugin's card → "Gate injection". It takes effect without a profile restart and controls only the injected text
|
|
228
|
+
The switch is editable live in the dsh Web GUI: sidebar **Plugins** → this plugin's card → "Gate injection". It takes effect without a profile restart, and it controls only the injected text. Turning it off leaves the skills and the verification tools registered. The same card also carries a coarser row switch: turning that one off unmounts the whole row, so the skills, the tools and this switch all disappear. Persistent overrides still go through the profile patch below.
|
|
200
229
|
|
|
201
|
-
To
|
|
230
|
+
To override the row by id, edit your profile's `cordis.patch.yml`:
|
|
202
231
|
|
|
203
232
|
```yaml
|
|
204
233
|
- insert:
|
|
@@ -213,24 +242,24 @@ To change it, override the row by id in your profile's `cordis.patch.yml`:
|
|
|
213
242
|
|
|
214
243
|
## Uninstall
|
|
215
244
|
|
|
216
|
-
- If you installed through the DSH plugin manager, remove the `logicprobe` plugin from the target profile
|
|
217
|
-
- If you copied `skills/*` manually, delete the copied skill directories from `~/.agents/skills/` or the project `.dsh/skills/`.
|
|
245
|
+
- If you installed through the DSH plugin manager, remove the `logicprobe` plugin from the target profile with the same manager.
|
|
246
|
+
- If you copied `skills/*` manually, delete the copied skill directories from `~/.agents/skills/` or the project's `.dsh/skills/`.
|
|
218
247
|
- If you added the bundle as a `cordis.patch.yml` row, remove the row with `id: logicprobe` from the profile patch and restart DSH.
|
|
219
248
|
|
|
220
249
|
## Permissions & Data
|
|
221
250
|
|
|
222
251
|
- The plugin runtime reads only the `skills/` directory shipped inside the package, in order to register skills through DSH's standard filesystem skill provider.
|
|
223
252
|
- It injects the configured gate text into the first model step of a session.
|
|
224
|
-
- It does not read credentials, open network connections, or
|
|
253
|
+
- It does not read credentials, open network connections, or touch user data outside the DSH session context.
|
|
225
254
|
- When the skill is actually used, the model may read project files as directed by the user, just like any other coding skill.
|
|
226
255
|
|
|
227
256
|
## Troubleshooting
|
|
228
257
|
|
|
229
|
-
- Skill not visible in DSH: confirm
|
|
230
|
-
- Gate not injected: check that `enabled` is not `false
|
|
231
|
-
- `logicprobe_verify` not visible: check `cordis_inspect_query` status for `toolRegistered: true`, and confirm the
|
|
232
|
-
- Plugin manager rejects installation: make sure `@deepseek-ai/*` packages are declared as `peerDependencies`, not regular `dependencies`.
|
|
233
|
-
- After manual copy
|
|
258
|
+
- Skill not visible in DSH: confirm the DSH version supports `ctx.skills` and Agent Skills discovery, then restart the profile.
|
|
259
|
+
- Gate not injected: check that `enabled` is not `false`, and that the row id `logicprobe` is present in the active profile patch.
|
|
260
|
+
- `logicprobe_verify` not visible: check `cordis_inspect_query` status for `toolRegistered: true`, and confirm the profile resolved the `@deepseek-ai/dsh-tools` peer dependency.
|
|
261
|
+
- Plugin manager rejects the installation: make sure the `@deepseek-ai/*` packages are declared as `peerDependencies`, not as regular `dependencies`.
|
|
262
|
+
- After a manual copy DSH still does not see the skill: install the native bundle instead (`dsh plugin add "github:AmethystLuna/logicprobe"`).
|
|
234
263
|
|
|
235
264
|
## Development
|
|
236
265
|
|
|
@@ -242,10 +271,12 @@ npm run build
|
|
|
242
271
|
|
|
243
272
|
Test chain:
|
|
244
273
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
274
|
+
| Command | What it covers |
|
|
275
|
+
|---|---|
|
|
276
|
+
| `npm run test:engine` | State-machine and data-model engine regression (`tests/engine`, `tests/data-engine`, `tests/concurrency`, `tests/uml`, `tests/apply-smoke`, `tests/dsh-client-half`, `tests/exporters`, `tests/external`), plus byte-for-byte Python parity. The parity script `tests/python/run.mjs` compares the same fixtures between the TS engine and `skills/logicprobe/references/logicprobe-engine.py` across reports, composition and exporter output. It SKIPs when Python is absent. |
|
|
277
|
+
| `npm run test:full` | `tests/full-suite.mjs` combined end-to-end suite |
|
|
278
|
+
| `npm run test:python` | Python parity only (build + `tests/python/run.mjs`) |
|
|
279
|
+
| `bash tests/skill-triggering/run-all.sh` | Trigger tests under `tests/skill-triggering/` |
|
|
249
280
|
|
|
250
281
|
## License & Security
|
|
251
282
|
|
package/README.md
CHANGED
|
@@ -2,23 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
<p align="center"><a href="README.en-US.md">English</a> · <strong>中文</strong></p>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
文档不是事实,代码才是。本技能逐条核验设计文档、架构规格与重构计划里的可验证声称,再把每一条对照到代码库的真实实现。遇到行为类声称时,它升级为可执行模型验证。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**跨平台**:支持 Claude Code、Codex CLI、Cursor、Kimi CLI、OpenCode、ZCode。技能基于 [Agent Skills](https://agentskills.io) 开放标准。
|
|
8
8
|
|
|
9
9
|
## 功能
|
|
10
10
|
|
|
11
11
|
| 阶段 | 内容 |
|
|
12
12
|
|------|------|
|
|
13
|
-
| Phase 1-2 |
|
|
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
|
|
16
|
-
| 重构模式 |
|
|
17
|
-
| 数据模型模式 | DataModelV1
|
|
18
|
-
|
|
|
19
|
-
|
|
|
13
|
+
| Phase 1-2 | 枚举每个可验证声称:API 名、文件路径、枚举值、数量、机制可行性。逐条对照代码库给出证据。 |
|
|
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)、期限(A14)。 |
|
|
16
|
+
| 重构模式 | 对比前后模型:行为保持、不变量连续性、死锁回归、复杂度声称。 |
|
|
17
|
+
| 数据模型模式 | 验证 DataModelV1 数据模型(DS/DA/DD):迁移覆盖、copy 一致性、before/after 破坏性变更回归。 |
|
|
18
|
+
| UML 建模与审查 | 用 UML 画出代码流程,再审查这份建模本身:结构缺陷、文档缺口、图与模型的往返保真度。 |
|
|
19
|
+
| 并发风险挖掘 | 扫描文档与计划中的并发安全声称(thread-safe、lock-free、race condition、中断安全等),标记出来交给专用验证。 |
|
|
20
|
+
| 输出 | 结构化发现:精确 file:line 证据、严重性分级、修正方向。核查过程中绝不直接改代码。报告附带 `coverageNotes`,把时序、抢占、混合控制、概率等词汇路由到外部工具(UPPAAL、TSan、CBMC、TLA+、SpaceEx、PRISM 等),见 `skills/logicprobe/references/gap-routing-guide.md`。模型可携带自然语言 `narrative`(状态、事件、场景注释),报告原样回显。 |
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
模型永远先以转换表形式展示,**经用户确认后才运行**。模型提取错误是验证的头号失败模式。
|
|
22
23
|
|
|
23
24
|
## 安装
|
|
24
25
|
|
|
@@ -60,19 +61,26 @@ git clone https://github.com/AmethystLuna/logicprobe.git ~/.claude/plugins/dev/l
|
|
|
60
61
|
|
|
61
62
|
## DeepSeek Harness (dsh)
|
|
62
63
|
|
|
63
|
-
原生 dsh 支持以 cordis 插件 bundle
|
|
64
|
+
原生 dsh 支持以 cordis 插件 bundle 的形式提供,位于**仓库根**,由根 `package.json` 的 `dsh.bundle` 声明。
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
这个 bundle 做三件事:
|
|
67
|
+
|
|
68
|
+
1. **注册技能。** 技能遵循 Agent Skills 开放标准,由 dsh 的 `skill-filesystem` provider 原样发现,不需要额外代码。
|
|
69
|
+
2. **注入门禁文本。** 每个会话的第一个模型步骤会收到 claim 验证门禁(1% Rule / Red Flags / 主动建议)。这是 Claude `SessionStart` hook 在 dsh 上的对应物。
|
|
70
|
+
3. **注册原生工具与上下文。** 工具挂在 `ctx.tools` 上,另有一条策略感知上下文 `logicprobe:mode`(`ctx.systemPrompt`),以及模型可见目录条目(`cordis_inspect`)。
|
|
71
|
+
|
|
72
|
+
工具清单:
|
|
73
|
+
|
|
74
|
+
| 工具 | 作用 |
|
|
75
|
+
|------|------|
|
|
76
|
+
| `logicprobe_verify` | 状态机验证:S1-S8 结构检查 + A1-A14 对抗探针。传 `beforeModel` 与 `stateMapping` 可加做 D1-D4 前后回归。 |
|
|
77
|
+
| `logicprobe_datamodel_verify` | 数据模型验证:DataModelV1、迁移覆盖、copy 一致性、DD1-DD4 数据回归。 |
|
|
78
|
+
| `logicprobe_concurrency_scan` | 扫描并发风险声称(thread-safe、lock-free、race condition、mutex 等),标注需要专用验证。 |
|
|
79
|
+
| `logicprobe_compose_verify` | 两台及以上状态机组合验证(握手 rendezvous 语义):C1 组合死锁、C2 握手永不触发。 |
|
|
80
|
+
| `logicprobe_export` | 导出外部工具原生输入:UPPAAL(`.xta` + queries)、TLA+(TLC 模块)、PRISM(DTMC `.pm` + `.pctl`)、SPIN(Promela + ltl)。 |
|
|
81
|
+
| `logicprobe_uml` | 用 UML 建模代码流程,并审查这份建模。见下方「UML 建模与审查」。 |
|
|
82
|
+
|
|
83
|
+
迁移代价用 `cost`(缺省 1),配 `budget` 不变量即由 A12 检查最坏路径代价,正成本环会被判为无界。迁移权重用 `weight`(缺省 1),配 `probability` 不变量即由 A13 计算概率可达。状态上的 `onEntry`/`onExit` 动作由 A4 自动纳入配对检查,`maxTicks` 加 `tickEvents` 由 A14 检查期限。
|
|
76
84
|
|
|
77
85
|
安装(原生 bundle,推荐):
|
|
78
86
|
|
|
@@ -85,22 +93,42 @@ dsh plugin --profile web add "github:AmethystLuna/logicprobe"
|
|
|
85
93
|
npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-logicprobe
|
|
86
94
|
```
|
|
87
95
|
|
|
88
|
-
|
|
96
|
+
装完重启 profile。运行 `dsh --profile web --dump-config` 应看到 `id: logicprobe` 且 `enabled: true`。更多方式(纯技能拷贝、项目级等)见 [`.dsh/INSTALL.md`](.dsh/INSTALL.md)。
|
|
97
|
+
|
|
98
|
+
> 注意包名。npm 包名是 `dsh-logicprobe`,没有 scope。在 web profile 的 `package.json` 中,依赖键与 `dsh.profile.bundles` 必须都写 `dsh-logicprobe`。写错时 dsh 加载器找不到 `node_modules/dsh-logicprobe`,启动会失败。
|
|
89
99
|
|
|
90
|
-
|
|
100
|
+
## UML 建模与审查
|
|
101
|
+
|
|
102
|
+
`logicprobe_uml` 把一份 LogicModelV1 画成 UML,也可以把手绘的 UML 读回模型,还可以审查建模本身。它有 3 个动作:
|
|
103
|
+
|
|
104
|
+
- **render**:模型 → 图。Mermaid 支持状态图、活动流程图、时序图;PlantUML 支持状态图与时序图。notation 表达不了的构造会变成 warning,不会被悄悄丢掉。PlantUML 活动图直接拒绝,因为它的语法无法忠实承载带合流或环的图。
|
|
105
|
+
- **parse**:图 → 模型。支持 Mermaid 与 PlantUML 的状态图、活动图,因此手绘的图也能送进 `logicprobe_verify` 验证。时序图是迹而不是机,解析会被拒绝。
|
|
106
|
+
- **review**:审查建模。它报告两类问题。结构缺陷包括不可达状态、死端、歧义分支、无出口自环、重复迁移。文档缺口包括缺 narrative、变量无界、状态无可读标注、图与 narrative 标签漂移。它还会做保真度检查:把图重新解析回模型,任何结构性差异都报出来。
|
|
107
|
+
|
|
108
|
+
保真度是这套功能的核心。生成的图带有 `logicprobe:` 注释指令(init、终态、别名、变量类型),Mermaid 与 PlantUML 会忽略它们,而解析器会读取它们。因此「图 ↔ 模型」的比较是精确的。
|
|
109
|
+
|
|
110
|
+
审查只覆盖建模,不覆盖行为。每条发现都会指明应该跑哪一项引擎检查。完整清单(`UML001`-`UML019`)、指令格式、示例与各视图局限见 [`skills/logicprobe/references/uml-modeling-guide.md`](skills/logicprobe/references/uml-modeling-guide.md)。
|
|
91
111
|
|
|
92
112
|
## 使用
|
|
93
113
|
|
|
94
|
-
|
|
114
|
+
插件在会话首个模型步骤自动注入能力通知。任务匹配技能的 `Use when` 描述时技能生效:
|
|
95
115
|
|
|
96
116
|
- **设计文档 / 计划审查** — "Review this design document" → 声称枚举与代码库核查
|
|
97
|
-
- **行为类问题** — "could this state machine deadlock"、"is this retry limit safe"
|
|
98
|
-
- **重构计划** —
|
|
99
|
-
-
|
|
117
|
+
- **行为类问题** — "could this state machine deadlock"、"is this retry limit safe" → 主动建议(不自动加载)作为可选验证
|
|
118
|
+
- **重构计划** — 对比前后模型,标记计划未声明的行为变化
|
|
119
|
+
- **数据模型 / 迁移审查** — "is this migration non-breaking" → 使用 `logicprobe-datamodel` 技能
|
|
120
|
+
- **代码流程建模** — "把这个状态机画出来"、"这份 UML 图对吗" → 用 `logicprobe_uml` 出图并审查建模,随后仍用 `logicprobe_verify` 验证行为
|
|
100
121
|
|
|
101
122
|
技能在 Phase 0 依据计划特征自动分级(LIGHTWEIGHT / STANDARD / ESCALATED),并在计划文件追加 `## Plan Verification` 摘要块作为审计痕迹。
|
|
102
123
|
|
|
103
|
-
Python
|
|
124
|
+
Python 可选。已有 LogicModelV1 JSON 时,可直接运行独立引擎 `skills/logicprobe/references/logicprobe-engine.py`:
|
|
125
|
+
|
|
126
|
+
- `verify` 跑 S1-S8 / A1-A14 / D1-D4
|
|
127
|
+
- `compose` 跑 C1 / C2 组合
|
|
128
|
+
- `export` 生成 UPPAAL、TLA+、PRISM、SPIN 输入
|
|
129
|
+
- `uml-render`、`uml-parse`、`uml-review` 覆盖 UML 前端
|
|
130
|
+
|
|
131
|
+
它与 dsh 工具逐字节一致,对照见 `tests/python/run.mjs`。模型只有抽取出的状态表时,填充模板 `skills/logicprobe/references/verification-harness.py`。数据模型验证使用 `skills/logicprobe-datamodel/references/data-model-harness.py`。Python 不可用(例如离线开发机)时,对应 guide 提供手动验证模式。
|
|
104
132
|
|
|
105
133
|
示例模型见 [`examples/`](examples/README.md):订单状态机 before/after、电商数据模型、User 字段迁移。
|
|
106
134
|
|
|
@@ -169,7 +197,7 @@ git clone https://github.com/AmethystLuna/logicprobe.git ~/.kimi/plugins/logicpr
|
|
|
169
197
|
|
|
170
198
|
## ZCode (Z.AI)
|
|
171
199
|
|
|
172
|
-
ZCode 3.0+ 遵循 Agent Skills
|
|
200
|
+
ZCode 3.0+ 遵循 Agent Skills 标准。它没有插件市场,手动把技能复制过去:
|
|
173
201
|
|
|
174
202
|
```bash
|
|
175
203
|
git clone https://github.com/AmethystLuna/logicprobe.git
|
|
@@ -180,10 +208,10 @@ cp -r logicprobe/skills/* .zcode/skills/
|
|
|
180
208
|
|
|
181
209
|
## 环境要求
|
|
182
210
|
|
|
183
|
-
- Claude Code v2.1+ / Codex CLI 最新 / Cursor 2.5+ / Kimi CLI 最新 / OpenCode 最新 / ZCode 3.0+
|
|
184
|
-
- DeepSeek Harness (dsh)
|
|
185
|
-
- Web 端的「Gate 注入」开关需要 **dsh ≥ 0.1.7-alpha.1
|
|
186
|
-
- Python 3.6+
|
|
211
|
+
- 宿主:Claude Code v2.1+ / Codex CLI 最新 / Cursor 2.5+ / Kimi CLI 最新 / OpenCode 最新 / ZCode 3.0+
|
|
212
|
+
- DeepSeek Harness (dsh):dev preview,声明支持 `>= 0.1.0-rc.7`。最新一轮在 0.2.1-alpha.1 上实测了安装、挂载、启动与卸载;更早一轮实测覆盖 0.1.5-rc.2 到 0.2.0-rc.2。逐版本证据见 [DSH-COMPATIBILITY.md](DSH-COMPATIBILITY.md)。
|
|
213
|
+
- Web 端的「Gate 注入」开关需要 **dsh ≥ 0.1.7-alpha.1**,因为设置服务必须能投影即时字段。更早的 dsh 上插件照常加载、照常注入,只是开关不出现,也不报错。
|
|
214
|
+
- Python 3.6+ 可选,仅自动验证工具需要。手动兜底模式不需要任何依赖。
|
|
187
215
|
|
|
188
216
|
## 配置
|
|
189
217
|
|
|
@@ -193,9 +221,9 @@ cp -r logicprobe/skills/* .zcode/skills/
|
|
|
193
221
|
|---|---|---|---|
|
|
194
222
|
| `enabled` | boolean | `true` | 设为 `false` 可关闭首步 Gate 注入。 |
|
|
195
223
|
| `gateContent` | string | 内置 gate 文本 | 覆盖注入到首轮模型上下文中的文本。 |
|
|
196
|
-
| `interaction` | `ask` \| `auto` \| `follow-approval` | `follow-approval` |
|
|
224
|
+
| `interaction` | `ask` \| `auto` \| `follow-approval` | `follow-approval` | 模型确认策略。`follow-approval` 在会话 approval policy 为 `never` 时解析为 `auto`。 |
|
|
197
225
|
|
|
198
|
-
在 dsh Web GUI 里可以直接改这个开关:侧边栏 **插件** → 本插件卡片 → 「Gate 注入」。它实时生效,不必重启 profile
|
|
226
|
+
在 dsh Web GUI 里可以直接改这个开关:侧边栏 **插件** → 本插件卡片 → 「Gate 注入」。它实时生效,不必重启 profile。它只管注入的那段文本:关掉后 skills 与验证工具照常注册。同一张卡片上还有一个更粗粒度的行开关,关掉它会整行卸载插件,技能、工具和这个开关一起消失。要持久化覆盖,仍按下面的 profile patch 写。
|
|
199
227
|
|
|
200
228
|
在 profile 的 `cordis.patch.yml` 中按 row id 覆盖:
|
|
201
229
|
|
|
@@ -212,20 +240,20 @@ cp -r logicprobe/skills/* .zcode/skills/
|
|
|
212
240
|
|
|
213
241
|
## 卸载
|
|
214
242
|
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
243
|
+
- 通过 DSH 插件管理器安装的,用同一管理器从目标 profile 中移除 `logicprobe`。
|
|
244
|
+
- 手动复制过 `skills/*` 的,删除 `~/.agents/skills/` 或项目 `.dsh/skills/` 下的对应目录。
|
|
245
|
+
- 通过 `cordis.patch.yml` 添加的,删除 profile patch 中 `id: logicprobe` 的行,并重启 DSH。
|
|
218
246
|
|
|
219
247
|
## 权限与数据
|
|
220
248
|
|
|
221
249
|
- 插件运行时只读取包内自带的 `skills/` 目录,用于通过 DSH 标准 filesystem skill provider 注册技能。
|
|
222
250
|
- 它会在会话首轮向模型上下文注入配置好的 gate 文本。
|
|
223
|
-
-
|
|
251
|
+
- 它不读取凭据,不发起网络连接,也不访问 DSH 会话上下文之外的用户数据。
|
|
224
252
|
- 实际使用技能时,模型会像使用其他编码技能一样,按用户指示读取项目文件。
|
|
225
253
|
|
|
226
254
|
## 故障排查
|
|
227
255
|
|
|
228
|
-
- 技能在 DSH 中不可见:确认 DSH 版本支持 `ctx.skills`
|
|
256
|
+
- 技能在 DSH 中不可见:确认 DSH 版本支持 `ctx.skills` 与 Agent Skills 发现,并在安装后重启 profile。
|
|
229
257
|
- Gate 未注入:检查 `enabled` 是否为 `false`,以及 profile patch 中是否存在 `id: logicprobe` 的行。
|
|
230
258
|
- 插件管理器拒绝安装:确认 `@deepseek-ai/*` 包声明在 `peerDependencies` 中,而不是 `dependencies`。
|
|
231
259
|
- 手动复制后 DSH 仍看不到技能:改用原生 bundle 安装(`dsh plugin add "github:AmethystLuna/logicprobe"`)。
|
|
@@ -240,10 +268,12 @@ npm run build
|
|
|
240
268
|
|
|
241
269
|
测试链:
|
|
242
270
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
271
|
+
| 命令 | 内容 |
|
|
272
|
+
|---|---|
|
|
273
|
+
| `npm run test:engine` | 状态机与数据模型引擎回归(`tests/engine`、`tests/data-engine`、`tests/concurrency`、`tests/uml`、`tests/apply-smoke`、`tests/dsh-client-half`、`tests/exporters`、`tests/external`),再加 Python 逐字节一致性对照。对照脚本是 `tests/python/run.mjs`,它把同一批 fixture 在 TS 引擎与 `skills/logicprobe/references/logicprobe-engine.py` 之间比对报告、组合与导出产物。无 Python 时自动 SKIP。 |
|
|
274
|
+
| `npm run test:full` | `tests/full-suite.mjs` 端到端合并套件 |
|
|
275
|
+
| `npm run test:python` | 仅 Python parity(构建 + `tests/python/run.mjs`) |
|
|
276
|
+
| `bash tests/skill-triggering/run-all.sh` | 触发测试,位于 `tests/skill-triggering/` |
|
|
247
277
|
|
|
248
278
|
## 许可证与安全
|
|
249
279
|
|
|
@@ -255,7 +285,7 @@ npm run build
|
|
|
255
285
|
|
|
256
286
|
| 插件 | 说明 |
|
|
257
287
|
|------|------|
|
|
258
|
-
| [embedded-workbench](https://github.com/AmethystLuna/embedded-workbench) | 嵌入式 C/C++ 工具箱,其 Plan Verification Gate
|
|
288
|
+
| [embedded-workbench](https://github.com/AmethystLuna/embedded-workbench) | 嵌入式 C/C++ 工具箱,其 Plan Verification Gate 依赖本技能。本插件由 embedded-workbench 拆分而来。 |
|
|
259
289
|
|
|
260
290
|
## 致谢
|
|
261
291
|
|
package/lib/index.js
CHANGED
|
@@ -33,6 +33,7 @@ import { logicProbeDataModelVerifyTool, DATA_ENGINE_SCHEMA_VERSION } from './dat
|
|
|
33
33
|
import { logicProbeConcurrencyScanTool } from './concurrency-tool.js';
|
|
34
34
|
import { logicProbeComposeTool } from './compose-tool.js';
|
|
35
35
|
import { logicProbeExportTool } from './export-tool.js';
|
|
36
|
+
import { logicProbeUmlTool } from './uml-tool.js';
|
|
36
37
|
import { ENGINE_SCHEMA_VERSION } from './engine.js';
|
|
37
38
|
export const name = 'logicprobe';
|
|
38
39
|
// Skills are contributed through the registry service, which dsh-base always
|
|
@@ -59,7 +60,7 @@ Plugin logicprobe is active. Documents are not truth — code is. Verify every v
|
|
|
59
60
|
| "I'll verify while implementing" | Verification happens before implementation, not during. |
|
|
60
61
|
| "I can check this with reasoning alone" | Behavioral claims are verified with code/models, not intuition. One counter-example refutes a universal claim. |
|
|
61
62
|
|
|
62
|
-
**Native verification path**: In dsh, prefer the \`logicprobe_verify\` tool for state-machine checks and \`logicprobe_datamodel_verify\` for data-model/schema migration checks. Both support before/after regression and common domain constraints (idempotency, monotonic, sequence, leads-to, atomicity). Python harnesses remain the fallback for non-dsh hosts.
|
|
63
|
+
**Native verification path**: In dsh, prefer the \`logicprobe_verify\` tool for state-machine checks and \`logicprobe_datamodel_verify\` for data-model/schema migration checks. Both support before/after regression and common domain constraints (idempotency, monotonic, sequence, leads-to, atomicity). To model a code flow as UML, or to audit such a modelling, use \`logicprobe_uml\` (render | parse | review). Python harnesses remain the fallback for non-dsh hosts.
|
|
63
64
|
|
|
64
65
|
**Proactive suggestion**: When a user asks code-level behavioral questions — "could this state machine deadlock", "is this retry limit safe", "check this timing sequence for bugs", "is this migration non-breaking", "does this copy cover all required fields" — suggest logicprobe as an optional verification pass (do not auto-escalate).
|
|
65
66
|
</EXTREMELY_IMPORTANT>`;
|
|
@@ -146,6 +147,7 @@ function modeContextText(config, session) {
|
|
|
146
147
|
const interaction = resolveInteraction(config, session);
|
|
147
148
|
const lines = [
|
|
148
149
|
'logicprobe: use `logicprobe_verify` for state machines and `logicprobe_datamodel_verify` for data models; both cover before/after regression and common domain constraints.',
|
|
150
|
+
'logicprobe: use `logicprobe_uml` to model a code flow as UML (render), to read a UML diagram back into a model (parse), or to audit the modelling (review: structural defects, documentation gaps, diagram-vs-model round-trip fidelity).',
|
|
149
151
|
interaction === 'auto'
|
|
150
152
|
? 'logicprobe interaction=auto: do NOT call ask_user_question for model confirmation; run round-trip validation of the extracted transition table and mark the result UNCONFIRMED.'
|
|
151
153
|
: 'logicprobe interaction=ask: show the extracted transition table and get user confirmation before running verification.',
|
|
@@ -160,7 +162,7 @@ function modeContextText(config, session) {
|
|
|
160
162
|
* lets the model read this plugin's runtime status without guessing. Mirrors
|
|
161
163
|
* the registration pattern of the official dsh-tool-cordis host providers.
|
|
162
164
|
*/
|
|
163
|
-
function inspectProvider(config, isToolRegistered, isDataToolRegistered, isConcurrencyToolRegistered, isComposeToolRegistered, isExportToolRegistered) {
|
|
165
|
+
function inspectProvider(config, isToolRegistered, isDataToolRegistered, isConcurrencyToolRegistered, isComposeToolRegistered, isExportToolRegistered, isUmlToolRegistered) {
|
|
164
166
|
return {
|
|
165
167
|
manifest: {
|
|
166
168
|
id: 'logicprobe',
|
|
@@ -186,10 +188,11 @@ function inspectProvider(config, isToolRegistered, isDataToolRegistered, isConcu
|
|
|
186
188
|
concurrencyToolRegistered: { type: 'boolean', description: 'Whether the logicprobe_concurrency_scan tool is registered on ctx.tools.' },
|
|
187
189
|
composeToolRegistered: { type: 'boolean', description: 'Whether the logicprobe_compose_verify tool is registered on ctx.tools.' },
|
|
188
190
|
exportToolRegistered: { type: 'boolean', description: 'Whether the logicprobe_export tool is registered on ctx.tools.' },
|
|
191
|
+
umlToolRegistered: { type: 'boolean', description: 'Whether the logicprobe_uml tool (UML modelling + modelling review) is registered on ctx.tools.' },
|
|
189
192
|
engineSchemaVersion: { type: 'integer', description: 'Model schema version the bundled state-machine verification engine accepts.' },
|
|
190
193
|
dataEngineSchemaVersion: { type: 'integer', description: 'Model schema version the bundled data-model verification engine accepts.' },
|
|
191
194
|
},
|
|
192
|
-
required: ['enabled', 'gateContentLength', 'interaction', 'toolRegistered', 'dataToolRegistered', 'concurrencyToolRegistered', 'composeToolRegistered', 'exportToolRegistered', 'engineSchemaVersion', 'dataEngineSchemaVersion'],
|
|
195
|
+
required: ['enabled', 'gateContentLength', 'interaction', 'toolRegistered', 'dataToolRegistered', 'concurrencyToolRegistered', 'composeToolRegistered', 'exportToolRegistered', 'umlToolRegistered', 'engineSchemaVersion', 'dataEngineSchemaVersion'],
|
|
193
196
|
additionalProperties: false,
|
|
194
197
|
},
|
|
195
198
|
},
|
|
@@ -206,6 +209,7 @@ function inspectProvider(config, isToolRegistered, isDataToolRegistered, isConcu
|
|
|
206
209
|
concurrencyToolRegistered: isConcurrencyToolRegistered(),
|
|
207
210
|
composeToolRegistered: isComposeToolRegistered(),
|
|
208
211
|
exportToolRegistered: isExportToolRegistered(),
|
|
212
|
+
umlToolRegistered: isUmlToolRegistered(),
|
|
209
213
|
engineSchemaVersion: ENGINE_SCHEMA_VERSION,
|
|
210
214
|
dataEngineSchemaVersion: DATA_ENGINE_SCHEMA_VERSION,
|
|
211
215
|
};
|
|
@@ -224,6 +228,7 @@ export function apply(ctx, config) {
|
|
|
224
228
|
let concurrencyToolRegistered = false;
|
|
225
229
|
let composeToolRegistered = false;
|
|
226
230
|
let exportToolRegistered = false;
|
|
231
|
+
let umlToolRegistered = false;
|
|
227
232
|
let modeContextRegistered = false;
|
|
228
233
|
const registerProvider = () => {
|
|
229
234
|
if (providerRegistered)
|
|
@@ -232,7 +237,7 @@ export function apply(ctx, config) {
|
|
|
232
237
|
if (inspect === undefined)
|
|
233
238
|
return;
|
|
234
239
|
try {
|
|
235
|
-
ctx.effect(() => inspect.register(inspectProvider(config, () => toolRegistered, () => dataToolRegistered, () => concurrencyToolRegistered, () => composeToolRegistered, () => exportToolRegistered)), 'logicprobe: inspect provider');
|
|
240
|
+
ctx.effect(() => inspect.register(inspectProvider(config, () => toolRegistered, () => dataToolRegistered, () => concurrencyToolRegistered, () => composeToolRegistered, () => exportToolRegistered, () => umlToolRegistered)), 'logicprobe: inspect provider');
|
|
236
241
|
providerRegistered = true;
|
|
237
242
|
}
|
|
238
243
|
catch (err) {
|
|
@@ -251,11 +256,13 @@ export function apply(ctx, config) {
|
|
|
251
256
|
ctx.effect(() => tools.register(logicProbeConcurrencyScanTool), 'logicprobe: concurrency scan tool');
|
|
252
257
|
ctx.effect(() => tools.register(logicProbeComposeTool), 'logicprobe: compose tool');
|
|
253
258
|
ctx.effect(() => tools.register(logicProbeExportTool), 'logicprobe: export tool');
|
|
259
|
+
ctx.effect(() => tools.register(logicProbeUmlTool), 'logicprobe: uml tool');
|
|
254
260
|
toolRegistered = true;
|
|
255
261
|
dataToolRegistered = true;
|
|
256
262
|
concurrencyToolRegistered = true;
|
|
257
263
|
composeToolRegistered = true;
|
|
258
264
|
exportToolRegistered = true;
|
|
265
|
+
umlToolRegistered = true;
|
|
259
266
|
}
|
|
260
267
|
catch (err) {
|
|
261
268
|
console.warn('[logicprobe] logicprobe_verify/logicprobe_datamodel_verify tool registration failed', err);
|