@zhuoyuezs/ml-platform 0.2.9 → 0.2.11

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 (30) hide show
  1. package/checksums.json +64 -44
  2. package/package.json +1 -1
  3. package/release.json +19 -19
  4. package/runtime/business-client/README.md +10 -0
  5. package/runtime/business-client/package-lock.json +2 -2
  6. package/runtime/business-client/package.json +1 -1
  7. package/runtime/business-client/src/cli.js +92 -2
  8. package/runtime/business-client/src/http.js +9 -0
  9. package/skills/data-source-exploration/SKILL.md +12 -1
  10. package/skills/data-source-exploration/agents/openai.yaml +2 -2
  11. package/skills/data-source-exploration/references/data-platform.md +83 -0
  12. package/skills/feature-management/SKILL.md +13 -4
  13. package/skills/feature-management/agents/openai.yaml +2 -2
  14. package/skills/feature-management/references/commands.md +26 -0
  15. package/skills/feature-management/references/data-platform-mapping.md +104 -0
  16. package/skills/feature-management/references/platform-capability-guide.md +6 -0
  17. package/skills/feature-management/references/supervised-datasets.md +13 -0
  18. package/skills/model-deployment-management/SKILL.md +4 -0
  19. package/skills/model-deployment-management/references/contracts.md +6 -0
  20. package/skills/model-deployment-management/references/operations.md +14 -0
  21. package/skills/model-deployment-management/references/troubleshooting.md +8 -0
  22. package/skills/model-lifecycle-management/SKILL.md +14 -5
  23. package/skills/model-lifecycle-management/agents/openai.yaml +2 -2
  24. package/skills/model-lifecycle-management/references/ablation.md +111 -0
  25. package/skills/model-lifecycle-management/references/evaluation.md +55 -1
  26. package/skills/model-lifecycle-management/references/experiment-runs.md +59 -0
  27. package/skills/model-lifecycle-management/references/model-comparison.md +11 -9
  28. package/skills/model-lifecycle-management/references/training.md +34 -0
  29. package/skills/model-lifecycle-management/references/zero-shot-inference.md +68 -0
  30. package/skills/prediction-report-management/SKILL.md +3 -0
@@ -0,0 +1,59 @@
1
+ # ExperimentRun
2
+
3
+ `ExperimentRun` is the platform control-plane record for a finite comparison
4
+ over one frozen `DatasetArtifact`. It supports model comparison, feature/input
5
+ ablation and a small candidate matrix while reusing existing TrainingRun,
6
+ TrainingJob, ModelArtifact, EvaluationRun, EvaluationResult and
7
+ EvaluationComparison records.
8
+
9
+ It does not implement AutoML, a general DAG engine, automatic model selection,
10
+ packaging or deployment. The Skill owns the modeling method and stopping rules;
11
+ the platform owns durable candidate state and reconciliation.
12
+
13
+ ## Lifecycle
14
+
15
+ Use the installed `ml-platform` CLI:
16
+
17
+ ```text
18
+ ml-platform create-experiment-run SPEC.json
19
+ ml-platform validate-experiment-run RUN_ID
20
+ ml-platform submit-experiment-run RUN_ID
21
+ ml-platform get-experiment-run RUN_ID
22
+ ml-platform list-experiment-candidates RUN_ID --limit 50 --offset 0
23
+ ml-platform reconcile-experiment-run RUN_ID
24
+ ml-platform cancel-experiment-run RUN_ID
25
+ ```
26
+
27
+ Create is idempotent for the same `experiment_run_id` and immutable
28
+ `spec_hash`. Always validate before submit. Validation resolves every candidate's
29
+ TrainingJob snapshot and has no training side effects. Submit is the mutation
30
+ that may create TrainingJob records, subject to `max_parallelism`.
31
+
32
+ ## Candidate contract
33
+
34
+ The spec must contain at least two candidates, a baseline candidate, one
35
+ DatasetArtifact identity and one evaluation contract. Each candidate carries a
36
+ complete TrainingRun v4 JSON object, a stable `candidate_id`, an optional
37
+ hypothesis and parent candidate, and an execution policy. Candidate FeatureSets
38
+ may be different exact-version subset/order projections of the same wide
39
+ DatasetArtifact. Labels, split membership, temporal semantics, evaluation
40
+ configuration and comparison population remain shared.
41
+
42
+ ## Recovery rules
43
+
44
+ `UNKNOWN` means the platform cannot prove whether a remote submission happened.
45
+ Reconcile first queries the durable TrainingJob/EvaluationRun records. It may
46
+ resume only when the lifecycle record proves no remote submission was reached;
47
+ it never blindly retries an unknown Kubernetes operation. An unknown candidate
48
+ also stops new candidate submissions until it is reconciled. A known terminal
49
+ failure is preserved and does not consume a parallel slot for independent
50
+ candidates.
51
+
52
+ ## Completion
53
+
54
+ Every candidate must be `RESULT_READY`, `FAILED`, `SKIPPED` or otherwise
55
+ accounted for. The service calls the existing EvaluationComparison implementation
56
+ only after complete results exist. `COMPLETE` with `ranking_allowed=true` requires
57
+ complete evidence, comparable population and a release-mode EvaluationConfig;
58
+ otherwise the run is `INCONCLUSIVE`. A result never authorizes registration,
59
+ packaging or deployment by itself.
@@ -1,10 +1,16 @@
1
1
  # Comparing models within one experiment
2
2
 
3
+ Feature or input ablation is the controlled one-factor variant of this
4
+ workflow. Read [ablation.md](ablation.md) for the baseline, removal-set and
5
+ round-closeout rules; the comparison gates below still apply.
6
+
3
7
  Use one documented goal and user-authorized scope: metric, target, candidate
4
8
  constraints and any maximum number of training submissions. Preserve that goal
5
9
  when a follow-up changes a constraint or asks for verification. Reuse existing
6
10
  authorization when it covers the next action; ask only for missing decisions.
7
11
  No TUI, session service, or Runtime-specific tool is required for this method.
12
+ Persist the candidate set and execution links in an `ExperimentRun`; see
13
+ [experiment-runs.md](experiment-runs.md) for its CLI lifecycle.
8
14
 
9
15
  ## Shared scope and candidate execution
10
16
 
@@ -45,9 +51,8 @@ forecast horizon, and do not let trajectory construction cross split
45
51
  boundaries. Compare complete platform-produced EvaluationResults only after
46
52
  each candidate passes its own TrainingRun and evaluation preflight.
47
53
 
48
- For each candidate, record its hypothesis, exact changed inputs, parent attempt
49
- if any, request JSON and returned immutable IDs in the agent's working
50
- directory. Submit within the user's authorization, observe the TrainingJob,
54
+ For each candidate, record its hypothesis, exact changed inputs and parent
55
+ candidate in the ExperimentRun spec. Submit within the user's authorization, observe the TrainingJob,
51
56
  validate the resulting ModelArtifact, then submit and inspect governed
52
57
  evaluation. Explain the observed result before choosing another candidate.
53
58
  Do not resubmit after an unknown outcome: reconcile the existing Job or retry
@@ -57,12 +62,9 @@ the authorization described in the training reference.
57
62
  ## Rounds, failure evidence and stopping
58
63
 
59
64
  A round groups candidates that test a related hypothesis under the frozen
60
- comparison scope. Keep a small round record in the agent's working directory
61
- (outside a platform source checkout), using normal file tools. Include the
62
- scope/request paths, candidate identities and changes, submission IDs, observed
63
- status, result IDs, per-candidate reflection and the round's next decision.
64
- This is an agent work record, not a new platform resource or required tool.
65
- Update it after submissions and observations so another coding agent can resume.
65
+ comparison scope. ExperimentRun and its candidates are the durable execution
66
+ record. Keep any additional method reflection in the agent's working directory
67
+ without duplicating platform status or IDs.
66
68
 
67
69
  When a candidate fails, inspect the actual Job status, attempts and diagnostic
68
70
  evidence. Distinguish a model execution failure from a runtime/infrastructure
@@ -54,6 +54,40 @@ it does not reconstruct it from manifest `rowset_splits`. Save the submitted
54
54
  TrainingRun JSON, validation output, Job ID and ModelArtifact ID in the user's
55
55
  working directory so later diagnosis needs no source repository.
56
56
 
57
+ For a second experiment over the same immutable DatasetArtifact, a TrainingRun
58
+ may freeze a time based split without adding a split column to the artifact:
59
+
60
+ ```json
61
+ {
62
+ "splits": {
63
+ "mode": "derived",
64
+ "strategy": "time_range",
65
+ "source_rowsets": ["all"],
66
+ "ranges": {
67
+ "train": {"start": "2026-01-01T00:00:00+08:00", "end": "2026-07-01T00:00:00+08:00"},
68
+ "validation": {"start": "2026-07-01T00:00:00+08:00", "end": "2026-08-01T00:00:00+08:00"},
69
+ "test": {"start": "2026-08-01T00:00:00+08:00", "end": "2026-09-01T00:00:00+08:00"}
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ `time_range` uses timezone aware, left closed/right open prediction time
76
+ intervals and requires unique row keys. The platform freezes each role's row
77
+ identity in the resolved TrainingJob and rechecks it in the Worker. Samples
78
+ whose `label_time` reaches or passes their role's end are excluded and counted
79
+ in the validation snapshot; if that leaves no train samples, validation fails.
80
+ Training time evaluation must explicitly use `train` or `validation`; `test`
81
+ is reserved for an independent EvaluationRun. For `chronological_ratio`, provide
82
+ `ratios` with `train`, `validation` and `test` values summing to `1`; equal
83
+ prediction timestamps stay together. Actual counts may differ from requested
84
+ ratios, and the algorithm version and row identities are frozen in the Job
85
+ snapshot. Derived splits currently use all artifact rows as candidates; use
86
+ `assignment_column` for artifacts containing auxiliary history or truth rows.
87
+ Only `time_range` and `chronological_ratio` are supported. Confirm the selected
88
+ training and evaluation Worker images support derived splits before submission.
89
+ Existing `assignment_column` contracts keep their original behavior.
90
+
57
91
  ## Commands
58
92
 
59
93
  Read [training-contracts.md](training-contracts.md) when authoring a Run or Job
@@ -29,6 +29,74 @@ ml-platform --profile server predict-foundation \
29
29
 
30
30
  The endpoint is `POST /foundation-models/chronos2_forecaster/predict`.
31
31
 
32
+ ### Complete request shape and preflight
33
+
34
+ Build the whole request from the versioned schema before calling the CLI. This
35
+ minimal example uses three hourly historical observations and forecasts six
36
+ steps. Replace the timestamps and values with the user's data, keeping the
37
+ timestamp grid aligned to `frequency` and ending exactly at `cutoff_time`.
38
+
39
+ ```json
40
+ {
41
+ "input": {"transport": "json_records"},
42
+ "schema": {
43
+ "schema_version": "ml_data_platform.prediction_input_schema/v1",
44
+ "layout": "long",
45
+ "timestamp_column": "timestamp",
46
+ "series_keys": [],
47
+ "targets": ["temperature"],
48
+ "past_covariates": [],
49
+ "known_future_covariates": [],
50
+ "frequency": "1h",
51
+ "timezone": "UTC",
52
+ "cutoff_time": "2026-01-01T02:00:00Z"
53
+ },
54
+ "records": [
55
+ {"timestamp": "2026-01-01T00:00:00Z", "temperature": 20.1},
56
+ {"timestamp": "2026-01-01T01:00:00Z", "temperature": 20.3},
57
+ {"timestamp": "2026-01-01T02:00:00Z", "temperature": 20.2}
58
+ ],
59
+ "forecast": {
60
+ "horizon_steps": 6,
61
+ "statistics": ["median"]
62
+ }
63
+ }
64
+ ```
65
+
66
+ Before the one prediction call, verify all of the following:
67
+
68
+ - `schema.schema_version` is exactly `ml_data_platform.prediction_input_schema/v1`;
69
+ - `input.transport` is `json_records`, and the top-level keys are `input`,
70
+ `schema`, `records` and `forecast`;
71
+ - every record has exactly the timestamp, series-key, target, past-covariate
72
+ and known-future-covariate columns declared in `schema`; role names are
73
+ disjoint;
74
+ - `schema.cutoff_time` is timezone-aware, appears as the final historical
75
+ timestamp in every series, and all historical timestamps form a regular grid
76
+ at `schema.frequency` with no duplicates or gaps;
77
+ - historical target values are numeric and non-null; do not include rows after
78
+ cutoff unless known-future covariates are declared;
79
+ - `forecast.horizon_steps` is a positive integer within the discovered active
80
+ release's `max_prediction_length`; it counts frequency intervals, not a
81
+ duration string. There is no `output_window` field in this API contract;
82
+ - request rows and serialized bytes are within the discovered release limits.
83
+
84
+ When known-future covariates are used, declare them in
85
+ `schema.known_future_covariates`, include their historical values as well, and
86
+ provide exactly one future row for every forecast step. Future target values
87
+ must be null. Do not add future rows when no known-future covariates are
88
+ declared.
89
+
90
+ If the CLI rejects the request, inspect the complete structured error once and
91
+ compare its named field/value with this contract and the discovered release
92
+ capabilities. Correct only a confirmed mismatch, then make at most one
93
+ corrected retry. Do not guess a schema version, rename fields speculatively, or
94
+ loop through 422s. If the error conflicts with this versioned contract or does
95
+ not identify a correctable input issue, stop and report the response for
96
+ server-side contract investigation. Report success only when the CLI returns a
97
+ successful prediction response; include its request/prediction ID and returned
98
+ release identity when present.
99
+
32
100
  ## CSV prediction
33
101
 
34
102
  CSV uses the same schema and forecast JSON as the JSON path. The CLI sends one
@@ -28,6 +28,9 @@ schedule request or deployment policy. A clustering deployment (its model
28
28
  artifact has `output_bindings`) has no horizon: omit `horizon` and
29
29
  `output_window`, which are rejected. A report run may be `SKIPPED` when the
30
30
  selected revision is not READY.
31
+ A READY staging revision is eligible; reporting does not require canary or
32
+ production promotion, an Ingress, or a Gateway. Do not promote a deployment
33
+ just to enable its report schedule.
31
34
 
32
35
  ## Configure a destination
33
36