lawspec 0.24.0 → 0.25.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 (87) hide show
  1. package/CHANGELOG.md +67 -1
  2. package/README.md +29 -22
  3. package/UNICODE-LICENSE.txt +39 -0
  4. package/api.mjs +14 -23
  5. package/bin/lawspec.mjs +186 -65
  6. package/build.json +255 -159
  7. package/builtin-data-names.mjs +73 -0
  8. package/core.wasm +2 -2
  9. package/examples/native-payments/clojure/lawspec.json +13 -2
  10. package/examples/native-payments/csharp/lawspec.json +13 -2
  11. package/examples/native-payments/elixir/lawspec.json +14 -3
  12. package/examples/native-payments/erlang/lawspec.json +14 -3
  13. package/examples/native-payments/fsharp/lawspec.json +14 -3
  14. package/examples/native-payments/gleam/lawspec.json +14 -3
  15. package/examples/native-payments/go/lawspec.json +14 -3
  16. package/examples/native-payments/groovy/lawspec.json +14 -3
  17. package/examples/native-payments/haskell/lawspec.json +14 -3
  18. package/examples/native-payments/java/lawspec.json +14 -3
  19. package/examples/native-payments/javascript/lawspec.json +14 -3
  20. package/examples/native-payments/kotlin/lawspec.json +14 -3
  21. package/examples/native-payments/python/lawspec.json +14 -3
  22. package/examples/native-payments/rust/lawspec.json +14 -3
  23. package/examples/native-payments/scala/lawspec.json +14 -3
  24. package/examples/native-payments/swift/lawspec.json +14 -3
  25. package/examples/native-payments/typescript/lawspec.json +14 -3
  26. package/examples/packages/orders/lawspec.json +25 -5
  27. package/examples/packages/orders/orders.lawspec +36 -34
  28. package/examples/packages/shop-domain/src/domain.lawspec +23 -21
  29. package/examples/packages/shop-tax-1/src/rates.lawspec +4 -4
  30. package/examples/packages/shop-tax-2/src/rates.lawspec +5 -4
  31. package/examples/rc1/authorization-snapshots.lawspec +112 -0
  32. package/examples/rc1/banner-filenames.lawspec +63 -0
  33. package/examples/rc1/bit-codec.lawspec +56 -0
  34. package/examples/rc1/bounded-witness-search.lawspec +144 -0
  35. package/examples/rc1/conflicting-requirements.lawspec +30 -0
  36. package/examples/rc1/constructive-witnesses.lawspec +113 -0
  37. package/examples/rc1/documentary-review.lawspec +42 -0
  38. package/examples/rc1/empty-domains.lawspec +46 -0
  39. package/examples/rc1/finite-integer-domains.lawspec +75 -0
  40. package/examples/rc1/law-metadata.lawspec +29 -0
  41. package/examples/rc1/native-payments.lawspec +107 -0
  42. package/examples/rc1/nesting/rrr.lawspec +33 -0
  43. package/examples/rc1/nesting/rru.lawspec +56 -0
  44. package/examples/rc1/nesting/rur.lawspec +57 -0
  45. package/examples/rc1/nesting/ruu.lawspec +77 -0
  46. package/examples/rc1/nesting/urr.lawspec +52 -0
  47. package/examples/rc1/nesting/uru.lawspec +72 -0
  48. package/examples/rc1/nesting/uur.lawspec +73 -0
  49. package/examples/rc1/nesting/uuu.lawspec +95 -0
  50. package/examples/rc1/order-workflow.lawspec +126 -0
  51. package/examples/rc1/parcel-measurements.lawspec +92 -0
  52. package/examples/rc1/picture-records.lawspec +51 -0
  53. package/examples/rc1/picture-tuples.lawspec +47 -0
  54. package/examples/rc1/record-payloads.lawspec +56 -0
  55. package/examples/rc1/recursive-records.lawspec +64 -0
  56. package/examples/rc1/refund-conformance.lawspec +44 -0
  57. package/examples/rc1/refund-policy.lawspec +88 -0
  58. package/examples/rc1/requirement-composition.lawspec +89 -0
  59. package/examples/rc1/structural-records.lawspec +53 -0
  60. package/examples/rc1-authoring.lawspec +56 -0
  61. package/examples-command.mjs +11 -5
  62. package/explain.mjs +112 -0
  63. package/expression-presentation.mjs +333 -0
  64. package/files.mjs +16 -0
  65. package/index.d.ts +929 -11
  66. package/lsp.mjs +231 -0
  67. package/migrate.mjs +135 -0
  68. package/migration-bindings.mjs +86 -0
  69. package/migration-cases.mjs +45 -0
  70. package/migration-collections.mjs +54 -0
  71. package/migration-correspondence.mjs +275 -0
  72. package/migration-generation.mjs +99 -0
  73. package/migration-laws.mjs +102 -0
  74. package/migration-records.mjs +166 -0
  75. package/migration-source.mjs +247 -0
  76. package/migration-write.mjs +156 -0
  77. package/native-evidence.mjs +187 -0
  78. package/native-examples.mjs +8 -1
  79. package/node-events-reporter.mjs +23 -0
  80. package/package.json +8 -1
  81. package/positional-fields.mjs +13 -0
  82. package/proof.d.ts +35 -0
  83. package/proof.mjs +174 -0
  84. package/starter-rc1.lawspec +25 -0
  85. package/templates.mjs +2 -2
  86. package/test-command.mjs +107 -35
  87. package/typed-presentation.mjs +165 -0
@@ -0,0 +1,73 @@
1
+ // Generated from templates/npm/builtin-data-names.mjs by lawspec-dev generate. Do not edit.
2
+ // Names and field order projected from the compiler's primitive data registry.
3
+ // This is presentation metadata, not another type checker or public wire view.
4
+ export const builtinDataNames =
5
+ [
6
+ {
7
+ "id": "List",
8
+ "name": "List",
9
+ "constructors": [
10
+ {
11
+ "id": "List::Nil",
12
+ "name": "Nil",
13
+ "fields": []
14
+ },
15
+ {
16
+ "id": "List::Cons",
17
+ "name": "Cons",
18
+ "fields": [
19
+ {
20
+ "name": "head"
21
+ },
22
+ {
23
+ "name": "tail"
24
+ }
25
+ ]
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ "id": "Maybe",
31
+ "name": "Maybe",
32
+ "constructors": [
33
+ {
34
+ "id": "Maybe::Nothing",
35
+ "name": "Nothing",
36
+ "fields": []
37
+ },
38
+ {
39
+ "id": "Maybe::Just",
40
+ "name": "Just",
41
+ "fields": [
42
+ {
43
+ "name": "value"
44
+ }
45
+ ]
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "id": "Either",
51
+ "name": "Either",
52
+ "constructors": [
53
+ {
54
+ "id": "Either::Left",
55
+ "name": "Left",
56
+ "fields": [
57
+ {
58
+ "name": "value"
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "id": "Either::Right",
64
+ "name": "Right",
65
+ "fields": [
66
+ {
67
+ "name": "value"
68
+ }
69
+ ]
70
+ }
71
+ ]
72
+ }
73
+ ];
package/core.wasm CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/core.wasm
3
- size: 57941480 bytes
4
- sha256: a5297e71e959bce14e302c98c107c570bb57ba11a60ff9cfd41c6a7876b2bfed
3
+ size: 73195567 bytes
4
+ sha256: 79d6019410f0fdc5412b88973a16dc2ccf409bc9474a581a49f8ec0920ad32f4
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -47,5 +47,16 @@
47
47
  ]
48
48
  }
49
49
  }
50
- ]
50
+ ],
51
+ "languageProfile": "1.0-rc.1",
52
+ "verification": {
53
+ "layers": [
54
+ "proof",
55
+ "exhaustive",
56
+ "property",
57
+ "examples",
58
+ "runtime",
59
+ "model"
60
+ ]
61
+ }
51
62
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -47,5 +47,16 @@
47
47
  ]
48
48
  }
49
49
  }
50
- ]
50
+ ],
51
+ "languageProfile": "1.0-rc.1",
52
+ "verification": {
53
+ "layers": [
54
+ "proof",
55
+ "exhaustive",
56
+ "property",
57
+ "examples",
58
+ "runtime",
59
+ "model"
60
+ ]
61
+ }
51
62
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -103,7 +103,7 @@
103
103
  "style": "variant",
104
104
  "fields": [
105
105
  {
106
- "field": "reason",
106
+ "field": "value",
107
107
  "native": "explanation"
108
108
  }
109
109
  ]
@@ -145,5 +145,16 @@
145
145
  ]
146
146
  }
147
147
  }
148
- ]
148
+ ],
149
+ "languageProfile": "1.0-rc.1",
150
+ "verification": {
151
+ "layers": [
152
+ "proof",
153
+ "exhaustive",
154
+ "property",
155
+ "examples",
156
+ "runtime",
157
+ "model"
158
+ ]
159
+ }
149
160
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -97,7 +97,7 @@
97
97
  "style": "variant",
98
98
  "fields": [
99
99
  {
100
- "field": "reason",
100
+ "field": "value",
101
101
  "native": "explanation"
102
102
  }
103
103
  ]
@@ -144,5 +144,16 @@
144
144
  ]
145
145
  }
146
146
  }
147
- ]
147
+ ],
148
+ "languageProfile": "1.0-rc.1",
149
+ "verification": {
150
+ "layers": [
151
+ "proof",
152
+ "exhaustive",
153
+ "property",
154
+ "examples",
155
+ "runtime",
156
+ "model"
157
+ ]
158
+ }
148
159
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -117,7 +117,7 @@
117
117
  "style": "variant",
118
118
  "fields": [
119
119
  {
120
- "field": "reason",
120
+ "field": "value",
121
121
  "native": "explanation"
122
122
  }
123
123
  ]
@@ -163,5 +163,16 @@
163
163
  ]
164
164
  }
165
165
  }
166
- ]
166
+ ],
167
+ "languageProfile": "1.0-rc.1",
168
+ "verification": {
169
+ "layers": [
170
+ "proof",
171
+ "exhaustive",
172
+ "property",
173
+ "examples",
174
+ "runtime",
175
+ "model"
176
+ ]
177
+ }
167
178
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -103,7 +103,7 @@
103
103
  "style": "variant",
104
104
  "fields": [
105
105
  {
106
- "field": "reason",
106
+ "field": "value",
107
107
  "native": "explanation"
108
108
  }
109
109
  ]
@@ -145,5 +145,16 @@
145
145
  ]
146
146
  }
147
147
  }
148
- ]
148
+ ],
149
+ "languageProfile": "1.0-rc.1",
150
+ "verification": {
151
+ "layers": [
152
+ "proof",
153
+ "exhaustive",
154
+ "property",
155
+ "examples",
156
+ "runtime",
157
+ "model"
158
+ ]
159
+ }
149
160
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -94,7 +94,7 @@
94
94
  "style": "variant",
95
95
  "fields": [
96
96
  {
97
- "field": "reason",
97
+ "field": "value",
98
98
  "native": "Explanation"
99
99
  }
100
100
  ]
@@ -132,5 +132,16 @@
132
132
  ]
133
133
  }
134
134
  }
135
- ]
135
+ ],
136
+ "languageProfile": "1.0-rc.1",
137
+ "verification": {
138
+ "layers": [
139
+ "proof",
140
+ "exhaustive",
141
+ "property",
142
+ "examples",
143
+ "runtime",
144
+ "model"
145
+ ]
146
+ }
136
147
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -115,7 +115,7 @@
115
115
  "style": "variant",
116
116
  "fields": [
117
117
  {
118
- "field": "reason",
118
+ "field": "value",
119
119
  "native": "explanation"
120
120
  }
121
121
  ]
@@ -161,5 +161,16 @@
161
161
  ]
162
162
  }
163
163
  }
164
- ]
164
+ ],
165
+ "languageProfile": "1.0-rc.1",
166
+ "verification": {
167
+ "layers": [
168
+ "proof",
169
+ "exhaustive",
170
+ "property",
171
+ "examples",
172
+ "runtime",
173
+ "model"
174
+ ]
175
+ }
165
176
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -103,7 +103,7 @@
103
103
  "style": "variant",
104
104
  "fields": [
105
105
  {
106
- "field": "reason",
106
+ "field": "value",
107
107
  "native": "explanation"
108
108
  }
109
109
  ]
@@ -145,5 +145,16 @@
145
145
  ]
146
146
  }
147
147
  }
148
- ]
148
+ ],
149
+ "languageProfile": "1.0-rc.1",
150
+ "verification": {
151
+ "layers": [
152
+ "proof",
153
+ "exhaustive",
154
+ "property",
155
+ "examples",
156
+ "runtime",
157
+ "model"
158
+ ]
159
+ }
149
160
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -115,7 +115,7 @@
115
115
  "style": "variant",
116
116
  "fields": [
117
117
  {
118
- "field": "reason",
118
+ "field": "value",
119
119
  "native": "explanation"
120
120
  }
121
121
  ]
@@ -161,5 +161,16 @@
161
161
  ]
162
162
  }
163
163
  }
164
- ]
164
+ ],
165
+ "languageProfile": "1.0-rc.1",
166
+ "verification": {
167
+ "layers": [
168
+ "proof",
169
+ "exhaustive",
170
+ "property",
171
+ "examples",
172
+ "runtime",
173
+ "model"
174
+ ]
175
+ }
165
176
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -103,7 +103,7 @@
103
103
  "style": "variant",
104
104
  "fields": [
105
105
  {
106
- "field": "reason",
106
+ "field": "value",
107
107
  "native": "explanation"
108
108
  }
109
109
  ]
@@ -145,5 +145,16 @@
145
145
  ]
146
146
  }
147
147
  }
148
- ]
148
+ ],
149
+ "languageProfile": "1.0-rc.1",
150
+ "verification": {
151
+ "layers": [
152
+ "proof",
153
+ "exhaustive",
154
+ "property",
155
+ "examples",
156
+ "runtime",
157
+ "model"
158
+ ]
159
+ }
149
160
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -115,7 +115,7 @@
115
115
  "style": "variant",
116
116
  "fields": [
117
117
  {
118
- "field": "reason",
118
+ "field": "value",
119
119
  "native": "explanation"
120
120
  }
121
121
  ]
@@ -161,5 +161,16 @@
161
161
  ]
162
162
  }
163
163
  }
164
- ]
164
+ ],
165
+ "languageProfile": "1.0-rc.1",
166
+ "verification": {
167
+ "layers": [
168
+ "proof",
169
+ "exhaustive",
170
+ "property",
171
+ "examples",
172
+ "runtime",
173
+ "model"
174
+ ]
175
+ }
165
176
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -103,7 +103,7 @@
103
103
  "style": "variant",
104
104
  "fields": [
105
105
  {
106
- "field": "reason",
106
+ "field": "value",
107
107
  "native": "explanation"
108
108
  }
109
109
  ]
@@ -145,5 +145,16 @@
145
145
  ]
146
146
  }
147
147
  }
148
- ]
148
+ ],
149
+ "languageProfile": "1.0-rc.1",
150
+ "verification": {
151
+ "layers": [
152
+ "proof",
153
+ "exhaustive",
154
+ "property",
155
+ "examples",
156
+ "runtime",
157
+ "model"
158
+ ]
159
+ }
149
160
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -118,7 +118,7 @@
118
118
  "style": "variant",
119
119
  "fields": [
120
120
  {
121
- "field": "reason",
121
+ "field": "value",
122
122
  "native": "explanation"
123
123
  }
124
124
  ]
@@ -163,5 +163,16 @@
163
163
  ]
164
164
  }
165
165
  }
166
- ]
166
+ ],
167
+ "languageProfile": "1.0-rc.1",
168
+ "verification": {
169
+ "layers": [
170
+ "proof",
171
+ "exhaustive",
172
+ "property",
173
+ "examples",
174
+ "runtime",
175
+ "model"
176
+ ]
177
+ }
167
178
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -115,7 +115,7 @@
115
115
  "style": "variant",
116
116
  "fields": [
117
117
  {
118
- "field": "reason",
118
+ "field": "value",
119
119
  "native": "explanation"
120
120
  }
121
121
  ]
@@ -161,5 +161,16 @@
161
161
  ]
162
162
  }
163
163
  }
164
- ]
164
+ ],
165
+ "languageProfile": "1.0-rc.1",
166
+ "verification": {
167
+ "layers": [
168
+ "proof",
169
+ "exhaustive",
170
+ "property",
171
+ "examples",
172
+ "runtime",
173
+ "model"
174
+ ]
175
+ }
165
176
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -108,7 +108,7 @@
108
108
  "style": "variant",
109
109
  "fields": [
110
110
  {
111
- "field": "reason",
111
+ "field": "value",
112
112
  "native": "explanation"
113
113
  }
114
114
  ]
@@ -150,5 +150,16 @@
150
150
  ]
151
151
  }
152
152
  }
153
- ]
153
+ ],
154
+ "languageProfile": "1.0-rc.1",
155
+ "verification": {
156
+ "layers": [
157
+ "proof",
158
+ "exhaustive",
159
+ "property",
160
+ "examples",
161
+ "runtime",
162
+ "model"
163
+ ]
164
+ }
154
165
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 1,
2
+ "version": 2,
3
3
  "sources": [
4
4
  "laws"
5
5
  ],
@@ -103,7 +103,7 @@
103
103
  "style": "variant",
104
104
  "fields": [
105
105
  {
106
- "field": "reason",
106
+ "field": "value",
107
107
  "native": "explanation"
108
108
  }
109
109
  ]
@@ -145,5 +145,16 @@
145
145
  ]
146
146
  }
147
147
  }
148
- ]
148
+ ],
149
+ "languageProfile": "1.0-rc.1",
150
+ "verification": {
151
+ "layers": [
152
+ "proof",
153
+ "exhaustive",
154
+ "property",
155
+ "examples",
156
+ "runtime",
157
+ "model"
158
+ ]
159
+ }
149
160
  }
@@ -1,7 +1,27 @@
1
1
  {
2
- "version": 1,
3
- "sources": ["orders.lawspec"],
4
- "dependencies": { "shop.domain": "^1.0.0", "shop.tax": "^2.0.0" },
5
- "packages": ["../shop-domain", "../shop-tax-1", "../shop-tax-2"],
6
- "targets": []
2
+ "version": 2,
3
+ "sources": [
4
+ "orders.lawspec"
5
+ ],
6
+ "dependencies": {
7
+ "shop.domain": "^1.0.0",
8
+ "shop.tax": "^2.0.0"
9
+ },
10
+ "packages": [
11
+ "../shop-domain",
12
+ "../shop-tax-1",
13
+ "../shop-tax-2"
14
+ ],
15
+ "targets": [],
16
+ "languageProfile": "1.0-rc.1",
17
+ "verification": {
18
+ "layers": [
19
+ "proof",
20
+ "exhaustive",
21
+ "property",
22
+ "examples",
23
+ "runtime",
24
+ "model"
25
+ ]
26
+ }
7
27
  }