@delta-infra/cli 1.0.80 → 1.0.81

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.
@@ -1,116 +1,116 @@
1
- # GSAS-II 详细规则
2
-
3
- 所有调用只走统一 wrapper。模拟必须使用真实 CIF;精修必须使用真实 powder data、
4
- instrument parameters 和 phase CIF,任何失败不得用合成数据补齐。输入不是 CIF 时,
5
- 先使用当前任务中成功的 pymatgen `structure-convert` 结果。
6
-
7
- ## Health
8
-
9
- operation:`health`,无 body。
10
-
11
- Key response fields in `data`: `status`, `service`, `gsasii_available`,
12
- `metadata`, and `limits`.
13
-
14
- 只有用户明确要求健康检查时才调用;不要在模拟或精修前自动增加 health。
15
-
16
- ## Powder Simulation
17
-
18
- operation:`powder-simulate`。
19
-
20
- ```json
21
- {
22
- "cif": "<CIF text>",
23
- "phase_name": "phase",
24
- "instrument_parameters": "<GSAS-II instrument parameter text>",
25
- "histogram_name": "simulation",
26
- "t_min": 10.0,
27
- "t_max": 80.0,
28
- "t_step": 0.02,
29
- "include_profile": true,
30
- "max_profile_points": 1000,
31
- "include_reflections": true,
32
- "max_reflections": 1000,
33
- "return_refined_cif": false,
34
- "return_project": false
35
- }
36
- ```
37
-
38
- Use either `t_step` or `n_points`, not both. Optional fields include
39
- `wavelength`, `radiation`, `scale`, `include_profile`, `max_profile_points`,
40
- `include_reflections`, `max_reflections`, `return_refined_cif`, and
41
- `return_project`.
42
-
43
- The response includes `profile` points with `x`, `y_calc`, optional background,
44
- bounded `reflections` with hkl/d-spacing/2theta where available, and metadata.
45
- If `return_project` is true, `project_base64` contains the GSAS-II `.gpx`
46
- project. If `return_refined_cif` is true, `refined_cif` contains exported CIF
47
- text for pymatgen handoff when GSAS-II supports export for the phase.
48
-
49
- Notes:
50
-
51
- - `cif` should be valid CIF text. If the input is POSCAR/JSON/CSSR/XSF, use
52
- pymatgen `structure-convert` first with `output_format: "cif"`.
53
- - `instrument_parameters` should be GSAS-II instrument parameter text such as
54
- `INST_XRY.PRM` when instrument-specific simulation is needed.
55
- - For quick simulation only, `instrument_parameters` may be omitted. The service
56
- then generates a simple CW X-ray instrument model from `wavelength` or
57
- `radiation` (`CuKa` by default; also supports aliases such as `MoKa`, `CoKa`,
58
- `CrKa`, and explicit numeric wavelength).
59
- - Refinement still requires real `instrument_parameters`.
60
- - `max_profile_points` controls response sampling. Use small values for smoke
61
- tests and larger values for profile comparison.
62
- - Older deployed gateway images may require `max_profile_points >= 10`.
63
-
64
- ## Powder Refinement
65
-
66
- operation:`powder-refine`。
67
-
68
- ```json
69
- {
70
- "powder_data": "<two-column or three-column powder data text>",
71
- "powder_format": "xy",
72
- "instrument_parameters": "<GSAS-II instrument parameter text>",
73
- "phases": [
74
- {"name": "phase", "cif": "<CIF text>"}
75
- ],
76
- "refinement_mode": "rietveld",
77
- "refinement_steps": [],
78
- "max_cycles": 3,
79
- "histogram_name": "powder",
80
- "include_profile": true,
81
- "max_profile_points": 1000,
82
- "include_reflections": true,
83
- "max_reflections": 1000,
84
- "return_refined_cif": false,
85
- "return_project": false
86
- }
87
- ```
88
-
89
- Supported `powder_format` values: `xy`, `xye`, `fxye`, `gsas`, and `csv`.
90
-
91
- `refinement_mode: "rietveld"` is currently implemented. `pawley` and `lebail`
92
- return a clear not-implemented response until the service wires the
93
- mode-specific GSAS-II setup.
94
-
95
- The response includes fit `residuals` when available, phase summaries, sampled
96
- profile points, bounded `reflections`, warnings, optional `refined_cif`, and
97
- the optional `.gpx` project.
98
-
99
- Notes:
100
-
101
- - Use `xy` for simple whitespace-delimited `x y` rows, `xye` for `x y esd`,
102
- `csv` for numeric comma-separated rows, or `gsas`/`fxye` for GSAS-like powder
103
- formats.
104
- - `max_cycles: 0` is useful for project-construction smoke tests. Increase it
105
- only when the powder data, phase model, instrument file, and refinement steps
106
- are realistic.
107
- - `refinement_steps` is passed to `G2Project.do_refinements`. Keep recipes
108
- incremental and inspect `warnings`, `residuals`, and `lst` output.
109
- - Refinement may return `valid: false` with partial phase/profile information
110
- if GSAS-II constructed the project but a refinement step failed.
111
-
112
- ## 跨工具交接
113
-
114
- 结构转换、衍射模拟和精修必须在本 Skill 内通过 wrapper 逐步完成:
115
- `pymatgen structure-convert -> gsasii powder-simulate/powder-refine`。下游只使用上一步
116
- 成功 native 中的结构文本或 profile;不得执行本地脚本或直连服务。
1
+ # GSAS-II 详细规则
2
+
3
+ 所有调用只走统一 wrapper。模拟必须使用真实 CIF;精修必须使用真实 powder data、
4
+ instrument parameters 和 phase CIF,任何失败不得用合成数据补齐。输入不是 CIF 时,
5
+ 先使用当前任务中成功的 pymatgen `structure-convert` 结果。
6
+
7
+ ## Health
8
+
9
+ operation:`health`,无 body。
10
+
11
+ Key response fields in `data`: `status`, `service`, `gsasii_available`,
12
+ `metadata`, and `limits`.
13
+
14
+ 只有用户明确要求健康检查时才调用;不要在模拟或精修前自动增加 health。
15
+
16
+ ## Powder Simulation
17
+
18
+ operation:`powder-simulate`。
19
+
20
+ ```json
21
+ {
22
+ "cif": "<CIF text>",
23
+ "phase_name": "phase",
24
+ "instrument_parameters": "<GSAS-II instrument parameter text>",
25
+ "histogram_name": "simulation",
26
+ "t_min": 10.0,
27
+ "t_max": 80.0,
28
+ "t_step": 0.02,
29
+ "include_profile": true,
30
+ "max_profile_points": 1000,
31
+ "include_reflections": true,
32
+ "max_reflections": 1000,
33
+ "return_refined_cif": false,
34
+ "return_project": false
35
+ }
36
+ ```
37
+
38
+ Use either `t_step` or `n_points`, not both. Optional fields include
39
+ `wavelength`, `radiation`, `scale`, `include_profile`, `max_profile_points`,
40
+ `include_reflections`, `max_reflections`, `return_refined_cif`, and
41
+ `return_project`.
42
+
43
+ The response includes `profile` points with `x`, `y_calc`, optional background,
44
+ bounded `reflections` with hkl/d-spacing/2theta where available, and metadata.
45
+ If `return_project` is true, `project_base64` contains the GSAS-II `.gpx`
46
+ project. If `return_refined_cif` is true, `refined_cif` contains exported CIF
47
+ text for pymatgen handoff when GSAS-II supports export for the phase.
48
+
49
+ Notes:
50
+
51
+ - `cif` should be valid CIF text. If the input is POSCAR/JSON/CSSR/XSF, use
52
+ pymatgen `structure-convert` first with `output_format: "cif"`.
53
+ - `instrument_parameters` should be GSAS-II instrument parameter text such as
54
+ `INST_XRY.PRM` when instrument-specific simulation is needed.
55
+ - For quick simulation only, `instrument_parameters` may be omitted. The service
56
+ then generates a simple CW X-ray instrument model from `wavelength` or
57
+ `radiation` (`CuKa` by default; also supports aliases such as `MoKa`, `CoKa`,
58
+ `CrKa`, and explicit numeric wavelength).
59
+ - Refinement still requires real `instrument_parameters`.
60
+ - `max_profile_points` controls response sampling. Use small values for smoke
61
+ tests and larger values for profile comparison.
62
+ - Older deployed gateway images may require `max_profile_points >= 10`.
63
+
64
+ ## Powder Refinement
65
+
66
+ operation:`powder-refine`。
67
+
68
+ ```json
69
+ {
70
+ "powder_data": "<two-column or three-column powder data text>",
71
+ "powder_format": "xy",
72
+ "instrument_parameters": "<GSAS-II instrument parameter text>",
73
+ "phases": [
74
+ {"name": "phase", "cif": "<CIF text>"}
75
+ ],
76
+ "refinement_mode": "rietveld",
77
+ "refinement_steps": [],
78
+ "max_cycles": 3,
79
+ "histogram_name": "powder",
80
+ "include_profile": true,
81
+ "max_profile_points": 1000,
82
+ "include_reflections": true,
83
+ "max_reflections": 1000,
84
+ "return_refined_cif": false,
85
+ "return_project": false
86
+ }
87
+ ```
88
+
89
+ Supported `powder_format` values: `xy`, `xye`, `fxye`, `gsas`, and `csv`.
90
+
91
+ `refinement_mode: "rietveld"` is currently implemented. `pawley` and `lebail`
92
+ return a clear not-implemented response until the service wires the
93
+ mode-specific GSAS-II setup.
94
+
95
+ The response includes fit `residuals` when available, phase summaries, sampled
96
+ profile points, bounded `reflections`, warnings, optional `refined_cif`, and
97
+ the optional `.gpx` project.
98
+
99
+ Notes:
100
+
101
+ - Use `xy` for simple whitespace-delimited `x y` rows, `xye` for `x y esd`,
102
+ `csv` for numeric comma-separated rows, or `gsas`/`fxye` for GSAS-like powder
103
+ formats.
104
+ - `max_cycles: 0` is useful for project-construction smoke tests. Increase it
105
+ only when the powder data, phase model, instrument file, and refinement steps
106
+ are realistic.
107
+ - `refinement_steps` is passed to `G2Project.do_refinements`. Keep recipes
108
+ incremental and inspect `warnings`, `residuals`, and `lst` output.
109
+ - Refinement may return `valid: false` with partial phase/profile information
110
+ if GSAS-II constructed the project but a refinement step failed.
111
+
112
+ ## 跨工具交接
113
+
114
+ 结构转换、衍射模拟和精修必须在本 Skill 内通过 wrapper 逐步完成:
115
+ `pymatgen structure-convert -> gsasii powder-simulate/powder-refine`。下游只使用上一步
116
+ 成功 native 中的结构文本或 profile;不得执行本地脚本或直连服务。
@@ -1,66 +1,66 @@
1
- # LAMMPS 详细规则
2
-
3
- 所有调用只走统一 wrapper。LAMMPS 不从化学式、CIF 或 POSCAR 自动推断 data、原子
4
- 类型、势函数与边界条件。成功执行不表示物理收敛或生产可用。
5
-
6
- ## Health
7
-
8
- operation:`health`,无 body。
9
-
10
- Key response fields in `data`: `status`, `service`, `lammps_available`,
11
- `metadata`, and `limits`.
12
-
13
- 只有用户明确要求健康检查时才调用;不要在模拟前自动增加 health。
14
-
15
- ## Built-In Lennard-Jones Example
16
-
17
- operation:`lj-melt-example`。
18
-
19
- Returns a complete `request` payload for the `run` operation, plus workflow notes
20
- showing where pymatgen and GSAS-II fit around LAMMPS.
21
-
22
- ## Run
23
-
24
- operation:`run`。
25
-
26
- ```json
27
- {
28
- "input_script": "<LAMMPS input script>",
29
- "files": [
30
- {"path": "system.data", "content": "<LAMMPS data file text>", "encoding": "text"}
31
- ],
32
- "timeout_seconds": 30,
33
- "max_thermo_rows": 1000,
34
- "log_tail_lines": 200,
35
- "output_files": ["dump.lammpstrj", "final.data"],
36
- "include_log": true,
37
- "include_stdout": false,
38
- "include_stderr": false
39
- }
40
- ```
41
-
42
- `files` are written into a fresh job working directory before LAMMPS starts.
43
- `encoding` can be `text` or `base64`.
44
-
45
- The response includes parsed thermo rows, the final thermo row, atom count when
46
- detectable, log tail, warnings, and requested output files. Text output files
47
- return `content`; binary output files return `content_base64`.
48
-
49
- Notes:
50
-
51
- - Use relative file paths only.
52
- - The service rejects unsafe commands such as `shell`, `python`, `plugin`, and
53
- `jump` by default.
54
- - `include <relative-file>` is allowed when the included file is supplied in
55
- `files`; absolute paths, parent-directory traversal, URLs, and `jump` loops
56
- are rejected.
57
- - Dump/data products are returned as raw requested output files, not structured
58
- parsed atom-frame objects.
59
- - The gateway is synchronous; keep interactive runs short.
60
- - Force-field choice is caller responsibility. The service executes explicit
61
- LAMMPS input and does not infer potentials from formulas or structures.
62
-
63
- 最终只复制当前 native 的 `last_thermo`、final step/temperature/total energy、
64
- warnings 和用户要求的输出文件摘要。禁止把总能量除以原子数、替换步数、换算单位或
65
- 推测收敛性、稳定性。最小示例必须先调用 `lj-melt-example`,再把其
66
- `native["request"]` 原样交给 `run`;不得传 wrapper 外层 envelope。
1
+ # LAMMPS 详细规则
2
+
3
+ 所有调用只走统一 wrapper。LAMMPS 不从化学式、CIF 或 POSCAR 自动推断 data、原子
4
+ 类型、势函数与边界条件。成功执行不表示物理收敛或生产可用。
5
+
6
+ ## Health
7
+
8
+ operation:`health`,无 body。
9
+
10
+ Key response fields in `data`: `status`, `service`, `lammps_available`,
11
+ `metadata`, and `limits`.
12
+
13
+ 只有用户明确要求健康检查时才调用;不要在模拟前自动增加 health。
14
+
15
+ ## Built-In Lennard-Jones Example
16
+
17
+ operation:`lj-melt-example`。
18
+
19
+ Returns a complete `request` payload for the `run` operation, plus workflow notes
20
+ showing where pymatgen and GSAS-II fit around LAMMPS.
21
+
22
+ ## Run
23
+
24
+ operation:`run`。
25
+
26
+ ```json
27
+ {
28
+ "input_script": "<LAMMPS input script>",
29
+ "files": [
30
+ {"path": "system.data", "content": "<LAMMPS data file text>", "encoding": "text"}
31
+ ],
32
+ "timeout_seconds": 30,
33
+ "max_thermo_rows": 1000,
34
+ "log_tail_lines": 200,
35
+ "output_files": ["dump.lammpstrj", "final.data"],
36
+ "include_log": true,
37
+ "include_stdout": false,
38
+ "include_stderr": false
39
+ }
40
+ ```
41
+
42
+ `files` are written into a fresh job working directory before LAMMPS starts.
43
+ `encoding` can be `text` or `base64`.
44
+
45
+ The response includes parsed thermo rows, the final thermo row, atom count when
46
+ detectable, log tail, warnings, and requested output files. Text output files
47
+ return `content`; binary output files return `content_base64`.
48
+
49
+ Notes:
50
+
51
+ - Use relative file paths only.
52
+ - The service rejects unsafe commands such as `shell`, `python`, `plugin`, and
53
+ `jump` by default.
54
+ - `include <relative-file>` is allowed when the included file is supplied in
55
+ `files`; absolute paths, parent-directory traversal, URLs, and `jump` loops
56
+ are rejected.
57
+ - Dump/data products are returned as raw requested output files, not structured
58
+ parsed atom-frame objects.
59
+ - The gateway is synchronous; keep interactive runs short.
60
+ - Force-field choice is caller responsibility. The service executes explicit
61
+ LAMMPS input and does not infer potentials from formulas or structures.
62
+
63
+ 最终只复制当前 native 的 `last_thermo`、final step/temperature/total energy、
64
+ warnings 和用户要求的输出文件摘要。禁止把总能量除以原子数、替换步数、换算单位或
65
+ 推测收敛性、稳定性。最小示例必须先调用 `lj-melt-example`,再把其
66
+ `native["request"]` 原样交给 `run`;不得传 wrapper 外层 envelope。
@@ -1,130 +1,130 @@
1
- # LDM-BO 详细规则
2
-
3
- 所有调用只走统一 wrapper,不是本地 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
-
1
+ # LDM-BO 详细规则
2
+
3
+ 所有调用只走统一 wrapper,不是本地 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
36
  Typical native response inside gateway `data`:
37
-
38
- ```json
39
- {
40
- "recommendations": ["CCC"],
41
- "acquisition_values": [0.12],
42
- "n_objectives": 1
43
- }
44
- ```
45
-
37
+
38
+ ```json
39
+ {
40
+ "recommendations": ["CCC"],
41
+ "acquisition_values": [0.12],
42
+ "n_objectives": 1
43
+ }
44
+ ```
45
+
46
46
  LDM methods may include an `llm` diagnostics object.
47
47
 
48
48
  `acquisition_values` 只能按 native 原值报告。除非当前 native 明确给出字段定义,否则
49
49
  不得把它描述为预测 Vina、预测 objective、不确定性、置信度、expected improvement,
50
50
  也不得自行判断“越大/越小越好”。服务未返回推荐理由时,明确写“服务未返回推荐
51
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 native response inside 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 native `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 wrapper intentionally preserves user payloads and lets `bo_api` own native
130
- defaults and schema behavior.
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 native response inside 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 native `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 wrapper intentionally preserves user payloads and lets `bo_api` own native
130
+ defaults and schema behavior.