@memberjunction/predictive-studio 0.0.1 → 5.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +101 -28
  2. package/dist/actions/base-predictive-studio.action.d.ts +63 -0
  3. package/dist/actions/base-predictive-studio.action.d.ts.map +1 -0
  4. package/dist/actions/base-predictive-studio.action.js +125 -0
  5. package/dist/actions/base-predictive-studio.action.js.map +1 -0
  6. package/dist/actions/index.d.ts +38 -0
  7. package/dist/actions/index.d.ts.map +1 -0
  8. package/dist/actions/index.js +49 -0
  9. package/dist/actions/index.js.map +1 -0
  10. package/dist/actions/model-scoring-action-generator.d.ts +108 -0
  11. package/dist/actions/model-scoring-action-generator.d.ts.map +1 -0
  12. package/dist/actions/model-scoring-action-generator.js +316 -0
  13. package/dist/actions/model-scoring-action-generator.js.map +1 -0
  14. package/dist/actions/promote-model.action.d.ts +102 -0
  15. package/dist/actions/promote-model.action.d.ts.map +1 -0
  16. package/dist/actions/promote-model.action.js +132 -0
  17. package/dist/actions/promote-model.action.js.map +1 -0
  18. package/dist/actions/promote-model.gate.d.ts +77 -0
  19. package/dist/actions/promote-model.gate.d.ts.map +1 -0
  20. package/dist/actions/promote-model.gate.js +205 -0
  21. package/dist/actions/promote-model.gate.js.map +1 -0
  22. package/dist/actions/run-experiment.action.d.ts +60 -0
  23. package/dist/actions/run-experiment.action.d.ts.map +1 -0
  24. package/dist/actions/run-experiment.action.js +134 -0
  25. package/dist/actions/run-experiment.action.js.map +1 -0
  26. package/dist/actions/run-experiment.deps.d.ts +47 -0
  27. package/dist/actions/run-experiment.deps.d.ts.map +1 -0
  28. package/dist/actions/run-experiment.deps.js +71 -0
  29. package/dist/actions/run-experiment.deps.js.map +1 -0
  30. package/dist/actions/schedule-model-scoring.action.d.ts +71 -0
  31. package/dist/actions/schedule-model-scoring.action.d.ts.map +1 -0
  32. package/dist/actions/schedule-model-scoring.action.js +148 -0
  33. package/dist/actions/schedule-model-scoring.action.js.map +1 -0
  34. package/dist/actions/score-record-set.action.d.ts +133 -0
  35. package/dist/actions/score-record-set.action.d.ts.map +1 -0
  36. package/dist/actions/score-record-set.action.js +136 -0
  37. package/dist/actions/score-record-set.action.js.map +1 -0
  38. package/dist/actions/score-record-set.runner.d.ts +192 -0
  39. package/dist/actions/score-record-set.runner.d.ts.map +1 -0
  40. package/dist/actions/score-record-set.runner.js +416 -0
  41. package/dist/actions/score-record-set.runner.js.map +1 -0
  42. package/dist/actions/train-model.action.d.ts +57 -0
  43. package/dist/actions/train-model.action.d.ts.map +1 -0
  44. package/dist/actions/train-model.action.js +111 -0
  45. package/dist/actions/train-model.action.js.map +1 -0
  46. package/dist/agent/index.d.ts +14 -0
  47. package/dist/agent/index.d.ts.map +1 -0
  48. package/dist/agent/index.js +14 -0
  49. package/dist/agent/index.js.map +1 -0
  50. package/dist/agent/model-dev-orchestrator-agent.d.ts +42 -0
  51. package/dist/agent/model-dev-orchestrator-agent.d.ts.map +1 -0
  52. package/dist/agent/model-dev-orchestrator-agent.js +76 -0
  53. package/dist/agent/model-dev-orchestrator-agent.js.map +1 -0
  54. package/dist/agent/modeling-plan-to-pipeline.d.ts +49 -0
  55. package/dist/agent/modeling-plan-to-pipeline.d.ts.map +1 -0
  56. package/dist/agent/modeling-plan-to-pipeline.js +101 -0
  57. package/dist/agent/modeling-plan-to-pipeline.js.map +1 -0
  58. package/dist/agent/pipeline-builder-agent.d.ts +58 -0
  59. package/dist/agent/pipeline-builder-agent.d.ts.map +1 -0
  60. package/dist/agent/pipeline-builder-agent.js +101 -0
  61. package/dist/agent/pipeline-builder-agent.js.map +1 -0
  62. package/dist/agent/pipeline-builder.d.ts +67 -0
  63. package/dist/agent/pipeline-builder.d.ts.map +1 -0
  64. package/dist/agent/pipeline-builder.js +114 -0
  65. package/dist/agent/pipeline-builder.js.map +1 -0
  66. package/dist/experiment/concurrency.d.ts +41 -0
  67. package/dist/experiment/concurrency.d.ts.map +1 -0
  68. package/dist/experiment/concurrency.js +54 -0
  69. package/dist/experiment/concurrency.js.map +1 -0
  70. package/dist/experiment/experiment-orchestrator.d.ts +136 -0
  71. package/dist/experiment/experiment-orchestrator.d.ts.map +1 -0
  72. package/dist/experiment/experiment-orchestrator.js +408 -0
  73. package/dist/experiment/experiment-orchestrator.js.map +1 -0
  74. package/dist/experiment/index.d.ts +17 -0
  75. package/dist/experiment/index.d.ts.map +1 -0
  76. package/dist/experiment/index.js +17 -0
  77. package/dist/experiment/index.js.map +1 -0
  78. package/dist/experiment/leaderboard.d.ts +50 -0
  79. package/dist/experiment/leaderboard.d.ts.map +1 -0
  80. package/dist/experiment/leaderboard.js +91 -0
  81. package/dist/experiment/leaderboard.js.map +1 -0
  82. package/dist/experiment/seams.d.ts +95 -0
  83. package/dist/experiment/seams.d.ts.map +1 -0
  84. package/dist/experiment/seams.js +126 -0
  85. package/dist/experiment/seams.js.map +1 -0
  86. package/dist/experiment/types.d.ts +228 -0
  87. package/dist/experiment/types.d.ts.map +1 -0
  88. package/dist/experiment/types.js +19 -0
  89. package/dist/experiment/types.js.map +1 -0
  90. package/dist/experiment/wave-strategist.d.ts +31 -0
  91. package/dist/experiment/wave-strategist.d.ts.map +1 -0
  92. package/dist/experiment/wave-strategist.js +50 -0
  93. package/dist/experiment/wave-strategist.js.map +1 -0
  94. package/dist/feature-assembly/as-of.d.ts +74 -0
  95. package/dist/feature-assembly/as-of.d.ts.map +1 -0
  96. package/dist/feature-assembly/as-of.js +136 -0
  97. package/dist/feature-assembly/as-of.js.map +1 -0
  98. package/dist/feature-assembly/data-access.d.ts +114 -0
  99. package/dist/feature-assembly/data-access.d.ts.map +1 -0
  100. package/dist/feature-assembly/data-access.js +68 -0
  101. package/dist/feature-assembly/data-access.js.map +1 -0
  102. package/dist/feature-assembly/feature-assembly-executor.d.ts +273 -0
  103. package/dist/feature-assembly/feature-assembly-executor.d.ts.map +1 -0
  104. package/dist/feature-assembly/feature-assembly-executor.js +521 -0
  105. package/dist/feature-assembly/feature-assembly-executor.js.map +1 -0
  106. package/dist/feature-assembly/index.d.ts +13 -0
  107. package/dist/feature-assembly/index.d.ts.map +1 -0
  108. package/dist/feature-assembly/index.js +13 -0
  109. package/dist/feature-assembly/index.js.map +1 -0
  110. package/dist/feature-assembly/leakage-guard.d.ts +86 -0
  111. package/dist/feature-assembly/leakage-guard.d.ts.map +1 -0
  112. package/dist/feature-assembly/leakage-guard.js +111 -0
  113. package/dist/feature-assembly/leakage-guard.js.map +1 -0
  114. package/dist/feature-assembly/vision-llm.d.ts +125 -0
  115. package/dist/feature-assembly/vision-llm.d.ts.map +1 -0
  116. package/dist/feature-assembly/vision-llm.js +211 -0
  117. package/dist/feature-assembly/vision-llm.js.map +1 -0
  118. package/dist/feature-pipelines/feature-pipeline-engine.d.ts +159 -0
  119. package/dist/feature-pipelines/feature-pipeline-engine.d.ts.map +1 -0
  120. package/dist/feature-pipelines/feature-pipeline-engine.js +298 -0
  121. package/dist/feature-pipelines/feature-pipeline-engine.js.map +1 -0
  122. package/dist/feature-pipelines/index.d.ts +13 -0
  123. package/dist/feature-pipelines/index.d.ts.map +1 -0
  124. package/dist/feature-pipelines/index.js +13 -0
  125. package/dist/feature-pipelines/index.js.map +1 -0
  126. package/dist/feature-pipelines/types.d.ts +72 -0
  127. package/dist/feature-pipelines/types.d.ts.map +1 -0
  128. package/dist/feature-pipelines/types.js +17 -0
  129. package/dist/feature-pipelines/types.js.map +1 -0
  130. package/dist/index.d.ts +37 -0
  131. package/dist/index.d.ts.map +1 -0
  132. package/dist/index.js +80 -0
  133. package/dist/index.js.map +1 -0
  134. package/dist/maintenance/index.d.ts +19 -0
  135. package/dist/maintenance/index.d.ts.map +1 -0
  136. package/dist/maintenance/index.js +19 -0
  137. package/dist/maintenance/index.js.map +1 -0
  138. package/dist/maintenance/maintenance-engine.d.ts +152 -0
  139. package/dist/maintenance/maintenance-engine.d.ts.map +1 -0
  140. package/dist/maintenance/maintenance-engine.js +412 -0
  141. package/dist/maintenance/maintenance-engine.js.map +1 -0
  142. package/dist/maintenance/metrics.d.ts +37 -0
  143. package/dist/maintenance/metrics.d.ts.map +1 -0
  144. package/dist/maintenance/metrics.js +85 -0
  145. package/dist/maintenance/metrics.js.map +1 -0
  146. package/dist/maintenance/seams.d.ts +85 -0
  147. package/dist/maintenance/seams.d.ts.map +1 -0
  148. package/dist/maintenance/seams.js +166 -0
  149. package/dist/maintenance/seams.js.map +1 -0
  150. package/dist/maintenance/types.d.ts +318 -0
  151. package/dist/maintenance/types.d.ts.map +1 -0
  152. package/dist/maintenance/types.js +27 -0
  153. package/dist/maintenance/types.js.map +1 -0
  154. package/dist/operations/__tests__/helpers.d.ts +30 -0
  155. package/dist/operations/__tests__/helpers.d.ts.map +1 -0
  156. package/dist/operations/__tests__/helpers.js +44 -0
  157. package/dist/operations/__tests__/helpers.js.map +1 -0
  158. package/dist/operations/control-experiment-session.operation.d.ts +33 -0
  159. package/dist/operations/control-experiment-session.operation.d.ts.map +1 -0
  160. package/dist/operations/control-experiment-session.operation.js +71 -0
  161. package/dist/operations/control-experiment-session.operation.js.map +1 -0
  162. package/dist/operations/create-scoring-process.operation.d.ts +30 -0
  163. package/dist/operations/create-scoring-process.operation.d.ts.map +1 -0
  164. package/dist/operations/create-scoring-process.operation.js +65 -0
  165. package/dist/operations/create-scoring-process.operation.js.map +1 -0
  166. package/dist/operations/delegation.d.ts +113 -0
  167. package/dist/operations/delegation.d.ts.map +1 -0
  168. package/dist/operations/delegation.js +139 -0
  169. package/dist/operations/delegation.js.map +1 -0
  170. package/dist/operations/index.d.ts +40 -0
  171. package/dist/operations/index.d.ts.map +1 -0
  172. package/dist/operations/index.js +55 -0
  173. package/dist/operations/index.js.map +1 -0
  174. package/dist/operations/promote-model.operation.d.ts +57 -0
  175. package/dist/operations/promote-model.operation.d.ts.map +1 -0
  176. package/dist/operations/promote-model.operation.js +113 -0
  177. package/dist/operations/promote-model.operation.js.map +1 -0
  178. package/dist/operations/run-feature-pipeline.operation.d.ts +56 -0
  179. package/dist/operations/run-feature-pipeline.operation.d.ts.map +1 -0
  180. package/dist/operations/run-feature-pipeline.operation.js +94 -0
  181. package/dist/operations/run-feature-pipeline.operation.js.map +1 -0
  182. package/dist/operations/score-record-set.operation.d.ts +47 -0
  183. package/dist/operations/score-record-set.operation.d.ts.map +1 -0
  184. package/dist/operations/score-record-set.operation.js +113 -0
  185. package/dist/operations/score-record-set.operation.js.map +1 -0
  186. package/dist/operations/start-experiment-session.operation.d.ts +66 -0
  187. package/dist/operations/start-experiment-session.operation.d.ts.map +1 -0
  188. package/dist/operations/start-experiment-session.operation.js +132 -0
  189. package/dist/operations/start-experiment-session.operation.js.map +1 -0
  190. package/dist/operations/train-model.operation.d.ts +50 -0
  191. package/dist/operations/train-model.operation.d.ts.map +1 -0
  192. package/dist/operations/train-model.operation.js +114 -0
  193. package/dist/operations/train-model.operation.js.map +1 -0
  194. package/dist/scheduling/index.d.ts +13 -0
  195. package/dist/scheduling/index.d.ts.map +1 -0
  196. package/dist/scheduling/index.js +13 -0
  197. package/dist/scheduling/index.js.map +1 -0
  198. package/dist/scheduling/scheduled-model-scoring.d.ts +169 -0
  199. package/dist/scheduling/scheduled-model-scoring.d.ts.map +1 -0
  200. package/dist/scheduling/scheduled-model-scoring.js +189 -0
  201. package/dist/scheduling/scheduled-model-scoring.js.map +1 -0
  202. package/dist/scoring/artifact-loader.d.ts +65 -0
  203. package/dist/scoring/artifact-loader.d.ts.map +1 -0
  204. package/dist/scoring/artifact-loader.js +97 -0
  205. package/dist/scoring/artifact-loader.js.map +1 -0
  206. package/dist/scoring/index.d.ts +26 -0
  207. package/dist/scoring/index.d.ts.map +1 -0
  208. package/dist/scoring/index.js +26 -0
  209. package/dist/scoring/index.js.map +1 -0
  210. package/dist/scoring/ml-model-inference-processor.d.ts +154 -0
  211. package/dist/scoring/ml-model-inference-processor.d.ts.map +1 -0
  212. package/dist/scoring/ml-model-inference-processor.js +320 -0
  213. package/dist/scoring/ml-model-inference-processor.js.map +1 -0
  214. package/dist/scoring/ml-model-score-enricher.d.ts +80 -0
  215. package/dist/scoring/ml-model-score-enricher.d.ts.map +1 -0
  216. package/dist/scoring/ml-model-score-enricher.js +139 -0
  217. package/dist/scoring/ml-model-score-enricher.js.map +1 -0
  218. package/dist/scoring/register.d.ts +81 -0
  219. package/dist/scoring/register.d.ts.map +1 -0
  220. package/dist/scoring/register.js +105 -0
  221. package/dist/scoring/register.js.map +1 -0
  222. package/dist/scoring/scoring-binding.d.ts +72 -0
  223. package/dist/scoring/scoring-binding.d.ts.map +1 -0
  224. package/dist/scoring/scoring-binding.js +76 -0
  225. package/dist/scoring/scoring-binding.js.map +1 -0
  226. package/dist/scoring/scoring-process-shared.d.ts +105 -0
  227. package/dist/scoring/scoring-process-shared.d.ts.map +1 -0
  228. package/dist/scoring/scoring-process-shared.js +141 -0
  229. package/dist/scoring/scoring-process-shared.js.map +1 -0
  230. package/dist/scoring/scoring-process.d.ts +128 -0
  231. package/dist/scoring/scoring-process.d.ts.map +1 -0
  232. package/dist/scoring/scoring-process.js +146 -0
  233. package/dist/scoring/scoring-process.js.map +1 -0
  234. package/dist/scoring/seams.d.ts +40 -0
  235. package/dist/scoring/seams.d.ts.map +1 -0
  236. package/dist/scoring/seams.js +66 -0
  237. package/dist/scoring/seams.js.map +1 -0
  238. package/dist/scoring/startup-register.d.ts +49 -0
  239. package/dist/scoring/startup-register.d.ts.map +1 -0
  240. package/dist/scoring/startup-register.js +72 -0
  241. package/dist/scoring/startup-register.js.map +1 -0
  242. package/dist/scoring/types.d.ts +134 -0
  243. package/dist/scoring/types.d.ts.map +1 -0
  244. package/dist/scoring/types.js +26 -0
  245. package/dist/scoring/types.js.map +1 -0
  246. package/dist/training/artifact-store.d.ts +124 -0
  247. package/dist/training/artifact-store.d.ts.map +1 -0
  248. package/dist/training/artifact-store.js +163 -0
  249. package/dist/training/artifact-store.js.map +1 -0
  250. package/dist/training/index.d.ts +13 -0
  251. package/dist/training/index.d.ts.map +1 -0
  252. package/dist/training/index.js +13 -0
  253. package/dist/training/index.js.map +1 -0
  254. package/dist/training/seams.d.ts +57 -0
  255. package/dist/training/seams.d.ts.map +1 -0
  256. package/dist/training/seams.js +103 -0
  257. package/dist/training/seams.js.map +1 -0
  258. package/dist/training/training-engine.d.ts +96 -0
  259. package/dist/training/training-engine.d.ts.map +1 -0
  260. package/dist/training/training-engine.js +300 -0
  261. package/dist/training/training-engine.js.map +1 -0
  262. package/dist/training/types.d.ts +159 -0
  263. package/dist/training/types.d.ts.map +1 -0
  264. package/dist/training/types.js +16 -0
  265. package/dist/training/types.js.map +1 -0
  266. package/package.json +44 -7
@@ -0,0 +1,159 @@
1
+ /**
2
+ * @module training/types
3
+ *
4
+ * Dependency-injection seams and input/output shapes for the
5
+ * {@link TrainingEngine} (plan §3 / §4.3 / §4.4 / §8.2 / §11). Every external
6
+ * dependency the engine touches — entity creation, record loading, the Python
7
+ * sidecar, and artifact storage — is expressed as a narrow interface here so the
8
+ * orchestrator is unit-testable with no live database and no live sidecar.
9
+ *
10
+ * The production implementations of these seams (`MetadataEntityFactory`,
11
+ * `RunViewRecordLoader`, `MJSidecarTrainer`, `MJFilesArtifactStore`) are thin
12
+ * adapters around `Metadata.GetEntityObject`, `RunView`, `MLSidecar`, and
13
+ * `MJ: Files`; the tests inject in-memory fakes implementing the same contracts.
14
+ */
15
+ import type { BaseEntity, UserInfo, IMetadataProvider } from '@memberjunction/core';
16
+ import type { TrainRequest, TrainResponse, ProblemType, MatrixData } from '@memberjunction/predictive-studio-core';
17
+ import type { MJMLTrainingPipelineEntity, MJMLModelEntity, MJMLTrainingRunEntity } from '@memberjunction/core-entities';
18
+ /**
19
+ * Factory seam for creating strongly-typed entity objects. Wraps
20
+ * `Metadata.GetEntityObject` in production; tests inject a fake returning
21
+ * in-memory entity stand-ins.
22
+ */
23
+ export interface IEntityFactory {
24
+ /**
25
+ * Create a new, unsaved entity object for the named entity. Mirrors
26
+ * `Metadata.GetEntityObject<T>(entityName, contextUser)`.
27
+ *
28
+ * @param entityName MJ entity name (e.g. `MJ: ML Models`)
29
+ * @param contextUser request user — required on the server for isolation/audit
30
+ */
31
+ getEntityObject<T extends BaseEntity>(entityName: string, contextUser?: UserInfo): Promise<T>;
32
+ }
33
+ /**
34
+ * Read seam for loading existing records (the training pipeline definition and
35
+ * the next-version lookup). Wraps `RunView` in production; tests inject canned
36
+ * rows. Never throws for logical read failures (mirrors `RunView`).
37
+ */
38
+ export interface IRecordLoader {
39
+ /**
40
+ * Load a single ML Training Pipeline by id, fully typed for mutation-free
41
+ * reads. Returns `null` when not found.
42
+ *
43
+ * @param pipelineId pipeline primary-key value
44
+ * @param contextUser request user
45
+ * @param provider optional provider for multi-provider correctness
46
+ */
47
+ loadPipeline(pipelineId: string, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<MJMLTrainingPipelineEntity | null>;
48
+ /**
49
+ * Compute the next monotonic model version under a pipeline — `max(Version)+1`,
50
+ * or `1` when the pipeline has no prior models. Implemented as a narrow,
51
+ * read-only count/scan over `MJ: ML Models`.
52
+ *
53
+ * @param pipelineId pipeline primary-key value
54
+ * @param contextUser request user
55
+ * @param provider optional provider for multi-provider correctness
56
+ */
57
+ nextModelVersion(pipelineId: string, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<number>;
58
+ }
59
+ /**
60
+ * Sidecar seam — the `/train` call. Wraps {@link MLSidecar} from
61
+ * `@memberjunction/predictive-studio-sidecar` in production; tests inject a fake
62
+ * that returns a canned {@link TrainResponse} and captures the request so the
63
+ * test can assert the matrix/preprocessing/holdout shape sent to the sidecar.
64
+ */
65
+ export interface ISidecarTrainer {
66
+ /**
67
+ * Train a model from an assembled feature matrix. The implementation is
68
+ * responsible for sidecar lifecycle (start/connect); the engine only calls
69
+ * this method.
70
+ *
71
+ * The engine carves the **locked holdout** (plan §8.2) in TypeScript before
72
+ * calling this — `req.data` contains ONLY the training portion (the rows the
73
+ * model may train and tune on). The locked-holdout rows travel separately in
74
+ * the optional second argument so the sidecar scores them **exactly once** and
75
+ * returns `holdout_metrics`; they never enter `req.data`. Keeping the holdout
76
+ * out of the public {@link TrainRequest} shape preserves that contract while
77
+ * making the carve auditable and deterministic on the orchestrator side.
78
+ *
79
+ * @param req the fully-built train request (training matrix + schema + preprocessing + validation)
80
+ * @param lockedHoldout the carved-off holdout matrix to score exactly once (optional)
81
+ */
82
+ train(req: TrainRequest, lockedHoldout?: MatrixData): Promise<TrainResponse>;
83
+ }
84
+ /**
85
+ * Artifact-storage seam (plan §11). The serialized model artifact is persisted
86
+ * out-of-row and referenced by file id on the `MJ: ML Models` row
87
+ * (`ArtifactFileID`). The production implementation writes a `MJ: Files` record;
88
+ * tests use an in-memory map.
89
+ */
90
+ export interface IArtifactStore {
91
+ /**
92
+ * Persist the serialized artifact bytes under a name and return the storage
93
+ * file id to record on the model.
94
+ *
95
+ * @param bytes the serialized model artifact
96
+ * @param name a human-readable artifact name (e.g. `model-<pipeline>-v<version>.bin`)
97
+ * @param contextUser request user — required on the server for isolation/audit
98
+ * @returns the file id to store in `MLModel.ArtifactFileID`
99
+ */
100
+ save(bytes: Uint8Array, name: string, contextUser?: UserInfo): Promise<string>;
101
+ }
102
+ /**
103
+ * Input to {@link TrainingEngine.trainModel}. A standalone/manual train is the
104
+ * default; pass `experimentSessionIterationId` to hang the run off a generic
105
+ * Experiment Session Iteration (plan §4.4) during an agent-driven search.
106
+ */
107
+ export interface TrainModelInput {
108
+ /** Id of the `MJ: ML Training Pipelines` row to train. */
109
+ pipelineId: string;
110
+ /**
111
+ * Optional `MJ: Experiment Session Iterations` id this run belongs to. NULL /
112
+ * omitted for a one-off standalone train outside a session.
113
+ */
114
+ experimentSessionIterationId?: string;
115
+ /**
116
+ * Optional per-record label-event dates (keyed by record primary key),
117
+ * required when the pipeline's `AsOfStrategy.Mode` is `offset` (plan §6.3).
118
+ */
119
+ labelEventDates?: Record<string, Date>;
120
+ /** Optional primary-key field on the target entity (defaults to `ID`). */
121
+ primaryKeyField?: string;
122
+ /** Optional cap on training rows pulled from the target entity. */
123
+ maxRows?: number;
124
+ /** Sidecar version string recorded in model lineage (provenance). */
125
+ sidecarVersion?: string;
126
+ }
127
+ /**
128
+ * The injected dependency bundle passed to {@link TrainingEngine.trainModel}.
129
+ * Bundling the seams (rather than constructor-injecting them) keeps the engine
130
+ * stateless and lets a caller vary implementations per call (e.g. a different
131
+ * artifact store per tenant).
132
+ */
133
+ export interface TrainingDeps {
134
+ /** Entity-creation seam. */
135
+ entityFactory: IEntityFactory;
136
+ /** Record-loading seam (pipeline + next-version). */
137
+ recordLoader: IRecordLoader;
138
+ /** Sidecar `/train` seam. */
139
+ sidecar: ISidecarTrainer;
140
+ /** Artifact-storage seam. */
141
+ artifactStore: IArtifactStore;
142
+ /** Request user — threaded through every entity op for isolation/audit. */
143
+ contextUser?: UserInfo;
144
+ /** Optional provider for multi-provider correctness. */
145
+ provider?: IMetadataProvider;
146
+ }
147
+ /**
148
+ * Result of a successful (or recorded-failed) training orchestration — the
149
+ * produced model and the run that produced it.
150
+ */
151
+ export interface TrainModelResult {
152
+ /** The immutable `MJ: ML Models` row produced (Draft status). */
153
+ model: MJMLModelEntity;
154
+ /** The `MJ: ML Training Runs` row recording this attempt. */
155
+ run: MJMLTrainingRunEntity;
156
+ }
157
+ /** Re-export for downstream training consumers without reaching into core. */
158
+ export type { ProblemType };
159
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/training/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACX,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,0BAA0B,EAC1B,eAAe,EACf,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,eAAe,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC/F;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAOG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;IAEnI;;;;;;;;OAQG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7G;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC9E;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChF;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,aAAa,EAAE,cAAc,CAAC;IAC9B,qDAAqD;IACrD,YAAY,EAAE,aAAa,CAAC;IAC5B,6BAA6B;IAC7B,OAAO,EAAE,eAAe,CAAC;IACzB,6BAA6B;IAC7B,aAAa,EAAE,cAAc,CAAC;IAC9B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,KAAK,EAAE,eAAe,CAAC;IACvB,6DAA6D;IAC7D,GAAG,EAAE,qBAAqB,CAAC;CAC5B;AAED,8EAA8E;AAC9E,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @module training/types
3
+ *
4
+ * Dependency-injection seams and input/output shapes for the
5
+ * {@link TrainingEngine} (plan §3 / §4.3 / §4.4 / §8.2 / §11). Every external
6
+ * dependency the engine touches — entity creation, record loading, the Python
7
+ * sidecar, and artifact storage — is expressed as a narrow interface here so the
8
+ * orchestrator is unit-testable with no live database and no live sidecar.
9
+ *
10
+ * The production implementations of these seams (`MetadataEntityFactory`,
11
+ * `RunViewRecordLoader`, `MJSidecarTrainer`, `MJFilesArtifactStore`) are thin
12
+ * adapters around `Metadata.GetEntityObject`, `RunView`, `MLSidecar`, and
13
+ * `MJ: Files`; the tests inject in-memory fakes implementing the same contracts.
14
+ */
15
+ export {};
16
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/training/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
package/package.json CHANGED
@@ -1,10 +1,47 @@
1
1
  {
2
2
  "name": "@memberjunction/predictive-studio",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @memberjunction/predictive-studio",
5
- "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
3
+ "type": "module",
4
+ "version": "5.45.0",
5
+ "description": "MemberJunction: Predictive Studio server-side engine (feature assembly, training, inference, experiment orchestration)",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "/dist"
10
+ ],
11
+ "scripts": {
12
+ "start": "ts-node-dev src/index.ts",
13
+ "build": "tsc && tsc-alias -f",
14
+ "test": "vitest run",
15
+ "test:watch": "vitest",
16
+ "test:coverage": "vitest run --coverage",
17
+ "test:integration": "vitest run --config vitest.integration.config.ts"
18
+ },
19
+ "author": "MemberJunction.com",
20
+ "license": "ISC",
21
+ "dependencies": {
22
+ "@memberjunction/actions": "5.45.0",
23
+ "@memberjunction/actions-base": "5.45.0",
24
+ "@memberjunction/ai": "5.45.0",
25
+ "@memberjunction/ai-agents": "5.45.0",
26
+ "@memberjunction/ai-core-plus": "5.45.0",
27
+ "@memberjunction/core": "5.45.0",
28
+ "@memberjunction/core-entities": "5.45.0",
29
+ "@memberjunction/global": "5.45.0",
30
+ "@memberjunction/predictive-studio-core": "5.45.0",
31
+ "@memberjunction/predictive-studio-sidecar": "5.45.0",
32
+ "@memberjunction/record-set-processor": "5.45.0",
33
+ "@memberjunction/record-set-processor-base": "5.45.0",
34
+ "rxjs": "^7.8.2"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "24.10.11",
38
+ "ts-node-dev": "^2.0.0",
39
+ "typescript": "^5.9.3",
40
+ "tsc-alias": "^1.8.10",
41
+ "vitest": "^4.0.18"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/MemberJunction/MJ"
46
+ }
10
47
  }