@codyswann/lisa 4.28.5 → 4.29.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 (188) hide show
  1. package/all/copy-overwrite/scripts/lisa-gates.mjs +2 -1
  2. package/all/copy-overwrite/scripts/lisa-hooks/sonar-secrets.sh +3 -2
  3. package/cdk/create-only/vitest.config.local.ts +5 -1
  4. package/cdk/package-lisa/package.lisa.json +14 -7
  5. package/dist/cli/lisa-test-run-bootstrap.d.ts +3 -0
  6. package/dist/cli/lisa-test-run-bootstrap.d.ts.map +1 -0
  7. package/dist/cli/lisa-test-run-bootstrap.js +201 -0
  8. package/dist/cli/lisa-test-run-bootstrap.js.map +1 -0
  9. package/dist/cli/lisa-test-run-ipc.d.ts +42 -0
  10. package/dist/cli/lisa-test-run-ipc.d.ts.map +1 -0
  11. package/dist/cli/lisa-test-run-ipc.js +200 -0
  12. package/dist/cli/lisa-test-run-ipc.js.map +1 -0
  13. package/dist/cli/lisa-test-run-process-group.d.ts +30 -0
  14. package/dist/cli/lisa-test-run-process-group.d.ts.map +1 -0
  15. package/dist/cli/lisa-test-run-process-group.js +123 -0
  16. package/dist/cli/lisa-test-run-process-group.js.map +1 -0
  17. package/dist/cli/lisa-test-run-reaper.d.ts +3 -0
  18. package/dist/cli/lisa-test-run-reaper.d.ts.map +1 -0
  19. package/dist/cli/lisa-test-run-reaper.js +195 -0
  20. package/dist/cli/lisa-test-run-reaper.js.map +1 -0
  21. package/dist/cli/lisa-test-run-runtime.d.ts +46 -0
  22. package/dist/cli/lisa-test-run-runtime.d.ts.map +1 -0
  23. package/dist/cli/lisa-test-run-runtime.js +123 -0
  24. package/dist/cli/lisa-test-run-runtime.js.map +1 -0
  25. package/dist/cli/lisa-test-run-supervisor.d.ts +13 -0
  26. package/dist/cli/lisa-test-run-supervisor.d.ts.map +1 -0
  27. package/dist/cli/lisa-test-run-supervisor.js +268 -0
  28. package/dist/cli/lisa-test-run-supervisor.js.map +1 -0
  29. package/dist/cli/lisa-test-run.d.ts +3 -0
  30. package/dist/cli/lisa-test-run.d.ts.map +1 -0
  31. package/dist/cli/lisa-test-run.js +66 -0
  32. package/dist/cli/lisa-test-run.js.map +1 -0
  33. package/dist/configs/vitest/base.d.ts.map +1 -1
  34. package/dist/configs/vitest/base.js +5 -2
  35. package/dist/configs/vitest/base.js.map +1 -1
  36. package/dist/configs/vitest/cdk.d.ts +4 -0
  37. package/dist/configs/vitest/cdk.d.ts.map +1 -1
  38. package/dist/configs/vitest/cdk.js +5 -0
  39. package/dist/configs/vitest/cdk.js.map +1 -1
  40. package/dist/configs/vitest/harper-fabric.d.ts.map +1 -1
  41. package/dist/configs/vitest/harper-fabric.js +1 -0
  42. package/dist/configs/vitest/harper-fabric.js.map +1 -1
  43. package/dist/configs/vitest/nestjs.d.ts.map +1 -1
  44. package/dist/configs/vitest/nestjs.js +1 -0
  45. package/dist/configs/vitest/nestjs.js.map +1 -1
  46. package/dist/configs/vitest/phaser.d.ts.map +1 -1
  47. package/dist/configs/vitest/phaser.js +1 -0
  48. package/dist/configs/vitest/phaser.js.map +1 -1
  49. package/dist/configs/vitest/scratch-authority.d.ts +25 -0
  50. package/dist/configs/vitest/scratch-authority.d.ts.map +1 -0
  51. package/dist/configs/vitest/scratch-authority.js +107 -0
  52. package/dist/configs/vitest/scratch-authority.js.map +1 -0
  53. package/dist/configs/vitest/scratch-bound-cleanup-programs.d.ts +5 -0
  54. package/dist/configs/vitest/scratch-bound-cleanup-programs.d.ts.map +1 -0
  55. package/dist/configs/vitest/scratch-bound-cleanup-programs.js +219 -0
  56. package/dist/configs/vitest/scratch-bound-cleanup-programs.js.map +1 -0
  57. package/dist/configs/vitest/scratch-bound-cleanup.d.ts +28 -0
  58. package/dist/configs/vitest/scratch-bound-cleanup.d.ts.map +1 -0
  59. package/dist/configs/vitest/scratch-bound-cleanup.js +155 -0
  60. package/dist/configs/vitest/scratch-bound-cleanup.js.map +1 -0
  61. package/dist/configs/vitest/scratch-bound-root-cleanup.d.ts +17 -0
  62. package/dist/configs/vitest/scratch-bound-root-cleanup.d.ts.map +1 -0
  63. package/dist/configs/vitest/scratch-bound-root-cleanup.js +149 -0
  64. package/dist/configs/vitest/scratch-bound-root-cleanup.js.map +1 -0
  65. package/dist/configs/vitest/scratch-global-setup.d.ts +17 -9
  66. package/dist/configs/vitest/scratch-global-setup.d.ts.map +1 -1
  67. package/dist/configs/vitest/scratch-global-setup.js +103 -35
  68. package/dist/configs/vitest/scratch-global-setup.js.map +1 -1
  69. package/dist/configs/vitest/scratch-leak-setup.d.ts +2 -0
  70. package/dist/configs/vitest/scratch-leak-setup.d.ts.map +1 -0
  71. package/dist/configs/vitest/scratch-leak-setup.js +108 -0
  72. package/dist/configs/vitest/scratch-leak-setup.js.map +1 -0
  73. package/dist/configs/vitest/scratch-namespace-authority.d.ts +80 -0
  74. package/dist/configs/vitest/scratch-namespace-authority.d.ts.map +1 -0
  75. package/dist/configs/vitest/scratch-namespace-authority.js +291 -0
  76. package/dist/configs/vitest/scratch-namespace-authority.js.map +1 -0
  77. package/dist/configs/vitest/scratch-owner.d.ts +131 -0
  78. package/dist/configs/vitest/scratch-owner.d.ts.map +1 -0
  79. package/dist/configs/vitest/scratch-owner.js +297 -0
  80. package/dist/configs/vitest/scratch-owner.js.map +1 -0
  81. package/dist/configs/vitest/scratch-route-profile.d.ts +36 -0
  82. package/dist/configs/vitest/scratch-route-profile.d.ts.map +1 -0
  83. package/dist/configs/vitest/scratch-route-profile.js +217 -0
  84. package/dist/configs/vitest/scratch-route-profile.js.map +1 -0
  85. package/dist/configs/vitest/scratch-run-root-compatibility.d.ts +33 -0
  86. package/dist/configs/vitest/scratch-run-root-compatibility.d.ts.map +1 -0
  87. package/dist/configs/vitest/scratch-run-root-compatibility.js +137 -0
  88. package/dist/configs/vitest/scratch-run-root-compatibility.js.map +1 -0
  89. package/dist/configs/vitest/scratch-run-root-intent.d.ts +66 -0
  90. package/dist/configs/vitest/scratch-run-root-intent.d.ts.map +1 -0
  91. package/dist/configs/vitest/scratch-run-root-intent.js +183 -0
  92. package/dist/configs/vitest/scratch-run-root-intent.js.map +1 -0
  93. package/dist/configs/vitest/scratch-setup.d.ts.map +1 -1
  94. package/dist/configs/vitest/scratch-setup.js +45 -15
  95. package/dist/configs/vitest/scratch-setup.js.map +1 -1
  96. package/dist/configs/vitest/scratch-supervision-intent.d.ts +8 -0
  97. package/dist/configs/vitest/scratch-supervision-intent.d.ts.map +1 -0
  98. package/dist/configs/vitest/scratch-supervision-intent.js +125 -0
  99. package/dist/configs/vitest/scratch-supervision-intent.js.map +1 -0
  100. package/dist/configs/vitest/scratch-supervision-protocol.d.ts +12 -0
  101. package/dist/configs/vitest/scratch-supervision-protocol.d.ts.map +1 -0
  102. package/dist/configs/vitest/scratch-supervision-protocol.js +230 -0
  103. package/dist/configs/vitest/scratch-supervision-protocol.js.map +1 -0
  104. package/dist/configs/vitest/scratch-supervision.d.ts +64 -0
  105. package/dist/configs/vitest/scratch-supervision.d.ts.map +1 -0
  106. package/dist/configs/vitest/scratch-supervision.js +209 -0
  107. package/dist/configs/vitest/scratch-supervision.js.map +1 -0
  108. package/dist/configs/vitest/scratch-sweep.d.ts +66 -0
  109. package/dist/configs/vitest/scratch-sweep.d.ts.map +1 -0
  110. package/dist/configs/vitest/scratch-sweep.js +82 -0
  111. package/dist/configs/vitest/scratch-sweep.js.map +1 -0
  112. package/dist/configs/vitest/scratch.d.ts +14 -187
  113. package/dist/configs/vitest/scratch.d.ts.map +1 -1
  114. package/dist/configs/vitest/scratch.js +18 -285
  115. package/dist/configs/vitest/scratch.js.map +1 -1
  116. package/dist/configs/vitest/typescript.d.ts.map +1 -1
  117. package/dist/configs/vitest/typescript.js +1 -0
  118. package/dist/configs/vitest/typescript.js.map +1 -1
  119. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  120. package/dist/core/lisa-owned-hash-ledger.js +4 -0
  121. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  122. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  123. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  124. package/dist/core/upstream-evidence-manifest.js +59 -13
  125. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  126. package/expo/package-lisa/package.lisa.json +14 -14
  127. package/harper-fabric/package-lisa/package.lisa.json +8 -3
  128. package/nestjs/create-only/vitest.config.local.ts +5 -1
  129. package/nestjs/package-lisa/package.lisa.json +14 -8
  130. package/npm-package/package-lisa/package.lisa.json +8 -0
  131. package/package.json +17 -13
  132. package/phaser/package-lisa/package.lisa.json +9 -3
  133. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  134. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  135. package/plugins/lisa/hooks/sonar-secrets.sh +3 -2
  136. package/plugins/lisa-agy/plugin.json +1 -1
  137. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  138. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  139. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  140. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  141. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  142. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  143. package/plugins/lisa-copilot/hooks/sonar-secrets.sh +3 -2
  144. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  145. package/plugins/lisa-cursor/hooks/sonar-secrets.sh +3 -2
  146. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  147. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  148. package/plugins/lisa-expo-agy/plugin.json +1 -1
  149. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  150. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  151. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  152. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  153. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  154. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  155. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  156. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  157. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  158. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  159. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  160. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  161. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  162. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  163. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  164. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  165. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  166. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  167. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  168. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  169. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  170. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  171. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  172. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  173. package/plugins/lisa-rails-agy/plugin.json +1 -1
  174. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  175. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  176. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  177. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  178. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  179. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  180. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  181. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  182. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  183. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  184. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  185. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  186. package/plugins/src/base/hooks/sonar-secrets.sh +3 -2
  187. package/typescript/create-only/vitest.config.local.ts +5 -1
  188. package/typescript/package-lisa/package.lisa.json +14 -8
@@ -0,0 +1,137 @@
1
+ /** Compatibility allocation/adoption atop the owned run-root lifecycle. */
2
+ import { randomBytes } from "node:crypto";
3
+ import * as fs from "node:fs";
4
+ import * as path from "node:path";
5
+ import { createScratchNamespaceAuthority, parseRunRootName, removeAuthorizedScratchRoot, runRootName, } from "./scratch-authority.js";
6
+ import { registeredScratchPrefixes, scratchSuiteLabel, } from "./scratch-route-profile.js";
7
+ import { createScratchOwnerRecord, readScratchOwnerRecord, scratchPathIdentity, writeScratchOwnerRecord, } from "./scratch-owner.js";
8
+ import { sweepScratchNamespace } from "./scratch-sweep.js";
9
+ /**
10
+ * Create the immutable owner marker for a newly materialized root.
11
+ * @param authority - Pinned namespace authority
12
+ * @param root - Newly materialized direct root
13
+ * @param now - Creation epoch milliseconds
14
+ * @param configuration - Validated owner attribution
15
+ * @returns Immutable owner marker
16
+ */
17
+ function createOwnerForNewRoot(authority, root, now, configuration) {
18
+ return createScratchOwnerRecord({
19
+ authority,
20
+ root,
21
+ suiteLabel: configuration.suiteLabel,
22
+ registeredPrefixes: configuration.registeredPrefixes,
23
+ now: new Date(now),
24
+ });
25
+ }
26
+ /**
27
+ * Create a legacy-compatible owned root with transactional marker rollback.
28
+ * @param options - Clock and marker-writer seams
29
+ * @param options.now - Epoch milliseconds recorded in the basename
30
+ * @param options.writeOwnerRecord - Injectable transactional marker writer
31
+ * @returns Absolute run-root path
32
+ */
33
+ export const createRunRoot = ({ now = Date.now(), writeOwnerRecord = writeScratchOwnerRecord, } = {}) => {
34
+ if (!Number.isSafeInteger(now) || now < 0) {
35
+ throw new Error("Scratch run-root timestamp must be a non-negative integer");
36
+ }
37
+ const configuration = {
38
+ suiteLabel: scratchSuiteLabel(),
39
+ registeredPrefixes: registeredScratchPrefixes(),
40
+ };
41
+ const authority = createScratchNamespaceAuthority();
42
+ const root = path.join(authority.namespace.canonicalPath, runRootName(process.pid, now, randomBytes(4).toString("hex")));
43
+ const expectedIdentity = (() => {
44
+ fs.mkdirSync(root, { mode: 0o700 });
45
+ return scratchPathIdentity(root);
46
+ })();
47
+ try {
48
+ const owner = createOwnerForNewRoot(authority, root, now, configuration);
49
+ writeOwnerRecord(root, owner);
50
+ }
51
+ catch (error) {
52
+ try {
53
+ removeAuthorizedScratchRoot({
54
+ authority,
55
+ basename: path.basename(root),
56
+ expectedIdentity,
57
+ });
58
+ }
59
+ catch (cleanupError) {
60
+ throw new AggregateError([error, cleanupError], "Scratch root allocation failed and rollback could not reclaim it");
61
+ }
62
+ throw error;
63
+ }
64
+ return root;
65
+ };
66
+ /**
67
+ * Reclaim residue, then allocate a durable owned-root handle.
68
+ * @returns Owned current-process root
69
+ */
70
+ export function reclaimAndCreateOwnedRunRoot() {
71
+ const authority = createScratchNamespaceAuthority();
72
+ const root = (() => {
73
+ sweepScratchNamespace();
74
+ return createRunRoot();
75
+ })();
76
+ return {
77
+ path: root,
78
+ basename: path.basename(root),
79
+ authority,
80
+ owner: readScratchOwnerRecord(root),
81
+ };
82
+ }
83
+ /**
84
+ * Read an existing marker or atomically upgrade a legacy current root.
85
+ * @param authority - Pinned namespace authority
86
+ * @param root - Existing current-process root
87
+ * @param startedAt - Timestamp encoded in the recognized basename
88
+ * @returns Existing or newly written marker
89
+ */
90
+ function readOrCreateAdoptedOwner(authority, root, startedAt) {
91
+ try {
92
+ return readScratchOwnerRecord(root);
93
+ }
94
+ catch (error) {
95
+ if (error.code !== "ENOENT")
96
+ throw error;
97
+ const owner = createScratchOwnerRecord({
98
+ authority,
99
+ root,
100
+ suiteLabel: scratchSuiteLabel(),
101
+ registeredPrefixes: registeredScratchPrefixes(),
102
+ now: new Date(startedAt),
103
+ });
104
+ writeScratchOwnerRecord(root, owner);
105
+ return owner;
106
+ }
107
+ }
108
+ /**
109
+ * Upgrade a source/dist-compatible path memo created by an older setup copy.
110
+ * @param root - Existing memoized run-root path
111
+ * @returns Durable handle for the existing root
112
+ */
113
+ export function adoptOwnedScratchRunRoot(root) {
114
+ const authority = createScratchNamespaceAuthority();
115
+ const canonicalRoot = fs.realpathSync(root);
116
+ if (path.dirname(canonicalRoot) !== authority.namespace.canonicalPath ||
117
+ path.basename(root) !== path.basename(canonicalRoot)) {
118
+ throw new Error("Memoized scratch root is outside canonical authority");
119
+ }
120
+ const parsed = parseRunRootName(path.basename(root));
121
+ if (parsed?.pid !== process.pid) {
122
+ throw new Error("Memoized scratch root is not owned by this process");
123
+ }
124
+ const owner = readOrCreateAdoptedOwner(authority, root, parsed.startedAt);
125
+ return {
126
+ path: root,
127
+ basename: path.basename(root),
128
+ authority,
129
+ owner,
130
+ };
131
+ }
132
+ /**
133
+ * Reclaim residue, then return one current-process root path.
134
+ * @returns Newly allocated root path
135
+ */
136
+ export const reclaimAndCreateRunRoot = () => reclaimAndCreateOwnedRunRoot().path;
137
+ //# sourceMappingURL=scratch-run-root-compatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scratch-run-root-compatibility.js","sourceRoot":"","sources":["../../../src/configs/vitest/scratch-run-root-compatibility.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,+BAA+B,EAC/B,gBAAgB,EAChB,2BAA2B,EAC3B,WAAW,GAEZ,MAAM,wBAAwB,CAAC;AACh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ACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAW,EAAE,CAClD,4BAA4B,EAAE,CAAC,IAAI,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { type ScratchNamespaceAuthority } from "./scratch-authority.js";
2
+ import { writeScratchOwnerRecord, type ScratchOwnerRecordV1, type ScratchPathIdentity } from "./scratch-owner.js";
3
+ /** Durable handle for one run root owned by this process. */
4
+ export interface OwnedScratchRunRoot {
5
+ readonly path: string;
6
+ readonly basename: string;
7
+ readonly authority: ScratchNamespaceAuthority;
8
+ readonly owner: ScratchOwnerRecordV1;
9
+ }
10
+ /** Precommitted immutable intent for one exact direct run root. */
11
+ export interface ScratchRunRootIntentV1 {
12
+ readonly schema: 1;
13
+ readonly rootPath: string;
14
+ readonly basename: string;
15
+ readonly authority: ScratchNamespaceAuthority;
16
+ readonly pid: number;
17
+ readonly processBirthFingerprint: string;
18
+ readonly createdAt: string;
19
+ readonly token: string;
20
+ readonly suiteLabel: string;
21
+ readonly registeredPrefixes: readonly string[];
22
+ }
23
+ /** Deterministic seams for precommitting process-birth authority. */
24
+ interface PrepareRunRootOptions {
25
+ readonly platform?: NodeJS.Platform;
26
+ readonly processBirthFingerprint?: (pid: number) => string | undefined;
27
+ readonly suiteLabel?: string;
28
+ readonly registeredPrefixes?: readonly string[];
29
+ }
30
+ /** Deterministic seams for transactional root materialization. */
31
+ interface MaterializeRunRootOptions {
32
+ readonly writeOwnerRecord?: typeof writeScratchOwnerRecord;
33
+ }
34
+ /**
35
+ * Prepare an exact root identity without creating that root.
36
+ * @param options - Deterministic authority seams
37
+ * @returns Immutable precommitted root intent
38
+ */
39
+ export declare function prepareOwnedScratchRunRoot(options?: PrepareRunRootOptions): ScratchRunRootIntentV1;
40
+ /**
41
+ * Materialize one armed root and persist its immutable marker.
42
+ * @param intent - Precommitted root intent
43
+ * @param options - Transactional marker-writer seams
44
+ * @returns Durable owned-root handle
45
+ */
46
+ export declare function materializeOwnedScratchRunRoot(intent: ScratchRunRootIntentV1, options?: MaterializeRunRootOptions): OwnedScratchRunRoot;
47
+ /**
48
+ * Validate an opened marker against the complete armed intent.
49
+ * @param intent - Precommitted root facts
50
+ * @param owner - Persisted owner marker
51
+ * @param root - Currently opened root identity
52
+ */
53
+ declare function assertIntentOwner(intent: ScratchRunRootIntentV1, owner: ScratchOwnerRecordV1, root: ScratchPathIdentity): void;
54
+ /**
55
+ * Open one exact materialized root without following a replacement symlink.
56
+ * @param intent - Armed root intent
57
+ * @returns Owned handle, or undefined when not yet materialized
58
+ */
59
+ export declare function openOwnedScratchRunRoot(intent: ScratchRunRootIntentV1): OwnedScratchRunRoot | undefined;
60
+ /**
61
+ * Remove a run root using only the authority captured when it was made.
62
+ * @param owned - Durable handle or precommitted intent
63
+ */
64
+ export declare function removeOwnedScratchRunRoot(owned: OwnedScratchRunRoot | ScratchRunRootIntentV1): void;
65
+ export { assertIntentOwner };
66
+ //# sourceMappingURL=scratch-run-root-intent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scratch-run-root-intent.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/scratch-run-root-intent.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAKL,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAE5B,6DAA6D;AAC7D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;CACtC;AAED,mEAAmE;AACnE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACnB,QAAQ,CAAC,QAAQ,EA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AS,CAiBjC;AAiCD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,mBAAmB,GAAG,sBAAsB,GAClD,IAAI,CAuBN;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,183 @@
1
+ /** Pre-root intent, materialization, and reopening for one owned scratch root. */
2
+ import { randomBytes } from "node:crypto";
3
+ import * as fs from "node:fs";
4
+ import * as path from "node:path";
5
+ import { SCRATCH_QUARANTINE_PREFIX, createScratchNamespaceAuthority, readBoundedScratchNamespace, removeAuthorizedScratchRoot, runRootName, } from "./scratch-authority.js";
6
+ import { registeredScratchPrefixes, scratchSuiteLabel, } from "./scratch-route-profile.js";
7
+ import { createScratchOwnerRecord, processBirthFingerprint, readScratchOwnerRecord, scratchPathIdentity, writeScratchOwnerRecord, } from "./scratch-owner.js";
8
+ /**
9
+ * Prepare an exact root identity without creating that root.
10
+ * @param options - Deterministic authority seams
11
+ * @returns Immutable precommitted root intent
12
+ */
13
+ export function prepareOwnedScratchRunRoot(options = {}) {
14
+ const suiteLabel = options.suiteLabel ?? scratchSuiteLabel();
15
+ const prefixes = options.registeredPrefixes ?? registeredScratchPrefixes();
16
+ const authority = createScratchNamespaceAuthority();
17
+ const now = Date.now();
18
+ const basename = runRootName(process.pid, now, randomBytes(4).toString("hex"));
19
+ const platform = options.platform ?? process.platform;
20
+ const birth = (options.processBirthFingerprint ?? processBirthFingerprint)(process.pid);
21
+ if (birth === undefined && (platform === "darwin" || platform === "linux")) {
22
+ throw new Error(`Scratch process-birth authority is unavailable on ${platform}`);
23
+ }
24
+ return Object.freeze({
25
+ schema: 1,
26
+ rootPath: path.join(authority.namespace.canonicalPath, basename),
27
+ basename,
28
+ authority,
29
+ pid: process.pid,
30
+ processBirthFingerprint: birth ?? `unsupported:${String(process.pid)}`,
31
+ createdAt: new Date(now).toISOString(),
32
+ token: randomBytes(16).toString("hex"),
33
+ suiteLabel,
34
+ registeredPrefixes: prefixes,
35
+ });
36
+ }
37
+ /**
38
+ * Materialize one armed root and persist its immutable marker.
39
+ * @param intent - Precommitted root intent
40
+ * @param options - Transactional marker-writer seams
41
+ * @returns Durable owned-root handle
42
+ */
43
+ export function materializeOwnedScratchRunRoot(intent, options = {}) {
44
+ if (intent.schema !== 1)
45
+ throw new Error("Invalid scratch root intent schema");
46
+ if (path.join(intent.authority.namespace.canonicalPath, intent.basename) !==
47
+ intent.rootPath) {
48
+ throw new Error("Scratch root intent path does not match its authority");
49
+ }
50
+ const expectedIdentity = (() => {
51
+ fs.mkdirSync(intent.rootPath, { mode: 0o700 });
52
+ return scratchPathIdentity(intent.rootPath);
53
+ })();
54
+ try {
55
+ const owner = createScratchOwnerRecord({
56
+ authority: intent.authority,
57
+ root: intent.rootPath,
58
+ pid: intent.pid,
59
+ processBirthFingerprint: intent.processBirthFingerprint,
60
+ suiteLabel: intent.suiteLabel,
61
+ registeredPrefixes: intent.registeredPrefixes,
62
+ token: intent.token,
63
+ now: new Date(intent.createdAt),
64
+ });
65
+ (options.writeOwnerRecord ?? writeScratchOwnerRecord)(intent.rootPath, owner);
66
+ return {
67
+ path: intent.rootPath,
68
+ basename: intent.basename,
69
+ authority: intent.authority,
70
+ owner,
71
+ };
72
+ }
73
+ catch (error) {
74
+ try {
75
+ removeAuthorizedScratchRoot({
76
+ authority: intent.authority,
77
+ basename: intent.basename,
78
+ expectedIdentity,
79
+ });
80
+ }
81
+ catch (cleanupError) {
82
+ throw new AggregateError([error, cleanupError], "Scratch root materialization failed and rollback could not reclaim it");
83
+ }
84
+ throw error;
85
+ }
86
+ }
87
+ /**
88
+ * Validate an opened marker against the complete armed intent.
89
+ * @param intent - Precommitted root facts
90
+ * @param owner - Persisted owner marker
91
+ * @param root - Currently opened root identity
92
+ */
93
+ function assertIntentOwner(intent, owner, root) {
94
+ if (owner.token !== intent.token ||
95
+ owner.pid !== intent.pid ||
96
+ owner.processBirthFingerprint !== intent.processBirthFingerprint ||
97
+ owner.namespace.dev !== intent.authority.namespace.dev ||
98
+ owner.namespace.ino !== intent.authority.namespace.ino ||
99
+ owner.root.dev !== root.dev ||
100
+ owner.root.ino !== root.ino) {
101
+ throw new Error("Scratch owner token or armed identity does not match intent");
102
+ }
103
+ }
104
+ /**
105
+ * Open one exact materialized root without following a replacement symlink.
106
+ * @param intent - Armed root intent
107
+ * @returns Owned handle, or undefined when not yet materialized
108
+ */
109
+ export function openOwnedScratchRunRoot(intent) {
110
+ // eslint-disable-next-line functional/no-let -- path-level ENOENT must be separated from marker-level ENOENT
111
+ let root;
112
+ try {
113
+ root = scratchPathIdentity(intent.rootPath);
114
+ }
115
+ catch (error) {
116
+ if (error.code === "ENOENT")
117
+ return undefined;
118
+ throw error;
119
+ }
120
+ const owner = readScratchOwnerRecord(intent.rootPath);
121
+ assertIntentOwner(intent, owner, root);
122
+ return {
123
+ path: intent.rootPath,
124
+ basename: intent.basename,
125
+ authority: intent.authority,
126
+ owner,
127
+ };
128
+ }
129
+ /**
130
+ * Find an interrupted quarantine bound to the intent token and root inode.
131
+ * @param intent - Precommitted root facts
132
+ * @returns Matching quarantine identity, or undefined
133
+ */
134
+ function interruptedQuarantine(intent) {
135
+ for (const basename of readBoundedScratchNamespace(intent.authority.namespace.canonicalPath)) {
136
+ if (!basename.startsWith(SCRATCH_QUARANTINE_PREFIX))
137
+ continue;
138
+ const candidate = path.join(intent.authority.namespace.canonicalPath, basename);
139
+ try {
140
+ const owner = readScratchOwnerRecord(candidate);
141
+ if (owner.token !== intent.token)
142
+ continue;
143
+ const identity = scratchPathIdentity(candidate);
144
+ assertIntentOwner(intent, owner, identity);
145
+ return { basename, identity };
146
+ }
147
+ catch {
148
+ // Foreign and malformed quarantines never authorize this intent.
149
+ }
150
+ }
151
+ return undefined;
152
+ }
153
+ /**
154
+ * Remove a run root using only the authority captured when it was made.
155
+ * @param owned - Durable handle or precommitted intent
156
+ */
157
+ export function removeOwnedScratchRunRoot(owned) {
158
+ if ("rootPath" in owned) {
159
+ const opened = openOwnedScratchRunRoot(owned);
160
+ if (opened !== undefined) {
161
+ removeOwnedScratchRunRoot(opened);
162
+ return;
163
+ }
164
+ const quarantine = interruptedQuarantine(owned);
165
+ if (quarantine === undefined)
166
+ return;
167
+ removeAuthorizedScratchRoot({
168
+ authority: owned.authority,
169
+ basename: quarantine.basename,
170
+ expectedToken: owned.token,
171
+ expectedIdentity: quarantine.identity,
172
+ });
173
+ return;
174
+ }
175
+ removeAuthorizedScratchRoot({
176
+ authority: owned.authority,
177
+ basename: owned.basename,
178
+ expectedToken: owned.owner.token,
179
+ expectedIdentity: owned.owner.root,
180
+ });
181
+ }
182
+ export { assertIntentOwner };
183
+ //# sourceMappingURL=scratch-run-root-intent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scratch-run-root-intent.js","sourceRoot":"","sources":["../../../src/configs/vitest/scratch-run-root-intent.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,2BAA2B,EAC3B,2BAA2B,EAC3B,WAAW,GAEZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,GAGxB,MAAM,oBAAoB,CAAC;AAqC5B;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,UAAiC,EAAE;IAEnC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,iBAAiB,EAAE,CAAC;IAC7D,MAAM,QAAQ,GAAG,OAAO,CAAC,kBAAkB,IAAI,yBAAyB,EAAE,CAAC;IAC3E,MAAM,SAAS,GAAG,+BAA+B,EAAE,CAAC;IACpD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AAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,UAAU,KAAK,SAAS;YAAE,OAAO;QACrC,2BAA2B,CAAC;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,aAAa,EAAE,KAAK,CAAC,KAAK;YAC1B,gBAAgB,EAAE,UAAU,CAAC,QAAQ;SACtC,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IACD,2BAA2B,CAAC;QAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK;QAChC,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;KACnC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scratch-setup.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/scratch-setup.ts"],"names":[],"mappings":"AAsEA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,QAAO,MAqDrC,CAAC"}
1
+ {"version":3,"file":"scratch-setup.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/scratch-setup.ts"],"names":[],"mappings":"AA0GA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,QAAO,MA0DrC,CAAC"}
@@ -29,9 +29,9 @@
29
29
  * @see {@link module:configs/vitest/scratch} for why the root is shaped this way
30
30
  * @module configs/vitest/scratch-setup
31
31
  */
32
- import * as fs from "node:fs";
33
32
  import { env } from "node:process";
34
- import { SCRATCH_ROOT_ENV, reclaimAndCreateRunRoot, removeScratchDir, scratchBaseDir, scratchNamespaceDir, } from "./scratch.js";
33
+ import { SCRATCH_SUPERVISION_LEASE_ENV, createSupervisedWorkerScope, parseScratchSupervisionLease, removeSupervisedWorkerScope, } from "./scratch-supervision.js";
34
+ import { assertScratchRouteProfile } from "./scratch-route-profile.js";
35
35
  /**
36
36
  * Signals a worker is reaped with, each of which skips `exit` by default.
37
37
  *
@@ -42,8 +42,9 @@ import { SCRATCH_ROOT_ENV, reclaimAndCreateRunRoot, removeScratchDir, scratchBas
42
42
  * handler that covered only the case that happened to be measured would leave
43
43
  * the other two producing exactly the residue this removes.
44
44
  *
45
- * `SIGKILL` is deliberately absent — it cannot be caught, which is precisely
46
- * why reclaim-on-start exists and is tested separately.
45
+ * `SIGKILL` is deliberately absent — it cannot be caught in this worker. The
46
+ * detached `lisa-test-run` reaper owns that arm; reclaim-on-start remains the
47
+ * compatibility fallback and is tested separately.
47
48
  */
48
49
  const REAPING_SIGNALS = [
49
50
  "SIGTERM",
@@ -52,6 +53,32 @@ const REAPING_SIGNALS = [
52
53
  ];
53
54
  /** Key under which the per-process run root is memoised. */
54
55
  const RUN_ROOT_KEY = "__lisaScratchRunRoot__";
56
+ /** Key holding the authority/token handle while preserving the path memo ABI. */
57
+ const RUN_ROOT_HANDLE_KEY = "__lisaScratchWorkerScopeV1__";
58
+ /**
59
+ * Tear down this worker's scope without letting the attempt change the outcome.
60
+ *
61
+ * `removeSupervisedWorkerScope` validates the suite root OUTSIDE its own
62
+ * try/catch, so a suite root that has gone missing throws straight out of it.
63
+ * Unguarded, that throw lands in a `process.on("exit")` listener -- where node
64
+ * turns it into an uncaught exception and rewrites the exit code, so a green
65
+ * run reports as a failed one -- or in a reaping-signal listener, BEFORE the
66
+ * re-raise below, so the worker never dies of the signal the pool sent and the
67
+ * pool sees the wrong status. Cleanup is best-effort by construction: it must
68
+ * never be the thing that decides how this process ends. The failure is still
69
+ * reported, because a silent one is how the leak this file exists to close
70
+ * came back the first time.
71
+ * @param worker - This worker's supervised scope
72
+ * @param lease - The suite lease the scope was created under
73
+ */
74
+ const teardownWorkerScope = (worker, lease) => {
75
+ try {
76
+ removeSupervisedWorkerScope(worker, lease);
77
+ }
78
+ catch (error) {
79
+ process.stderr.write(`lisa scratch worker teardown failed: ${error instanceof Error ? error.message : String(error)}\n`);
80
+ }
81
+ };
55
82
  /**
56
83
  * Points this process's temp directory at a run root it owns, creating the root
57
84
  * on first call and reusing it afterwards.
@@ -65,24 +92,27 @@ const RUN_ROOT_KEY = "__lisaScratchRunRoot__";
65
92
  export const installScratchRoot = () => {
66
93
  const scope = globalThis;
67
94
  const existing = scope[RUN_ROOT_KEY];
68
- if (existing !== undefined && fs.existsSync(existing)) {
95
+ if (existing !== undefined && scope[RUN_ROOT_HANDLE_KEY] !== undefined) {
69
96
  return existing;
70
97
  }
71
- // Read before the redirection lands: `scratchNamespaceDir()` derives from
72
- // `os.tmpdir()`, so once TMPDIR moves, a later call in this process — or in a
73
- // child that inherits the environment — would otherwise compute a namespace
74
- // NESTED INSIDE the run root and sweep the wrong directory. Recording the
75
- // base makes the resolution idempotent under its own side effect.
76
- const base = scratchBaseDir();
77
- const root = reclaimAndCreateRunRoot(scratchNamespaceDir());
98
+ const rawLease = env[SCRATCH_SUPERVISION_LEASE_ENV];
99
+ if (rawLease === undefined || rawLease === "") {
100
+ throw new Error("Lisa Vitest scratch requires a supervised lease. Run the suite through `lisa-test-run --profile <profile> --adapter vitest -- vitest ...`.");
101
+ }
102
+ const lease = parseScratchSupervisionLease(rawLease);
103
+ const worker = (() => {
104
+ assertScratchRouteProfile(lease);
105
+ return createSupervisedWorkerScope(lease);
106
+ })();
107
+ const root = worker.path;
78
108
  scope[RUN_ROOT_KEY] = root;
79
- env[SCRATCH_ROOT_ENV] = base;
109
+ scope[RUN_ROOT_HANDLE_KEY] = worker;
80
110
  env["TMPDIR"] = root;
81
111
  env["TMP"] = root;
82
112
  env["TEMP"] = root;
83
113
  // Covers an ordinary exit, including one where tests failed.
84
114
  process.once("exit", () => {
85
- removeScratchDir(root);
115
+ teardownWorkerScope(worker, lease);
86
116
  });
87
117
  // And covers the exit this suite ACTUALLY takes, which is not an ordinary
88
118
  // one. Measured on vitest 4.1.9, `forks` pool, by recording every lifecycle
@@ -104,7 +134,7 @@ export const installScratchRoot = () => {
104
134
  // buys the cleanup, not a different lifecycle.
105
135
  for (const signal of REAPING_SIGNALS) {
106
136
  process.once(signal, () => {
107
- removeScratchDir(root);
137
+ teardownWorkerScope(worker, lease);
108
138
  process.removeAllListeners(signal);
109
139
  process.kill(process.pid, signal);
110
140
  });
@@ -1 +1 @@
1
- {"version":3,"file":"scratch-setup.js","sourceRoot":"","sources":["../../../src/configs/vitest/scratch-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAA8B;IACjD,SAAS;IACT,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,4DAA4D;AAC5D,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAQ9C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAW,EAAE;IAC7C,MAAM,KAAK,GAAG,UAA2B,CAAC;IAC1C,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;IACrC,IAAI,QAAQ,KAAK,SAAS,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,0EAA0E;IAC1E,8EAA8E;IAC9E,4EAA4E;IAC5E,0EAA0E;IAC1E,kEAAkE;IAClE,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,uBAAuB,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAE5D,KAAK,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAC3B,GAAG,CAAC,g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unRootIntentV1 } from "./scratch.js";
2
+ /**
3
+ * Validate an inert scratch-root intent received over IPC.
4
+ * @param value - Candidate intent
5
+ * @returns Schema-validated intent
6
+ */
7
+ export declare function validateScratchRunRootIntent(value: unknown): ScratchRunRootIntentV1;
8
+ //# sourceMappingURL=scratch-supervision-intent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scratch-supervision-intent.d.ts","sourceRoot":"","sources":["../../../src/configs/vitest/scratch-supervision-intent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAwG3D;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,GACb,sBAAsB,CA6CxB"}