@codyswann/lisa 4.27.8 → 4.28.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.
Files changed (70) hide show
  1. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  2. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  3. package/dist/core/upstream-evidence-manifest.js +36 -2
  4. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  5. package/package.json +5 -4
  6. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  7. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  8. package/plugins/lisa/.codex-plugin/skills/lisa-validate-tracker-mapping/SKILL.md +134 -3
  9. package/plugins/lisa/scripts/repo-scope-vocabulary-audit.mjs +458 -0
  10. package/plugins/lisa/skills/lisa-validate-tracker-mapping/SKILL.md +135 -4
  11. package/plugins/lisa-agy/plugin.json +1 -1
  12. package/plugins/lisa-agy/scripts/repo-scope-vocabulary-audit.mjs +458 -0
  13. package/plugins/lisa-agy/skills/lisa-validate-tracker-mapping/SKILL.md +135 -4
  14. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  15. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  16. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  17. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa-copilot/scripts/repo-scope-vocabulary-audit.mjs +458 -0
  21. package/plugins/lisa-copilot/skills/lisa-validate-tracker-mapping/SKILL.md +135 -4
  22. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-cursor/scripts/repo-scope-vocabulary-audit.mjs +458 -0
  24. package/plugins/lisa-cursor/skills/lisa-validate-tracker-mapping/SKILL.md +135 -4
  25. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  27. package/plugins/lisa-expo-agy/plugin.json +1 -1
  28. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  32. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  33. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  37. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  38. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  42. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  43. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  47. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  48. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa-rails-agy/plugin.json +1 -1
  53. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  57. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  58. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  63. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/src/base/scripts/repo-scope-vocabulary-audit.mjs +458 -0
  66. package/plugins/src/base/skills/lisa-validate-tracker-mapping/SKILL.md +135 -4
  67. package/scripts/lib/mutation-performance-reporter.mjs +135 -0
  68. package/scripts/mutation-performance-measure.mjs +1794 -0
  69. package/scripts/mutation-performance.schema.json +103 -0
  70. package/typescript/create-only/.github/workflows/review-evidence.yml +18 -10
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Measurement-only Stryker reporter for CodySwannGT/lisa#3304.
3
+ *
4
+ * It deliberately observes lifecycle boundaries only. In particular it does
5
+ * not implement `onMutantTested`, so enabling it cannot add I/O to Stryker's
6
+ * per-mutant hot path. Evidence is retained in memory and committed atomically
7
+ * once, during wrap-up.
8
+ * @module scripts/lib/mutation-performance-reporter
9
+ */
10
+ import { mkdir, rename, writeFile } from "node:fs/promises";
11
+ import * as path from "node:path";
12
+
13
+ import {
14
+ commonTokens,
15
+ declareClassPlugin,
16
+ PluginKind,
17
+ tokens,
18
+ } from "@stryker-mutator/api/plugin";
19
+
20
+ const defaultNow = () => new Date().toISOString();
21
+
22
+ const testLocation = test => {
23
+ const position = test.startPosition ?? test.location ?? {};
24
+ const line = position.line ?? position.start?.line ?? 0;
25
+ const column = position.column ?? position.start?.column ?? 0;
26
+ return `${line}:${column}`;
27
+ };
28
+
29
+ const canonicalTest = test => ({
30
+ file: String(test.fileName ?? test.file ?? ""),
31
+ name: String(test.name ?? test.description ?? test.id ?? ""),
32
+ location: testLocation(test),
33
+ });
34
+
35
+ /** Lifecycle-only reporter consumed through Stryker's reporter plugin API. */
36
+ export class LisaMeasurementReporter {
37
+ static inject = tokens(commonTokens.options);
38
+
39
+ #outputFile;
40
+ #now;
41
+ #startedAt;
42
+ #dryRun = null;
43
+ #planCount = null;
44
+ #planAt = null;
45
+ #reportReadyAt = null;
46
+ #written = false;
47
+
48
+ /**
49
+ * @param {object} options Stryker options or a focused-test configuration
50
+ */
51
+ constructor(options = {}) {
52
+ this.#outputFile =
53
+ options.outputFile ??
54
+ process.env.LISA_MUTATION_PHASE_EVENTS ??
55
+ path.resolve(
56
+ path.dirname(
57
+ options.jsonReporter?.fileName ?? "reports/stryker-report.json"
58
+ ),
59
+ "phase-events.json"
60
+ );
61
+ this.#now = options.now ?? defaultNow;
62
+ this.#startedAt = this.#now();
63
+ }
64
+
65
+ /** Retain exact dry-run timing and test identity in memory. */
66
+ onDryRunCompleted(event) {
67
+ const result = event.result ?? event;
68
+ const timing = event.timing ?? result.timing ?? { net: 0, overhead: 0 };
69
+ this.#dryRun = {
70
+ at: this.#now(),
71
+ net_ms: Number(timing.net),
72
+ overhead_ms: Number(timing.overhead),
73
+ tests: (result.tests ?? event.tests ?? []).map(canonicalTest),
74
+ };
75
+ }
76
+
77
+ /** Retain the planned mutant count, without per-mutant callbacks. */
78
+ onMutationTestingPlanReady(event) {
79
+ this.#planCount = (event.mutantPlans ?? event.mutants ?? []).length;
80
+ this.#planAt = this.#now();
81
+ }
82
+
83
+ /** Compatibility with the focused fake lifecycle and final-report timing. */
84
+ onMutationTestReportReady(report) {
85
+ if (this.#planCount === null) {
86
+ this.#planCount =
87
+ report.mutants?.length ??
88
+ Object.values(report.files ?? {}).reduce(
89
+ (count, file) => count + (file.mutants?.length ?? 0),
90
+ 0
91
+ );
92
+ }
93
+ if (this.#planAt === null) this.#planAt = this.#now();
94
+ this.#reportReadyAt = this.#now();
95
+ }
96
+
97
+ /** Atomically write the one lifecycle artifact. */
98
+ async wrapUp() {
99
+ if (this.#written) {
100
+ throw new Error("measurement reporter evidence was already written");
101
+ }
102
+ if (!this.#dryRun || this.#planCount === null || !this.#reportReadyAt) {
103
+ throw new Error("measurement reporter lifecycle is incomplete");
104
+ }
105
+ this.#written = true;
106
+ const evidence = {
107
+ schema_version: "lisa.mutation-phase-events/v1",
108
+ started_at: this.#startedAt,
109
+ dry_run_at: this.#dryRun.at,
110
+ dry_run_ms: this.#dryRun.net_ms + this.#dryRun.overhead_ms,
111
+ dry_run_net_ms: this.#dryRun.net_ms,
112
+ dry_run_overhead_ms: this.#dryRun.overhead_ms,
113
+ tests: this.#dryRun.tests,
114
+ plan_count: this.#planCount,
115
+ plan_ready_at: this.#planAt,
116
+ report_ready_at: this.#reportReadyAt,
117
+ finished_at: this.#now(),
118
+ };
119
+ await mkdir(path.dirname(this.#outputFile), { recursive: true });
120
+ const temporary = `${this.#outputFile}.tmp`;
121
+ await writeFile(temporary, `${JSON.stringify(evidence, null, 2)}\n`, {
122
+ flag: "wx",
123
+ mode: 0o600,
124
+ });
125
+ await rename(temporary, this.#outputFile);
126
+ }
127
+ }
128
+
129
+ export const strykerPlugins = [
130
+ declareClassPlugin(
131
+ PluginKind.Reporter,
132
+ "lisa-measurement",
133
+ LisaMeasurementReporter
134
+ ),
135
+ ];