@zhuoyuezs/ml-platform 0.1.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 (29) hide show
  1. package/DEVELOPMENT.md +189 -0
  2. package/README.md +103 -0
  3. package/checksums.json +110 -0
  4. package/package.json +29 -0
  5. package/release-policy.json +31 -0
  6. package/release.json +42 -0
  7. package/runtime/business-client/README.md +14 -0
  8. package/runtime/business-client/package-lock.json +19 -0
  9. package/runtime/business-client/package.json +21 -0
  10. package/runtime/business-client/src/catalog.js +184 -0
  11. package/runtime/business-client/src/cli.js +225 -0
  12. package/runtime/business-client/src/config.js +52 -0
  13. package/runtime/business-client/src/http.js +137 -0
  14. package/scripts/lib.js +819 -0
  15. package/scripts/main.js +92 -0
  16. package/skills/feature-management/SKILL.md +265 -0
  17. package/skills/feature-management/agents/openai.yaml +4 -0
  18. package/skills/feature-management/assets/catalog-template/catalog.json +23 -0
  19. package/skills/feature-management/assets/catalog-template/datasets/example_temperature_training.v1.json +24 -0
  20. package/skills/feature-management/assets/catalog-template/feature_sets/example_temperature_core.v1.json +13 -0
  21. package/skills/feature-management/assets/catalog-template/features/example_temperature_mean_5m.v1.json +21 -0
  22. package/skills/feature-management/assets/catalog-template/operator_package/pyproject.toml +12 -0
  23. package/skills/feature-management/assets/catalog-template/operator_package/src/business_feature_operator_template/__init__.py +39 -0
  24. package/skills/feature-management/assets/catalog-template/operator_package/tests/test_operator.py +56 -0
  25. package/skills/feature-management/assets/catalog-template/operators/example_temperature_features.v1.json +43 -0
  26. package/skills/feature-management/assets/catalog-template/parameters/example_temperature.v1.json +57 -0
  27. package/skills/feature-management/references/commands.md +244 -0
  28. package/skills/feature-management/references/contracts.md +682 -0
  29. package/skills/feature-management/references/operator-authoring.md +167 -0
@@ -0,0 +1,244 @@
1
+ # Platform Commands
2
+
3
+ Use the `ml-platform` executable installed on `PATH` by the same ML Platform release as this Skill. The Skill contains no client runtime or launcher. Do not require a platform source checkout. Use the same API target for discovery, dry-run, publication, resolve, and build.
4
+
5
+ ## Contents
6
+
7
+ 1. Select a target
8
+ 2. Discover Registry state
9
+ 3. Test and build an Operator
10
+ 4. Validate and publish a catalog
11
+ 5. Resolve and build a dataset
12
+ 6. Fetch realtime inference data
13
+ 7. Inspect and download an artifact
14
+ 8. Prohibited shortcuts
15
+
16
+ ## Select A Target
17
+
18
+ Verify the installed CLI before using the Skill:
19
+
20
+ ```bash
21
+ command -v ml-platform
22
+ ml-platform version
23
+ ml-platform --help
24
+ ```
25
+
26
+ Configure the server API for business users:
27
+
28
+ ```bash
29
+ ml-platform configure --api-url http://<platform-api-host>:8060
30
+ ml-platform --profile server show-config
31
+ ml-platform --profile server health
32
+ ```
33
+
34
+ The API URL for this environment is fixed at `http://10.36.9.212:30620`.
35
+ Configure it before all discovery, dry-run, publication, build, and artifact
36
+ commands. The address in the command block is a reusable placeholder; replace
37
+ it with the fixed URL above for this deployment.
38
+
39
+ Do not place database, MinIO, or source credentials in commands when the server profile can use managed Secrets.
40
+
41
+ ## Discover Registry State
42
+
43
+ ```bash
44
+ ml-platform --profile server list-parameters -q <stable-name>
45
+ ml-platform --profile server list-operators -q <stable-name>
46
+ ml-platform --profile server list-features -q <stable-name>
47
+ ml-platform --profile server list-feature-sets -q <stable-name>
48
+ ml-platform --profile server list-datasets -q <stable-dataset-id>
49
+ ```
50
+
51
+ By default each `list-*` command auto-pages through the whole result set and
52
+ prints a **bare JSON array** of every matching item, so it never silently stops
53
+ at the server's default page size. Use `-q` for a case-insensitive identifier
54
+ substring search. To fetch one explicit page instead, pass `--limit` (1-500)
55
+ and/or `--offset`; in that single-page mode the command prints the
56
+ `{"items": [...], "total": ..., "limit": ..., "offset": ...}` envelope so you can
57
+ resume with the next `--offset`. Note that `--offset` paging is not stable
58
+ under concurrent writes: if items are added or removed between page requests,
59
+ boundary rows can be skipped or repeated. A stable cursor is planned as a
60
+ follow-up. Catalog `apply` and `apply --dry-run` page
61
+ through the entire Registry automatically. Filter structured JSON with a JSON
62
+ parser when the output is large. Do not scrape it with fragile text replacement.
63
+
64
+ Every `list-*` registry command (except `list-jobs`) accepts `--project <name>`
65
+ to restrict results to a single project. Omit it to list across all projects:
66
+
67
+ ```bash
68
+ ml-platform --profile server list-parameters --project <project>
69
+ ml-platform --profile server list-feature-sets --project <project>
70
+ ```
71
+
72
+ ## Projects
73
+
74
+ A project is an isolated namespace over the whole registry. The real identity of
75
+ every asset is `project/name:version`, so the same `name:version` can exist
76
+ independently under different projects and never collide. The platform ships a
77
+ built-in `default` project used whenever a project is not specified.
78
+
79
+ Project is supplied differently for writes vs reads:
80
+
81
+ Manage projects through the business client as well:
82
+
83
+ ```bash
84
+ ml-platform create-project <project> --display-name "<display name>" --description "<description>"
85
+ ml-platform list-projects
86
+ ml-platform get-project <project>
87
+ ml-platform delete-project <project>
88
+ ```
89
+
90
+ `delete-project` is subject to the server's protection and only succeeds for an
91
+ empty project. Project commands are server-only and do not modify local storage.
92
+
93
+ - Creation: the project an asset is published under comes from the optional
94
+ `project` field in its own JSON spec (defaults to `default` when omitted). Set
95
+ `"project": "<name>"` in the spec to publish into a non-default project.
96
+ - `apply --project <project>` scopes the comparison snapshot the catalog is
97
+ validated against (omit to compare against `default`);
98
+ - `list-* --project <project>` filters discovery to that project;
99
+ - `get-dataset-artifact` / `download-dataset-artifact` take the project as their
100
+ first positional argument (defaults to `default`).
101
+
102
+ Before choosing names, discover within the target project: identical names in a
103
+ different project are unrelated and must not be reused across projects to mean the
104
+ same thing. Cross-project references are rejected by the platform.
105
+
106
+ ## Test And Build An Operator
107
+
108
+ From the Operator package directory:
109
+
110
+ ```bash
111
+ uv run python -m unittest discover -s tests -p 'test_*.py'
112
+ ```
113
+
114
+ Build the package:
115
+
116
+ ```bash
117
+ uv build <catalog>/operator_package \
118
+ --wheel \
119
+ --out-dir <catalog>/operator_package/dist
120
+ ```
121
+
122
+ Confirm that `catalog.json` references the exact generated filename.
123
+
124
+ ## Validate And Publish A Catalog
125
+
126
+ Validate against the intended server Registry without mutation:
127
+
128
+ ```bash
129
+ ml-platform --profile server apply <catalog-directory> --dry-run
130
+ ```
131
+
132
+ Review the returned counts and conflicts. After explicit user approval, publish:
133
+
134
+ ```bash
135
+ ml-platform --profile server apply <catalog-directory>
136
+ ```
137
+
138
+ Add `--project <project>` to publish into a specific project and compare against
139
+ that project's snapshot only. Without it, the catalog is applied to the built-in
140
+ `default` project:
141
+
142
+ ```bash
143
+ ml-platform --profile server apply <catalog-directory> --project <project> --dry-run
144
+ ml-platform --profile server apply <catalog-directory> --project <project>
145
+ ```
146
+
147
+ `apply` processes dependencies in this order:
148
+
149
+ ```text
150
+ Parameter -> Operator package/Operator -> Feature -> FeatureSet -> Dataset
151
+ ```
152
+
153
+ 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.
154
+
155
+ ## Resolve And Build A Dataset
156
+
157
+ Resolve without fetching source data:
158
+
159
+ ```bash
160
+ ml-platform --profile server \
161
+ resolve-manifest <catalog>/datasets/<dataset>.json \
162
+ --out /tmp/<dataset>.resolved.json
163
+ ```
164
+
165
+ Submit and wait for a server build:
166
+
167
+ ```bash
168
+ ml-platform --profile server \
169
+ build-dataset <catalog>/datasets/<dataset>.json \
170
+ --partition-duration 1d \
171
+ --max-parallelism 1 \
172
+ --wait
173
+ ```
174
+
175
+ `--partition-duration` is an execution control and does not change the
176
+ DatasetManifest hash. The initial implementation is sequential, so keep
177
+ `--max-parallelism 1`. Completed partitions are checkpointed and resumed by
178
+ default; use `--no-resume` only to force a clean execution.
179
+
180
+ Record the returned `job_id`, `dataset_id`, and `manifest_hash`. If a separate wait is needed:
181
+
182
+ ```bash
183
+ ml-platform --profile server wait-job <job_id>
184
+ ml-platform --profile server get-job <job_id>
185
+ ```
186
+
187
+ ## Fetch Realtime Inference Data
188
+
189
+ Fetch one causal-cutoff row in memory:
190
+
191
+ ```bash
192
+ ml-platform --profile server \
193
+ fetch-inference-data <catalog>/datasets/<dataset>.json \
194
+ --cutoff-time 2026-07-31T10:00:00+08:00
195
+ ```
196
+
197
+ Optional flags `--max-workers`, `--max-source-lag-hours`,
198
+ `--no-validate-freshness`, and `--allow-missing` override individual
199
+ `realtime_fetch` fields for this request. Prefer the versioned manifest policy;
200
+ use overrides only when the user explicitly requests different runtime behavior.
201
+
202
+ This command calls `POST /inference-data/fetch`. It does not submit a build Job,
203
+ write parquet, or publish a DatasetArtifact. Treat HTTP `503` as retryable source
204
+ freshness/missing-data failure and HTTP `400` as a contract error that requires a
205
+ manifest or request change.
206
+
207
+ ## Inspect And Download An Artifact
208
+
209
+ ```bash
210
+ ml-platform --profile server \
211
+ get-dataset-artifact <dataset_id> <manifest_hash> --project <project>
212
+
213
+ ml-platform --profile server \
214
+ download-dataset-artifact <dataset_id> <manifest_hash> \
215
+ --project <project> \
216
+ --out-dir /tmp/<dataset_id>-artifact
217
+ ```
218
+
219
+ `--project` defaults to `default`; pass the owning project when the dataset lives
220
+ elsewhere, or the lookup returns `artifact_not_found`.
221
+
222
+ Inspect at least:
223
+
224
+ ```text
225
+ dataset_manifest.json
226
+ resolved_manifest.json
227
+ validation.json
228
+ lineage.json
229
+ feature_computations/computation_manifest.json
230
+ feature_computations/executions/*.json
231
+ feature_dataset.parquet
232
+ ```
233
+
234
+ Use a structured Parquet reader for schema, row count, column order, and missing-rate inspection.
235
+
236
+ ## Prohibited Shortcuts
237
+
238
+ - Do not use `seed-demo v95` for business catalogs.
239
+ - Do not call individual `add-*` commands when catalog `apply` is available for an end-to-end publication.
240
+ - Do not use `delete-dataset`, `cancel-job`, or force overwrite operations unless separately requested.
241
+ - Do not build images, deploy Kubernetes, or change service configuration in this workflow.
242
+ - Do not claim a successful publication from `--dry-run` output.
243
+ - Do not claim Chronon compile/backfill from a successful first-phase Operator build.
244
+ - Do not use `build-dataset` to serve a single realtime inference cutoff.