lawspec 0.31.1 → 0.31.3

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 (79) hide show
  1. package/CHANGELOG.md +89 -2
  2. package/README.md +85 -9
  3. package/api.mjs +14 -9
  4. package/authoring.mjs +899 -0
  5. package/beam-coverage.mjs +190 -65
  6. package/beam-doctor.mjs +343 -124
  7. package/bin/lawspec.mjs +1949 -661
  8. package/build.json +134 -128
  9. package/component-packages.mjs +662 -176
  10. package/component.d.ts +82 -20
  11. package/component.mjs +317 -94
  12. package/core.wasm +2 -2
  13. package/core_jsffi.js +5 -5
  14. package/doctor.mjs +558 -299
  15. package/examples-command.mjs +44 -23
  16. package/failure-database.mjs +60 -17
  17. package/files.mjs +122 -62
  18. package/index.d.ts +585 -312
  19. package/input-files.mjs +90 -25
  20. package/launcher.mjs +72 -31
  21. package/learn/coverage.json +184 -112
  22. package/learn/curriculum.json +4 -1
  23. package/learn/vendor/fantomas/{LawSpec.Learn.Formatter.5arcua4vy0.wasm → LawSpec.Learn.Formatter.poiijdbsl9.wasm} +0 -0
  24. package/learn/vendor/fantomas/dotnet.js +3 -3
  25. package/learn/vendor/manifest.json +4 -8
  26. package/lsp.mjs +444 -133
  27. package/mcp.mjs +250 -0
  28. package/native-evidence.mjs +668 -182
  29. package/native-examples.mjs +56 -19
  30. package/native-host.mjs +136 -42
  31. package/native-parsers/clojure.LICENSE +121 -0
  32. package/native-parsers/clojure.wasm +0 -0
  33. package/native-parsers/csharp.LICENSE +21 -0
  34. package/native-parsers/csharp.wasm +0 -0
  35. package/native-parsers/elixir.LICENSE +176 -0
  36. package/native-parsers/elixir.wasm +0 -0
  37. package/native-parsers/erlang.LICENSE +201 -0
  38. package/native-parsers/erlang.wasm +0 -0
  39. package/native-parsers/fsharp.LICENSE +21 -0
  40. package/native-parsers/fsharp.wasm +0 -0
  41. package/native-parsers/gleam.LICENSE +202 -0
  42. package/native-parsers/gleam.wasm +0 -0
  43. package/native-parsers/go.LICENSE +21 -0
  44. package/native-parsers/go.wasm +0 -0
  45. package/native-parsers/groovy.LICENSE +21 -0
  46. package/native-parsers/groovy.wasm +0 -0
  47. package/native-parsers/haskell.LICENSE +21 -0
  48. package/native-parsers/haskell.wasm +0 -0
  49. package/native-parsers/java.LICENSE +21 -0
  50. package/native-parsers/java.wasm +0 -0
  51. package/native-parsers/javascript.LICENSE +21 -0
  52. package/native-parsers/javascript.wasm +0 -0
  53. package/native-parsers/kotlin.LICENSE +9 -0
  54. package/native-parsers/kotlin.wasm +0 -0
  55. package/native-parsers/lock.json +114 -0
  56. package/native-parsers/prolog.LICENSE +21 -0
  57. package/native-parsers/prolog.wasm +0 -0
  58. package/native-parsers/python.LICENSE +21 -0
  59. package/native-parsers/python.wasm +0 -0
  60. package/native-parsers/rust.LICENSE +21 -0
  61. package/native-parsers/rust.wasm +0 -0
  62. package/native-parsers/scala.LICENSE +21 -0
  63. package/native-parsers/scala.wasm +0 -0
  64. package/native-parsers/swift.LICENSE +21 -0
  65. package/native-parsers/swift.wasm +0 -0
  66. package/native-parsers/typescript.LICENSE +21 -0
  67. package/native-parsers/typescript.wasm +0 -0
  68. package/node-events-reporter.mjs +41 -17
  69. package/package.json +4 -3
  70. package/project.mjs +338 -0
  71. package/proof.d.ts +93 -19
  72. package/proof.mjs +1538 -447
  73. package/read-only-hpack.mjs +6 -5
  74. package/scala-build-state.mjs +131 -41
  75. package/scala-coverage.mjs +57 -34
  76. package/scalars.mjs +23 -8
  77. package/templates.mjs +566 -617
  78. package/test-command.mjs +1671 -521
  79. package/learn/vendor/fantomas/LawSpec.Learn.Formatter.u1ne3a6xd2.wasm +0 -0
package/index.d.ts CHANGED
@@ -1,66 +1,186 @@
1
1
  // Generated by lawspec-dev generate. Do not edit.
2
+ export interface PreludeRequest
3
+ {
4
+ query?: string;
5
+ }
6
+
7
+ export interface PreludeEntry
8
+ {
9
+ kind: string;
10
+ name: string;
11
+ qualifiedName?: string;
12
+ source?: string;
13
+ definition?: string | null;
14
+ }
15
+
16
+ export interface NativeAdapter
17
+ {
18
+ path: string;
19
+ ownership: string;
20
+ requiredSource: string;
21
+ }
22
+
23
+ export interface NativeConstructor
24
+ {
25
+ declaration: string;
26
+ allocatedName: string | null;
27
+ schemaIdentity: string;
28
+ nativeBinding: NativeReference[];
29
+ }
30
+
31
+ export interface NativeData
32
+ {
33
+ declaration: string;
34
+ nativeName: string | null;
35
+ generatedName: string | null;
36
+ ownership: 'generated' | 'bound';
37
+ nativeBinding: NativeReference[];
38
+ constructors: NativeConstructor[];
39
+ }
40
+
41
+ export interface NativeArtifactDigest
42
+ {
43
+ path: string;
44
+ sha256: string[];
45
+ }
46
+
47
+ export interface NativeInterface
48
+ {
49
+ target: Target;
50
+ nativeAnalysis: 'applicable' | 'not-applicable';
51
+ data: NativeData[];
52
+ artifacts: Artifact[];
53
+ generatedDigests: NativeArtifactDigest[];
54
+ adapters: NativeAdapter[];
55
+ construction: string;
56
+ }
57
+
58
+ export interface PreludeResult
59
+ {
60
+ schemaVersion: 5;
61
+ entries: PreludeEntry[];
62
+ lawSource: string;
63
+ diagnostics: Diagnostic[];
64
+ }
65
+
66
+ export interface AdviceFinding
67
+ {
68
+ severity: 'warning';
69
+ rule: string;
70
+ declaration: string;
71
+ message: string;
72
+ suggestion: string;
73
+ status: 'unresolved' | 'excepted';
74
+ target?: Target;
75
+ path?: string;
76
+ line?: number;
77
+ reason?: string;
78
+ }
79
+
80
+ export interface AdviceCheck
81
+ {
82
+ declaration?: string;
83
+ rule: string;
84
+ status: string;
85
+ scope?: string;
86
+ reason?: string;
87
+ target?: Target;
88
+ path?: string;
89
+ }
90
+
91
+ export interface AdviceReport
92
+ {
93
+ findings: AdviceFinding[];
94
+ checks: AdviceCheck[];
95
+ ok?: boolean;
96
+ meaning?: string;
97
+ }
98
+
99
+ export interface AdviceException
100
+ {
101
+ rule: string;
102
+ declaration: string;
103
+ reason: string;
104
+ }
105
+
106
+ export interface AdviceRequest extends CheckRequest
107
+ {
108
+ target?: Target;
109
+ nativeSources?: Source[];
110
+ sourceDir?: string;
111
+ testDir?: string;
112
+ exceptions?: AdviceException[];
113
+ }
114
+
2
115
  export type Target =
3
- 'java' |
4
- 'python' |
5
- 'javascript' |
6
- 'typescript' |
7
- 'go' |
8
- 'haskell' |
9
- 'kotlin' |
10
- 'rust' |
11
- 'erlang' |
12
- 'elixir' |
13
- 'gleam' |
14
- 'fsharp' |
15
- 'csharp' |
16
- 'scala' |
17
- 'groovy' |
18
- 'clojure' |
19
- 'swift' |
20
- 'prolog' |
21
- 'hcl' |
22
- 'yaml' |
23
- 'antlr4' |
24
- 'make';
25
-
26
- export interface Source {
116
+ | 'java'
117
+ | 'python'
118
+ | 'javascript'
119
+ | 'typescript'
120
+ | 'go'
121
+ | 'haskell'
122
+ | 'kotlin'
123
+ | 'rust'
124
+ | 'erlang'
125
+ | 'elixir'
126
+ | 'gleam'
127
+ | 'fsharp'
128
+ | 'csharp'
129
+ | 'scala'
130
+ | 'groovy'
131
+ | 'clojure'
132
+ | 'swift'
133
+ | 'prolog'
134
+ | 'hcl'
135
+ | 'yaml'
136
+ | 'antlr4'
137
+ | 'make';
138
+
139
+ export interface Source
140
+ {
27
141
  path: string;
28
142
  content: string;
29
143
  }
30
144
 
31
- export interface Location {
145
+ export interface Location
146
+ {
32
147
  file: string;
33
148
  line: number;
34
149
  column: number;
35
150
  }
36
151
 
37
- export interface Span {
152
+ export interface Span
153
+ {
38
154
  start: Location;
39
155
  end: Location;
40
156
  }
41
157
 
42
- export interface SourceSyntaxNode {
158
+ export interface SourceSyntaxNode
159
+ {
43
160
  kind: string;
44
161
  name?: string;
45
162
  span: Span;
46
163
  uses?: string[];
47
164
  }
48
165
 
49
- export interface SourceSyntaxBinding {
166
+ export interface SourceSyntaxBinding
167
+ {
50
168
  namespace: 'type' | 'constructor' | 'refinement' | 'value' | 'law';
51
169
  name: string;
52
170
  target: string;
53
171
  declaration?: string;
54
172
  }
55
173
 
56
- export interface SourceSyntaxReference {
174
+ export interface SourceSyntaxReference
175
+ {
57
176
  name: string;
58
177
  target: string;
59
178
  span: Span;
60
179
  declaration?: string;
61
180
  }
62
181
 
63
- export interface SourceSyntax {
182
+ export interface SourceSyntax
183
+ {
64
184
  version: 1;
65
185
  path: string;
66
186
  unit: string;
@@ -69,27 +189,36 @@ export interface SourceSyntax {
69
189
  references: SourceSyntaxReference[];
70
190
  }
71
191
 
72
- export interface Diagnostic {
192
+ export interface Diagnostic
193
+ {
73
194
  code: string;
74
195
  message: string;
75
196
  at: Location | null;
76
197
  span?: Span;
77
- related?: {message: string; span: Span;}[];
198
+ related?: {message: string; span: Span}[];
199
+ }
200
+
201
+ export interface CompilerWarning extends Diagnostic
202
+ {
203
+ severity: 'warning';
78
204
  }
79
205
 
80
- export interface MatchWarning extends Diagnostic {
206
+ export interface MatchWarning extends CompilerWarning
207
+ {
81
208
  severity: 'warning';
82
209
  span: Span;
83
210
  }
84
211
 
85
- export interface MatchWarningAnalysis {
212
+ export interface MatchWarningAnalysis
213
+ {
86
214
  kind: 'match-reachability';
87
215
  complete: false;
88
216
  scope: 'ordered-pattern-specialization';
89
217
  reason: string;
90
218
  }
91
219
 
92
- export interface Artifact {
220
+ export interface Artifact
221
+ {
93
222
  path: string;
94
223
  content: string;
95
224
  ownership: 'user' | 'generated';
@@ -98,21 +227,22 @@ export interface Artifact {
98
227
  }
99
228
 
100
229
  export type Type =
101
- {kind: 'constructor'; name: string; arguments: TypeArgument[];} |
102
- {kind: 'variable'; id: string;} |
103
- {kind: 'function'; parameter: Type; result: Type;};
230
+ | {kind: 'constructor'; name: string; arguments: TypeArgument[]}
231
+ | {kind: 'variable'; id: string}
232
+ | {kind: 'function'; parameter: Type; result: Type};
104
233
 
105
234
  export type TypeArgument =
106
- {kind: 'type'; type: Type;} |
107
- {kind: 'natural'; value: string;} |
108
- {kind: 'indexVariable'; id: string;};
235
+ | {kind: 'type'; type: Type}
236
+ | {kind: 'natural'; value: string}
237
+ | {kind: 'indexVariable'; id: string};
109
238
 
110
239
  export type Origin =
111
- {kind: 'source'; span: Span;} | {kind: 'generated'; declaration: string;};
240
+ {kind: 'source'; span: Span} | {kind: 'generated'; declaration: string};
112
241
 
113
- export type Evidence = {kind: 'numeric' | 'structural'; type: Type;};
242
+ export type Evidence = {kind: 'numeric' | 'structural'; type: Type};
114
243
 
115
- export interface Expr {
244
+ export interface Expr
245
+ {
116
246
  type: Type;
117
247
  origin: Origin;
118
248
  text: string;
@@ -120,51 +250,51 @@ export interface Expr {
120
250
  }
121
251
 
122
252
  export type ExprNode =
123
- {kind: 'constant'; value: ScalarValue;} |
124
- {kind: 'field'; constructor: string; index: number; value: Expr;} |
125
- {
253
+ | {kind: 'constant'; value: ScalarValue}
254
+ | {kind: 'field'; constructor: string; index: number; value: Expr}
255
+ | {
126
256
  kind: 'update';
127
257
  constructor: string;
128
258
  index: number;
129
259
  value: Expr;
130
260
  field: Expr;
131
- } |
132
- {kind: 'match'; value: Expr; cases: MatchCase[];} |
133
- {kind: 'allElements'; value: Expr; binder: Binder; predicate: Expr;} |
134
- {
261
+ }
262
+ | {kind: 'match'; value: Expr; cases: MatchCase[]}
263
+ | {kind: 'allElements'; value: Expr; binder: Binder; predicate: Expr}
264
+ | {
135
265
  kind: 'searchElements';
136
266
  universal: boolean;
137
267
  value: Expr;
138
268
  binder: Binder;
139
269
  predicate: Expr;
140
- } |
141
- {kind: 'allPayloads'; value: Expr; predicates: PayloadPredicate[];} |
142
- {kind: 'construct'; constructor: string; arguments: Expr[];} |
143
- {kind: 'local'; id: string;} |
144
- {kind: 'call'; declaration: string; arguments: Expr[];} |
145
- {
270
+ }
271
+ | {kind: 'allPayloads'; value: Expr; predicates: PayloadPredicate[]}
272
+ | {kind: 'construct'; constructor: string; arguments: Expr[]}
273
+ | {kind: 'local'; id: string}
274
+ | {kind: 'call'; declaration: string; arguments: Expr[]}
275
+ | {
146
276
  kind: 'binary';
147
277
  operator: string;
148
278
  evidence: Evidence;
149
279
  left: Expr;
150
280
  right: Expr;
151
- } |
152
- {kind: 'unary'; operator: '-' | '!'; argument: Expr;} |
153
- {kind: 'shortCircuit'; operator: '&&' | '||'; left: Expr; right: Expr;} |
154
- {kind: 'if'; condition: Expr; then: Expr; else: Expr;} |
155
- {kind: 'convert'; conversion: 'explicit' | 'checked'; argument: Expr;} |
156
- {kind: 'helper'; name: string; arguments: Expr[];} |
157
- {kind: 'perform'; ability: string; operation: string; arguments: Expr[];} |
158
- {kind: 'handle'; handling: 'catchFailure'; ability: string; body: Expr;} |
159
- {
281
+ }
282
+ | {kind: 'unary'; operator: '-' | '!'; argument: Expr}
283
+ | {kind: 'shortCircuit'; operator: '&&' | '||'; left: Expr; right: Expr}
284
+ | {kind: 'if'; condition: Expr; then: Expr; else: Expr}
285
+ | {kind: 'convert'; conversion: 'explicit' | 'checked'; argument: Expr}
286
+ | {kind: 'helper'; name: string; arguments: Expr[]}
287
+ | {kind: 'perform'; ability: string; operation: string; arguments: Expr[]}
288
+ | {kind: 'handle'; handling: 'catchFailure'; ability: string; body: Expr}
289
+ | {
160
290
  kind: 'handle';
161
291
  handling: 'withHandler';
162
292
  ability: string;
163
293
  handler: string;
164
294
  body: Expr;
165
- } |
166
- {kind: 'let'; binder: Binder; value: Expr; body: Expr;} |
167
- {
295
+ }
296
+ | {kind: 'let'; binder: Binder; value: Expr; body: Expr}
297
+ | {
168
298
  kind: 'calls';
169
299
  ability: string;
170
300
  operation: string;
@@ -172,76 +302,85 @@ export type ExprNode =
172
302
  };
173
303
 
174
304
  export type Assertion =
175
- {kind: 'equal'; evidence: Evidence; left: Expr; right: Expr;} |
176
- {kind: 'implies'; guard: Expr; body: Assertion;} |
177
- {kind: 'all'; items: Assertion[];} |
178
- {kind: 'not'; body: Assertion;} |
179
- {kind: 'forall'; binder: Binder; predicates: Expr[]; body: Assertion;} |
180
- {kind: 'exists'; binder: Binder; predicates: Expr[]; body: Assertion;};
181
-
182
- export interface Generation {
305
+ | {kind: 'equal'; evidence: Evidence; left: Expr; right: Expr}
306
+ | {kind: 'implies'; guard: Expr; body: Assertion}
307
+ | {kind: 'all'; items: Assertion[]}
308
+ | {kind: 'not'; body: Assertion}
309
+ | {kind: 'forall'; binder: Binder; predicates: Expr[]; body: Assertion}
310
+ | {kind: 'exists'; binder: Binder; predicates: Expr[]; body: Assertion};
311
+
312
+ export interface Generation
313
+ {
183
314
  cases: number;
184
315
  maxAttempts: number;
185
316
  maxShrinks: number;
186
317
  exhaustiveLimit: number;
187
318
  }
188
319
 
189
- export interface Binder {
320
+ export interface Binder
321
+ {
190
322
  id: string;
191
323
  name: string;
192
324
  type: Type;
193
325
  }
194
326
 
195
- export interface Definition {
327
+ export interface Definition
328
+ {
196
329
  owner: string;
197
330
  id: string;
198
331
  arguments: Binder[];
199
332
  body: Expr;
200
333
  }
201
334
 
202
- export interface Input extends Binder {
335
+ export interface Input extends Binder
336
+ {
203
337
  predicates: Expr[];
204
- bounds: {operator: string; value: Expr;}[];
338
+ bounds: {operator: string; value: Expr}[];
205
339
  }
206
340
 
207
- export interface Example {
341
+ export interface Example
342
+ {
208
343
  name: string;
209
- bindings: (Binder & {value: DataValue;})[];
344
+ bindings: (Binder & {value: DataValue})[];
210
345
  expectations: Assertion[];
211
346
  }
212
347
 
213
- export interface LawMetadata {
348
+ export interface LawMetadata
349
+ {
214
350
  id?: string;
215
351
  owner?: string;
216
352
  }
217
353
 
218
- export interface HarnessWitness {
354
+ export interface HarnessWitness
355
+ {
219
356
  binder: string;
220
357
  path: string[];
221
358
  expression: Expr;
222
359
  }
223
360
 
224
361
  export type HarnessDraw =
225
- {kind: 'any'; type: Type; aim: Input | null;} |
226
- {kind: 'one-of'; type: Type; values: Expr[];} |
227
- {kind: 'frequency'; alternatives: {weight: number; draw: HarnessDraw;}[];} |
228
- {
362
+ | {kind: 'any'; type: Type; aim: Input | null}
363
+ | {kind: 'one-of'; type: Type; values: Expr[]}
364
+ | {kind: 'frequency'; alternatives: {weight: number; draw: HarnessDraw}[]}
365
+ | {
229
366
  kind: 'such-that';
230
367
  draw: HarnessDraw;
231
368
  binder: Binder;
232
369
  predicate: Expr;
233
370
  maxDiscards: number;
234
- } |
235
- {kind: 'bind'; binder: Binder; from: HarnessDraw; body: HarnessDraw;};
371
+ }
372
+ | {kind: 'bind'; binder: Binder; from: HarnessDraw; body: HarnessDraw};
236
373
 
237
- export interface HarnessSearch {
374
+ export interface HarnessSearch
375
+ {
238
376
  binder: string;
239
377
  path: string[];
240
378
  strategy: string;
241
379
  draw: HarnessDraw;
242
380
  }
243
381
 
244
- export interface LawHarness {
382
+ export interface LawHarness
383
+ {
245
384
  unit: string | null;
246
385
  tags: string[];
247
386
  skip: string | null;
@@ -256,29 +395,31 @@ export interface LawHarness {
256
395
  parallel: boolean;
257
396
  witnesses: HarnessWitness[];
258
397
  searches: HarnessSearch[];
259
- cover: {percent: number; label: string; when: Expr;}[];
260
- classify: {label: string; when: Expr;}[];
261
- strategies: {input: string; strategy: string; draw: HarnessDraw;}[];
398
+ cover: {percent: number; label: string; when: Expr}[];
399
+ classify: {label: string; when: Expr}[];
400
+ strategies: {input: string; strategy: string; draw: HarnessDraw}[];
262
401
  }
263
402
 
264
- export interface DocumentaryTarget {
403
+ export interface DocumentaryTarget
404
+ {
265
405
  id: string;
266
406
  unit: string;
267
407
  name: string;
268
- span: {spanStart: Location; spanEnd: Location;};
269
- referenceSpan: {spanStart: Location; spanEnd: Location;};
408
+ span: {spanStart: Location; spanEnd: Location};
409
+ referenceSpan: {spanStart: Location; spanEnd: Location};
270
410
  }
271
411
 
272
412
  export type ReferenceSelector =
273
- {kind: 'definition' | 'description' | 'rationale' | 'references';} |
274
- {kind: 'named-reference'; name: string;};
413
+ | {kind: 'definition' | 'description' | 'rationale' | 'references'}
414
+ | {kind: 'named-reference'; name: string};
275
415
 
276
416
  export type DocumentaryReference =
277
- {kind: 'law'; target: DocumentaryTarget; selector?: ReferenceSelector;} |
278
- {kind: 'function'; target: DocumentaryTarget;} |
279
- {kind: 'external'; resource: string; name?: string;};
417
+ | {kind: 'law'; target: DocumentaryTarget; selector?: ReferenceSelector}
418
+ | {kind: 'function'; target: DocumentaryTarget}
419
+ | {kind: 'external'; resource: string; name?: string};
280
420
 
281
- export interface Law {
421
+ export interface Law
422
+ {
282
423
  id: string;
283
424
  owner: string;
284
425
  name: string;
@@ -297,40 +438,89 @@ export interface Law {
297
438
  harness: LawHarness;
298
439
  }
299
440
 
300
- export interface DeclarationSource {
441
+ export interface DeclarationSource
442
+ {
301
443
  unit: string;
302
444
  name: string;
303
445
  canonicalName?: string;
304
446
  }
305
447
 
306
- export interface Unit {
448
+ export type TemporalFormula =
449
+ | {kind: 'atom'; name: string}
450
+ | {kind: 'not' | 'always' | 'eventually'; body: TemporalFormula}
451
+ | {
452
+ kind: 'and' | 'or' | 'implies' | 'until' | 'whenever' | 'never-before';
453
+ left: TemporalFormula;
454
+ right: TemporalFormula;
455
+ }
456
+ | {kind: 'within'; body: TemporalFormula; microseconds: string}
457
+ | {
458
+ kind: 'reference';
459
+ parts: (
460
+ | {kind: 'word'; text: string}
461
+ | {kind: 'argument'; formula: TemporalFormula}
462
+ )[];
463
+ };
464
+
465
+ export interface TemporalLaw
466
+ {
467
+ id: string;
468
+ owner: string;
469
+ name: string;
470
+ kind: 'model' | 'history';
471
+ scope: string;
472
+ formula: TemporalFormula;
473
+ description: string;
474
+ location: Location;
475
+ every?: boolean;
476
+ complete?: boolean;
477
+ fairness?: {command: string; strong: boolean}[];
478
+ }
479
+
480
+ export interface Unit
481
+ {
307
482
  id: string;
308
483
  declarations: (Binder & {
309
484
  origin: Origin;
485
+ typeText?: string;
310
486
  source?: DeclarationSource;
311
487
  representation?: 'structural-record-storage';
312
488
  })[];
489
+ handlers?: {
490
+ id: string;
491
+ name: string;
492
+ ability: string;
493
+ origin: Origin;
494
+ goEmbedding: {
495
+ available: boolean;
496
+ reasons: string[];
497
+ runtime: 'typed-native' | 'checked-dynamic';
498
+ };
499
+ }[];
313
500
  }
314
501
 
315
- export interface StructuralRecord {
502
+ export interface StructuralRecord
503
+ {
316
504
  kind: 'record';
317
505
  digest: string;
318
506
  descriptor: string;
319
507
  positions?: string[];
320
508
  indexGuards?: string[];
321
- fields: {name: string; predicates: Expr[];}[];
509
+ fields: {name: string; predicates: Expr[]}[];
322
510
  }
323
511
 
324
- export interface DataTypeDeclaration {
512
+ export interface DataTypeDeclaration
513
+ {
325
514
  id: string;
326
515
  name: string;
327
516
  parameters: string[];
328
517
  origin: Origin;
329
- constructors: {id: string; name: string; fields: Binder[]; origin: Origin;}[];
518
+ constructors: {id: string; name: string; fields: Binder[]; origin: Origin}[];
330
519
  structure?: StructuralRecord;
331
520
  }
332
521
 
333
- export interface Contract {
522
+ export interface Contract
523
+ {
334
524
  id: string;
335
525
  name: string;
336
526
  arguments: Binder[];
@@ -339,33 +529,37 @@ export interface Contract {
339
529
  postconditions: Expr[];
340
530
  }
341
531
 
342
- export interface Refinement {
532
+ export interface Refinement
533
+ {
343
534
  owner: string;
344
535
  name: string;
345
- parameters: {name: string; kind: 'type' | 'value'; type: string;}[];
346
- requirements: {capability: string; type: string;}[];
536
+ parameters: {name: string; kind: 'type' | 'value'; type: string}[];
537
+ requirements: {capability: string; type: string}[];
347
538
  definition: string;
348
539
  }
349
540
 
350
541
  export type NativeReference = string[];
351
542
 
352
543
  export type NativeFieldBinding =
353
- {field: string; native: string; path?: never; argument?: never;} |
354
- {field: string; native: string; path: string[]; argument: number;};
544
+ | {field: string; native: string; path?: never; argument?: never}
545
+ | {field: string; native: string; path: string[]; argument: number};
355
546
 
356
- export interface NativeConstructorBinding {
547
+ export interface NativeConstructorBinding
548
+ {
357
549
  constructor: string;
358
550
  native: NativeReference;
359
551
  fields?: NativeFieldBinding[];
360
552
  style: 'record' | 'variant' | 'unit';
361
553
  }
362
554
 
363
- export interface NativeCodecBinding {
555
+ export interface NativeCodecBinding
556
+ {
364
557
  toNative: NativeReference;
365
558
  fromNative: NativeReference;
366
559
  }
367
560
 
368
- export interface NativeTypeBinding {
561
+ export interface NativeTypeBinding
562
+ {
369
563
  type: string;
370
564
  native: NativeReference;
371
565
  constructors?: NativeConstructorBinding[];
@@ -373,50 +567,59 @@ export interface NativeTypeBinding {
373
567
  arguments?: string[];
374
568
  }
375
569
 
376
- export interface NativeGeneratorBinding {
570
+ export interface NativeGeneratorBinding
571
+ {
377
572
  type: string;
378
573
  factory: NativeReference;
379
574
  stub?: boolean;
380
575
  }
381
576
 
382
- export interface NativeFunctionBinding {
577
+ export interface NativeFunctionBinding
578
+ {
383
579
  declaration: string;
384
580
  native?: NativeReference;
385
581
  method?: string;
386
582
  constructor?: NativeReference;
387
583
  }
388
584
 
389
- export interface NativeNameBinding {
585
+ export interface NativeNameBinding
586
+ {
390
587
  declaration: string;
391
588
  name: string;
392
589
  }
393
590
 
394
- export interface NativeGoImport {
591
+ export interface NativeGoImport
592
+ {
395
593
  alias: string;
396
594
  path: string;
397
595
  }
398
596
 
399
- export interface NativeErlangInclude {
597
+ export interface NativeErlangInclude
598
+ {
400
599
  path: string;
401
600
  library?: boolean;
402
601
  }
403
602
 
404
- export interface NativeHandlerBinding {
603
+ export interface NativeHandlerBinding
604
+ {
405
605
  ability: string;
406
606
  native: NativeReference;
407
607
  }
408
608
 
409
- export interface NativeFailureMapping {
609
+ export interface NativeFailureMapping
610
+ {
410
611
  failure: string;
411
612
  native: NativeReference;
412
613
  }
413
614
 
414
- export interface NativeNetworkBinding {
615
+ export interface NativeNetworkBinding
616
+ {
415
617
  identity?: string;
416
618
  trusted?: string;
417
619
  }
418
620
 
419
- export interface NativeBindings {
621
+ export interface NativeBindings
622
+ {
420
623
  types?: NativeTypeBinding[];
421
624
  generators?: NativeGeneratorBinding[];
422
625
  functions?: NativeFunctionBinding[];
@@ -430,25 +633,26 @@ export interface NativeBindings {
430
633
  }
431
634
 
432
635
  export type DischargeStatus =
433
- 'planned' |
434
- 'not-verified' |
435
- 'incomplete' |
436
- 'unsupported' |
437
- 'known-discrepancy' |
438
- 'flaky' |
439
- 'skipped' |
440
- 'pending' |
441
- 'proved' |
442
- 'exhaustively-checked' |
443
- 'property-tested' |
444
- 'measured' |
445
- 'runtime-checked' |
446
- 'default-handler' |
447
- 'assumed' |
448
- 'exempted' |
449
- 'refuted';
450
-
451
- export interface ObligationEvidence {
636
+ | 'planned'
637
+ | 'not-verified'
638
+ | 'incomplete'
639
+ | 'unsupported'
640
+ | 'known-discrepancy'
641
+ | 'flaky'
642
+ | 'skipped'
643
+ | 'pending'
644
+ | 'proved'
645
+ | 'exhaustively-checked'
646
+ | 'property-tested'
647
+ | 'measured'
648
+ | 'runtime-checked'
649
+ | 'default-handler'
650
+ | 'assumed'
651
+ | 'exempted'
652
+ | 'refuted';
653
+
654
+ export interface ObligationEvidence
655
+ {
452
656
  owner: string;
453
657
  declaration: string;
454
658
  stage: string;
@@ -456,6 +660,7 @@ export interface ObligationEvidence {
456
660
  reason: string;
457
661
  claim: Expr | null;
458
662
  exemption?: Exemption;
663
+ executionKind?: 'measurement';
459
664
  environment?: string;
460
665
  environmentRun?: AttestedRun;
461
666
  against?: AttestedDependency[];
@@ -468,20 +673,23 @@ export interface ObligationEvidence {
468
673
  plannedEvidence?: {status: DischargeStatus; reason: string};
469
674
  }
470
675
 
471
- export interface AttestedRun {
676
+ export interface AttestedRun
677
+ {
472
678
  id: string;
473
679
  startedAt: string;
474
680
  recordedAt: string;
475
681
  execution?: AttestedExecution;
476
682
  }
477
683
 
478
- export interface AttestedExecution {
684
+ export interface AttestedExecution
685
+ {
479
686
  status: 'wired' | 'running' | 'completed';
480
687
  exitCode?: number;
481
688
  finishedAt?: string;
482
689
  }
483
690
 
484
- export interface AttestedArchitecture {
691
+ export interface AttestedArchitecture
692
+ {
485
693
  document: string;
486
694
  digest: string;
487
695
  uniqueId?: string;
@@ -491,25 +699,29 @@ export interface AttestedArchitecture {
491
699
  elements?: string[];
492
700
  }
493
701
 
494
- export interface AttestedComponent extends PackageVersion {
702
+ export interface AttestedComponent extends PackageVersion
703
+ {
495
704
  fingerprint: string;
496
705
  [key: string]: unknown;
497
706
  }
498
707
 
499
- export interface AttestedCompletion {
708
+ export interface AttestedCompletion
709
+ {
500
710
  reached: boolean;
501
711
  historyDigest?: string;
502
712
  historyEntries?: number;
503
713
  }
504
714
 
505
- export interface AttestedContract {
715
+ export interface AttestedContract
716
+ {
506
717
  package: string;
507
718
  version: string;
508
719
  abilities?: string[];
509
720
  digest?: string;
510
721
  }
511
722
 
512
- export interface AttestedImplementation {
723
+ export interface AttestedImplementation
724
+ {
513
725
  kind: string;
514
726
  product: string;
515
727
  version: string;
@@ -517,14 +729,16 @@ export interface AttestedImplementation {
517
729
  imageDigest?: string;
518
730
  }
519
731
 
520
- export interface AttestedApplication {
732
+ export interface AttestedApplication
733
+ {
521
734
  node: string;
522
735
  contract?: AttestedContract;
523
736
  implementation: AttestedImplementation;
524
737
  component?: AttestedComponent;
525
738
  }
526
739
 
527
- export interface AttestedStandIn {
740
+ export interface AttestedStandIn
741
+ {
528
742
  identity: string;
529
743
  version: string;
530
744
  conformance: string;
@@ -533,7 +747,8 @@ export interface AttestedStandIn {
533
747
  standsInFor?: AttestedContract;
534
748
  }
535
749
 
536
- export interface AttestedDependency {
750
+ export interface AttestedDependency
751
+ {
537
752
  dependency: string;
538
753
  endpoint: string;
539
754
  reached: boolean;
@@ -546,29 +761,35 @@ export interface AttestedDependency {
546
761
  completed?: AttestedCompletion;
547
762
  }
548
763
 
549
- export interface AttestationView {
764
+ export interface AttestationView
765
+ {
550
766
  environment: string;
551
767
  run: AttestedRun;
552
768
  producer?: PackageVersion;
553
769
  application?: AttestedApplication;
554
770
  architecture?: AttestedArchitecture;
555
- dependencies: (AttestedDependency &
556
- {obligations: string[]; plannedObligations: string[];})[];
771
+ dependencies: (AttestedDependency & {
772
+ obligations: string[];
773
+ plannedObligations: string[];
774
+ })[];
557
775
  }
558
776
 
559
- export interface PackageVersion {
777
+ export interface PackageVersion
778
+ {
560
779
  name: string;
561
780
  version: string;
562
781
  }
563
782
 
564
- export interface Package {
783
+ export interface Package
784
+ {
565
785
  name: string;
566
786
  version: string;
567
787
  dependencies?: Record<string, string>;
568
788
  sources: Source[];
569
789
  }
570
790
 
571
- export interface PackageView {
791
+ export interface PackageView
792
+ {
572
793
  name: string;
573
794
  version: string;
574
795
  dependencies: Record<string, string>;
@@ -576,25 +797,29 @@ export interface PackageView {
576
797
  }
577
798
 
578
799
  export type VerificationLayer =
579
- 'proof' |
580
- 'exhaustive' |
581
- 'property' |
582
- 'examples' |
583
- 'runtime' |
584
- 'model' |
585
- 'analysis';
586
-
587
- export interface Verification {
800
+ | 'proof'
801
+ | 'exhaustive'
802
+ | 'property'
803
+ | 'examples'
804
+ | 'runtime'
805
+ | 'model'
806
+ | 'analysis';
807
+
808
+ export interface Verification
809
+ {
588
810
  layers?: VerificationLayer[];
589
811
  }
590
812
 
591
- export interface VerificationSelection {
813
+ export interface VerificationSelection
814
+ {
592
815
  layers: VerificationLayer[];
593
816
  selection: 'no-selected-checks' | 'selected-checks';
594
817
  intrinsicDefinitionChecks: true;
595
818
  }
596
819
 
597
- export interface CheckRequest {
820
+ export interface CheckRequest
821
+ {
822
+ advice?: boolean;
598
823
  languageProfile: '1.0-rc.2';
599
824
  verification?: Verification;
600
825
  warnMatches?: boolean;
@@ -615,7 +840,8 @@ export interface CheckRequest {
615
840
  modelResults?: ModelResult[];
616
841
  }
617
842
 
618
- export interface ModelResult {
843
+ export interface ModelResult
844
+ {
619
845
  fingerprint: string;
620
846
  outcome: string;
621
847
  values: string;
@@ -623,19 +849,22 @@ export interface ModelResult {
623
849
  inputs?: string[];
624
850
  }
625
851
 
626
- export interface ModelAnswerCheck {
852
+ export interface ModelAnswerCheck
853
+ {
627
854
  fingerprint: string;
628
855
  status: 'confirmed' | 'model-not-confirmed';
629
856
  reason: string;
630
857
  }
631
858
 
632
- export interface ModelTaskRow {
859
+ export interface ModelTaskRow
860
+ {
633
861
  owner: string;
634
862
  declaration: string;
635
863
  tasks: ModelTask[];
636
864
  }
637
865
 
638
- export interface ModelTask {
866
+ export interface ModelTask
867
+ {
639
868
  fingerprint: string;
640
869
  semanticFingerprint: string;
641
870
  kind: string;
@@ -643,14 +872,16 @@ export interface ModelTask {
643
872
  inputs: string[];
644
873
  }
645
874
 
646
- export interface Exemption {
875
+ export interface Exemption
876
+ {
647
877
  reason: string;
648
878
  until: string | null;
649
879
  expired: boolean;
650
880
  law: string | null;
651
881
  }
652
882
 
653
- export interface AnalysisResult {
883
+ export interface AnalysisResult
884
+ {
654
885
  fingerprint: string;
655
886
  outcome: string;
656
887
  values: string;
@@ -660,14 +891,14 @@ export interface AnalysisResult {
660
891
  export type AnalysisStage = 'completeness' | 'overlap' | 'conflict' | 'vacuity';
661
892
 
662
893
  export type AnalysisTaskRow =
663
- {
894
+ | {
664
895
  owner: string;
665
896
  declaration: string;
666
897
  stage: AnalysisStage;
667
898
  status: 'ready';
668
899
  tasks: AnalysisTask[];
669
- } |
670
- {
900
+ }
901
+ | {
671
902
  owner: string;
672
903
  declaration: string;
673
904
  stage: AnalysisStage;
@@ -675,7 +906,8 @@ export type AnalysisTaskRow =
675
906
  reason: string;
676
907
  };
677
908
 
678
- export interface AnalysisTask {
909
+ export interface AnalysisTask
910
+ {
679
911
  fingerprint: string;
680
912
  semanticFingerprint: string;
681
913
  encoding: 'lawspec-smtlib-v2';
@@ -683,7 +915,8 @@ export interface AnalysisTask {
683
915
  inputs: string[];
684
916
  }
685
917
 
686
- export interface AnalysisCheck {
918
+ export interface AnalysisCheck
919
+ {
687
920
  owner: string;
688
921
  declaration: string;
689
922
  stage: AnalysisStage;
@@ -694,64 +927,71 @@ export interface AnalysisCheck {
694
927
  }
695
928
 
696
929
  export type AnalysisCheckStatus =
697
- 'proved' | 'refuted' | 'exempted' | 'incomplete';
930
+ 'proved' | 'refuted' | 'exempted' | 'incomplete';
698
931
 
699
- export interface FormatRequest extends CheckRequest {
932
+ export interface FormatRequest extends CheckRequest
933
+ {
700
934
  compile?: boolean;
701
935
  }
702
936
 
703
937
  export type ExplainView = 'eng' | 'math' | 'dev';
704
938
 
705
- export interface ExplainRequest extends CheckRequest {
939
+ export interface ExplainRequest extends CheckRequest
940
+ {
706
941
  view?: ExplainView;
707
942
  law?: string;
708
943
  evidence?: ObligationEvidence[];
709
944
  }
710
945
 
711
946
  export type ExplanationSectionKind =
712
- 'title' |
713
- 'documentary' |
714
- 'description' |
715
- 'inputs' |
716
- 'statement' |
717
- 'reason' |
718
- 'quantifiers' |
719
- 'formula' |
720
- 'law' |
721
- 'trace' |
722
- 'strategies' |
723
- 'restrictions' |
724
- 'source' |
725
- 'examples' |
726
- 'native-evidence';
727
-
728
- export interface ExplanationCase {
947
+ | 'title'
948
+ | 'documentary'
949
+ | 'description'
950
+ | 'inputs'
951
+ | 'statement'
952
+ | 'reason'
953
+ | 'quantifiers'
954
+ | 'formula'
955
+ | 'law'
956
+ | 'trace'
957
+ | 'strategies'
958
+ | 'restrictions'
959
+ | 'source'
960
+ | 'examples'
961
+ | 'native-evidence';
962
+
963
+ export interface ExplanationCase
964
+ {
729
965
  type: string;
730
966
  case: string;
731
967
  cases: string[];
732
968
  }
733
969
 
734
- export interface ExplanationSection {
970
+ export interface ExplanationSection
971
+ {
735
972
  kind: ExplanationSectionKind;
736
973
  lines: string[];
737
974
  cases?: ExplanationCase[];
738
975
  }
739
976
 
740
- export interface Explanation {
977
+ export interface Explanation
978
+ {
741
979
  view: ExplainView;
742
980
  law: string;
743
981
  name: string;
744
982
  sections: ExplanationSection[];
745
983
  }
746
984
 
747
- export interface ExplainResult {
985
+ export interface ExplainResult
986
+ {
748
987
  schemaVersion?: 5;
749
988
  diagnostics: Diagnostic[];
750
989
  explanations?: Explanation[];
751
990
  text?: string;
752
991
  }
753
992
 
754
- export interface GenerationRequest extends CheckRequest {
993
+ export interface GenerationRequest extends CheckRequest
994
+ {
755
995
  target: Target;
756
996
  sourceDir?: string;
757
997
  testDir?: string;
@@ -759,7 +999,7 @@ export interface GenerationRequest extends CheckRequest {
759
999
  }
760
1000
 
761
1001
  export type ProofTask =
762
- {
1002
+ | {
763
1003
  encoding: 'lawspec-smtlib-v1' | 'lawspec-smtlib-v2';
764
1004
  owner: string;
765
1005
  declaration: string;
@@ -775,8 +1015,8 @@ export type ProofTask =
775
1015
  recursion?: Recursion;
776
1016
  alternative?: AlternativeTask;
777
1017
  induction?: InductionPlan;
778
- } |
779
- {
1018
+ }
1019
+ | {
780
1020
  encoding: 'lawspec-smtlib-v1' | 'lawspec-smtlib-v2';
781
1021
  owner: string;
782
1022
  declaration: string;
@@ -787,21 +1027,22 @@ export type ProofTask =
787
1027
  reason: string;
788
1028
  };
789
1029
 
790
- export interface AlternativeTask {
1030
+ export interface AlternativeTask
1031
+ {
791
1032
  recursion: Recursion;
792
1033
  script: string;
793
1034
  taskFingerprint: string;
794
1035
  }
795
1036
 
796
1037
  export type InductionPlan =
797
- {
1038
+ | {
798
1039
  on: string;
799
1040
  asked: boolean;
800
1041
  using: string[];
801
1042
  status: 'ready';
802
1043
  cases: InductionCase[];
803
- } |
804
- {
1044
+ }
1045
+ | {
805
1046
  on: string;
806
1047
  asked: boolean;
807
1048
  using: string[];
@@ -809,7 +1050,8 @@ export type InductionPlan =
809
1050
  reason: string;
810
1051
  };
811
1052
 
812
- export interface InductionCase {
1053
+ export interface InductionCase
1054
+ {
813
1055
  case: string;
814
1056
  script: string;
815
1057
  recursion: Recursion;
@@ -819,60 +1061,58 @@ export interface InductionCase {
819
1061
  }
820
1062
 
821
1063
  export type Recursion =
822
- {encoding: 'guarded-axioms'; fuel: number;} | {encoding: 'define-fun-rec';};
1064
+ {encoding: 'guarded-axioms'; fuel: number} | {encoding: 'define-fun-rec'};
823
1065
 
824
- export type ProofCounterexample =
825
- {
826
- owner: string;
827
- declaration: string;
828
- taskFingerprint: string;
829
- values: string;
830
- };
1066
+ export type ProofCounterexample = {
1067
+ owner: string;
1068
+ declaration: string;
1069
+ taskFingerprint: string;
1070
+ values: string;
1071
+ };
831
1072
 
832
- export type CounterexampleQuery =
833
- {
834
- encoding: 'lawspec-smtlib-v2';
835
- script: string;
836
- fingerprint: string;
837
- semanticFingerprint: string;
838
- inputs: {name: string; binder: string}[];
839
- };
1073
+ export type CounterexampleQuery = {
1074
+ encoding: 'lawspec-smtlib-v2';
1075
+ script: string;
1076
+ fingerprint: string;
1077
+ semanticFingerprint: string;
1078
+ inputs: {name: string; binder: string}[];
1079
+ };
840
1080
 
841
- export type CounterexampleCheck =
842
- {
843
- owner?: string;
844
- declaration?: string;
845
- taskFingerprint?: string;
846
- status: 'refuted' | 'model-not-confirmed' | 'incomplete';
847
- reason: string;
848
- inputs?: {name: string; value: string}[];
849
- };
1081
+ export type CounterexampleCheck = {
1082
+ owner?: string;
1083
+ declaration?: string;
1084
+ taskFingerprint?: string;
1085
+ status: 'refuted' | 'model-not-confirmed' | 'incomplete';
1086
+ reason: string;
1087
+ inputs?: {name: string; value: string}[];
1088
+ };
850
1089
 
851
1090
  export type NativeSeed = number | string;
852
1091
 
853
1092
  export type NativeFreshness =
854
- 'matching-inputs' | 'stale' | 'not-selected' | 'unavailable' | 'not-run';
1093
+ 'matching-inputs' | 'stale' | 'not-selected' | 'unavailable' | 'not-run';
855
1094
 
856
1095
  export type NativeConformanceStatus =
857
- 'passed' |
858
- 'failed' |
859
- 'partial' |
860
- 'incomplete' |
861
- 'skipped' |
862
- 'known-discrepancy' |
863
- 'not-selected' |
864
- 'stale' |
865
- 'unavailable';
1096
+ | 'passed'
1097
+ | 'failed'
1098
+ | 'partial'
1099
+ | 'incomplete'
1100
+ | 'skipped'
1101
+ | 'known-discrepancy'
1102
+ | 'not-selected'
1103
+ | 'stale'
1104
+ | 'unavailable';
866
1105
 
867
1106
  export type NativeOutcome =
868
- 'passed' |
869
- 'failed' |
870
- 'skipped' |
871
- 'incomplete' |
872
- 'not-run' |
873
- 'known-discrepancy';
874
-
875
- export interface NativeCompletedTest {
1107
+ | 'passed'
1108
+ | 'failed'
1109
+ | 'skipped'
1110
+ | 'incomplete'
1111
+ | 'not-run'
1112
+ | 'known-discrepancy';
1113
+
1114
+ export interface NativeCompletedTest
1115
+ {
876
1116
  name: string;
877
1117
  classname?: string;
878
1118
  identity?: string;
@@ -882,7 +1122,8 @@ export interface NativeCompletedTest {
882
1122
  time?: number;
883
1123
  }
884
1124
 
885
- export interface NativeExecutionProfile {
1125
+ export interface NativeExecutionProfile
1126
+ {
886
1127
  target: string;
887
1128
  root: string;
888
1129
  machineBits: 32 | 64;
@@ -890,7 +1131,8 @@ export interface NativeExecutionProfile {
890
1131
  build: string;
891
1132
  }
892
1133
 
893
- export interface NativeExecutionCheck {
1134
+ export interface NativeExecutionCheck
1135
+ {
894
1136
  id: string;
895
1137
  unit: string;
896
1138
  file: string;
@@ -901,13 +1143,15 @@ export interface NativeExecutionCheck {
901
1143
  nativeGroup: string[];
902
1144
  }
903
1145
 
904
- export interface NativeInvocation {
1146
+ export interface NativeInvocation
1147
+ {
905
1148
  ok: boolean;
906
1149
  command: string | null;
907
1150
  output?: string;
908
1151
  }
909
1152
 
910
- export interface NativeExecutionAttempt {
1153
+ export interface NativeExecutionAttempt
1154
+ {
911
1155
  key: string;
912
1156
  planKey: string;
913
1157
  seed: NativeSeed;
@@ -924,11 +1168,13 @@ export interface NativeExecutionAttempt {
924
1168
  environment?: string;
925
1169
  }
926
1170
 
927
- export type RecordedNativeExecutionAttempt =
928
- Omit<NativeExecutionAttempt, 'outcome'> &
929
- {outcome: NativeOutcome | 'known-failing';};
1171
+ export type RecordedNativeExecutionAttempt = Omit<
1172
+ NativeExecutionAttempt,
1173
+ 'outcome'
1174
+ > & {outcome: NativeOutcome | 'known-failing'};
930
1175
 
931
- export interface NativeExecutionObservation {
1176
+ export interface NativeExecutionObservation
1177
+ {
932
1178
  target: string;
933
1179
  root: string;
934
1180
  outcome: NativeOutcome;
@@ -941,7 +1187,8 @@ export interface NativeExecutionObservation {
941
1187
  harness?: {flaky?: boolean; adequacy?: NativeAdequacy[]};
942
1188
  }
943
1189
 
944
- export interface NativeAdequacy {
1190
+ export interface NativeAdequacy
1191
+ {
945
1192
  test: string;
946
1193
  cases: number;
947
1194
  cover?: NativeCoverageObservation[];
@@ -949,32 +1196,48 @@ export interface NativeAdequacy {
949
1196
  labels?: Record<string, number>;
950
1197
  }
951
1198
 
952
- export interface NativeCoverageObservation {
1199
+ export interface NativeCoverageObservation
1200
+ {
953
1201
  label: string;
954
1202
  observed: number;
955
1203
  required: number;
956
1204
  met: boolean;
957
1205
  }
958
1206
 
959
- export interface NativeConformanceEvidence {
1207
+ export interface NativeConformanceEvidence
1208
+ {
960
1209
  kind: 'native-conformance';
961
1210
  status: NativeConformanceStatus;
962
1211
  searchCompleteness: 'complete-finite-inputs' | 'not-established';
963
1212
  observations: NativeExecutionObservation[];
1213
+ measurements?: NativeMeasurement[];
1214
+ measurementScope?: string;
1215
+ }
1216
+
1217
+ export interface NativeMeasurement
1218
+ {
1219
+ kind: 'native-check-duration';
1220
+ target: string;
1221
+ root: string;
1222
+ test: string;
1223
+ seconds: number;
964
1224
  }
965
1225
 
966
- export interface NativeCheckCoverage {
1226
+ export interface NativeCheckCoverage
1227
+ {
967
1228
  kind: 'sampled' | 'examples' | 'finite-inputs';
968
1229
  cases?: number;
969
1230
  scopedQuantifiers: boolean;
970
1231
  }
971
1232
 
972
- export interface NativeEvidenceTarget {
1233
+ export interface NativeEvidenceTarget
1234
+ {
973
1235
  declaration: string;
974
1236
  stage: string;
975
1237
  }
976
1238
 
977
- export interface NativeTestEntry {
1239
+ export interface NativeTestEntry
1240
+ {
978
1241
  law: string;
979
1242
  unit: string;
980
1243
  label: string;
@@ -993,20 +1256,24 @@ export interface NativeTestEntry {
993
1256
  coverage: NativeCheckCoverage;
994
1257
  }
995
1258
 
996
- export interface Result {
1259
+ export interface Result
1260
+ {
1261
+ advice?: AdviceReport;
1262
+ interface?: NativeInterface;
997
1263
  schemaVersion: 5;
998
1264
  machineBits?: 32 | 64;
999
- languageProfile?: "1.0-rc.2";
1265
+ languageProfile?: '1.0-rc.2';
1000
1266
  verification?: VerificationSelection;
1001
1267
  generation?: Generation;
1002
1268
  units?: Unit[];
1003
1269
  dataTypes?: DataTypeDeclaration[];
1004
1270
  definitions?: Definition[];
1005
1271
  laws?: Law[];
1006
- contracts?: {owner: string; contract: Contract;}[];
1272
+ temporalLaws?: TemporalLaw[];
1273
+ contracts?: {owner: string; contract: Contract}[];
1007
1274
  refinements?: Refinement[];
1008
1275
  diagnostics: Diagnostic[];
1009
- warnings?: MatchWarning[];
1276
+ warnings?: CompilerWarning[];
1010
1277
  warningAnalysis?: MatchWarningAnalysis;
1011
1278
  expansions?: string[];
1012
1279
  files?: Artifact[];
@@ -1023,58 +1290,64 @@ export interface Result {
1023
1290
  evidence?: ObligationEvidence[];
1024
1291
  attestation?: AttestationView;
1025
1292
  packages?: PackageView[];
1026
- project?: {package?: PackageVersion; dependencies: Record<string, string>;};
1293
+ project?: {package?: PackageVersion; dependencies: Record<string, string>};
1027
1294
  }
1028
1295
 
1029
- export interface PayloadPredicate {
1296
+ export interface PayloadPredicate
1297
+ {
1030
1298
  binder: Binder;
1031
1299
  predicate: Expr;
1032
1300
  }
1033
1301
 
1034
- export interface MatchCase {
1302
+ export interface MatchCase
1303
+ {
1035
1304
  constructor: string;
1036
1305
  binders: Binder[];
1037
1306
  body: Expr;
1038
1307
  }
1039
1308
 
1040
1309
  export type DataValue =
1041
- ScalarValue |
1042
- {kind: 'data'; type: Type; constructor: string; fields: DataValue[];};
1310
+ | ScalarValue
1311
+ | {kind: 'data'; type: Type; constructor: string; fields: DataValue[]};
1043
1312
 
1044
1313
  export type IntegerType =
1045
- 'Int8' |
1046
- 'Int16' |
1047
- 'Int32' |
1048
- 'Int64' |
1049
- 'UInt8' |
1050
- 'UInt16' |
1051
- 'UInt32' |
1052
- 'UInt64' |
1053
- 'IntSize' |
1054
- 'UIntSize' |
1055
- 'UIntPtr' |
1056
- 'Integer' |
1057
- 'BigInt' |
1058
- 'BigUInt';
1314
+ | 'Int8'
1315
+ | 'Int16'
1316
+ | 'Int32'
1317
+ | 'Int64'
1318
+ | 'UInt8'
1319
+ | 'UInt16'
1320
+ | 'UInt32'
1321
+ | 'UInt64'
1322
+ | 'IntSize'
1323
+ | 'UIntSize'
1324
+ | 'UIntPtr'
1325
+ | 'Integer'
1326
+ | 'BigInt'
1327
+ | 'BigUInt';
1059
1328
 
1060
1329
  export type ScalarValue =
1061
- {type: IntegerType; value: string;} |
1062
- {type: 'Bool'; value: boolean;} |
1063
- {type: 'Decimal'; coefficient: string; exponent: string;} |
1064
- {type: 'Rational'; numerator: string; denominator: string;} |
1065
- {type: 'Float32' | 'Float64'; bits: string;} |
1066
- {
1330
+ | {type: IntegerType; value: string}
1331
+ | {type: 'Bool'; value: boolean}
1332
+ | {type: 'Decimal'; coefficient: string; exponent: string}
1333
+ | {type: 'Rational'; numerator: string; denominator: string}
1334
+ | {type: 'Float32' | 'Float64'; bits: string}
1335
+ | {
1067
1336
  type: 'Complex64' | 'Complex128';
1068
1337
  real: ScalarValue;
1069
1338
  imaginary: ScalarValue;
1070
- } |
1071
- {type: 'Char' | 'CodePoint' | 'CodeUnit16'; value: number;} |
1072
- {type: 'Text' | 'CodePointText' | 'Utf16Text' | 'Bytes'; units: number[];} |
1073
- {type: 'Symbol'; id: string; description: string;} |
1074
- {type: 'Unit' | 'Null' | 'Undefined';} |
1075
- {type: 'Nullable' | 'Optional'; value: ScalarValue | null;};
1076
-
1077
- export interface Compiler {
1339
+ }
1340
+ | {type: 'Char' | 'CodePoint' | 'CodeUnit16'; value: number}
1341
+ | {type: 'Text' | 'CodePointText' | 'Utf16Text' | 'Bytes'; units: number[]}
1342
+ | {type: 'Symbol'; id: string; description: string}
1343
+ | {type: 'Unit' | 'Null' | 'Undefined'}
1344
+ | {type: 'Nullable' | 'Optional'; value: ScalarValue | null};
1345
+
1346
+ export interface Compiler
1347
+ {
1348
+ prelude(input: PreludeRequest): Promise<PreludeResult>;
1349
+ inspect(input: GenerationRequest): Promise<Result>;
1350
+ advise(input: AdviceRequest): Promise<Result>;
1078
1351
  format(input: FormatRequest): Promise<Result>;
1079
1352
  check(input: CheckRequest): Promise<Result>;
1080
1353
  expand(input: CheckRequest): Promise<Result>;