@memberjunction/predictive-studio 6.2.2 → 6.3.0-edge.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/README.md +16 -11
  2. package/dist/actions/base-predictive-studio.action.d.ts +7 -0
  3. package/dist/actions/base-predictive-studio.action.d.ts.map +1 -1
  4. package/dist/actions/base-predictive-studio.action.js +22 -0
  5. package/dist/actions/base-predictive-studio.action.js.map +1 -1
  6. package/dist/actions/driver-classes.d.ts +2 -0
  7. package/dist/actions/driver-classes.d.ts.map +1 -1
  8. package/dist/actions/driver-classes.js +2 -0
  9. package/dist/actions/driver-classes.js.map +1 -1
  10. package/dist/actions/evaluate-drift.action.d.ts +100 -0
  11. package/dist/actions/evaluate-drift.action.d.ts.map +1 -0
  12. package/dist/actions/evaluate-drift.action.js +512 -0
  13. package/dist/actions/evaluate-drift.action.js.map +1 -0
  14. package/dist/actions/index.d.ts +3 -0
  15. package/dist/actions/index.d.ts.map +1 -1
  16. package/dist/actions/index.js +7 -0
  17. package/dist/actions/index.js.map +1 -1
  18. package/dist/actions/migrate-pipelines.action.d.ts +19 -0
  19. package/dist/actions/migrate-pipelines.action.d.ts.map +1 -0
  20. package/dist/actions/migrate-pipelines.action.js +51 -0
  21. package/dist/actions/migrate-pipelines.action.js.map +1 -0
  22. package/dist/actions/promote-model.action.d.ts +12 -1
  23. package/dist/actions/promote-model.action.d.ts.map +1 -1
  24. package/dist/actions/promote-model.action.js +7 -2
  25. package/dist/actions/promote-model.action.js.map +1 -1
  26. package/dist/actions/promote-model.gate.d.ts +31 -2
  27. package/dist/actions/promote-model.gate.d.ts.map +1 -1
  28. package/dist/actions/promote-model.gate.js +84 -5
  29. package/dist/actions/promote-model.gate.js.map +1 -1
  30. package/dist/actions/run-experiment.action.d.ts.map +1 -1
  31. package/dist/actions/run-experiment.action.js +5 -4
  32. package/dist/actions/run-experiment.action.js.map +1 -1
  33. package/dist/actions/schedule-model-scoring.action.js +2 -2
  34. package/dist/actions/schedule-model-scoring.action.js.map +1 -1
  35. package/dist/actions/score-record-set.action.js +1 -1
  36. package/dist/actions/score-record-set.action.js.map +1 -1
  37. package/dist/actions/score-record-set.runner.d.ts +2 -2
  38. package/dist/actions/score-record-set.runner.js +3 -3
  39. package/dist/actions/score-record-set.runner.js.map +1 -1
  40. package/dist/actions/train-model.action.d.ts +28 -25
  41. package/dist/actions/train-model.action.d.ts.map +1 -1
  42. package/dist/actions/train-model.action.js +50 -39
  43. package/dist/actions/train-model.action.js.map +1 -1
  44. package/dist/agent/index.d.ts +1 -1
  45. package/dist/agent/index.js +1 -1
  46. package/dist/agent/modeling-plan-to-pipeline.d.ts +0 -2
  47. package/dist/agent/modeling-plan-to-pipeline.d.ts.map +1 -1
  48. package/dist/agent/modeling-plan-to-pipeline.js +30 -39
  49. package/dist/agent/modeling-plan-to-pipeline.js.map +1 -1
  50. package/dist/agent/pipeline-builder-agent.d.ts +47 -18
  51. package/dist/agent/pipeline-builder-agent.d.ts.map +1 -1
  52. package/dist/agent/pipeline-builder-agent.js +161 -92
  53. package/dist/agent/pipeline-builder-agent.js.map +1 -1
  54. package/dist/agent/pipeline-builder.d.ts +178 -56
  55. package/dist/agent/pipeline-builder.d.ts.map +1 -1
  56. package/dist/agent/pipeline-builder.js +333 -234
  57. package/dist/agent/pipeline-builder.js.map +1 -1
  58. package/dist/experiment/budget.d.ts +61 -0
  59. package/dist/experiment/budget.d.ts.map +1 -0
  60. package/dist/experiment/budget.js +72 -0
  61. package/dist/experiment/budget.js.map +1 -0
  62. package/dist/experiment/experiment-orchestrator.d.ts +43 -7
  63. package/dist/experiment/experiment-orchestrator.d.ts.map +1 -1
  64. package/dist/experiment/experiment-orchestrator.js +130 -33
  65. package/dist/experiment/experiment-orchestrator.js.map +1 -1
  66. package/dist/experiment/index.d.ts +2 -0
  67. package/dist/experiment/index.d.ts.map +1 -1
  68. package/dist/experiment/index.js +2 -0
  69. package/dist/experiment/index.js.map +1 -1
  70. package/dist/experiment/leaderboard.d.ts +15 -15
  71. package/dist/experiment/leaderboard.d.ts.map +1 -1
  72. package/dist/experiment/leaderboard.js +44 -18
  73. package/dist/experiment/leaderboard.js.map +1 -1
  74. package/dist/experiment/scores.d.ts +32 -0
  75. package/dist/experiment/scores.d.ts.map +1 -0
  76. package/dist/experiment/scores.js +62 -0
  77. package/dist/experiment/scores.js.map +1 -0
  78. package/dist/experiment/seams.d.ts +23 -20
  79. package/dist/experiment/seams.d.ts.map +1 -1
  80. package/dist/experiment/seams.js +54 -56
  81. package/dist/experiment/seams.js.map +1 -1
  82. package/dist/experiment/types.d.ts +55 -10
  83. package/dist/experiment/types.d.ts.map +1 -1
  84. package/dist/experiment/types.js.map +1 -1
  85. package/dist/feature-assembly/as-of/as-of-assembler.d.ts +412 -0
  86. package/dist/feature-assembly/as-of/as-of-assembler.d.ts.map +1 -0
  87. package/dist/feature-assembly/as-of/as-of-assembler.js +1239 -0
  88. package/dist/feature-assembly/as-of/as-of-assembler.js.map +1 -0
  89. package/dist/feature-assembly/as-of/feature-resolution.d.ts +84 -0
  90. package/dist/feature-assembly/as-of/feature-resolution.d.ts.map +1 -0
  91. package/dist/feature-assembly/as-of/feature-resolution.js +229 -0
  92. package/dist/feature-assembly/as-of/feature-resolution.js.map +1 -0
  93. package/dist/feature-assembly/as-of/index.d.ts +15 -0
  94. package/dist/feature-assembly/as-of/index.d.ts.map +1 -0
  95. package/dist/feature-assembly/as-of/index.js +15 -0
  96. package/dist/feature-assembly/as-of/index.js.map +1 -0
  97. package/dist/feature-assembly/as-of/read-by-keys.d.ts +30 -0
  98. package/dist/feature-assembly/as-of/read-by-keys.d.ts.map +1 -0
  99. package/dist/feature-assembly/as-of/read-by-keys.js +51 -0
  100. package/dist/feature-assembly/as-of/read-by-keys.js.map +1 -0
  101. package/dist/feature-assembly/as-of/record-history.d.ts +256 -0
  102. package/dist/feature-assembly/as-of/record-history.d.ts.map +1 -0
  103. package/dist/feature-assembly/as-of/record-history.js +505 -0
  104. package/dist/feature-assembly/as-of/record-history.js.map +1 -0
  105. package/dist/feature-assembly/as-of/refusal.d.ts +19 -0
  106. package/dist/feature-assembly/as-of/refusal.d.ts.map +1 -0
  107. package/dist/feature-assembly/as-of/refusal.js +13 -0
  108. package/dist/feature-assembly/as-of/refusal.js.map +1 -0
  109. package/dist/feature-assembly/as-of/series-features.d.ts +65 -0
  110. package/dist/feature-assembly/as-of/series-features.d.ts.map +1 -0
  111. package/dist/feature-assembly/as-of/series-features.js +97 -0
  112. package/dist/feature-assembly/as-of/series-features.js.map +1 -0
  113. package/dist/feature-assembly/as-of/windowed-aggregate.d.ts +36 -0
  114. package/dist/feature-assembly/as-of/windowed-aggregate.d.ts.map +1 -0
  115. package/dist/feature-assembly/as-of/windowed-aggregate.js +99 -0
  116. package/dist/feature-assembly/as-of/windowed-aggregate.js.map +1 -0
  117. package/dist/feature-assembly/as-of.d.ts +1 -9
  118. package/dist/feature-assembly/as-of.d.ts.map +1 -1
  119. package/dist/feature-assembly/as-of.js +2 -19
  120. package/dist/feature-assembly/as-of.js.map +1 -1
  121. package/dist/feature-assembly/assembly-metadata.d.ts +34 -0
  122. package/dist/feature-assembly/assembly-metadata.d.ts.map +1 -0
  123. package/dist/feature-assembly/assembly-metadata.js +26 -0
  124. package/dist/feature-assembly/assembly-metadata.js.map +1 -0
  125. package/dist/feature-assembly/data-access.d.ts +21 -2
  126. package/dist/feature-assembly/data-access.d.ts.map +1 -1
  127. package/dist/feature-assembly/data-access.js +14 -0
  128. package/dist/feature-assembly/data-access.js.map +1 -1
  129. package/dist/feature-assembly/feature-assembly-executor.d.ts.map +1 -1
  130. package/dist/feature-assembly/feature-assembly-executor.js +5 -2
  131. package/dist/feature-assembly/feature-assembly-executor.js.map +1 -1
  132. package/dist/feature-assembly/index.d.ts +3 -0
  133. package/dist/feature-assembly/index.d.ts.map +1 -1
  134. package/dist/feature-assembly/index.js +3 -0
  135. package/dist/feature-assembly/index.js.map +1 -1
  136. package/dist/feature-assembly/leakage-guard.d.ts +1 -1
  137. package/dist/feature-assembly/leakage-guard.js +1 -1
  138. package/dist/feature-assembly/read-policy.d.ts +27 -0
  139. package/dist/feature-assembly/read-policy.d.ts.map +1 -0
  140. package/dist/feature-assembly/read-policy.js +63 -0
  141. package/dist/feature-assembly/read-policy.js.map +1 -0
  142. package/dist/feature-pipelines/feature-pipeline-engine.d.ts.map +1 -1
  143. package/dist/feature-pipelines/feature-pipeline-engine.js +3 -1
  144. package/dist/feature-pipelines/feature-pipeline-engine.js.map +1 -1
  145. package/dist/index.d.ts +5 -2
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +16 -4
  148. package/dist/index.js.map +1 -1
  149. package/dist/maintenance/index.d.ts +1 -0
  150. package/dist/maintenance/index.d.ts.map +1 -1
  151. package/dist/maintenance/index.js +1 -0
  152. package/dist/maintenance/index.js.map +1 -1
  153. package/dist/maintenance/maintenance-engine.d.ts +16 -19
  154. package/dist/maintenance/maintenance-engine.d.ts.map +1 -1
  155. package/dist/maintenance/maintenance-engine.js +53 -53
  156. package/dist/maintenance/maintenance-engine.js.map +1 -1
  157. package/dist/maintenance/metrics.d.ts +19 -15
  158. package/dist/maintenance/metrics.d.ts.map +1 -1
  159. package/dist/maintenance/metrics.js +29 -24
  160. package/dist/maintenance/metrics.js.map +1 -1
  161. package/dist/maintenance/psi-drift-detector.d.ts +246 -0
  162. package/dist/maintenance/psi-drift-detector.d.ts.map +1 -0
  163. package/dist/maintenance/psi-drift-detector.js +1002 -0
  164. package/dist/maintenance/psi-drift-detector.js.map +1 -0
  165. package/dist/maintenance/types.d.ts +11 -2
  166. package/dist/maintenance/types.d.ts.map +1 -1
  167. package/dist/maintenance/types.js.map +1 -1
  168. package/dist/migration/index.d.ts +8 -0
  169. package/dist/migration/index.d.ts.map +1 -0
  170. package/dist/migration/index.js +8 -0
  171. package/dist/migration/index.js.map +1 -0
  172. package/dist/migration/legacy-pipeline-migration.d.ts +138 -0
  173. package/dist/migration/legacy-pipeline-migration.d.ts.map +1 -0
  174. package/dist/migration/legacy-pipeline-migration.js +273 -0
  175. package/dist/migration/legacy-pipeline-migration.js.map +1 -0
  176. package/dist/operations/delegation.d.ts +58 -46
  177. package/dist/operations/delegation.d.ts.map +1 -1
  178. package/dist/operations/delegation.js +90 -77
  179. package/dist/operations/delegation.js.map +1 -1
  180. package/dist/operations/promote-model.operation.d.ts +2 -2
  181. package/dist/operations/promote-model.operation.d.ts.map +1 -1
  182. package/dist/operations/promote-model.operation.js +6 -2
  183. package/dist/operations/promote-model.operation.js.map +1 -1
  184. package/dist/operations/refusals.d.ts +5 -0
  185. package/dist/operations/refusals.d.ts.map +1 -1
  186. package/dist/operations/refusals.js +26 -1
  187. package/dist/operations/refusals.js.map +1 -1
  188. package/dist/operations/start-experiment-session.operation.js +3 -3
  189. package/dist/operations/train-model.mapping.d.ts +91 -0
  190. package/dist/operations/train-model.mapping.d.ts.map +1 -0
  191. package/dist/operations/train-model.mapping.js +145 -0
  192. package/dist/operations/train-model.mapping.js.map +1 -0
  193. package/dist/operations/train-model.operation.d.ts +14 -9
  194. package/dist/operations/train-model.operation.d.ts.map +1 -1
  195. package/dist/operations/train-model.operation.js +30 -51
  196. package/dist/operations/train-model.operation.js.map +1 -1
  197. package/dist/prediction-unit/decision-date-advance.d.ts +46 -0
  198. package/dist/prediction-unit/decision-date-advance.d.ts.map +1 -0
  199. package/dist/prediction-unit/decision-date-advance.js +79 -0
  200. package/dist/prediction-unit/decision-date-advance.js.map +1 -0
  201. package/dist/prediction-unit/index.d.ts +12 -0
  202. package/dist/prediction-unit/index.d.ts.map +1 -0
  203. package/dist/prediction-unit/index.js +12 -0
  204. package/dist/prediction-unit/index.js.map +1 -0
  205. package/dist/prediction-unit/target-validation.d.ts +21 -0
  206. package/dist/prediction-unit/target-validation.d.ts.map +1 -0
  207. package/dist/prediction-unit/target-validation.js +54 -0
  208. package/dist/prediction-unit/target-validation.js.map +1 -0
  209. package/dist/prediction-unit/unit-row-reader.d.ts +108 -0
  210. package/dist/prediction-unit/unit-row-reader.d.ts.map +1 -0
  211. package/dist/prediction-unit/unit-row-reader.js +348 -0
  212. package/dist/prediction-unit/unit-row-reader.js.map +1 -0
  213. package/dist/prediction-unit/unit-store.d.ts +28 -0
  214. package/dist/prediction-unit/unit-store.d.ts.map +1 -0
  215. package/dist/prediction-unit/unit-store.js +41 -0
  216. package/dist/prediction-unit/unit-store.js.map +1 -0
  217. package/dist/prediction-unit/unit-versioning.d.ts +43 -0
  218. package/dist/prediction-unit/unit-versioning.d.ts.map +1 -0
  219. package/dist/prediction-unit/unit-versioning.js +71 -0
  220. package/dist/prediction-unit/unit-versioning.js.map +1 -0
  221. package/dist/protocol/index.d.ts +9 -0
  222. package/dist/protocol/index.d.ts.map +1 -0
  223. package/dist/protocol/index.js +9 -0
  224. package/dist/protocol/index.js.map +1 -0
  225. package/dist/protocol/protocol-defaults.d.ts +37 -0
  226. package/dist/protocol/protocol-defaults.d.ts.map +1 -0
  227. package/dist/protocol/protocol-defaults.js +59 -0
  228. package/dist/protocol/protocol-defaults.js.map +1 -0
  229. package/dist/protocol/protocol-versioning.d.ts +46 -0
  230. package/dist/protocol/protocol-versioning.d.ts.map +1 -0
  231. package/dist/protocol/protocol-versioning.js +48 -0
  232. package/dist/protocol/protocol-versioning.js.map +1 -0
  233. package/dist/protocol/search-guard.d.ts +45 -0
  234. package/dist/protocol/search-guard.d.ts.map +1 -0
  235. package/dist/protocol/search-guard.js +50 -0
  236. package/dist/protocol/search-guard.js.map +1 -0
  237. package/dist/scoring/artifact-loader.d.ts +5 -32
  238. package/dist/scoring/artifact-loader.d.ts.map +1 -1
  239. package/dist/scoring/artifact-loader.js +4 -59
  240. package/dist/scoring/artifact-loader.js.map +1 -1
  241. package/dist/scoring/auto-train.d.ts +25 -5
  242. package/dist/scoring/auto-train.d.ts.map +1 -1
  243. package/dist/scoring/auto-train.js +48 -31
  244. package/dist/scoring/auto-train.js.map +1 -1
  245. package/dist/scoring/index.d.ts +3 -0
  246. package/dist/scoring/index.d.ts.map +1 -1
  247. package/dist/scoring/index.js +3 -0
  248. package/dist/scoring/index.js.map +1 -1
  249. package/dist/scoring/ml-model-inference-processor.d.ts +137 -10
  250. package/dist/scoring/ml-model-inference-processor.d.ts.map +1 -1
  251. package/dist/scoring/ml-model-inference-processor.js +383 -40
  252. package/dist/scoring/ml-model-inference-processor.js.map +1 -1
  253. package/dist/scoring/model-readiness.d.ts +45 -0
  254. package/dist/scoring/model-readiness.d.ts.map +1 -1
  255. package/dist/scoring/model-readiness.js +49 -0
  256. package/dist/scoring/model-readiness.js.map +1 -1
  257. package/dist/scoring/register.d.ts +8 -3
  258. package/dist/scoring/register.d.ts.map +1 -1
  259. package/dist/scoring/register.js +28 -4
  260. package/dist/scoring/register.js.map +1 -1
  261. package/dist/scoring/seams.d.ts +18 -2
  262. package/dist/scoring/seams.d.ts.map +1 -1
  263. package/dist/scoring/seams.js +35 -10
  264. package/dist/scoring/seams.js.map +1 -1
  265. package/dist/scoring/shadow-scoring.d.ts +245 -0
  266. package/dist/scoring/shadow-scoring.d.ts.map +1 -0
  267. package/dist/scoring/shadow-scoring.js +510 -0
  268. package/dist/scoring/shadow-scoring.js.map +1 -0
  269. package/dist/scoring/startup-register.d.ts +3 -3
  270. package/dist/scoring/startup-register.d.ts.map +1 -1
  271. package/dist/scoring/startup-register.js +10 -4
  272. package/dist/scoring/startup-register.js.map +1 -1
  273. package/dist/scoring/storage-provider-artifact-loader.d.ts +14 -0
  274. package/dist/scoring/storage-provider-artifact-loader.d.ts.map +1 -0
  275. package/dist/scoring/storage-provider-artifact-loader.js +47 -0
  276. package/dist/scoring/storage-provider-artifact-loader.js.map +1 -0
  277. package/dist/scoring/training-keys.d.ts +27 -0
  278. package/dist/scoring/training-keys.d.ts.map +1 -0
  279. package/dist/scoring/training-keys.js +54 -0
  280. package/dist/scoring/training-keys.js.map +1 -0
  281. package/dist/scoring/types.d.ts +72 -7
  282. package/dist/scoring/types.d.ts.map +1 -1
  283. package/dist/scoring/types.js +4 -0
  284. package/dist/scoring/types.js.map +1 -1
  285. package/dist/sidecar-provider.d.ts +2 -2
  286. package/dist/sidecar-provider.js +3 -3
  287. package/dist/snapshot/code-version.d.ts +16 -0
  288. package/dist/snapshot/code-version.d.ts.map +1 -0
  289. package/dist/snapshot/code-version.js +39 -0
  290. package/dist/snapshot/code-version.js.map +1 -0
  291. package/dist/snapshot/holdout-carver.d.ts +110 -0
  292. package/dist/snapshot/holdout-carver.d.ts.map +1 -0
  293. package/dist/snapshot/holdout-carver.js +171 -0
  294. package/dist/snapshot/holdout-carver.js.map +1 -0
  295. package/dist/snapshot/index.d.ts +17 -0
  296. package/dist/snapshot/index.d.ts.map +1 -0
  297. package/dist/snapshot/index.js +17 -0
  298. package/dist/snapshot/index.js.map +1 -0
  299. package/dist/snapshot/snapshot-builder.d.ts +152 -0
  300. package/dist/snapshot/snapshot-builder.d.ts.map +1 -0
  301. package/dist/snapshot/snapshot-builder.js +286 -0
  302. package/dist/snapshot/snapshot-builder.js.map +1 -0
  303. package/dist/snapshot/snapshot-file-store.d.ts +161 -0
  304. package/dist/snapshot/snapshot-file-store.d.ts.map +1 -0
  305. package/dist/snapshot/snapshot-file-store.js +204 -0
  306. package/dist/snapshot/snapshot-file-store.js.map +1 -0
  307. package/dist/snapshot/snapshot-hash.d.ts +6 -0
  308. package/dist/snapshot/snapshot-hash.d.ts.map +1 -0
  309. package/dist/snapshot/snapshot-hash.js +16 -0
  310. package/dist/snapshot/snapshot-hash.js.map +1 -0
  311. package/dist/snapshot/snapshot-manifest.d.ts +43 -0
  312. package/dist/snapshot/snapshot-manifest.d.ts.map +1 -0
  313. package/dist/snapshot/snapshot-manifest.js +43 -0
  314. package/dist/snapshot/snapshot-manifest.js.map +1 -0
  315. package/dist/snapshot/snapshot-retrainer.d.ts +107 -0
  316. package/dist/snapshot/snapshot-retrainer.d.ts.map +1 -0
  317. package/dist/snapshot/snapshot-retrainer.js +194 -0
  318. package/dist/snapshot/snapshot-retrainer.js.map +1 -0
  319. package/dist/snapshot/snapshot-serialization.d.ts +99 -0
  320. package/dist/snapshot/snapshot-serialization.d.ts.map +1 -0
  321. package/dist/snapshot/snapshot-serialization.js +191 -0
  322. package/dist/snapshot/snapshot-serialization.js.map +1 -0
  323. package/dist/snapshot/training-snapshot-store.d.ts +38 -0
  324. package/dist/snapshot/training-snapshot-store.d.ts.map +1 -0
  325. package/dist/snapshot/training-snapshot-store.js +41 -0
  326. package/dist/snapshot/training-snapshot-store.js.map +1 -0
  327. package/dist/storage/ps-storage-provider.d.ts +108 -0
  328. package/dist/storage/ps-storage-provider.d.ts.map +1 -0
  329. package/dist/storage/ps-storage-provider.js +154 -0
  330. package/dist/storage/ps-storage-provider.js.map +1 -0
  331. package/dist/training/artifact-store.d.ts +12 -103
  332. package/dist/training/artifact-store.d.ts.map +1 -1
  333. package/dist/training/artifact-store.js +13 -137
  334. package/dist/training/artifact-store.js.map +1 -1
  335. package/dist/training/compute-cost.d.ts +23 -0
  336. package/dist/training/compute-cost.d.ts.map +1 -0
  337. package/dist/training/compute-cost.js +36 -0
  338. package/dist/training/compute-cost.js.map +1 -0
  339. package/dist/training/evaluation-protocol-store.d.ts +53 -0
  340. package/dist/training/evaluation-protocol-store.d.ts.map +1 -0
  341. package/dist/training/evaluation-protocol-store.js +54 -0
  342. package/dist/training/evaluation-protocol-store.js.map +1 -0
  343. package/dist/training/index.d.ts +9 -1
  344. package/dist/training/index.d.ts.map +1 -1
  345. package/dist/training/index.js +9 -1
  346. package/dist/training/index.js.map +1 -1
  347. package/dist/training/locked-holdout.d.ts +19 -4
  348. package/dist/training/locked-holdout.d.ts.map +1 -1
  349. package/dist/training/locked-holdout.js +29 -5
  350. package/dist/training/locked-holdout.js.map +1 -1
  351. package/dist/training/seams.d.ts +34 -8
  352. package/dist/training/seams.d.ts.map +1 -1
  353. package/dist/training/seams.js +74 -18
  354. package/dist/training/seams.js.map +1 -1
  355. package/dist/training/storage-provider-artifact-store.d.ts +49 -0
  356. package/dist/training/storage-provider-artifact-store.d.ts.map +1 -0
  357. package/dist/training/storage-provider-artifact-store.js +147 -0
  358. package/dist/training/storage-provider-artifact-store.js.map +1 -0
  359. package/dist/training/trainer-model-lineage.d.ts +32 -0
  360. package/dist/training/trainer-model-lineage.d.ts.map +1 -0
  361. package/dist/training/trainer-model-lineage.js +62 -0
  362. package/dist/training/trainer-model-lineage.js.map +1 -0
  363. package/dist/training/trainer-request.d.ts +50 -0
  364. package/dist/training/trainer-request.d.ts.map +1 -0
  365. package/dist/training/trainer-request.js +65 -0
  366. package/dist/training/trainer-request.js.map +1 -0
  367. package/dist/training/trainer-result.d.ts +30 -0
  368. package/dist/training/trainer-result.d.ts.map +1 -0
  369. package/dist/training/trainer-result.js +40 -0
  370. package/dist/training/trainer-result.js.map +1 -0
  371. package/dist/training/training-engine.d.ts +417 -64
  372. package/dist/training/training-engine.d.ts.map +1 -1
  373. package/dist/training/training-engine.js +869 -178
  374. package/dist/training/training-engine.js.map +1 -1
  375. package/dist/training/training-refusal.d.ts +15 -0
  376. package/dist/training/training-refusal.d.ts.map +1 -0
  377. package/dist/training/training-refusal.js +62 -0
  378. package/dist/training/training-refusal.js.map +1 -0
  379. package/dist/training/types.d.ts +133 -41
  380. package/dist/training/types.d.ts.map +1 -1
  381. package/dist/training/types.js +4 -4
  382. package/dist/training/unit-model-lineage.d.ts +72 -0
  383. package/dist/training/unit-model-lineage.d.ts.map +1 -0
  384. package/dist/training/unit-model-lineage.js +288 -0
  385. package/dist/training/unit-model-lineage.js.map +1 -0
  386. package/dist/tsconfig.tsbuildinfo +1 -0
  387. package/package.json +16 -13
  388. package/dist/operations/__tests__/helpers.d.ts +0 -30
  389. package/dist/operations/__tests__/helpers.d.ts.map +0 -1
  390. package/dist/operations/__tests__/helpers.js +0 -44
  391. package/dist/operations/__tests__/helpers.js.map +0 -1
@@ -0,0 +1,204 @@
1
+ import { IsSafeStorageObjectKey } from '@memberjunction/storage';
2
+ import { SnapshotHash } from './snapshot-hash.js';
3
+ import { PredictiveStudioStorage } from '../storage/ps-storage-provider.js';
4
+ /**
5
+ * Builds pre-authorised downloads. `FileStorageBase.CreatePreAuthDownloadUrl` states no
6
+ * lifetime, so the lifetime of each driver's URLs is recorded here, keyed by the provider's `ServerDriverKey`, from
7
+ * what each driver's code fixes: the local file-system driver returns `file://` URLs that do not expire; the AWS S3,
8
+ * Azure Blob, Google Cloud Storage and SharePoint drivers sign their URLs for 10 minutes. Any other driver states no
9
+ * lifetime in its code (Dropbox, Box and Google Drive URLs expire on the service's own terms), so its downloads state
10
+ * none and the sidecar does not refuse them as expired; such a URL that has expired fails as a download instead.
11
+ */
12
+ export class PreAuthDownloads {
13
+ static { this.lifetimeSecondsByDriverKey = new Map([
14
+ ['local file system storage', null],
15
+ ['aws s3 storage', 600],
16
+ ['azure blob storage', 600],
17
+ ['google cloud storage', 600],
18
+ ['sharepoint storage', 600],
19
+ ]); }
20
+ /** The URL lifetime in seconds of a driver's downloads; null when its URLs do not expire or it states no lifetime. */
21
+ static LifetimeSecondsOf(serverDriverKey) {
22
+ const lifetime = PreAuthDownloads.lifetimeSecondsByDriverKey.get(serverDriverKey.trim().toLowerCase());
23
+ return lifetime === undefined ? null : lifetime;
24
+ }
25
+ /** A download issued at `now`: it expires `lifetimeSeconds` later, or never (null expiry) when the lifetime is null. */
26
+ static IssuedDownload(fileId, url, sha256, lifetimeSeconds, now = new Date()) {
27
+ return {
28
+ fileId,
29
+ url,
30
+ issuedAt: now.toISOString(),
31
+ driverLifetimeSeconds: lifetimeSeconds,
32
+ expiresAt: lifetimeSeconds === null ? null : new Date(now.getTime() + lifetimeSeconds * 1000).toISOString(),
33
+ sha256,
34
+ };
35
+ }
36
+ }
37
+ /**
38
+ * An in-process snapshot file store, for tests: the same write-once rule, no storage provider. Its downloads are
39
+ * `data:` URLs carrying the bytes, which only test trainers read: the sidecar opens `http`, `https` and `file` URLs
40
+ * and refuses a `data:` URL.
41
+ */
42
+ export class InMemorySnapshotFileStore {
43
+ /**
44
+ * @param providerId the provider ID the stored files report
45
+ * @param downloadLifetimeSeconds the lifetime its downloads state; null (the default) for downloads that do not expire
46
+ */
47
+ constructor(providerId, downloadLifetimeSeconds = null) {
48
+ this.providerId = providerId;
49
+ this.downloadLifetimeSeconds = downloadLifetimeSeconds;
50
+ /** The stored files, by file ID. */
51
+ this.Saved = new Map();
52
+ }
53
+ async Put(objectKey, _name, bytes) {
54
+ SnapshotObjectKeys.AssertSafe(objectKey);
55
+ const existing = [...this.Saved.entries()].find(([, f]) => f.Key === objectKey);
56
+ if (existing)
57
+ SnapshotWriteOnce.AcceptExisting(objectKey, existing[1].Bytes, bytes);
58
+ // A UUID-shaped ID, as an `MJ: Files` row has: the trainer's request schema validates file IDs as UUIDs.
59
+ const id = existing ? existing[0] : `00000000-0000-4000-9000-${String(this.Saved.size + 1).padStart(12, '0')}`;
60
+ if (!existing)
61
+ this.Saved.set(id, { Key: objectKey, Bytes: bytes });
62
+ return { FileID: id, ProviderID: this.providerId, ProviderKey: objectKey, Sha256: SnapshotHash.Sha256Hex(bytes), SizeBytes: bytes.byteLength };
63
+ }
64
+ async Get(fileId) {
65
+ const f = this.Saved.get(fileId);
66
+ if (!f)
67
+ throw new Error(`Training snapshots: file ${fileId} not found`);
68
+ return f.Bytes;
69
+ }
70
+ async ProviderID() {
71
+ return this.providerId;
72
+ }
73
+ async CreatePreAuthDownload(fileId, sha256, now) {
74
+ const f = this.Saved.get(fileId);
75
+ if (!f)
76
+ throw new Error(`Training snapshots: snapshot file ${fileId} not found`);
77
+ const url = `data:application/x-ndjson;base64,${Buffer.from(f.Bytes).toString('base64')}`;
78
+ return PreAuthDownloads.IssuedDownload(fileId, url, sha256, this.downloadLifetimeSeconds, now);
79
+ }
80
+ }
81
+ /** A snapshot object key that already holds different bytes: snapshot files are written once and never overwritten. */
82
+ export class SnapshotFileExistsError extends Error {
83
+ constructor(ObjectKey) {
84
+ super(`Training snapshots: ${ObjectKey} already exists with different bytes; snapshot files are write-once`);
85
+ this.ObjectKey = ObjectKey;
86
+ this.name = 'SnapshotFileExistsError';
87
+ }
88
+ }
89
+ /** The write-once rule every snapshot store applies to a key that already holds an object. */
90
+ export class SnapshotWriteOnce {
91
+ /**
92
+ * Returns when the stored bytes equal the new ones (equal SHA-256: the write is already done); throws
93
+ * `SnapshotFileExistsError` when they differ.
94
+ */
95
+ static AcceptExisting(objectKey, stored, bytes) {
96
+ if (SnapshotHash.Sha256Hex(stored) !== SnapshotHash.Sha256Hex(bytes))
97
+ throw new SnapshotFileExistsError(objectKey);
98
+ }
99
+ }
100
+ /** The object-key rule every snapshot store applies before a key reaches storage. */
101
+ export class SnapshotObjectKeys {
102
+ /** Refuses an empty key and one whose meaning depends on the provider (`..` segments, backslashes, encoded separators). */
103
+ static AssertSafe(objectKey) {
104
+ if (objectKey.trim().length === 0 || !IsSafeStorageObjectKey(objectKey)) {
105
+ throw new Error(`Training snapshots: "${objectKey}" is not a safe storage key`);
106
+ }
107
+ }
108
+ }
109
+ /** Snapshot files in an MJ storage provider, each recorded as an `MJ: Files` row. */
110
+ export class StorageProviderSnapshotFileStore {
111
+ /**
112
+ * @param entityFactory creates the `MJ: Files` rows
113
+ * @param storage the storage the files are written to and read through; its provider and user run every `MJ: Files`
114
+ * read, so a run's snapshot store and artifact store built over one storage resolve one provider once
115
+ */
116
+ constructor(entityFactory, storage) {
117
+ this.entityFactory = entityFactory;
118
+ this.storage = storage;
119
+ }
120
+ /**
121
+ * A store over its own {@link PredictiveStudioStorage}.
122
+ *
123
+ * @param entityFactory creates the `MJ: Files` rows
124
+ * @param provider the provider the `MJ: Files` reads and the storage-provider cache load run on
125
+ * @param contextUser the acting user
126
+ * @param providerName the provider to write to (default: `PS_STORAGE_PROVIDER`, or "Local File System" when it is unset or empty)
127
+ */
128
+ static ForProviderName(entityFactory, provider, contextUser, providerName) {
129
+ return new StorageProviderSnapshotFileStore(entityFactory, new PredictiveStudioStorage(provider, contextUser, providerName));
130
+ }
131
+ async ProviderID() {
132
+ return (await this.storage.ConfiguredDriver()).Provider.ID;
133
+ }
134
+ /**
135
+ * Check-then-write. A key that already holds an object is read and compared: identical bytes succeed without a
136
+ * write (reusing the object's `MJ: Files` row, or recording one when an earlier build left none), different bytes
137
+ * are refused. A new object is stored and its `MJ: Files` row saved.
138
+ */
139
+ async Put(objectKey, name, bytes, contentType) {
140
+ SnapshotObjectKeys.AssertSafe(objectKey);
141
+ const binding = await this.storage.ConfiguredDriver();
142
+ const sha256 = SnapshotHash.Sha256Hex(bytes);
143
+ const row = {
144
+ ObjectKey: objectKey, Name: name, ContentType: contentType,
145
+ Detail: `Predictive Studio training snapshot file (${bytes.byteLength} bytes, sha256 ${sha256})`,
146
+ };
147
+ const fileId = (await binding.Driver.ObjectExists(objectKey))
148
+ ? await this.acceptExisting(binding, row, bytes)
149
+ : await this.writeNew(binding, row, bytes);
150
+ return { FileID: fileId, ProviderID: binding.Provider.ID, ProviderKey: objectKey, Sha256: sha256, SizeBytes: bytes.byteLength };
151
+ }
152
+ /** The file's bytes, read through the provider its `MJ: Files` row names (not necessarily the configured one). */
153
+ async Get(fileId) {
154
+ const location = await this.fileLocationOf(fileId);
155
+ const { Driver } = await this.storage.DriverFor(location.ProviderID);
156
+ return new Uint8Array(await Driver.GetObject({ fullPath: location.ProviderKey }));
157
+ }
158
+ /**
159
+ * A download issued by the provider the file's `MJ: Files` row names (as `Get` reads it, never the configured
160
+ * provider), stating that provider's URL lifetime.
161
+ */
162
+ async CreatePreAuthDownload(fileId, sha256, now) {
163
+ const location = await this.fileLocationOf(fileId);
164
+ const { Driver, Provider } = await this.storage.DriverFor(location.ProviderID);
165
+ const url = await Driver.CreatePreAuthDownloadUrl(location.ProviderKey);
166
+ return PreAuthDownloads.IssuedDownload(fileId, url, sha256, PreAuthDownloads.LifetimeSecondsOf(Provider.ServerDriverKey), now);
167
+ }
168
+ /** An existing object: identical bytes reuse it (and its `MJ: Files` row when there is one); different bytes throw. */
169
+ async acceptExisting(binding, row, bytes) {
170
+ const stored = new Uint8Array(await binding.Driver.GetObject({ fullPath: row.ObjectKey }));
171
+ SnapshotWriteOnce.AcceptExisting(row.ObjectKey, stored, bytes);
172
+ // The earliest-created row recording this provider's object, so every writer picks the same one.
173
+ const recorded = await this.storage.FileRowIDFor(binding.Provider.ID, row.ObjectKey);
174
+ if (recorded !== null)
175
+ return recorded;
176
+ const file = await this.storage.SaveFileRow(binding, row, this.entityFactory);
177
+ // The object predates this write, so a failed row leaves it in place.
178
+ if (file.Saved === false)
179
+ throw new Error(`Training snapshots: saving the MJ: Files row for ${row.ObjectKey} failed: ${file.Error}`);
180
+ return file.ID;
181
+ }
182
+ /**
183
+ * A new object: stored, then recorded. When the row cannot be saved the object stays (never deleted: another build
184
+ * of the same content may have written, and committed a snapshot over, the same bytes under this key); the next
185
+ * identical write records the missing row.
186
+ */
187
+ async writeNew(binding, row, bytes) {
188
+ if (!(await binding.Driver.PutObject(row.ObjectKey, Buffer.from(bytes), row.ContentType)))
189
+ throw new Error(`Training snapshots: storage refused ${row.ObjectKey}`);
190
+ const file = await this.storage.SaveFileRow(binding, row, this.entityFactory);
191
+ if (file.Saved === false)
192
+ throw new Error(`Training snapshots: saving the MJ: Files row for ${row.ObjectKey} failed: ${file.Error}`);
193
+ return file.ID;
194
+ }
195
+ /** Where a snapshot's `MJ: Files` row says its object is: the provider and the stored key, which must be safe. */
196
+ async fileLocationOf(fileId) {
197
+ const location = await this.storage.LocationOf(fileId);
198
+ if (!location?.ProviderKey)
199
+ throw new Error(`Training snapshots: file ${fileId} has no storage key`);
200
+ SnapshotObjectKeys.AssertSafe(location.ProviderKey);
201
+ return { ProviderID: location.ProviderID, ProviderKey: location.ProviderKey };
202
+ }
203
+ }
204
+ //# sourceMappingURL=snapshot-file-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-file-store.js","sourceRoot":"","sources":["../../src/snapshot/snapshot-file-store.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,sBAAsB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C,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;QACnK,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC9E,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,GAAG,CAAC,SAAS,YAAY,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACrI,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,kHAAkH;IAC1G,KAAK,CAAC,cAAc,CAAC,MAAc;QACzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACvD,IAAI,CAAC,QAAQ,EAAE,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,qBAAqB,CAAC,CAAC;QACrG,kBAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC;IAChF,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ /** SHA-256 hashing of snapshot bytes and canonical-JSON strings. */
2
+ export declare class SnapshotHash {
3
+ /** SHA-256 of bytes or a UTF-8 string, lower-case hex: every Training Snapshot file and content hash. */
4
+ static Sha256Hex(data: Uint8Array | string): string;
5
+ }
6
+ //# sourceMappingURL=snapshot-hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-hash.d.ts","sourceRoot":"","sources":["../../src/snapshot/snapshot-hash.ts"],"names":[],"mappings":"AASA,oEAAoE;AACpE,qBAAa,YAAY;IACvB,yGAAyG;WAC3F,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM;CAG3D"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @module snapshot/snapshot-hash
3
+ *
4
+ * The byte hash of the Training Snapshot files and content hash. Canonical JSON is MJ's existing `Canonicalize` from
5
+ * `@memberjunction/global` (keys sorted at every depth, no whitespace), the canonicalizer Feature Pipelines' content
6
+ * hash uses, so this module adds only SHA-256.
7
+ */
8
+ import { createHash } from 'node:crypto';
9
+ /** SHA-256 hashing of snapshot bytes and canonical-JSON strings. */
10
+ export class SnapshotHash {
11
+ /** SHA-256 of bytes or a UTF-8 string, lower-case hex: every Training Snapshot file and content hash. */
12
+ static Sha256Hex(data) {
13
+ return createHash('sha256').update(data).digest('hex');
14
+ }
15
+ }
16
+ //# sourceMappingURL=snapshot-hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-hash.js","sourceRoot":"","sources":["../../src/snapshot/snapshot-hash.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,oEAAoE;AACpE,MAAM,OAAO,YAAY;IACvB,yGAAyG;IAClG,MAAM,CAAC,SAAS,CAAC,IAAyB;QAC/C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @module snapshot/snapshot-manifest
3
+ *
4
+ * Reading a Training Snapshot's stored files back: the one SHA-256 check every read applies (a stored file whose bytes
5
+ * no longer hash to its column on the snapshot row is refused) and the one manifest reader, which verifies the
6
+ * manifest file and parses every line through the snapshot row-key schema.
7
+ */
8
+ import type { MJMLTrainingSnapshotEntity } from '@memberjunction/core-entities';
9
+ import type { SnapshotRowKey } from '@memberjunction/predictive-studio-core';
10
+ import type { ISnapshotFileStore } from './snapshot-file-store.js';
11
+ /** What a snapshot read verifies: one of the three stored files, or the content hash the row's identity yields. */
12
+ export type SnapshotIntegrityTarget = 'matrix' | 'manifest' | 'provenance' | 'content';
13
+ /**
14
+ * A stored snapshot file whose bytes no longer match the SHA-256 on its snapshot row (`File` names the file), or a
15
+ * snapshot whose matrix and manifest hashes and identity columns no longer yield its `ContentHash` (`File` is
16
+ * `'content'`).
17
+ */
18
+ export declare class SnapshotIntegrityError extends Error {
19
+ readonly File: SnapshotIntegrityTarget;
20
+ readonly Expected: string;
21
+ readonly Actual: string;
22
+ constructor(File: SnapshotIntegrityTarget, Expected: string, Actual: string);
23
+ }
24
+ /** The snapshot row columns the manifest reader reads. */
25
+ export type SnapshotManifestRef = Pick<MJMLTrainingSnapshotEntity, 'RowManifestFileID' | 'RowManifestSha256'>;
26
+ /** Verified reads of a snapshot's stored files. */
27
+ export declare class SnapshotManifest {
28
+ /**
29
+ * The snapshot's row manifest: the file is read through the store, its bytes must hash to the row's
30
+ * `RowManifestSha256`, and every line is checked with the snapshot row-key schema.
31
+ *
32
+ * @throws SnapshotIntegrityError (`manifest`) when the bytes differ from the stored SHA-256
33
+ * @throws SnapshotFileFormatError when a line is not a snapshot row key
34
+ */
35
+ static ReadSnapshotManifest(snapshot: SnapshotManifestRef, files: ISnapshotFileStore): Promise<SnapshotRowKey[]>;
36
+ /**
37
+ * The bytes' SHA-256 when it equals the one stored on the snapshot row; the one check every stored-file read applies.
38
+ *
39
+ * @throws SnapshotIntegrityError naming the file
40
+ */
41
+ static VerifiedSha256(file: SnapshotIntegrityTarget, bytes: Uint8Array, expected: string): string;
42
+ }
43
+ //# sourceMappingURL=snapshot-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-manifest.d.ts","sourceRoot":"","sources":["../../src/snapshot/snapshot-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,mHAAmH;AACnH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;AAEvF;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;aACnB,IAAI,EAAE,uBAAuB;aAAkB,QAAQ,EAAE,MAAM;aAAkB,MAAM,EAAE,MAAM;gBAA/F,IAAI,EAAE,uBAAuB,EAAkB,QAAQ,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM;CAI5H;AAED,0DAA0D;AAC1D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,0BAA0B,EAAE,mBAAmB,GAAG,mBAAmB,CAAC,CAAC;AAE9G,mDAAmD;AACnD,qBAAa,gBAAgB;IAC3B;;;;;;OAMG;WACiB,oBAAoB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAM7H;;;;OAIG;WACW,cAAc,CAAC,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;CAKzG"}
@@ -0,0 +1,43 @@
1
+ import { SnapshotHash } from './snapshot-hash.js';
2
+ import { SnapshotFiles } from './snapshot-serialization.js';
3
+ /**
4
+ * A stored snapshot file whose bytes no longer match the SHA-256 on its snapshot row (`File` names the file), or a
5
+ * snapshot whose matrix and manifest hashes and identity columns no longer yield its `ContentHash` (`File` is
6
+ * `'content'`).
7
+ */
8
+ export class SnapshotIntegrityError extends Error {
9
+ constructor(File, Expected, Actual) {
10
+ super(`Snapshot ${File} sha256 mismatch: stored ${Expected}, read ${Actual}`);
11
+ this.File = File;
12
+ this.Expected = Expected;
13
+ this.Actual = Actual;
14
+ this.name = 'SnapshotIntegrityError';
15
+ }
16
+ }
17
+ /** Verified reads of a snapshot's stored files. */
18
+ export class SnapshotManifest {
19
+ /**
20
+ * The snapshot's row manifest: the file is read through the store, its bytes must hash to the row's
21
+ * `RowManifestSha256`, and every line is checked with the snapshot row-key schema.
22
+ *
23
+ * @throws SnapshotIntegrityError (`manifest`) when the bytes differ from the stored SHA-256
24
+ * @throws SnapshotFileFormatError when a line is not a snapshot row key
25
+ */
26
+ static async ReadSnapshotManifest(snapshot, files) {
27
+ const bytes = await files.Get(snapshot.RowManifestFileID);
28
+ SnapshotManifest.VerifiedSha256('manifest', bytes, snapshot.RowManifestSha256);
29
+ return SnapshotFiles.ParseManifestLines(bytes);
30
+ }
31
+ /**
32
+ * The bytes' SHA-256 when it equals the one stored on the snapshot row; the one check every stored-file read applies.
33
+ *
34
+ * @throws SnapshotIntegrityError naming the file
35
+ */
36
+ static VerifiedSha256(file, bytes, expected) {
37
+ const actual = SnapshotHash.Sha256Hex(bytes);
38
+ if (actual !== expected)
39
+ throw new SnapshotIntegrityError(file, expected, actual);
40
+ return actual;
41
+ }
42
+ }
43
+ //# sourceMappingURL=snapshot-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-manifest.js","sourceRoot":"","sources":["../../src/snapshot/snapshot-manifest.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAA4B,IAA6B,EAAkB,QAAgB,EAAkB,MAAc;QACzH,KAAK,CAAC,YAAY,IAAI,4BAA4B,QAAQ,UAAU,MAAM,EAAE,CAAC,CAAC;QADpD,SAAI,GAAJ,IAAI,CAAyB;QAAkB,aAAQ,GAAR,QAAQ,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAQ;QAEzH,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAKD,mDAAmD;AACnD,MAAM,OAAO,gBAAgB;IAC3B;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,QAA6B,EAAE,KAAyB;QAC/F,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAC1D,gBAAgB,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAC/E,OAAO,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,cAAc,CAAC,IAA6B,EAAE,KAAiB,EAAE,QAAgB;QAC7F,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,MAAM,KAAK,QAAQ;YAAE,MAAM,IAAI,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,107 @@
1
+ import type { MJMLTrainingRunEntity, MJMLTrainingSnapshotEntity } from '@memberjunction/core-entities';
2
+ import { type EvaluationProtocolSpec, type PredictionUnitSpec, type StoredTrainerResult, type TrainerRequestConfig, type TrainingRunResults } from '@memberjunction/predictive-studio-core';
3
+ import type { TrainingDeps } from '../training/types.js';
4
+ import { type SnapshotContent } from './snapshot-serialization.js';
5
+ import { type ISnapshotFileStore } from './snapshot-file-store.js';
6
+ import { type ITrainingSnapshotStore } from './training-snapshot-store.js';
7
+ /** The outcome of retraining a completed run from its Training Snapshot. */
8
+ export interface RetrainResult {
9
+ readonly TrainingRunID: MJMLTrainingRunEntity['ID'];
10
+ readonly TrainingSnapshotID: MJMLTrainingSnapshotEntity['ID'];
11
+ /**
12
+ * Records that the three stored files were verified against the row's SHA-256 columns. Always `true` on a returned
13
+ * result: a mismatch throws `SnapshotIntegrityError` before the trainer is called.
14
+ */
15
+ readonly FilesVerified: true;
16
+ /**
17
+ * Records that the content hash was recomputed from the verified file hashes and the row's identity columns and
18
+ * matched `ContentHash`. Always `true` on a returned result: a mismatch throws `SnapshotIntegrityError`.
19
+ */
20
+ readonly ContentHashVerified: true;
21
+ /** The holdout metrics the run recorded. */
22
+ readonly Original: Readonly<Record<string, number>>;
23
+ /** The holdout metrics the retraining returned. */
24
+ readonly Retrained: Readonly<Record<string, number>>;
25
+ /** The largest absolute difference over every holdout metric; `Infinity` when a metric is on one side only. */
26
+ readonly MaxAbsDiff: number;
27
+ /** Every holdout metric of both trainings is present on both sides and within the tolerance, and there is at least one. */
28
+ readonly Reproduced: boolean;
29
+ }
30
+ /** The largest metric difference and how many metric names it covered. */
31
+ export interface MetricDifference {
32
+ readonly Value: number;
33
+ readonly Keys: number;
34
+ }
35
+ /** What a completed run logged: the trainer's stored result and the request settings it was called with. */
36
+ export interface LoggedTrainerRun {
37
+ readonly Result: StoredTrainerResult;
38
+ readonly Request: TrainerRequestConfig;
39
+ }
40
+ /**
41
+ * Retrains from Training Snapshots: `Retrain` re-runs a completed run through the protocol trainer from its verified
42
+ * snapshot files, with its reads split into protected steps a subclass can replace.
43
+ */
44
+ export declare class SnapshotRetrainer {
45
+ /** The default largest holdout-metric difference a retraining may show and still reproduce its run. */
46
+ static readonly DefaultTolerance = 1e-9;
47
+ /**
48
+ * Re-runs a completed unit run from its snapshot files and logged trainer request. The run and snapshot are read
49
+ * through `deps.snapshots` and the files through `deps.snapshotFiles` (defaults: the RunView and storage-provider
50
+ * stores on `deps.provider`, as `deps.contextUser`).
51
+ *
52
+ * @param trainingRunId the `MJ: ML Training Runs` row to retrain
53
+ * @param deps the training seams; only the snapshot stores, the trainer, the provider and the user are used
54
+ * @param tolerance the largest holdout-metric difference that still counts as reproduced
55
+ * @returns both metric sets, their largest difference and whether the run reproduced
56
+ * @throws Error when the run logged no trainer request (only runs trained through `/trainer` are retrained)
57
+ * @throws SnapshotIntegrityError when a stored file or the content hash does not match the snapshot row
58
+ */
59
+ Retrain(trainingRunId: string, deps: TrainingDeps, tolerance?: number): Promise<RetrainResult>;
60
+ /**
61
+ * Sends a run's logged request settings to the trainer again, with new downloads of the verified
62
+ * snapshot files, under the protocol and unit the run was trained with; the retraining's holdout metrics.
63
+ *
64
+ * @throws Error when the deps have no trainer, the protocol or unit row is missing or does not parse, or the
65
+ * retraining does not complete
66
+ */
67
+ protected RetrainThroughTrainer(run: MJMLTrainingRunEntity, snapshot: MJMLTrainingSnapshotEntity, files: ISnapshotFileStore, logged: LoggedTrainerRun, deps: TrainingDeps): Promise<Record<string, number>>;
68
+ /**
69
+ * The protocol a retraining runs under is the one the run logged; the snapshot's `EvaluationProtocolID` is covered by
70
+ * its verified content hash. A run whose log names another protocol (an edited run row) would retrain under rules the
71
+ * snapshot was not frozen for, so it is refused.
72
+ *
73
+ * @throws Error naming both protocols when they differ
74
+ */
75
+ private static assertLoggedProtocolIsSnapshots;
76
+ /** The Evaluation Protocol a run was trained under, read through `deps.protocols` (default: RunView on `deps.provider`). */
77
+ protected LoadProtocolSpec(protocolId: string, deps: TrainingDeps): Promise<EvaluationProtocolSpec>;
78
+ /** The Prediction Unit version a snapshot was built from, read through `deps.predictionUnits` (default: RunView on `deps.provider`). */
79
+ protected LoadUnitSpec(unitId: string, deps: TrainingDeps): Promise<PredictionUnitSpec>;
80
+ /** Both metric sets of a retraining, their largest difference and whether the run reproduced. */
81
+ private static compared;
82
+ /**
83
+ * The trainer result and request a completed run stored. A run without them is refused, naming it: only runs trained
84
+ * through `/trainer` are retrained.
85
+ */
86
+ private static loggedTrainerRunOf;
87
+ /**
88
+ * The largest |original − retrained| over every metric name on either side. A name present on one side only makes
89
+ * the difference `Infinity` (the retraining did not measure what the run measured), and so does a non-finite value.
90
+ */
91
+ static MaxAbsDiff(original: Readonly<Record<string, number>>, retrained: Readonly<Record<string, number>>): MetricDifference;
92
+ /**
93
+ * Reads the three files in parallel and refuses any whose SHA-256 differs from its column on the snapshot row (the
94
+ * provenance file included: it is outside the content hash, so its own column is its only check), then refuses a
95
+ * row whose verified matrix and manifest hashes and identity columns no longer yield its `ContentHash`.
96
+ *
97
+ * @throws SnapshotIntegrityError naming the file, or `'content'`
98
+ */
99
+ protected ReadVerifiedContent(snapshot: MJMLTrainingSnapshotEntity, files: ISnapshotFileStore): Promise<SnapshotContent>;
100
+ /** The run's results envelope, parsed once; a run without a readable envelope is refused, naming it. */
101
+ protected StoredResultsOf(run: MJMLTrainingRunEntity): TrainingRunResults;
102
+ /** Where the run and its snapshot are read: `deps.snapshots`, or the RunView store on the request's provider. */
103
+ protected SnapshotStore(deps: TrainingDeps): ITrainingSnapshotStore;
104
+ /** Where the snapshot files are read: `deps.snapshotFiles`, or the storage-provider store on the request's provider. */
105
+ protected FileStore(deps: TrainingDeps): ISnapshotFileStore;
106
+ }
107
+ //# sourceMappingURL=snapshot-retrainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-retrainer.d.ts","sourceRoot":"","sources":["../../src/snapshot/snapshot-retrainer.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACvG,OAAO,EAKL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,EAAoC,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEtG,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACpD,Q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