@zhuoyuezs/ml-platform 0.2.10 → 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.
package/checksums.json CHANGED
@@ -2,17 +2,17 @@
2
2
  "files": [
3
3
  {
4
4
  "path": "runtime/business-client/README.md",
5
- "sha256": "sha256:9f81e4400f46c53952a0df6f7442d4c0b58cff4ca1be61f1daf785e111b3f8eb",
6
- "size_bytes": 20557
5
+ "sha256": "sha256:9b56dde8e0db3a426e45b70595558b3ff461b79a867913a36978db90b963dfc0",
6
+ "size_bytes": 21439
7
7
  },
8
8
  {
9
9
  "path": "runtime/business-client/package-lock.json",
10
- "sha256": "sha256:9d19700ee4b348406bd0134f0539c37c2800e41a87dc130c1b0476eb2d23b931",
10
+ "sha256": "sha256:aaed1feb38250bcfa11284f54ff715dadadf848efece51b23aa133f110bd1358",
11
11
  "size_bytes": 1628
12
12
  },
13
13
  {
14
14
  "path": "runtime/business-client/package.json",
15
- "sha256": "sha256:d967d64289276cf1ce94f826a138f60fc93982b7478c1fb9f78f068f47f9d803",
15
+ "sha256": "sha256:bb5daa3e966f815c89ff5517962ddfe8a0dd5b767a2130d26c27c9cd987a8a0f",
16
16
  "size_bytes": 671
17
17
  },
18
18
  {
@@ -27,8 +27,8 @@
27
27
  },
28
28
  {
29
29
  "path": "runtime/business-client/src/cli.js",
30
- "sha256": "sha256:143ce6e82d861fae647384e3617ec0f0222fef7c8e7b546ca67393fba8bd08b5",
31
- "size_bytes": 85198
30
+ "sha256": "sha256:d3d2eb31c4508e532f634a63a057e2737bf60c4f7ccd966d156f71ab3e40fcbf",
31
+ "size_bytes": 85426
32
32
  },
33
33
  {
34
34
  "path": "runtime/business-client/src/config.js",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  {
39
39
  "path": "runtime/business-client/src/http.js",
40
- "sha256": "sha256:91dc66d086deb5b5c0fd016560e6fddd369ccce9d430ce8f926bcae3f324cc86",
41
- "size_bytes": 29035
40
+ "sha256": "sha256:2387545e4548c60148b69a3bf5a8ae98a369e387e54de47da4327a957f541c35",
41
+ "size_bytes": 29525
42
42
  },
43
43
  {
44
44
  "path": "skills/data-source-exploration/SKILL.md",
@@ -57,8 +57,8 @@
57
57
  },
58
58
  {
59
59
  "path": "skills/feature-management/SKILL.md",
60
- "sha256": "sha256:f7777f43adf83cf4ee663c1e993f2f3d6221054f02e3cdcd24e65db36990141e",
61
- "size_bytes": 36116
60
+ "sha256": "sha256:df6ca953ce7b1ad8dc8edb7a47cde02fc9cb6a70c1bf3a9a47d68b01ad642256",
61
+ "size_bytes": 36599
62
62
  },
63
63
  {
64
64
  "path": "skills/feature-management/agents/openai.yaml",
@@ -112,8 +112,8 @@
112
112
  },
113
113
  {
114
114
  "path": "skills/feature-management/references/commands.md",
115
- "sha256": "sha256:248721ee995ebb20ea44a263f528e1af6004f7af55d31503185f6269744dee8d",
116
- "size_bytes": 18829
115
+ "sha256": "sha256:8298c55378579aad151b86ff8a00d0c7cf992378b7c6af262d94564544dc4a3c",
116
+ "size_bytes": 19411
117
117
  },
118
118
  {
119
119
  "path": "skills/feature-management/references/contracts.md",
@@ -167,8 +167,8 @@
167
167
  },
168
168
  {
169
169
  "path": "skills/model-lifecycle-management/SKILL.md",
170
- "sha256": "sha256:099973e2dd334beac12e275ee184d3ce500f6c307ae339e3400e585d8ad88a8e",
171
- "size_bytes": 7833
170
+ "sha256": "sha256:920473f386f191e7492088e6d84bf33458ee57e97fb8b1db1d7274722ae871ad",
171
+ "size_bytes": 8043
172
172
  },
173
173
  {
174
174
  "path": "skills/model-lifecycle-management/agents/openai.yaml",
@@ -217,8 +217,8 @@
217
217
  },
218
218
  {
219
219
  "path": "skills/model-lifecycle-management/references/zero-shot-inference.md",
220
- "sha256": "sha256:4ea224be54a7b0fc7754bdaa41df0f3b14c56f5134afc3951e91e59844108f90",
221
- "size_bytes": 2350
220
+ "sha256": "sha256:cae4675f0ae6f57482bcc7d2df956ee10495709f09f1d118b7a8bb565f1227f1",
221
+ "size_bytes": 5402
222
222
  },
223
223
  {
224
224
  "path": "skills/prediction-report-management/SKILL.md",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhuoyuezs/ml-platform",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "ML 数据平台 business CLI 与 Agent Skills 管理工具",
5
5
  "bin": {
6
6
  "ml-platform": "scripts/main.js"
package/release.json CHANGED
@@ -13,8 +13,8 @@
13
13
  "entrypoint": "src/cli.js",
14
14
  "name": "ml-platform",
15
15
  "path": "runtime/business-client",
16
- "sha256": "sha256:5b83423598eb2c8afae8765e4315a9432cc026d1779348808c6516432820e67e",
17
- "version": "0.8.7"
16
+ "sha256": "sha256:b6e415ea6031b7dd7c838f09c50c1b22501591754c6deedbdcd444d39eb498f7",
17
+ "version": "0.8.8"
18
18
  },
19
19
  "policy_sha256": "sha256:02fbde0134696b78c0c365d6e0b76c9814227208da5b2b3d4e5dbd82dc4a3606",
20
20
  "public_schema_versions": [
@@ -25,7 +25,7 @@
25
25
  "ml_data_platform.feature_set/v1",
26
26
  "ml_data_platform.dataset_manifest/v1"
27
27
  ],
28
- "release_version": "0.2.10",
28
+ "release_version": "0.2.11",
29
29
  "runtime_requirements": {
30
30
  "node": ">=18",
31
31
  "os": [
@@ -37,34 +37,34 @@
37
37
  "skills": {
38
38
  "data-source-exploration": {
39
39
  "path": "skills/data-source-exploration",
40
- "requires_cli": ">=0.8.7 <0.9.0",
41
- "revision": "0.2.10",
40
+ "requires_cli": ">=0.8.8 <0.9.0",
41
+ "revision": "0.2.11",
42
42
  "sha256": "sha256:9614e6901fcfeac7e0779caee7a8ab1df40b39d08161967e51b459c266b82f90"
43
43
  },
44
44
  "feature-management": {
45
45
  "path": "skills/feature-management",
46
- "requires_cli": ">=0.8.7 <0.9.0",
47
- "revision": "0.2.10",
48
- "sha256": "sha256:c2f109d11ddfdfe9deaa2da077cd11f374bc8cef0db6155572fbb24defab39f7"
46
+ "requires_cli": ">=0.8.8 <0.9.0",
47
+ "revision": "0.2.11",
48
+ "sha256": "sha256:f9ec42124113d63a261e31d0f06959f2c7420370dfc1b6a84fcb2f5011310c45"
49
49
  },
50
50
  "model-deployment-management": {
51
51
  "path": "skills/model-deployment-management",
52
- "requires_cli": ">=0.8.7 <0.9.0",
53
- "revision": "0.2.10",
52
+ "requires_cli": ">=0.8.8 <0.9.0",
53
+ "revision": "0.2.11",
54
54
  "sha256": "sha256:ef13c737a098e9a582dfa6f7c54777c00a9efbc7af894c7aea35b9db4a97aa15"
55
55
  },
56
56
  "model-lifecycle-management": {
57
57
  "path": "skills/model-lifecycle-management",
58
- "requires_cli": ">=0.8.7 <0.9.0",
59
- "revision": "0.2.10",
60
- "sha256": "sha256:02fc9451ae888bec7ae1aa38bf51c3c8f657c6f899506ce323f17552b2dd31a0"
58
+ "requires_cli": ">=0.8.8 <0.9.0",
59
+ "revision": "0.2.11",
60
+ "sha256": "sha256:5f95a65d649c946ab64f72b127ad8861e20623b05b6a937cad953a4eb2eadfe3"
61
61
  },
62
62
  "prediction-report-management": {
63
63
  "path": "skills/prediction-report-management",
64
- "requires_cli": ">=0.8.7 <0.9.0",
65
- "revision": "0.2.10",
64
+ "requires_cli": ">=0.8.8 <0.9.0",
65
+ "revision": "0.2.11",
66
66
  "sha256": "sha256:399e5838604b5ce0248be702b70be2deaaf8f644e5518c91c45d21e0d2f43e53"
67
67
  }
68
68
  },
69
- "source_commit": "b9b4ec03474a9ff7b11bae35eacf8302bcb97d0c"
69
+ "source_commit": "c4ba6b6d1f0010eabbc269db5a8642b0c137944d"
70
70
  }
@@ -58,6 +58,16 @@ ml-platform list-feature-versions <name> --project <project> --all
58
58
  ml-platform list-jobs --project <project> --status succeeded --all
59
59
  ```
60
60
 
61
+ 本地 CSV/Parquet 可上传为不可变 Parameter source,再通过 `add-parameter` 注册显式列映射;后续仍使用既有 Feature、FeatureSet 和 Dataset build 流程生成标准 DatasetArtifact:
62
+
63
+ ```bash
64
+ ml-platform upload-source-file /absolute/path/to/measurements.csv
65
+ ml-platform add-parameter /absolute/path/to/parameter.json
66
+ ml-platform build-registered-dataset <dataset_id> <dataset_version> --project <project> --wait
67
+ ```
68
+
69
+ 上传响应提供 `object_uri`、`object_sha256`、格式和列预览。Parameter 的 `source.adapter` 使用 `local_file`,并显式设置 `object_uri`、`object_sha256`、`file_format`、`time_column` 和 `value_column`;筛选条件使用 `filters`。上传不会推断业务字段、注册资产或创建 DatasetArtifact。当前首期支持单文件,不支持 ZIP/多文件合并或直接将原始文件作为训练数据集。
70
+
61
71
  平台资源生命周期与部署绑定的因果上下文读取也由同一 CLI 覆盖:
62
72
 
63
73
  ```bash
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@zhuoyuezs/ml-platform-business-client",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@zhuoyuezs/ml-platform-business-client",
9
- "version": "0.8.7",
9
+ "version": "0.8.8",
10
10
  "license": "UNLICENSED",
11
11
  "bin": {
12
12
  "ml-platform": "src/cli.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhuoyuezs/ml-platform-business-client",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "private": true,
5
5
  "description": "JavaScript implementation of the ML Platform business client",
6
6
  "bin": {
@@ -31,7 +31,7 @@ const BUSINESS_COMMANDS = new Set([
31
31
  "get-parameter-lifecycle", "get-feature-lifecycle", "get-feature-set-lifecycle", "get-parameter-freshness",
32
32
  "list-parameter-references", "list-feature-references", "list-feature-set-references",
33
33
  "list-parameter-versions", "list-feature-versions", "list-feature-set-versions", "list-operator-versions",
34
- "add-parameter", "add-feature", "add-feature-set", "add-operator", "publish-operator",
34
+ "add-parameter", "add-feature", "add-feature-set", "add-operator", "publish-operator", "upload-source-file",
35
35
  "add-dataset", "update-dataset", "delete-dataset", "list-dataset-artifacts",
36
36
  "register-operator", "show-operator-specs", "delete-operator", "run-operator",
37
37
  "get-job", "wait-job", "retry-job", "cancel-job", "get-dataset-artifact", "download-dataset-artifact", "fetch-inference-data", "fetch-inference-context", "predict-model", "apply",
@@ -122,6 +122,7 @@ const COMMAND_USAGE = {
122
122
  "add-feature-set": "add-feature-set SPEC_JSON",
123
123
  "add-operator": "add-operator SPEC_JSON",
124
124
  "publish-operator": "publish-operator SPEC_JSON --package PATH",
125
+ "upload-source-file": "upload-source-file FILE",
125
126
  "add-dataset": "add-dataset MANIFEST_JSON [--force]",
126
127
  "update-dataset": "update-dataset MANIFEST_JSON [--force]",
127
128
  "delete-dataset": "delete-dataset DATASET_ID DATASET_VERSION [--project PROJECT]",
@@ -624,6 +625,9 @@ async function runBusinessCli(argv, output = { write: text => process.stdout.wri
624
625
  const published = { ...spec, code_hash: upload.code_artifact.sha256, package_uri: upload.code_artifact.uri, code_artifact: upload.code_artifact };
625
626
  result = { status: "published", profile: "server", path: null, operator: published, registration: await api.post("/operators", published) };
626
627
  }
628
+ else if (options.command === "upload-source-file") {
629
+ result = await client(options).uploadSourceFile(positional(rest, "source file"));
630
+ }
627
631
  else if (options.command === "get-dataset") {
628
632
  const datasetId = positional(rest, "dataset id");
629
633
  const datasetVersion = positional(rest, "dataset version");
@@ -212,6 +212,15 @@ class PlatformApiClient {
212
212
  params: { filename: path.basename(resolved) }, body: fs.readFileSync(resolved), contentType: "application/octet-stream",
213
213
  });
214
214
  }
215
+ uploadSourceFile(filePath) {
216
+ const resolved = path.resolve(expandHome(filePath));
217
+ if (!fs.existsSync(resolved) || !fs.statSync(resolved).isFile())
218
+ throw new Error(`source file not found: ${resolved}`);
219
+ const filename = path.basename(resolved).replace(/["\r\n]/g, "_");
220
+ return this.request("POST", "/source-files", {
221
+ params: { filename }, body: fs.readFileSync(resolved), contentType: "application/octet-stream",
222
+ });
223
+ }
215
224
  async downloadDatasetArtifact(project, datasetId, manifestHash, outputDir, force = false) {
216
225
  const target = path.resolve(expandHome(outputDir));
217
226
  if (fs.existsSync(target) && fs.readdirSync(target).length) {
@@ -53,7 +53,8 @@ Keep these evidence rules active in every workflow:
53
53
  5. Read [references/commands.md](references/commands.md) immediately before a platform CLI action: discovery, validation, publication, build, realtime fetch, or artifact download. A local-only draft that is forbidden to call the CLI does not need this reference.
54
54
  6. Use [assets/catalog-template](assets/catalog-template) as a copyable starting point for a new end-to-end catalog. Rename every `example_*` identifier and update every referenced path before validation.
55
55
  7. Read [references/data-platform-mapping.md](references/data-platform-mapping.md) when binding published external data-platform Mapping outputs to Parameters.
56
- 8. Read [references/platform-capability-guide.md](references/platform-capability-guide.md) only when selecting an asset type or explaining a platform capability. Do not load it merely to write a confirmed local draft; it is never evidence for unresolved business semantics.
56
+ 8. For a local CSV or Parquet input, use `upload-source-file FILE` from [references/commands.md](references/commands.md). Treat the returned content-addressed URI and SHA-256 as an immutable `local_file` Parameter source; inspect the returned columns and explicitly define the Parameter before creating Features. Uploading a file does not publish a DatasetArtifact or start training. ZIPs, directory joins, and direct precomputed Artifact imports are not supported by this workflow.
57
+ 9. Read [references/platform-capability-guide.md](references/platform-capability-guide.md) only when selecting an asset type or explaining a platform capability. Do not load it merely to write a confirmed local draft; it is never evidence for unresolved business semantics.
57
58
 
58
59
  ## Initialize The Client
59
60
 
@@ -162,6 +162,18 @@ ml-platform --profile server apply <catalog-directory> --project <project>
162
162
  Parameter -> Operator package/Operator -> Feature -> FeatureSet -> Dataset
163
163
  ```
164
164
 
165
+ For a local CSV or Parquet source, upload the immutable source object first:
166
+
167
+ ```bash
168
+ ml-platform --profile server upload-source-file ./measurements.parquet
169
+ ```
170
+
171
+ Use the response `object_uri`, `object_sha256`, `file_format`, and `columns` in an explicit
172
+ `ParameterSpec.source` with `adapter: "local_file"`, `time_column`, and `value_column`. The
173
+ platform then reads the Parameter through the normal Dataset build and Operator chain. Uploading
174
+ a file alone never publishes a DatasetArtifact and never starts training; ZIPs and multi-file joins
175
+ require a separate manifest contract.
176
+
165
177
  The cross-store publication is not transactional. If an error occurs, report the returned progress summary and rerun only after understanding which immutable assets were already published.
166
178
 
167
179
  ## Resolve And Build A Dataset
@@ -63,6 +63,9 @@ the user wants synchronous zero-shot forecasting from JSON or CSV. This path
63
63
  uses the platform-owned `chronos2_forecaster` model name, not a public project
64
64
  or contract version, and does not create a TrainingRun, ModelArtifact,
65
65
  PredictionJob or prediction result record.
66
+ Before sending a prediction, use the reference's complete request example and
67
+ preflight checklist. The nested schema is a strict versioned contract; do not
68
+ discover its fields through successive 422 responses.
66
69
 
67
70
  ## Shared Gates
68
71
 
@@ -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