@zhuoyuezs/ml-platform 0.1.8 → 0.1.10
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 +7 -3
- package/package.json +1 -1
- package/checksums.json +0 -155
- package/release.json +0 -52
- package/runtime/business-client/README.md +0 -78
- package/runtime/business-client/package-lock.json +0 -19
- package/runtime/business-client/package.json +0 -23
- package/runtime/business-client/src/catalog.js +0 -206
- package/runtime/business-client/src/cli.js +0 -533
- package/runtime/business-client/src/config.js +0 -56
- package/runtime/business-client/src/http.js +0 -254
- package/skills/feature-management/SKILL.md +0 -479
- package/skills/feature-management/agents/openai.yaml +0 -4
- package/skills/feature-management/assets/catalog-template/catalog.json +0 -23
- package/skills/feature-management/assets/catalog-template/datasets/example_temperature_training.v1.json +0 -40
- package/skills/feature-management/assets/catalog-template/feature_sets/example_temperature_core.v1.json +0 -14
- package/skills/feature-management/assets/catalog-template/features/example_temperature_mean_5m.v1.json +0 -28
- package/skills/feature-management/assets/catalog-template/operator_package/pyproject.toml +0 -12
- package/skills/feature-management/assets/catalog-template/operator_package/src/business_feature_operator_template/__init__.py +0 -39
- package/skills/feature-management/assets/catalog-template/operator_package/tests/test_operator.py +0 -83
- package/skills/feature-management/assets/catalog-template/operators/example_temperature_features.v1.json +0 -58
- package/skills/feature-management/assets/catalog-template/parameters/example_temperature.v1.json +0 -58
- package/skills/feature-management/references/commands.md +0 -358
- package/skills/feature-management/references/contracts.md +0 -719
- package/skills/feature-management/references/operator-authoring.md +0 -175
- package/skills/feature-management/references/platform-capability-guide.md +0 -75
- package/skills/feature-management/references/supervised-datasets.md +0 -101
- package/skills/model-lifecycle-management/SKILL.md +0 -38
- package/skills/model-lifecycle-management/agents/openai.yaml +0 -4
- package/skills/model-lifecycle-management/references/discovery.md +0 -89
- package/skills/model-lifecycle-management/references/evaluation.md +0 -172
- package/skills/model-lifecycle-management/references/packaging.md +0 -51
- package/skills/model-lifecycle-management/references/training-contracts.md +0 -139
- package/skills/model-lifecycle-management/references/training.md +0 -81
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
# Operator Authoring
|
|
2
|
-
|
|
3
|
-
Read this file whenever a workflow creates or changes executable Operator code.
|
|
4
|
-
|
|
5
|
-
## Contents
|
|
6
|
-
|
|
7
|
-
1. Package contract
|
|
8
|
-
2. Feature entrypoint contract
|
|
9
|
-
3. Causal calculation rules
|
|
10
|
-
4. Required tests
|
|
11
|
-
5. Build and publication
|
|
12
|
-
6. Security boundary
|
|
13
|
-
|
|
14
|
-
## Package Contract
|
|
15
|
-
|
|
16
|
-
Build a standalone pure-Python wheel. Do not import report-local, experiment-local, or unregistered business packages. Declare runtime dependencies explicitly, but keep the package small and compatible with `py3-none-any`.
|
|
17
|
-
|
|
18
|
-
Minimal `pyproject.toml`:
|
|
19
|
-
|
|
20
|
-
```toml
|
|
21
|
-
[build-system]
|
|
22
|
-
requires = ["hatchling"]
|
|
23
|
-
build-backend = "hatchling.build"
|
|
24
|
-
|
|
25
|
-
[project]
|
|
26
|
-
name = "pressure-features"
|
|
27
|
-
version = "1.0.0"
|
|
28
|
-
requires-python = ">=3.10"
|
|
29
|
-
dependencies = ["pandas>=2.3.3"]
|
|
30
|
-
|
|
31
|
-
[tool.hatch.build.targets.wheel]
|
|
32
|
-
packages = ["src/pressure_features"]
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Keep package version and Operator Registry version independently explicit. Change both when code behavior changes unless a documented release policy maps them differently.
|
|
36
|
-
|
|
37
|
-
## Feature Entrypoint Contract
|
|
38
|
-
|
|
39
|
-
Implement:
|
|
40
|
-
|
|
41
|
-
```python
|
|
42
|
-
def compute_features(context: Any) -> pandas.DataFrame:
|
|
43
|
-
...
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Available context fields:
|
|
47
|
-
|
|
48
|
-
```text
|
|
49
|
-
manifest
|
|
50
|
-
features
|
|
51
|
-
inputs
|
|
52
|
-
config
|
|
53
|
-
requested_output_columns
|
|
54
|
-
operator
|
|
55
|
-
parameters
|
|
56
|
-
metric_frames
|
|
57
|
-
target_times
|
|
58
|
-
prediction_horizon
|
|
59
|
-
cutoff_times
|
|
60
|
-
furnace_id
|
|
61
|
-
computation_hash
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Each `metric_frames[parameter_key]` is a standard long frame with source timestamps and values. Resolve frames from `context.inputs`; do not reach into a database, API, filesystem secret, or environment credential.
|
|
65
|
-
|
|
66
|
-
Use `context.cutoff_times` for causal feature windows. It is derived once from
|
|
67
|
-
`context.target_times - context.prediction_horizon` using the DatasetManifest
|
|
68
|
-
prediction contract; do not parse a duplicated Feature-level horizon.
|
|
69
|
-
|
|
70
|
-
An Operator requires an explicit forecast contract whenever its formula or code
|
|
71
|
-
uses `context.cutoff_times`, or any `input_schema.history_requirements` entry uses
|
|
72
|
-
`anchor: cutoff`. In that case always declare `input_schema.prediction` with
|
|
73
|
-
`required`, `minimum_horizon`, and `maximum_horizon`. This includes a strict
|
|
74
|
-
nowcast: declare `required=true` and both bounds as `0min`; do not omit the
|
|
75
|
-
section and silently accept the runtime's `default_nowcast` fallback. Declare
|
|
76
|
-
source history as `input_schema.history_requirements`, using `anchor: cutoff`
|
|
77
|
-
for causal windows and `anchor: target_time` only for intentional target-aligned
|
|
78
|
-
formulas. Scope a requirement with `output_columns` when only some outputs need
|
|
79
|
-
it. Include alignment slack such as hourly floor boundaries in the declared
|
|
80
|
-
lookback.
|
|
81
|
-
|
|
82
|
-
For realtime reads, `history_requirements` is also the per-Parameter fetch
|
|
83
|
-
contract. Do not rely on a package-local lookback map or a single fixed window
|
|
84
|
-
shared by all inputs. The realtime runner widens a half-open adapter read by one
|
|
85
|
-
grid step, then applies `timestamp <= cutoff`; an Operator must never consume a
|
|
86
|
-
post-cutoff row.
|
|
87
|
-
|
|
88
|
-
Return requirements:
|
|
89
|
-
|
|
90
|
-
- Return a pandas DataFrame.
|
|
91
|
-
- Return exactly one row per `context.target_times` entry.
|
|
92
|
-
- Return `event_time` in the same order and with the same timestamps.
|
|
93
|
-
- Optionally return `furnace_id`.
|
|
94
|
-
- Return every requested physical output column.
|
|
95
|
-
- Avoid calculating unrequested expensive columns when practical.
|
|
96
|
-
- Reject unknown requested output columns.
|
|
97
|
-
- Preserve numeric missing values rather than silently filling them without a declared rule.
|
|
98
|
-
|
|
99
|
-
One Operator may return multiple physical columns. Each public Feature still binds one `output_column` and exact inputs.
|
|
100
|
-
|
|
101
|
-
## Causal Calculation Rules
|
|
102
|
-
|
|
103
|
-
State every time rule in tests and descriptions:
|
|
104
|
-
|
|
105
|
-
- forecast horizon and cutoff derivation;
|
|
106
|
-
- whether an event exactly at cutoff is included (`<=`) or excluded (`<`);
|
|
107
|
-
- rolling window left/right closure;
|
|
108
|
-
- timezone and daylight-saving assumptions;
|
|
109
|
-
- duplicate timestamp resolution;
|
|
110
|
-
- sparse-event fallback behavior;
|
|
111
|
-
- rounding stage and decimal count;
|
|
112
|
-
- behavior before and after dated business-rule changes.
|
|
113
|
-
|
|
114
|
-
Never infer a rule from a Feature name alone. Require a business decision when a boundary is unspecified.
|
|
115
|
-
|
|
116
|
-
## Required Tests
|
|
117
|
-
|
|
118
|
-
Use deterministic fixtures and cover each applicable item with a separately
|
|
119
|
-
named test. A broad formula or happy-path test does not substitute for the
|
|
120
|
-
cutoff-before, cutoff-at, cutoff-after, duplicate/missing, empty-history,
|
|
121
|
-
requested-output, event-time-order, or dtype/rounding cases below:
|
|
122
|
-
|
|
123
|
-
1. expected formula values;
|
|
124
|
-
2. the event immediately before cutoff;
|
|
125
|
-
3. an event exactly at cutoff;
|
|
126
|
-
4. an event immediately after cutoff;
|
|
127
|
-
5. missing and duplicate inputs;
|
|
128
|
-
6. empty history or insufficient lookback;
|
|
129
|
-
7. requested output subsets;
|
|
130
|
-
8. exact `event_time` row count and order;
|
|
131
|
-
9. output dtype and rounding;
|
|
132
|
-
10. every dated business-rule branch.
|
|
133
|
-
|
|
134
|
-
Run package tests before building the wheel. Then inspect the wheel tag and ensure it is `py3-none-any`.
|
|
135
|
-
|
|
136
|
-
## Build And Publication
|
|
137
|
-
|
|
138
|
-
Build into the catalog path referenced by `catalog.json`:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
uv build <catalog>/operator_package \
|
|
142
|
-
--wheel \
|
|
143
|
-
--out-dir <catalog>/operator_package/dist
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
Keep the draft Operator fields null:
|
|
147
|
-
|
|
148
|
-
```json
|
|
149
|
-
{
|
|
150
|
-
"code_hash": null,
|
|
151
|
-
"package_uri": null,
|
|
152
|
-
"code_artifact": null
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
Catalog publication uploads the wheel, computes SHA-256 and size, records its immutable object URI, and registers the resolved OperatorSpec.
|
|
157
|
-
|
|
158
|
-
Do not reuse an Operator version with a different wheel. If the same key already exists with different content or digest, create a new version.
|
|
159
|
-
|
|
160
|
-
## Security Boundary
|
|
161
|
-
|
|
162
|
-
The current runtime blocks socket networking, removes storage/source credentials from the child environment, verifies the wheel hash, enforces a timeout, and extracts only pure-Python wheels without native libraries or unsafe paths.
|
|
163
|
-
|
|
164
|
-
This is not a complete OS sandbox. Therefore:
|
|
165
|
-
|
|
166
|
-
- publish only reviewed internal code;
|
|
167
|
-
- do not read arbitrary host paths;
|
|
168
|
-
- do not spawn subprocesses;
|
|
169
|
-
- do not access secrets or environment configuration;
|
|
170
|
-
- do not use dynamic code evaluation;
|
|
171
|
-
- do not add native libraries;
|
|
172
|
-
- do not perform network calls;
|
|
173
|
-
- keep resource limits conservative.
|
|
174
|
-
|
|
175
|
-
Request an engineering/security review when the formula requires capabilities outside this boundary.
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# Platform Capability Guide
|
|
2
|
-
|
|
3
|
-
Use this guide to explain what the platform can execute. It is not business
|
|
4
|
-
evidence. A platform default never answers an unresolved business question.
|
|
5
|
-
|
|
6
|
-
## Platform In One Paragraph
|
|
7
|
-
|
|
8
|
-
The platform is a versioned data-contract, registry, execution, and delivery
|
|
9
|
-
layer for algorithm projects. It turns confirmed source Parameters and approved
|
|
10
|
-
deterministic Operators into ordered Features and reproducible DatasetManifests,
|
|
11
|
-
then either materializes a batch DatasetArtifact or serves one causal realtime
|
|
12
|
-
read. It owns source adapters, quality/missingness/freshness evidence, lineage,
|
|
13
|
-
replay metadata, and data Job execution. This Skill covers that data subsystem;
|
|
14
|
-
use the separate model lifecycle Skill for training, evaluation and packaging.
|
|
15
|
-
Model serving, source-table creation and Kubernetes administration are outside
|
|
16
|
-
this Skill's scope. Do not present a Skill boundary as a platform capability gap.
|
|
17
|
-
|
|
18
|
-
The following distinctions are part of the platform contract:
|
|
19
|
-
|
|
20
|
-
- A `Parameter` is a public source-data contract, not an arbitrary raw table or
|
|
21
|
-
a model feature.
|
|
22
|
-
- An `Operator` is versioned executable code; a `Feature` is exactly one output
|
|
23
|
-
column; a `FeatureSet` is the consumer-visible column order.
|
|
24
|
-
- A `DatasetManifest` is a versioned request for time range, read policy,
|
|
25
|
-
rowsets, missing/endpoint rules, prediction, and one FeatureSet.
|
|
26
|
-
- A `DatasetArtifact` is an output of an authorized build, not evidence that the
|
|
27
|
-
source contract or business formula was semantically approved.
|
|
28
|
-
- Realtime inference is a causal cutoff read. It must not run a batch build,
|
|
29
|
-
write Parquet, or publish a DatasetArtifact.
|
|
30
|
-
|
|
31
|
-
Dry-run and registry resolution are structural evidence. They may not detect a
|
|
32
|
-
missing source relation; source-backed success must be established by the build
|
|
33
|
-
or realtime fetch response. Artifact metadata is separate from downloaded-file
|
|
34
|
-
evidence: schema, column order, file hashes, and numeric parity require the
|
|
35
|
-
complete files.
|
|
36
|
-
|
|
37
|
-
## Public Assets
|
|
38
|
-
|
|
39
|
-
| Asset | Stores | Use when | Do not use for |
|
|
40
|
-
|---|---|---|---|
|
|
41
|
-
| Project | Namespace and isolation boundary | Every independent business release | A dataset version or a source table |
|
|
42
|
-
| Parameter | One readable source contract and its quality/time semantics | Raw or independently readable source values/events | Rolling means, ratios, trends, model columns |
|
|
43
|
-
| Operator | Versioned deterministic executable code | A formula needs computation over declared inputs | A business definition without confirmed formula |
|
|
44
|
-
| Feature | One immutable output-column contract | One model/input column produced by an Operator | A group of columns or an unnamed formula |
|
|
45
|
-
| FeatureSet | Ordered Feature references | Consumer column order is part of the contract | Copying formulas or creating multiple datasets |
|
|
46
|
-
| DatasetManifest | Dataset mode, time grid, rowsets, policy and FeatureSet reference | A reproducible dataset contract is ready | Filling unknown source or business semantics |
|
|
47
|
-
| DatasetArtifact | Output of an authorized build | Build was explicitly approved and completed | Proving a Catalog is semantically correct |
|
|
48
|
-
|
|
49
|
-
## Decision Rules
|
|
50
|
-
|
|
51
|
-
- Parameter answers **what source value is exposed**; Operator/Feature answers
|
|
52
|
-
**how a confirmed business formula is computed**.
|
|
53
|
-
- FeatureSet order is consumer-facing and must be confirmed; it is not inferred
|
|
54
|
-
from filesystem order or JSON discovery order.
|
|
55
|
-
- Dataset `time_range`, `prediction`, `rowset_splits`, `abnormal_windows` and
|
|
56
|
-
`endpoint_policy` are separate contracts. A platform default does not choose
|
|
57
|
-
a business policy.
|
|
58
|
-
- `apply --dry-run` checks structure, references, package and immutability. It
|
|
59
|
-
does not prove source correctness, formula correctness or artifact parity.
|
|
60
|
-
- `publish` creates immutable Registry resources. `build` creates an execution
|
|
61
|
-
Job and must have a separate explicit approval.
|
|
62
|
-
|
|
63
|
-
## Required Semantic Asset Review
|
|
64
|
-
|
|
65
|
-
Before writing Catalog JSON, produce a local review table with one row per
|
|
66
|
-
Parameter, Operator, Feature and Dataset field:
|
|
67
|
-
|
|
68
|
-
```text
|
|
69
|
-
asset_key | business_meaning | source/evidence | confirmed_by | unresolved | proposed_value
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Stop before Catalog generation if any required `source/evidence`, formula,
|
|
73
|
-
time boundary, unit, null policy, output dtype, FeatureSet order, read policy,
|
|
74
|
-
or approval field is unresolved. The review table is a proposal for the user;
|
|
75
|
-
it is not a Registry asset and must not contain guessed values.
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
# Supervised dataset preflight
|
|
2
|
-
|
|
3
|
-
Use before the first immutable publication for training/evaluation. Examples
|
|
4
|
-
describe the current contract; deployed capabilities still require validation.
|
|
5
|
-
|
|
6
|
-
## Labels and clocks
|
|
7
|
-
|
|
8
|
-
Keep labels out of FeatureSet order. Training rejects overlap with `data.labels`
|
|
9
|
-
even when an input adapter would omit that column. Generic supervised labels use
|
|
10
|
-
`label_materializations`, mutually exclusive with legacy `target`.
|
|
11
|
-
|
|
12
|
-
Merge this fragment into a complete manifest, replacing source identities:
|
|
13
|
-
|
|
14
|
-
```json
|
|
15
|
-
{
|
|
16
|
-
"mode": "training",
|
|
17
|
-
"prediction": {"horizon": "5min"},
|
|
18
|
-
"label_materializations": [{
|
|
19
|
-
"name": "future_pressure",
|
|
20
|
-
"source": {"kind": "parameter", "ref": {
|
|
21
|
-
"name": "pressure", "version": "v1", "project": "default"
|
|
22
|
-
}},
|
|
23
|
-
"output_column": "future_pressure",
|
|
24
|
-
"event_time": {"source_field": "timestamp", "offset": "0min"},
|
|
25
|
-
"alignment": {"method": "exact"},
|
|
26
|
-
"missing_policy": "report",
|
|
27
|
-
"dtype": "float64"
|
|
28
|
-
}]
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
`source_field` names a column in the normalized Parameter frame, commonly
|
|
33
|
-
`timestamp`, not automatically the output Feature frame's `event_time`. Other
|
|
34
|
-
names need source-frame evidence. The schema lists `dataset_column` and
|
|
35
|
-
`operator_output`, but the current materializer supports Parameter sources;
|
|
36
|
-
resolve before building rather than treating schema acceptance as runtime support.
|
|
37
|
-
Choose `report`, `reject` or `drop` according to the intended label population.
|
|
38
|
-
|
|
39
|
-
- `prediction_time = event_time` is the causal cutoff.
|
|
40
|
-
- `label_time = prediction_time + prediction.horizon` is the forecast target.
|
|
41
|
-
- `event_time.offset` shifts the source observation clock before alignment. At
|
|
42
|
-
exact alignment, source time `s` matches label time `t` when `s + offset = t`.
|
|
43
|
-
|
|
44
|
-
For cutoff 10:00 and horizon 5min, expect label time 10:05 and, with zero offset,
|
|
45
|
-
the source value at 10:05. A positive offset is not a shortcut to future values
|
|
46
|
-
and does not change the forecast horizon. `offset_minutes` belongs to legacy
|
|
47
|
-
`target`, not generic label materialization. Free-form dictionaries can accept
|
|
48
|
-
unused keys: inspect resolved semantics and sampled built rows too.
|
|
49
|
-
|
|
50
|
-
Check every Operator's `input_schema.prediction` before publication. A maximum
|
|
51
|
-
horizon of zero is incompatible with a 5min manifest. Review a new immutable
|
|
52
|
-
Operator version and causal tests, or select a compatible Operator; do not
|
|
53
|
-
compensate with label offsets or silently reduce the requested horizon. Zero
|
|
54
|
-
horizon does not itself disable named splits.
|
|
55
|
-
|
|
56
|
-
## Splits and schema must precede training
|
|
57
|
-
|
|
58
|
-
`rowset_splits` is a mapping, not an array, and is mutually exclusive with
|
|
59
|
-
`rowset`. Values are RowsetStrategy objects: `strategy`, optional `time_range`,
|
|
60
|
-
and `grid` for `fixed_grid`. See [contracts.md](contracts.md) for the full split
|
|
61
|
-
example. Fixed-grid split grids must match the manifest grid; ranges are
|
|
62
|
-
half-open and must not overlap.
|
|
63
|
-
|
|
64
|
-
Building splits adds `rowset_split` and can change the complete DataSchema hash.
|
|
65
|
-
Settle split/metadata columns, labels, time columns, dtypes, roles and FeatureSet
|
|
66
|
-
order before training. Matching feature values alone does not ensure evaluation
|
|
67
|
-
compatibility after adding columns.
|
|
68
|
-
|
|
69
|
-
Dataset split declaration does not populate the TrainingRun binding. Hand this
|
|
70
|
-
fragment to the lifecycle consumer to merge under `data`:
|
|
71
|
-
|
|
72
|
-
```json
|
|
73
|
-
{
|
|
74
|
-
"splits": {
|
|
75
|
-
"assignment_column": "rowset_split",
|
|
76
|
-
"train": ["training"],
|
|
77
|
-
"validation": ["validation"],
|
|
78
|
-
"test": ["test"]
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Keys are consumer roles; array values are actual artifact assignment values.
|
|
84
|
-
For a manifest split named `train`, use `["train"]`. Hand off the exact artifact
|
|
85
|
-
identity, DataSchema hash, FeatureSet order, label/temporal contracts, observed
|
|
86
|
-
split counts and binding together.
|
|
87
|
-
|
|
88
|
-
## Evidence checkpoints
|
|
89
|
-
|
|
90
|
-
Before publication, review schema and Operator limits and run catalog dry-run.
|
|
91
|
-
After publication, resolve labels, source fields, horizon and dependencies before
|
|
92
|
-
building. After build, inspect DataSchema and sampled Parquet rows for the clock
|
|
93
|
-
equation, source-label alignment, nulls and split counts. A small authorized
|
|
94
|
-
diagnostic build can test source semantics but cannot replace final artifact
|
|
95
|
-
identity or full-data validation.
|
|
96
|
-
|
|
97
|
-
Before training, validate the TrainingRun with explicit splits and confirm
|
|
98
|
-
trainer shape/device and evaluation runtime support. Do not create successive
|
|
99
|
-
immutable dataset versions or launch training to discover field names. Stop at
|
|
100
|
-
the first unexplained error, preserve the request and evidence outside the
|
|
101
|
-
repository, and correct the draft once the cause is understood.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: model-lifecycle-management
|
|
3
|
-
description: Manage ITSMP model training, evaluation, and immutable model packaging through the deployed platform API. Use when a user asks to list or inspect registered TrainerDefinitions, register a trainer, validate or submit a training run, inspect/retry/cancel training jobs, configure or run governed evaluation, inspect evaluation evidence, validate a ModelArtifact, or create and inspect a ModelPackage. Do not use for feature catalog authoring, dataset builds, model deployment, Kubernetes administration, or image release engineering.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Model Lifecycle Management
|
|
7
|
-
|
|
8
|
-
Use the `ml-platform` executable installed with the same npm release as this Skill. Verify `ml-platform version`, `ml-platform show-config`, and server health before API operations. Never use a platform source checkout or a second client runtime.
|
|
9
|
-
|
|
10
|
-
```text
|
|
11
|
-
DatasetArtifact -> TrainingRun -> TrainingJob -> ModelArtifact
|
|
12
|
-
-> EvaluationRun/Job -> EvaluationResult/Summary -> ModelPackage
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Read [references/training.md](references/training.md) for training work, [references/evaluation.md](references/evaluation.md) for governed evaluation, and [references/packaging.md](references/packaging.md) for ModelArtifact validation and packaging. Read only the references required by the request.
|
|
16
|
-
|
|
17
|
-
Read [references/discovery.md](references/discovery.md) before locating existing
|
|
18
|
-
resources or selecting runtime bindings. It also defines Job/package preflight
|
|
19
|
-
and version-skew handling.
|
|
20
|
-
|
|
21
|
-
## Shared Gates
|
|
22
|
-
|
|
23
|
-
Before training a model that will be evaluated, also read
|
|
24
|
-
[references/evaluation.md](references/evaluation.md). Check the final dataset
|
|
25
|
-
schema, training split binding and evaluation runtime before submission.
|
|
26
|
-
OpenAPI free-form dictionaries are not complete nested contracts: use the
|
|
27
|
-
examples in these references and same-release validation, not successive 422s
|
|
28
|
-
to discover fields. Preserve release/error evidence when deployment differs.
|
|
29
|
-
|
|
30
|
-
- Establish exact immutable inputs, TrainerDefinition `v1`, runtime image digest, model inputs/targets, resources, evaluation policy, and package destination from authoritative contracts. Do not infer them from model names.
|
|
31
|
-
- Validate, register, submit, retry, cancel, and package creation are separate actions. Read-only discovery and validation do not authorize mutation or workload submission.
|
|
32
|
-
- Before submission, show the exact JSON path, immutable identities, expected workload, and target API. Obtain explicit authorization. Retry and cancel require separate authorization for the exact Job.
|
|
33
|
-
- Never use `latest` image tags. During development TrainerDefinition stays at `v1`; rebinding it follows the reviewed release procedure and requires confirming no active Job references the old definition.
|
|
34
|
-
- A succeeded Job is insufficient evidence. Training requires a valid ModelArtifact and signature; evaluation requires immutable Result/Summary evidence and coverage; packaging requires `READY`, an immutable image digest, manifest, and passing test report.
|
|
35
|
-
- Do not register caller-computed evaluation results. Workers produce predictions, metrics, decisions, and summaries from frozen DatasetArtifact rowsets.
|
|
36
|
-
- Keep credentials, registry secrets, Kubernetes details, and model binaries out of request JSON and reports.
|
|
37
|
-
|
|
38
|
-
Report immutable input identities, returned run/job/package IDs, status, validation or gate failures, and the next authorized action. Never claim deployment; it is outside this Skill.
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Discover exact contracts before authoring requests
|
|
2
|
-
|
|
3
|
-
Use the same-release CLI/API. Start with `version`, `show-config`, `health` and
|
|
4
|
-
`get-model-runtime-release`. If a documented command is absent from `--help`,
|
|
5
|
-
or a new endpoint returns 404, record client/server release evidence and upgrade
|
|
6
|
-
to the matching release; do not guess another resource name or submit work as a
|
|
7
|
-
capability probe.
|
|
8
|
-
|
|
9
|
-
## Effective runtime policy
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
ml-platform --profile server get-model-runtime-release
|
|
13
|
-
ml-platform --profile server list-trainer-definitions
|
|
14
|
-
ml-platform --profile server get-trainer-definition NAME v1 --project PROJECT
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Discovery returns `configured`, `release_id`, `approval_policy`, and `bindings`.
|
|
18
|
-
Each binding contains the exact `project/name:version:device` trainer key,
|
|
19
|
-
immutable training and Serving base images, input modes and architectures.
|
|
20
|
-
Compare the registered TrainerDefinition image against the binding before Job
|
|
21
|
-
preflight. A binding is release approval, not proof that a matching definition
|
|
22
|
-
is registered. `configured=false` means capability-based validation without a
|
|
23
|
-
release allowlist; it does not mean every trainer/device is approved by a release.
|
|
24
|
-
`evaluation.runtime_identity` and `default_executor` are effective server values.
|
|
25
|
-
`worker_dependencies_verified=false` explicitly means discovery has not tested
|
|
26
|
-
imports, image pulls or model prediction in the Worker.
|
|
27
|
-
|
|
28
|
-
## Resource lookup and pagination
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
ml-platform --profile server list-training-runs -q pressure --limit 50 --offset 0
|
|
32
|
-
ml-platform --profile server get-training-run RUN_ID
|
|
33
|
-
ml-platform --profile server list-training-jobs -q RUN_ID
|
|
34
|
-
ml-platform --profile server list-model-artifacts -q JOB_ID
|
|
35
|
-
ml-platform --profile server get-model-artifact ARTIFACT_ID
|
|
36
|
-
ml-platform --profile server list-evaluation-configs
|
|
37
|
-
ml-platform --profile server list-evaluation-runs -q ARTIFACT_ID
|
|
38
|
-
ml-platform --profile server list-evaluation-jobs -q RUN_ID
|
|
39
|
-
ml-platform --profile server list-metric-definitions
|
|
40
|
-
ml-platform --profile server list-executable-packages
|
|
41
|
-
ml-platform --profile server get-executable-package NAME VERSION
|
|
42
|
-
ml-platform --profile server list-model-packages -q ARTIFACT_ID
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
All these list commands return `items`, `total`, `limit`, `offset`; default limit
|
|
46
|
-
is 50, maximum 500. Continue with offset plus returned item count until total is
|
|
47
|
-
reached. `-q` is a case-insensitive substring of serialized metadata, not a query
|
|
48
|
-
language or project authorization filter. Always verify exact identities after
|
|
49
|
-
search. Collections are global metadata views; no project filter is claimed.
|
|
50
|
-
Jobs in lists are immutable specs; use the exact get-job command for refreshed
|
|
51
|
-
status. Lists do not reconcile or schedule workloads. `get-training-run` returns
|
|
52
|
-
`training_run` plus `spec_hash`; artifact/package detail returns the object.
|
|
53
|
-
|
|
54
|
-
## Read-only preflight
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
ml-platform --profile server validate-training-job training-job-request.json
|
|
58
|
-
ml-platform --profile server validate-model-package model-package-request.json
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Training preflight requires an already registered Run with its exact hash and
|
|
62
|
-
resolves the same Job spec used by submission, including device/runtime approval,
|
|
63
|
-
resources and distributed capability. Packaging preflight resolves the same
|
|
64
|
-
artifact eligibility, selected runtime, input modes and immutable-version conflict
|
|
65
|
-
checks used by creation. Both return `status=valid`, the proposed `job_spec` or
|
|
66
|
-
`package`, `submitted=false` and `unchecked` execution checks. They do not register
|
|
67
|
-
Jobs/packages or invoke schedulers. Artifact reads can populate local caches.
|
|
68
|
-
|
|
69
|
-
A valid preview does not prove image availability, cluster capacity, credentials,
|
|
70
|
-
framework imports, training success or packaging test success. Read `unchecked`
|
|
71
|
-
and inspect an existing package's status: an immutable failed version is not
|
|
72
|
-
made runnable by validation. Submission rechecks current state; preflight is not
|
|
73
|
-
a reservation. Preserve the preview alongside the approved submission request.
|
|
74
|
-
|
|
75
|
-
## Structured request errors
|
|
76
|
-
|
|
77
|
-
Training Run `task`, `data`, `data.artifact`, `features.feature_set`, `splits`,
|
|
78
|
-
`temporal` and `trainer` are explicit objects in OpenAPI. Evaluation artifact,
|
|
79
|
-
config references, members and execution, plus ModelPackage requests, are also
|
|
80
|
-
structured. Unknown keys return 422 with `detail[].loc` identifying the field.
|
|
81
|
-
Keep algorithm-specific `trainer.parameters` and documented plugin configuration
|
|
82
|
-
maps extensible; validate them against the registered plugin schema. Do not treat
|
|
83
|
-
all remaining `additionalProperties` as a platform schema defect.
|
|
84
|
-
|
|
85
|
-
These HTTP checks preserve accepted values and do not rewrite historical stored
|
|
86
|
-
contracts or hashes. Legacy records remain readable. A previously ignored typo
|
|
87
|
-
is now rejected on a new submission; correct the input rather than removing
|
|
88
|
-
validation. Omit evaluation runtime identity for the server default; if execution
|
|
89
|
-
is supplied it must name `executor` explicitly.
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
# Evaluation Commands
|
|
2
|
-
|
|
3
|
-
## Request bodies and prerequisites
|
|
4
|
-
|
|
5
|
-
Evaluation reuses the model's original TrainingRun, replaces its artifact
|
|
6
|
-
reference and compares the complete evaluation DataSchema hash with the trained
|
|
7
|
-
Job's hash. Matching feature names is insufficient: added split/metadata columns
|
|
8
|
-
or changed roles/dtypes can fail. Settle the final schema before training and
|
|
9
|
-
validate compatibility before concluding that retraining is required.
|
|
10
|
-
|
|
11
|
-
Example `evaluation-config.json` (exploratory, not a release gate):
|
|
12
|
-
|
|
13
|
-
```json
|
|
14
|
-
{
|
|
15
|
-
"name": "pressure_metrics",
|
|
16
|
-
"version": "v1",
|
|
17
|
-
"task_type": "regression",
|
|
18
|
-
"mode": "exploratory",
|
|
19
|
-
"metrics": [{
|
|
20
|
-
"name": "regression.mae", "version": "v1",
|
|
21
|
-
"targets": ["future_pressure"], "calculation_space": "business"
|
|
22
|
-
}]
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Inspect `get-metric-definition regression.mae v1` before relying on this metric.
|
|
27
|
-
Release mode additionally requires at least one required validation rule with a
|
|
28
|
-
business-approved threshold; do not invent thresholds to obtain PASS.
|
|
29
|
-
|
|
30
|
-
Example `evaluation-request.json` shape; replace illustrative identities before
|
|
31
|
-
validation or submission:
|
|
32
|
-
|
|
33
|
-
```json
|
|
34
|
-
{
|
|
35
|
-
"model_artifact_id": "replace_model_artifact_id",
|
|
36
|
-
"dataset": {
|
|
37
|
-
"project": "default",
|
|
38
|
-
"dataset_id": "replace_dataset_id",
|
|
39
|
-
"manifest_hash": "replace_with_exact_artifact_manifest_hash"
|
|
40
|
-
},
|
|
41
|
-
"rowset": "test",
|
|
42
|
-
"targets": ["future_pressure"],
|
|
43
|
-
"config": {"name": "pressure_metrics", "version": "v1"},
|
|
44
|
-
"execution": {
|
|
45
|
-
"executor": "kubernetes",
|
|
46
|
-
"resources": {"cpu": "2", "memory": "3Gi"},
|
|
47
|
-
"deadline": "90min",
|
|
48
|
-
"retry_limit": 0
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
`config` is a name/version reference, not an inline policy. `targets` are
|
|
54
|
-
model-bound label column names. The HTTP validation and submission endpoints
|
|
55
|
-
fill omitted `runtime_identity` with the server's supported evaluation identity;
|
|
56
|
-
omit it rather than guessing. Explicit pinning requires that exact identity
|
|
57
|
-
(`sha256:` plus 64 hex digits), not an image digest or trainer hash. Inspect the
|
|
58
|
-
returned frozen Job's `policy.runtime_identity` and retain it as evidence.
|
|
59
|
-
Resources above illustrate shape, not Chronos-2 sizing guidance.
|
|
60
|
-
|
|
61
|
-
If `execution` is omitted entirely, these HTTP endpoints use the configured
|
|
62
|
-
server execution backend. If supplied, include `executor` explicitly: an empty
|
|
63
|
-
execution dictionary falls back to the domain's `local` default. Do not assume
|
|
64
|
-
the domain default is the deployed HTTP default. Kubernetes selection alone does
|
|
65
|
-
not prove Worker dependency availability. Validate before submitting and confirm
|
|
66
|
-
the approved Worker supports the model plugin. Successful training in another
|
|
67
|
-
image does not establish evaluation support.
|
|
68
|
-
|
|
69
|
-
## Diagnose before another build or training run
|
|
70
|
-
|
|
71
|
-
| Symptom | Actual check and next action |
|
|
72
|
-
| --- | --- |
|
|
73
|
-
| `requires a named split` | Inherited TrainingRun `data.splits` is not a dictionary and requested rowset is not `all`. Inspect the original training request, not only manifest/resolved/Parquet splits. This check has no horizon-zero branch. |
|
|
74
|
-
| `rowset is not declared` | Inspect `data.splits` role keys (`train`, `validation`, `test`), nonempty value arrays, assignment column and observed values. Manifest `training` can map to consumer role `train`. |
|
|
75
|
-
| DataSchema mismatch | Compare the full schema with the trained Job's hash, including split columns, roles and dtypes. Do not remove columns or falsify hashes to pass. |
|
|
76
|
-
| Label leakage | Materialize label columns separately from FeatureSet order; input selection alone cannot repair the contract. |
|
|
77
|
-
| Chronos-2 runtime unavailable | Record executor, error stage/Job, runtime identity and Worker image evidence. The prediction plugin cannot load a dependency; request runtime support from the platform owner. New dataset/model versions do not install dependencies. |
|
|
78
|
-
|
|
79
|
-
Do not change to `rowset=all` to bypass a requested holdout. Adding `data.splits`
|
|
80
|
-
to EvaluationRunRequest is unsupported and cannot repair an immutable original
|
|
81
|
-
TrainingRun. Explain the missing binding and validate a corrected training draft
|
|
82
|
-
before any authorized retraining.
|
|
83
|
-
|
|
84
|
-
`ExecutablePackage` is a custom metric Python wheel with verification and
|
|
85
|
-
publication lifecycle, not a model Serving container. Built-in metrics need no
|
|
86
|
-
user-created wheel. `ModelPackage` is a separate model image packaging object;
|
|
87
|
-
creating one does not configure evaluation Workers or automatically satisfy the
|
|
88
|
-
evaluation runtime identity. Empty package registration cannot repair a
|
|
89
|
-
Chronos-2 import failure.
|
|
90
|
-
|
|
91
|
-
## Discovery and evidence retention
|
|
92
|
-
|
|
93
|
-
Submission returns `run.run_id`, singular `job.job_id` / `job_status` for the
|
|
94
|
-
first member, and `jobs[].spec` / `jobs[].status` for all members. Track all
|
|
95
|
-
members when present. `get-evaluation-job` returns `spec`, `status`, `attempts`;
|
|
96
|
-
inspect `status.phase` and, on success, `status.result_id`. Top-level
|
|
97
|
-
`status=accepted` is not completion. Read `spec.policy.runtime_identity` for the
|
|
98
|
-
resolved runtime. There is no evaluation wait CLI; poll the get command with a
|
|
99
|
-
bounded interval/deadline and preserve the ID on timeout. Do not use dataset
|
|
100
|
-
`wait-job` for a training or evaluation Job.
|
|
101
|
-
|
|
102
|
-
Evaluation request reuse is normally deduplicated. `force_rerun=true` explicitly
|
|
103
|
-
requests another execution; do not set it to work around an unexplained timeout
|
|
104
|
-
or missing result. Retry keeps the immutable contract; corrections to inputs
|
|
105
|
-
require a corrected request, not a retry with hidden changed semantics.
|
|
106
|
-
|
|
107
|
-
Default coverage requires at least one row and both prediction and label
|
|
108
|
-
coverage of 1.0. Null labels and sequence context loss can prevent a gate pass
|
|
109
|
-
despite successful computation. Do not lower coverage to obtain PASS. If the
|
|
110
|
-
business policy intentionally permits incomplete coverage, declare the approved
|
|
111
|
-
values under `coverage.minimum_rows`, `minimum_prediction_coverage` and
|
|
112
|
-
`minimum_label_coverage`, and report the excluded population.
|
|
113
|
-
|
|
114
|
-
A release-rule shape is shown below; the threshold is illustrative and must be
|
|
115
|
-
replaced by a business-approved value. Merge under the policy and set
|
|
116
|
-
`mode=release`; `metric` and version must also appear in `metrics`.
|
|
117
|
-
|
|
118
|
-
```json
|
|
119
|
-
{
|
|
120
|
-
"validation": [{
|
|
121
|
-
"metric": "regression.mae", "version": "v1",
|
|
122
|
-
"target": "future_pressure", "operator": "<=", "threshold": 1.0,
|
|
123
|
-
"required": true, "level": "job", "source": "metric", "slice": "overall"
|
|
124
|
-
}]
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
`slices` names metadata/entity-key columns, not filter expressions or arbitrary
|
|
129
|
-
Feature columns. `SUCCEEDED` describes execution; `PASS`, `FAIL`, `INCONCLUSIVE`
|
|
130
|
-
describe decisions. Inspect required decisions and coverage before reporting
|
|
131
|
-
release readiness. A Result and a Summary are distinct evidence objects;
|
|
132
|
-
record the actual returned IDs rather than deriving one ID from another.
|
|
133
|
-
|
|
134
|
-
Use `list-evaluation-configs`, `list-evaluation-runs`, `list-evaluation-jobs`
|
|
135
|
-
and their get commands to locate prior evidence; see [discovery.md](discovery.md)
|
|
136
|
-
for paging and exact identity recovery. `list-evaluation-attempts JOB_ID` lists
|
|
137
|
-
attempt history, not all runs. Preserve request/config versions and returned
|
|
138
|
-
run/job/result/summary IDs; do not search metric names instead of provenance.
|
|
139
|
-
|
|
140
|
-
## Commands
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
ml-platform --profile server register-evaluation-config evaluation-config.json
|
|
144
|
-
ml-platform --profile server register-metric-definition metric-definition.json
|
|
145
|
-
ml-platform --profile server register-executable-package executable-package.json
|
|
146
|
-
ml-platform --profile server verify-executable-package <name> <version>
|
|
147
|
-
ml-platform --profile server publish-executable-package <name> <version>
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Custom metric packages must be deterministic, digest-bound, network-restricted, verified, and separately authorized for publication.
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
ml-platform --profile server validate-evaluation-run evaluation-request.json
|
|
154
|
-
ml-platform --profile server submit-evaluation evaluation-request.json
|
|
155
|
-
ml-platform --profile server get-evaluation-run <run-id>
|
|
156
|
-
ml-platform --profile server get-evaluation-job <job-id>
|
|
157
|
-
ml-platform --profile server list-evaluation-attempts <job-id>
|
|
158
|
-
ml-platform --profile server retry-evaluation-job <job-id>
|
|
159
|
-
ml-platform --profile server cancel-evaluation-job <job-id>
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
An EvaluationRunRequest binds ModelArtifact(s), a frozen DatasetArtifact rowset, targets, EvaluationConfig, runtime identity, and optional baseline. Retry/cancel require separate authorization.
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
ml-platform --profile server get-evaluation-result <result-id>
|
|
166
|
-
ml-platform --profile server get-evaluation-result-metrics <result-id>
|
|
167
|
-
ml-platform --profile server get-evaluation-result-artifacts <result-id>
|
|
168
|
-
ml-platform --profile server summarize-evaluation-run <run-id>
|
|
169
|
-
ml-platform --profile server get-evaluation-summary <summary-id>
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Report candidate, eligible, labeled and evaluable coverage; calculation space; slices; baseline identity; required decisions; runtime/package digests; and Result/Summary hashes. Exploratory or incomplete evidence is never a release gate pass.
|