@memberjunction/predictive-studio 6.2.0-edge.5 → 6.2.0-edge.6
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.
- package/README.md +18 -14
- package/dist/actions/driver-classes.d.ts +11 -0
- package/dist/actions/driver-classes.d.ts.map +1 -0
- package/dist/actions/driver-classes.js +11 -0
- package/dist/actions/driver-classes.js.map +1 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +1 -0
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/model-scoring-action-generator.js +1 -1
- package/dist/actions/model-scoring-action-generator.js.map +1 -1
- package/dist/actions/promote-model.action.d.ts +3 -2
- package/dist/actions/promote-model.action.d.ts.map +1 -1
- package/dist/actions/promote-model.action.js +4 -3
- package/dist/actions/promote-model.action.js.map +1 -1
- package/dist/actions/promote-model.gate.d.ts +5 -5
- package/dist/actions/promote-model.gate.d.ts.map +1 -1
- package/dist/actions/promote-model.gate.js +8 -14
- package/dist/actions/promote-model.gate.js.map +1 -1
- package/dist/actions/run-experiment.action.d.ts +13 -5
- package/dist/actions/run-experiment.action.d.ts.map +1 -1
- package/dist/actions/run-experiment.action.js +26 -7
- package/dist/actions/run-experiment.action.js.map +1 -1
- package/dist/actions/run-experiment.deps.d.ts +19 -27
- package/dist/actions/run-experiment.deps.d.ts.map +1 -1
- package/dist/actions/run-experiment.deps.js +23 -48
- package/dist/actions/run-experiment.deps.js.map +1 -1
- package/dist/actions/schedule-model-scoring.action.d.ts +1 -1
- package/dist/actions/schedule-model-scoring.action.d.ts.map +1 -1
- package/dist/actions/schedule-model-scoring.action.js +2 -1
- package/dist/actions/schedule-model-scoring.action.js.map +1 -1
- package/dist/actions/score-record-set.action.d.ts +8 -3
- package/dist/actions/score-record-set.action.d.ts.map +1 -1
- package/dist/actions/score-record-set.action.js +16 -7
- package/dist/actions/score-record-set.action.js.map +1 -1
- package/dist/actions/score-record-set.runner.d.ts +62 -32
- package/dist/actions/score-record-set.runner.d.ts.map +1 -1
- package/dist/actions/score-record-set.runner.js +122 -67
- package/dist/actions/score-record-set.runner.js.map +1 -1
- package/dist/actions/train-model.action.d.ts +4 -6
- package/dist/actions/train-model.action.d.ts.map +1 -1
- package/dist/actions/train-model.action.js +13 -20
- package/dist/actions/train-model.action.js.map +1 -1
- package/dist/agent/modeling-plan-to-pipeline.d.ts +5 -2
- package/dist/agent/modeling-plan-to-pipeline.d.ts.map +1 -1
- package/dist/agent/modeling-plan-to-pipeline.js +32 -7
- package/dist/agent/modeling-plan-to-pipeline.js.map +1 -1
- package/dist/agent/pipeline-builder-agent.d.ts +20 -5
- package/dist/agent/pipeline-builder-agent.d.ts.map +1 -1
- package/dist/agent/pipeline-builder-agent.js +73 -46
- package/dist/agent/pipeline-builder-agent.js.map +1 -1
- package/dist/agent/pipeline-builder.d.ts +37 -5
- package/dist/agent/pipeline-builder.d.ts.map +1 -1
- package/dist/agent/pipeline-builder.js +91 -96
- package/dist/agent/pipeline-builder.js.map +1 -1
- package/dist/feature-assembly/data-access.d.ts +12 -8
- package/dist/feature-assembly/data-access.d.ts.map +1 -1
- package/dist/feature-assembly/data-access.js +8 -10
- package/dist/feature-assembly/data-access.js.map +1 -1
- package/dist/feature-assembly/feature-assembly-executor.d.ts +4 -4
- package/dist/feature-assembly/feature-assembly-executor.d.ts.map +1 -1
- package/dist/feature-assembly/feature-assembly-executor.js +6 -0
- package/dist/feature-assembly/feature-assembly-executor.js.map +1 -1
- package/dist/feature-assembly/index.d.ts +1 -0
- package/dist/feature-assembly/index.d.ts.map +1 -1
- package/dist/feature-assembly/index.js +1 -0
- package/dist/feature-assembly/index.js.map +1 -1
- package/dist/feature-assembly/read-cap-error.d.ts +23 -0
- package/dist/feature-assembly/read-cap-error.d.ts.map +1 -0
- package/dist/feature-assembly/read-cap-error.js +35 -0
- package/dist/feature-assembly/read-cap-error.js.map +1 -0
- package/dist/maintenance/seams.d.ts +4 -4
- package/dist/maintenance/seams.d.ts.map +1 -1
- package/dist/maintenance/seams.js +7 -4
- package/dist/maintenance/seams.js.map +1 -1
- package/dist/maintenance/types.d.ts +10 -10
- package/dist/maintenance/types.d.ts.map +1 -1
- package/dist/operations/delegation.d.ts +16 -17
- package/dist/operations/delegation.d.ts.map +1 -1
- package/dist/operations/delegation.js +18 -19
- package/dist/operations/delegation.js.map +1 -1
- package/dist/operations/index.d.ts +1 -0
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +1 -0
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/promote-model.operation.d.ts +1 -1
- package/dist/operations/promote-model.operation.js +1 -1
- package/dist/operations/refusals.d.ts +16 -0
- package/dist/operations/refusals.d.ts.map +1 -0
- package/dist/operations/refusals.js +44 -0
- package/dist/operations/refusals.js.map +1 -0
- package/dist/operations/score-record-set.operation.d.ts +4 -2
- package/dist/operations/score-record-set.operation.d.ts.map +1 -1
- package/dist/operations/score-record-set.operation.js +7 -1
- package/dist/operations/score-record-set.operation.js.map +1 -1
- package/dist/operations/start-experiment-session.operation.d.ts +14 -18
- package/dist/operations/start-experiment-session.operation.d.ts.map +1 -1
- package/dist/operations/start-experiment-session.operation.js +23 -21
- package/dist/operations/start-experiment-session.operation.js.map +1 -1
- package/dist/operations/train-model.operation.d.ts +4 -2
- package/dist/operations/train-model.operation.d.ts.map +1 -1
- package/dist/operations/train-model.operation.js +10 -1
- package/dist/operations/train-model.operation.js.map +1 -1
- package/dist/scheduling/scheduled-model-scoring.d.ts +2 -2
- package/dist/scheduling/scheduled-model-scoring.d.ts.map +1 -1
- package/dist/scheduling/scheduled-model-scoring.js +1 -2
- package/dist/scheduling/scheduled-model-scoring.js.map +1 -1
- package/dist/scoring/auto-train.d.ts.map +1 -1
- package/dist/scoring/auto-train.js +6 -10
- package/dist/scoring/auto-train.js.map +1 -1
- package/dist/scoring/ml-model-inference-processor.d.ts +13 -0
- package/dist/scoring/ml-model-inference-processor.d.ts.map +1 -1
- package/dist/scoring/ml-model-inference-processor.js +35 -7
- package/dist/scoring/ml-model-inference-processor.js.map +1 -1
- package/dist/scoring/ml-model-score-enricher.d.ts.map +1 -1
- package/dist/scoring/ml-model-score-enricher.js +5 -0
- package/dist/scoring/ml-model-score-enricher.js.map +1 -1
- package/dist/scoring/model-readiness.d.ts +13 -0
- package/dist/scoring/model-readiness.d.ts.map +1 -1
- package/dist/scoring/model-readiness.js +20 -0
- package/dist/scoring/model-readiness.js.map +1 -1
- package/dist/scoring/scoring-process.d.ts +2 -2
- package/dist/scoring/scoring-process.d.ts.map +1 -1
- package/dist/scoring/scoring-process.js +1 -2
- package/dist/scoring/scoring-process.js.map +1 -1
- package/dist/scoring/seams.d.ts +1 -1
- package/dist/scoring/seams.d.ts.map +1 -1
- package/dist/scoring/seams.js +1 -1
- package/dist/scoring/seams.js.map +1 -1
- package/dist/scoring/startup-register.d.ts +1 -1
- package/dist/scoring/startup-register.js +1 -1
- package/dist/scoring/types.d.ts +2 -2
- package/dist/scoring/types.d.ts.map +1 -1
- package/dist/training/artifact-store.d.ts +3 -3
- package/dist/training/artifact-store.d.ts.map +1 -1
- package/dist/training/artifact-store.js +2 -2
- package/dist/training/artifact-store.js.map +1 -1
- package/dist/training/as-of-refusal.d.ts +35 -0
- package/dist/training/as-of-refusal.d.ts.map +1 -0
- package/dist/training/as-of-refusal.js +48 -0
- package/dist/training/as-of-refusal.js.map +1 -0
- package/dist/training/index.d.ts +2 -0
- package/dist/training/index.d.ts.map +1 -1
- package/dist/training/index.js +2 -0
- package/dist/training/index.js.map +1 -1
- package/dist/training/locked-holdout.d.ts +73 -0
- package/dist/training/locked-holdout.d.ts.map +1 -0
- package/dist/training/locked-holdout.js +151 -0
- package/dist/training/locked-holdout.js.map +1 -0
- package/dist/training/seams.d.ts +10 -11
- package/dist/training/seams.d.ts.map +1 -1
- package/dist/training/seams.js +10 -15
- package/dist/training/seams.js.map +1 -1
- package/dist/training/training-engine.d.ts +23 -9
- package/dist/training/training-engine.d.ts.map +1 -1
- package/dist/training/training-engine.js +80 -55
- package/dist/training/training-engine.js.map +1 -1
- package/dist/training/types.d.ts +40 -12
- package/dist/training/types.d.ts.map +1 -1
- package/package.json +13 -13
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An explicit row cap (`maxRows` / `MaxRows`) smaller than the rows the read matches (decision D2-C1): training and
|
|
3
|
+
* scoring refuse instead of silently working on a sample. One class, so both paths share one truncation rule and
|
|
4
|
+
* callers branch on `instanceof` and the structured fields, never on the message.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ReadCapExceededError extends Error {
|
|
7
|
+
readonly EntityName: string;
|
|
8
|
+
readonly MaxRows: number;
|
|
9
|
+
readonly RowsRead: number;
|
|
10
|
+
readonly RowsMatched: number;
|
|
11
|
+
constructor(message: string, EntityName: string, MaxRows: number, RowsRead: number, RowsMatched: number);
|
|
12
|
+
/**
|
|
13
|
+
* True when an explicit cap cut the read short: the database matched more rows than the capped read returned. No
|
|
14
|
+
* cap means the read was uncapped (`IgnoreMaxRows`), so it can never truncate. Narrows `maxRows` to `number`, so
|
|
15
|
+
* callers need no cap check of their own.
|
|
16
|
+
*/
|
|
17
|
+
static IsTruncated(maxRows: number | undefined, rowsRead: number, rowsMatched: number): maxRows is number;
|
|
18
|
+
/** The training refusal (feature assembly). */
|
|
19
|
+
static ForTraining(entityName: string, maxRows: number, rowsRead: number, rowsMatched: number): ReadCapExceededError;
|
|
20
|
+
/** The scoring refusal (Score Record Set scope resolution). */
|
|
21
|
+
static ForScoring(entityName: string, maxRows: number, rowsRead: number, rowsMatched: number): ReadCapExceededError;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=read-cap-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-cap-error.d.ts","sourceRoot":"","sources":["../../src/feature-assembly/read-cap-error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;aAG3B,UAAU,EAAE,MAAM;aAClB,OAAO,EAAE,MAAM;aACf,QAAQ,EAAE,MAAM;aAChB,WAAW,EAAE,MAAM;gBAJnC,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM;IAMrC;;;;OAIG;WACW,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,IAAI,MAAM;IAIhH,+CAA+C;WACjC,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,oBAAoB;IAY3H,+DAA+D;WACjD,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,oBAAoB;CAU3H"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An explicit row cap (`maxRows` / `MaxRows`) smaller than the rows the read matches (decision D2-C1): training and
|
|
3
|
+
* scoring refuse instead of silently working on a sample. One class, so both paths share one truncation rule and
|
|
4
|
+
* callers branch on `instanceof` and the structured fields, never on the message.
|
|
5
|
+
*/
|
|
6
|
+
export class ReadCapExceededError extends Error {
|
|
7
|
+
constructor(message, EntityName, MaxRows, RowsRead, RowsMatched) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.EntityName = EntityName;
|
|
10
|
+
this.MaxRows = MaxRows;
|
|
11
|
+
this.RowsRead = RowsRead;
|
|
12
|
+
this.RowsMatched = RowsMatched;
|
|
13
|
+
this.name = 'ReadCapExceededError';
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* True when an explicit cap cut the read short: the database matched more rows than the capped read returned. No
|
|
17
|
+
* cap means the read was uncapped (`IgnoreMaxRows`), so it can never truncate. Narrows `maxRows` to `number`, so
|
|
18
|
+
* callers need no cap check of their own.
|
|
19
|
+
*/
|
|
20
|
+
static IsTruncated(maxRows, rowsRead, rowsMatched) {
|
|
21
|
+
return maxRows !== undefined && rowsMatched > rowsRead;
|
|
22
|
+
}
|
|
23
|
+
/** The training refusal (feature assembly). */
|
|
24
|
+
static ForTraining(entityName, maxRows, rowsRead, rowsMatched) {
|
|
25
|
+
return new ReadCapExceededError(`FeatureAssembly read ${rowsRead} of ${rowsMatched} rows of '${entityName}' because MaxRows=${maxRows}. ` +
|
|
26
|
+
'Training reads every row the filter matches (rows with no label are dropped after the read): remove maxRows, ' +
|
|
27
|
+
'or narrow the population with a filter, and train again.', entityName, maxRows, rowsRead, rowsMatched);
|
|
28
|
+
}
|
|
29
|
+
/** The scoring refusal (Score Record Set scope resolution). */
|
|
30
|
+
static ForScoring(entityName, maxRows, rowsRead, rowsMatched) {
|
|
31
|
+
return new ReadCapExceededError(`Score Record Set: the scope matches ${rowsMatched} rows of '${entityName}' but maxRows=${maxRows} would score only ${rowsRead}. ` +
|
|
32
|
+
'Remove maxRows to score every matching row, or narrow the filter.', entityName, maxRows, rowsRead, rowsMatched);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=read-cap-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-cap-error.js","sourceRoot":"","sources":["../../src/feature-assembly/read-cap-error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YACE,OAAe,EACC,UAAkB,EAClB,OAAe,EACf,QAAgB,EAChB,WAAmB;QAEnC,KAAK,CAAC,OAAO,CAAC,CAAC;QALC,eAAU,GAAV,UAAU,CAAQ;QAClB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAQ;QAChB,gBAAW,GAAX,WAAW,CAAQ;QAGnC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,OAA2B,EAAE,QAAgB,EAAE,WAAmB;QAC1F,OAAO,OAAO,KAAK,SAAS,IAAI,WAAW,GAAG,QAAQ,CAAC;IACzD,CAAC;IAED,+CAA+C;IACxC,MAAM,CAAC,WAAW,CAAC,UAAkB,EAAE,OAAe,EAAE,QAAgB,EAAE,WAAmB;QAClG,OAAO,IAAI,oBAAoB,CAC7B,wBAAwB,QAAQ,OAAO,WAAW,aAAa,UAAU,qBAAqB,OAAO,IAAI;YACvG,+GAA+G;YAC/G,0DAA0D,EAC5D,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,CACZ,CAAC;IACJ,CAAC;IAED,+DAA+D;IACxD,MAAM,CAAC,UAAU,CAAC,UAAkB,EAAE,OAAe,EAAE,QAAgB,EAAE,WAAmB;QACjG,OAAO,IAAI,oBAAoB,CAC7B,uCAAuC,WAAW,aAAa,UAAU,iBAAiB,OAAO,qBAAqB,QAAQ,IAAI;YAChI,mEAAmE,EACrE,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,CACZ,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -20,11 +20,11 @@ import type { IMaintenanceLoader, IRowCounter, IRescoreRunner, IDriftDetector, R
|
|
|
20
20
|
*/
|
|
21
21
|
export declare class RunViewMaintenanceLoader implements IMaintenanceLoader {
|
|
22
22
|
/** @inheritdoc */
|
|
23
|
-
loadBinding(bindingId: string, contextUser
|
|
23
|
+
loadBinding(bindingId: string, contextUser: UserInfo | undefined, provider: IMetadataProvider): Promise<MJMLModelScoringBindingEntity | null>;
|
|
24
24
|
/** @inheritdoc */
|
|
25
|
-
loadBindings(mode
|
|
25
|
+
loadBindings(mode: MaintenanceBindingMode | undefined, contextUser: UserInfo | undefined, provider: IMetadataProvider): Promise<MJMLModelScoringBindingEntity[]>;
|
|
26
26
|
/** @inheritdoc */
|
|
27
|
-
loadModel(modelId: string, contextUser
|
|
27
|
+
loadModel(modelId: string, contextUser: UserInfo | undefined, provider: IMetadataProvider): Promise<MJMLModelEntity | null>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* `RunView`-backed {@link IRowCounter}. Uses the `count_only` result type so the
|
|
@@ -33,7 +33,7 @@ export declare class RunViewMaintenanceLoader implements IMaintenanceLoader {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare class RunViewRowCounter implements IRowCounter {
|
|
35
35
|
/** @inheritdoc */
|
|
36
|
-
countRows(entityName: string, extraFilter
|
|
36
|
+
countRows(entityName: string, extraFilter: string | undefined, contextUser: UserInfo | undefined, provider: IMetadataProvider): Promise<number>;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* {@link IRescoreRunner} backed by the scoring action's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seams.d.ts","sourceRoot":"","sources":["../../src/maintenance/seams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAW,KAAK,QAAQ,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACX,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,qBAAa,wBAAyB,YAAW,kBAAkB;IACjE,kBAAkB;IACL,WAAW,CACtB,SAAS,EAAE,MAAM,EACjB,WAAW,
|
|
1
|
+
{"version":3,"file":"seams.d.ts","sourceRoot":"","sources":["../../src/maintenance/seams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAW,KAAK,QAA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,IAAI,CAAC,EAAE,eAAe,EAAE,eAAe,CAAC,EAAE,MAAM;IAI5D,kBAAkB;IACL,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAetE;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,0BAA2B,YAAW,cAAc;IAQnD,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAPjD;;;;;;OAMG;gBAC0B,oBAAoB,SAAM;IAEvD,kBAAkB;IACX,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW;CAqBvD"}
|
|
@@ -19,7 +19,7 @@ import { ProductionScoreRecordSetRunner } from '../actions/score-record-set.runn
|
|
|
19
19
|
export class RunViewMaintenanceLoader {
|
|
20
20
|
/** @inheritdoc */
|
|
21
21
|
async loadBinding(bindingId, contextUser, provider) {
|
|
22
|
-
const rv =
|
|
22
|
+
const rv = RunView.FromMetadataProvider(provider);
|
|
23
23
|
const result = await rv.RunView({
|
|
24
24
|
EntityName: 'MJ: ML Model Scoring Bindings',
|
|
25
25
|
ExtraFilter: `ID='${bindingId}'`,
|
|
@@ -33,10 +33,13 @@ export class RunViewMaintenanceLoader {
|
|
|
33
33
|
}
|
|
34
34
|
/** @inheritdoc */
|
|
35
35
|
async loadBindings(mode, contextUser, provider) {
|
|
36
|
-
const rv =
|
|
36
|
+
const rv = RunView.FromMetadataProvider(provider);
|
|
37
37
|
const result = await rv.RunView({
|
|
38
38
|
EntityName: 'MJ: ML Model Scoring Bindings',
|
|
39
39
|
ExtraFilter: mode ? `Mode='${mode}'` : undefined,
|
|
40
|
+
// Every binding: without this the read stops at UserViewMaxRows (1,000 by default) and maintenance
|
|
41
|
+
// silently skips the rest (F-L3-2).
|
|
42
|
+
IgnoreMaxRows: true,
|
|
40
43
|
ResultType: 'entity_object',
|
|
41
44
|
}, contextUser);
|
|
42
45
|
if (!result.Success) {
|
|
@@ -46,7 +49,7 @@ export class RunViewMaintenanceLoader {
|
|
|
46
49
|
}
|
|
47
50
|
/** @inheritdoc */
|
|
48
51
|
async loadModel(modelId, contextUser, provider) {
|
|
49
|
-
const rv =
|
|
52
|
+
const rv = RunView.FromMetadataProvider(provider);
|
|
50
53
|
const result = await rv.RunView({
|
|
51
54
|
EntityName: 'MJ: ML Models',
|
|
52
55
|
ExtraFilter: `ID='${modelId}'`,
|
|
@@ -67,7 +70,7 @@ export class RunViewMaintenanceLoader {
|
|
|
67
70
|
export class RunViewRowCounter {
|
|
68
71
|
/** @inheritdoc */
|
|
69
72
|
async countRows(entityName, extraFilter, contextUser, provider) {
|
|
70
|
-
const rv =
|
|
73
|
+
const rv = RunView.FromMetadataProvider(provider);
|
|
71
74
|
const result = await rv.RunView({
|
|
72
75
|
EntityName: entityName,
|
|
73
76
|
ExtraFilter: extraFilter,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seams.js","sourceRoot":"","sources":["../../src/maintenance/seams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAyC,MAAM,sBAAsB,CAAC;AAMtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAcpF;;;;GAIG;AACH,MAAM,OAAO,wBAAwB;IACnC,kBAAkB;IACX,KAAK,CAAC,WAAW,CACtB,SAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"seams.js","sourceRoot":"","sources":["../../src/maintenance/seams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAyC,MAAM,sBAAsB,CAAC;AAMtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAcpF;;;;GAIG;AACH,MAAM,OAAO,wBAAwB;IACnC,kBAAkB;IACX,KAAK,CAAC,WAAW,CACtB,SAAiB,EACjB,WAAiC,EACjC,QAA2B;QAE3B,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAClD,MAAM,MAAM,G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BACpH,2FAA2F;gBAC7F,CAAC,CAAC,0BAA0B,QAAQ,0EAA0E,OAAO,SAAS;SACjI,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -139,10 +139,10 @@ export interface IRowCounter {
|
|
|
139
139
|
* @param entityName the target entity (model's training-unit entity)
|
|
140
140
|
* @param extraFilter optional filter narrowing the population (mirrors the pipeline scope)
|
|
141
141
|
* @param contextUser request user — required server-side for isolation/audit
|
|
142
|
-
* @param provider
|
|
142
|
+
* @param provider the provider the count goes through (required: no fallback to the global provider)
|
|
143
143
|
*/
|
|
144
144
|
countRows(// case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
145
|
-
entityName: string, extraFilter
|
|
145
|
+
entityName: string, extraFilter: string | undefined, contextUser: UserInfo | undefined, provider: IMetadataProvider): Promise<number>;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Read seam for loading the bindings + their models that maintenance evaluates.
|
|
@@ -156,22 +156,22 @@ export interface IMaintenanceLoader {
|
|
|
156
156
|
* @returns the binding, or `null` when not found
|
|
157
157
|
*/
|
|
158
158
|
loadBinding(// case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
159
|
-
bindingId: string, contextUser
|
|
159
|
+
bindingId: string, contextUser: UserInfo | undefined, provider: IMetadataProvider): Promise<MJMLModelScoringBindingEntity | null>;
|
|
160
160
|
/**
|
|
161
161
|
* Load every scoring binding in a given {@link RetrainingPolicy}-relevant `Mode`
|
|
162
162
|
* (e.g. all `Scheduled` bindings for the scheduled-rescore pass).
|
|
163
163
|
*
|
|
164
|
-
* @param mode the binding mode to filter on (
|
|
164
|
+
* @param mode the binding mode to filter on (`undefined` for ALL bindings)
|
|
165
165
|
*/
|
|
166
166
|
loadBindings(// case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
167
|
-
mode
|
|
167
|
+
mode: MaintenanceBindingMode | undefined, contextUser: UserInfo | undefined, provider: IMetadataProvider): Promise<MJMLModelScoringBindingEntity[]>;
|
|
168
168
|
/**
|
|
169
169
|
* Load the `MJ: ML Models` row a binding scores with (mutation-free read).
|
|
170
170
|
*
|
|
171
171
|
* @returns the model, or `null` when not found
|
|
172
172
|
*/
|
|
173
173
|
loadModel(// case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
174
|
-
modelId: string, contextUser
|
|
174
|
+
modelId: string, contextUser: UserInfo | undefined, provider: IMetadataProvider): Promise<MJMLModelEntity | null>;
|
|
175
175
|
}
|
|
176
176
|
/** The binding modes maintenance distinguishes (mirrors `MJMLModelScoringBindingEntity.Mode`). */
|
|
177
177
|
export type MaintenanceBindingMode = 'OnDemand' | 'Scheduled' | 'Materialized';
|
|
@@ -202,8 +202,8 @@ export interface RescoreRequest {
|
|
|
202
202
|
maxRows?: number;
|
|
203
203
|
/** Request user. */
|
|
204
204
|
contextUser?: UserInfo;
|
|
205
|
-
/**
|
|
206
|
-
provider
|
|
205
|
+
/** The provider every scoring read and write goes through (the score runner has no global fallback). */
|
|
206
|
+
provider: IMetadataProvider;
|
|
207
207
|
}
|
|
208
208
|
/** Result of an {@link IRescoreRunner.rescore} call. */
|
|
209
209
|
export interface RescoreResult {
|
|
@@ -247,8 +247,8 @@ export interface MaintenanceDeps {
|
|
|
247
247
|
clock?: IMaintenanceClock;
|
|
248
248
|
/** Request user — threaded through every entity op for isolation/audit. */
|
|
249
249
|
contextUser?: UserInfo;
|
|
250
|
-
/**
|
|
251
|
-
provider
|
|
250
|
+
/** The provider every entity read and the rescore pass go through; required because the score runner has no global fallback. */
|
|
251
|
+
provider: IMetadataProvider;
|
|
252
252
|
}
|
|
253
253
|
/** The promotion verdict produced after a retrain+compare. */
|
|
254
254
|
export type PromotionRecommendation = 'promote' | 'hold';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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AAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;CAChE;AAED,yCAAyC;AACzC,MAAM,WAAW,qBAAqB;IACpC,uCAAuC;IACvC,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,CAAC;CACjC"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Shared **engine-delegation helpers** for the Predictive Studio Remote Operations.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
6
|
+
* The seven Manual-mode Remote Operations and the five Predictive Studio Actions are
|
|
7
7
|
* two thin invocation surfaces over the SAME engine service classes
|
|
8
|
-
* (`TrainingEngine`, `ProductionScoreRecordSetRunner`, `
|
|
9
|
-
*
|
|
8
|
+
* (`TrainingEngine`, `ProductionScoreRecordSetRunner`, `ProductionModelPromotionGate`; experiment
|
|
9
|
+
* sessions are switched off and refuse with `ExperimentSessionsUnavailableError`). Per CLAUDE.md
|
|
10
10
|
* "push improvements to the generic level" and DRY, the production wiring each path
|
|
11
11
|
* needs lives here exactly ONCE, so the Remote Ops and Actions share one delegation
|
|
12
12
|
* path rather than duplicating the deps/seam construction.
|
|
@@ -31,7 +31,7 @@ import type { ModelingPlanSpec, Budget } from '@memberjunction/predictive-studio
|
|
|
31
31
|
* Build the {@link TrainingEngine}'s production dependency bundle from a per-call
|
|
32
32
|
* `provider` + `user`. Resolves the active File Storage Provider once and chooses
|
|
33
33
|
* the artifact-store family accordingly (MJ-Files when a provider is active, local
|
|
34
|
-
* disk when none is — see {@link
|
|
34
|
+
* disk when none is — see {@link ResolveActiveFileStorageProviderId}). Async so the
|
|
35
35
|
* provider lookup is part of the wiring; the scoring side keys off the SAME
|
|
36
36
|
* decision (the composite loader routes by whether the artifact exists on local
|
|
37
37
|
* disk) so a model never gets trained to one family and scored from another.
|
|
@@ -68,7 +68,7 @@ export declare function wasTrainingLeakageFlagged(result: TrainModelResult): boo
|
|
|
68
68
|
* {@link RunViewMLModelLoader} (loads the `MJ: ML Models` row), the
|
|
69
69
|
* {@link MJSidecarPredictor} (runs `/predict` against the Python sidecar) and the
|
|
70
70
|
* {@link LocalArtifactLoader} (reads the model bytes back by their `MJ: Files` row id,
|
|
71
|
-
* the read-side inverse of `MJFilesArtifactStore`). Shared by {@link
|
|
71
|
+
* the read-side inverse of `MJFilesArtifactStore`). Shared by {@link BuildScoreRecordSetRunner}
|
|
72
72
|
* (the Score action / Remote Op path) AND the startup work-type registration so a model
|
|
73
73
|
* trained one way is always scored the same way — one source of truth (CLAUDE.md DRY).
|
|
74
74
|
*
|
|
@@ -80,7 +80,7 @@ export declare function BuildProductionMLInferenceDeps(): MLInferenceDeps;
|
|
|
80
80
|
export declare function buildProductionMLInferenceDeps(): MLInferenceDeps;
|
|
81
81
|
/**
|
|
82
82
|
* Build the production scoring runner wired with the production {@link MLInferenceDeps}
|
|
83
|
-
* (see {@link
|
|
83
|
+
* (see {@link BuildProductionMLInferenceDeps}). No provider lookup is needed at score
|
|
84
84
|
* time — the File id IS the artifact key.
|
|
85
85
|
*/
|
|
86
86
|
export declare function BuildScoreRecordSetRunner(): ProductionScoreRecordSetRunner;
|
|
@@ -93,24 +93,23 @@ export declare function buildScoreRecordSetRunner(): ProductionScoreRecordSetRun
|
|
|
93
93
|
* read back by its `MJ: Files` row id. The `runner` is injectable for tests.
|
|
94
94
|
*
|
|
95
95
|
* @param request the model id + resolved scope + write-back directive + user/provider
|
|
96
|
-
* @param runner optional runner override (defaults to {@link
|
|
96
|
+
* @param runner optional runner override (defaults to {@link BuildScoreRecordSetRunner})
|
|
97
97
|
*/
|
|
98
98
|
export declare function ScoreRecordSetViaRunner(request: ScoreRecordSetRequest, runner?: IScoreRecordSetRunner): Promise<ScoreRecordSetResult>;
|
|
99
99
|
/** @deprecated Use {@link ScoreRecordSetViaRunner}. */
|
|
100
100
|
export declare function scoreRecordSetViaRunner(request: ScoreRecordSetRequest, runner?: IScoreRecordSetRunner): Promise<ScoreRecordSetResult>;
|
|
101
101
|
/**
|
|
102
|
-
* Start (run) an experiment session
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* `orchestrator` is injectable for tests.
|
|
102
|
+
* Start (run) an experiment session. Always refuses with {@link ExperimentSessionsUnavailableError}
|
|
103
|
+
* (no production pipeline resolver exists), before any Experiment, Session or Iteration row is
|
|
104
|
+
* created. The signature is kept for the published callers.
|
|
106
105
|
*
|
|
107
|
-
* @param
|
|
108
|
-
* @param
|
|
109
|
-
* @param
|
|
110
|
-
* @param
|
|
111
|
-
* @param
|
|
106
|
+
* @param _plan the approved modeling plan to execute
|
|
107
|
+
* @param _options run tunables (experiment id to attach to, budget override, session name)
|
|
108
|
+
* @param _provider the owning provider
|
|
109
|
+
* @param _user the acting user
|
|
110
|
+
* @param _orchestrator optional orchestrator override
|
|
112
111
|
*/
|
|
113
|
-
export declare function RunExperimentSessionViaOrchestrator(
|
|
112
|
+
export declare function RunExperimentSessionViaOrchestrator(_plan: ModelingPlanSpec, _options: ExperimentRunOptions, _provider: IMetadataProvider, _user: UserInfo, _orchestrator?: ExperimentOrchestrator): Promise<ExperimentSessionResult>;
|
|
114
113
|
/** @deprecated Use {@link RunExperimentSessionViaOrchestrator}. */
|
|
115
114
|
export declare function runExperimentSessionViaOrchestrator(plan: ModelingPlanSpec, options: ExperimentRunOptions, provider: IMetadataProvider, user: UserInfo, orchestrator?: ExperimentOrchestrator): Promise<ExperimentSessionResult>;
|
|
116
115
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegation.d.ts","sourceRoot":"","sources":["../../src/operations/delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,QA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
+
* The seven Manual-mode Remote Operations and the five Predictive Studio Actions are
|
|
7
7
|
* two thin invocation surfaces over the SAME engine service classes
|
|
8
|
-
* (`TrainingEngine`, `ProductionScoreRecordSetRunner`, `
|
|
9
|
-
*
|
|
8
|
+
* (`TrainingEngine`, `ProductionScoreRecordSetRunner`, `ProductionModelPromotionGate`; experiment
|
|
9
|
+
* sessions are switched off and refuse with `ExperimentSessionsUnavailableError`). Per CLAUDE.md
|
|
10
10
|
* "push improvements to the generic level" and DRY, the production wiring each path
|
|
11
11
|
* needs lives here exactly ONCE, so the Remote Ops and Actions share one delegation
|
|
12
12
|
* path rather than duplicating the deps/seam construction.
|
|
@@ -21,7 +21,7 @@ import { TrainingEngine } from '../training/training-engine.js';
|
|
|
21
21
|
import { MetadataEntityFactory, RunViewRecordLoader, MJSidecarTrainer } from '../training/seams.js';
|
|
22
22
|
import { ResolveActiveFileStorageProviderId, BuildArtifactStore } from '../training/artifact-store.js';
|
|
23
23
|
import { ExperimentOrchestrator } from '../experiment/experiment-orchestrator.js';
|
|
24
|
-
import {
|
|
24
|
+
import { ExperimentSessionsUnavailableError } from '../actions/run-experiment.deps.js';
|
|
25
25
|
import { ProductionScoreRecordSetRunner } from '../actions/score-record-set.runner.js';
|
|
26
26
|
import { RunViewMLModelLoader, MJSidecarPredictor } from '../scoring/seams.js';
|
|
27
27
|
import { LocalArtifactLoader } from '../scoring/artifact-loader.js';
|
|
@@ -31,7 +31,7 @@ import { ProductionModelPromotionGate } from '../actions/promote-model.gate.js';
|
|
|
31
31
|
* Build the {@link TrainingEngine}'s production dependency bundle from a per-call
|
|
32
32
|
* `provider` + `user`. Resolves the active File Storage Provider once and chooses
|
|
33
33
|
* the artifact-store family accordingly (MJ-Files when a provider is active, local
|
|
34
|
-
* disk when none is — see {@link
|
|
34
|
+
* disk when none is — see {@link ResolveActiveFileStorageProviderId}). Async so the
|
|
35
35
|
* provider lookup is part of the wiring; the scoring side keys off the SAME
|
|
36
36
|
* decision (the composite loader routes by whether the artifact exists on local
|
|
37
37
|
* disk) so a model never gets trained to one family and scored from another.
|
|
@@ -90,7 +90,7 @@ export function wasTrainingLeakageFlagged(result) {
|
|
|
90
90
|
* {@link RunViewMLModelLoader} (loads the `MJ: ML Models` row), the
|
|
91
91
|
* {@link MJSidecarPredictor} (runs `/predict` against the Python sidecar) and the
|
|
92
92
|
* {@link LocalArtifactLoader} (reads the model bytes back by their `MJ: Files` row id,
|
|
93
|
-
* the read-side inverse of `MJFilesArtifactStore`). Shared by {@link
|
|
93
|
+
* the read-side inverse of `MJFilesArtifactStore`). Shared by {@link BuildScoreRecordSetRunner}
|
|
94
94
|
* (the Score action / Remote Op path) AND the startup work-type registration so a model
|
|
95
95
|
* trained one way is always scored the same way — one source of truth (CLAUDE.md DRY).
|
|
96
96
|
*
|
|
@@ -106,7 +106,7 @@ export function buildProductionMLInferenceDeps() {
|
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* Build the production scoring runner wired with the production {@link MLInferenceDeps}
|
|
109
|
-
* (see {@link
|
|
109
|
+
* (see {@link BuildProductionMLInferenceDeps}). No provider lookup is needed at score
|
|
110
110
|
* time — the File id IS the artifact key.
|
|
111
111
|
*/
|
|
112
112
|
export function BuildScoreRecordSetRunner() {
|
|
@@ -123,7 +123,7 @@ export function buildScoreRecordSetRunner() {
|
|
|
123
123
|
* read back by its `MJ: Files` row id. The `runner` is injectable for tests.
|
|
124
124
|
*
|
|
125
125
|
* @param request the model id + resolved scope + write-back directive + user/provider
|
|
126
|
-
* @param runner optional runner override (defaults to {@link
|
|
126
|
+
* @param runner optional runner override (defaults to {@link BuildScoreRecordSetRunner})
|
|
127
127
|
*/
|
|
128
128
|
export function ScoreRecordSetViaRunner(request, runner = BuildScoreRecordSetRunner()) {
|
|
129
129
|
return runner.run(request);
|
|
@@ -134,19 +134,18 @@ export function scoreRecordSetViaRunner(request, runner = buildScoreRecordSetRun
|
|
|
134
134
|
}
|
|
135
135
|
// ----- Experiment -------------------------------------------------------------
|
|
136
136
|
/**
|
|
137
|
-
* Start (run) an experiment session
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* `orchestrator` is injectable for tests.
|
|
137
|
+
* Start (run) an experiment session. Always refuses with {@link ExperimentSessionsUnavailableError}
|
|
138
|
+
* (no production pipeline resolver exists), before any Experiment, Session or Iteration row is
|
|
139
|
+
* created. The signature is kept for the published callers.
|
|
141
140
|
*
|
|
142
|
-
* @param
|
|
143
|
-
* @param
|
|
144
|
-
* @param
|
|
145
|
-
* @param
|
|
146
|
-
* @param
|
|
141
|
+
* @param _plan the approved modeling plan to execute
|
|
142
|
+
* @param _options run tunables (experiment id to attach to, budget override, session name)
|
|
143
|
+
* @param _provider the owning provider
|
|
144
|
+
* @param _user the acting user
|
|
145
|
+
* @param _orchestrator optional orchestrator override
|
|
147
146
|
*/
|
|
148
|
-
export async function RunExperimentSessionViaOrchestrator(
|
|
149
|
-
|
|
147
|
+
export async function RunExperimentSessionViaOrchestrator(_plan, _options, _provider, _user, _orchestrator) {
|
|
148
|
+
throw new ExperimentSessionsUnavailableError();
|
|
150
149
|
}
|
|
151
150
|
/** @deprecated Use {@link RunExperimentSessionViaOrchestrator}. */
|
|
152
151
|
export async function runExperimentSessionViaOrchestrator(plan, options, provider, user, orchestrator = new ExperimentOrchestrator()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegation.js","sourceRoot":"","sources":["../../src/operations/delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,kCAAkC,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,
|
|
1
|
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ServerOperation}
|
|
23
23
|
*/
|
|
24
24
|
export * from './delegation.js';
|
|
25
|
+
export * from './refusals.js';
|
|
25
26
|
export * from './train-model.operation.js';
|
|
26
27
|
export * from './score-record-set.operation.js';
|
|
27
28
|
export * from './run-feature-pipeline.operation.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AAUnD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,IAAI,IAAI,CAQrD"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AAUnD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,IAAI,IAAI,CAQrD"}
|
package/dist/operations/index.js
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
* - `PredictiveStudio.CreateScoringProcess` → {@link PredictiveStudioCreateScoringProcessServerOperation}
|
|
23
23
|
*/
|
|
24
24
|
export * from './delegation.js';
|
|
25
|
+
export * from './refusals.js';
|
|
25
26
|
export * from './train-model.operation.js';
|
|
26
27
|
export * from './score-record-set.operation.js';
|
|
27
28
|
export * from './run-feature-pipeline.operation.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AAEnD,OAAO,EAAE,yCAAyC,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,6CAA6C,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,iDAAiD,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,EAAE,qDAAqD,EAAE,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAAE,uDAAuD,EAAE,MAAM,wCAAwC,CAAC;AACjH,OAAO,EAAE,2CAA2C,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,mDAAmD,EAAE,MAAM,oCAAoC,CAAC;AAEzG;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B;IAC5C,KAAK,yCAAyC,CAAC;IAC/C,KAAK,6CAA6C,CAAC;IACnD,KAAK,iDAAiD,CAAC;IACvD,KAAK,qDAAqD,CAAC;IAC3D,KAAK,uDAAuD,CAAC;IAC7D,KAAK,2CAA2C,CAAC;IACjD,KAAK,mDAAmD,CAAC;AAC3D,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AAEnD,OAAO,EAAE,yCAAyC,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,6CAA6C,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,iDAAiD,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,EAAE,qDAAqD,EAAE,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAAE,uDAAuD,EAAE,MAAM,wCAAwC,CAAC;AACjH,OAAO,EAAE,2CAA2C,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,mDAAmD,EAAE,MAAM,oCAAoC,CAAC;AAEzG;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B;IAC5C,KAAK,yCAAyC,CAAC;IAC/C,KAAK,6CAA6C,CAAC;IACnD,KAAK,iDAAiD,CAAC;IACvD,KAAK,qDAAqD,CAAC;IAC3D,KAAK,uDAAuD,CAAC;IAC7D,KAAK,2CAA2C,CAAC;IACjD,KAAK,mDAAmD,CAAC;AAC3D,CAAC"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Per CLAUDE.md "transport-layer architecture", the operation is a THIN adapter — it
|
|
11
11
|
* carries no promotion logic. The leakage detection + state-machine transition live
|
|
12
12
|
* in {@link ProductionModelPromotionGate}, shared with the Promote action via
|
|
13
|
-
* {@link
|
|
13
|
+
* {@link PromoteModelViaGate}. The gate touches ONLY the `Status` (the model is
|
|
14
14
|
* immutable, §6.4).
|
|
15
15
|
*
|
|
16
16
|
* Non-promoted outcomes (leakage refusal, missing reason, invalid transition, not
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Per CLAUDE.md "transport-layer architecture", the operation is a THIN adapter — it
|
|
11
11
|
* carries no promotion logic. The leakage detection + state-machine transition live
|
|
12
12
|
* in {@link ProductionModelPromotionGate}, shared with the Promote action via
|
|
13
|
-
* {@link
|
|
13
|
+
* {@link PromoteModelViaGate}. The gate touches ONLY the `Status` (the model is
|
|
14
14
|
* immutable, §6.4).
|
|
15
15
|
*
|
|
16
16
|
* Non-promoted outcomes (leakage refusal, missing reason, invalid transition, not
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RemoteOpResult } from '@memberjunction/core';
|
|
2
|
+
import { type PredictiveStudioRefusalCode } from '@memberjunction/predictive-studio-core';
|
|
3
|
+
/**
|
|
4
|
+
* Turns Predictive Studio refusal errors into typed `ResultCode`s on the operation result.
|
|
5
|
+
*
|
|
6
|
+
* Why this repeats `BaseRemotableOperation.ExecuteServer`'s three outcomes: the base maps every throw to
|
|
7
|
+
* `EXECUTION_ERROR`, which loses the refusal type before it reaches the caller, and changing that base belongs to
|
|
8
|
+
* MJCore, outside Predictive Studio. Keep the FORBIDDEN / SUCCESS / EXECUTION_ERROR shapes identical to the base.
|
|
9
|
+
*/
|
|
10
|
+
export declare class PredictiveStudioRefusals {
|
|
11
|
+
/** The refusal code for a Predictive Studio refusal error; null for any other error. */
|
|
12
|
+
static CodeOf(e: Error): PredictiveStudioRefusalCode | null;
|
|
13
|
+
/** The operation's server-side run with refusal errors returned as their codes. */
|
|
14
|
+
static ExecuteServer<TOut>(authorize: () => Promise<boolean>, execute: () => Promise<TOut>, operationKey: string): Promise<RemoteOpResult<TOut>>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=refusals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusals.d.ts","sourceRoot":"","sources":["../../src/operations/refusals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAoC,KAAK,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAM5H;;;;;;GAMG;AACH,qBAAa,wBAAwB;IACnC,wFAAwF;WAC1E,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,2BAA2B,GAAG,IAAI;IAUlE,mFAAmF;WAC/D,aAAa,CAAC,IAAI,EACpC,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EACjC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;CAWjC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { InvalidMajorityBaselineRuleError } from '@memberjunction/predictive-studio-core';
|
|
2
|
+
import { ReadCapExceededError } from '../feature-assembly/read-cap-error.js';
|
|
3
|
+
import { AsOfSettingHasNoEffectError } from '../training/as-of-refusal.js';
|
|
4
|
+
import { ModelNotScorableError, ModelNeedsTrainingError } from '../scoring/model-readiness.js';
|
|
5
|
+
import { ExperimentSessionsUnavailableError } from '../actions/run-experiment.deps.js';
|
|
6
|
+
/**
|
|
7
|
+
* Turns Predictive Studio refusal errors into typed `ResultCode`s on the operation result.
|
|
8
|
+
*
|
|
9
|
+
* Why this repeats `BaseRemotableOperation.ExecuteServer`'s three outcomes: the base maps every throw to
|
|
10
|
+
* `EXECUTION_ERROR`, which loses the refusal type before it reaches the caller, and changing that base belongs to
|
|
11
|
+
* MJCore, outside Predictive Studio. Keep the FORBIDDEN / SUCCESS / EXECUTION_ERROR shapes identical to the base.
|
|
12
|
+
*/
|
|
13
|
+
export class PredictiveStudioRefusals {
|
|
14
|
+
/** The refusal code for a Predictive Studio refusal error; null for any other error. */
|
|
15
|
+
static CodeOf(e) {
|
|
16
|
+
if (e instanceof ReadCapExceededError)
|
|
17
|
+
return 'READ_CAP_EXCEEDED';
|
|
18
|
+
if (e instanceof AsOfSettingHasNoEffectError)
|
|
19
|
+
return 'AS_OF_NO_EFFECT';
|
|
20
|
+
if (e instanceof ModelNotScorableError)
|
|
21
|
+
return 'MODEL_NOT_SCORABLE';
|
|
22
|
+
if (e instanceof ModelNeedsTrainingError)
|
|
23
|
+
return 'MODEL_NEEDS_TRAINING';
|
|
24
|
+
if (e instanceof ExperimentSessionsUnavailableError)
|
|
25
|
+
return 'EXPERIMENT_SESSIONS_UNAVAILABLE';
|
|
26
|
+
if (e instanceof InvalidMajorityBaselineRuleError)
|
|
27
|
+
return 'INVALID_EVALUATION_SETTING';
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
/** The operation's server-side run with refusal errors returned as their codes. */
|
|
31
|
+
static async ExecuteServer(authorize, execute, operationKey) {
|
|
32
|
+
try {
|
|
33
|
+
if (!(await authorize())) {
|
|
34
|
+
return { Success: false, ResultCode: 'FORBIDDEN', ErrorMessage: `Not authorized to run operation '${operationKey}'` };
|
|
35
|
+
}
|
|
36
|
+
return { Success: true, ResultCode: 'SUCCESS', Output: await execute() };
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
const error = e instanceof Error ? e : new Error(String(e));
|
|
40
|
+
return { Success: false, ResultCode: PredictiveStudioRefusals.CodeOf(error) || 'EXECUTION_ERROR', ErrorMessage: error.message };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=refusals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusals.js","sourceRoot":"","sources":["../../src/operations/refusals.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAoC,MAAM,wCAAwC,CAAC;AAC5H,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,gCAAgC,CAAC;AAEpF;;;;;;GAMG;AACH,MAAM,OAAO,wBAAwB;IACnC,wFAAwF;IACjF,MAAM,CAAC,MAAM,CAAC,CAAQ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