@codyswann/lisa 5.7.0 → 5.8.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.
Files changed (81) hide show
  1. package/all/copy-overwrite/scripts/lib/push-timing.mjs +135 -9
  2. package/all/copy-overwrite/scripts/lisa-gates.mjs +5 -5
  3. package/all/copy-overwrite/scripts/lisa-push-timing-report.mjs +58 -4
  4. package/all/copy-overwrite/scripts/lisa-run-gates.mjs +13 -1
  5. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +3 -3
  6. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  7. package/dist/core/lisa-owned-hash-ledger.js +22 -0
  8. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  9. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  10. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  11. package/dist/core/upstream-evidence-manifest.js +17 -8
  12. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  13. package/package.json +5 -5
  14. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  15. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  16. package/plugins/lisa-agy/plugin.json +1 -1
  17. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  19. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  20. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  21. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  24. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  28. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  30. package/plugins/lisa-expo-agy/plugin.json +1 -1
  31. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  35. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  37. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  38. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  42. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  44. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  45. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  49. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  51. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  52. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  56. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  58. package/plugins/lisa-rails-agy/plugin.json +1 -1
  59. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  63. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  65. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  66. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  70. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  72. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  73. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  77. package/rails/copy-overwrite/scripts/lisa-rails-gates.mjs +6 -0
  78. package/scripts/check-shell-guard-refusal-coverage.mjs +10 -0
  79. package/scripts/check-test-files-executed.mjs +149 -0
  80. package/scripts/lib/nightly-slow-suites.mjs +58 -0
  81. package/scripts/plan-integration-shards.mjs +12 -3
@@ -634,6 +634,12 @@ export async function runRailsGates(
634
634
  }
635
635
  selection.close();
636
636
  cache?.commit();
637
+ // Known gap (CodySwannGT/lisa#4896): the JS/TS runner records, per failed
638
+ // test gate, the test files its Vitest or Jest output named as failing. Here
639
+ // RSpec runs with inherited stdio (`runner` above), so no transcript exists
640
+ // to read `rspec ./spec/...` lines from, and every Rails gate records an empty
641
+ // `failingTestFiles`. Closing it needs a bounded output tail on the rspec
642
+ // payload, as the JS runner's supervisor keeps.
637
643
  recordPushTiming({
638
644
  moment: "push",
639
645
  startedAtMs,
@@ -66,6 +66,7 @@ import process from "node:process";
66
66
  import { fileURLToPath } from "node:url";
67
67
 
68
68
  import { invokedAsScript } from "./lib/invoked-as-script.mjs";
69
+ import { NIGHTLY_SLOW_SUITES } from "./lib/nightly-slow-suites.mjs";
69
70
  import {
70
71
  formatReport,
71
72
  guardPopulation,
@@ -114,9 +115,18 @@ const CHILD_STARTS = Object.freeze([
114
115
  * Sync run 42505996595 collected it in shard 3, and none of that shard's 350
115
116
  * trace records originated from it, so leaving it out narrows no guard's
116
117
  * observed refusals.
118
+ * - `NIGHTLY_SLOW_SUITES` — the six slow suites CodySwannGT/lisa#4896 moved to
119
+ * `.github/workflows/nightly-slow-tests.yml`. `vitest.config.local.ts`
120
+ * excludes them from every per-PR Vitest run, so the native collection this
121
+ * check compares against cannot contain them. Only
122
+ * `tests/integration/vitest-nodenext-local-config.test.ts` was ever a
123
+ * candidate, and it drove no guard: Plugins Sync run 43325166549 on main
124
+ * passed it in shard 3, and none of that shard's 394 trace records
125
+ * originated from it.
117
126
  */
118
127
  export const HAND_RUN_SUITES = Object.freeze([
119
128
  "tests/integration/shared-runtime-packed-hosts.test.ts",
129
+ ...NIGHTLY_SLOW_SUITES,
120
130
  ]);
121
131
 
122
132
  /**
@@ -0,0 +1,149 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Proves every NAMED test file ran and passed, from a vitest JSON report.
4
+ *
5
+ * The file-level sibling of `scripts/check-test-case-executed.mjs`, written for
6
+ * the nightly slow-test lane (CodySwannGT/lisa#4896). That lane runs files the
7
+ * rest of the suite excludes, and an excluded, moved or renamed file is not a
8
+ * failure to Vitest: it is simply absent, and an absent file reports green. So
9
+ * a green run proves nothing until each file is shown to be in the report,
10
+ * with a passing status and at least one passing case.
11
+ *
12
+ * Vitest's JSON report names each file by its ABSOLUTE path in
13
+ * `testResults[].name`; this script compares repository-relative paths against
14
+ * `--root` (default: the working directory).
15
+ *
16
+ * ## Usage
17
+ *
18
+ * node scripts/check-test-files-executed.mjs --report <report.json> \
19
+ * [--root <dir>] (--list <module.mjs>#<export> | --file <path> ...)
20
+ *
21
+ * `--list` reads the file list from a module's named export, so the nightly
22
+ * lane can check the same list `vitest.config.local.ts` excludes without
23
+ * restating it.
24
+ *
25
+ * Exit 0 only when every file ran and passed; otherwise exit 1 naming each
26
+ * file and why.
27
+ * @module scripts/check-test-files-executed
28
+ */
29
+ import { readFileSync } from "node:fs";
30
+ import * as path from "node:path";
31
+ import { pathToFileURL } from "node:url";
32
+
33
+ import { invokedAsScript } from "./lib/invoked-as-script.mjs";
34
+
35
+ /**
36
+ * Parse the arguments.
37
+ * @param {readonly string[]} argv - Arguments after the script path
38
+ * @returns {{ report: string, root: string, files: string[], list?: string }} Invocation
39
+ */
40
+ export function parseArguments(argv) {
41
+ const files = [];
42
+ let report;
43
+ let root = process.cwd();
44
+ let list;
45
+ for (let index = 0; index < argv.length; index += 2) {
46
+ const flag = argv[index];
47
+ const value = argv[index + 1];
48
+ if (!["--report", "--root", "--file", "--list"].includes(String(flag)))
49
+ throw new Error(`Unknown argument: ${String(flag)}`);
50
+ if (value === undefined || value.startsWith("--"))
51
+ throw new Error(`${flag} requires a value`);
52
+ if (flag === "--report") report = value;
53
+ else if (flag === "--root") root = value;
54
+ else if (flag === "--list") list = value;
55
+ else files.push(value);
56
+ }
57
+ if (report === undefined) throw new Error("--report is required");
58
+ if (files.length === 0 && list === undefined)
59
+ throw new Error("Name the files with --file or --list");
60
+ return { report, root, files, ...(list === undefined ? {} : { list }) };
61
+ }
62
+
63
+ /**
64
+ * Each named file that did not run and pass, with the reason.
65
+ * @param {unknown} report - A parsed vitest JSON report
66
+ * @param {readonly string[]} files - Repository-relative paths that must have run
67
+ * @param {string} root - Directory the paths are relative to
68
+ * @returns {string[]} Failures, empty when every file ran and passed
69
+ */
70
+ export function unexecutedFiles(report, files, root) {
71
+ const results = Array.isArray(report?.testResults) ? report.testResults : [];
72
+ const byFile = new Map(
73
+ results.map(result => [
74
+ path.relative(root, String(result?.name)).split(path.sep).join("/"),
75
+ result,
76
+ ])
77
+ );
78
+ return files.flatMap(file => {
79
+ const result = byFile.get(file);
80
+ if (result === undefined)
81
+ return [
82
+ `${file} is ABSENT from the report — it was excluded, moved, or renamed, so nothing ran it.`,
83
+ ];
84
+ if (result.status !== "passed")
85
+ return [`${file} did not pass: the runner reported "${result.status}".`];
86
+ const cases = Array.isArray(result.assertionResults)
87
+ ? result.assertionResults
88
+ : [];
89
+ if (!cases.some(entry => entry?.status === "passed"))
90
+ return [
91
+ `${file} passed with no passing case — every case was skipped, so it proves nothing.`,
92
+ ];
93
+ return [];
94
+ });
95
+ }
96
+
97
+ /**
98
+ * Resolve `--list <module>#<export>` to the file list it names.
99
+ * @param {string} spec - Module path, `#`, export name
100
+ * @param {string} root - Directory a relative module path resolves against
101
+ * @returns {Promise<string[]>} Repository-relative paths
102
+ */
103
+ async function listFrom(spec, root) {
104
+ const [modulePath = "", exportName = ""] = spec.split("#");
105
+ const loaded = await import(
106
+ pathToFileURL(path.resolve(root, modulePath)).href
107
+ );
108
+ const value = loaded[exportName];
109
+ if (!Array.isArray(value) || value.length === 0)
110
+ throw new Error(`${spec} is not a non-empty list of files`);
111
+ return value.map(String);
112
+ }
113
+
114
+ /**
115
+ * CLI entry.
116
+ * @param {readonly string[]} argv - Arguments after the script path
117
+ * @returns {Promise<string[]>} Failures, empty when every file ran and passed
118
+ */
119
+ export async function checkTestFilesExecuted(argv) {
120
+ const options = parseArguments(argv);
121
+ const files = [
122
+ ...options.files,
123
+ ...(options.list === undefined
124
+ ? []
125
+ : await listFrom(options.list, options.root)),
126
+ ];
127
+ const report = JSON.parse(readFileSync(options.report, "utf8"));
128
+ const failures = unexecutedFiles(report, files, options.root);
129
+ for (const file of files)
130
+ if (!failures.some(failure => failure.startsWith(`${file} `)))
131
+ process.stdout.write(`RAN ${file}\n`);
132
+ return failures;
133
+ }
134
+
135
+ if (invokedAsScript(import.meta.url)) {
136
+ try {
137
+ const failures = await checkTestFilesExecuted(process.argv.slice(2));
138
+ for (const failure of failures)
139
+ process.stdout.write(
140
+ `::error title=Nightly test file did not run and pass::${failure}\n`
141
+ );
142
+ process.exit(failures.length === 0 ? 0 : 1);
143
+ } catch (error) {
144
+ process.stderr.write(
145
+ `${error instanceof Error ? error.message : String(error)}\n`
146
+ );
147
+ process.exit(1);
148
+ }
149
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The test files that run only on the nightly lane (CodySwannGT/lisa#4896).
3
+ *
4
+ * A 2026-11-14 audit set each test file's CI runtime against 71 days of CI
5
+ * catch history. These six cost about 380 s per run between them and caught
6
+ * nothing confirmed in that window, so they leave every pull-request and push
7
+ * path and run once a night in `.github/workflows/nightly-slow-tests.yml`
8
+ * instead. Nothing about what they assert changes; only when they run does.
9
+ *
10
+ * ONE list, read by everything that decides a file set:
11
+ *
12
+ * - `vitest.config.local.ts` excludes them from every run, so every package
13
+ * script (`test`, `test:unit`, `test:cov:unit`, `test:cov:unit:push`,
14
+ * `test:integration`, `test:integration:push`) and every CI shard leg drops
15
+ * them without a flag of its own to keep in step.
16
+ * - `scripts/plan-integration-shards.mjs` leaves them out of the plan, so a
17
+ * leg is not weighed for files it will not run.
18
+ * - The nightly workflow sets {@link NIGHTLY_SLOW_SUITES_ENV} and names exactly
19
+ * these files; `tests/unit/config/nightly-slow-suites.test.ts` pins that the
20
+ * names match this list.
21
+ *
22
+ * Paths are exact repository-relative paths, never any-directory basename globs:
23
+ * `history-secret-private-report.test.ts` also names a cheap UNIT suite under
24
+ * `tests/unit/scripts/`, which must keep running on every pull request.
25
+ *
26
+ * To run one by hand, set the variable: `LISA_NIGHTLY_SLOW_SUITES=run bun run
27
+ * lisa-test-run -- --adapter vitest -- vitest run <file>`. Without it Vitest
28
+ * answers "No test files found", because the file is excluded.
29
+ * @module nightly-slow-suites
30
+ */
31
+
32
+ /** Repository-relative paths of the nightly-only suites. */
33
+ export const NIGHTLY_SLOW_SUITES = Object.freeze([
34
+ "tests/unit/config/test-run-supervision-wiring.test.ts",
35
+ "tests/integration/mutation-gate-bite.test.ts",
36
+ "tests/integration/history-secret-evidence.test.ts",
37
+ "tests/integration/history-secret-private-report.test.ts",
38
+ "tests/integration/vitest-nodenext-local-config.test.ts",
39
+ "tests/integration/staged-module-formatting.test.ts",
40
+ ]);
41
+
42
+ /** The variable that lifts the exclusion, set by the nightly lane. */
43
+ export const NIGHTLY_SLOW_SUITES_ENV = "LISA_NIGHTLY_SLOW_SUITES";
44
+
45
+ /** The one value of {@link NIGHTLY_SLOW_SUITES_ENV} that lifts it. */
46
+ export const NIGHTLY_SLOW_SUITES_RUN = "run";
47
+
48
+ /**
49
+ * The Vitest `exclude` entries for this run: the nightly list, unless the
50
+ * environment asks for those suites to run.
51
+ * @param {Readonly<Record<string, string | undefined>>} env - Environment
52
+ * @returns {string[]} Exclusion patterns (exact paths)
53
+ */
54
+ export function nightlySlowSuiteExclusions(env) {
55
+ return env[NIGHTLY_SLOW_SUITES_ENV] === NIGHTLY_SLOW_SUITES_RUN
56
+ ? []
57
+ : [...NIGHTLY_SLOW_SUITES];
58
+ }
@@ -11,6 +11,9 @@
11
11
  * the plan every leg applies through `lisa-test-run` (`LISA_TEST_SHARD_PLAN`,
12
12
  * `src/cli/lisa-test-run-shard-files.ts`).
13
13
  *
14
+ * The nightly-only suites (`scripts/lib/nightly-slow-suites.mjs`) are left
15
+ * out: the shared Vitest config excludes them from every leg.
16
+ *
14
17
  * The history-scanner suites are one item, so they land in one leg and a
15
18
  * sharded run downloads the pinned scanner at most once: their project's
16
19
  * global setup runs only in an invocation whose selection holds one of them.
@@ -34,6 +37,7 @@ import * as path from "node:path";
34
37
 
35
38
  import { HISTORY_SCANNER_SUITES } from "./lib/history-scanner-suites.mjs";
36
39
  import { invokedAsScript } from "./lib/invoked-as-script.mjs";
40
+ import { NIGHTLY_SLOW_SUITES } from "./lib/nightly-slow-suites.mjs";
37
41
  import { collectTimings } from "./test-timing-report.mjs";
38
42
 
39
43
  /** The schema token `lisa-test-run` requires of a plan. */
@@ -261,12 +265,17 @@ export function main(argv, deps) {
261
265
  return 2;
262
266
  }
263
267
  const read = readTimings(options, deps);
264
- // A file deleted since the timings were recorded would only skew the loads.
265
- const timings = read.timings.filter(entry => deps.exists(entry.file));
268
+ // A file deleted since the timings were recorded would only skew the loads,
269
+ // and so would a nightly-only suite the shared Vitest config excludes from
270
+ // every pull-request run (CodySwannGT/lisa#4896).
271
+ const nightlyOnly = new Set(NIGHTLY_SLOW_SUITES);
272
+ const timings = read.timings.filter(
273
+ entry => deps.exists(entry.file) && !nightlyOnly.has(entry.file)
274
+ );
266
275
  const plan = planShards({
267
276
  total: options.shards,
268
277
  timings,
269
- groups: [[...HISTORY_SCANNER_SUITES]],
278
+ groups: [HISTORY_SCANNER_SUITES.filter(suite => !nightlyOnly.has(suite))],
270
279
  });
271
280
  if (timings.length === 0) {
272
281
  deps.out(