supercov 0.0.43 → 0.0.45

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.
Files changed (42) hide show
  1. package/README.md +23 -14
  2. package/docs/agent-loop.md +128 -39
  3. package/docs/assertion-agent.md +156 -0
  4. package/docs/assertion-evidence.md +9 -135
  5. package/docs/assertion-maps.md +252 -0
  6. package/docs/assertions.md +82 -0
  7. package/docs/cli.md +38 -23
  8. package/docs/coverage-model.md +18 -6
  9. package/docs/evidence.md +6 -6
  10. package/docs/getting-started.md +60 -72
  11. package/docs/performance.md +4 -4
  12. package/docs/troubleshooting.md +8 -8
  13. package/docs/verification.md +2 -2
  14. package/docs/workspace-isolation.md +1 -1
  15. package/package.json +34 -33
  16. package/runtime/javascript/nodeAssertAdapter.mjs +32 -8
  17. package/runtime/javascript/nodeTest.mjs +13 -5
  18. package/runtime/javascript/runnerEvidence.mjs +33 -11
  19. package/runtime/javascript/runtime.mjs +27 -23
  20. package/schemas/assertions.schema.json +276 -0
  21. package/analyzers/typescript/README.md +0 -55
  22. package/analyzers/typescript/bin/compiler-identity.mjs +0 -78
  23. package/analyzers/typescript/bin/identity.mjs +0 -67
  24. package/analyzers/typescript/bin/query.mjs +0 -29
  25. package/analyzers/typescript/dist/analyze.js +0 -3972
  26. package/analyzers/typescript/dist/archive.js +0 -309
  27. package/analyzers/typescript/dist/build-identity.json +0 -1
  28. package/analyzers/typescript/dist/compiler.js +0 -32
  29. package/analyzers/typescript/dist/frontend.js +0 -75
  30. package/analyzers/typescript/dist/native-frontend.js +0 -271
  31. package/analyzers/typescript/dist/pragmas.js +0 -143
  32. package/analyzers/typescript/dist/types.js +0 -1
  33. package/analyzers/typescript/package.json +0 -27
  34. package/analyzers/typescript/src/analyze.ts +0 -4538
  35. package/analyzers/typescript/src/archive.ts +0 -438
  36. package/analyzers/typescript/src/compiler.ts +0 -49
  37. package/analyzers/typescript/src/frontend.ts +0 -136
  38. package/analyzers/typescript/src/native-frontend.ts +0 -315
  39. package/analyzers/typescript/src/pragmas.ts +0 -218
  40. package/analyzers/typescript/src/types.ts +0 -45
  41. package/analyzers/typescript/tsconfig.json +0 -12
  42. package/docs/code-verification.md +0 -182
@@ -1,67 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { readFileSync, writeFileSync } from "node:fs";
3
- import { resolve } from "node:path";
4
- import { fileURLToPath } from "node:url";
5
-
6
- const root = resolve(import.meta.dirname, "..");
7
- const sources = [
8
- "src/analyze.ts",
9
- "src/archive.ts",
10
- "src/compiler.ts",
11
- "src/frontend.ts",
12
- "src/native-frontend.ts",
13
- "src/types.ts",
14
- "src/pragmas.ts",
15
- "bin/query.mjs",
16
- "bin/compiler-identity.mjs",
17
- "bin/identity.mjs",
18
- "tsconfig.json",
19
- // npm excludes package-lock.json from tarballs. Hash shipped build inputs,
20
- // not a checkout-only file, so installed and development checks are identical.
21
- "package.json",
22
- ];
23
- const outputs = [
24
- "dist/analyze.js",
25
- "dist/archive.js",
26
- "dist/compiler.js",
27
- "dist/frontend.js",
28
- "dist/native-frontend.js",
29
- "dist/types.js",
30
- "dist/pragmas.js",
31
- ];
32
- function digest(files) {
33
- const hash = createHash("sha256");
34
- for (const file of files)
35
- hash
36
- .update(file)
37
- .update("\0")
38
- .update(readFileSync(resolve(root, file)))
39
- .update("\0");
40
- return hash.digest("hex");
41
- }
42
- export function identity() {
43
- return {
44
- schema: 1,
45
- sourceSha256: digest(sources),
46
- compiledSha256: digest(outputs),
47
- };
48
- }
49
- export function checkedIdentity() {
50
- const built = JSON.parse(
51
- readFileSync(resolve(root, "dist/build-identity.json"), "utf8"),
52
- );
53
- const current = identity();
54
- if (JSON.stringify(built) !== JSON.stringify(current))
55
- throw new Error(
56
- "Assertion analyzer build is stale or modified; rebuild analyzers/typescript",
57
- );
58
- return current;
59
- }
60
- if (
61
- process.argv[1] &&
62
- resolve(process.argv[1]) === fileURLToPath(import.meta.url)
63
- )
64
- writeFileSync(
65
- resolve(root, "dist/build-identity.json"),
66
- JSON.stringify(identity()) + "\n",
67
- );
@@ -1,29 +0,0 @@
1
- // First-party query transport, never executed by the test runner.
2
- import { readFileSync } from "node:fs";
3
- import { checkedIdentity } from "./identity.mjs";
4
-
5
- try {
6
- const analyzer = checkedIdentity();
7
- const input = JSON.parse(readFileSync(0, "utf8"));
8
- // Check the build before importing executable analyzer code.
9
- const { compilerIdentity } = await import("./compiler-identity.mjs");
10
- const { analyzeArchive } = await import("../dist/archive.js");
11
- const compiler = compilerIdentity(input.projectRoot);
12
- const compilerSha256 = compiler.sha256;
13
- const result = analyzeArchive(input);
14
- if (
15
- JSON.stringify(compilerIdentity(input.projectRoot)) !==
16
- JSON.stringify(compiler) ||
17
- JSON.stringify(checkedIdentity()) !== JSON.stringify(analyzer)
18
- )
19
- throw new Error("Analyzer or compiler changed during analysis");
20
- process.stdout.write(
21
- JSON.stringify({
22
- ...result,
23
- analyzer: { ...analyzer, compilerSha256, compiler },
24
- }),
25
- );
26
- } catch (error) {
27
- console.error(error instanceof Error ? error.message : String(error));
28
- process.exitCode = 1;
29
- }