@delta-infra/cli 1.1.1 → 1.1.2
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 +1 -1
- package/checksums.txt +5 -5
- package/package.json +1 -1
- package/scripts/install-wizard.js +701 -701
- package/scripts/install.js +442 -442
- package/scripts/run.js +65 -65
- package/skills/delta-sandbox/SKILL.md +383 -383
- package/skills/delta-sandbox/agents/openai.yaml +4 -4
- package/skills/delta-sandbox/references/commands.md +58 -58
- package/skills/delta-sandbox/references/lifecycle.md +100 -100
- package/skills/delta-sandbox/references/recipes.md +138 -138
- package/skills/delta-science/AGENTS.md +47 -47
- package/skills/delta-science/SKILL.md +174 -174
- package/skills/delta-science/agents/openai.yaml +4 -4
- package/skills/delta-science/references/antbo.md +100 -100
- package/skills/delta-science/references/delta-bo.md +89 -89
- package/skills/delta-science/references/gsasii.md +116 -116
- package/skills/delta-science/references/lammps.md +66 -66
- package/skills/delta-science/references/ldm-bo.md +129 -129
- package/skills/delta-science/references/materials-design.md +118 -118
- package/skills/delta-science/references/pubchem.md +126 -126
- package/skills/delta-science/references/pymatgen.md +68 -68
- package/skills/delta-science/references/qe.md +125 -125
- package/skills/delta-science/references/rdkit.md +138 -138
- package/skills/delta-science/references/strbo.md +87 -87
- package/skills/delta-science/references/synbo.md +198 -198
- package/skills/delta-science/scripts/catalog.py +92 -92
- package/skills/delta-science/scripts/generated_catalog.py +69 -69
- package/skills/delta-science/scripts/invoke.py +346 -346
- package/skills/delta-shared/SKILL.md +97 -97
- package/skills/delta-shared/agents/openai.yaml +4 -4
- package/skills/manifest.json +19 -19
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
# LDM-BO 详细规则
|
|
2
|
-
|
|
3
|
-
所有调用直接使用 `delta-cli science invoke`,不是本地 PDF2Dock runner。仅用于小分子 SMILES;
|
|
4
|
-
抗体、CDRH3 或 AntBO 场景必须使用 AntBO 能力边界。
|
|
5
|
-
provider、模型路径、Vina/ReaSyn/GPU/LLM 配置由服务端注入,不放入请求 JSON。
|
|
6
|
-
|
|
7
|
-
## Health
|
|
8
|
-
|
|
9
|
-
operation:`health`,无 body。
|
|
10
|
-
|
|
11
|
-
The response reports whether the adapter can see the mounted PDF2Dock
|
|
12
|
-
interpreter, `bo_api.py`, Vina binary, ReaSyn repo/interpreter/checkpoints, NN
|
|
13
|
-
model files, cache directory, GPU settings, and LLM configuration. Missing LLM
|
|
14
|
-
settings degrade health because LDM methods need them.
|
|
15
|
-
|
|
16
|
-
## One-Step Recommend
|
|
17
|
-
|
|
18
|
-
operation:`recommend`。
|
|
19
|
-
|
|
20
|
-
Wraps `bo_api.recommend_next_smiles`.
|
|
21
|
-
|
|
22
|
-
Typical payload:
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"method": "bo-tanimoto",
|
|
27
|
-
"pool": ["CCO", "CCN", "CCC"],
|
|
28
|
-
"history": [
|
|
29
|
-
{"smiles": "CCO", "scores": [-7.1]},
|
|
30
|
-
{"smiles": "CCN", "scores": [-6.8]}
|
|
31
|
-
],
|
|
32
|
-
"batch_size": 1
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Typical business response inside the documented gateway `data`:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"recommendations": ["CCC"],
|
|
41
|
-
"acquisition_values": [0.12],
|
|
42
|
-
"n_objectives": 1
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
LDM methods may include an `llm` diagnostics object.
|
|
47
|
-
|
|
48
|
-
`acquisition_values` 只能按业务响应原值报告。除非当前业务响应明确给出字段定义,否则
|
|
49
|
-
不得把它描述为预测 Vina、预测 objective、不确定性、置信度、expected improvement,
|
|
50
|
-
也不得自行判断“越大/越小越好”。服务未返回推荐理由时,明确写“服务未返回推荐
|
|
51
|
-
理由”,不得根据分子骨架、杂原子或模型机制补写解释。
|
|
52
|
-
|
|
53
|
-
## Full Trajectory
|
|
54
|
-
|
|
55
|
-
operation:`trajectory`。
|
|
56
|
-
|
|
57
|
-
Wraps `bo_api.run_search_trajectory`.
|
|
58
|
-
|
|
59
|
-
Small smoke payload:
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"method": "bo-tanimoto",
|
|
64
|
-
"seed": 42,
|
|
65
|
-
"seed-smiles": "CCO,CCN,CCC",
|
|
66
|
-
"num-evaluations": 4,
|
|
67
|
-
"batch-size": 1,
|
|
68
|
-
"objective": "vina+nn"
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Typical business response inside the documented gateway `data`:
|
|
73
|
-
|
|
74
|
-
```json
|
|
75
|
-
{
|
|
76
|
-
"config": {},
|
|
77
|
-
"history": [],
|
|
78
|
-
"summary": {}
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
LDM methods may include `llm_trajectory`.
|
|
83
|
-
|
|
84
|
-
## Error Handling
|
|
85
|
-
|
|
86
|
-
The service maps `bo_api` error JSON to an upstream failure. The gateway
|
|
87
|
-
returns a standard error envelope:
|
|
88
|
-
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"code": 1,
|
|
92
|
-
"message": "AutoDock Vina executable not found...",
|
|
93
|
-
"data": {
|
|
94
|
-
"endpoint": "/v1/trajectory",
|
|
95
|
-
"ldm_bo_response": {
|
|
96
|
-
"error": "...",
|
|
97
|
-
"error_type": "ValueError",
|
|
98
|
-
"traceback": "Traceback ..."
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Common causes are missing Vina, missing ReaSyn, wrong Python interpreter, CUDA
|
|
105
|
-
device mismatch, missing LLM credentials for LDM methods, or an unwritable Vina
|
|
106
|
-
cache directory.
|
|
107
|
-
|
|
108
|
-
## Provider Settings
|
|
109
|
-
|
|
110
|
-
Do not send provider settings in request JSON. The adapter reads these from
|
|
111
|
-
deployment config and passes them as Python kwargs to `bo_api`:
|
|
112
|
-
|
|
113
|
-
```text
|
|
114
|
-
vina_bin
|
|
115
|
-
vina_cache_dir
|
|
116
|
-
vina_max_workers
|
|
117
|
-
gp_device
|
|
118
|
-
reasyn_repo
|
|
119
|
-
reasyn_python_bin
|
|
120
|
-
reasyn_model_path
|
|
121
|
-
reasyn_devices
|
|
122
|
-
nn_model_path
|
|
123
|
-
nn_metadata_path
|
|
124
|
-
llm_model
|
|
125
|
-
llm_base_url
|
|
126
|
-
llm_api_key
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
The CLI forwards the user payload; `bo_api` owns business defaults and schema behavior.
|
|
1
|
+
# LDM-BO 详细规则
|
|
2
|
+
|
|
3
|
+
所有调用直接使用 `delta-cli science invoke`,不是本地 PDF2Dock runner。仅用于小分子 SMILES;
|
|
4
|
+
抗体、CDRH3 或 AntBO 场景必须使用 AntBO 能力边界。
|
|
5
|
+
provider、模型路径、Vina/ReaSyn/GPU/LLM 配置由服务端注入,不放入请求 JSON。
|
|
6
|
+
|
|
7
|
+
## Health
|
|
8
|
+
|
|
9
|
+
operation:`health`,无 body。
|
|
10
|
+
|
|
11
|
+
The response reports whether the adapter can see the mounted PDF2Dock
|
|
12
|
+
interpreter, `bo_api.py`, Vina binary, ReaSyn repo/interpreter/checkpoints, NN
|
|
13
|
+
model files, cache directory, GPU settings, and LLM configuration. Missing LLM
|
|
14
|
+
settings degrade health because LDM methods need them.
|
|
15
|
+
|
|
16
|
+
## One-Step Recommend
|
|
17
|
+
|
|
18
|
+
operation:`recommend`。
|
|
19
|
+
|
|
20
|
+
Wraps `bo_api.recommend_next_smiles`.
|
|
21
|
+
|
|
22
|
+
Typical payload:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"method": "bo-tanimoto",
|
|
27
|
+
"pool": ["CCO", "CCN", "CCC"],
|
|
28
|
+
"history": [
|
|
29
|
+
{"smiles": "CCO", "scores": [-7.1]},
|
|
30
|
+
{"smiles": "CCN", "scores": [-6.8]}
|
|
31
|
+
],
|
|
32
|
+
"batch_size": 1
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Typical business response inside the documented gateway `data`:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"recommendations": ["CCC"],
|
|
41
|
+
"acquisition_values": [0.12],
|
|
42
|
+
"n_objectives": 1
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
LDM methods may include an `llm` diagnostics object.
|
|
47
|
+
|
|
48
|
+
`acquisition_values` 只能按业务响应原值报告。除非当前业务响应明确给出字段定义,否则
|
|
49
|
+
不得把它描述为预测 Vina、预测 objective、不确定性、置信度、expected improvement,
|
|
50
|
+
也不得自行判断“越大/越小越好”。服务未返回推荐理由时,明确写“服务未返回推荐
|
|
51
|
+
理由”,不得根据分子骨架、杂原子或模型机制补写解释。
|
|
52
|
+
|
|
53
|
+
## Full Trajectory
|
|
54
|
+
|
|
55
|
+
operation:`trajectory`。
|
|
56
|
+
|
|
57
|
+
Wraps `bo_api.run_search_trajectory`.
|
|
58
|
+
|
|
59
|
+
Small smoke payload:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"method": "bo-tanimoto",
|
|
64
|
+
"seed": 42,
|
|
65
|
+
"seed-smiles": "CCO,CCN,CCC",
|
|
66
|
+
"num-evaluations": 4,
|
|
67
|
+
"batch-size": 1,
|
|
68
|
+
"objective": "vina+nn"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Typical business response inside the documented gateway `data`:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"config": {},
|
|
77
|
+
"history": [],
|
|
78
|
+
"summary": {}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
LDM methods may include `llm_trajectory`.
|
|
83
|
+
|
|
84
|
+
## Error Handling
|
|
85
|
+
|
|
86
|
+
The service maps `bo_api` error JSON to an upstream failure. The gateway
|
|
87
|
+
returns a standard error envelope:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"code": 1,
|
|
92
|
+
"message": "AutoDock Vina executable not found...",
|
|
93
|
+
"data": {
|
|
94
|
+
"endpoint": "/v1/trajectory",
|
|
95
|
+
"ldm_bo_response": {
|
|
96
|
+
"error": "...",
|
|
97
|
+
"error_type": "ValueError",
|
|
98
|
+
"traceback": "Traceback ..."
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Common causes are missing Vina, missing ReaSyn, wrong Python interpreter, CUDA
|
|
105
|
+
device mismatch, missing LLM credentials for LDM methods, or an unwritable Vina
|
|
106
|
+
cache directory.
|
|
107
|
+
|
|
108
|
+
## Provider Settings
|
|
109
|
+
|
|
110
|
+
Do not send provider settings in request JSON. The adapter reads these from
|
|
111
|
+
deployment config and passes them as Python kwargs to `bo_api`:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
vina_bin
|
|
115
|
+
vina_cache_dir
|
|
116
|
+
vina_max_workers
|
|
117
|
+
gp_device
|
|
118
|
+
reasyn_repo
|
|
119
|
+
reasyn_python_bin
|
|
120
|
+
reasyn_model_path
|
|
121
|
+
reasyn_devices
|
|
122
|
+
nn_model_path
|
|
123
|
+
nn_metadata_path
|
|
124
|
+
llm_model
|
|
125
|
+
llm_base_url
|
|
126
|
+
llm_api_key
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The CLI forwards the user payload; `bo_api` owns business defaults and schema behavior.
|
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
# Materials Design 详细规则
|
|
2
|
-
|
|
3
|
-
Materials Design 用于从实验或计算材料表格中建立 surrogate、验证模型、定义可行候选空间,
|
|
4
|
-
并生成带不确定性的候选排序。推荐是待验证假设,不是已确认材料、合成方案或实验结果。
|
|
5
|
-
|
|
6
|
-
本 reference 的路由标签是 `materials-design`。`tools.name` 和
|
|
7
|
-
`tool_endpoints.name` 仍以当前 `delta-cli science list` 和
|
|
8
|
-
`delta-cli science endpoints list <tool>` 的返回为准;下列 Gateway 路径只是服务契约,
|
|
9
|
-
不是可以直接拼接或访问的 URL。
|
|
10
|
-
|
|
11
|
-
## 服务边界
|
|
12
|
-
|
|
13
|
-
服务提供以下能力:
|
|
14
|
-
|
|
15
|
-
| 服务路径 | 作用 | 结果边界 |
|
|
16
|
-
| --- | --- | --- |
|
|
17
|
-
| `/chem/materials-design/health` | Gateway 到服务的就绪检查 | `status`、依赖可用性、limits |
|
|
18
|
-
| `/chem/materials-design/v1/capabilities` | 输入格式、模型、验证模式和限制 | 能力目录 |
|
|
19
|
-
| `/chem/materials-design/v1/jobs` | 上传训练/候选表并创建异步作业 | `202`、`job_id`、状态和 links |
|
|
20
|
-
| `/chem/materials-design/v1/jobs/{job_id}` | 查询作业 | `status`、`result_status`、result、warnings |
|
|
21
|
-
| `/chem/materials-design/v1/jobs/{job_id}/cancel` | 请求取消 | 取消请求/终态 |
|
|
22
|
-
| `/chem/materials-design/v1/jobs/{job_id}/artifacts` | 列出产物 | name、size、media_type、SHA-256 |
|
|
23
|
-
| `/chem/materials-design/v1/jobs/{job_id}/artifacts/{path}` | 下载单个产物 | 原始 report/JSON/CSV/figure bytes |
|
|
24
|
-
|
|
25
|
-
所有 JSON/query 调用都必须走:
|
|
26
|
-
|
|
27
|
-
```text
|
|
28
|
-
delta-cli science invoke --tool TOOL --endpoint ENDPOINT --data JSON
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
训练表提交使用受控文件 adapter:
|
|
32
|
-
|
|
33
|
-
```text
|
|
34
|
-
delta-cli science file invoke --tool materials-design --endpoint job-submit \
|
|
35
|
-
--file train.xlsx --candidate-file candidates.xlsx --data CONFIG_JSON
|
|
36
|
-
delta-cli science task submit --tool materials-design --operation job-status \
|
|
37
|
-
--input '{"job_id":"mdjob_..."}' --wait
|
|
38
|
-
delta-cli science file download --tool materials-design --endpoint artifact-download \
|
|
39
|
-
--params '{"job_id":"mdjob_...","artifact_path":"report.html"}' --output report.html
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
只读 query operation 才使用 `--params JSON`。如果新工具尚未出现在目录中,或目录没有
|
|
43
|
-
返回足够的请求 schema,停止并报告未暴露;不要猜测 endpoint 名、body 或兼容别名。
|
|
44
|
-
|
|
45
|
-
## CLI 能力边界
|
|
46
|
-
|
|
47
|
-
`POST /v1/jobs` 的原始服务请求是 `multipart/form-data`,至少包含:
|
|
48
|
-
|
|
49
|
-
```text
|
|
50
|
-
file=<training table>
|
|
51
|
-
candidate_file=<optional candidate table>
|
|
52
|
-
config=<serialized JSON object>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
`science invoke` 只接受 JSON object body 和 JSON query 参数,不能表达 multipart;因此不能
|
|
56
|
-
把本地路径或 base64 伪装成文件字段。artifact 下载同样是原始 bytes,必须通过
|
|
57
|
-
`science file download` 保存并校验,不能当作普通 JSON 结果。不得调用
|
|
58
|
-
`materials-design-service:8900` 或直连 preflight Gateway。
|
|
59
|
-
|
|
60
|
-
## 输入与配置
|
|
61
|
-
|
|
62
|
-
开始建模前必须确认:
|
|
63
|
-
|
|
64
|
-
- `feature_columns`、`controllable_columns`、`target_column` 或 `objectives`;
|
|
65
|
-
- identifier、metadata、leakage、post-measurement、group/time 列及单位;
|
|
66
|
-
- 目标方向、可行性约束、候选表或候选生成规则;
|
|
67
|
-
- 缺失值、重复样本、测量条件、数据来源和验证切分策略。
|
|
68
|
-
|
|
69
|
-
单目标配置的核心字段:
|
|
70
|
-
|
|
71
|
-
```json
|
|
72
|
-
{
|
|
73
|
-
"feature_columns": ["Bi", "In", "Ti"],
|
|
74
|
-
"controllable_columns": ["Bi", "In", "Ti"],
|
|
75
|
-
"identifier_columns": ["sample_id"],
|
|
76
|
-
"target_column": "T",
|
|
77
|
-
"target_direction": "maximize",
|
|
78
|
-
"validation": {"strategy": "kfold", "n_splits": 5},
|
|
79
|
-
"model_names": ["ExtraTrees", "GPR", "Ridge"],
|
|
80
|
-
"random_state": 42,
|
|
81
|
-
"recommendation_count": 10
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
多目标使用 `objectives: [{"target_column": "...", "direction": "maximize|minimize"}]`
|
|
86
|
-
和显式的 Pareto/EHVI 配置。优先传入用户的 `candidate_file`;若服务按观测范围生成
|
|
87
|
-
候选,必须显式保留 steps、hard constraints、composition closure、`max_candidates` 和
|
|
88
|
-
`allow_extrapolation`。禁止优化 identifier、测量后变量、泄漏列或未获授权的域外点,禁止
|
|
89
|
-
为填充候选数而任意外推。
|
|
90
|
-
|
|
91
|
-
## 结果处理
|
|
92
|
-
|
|
93
|
-
作业 `status` 与 `result_status` 必须分开判断:
|
|
94
|
-
|
|
95
|
-
- `status`:`pending`、`running`、`completed`、`failed`、`cancelled`;
|
|
96
|
-
- `result_status`:`complete`、`exploratory`、`readiness_only` 或 `failed`。
|
|
97
|
-
|
|
98
|
-
`202` 只表示服务已接收/排队,不表示模型训练完成;`completed` 也不表示排序可靠。
|
|
99
|
-
只有在 `result_status` 为 `complete` 时才能说数据和验证支持候选排序;`exploratory` 只能
|
|
100
|
-
作为学习假设;`readiness_only` 要读取 readiness 信息并请求缺失输入;`failed` 原样报告。
|
|
101
|
-
始终保留服务返回的 validation、ranking、warnings 和 error。
|
|
102
|
-
|
|
103
|
-
预测结果必须和观测值、交叉验证预测区分。报告至少说明数据覆盖、切分、模型比较、
|
|
104
|
-
不确定性校准、候选可行性、域内/域外状态、EI/PI/UCB 或 Pareto 设置,以及后续实验验证
|
|
105
|
-
计划;不要用模型方差冒充实验误差或把候选预测写成实测值。
|
|
106
|
-
|
|
107
|
-
## Artifact 与错误
|
|
108
|
-
|
|
109
|
-
只有用户要求或工作流需要时才读取 artifacts。按 listing 返回的 `size`、`media_type` 和
|
|
110
|
-
SHA-256 校验下载内容;不能凭文件名猜格式。服务可能产生 `report.html`、`result.json`、
|
|
111
|
-
`data_dictionary.json`、`model_comparison.csv`、OOF/残差/校准文件、`search_space.json`、
|
|
112
|
-
`candidate_predictions.csv`、`shortlist.csv`、`recommendation_views.csv`、
|
|
113
|
-
`pareto_front.csv` 和 `figures/*`。
|
|
114
|
-
|
|
115
|
-
常见终止条件包括配置/文件格式错误、缺目标或候选空间、超出上传/行数/候选数限制、
|
|
116
|
-
后端未就绪、作业不存在和 artifact 不存在。提交超时或连接中断时不要盲目重试:multipart
|
|
117
|
-
上传可能已经创建作业,先检查是否已经得到 `job_id`。失败或空推荐不得用本地回归、GP、
|
|
118
|
-
随机数或人工排序替代。
|
|
1
|
+
# Materials Design 详细规则
|
|
2
|
+
|
|
3
|
+
Materials Design 用于从实验或计算材料表格中建立 surrogate、验证模型、定义可行候选空间,
|
|
4
|
+
并生成带不确定性的候选排序。推荐是待验证假设,不是已确认材料、合成方案或实验结果。
|
|
5
|
+
|
|
6
|
+
本 reference 的路由标签是 `materials-design`。`tools.name` 和
|
|
7
|
+
`tool_endpoints.name` 仍以当前 `delta-cli science list` 和
|
|
8
|
+
`delta-cli science endpoints list <tool>` 的返回为准;下列 Gateway 路径只是服务契约,
|
|
9
|
+
不是可以直接拼接或访问的 URL。
|
|
10
|
+
|
|
11
|
+
## 服务边界
|
|
12
|
+
|
|
13
|
+
服务提供以下能力:
|
|
14
|
+
|
|
15
|
+
| 服务路径 | 作用 | 结果边界 |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `/chem/materials-design/health` | Gateway 到服务的就绪检查 | `status`、依赖可用性、limits |
|
|
18
|
+
| `/chem/materials-design/v1/capabilities` | 输入格式、模型、验证模式和限制 | 能力目录 |
|
|
19
|
+
| `/chem/materials-design/v1/jobs` | 上传训练/候选表并创建异步作业 | `202`、`job_id`、状态和 links |
|
|
20
|
+
| `/chem/materials-design/v1/jobs/{job_id}` | 查询作业 | `status`、`result_status`、result、warnings |
|
|
21
|
+
| `/chem/materials-design/v1/jobs/{job_id}/cancel` | 请求取消 | 取消请求/终态 |
|
|
22
|
+
| `/chem/materials-design/v1/jobs/{job_id}/artifacts` | 列出产物 | name、size、media_type、SHA-256 |
|
|
23
|
+
| `/chem/materials-design/v1/jobs/{job_id}/artifacts/{path}` | 下载单个产物 | 原始 report/JSON/CSV/figure bytes |
|
|
24
|
+
|
|
25
|
+
所有 JSON/query 调用都必须走:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
delta-cli science invoke --tool TOOL --endpoint ENDPOINT --data JSON
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
训练表提交使用受控文件 adapter:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
delta-cli science file invoke --tool materials-design --endpoint job-submit \
|
|
35
|
+
--file train.xlsx --candidate-file candidates.xlsx --data CONFIG_JSON
|
|
36
|
+
delta-cli science task submit --tool materials-design --operation job-status \
|
|
37
|
+
--input '{"job_id":"mdjob_..."}' --wait
|
|
38
|
+
delta-cli science file download --tool materials-design --endpoint artifact-download \
|
|
39
|
+
--params '{"job_id":"mdjob_...","artifact_path":"report.html"}' --output report.html
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
只读 query operation 才使用 `--params JSON`。如果新工具尚未出现在目录中,或目录没有
|
|
43
|
+
返回足够的请求 schema,停止并报告未暴露;不要猜测 endpoint 名、body 或兼容别名。
|
|
44
|
+
|
|
45
|
+
## CLI 能力边界
|
|
46
|
+
|
|
47
|
+
`POST /v1/jobs` 的原始服务请求是 `multipart/form-data`,至少包含:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
file=<training table>
|
|
51
|
+
candidate_file=<optional candidate table>
|
|
52
|
+
config=<serialized JSON object>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`science invoke` 只接受 JSON object body 和 JSON query 参数,不能表达 multipart;因此不能
|
|
56
|
+
把本地路径或 base64 伪装成文件字段。artifact 下载同样是原始 bytes,必须通过
|
|
57
|
+
`science file download` 保存并校验,不能当作普通 JSON 结果。不得调用
|
|
58
|
+
`materials-design-service:8900` 或直连 preflight Gateway。
|
|
59
|
+
|
|
60
|
+
## 输入与配置
|
|
61
|
+
|
|
62
|
+
开始建模前必须确认:
|
|
63
|
+
|
|
64
|
+
- `feature_columns`、`controllable_columns`、`target_column` 或 `objectives`;
|
|
65
|
+
- identifier、metadata、leakage、post-measurement、group/time 列及单位;
|
|
66
|
+
- 目标方向、可行性约束、候选表或候选生成规则;
|
|
67
|
+
- 缺失值、重复样本、测量条件、数据来源和验证切分策略。
|
|
68
|
+
|
|
69
|
+
单目标配置的核心字段:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"feature_columns": ["Bi", "In", "Ti"],
|
|
74
|
+
"controllable_columns": ["Bi", "In", "Ti"],
|
|
75
|
+
"identifier_columns": ["sample_id"],
|
|
76
|
+
"target_column": "T",
|
|
77
|
+
"target_direction": "maximize",
|
|
78
|
+
"validation": {"strategy": "kfold", "n_splits": 5},
|
|
79
|
+
"model_names": ["ExtraTrees", "GPR", "Ridge"],
|
|
80
|
+
"random_state": 42,
|
|
81
|
+
"recommendation_count": 10
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
多目标使用 `objectives: [{"target_column": "...", "direction": "maximize|minimize"}]`
|
|
86
|
+
和显式的 Pareto/EHVI 配置。优先传入用户的 `candidate_file`;若服务按观测范围生成
|
|
87
|
+
候选,必须显式保留 steps、hard constraints、composition closure、`max_candidates` 和
|
|
88
|
+
`allow_extrapolation`。禁止优化 identifier、测量后变量、泄漏列或未获授权的域外点,禁止
|
|
89
|
+
为填充候选数而任意外推。
|
|
90
|
+
|
|
91
|
+
## 结果处理
|
|
92
|
+
|
|
93
|
+
作业 `status` 与 `result_status` 必须分开判断:
|
|
94
|
+
|
|
95
|
+
- `status`:`pending`、`running`、`completed`、`failed`、`cancelled`;
|
|
96
|
+
- `result_status`:`complete`、`exploratory`、`readiness_only` 或 `failed`。
|
|
97
|
+
|
|
98
|
+
`202` 只表示服务已接收/排队,不表示模型训练完成;`completed` 也不表示排序可靠。
|
|
99
|
+
只有在 `result_status` 为 `complete` 时才能说数据和验证支持候选排序;`exploratory` 只能
|
|
100
|
+
作为学习假设;`readiness_only` 要读取 readiness 信息并请求缺失输入;`failed` 原样报告。
|
|
101
|
+
始终保留服务返回的 validation、ranking、warnings 和 error。
|
|
102
|
+
|
|
103
|
+
预测结果必须和观测值、交叉验证预测区分。报告至少说明数据覆盖、切分、模型比较、
|
|
104
|
+
不确定性校准、候选可行性、域内/域外状态、EI/PI/UCB 或 Pareto 设置,以及后续实验验证
|
|
105
|
+
计划;不要用模型方差冒充实验误差或把候选预测写成实测值。
|
|
106
|
+
|
|
107
|
+
## Artifact 与错误
|
|
108
|
+
|
|
109
|
+
只有用户要求或工作流需要时才读取 artifacts。按 listing 返回的 `size`、`media_type` 和
|
|
110
|
+
SHA-256 校验下载内容;不能凭文件名猜格式。服务可能产生 `report.html`、`result.json`、
|
|
111
|
+
`data_dictionary.json`、`model_comparison.csv`、OOF/残差/校准文件、`search_space.json`、
|
|
112
|
+
`candidate_predictions.csv`、`shortlist.csv`、`recommendation_views.csv`、
|
|
113
|
+
`pareto_front.csv` 和 `figures/*`。
|
|
114
|
+
|
|
115
|
+
常见终止条件包括配置/文件格式错误、缺目标或候选空间、超出上传/行数/候选数限制、
|
|
116
|
+
后端未就绪、作业不存在和 artifact 不存在。提交超时或连接中断时不要盲目重试:multipart
|
|
117
|
+
上传可能已经创建作业,先检查是否已经得到 `job_id`。失败或空推荐不得用本地回归、GP、
|
|
118
|
+
随机数或人工排序替代。
|