@overkill-dev/run 0.0.92 → 0.0.94

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 (272) hide show
  1. package/baselines/calibration-reference.js +1 -1
  2. package/baselines/calibration-reference.js.map +1 -1
  3. package/baselines/performance-presentation.js +1 -1
  4. package/baselines/performance-presentation.js.map +1 -1
  5. package/baselines/performance-schema.js +1 -1
  6. package/baselines/performance-schema.js.map +1 -1
  7. package/bench/calibration-evidence.js +1 -1
  8. package/bench/calibration-evidence.js.map +1 -1
  9. package/config/config.d.ts +3 -1
  10. package/config/config.d.ts.map +1 -1
  11. package/config/config.js +10 -11
  12. package/config/config.js.map +1 -1
  13. package/config/defaults.js +4 -0
  14. package/config/defaults.js.map +1 -1
  15. package/config/history-policy.d.ts +15 -0
  16. package/config/history-policy.d.ts.map +1 -0
  17. package/config/history-policy.js +26 -0
  18. package/config/history-policy.js.map +1 -0
  19. package/config/normalized-microtest-schema.js +1 -0
  20. package/config/normalized-microtest-schema.js.map +1 -1
  21. package/config/profile-normalization.js +4 -1
  22. package/config/profile-normalization.js.map +1 -1
  23. package/config/property-corpus.js +21 -0
  24. package/config/property-corpus.js.map +1 -0
  25. package/config/schema.d.ts +76 -0
  26. package/config/schema.d.ts.map +1 -1
  27. package/config/schema.js +8 -0
  28. package/config/schema.js.map +1 -1
  29. package/config/snapshot.js +6 -0
  30. package/config/snapshot.js.map +1 -1
  31. package/config/types.d.ts +24 -0
  32. package/config/types.d.ts.map +1 -1
  33. package/config/validation.js +4 -0
  34. package/config/validation.js.map +1 -1
  35. package/package.json +13 -3
  36. package/packages/run/command-line.entry-point.d.ts +1 -1
  37. package/packages/run/command-line.entry-point.d.ts.map +1 -1
  38. package/packages/run/command-line.entry-point.js +5 -2
  39. package/packages/run/command-line.entry-point.js.map +1 -1
  40. package/packages/run/config.entry-point.d.ts +1 -0
  41. package/packages/run/config.entry-point.d.ts.map +1 -1
  42. package/packages/run/run.entry-point.d.ts +5 -1
  43. package/packages/run/run.entry-point.d.ts.map +1 -1
  44. package/packages/run/run.entry-point.js +2 -1
  45. package/packages/run/run.entry-point.js.map +1 -1
  46. package/readme.md +120 -1
  47. package/reporters/failure-summary.js +29 -0
  48. package/reporters/failure-summary.js.map +1 -1
  49. package/reporters/human-reporter-rendering.js +5 -1
  50. package/reporters/human-reporter-rendering.js.map +1 -1
  51. package/run/assertion-result-schema.js +1 -1
  52. package/run/assertion-result-schema.js.map +1 -1
  53. package/run/attachment-record.js +13 -12
  54. package/run/attachment-record.js.map +1 -1
  55. package/run/attachment-run.js +18 -7
  56. package/run/attachment-run.js.map +1 -1
  57. package/run/benchmark-result-schema.js +1 -1
  58. package/run/benchmark-result-schema.js.map +1 -1
  59. package/run/collected-run-execution.js +4 -26
  60. package/run/collected-run-execution.js.map +1 -1
  61. package/run/collected-run-invocation.js +39 -0
  62. package/run/collected-run-invocation.js.map +1 -0
  63. package/run/collected-run-plan-schema.js +1 -1
  64. package/run/collected-run-plan-schema.js.map +1 -1
  65. package/run/collected-run.js +4 -3
  66. package/run/collected-run.js.map +1 -1
  67. package/run/command-line-command-namespace.d.ts +2 -0
  68. package/run/command-line-command-namespace.d.ts.map +1 -1
  69. package/run/command-line-command-namespace.js +35 -0
  70. package/run/command-line-command-namespace.js.map +1 -1
  71. package/run/command-line-command.d.ts +5 -0
  72. package/run/command-line-command.d.ts.map +1 -1
  73. package/run/command-line-config.js +2 -0
  74. package/run/command-line-config.js.map +1 -1
  75. package/run/command-line-execution.js +5 -1
  76. package/run/command-line-execution.js.map +1 -1
  77. package/run/command-line-runner.d.ts +2 -1
  78. package/run/command-line-runner.d.ts.map +1 -1
  79. package/run/command-line-runner.js +2 -1
  80. package/run/command-line-runner.js.map +1 -1
  81. package/run/compact-history-schema.d.ts +20 -0
  82. package/run/compact-history-schema.d.ts.map +1 -0
  83. package/run/compact-history-schema.js +32 -0
  84. package/run/compact-history-schema.js.map +1 -0
  85. package/run/compact-history.js +100 -0
  86. package/run/compact-history.js.map +1 -0
  87. package/run/coverage-run-record.js +2 -9
  88. package/run/coverage-run-record.js.map +1 -1
  89. package/run/duration-history-schema.js +3 -1
  90. package/run/duration-history-schema.js.map +1 -1
  91. package/run/duration-history-storage.js +170 -0
  92. package/run/duration-history-storage.js.map +1 -0
  93. package/run/duration-history-types.js +2 -0
  94. package/run/duration-history-types.js.map +1 -0
  95. package/run/duration-history.js +24 -92
  96. package/run/duration-history.js.map +1 -1
  97. package/run/execution-session-collected.js +1 -1
  98. package/run/execution-session-collected.js.map +1 -1
  99. package/run/execution-session-supervised.js +1 -1
  100. package/run/execution-session-supervised.js.map +1 -1
  101. package/run/freeze-run-policy.js +1 -0
  102. package/run/freeze-run-policy.js.map +1 -1
  103. package/run/frozen-policy-validation.js +1 -0
  104. package/run/frozen-policy-validation.js.map +1 -1
  105. package/run/frozen-run-policy-schema.js +3 -0
  106. package/run/frozen-run-policy-schema.js.map +1 -1
  107. package/run/frozen-run-policy.d.ts.map +1 -1
  108. package/run/frozen-run-policy.js +1 -0
  109. package/run/frozen-run-policy.js.map +1 -1
  110. package/run/history-commands.d.ts +4 -0
  111. package/run/history-commands.d.ts.map +1 -0
  112. package/run/history-commands.js +76 -0
  113. package/run/history-commands.js.map +1 -0
  114. package/run/history-confirmation.js +33 -0
  115. package/run/history-confirmation.js.map +1 -0
  116. package/run/history-lock-acquisition.js +59 -0
  117. package/run/history-lock-acquisition.js.map +1 -0
  118. package/run/history-maintenance-budget.js +35 -0
  119. package/run/history-maintenance-budget.js.map +1 -0
  120. package/run/history-maintenance.js +21 -0
  121. package/run/history-maintenance.js.map +1 -0
  122. package/run/history-outcomes.js +78 -0
  123. package/run/history-outcomes.js.map +1 -0
  124. package/run/history-pruning.js +104 -0
  125. package/run/history-pruning.js.map +1 -0
  126. package/run/history-reader.js +32 -0
  127. package/run/history-reader.js.map +1 -0
  128. package/run/history-record.js +48 -0
  129. package/run/history-record.js.map +1 -0
  130. package/run/history-repair.js +158 -0
  131. package/run/history-repair.js.map +1 -0
  132. package/run/history-retention-metadata.js +54 -0
  133. package/run/history-retention-metadata.js.map +1 -0
  134. package/run/history-retention-records.js +85 -0
  135. package/run/history-retention-records.js.map +1 -0
  136. package/run/history-state-access.js +161 -0
  137. package/run/history-state-access.js.map +1 -0
  138. package/run/history-state-error.js +35 -0
  139. package/run/history-state-error.js.map +1 -0
  140. package/run/history-storage-types.d.ts +13 -0
  141. package/run/history-storage-types.d.ts.map +1 -0
  142. package/run/history-storage.js +55 -0
  143. package/run/history-storage.js.map +1 -0
  144. package/run/history-types.d.ts +40 -0
  145. package/run/history-types.d.ts.map +1 -0
  146. package/run/history.d.ts +3 -0
  147. package/run/history.d.ts.map +1 -0
  148. package/run/history.js +97 -0
  149. package/run/history.js.map +1 -0
  150. package/run/local-run-collection.js +31 -0
  151. package/run/local-run-collection.js.map +1 -0
  152. package/run/node-history-storage.js +107 -0
  153. package/run/node-history-storage.js.map +1 -0
  154. package/run/node-run-execution.js +6 -0
  155. package/run/node-run-execution.js.map +1 -1
  156. package/run/prepared-run.js +42 -0
  157. package/run/prepared-run.js.map +1 -0
  158. package/run/property-corpus-cache.js +85 -0
  159. package/run/property-corpus-cache.js.map +1 -0
  160. package/run/property-corpus-execution.js +69 -0
  161. package/run/property-corpus-execution.js.map +1 -0
  162. package/run/property-corpus-storage.js +86 -0
  163. package/run/property-corpus-storage.js.map +1 -0
  164. package/run/property-evidence-schema.js +48 -0
  165. package/run/property-evidence-schema.js.map +1 -0
  166. package/run/recorded-coverage-run.js +2 -12
  167. package/run/recorded-coverage-run.js.map +1 -1
  168. package/run/recorded-run.js +32 -0
  169. package/run/recorded-run.js.map +1 -0
  170. package/run/replay-command.js +5 -0
  171. package/run/replay-command.js.map +1 -0
  172. package/run/reporter-event-schema.js +4 -1
  173. package/run/reporter-event-schema.js.map +1 -1
  174. package/run/request-snapshot.js +1 -0
  175. package/run/request-snapshot.js.map +1 -1
  176. package/run/run-artifact-id-schema.js +1 -1
  177. package/run/run-artifact-id-schema.js.map +1 -1
  178. package/run/run-artifact-schema.d.ts.map +1 -1
  179. package/run/run-artifact-schema.js +3 -1
  180. package/run/run-artifact-schema.js.map +1 -1
  181. package/run/run-collected-resolution.js +3 -3
  182. package/run/run-collected-resolution.js.map +1 -1
  183. package/run/run-command-schema.js +8 -0
  184. package/run/run-command-schema.js.map +1 -1
  185. package/run/run-empty-shard.js.map +1 -1
  186. package/run/run-engine-primitives.d.ts.map +1 -1
  187. package/run/run-execution.js +26 -50
  188. package/run/run-execution.js.map +1 -1
  189. package/run/run-facts.js +54 -1
  190. package/run/run-facts.js.map +1 -1
  191. package/run/run-if-main.d.ts.map +1 -1
  192. package/run/run-if-main.js +5 -0
  193. package/run/run-if-main.js.map +1 -1
  194. package/run/run-in-process-execution.js.map +1 -1
  195. package/run/run-isolated-process.js +12 -3
  196. package/run/run-isolated-process.js.map +1 -1
  197. package/run/run-local-command.js +14 -33
  198. package/run/run-local-command.js.map +1 -1
  199. package/run/run-local-coverage.js +2 -1
  200. package/run/run-local-coverage.js.map +1 -1
  201. package/run/run-local-execution.js +3 -0
  202. package/run/run-local-execution.js.map +1 -1
  203. package/run/run-local-planning.js +5 -5
  204. package/run/run-local-planning.js.map +1 -1
  205. package/run/run-local-resolution.js +0 -4
  206. package/run/run-local-resolution.js.map +1 -1
  207. package/run/run-operations.d.ts.map +1 -1
  208. package/run/run-operations.js +1 -0
  209. package/run/run-operations.js.map +1 -1
  210. package/run/run-orchestrator-dependencies.d.ts +4 -2
  211. package/run/run-orchestrator-dependencies.d.ts.map +1 -1
  212. package/run/run-profile-facts.js +12 -0
  213. package/run/run-profile-facts.js.map +1 -1
  214. package/run/run-record-input.js +21 -0
  215. package/run/run-record-input.js.map +1 -1
  216. package/run/run-record-storage.js +15 -2
  217. package/run/run-record-storage.js.map +1 -1
  218. package/run/run-record.js +66 -19
  219. package/run/run-record.js.map +1 -1
  220. package/run/run-result-schema.d.ts +2 -0
  221. package/run/run-result-schema.d.ts.map +1 -1
  222. package/run/run-result-schema.js +11 -1
  223. package/run/run-result-schema.js.map +1 -1
  224. package/run/run-selection-filters.js +1 -1
  225. package/run/run-selection-filters.js.map +1 -1
  226. package/run/run-selection-schema.js +1 -1
  227. package/run/run-selection-schema.js.map +1 -1
  228. package/run/run-state-finalization.js +22 -0
  229. package/run/run-state-finalization.js.map +1 -0
  230. package/run/run-supervised-finalization.js +1 -1
  231. package/run/run-supervised-finalization.js.map +1 -1
  232. package/run/run-supervised-process.js +2 -1
  233. package/run/run-supervised-process.js.map +1 -1
  234. package/run/run-support.js +1 -19
  235. package/run/run-support.js.map +1 -1
  236. package/run/run-types.d.ts +14 -8
  237. package/run/run-types.d.ts.map +1 -1
  238. package/run/run-types.js.map +1 -1
  239. package/run/run-validation.js +3 -0
  240. package/run/run-validation.js.map +1 -1
  241. package/run/runner-result.js +10 -0
  242. package/run/runner-result.js.map +1 -0
  243. package/run/runtime-attachment-boundary.js +3 -3
  244. package/run/runtime-attachment-boundary.js.map +1 -1
  245. package/run/supervised-child-transport.js +19 -0
  246. package/run/supervised-child-transport.js.map +1 -1
  247. package/run/supervised-child.js +6 -2
  248. package/run/supervised-child.js.map +1 -1
  249. package/run/supervised-protocol-schema.js +3 -2
  250. package/run/supervised-protocol-schema.js.map +1 -1
  251. package/run/supervised-protocol.js +3 -0
  252. package/run/supervised-protocol.js.map +1 -1
  253. package/run/supervised-run-runtime.js +5 -0
  254. package/run/supervised-run-runtime.js.map +1 -1
  255. package/run/supervised-run-state.js +10 -1
  256. package/run/supervised-run-state.js.map +1 -1
  257. package/run/supervised-run.js +6 -20
  258. package/run/supervised-run.js.map +1 -1
  259. package/run/worker-pool-host-protocol-schema.js +1 -1
  260. package/run/worker-pool-host-protocol-schema.js.map +1 -1
  261. package/run/worker-pool-placement-planning.js.map +1 -1
  262. package/run/worker-pool-run.js +1 -1
  263. package/run/worker-pool-run.js.map +1 -1
  264. package/run/worker-pool-task-schema.js +1 -1
  265. package/run/worker-pool-task-schema.js.map +1 -1
  266. package/software-bill-of-materials.cyclonedx.json +26 -9
  267. package/engine/identity-schema.js +0 -38
  268. package/engine/identity-schema.js.map +0 -1
  269. package/run/attachment-eligibility.js +0 -37
  270. package/run/attachment-eligibility.js.map +0 -1
  271. package/run/duration-history.d.ts +0 -6
  272. package/run/duration-history.d.ts.map +0 -1
@@ -0,0 +1,76 @@
1
+ import { realpath } from 'node:fs/promises';
2
+ import { createCommandLineErrorResultFromUnknown } from "./command-line-command.js";
3
+ import { createHistory } from "./history.js";
4
+ import { confirmHistoryClear } from "./history-confirmation.js";
5
+ const operations = {
6
+ async list(history) {
7
+ const summaries = await history.list();
8
+ return {
9
+ fallbackDiagnostics: [],
10
+ stdoutLines: [
11
+ 'ID\tSTARTED\tPROFILE\tFAMILY\tSTATUS\tDURATION (us)\tREPLAY',
12
+ ...summaries.map(function summaryLine(value) {
13
+ return [
14
+ value.id,
15
+ value.startedAt,
16
+ value.profile,
17
+ value.testFamily,
18
+ value.status,
19
+ value.durationMicroseconds ?? '',
20
+ value.replay
21
+ ]
22
+ .join('\t');
23
+ })
24
+ ]
25
+ };
26
+ },
27
+ async prune(history, request) {
28
+ const result = await history.prune({ dryRun: request.dryRun });
29
+ const action = request.dryRun ? 'Would remove' : 'Removed';
30
+ return {
31
+ fallbackDiagnostics: result.diagnostics,
32
+ stdoutLines: [
33
+ ...result.paths.map(function removalLine(value) {
34
+ return `${action} ${value}`;
35
+ }),
36
+ `${action} ${result.removedSummaries} summaries, ${result.removedCases} cases, ` +
37
+ `${result.removedWorkEntries} work entries.`
38
+ ]
39
+ };
40
+ },
41
+ async compact(history) {
42
+ const result = await history.compact();
43
+ return {
44
+ stdoutLines: [`Compacted ${result.rebuiltRunCount} retained runs.`],
45
+ fallbackDiagnostics: result.diagnostics
46
+ };
47
+ },
48
+ async clear(history, request) {
49
+ if (!await confirmHistoryClear(request.yes)) {
50
+ return { stdoutLines: [], fallbackDiagnostics: [] };
51
+ }
52
+ const result = await history.clear({ confirmed: true });
53
+ return { stdoutLines: ['History cleared.'], fallbackDiagnostics: result.diagnostics };
54
+ }
55
+ };
56
+ async function executeHistoryCommand(loadConfig, verb, request) {
57
+ const config = await loadConfig(request);
58
+ const projectRoot = await realpath(request.cwd);
59
+ const history = createHistory({ projectRoot, config });
60
+ const output = await operations[verb](history, request);
61
+ return { exitCode: 0, runResult: null, ...output };
62
+ }
63
+ export function createHistoryCommands(loadConfig) {
64
+ function command(verb) {
65
+ return async function runHistoryCommand(request) {
66
+ try {
67
+ return await executeHistoryCommand(loadConfig, verb, request);
68
+ }
69
+ catch (error) {
70
+ return createCommandLineErrorResultFromUnknown(error);
71
+ }
72
+ };
73
+ }
74
+ return { list: command('list'), prune: command('prune'), compact: command('compact'), clear: command('clear') };
75
+ }
76
+ //# sourceMappingURL=history-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-commands.js","sourceRoot":"","sources":["../../../../source/run/history-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EACH,uCAAuC,EAI1C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,UAAU,GAA8D;IAC1E,KAAK,CAAC,IAAI,CAAC,OAAO;QACd,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;QACvC,OAAO;YACH,mBAAmB,EAAE,EAAE;YACvB,WAAW,EAAE;gBACT,6DAA6D;gBAC7D,GAAG,SAAS,CAAC,GAAG,CAAC,SAAS,WAAW,CAAC,KAAK;oBACvC,OAAO;wBACH,KAAK,CAAC,EAAE;wBACR,KAAK,CAAC,SAAS;wBACf,KAAK,CAAC,OAAO;wBACb,KAAK,CAAC,UAAU;wBAChB,KAAK,CAAC,MAAM;wBACZ,KAAK,CAAC,oBAAoB,IAAI,EAAE;wB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from "./run-errors.js";
3
+ async function askClear() {
4
+ const terminal = createInterface({ input: process.stdin, output: process.stderr });
5
+ try {
6
+ const closed = new Promise(function (resolve) {
7
+ terminal.once('close', function () {
8
+ resolve('');
9
+ });
10
+ });
11
+ const answer = await Promise.race([terminal.question('Delete run history? [y/N] '), closed]);
12
+ return answer.toLowerCase() === 'y';
13
+ }
14
+ catch (error) {
15
+ if (error instanceof Error && Reflect.get(error, 'code') === 'ERR_USE_AFTER_CLOSE') {
16
+ return false;
17
+ }
18
+ throw error;
19
+ }
20
+ finally {
21
+ terminal.close();
22
+ }
23
+ }
24
+ export async function confirmHistoryClear(yes) {
25
+ if (yes) {
26
+ return true;
27
+ }
28
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
29
+ throw new RunResolutionError('History clear requires --yes outside a terminal.', undefined, 'unsupported-request');
30
+ }
31
+ return await askClear();
32
+ }
33
+ //# sourceMappingURL=history-confirmation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-confirmation.js","sourceRoot":"","sources":["../../../../source/run/history-confirmation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,KAAK,UAAU,QAAQ;IACnB,MAAM,QAAQ,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACnF,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,OAAO,CAAS,UAAU,OAAO;YAChD,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE;gBACnB,OAAO,CAAC,EAAE,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAE,QAAQ,CAAC,QAAQ,CAAC,4BAA4B,CAAC,EAAE,MAAM,CAAE,CAAC,CAAC;QAC/F,OAAO,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC;IACxC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,IAAI,KAAK,YAAY,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,qBAAqB,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,KAAK,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,QAAQ,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;AACL,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,GAAY;IAClD,IAAI,GAAG,EAAE,CAAC;QACN,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAChD,MAAM,IAAI,kBAAkB,CACxB,kDAAkD,EAClD,SAAS,EACT,qBAAqB,CACxB,CAAC;IACN,CAAC;IACD,OAAO,MAAM,QAAQ,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { lstat } from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { setTimeout as delay } from 'node:timers/promises';
4
+ import lockfile from 'proper-lockfile';
5
+ import { checkHistoryMaintenanceBudget, historyMaintenanceDeadline, recordHistoryMaintenanceDiagnostic, HistoryMaintenanceDeferredError } from "./history-maintenance-budget.js";
6
+ const retryIntervalMilliseconds = 25;
7
+ async function staleLock(options) {
8
+ try {
9
+ const status = await lstat(options.lockfilePath);
10
+ return Date.now() - status.mtimeMs > options.stale;
11
+ }
12
+ catch (error) {
13
+ if (error instanceof Error && Reflect.get(error, 'code') === 'ENOENT') {
14
+ return false;
15
+ }
16
+ throw error;
17
+ }
18
+ }
19
+ async function acquireProjectLock(directory, options) {
20
+ checkHistoryMaintenanceBudget();
21
+ const stale = await staleLock(options);
22
+ checkHistoryMaintenanceBudget();
23
+ const release = await lockfile.lock(directory, options);
24
+ if (stale) {
25
+ recordHistoryMaintenanceDiagnostic('Stale history lock was recovered.');
26
+ }
27
+ return release;
28
+ }
29
+ async function retryLock(directory, options, deadline, error) {
30
+ checkHistoryMaintenanceBudget();
31
+ const locked = await lockfile.check(directory, options);
32
+ if (!locked) {
33
+ throw error;
34
+ }
35
+ if (performance.now() >= deadline) {
36
+ if (Number.isFinite(historyMaintenanceDeadline())) {
37
+ throw new HistoryMaintenanceDeferredError();
38
+ }
39
+ throw error;
40
+ }
41
+ await delay(Math.min(retryIntervalMilliseconds, Math.max(0, deadline - performance.now())));
42
+ }
43
+ export async function acquireHistoryLock(directory, policy, onCompromised) {
44
+ const options = {
45
+ lockfilePath: path.join(directory, 'history.lock'),
46
+ stale: policy.staleLockMilliseconds,
47
+ onCompromised
48
+ };
49
+ const deadline = Math.min(performance.now() + policy.lockTimeoutMilliseconds, historyMaintenanceDeadline());
50
+ for (;;) {
51
+ try {
52
+ return await acquireProjectLock(directory, options);
53
+ }
54
+ catch (error) {
55
+ await retryLock(directory, options, deadline, error);
56
+ }
57
+ }
58
+ }
59
+ //# sourceMappingURL=history-lock-acquisition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-lock-acquisition.js","sourceRoot":"","sources":["../../../../source/run/history-lock-acquisition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EACH,6BAA6B,EAC7B,0BAA0B,EAC1B,kCAAkC,EAClC,+BAA+B,EAClC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAGrC,KAAK,UAAU,SAAS,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C;QACD,MAAM,KAAK,CAAC;IAChB,CAAC;IACD,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAChG,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACpC,SAAiB,EACjB,MAAqB,EACrB,aAAqC;IAErC,MAAM,OAAO,GAAG;QACZ,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC;QAClD,KAAK,EAAE,MAAM,CAAC,qBAAqB;QACnC,aAAa;KAChB,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,uBAAuB,EAAE,0BAA0B,EAAE,CAAC,CAAC;IAC5G,SAAS,CAAC;QACN,IAAI,CAAC;YACD,OAAO,MAAM,kBAAkB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,MAAM,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QACzD,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ const deadlines = new AsyncLocalStorage();
3
+ export class HistoryMaintenanceDeferredError extends Error {
4
+ constructor() {
5
+ super('History maintenance was deferred.');
6
+ this.name = 'HistoryMaintenanceDeferredError';
7
+ }
8
+ }
9
+ export function historyMaintenanceDeadline() {
10
+ return deadlines.getStore()?.deadline ?? Number.POSITIVE_INFINITY;
11
+ }
12
+ export function historyMaintenanceDiagnostics() {
13
+ return deadlines.getStore()?.diagnostics() ?? [];
14
+ }
15
+ export function recordHistoryMaintenanceDiagnostic(message) {
16
+ deadlines.getStore()?.recordDiagnostic(message);
17
+ }
18
+ export function checkHistoryMaintenanceBudget() {
19
+ if (performance.now() >= historyMaintenanceDeadline()) {
20
+ throw new HistoryMaintenanceDeferredError();
21
+ }
22
+ }
23
+ export async function withinHistoryMaintenanceBudget(milliseconds, operation) {
24
+ const messages = new Set();
25
+ return await deadlines.run({
26
+ deadline: performance.now() + milliseconds,
27
+ diagnostics() {
28
+ return Array.from(messages);
29
+ },
30
+ recordDiagnostic(message) {
31
+ messages.add(message);
32
+ }
33
+ }, operation);
34
+ }
35
+ //# sourceMappingURL=history-maintenance-budget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-maintenance-budget.js","sourceRoot":"","sources":["../../../../source/run/history-maintenance-budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrD,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAqB,CAAC;AAE7D,MAAM,OAAO,+BAAgC,SAAQ,KAAK;IACtD;QACI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC;IAClD,CAAC;CACJ;AAED,MAAM,UAAU,0BAA0B;IACtC,OAAO,SAAS,CAAC,QAAQ,EAAE,EAAE,QAAQ,IAAI,MAAM,CAAC,iBAAiB,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,6BAA6B;IACzC,OAAO,SAAS,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,OAAe;IAC9D,SAAS,CAAC,QAAQ,EAAE,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,6BAA6B;IACzC,IAAI,WAAW,CAAC,GAAG,EAAE,IAAI,0BAA0B,EAAE,EAAE,CAAC;QACpD,MAAM,IAAI,+BAA+B,EAAE,CAAC;IAChD,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAI,YAAoB,EAAE,SAA2B;IACrG,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,OAAO,MAAM,SAAS,CAAC,GAAG,CAAC;QACvB,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,YAAY;QAC1C,WAAW;YACP,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;QACD,gBAAgB,CAAC,OAAO;YACpB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;KACJ,EAAE,SAAS,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { createHistory } from "./history.js";
2
+ import { HistoryMaintenanceDeferredError, withinHistoryMaintenanceBudget } from "./history-maintenance-budget.js";
3
+ export async function maintainHistory(options) {
4
+ const budget = options.config.history.automaticMaintenanceBudgetMilliseconds;
5
+ if (budget === 0) {
6
+ return [];
7
+ }
8
+ try {
9
+ return await withinHistoryMaintenanceBudget(budget, async function pruneCompletedHistory() {
10
+ const result = await createHistory(options).prune({ dryRun: false });
11
+ return result.diagnostics;
12
+ });
13
+ }
14
+ catch (error) {
15
+ if (error instanceof HistoryMaintenanceDeferredError) {
16
+ return [];
17
+ }
18
+ return [`History maintenance failed: ${error instanceof Error ? error.message : String(error)}`];
19
+ }
20
+ }
21
+ //# sourceMappingURL=history-maintenance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-maintenance.js","sourceRoot":"","sources":["../../../../source/run/history-maintenance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,+BAA+B,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AAElH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAuB;IACzD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,sCAAsC,CAAC;IAC7E,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACD,OAAO,MAAM,8BAA8B,CAAC,MAAM,EAAE,KAAK,UAAU,qBAAqB;YACpF,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;YACrE,OAAO,MAAM,CAAC,WAAW,CAAC;QAC9B,CAAC,CAAC,CAAC;IACP,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,IAAI,KAAK,YAAY,+BAA+B,EAAE,CAAC;YACnD,OAAO,EAAE,CAAC;QACd,CAAC;QACD,OAAO,CAAE,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAE,CAAC;IACvG,CAAC;AACL,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { caseIdentityKey } from "@overkill-dev/engine/engine/identity.js";
2
+ const precedence = { failed: 4, inconclusive: 3, passed: 2, skipped: 1 };
3
+ const verdictStatus = {
4
+ pass: 'passed',
5
+ skip: 'skipped',
6
+ inconclusive: 'inconclusive',
7
+ fail: 'failed',
8
+ crashed: 'failed',
9
+ 'process-exhausted': 'failed',
10
+ 'runtime-policy': 'failed'
11
+ };
12
+ function completedRunStatus(result) {
13
+ if (result.runnerErrors.length > 0) {
14
+ return 'runner-error';
15
+ }
16
+ const counts = result.summary;
17
+ if (counts.failed + counts.crashed + counts.processExhausted + counts.runtimePolicy > 0) {
18
+ return 'failed';
19
+ }
20
+ return counts.inconclusive > 0 ? 'inconclusive' : 'passed';
21
+ }
22
+ export function historyRunStatus(record) {
23
+ return record.status === 'completed' ? completedRunStatus(record.result) : 'interrupted';
24
+ }
25
+ export function historyRunSummary(record, testFamily) {
26
+ return {
27
+ id: record.id,
28
+ startedAt: record.startedAt,
29
+ profile: record.request.profile,
30
+ testFamily,
31
+ status: historyRunStatus(record),
32
+ durationMicroseconds: record.result?.timings.summary.totalWallTimeMicroseconds ?? null,
33
+ replayable: record.facts !== null
34
+ };
35
+ }
36
+ export function caseOutcomes(record) {
37
+ const outcomes = new Map();
38
+ const results = record.result?.perTest ?? [];
39
+ for (const result of results) {
40
+ const identity = result.workId.case;
41
+ const key = caseIdentityKey(identity);
42
+ const status = verdictStatus[result.verdict];
43
+ const previous = outcomes.get(key);
44
+ if (previous === undefined || precedence[status] > precedence[previous.status]) {
45
+ outcomes.set(key, { identity, status });
46
+ }
47
+ }
48
+ return outcomes;
49
+ }
50
+ export function recordDurationContributions(record) {
51
+ const family = record.facts?.execution.testFamily;
52
+ if (family === undefined) {
53
+ return [];
54
+ }
55
+ const { execution } = record;
56
+ return (record.result?.perTest ?? []).flatMap(function durationObservation(result) {
57
+ if (!Number.isFinite(result.durationMicroseconds) || result.durationMicroseconds < 0) {
58
+ return [];
59
+ }
60
+ return [{
61
+ work: result.workId,
62
+ observation: {
63
+ durationMicroseconds: result.durationMicroseconds,
64
+ observedAt: record.startedAt,
65
+ metadata: {
66
+ profile: record.request.profile,
67
+ testFamily: family,
68
+ processModel: execution.processModel,
69
+ scheduling: execution.scheduling,
70
+ workerLifecycle: execution.processModel === 'worker-pool'
71
+ ? execution.workerLifecycle
72
+ : null
73
+ }
74
+ }
75
+ }];
76
+ });
77
+ }
78
+ //# sourceMappingURL=history-outcomes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-outcomes.js","sourceRoot":"","sources":["../../../../source/run/history-outcomes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,yCAAuB,CAAC;AAMrE,MAAM,UAAU,GAAgD,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AACtH,MAAM,aAAa,GAAG;IAClB,IAAI,E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;gBACL,IAAI,EAAE,MAAM,CAAC,MAAM;gBACnB,WAAW,EAAE;oBACT,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;oBACjD,UAAU,EAAE,MAAM,CAAC,SAAS;oBAC5B,QAAQ,EAAE;wBACN,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO;wBAC/B,UAAU,EAAE,MAAM;wBAClB,YAAY,EAAE,SAAS,CAAC,YAAY;wBACpC,UAAU,EAAE,SAAS,CAAC,UAAU;wBAChC,eAAe,EAAE,SAAS,CAAC,YAAY,KAAK,aAAa;4BACrD,CAAC,CAAC,SAAS,CAAC,eAAe;4BAC3B,CAAC,CAAC,IAAI;qBACb;iBACJ;aACJ,CAAE,CAAC;IACR,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { rm } from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { checkHistoryMaintenanceBudget } from "./history-maintenance-budget.js";
4
+ import { readCompactHistory } from "./history-storage.js";
5
+ import { historyStateError } from "./history-state-error.js";
6
+ import { retainCompactHistory } from "./compact-history.js";
7
+ import { readDurationState, durationStatePath, ingestDurationState } from "./duration-history-storage.js";
8
+ import { readRetentionCatalog, selectHistoryRemovals } from "./history-retention-records.js";
9
+ async function writeArtifactRetention(input) {
10
+ const { store, metadata, artifactDirectories, result } = input;
11
+ const retainedArtifacts = artifactDirectories.filter(function retainedArtifact(value) {
12
+ return !result.paths.includes(value);
13
+ });
14
+ for (const target of retainedArtifacts) {
15
+ checkHistoryMaintenanceBudget();
16
+ await store.write(path.join(target, 'retention.json'), JSON.stringify(metadata.get(path.basename(target))));
17
+ }
18
+ }
19
+ async function applyRetention(input) {
20
+ const { store, directory, next, nextDurations, result } = input;
21
+ await writeArtifactRetention(input);
22
+ for (const target of result.paths) {
23
+ checkHistoryMaintenanceBudget();
24
+ await rm(target, { recursive: true, force: true });
25
+ }
26
+ if (nextDurations !== null) {
27
+ await store.write(durationStatePath(directory), JSON.stringify(nextDurations));
28
+ }
29
+ await store.write(path.join(directory, 'history', 'index.json'), JSON.stringify(next));
30
+ }
31
+ async function requiredIndex(context) {
32
+ const index = await readCompactHistory(context.store, context.directory);
33
+ if (index === null) {
34
+ throw historyStateError('Compact history is missing.');
35
+ }
36
+ return index;
37
+ }
38
+ function currentTimestamp() {
39
+ const now = new Date();
40
+ return now.toISOString();
41
+ }
42
+ async function retainedDurations(context, now) {
43
+ const state = await readDurationState(context.store, context.directory, now);
44
+ return state === null
45
+ ? null
46
+ : ingestDurationState(state, [], { run: null, policy: context.policy, now, source: 'repair' });
47
+ }
48
+ function removalResult(request, paths, before, after) {
49
+ return {
50
+ kind: request.dryRun ? 'dry-run' : 'applied',
51
+ diagnostics: [],
52
+ paths,
53
+ removedSummaries: before.summaries.length - after.summaries.length,
54
+ removedCases: before.cases.length - after.cases.length,
55
+ removedWorkEntries: 0
56
+ };
57
+ }
58
+ async function prepareRetention(context, request) {
59
+ const now = currentTimestamp();
60
+ const index = await requiredIndex(context);
61
+ const catalog = await readRetentionCatalog({
62
+ store: context.store,
63
+ runs: path.join(context.directory, 'runs'),
64
+ index,
65
+ policy: context.policy,
66
+ now
67
+ });
68
+ const removals = selectHistoryRemovals(catalog, path.join(context.directory, 'runs'), context.policy, now);
69
+ const next = retainCompactHistory({
70
+ ...index,
71
+ summaries: index.summaries.map(function replayAvailability(value) {
72
+ return { ...value, replayable: value.replayable && removals.retainedRecords.has(value.id) };
73
+ })
74
+ }, context.policy, now);
75
+ const durations = await readDurationState(context.store, context.directory, now);
76
+ const nextDurations = await retainedDurations(context, now);
77
+ const artifactDirectories = Array.from(new Set([
78
+ ...catalog.artifactDirectories,
79
+ ...Array
80
+ .from(removals.successfulRuns, function successfulRunDirectory(id) {
81
+ return path.join(context.directory, 'runs', id);
82
+ })
83
+ ]));
84
+ const result = removalResult(request, [...removals.removedRecords, ...removals.removedArtifacts], index, next);
85
+ return {
86
+ ...context,
87
+ next,
88
+ nextDurations,
89
+ metadata: catalog.metadata,
90
+ artifactDirectories,
91
+ result: {
92
+ ...result,
93
+ removedWorkEntries: (durations?.entries.length ?? 0) - (nextDurations?.entries.length ?? 0)
94
+ }
95
+ };
96
+ }
97
+ export async function pruneHistory(context, request) {
98
+ const write = await prepareRetention(context, request);
99
+ if (!request.dryRun) {
100
+ await applyRetention(write);
101
+ }
102
+ return write.result;
103
+ }
104
+ //# sourceMappingURL=history-pruning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-pruning.js","sourceRoot":"","sources":["../../../../source/run/history-pruning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAe7F,KAAK,UAAU,sBAAsB,CAAC,KAAqB;IACvD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC/D,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,MAAM,CAAC,SAAS,gBAAgB,CAAC,KAAK;QAChF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE,CAAC;QACrC,6BAA6B,EAAE,CAAC;QAChC,MAAM,KAAK,CAAC,KAAK,CAAC,IAA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ACH,GAAG,OAAO;QACV,IAAI;QACJ,aAAa;QACb,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,mBAAmB;QACnB,MAAM,EAAE;YACJ,GAAG,MAAM;YACT,kBAAkB,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;SAC9F;KACJ,CAAC;AACN,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAqB,EAAE,OAA4B;IAClF,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,CAAC;AACxB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { readCompactHistory } from "./history-storage.js";
2
+ import { readDurationState, durationIndexProjection } from "./duration-history-storage.js";
3
+ import { historyStateError } from "./history-state-error.js";
4
+ async function completedRuns(store, directory) {
5
+ const history = await readCompactHistory(store, directory);
6
+ if (history === null) {
7
+ throw historyStateError('Compact history is missing.');
8
+ }
9
+ return new Set(history
10
+ .receipts
11
+ .filter(function completed(receipt) {
12
+ return receipt.state === 'completed';
13
+ })
14
+ .map(function runIdentity(receipt) {
15
+ return receipt.id;
16
+ }));
17
+ }
18
+ export async function readDurationProjection(store, directory) {
19
+ const now = new Date();
20
+ const state = await readDurationState(store, directory, now.toISOString());
21
+ if (state === null) {
22
+ return null;
23
+ }
24
+ const hasRecordedObservations = state.entries.some(function recorded(entry) {
25
+ return entry.observations.some(function identified(observation) {
26
+ return observation.runId !== null;
27
+ });
28
+ });
29
+ const completed = hasRecordedObservations ? await completedRuns(store, directory) : new Set();
30
+ return durationIndexProjection(state, completed);
31
+ }
32
+ //# sourceMappingURL=history-reader.js.map
@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OAAO,WAAW,CAAC,KAAK,KAAK,IAAI,CAAC;QACtC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,uBAAuB,CAAC,CAAC,CAAC,MAAM,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAU,CAAC;IACtG,OAAO,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ import { workIdSchema } from "@overkill-dev/engine/engine/identity-schema.js";
3
+ import { verdictSchema } from "./run-artifact-schema.js";
4
+ const family = z.enum(['microtest', 'integration', 'benchmark', 'property']);
5
+ const execution = z.union([
6
+ z.object({
7
+ processModel: z.enum(['in-process', 'supervised-process']),
8
+ scheduling: z.enum(['serial', 'concurrent'])
9
+ }),
10
+ z.object({
11
+ processModel: z.literal('worker-pool'),
12
+ scheduling: z.enum(['serial', 'concurrent']),
13
+ workerLifecycle: z.enum(['reuse', 'fresh-worker-per-unit'])
14
+ })
15
+ ]);
16
+ const count = z.number().int().nonnegative();
17
+ const result = z.object({
18
+ runnerErrors: z.array(z.unknown()).readonly(),
19
+ summary: z.object({
20
+ failed: count,
21
+ crashed: count,
22
+ processExhausted: count,
23
+ runtimePolicy: count,
24
+ inconclusive: count
25
+ }),
26
+ timings: z.object({ summary: z.object({ totalWallTimeMicroseconds: z.number().nonnegative() }) }),
27
+ perTest: z
28
+ .array(z.object({
29
+ workId: workIdSchema,
30
+ verdict: verdictSchema,
31
+ durationMicroseconds: z.number().nonnegative()
32
+ }))
33
+ .readonly()
34
+ });
35
+ const fields = {
36
+ version: z.literal(1),
37
+ kind: z.literal('single'),
38
+ id: z.string().min(1),
39
+ startedAt: z.iso.datetime({ offset: true }),
40
+ request: z.object({ profile: z.string() }),
41
+ execution,
42
+ facts: z.object({ execution: z.object({ testFamily: family }) }).nullable()
43
+ };
44
+ export const historyRecordSchema = z.discriminatedUnion('status', [
45
+ z.object({ ...fields, status: z.literal('completed'), result }),
46
+ z.object({ ...fields, status: z.enum(['started', 'interrupted']), result: result.nullable() })
47
+ ]);
48
+ //# sourceMappingURL=history-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-record.js","sourceRoot":"","sources":["../../../../source/run/history-record.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gDAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAE,CAAC,CAAC;AAC/E,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC;IACtB,CAAC,CAAC,MAAM,CAAC;QACL,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAE,YAAY,EAAE,oBAAoB,CAAE,CAAC;QAC5D,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAE,QAAQ,EAAE,YAAY,CAAE,CAAC;KACjD,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACL,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;QACtC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAE,QAAQ,EAAE,YAAY,CAAE,CAAC;QAC9C,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAE,OAAO,EAAE,uBAAuB,CAAE,CAAC;KAChE,CAAC;CACL,CAAC,CAAC;AACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;AAC7C,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACpB,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAA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