supercov 0.0.44 → 0.0.46

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 (45) hide show
  1. package/README.md +21 -12
  2. package/docs/agent-loop.md +17 -9
  3. package/docs/assertion-agent.md +146 -0
  4. package/docs/assertion-evidence.md +72 -663
  5. package/docs/assertion-maps.md +236 -0
  6. package/docs/assertions.md +132 -0
  7. package/docs/cli.md +40 -8
  8. package/docs/coverage-model.md +18 -0
  9. package/docs/evidence.md +28 -0
  10. package/docs/performance.md +16 -0
  11. package/docs/supported-suites.md +64 -147
  12. package/package.json +36 -35
  13. package/runtime/javascript/launchSupervisor.mjs +5 -0
  14. package/runtime/javascript/nodeTest.mjs +57 -41
  15. package/runtime/javascript/provenance.mjs +4 -1
  16. package/runtime/javascript/register.mjs +9 -5
  17. package/runtime/javascript/runnerEvidence.mjs +4 -1
  18. package/runtime/javascript/runtime.mjs +62 -36
  19. package/schemas/assertions.schema.json +276 -0
  20. package/analyzers/typescript/README.md +0 -59
  21. package/analyzers/typescript/bin/compiler-identity.mjs +0 -78
  22. package/analyzers/typescript/bin/identity.mjs +0 -71
  23. package/analyzers/typescript/bin/query.mjs +0 -29
  24. package/analyzers/typescript/dist/analyze.js +0 -5273
  25. package/analyzers/typescript/dist/archive.js +0 -337
  26. package/analyzers/typescript/dist/awaited-observations.js +0 -376
  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/mock-counts.js +0 -2517
  31. package/analyzers/typescript/dist/native-frontend.js +0 -271
  32. package/analyzers/typescript/dist/pragmas.js +0 -186
  33. package/analyzers/typescript/dist/types.js +0 -1
  34. package/analyzers/typescript/package.json +0 -27
  35. package/analyzers/typescript/src/analyze.ts +0 -6180
  36. package/analyzers/typescript/src/archive.ts +0 -471
  37. package/analyzers/typescript/src/awaited-observations.ts +0 -561
  38. package/analyzers/typescript/src/compiler.ts +0 -49
  39. package/analyzers/typescript/src/frontend.ts +0 -136
  40. package/analyzers/typescript/src/mock-counts.ts +0 -3219
  41. package/analyzers/typescript/src/native-frontend.ts +0 -315
  42. package/analyzers/typescript/src/pragmas.ts +0 -284
  43. package/analyzers/typescript/src/types.ts +0 -45
  44. package/analyzers/typescript/tsconfig.json +0 -12
  45. package/docs/code-verification.md +0 -4
@@ -1,71 +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/awaited-observations.ts",
11
- "src/compiler.ts",
12
- "src/frontend.ts",
13
- "src/native-frontend.ts",
14
- "src/types.ts",
15
- "src/pragmas.ts",
16
- "src/mock-counts.ts",
17
- "bin/query.mjs",
18
- "bin/compiler-identity.mjs",
19
- "bin/identity.mjs",
20
- "tsconfig.json",
21
- // npm excludes package-lock.json from tarballs. Hash shipped build inputs,
22
- // not a checkout-only file, so installed and development checks are identical.
23
- "package.json",
24
- ];
25
- const outputs = [
26
- "dist/analyze.js",
27
- "dist/archive.js",
28
- "dist/awaited-observations.js",
29
- "dist/compiler.js",
30
- "dist/frontend.js",
31
- "dist/native-frontend.js",
32
- "dist/types.js",
33
- "dist/pragmas.js",
34
- "dist/mock-counts.js",
35
- ];
36
- function digest(files) {
37
- const hash = createHash("sha256");
38
- for (const file of files)
39
- hash
40
- .update(file)
41
- .update("\0")
42
- .update(readFileSync(resolve(root, file)))
43
- .update("\0");
44
- return hash.digest("hex");
45
- }
46
- export function identity() {
47
- return {
48
- schema: 1,
49
- sourceSha256: digest(sources),
50
- compiledSha256: digest(outputs),
51
- };
52
- }
53
- export function checkedIdentity() {
54
- const built = JSON.parse(
55
- readFileSync(resolve(root, "dist/build-identity.json"), "utf8"),
56
- );
57
- const current = identity();
58
- if (JSON.stringify(built) !== JSON.stringify(current))
59
- throw new Error(
60
- "Assertion analyzer build is stale or modified; rebuild analyzers/typescript",
61
- );
62
- return current;
63
- }
64
- if (
65
- process.argv[1] &&
66
- resolve(process.argv[1]) === fileURLToPath(import.meta.url)
67
- )
68
- writeFileSync(
69
- resolve(root, "dist/build-identity.json"),
70
- JSON.stringify(identity()) + "\n",
71
- );
@@ -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
- }