lawspec 0.17.0 → 0.17.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.2
4
+
5
+ ### Dependency-tracked incremental compilation
6
+
7
+ - The compiler builds a dependency graph of each program. Its nodes are data
8
+ types and declarations (with their contracts and checked definitions), and
9
+ each node has a Merkle digest (SHA-256) of its content and of everything it
10
+ references, with recursive groups digested together.
11
+ - A law is planned again only when it, or a type or definition it can reach,
12
+ changes. A unit's files are emitted again only when the unit or one of its
13
+ laws' plans changes, when a data type changes (emitters name types across
14
+ the whole program), or when a checked definition is added, removed or
15
+ renamed. Editing one definition's body no longer replans and re-emits the
16
+ whole program, and reverting an edit reuses the earlier results.
17
+ - Each law is planned from only the types and definitions it reaches, which
18
+ cuts planning time for the bundled examples by two thirds. Evidence
19
+ discharge plans laws the same way, so `lawspec evidence` reports the boundary
20
+ cases the generated tests use.
21
+
22
+ ### Changes to generated tests
23
+
24
+ - Boundary search for constrained data took its depth from the number of data
25
+ types in the whole program, and seeded scalar boundaries with literals from
26
+ every type's constructor predicates. Both now come from the types the law
27
+ reaches, so adding an unrelated type no longer changes a law's tests.
28
+ Regenerating can change the boundary cases of laws over indexed families and
29
+ constrained data; among the bundled examples, `indexed_arithmetic`,
30
+ `domain_modeling` and the shop package's domain unit gain or lose cases.
31
+
32
+ ## 0.17.1
33
+
34
+ ### Faster compilation
35
+
36
+ - The compiler reuses work for whatever did not change. A compiler instance
37
+ (one `createCompiler()`, one wasm instance or one process) compiles,
38
+ discharges and plans a set of sources once for every method and target, plans
39
+ each law again only when it or the program's types, declarations, contracts
40
+ or definitions changed, and emits each unit again only when it, its laws or
41
+ that interface changed. Results are identical to a full compile.
42
+ - `lawspec examples` and other multi-target runs compile once instead of once
43
+ per target: generating every bundled example for all eight targets takes
44
+ about 105 seconds instead of about 270.
45
+ - A single compile is faster too: kind lookups use a map instead of scanning
46
+ every type in the program, boundary candidates are deduplicated in
47
+ `n log n`, and long failure messages are split by bisection. Compiling all
48
+ bundled examples together takes a quarter less time.
49
+
50
+ ### Incremental local checks
51
+
52
+ - `lawspec-dev ci` records passing results by content. Acceptance suites key
53
+ each run by the generated project and everything else its tests read, so a
54
+ compiler change that leaves a target's output unchanged skips that target's
55
+ native tests. Core steps key by the repository files they read.
56
+ - `lawspec-dev ci --fresh` (`make ci-fresh`) runs every step, and releases use
57
+ it. See [CONTRIBUTING](CONTRIBUTING.md#checks).
58
+
3
59
  ## 0.17.0
4
60
 
5
61
  ### Collections
package/README.md CHANGED
@@ -30,7 +30,7 @@ Node 22+ and the selected target's build tools are required. No Haskell
30
30
  toolchain is needed. The reference platforms are macOS and Linux.
31
31
 
32
32
  ```sh
33
- npm install --save-dev lawspec@0.17.0
33
+ npm install --save-dev lawspec@0.17.2
34
34
  npx lawspec --version
35
35
  ```
36
36
 
@@ -40,8 +40,8 @@ LawSpec can create `package.json` and its test script:
40
40
  ```sh
41
41
  mkdir lawspec-example
42
42
  cd lawspec-example
43
- npm exec --package=lawspec@0.17.0 -- lawspec init --target javascript
44
- npm install --save-dev lawspec@0.17.0
43
+ npm exec --package=lawspec@0.17.2 -- lawspec init --target javascript
44
+ npm install --save-dev lawspec@0.17.2
45
45
  npx lawspec check
46
46
  npx lawspec explain 'example.atoi_codec::itoa and then atoi yields a'
47
47
  npx lawspec doctor
package/bin/lawspec.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  atomicWrite,
15
15
  safePath,
16
16
  } from "../files.mjs";
17
- const VERSION = "0.17.0";
17
+ const VERSION = "0.17.2";
18
18
  const args = process.argv.slice(2);
19
19
  const verb = args.shift();
20
20
  const options = {};
package/build.json CHANGED
@@ -60,6 +60,8 @@
60
60
  "src/LawSpec/Data.hs",
61
61
  "src/LawSpec/DataNames.hs",
62
62
  "src/LawSpec/DefinitionTotality.hs",
63
+ "src/LawSpec/Dependencies.hs",
64
+ "src/LawSpec/Digest.hs",
63
65
  "src/LawSpec/Discharge.hs",
64
66
  "src/LawSpec/Domain.hs",
65
67
  "src/LawSpec/DomainModel.hs",
@@ -98,6 +100,7 @@
98
100
  "src/LawSpec/KotlinNativeBinding.hs",
99
101
  "src/LawSpec/KotlinProperties.hs",
100
102
  "src/LawSpec/KotlinTestHelpers.hs",
103
+ "src/LawSpec/Memo.hs",
101
104
  "src/LawSpec/Model.hs",
102
105
  "src/LawSpec/NativeBinding.hs",
103
106
  "src/LawSpec/NativeRequest.hs",
@@ -139,8 +142,8 @@
139
142
  ],
140
143
  "digests": {
141
144
  "dev/Gen/Embed.hs": "41cd18500c1a8c9bdb51011ab4c74817f8e04b655aa10d9894aa1b93a3fa858b",
142
- "lawspec.cabal": "a80664dbccd59b2365eb0c7721e7a809cc513895dacc25df1d654bd33eb5171c",
143
- "package.yaml": "dbf60bb49b779a36a9764774430f35affe300fccc97e3e6b687a80ee3059237f",
145
+ "lawspec.cabal": "f3e7fcdcb25ee3ce8c122c9641ba596f206314b2bd96dc80e8150bf187128bd8",
146
+ "package.yaml": "2bf973ae585ecdd17c52a02e3995eb767383de051b31cf132910009055d70110",
144
147
  "runtime/LawSpecCodecs.hs": "1b3f6b40ad49928cf5e9386e06bc2992c9f1271754351b9fa3075e50346ef03b",
145
148
  "runtime/LawSpecCollectionCodecs.hs": "74caa786801c5142ed040897c7ebb7373abf49ee49e02af53e466646fb624f47",
146
149
  "runtime/LawSpecDataStrategies.hs": "9cc5b98476364a6c255dc3eb40c53d65b4a9d4ab0c3961a806b3515a8d5e8f7f",
@@ -165,9 +168,9 @@
165
168
  "runtime/lawspec_schema.mjs": "d77abea1a9dcb03e4a6c6eef6509971d8599fac9acdefa9b9e4b89b8d0fc5226",
166
169
  "runtime/lawspec_schema.py": "daed20d27168970350ef0b63b9cb2e566bd00598922acb4071d863c076e787ba",
167
170
  "runtime/lawspec_strategies.rs": "5e991a45548811fef1728e1e9b9f12f76ee4cc7cb9c3339eab79bc4cf5f54f6b",
168
- "runtime/rust/Cargo.lock": "06dbc409b525f297e90a6a3255b2af1ad002421873d6e068cbbbf49ea09bf9a4",
169
- "runtime/rust/Cargo.toml": "efa4b9b3f7b5d8a44652bacc1e49beebb2e53d15d96ef6f8ff9832d589d6125a",
170
- "src/LawSpec/Api.hs": "b7315b30890e3e38382c7e4d60afdfc6c7c3647f056636c230a91c16047f9944",
171
+ "runtime/rust/Cargo.lock": "46a4457b658665181d4f01949f2d3f27be7c0a45da31fdab391799fb03afc260",
172
+ "runtime/rust/Cargo.toml": "110b10c0072d99ff42566cd33c7c860504738d1a4c9164d0201a0609d35248ae",
173
+ "src/LawSpec/Api.hs": "26abff862b87cfe3a96bb73eca269d6a8817172760d67470418bb0a3a82fb3c6",
171
174
  "src/LawSpec/Backend.hs": "caf45afb73e7455dd801195b8b117ca7e4664ac4babc6ef0732e06faf9e64fcb",
172
175
  "src/LawSpec/Capabilities.hs": "ab457f3da440a237ee731d664b94d95a0cc1fa4d8be4d4d0403a61ebcf98e310",
173
176
  "src/LawSpec/Code/Doc.hs": "9e3b70f85deb1dcbce385af1d0cd4bea2dfa8a2d806d54745d4bb437406673e5",
@@ -175,7 +178,7 @@
175
178
  "src/LawSpec/Collections.hs": "f8cc2978b6690709deb421ee22df37985c80e5b06064f819a193d6b912328ee1",
176
179
  "src/LawSpec/Common.hs": "107612a8aaa787488413acf9c1a56622004d3bff251db89b99928343e6070883",
177
180
  "src/LawSpec/Compile.hs": "ec8a077041ec65ae908cf5fe48ed3cd15200f613b5cee7a4331f2f0bd9cb66ca",
178
- "src/LawSpec/Core.hs": "30f5a20ede2dc810532d7e5c608a7df98b436e4d5e08547b837d5f56c86c270e",
181
+ "src/LawSpec/Core.hs": "faa5abce4be809298212dee0fbdf1b65c992a950e23801d9509630580e615163",
179
182
  "src/LawSpec/Core/DefinitionContracts.hs": "b7f60f038b231187ecf898e585ae1a8fb1fc113bb55bad6d1bb2660350fd969e",
180
183
  "src/LawSpec/Core/Definitions.hs": "8e0d1d7127f9d4872f2464b4af50b0f286823d5f0f203baf38fb3c316d766140",
181
184
  "src/LawSpec/Core/Eval.hs": "26c518cf3db1f395f69353cb373e1aacf7f1a0ce81d3e17b15878421e9625a8b",
@@ -188,16 +191,18 @@
188
191
  "src/LawSpec/Core/Semantics.hs": "cdb8256e523f7808fa50fe7d80d709217a28de4c81c5ff5be8382f94900f3779",
189
192
  "src/LawSpec/Core/Total.hs": "308684d7ff78a5e4dc75aef30c4df17610a2cb107d48ddb75d14d8573b178e5b",
190
193
  "src/LawSpec/Core/Totality.hs": "5e76100466cf4a157b9eda36738806af836a5bda949f5d568d7bf5155fa8858a",
191
- "src/LawSpec/Core/Types.hs": "f4689fb690148be0171403ba2bf0e29f841cee3381bf2a8ad1daf45841140097",
194
+ "src/LawSpec/Core/Types.hs": "04d9c093fcc0d84e2864c8a3b69d5fe318a92c60b32844048198f1b12fe1b6fb",
192
195
  "src/LawSpec/Core/Validate.hs": "74c2a51eb913f8414268064f22d2d5d97ebfb0e4797e146b229076c29ac38726",
193
- "src/LawSpec/Core/Value.hs": "1f4eddd1e4c642f91478fa7009bc4edbd9f6f4da115c11e03021f4e4e9f0b275",
194
- "src/LawSpec/CoreEmit.hs": "e006dd23a77fea0918b5a5a9dd1aaba5f56c55e74d8f717f91266b94463f7d80",
195
- "src/LawSpec/CoreNativeScalarEmit.hs": "389f1940596512d91ba813c2f20ed66fe7c972cfc2e44d76e4e8a61d5f3c52b7",
196
- "src/LawSpec/CoreScalarEmit.hs": "4b45ec70b9074d54c9e023d482d5926ec3f679c167eb4f68f6de9679dfb98f8e",
196
+ "src/LawSpec/Core/Value.hs": "a1e0745154c54498d7e164a89546ef2a56afade05a1d362e1c63986245ad2774",
197
+ "src/LawSpec/CoreEmit.hs": "53dc6d57a1b5279f2295f530ad317bbbb9d5e1afd2deb5eec2330608b8ab1078",
198
+ "src/LawSpec/CoreNativeScalarEmit.hs": "5a5d145a18f596682a3dc3dacb009268d48c384c2f2ca620b503268096a66940",
199
+ "src/LawSpec/CoreScalarEmit.hs": "0493aa132599aca36a773717252281c2ab9c2aeb6ac1c90269dfbea50aaa36b1",
197
200
  "src/LawSpec/Data.hs": "f659f4e86f1009c4806334a45686970dde2efa2641585f997a7beba01d0e6f2d",
198
201
  "src/LawSpec/DataNames.hs": "2eeb0d215131981a2271725a50c21dce44c7146a167025eb239a83922fdecaf6",
199
202
  "src/LawSpec/DefinitionTotality.hs": "adf00236e0e1b1cad4299793ced5f9047dbc2321d3c2f9ba040bac30d1a87c73",
200
- "src/LawSpec/Discharge.hs": "bd1acbddecf1f060aaaad1a6796825321c56b434d556e9873eb6c9d99459fdb7",
203
+ "src/LawSpec/Dependencies.hs": "918d55923c29c66a5a82dc346bad9c6f539965bc06212b2a54d03d65d9df599f",
204
+ "src/LawSpec/Digest.hs": "ba8128e36856d5fb0d2345779fd949b11042af688a0d8cee63e5ae8818cef7ca",
205
+ "src/LawSpec/Discharge.hs": "e0c6760fa483e79782eb944c6208a815f2ff073428a5b90bbbb41aafca830bfe",
201
206
  "src/LawSpec/Domain.hs": "222d15f0012ae630802238a6d7e1ee78d1e718b599f5ebb5a1ddc4e8d29d68c3",
202
207
  "src/LawSpec/DomainModel.hs": "835e6e31c9565bd624c1139ead71ad65c1065ee660457ae365522f7ed78f7939",
203
208
  "src/LawSpec/Elaboration.hs": "aade19ada1b9b944d1d5864b1ada61f89a57a675d7e8de9e2f3bc6b6f6d84b00",
@@ -235,6 +240,7 @@
235
240
  "src/LawSpec/KotlinNativeBinding.hs": "1aec7854758f07a4d2288de13931fbb88ef32220f85d3c84fe8233ad67b6d095",
236
241
  "src/LawSpec/KotlinProperties.hs": "5c7289c97cc915cbc3432eb4b08a2fefbe786af4d6591af4b59923aa9d6a2075",
237
242
  "src/LawSpec/KotlinTestHelpers.hs": "74810d65faafc6ed4d64b1fb0596cda4186e586b7144a7441641b798795bc324",
243
+ "src/LawSpec/Memo.hs": "34e9baa568dc01d2eae6ac3ec160f628d0fb8a4f79567a93bfe8d181b201c065",
238
244
  "src/LawSpec/Model.hs": "72fae874b4a5aa98057254fc1b508df3f71ec8587740bc7c18ea29490526137b",
239
245
  "src/LawSpec/NativeBinding.hs": "33959b0fd432ad4150f3b685f6438e284b801c2a59d9ef3132486a1cc7c8925a",
240
246
  "src/LawSpec/NativeRequest.hs": "f8200c36725859ea32374655951f7a45e2b3342b159f9f6c88b5f9a2a6331897",
@@ -258,9 +264,9 @@
258
264
  "src/LawSpec/RustNativeBinding.hs": "d50d1fb10591ee86129ae49b38a343148c084479e450eef3b320e1efdd55245d",
259
265
  "src/LawSpec/RustNativeGenerators.hs": "a3b1484d9ff0008e4f961aa81d0aa51da57ec0cd7909124e80c98d56aacc8ce9",
260
266
  "src/LawSpec/Scaffold.hs": "217328445923b9e339428dd542ce9b910c26ed132c31d1ef083de73763b749f9",
261
- "src/LawSpec/Scalar.hs": "f7eddc660dbc08d315d85291e446ed5c34670e2321f9268ba852ebf65e206141",
267
+ "src/LawSpec/Scalar.hs": "c49180c9de3d9549dbfa715a0e21868badc2ea78357381be883026c71b477a44",
262
268
  "src/LawSpec/SpecializeDefinitions.hs": "2bdd6d9b191941d869ef524659e02fed551499aaa2ea98c99323da03af113012",
263
- "src/LawSpec/Testing.hs": "fb4299ad7e68d84e32991b5397c39f2fd06eb1417a0bf8b14fe2d85cfa9c26db",
269
+ "src/LawSpec/Testing.hs": "17b9e9d5ffb2833cc360d4ef3b1f19a45edd3beb0739815ef484a5a911545309",
264
270
  "src/LawSpec/WebData.hs": "bbcd7d734ce3941d83cc455a9a2147b642f6111ebb34db9ef99dcb7a58b8c4ae",
265
271
  "src/LawSpec/WebDefinitions.hs": "579309c76b9303a3c9e456e1252f2d0881795210aa0b09104a00efdfe10e3e13",
266
272
  "src/LawSpec/WebExpr.hs": "0389dcd5cf7479dd23ef034b1012de6ebd70bf1dc9e3d90981dfb0ba2702596f",
@@ -272,8 +278,8 @@
272
278
  "wasm/app/Exports.hs": "4ecbdac8faa2449e6fc61b93c82e6278fa14374154f29b4dacf0eef433f06a47",
273
279
  "wasm/cabal.project": "021e560afdc5eb4cb7169e7119ecb8f92c9ee170245af909c94b612941bff5cc",
274
280
  "wasm/cabal.project.freeze": "733dbed3d2ecccb26e874fd58f136296dad772184deb1658c196b5d54a0814dc",
275
- "wasm/lawspec-wasm.cabal": "c4be9cf8ffe6ed3f54000311845595ea9a9094dbbfc1dd735be90d9ba23e08ab",
276
- "npm/core.wasm": "369eb593bfdf2824102cec5f9097ee9d7958be71394d432e5b09aae408db333b",
281
+ "wasm/lawspec-wasm.cabal": "cfe5050dd58d8a2f13c8f950442abf60a5d1846d8de430f54b1ebd0e6fa2d968",
282
+ "npm/core.wasm": "8aed0bf33b6925b86879d67c70cf312047c55e2f6b49ee2f5e8555bdd4f8264a",
277
283
  "npm/core_jsffi.js": "88d136efe92f7cff5758c8fec8d9b6bbc9707fe37741cebeeb415fe34ce3d72b",
278
284
  "npm/api.mjs": "19e1624f91258c1397f3212faf65b407c62671b0fc5b118520e6a91f7ad7c6ba",
279
285
  "npm/index.d.ts": "2215087cc6628a2ddbdd573210c4f9021cffeb00c142d4f3ae1314fd59a397f6"
package/core.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lawspec",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "description": "State the law once. Check it everywhere.",
5
5
  "license": "MIT",
6
6
  "repository": {