lawspec 0.28.0 → 0.29.1
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 +24 -1
- package/bin/lawspec.mjs +12 -7
- package/build.json +13 -13
- package/core.wasm +2 -2
- package/core_jsffi.js +5 -5
- package/index.d.ts +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,27 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.29.1] - 2026-10-22
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Parsing now reports independent errors together across fields, collection
|
|
14
|
+
items, table rows, law sections, declarations, harness settings and files.
|
|
15
|
+
This includes repeated bad constructors and general syntax errors. Recovery
|
|
16
|
+
preserves source locations and block opener links, keeps quoted tokens
|
|
17
|
+
opaque, and never admits a partial program or writes a formatting result.
|
|
18
|
+
|
|
19
|
+
## [0.29.0] - 2026-10-22
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- `lawspec fmt` parses syntax without compiling by default, including sources
|
|
24
|
+
whose definitions or imports are unfinished. `--compile` opts into checked
|
|
25
|
+
formatting before any write; `--check` works with either mode. SDK formatting
|
|
26
|
+
remains checked by default and accepts `compile: false` for parsing alone.
|
|
27
|
+
- Source formatting uses separate brace lines and two-space fields for record
|
|
28
|
+
types, including one-field and nested records, with one field per line.
|
|
29
|
+
|
|
9
30
|
## [0.28.0] - 2026-10-22
|
|
10
31
|
|
|
11
32
|
### Added
|
|
@@ -1915,7 +1936,9 @@ A maintenance release. The language, generated code and API are unchanged from
|
|
|
1915
1936
|
machine-sized bindings reject an architecture mismatch. Rust adapters take
|
|
1916
1937
|
owned values.
|
|
1917
1938
|
|
|
1918
|
-
[Unreleased]: https://github.com/brain-fuel/lawspec/compare/v0.
|
|
1939
|
+
[Unreleased]: https://github.com/brain-fuel/lawspec/compare/v0.29.1...HEAD
|
|
1940
|
+
[0.29.1]: https://github.com/brain-fuel/lawspec/compare/v0.29.0...v0.29.1
|
|
1941
|
+
[0.29.0]: https://github.com/brain-fuel/lawspec/compare/v0.28.0...v0.29.0
|
|
1919
1942
|
[0.28.0]: https://github.com/brain-fuel/lawspec/compare/v0.27.0...v0.28.0
|
|
1920
1943
|
[0.27.0]: https://github.com/brain-fuel/lawspec/compare/v0.26.0...v0.27.0
|
|
1921
1944
|
[0.26.0]: https://github.com/brain-fuel/lawspec/compare/v0.25.0...v0.26.0
|
package/bin/lawspec.mjs
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
safePath,
|
|
27
27
|
collectSources,
|
|
28
28
|
} from "../files.mjs";
|
|
29
|
-
const VERSION = "0.
|
|
29
|
+
const VERSION = "0.29.1";
|
|
30
30
|
const args = process.argv.slice(2);
|
|
31
31
|
const verb = args.shift();
|
|
32
32
|
const options = {};
|
|
@@ -42,7 +42,7 @@ for (let i = 0; i < args.length; i++) {
|
|
|
42
42
|
if (!args[i + 1] || args[i + 1].startsWith("--"))
|
|
43
43
|
throw new Error(`Missing value for ${arg}`);
|
|
44
44
|
options[arg.slice(2)] = [...(options[arg.slice(2)] ?? []), ...args[++i].split(",").filter(Boolean)];
|
|
45
|
-
} else if (["--dry-run", "--check", "--json", "--minify", "--no-cache", "--fresh", "--coverage", "--update-recorded", "--benchmarks", "--stdio", "--warn-matches"].includes(arg))
|
|
45
|
+
} else if (["--dry-run", "--check", "--json", "--minify", "--no-cache", "--fresh", "--coverage", "--update-recorded", "--benchmarks", "--stdio", "--warn-matches", "--compile"].includes(arg))
|
|
46
46
|
options[arg.slice(2)] = true;
|
|
47
47
|
else if (arg.startsWith("--")) throw new Error(`Unknown option: ${arg}`);
|
|
48
48
|
else positional.push(arg);
|
|
@@ -123,14 +123,17 @@ async function loadPackage(directory) {
|
|
|
123
123
|
},
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
async function packageInput(owner, root) {
|
|
126
|
+
async function packageInput(owner, root, optional = false) {
|
|
127
127
|
if (owner.packages !== undefined && !Array.isArray(owner.packages))
|
|
128
128
|
throw new Error("packages must be an array of package directories");
|
|
129
129
|
const packages = await Promise.all(
|
|
130
|
-
(owner.packages ?? []).map(async (p) =>
|
|
130
|
+
(owner.packages ?? []).map(async (p) => {
|
|
131
|
+
try { return (await loadPackage(path.resolve(root, p))).package; }
|
|
132
|
+
catch (error) { if (optional && error.code === "ENOENT") return null; throw error; }
|
|
133
|
+
}),
|
|
131
134
|
);
|
|
132
135
|
return {
|
|
133
|
-
...(packages.
|
|
136
|
+
...(packages.some(Boolean) ? { packages: packages.filter(Boolean) } : {}),
|
|
134
137
|
...(owner.dependencies !== undefined ? { dependencies: owner.dependencies } : {}),
|
|
135
138
|
};
|
|
136
139
|
}
|
|
@@ -142,7 +145,8 @@ async function formatCommand() {
|
|
|
142
145
|
const files = await collectSources(root, positional.length ? positional : config.sources);
|
|
143
146
|
const compiler = await createCompiler();
|
|
144
147
|
const result = diagnostics(await compiler.format({
|
|
145
|
-
sources: files,
|
|
148
|
+
sources: files, compile: !!options.compile, machineBits: options.machineBits ?? 64,
|
|
149
|
+
...(config ? await packageInput(config, configRoot, !options.compile) : {}),
|
|
146
150
|
languageProfile: "1.0-rc.2", verification: { layers: [] },
|
|
147
151
|
}));
|
|
148
152
|
const changed = result.formattedSources.filter((file, index) => file.content !== files[index].content);
|
|
@@ -755,7 +759,7 @@ async function main() {
|
|
|
755
759
|
}
|
|
756
760
|
if (!verb || ["help", "--help", "-h"].includes(verb)) {
|
|
757
761
|
output(
|
|
758
|
-
"LawSpec " + VERSION + "\nUsage: lawspec init --target <language> [--project <directory>] [--minify]\n lawspec fmt [paths...] [--check]\n lawspec lsp --stdio\n lawspec prove [--solver <z3-executable>] [--proof-timeout <ms>] [--json]\n lawspec check [--warn-matches] | doctor | explain [<unit>::<law>] [--view developer|business|formal|evidence] | generate\n lawspec evidence [<unit> | <unit>::<declaration>] [--attestation <file>]\n lawspec test [--target <language>] [--fresh] [--seed <n>] [--attestation <file>] [--update-recorded] [--tag <t>] [--exclude-tag <t>] [--report junit=<path>] [--coverage] [--benchmarks]\n lawspec package [--project <package directory>]\n lawspec examples [--example payments] [--target <language>] [--output <directory>]\nOptions: --config <path>, --target <language>, --machine-bits <32|64>, --json, --no-cache\nGeneration: --dry-run, --check, --minify\nTargets: " +
|
|
762
|
+
"LawSpec " + VERSION + "\nUsage: lawspec init --target <language> [--project <directory>] [--minify]\n lawspec fmt [paths...] [--check] [--compile]\n lawspec lsp --stdio\n lawspec prove [--solver <z3-executable>] [--proof-timeout <ms>] [--json]\n lawspec check [--warn-matches] | doctor | explain [<unit>::<law>] [--view developer|business|formal|evidence] | generate\n lawspec evidence [<unit> | <unit>::<declaration>] [--attestation <file>]\n lawspec test [--target <language>] [--fresh] [--seed <n>] [--attestation <file>] [--update-recorded] [--tag <t>] [--exclude-tag <t>] [--report junit=<path>] [--coverage] [--benchmarks]\n lawspec package [--project <package directory>]\n lawspec examples [--example payments] [--target <language>] [--output <directory>]\nOptions: --config <path>, --target <language>, --machine-bits <32|64>, --json, --no-cache\nGeneration: --dry-run, --check, --minify\nTargets: " +
|
|
759
763
|
targets.join(", "),
|
|
760
764
|
);
|
|
761
765
|
return;
|
|
@@ -764,6 +768,7 @@ async function main() {
|
|
|
764
768
|
output(VERSION);
|
|
765
769
|
return;
|
|
766
770
|
}
|
|
771
|
+
if (options.compile && verb !== "fmt") throw new Error("--compile applies to fmt");
|
|
767
772
|
if (verb !== "fmt" && positional.length > (["explain", "evidence"].includes(verb) ? 1 : 0))
|
|
768
773
|
throw new Error(`Unexpected argument: ${positional.join(" ")}`);
|
|
769
774
|
if (verb === "examples") {
|
package/build.json
CHANGED
|
@@ -514,8 +514,8 @@
|
|
|
514
514
|
],
|
|
515
515
|
"digests": {
|
|
516
516
|
"dev/Gen/Embed.hs": "a359c45835b3656d7381d5f00f3b4c17ebe25460cdcb7b9905c7842a25eec406",
|
|
517
|
-
"lawspec.cabal": "
|
|
518
|
-
"package.yaml": "
|
|
517
|
+
"lawspec.cabal": "4ddf941cda8fb5edfe8cfbd43b3a88e8db6cd340df4480c3ed9f7642da2b6820",
|
|
518
|
+
"package.yaml": "3387644242c7cba4673c00bd3330aff1d796112c20064357e5c5e1438949555a",
|
|
519
519
|
"runtime/LawSpecCodecs.hs": "d4cf9cacf9d0f8f100423f537d30be7232b1ec3634bace0ef8b0780e9d7ad2f3",
|
|
520
520
|
"runtime/LawSpecCollectionCodecs.hs": "1ec581af09c2931cacd0245b35debebd066fd06d71c6dfb60a124af9a5fac562",
|
|
521
521
|
"runtime/LawSpecDataStrategies.hs": "8ab09adb405a76535e6a9f969375298b693954d2428d12e1479e23d813a0d799",
|
|
@@ -722,8 +722,8 @@
|
|
|
722
722
|
"runtime/lawspec_schema.mjs": "f3602f701d73295be8946e3e27f236cf77d2cd3f1d58bfd456d6365c75cd69a7",
|
|
723
723
|
"runtime/lawspec_schema.py": "db690189506bf485f7692505ada87d142e2d842f595520e071db38edaea64bfe",
|
|
724
724
|
"runtime/lawspec_strategies.rs": "b801c9ddc702588b6b30e6a14c1e7b200ae2e0229f4f3ca8f6fb5510e8238df6",
|
|
725
|
-
"runtime/rust/Cargo.lock": "
|
|
726
|
-
"runtime/rust/Cargo.toml": "
|
|
725
|
+
"runtime/rust/Cargo.lock": "0249aac56ce632030ac24499c3038fb4617951ac4e98c53bfd75aece779fb5d6",
|
|
726
|
+
"runtime/rust/Cargo.toml": "620a6d4cae82f650591ac112d855154cc3fd8d8f5ea96b1becc4b0ba67407b93",
|
|
727
727
|
"src/LawSpec/Abilities.hs": "79e900dea8c07ec0ca724d6301b4a489332de0cc0d7ce46511a16a21bca13831",
|
|
728
728
|
"src/LawSpec/AbilityEmit.hs": "d79a0b60785433c7763aea6edb389c45377b7be98a5345436140a725655de3b7",
|
|
729
729
|
"src/LawSpec/AbilityEmit/Go.hs": "d6e78b73c6f225c90cfc4345f2c4fbc6a090ec5083e4ba65af906028cc33f994",
|
|
@@ -744,7 +744,7 @@
|
|
|
744
744
|
"src/LawSpec/Actors/Scala.hs": "6a034fb96983fd11b8714d5c6b8c09b5cb24ceb06977b52010c2424a51b60f38",
|
|
745
745
|
"src/LawSpec/Actors/Types.hs": "09f764a8da926f00817a0de0f17a03d48194c819a3c64aca78c96b19d38ac823",
|
|
746
746
|
"src/LawSpec/Actors/Web.hs": "b8a63be30754569d7b150d454e656b4089a63e2f913bb2276ba722e2529e185d",
|
|
747
|
-
"src/LawSpec/Api.hs": "
|
|
747
|
+
"src/LawSpec/Api.hs": "8fc75d62a458d4c554101057a08963b70f2fcc5df6ab979e9dd8942a97ee4f23",
|
|
748
748
|
"src/LawSpec/ArtifactEmit.hs": "c6249a494be8c522a59971f60ad1eb935c5d5f510183bbe3692f59d7eea3c416",
|
|
749
749
|
"src/LawSpec/Attestation.hs": "54c932e3cb9a297c220996f0cbe9cb5dc8db8ad8d532f15c6d4220a6a6078f28",
|
|
750
750
|
"src/LawSpec/Backend.hs": "bd11686c38f6bf52791f3d490bb95e60c53feda6f6fd40dda03dcb3278745760",
|
|
@@ -784,7 +784,7 @@
|
|
|
784
784
|
"src/LawSpec/Code/JavaScript.hs": "20e9536ba253a43fbbca96a8c20c3fd7c87b8fcacc065b5c5f4a1741f321b843",
|
|
785
785
|
"src/LawSpec/Collections.hs": "6a18460a4bbf1e74a971b9c8a58071ea0bcf57cb9eef3742ea0878dab2e028c1",
|
|
786
786
|
"src/LawSpec/Common.hs": "a9ad307ccf2bb9accad655c2795ca3276d5de58d86cbaaf423aff4dea45dee83",
|
|
787
|
-
"src/LawSpec/Compile.hs": "
|
|
787
|
+
"src/LawSpec/Compile.hs": "426afe82644b11d5d173fb9acd4d258f96ec8c48637ec7e5d87ffb3e90b01e87",
|
|
788
788
|
"src/LawSpec/Core.hs": "a824743dc8a52fc5182b0249ab2618ecc265c75fad3022283326cdc1ca41a7b0",
|
|
789
789
|
"src/LawSpec/Core/CapabilityScope.hs": "0f419bc299253e04684dfda7b127d9731032512fec78090892684a7b50004b52",
|
|
790
790
|
"src/LawSpec/Core/Counterexample.hs": "a4ceef54be7e2c2830328afc9520b545bb124e6f2e9db63b36d3a0b227085724",
|
|
@@ -917,7 +917,7 @@
|
|
|
917
917
|
"src/LawSpec/Network.hs": "4fdbc8a0bc6f91b22f1fe57554078be79425d9a4f4509e09595b949092f4f733",
|
|
918
918
|
"src/LawSpec/OperationChecks.hs": "00094994bca2e62d0d77741508ae2336588cb22896864a798940281ec814a994",
|
|
919
919
|
"src/LawSpec/Packages.hs": "fd66ad5a6bdd167d518d2548df21f12a6af02e2d635c1993bf3e309824b1d8b4",
|
|
920
|
-
"src/LawSpec/Parser.hs": "
|
|
920
|
+
"src/LawSpec/Parser.hs": "1b52723dcac7f4c875efd9a7a9e12792b45c4f1e5e30e0d3a48a951e1872d1e2",
|
|
921
921
|
"src/LawSpec/Persist.hs": "a354a57cffc7d61d2b9c5aa35e246633997a79a0f8ef0b087b70c4e348698251",
|
|
922
922
|
"src/LawSpec/PortableGenerator.hs": "14037ba42ef8fc06bbdbb5892c058455cc1848a08253f0f7cf2d7cc5cb16d396",
|
|
923
923
|
"src/LawSpec/PortableTestHelpers.hs": "1a60780525e70b2faf84c09750362ea5a9b2927225812378e6e210126aed6a45",
|
|
@@ -968,8 +968,8 @@
|
|
|
968
968
|
"src/LawSpec/SourceContext.hs": "9c7b916e6331ca588f62a182cd0f467f1ef691641011626feec4ba76fa0be54a",
|
|
969
969
|
"src/LawSpec/SourceOrigins.hs": "7387df6cf5d8f30f4cf47593a49acab39a6bc9554eeb3bfdaf5ddc9a2bef8076",
|
|
970
970
|
"src/LawSpec/SourceRecords.hs": "6d7fbc5436161fa50cfbf728f54497f64f285542fd49be4e8c70c780e1f3edf7",
|
|
971
|
-
"src/LawSpec/SourceSyntax.hs": "
|
|
972
|
-
"src/LawSpec/SourceText.hs": "
|
|
971
|
+
"src/LawSpec/SourceSyntax.hs": "62965163c1d23ff437f0c59c2606d933cde92b229465bcd2b848fcfb47471570",
|
|
972
|
+
"src/LawSpec/SourceText.hs": "f4d9038a1e19a08754ba27208992d4c9cfb3cdc4327f2cfc99cff05e05808364",
|
|
973
973
|
"src/LawSpec/SourceTokens.hs": "8ce1e050000070a1d1753756a6c481991049c24d28ccccb8c9f9de638608cc84",
|
|
974
974
|
"src/LawSpec/SpecializeDefinitions.hs": "1268564062880f44885ee52a0848b764983549e8d6fcc07665182e3a456aa5bb",
|
|
975
975
|
"src/LawSpec/StatefulModel.hs": "554eece7a55696717456b0868dcc8ed1f1aecceda39ac3c3ff11b6a2f1c3450b",
|
|
@@ -1022,10 +1022,10 @@
|
|
|
1022
1022
|
"wasm/app/Exports.hs": "7698bc8dcdbd3e00cc62d0597626a6dabe29aace9258645d1df266be1f3c408c",
|
|
1023
1023
|
"wasm/cabal.project": "91ad752c055a034fff42bf1815125ce2174630a41859fe8d5c571e9a12e50b7d",
|
|
1024
1024
|
"wasm/cabal.project.freeze": "e067df77442b8111c97b3f12cc215af5ca69668aa65f95f3ff90110c22933170",
|
|
1025
|
-
"wasm/lawspec-wasm.cabal": "
|
|
1026
|
-
"npm/core.wasm": "
|
|
1027
|
-
"npm/core_jsffi.js": "
|
|
1025
|
+
"wasm/lawspec-wasm.cabal": "f4d06d78ed6d9722f3742dcbc927e22efe1ae06cfee06312f784835b7efddea5",
|
|
1026
|
+
"npm/core.wasm": "2ad02540bc6a144b6e45fd5e72a19470817fe5120d45c53ebebde250e66dee71",
|
|
1027
|
+
"npm/core_jsffi.js": "6d2302b334268f00034618b5a0df76232ca4198595454c20416d3282429ca7dd",
|
|
1028
1028
|
"npm/api.mjs": "fd40ec7034402e4456504182d80e2e97f535713ae5d227ffad6456fa9091f59b",
|
|
1029
|
-
"npm/index.d.ts": "
|
|
1029
|
+
"npm/index.d.ts": "3efda72842f1c99bc15bc2e764f0ef2707db7be0d47dfc98cbae2263dbf7af04"
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
package/core.wasm
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/core.wasm
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 77188592 bytes
|
|
4
|
+
sha256: 2ad02540bc6a144b6e45fd5e72a19470817fe5120d45c53ebebde250e66dee71
|
package/core_jsffi.js
CHANGED
|
@@ -92,11 +92,11 @@ newJSVal: (v) => __ghc_wasm_jsffi_jsval_manager.newJSVal(v),
|
|
|
92
92
|
getJSVal: (k) => __ghc_wasm_jsffi_jsval_manager.getJSVal(k),
|
|
93
93
|
freeJSVal: (k) => __ghc_wasm_jsffi_jsval_manager.freeJSVal(k),
|
|
94
94
|
scheduleWork: () => setImmediate(__exports.rts_schedulerLoop),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
ZC1ZClawspeczmwasmzm0zi29zi1zminplacezmlawspeczmwasmZCMainZC: ($1) => (($1.parts.push($1.decoder.decode()), $1.parts.join(''))),
|
|
96
|
+
ZC2ZClawspeczmwasmzm0zi29zi1zminplacezmlawspeczmwasmZCMainZC: ($1,$2,$3) => ($1.parts.push($1.decoder.decode(new Uint8Array(__exports.memory.buffer, $2 >>> 0, $3), {stream: true}))),
|
|
97
|
+
ZC3ZClawspeczmwasmzm0zi29zi1zminplacezmlawspeczmwasmZCMainZC: () => (({decoder: new TextDecoder('utf-8', {fatal: true}), parts: []})),
|
|
98
|
+
ZC4ZClawspeczmwasmzm0zi29zi1zminplacezmlawspeczmwasmZCMainZC: ($1,$2,$3) => ((new TextEncoder()).encodeInto($1, new Uint8Array(__exports.memory.buffer, $2 >>> 0, $3)).written),
|
|
99
|
+
ZC5ZClawspeczmwasmzm0zi29zi1zminplacezmlawspeczmwasmZCMainZC: ($1) => ($1.length),
|
|
100
100
|
ZC0ZCghczminternalZCGHCziInternalziWasmziPrimziExportsZC: ($1,$2) => ($1.reject(new WebAssembly.RuntimeError($2))),
|
|
101
101
|
ZC18ZCghczminternalZCGHCziInternalziWasmziPrimziExportsZC: ($1,$2) => ($1.resolve($2)),
|
|
102
102
|
ZC20ZCghczminternalZCGHCziInternalziWasmziPrimziExportsZC: ($1) => {$1.throwTo = () => {};},
|
package/index.d.ts
CHANGED
|
@@ -619,6 +619,10 @@ export interface AnalysisCheck {
|
|
|
619
619
|
export type AnalysisCheckStatus =
|
|
620
620
|
'proved' | 'refuted' | 'exempted' | 'incomplete';
|
|
621
621
|
|
|
622
|
+
export interface FormatRequest extends CheckRequest {
|
|
623
|
+
compile?: boolean;
|
|
624
|
+
}
|
|
625
|
+
|
|
622
626
|
export interface GenerationRequest extends CheckRequest {
|
|
623
627
|
target: Target;
|
|
624
628
|
sourceDir?: string;
|
|
@@ -935,7 +939,7 @@ export type ScalarValue =
|
|
|
935
939
|
{type: 'Nullable' | 'Optional'; value: ScalarValue | null;};
|
|
936
940
|
|
|
937
941
|
export interface Compiler {
|
|
938
|
-
format(input:
|
|
942
|
+
format(input: FormatRequest): Promise<Result>;
|
|
939
943
|
check(input: CheckRequest): Promise<Result>;
|
|
940
944
|
expand(input: CheckRequest): Promise<Result>;
|
|
941
945
|
proofTasks(input: CheckRequest): Promise<Result>;
|