@delta-infra/cli 1.1.17 → 1.1.18

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 (33) hide show
  1. package/README.md +513 -506
  2. package/checksums.txt +5 -5
  3. package/package.json +1 -1
  4. package/scripts/install-wizard.js +701 -701
  5. package/scripts/install.js +442 -442
  6. package/scripts/run.js +65 -65
  7. package/skills/delta-sandbox/SKILL.md +388 -388
  8. package/skills/delta-sandbox/agents/openai.yaml +4 -4
  9. package/skills/delta-sandbox/references/commands.md +58 -58
  10. package/skills/delta-sandbox/references/lifecycle.md +100 -100
  11. package/skills/delta-sandbox/references/recipes.md +138 -138
  12. package/skills/delta-science/AGENTS.md +47 -47
  13. package/skills/delta-science/SKILL.md +227 -185
  14. package/skills/delta-science/agents/openai.yaml +4 -4
  15. package/skills/delta-science/references/antbo.md +105 -100
  16. package/skills/delta-science/references/delta-bo.md +92 -89
  17. package/skills/delta-science/references/gsasii.md +118 -116
  18. package/skills/delta-science/references/lammps.md +68 -66
  19. package/skills/delta-science/references/ldm-bo.md +132 -129
  20. package/skills/delta-science/references/materials-design.md +130 -118
  21. package/skills/delta-science/references/pubchem.md +128 -126
  22. package/skills/delta-science/references/pymatgen.md +69 -68
  23. package/skills/delta-science/references/qe.md +134 -125
  24. package/skills/delta-science/references/rdkit.md +141 -138
  25. package/skills/delta-science/references/strbo.md +95 -87
  26. package/skills/delta-science/references/synbo.md +201 -198
  27. package/skills/delta-science/references/xrd.md +197 -186
  28. package/skills/delta-science/scripts/catalog.py +92 -92
  29. package/skills/delta-science/scripts/generated_catalog.py +69 -69
  30. package/skills/delta-science/scripts/invoke.py +346 -346
  31. package/skills/delta-shared/SKILL.md +113 -111
  32. package/skills/delta-shared/agents/openai.yaml +4 -4
  33. package/skills/manifest.json +19 -19
@@ -1,68 +1,69 @@
1
- # pymatgen 详细规则
2
-
3
- 所有调用直接使用 `delta-cli science invoke`。无机化学式、组成和式量优先使用 pymatgen,不用 PubChem
4
- 或本地元素表替代。结构 operation 必须发送完整结构文本,不能发送本地文件路径;
5
- 支持 `cif`、`poscar`、`json`、`cssr`、`xsf`,不接收 LAMMPS data/dump。
6
-
7
- ## Health
8
-
9
- operation:`health`,无 body。
10
-
11
- ## Composition Parse
12
-
13
- operation:`composition-parse`。
14
-
15
- ```json
16
- {"formula": "LiFePO4", "format": "formula"}
17
- ```
18
-
19
- Key response fields in `data`: `valid`, `formula`, `reduced_formula`,
20
- `alphabetic_formula`, `anonymous_formula`, `chemical_system`,
21
- `number_of_atoms`, `weight`, `element_amounts`, `atomic_fractions`,
22
- `weight_fractions`, `error`.
23
-
24
- ## Structure Parse / Summary
25
-
26
- operation:`structure-parse` 或 `structure-summary`。
27
-
28
- ```json
29
- {"input": "<CIF text>", "format": "cif", "primitive": false}
30
- ```
31
-
32
- Input formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
33
-
34
- Summary fields include `formula`, `reduced_formula`, `chemical_system`,
35
- `nsites`, `nelements`, `density`, `volume`, `lattice`, `element_amounts`, and
36
- `species`.
37
-
38
- ## Structure Convert
39
-
40
- operation:`structure-convert`。
41
-
42
- ```json
43
- {
44
- "input": "<CIF text>",
45
- "input_format": "cif",
46
- "output_format": "poscar",
47
- "primitive": false
48
- }
49
- ```
50
-
51
- Output formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
52
-
53
- ## Symmetry
54
-
55
- operation:`structure-symmetry`。
56
-
57
- ```json
58
- {
59
- "input": "<CIF text>",
60
- "format": "cif",
61
- "primitive": false,
62
- "symprec": 0.01,
63
- "angle_tolerance": 5.0
64
- }
65
- ```
66
-
67
- Returns `space_group_symbol`, `space_group_number`, `crystal_system`,
68
- `point_group_symbol`, `hall`, and `nsites`.
1
+ # pymatgen reference
2
+
3
+ Make all calls with `delta-cli science invoke`. Prefer pymatgen for inorganic formulae,
4
+ composition and formula weight; do not use PubChem or a local element table as a substitute.
5
+ Structure operations require the complete structure text, not a local file path. Supported formats
6
+ are `cif`, `poscar`, `json`, `cssr` and `xsf`; LAMMPS data and dump files are not accepted.
7
+
8
+ ## Health
9
+
10
+ Operation: `health`; no request body.
11
+
12
+ ## Composition Parse
13
+
14
+ Operation: `composition-parse`.
15
+
16
+ ```json
17
+ {"formula": "LiFePO4", "format": "formula"}
18
+ ```
19
+
20
+ Key response fields in `data`: `valid`, `formula`, `reduced_formula`,
21
+ `alphabetic_formula`, `anonymous_formula`, `chemical_system`,
22
+ `number_of_atoms`, `weight`, `element_amounts`, `atomic_fractions`,
23
+ `weight_fractions`, `error`.
24
+
25
+ ## Structure Parse / Summary
26
+
27
+ Operation: `structure-parse` or `structure-summary`.
28
+
29
+ ```json
30
+ {"input": "<CIF text>", "format": "cif", "primitive": false}
31
+ ```
32
+
33
+ Input formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
34
+
35
+ Summary fields include `formula`, `reduced_formula`, `chemical_system`,
36
+ `nsites`, `nelements`, `density`, `volume`, `lattice`, `element_amounts`, and
37
+ `species`.
38
+
39
+ ## Structure Convert
40
+
41
+ Operation: `structure-convert`.
42
+
43
+ ```json
44
+ {
45
+ "input": "<CIF text>",
46
+ "input_format": "cif",
47
+ "output_format": "poscar",
48
+ "primitive": false
49
+ }
50
+ ```
51
+
52
+ Output formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
53
+
54
+ ## Symmetry
55
+
56
+ Operation: `structure-symmetry`.
57
+
58
+ ```json
59
+ {
60
+ "input": "<CIF text>",
61
+ "format": "cif",
62
+ "primitive": false,
63
+ "symprec": 0.01,
64
+ "angle_tolerance": 5.0
65
+ }
66
+ ```
67
+
68
+ Returns `space_group_symbol`, `space_group_number`, `crystal_system`,
69
+ `point_group_symbol`, `hall`, and `nsites`.
@@ -1,125 +1,134 @@
1
- # Quantum ESPRESSO DFT 详细规则
2
-
3
- QE 用于通过 Chemistry Gateway 执行可追踪的异步 Quantum ESPRESSO 工作流。agent 只接触
4
- Gateway/Science Server contract,不运行本地 `pw.x`,不调用内部 QE 容器,也不提交 shell
5
- 命令、scheduler 脚本、`pseudo_dir`、`outdir` 或主机路径。
6
-
7
- 本 reference 对应 CLI 的真实工具为 `qe`。实际 `tools.name` 与 `tool_endpoints.name`
8
- 必须逐字取自当前 CLI catalog。下列路径是 QE 服务契约,不是可直接访问的 URL,也不是
9
- 可以自动改写的 endpoint 别名。
10
-
11
- ## 能力分组
12
-
13
- | 服务路径 | 作用 | 类型 |
14
- | --- | --- | --- |
15
- | `/chem/qe/health`、`/healthz`、`/readyz` | 运行时、scheduler、存储和 PP 就绪 | 只读 |
16
- | `/chem/qe/v1/qe/workflow-types` | workflow catalog 和支持状态 | 只读 |
17
- | `/chem/qe/v1/pp-sets`、`/pp-locks/{digest}` | 已发布 PP profile/lock | 只读 |
18
- | `/chem/qe/v1/pp-sets:resolve` | 按 campaign 元素全集解析 PP 候选 | 只读/校验 |
19
- | `/chem/qe/v1/artifacts` | 上传、查询和下载结构/fixed-coordinate artifact | 文件/二进制 |
20
- | `/chem/qe/v1/qe/jobs` | 提交异步计算并查询 job | 远端变更 |
21
- | `/chem/qe/v1/qe/jobs/{job_id}/events`、`steps`、`logs`、`artifacts` | 读取作业过程和结果 | 只读 |
22
- | `/chem/qe/v1/qe/jobs/{job_id}:cancel`、`:retry`、`:review` | 取消、重试和科学审核 | 远端变更 |
23
-
24
- 选择新 operation 时,先使用:
25
-
26
- ```text
27
- delta-cli science list
28
- delta-cli science endpoints list <exact tool name>
29
- ```
30
-
31
- 再用目录返回的精确名称调用;如果 catalog 没有 schema,不猜测 operation、路径参数、
32
- 请求头或 body。
33
-
34
- ## CLI 的文件和幂等边界
35
-
36
- 结构 artifact 上传需要 `application/octet-stream` 和 query metadata,QE job 提交要求
37
- 稳定的 `Idempotency-Key`。`science invoke` 仍只用于 JSON/query;文件通过
38
- `science file`,持久化 job 通过 `science task`:
39
-
40
- - `delta-cli science file invoke --tool qe --endpoint artifact-upload --file <path>` 上传
41
- 结构 artifact;`custom-pp-upload` 同理并在 `--data` 中提供 `custom_pp_id`;
42
- - `delta-cli science task submit --tool qe --operation job-submit --input JSON
43
- --idempotency-key KEY` 提交 durable QE job,worker 将幂等键传给 Gateway;
44
- - `delta-cli science file download --tool qe --endpoint artifact-content --params JSON
45
- --output <path>` 下载原始 artifact;
46
- - 不要把结构文本、文件路径、base64、`Idempotency-Key` 或 QE service credential 当成
47
- 普通业务字段发送,也不要调用公开/私有 Gateway URL 或 `qe-cloud-compute:18020`。
48
-
49
- ## 新作业的正确顺序
50
-
51
- 1. 读取 health;需要部署诊断时再读取 readiness,并从 workflow catalog 选择当前
52
- `supported` 的 task。
53
- 2. 计算完整 `campaign_elements` 集合,使用 `pp-sets:resolve` 得到 profile;生产作业
54
- 必须使用服务返回的 `pp_set_id` 与不可变 `lock_id`,不能只凭 profile 名称推断 lock。
55
- 3. 让服务校验结构 artifact,job 只引用返回的 `sha256:<digest>` artifact ID。
56
- 4. 用稳定幂等语义提交 `qe/jobs`;接收 `202` 只代表 accepted/queued,不代表 QE 已收敛。
57
- 5. 轮询 job、events、steps、logs 和 artifacts;独立读取 `execution`、`solver`、
58
- `scientific` 三个状态。
59
- 6. 下载结果时校验每个 artifact 的 SHA-256,并分别报告 selected backend、资源 telemetry、
60
- solver 状态、scientific review 状态和 warnings。
61
-
62
- PP 解析的最小业务数据形状如下;其中值必须来自当前服务/目录,不能填入虚构的生产 lock:
63
-
64
- ```json
65
- {
66
- "campaign_id": "si-bulk-scf-v1",
67
- "campaign_elements": ["Si", "O"],
68
- "workflows": ["qe.pw.scf"],
69
- "explicit_mode": null
70
- }
71
- ```
72
-
73
- 作业的核心结构如下,`workflow_inputs` 必须遵循当前 task schema:
74
-
75
- ```json
76
- {
77
- "task": "qe.pw.scf",
78
- "schema_version": "1.1",
79
- "campaign_id": "si-bulk-scf-v1",
80
- "campaign_elements": ["Si"],
81
- "structure": {"format": "artifact", "artifact_id": "sha256:<64-hex>"},
82
- "physics": {
83
- "parameter_set": "<approved-parameter-set>",
84
- "pp_policy": {
85
- "mode": "sssp_single",
86
- "pp_set_id": "<approved-pp-set>",
87
- "lock_id": "sha256:<64-hex>"
88
- },
89
- "kpoints": [4, 4, 4]
90
- },
91
- "resources": {
92
- "profile": "standard",
93
- "nodes": 1,
94
- "mpi_ranks_per_node": 1,
95
- "omp_threads_per_rank": 1,
96
- "walltime_seconds": 3600,
97
- "gpu_policy": "cpu"
98
- },
99
- "client_request_id": "si-scf-v1",
100
- "workflow_inputs": {}
101
- }
102
- ```
103
-
104
- ## CPU/GPU 与状态解释
105
-
106
- CPU 是默认策略,尤其适用于小/中型交互任务、PP/结构/审计/归档任务和成本敏感场景。
107
- 只有用户明确要求或项目已有 GPU 预算,并且 live catalog 返回
108
- `gpu_support_status: "verified"` 时,才使用 `gpu`;强制 GPU 不得静默回退 CPU。只有
109
- 结果明确返回 `selected_backend: "gpu"` 才能声称实际使用 GPU;`auto` 不是 GPU 使用证明。
110
-
111
- 三个状态通道不可合并:
112
-
113
- - `execution`:prepared/submitted/queued/running/scheduler completion/cancelled/failed;
114
- - `solver`:not started/running/converged/not converged/failed/unknown;
115
- - `scientific`:unreviewed、scientifically accepted、accepted with limitations、needs
116
- recalculation、not assessable、failed 或 archived。
117
-
118
- scheduler 完成不等于 solver 收敛,solver 收敛也不等于 scientific acceptance。按稳定
119
- 错误码而不是 message 分支,重点包括 `PP_SET_INCOMPLETE`、`PP_POLICY_INCOMPATIBLE`、
120
- `PP_CAPABILITY_UNKNOWN`、`ARTIFACT_MISSING`、`SOLVER_NOT_CONVERGED`、
121
- `SCIENTIFIC_GATE_FAILED`、`RESTART_INCOMPATIBLE`、`IDEMPOTENCY_CONFLICT`、
122
- `EXECUTION_BACKEND_NOT_READY`、`GPU_UNSUPPORTED` 和 `GPU_UNAVAILABLE`。
123
-
124
- 提交、取消、重试或审核属于远端变更,必须有用户明确授权;结果未知时禁止重试。不要把
125
- GPU smoke test、scheduler 日志或可解析的 QE 输出描述成科学结论或客户级性能保证。
1
+ # Quantum ESPRESSO DFT reference
2
+
3
+ Use QE to run traceable, asynchronous Quantum ESPRESSO workflows through Chemistry Gateway.
4
+ The agent interacts only with the Gateway/Science Server contract: it does not run local `pw.x`,
5
+ call internal QE containers, or submit shell commands, scheduler scripts, `pseudo_dir`, `outdir`
6
+ or host paths.
7
+
8
+ The actual CLI tool for this reference is `qe`. Copy `tools.name` and `tool_endpoints.name`
9
+ exactly from the current CLI catalogue. The paths below describe the QE service contract; they
10
+ are not URLs to access directly or endpoint aliases that may be rewritten automatically.
11
+
12
+ ## Capability groups
13
+
14
+ | Service path | Purpose | Type |
15
+ | --- | --- | --- |
16
+ | `/chem/qe/health`, `/healthz`, `/readyz` | Runtime, scheduler, storage and PP readiness | Read-only |
17
+ | `/chem/qe/v1/qe/workflow-types` | Workflow catalogue and support status | Read-only |
18
+ | `/chem/qe/v1/pp-sets`, `/pp-locks/{digest}` | Published PP profiles/locks | Read-only |
19
+ | `/chem/qe/v1/pp-sets:resolve` | Resolve PP candidates for the complete set of campaign elements | Read-only/validation |
20
+ | `/chem/qe/v1/artifacts` | Upload, query and download structure/fixed-coordinate artifacts | File/binary |
21
+ | `/chem/qe/v1/qe/jobs` | Submit asynchronous calculations and query jobs | Remote mutation |
22
+ | `/chem/qe/v1/qe/jobs/{job_id}/events`, `steps`, `logs`, `artifacts` | Read job progress and results | Read-only |
23
+ | `/chem/qe/v1/qe/jobs/{job_id}:cancel`, `:retry`, `:review` | Cancel, retry and scientifically review a job | Remote mutation |
24
+
25
+ When selecting a new operation, first run:
26
+
27
+ ```text
28
+ delta-cli science list
29
+ delta-cli science endpoints list <exact tool name>
30
+ ```
31
+
32
+ Then call it using the exact names returned by the catalogue. If the catalogue has no schema, do
33
+ not guess the operation, path parameters, headers or body.
34
+
35
+ ## CLI file and idempotency boundaries
36
+
37
+ Structure artifact uploads require `application/octet-stream` and query metadata; QE job
38
+ submission requires a stable `Idempotency-Key`. `science invoke` remains for JSON/query only;
39
+ send files through `science file` and persistent jobs through `science task`:
40
+
41
+ - `delta-cli science file invoke --tool qe --endpoint artifact-upload --file <path>` uploads
42
+ a structure artifact; for `custom-pp-upload`, also provide `custom_pp_id` in `--data`;
43
+ - `delta-cli science task submit --tool qe --operation job-submit --input JSON
44
+ --idempotency-key KEY` submits a durable QE job; the worker passes the idempotency key to Gateway;
45
+ - `delta-cli science file download --tool qe --endpoint artifact-content --params JSON
46
+ --output <path>` downloads a raw artifact;
47
+ - Do not send structure text, file paths, base64, `Idempotency-Key` or QE service credentials as
48
+ ordinary business fields, and do not call public or private Gateway URLs or `qe-cloud-compute:18020`.
49
+
50
+ ## Correct sequence for a new job
51
+
52
+ 1. Read health. Read readiness only when diagnosing the deployment, and choose a currently
53
+ `supported` task from the workflow catalogue.
54
+ 2. Determine the complete `campaign_elements` set and use `pp-sets:resolve` to obtain a profile.
55
+ Production jobs must use the returned `pp_set_id` and immutable `lock_id`; do not infer the
56
+ lock from the profile name alone.
57
+ 3. Ask the service to validate the structure artifact. The job must reference only the returned
58
+ `sha256:<digest>` artifact ID.
59
+ 4. Submit to `qe/jobs` with stable idempotency semantics. A `202` response means accepted/queued,
60
+ not that QE has converged.
61
+ 5. Poll the job, events, steps, logs and artifacts; read the `execution`, `solver` and
62
+ `scientific` states independently.
63
+ 6. Verify each artifact's SHA-256 when downloading results. Report the selected backend, resource
64
+ telemetry, solver state, scientific review state and warnings separately.
65
+
66
+ The minimum business-data shape for PP resolution is shown below. Values must come from the
67
+ current service/catalogue; do not insert a fabricated production lock:
68
+
69
+ ```json
70
+ {
71
+ "campaign_id": "si-bulk-scf-v1",
72
+ "campaign_elements": ["Si", "O"],
73
+ "workflows": ["qe.pw.scf"],
74
+ "explicit_mode": null
75
+ }
76
+ ```
77
+
78
+ The core job structure is shown below. `workflow_inputs` must follow the current task schema:
79
+
80
+ ```json
81
+ {
82
+ "task": "qe.pw.scf",
83
+ "schema_version": "1.1",
84
+ "campaign_id": "si-bulk-scf-v1",
85
+ "campaign_elements": ["Si"],
86
+ "structure": {"format": "artifact", "artifact_id": "sha256:<64-hex>"},
87
+ "physics": {
88
+ "parameter_set": "<approved-parameter-set>",
89
+ "pp_policy": {
90
+ "mode": "sssp_single",
91
+ "pp_set_id": "<approved-pp-set>",
92
+ "lock_id": "sha256:<64-hex>"
93
+ },
94
+ "kpoints": [4, 4, 4]
95
+ },
96
+ "resources": {
97
+ "profile": "standard",
98
+ "nodes": 1,
99
+ "mpi_ranks_per_node": 1,
100
+ "omp_threads_per_rank": 1,
101
+ "walltime_seconds": 3600,
102
+ "gpu_policy": "cpu"
103
+ },
104
+ "client_request_id": "si-scf-v1",
105
+ "workflow_inputs": {}
106
+ }
107
+ ```
108
+
109
+ ## CPU/GPU and state interpretation
110
+
111
+ CPU is the default, particularly for small or medium interactive jobs, PP/structure/audit/archive
112
+ jobs, and cost-sensitive work. Use `gpu` only when the user explicitly requests it or the project
113
+ already has a GPU budget, and the live catalogue returns `gpu_support_status: "verified"`. Do not
114
+ silently fall back to CPU when GPU is required. Claim that GPU was used only when the result
115
+ explicitly returns `selected_backend: "gpu"`; `auto` does not prove GPU use.
116
+
117
+ Keep the three state channels separate:
118
+
119
+ - `execution`: prepared/submitted/queued/running/scheduler completion/cancelled/failed;
120
+ - `solver`: not started/running/converged/not converged/failed/unknown;
121
+ - `scientific`: unreviewed, scientifically accepted, accepted with limitations, needs
122
+ recalculation, not assessable, failed or archived.
123
+
124
+ scheduler completion does not mean solver convergence, and solver convergence does not mean
125
+ scientific acceptance. Branch on stable error codes rather than messages. Key codes include
126
+ `PP_SET_INCOMPLETE`, `PP_POLICY_INCOMPATIBLE`,
127
+ `PP_CAPABILITY_UNKNOWN`, `ARTIFACT_MISSING`, `SOLVER_NOT_CONVERGED`,
128
+ `SCIENTIFIC_GATE_FAILED`, `RESTART_INCOMPATIBLE`, `IDEMPOTENCY_CONFLICT`,
129
+ `EXECUTION_BACKEND_NOT_READY`, `GPU_UNSUPPORTED` and `GPU_UNAVAILABLE`.
130
+
131
+ Submission, cancellation, retry and review are remote mutations and require the user's explicit
132
+ authorisation. Do not retry when the outcome is unknown. Do not describe a GPU smoke test,
133
+ scheduler log or parseable QE output as a scientific conclusion or a customer-level performance
134
+ guarantee.