lawspec 0.26.0 → 0.27.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.
package/bin/lawspec.mjs CHANGED
@@ -4,7 +4,7 @@ import { readFile, mkdir, readdir, rm, stat, writeFile } from "node:fs/promises"
4
4
  import { createHash } from "node:crypto";
5
5
  import path from "node:path";
6
6
  import { createCompiler } from "../api.mjs";
7
- import { targets, templates, commands, setup } from "../templates.mjs";
7
+ import { targets, artifactTargets, templates, commands, setup } from "../templates.mjs";
8
8
  import { generateExamples } from "../examples-command.mjs";
9
9
  import { proveWithZ3 } from "../proof.mjs";
10
10
  import { serveLanguage } from "../lsp.mjs";
@@ -26,7 +26,7 @@ import {
26
26
  safePath,
27
27
  collectSources,
28
28
  } from "../files.mjs";
29
- const VERSION = "0.26.0";
29
+ const VERSION = "0.27.0";
30
30
  const args = process.argv.slice(2);
31
31
  const verb = args.shift();
32
32
  const options = {};
@@ -56,10 +56,13 @@ const output = (value) =>
56
56
  const shellQuote = (value) =>
57
57
  "'" + String(value).replaceAll("'", "'\\''") + "'";
58
58
  function testCommand(target, root) {
59
+ if (artifactTargets.includes(target.language)) return null;
59
60
  const testDir = target.testDir || "test";
60
61
  let command = commands[target.language];
61
62
  if (target.language === "python")
62
63
  command = `${shellQuote(target.python || "python3")} -m pytest`;
64
+ if (target.language === "prolog")
65
+ command = `${shellQuote(target.python || "python3")} lawspec_test.py`;
63
66
  if (target.language === "java")
64
67
  command = `${shellQuote(target.maven || "mvn")} test`;
65
68
  if (target.language === "kotlin")
@@ -237,7 +240,9 @@ async function init() {
237
240
  if (current === null)
238
241
  await atomicWrite(
239
242
  starter,
240
- await readFile(new URL("../starter-rc1.lawspec", import.meta.url), "utf8"),
243
+ artifactTargets.includes(language) && language !== "make"
244
+ ? "unit configuration\ntype Settings is a record{port :: UInt16 enabled :: Bool} end type\nfunction settings (unused :: Unit) -> Settings is Settings record{port = 8080, enabled = true} end function\nend unit\n"
245
+ : await readFile(new URL("../starter-rc1.lawspec", import.meta.url), "utf8"),
241
246
  true,
242
247
  );
243
248
  if (options.machineBits !== undefined) config.machineBits = options.machineBits;
@@ -291,10 +296,23 @@ async function lastRuns() {
291
296
  const folder = path.join(configRoot, ".lawspec", "results");
292
297
  const runs = new Map();
293
298
  const attestations = new Map();
299
+ // The outcome each law last had in each attested run, by run id; across
300
+ // targets a failure outweighs a pass.
301
+ const outcomes = new Map();
302
+ const rank = (o) => ["passed", "known-failing", "skipped", "incomplete", "failed"].indexOf(o);
294
303
  for (const name of (await readOptionalDirectory(folder)) ?? []) {
295
304
  if (!name.endsWith(".json")) continue;
296
305
  const recorded = JSON.parse((await readOptional(path.join(folder, name))) ?? "{}");
297
306
  for (const [id, attestation] of Object.entries(recorded.attestations ?? {})) attestations.set(id, attestation);
307
+ const outcome = (id, law, value) => {
308
+ const known = outcomes.get(id) ?? {};
309
+ if (known[law] === undefined || rank(value) > rank(known[law])) known[law] = value;
310
+ outcomes.set(id, known);
311
+ };
312
+ for (const [law, attempt] of Object.entries(recorded.attempts ?? {}))
313
+ if (attempt.environment) outcome(attempt.environment, law, attempt.outcome);
314
+ for (const [law, run] of Object.entries(recorded.laws ?? {}))
315
+ if (run.environment && recorded.attempts?.[law]?.environment !== run.environment) outcome(run.environment, law, "passed");
298
316
  for (const [law, run] of Object.entries(recorded.laws ?? {})) {
299
317
  const known = runs.get(law) ?? {};
300
318
  const latest = (known.passed ?? "") > (run.passed ?? "") ? known : run;
@@ -302,7 +320,7 @@ async function lastRuns() {
302
320
  passed: latest.passed, seed: latest.seed, environment: latest.environment });
303
321
  }
304
322
  }
305
- return { runs, attestations };
323
+ return { runs, attestations, outcomes };
306
324
  }
307
325
  // An environment attestation: a versioned JSON document any tool may write,
308
326
  // recording for one run where each dependency was wired and whether it was
@@ -323,10 +341,29 @@ async function readAttestation(config) {
323
341
  // One attested dependency, as lawspec evidence shows it.
324
342
  function dependencyText(d) {
325
343
  const level = (c) => /^[0-9]+$/.test(c) ? `conformance level ${c}` : `conformance ${c}`;
344
+ const ran = d.ranAgainst ?? {};
345
+ const history = ran.historyDigest ?? d.standIn?.historyDigest;
326
346
  return `${d.dependency}: ` + (d.standIn
327
347
  ? `stand-in ${d.standIn.identity} ${d.standIn.version} (${level(d.standIn.conformance)}` +
328
- (d.standIn.historyDigest ? `, history ${d.standIn.historyDigest}` : "") + ")"
329
- : "real") + ` at ${d.endpoint}` + (d.reached ? "" : " (not reached when recorded)");
348
+ (history ? `, history ${history}${ran.historyFrom === "completed" ? " when completed" : ""}` : "") + ")"
349
+ : "real") + ` at ${d.endpoint}` + (d.reached ? "" : " (not reached when recorded)") +
350
+ (d.implementation ? `; ${d.implementation.kind} ${d.implementation.product} ${d.implementation.version}` : "") +
351
+ (d.contract ? `; contract ${d.contract.package} ${d.contract.version}` : "") +
352
+ (d.node ? `; node ${d.node}` + (d.edge ? ` via ${d.edge}` : "") : "") +
353
+ (d.completed && !d.completed.reached ? " (not reached when completed)" : "");
354
+ }
355
+ // What an attested run's document records, as lawspec evidence shows it.
356
+ function executionText(run) {
357
+ const e = run?.execution;
358
+ if (!e) return "";
359
+ return e.status === "completed" ? `, completed with exit code ${e.exitCode}` :
360
+ e.status === "running" ? ", in progress" : ", wiring only";
361
+ }
362
+ // Why a law relying on an attested dependency has no completed run linked.
363
+ function unlinkedText(run) {
364
+ const status = run?.execution?.status;
365
+ return status === "wired" ? "wiring only; nothing ran" :
366
+ status === "running" ? "run in progress; no completed run linked" : "no completed run linked";
330
367
  }
331
368
  // One law's harness, as lawspec evidence shows it.
332
369
  function harnessText(item) {
@@ -345,9 +382,7 @@ function harnessText(item) {
345
382
  if (h.skip) parts.push(`skip "${h.skip}"`);
346
383
  if (h.knownFailing) parts.push(`known failing "${h.knownFailing}"`);
347
384
  if (h.orderRandom) parts.push("order random");
348
- // Python runs a parallel unit's tests at the same time only with
349
- // pytest-xdist; without it, parallel changes nothing there.
350
- if (h.parallel) parts.push("parallel (on Python only with pytest-xdist; otherwise one after another)");
385
+ if (h.parallel) parts.push("parallel");
351
386
  const lines = [` ${item.declaration.replace("::law::", "::")}: ${parts.join("; ") || "no harness settings"}`];
352
387
  for (const run of item.adequacy ?? []) {
353
388
  lines.push(` last run: ${run.cases} generated case(s)` +
@@ -487,12 +522,11 @@ async function runTests(compiler, input, selected, roots, config) {
487
522
  if (beam || target.language === "scala") await rm(coverage, {recursive: true, force: true});
488
523
  await mkdir(beam ? path.join(coverage, "runs") : coverage, { recursive: true });
489
524
  }
490
- // parallel on Python needs pytest-xdist; without it the tests run one
491
- // after another, and lawspec test says so.
525
+ // Python may use xdist processes; the host harness otherwise supplies
526
+ // its existing thread scheduler, which Prolog also uses through Janus.
492
527
  let xdist = false;
493
528
  if (target.language === "python" && stale.some((entry) => entry.parallel)) {
494
529
  xdist = spawnSync(target.python || "python3", ["-c", "import xdist"], { cwd: root, stdio: "ignore" }).status === 0;
495
- if (!xdist) console.error("python: `parallel` runs tests at the same time only with pytest-xdist (pip install pytest-xdist); without it they run one after another.");
496
530
  }
497
531
  // A skipped law runs nothing. BEAM known-failing checks finish as native
498
532
  // passing tests, so their completion must appear in the native report.
@@ -579,10 +613,14 @@ async function runTests(compiler, input, selected, roots, config) {
579
613
  await writeFile(databaseFile, JSON.stringify(database, null, 2) + "\n");
580
614
  await mkdir(path.dirname(resultsFile), { recursive: true });
581
615
  await writeFile(path.join(path.dirname(resultsFile), ".gitignore"), "*\n");
616
+ // Each attempt at a law the attestation touches names the run it was
617
+ // made in, whatever its outcome.
618
+ if (attestation) for (const entry of stale)
619
+ if (attested.has(entry.law) && attempts[entry.law]) attempts[entry.law] = { ...attempts[entry.law], environment: attestation.run.id };
582
620
  // Each attestation a recorded law ran under is kept with the results.
583
621
  const attestations = Object.fromEntries(Object.entries({ ...(previous.attestations ?? {}),
584
622
  ...(attestation ? { [attestation.run.id]: attestation } : {}) })
585
- .filter(([id]) => Object.values(laws).some((run) => run.environment === id)));
623
+ .filter(([id]) => [...Object.values(laws), ...Object.values(attempts)].some((run) => run.environment === id)));
586
624
  await atomicWrite(resultsFile, JSON.stringify({ version: 1, laws, attempts,
587
625
  ...(Object.keys(attestations).length ? { attestations } : {}) }, null, 2) + "\n");
588
626
  const flaky = statistics.filter((s) => s.outcome === "flaky").map((s) => s.law);
@@ -785,8 +823,11 @@ async function main() {
785
823
  "Expected lawspec.json version 2 with languageProfile 1.0-rc.2, sources and targets arrays",
786
824
  );
787
825
  if (config.languageProfile !== "1.0-rc.2") throw new Error("Configuration version 2 requires languageProfile 1.0-rc.2");
826
+ if (verb === "test" && artifactTargets.includes(options.target))
827
+ throw new Error(`${options.target} is an artifact target and cannot execute application laws`);
788
828
  const selected = config.targets.filter(
789
- (t) => !options.target || t.language === options.target,
829
+ (t) => (!options.target || t.language === options.target) &&
830
+ (verb !== "test" || !artifactTargets.includes(t.language)),
790
831
  );
791
832
  if (["doctor", "generate", "test"].includes(verb) && !selected.length &&
792
833
  !(verb === "test" && !options.benchmarks && config.version === 2 && !(config.verification?.layers ?? []).some(layer => ["exhaustive", "property", "examples", "model"].includes(layer))))
@@ -804,7 +845,7 @@ async function main() {
804
845
  : reports
805
846
  .map(
806
847
  (r) =>
807
- `${r.target}: ${r.ok ? "ready" : `${r.message}\n${r.instructions}`}`,
848
+ `${r.target}: ${r.ok ? (r.kind === "artifact" ? "generation ready" : "ready") : `${r.message}\n${r.instructions}`}`,
808
849
  )
809
850
  .join("\n"),
810
851
  );
@@ -890,22 +931,40 @@ async function main() {
890
931
  if (verb === "evidence") {
891
932
  // An attestation named here, or in lawspec.json, says where the tests
892
933
  // ran; otherwise each law shows the attested run it last passed in.
934
+ // A named attestation of a run lawspec test recorded links each law to
935
+ // that run, with the outcome recorded for it, unless the document says
936
+ // the run has not completed.
893
937
  const named = await readAttestation(config);
894
- const result = diagnostics(await compiler.check({ ...input, ...(named ? { attestation: named } : {}) }));
938
+ const { runs, attestations, outcomes } = await lastRuns();
939
+ const recorded = named && typeof named.run?.id === "string" ? outcomes.get(named.run.id) : undefined;
940
+ const result = diagnostics(await compiler.check({ ...input,
941
+ ...(named ? { attestation: named, ...(recorded ? { attestedOutcomes: recorded } : {}) } : {}) }));
895
942
  let evidence = attachNativeEvidence(result.evidence,await readNativeObservations({compiler,input,selected,roots,
896
943
  configRoot,build:await buildDigest(),evidence:result.evidence,attestation:named}));
897
- const { runs, attestations } = await lastRuns();
898
944
  const environments = named ? [result.attestation] : [];
899
945
  if (!named) for (const [id, attestation] of attestations) {
900
946
  const laws = new Set([...runs].filter(([, run]) => run.environment === id).map(([law]) => law));
901
947
  if (!laws.size) continue;
902
- const attested = diagnostics(await compiler.check({ ...input, attestation }));
948
+ const attested = diagnostics(await compiler.check({ ...input, attestation, attestedOutcomes: outcomes.get(id) ?? {} }));
903
949
  const fields = new Map(attested.evidence.filter((item) => (item.against || item.plannedAgainst) && laws.has(item.declaration))
904
- .map(item => [item.declaration, {environment: item.environment ?? item.plannedEnvironment,
905
- environmentRun: item.environmentRun ?? item.plannedEnvironmentRun, against: item.against ?? item.plannedAgainst}]));
950
+ .map(item => {
951
+ // Receipts predating execution states keep their historical meaning.
952
+ // An explicit running/wired state must retain the compiler's planned
953
+ // fields; a cached passing law does not complete its environment run.
954
+ const legacy = !attestation.execution && !item.against;
955
+ return [item.declaration, legacy ? {
956
+ environment: item.plannedEnvironment, environmentRun: item.plannedEnvironmentRun,
957
+ against: item.plannedAgainst, environmentProviders: item.plannedEnvironmentProviders,
958
+ } : Object.fromEntries(["environment", "environmentRun", "against", "environmentProviders", "environmentOutcome",
959
+ "plannedEnvironment", "plannedEnvironmentRun", "plannedAgainst", "plannedEnvironmentProviders"]
960
+ .filter(key => item[key] !== undefined).map(key => [key, item[key]]))];
961
+ }));
906
962
  evidence = evidence.map((item) => item.stage === "law" && fields.has(item.declaration) ? { ...item, ...fields.get(item.declaration) } : item);
907
963
  environments.push({ ...attested.attestation, dependencies: attested.attestation.dependencies
908
- .map((d) => ({ ...d, obligations: [...new Set([...d.obligations, ...(d.plannedObligations ?? [])])].filter((law) => laws.has(law)), plannedObligations: [] })) });
964
+ .map((d) => ({ ...d,
965
+ obligations: (attestation.execution ? d.obligations : [...new Set([...d.obligations, ...(d.plannedObligations ?? [])])])
966
+ .filter((law) => laws.has(law)),
967
+ plannedObligations: attestation.execution ? (d.plannedObligations ?? []).filter((law) => laws.has(law)) : [] })) });
909
968
  }
910
969
  // Native bindings are configured per target; their obligations are added.
911
970
  for (const target of selected) {
@@ -941,18 +1000,32 @@ async function main() {
941
1000
  (item.claim ? `: ${item.claim.text}` : "") + `\n ${item.reason}` +
942
1001
  (item.nativeEvidence ? `\n ${nativeEvidenceText(item).replaceAll("\n","\n ")}` : "") +
943
1002
  (item.lastNativeRun ? `\n last native run passed at ${item.lastNativeRun.passed} (seed ${item.lastNativeRun.seed})` : "") +
944
- (item.against ? `\n last recorded passing run in environment ${item.environment} (run ${item.environmentRun.id}) against ` +
945
- item.against.map(dependencyText).join("; ") : "")).join("\n");
1003
+ (item.against ? (item.environmentOutcome
1004
+ ? `\n ${item.environmentOutcome} in completed run ${item.environmentRun.id} in environment ${item.environment}${executionText(item.environmentRun)} against `
1005
+ : `\n last recorded passing run in environment ${item.environment} (run ${item.environmentRun.id}) against `) +
1006
+ item.against.map(dependencyText).join("; ") : "") +
1007
+ (item.plannedAgainst ? `\n planned in environment ${item.plannedEnvironment} (run ${item.plannedEnvironmentRun.id}` +
1008
+ `${executionText(item.plannedEnvironmentRun)}; ${unlinkedText(item.plannedEnvironmentRun)}) against ` +
1009
+ item.plannedAgainst.map(dependencyText).join("; ") : "")).join("\n");
946
1010
  })
947
1011
  .filter((section) => section !== null),
948
1012
  // How each law is discharged: the harness plane, apart from what
949
1013
  // the laws say.
950
1014
  ...(harnessed.length ? [`HARNESS (${harnessed.length})\n` + harnessed.map(harnessText).join("\n")] : []),
951
1015
  // Where the tests ran: reporting only, so no status above changes.
952
- ...environments.map((e) => `ENVIRONMENT ${e.environment} (run ${e.run.id}, recorded ${e.run.recordedAt})\n` +
953
- e.dependencies.map((d) => ` ${dependencyText(d)}; ` + (d.obligations.length
954
- ? `${d.obligations.length} tested obligation(s)` :
955
- d.plannedObligations?.length ? `${d.plannedObligations.length} planned obligation(s); no completed run linked` : "no tested obligation relies on it")).join("\n"))]
1016
+ ...environments.map((e) => `ENVIRONMENT ${e.environment} (run ${e.run.id}, recorded ${e.run.recordedAt}${executionText(e.run)})\n` +
1017
+ (e.architecture ? ` architecture ${e.architecture.document} ${e.architecture.digest}` +
1018
+ (e.architecture.topologyDigest ? `, topology ${e.architecture.topologyDigest}` : "") + "\n" : "") +
1019
+ (e.application ? ` application ${e.application.node}: contract ${e.application.contract.package} ${e.application.contract.version}; ` +
1020
+ `${e.application.implementation.kind} ${e.application.implementation.product} ${e.application.implementation.version}` +
1021
+ (e.application.implementation.commit ? ` (commit ${e.application.implementation.commit})` : "") + "\n" : "") +
1022
+ e.dependencies.map((d) => {
1023
+ const outcome = (o) => evidence.find((item) => item.declaration === o && item.environmentOutcome)?.environmentOutcome;
1024
+ const failed = d.obligations.filter((o) => ["failed", "incomplete"].includes(outcome(o))).length;
1025
+ return ` ${dependencyText(d)}; ` + (d.obligations.length
1026
+ ? `${d.obligations.length} tested obligation(s)` + (failed ? `, ${failed} failed` : "") :
1027
+ d.plannedObligations?.length ? `${d.plannedObligations.length} planned obligation(s); ${unlinkedText(e.run)}` : "no tested obligation relies on it");
1028
+ }).join("\n"))]
956
1029
  .join("\n\n"),
957
1030
  );
958
1031
  return;
@@ -1024,7 +1097,7 @@ async function main() {
1024
1097
  : summary
1025
1098
  .map(
1026
1099
  (r) =>
1027
- `${r.target}: ${r.changes.length} ${options["dry-run"] || options.check ? "planned" : "applied"} change(s), ${r.preservedAdapters.length} user adapter(s) preserved.${r.adapterUpdates.length ? "\nReview required adapter signatures:\n" + r.adapterUpdates.map((a) => a.path + "\n" + a.requiredAdapter).join("\n") : ""}\nTest: ${r.test}`,
1100
+ `${r.target}: ${r.changes.length} ${options["dry-run"] || options.check ? "planned" : "applied"} change(s), ${r.preservedAdapters.length} user adapter(s) preserved.${r.adapterUpdates.length ? "\nReview required adapter signatures:\n" + r.adapterUpdates.map((a) => a.path + "\n" + a.requiredAdapter).join("\n") : ""}\n${r.test === null ? "Artifact generation complete." : "Test: " + r.test}`,
1028
1101
  )
1029
1102
  .join("\n"),
1030
1103
  );
package/build.json CHANGED
@@ -199,6 +199,9 @@
199
199
  "runtime/lawspec_network.mjs",
200
200
  "runtime/lawspec_network.py",
201
201
  "runtime/lawspec_network.rs",
202
+ "runtime/lawspec_prolog.pl",
203
+ "runtime/lawspec_prolog.py",
204
+ "runtime/lawspec_prolog_tests.py",
202
205
  "runtime/lawspec_runtime.go",
203
206
  "runtime/lawspec_runtime.mjs",
204
207
  "runtime/lawspec_runtime.py",
@@ -230,6 +233,7 @@
230
233
  "src/LawSpec/Actors/Types.hs",
231
234
  "src/LawSpec/Actors/Web.hs",
232
235
  "src/LawSpec/Api.hs",
236
+ "src/LawSpec/ArtifactEmit.hs",
233
237
  "src/LawSpec/Attestation.hs",
234
238
  "src/LawSpec/Backend.hs",
235
239
  "src/LawSpec/BeamAbilities.hs",
@@ -399,6 +403,7 @@
399
403
  "src/LawSpec/PortableTestHelpers.hs",
400
404
  "src/LawSpec/Prelude.hs",
401
405
  "src/LawSpec/PreludeNames.hs",
406
+ "src/LawSpec/Prolog/Emit.hs",
402
407
  "src/LawSpec/Public.hs",
403
408
  "src/LawSpec/PythonData.hs",
404
409
  "src/LawSpec/PythonDefinitions.hs",
@@ -499,9 +504,9 @@
499
504
  "wasm/lawspec-wasm.cabal"
500
505
  ],
501
506
  "digests": {
502
- "dev/Gen/Embed.hs": "32b40834ed6f58d5290af56b62037426cb5868b4d4fa2ee6de0aa541a494199f",
503
- "lawspec.cabal": "2c116a609c30e9b5b4fea751f3458b64768d971d1df46e9e43c29387185f3d95",
504
- "package.yaml": "46d38e8bac595aabf0d1861a27e72bc150581204089d31a03896def2069e7396",
507
+ "dev/Gen/Embed.hs": "a359c45835b3656d7381d5f00f3b4c17ebe25460cdcb7b9905c7842a25eec406",
508
+ "lawspec.cabal": "651ceb8d6e545980ed917a793a1b84aeb02607fc10018bc7007412bba475f5ed",
509
+ "package.yaml": "d1dee3ff1a97e817dcb8cdc8ac55817cf8dae46cf6db67e42ba7dfe9ebff483b",
505
510
  "runtime/LawSpecCodecs.hs": "02813943d154f064457601319ef59ab8c48f1416cdd40115e94a44619a1238a0",
506
511
  "runtime/LawSpecCollectionCodecs.hs": "1ec581af09c2931cacd0245b35debebd066fd06d71c6dfb60a124af9a5fac562",
507
512
  "runtime/LawSpecDataStrategies.hs": "463a6825756f162111d4d085c806a54bd2707ce3abf8e4986842cf0b4f9e4a84",
@@ -697,24 +702,27 @@
697
702
  "runtime/lawspec_network.mjs": "db5d1b4bcddb67a499236ceb147a36c6b4f63016b142bbd4fabd5421b1419d4a",
698
703
  "runtime/lawspec_network.py": "7d96c9ef7075f527d5d133ec867920f88bc22b9aa4014c56c71cbcc350e63f40",
699
704
  "runtime/lawspec_network.rs": "265311ec1ba62a11cbd175c706c2bbc5149ac9579a954e8ce2135c3a0233986d",
705
+ "runtime/lawspec_prolog.pl": "d7854da9cc215ee7ef6c46c6a56f17e1307b362173ccac9f1651dbcaede66e81",
706
+ "runtime/lawspec_prolog.py": "04e70e87f4e1d8cb6f1209b44d1b989012f9e493f177a79f2b138d7a0fed57d3",
707
+ "runtime/lawspec_prolog_tests.py": "994dd1f3c42e0900f72761dd9cb6fedd8ee6de1a03ec3f2d17748c76690704ed",
700
708
  "runtime/lawspec_runtime.go": "f7b4611bd428a7be07c0c37ce6eed84cfef4e1413cb5d9a17f6a884a3c0e4f47",
701
709
  "runtime/lawspec_runtime.mjs": "5482f479d0e3aa045cddcde2646c09d4f3de165f64fcd89660c1e1e0a8df1b92",
702
- "runtime/lawspec_runtime.py": "1fdcdb9a4e01d6b27fe1d78e56a988915a845fff98db3c5d6e8f434bd5a93de0",
710
+ "runtime/lawspec_runtime.py": "edff60940fef773022d42e32871eac92b8b6f512a3af429085b126b917e1e9a3",
703
711
  "runtime/lawspec_runtime.rs": "688ba4ba40eda80207abc489b18461cdfbe0585a73befa284e4e45892b497e7d",
704
712
  "runtime/lawspec_schema.go": "01916186c41bfd3d406a6ab92c9f0693d6f1103c3d83290c203c6aef5d243106",
705
713
  "runtime/lawspec_schema.mjs": "2c845310cbc0f66efa2d871e13ba841c3414f9352aebd1f3af656ca7a594c843",
706
- "runtime/lawspec_schema.py": "d55bffd4453d17555e02e95ed484cd7c2b7bbf428db6bb9406cffbf019164169",
714
+ "runtime/lawspec_schema.py": "6b55409a772c15d16142ea20d7d3f80231ad489cfce19e8a92ca9ad13c0a2f67",
707
715
  "runtime/lawspec_strategies.rs": "b801c9ddc702588b6b30e6a14c1e7b200ae2e0229f4f3ca8f6fb5510e8238df6",
708
- "runtime/rust/Cargo.lock": "6bd9cf9b2a2604db90187a2ee1acce007f86d986033c87bab68e792879dadead",
709
- "runtime/rust/Cargo.toml": "6f035ffcbeb305ad5503aec61aedb155356f44a55d622c4d193e14804028813c",
710
- "src/LawSpec/Abilities.hs": "47d318d113011b73876ef98d81137a2098ba21215c59de00b2a6ff171a480984",
716
+ "runtime/rust/Cargo.lock": "b92d921ecebc89ae037670a392179b477b43f06c5ca73c902788922f1432781d",
717
+ "runtime/rust/Cargo.toml": "2fac90534d2af764f4f0b03fd435af99cad5e9b54ea543b7c6a38acf469dfdfe",
718
+ "src/LawSpec/Abilities.hs": "79e900dea8c07ec0ca724d6301b4a489332de0cc0d7ce46511a16a21bca13831",
711
719
  "src/LawSpec/AbilityEmit.hs": "d79a0b60785433c7763aea6edb389c45377b7be98a5345436140a725655de3b7",
712
720
  "src/LawSpec/AbilityEmit/Go.hs": "d6e78b73c6f225c90cfc4345f2c4fbc6a090ec5083e4ba65af906028cc33f994",
713
721
  "src/LawSpec/AbilityEmit/Haskell.hs": "4b35bff659a2721c9a94c745616e815cceef7ad20769fdc87852363913bd26a3",
714
722
  "src/LawSpec/AbilityEmit/Java.hs": "3d55e517f3ae6f5337b12f5557e02fe267de16b2abc30a469fff5881ed088dd5",
715
723
  "src/LawSpec/AbilityEmit/Kotlin.hs": "0a080fde84579681351ae371f007e9ad3be8f6eaa8d908f1f3f2d17d558bd247",
716
724
  "src/LawSpec/AbilityEmit/Python.hs": "a4e3749a9d028e169f05d806c71f64482be7d4c98402055f3a4dad9a3a2d1ef0",
717
- "src/LawSpec/AbilityEmit/Rust.hs": "a5e903b625f925b847c230f17c3db418a0f367b706b3a05fbd9f33f44d2b1e7c",
725
+ "src/LawSpec/AbilityEmit/Rust.hs": "de51ce3f815bf8828f0cba4f944d5f80e0860a68e4a71b7f6d1e27884a9346ae",
718
726
  "src/LawSpec/AbilityEmit/Scala.hs": "ecb9cab2dc3c28e1be0d7763b2f3c107cbb101ce99f0c508955441d1ea6fa947",
719
727
  "src/LawSpec/AbilityEmit/Web.hs": "9ca72a92447ce194d1424ab5f4cadf981e6d2bcfd816059ea8658f31d62a222e",
720
728
  "src/LawSpec/AbilityNames.hs": "694bfabe711eaf23f75ec63ae2ecb196271b06c18e5d614fc07512002675a405",
@@ -727,8 +735,9 @@
727
735
  "src/LawSpec/Actors/Scala.hs": "6a034fb96983fd11b8714d5c6b8c09b5cb24ceb06977b52010c2424a51b60f38",
728
736
  "src/LawSpec/Actors/Types.hs": "09f764a8da926f00817a0de0f17a03d48194c819a3c64aca78c96b19d38ac823",
729
737
  "src/LawSpec/Actors/Web.hs": "b8a63be30754569d7b150d454e656b4089a63e2f913bb2276ba722e2529e185d",
730
- "src/LawSpec/Api.hs": "9de2c89addbb64a77910d06c4f91817830272c91e887ee5ebd3173c54cb46f12",
731
- "src/LawSpec/Attestation.hs": "8315879771dbf8417a32a06421b292ad67ede9635449b9865e171f0d2afe11f7",
738
+ "src/LawSpec/Api.hs": "cf611dc452b444680e1434e49b5d8401d5fe1695f6df7ec82fa0beab28fa23f4",
739
+ "src/LawSpec/ArtifactEmit.hs": "c6249a494be8c522a59971f60ad1eb935c5d5f510183bbe3692f59d7eea3c416",
740
+ "src/LawSpec/Attestation.hs": "54c932e3cb9a297c220996f0cbe9cb5dc8db8ad8d532f15c6d4220a6a6078f28",
732
741
  "src/LawSpec/Backend.hs": "bd11686c38f6bf52791f3d490bb95e60c53feda6f6fd40dda03dcb3278745760",
733
742
  "src/LawSpec/BeamAbilities.hs": "958d34b7a8808dbe4f5fad6a5b6b922651ac1659f2dc6bcf7189732dc4e2d823",
734
743
  "src/LawSpec/BeamActors.hs": "f2dfd04d9d73534ff2888c77d00e42fa5dd7f1b3c6b0d552ca1a3e85520ebbf5",
@@ -766,10 +775,10 @@
766
775
  "src/LawSpec/Code/JavaScript.hs": "20e9536ba253a43fbbca96a8c20c3fd7c87b8fcacc065b5c5f4a1741f321b843",
767
776
  "src/LawSpec/Collections.hs": "4138cbfe26985a53ec01778020d7432f9d56cfa97ad9ecef9b295316917ff2f2",
768
777
  "src/LawSpec/Common.hs": "a9ad307ccf2bb9accad655c2795ca3276d5de58d86cbaaf423aff4dea45dee83",
769
- "src/LawSpec/Compile.hs": "fa3526b54da1d3cff96f813b07aaca879415ab7ac6ae1582d385338a52b1a7c1",
778
+ "src/LawSpec/Compile.hs": "d53eb7bd4885527a118f1ae154cf964c424a82e62b9a0ef24d09962387bb5dde",
770
779
  "src/LawSpec/Core.hs": "81b2b8d50cfdc564ea0adc43ff6e4191cc7e3ba7f8ce19bc0f3815b681db51a8",
771
780
  "src/LawSpec/Core/CapabilityScope.hs": "0f419bc299253e04684dfda7b127d9731032512fec78090892684a7b50004b52",
772
- "src/LawSpec/Core/DefinitionContracts.hs": "5d15492609003bff4599cc2acc6e7206cdd01692af4c70a0abb6619b001eff3f",
781
+ "src/LawSpec/Core/DefinitionContracts.hs": "d1030a5c8ac8a689bcd6c534a0f0017bb8d5a0aa57e346098d5c943c0a069881",
773
782
  "src/LawSpec/Core/Definitions.hs": "814c5ae73bc10da9b9873eadbc2e2e3376a3947c2c1a781b44b0224c0ff18f15",
774
783
  "src/LawSpec/Core/DomainEvidence.hs": "825e7f2b76f9d5ec6cdce5e06152126a3e22543b5db685d00b21ab23d46cbad5",
775
784
  "src/LawSpec/Core/EqSet.hs": "bb1a82176ff5ecb235aa3c253f6cc53da8518d1858212d7860e23d6d617bfaa8",
@@ -801,7 +810,7 @@
801
810
  "src/LawSpec/Core/Validate.hs": "32d56e6a8390b88d0f614d98d3cd6f986e51fcdef4c2f06601eade724f953e40",
802
811
  "src/LawSpec/Core/Value.hs": "e366666aef9f1ec6fa089d540d772d68b474955b9f5f8ab4b3298fe0b1c85844",
803
812
  "src/LawSpec/Core/Verification.hs": "a8ceec096d5a0cf96910daadf1d7d8ef91589164b7413af4e55f4efaeae77c1d",
804
- "src/LawSpec/CoreEmit.hs": "2f0d16a9d73174fb191b594f83e4fdaaecd647784ad54550a8a1935208d7f844",
813
+ "src/LawSpec/CoreEmit.hs": "80d2a58879776a966ff958783829c52eb61a1040d317e1dc9dc48e7c269fbc0e",
805
814
  "src/LawSpec/CoreNativeScalarEmit.hs": "806c202b2690f469196e623c829f1c84f9d229478a6deccb18dbc416adbd55d5",
806
815
  "src/LawSpec/CorePersist.hs": "a6131ae2277757cd90f4ba59717b8f3f87da808ebfe0e2ec7599f3a3d346ade7",
807
816
  "src/LawSpec/CoreScalarEmit.hs": "7a5619da482ee71c9541047b373989fba0b9fd8582416cc0495802faa78f927b",
@@ -836,7 +845,7 @@
836
845
  "src/LawSpec/Elaboration.hs": "74e2481fcaf88e484e344b40322736552f88af9735f0aa92ab86fb506ab909f2",
837
846
  "src/LawSpec/ElixirCode.hs": "92925005defb80038917c1f6daf0df5e41e473c8b09a01e618438886c3fc0f52",
838
847
  "src/LawSpec/ElixirNative.hs": "877b30fcc03f481470b1b5b04485c8da53eee15caa7a94e2edff5a5667c22046",
839
- "src/LawSpec/Emit.hs": "b4e67bb1fd0f5acfd1864516be417c5d560aaf147d2a86a6f1360a61fd58b2ba",
848
+ "src/LawSpec/Emit.hs": "943fe7fc59e4e170135ecfcb4585906792d8e44c6196f7f8ebca27519d8a5510",
840
849
  "src/LawSpec/Eval.hs": "441bb211945a09fbbe03641e7f2ee4d321699c068909d6be80b3f8fb28adb3ea",
841
850
  "src/LawSpec/Flow.hs": "01c840c6045a2ded8a334947ac3d48f167c49f77bc69ba9c6536860e209f1a87",
842
851
  "src/LawSpec/Frontend.hs": "4b4bfd408703cd5f04244cf02145f60c0aa4061564c1d100464a9186f32dd502",
@@ -886,7 +895,7 @@
886
895
  "src/LawSpec/Model.hs": "ee651b0c6f8ddc0b3abaab448ecef16b6e2163fcd41fc1457faa15fd19a82df4",
887
896
  "src/LawSpec/ModelTests.hs": "1f6ae6b7500f81beb9e71cc7ef8d0db5f4df79dea4813d9dfa920bdb9ac70944",
888
897
  "src/LawSpec/NativeBinding.hs": "44e7cb7d3a7b738256b9ef9f78a09779d3f81d9e764974d3148ea1388be31e94",
889
- "src/LawSpec/NativeModelChecks.hs": "7759968e3183f9b8d00ab4fe5c864976dfd4ebe855701ca8a2f99a7a48e35091",
898
+ "src/LawSpec/NativeModelChecks.hs": "612125cfcc2d5246d7584154ca4c3511d1922d07fcbf4b84c6cd65f6aa75d5f5",
890
899
  "src/LawSpec/NativeRequest.hs": "1851127c89411f4f0712017c4d2960e6e891b800f6ce6a4f729104ba5825072f",
891
900
  "src/LawSpec/NativeRequestView.hs": "4a6389f2cc87d84324e2f502cb15a083c9d29f236a162cefe5bd2173db98df91",
892
901
  "src/LawSpec/Network.hs": "4fdbc8a0bc6f91b22f1fe57554078be79425d9a4f4509e09595b949092f4f733",
@@ -897,6 +906,7 @@
897
906
  "src/LawSpec/PortableTestHelpers.hs": "1a60780525e70b2faf84c09750362ea5a9b2927225812378e6e210126aed6a45",
898
907
  "src/LawSpec/Prelude.hs": "5d472d28b6a5697afaadbad1b5a9b0ad620489974db4a4a3d0ca71ed5a031eb6",
899
908
  "src/LawSpec/PreludeNames.hs": "7e93cc4cc7ff6efadb68baf7ef475474c6751f43c8b59db122302476c3471d7d",
909
+ "src/LawSpec/Prolog/Emit.hs": "11d7d0de91b3195447894f93295775bb078774b3fa06474b5f7e6f1c2f1697ef",
900
910
  "src/LawSpec/Public.hs": "8025c1f326c92d62652ea36d3eabf30f41884f6862340d8445710a8c294a496d",
901
911
  "src/LawSpec/PythonData.hs": "e144e894eb7d911b5bd9b99937221f1fed6bb903689007cf77a5ab00dbc0c771",
902
912
  "src/LawSpec/PythonDefinitions.hs": "f24b96f5fa24741eaa34633238bacbd4c12bc36379f396866092c0a2cf18aeb3",
@@ -904,13 +914,13 @@
904
914
  "src/LawSpec/PythonNativeBinding.hs": "be3f28d3258ade4a7923d035cd53d44bbb6168413f9307c11373ad950f8caf03",
905
915
  "src/LawSpec/PythonTypes.hs": "3cb61fce7882a38b7ef93edfcae543b76deab3261f76d902a964031c2b679891",
906
916
  "src/LawSpec/Railway.hs": "9c2ee84bdd8c47b522c72be7c41be3c132a27d52e945b48374e1de54919daec5",
907
- "src/LawSpec/Refinement.hs": "97d203ed82b07bddb0dec77016798903c542ae270646d3447437abfe24a332c9",
917
+ "src/LawSpec/Refinement.hs": "5039d8b256f8072c2a8127e03ee58c20c61f8502712cc7733338ae7a469a4f29",
908
918
  "src/LawSpec/Regex.hs": "61618a6364c672f42d9c578ec826b51cc28c342282c15d2cad098be56a887c4d",
909
919
  "src/LawSpec/Release.hs": "4721411ad78908b6c96a7b56f596defbd32cf4bebc9de0af1494f780ce8febef",
910
920
  "src/LawSpec/Remote.hs": "998ac8f7d35afdef753c238aaead5aee48b10db338d0cf400be83776c6e9f366",
911
921
  "src/LawSpec/Resilience.hs": "f6531412176f6740d7506ab13fdda21e3b4279fb6b0dd8711b5123809a9763f9",
912
922
  "src/LawSpec/Resources.hs": "f252f1bd9848dfcb2d055671faf5ec177f63917d8532760877e288a6e2436cf3",
913
- "src/LawSpec/RuntimeSources.hs": "b9f6704ee7236c17c6977d61394bb0e0027979dc8570a2e56aef9d82ad7834a3",
923
+ "src/LawSpec/RuntimeSources.hs": "e83c416216842c5743e785d98452aff2b47287d4b948122d1f70317b8fa0ee36",
914
924
  "src/LawSpec/RustAbilityPaths.hs": "ef1a53e87c67ff69be489f36f0fdb20a954a5dcc25d5dcf3b0134d875572f221",
915
925
  "src/LawSpec/RustData.hs": "509a56c6b9399151e024743828bae2df1b0d62dfd694bb3897cd7381d0c77ed7",
916
926
  "src/LawSpec/RustDefinitions.hs": "d4c6a4ecebadc7ba1d53df962173ba04622cce4adbd45bfc06dee6cb162323f5",
@@ -918,7 +928,7 @@
918
928
  "src/LawSpec/RustExpr.hs": "db2c201a50d56436850c832bca11719399cd24a140a208868a2bedb3f9c676f9",
919
929
  "src/LawSpec/RustNativeBinding.hs": "976306e938cdf72c0c4d166a02b269642d2d4e161f72a9226b85dcdf8269c017",
920
930
  "src/LawSpec/RustNativeGenerators.hs": "5a8cfbe3b840c7b5f9fd73b37d27861b60430075fa921299438544093d458bd9",
921
- "src/LawSpec/Scaffold.hs": "a210edbb934e48b8d085b7290dec7a5faa9dfd61912a5f232f5ac90f227e3964",
931
+ "src/LawSpec/Scaffold.hs": "484ce0425accbb6e632ce0e302f493bc7d0e8f0ff5d556e063089262b2bd600d",
922
932
  "src/LawSpec/ScalaData.hs": "e66290a8073b18aa21d13ede17bfc216d76b94ae694dc4a14d67d98c7b262346",
923
933
  "src/LawSpec/ScalaDefinitions.hs": "33e2db7d6dba6953388efea19f4ed5b901beb481f4521e306b88a7b79fbf5fd9",
924
934
  "src/LawSpec/ScalaExpr.hs": "2b685463cca3884a5a0563de993cf8419807a4cb6a30cb68b4ee98beefd0f46d",
@@ -964,9 +974,9 @@
964
974
  "src/LawSpec/Swift/Sessions.hs": "ce467f4dbf948de8834fb61855721e6cff85c55b81fdb14adf599f03de03f4a7",
965
975
  "src/LawSpec/SwiftSources.hs": "ca3e2ee3a9118439f054f58813578b2b4e09b73795aa87b841d895b2f6f9ecdb",
966
976
  "src/LawSpec/TargetNames.hs": "f97f4fba7f33fed9d3b30670bae56693fe258308c7b0fac251ac7b8a48bb30d4",
967
- "src/LawSpec/Targets.hs": "eaf5b3006fd31b134053c755ecd13b5a18b6ff22d0de233f9dc044e9fdb82c2a",
977
+ "src/LawSpec/Targets.hs": "ad9c43ac022ae6d79d84bd2433fec699360ca6111809443bca1829d2b6f192d0",
968
978
  "src/LawSpec/Temporal.hs": "68ad4fca89f75476030428edf5d1d22f868605b07f1ee59f2641025b5cab1c00",
969
- "src/LawSpec/TestManifest.hs": "1ae721822fc4921f7069a90b3ab8231212f4c9144fc94731b575f8c03beabe6f",
979
+ "src/LawSpec/TestManifest.hs": "810138b12cb687a4bbef0ca9ee51d32ef8df5fe743da424ebac44702835f0dfc",
970
980
  "src/LawSpec/TestNames.hs": "eb0bef102e861058fd759094388924dbfc7a4a28d84cf94bafc22aae4a6397a7",
971
981
  "src/LawSpec/Testing.hs": "88b8b3ca900eb02ef24b3dccd36ca2652ff7ce47f988f97540526a211f87dc41",
972
982
  "src/LawSpec/Time.hs": "4fe90ae3140fb0c9064405572a42ea9ca2e90f22390c9b4c61b198f62a431177",
@@ -992,12 +1002,12 @@
992
1002
  "vendor/unicode/17.0.0/CaseFolding.txt": "ff8d8fefbf123574205085d6714c36149eb946d717a0c585c27f0f4ef58c4183",
993
1003
  "vendor/unicode/LICENSE.txt": "e7a93b009565cfce55919a381437ac4db883e9da2126fa28b91d12732bc53d96",
994
1004
  "wasm/app/Exports.hs": "7698bc8dcdbd3e00cc62d0597626a6dabe29aace9258645d1df266be1f3c408c",
995
- "wasm/cabal.project": "021e560afdc5eb4cb7169e7119ecb8f92c9ee170245af909c94b612941bff5cc",
996
- "wasm/cabal.project.freeze": "733dbed3d2ecccb26e874fd58f136296dad772184deb1658c196b5d54a0814dc",
997
- "wasm/lawspec-wasm.cabal": "8e34b5429ad3531cb954380e40f79a5703cd57bc6f2ba7f857425a6a7b90a81e",
998
- "npm/core.wasm": "d2b1e801de144f41badc4688b51b54112a0b3a050c33c1f959832c6a843d7264",
999
- "npm/core_jsffi.js": "83f3d08134001f01a5431ac43d68fe10bafde834879393fa5fd38ecf39fc1d58",
1005
+ "wasm/cabal.project": "91ad752c055a034fff42bf1815125ce2174630a41859fe8d5c571e9a12e50b7d",
1006
+ "wasm/cabal.project.freeze": "e067df77442b8111c97b3f12cc215af5ca69668aa65f95f3ff90110c22933170",
1007
+ "wasm/lawspec-wasm.cabal": "534a96b479e88087d51acab9fa347153545b99a7d16bd3568bdf23a3790c4ddb",
1008
+ "npm/core.wasm": "e5812e8025b84e30741ec1319a2b444ad16c4115b9e0d669c78903505cffce85",
1009
+ "npm/core_jsffi.js": "d040d2c84a46d5c6212f7ce2537e552d6c484c2501d4d89488f4a2f46c619502",
1000
1010
  "npm/api.mjs": "fd40ec7034402e4456504182d80e2e97f535713ae5d227ffad6456fa9091f59b",
1001
- "npm/index.d.ts": "5b459c42bdaedcaa2acdbe57f7b225f2b0b6889044145a987af357f887e5d558"
1011
+ "npm/index.d.ts": "747204260a9c5f2ce7d9377d57fe42cfbbc8a49e31b848a6d607d06f69fe8ceb"
1002
1012
  }
1003
1013
  }
package/core.wasm CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/core.wasm
3
- size: 69542732 bytes
4
- sha256: d2b1e801de144f41badc4688b51b54112a0b3a050c33c1f959832c6a843d7264
3
+ size: 72461030 bytes
4
+ sha256: e5812e8025b84e30741ec1319a2b444ad16c4115b9e0d669c78903505cffce85
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
- ZC1ZClawspeczmwasmzm0zi26zi0zminplacezmlawspeczmwasmZCMainZC: ($1) => (($1.parts.push($1.decoder.decode()), $1.parts.join(''))),
96
- ZC2ZClawspeczmwasmzm0zi26zi0zminplacezmlawspeczmwasmZCMainZC: ($1,$2,$3) => ($1.parts.push($1.decoder.decode(new Uint8Array(__exports.memory.buffer, $2 >>> 0, $3), {stream: true}))),
97
- ZC3ZClawspeczmwasmzm0zi26zi0zminplacezmlawspeczmwasmZCMainZC: () => (({decoder: new TextDecoder('utf-8', {fatal: true}), parts: []})),
98
- ZC4ZClawspeczmwasmzm0zi26zi0zminplacezmlawspeczmwasmZCMainZC: ($1,$2,$3) => ((new TextEncoder()).encodeInto($1, new Uint8Array(__exports.memory.buffer, $2 >>> 0, $3)).written),
99
- ZC5ZClawspeczmwasmzm0zi26zi0zminplacezmlawspeczmwasmZCMainZC: ($1) => ($1.length),
95
+ ZC1ZClawspeczmwasmzm0zi27zi0zminplacezmlawspeczmwasmZCMainZC: ($1) => (($1.parts.push($1.decoder.decode()), $1.parts.join(''))),
96
+ ZC2ZClawspeczmwasmzm0zi27zi0zminplacezmlawspeczmwasmZCMainZC: ($1,$2,$3) => ($1.parts.push($1.decoder.decode(new Uint8Array(__exports.memory.buffer, $2 >>> 0, $3), {stream: true}))),
97
+ ZC3ZClawspeczmwasmzm0zi27zi0zminplacezmlawspeczmwasmZCMainZC: () => (({decoder: new TextDecoder('utf-8', {fatal: true}), parts: []})),
98
+ ZC4ZClawspeczmwasmzm0zi27zi0zminplacezmlawspeczmwasmZCMainZC: ($1,$2,$3) => ((new TextEncoder()).encodeInto($1, new Uint8Array(__exports.memory.buffer, $2 >>> 0, $3)).written),
99
+ ZC5ZClawspeczmwasmzm0zi27zi0zminplacezmlawspeczmwasmZCMainZC: ($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/doctor.mjs CHANGED
@@ -13,7 +13,7 @@ import { createRequire } from "node:module";
13
13
  import path from "node:path";
14
14
  import os from "node:os";
15
15
  import { fileURLToPath } from "node:url";
16
- import { setup } from "./templates.mjs";
16
+ import { setup, artifactTargets } from "./templates.mjs";
17
17
  import { beamDoctor } from "./beam-doctor.mjs";
18
18
  const exec = promisify(execFile);
19
19
  const profiles = JSON.parse(
@@ -71,6 +71,8 @@ async function installed(req, name) {
71
71
  }
72
72
  export async function doctor(target, root, plannedArtifacts = []) {
73
73
  const name = target.language;
74
+ if (artifactTargets.includes(name))
75
+ return {target: name, ok: true, versions: {}, kind: "artifact", instructions: setup[name]};
74
76
  const defaults =
75
77
  name === "java"
76
78
  ? ["src/main/java", "src/test/java"]
@@ -82,7 +84,7 @@ export async function doctor(target, root, plannedArtifacts = []) {
82
84
  ? ["src/main/groovy", "src/test/groovy"]
83
85
  : name === "clojure"
84
86
  ? ["src", "test"]
85
- : ["src", ["python", "rust", "fsharp", "csharp", "swift"].includes(name) ? "tests" : "test"];
87
+ : ["src", ["python", "prolog", "rust", "fsharp", "csharp", "swift"].includes(name) ? "tests" : "test"];
86
88
  const sourceDir = target.sourceDir ?? defaults[0];
87
89
  const testDir = target.testDir ?? defaults[1];
88
90
  try {
@@ -149,8 +151,8 @@ export async function doctor(target, root, plannedArtifacts = []) {
149
151
  "@types/node 22+ is required",
150
152
  );
151
153
  }
152
- } else if (name === "python") {
153
- const script = `import sys,json,importlib.metadata as m,tomllib,pathlib\np=tomllib.loads(pathlib.Path('pyproject.toml').read_text())\nprint(json.dumps({'python':'.'.join(map(str,sys.version_info[:3])),'pytest':m.version('pytest'),'hypothesis':m.version('hypothesis'),'config':p.get('tool',{}).get('pytest',{}).get('ini_options',{})}))`;
154
+ } else if (name === "python" || name === "prolog") {
155
+ const script = `import sys,json,importlib.metadata as m,tomllib,pathlib\np=tomllib.loads(pathlib.Path('pyproject.toml').read_text())\nprint(json.dumps({'python':'.'.join(map(str,sys.version_info[:3])),'optimization':sys.flags.optimize,'pytest':m.version('pytest'),'hypothesis':m.version('hypothesis'),'config':p.get('tool',{}).get('pytest',{}).get('ini_options',{})}))`;
154
156
  Object.assign(
155
157
  versions,
156
158
  JSON.parse(await run(target.python || "python3", ["-c", script], root)),
@@ -180,6 +182,14 @@ export async function doctor(target, root, plannedArtifacts = []) {
180
182
  "Clear PYTEST_ADDOPTS before compatibility checks",
181
183
  );
182
184
  delete versions.config;
185
+ if (name === "prolog") {
186
+ requireThat(versions.optimization === 0,
187
+ "Prolog host tests require enabled Python assertions; remove -O/PYTHONOPTIMIZE");
188
+ const probe = "import json,importlib.metadata as m,janus_swi as j; v=j.query_once('current_prolog_flag(version_data,swi(Major,Minor,Patch,_)),use_module(library(plunit)),current_prolog_flag(determinism_error,error)'); print(json.dumps({'janus':m.version('janus-swi'),'swi':[v['Major'],v['Minor'],v['Patch']],'ready':v['truth']}))";
189
+ Object.assign(versions, JSON.parse(await run(target.python || "python3", ["-c", probe], root)));
190
+ requireThat(versions.janus === "1.5.3" && versions.swi[0] === 10 && versions.ready === true,
191
+ "Prolog requires janus-swi 1.5.3, SWI-Prolog 10.x, PLUnit and determinism guards");
192
+ }
183
193
  } else if (name === "go") {
184
194
  versions.go = (await run("go", ["version"], root)).match(
185
195
  /go(\d+\.\d+(?:\.\d+)?)/,
@@ -0,0 +1,20 @@
1
+ {
2
+ "version": 2,
3
+ "languageProfile": "1.0-rc.2",
4
+ "sources": ["laws"],
5
+ "machineBits": 64,
6
+ "verification": {"layers": ["proof", "exhaustive", "property", "examples", "runtime", "model"]},
7
+ "targets": [{
8
+ "language": "prolog", "root": ".",
9
+ "nativeBindings": {
10
+ "functions": [
11
+ {"declaration": "example.payments::addFee", "native": ["domain", "payments", "apply_fee"]},
12
+ {"declaration": "example.payments::roundTrip", "native": ["domain", "payments", "restore"]},
13
+ {"declaration": "example.payments::archive", "native": ["domain", "payments", "store"]}
14
+ ],
15
+ "generators": [
16
+ {"type": "example.payments::type::Money", "factory": ["domain", "payment_generators", "prices"]}
17
+ ]
18
+ }
19
+ }]
20
+ }
@@ -0,0 +1,23 @@
1
+ /** <module> Application-owned payments over canonical constructor terms.
2
+
3
+ The fee uses Prolog integer arithmetic, independently of the checked model's
4
+ decimal arithmetic. Aligning decimal exponents preserves every input digit.
5
+ */
6
+ :- module('domain.payments', [apply_fee/2, restore/2, store/2]).
7
+
8
+ apply_fee(value(Tag, [decimal(Sign, Digits, Exponent), Currency]),
9
+ value(Tag, [decimal(ResultSign, ResultDigits, Scale), Currency])) :-
10
+ foldl(decimal_digit, Digits, 0, Magnitude),
11
+ Coefficient is (1 - 2*Sign)*Magnitude,
12
+ Scale is min(Exponent, -1),
13
+ Sum is Coefficient*10**(Exponent-Scale) + 2*10**(-1-Scale),
14
+ ( Sum < 0 -> ResultSign=1 ; ResultSign=0 ),
15
+ Absolute is abs(Sum),
16
+ number_codes(Absolute, Codes),
17
+ maplist(digit_code, ResultDigits, Codes).
18
+
19
+ decimal_digit(Digit, Previous, Result) :- Result is Previous*10 + Digit.
20
+ digit_code(Digit, Code) :- Digit is Code - 0'0.
21
+
22
+ restore(Payment, Payment).
23
+ store(Payments, Payments).
@@ -0,0 +1,17 @@
1
+ /** <module> Native strategy factory with Hypothesis's ordinary shrinker.
2
+
3
+ Janus retains child and result strategies as Python objects. The generated
4
+ schema validates every generated native value and every candidate shrink.
5
+ */
6
+ :- module('domain.payment_generators', [prices/1]).
7
+ :- use_module(library(janus)).
8
+
9
+ prices(Strategy) :-
10
+ py_call('hypothesis.strategies':integers(100, 200), Cents, [py_object(true)]),
11
+ py_call('hypothesis.strategies':just(-2), Exponent, [py_object(true)]),
12
+ py_call(lawspec_runtime:make_decimal, Decimal, [py_object(true)]),
13
+ py_call('hypothesis.strategies':builds(Decimal, Cents, Exponent), Amounts, [py_object(true)]),
14
+ py_call(lawspec_data:'CurrencyEUR'(), Euro, [py_object(true)]),
15
+ py_call('hypothesis.strategies':just(Euro), Currencies, [py_object(true)]),
16
+ py_call(lawspec_data:'Money', Money, [py_object(true)]),
17
+ py_call('hypothesis.strategies':builds(Money, Amounts, Currencies), Strategy, [py_object(true)]).
@@ -4,9 +4,9 @@ unit example.approvals
4
4
  -- own unit, so the adapters can call the workflow on every target (a Haskell
5
5
  -- workflow imports its steps' module).
6
6
 
7
- -- Approves order n under the real clock: whether it took less than 550ms,
8
- -- which the slow order does only when its checks run at the same time (the
9
- -- longer one, not the two together).
7
+ -- Approves order n under the real clock: whether the slow order's two checks
8
+ -- overlapped in time, which they do only when they run at the same time. Run
9
+ -- one after the other they cannot overlap, however loaded the machine is.
10
10
  async approvedQuickly :: Int64 -> Bool
11
11
 
12
12
  law "|an all group's checks run at the same time| is