dsh-logicprobe 0.4.0 → 0.5.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.
Files changed (33) hide show
  1. package/README.en-US.md +7 -1
  2. package/README.md +7 -1
  3. package/lib/concurrency-tool.js +34 -0
  4. package/lib/concurrency.js +76 -0
  5. package/lib/data-engine.js +930 -0
  6. package/lib/data-tool.js +61 -0
  7. package/lib/engine.js +1622 -1364
  8. package/lib/index.js +291 -277
  9. package/lib/tool.js +57 -57
  10. package/lib/types/concurrency-tool.d.ts +8 -0
  11. package/lib/types/concurrency.d.ts +20 -0
  12. package/lib/types/data-engine.d.ts +199 -0
  13. package/lib/types/data-tool.d.ts +10 -0
  14. package/lib/types/engine.d.ts +171 -151
  15. package/package.json +79 -78
  16. package/skills/logicprobe/SKILL.md +285 -268
  17. package/skills/logicprobe/references/__pycache__/verification-harness.cpython-312.pyc +0 -0
  18. package/skills/logicprobe/references/concurrency-risk-guide.md +54 -0
  19. package/skills/logicprobe/references/dsh-model-schema.md +145 -129
  20. package/skills/logicprobe/references/logic-verification-guide.md +463 -413
  21. package/skills/logicprobe/references/verification-harness.py +806 -582
  22. package/skills/logicprobe-datamodel/SKILL.md +124 -0
  23. package/skills/logicprobe-datamodel/references/__pycache__/data-model-harness.cpython-312.pyc +0 -0
  24. package/skills/logicprobe-datamodel/references/data-model-guide.md +62 -0
  25. package/skills/logicprobe-datamodel/references/data-model-harness.py +528 -0
  26. package/skills/logicprobe-datamodel/references/data-model-schema.md +128 -0
  27. package/src/concurrency-tool.ts +37 -0
  28. package/src/concurrency.ts +102 -0
  29. package/src/data-engine.ts +1001 -0
  30. package/src/data-tool.ts +65 -0
  31. package/src/engine.ts +234 -0
  32. package/src/index.ts +315 -301
  33. package/src/tool.ts +60 -60
package/lib/tool.js CHANGED
@@ -1,57 +1,57 @@
1
- import { defineTool } from '@deepseek-ai/dsh-tools';
2
- import { runVerification } from './engine.js';
3
- export const LOGICPROBE_VERIFY_TOOL_NAME = 'logicprobe_verify';
4
- /**
5
- * Model-visible DSH tool wrapping the bundled TypeScript verification engine.
6
- * The model passes a LogicModelV1 object; the engine validates it and returns
7
- * the 14-check report, or an 18-check report when beforeModel is supplied
8
- * (D1 behavioral preservation, D2 invariant continuity, D3 regression delta,
9
- * D4 deadlock/liveness regression). This is the dsh-native replacement for
10
- * hand-filling the Python template shipped in the skill references.
11
- */
12
- export const logicProbeVerifyTool = defineTool({
13
- name: LOGICPROBE_VERIFY_TOOL_NAME,
14
- description: 'Run executable state-machine verification (logicprobe). Takes a LogicModelV1 object with schemaVersion=1, init, states ({id, terminal?}), transitions ({from, event, to, guard?, updates?}), variables?, invariants?, concurrentPairs?, boundaryChecks?, resourcePairs?. Guards are structured ({variable, op, value} | {all} | {any} | {not}); invariants support never-states, var-in-range, and event-before-state. Returns a report with S1-S7 structural checks and A1-A7 adversarial probes including shortest counterexample paths. If beforeModel is provided, also runs D1-D4 before/after regression checks. See skills/logicprobe/references/dsh-model-schema.md.',
15
- parameters: {
16
- model: {
17
- type: 'json',
18
- required: true,
19
- description: 'LogicModelV1 state machine model to verify.',
20
- },
21
- maxStates: {
22
- type: 'integer',
23
- description: 'Maximum runtime states to explore. Default 10000.',
24
- },
25
- maxPermutationEvents: {
26
- type: 'integer',
27
- description: 'Maximum event count for A3 order permutation. Default 5.',
28
- },
29
- beforeModel: {
30
- type: 'json',
31
- description: 'Optional BEFORE LogicModelV1 state machine model for refactoring/migration regression comparison.',
32
- },
33
- stateMapping: {
34
- type: 'json',
35
- description: 'Optional object mapping BEFORE state ids to AFTER state ids. Omit for identity mapping (same state names).',
36
- },
37
- },
38
- output: {
39
- schema: {
40
- type: 'json',
41
- description: 'logicprobe verification report with summary and per-check findings.',
42
- },
43
- render(_args, value) {
44
- return [{ type: 'text', text: JSON.stringify(value, null, 2) }];
45
- },
46
- },
47
- timeoutMs: 10_000,
48
- isConcurrencySafe: () => true,
49
- async execute(args) {
50
- return runVerification(args.model, {
51
- maxStates: args.maxStates,
52
- maxPermutationEvents: args.maxPermutationEvents,
53
- beforeModel: args.beforeModel,
54
- stateMapping: args.stateMapping,
55
- });
56
- },
57
- });
1
+ import { defineTool } from '@deepseek-ai/dsh-tools';
2
+ import { runVerification } from './engine.js';
3
+ export const LOGICPROBE_VERIFY_TOOL_NAME = 'logicprobe_verify';
4
+ /**
5
+ * Model-visible DSH tool wrapping the bundled TypeScript verification engine.
6
+ * The model passes a LogicModelV1 object; the engine validates it and returns
7
+ * the 14-check report, or an 18-check report when beforeModel is supplied
8
+ * (D1 behavioral preservation, D2 invariant continuity, D3 regression delta,
9
+ * D4 deadlock/liveness regression). This is the dsh-native replacement for
10
+ * hand-filling the Python template shipped in the skill references.
11
+ */
12
+ export const logicProbeVerifyTool = defineTool({
13
+ name: LOGICPROBE_VERIFY_TOOL_NAME,
14
+ description: 'Run executable state-machine verification (logicprobe). Takes a LogicModelV1 object with schemaVersion=1, init, states ({id, terminal?}), transitions ({from, event, to, guard?, updates?}), variables?, invariants?, concurrentPairs?, boundaryChecks?, resourcePairs?, idempotentEvents?. Guards are structured ({variable, op, value} | {all} | {any} | {not}); invariants support never-states, var-in-range, event-before-state, leads-to, sequence, and atomicity; variables support monotonic inc/dec. Returns a report with S1-S7 structural checks and A1-A7 adversarial probes including shortest counterexample paths. If beforeModel is provided, also runs D1-D4 before/after regression checks. See skills/logicprobe/references/dsh-model-schema.md.',
15
+ parameters: {
16
+ model: {
17
+ type: 'json',
18
+ required: true,
19
+ description: 'LogicModelV1 state machine model to verify.',
20
+ },
21
+ maxStates: {
22
+ type: 'integer',
23
+ description: 'Maximum runtime states to explore. Default 10000.',
24
+ },
25
+ maxPermutationEvents: {
26
+ type: 'integer',
27
+ description: 'Maximum event count for A3 order permutation. Default 5.',
28
+ },
29
+ beforeModel: {
30
+ type: 'json',
31
+ description: 'Optional BEFORE LogicModelV1 state machine model for refactoring/migration regression comparison.',
32
+ },
33
+ stateMapping: {
34
+ type: 'json',
35
+ description: 'Optional object mapping BEFORE state ids to AFTER state ids. Omit for identity mapping (same state names).',
36
+ },
37
+ },
38
+ output: {
39
+ schema: {
40
+ type: 'json',
41
+ description: 'logicprobe verification report with summary and per-check findings.',
42
+ },
43
+ render(_args, value) {
44
+ return [{ type: 'text', text: JSON.stringify(value, null, 2) }];
45
+ },
46
+ },
47
+ timeoutMs: 10_000,
48
+ isConcurrencySafe: () => true,
49
+ async execute(args) {
50
+ return runVerification(args.model, {
51
+ maxStates: args.maxStates,
52
+ maxPermutationEvents: args.maxPermutationEvents,
53
+ beforeModel: args.beforeModel,
54
+ stateMapping: args.stateMapping,
55
+ });
56
+ },
57
+ });
@@ -0,0 +1,8 @@
1
+ export declare const LOGICPROBE_CONCURRENCY_SCAN_TOOL_NAME = "logicprobe_concurrency_scan";
2
+ /**
3
+ * Model-visible DSH tool that mines design documents/plans for concurrency-related
4
+ * claims and risk keywords. It does not prove concurrency safety; it flags terms
5
+ * such as "thread-safe", "lock-free", "race condition", "atomic", "mutex", etc.,
6
+ * so the model can either provide dedicated evidence or mark the claim unverified.
7
+ */
8
+ export declare const logicProbeConcurrencyScanTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
@@ -0,0 +1,20 @@
1
+ export interface ConcurrencyFinding {
2
+ code: 'CONCURRENCY_KEYWORD' | 'CONCURRENCY_ABSOLUTE_CLAIM';
3
+ severity: 'warning' | 'error';
4
+ message: string;
5
+ line?: number;
6
+ snippet?: string;
7
+ keyword: string;
8
+ }
9
+ export interface ConcurrencyScanReport {
10
+ ok: boolean;
11
+ findings: ConcurrencyFinding[];
12
+ summary: {
13
+ lines: number;
14
+ keywords: number;
15
+ absoluteClaims: number;
16
+ warnings: number;
17
+ errors: number;
18
+ };
19
+ }
20
+ export declare function runConcurrencyScan(text: string): ConcurrencyScanReport;
@@ -0,0 +1,199 @@
1
+ import type { CheckResult } from './engine.js';
2
+ export declare const DATA_ENGINE_SCHEMA_VERSION = 1;
3
+ export type DataValue = number | string | boolean | null;
4
+ export type DataType = 'string' | 'integer' | 'number' | 'boolean' | 'uuid' | 'date' | 'datetime' | 'timestamp' | 'json' | 'enum' | 'array' | 'object' | 'binary';
5
+ export interface FieldSpec {
6
+ name: string;
7
+ type: DataType | string;
8
+ required?: boolean;
9
+ unique?: boolean;
10
+ nullable?: boolean;
11
+ default?: DataValue;
12
+ min?: number;
13
+ max?: number;
14
+ minLength?: number;
15
+ maxLength?: number;
16
+ pattern?: string;
17
+ enum?: DataValue[];
18
+ ref?: string;
19
+ items?: FieldSpec;
20
+ monotonic?: 'inc' | 'dec';
21
+ }
22
+ export interface EntitySpec {
23
+ name: string;
24
+ fields: FieldSpec[];
25
+ primaryKey?: string[];
26
+ uniqueKeys?: string[][];
27
+ indexes?: string[][];
28
+ }
29
+ export interface RelationshipSpec {
30
+ name?: string;
31
+ fromEntity: string;
32
+ fromField: string;
33
+ toEntity: string;
34
+ toField?: string;
35
+ onDelete?: 'cascade' | 'restrict' | 'set-null' | 'no-action';
36
+ }
37
+ export type DataInvariantSpec = {
38
+ id: string;
39
+ description: string;
40
+ kind: 'field-required';
41
+ entity: string;
42
+ field: string;
43
+ } | {
44
+ id: string;
45
+ description: string;
46
+ kind: 'unique';
47
+ entity: string;
48
+ fields: string[];
49
+ } | {
50
+ id: string;
51
+ description: string;
52
+ kind: 'referential-integrity';
53
+ entity: string;
54
+ field: string;
55
+ refEntity: string;
56
+ refField?: string;
57
+ } | {
58
+ id: string;
59
+ description: string;
60
+ kind: 'range';
61
+ entity: string;
62
+ field: string;
63
+ min?: number;
64
+ max?: number;
65
+ } | {
66
+ id: string;
67
+ description: string;
68
+ kind: 'count-equal';
69
+ sourceEntity: string;
70
+ targetEntity: string;
71
+ } | {
72
+ id: string;
73
+ description: string;
74
+ kind: 'field-equal';
75
+ sourceEntity: string;
76
+ sourceField: string;
77
+ targetEntity: string;
78
+ targetField: string;
79
+ } | {
80
+ id: string;
81
+ description: string;
82
+ kind: 'no-orphan';
83
+ entity: string;
84
+ field: string;
85
+ refEntity: string;
86
+ } | {
87
+ id: string;
88
+ description: string;
89
+ kind: 'idempotent-copy';
90
+ sourceEntity: string;
91
+ targetEntity: string;
92
+ } | {
93
+ id: string;
94
+ description: string;
95
+ kind: 'idempotent-migration';
96
+ from: string;
97
+ to: string;
98
+ } | {
99
+ id: string;
100
+ description: string;
101
+ kind: 'monotonic';
102
+ entity: string;
103
+ field: string;
104
+ direction: 'inc' | 'dec';
105
+ } | {
106
+ id: string;
107
+ description: string;
108
+ kind: 'sequence';
109
+ steps: string[];
110
+ } | {
111
+ id: string;
112
+ description: string;
113
+ kind: 'leads-to';
114
+ entity: string;
115
+ field: string;
116
+ from: DataValue;
117
+ to: DataValue;
118
+ } | {
119
+ id: string;
120
+ description: string;
121
+ kind: 'atomicity';
122
+ steps: string[];
123
+ };
124
+ export interface DataModelV1 {
125
+ schemaVersion: 1;
126
+ entities: EntitySpec[];
127
+ relationships?: RelationshipSpec[];
128
+ invariants?: DataInvariantSpec[];
129
+ boundaryChecks?: Array<{
130
+ entity: string;
131
+ field: string;
132
+ values?: DataValue[];
133
+ }>;
134
+ }
135
+ export interface CopyPairSpec {
136
+ id: string;
137
+ sourceEntity: string;
138
+ targetEntity: string;
139
+ mapping: Record<string, string>;
140
+ }
141
+ export interface BackupPairSpec {
142
+ id: string;
143
+ sourceEntity: string;
144
+ targetEntity: string;
145
+ mapping: Record<string, string>;
146
+ }
147
+ export interface MigrationMappingSpec {
148
+ id?: string;
149
+ from: string;
150
+ to: string;
151
+ transform?: 'copy' | 'rename' | 'split' | 'merge' | 'drop' | 'manual';
152
+ note?: string;
153
+ }
154
+ export interface DataVerificationOptions {
155
+ beforeModel?: unknown;
156
+ fieldMapping?: Record<string, string>;
157
+ copyPairs?: CopyPairSpec[];
158
+ migrationMappings?: MigrationMappingSpec[];
159
+ backupPairs?: BackupPairSpec[];
160
+ }
161
+ export interface DataComparisonSummary {
162
+ beforeModelHash: string;
163
+ afterModelHash: string;
164
+ fieldMapping: Record<string, string>;
165
+ beforeEntities: number;
166
+ beforeFields: number;
167
+ afterEntities: number;
168
+ afterFields: number;
169
+ addedEntities: string[];
170
+ removedEntities: string[];
171
+ addedFields: string[];
172
+ removedFields: string[];
173
+ addedRelationships: string[];
174
+ removedRelationships: string[];
175
+ }
176
+ export interface DataVerificationReport {
177
+ ok: boolean;
178
+ schemaVersion: 1;
179
+ modelHash: string;
180
+ summary: {
181
+ entities: number;
182
+ fields: number;
183
+ errors: number;
184
+ warnings: number;
185
+ checksRun: number;
186
+ truncated?: boolean;
187
+ };
188
+ checks: CheckResult[];
189
+ comparison?: DataComparisonSummary;
190
+ }
191
+ export declare function dataModelHash(model: DataModelV1): string;
192
+ export declare function validateDataModel(input: unknown): {
193
+ ok: true;
194
+ model: DataModelV1;
195
+ } | {
196
+ ok: false;
197
+ errors: string[];
198
+ };
199
+ export declare function runDataVerification(input: unknown, options?: DataVerificationOptions): DataVerificationReport;
@@ -0,0 +1,10 @@
1
+ import { DATA_ENGINE_SCHEMA_VERSION } from './data-engine.js';
2
+ export declare const LOGICPROBE_DATAMODEL_VERIFY_TOOL_NAME = "logicprobe_datamodel_verify";
3
+ /**
4
+ * Model-visible DSH tool wrapping the bundled data-model verification engine.
5
+ * The model passes a DataModelV1 object; the engine validates it and returns
6
+ * DS/DA/DD checks. Optional beforeModel/fieldMapping/copyPairs/migrationMappings
7
+ * enable before/after data-model regression and migration coverage checks.
8
+ */
9
+ export declare const logicProbeDataModelVerifyTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
10
+ export { DATA_ENGINE_SCHEMA_VERSION };
@@ -1,151 +1,171 @@
1
- export declare const ENGINE_SCHEMA_VERSION = 1;
2
- export type VarValue = number | boolean;
3
- export type GuardOp = '==' | '!=' | '<' | '<=' | '>' | '>=';
4
- export interface LeafGuard {
5
- variable: string;
6
- op: GuardOp;
7
- value: VarValue;
8
- }
9
- export interface AllGuard {
10
- all: GuardNode[];
11
- }
12
- export interface AnyGuard {
13
- any: GuardNode[];
14
- }
15
- export interface NotGuard {
16
- not: GuardNode;
17
- }
18
- export type GuardNode = LeafGuard | AllGuard | AnyGuard | NotGuard;
19
- export interface StateSpec {
20
- id: string;
21
- terminal?: boolean;
22
- }
23
- export interface UpdateSpec {
24
- variable: string;
25
- op: 'set' | 'inc' | 'dec';
26
- value?: number;
27
- }
28
- export interface TransitionSpec {
29
- from: string;
30
- event: string;
31
- to: string;
32
- /** Absent guard is the else/default branch for the same (from, event) group. */
33
- guard?: GuardNode;
34
- updates?: UpdateSpec[];
35
- }
36
- export interface VariableSpec {
37
- name: string;
38
- kind: 'integer' | 'boolean';
39
- init: number | boolean;
40
- min?: number;
41
- max?: number;
42
- }
43
- export type InvariantSpec = {
44
- id: string;
45
- description: string;
46
- kind: 'never-states';
47
- states: string[];
48
- } | {
49
- id: string;
50
- description: string;
51
- kind: 'var-in-range';
52
- variable: string;
53
- min?: number;
54
- max?: number;
55
- } | {
56
- id: string;
57
- description: string;
58
- kind: 'event-before-state';
59
- event: string;
60
- state: string;
61
- };
62
- export interface ResourcePairSpec {
63
- resource: string;
64
- acquireEvent: string;
65
- releaseEvent: string;
66
- failEvent?: string;
67
- }
68
- export interface BoundaryCheckSpec {
69
- variable: string;
70
- values: number[];
71
- }
72
- export interface LogicModelV1 {
73
- schemaVersion: 1;
74
- init: string;
75
- states: StateSpec[];
76
- transitions: TransitionSpec[];
77
- variables?: VariableSpec[];
78
- invariants?: InvariantSpec[];
79
- concurrentPairs?: [string, string][];
80
- boundaryChecks?: BoundaryCheckSpec[];
81
- resourcePairs?: ResourcePairSpec[];
82
- }
83
- export interface VerificationOptions {
84
- maxStates?: number;
85
- maxPermutationEvents?: number;
86
- beforeModel?: unknown;
87
- stateMapping?: Record<string, string>;
88
- }
89
- export interface PathStep {
90
- from: string;
91
- event: string;
92
- to: string;
93
- }
94
- export interface Finding {
95
- code: string;
96
- severity: 'error' | 'warning';
97
- message: string;
98
- path?: PathStep[];
99
- evidence?: Record<string, unknown>;
100
- }
101
- export interface CheckResult {
102
- id: string;
103
- name: string;
104
- status: 'pass' | 'fail' | 'skip';
105
- detail: string;
106
- findings: Finding[];
107
- }
108
- export interface VerificationReport {
109
- ok: boolean;
110
- schemaVersion: 1;
111
- modelHash: string;
112
- summary: {
113
- states: number;
114
- transitions: number;
115
- errors: number;
116
- warnings: number;
117
- checksRun: number;
118
- truncated?: boolean;
119
- };
120
- checks: CheckResult[];
121
- comparison?: ComparisonSummary;
122
- }
123
- export interface ComparisonSummary {
124
- beforeModelHash: string;
125
- afterModelHash: string;
126
- stateMapping: Record<string, string>;
127
- beforeStates: number;
128
- beforeTransitions: number;
129
- afterStates: number;
130
- afterTransitions: number;
131
- addedStates: string[];
132
- removedStates: string[];
133
- addedEvents: string[];
134
- removedEvents: string[];
135
- addedTransitions: TransitionSpec[];
136
- removedTransitions: TransitionSpec[];
137
- }
138
- export interface RuntimeState {
139
- state: string;
140
- vars: Record<string, VarValue>;
141
- }
142
- export declare function modelHash(model: LogicModelV1): string;
143
- export declare function validateModel(input: unknown): {
144
- ok: true;
145
- model: LogicModelV1;
146
- } | {
147
- ok: false;
148
- errors: string[];
149
- };
150
- export declare function guardVariables(guard: GuardNode | undefined): string[];
151
- export declare function runVerification(input: unknown, options?: VerificationOptions): VerificationReport;
1
+ export declare const ENGINE_SCHEMA_VERSION = 1;
2
+ export type VarValue = number | boolean;
3
+ export type GuardOp = '==' | '!=' | '<' | '<=' | '>' | '>=';
4
+ export interface LeafGuard {
5
+ variable: string;
6
+ op: GuardOp;
7
+ value: VarValue;
8
+ }
9
+ export interface AllGuard {
10
+ all: GuardNode[];
11
+ }
12
+ export interface AnyGuard {
13
+ any: GuardNode[];
14
+ }
15
+ export interface NotGuard {
16
+ not: GuardNode;
17
+ }
18
+ export type GuardNode = LeafGuard | AllGuard | AnyGuard | NotGuard;
19
+ export interface StateSpec {
20
+ id: string;
21
+ terminal?: boolean;
22
+ }
23
+ export interface UpdateSpec {
24
+ variable: string;
25
+ op: 'set' | 'inc' | 'dec';
26
+ value?: number;
27
+ }
28
+ export interface TransitionSpec {
29
+ from: string;
30
+ event: string;
31
+ to: string;
32
+ /** Absent guard is the else/default branch for the same (from, event) group. */
33
+ guard?: GuardNode;
34
+ updates?: UpdateSpec[];
35
+ }
36
+ export interface VariableSpec {
37
+ name: string;
38
+ kind: 'integer' | 'boolean';
39
+ init: number | boolean;
40
+ min?: number;
41
+ max?: number;
42
+ monotonic?: 'inc' | 'dec';
43
+ }
44
+ export type InvariantSpec = {
45
+ id: string;
46
+ description: string;
47
+ kind: 'never-states';
48
+ states: string[];
49
+ } | {
50
+ id: string;
51
+ description: string;
52
+ kind: 'var-in-range';
53
+ variable: string;
54
+ min?: number;
55
+ max?: number;
56
+ } | {
57
+ id: string;
58
+ description: string;
59
+ kind: 'event-before-state';
60
+ event: string;
61
+ state: string;
62
+ } | {
63
+ id: string;
64
+ description: string;
65
+ kind: 'leads-to';
66
+ from: string;
67
+ to: string;
68
+ } | {
69
+ id: string;
70
+ description: string;
71
+ kind: 'sequence';
72
+ events: string[];
73
+ } | {
74
+ id: string;
75
+ description: string;
76
+ kind: 'atomicity';
77
+ events: string[];
78
+ commit: string;
79
+ rollback?: string;
80
+ };
81
+ export interface ResourcePairSpec {
82
+ resource: string;
83
+ acquireEvent: string;
84
+ releaseEvent: string;
85
+ failEvent?: string;
86
+ }
87
+ export interface BoundaryCheckSpec {
88
+ variable: string;
89
+ values: number[];
90
+ }
91
+ export interface LogicModelV1 {
92
+ schemaVersion: 1;
93
+ init: string;
94
+ states: StateSpec[];
95
+ transitions: TransitionSpec[];
96
+ variables?: VariableSpec[];
97
+ invariants?: InvariantSpec[];
98
+ concurrentPairs?: [string, string][];
99
+ boundaryChecks?: BoundaryCheckSpec[];
100
+ resourcePairs?: ResourcePairSpec[];
101
+ idempotentEvents?: string[];
102
+ }
103
+ export interface VerificationOptions {
104
+ maxStates?: number;
105
+ maxPermutationEvents?: number;
106
+ beforeModel?: unknown;
107
+ stateMapping?: Record<string, string>;
108
+ }
109
+ export interface PathStep {
110
+ from: string;
111
+ event: string;
112
+ to: string;
113
+ }
114
+ export interface Finding {
115
+ code: string;
116
+ severity: 'error' | 'warning';
117
+ message: string;
118
+ path?: PathStep[];
119
+ evidence?: Record<string, unknown>;
120
+ }
121
+ export interface CheckResult {
122
+ id: string;
123
+ name: string;
124
+ status: 'pass' | 'fail' | 'skip';
125
+ detail: string;
126
+ findings: Finding[];
127
+ }
128
+ export interface VerificationReport {
129
+ ok: boolean;
130
+ schemaVersion: 1;
131
+ modelHash: string;
132
+ summary: {
133
+ states: number;
134
+ transitions: number;
135
+ errors: number;
136
+ warnings: number;
137
+ checksRun: number;
138
+ truncated?: boolean;
139
+ };
140
+ checks: CheckResult[];
141
+ comparison?: ComparisonSummary;
142
+ }
143
+ export interface ComparisonSummary {
144
+ beforeModelHash: string;
145
+ afterModelHash: string;
146
+ stateMapping: Record<string, string>;
147
+ beforeStates: number;
148
+ beforeTransitions: number;
149
+ afterStates: number;
150
+ afterTransitions: number;
151
+ addedStates: string[];
152
+ removedStates: string[];
153
+ addedEvents: string[];
154
+ removedEvents: string[];
155
+ addedTransitions: TransitionSpec[];
156
+ removedTransitions: TransitionSpec[];
157
+ }
158
+ export interface RuntimeState {
159
+ state: string;
160
+ vars: Record<string, VarValue>;
161
+ }
162
+ export declare function modelHash(model: LogicModelV1): string;
163
+ export declare function validateModel(input: unknown): {
164
+ ok: true;
165
+ model: LogicModelV1;
166
+ } | {
167
+ ok: false;
168
+ errors: string[];
169
+ };
170
+ export declare function guardVariables(guard: GuardNode | undefined): string[];
171
+ export declare function runVerification(input: unknown, options?: VerificationOptions): VerificationReport;