@milkenjoyer/toolchain 0.11.0 → 0.13.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/README.md +190 -17
- package/dist/arithmetic.d.mts +45 -0
- package/dist/arithmetic.mjs +25 -0
- package/dist/conformance.d.mts +18 -0
- package/dist/conformance.mjs +31 -0
- package/dist/effect-plugin.mjs +1 -1
- package/dist/exceptions-Dybl9xpc.mjs +11 -0
- package/dist/exceptions.mjs +1 -1
- package/dist/foldkit-plugin.mjs +1 -1
- package/dist/formal.d.mts +131 -3
- package/dist/formal.mjs +1006 -146
- package/dist/guard.mjs +2 -2
- package/dist/knip.mjs +2 -1
- package/dist/{lint-JSnPsGO1.mjs → lint-IhmtnBbx.mjs} +3 -3
- package/dist/lint.mjs +1 -1
- package/dist/plugin.mjs +1 -1
- package/dist/proof.mjs +1 -1
- package/dist/trace-file-KuPRWgwt.mjs +17 -0
- package/dist/verdict.d.mts +1 -1
- package/dist/verdict.mjs +1 -1
- package/dist/{verification-p2rSx5lc.d.mts → verification-FgQFU1YN.d.mts} +1 -1
- package/dist/verification.d.mts +1 -1
- package/dist/verification.mjs +1 -1
- package/package.json +12 -3
- package/src/formal/arithmetic.ts +190 -0
- package/src/formal/cfg.ts +58 -1
- package/src/formal/checks.ts +57 -52
- package/src/formal/coverage.ts +79 -0
- package/src/formal/gate.ts +74 -0
- package/src/formal/git.ts +38 -0
- package/src/formal/proof-run.ts +77 -0
- package/src/formal/proofs.ts +226 -0
- package/src/formal/prover.ts +291 -0
- package/src/formal/semantics.ts +110 -0
- package/src/formal/specs.ts +103 -31
- package/src/formal/tla.ts +60 -19
- package/src/formal/trace-file.ts +35 -0
- package/src/formal/traces.ts +293 -0
- package/src/formal/violations.ts +76 -0
- package/src/formal/z3.ts +321 -0
- package/src/formal.ts +10 -3
- package/dist/exceptions-Bq-9MxoR.mjs +0 -3
- package/dist/{effect-plugin-kYxB-5LJ.mjs → effect-plugin-BXUx9PPu.mjs} +1 -1
- package/dist/{plugin-BoBRGtGf.mjs → plugin-CwxhPtui.mjs} +1 -1
- package/dist/{verification-6s2chr4X.mjs → verification-oAc1Q6I9.mjs} +1 -1
package/src/formal.ts
CHANGED
|
@@ -4,10 +4,12 @@ import * as Cause from "effect/Cause";
|
|
|
4
4
|
import * as Console from "effect/Console";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Exit from "effect/Exit";
|
|
7
|
+
import * as Layer from "effect/Layer";
|
|
7
8
|
import { ChildProcess } from "effect/process";
|
|
8
9
|
import * as Stream from "effect/Stream";
|
|
9
10
|
|
|
10
11
|
import { checks, type Finding } from "./formal/checks.ts";
|
|
12
|
+
import { Gate } from "./formal/gate.ts";
|
|
11
13
|
import { load } from "./formal/specs.ts";
|
|
12
14
|
import { FormalError, Tla } from "./formal/tla.ts";
|
|
13
15
|
|
|
@@ -23,7 +25,10 @@ export const formal = Effect.fn("formal")(function* (root: string) {
|
|
|
23
25
|
findings.push(...problems.map((problem) => ({ ...problem, check: name })));
|
|
24
26
|
}
|
|
25
27
|
findings.sort(
|
|
26
|
-
(a, b) =>
|
|
28
|
+
(a, b) =>
|
|
29
|
+
a.file.localeCompare(b.file) ||
|
|
30
|
+
Object.keys(checks).indexOf(a.check) -
|
|
31
|
+
Object.keys(checks).indexOf(b.check)
|
|
27
32
|
);
|
|
28
33
|
if (findings.length) {
|
|
29
34
|
for (const f of findings)
|
|
@@ -33,7 +38,7 @@ export const formal = Effect.fn("formal")(function* (root: string) {
|
|
|
33
38
|
);
|
|
34
39
|
} else
|
|
35
40
|
yield* Console.log(
|
|
36
|
-
`formal: ${repo.specs.length} specs, ${repo.specs.reduce((n, s) => n + s.configs.length, 0)} configs, no findings`
|
|
41
|
+
`formal: ${repo.specs.length} specs, ${repo.specs.reduce((n, s) => n + s.configs.length, 0)} configs, ${Object.keys(repo.file.proofs).length} proofs, no findings`
|
|
37
42
|
);
|
|
38
43
|
return findings.length ? 1 : 0;
|
|
39
44
|
});
|
|
@@ -59,7 +64,9 @@ if (import.meta.main) {
|
|
|
59
64
|
return yield* new FormalError({
|
|
60
65
|
message: "run formal inside a git repository",
|
|
61
66
|
});
|
|
62
|
-
return yield* formal(root.trim()).pipe(
|
|
67
|
+
return yield* formal(root.trim()).pipe(
|
|
68
|
+
Effect.provide(Gate.layer.pipe(Layer.provideMerge(Tla.layer)))
|
|
69
|
+
);
|
|
63
70
|
})
|
|
64
71
|
).pipe(Effect.provide(NodeServices.layer))
|
|
65
72
|
);
|
|
@@ -6,8 +6,8 @@ import * as Option from "effect/Option";
|
|
|
6
6
|
import * as R from "effect/Record";
|
|
7
7
|
import * as Schema from "effect/Schema";
|
|
8
8
|
import * as Str from "effect/String";
|
|
9
|
-
import { AST, Diagnostic, Plugin, Rule, RuleContext, Scope, SourceCode, Visitor } from "effect-oxlint";
|
|
10
9
|
import * as Effect from "effect/Effect";
|
|
10
|
+
import { AST, Diagnostic, Plugin, Rule, RuleContext, Scope, SourceCode, Visitor } from "effect-oxlint";
|
|
11
11
|
import * as Ref from "effect/Ref";
|
|
12
12
|
import { pipe as pipe$1 } from "effect";
|
|
13
13
|
import * as Result from "effect/Result";
|
|
@@ -4,8 +4,8 @@ import { dual } from "effect/Function";
|
|
|
4
4
|
import * as HashSet from "effect/HashSet";
|
|
5
5
|
import * as Option from "effect/Option";
|
|
6
6
|
import * as Str from "effect/String";
|
|
7
|
-
import { Comment, Diagnostic, Plugin, Rule, RuleContext } from "effect-oxlint";
|
|
8
7
|
import * as Effect from "effect/Effect";
|
|
8
|
+
import { Comment, Diagnostic, Plugin, Rule, RuleContext } from "effect-oxlint";
|
|
9
9
|
import * as HashMap from "effect/HashMap";
|
|
10
10
|
// src/rules/no-comments.ts
|
|
11
11
|
const noCommentsRule = Rule.define({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as Data from "effect/Data";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
|
+
import * as Config from "effect/Config";
|
|
3
4
|
import * as Effect from "effect/Effect";
|
|
4
5
|
import { NodeServices } from "@effect/platform-node";
|
|
5
6
|
import * as Cause from "effect/Cause";
|
|
6
7
|
import * as Console from "effect/Console";
|
|
7
8
|
import * as Exit from "effect/Exit";
|
|
8
9
|
import { FileSystem } from "effect/FileSystem";
|
|
9
|
-
import * as Config from "effect/Config";
|
|
10
10
|
import { Octokit } from "@octokit/rest";
|
|
11
11
|
import * as Redacted from "effect/Redacted";
|
|
12
12
|
// src/verification.ts
|