@overkill-dev/run 0.0.63 → 0.0.64

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 (239) hide show
  1. package/assertion-protocol/source-location-forwarding.js +14 -2
  2. package/assertion-protocol/source-location-forwarding.js.map +1 -1
  3. package/assertion-protocol/source-location.js +1 -0
  4. package/assertion-protocol/source-location.js.map +1 -1
  5. package/engine/async-leak-diagnostics.js +9 -9
  6. package/engine/async-leak-diagnostics.js.map +1 -1
  7. package/engine/case-attempt-execution.js +191 -0
  8. package/engine/case-attempt-execution.js.map +1 -0
  9. package/engine/case-execution.d.ts +5 -3
  10. package/engine/case-execution.d.ts.map +1 -1
  11. package/engine/case-execution.js +25 -24
  12. package/engine/case-execution.js.map +1 -1
  13. package/engine/coverage-artifact.d.ts +1 -0
  14. package/engine/coverage-artifact.d.ts.map +1 -1
  15. package/engine/execution-async-leak-policy.js +3 -10
  16. package/engine/execution-async-leak-policy.js.map +1 -1
  17. package/engine/execution-global-error-observer.d.ts +2 -1
  18. package/engine/execution-global-error-observer.d.ts.map +1 -1
  19. package/engine/execution-global-error-observer.js +19 -15
  20. package/engine/execution-global-error-observer.js.map +1 -1
  21. package/engine/execution-options.d.ts +4 -1
  22. package/engine/execution-options.d.ts.map +1 -1
  23. package/engine/execution-options.js +7 -2
  24. package/engine/execution-options.js.map +1 -1
  25. package/engine/execution-resource-budget-tracking.js.map +1 -1
  26. package/engine/execution-resource-tracked-cases.js.map +1 -1
  27. package/engine/execution-result.js.map +1 -1
  28. package/engine/execution-supervision-state.js.map +1 -1
  29. package/engine/execution-supervision.d.ts.map +1 -1
  30. package/engine/execution-supervision.js +50 -33
  31. package/engine/execution-supervision.js.map +1 -1
  32. package/engine/execution-test-plan-cases.js +6 -126
  33. package/engine/execution-test-plan-cases.js.map +1 -1
  34. package/engine/execution-test-plan-resource-usage.js.map +1 -1
  35. package/engine/execution.js +3 -3
  36. package/engine/execution.js.map +1 -1
  37. package/engine/identity.d.ts +3 -0
  38. package/engine/identity.d.ts.map +1 -1
  39. package/engine/reporter-dispatcher.js +1 -0
  40. package/engine/reporter-dispatcher.js.map +1 -1
  41. package/engine/reporter-event-queue.js.map +1 -1
  42. package/engine/reporter.d.ts +2 -1
  43. package/engine/reporter.d.ts.map +1 -1
  44. package/engine/reporter.js.map +1 -1
  45. package/engine/resource-usage.d.ts +22 -0
  46. package/engine/resource-usage.d.ts.map +1 -0
  47. package/engine/retry-policy.d.ts +4 -0
  48. package/engine/retry-policy.d.ts.map +1 -0
  49. package/engine/retry-policy.js +22 -0
  50. package/engine/retry-policy.js.map +1 -0
  51. package/engine/run-artifact.d.ts +45 -0
  52. package/engine/run-artifact.d.ts.map +1 -0
  53. package/engine/run-result.d.ts +17 -52
  54. package/engine/run-result.d.ts.map +1 -1
  55. package/engine/run-result.js +14 -0
  56. package/engine/run-result.js.map +1 -1
  57. package/engine/runner-error-reporting.js.map +1 -1
  58. package/engine/test-attempt-history.js +24 -0
  59. package/engine/test-attempt-history.js.map +1 -0
  60. package/package.json +17 -6
  61. package/packages/run/config.entry-point.d.ts +2 -0
  62. package/packages/run/config.entry-point.d.ts.map +1 -1
  63. package/packages/run/run.entry-point.d.ts +2 -0
  64. package/packages/run/run.entry-point.d.ts.map +1 -1
  65. package/packages/run/transcript-store.entry-point.d.ts +3 -0
  66. package/packages/run/transcript-store.entry-point.d.ts.map +1 -0
  67. package/packages/run/transcript-store.entry-point.js +2 -0
  68. package/packages/run/transcript-store.entry-point.js.map +1 -0
  69. package/packages/simulation/transcript.entry-point.js +2 -0
  70. package/packages/simulation/transcript.entry-point.js.map +1 -0
  71. package/readme.md +47 -2
  72. package/reporters/human-reporter-rendering.js +11 -2
  73. package/reporters/human-reporter-rendering.js.map +1 -1
  74. package/reporters/line-reporter.js +6 -1
  75. package/reporters/line-reporter.js.map +1 -1
  76. package/resources/resources.d.ts.map +1 -1
  77. package/resources/resources.js +3 -6
  78. package/resources/resources.js.map +1 -1
  79. package/run/capability-policy.js +10 -5
  80. package/run/capability-policy.js.map +1 -1
  81. package/run/collected-run-plan.js.map +1 -1
  82. package/run/coverage-loaded-sources.js +112 -0
  83. package/run/coverage-loaded-sources.js.map +1 -0
  84. package/run/coverage-native-data.js +18 -0
  85. package/run/coverage-native-data.js.map +1 -0
  86. package/run/coverage-paths.js +45 -4
  87. package/run/coverage-paths.js.map +1 -1
  88. package/run/coverage-reporting.js +104 -8
  89. package/run/coverage-reporting.js.map +1 -1
  90. package/run/coverage-run-record.js +50 -0
  91. package/run/coverage-run-record.js.map +1 -0
  92. package/run/coverage-runtime-source.js +37 -0
  93. package/run/coverage-runtime-source.js.map +1 -0
  94. package/run/coverage-session.js +344 -6
  95. package/run/coverage-session.js.map +1 -1
  96. package/run/coverage-source-map.js +125 -0
  97. package/run/coverage-source-map.js.map +1 -0
  98. package/run/coverage-source-selection.js +120 -0
  99. package/run/coverage-source-selection.js.map +1 -0
  100. package/run/duration-history.d.ts.map +1 -1
  101. package/run/duration-history.js +1 -0
  102. package/run/duration-history.js.map +1 -1
  103. package/run/node-run-execution.js +25 -0
  104. package/run/node-run-execution.js.map +1 -0
  105. package/run/node-runtime-state-store.js +38 -0
  106. package/run/node-runtime-state-store.js.map +1 -0
  107. package/run/node-worker-pool-factory.js +0 -31
  108. package/run/node-worker-pool-factory.js.map +1 -1
  109. package/run/path-containment.js +6 -1
  110. package/run/path-containment.js.map +1 -1
  111. package/run/permission-denial-runtime-policy.js +21 -13
  112. package/run/permission-denial-runtime-policy.js.map +1 -1
  113. package/run/recorded-coverage-run.js +45 -0
  114. package/run/recorded-coverage-run.js.map +1 -0
  115. package/run/recorded-coverage-session.js +50 -0
  116. package/run/recorded-coverage-session.js.map +1 -0
  117. package/run/resource-lifecycle-session-acquirer.js +11 -6
  118. package/run/resource-lifecycle-session-acquirer.js.map +1 -1
  119. package/run/resource-lifecycle-state.d.ts +4 -2
  120. package/run/resource-lifecycle-state.d.ts.map +1 -1
  121. package/run/resource-lifecycle-state.js +9 -3
  122. package/run/resource-lifecycle-state.js.map +1 -1
  123. package/run/resource-lifecycle.js +36 -10
  124. package/run/resource-lifecycle.js.map +1 -1
  125. package/run/resource-usage.js.map +1 -1
  126. package/run/retry-artifact-retention.js +37 -0
  127. package/run/retry-artifact-retention.js.map +1 -0
  128. package/run/run-config-schema.d.ts +25 -0
  129. package/run/run-config-schema.d.ts.map +1 -1
  130. package/run/run-config-schema.js +7 -0
  131. package/run/run-config-schema.js.map +1 -1
  132. package/run/run-config.d.ts +3 -2
  133. package/run/run-config.d.ts.map +1 -1
  134. package/run/run-config.js +4 -0
  135. package/run/run-config.js.map +1 -1
  136. package/run/run-coverage.js +5 -2
  137. package/run/run-coverage.js.map +1 -1
  138. package/run/run-engine-primitives.d.ts +2 -1
  139. package/run/run-engine-primitives.d.ts.map +1 -1
  140. package/run/run-errors.d.ts.map +1 -1
  141. package/run/run-errors.js +1 -0
  142. package/run/run-errors.js.map +1 -1
  143. package/run/run-execution-config.d.ts +5 -0
  144. package/run/run-execution-config.d.ts.map +1 -1
  145. package/run/run-facts.js +2 -0
  146. package/run/run-facts.js.map +1 -1
  147. package/run/run-isolated-command.js +2 -0
  148. package/run/run-isolated-command.js.map +1 -1
  149. package/run/run-local-command.js +8 -82
  150. package/run/run-local-command.js.map +1 -1
  151. package/run/run-local-coverage.js +72 -0
  152. package/run/run-local-coverage.js.map +1 -0
  153. package/run/run-local-execution.js +1 -0
  154. package/run/run-local-execution.js.map +1 -1
  155. package/run/run-local-resolution.js +6 -3
  156. package/run/run-local-resolution.js.map +1 -1
  157. package/run/run-orchestrator-dependencies.d.ts +1 -1
  158. package/run/run-orchestrator-dependencies.d.ts.map +1 -1
  159. package/run/run-orchestrator.d.ts.map +1 -1
  160. package/run/run-orchestrator.js +6 -18
  161. package/run/run-orchestrator.js.map +1 -1
  162. package/run/run-record-error.js +26 -0
  163. package/run/run-record-error.js.map +1 -0
  164. package/run/run-record-input.js +34 -0
  165. package/run/run-record-input.js.map +1 -0
  166. package/run/run-record-outcomes.d.ts +46 -0
  167. package/run/run-record-outcomes.d.ts.map +1 -0
  168. package/run/run-record-result.js +58 -0
  169. package/run/run-record-result.js.map +1 -0
  170. package/run/run-record-storage.js +51 -0
  171. package/run/run-record-storage.js.map +1 -0
  172. package/run/run-record-types.d.ts +73 -0
  173. package/run/run-record-types.d.ts.map +1 -0
  174. package/run/run-record-versions.js +51 -0
  175. package/run/run-record-versions.js.map +1 -0
  176. package/run/run-record.js +48 -0
  177. package/run/run-record.js.map +1 -0
  178. package/run/run-result-reporting.js +16 -0
  179. package/run/run-result-reporting.js.map +1 -0
  180. package/run/run-supervised-finalization.js +8 -0
  181. package/run/run-supervised-finalization.js.map +1 -0
  182. package/run/run-supervised-process.js +34 -33
  183. package/run/run-supervised-process.js.map +1 -1
  184. package/run/run-support.js +17 -8
  185. package/run/run-support.js.map +1 -1
  186. package/run/run-types.d.ts +4 -1
  187. package/run/run-types.d.ts.map +1 -1
  188. package/run/run-types.js.map +1 -1
  189. package/run/supervised-child-test-plan.js +2 -0
  190. package/run/supervised-child-test-plan.js.map +1 -1
  191. package/run/supervised-child.js +1 -0
  192. package/run/supervised-child.js.map +1 -1
  193. package/run/supervised-output-capture.js +66 -0
  194. package/run/supervised-output-capture.js.map +1 -0
  195. package/run/supervised-protocol.js.map +1 -1
  196. package/run/supervised-run-collection.js +3 -1
  197. package/run/supervised-run-collection.js.map +1 -1
  198. package/run/supervised-run-resource-policy.js +12 -1
  199. package/run/supervised-run-resource-policy.js.map +1 -1
  200. package/run/supervised-run-runtime.js +16 -27
  201. package/run/supervised-run-runtime.js.map +1 -1
  202. package/run/supervised-run-state.js +64 -81
  203. package/run/supervised-run-state.js.map +1 -1
  204. package/run/supervised-run.js +3 -1
  205. package/run/supervised-run.js.map +1 -1
  206. package/run/worker-pool-collection.js +1 -0
  207. package/run/worker-pool-collection.js.map +1 -1
  208. package/run/worker-pool-command.js +1 -0
  209. package/run/worker-pool-command.js.map +1 -1
  210. package/run/worker-pool-execution.js +2 -1
  211. package/run/worker-pool-execution.js.map +1 -1
  212. package/run/worker-pool-hedged-arbitration.js +4 -0
  213. package/run/worker-pool-hedged-arbitration.js.map +1 -1
  214. package/run/worker-pool-host-process.js.map +1 -1
  215. package/run/worker-pool-host-protocol.js.map +1 -1
  216. package/run/worker-pool-protocol.js.map +1 -1
  217. package/run/worker-pool-resource-lifecycle-execution.js +1 -0
  218. package/run/worker-pool-resource-lifecycle-execution.js.map +1 -1
  219. package/run/worker-pool-resource-tracking.js +2 -2
  220. package/run/worker-pool-resource-tracking.js.map +1 -1
  221. package/run/worker-pool-results.js +7 -9
  222. package/run/worker-pool-results.js.map +1 -1
  223. package/run/worker-pool-run.js +2 -2
  224. package/run/worker-pool-run.js.map +1 -1
  225. package/run/worker-pool-task-events.js +7 -2
  226. package/run/worker-pool-task-events.js.map +1 -1
  227. package/run/worker-pool-worker-plan.js +1 -0
  228. package/run/worker-pool-worker-plan.js.map +1 -1
  229. package/run/worker-pool-worker-resources.js +1 -0
  230. package/run/worker-pool-worker-resources.js.map +1 -1
  231. package/run/worker-pool-worker.js +1 -0
  232. package/run/worker-pool-worker.js.map +1 -1
  233. package/sbom.cdx.json +65 -14
  234. package/transcript/http-transcript.js +3 -0
  235. package/transcript/http-transcript.js.map +1 -0
  236. package/transcript/transcript-store.d.ts +25 -0
  237. package/transcript/transcript-store.d.ts.map +1 -0
  238. package/transcript/transcript-store.js +73 -0
  239. package/transcript/transcript-store.js.map +1 -0
@@ -0,0 +1,73 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ const transcriptIdentity = Symbol.for('@overkill-dev/transcript');
3
+ const activeTranscriptScope = new AsyncLocalStorage();
4
+ const noEntries = Object.freeze([]);
5
+ function validIndex(index) {
6
+ return Number.isSafeInteger(index) && index >= 0;
7
+ }
8
+ export function brandTranscriptView(subject) {
9
+ Object.defineProperty(subject, transcriptIdentity, {
10
+ enumerable: false,
11
+ value: true
12
+ });
13
+ return Object.freeze(subject);
14
+ }
15
+ export function currentTranscriptScope() {
16
+ return activeTranscriptScope.getStore() ?? null;
17
+ }
18
+ export async function runWithTranscriptScope(scope, run) {
19
+ return await activeTranscriptScope.run(scope, run);
20
+ }
21
+ function brandedView(currentEntries) {
22
+ const view = {
23
+ get entries() {
24
+ return currentEntries();
25
+ },
26
+ get entryCount() {
27
+ return currentEntries().length;
28
+ },
29
+ get firstEntry() {
30
+ return currentEntries()[0] ?? null;
31
+ },
32
+ get lastEntry() {
33
+ return currentEntries().at(-1) ?? null;
34
+ },
35
+ nthEntry(index) {
36
+ return validIndex(index) ? currentEntries()[index] ?? null : null;
37
+ }
38
+ };
39
+ return brandTranscriptView(view);
40
+ }
41
+ export function createTranscriptStore() {
42
+ const entries = [];
43
+ let scopedEntries = new WeakMap();
44
+ function recordInScope(scope, entry) {
45
+ entries.push(entry);
46
+ if (scope !== null) {
47
+ const scopeEntries = scopedEntries.get(scope) ?? [];
48
+ scopeEntries.push(entry);
49
+ scopedEntries.set(scope, scopeEntries);
50
+ }
51
+ }
52
+ function currentEntries() {
53
+ const scope = currentTranscriptScope();
54
+ return scope === null ? entries : scopedEntries.get(scope) ?? noEntries;
55
+ }
56
+ return Object.freeze({
57
+ record(...entry) {
58
+ recordInScope(currentTranscriptScope(), entry);
59
+ },
60
+ recordInScope(scope, ...entry) {
61
+ recordInScope(scope, entry);
62
+ },
63
+ reset() {
64
+ entries.length = 0;
65
+ scopedEntries = new WeakMap();
66
+ },
67
+ view: brandedView(currentEntries)
68
+ });
69
+ }
70
+ export function isTranscriptView(value) {
71
+ return typeof value === 'object' && value !== null && Reflect.get(value, transcriptIdentity) === true;
72
+ }
73
+ //# sourceMappingURL=transcript-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcript-store.js","sourceRoot":"","sources":["../../../../source/transcript/transcript-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,kBAAkB,GAAG,MA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