lawspec 0.30.0 → 0.31.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 +405 -1
- package/README.md +19 -7
- package/api.mjs +1 -0
- package/beam-doctor.mjs +2 -2
- package/bin/lawspec.mjs +104 -96
- package/build.json +498 -406
- package/component-packages.mjs +339 -0
- package/component.d.ts +46 -0
- package/component.mjs +208 -0
- package/core.wasm +2 -2
- package/core_jsffi.js +5 -5
- package/examples/native-payments/clojure/lawspec.edn +48 -0
- package/examples/native-payments/clojure/src/domain/payments.clj +1 -1
- package/examples/native-payments/clojure/test/domain/payment_generators.clj +1 -1
- package/examples/native-payments/csharp/lawspec.edn +48 -0
- package/examples/native-payments/elixir/lawspec.edn +123 -0
- package/examples/native-payments/erlang/lawspec.edn +128 -0
- package/examples/native-payments/fsharp/lawspec.edn +123 -0
- package/examples/native-payments/gleam/lawspec.edn +123 -0
- package/examples/native-payments/go/lawspec.edn +123 -0
- package/examples/native-payments/groovy/lawspec.edn +123 -0
- package/examples/native-payments/haskell/lawspec.edn +123 -0
- package/examples/native-payments/java/lawspec.edn +123 -0
- package/examples/native-payments/javascript/lawspec.edn +123 -0
- package/examples/native-payments/kotlin/lawspec.edn +123 -0
- package/examples/native-payments/prolog/lawspec.edn +48 -0
- package/examples/native-payments/python/lawspec.edn +123 -0
- package/examples/native-payments/rust/lawspec.edn +124 -0
- package/examples/native-payments/scala/lawspec.edn +123 -0
- package/examples/native-payments/swift/lawspec.edn +123 -0
- package/examples/native-payments/typescript/lawspec.edn +123 -0
- package/examples/packages/orders/lawspec.edn +25 -0
- package/examples/packages/shop-domain/lawspec.edn +13 -0
- package/examples/packages/shop-tax-1/lawspec.edn +9 -0
- package/examples/packages/shop-tax-2/lawspec.edn +9 -0
- package/examples/specs/handler_bindings.lawspec +2 -2
- package/files.mjs +2 -1
- package/go.mod +4 -0
- package/index.d.ts +135 -2
- package/input-files.mjs +47 -0
- package/launcher.mjs +33 -13
- package/learn/adapters.mjs +226 -0
- package/learn/app.mjs +1279 -0
- package/learn/assert.mjs +33 -0
- package/learn/assets.mjs +15 -0
- package/learn/browser-runtime.mjs +58 -0
- package/learn/bundle.mjs +118 -0
- package/learn/compile-worker.mjs +106 -0
- package/learn/compiler.mjs +230 -0
- package/learn/coverage.json +8187 -0
- package/learn/curriculum.json +2952 -0
- package/learn/fantomas-worker.mjs +25 -0
- package/learn/format-worker.mjs +148 -0
- package/learn/fsharp.mjs +83 -0
- package/learn/harness-host.mjs +22 -0
- package/learn/index.html +326 -0
- package/learn/lawspec-core.mjs +223 -0
- package/learn/lawspec-language.mjs +69 -0
- package/learn/node-test.mjs +11 -0
- package/learn/presentation.mjs +73 -0
- package/learn/runner.mjs +72 -0
- package/learn/sandbox-frame.html +34 -0
- package/learn/sandbox.mjs +91 -0
- package/learn/store.mjs +141 -0
- package/learn/story.mjs +42 -0
- package/learn/style-options.json +16 -0
- package/learn/style.css +1023 -0
- package/learn/theme.js +77 -0
- package/learn/typescript.mjs +53 -0
- package/learn/vendor/@fontsource-atkinson-hyperlegible-LICENSE.txt +93 -0
- package/learn/vendor/@fontsource-atkinson-hyperlegible-mono-LICENSE.txt +93 -0
- package/learn/vendor/@fontsource-overpass-LICENSE.txt +93 -0
- package/learn/vendor/assemblies.json +1 -0
- package/learn/vendor/editor-worker.js +30 -0
- package/learn/vendor/editor.css +1 -0
- package/learn/vendor/editor.mjs +931 -0
- package/learn/vendor/esbuild-wasm-LICENSE.txt +21 -0
- package/learn/vendor/esbuild.mjs +2683 -0
- package/learn/vendor/esbuild.wasm +0 -0
- package/learn/vendor/fable-library/Array.js +1347 -0
- package/learn/vendor/fable-library/Async.js +134 -0
- package/learn/vendor/fable-library/AsyncBuilder.js +183 -0
- package/learn/vendor/fable-library/BigInt.js +306 -0
- package/learn/vendor/fable-library/BitConverter.js +138 -0
- package/learn/vendor/fable-library/Boolean.js +22 -0
- package/learn/vendor/fable-library/CHANGELOG.md +242 -0
- package/learn/vendor/fable-library/Char.js +202 -0
- package/learn/vendor/fable-library/Choice.js +184 -0
- package/learn/vendor/fable-library/CollectionUtil.js +182 -0
- package/learn/vendor/fable-library/ConditionalWeakTable.js +21 -0
- package/learn/vendor/fable-library/Date.js +841 -0
- package/learn/vendor/fable-library/DateOffset.js +261 -0
- package/learn/vendor/fable-library/DateOnly.js +124 -0
- package/learn/vendor/fable-library/Decimal.js +238 -0
- package/learn/vendor/fable-library/Double.js +47 -0
- package/learn/vendor/fable-library/Encoding.js +185 -0
- package/learn/vendor/fable-library/Event.js +93 -0
- package/learn/vendor/fable-library/FSharp.Collections.js +45 -0
- package/learn/vendor/fable-library/FSharp.Core.CompilerServices.js +27 -0
- package/learn/vendor/fable-library/FSharp.Core.js +156 -0
- package/learn/vendor/fable-library/Global.js +29 -0
- package/learn/vendor/fable-library/Guid.js +161 -0
- package/learn/vendor/fable-library/Int32.js +135 -0
- package/learn/vendor/fable-library/List.js +1323 -0
- package/learn/vendor/fable-library/Long.js +47 -0
- package/learn/vendor/fable-library/MailboxProcessor.js +94 -0
- package/learn/vendor/fable-library/Map.js +1396 -0
- package/learn/vendor/fable-library/MapUtil.js +130 -0
- package/learn/vendor/fable-library/MutableMap.js +339 -0
- package/learn/vendor/fable-library/MutableSet.js +233 -0
- package/learn/vendor/fable-library/Native.js +14 -0
- package/learn/vendor/fable-library/Numeric.js +75 -0
- package/learn/vendor/fable-library/Observable.js +113 -0
- package/learn/vendor/fable-library/Option.js +104 -0
- package/learn/vendor/fable-library/README.md +3 -0
- package/learn/vendor/fable-library/Random.js +172 -0
- package/learn/vendor/fable-library/Range.js +45 -0
- package/learn/vendor/fable-library/Reflection.js +479 -0
- package/learn/vendor/fable-library/RegExp.js +141 -0
- package/learn/vendor/fable-library/Result.js +165 -0
- package/learn/vendor/fable-library/Seq.js +1417 -0
- package/learn/vendor/fable-library/Seq2.js +111 -0
- package/learn/vendor/fable-library/Set.js +1816 -0
- package/learn/vendor/fable-library/String.js +674 -0
- package/learn/vendor/fable-library/System.Collections.Generic.js +333 -0
- package/learn/vendor/fable-library/System.Text.js +200 -0
- package/learn/vendor/fable-library/System.js +289 -0
- package/learn/vendor/fable-library/TimeOnly.js +122 -0
- package/learn/vendor/fable-library/TimeSpan.js +180 -0
- package/learn/vendor/fable-library/Timer.js +67 -0
- package/learn/vendor/fable-library/Types.js +198 -0
- package/learn/vendor/fable-library/Unicode.13.0.0.js +4 -0
- package/learn/vendor/fable-library/Uri.js +165 -0
- package/learn/vendor/fable-library/Util.js +796 -0
- package/learn/vendor/fable-library/big.d.ts +338 -0
- package/learn/vendor/fable-library/lib/big.js +825 -0
- package/learn/vendor/fable-library/package.json +24 -0
- package/learn/vendor/fable-library/quotation.js +618 -0
- package/learn/vendor/fable.js +430 -0
- package/learn/vendor/fantomas/FSharp.Core.uawo19tl4c.wasm +0 -0
- package/learn/vendor/fantomas/Fantomas.Core.stnanlnpyw.wasm +0 -0
- package/learn/vendor/fantomas/Fantomas.FCS.lqohfu5o9y.wasm +0 -0
- package/learn/vendor/fantomas/LawSpec.Learn.Formatter.5arcua4vy0.wasm +0 -0
- package/learn/vendor/fantomas/LawSpec.Learn.Formatter.u1ne3a6xd2.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.CSharp.mp8lhr6rez.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.VisualBasic.0e5fchkecn.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.VisualBasic.Core.17wn27qal2.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.Win32.Primitives.9d566sle9e.wasm +0 -0
- package/learn/vendor/fantomas/Microsoft.Win32.Registry.52dy96yk8i.wasm +0 -0
- package/learn/vendor/fantomas/System.AppContext.jwujeh069z.wasm +0 -0
- package/learn/vendor/fantomas/System.Buffers.y0isk1x97h.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Concurrent.x5koi7bzem.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Immutable.diwg7advch.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.NonGeneric.4089xs440e.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.Specialized.hj81u7zblb.wasm +0 -0
- package/learn/vendor/fantomas/System.Collections.nvrdeoknr1.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.Annotations.yatcnfjeuk.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.DataAnnotations.led9l5awu3.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.EventBasedAsync.hpvp6cf4de.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.Primitives.v7cajwpaqo.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.TypeConverter.xk1hnyt762.wasm +0 -0
- package/learn/vendor/fantomas/System.ComponentModel.rrnda1lucx.wasm +0 -0
- package/learn/vendor/fantomas/System.Configuration.bn9vghjcq8.wasm +0 -0
- package/learn/vendor/fantomas/System.Console.09ajpiafhz.wasm +0 -0
- package/learn/vendor/fantomas/System.Core.wc649o5mw9.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.Common.s4cowzd9a9.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.DataSetExtensions.5fm360ikxl.wasm +0 -0
- package/learn/vendor/fantomas/System.Data.fsu4j4t4jw.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Contracts.p74re5oxzn.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Debug.622sixg49n.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.DiagnosticSource.2j35bc2g2b.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.FileVersionInfo.7n0wdvltaa.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Process.8iffh49mew.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.StackTrace.1yz88vico8.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.TextWriterTraceListener.ua8iuh2vhj.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Tools.roy5445ugj.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.TraceSource.6qx1ldzz7g.wasm +0 -0
- package/learn/vendor/fantomas/System.Diagnostics.Tracing.b4799zpaas.wasm +0 -0
- package/learn/vendor/fantomas/System.Drawing.8gcjjqj0pu.wasm +0 -0
- package/learn/vendor/fantomas/System.Drawing.Primitives.y2uveru2yk.wasm +0 -0
- package/learn/vendor/fantomas/System.Dynamic.Runtime.023zrvzh9x.wasm +0 -0
- package/learn/vendor/fantomas/System.Formats.Asn1.znpklkbgqv.wasm +0 -0
- package/learn/vendor/fantomas/System.Formats.Tar.5yybjepfi2.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.Calendars.10g6hyjy3k.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.Extensions.hrinfrismg.wasm +0 -0
- package/learn/vendor/fantomas/System.Globalization.uvs4rah8fk.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.4j645gw40d.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.2z7vdt6tfb.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.Brotli.fv80xs79j3.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.FileSystem.88jdddz3sw.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Compression.ZipFile.jkn9avr4vo.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.AccessControl.yme0uhbu37.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.DriveInfo.qas7wf73rs.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.Primitives.d1jmhkzu0e.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.Watcher.z570derp0d.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.FileSystem.o6jtz51fup.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.IsolatedStorage.hqyeyb5ipe.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.MemoryMappedFiles.zhamjnusxd.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipelines.wrmw5vws31.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipes.AccessControl.qcancj8gj2.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.Pipes.zhcyguvwkr.wasm +0 -0
- package/learn/vendor/fantomas/System.IO.UnmanagedMemoryStream.o8cpjnlard.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.AsyncEnumerable.hyc0b7okjw.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Expressions.ldibvm0efj.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Parallel.2buevezvch.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.Queryable.cvq43g1awj.wasm +0 -0
- package/learn/vendor/fantomas/System.Linq.lz6mvi0hm2.wasm +0 -0
- package/learn/vendor/fantomas/System.Memory.3jekerw0ga.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Http.Json.8k237kkwec.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Http.cityx2bvcl.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.HttpListener.s1jreclykx.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Mail.cmlj4c0gto.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.NameResolution.q3gf18q13l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.NetworkInformation.xaz5tjw7d0.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Ping.a40atim1h0.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Primitives.i88i20r8sr.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Quic.hx06eo5xkj.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Requests.hkjxlfe5f5.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Security.ch34yya69o.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.ServerSentEvents.0u7o0jk3p1.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.ServicePoint.xbhxnytx4l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.Sockets.hzgzlvkc9l.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebClient.84i8nwzbgu.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebHeaderCollection.326nl7s9g3.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebProxy.oq3mgkkqef.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebSockets.2cx1v74vg8.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.WebSockets.Client.rafzkktw8j.wasm +0 -0
- package/learn/vendor/fantomas/System.Net.w1hpj3bo6r.wasm +0 -0
- package/learn/vendor/fantomas/System.Numerics.Vectors.oyv7biw9ux.wasm +0 -0
- package/learn/vendor/fantomas/System.Numerics.lyu36wqn19.wasm +0 -0
- package/learn/vendor/fantomas/System.ObjectModel.kxu80demuu.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.CoreLib.1vy46s12u6.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.DataContractSerialization.ao8k9iu77a.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Uri.itn0n2zjd0.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Xml.19nzpxrx8w.wasm +0 -0
- package/learn/vendor/fantomas/System.Private.Xml.Linq.tw5eq1hjvo.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.DispatchProxy.7lajnj8s8c.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.7liz9zln06.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.ILGeneration.1ut3qgacw8.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Emit.Lightweight.d0gvllb1jj.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Extensions.zr5bhwfczd.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Metadata.ff6np6mz2j.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.Primitives.igpmvwv78c.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.TypeExtensions.qouojzlnp9.wasm +0 -0
- package/learn/vendor/fantomas/System.Reflection.mk3jyxvh13.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.Reader.41ppfyz2vc.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.ResourceManager.sfwvfmw1ea.wasm +0 -0
- package/learn/vendor/fantomas/System.Resources.Writer.3uvs9tp38z.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.CompilerServices.Unsafe.puz1xm53oc.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.CompilerServices.VisualC.9qdau315py.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Extensions.i7gntui96b.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Handles.00oxj4o6ov.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.JavaScript.9kq1vofond.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.RuntimeInformation.my7qeqbhfh.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.InteropServices.vqp80tnwc7.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Intrinsics.u0samjybfo.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Loader.n6zxw1b98a.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Numerics.o40sjhz59x.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Formatters.1esvva4te3.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Json.4n7u09advh.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Primitives.xs2bo91wvk.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.Xml.ny21jmziti.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.Serialization.qcxaur5wqs.wasm +0 -0
- package/learn/vendor/fantomas/System.Runtime.odq454d6j9.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.AccessControl.8yfnzmqzaq.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Claims.8ogy0860de.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Algorithms.8zijp1svfw.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Cng.yxagtt77no.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Csp.uhfbvvau84.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Encoding.2ywrusvy8q.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.OpenSsl.oa268u7i92.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.Primitives.5uhvqe8puk.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.X509Certificates.6i7pxilopt.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Cryptography.d0quqk1iyr.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Principal.Windows.gpqua4rz29.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.Principal.i20kfklf3g.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.SecureString.x2y8tzci3c.wasm +0 -0
- package/learn/vendor/fantomas/System.Security.e83vvh6sl2.wasm +0 -0
- package/learn/vendor/fantomas/System.ServiceModel.Web.poglliv2no.wasm +0 -0
- package/learn/vendor/fantomas/System.ServiceProcess.yro5uj2opo.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.CodePages.2wchx40i7z.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.Extensions.8utaw61kn5.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encoding.cxdyfepnpj.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Encodings.Web.37ehbi7cye.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.Json.ixiaa8hd3h.wasm +0 -0
- package/learn/vendor/fantomas/System.Text.RegularExpressions.2fhfmkk6vf.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.6pry74a050.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.AccessControl.76zfdfy8go.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Channels.gpxnr01lmp.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Overlapped.aqpl8tzdyc.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Dataflow.ytwttt7fzh.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Extensions.0deavcb00v.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.Parallel.tjwtxugso0.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Tasks.fu4qd5h3qy.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Thread.klaua2by9m.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.ThreadPool.mkzm212njz.wasm +0 -0
- package/learn/vendor/fantomas/System.Threading.Timer.yp49llu5h2.wasm +0 -0
- package/learn/vendor/fantomas/System.Transactions.Local.vz6cgeh4w7.wasm +0 -0
- package/learn/vendor/fantomas/System.Transactions.ipwm3rsy66.wasm +0 -0
- package/learn/vendor/fantomas/System.ValueTuple.7ol6ljuhx8.wasm +0 -0
- package/learn/vendor/fantomas/System.Web.HttpUtility.itlvncjd96.wasm +0 -0
- package/learn/vendor/fantomas/System.Web.np8uzzakvl.wasm +0 -0
- package/learn/vendor/fantomas/System.Windows.18nzio44t3.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.45jprtg1pa.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.Linq.v9v8udncm1.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.ReaderWriter.a9mr08uzci.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.Serialization.03juoguwgc.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XDocument.c9dhjnzqjb.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XPath.XDocument.138b12i1pm.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XPath.pvxm9341ce.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XmlDocument.450wsyxvl0.wasm +0 -0
- package/learn/vendor/fantomas/System.Xml.XmlSerializer.y3t2n0tce7.wasm +0 -0
- package/learn/vendor/fantomas/System.gjriafnqmz.wasm +0 -0
- package/learn/vendor/fantomas/WindowsBase.8zsce9qxfb.wasm +0 -0
- package/learn/vendor/fantomas/cs/FSharp.Core.resources.9ehmavdel7.wasm +0 -0
- package/learn/vendor/fantomas/de/FSharp.Core.resources.2ofmxloa01.wasm +0 -0
- package/learn/vendor/fantomas/dotnet.js +1233 -0
- package/learn/vendor/fantomas/dotnet.native.b6l13xorvf.js +16 -0
- package/learn/vendor/fantomas/dotnet.native.rw4kynp763.wasm +0 -0
- package/learn/vendor/fantomas/dotnet.runtime.v06hirbjsv.js +4 -0
- package/learn/vendor/fantomas/es/FSharp.Core.resources.hkr5ggb4tr.wasm +0 -0
- package/learn/vendor/fantomas/fr/FSharp.Core.resources.43soen28ow.wasm +0 -0
- package/learn/vendor/fantomas/icudt_CJK.tjcz0u77k5.dat +0 -0
- package/learn/vendor/fantomas/icudt_EFIGS.tptq2av103.dat +0 -0
- package/learn/vendor/fantomas/icudt_no_CJK.lfu7j35m59.dat +0 -0
- package/learn/vendor/fantomas/it/FSharp.Core.resources.m60n5ls7oq.wasm +0 -0
- package/learn/vendor/fantomas/ja/FSharp.Core.resources.o6oof69v14.wasm +0 -0
- package/learn/vendor/fantomas/ko/FSharp.Core.resources.q6l4snlu9o.wasm +0 -0
- package/learn/vendor/fantomas/mscorlib.8ptuc08eli.wasm +0 -0
- package/learn/vendor/fantomas/netstandard.eymp85mooh.wasm +0 -0
- package/learn/vendor/fantomas/pl/FSharp.Core.resources.8bni0w6j8b.wasm +0 -0
- package/learn/vendor/fantomas/pt-BR/FSharp.Core.resources.k849vqm41u.wasm +0 -0
- package/learn/vendor/fantomas/ru/FSharp.Core.resources.jz9rhhtsla.wasm +0 -0
- package/learn/vendor/fantomas/tr/FSharp.Core.resources.wn6vbvjm1u.wasm +0 -0
- package/learn/vendor/fantomas/zh-Hans/FSharp.Core.resources.z7zzbso094.wasm +0 -0
- package/learn/vendor/fantomas/zh-Hant/FSharp.Core.resources.iammfsi7ls.wasm +0 -0
- package/learn/vendor/fast-check-LICENSE.txt +21 -0
- package/learn/vendor/fast-check.mjs +37 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2 +0 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2 +0 -0
- package/learn/vendor/fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2 +0 -0
- package/learn/vendor/fonts/overpass-latin-600-normal.woff2 +0 -0
- package/learn/vendor/fonts/overpass-latin-700-normal.woff2 +0 -0
- package/learn/vendor/formatter-licenses/DotNet-LICENSE.txt +23 -0
- package/learn/vendor/formatter-licenses/DotNet-THIRD-PARTY-NOTICES.txt +1418 -0
- package/learn/vendor/formatter-licenses/FSharp-LICENSE.txt +23 -0
- package/learn/vendor/formatter-licenses/Fantomas-LICENSE.txt +202 -0
- package/learn/vendor/formatter-licenses/README.md +12 -0
- package/learn/vendor/manifest.json +1358 -0
- package/learn/vendor/metadata/Browser.Blob.dll +0 -0
- package/learn/vendor/metadata/Browser.Dom.dll +0 -0
- package/learn/vendor/metadata/Browser.Event.dll +0 -0
- package/learn/vendor/metadata/Browser.Gamepad.dll +0 -0
- package/learn/vendor/metadata/Browser.WebGL.dll +0 -0
- package/learn/vendor/metadata/Browser.WebStorage.dll +0 -0
- package/learn/vendor/metadata/FSharp.Core.dll +0 -0
- package/learn/vendor/metadata/Fable.Core.dll +0 -0
- package/learn/vendor/metadata/Fable.Repl.Lib.dll +0 -0
- package/learn/vendor/metadata/System.Collections.Concurrent.dll +0 -0
- package/learn/vendor/metadata/System.Collections.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.Primitives.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.TypeConverter.dll +0 -0
- package/learn/vendor/metadata/System.ComponentModel.dll +0 -0
- package/learn/vendor/metadata/System.Console.dll +0 -0
- package/learn/vendor/metadata/System.Core.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Debug.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Tools.dll +0 -0
- package/learn/vendor/metadata/System.Diagnostics.Tracing.dll +0 -0
- package/learn/vendor/metadata/System.Globalization.dll +0 -0
- package/learn/vendor/metadata/System.IO.dll +0 -0
- package/learn/vendor/metadata/System.Net.Requests.dll +0 -0
- package/learn/vendor/metadata/System.Net.WebClient.dll +0 -0
- package/learn/vendor/metadata/System.Numerics.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Metadata.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.Primitives.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.TypeExtensions.dll +0 -0
- package/learn/vendor/metadata/System.Reflection.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.InteropServices.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.Numerics.dll +0 -0
- package/learn/vendor/metadata/System.Runtime.dll +0 -0
- package/learn/vendor/metadata/System.Text.Encoding.Extensions.dll +0 -0
- package/learn/vendor/metadata/System.Text.Encoding.dll +0 -0
- package/learn/vendor/metadata/System.Text.RegularExpressions.dll +0 -0
- package/learn/vendor/metadata/System.Threading.Tasks.dll +0 -0
- package/learn/vendor/metadata/System.Threading.Thread.dll +0 -0
- package/learn/vendor/metadata/System.Threading.dll +0 -0
- package/learn/vendor/metadata/System.ValueTuple.dll +0 -0
- package/learn/vendor/metadata/System.dll +0 -0
- package/learn/vendor/metadata/mscorlib.dll +0 -0
- package/learn/vendor/metadata/netstandard.dll +0 -0
- package/learn/vendor/monaco-editor-LICENSE.txt +21 -0
- package/learn/vendor/prettier/babel.mjs +16 -0
- package/learn/vendor/prettier/brace-style.mjs +376 -0
- package/learn/vendor/prettier/estree.mjs +44 -0
- package/learn/vendor/prettier/standalone.mjs +29 -0
- package/learn/vendor/prettier/typescript.mjs +22 -0
- package/learn/vendor/prettier-LICENSE.txt +7 -0
- package/learn/vendor/prettier-plugin-brace-style-LICENSE.txt +21 -0
- package/learn/vendor/typescript-LICENSE.txt +55 -0
- package/learn/vendor/typescript-libs.json +1 -0
- package/learn/vendor/typescript.mjs +451 -0
- package/learn/vendor/zod-LICENSE.txt +21 -0
- package/learn/web-format.mjs +8 -0
- package/learn.mjs +126 -0
- package/lsp.mjs +10 -5
- package/native-evidence.mjs +50 -15
- package/native-examples.mjs +8 -7
- package/native-host.mjs +71 -0
- package/package.json +10 -4
- package/proof.d.ts +8 -2
- package/proof.mjs +183 -31
- package/scala-build-state.mjs +59 -0
- package/templates.mjs +242 -2
- package/test-command.mjs +192 -60
- package/builtin-data-names.mjs +0 -73
- package/examples/native-payments/clojure/lawspec.json +0 -62
- package/examples/native-payments/csharp/lawspec.json +0 -62
- package/examples/native-payments/elixir/lawspec.json +0 -160
- package/examples/native-payments/erlang/lawspec.json +0 -159
- package/examples/native-payments/fsharp/lawspec.json +0 -178
- package/examples/native-payments/gleam/lawspec.json +0 -160
- package/examples/native-payments/go/lawspec.json +0 -147
- package/examples/native-payments/groovy/lawspec.json +0 -176
- package/examples/native-payments/haskell/lawspec.json +0 -160
- package/examples/native-payments/java/lawspec.json +0 -176
- package/examples/native-payments/javascript/lawspec.json +0 -160
- package/examples/native-payments/kotlin/lawspec.json +0 -176
- package/examples/native-payments/prolog/lawspec.json +0 -20
- package/examples/native-payments/python/lawspec.json +0 -160
- package/examples/native-payments/rust/lawspec.json +0 -178
- package/examples/native-payments/scala/lawspec.json +0 -176
- package/examples/native-payments/swift/lawspec.json +0 -165
- package/examples/native-payments/typescript/lawspec.json +0 -160
- package/examples/packages/orders/lawspec.json +0 -27
- package/examples/packages/shop-domain/lawspec-package.json +0 -7
- package/examples/packages/shop-tax-1/lawspec-package.json +0 -5
- package/examples/packages/shop-tax-2/lawspec-package.json +0 -5
- package/explain.mjs +0 -114
- package/expression-presentation.mjs +0 -333
- package/positional-fields.mjs +0 -13
- package/typed-presentation.mjs +0 -165
package/proof.mjs
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
// Host execution of compiler-produced tasks. The browser/WASM compiler stays
|
|
3
3
|
// pure; this Node host invokes Z3's SMT-LIB interface without a shell.
|
|
4
4
|
import {spawn} from 'node:child_process';
|
|
5
|
-
import {createHash} from 'node:crypto';
|
|
6
|
-
import {access,readFile,realpath} from 'node:fs/promises';
|
|
5
|
+
import {createHash,randomUUID} from 'node:crypto';
|
|
6
|
+
import {access,mkdir,readFile,realpath,rename,rm,writeFile} from 'node:fs/promises';
|
|
7
7
|
import {constants} from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
|
|
10
10
|
const hash=value=>createHash('sha256').update(value).digest('hex');
|
|
11
11
|
const frame=value=>Buffer.byteLength(value,'utf8')+':'+value;
|
|
12
12
|
const fingerprint=values=>hash(values.map(frame).join(''));
|
|
13
|
-
//
|
|
13
|
+
// A task names its encoding; tasks that need later features are v2.
|
|
14
14
|
const encodings=['lawspec-smtlib-v1','lawspec-smtlib-v2'];
|
|
15
15
|
|
|
16
16
|
export function proofTaskFingerprint(task) {
|
|
17
|
-
return fingerprint([task.encoding,task.
|
|
17
|
+
return fingerprint([task.encoding,task.lawFingerprint,String(task.machineBits),
|
|
18
18
|
task.owner,task.declaration,task.script]);
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -103,11 +103,107 @@ async function prover(config) {
|
|
|
103
103
|
|
|
104
104
|
function validTask(task) {
|
|
105
105
|
return encodings.includes(task.encoding)&&[32,64].includes(task.machineBits)&&
|
|
106
|
-
['owner','declaration','
|
|
107
|
-
/^[0-9a-f]{64}$/.test(task.
|
|
106
|
+
['owner','declaration','lawFingerprint','script','taskFingerprint'].every(key=>typeof task[key]==='string')&&
|
|
107
|
+
/^[0-9a-f]{64}$/.test(task.lawFingerprint)&&
|
|
108
108
|
proofTaskFingerprint(task)===task.taskFingerprint;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
// A semantic receipt may be reused after the compiler has admitted and
|
|
112
|
+
// planned the current source again. Its exact original task/run binding is
|
|
113
|
+
// retained; reuse is never presented as another solver execution. The local
|
|
114
|
+
// cache has the same trust boundary as the compiler's other persisted memos.
|
|
115
|
+
// Only completed unsat laws are reused. Counterexamples must be replayed by
|
|
116
|
+
// the current evaluator, and unknown/unsupported/incomplete work is retried.
|
|
117
|
+
async function receiptCache(request,selected) {
|
|
118
|
+
if(typeof request.cacheDirectory!=='string'||!request.cacheDirectory||selected.error)return null;
|
|
119
|
+
try {
|
|
120
|
+
const build=await readFile(new URL('./build.json',import.meta.url));
|
|
121
|
+
const host=await readFile(new URL('./proof.mjs',import.meta.url));
|
|
122
|
+
return {folder:path.join(request.cacheDirectory,'solver-goals-v1'),
|
|
123
|
+
identity:fingerprint(['lawspec.solver-cache.v1',hash(build),hash(host),selected.fingerprint])};
|
|
124
|
+
} catch {return null;}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async function cachedSolve(task,selected,config,cache) {
|
|
128
|
+
if(!cache||task.status!=='ready'||!validTask(task))return solve(task,selected,config);
|
|
129
|
+
const key=fingerprint([cache.identity,task.encoding,task.lawFingerprint,String(task.machineBits)]);
|
|
130
|
+
const filename=path.join(cache.folder,key+'.json');
|
|
131
|
+
try {
|
|
132
|
+
const saved=JSON.parse(await readFile(filename,'utf8'));
|
|
133
|
+
const receipt=saved.receipt;
|
|
134
|
+
const complete=saved.version===1&&saved.key===key&&validTask(saved.task)&&
|
|
135
|
+
saved.task.lawFingerprint===task.lawFingerprint&&saved.task.encoding===task.encoding&&
|
|
136
|
+
saved.task.machineBits===task.machineBits&&receipt?.status==='proved'&&receipt.outcome==='unsat'&&
|
|
137
|
+
receipt.exitCode===0&&receipt.lawFingerprint===task.lawFingerprint&&
|
|
138
|
+
/^[0-9a-f]{64}$/.test(receipt.runFingerprint??'')&&
|
|
139
|
+
receipt.prover?.fingerprint===selected.fingerprint&&
|
|
140
|
+
saved.digest===hash(JSON.stringify([saved.task,receipt]));
|
|
141
|
+
if(complete&&hash(await readFile(selected.binary))===selected.binaryFingerprint)
|
|
142
|
+
return {...receipt,owner:task.owner,declaration:task.declaration,at:task.at,
|
|
143
|
+
currentTaskFingerprint:task.taskFingerprint,
|
|
144
|
+
...(receipt.induction&&task.induction?{currentInduction:{on:task.induction.on,using:task.induction.using}}:{}),
|
|
145
|
+
reused:{key,owner:saved.task.owner,declaration:saved.task.declaration,
|
|
146
|
+
taskFingerprint:receipt.taskFingerprint,runFingerprint:receipt.runFingerprint},
|
|
147
|
+
reason:receipt.reason+'; reused a completed semantic proof receipt; no new solver task ran'};
|
|
148
|
+
} catch {}
|
|
149
|
+
const receipt=await solve(task,selected,config);
|
|
150
|
+
if(receipt.status==='proved'&&receipt.outcome==='unsat'&&receipt.exitCode===0) {
|
|
151
|
+
const temporary=filename+'.'+randomUUID()+'.tmp';
|
|
152
|
+
try {
|
|
153
|
+
await mkdir(cache.folder,{recursive:true});
|
|
154
|
+
await writeFile(temporary,JSON.stringify({version:1,key,task,receipt,
|
|
155
|
+
digest:hash(JSON.stringify([task,receipt]))})+'\n',{mode:0o600});
|
|
156
|
+
await rename(temporary,filename);
|
|
157
|
+
} catch {} finally {await rm(temporary,{force:true}).catch(()=>{});}
|
|
158
|
+
}
|
|
159
|
+
return receipt;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Law-set queries have a stable logical-goal identity beside their exact
|
|
163
|
+
// script fingerprint. Reused SAT values are passed unchanged, with the
|
|
164
|
+
// original ordered constant names, to the compiler for positional decoding
|
|
165
|
+
// and full validation against the current binders/claim. The host never
|
|
166
|
+
// rewrites solver/model text. Only compiler-confirmed outcomes are saved.
|
|
167
|
+
function queryFingerprint(row,task) {
|
|
168
|
+
return row.kind==='model'?hash(row.declaration+'\0'+task.kind+'\0'+task.script):fingerprint([row.declaration,row.stage,task.script]);
|
|
169
|
+
}
|
|
170
|
+
async function analysisQuery(cache,row,task,selected,executeQuery,fresh=false) {
|
|
171
|
+
const eligible=cache&&/^[0-9a-f]{64}$/.test(task.semanticFingerprint??'')&&
|
|
172
|
+
task.fingerprint===queryFingerprint(row,task);
|
|
173
|
+
const key=eligible?fingerprint([cache.identity,row.kind==='model'?'model':'analysis',row.kind==='model'?'':row.stage,task.semanticFingerprint]):null;
|
|
174
|
+
const filename=eligible?path.join(cache.folder,key+'.json'):null;
|
|
175
|
+
if(eligible&&!fresh)try {
|
|
176
|
+
const saved=JSON.parse(await readFile(filename,'utf8'));
|
|
177
|
+
const record=saved.record;
|
|
178
|
+
if(saved.version===1&&saved.key===key&&saved.digest===hash(JSON.stringify(record))&&
|
|
179
|
+
record?.semanticFingerprint===task.semanticFingerprint&&record.solverFingerprint===selected.fingerprint&&
|
|
180
|
+
['sat','unsat'].includes(record.outcome)&&record.completed===true&&record.run?.exitCode===0&&
|
|
181
|
+
record.taskFingerprint===queryFingerprint(record,{kind:record.taskKind,script:record.script})&&
|
|
182
|
+
hash(await readFile(selected.binary))===selected.binaryFingerprint)
|
|
183
|
+
return {...record,row,cacheFile:filename,
|
|
184
|
+
reused:{key,owner:record.owner,declaration:record.declaration,
|
|
185
|
+
taskFingerprint:record.taskFingerprint,runFingerprint:record.runFingerprint},
|
|
186
|
+
rerun:()=>analysisQuery(cache,row,task,selected,executeQuery,true)};
|
|
187
|
+
} catch {}
|
|
188
|
+
const done=await executeQuery();
|
|
189
|
+
return {...done,row,inputs:task.inputs,
|
|
190
|
+
...(eligible?{pendingCache:{filename,key,record:{kind:row.kind,taskKind:task.kind,owner:row.owner,declaration:row.declaration,stage:row.stage,
|
|
191
|
+
taskFingerprint:task.fingerprint,semanticFingerprint:task.semanticFingerprint,script:task.script,
|
|
192
|
+
solverFingerprint:selected.fingerprint,inputs:task.inputs,outcome:done.outcome,values:done.values,invariant:done.invariant,
|
|
193
|
+
run:done.run,runFingerprint:done.runFingerprint,completed:true}}}:{})};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async function saveQuery(done) {
|
|
197
|
+
if(!done.pendingCache||!['sat','unsat'].includes(done.outcome)||done.run?.exitCode!==0)return;
|
|
198
|
+
const {filename,key,record}=done.pendingCache;
|
|
199
|
+
const temporary=filename+'.'+randomUUID()+'.tmp';
|
|
200
|
+
try {
|
|
201
|
+
await mkdir(path.dirname(filename),{recursive:true});
|
|
202
|
+
await writeFile(temporary,JSON.stringify({version:1,key,record,digest:hash(JSON.stringify(record))})+'\n',{mode:0o600});
|
|
203
|
+
await rename(temporary,filename);
|
|
204
|
+
} catch {} finally {await rm(temporary,{force:true}).catch(()=>{});}
|
|
205
|
+
}
|
|
206
|
+
|
|
111
207
|
// Law-set and model tasks need the same process and executable checks as
|
|
112
208
|
// ordinary laws; a protocol token alone is not a completed solver run.
|
|
113
209
|
async function verifiedOutcome(run,selected) {
|
|
@@ -184,7 +280,7 @@ async function solve(task,selected,config) {
|
|
|
184
280
|
|
|
185
281
|
async function attempt(task,script,taskFingerprint,selected,config,names=null) {
|
|
186
282
|
const common={owner:task.owner,declaration:task.declaration,at:task.at,
|
|
187
|
-
|
|
283
|
+
lawFingerprint:task.lawFingerprint,taskFingerprint:task.taskFingerprint,
|
|
188
284
|
encoding:task.encoding,machineBits:task.machineBits,configuration:config};
|
|
189
285
|
if(task.status==='unsupported')return {...common,status:'unsupported',outcome:'unsupported',reason:task.reason};
|
|
190
286
|
if(task.status!=='ready'||!validTask(task))
|
|
@@ -232,7 +328,7 @@ async function attempt(task,script,taskFingerprint,selected,config,names=null) {
|
|
|
232
328
|
async function counterexampleValues(task,selected,config) {
|
|
233
329
|
const query=task.counterexample;
|
|
234
330
|
if(!query||typeof query.script!=='string'||!Array.isArray(query.inputs))return null;
|
|
235
|
-
if(fingerprint(['lawspec-smtlib-v2',task.
|
|
331
|
+
if(fingerprint(['lawspec-smtlib-v2',task.lawFingerprint,String(task.machineBits),task.owner,task.declaration,
|
|
236
332
|
query.script])!==query.fingerprint)return null;
|
|
237
333
|
const names=query.inputs.map(input=>input.name);
|
|
238
334
|
// A law with no inputs needs no search: the evaluator decides it.
|
|
@@ -267,7 +363,8 @@ export async function proveWithZ3(compiler,request,options={}) {
|
|
|
267
363
|
catch(error){selected={error:error.message,outcome:error.code==='ENOENT'?'unavailable':error.outcome??'failed'};}
|
|
268
364
|
}
|
|
269
365
|
const solverEvidence=[];
|
|
270
|
-
|
|
366
|
+
const cache=await receiptCache(request,selected);
|
|
367
|
+
for(const task of tasks)solverEvidence.push(await cachedSolve(task,selected,config,cache));
|
|
271
368
|
const diagnostics=[...(result.diagnostics??[])];
|
|
272
369
|
// Values to check as each unproved law's counterexample: the
|
|
273
370
|
// counterexample query's (run whenever a law's task was satisfiable, and
|
|
@@ -324,7 +421,7 @@ export async function proveWithZ3(compiler,request,options={}) {
|
|
|
324
421
|
while(changed) {
|
|
325
422
|
changed=false;
|
|
326
423
|
solverEvidence.forEach((item,index)=>{
|
|
327
|
-
const cited=item.induction?.using??[];
|
|
424
|
+
const cited=(item.currentInduction??item.induction)?.using??[];
|
|
328
425
|
if(item.status!=='proved'||!cited.length)return;
|
|
329
426
|
const open=cited.filter(law=>!['proved','exhaustively-checked'].includes(current.get(law)));
|
|
330
427
|
if(!open.length)return;
|
|
@@ -351,7 +448,8 @@ export async function proveWithZ3(compiler,request,options={}) {
|
|
|
351
448
|
// model with its reference evaluator before a check is refuted.
|
|
352
449
|
let settled=evidence,found=diagnostics;
|
|
353
450
|
if(analysis.length) {
|
|
354
|
-
|
|
451
|
+
let answers=[];
|
|
452
|
+
const ran=new Map();
|
|
355
453
|
for(const row of analysis) {
|
|
356
454
|
if(row.status!=='ready') {
|
|
357
455
|
solverEvidence.push({owner:row.owner,declaration:row.declaration,stage:row.stage,kind:'analysis',
|
|
@@ -360,25 +458,47 @@ export async function proveWithZ3(compiler,request,options={}) {
|
|
|
360
458
|
}
|
|
361
459
|
for(const task of row.tasks) {
|
|
362
460
|
if(selected.error) {ran.set(task.fingerprint,{row,outcome:selected.outcome,error:selected.error});continue;}
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
461
|
+
const executeQuery=async()=>{
|
|
462
|
+
const input=`(set-option :print-success false)\n(set-option :produce-models true)\n`+
|
|
463
|
+
`(set-option :random-seed ${config.seed})\n(set-option :rlimit ${config.resourceLimit})\n`+task.script+'(check-sat)\n';
|
|
464
|
+
const run=await execute(selected.binary,selected.args,input,config,true,
|
|
465
|
+
token=>token==='sat'&&task.inputs.length?`(get-value (${task.inputs.join(' ')}))\n(exit)\n`:'(exit)\n');
|
|
466
|
+
const outcome=await verifiedOutcome(run,selected);
|
|
467
|
+
const values=outcome==='sat'&&task.inputs.length?run.stdout.slice(run.stdout.indexOf('\n')+1).trim():'';
|
|
468
|
+
return {outcome,run,values,runFingerprint:fingerprint([task.fingerprint,selected.fingerprint,run.input])};
|
|
469
|
+
};
|
|
470
|
+
const done=await analysisQuery(cache,row,task,selected,executeQuery);
|
|
471
|
+
ran.set(task.fingerprint,done);
|
|
472
|
+
answers.push({fingerprint:task.fingerprint,outcome:done.outcome,values:done.values,inputs:done.inputs});
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
let checked=answers.length?await compiler.proofTasks({...request,analysisResults:answers}):{};
|
|
476
|
+
// A stored SAT model can stop decoding after a public constructor rename.
|
|
477
|
+
// Revalidation fails closed; retry that query once with the current names.
|
|
478
|
+
let retried=false;
|
|
479
|
+
for(const verdict of checked.analysisChecks??[]) {
|
|
480
|
+
const done=ran.get(verdict.fingerprint);
|
|
481
|
+
if(verdict.status==='incomplete'&&done?.reused&&done.rerun) {
|
|
482
|
+
await rm(done.cacheFile,{force:true}).catch(()=>{});
|
|
483
|
+
ran.set(verdict.fingerprint,await done.rerun());retried=true;
|
|
371
484
|
}
|
|
372
485
|
}
|
|
373
|
-
|
|
486
|
+
if(retried) {
|
|
487
|
+
answers=answers.map(answer=>{const done=ran.get(answer.fingerprint);return {...answer,
|
|
488
|
+
outcome:done.outcome,values:done.values,inputs:done.inputs};});
|
|
489
|
+
checked=await compiler.proofTasks({...request,analysisResults:answers});
|
|
490
|
+
}
|
|
374
491
|
const rows=new Map((checked.analysisEvidence??[]).map(row=>[row.declaration+'\u0000'+row.stage,row]));
|
|
375
492
|
settled=evidence.map(row=>rows.get(row.declaration+'\u0000'+row.stage)??row);
|
|
376
493
|
found=[...diagnostics,...(checked.diagnostics??[]).filter(row=>row.code==='refuted')];
|
|
377
494
|
for(const verdict of checked.analysisChecks??[]) {
|
|
378
495
|
const done=ran.get(verdict.fingerprint)??{};
|
|
496
|
+
if(['proved','refuted','exempted'].includes(verdict.status))await saveQuery(done);
|
|
379
497
|
solverEvidence.push({owner:verdict.owner,declaration:verdict.declaration,stage:verdict.stage,kind:'analysis',
|
|
380
|
-
encoding:'lawspec-smtlib-v2',taskFingerprint:verdict.fingerprint,status:verdict.status,
|
|
381
|
-
|
|
498
|
+
encoding:'lawspec-smtlib-v2',taskFingerprint:done.reused?.taskFingerprint??verdict.fingerprint,status:verdict.status,
|
|
499
|
+
...(done.reused?{currentTaskFingerprint:verdict.fingerprint,reused:done.reused}:{}),
|
|
500
|
+
outcome:done.outcome??'failed',reason:verdict.reason+(done.reused?'; reused a completed query; model revalidated by the current evaluator':''),
|
|
501
|
+
check:verdict.check,configuration:config,
|
|
382
502
|
...(done.run?{prover:{name:'z3',version:selected.version,binary:selected.binary,binaryFingerprint:selected.binaryFingerprint,
|
|
383
503
|
fingerprint:selected.fingerprint,arguments:selected.args},runFingerprint:done.runFingerprint,
|
|
384
504
|
elapsedMs:done.run.elapsedMs,exitCode:done.run.exitCode,stdout:done.run.stdout,stderr:done.run.stderr}:{})});
|
|
@@ -399,13 +519,14 @@ export async function proveWithZ3(compiler,request,options={}) {
|
|
|
399
519
|
outcome:selected.outcome,reason:selected.error,configuration:config});
|
|
400
520
|
}
|
|
401
521
|
if(modelTasks.length&&!selected.error) {
|
|
402
|
-
const answered=new Map(),modelAnswers=[],modelRows=new Map();
|
|
522
|
+
const answered=new Map(),modelAnswers=[],modelRows=new Map(),runs=new Map();
|
|
403
523
|
let pending=modelTasks;
|
|
404
524
|
for(let round=0;round<4;round++) {
|
|
405
525
|
let fresh=0;
|
|
406
526
|
for(const law of pending) for(const task of law.tasks) {
|
|
407
527
|
if(answered.has(task.fingerprint))continue;
|
|
408
528
|
fresh++;
|
|
529
|
+
const executeQuery=async()=>{
|
|
409
530
|
const input=`(set-option :print-success false)\n(set-option :produce-models true)\n`+
|
|
410
531
|
`(set-option :random-seed ${config.seed})\n(set-option :rlimit ${config.resourceLimit})\n`+task.script+'(check-sat)\n';
|
|
411
532
|
const run=await execute(selected.binary,selected.args,input,config,true,token=>token!=='sat'?'(exit)\n':
|
|
@@ -417,21 +538,52 @@ export async function proveWithZ3(compiler,request,options={}) {
|
|
|
417
538
|
const at=body.indexOf('(define-fun Inv ');
|
|
418
539
|
if(at>=0) {let depth=0;for(let i=at;i<body.length;i++){if(body[i]==='(')depth++;if(body[i]===')'){depth--;if(depth===0){invariant=body.slice(at,i+1);break;}}}}
|
|
419
540
|
}
|
|
420
|
-
|
|
541
|
+
|
|
542
|
+
return {run,outcome,values:task.kind==='spacer'?'':body.trim(),invariant,
|
|
543
|
+
runFingerprint:fingerprint([task.fingerprint,selected.fingerprint,run.input])};
|
|
544
|
+
};
|
|
545
|
+
const row={kind:'model',owner:law.owner,declaration:law.declaration,stage:task.kind};
|
|
546
|
+
const done=await analysisQuery(cache,row,task,selected,executeQuery);
|
|
547
|
+
const answer={fingerprint:task.fingerprint,outcome:done.outcome,values:done.values,invariant:done.invariant??'',inputs:done.inputs??task.inputs};
|
|
421
548
|
answered.set(task.fingerprint,answer);modelAnswers.push(answer);
|
|
422
|
-
|
|
423
|
-
encoding:'lawspec-smtlib-v2',status:outcome==='unsat'?'proved':'incomplete',outcome,reason:task.kind+': '+outcome,
|
|
424
|
-
prover:{name:'z3',version:selected.version,binary:selected.binary,binaryFingerprint:selected.binaryFingerprint,
|
|
425
|
-
fingerprint:selected.fingerprint,arguments:selected.args},
|
|
426
|
-
runFingerprint:fingerprint([task.fingerprint,selected.fingerprint,run.input]),elapsedMs:run.elapsedMs,
|
|
427
|
-
exitCode:run.exitCode,signal:run.signal,stdout:run.stdout,stderr:run.stderr,configuration:config});
|
|
549
|
+
runs.set(task.fingerprint,{row,task,done});
|
|
428
550
|
}
|
|
429
551
|
if(!fresh)break;
|
|
430
|
-
|
|
552
|
+
let checked=await compiler.proofTasks({...request,modelResults:modelAnswers});
|
|
553
|
+
let retry=false;
|
|
554
|
+
for(const check of checked.modelChecks??[]){
|
|
555
|
+
const observation=runs.get(check.fingerprint);
|
|
556
|
+
if(check.status!=='model-not-confirmed'||!observation?.done.reused||!observation.done.rerun)continue;
|
|
557
|
+
await rm(observation.done.cacheFile,{force:true}).catch(()=>{});
|
|
558
|
+
observation.done=await observation.done.rerun();
|
|
559
|
+
const {task,done}=observation;
|
|
560
|
+
const answer={fingerprint:task.fingerprint,outcome:done.outcome,values:done.values,
|
|
561
|
+
invariant:done.invariant??'',inputs:done.inputs??task.inputs};
|
|
562
|
+
answered.set(task.fingerprint,answer);
|
|
563
|
+
modelAnswers[modelAnswers.findIndex(value=>value.fingerprint===task.fingerprint)]=answer;
|
|
564
|
+
retry=true;
|
|
565
|
+
}
|
|
566
|
+
if(retry)checked=await compiler.proofTasks({...request,modelResults:modelAnswers});
|
|
431
567
|
for(const row of checked.modelEvidence??[])modelRows.set(row.declaration,row);
|
|
432
568
|
for(const d of checked.diagnostics??[])if(d.code==='refuted'&&!found.some(e=>e.message===d.message))found=[...found,d];
|
|
433
569
|
pending=checked.modelTasks??[];
|
|
434
570
|
}
|
|
571
|
+
for(const {row,task,done} of runs.values()){
|
|
572
|
+
// Current model settlement still checks every proof/replay obligation.
|
|
573
|
+
// A reused raw query never substitutes for that compiler decision.
|
|
574
|
+
if(task.kind!=='bounded search'||done.outcome!=='sat'||modelRows.get(row.declaration)?.status==='refuted')
|
|
575
|
+
await saveQuery(done);
|
|
576
|
+
const run=done.run,outcome=done.outcome;
|
|
577
|
+
solverEvidence.push({kind:'model',owner:row.owner,declaration:row.declaration,task:task.kind,
|
|
578
|
+
taskFingerprint:done.reused?.taskFingerprint??task.fingerprint,
|
|
579
|
+
...(done.reused?{currentTaskFingerprint:task.fingerprint,reused:done.reused}:{}),
|
|
580
|
+
encoding:'lawspec-smtlib-v2',status:outcome==='unsat'?'proved':'incomplete',outcome,reason:task.kind+': '+outcome+
|
|
581
|
+
(done.reused?'; reused original solver query; current compiler rechecks the model evidence':''),
|
|
582
|
+
prover:{name:'z3',version:selected.version,binary:selected.binary,binaryFingerprint:selected.binaryFingerprint,
|
|
583
|
+
fingerprint:selected.fingerprint,arguments:selected.args},
|
|
584
|
+
runFingerprint:done.runFingerprint,elapsedMs:run.elapsedMs,
|
|
585
|
+
exitCode:run.exitCode,signal:run.signal,stdout:run.stdout,stderr:run.stderr,configuration:config});
|
|
586
|
+
}
|
|
435
587
|
settled=settled.map(row=>row.stage==='law'&&modelRows.has(row.declaration)?{...row,...modelRows.get(row.declaration)}:row);
|
|
436
588
|
}
|
|
437
589
|
return {...result,diagnostics:found,evidence:settled,solverEvidence};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Generated from templates/npm/scala-build-state.mjs by lawspec-dev generate. Do not edit.
|
|
2
|
+
// Preserve failed compiler state before an adapter restore or another build
|
|
3
|
+
// changes it. These diagnostics are not completed native execution evidence.
|
|
4
|
+
import {mkdir,readFile,readdir,realpath,stat,writeFile} from 'node:fs/promises';
|
|
5
|
+
import {randomUUID} from 'node:crypto';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
export const isScalaCompilationFailure = output =>
|
|
9
|
+
/error compiling project|compilation failed|unexpected error when (?:compiling|copying)/i.test(output);
|
|
10
|
+
|
|
11
|
+
export async function captureScalaBuildFailure({root,command,args,output,phase='native'}) {
|
|
12
|
+
try {
|
|
13
|
+
root=await realpath(root);
|
|
14
|
+
if(!(await stat(root)).isDirectory())return null;
|
|
15
|
+
const directory=path.join(root,'.lawspec','scala-build-failures',randomUUID());
|
|
16
|
+
await mkdir(directory,{recursive:true});
|
|
17
|
+
const inventory=[],configurations=[],errors=[];
|
|
18
|
+
const build=path.join(root,'.scala-build');
|
|
19
|
+
async function visit(folder) {
|
|
20
|
+
const entries=await readdir(folder,{withFileTypes:true}).catch(error=>{
|
|
21
|
+
if(error.code!=='ENOENT')errors.push({path:path.relative(root,folder),code:error.code});
|
|
22
|
+
return [];
|
|
23
|
+
});
|
|
24
|
+
for(const entry of entries.sort((a,b)=>a.name.localeCompare(b.name))) {
|
|
25
|
+
const file=path.join(folder,entry.name),relative=path.relative(root,file);
|
|
26
|
+
// A symlink may point to another client's output or outside this
|
|
27
|
+
// project. Record its presence without walking through it.
|
|
28
|
+
if(entry.isSymbolicLink()){inventory.push({path:relative,kind:'symlink'});continue;}
|
|
29
|
+
if(entry.isDirectory()){await visit(file);continue;}
|
|
30
|
+
if(!entry.isFile())continue;
|
|
31
|
+
if(/\.(?:class|tasty|betasty|sig)$/.test(entry.name)) {
|
|
32
|
+
const info=await stat(file).catch(error=>{errors.push({path:relative,code:error.code});return null;});
|
|
33
|
+
if(info)inventory.push({path:relative,bytes:info.size,modified:info.mtime.toISOString()});
|
|
34
|
+
}
|
|
35
|
+
if(path.basename(folder)==='.bloop'&&entry.name.endsWith('.json')) {
|
|
36
|
+
const raw=await readFile(file,'utf8').catch(error=>{errors.push({path:relative,code:error.code});return null;});
|
|
37
|
+
if(raw!==null) {
|
|
38
|
+
await writeFile(path.join(directory,entry.name),raw);
|
|
39
|
+
try {
|
|
40
|
+
const {project}=JSON.parse(raw);
|
|
41
|
+
configurations.push({file:relative,name:project?.name,directory:project?.directory,
|
|
42
|
+
workspaceDir:project?.workspaceDir,classesDir:project?.classesDir,
|
|
43
|
+
sources:project?.sources,dependencies:project?.dependencies,classpath:project?.classpath});
|
|
44
|
+
}catch{errors.push({path:relative,code:'invalid-json'});}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
await visit(build);
|
|
50
|
+
const lines=output.replace(/\x1b\[[0-9;]*m/g,'').split('\n');
|
|
51
|
+
const first=lines.findIndex(line=>/\[error\]|error:/i.test(line));
|
|
52
|
+
const state={version:1,capturedAt:new Date().toISOString(),root,phase,
|
|
53
|
+
command,args,firstCompilerError:first<0?[]:lines.slice(Math.max(0,first-2),first+18),
|
|
54
|
+
configurations,inventory,errors};
|
|
55
|
+
await writeFile(path.join(directory,'state.json'),JSON.stringify(state,null,2)+'\n');
|
|
56
|
+
await writeFile(path.join(directory,'compiler.log'),output);
|
|
57
|
+
return directory;
|
|
58
|
+
}catch{return null;} // Capture failure must never replace the compiler result.
|
|
59
|
+
}
|
package/templates.mjs
CHANGED
|
@@ -142,6 +142,246 @@ export const targetLabels = [
|
|
|
142
142
|
]
|
|
143
143
|
];
|
|
144
144
|
|
|
145
|
+
export const presentationChecks = {
|
|
146
|
+
"java": [
|
|
147
|
+
{
|
|
148
|
+
"command": "mvn",
|
|
149
|
+
"args": [
|
|
150
|
+
"-q",
|
|
151
|
+
"test-compile"
|
|
152
|
+
],
|
|
153
|
+
"suffix": null,
|
|
154
|
+
"each": false,
|
|
155
|
+
"environment": {}
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"python": [
|
|
159
|
+
{
|
|
160
|
+
"command": "python3",
|
|
161
|
+
"args": [
|
|
162
|
+
"-B",
|
|
163
|
+
"-c",
|
|
164
|
+
"import ast,pathlib,sys; [ast.parse(pathlib.Path(p).read_text(),filename=p) for p in sys.argv[1:]]"
|
|
165
|
+
],
|
|
166
|
+
"suffix": ".py",
|
|
167
|
+
"each": false,
|
|
168
|
+
"environment": {}
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"javascript": [
|
|
172
|
+
{
|
|
173
|
+
"command": "node",
|
|
174
|
+
"args": [
|
|
175
|
+
"--check"
|
|
176
|
+
],
|
|
177
|
+
"suffix": ".mjs",
|
|
178
|
+
"each": true,
|
|
179
|
+
"environment": {}
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"typescript": [
|
|
183
|
+
{
|
|
184
|
+
"command": "npm",
|
|
185
|
+
"args": [
|
|
186
|
+
"exec",
|
|
187
|
+
"--",
|
|
188
|
+
"tsc",
|
|
189
|
+
"-p",
|
|
190
|
+
"tsconfig.json"
|
|
191
|
+
],
|
|
192
|
+
"suffix": null,
|
|
193
|
+
"each": false,
|
|
194
|
+
"environment": {}
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"go": [
|
|
198
|
+
{
|
|
199
|
+
"command": "go",
|
|
200
|
+
"args": [
|
|
201
|
+
"test",
|
|
202
|
+
"./...",
|
|
203
|
+
"-run",
|
|
204
|
+
"^$"
|
|
205
|
+
],
|
|
206
|
+
"suffix": null,
|
|
207
|
+
"each": false,
|
|
208
|
+
"environment": {}
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"haskell": [
|
|
212
|
+
{
|
|
213
|
+
"command": "stack",
|
|
214
|
+
"args": [
|
|
215
|
+
"--no-terminal",
|
|
216
|
+
"build",
|
|
217
|
+
"--test",
|
|
218
|
+
"--no-run-tests"
|
|
219
|
+
],
|
|
220
|
+
"suffix": null,
|
|
221
|
+
"each": false,
|
|
222
|
+
"environment": {}
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"kotlin": [
|
|
226
|
+
{
|
|
227
|
+
"command": "gradle",
|
|
228
|
+
"args": [
|
|
229
|
+
"testClasses",
|
|
230
|
+
"--console=plain"
|
|
231
|
+
],
|
|
232
|
+
"suffix": null,
|
|
233
|
+
"each": false,
|
|
234
|
+
"environment": {}
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"rust": [
|
|
238
|
+
{
|
|
239
|
+
"command": "cargo",
|
|
240
|
+
"args": [
|
|
241
|
+
"test",
|
|
242
|
+
"--no-run"
|
|
243
|
+
],
|
|
244
|
+
"suffix": null,
|
|
245
|
+
"each": false,
|
|
246
|
+
"environment": {}
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"erlang": [
|
|
250
|
+
{
|
|
251
|
+
"command": "rebar3",
|
|
252
|
+
"args": [
|
|
253
|
+
"as",
|
|
254
|
+
"test",
|
|
255
|
+
"compile"
|
|
256
|
+
],
|
|
257
|
+
"suffix": null,
|
|
258
|
+
"each": false,
|
|
259
|
+
"environment": {}
|
|
260
|
+
}
|
|
261
|
+
],
|
|
262
|
+
"elixir": [
|
|
263
|
+
{
|
|
264
|
+
"command": "mix",
|
|
265
|
+
"args": [
|
|
266
|
+
"compile"
|
|
267
|
+
],
|
|
268
|
+
"suffix": null,
|
|
269
|
+
"each": false,
|
|
270
|
+
"environment": {
|
|
271
|
+
"MIX_ENV": "test"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"gleam": [
|
|
276
|
+
{
|
|
277
|
+
"command": "gleam",
|
|
278
|
+
"args": [
|
|
279
|
+
"build"
|
|
280
|
+
],
|
|
281
|
+
"suffix": null,
|
|
282
|
+
"each": false,
|
|
283
|
+
"environment": {}
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"fsharp": [
|
|
287
|
+
{
|
|
288
|
+
"command": "dotnet",
|
|
289
|
+
"args": [
|
|
290
|
+
"build"
|
|
291
|
+
],
|
|
292
|
+
"suffix": null,
|
|
293
|
+
"each": false,
|
|
294
|
+
"environment": {}
|
|
295
|
+
}
|
|
296
|
+
],
|
|
297
|
+
"csharp": [
|
|
298
|
+
{
|
|
299
|
+
"command": "dotnet",
|
|
300
|
+
"args": [
|
|
301
|
+
"build"
|
|
302
|
+
],
|
|
303
|
+
"suffix": null,
|
|
304
|
+
"each": false,
|
|
305
|
+
"environment": {}
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
"scala": [
|
|
309
|
+
{
|
|
310
|
+
"command": "scala",
|
|
311
|
+
"args": [
|
|
312
|
+
"compile",
|
|
313
|
+
"--test",
|
|
314
|
+
"."
|
|
315
|
+
],
|
|
316
|
+
"suffix": null,
|
|
317
|
+
"each": false,
|
|
318
|
+
"environment": {}
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"groovy": [
|
|
322
|
+
{
|
|
323
|
+
"command": "gradle",
|
|
324
|
+
"args": [
|
|
325
|
+
"testClasses",
|
|
326
|
+
"--console=plain"
|
|
327
|
+
],
|
|
328
|
+
"suffix": null,
|
|
329
|
+
"each": false,
|
|
330
|
+
"environment": {}
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"clojure": [
|
|
334
|
+
{
|
|
335
|
+
"command": "clojure",
|
|
336
|
+
"args": [
|
|
337
|
+
"-M",
|
|
338
|
+
"-e",
|
|
339
|
+
"(require 'lawspec.build) (lawspec.build/compile-java! true) (shutdown-agents)"
|
|
340
|
+
],
|
|
341
|
+
"suffix": null,
|
|
342
|
+
"each": false,
|
|
343
|
+
"environment": {}
|
|
344
|
+
}
|
|
345
|
+
],
|
|
346
|
+
"swift": [
|
|
347
|
+
{
|
|
348
|
+
"command": "swift",
|
|
349
|
+
"args": [
|
|
350
|
+
"build",
|
|
351
|
+
"--build-tests"
|
|
352
|
+
],
|
|
353
|
+
"suffix": null,
|
|
354
|
+
"each": false,
|
|
355
|
+
"environment": {}
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
"prolog": [
|
|
359
|
+
{
|
|
360
|
+
"command": "python3",
|
|
361
|
+
"args": [
|
|
362
|
+
"-B",
|
|
363
|
+
"-c",
|
|
364
|
+
"import ast,pathlib,sys; [ast.parse(pathlib.Path(p).read_text(),filename=p) for p in sys.argv[1:]]"
|
|
365
|
+
],
|
|
366
|
+
"suffix": ".py",
|
|
367
|
+
"each": false,
|
|
368
|
+
"environment": {}
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"command": "swipl",
|
|
372
|
+
"args": [
|
|
373
|
+
"-q",
|
|
374
|
+
"-g",
|
|
375
|
+
"halt",
|
|
376
|
+
"-s"
|
|
377
|
+
],
|
|
378
|
+
"suffix": ".pl",
|
|
379
|
+
"each": true,
|
|
380
|
+
"environment": {}
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
};
|
|
384
|
+
|
|
145
385
|
export const commands = {
|
|
146
386
|
"java": "mvn test",
|
|
147
387
|
"python": "python -m pytest",
|
|
@@ -356,10 +596,10 @@ const scaffolds = {
|
|
|
356
596
|
},
|
|
357
597
|
"swift": {
|
|
358
598
|
"readable": {
|
|
359
|
-
"Package.swift": "// swift-tools-version: 6.2\nimport PackageDescription\n\nlet package = Package(\n
|
|
599
|
+
"Package.swift": "// swift-tools-version: 6.2\nimport PackageDescription\n\nlet package = Package(\n name: \"Example\",\n platforms: [.macOS(.v26)],\n targets: [\n .target(name: \"LawSpecRuntime\", path: \"lawspec/LawSpecRuntime\"),\n .target(\n name: \"LawSpecTesting\", dependencies: [\"LawSpecRuntime\"], path: \"lawspec/LawSpecTesting\"),\n .target(name: \"App\", dependencies: [\"LawSpecRuntime\"], path: \"src\"),\n .testTarget(\n name: \"AppTests\", dependencies: [\"App\", \"LawSpecRuntime\", \"LawSpecTesting\"], path: \"tests\"),\n ]\n)\n"
|
|
360
600
|
},
|
|
361
601
|
"compact": {
|
|
362
|
-
"Package.swift": "// swift-tools-version: 6.2\nimport PackageDescription\nlet package = Package(\n
|
|
602
|
+
"Package.swift": "// swift-tools-version: 6.2\nimport PackageDescription\nlet package = Package(\n name: \"Example\",\n platforms: [.macOS(.v26)],\n targets: [\n .target(name: \"LawSpecRuntime\", path: \"lawspec/LawSpecRuntime\"),\n .target(\n name: \"LawSpecTesting\", dependencies: [\"LawSpecRuntime\"], path: \"lawspec/LawSpecTesting\"),\n .target(name: \"App\", dependencies: [\"LawSpecRuntime\"], path: \"src\"),\n .testTarget(\n name: \"AppTests\", dependencies: [\"App\", \"LawSpecRuntime\", \"LawSpecTesting\"], path: \"tests\"),\n ]\n)\n"
|
|
363
603
|
}
|
|
364
604
|
},
|
|
365
605
|
"prolog": {
|