@delta-infra/cli 1.1.19 → 1.1.21

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 (77) hide show
  1. package/README.md +507 -520
  2. package/checksums.txt +5 -5
  3. package/package.json +1 -1
  4. package/scripts/install-wizard.js +689 -688
  5. package/scripts/install.js +442 -442
  6. package/scripts/run.js +65 -65
  7. package/skills/delta-protein/AGENTS.md +72 -72
  8. package/skills/delta-protein/SKILL.md +388 -388
  9. package/skills/delta-protein/agents/openai.yaml +3 -3
  10. package/skills/delta-protein/references/bfitter.md +63 -63
  11. package/skills/delta-protein/references/catapro_predict.md +62 -62
  12. package/skills/delta-protein/references/catpred_predict.md +64 -64
  13. package/skills/delta-protein/references/caver_tunnel_analyze.md +62 -62
  14. package/skills/delta-protein/references/consensus_mutation.md +60 -60
  15. package/skills/delta-protein/references/consurf_predict.md +66 -66
  16. package/skills/delta-protein/references/crop_sequence.md +68 -68
  17. package/skills/delta-protein/references/dock.md +81 -81
  18. package/skills/delta-protein/references/dock_score.md +69 -69
  19. package/skills/delta-protein/references/easifa_predict_active_site.md +69 -69
  20. package/skills/delta-protein/references/ephod_predict_mutation.md +65 -65
  21. package/skills/delta-protein/references/ephod_predict_protein.md +60 -60
  22. package/skills/delta-protein/references/esmfold2_predict.md +66 -66
  23. package/skills/delta-protein/references/evcouplings_mutation.md +63 -63
  24. package/skills/delta-protein/references/fasta_to_sequence.md +58 -58
  25. package/skills/delta-protein/references/foldseek.md +60 -60
  26. package/skills/delta-protein/references/generate_msa.md +60 -60
  27. package/skills/delta-protein/references/interpro_analyze.md +62 -62
  28. package/skills/delta-protein/references/mpnn_design_sequence.md +70 -70
  29. package/skills/delta-protein/references/multievolve.md +72 -72
  30. package/skills/delta-protein/references/pisa_query.md +69 -69
  31. package/skills/delta-protein/references/plip_analyze.md +64 -64
  32. package/skills/delta-protein/references/pocket_prediction.md +62 -62
  33. package/skills/delta-protein/references/protein_design.md +64 -64
  34. package/skills/delta-protein/references/protein_evolution.md +76 -76
  35. package/skills/delta-protein/references/protein_sol_predict_mutation.md +65 -65
  36. package/skills/delta-protein/references/protein_sol_predict_protein.md +60 -60
  37. package/skills/delta-protein/references/protenix.md +65 -65
  38. package/skills/delta-protein/references/protrek_search.md +89 -89
  39. package/skills/delta-protein/references/pubchem_search.md +67 -67
  40. package/skills/delta-protein/references/pubmed_search.md +78 -78
  41. package/skills/delta-protein/references/reap_design_primer.md +68 -68
  42. package/skills/delta-protein/references/rfd3_design.md +64 -64
  43. package/skills/delta-protein/references/structure_to_sequence.md +60 -60
  44. package/skills/delta-protein/references/summarize_result.md +67 -67
  45. package/skills/delta-protein/references/surface_charge.md +83 -83
  46. package/skills/delta-protein/references/uniprot_batch_query.md +62 -62
  47. package/skills/delta-protein/references/uniprot_query.md +63 -63
  48. package/skills/delta-protein/references/zero_shot_mutant_candidates.md +75 -75
  49. package/skills/delta-protein/scripts/gen_references.py +166 -166
  50. package/skills/delta-protein/scripts/output_metadata.json +274 -274
  51. package/skills/delta-sandbox/SKILL.md +388 -388
  52. package/skills/delta-sandbox/agents/openai.yaml +4 -4
  53. package/skills/delta-sandbox/references/commands.md +58 -58
  54. package/skills/delta-sandbox/references/lifecycle.md +100 -100
  55. package/skills/delta-sandbox/references/recipes.md +138 -138
  56. package/skills/delta-science/AGENTS.md +47 -47
  57. package/skills/delta-science/SKILL.md +227 -227
  58. package/skills/delta-science/agents/openai.yaml +4 -4
  59. package/skills/delta-science/references/antbo.md +105 -105
  60. package/skills/delta-science/references/delta-bo.md +92 -92
  61. package/skills/delta-science/references/gsasii.md +118 -118
  62. package/skills/delta-science/references/lammps.md +68 -68
  63. package/skills/delta-science/references/ldm-bo.md +132 -132
  64. package/skills/delta-science/references/materials-design.md +130 -130
  65. package/skills/delta-science/references/pubchem.md +128 -128
  66. package/skills/delta-science/references/pymatgen.md +69 -69
  67. package/skills/delta-science/references/qe.md +134 -134
  68. package/skills/delta-science/references/rdkit.md +141 -141
  69. package/skills/delta-science/references/strbo.md +95 -95
  70. package/skills/delta-science/references/synbo.md +201 -201
  71. package/skills/delta-science/references/xrd.md +154 -170
  72. package/skills/delta-science/scripts/catalog.py +92 -92
  73. package/skills/delta-science/scripts/generated_catalog.py +69 -69
  74. package/skills/delta-science/scripts/invoke.py +346 -346
  75. package/skills/delta-shared/SKILL.md +113 -113
  76. package/skills/delta-shared/agents/openai.yaml +4 -4
  77. package/skills/manifest.json +20 -20
@@ -1,4 +1,10 @@
1
- # XRD Cloud Compute API Reference
1
+ # XRD reference
2
+
3
+ Make all online XRD calls with
4
+ `delta-cli science invoke --tool xrd --endpoint <operation>`.
5
+ Use the CLI's configured authentication and service address. Do not
6
+ call registry, gateway, or compute-service URLs directly, or follow returned
7
+ `content_url` and job `links` outside the CLI.
2
8
 
3
9
  The OpenAPI contract version is `1.2.0`. Business requests and responses use
4
10
  `schema_version: 1`.
@@ -8,110 +14,73 @@ sequences, refinement jobs, quality assessment, and error handling. Replace
8
14
  `art_<...>`, `<sha256>`, and `refjob_<...>` placeholders with values returned by
9
15
  the service in the same workflow.
10
16
 
11
- ## 1. Tool and endpoints
12
-
13
- The registered tool is `xrd`, tool ID `30`. The
14
- [tool record](http://8.141.101.94:8001/api/v1/tools/30) and
15
- [endpoint catalogue](http://8.141.101.94:8001/api/v1/tools/30/endpoints)
16
- identify 27 registered endpoints, all enabled. The catalogue server is a tool
17
- registry and invocation proxy; it is not the compute service base URL.
17
+ ## 1. Tool and operations
18
18
 
19
- Catalogue APIs, relative to `http://8.141.101.94:8001`:
20
-
21
- | Method and path | Purpose |
22
- | --- | --- |
23
- | `GET /api/v1/tools/30` | Tool identity and configuration |
24
- | `GET /api/v1/tools/30/endpoints` | All registered XRD endpoints |
25
- | `GET /api/v1/tools/30/endpoints?status=true` | Enabled XRD endpoints |
26
- | `GET /api/v1/tools/name/xrd/endpoints` | Endpoint lookup by tool name |
27
-
28
- Catalogue responses use `code`, `message`, and `data`; `code=0` indicates success.
29
- Endpoint records include `id`, `tool_id`, `name`, `path`, `method`, `price`,
30
- `featurekey`, and `status`. Registration and enabled status do not establish
31
- backend readiness. Recheck availability and prices before execution:
19
+ The CLI tool is `xrd`. Pass the operation names below exactly as `--endpoint`;
20
+ they are server catalogue contracts, not aliases. This table documents the
21
+ operations used by this reference, not a live inventory or price list.
22
+ When diagnosing availability, checking prices, or resolving a missing or
23
+ inconsistent contract, use CLI discovery:
32
24
 
33
25
  ```text
34
26
  delta-cli science list
35
27
  delta-cli science endpoints list xrd
36
28
  ```
37
29
 
38
- Use endpoint names exactly as registered. HTTP paths below are relative to the
39
- registered upstream compute service. Price values are the catalogue's `price`
40
- field; they do not specify a currency. All listed records have `status=true`.
41
-
42
- | Endpoint ID | CLI endpoint | HTTP method and path | Purpose / response | Price |
43
- | --- | --- | --- | --- | --- |
44
- | 128 | `healthz` | `GET /healthz` | Process liveness, JSON | 0 |
45
- | 129 | `readyz` | `GET /readyz` | Service readiness, JSON | 0 |
46
- | 130 | `capabilities` | `GET /v1/capabilities` | Components, versions, verification, modes, and limits | 0 |
47
- | 131 | `xqueryer-predictions` | `POST /v1/xqueryer/predictions` | Single-phase model predictions | 3 |
48
- | 132 | `xmatcher-detect-peaks` | `POST /v1/xmatcher/detect-peaks` | Observed peak detection | 4 |
49
- | 133 | `xmatcher-match` | `POST /v1/xmatcher/match` | Single-phase matching | 4 |
50
- | 134 | `xmatcher-multiphase-match` | `POST /v1/xmatcher/multiphase-match` | Multiphase candidate matching | 4 |
51
- | 135 | `xmatcher-cif-xrd` | `POST /v1/xmatcher/cif-xrd` | Theoretical XRD simulation from CIFs | 4 |
52
- | 136 | `xmatcher-pdf-peaks-xlsx` | `POST /v1/xmatcher/pdf-peaks-xlsx` | Theoretical peak tables, binary XLSX | 8 |
53
- | 137 | `xmatcher-status` | `GET /v1/xmatcher/status` | XMatcher database status | 0 |
54
- | 138 | `xdecomposer-predictions` | `POST /v1/xdecomposer/predictions` | Multiphase model decomposition | 2 |
55
- | 139 | `xmatcher-refinement-patterns` | `POST /v1/xmatcher/refinement-patterns` | Corrected pattern and provenance manifest | 0 |
56
- | 140 | `mp500-cif-exports` | `POST /v1/mp500/cif-exports` | Export a CIF by database identity | 0 |
57
- | 141 | `xmatcher-artifacts` | `POST /v1/artifacts` | Upload file bytes and return an artifact reference | 0 |
58
- | 143 | `xmatcher-artifact` | `GET /v1/artifacts/{artifact_id}` | Artifact metadata | 0 |
59
- | 144 | `xmatcher-artifact-content` | `GET /v1/artifacts/{artifact_id}/content` | Artifact content, binary | 0 |
60
- | 145 | `refinement-job` | `GET /v1/refinement-jobs/{job_id}` | Job status and results | 0 |
61
- | 146 | `refinement-job-cancel` | `POST /v1/refinement-jobs/{job_id}/cancel` | Request cancellation | 0 |
62
- | 147 | `refinement-job-events` | `GET /v1/refinement-jobs/{job_id}/events` | Paginated job events | 0 |
63
- | 148 | `refinement-job-artifacts` | `GET /v1/refinement-jobs/{job_id}/artifacts` | Public job artifacts | 0 |
64
- | 149 | `refinement-fullprof` | `POST /v1/refinement-jobs` | Submit a FullProf job, HTTP 202 | 15 |
65
- | 150 | `refinement-gsasii` | `POST /v1/refinement-jobs` | Submit a GSAS-II job, HTTP 202 | 12 |
66
- | 151 | `refinement-wpem` | `POST /v1/refinement-jobs` | Submit a PyXplore/WPEM job, HTTP 202 | 10 |
67
- | 160 | `simulation-cif-parse` | `POST /v1/simulation/cif-parse` | Parse CIF data blocks | 1 |
68
- | 161 | `simulation-cif-peaks` | `POST /v1/simulation/cif-peaks` | Simulate reflections for a selected block and wavelength | 1 |
69
- | 162 | `pdfreporter-analyses` | `POST /v1/pdfreporter/analyses` | Multiphase peak assignments and charts | 8 |
70
- | 163 | `pdfreporter-assignments` | `POST /v1/pdfreporter/analyses/assignments` | Recompute analysis with manual assignments | 8 |
71
-
72
- The three refinement CLI endpoints select backend and billing entries in the
73
- proxy. The compute service exposes one job submission route. HTTP `backends`
74
- values are `pyxplore`, `fullprof`, and `gsasii`; `refinement-wpem` corresponds to
75
- PyXplore/WPEM. Match the CLI endpoint and requested backends to the proxy configuration.
76
-
77
- ### Chemistry gateway
30
+ Registration and enabled status do not establish backend readiness. Do not add
31
+ catalogue or health calls to an ordinary workflow unless needed for the task.
78
32
 
79
- The Chemistry gateway prefix is `/api/v1/chem/xrd`. Allowed business routes are
80
- exposed as `/api/v1/chem/xrd/v1/...`. The gateway injects an upstream service token,
81
- rewrites `Location`, `content_url`, and job `links`, and preserves business HTTP
82
- status codes and download headers.
83
-
84
- - `GET /api/v1/chem/xrd/health` calls compute `/readyz`.
85
- This aggregate health endpoint uses the gateway's `BaseResponse` envelope.
86
- - The gateway allowlist excludes `/v1/xdecomposer/predictions`, both
87
- `/v1/simulation/...` routes, and both `/v1/pdfreporter/...` routes. Requests to
88
- these paths through this Chemistry gateway return 404. They are implemented by
89
- the compute service; access through other proxies depends on their configuration.
90
- - `/v1/identification/predictions`, `/v1/structures/cif-exports`, and
91
- `/v1/identification-jobs/...` appear in the gateway allowlist but have no
92
- corresponding routes in this compute service implementation.
33
+ | Operation (`--endpoint`) | Purpose / response |
34
+ | --- | --- |
35
+ | `healthz` | Process liveness, JSON |
36
+ | `readyz` | Service readiness, JSON |
37
+ | `capabilities` | Components, versions, verification, modes, and limits |
38
+ | `xqueryer-predictions` | Single-phase model predictions |
39
+ | `xmatcher-detect-peaks` | Observed peak detection |
40
+ | `xmatcher-match` | Single-phase matching |
41
+ | `xmatcher-multiphase-match` | Multiphase candidate matching |
42
+ | `xmatcher-cif-xrd` | Theoretical XRD simulation from CIFs |
43
+ | `xmatcher-pdf-peaks-xlsx` | Theoretical peak tables, binary XLSX |
44
+ | `xmatcher-status` | XMatcher database status |
45
+ | `xdecomposer-predictions` | Multiphase model decomposition |
46
+ | `xmatcher-refinement-patterns` | Corrected pattern and provenance manifest |
47
+ | `mp500-cif-exports` | Export a CIF by database identity |
48
+ | `xmatcher-artifacts` | Upload file bytes and return an artifact reference |
49
+ | `xmatcher-artifact` | Artifact metadata |
50
+ | `xmatcher-artifact-content` | Artifact content, binary |
51
+ | `refinement-job` | Job status and results |
52
+ | `refinement-job-cancel` | Request cancellation |
53
+ | `refinement-job-events` | Paginated job events |
54
+ | `refinement-job-artifacts` | Public job artifacts |
55
+ | `refinement-fullprof` | Submit a FullProf job |
56
+ | `refinement-gsasii` | Submit a GSAS-II job |
57
+ | `refinement-wpem` | Submit a PyXplore/WPEM job |
58
+ | `simulation-cif-parse` | Parse CIF data blocks |
59
+ | `simulation-cif-peaks` | Simulate reflections for a selected block and wavelength |
60
+ | `pdfreporter-analyses` | Multiphase peak assignments and charts |
61
+ | `pdfreporter-assignments` | Recompute analysis with manual assignments |
62
+
63
+ The refinement operations select backend and billing entries. Request `backends`
64
+ values are `pyxplore`, `fullprof`, and `gsasii`; `refinement-wpem` corresponds to
65
+ PyXplore/WPEM. Match the operation and requested backends to the catalogue contract.
93
66
 
94
67
  ## 2. Request conventions and CLI argument mapping
95
68
 
96
- Compute `/v1/...` endpoints require `Authorization: Bearer <token>`, except in
97
- explicitly configured isolated environments with authentication disabled.
98
- `/healthz` and `/readyz` have no Bearer dependency.
69
+ Pass business JSON through `--data`. For file uploads, pass local bytes through
70
+ `--file` and set `--content-type application/octet-stream`; uploads are not
71
+ multipart requests. Authentication is handled by the CLI, not business JSON or
72
+ manually supplied service tokens. Business request models reject unknown fields.
99
73
 
100
- JSON requests use `Content-Type: application/json`. File uploads use
101
- `Content-Type: application/octet-stream` with raw file bytes in the body.
102
- Uploads are not multipart requests.
74
+ An optional `X-Request-ID` in `--headers` accepts 1–128 characters from letters,
75
+ digits, and `._:-`. Preserve the returned request ID for diagnostics.
103
76
 
104
- The optional `X-Request-ID` header accepts 1–128 characters from letters, digits,
105
- and `._:-`. Responses also return this header. Business request models reject
106
- unknown fields.
107
-
108
- | CLI argument | Upstream meaning |
77
+ | CLI argument | Meaning for XRD calls |
109
78
  | --- | --- |
110
79
  | `--data` | JSON request body |
111
80
  | `--params` | URL query parameters, including upload metadata and event pagination |
112
- | `--path-params` | Replace `{artifact_id}` and `{job_id}` in paths |
81
+ | `--path-params` | Artifact or job identity: `artifact_id` or `job_id` |
113
82
  | `--headers` | Additional headers, such as `Idempotency-Key` and `X-Content-SHA256` |
114
- | `--file` | Upload a local file through the tool proxy |
83
+ | `--file` | Upload a local file through the CLI |
115
84
  | `--content-type` | Upload body Content-Type; use `application/octet-stream` |
116
85
 
117
86
  `--params` cannot replace `--path-params`. Keep local paths, base64 content, and
@@ -119,17 +88,23 @@ idempotency keys out of business JSON. Use `science invoke --file` for XRD uploa
119
88
  The `media_type` query parameter describes the stored file format separately
120
89
  from the upload body Content-Type.
121
90
 
122
- The registry proxy exposes `POST /api/v1/tools/invoke` with required
123
- `tool_name` and `endpoint_name` fields. Optional fields are `data`, `params`,
124
- `path_params`, `headers`, `file_base64`, and `content_type`. A supplied
125
- file_base64 is decoded and forwarded as raw bytes, taking precedence over data;
126
- content_type defaults to application/octet-stream. Delta CLI maps its invocation
127
- arguments to these proxy fields. Tool ID 30 is used for catalogue lookup;
128
- invocation selects `tool_name="xrd"` and a registered endpoint name.
91
+ All operations in this reference, including uploads, binary responses, and XRD
92
+ refinement jobs, use `science invoke`. The `science file` and `science task`
93
+ adapters documented for QE/Materials Design do not replace these XRD operations.
94
+
95
+ ```text
96
+ delta-cli science invoke --tool xrd --endpoint <operation> `
97
+ [--data JSON] [--params JSON] [--path-params JSON] [--headers JSON]
98
+ ```
99
+
100
+ Pass each JSON object as one safely quoted argument. The examples below use
101
+ PowerShell continuation syntax. A call succeeds only when the CLI exits with
102
+ code 0 and its top-level JSON has `ok:true`; read business fields from `data`.
129
103
 
130
104
  ## 3. Call sequence
131
105
 
132
- 1. Inspect the CLI catalogue and check readiness and required capabilities.
106
+ 1. Select the documented operation; inspect the CLI catalogue, readiness, or
107
+ required capabilities only when the task or diagnosis requires it.
133
108
  2. Upload observed patterns, model inputs, CIFs, or instrument files. Save the
134
109
  returned `artifact_id` and `sha256` together.
135
110
  3. Use XMatcher or XDecomposer for observed data. XQueryer requires a prepared
@@ -149,13 +124,17 @@ invocation selects `tool_name="xrd"` and a registered endpoint name.
149
124
  delta-cli science invoke --tool xrd --endpoint healthz
150
125
  delta-cli science invoke --tool xrd --endpoint readyz
151
126
  delta-cli science invoke --tool xrd --endpoint capabilities
127
+ delta-cli science invoke --tool xrd --endpoint xmatcher-status
152
128
  ```
153
129
 
154
- `GET /healthz` returns `200 {"ok":true}` for process liveness.
155
- `GET /readyz` checks authentication configuration and required components;
156
- an unready service returns `503 {"ok":false}`.
130
+ `healthz` returns business `{"ok":true}` for process liveness.
131
+ `readyz` checks authentication configuration and required components;
132
+ an unready service fails the call. Keep probe business `ok` distinct from the
133
+ CLI envelope's top-level `ok`.
157
134
 
158
- `GET /v1/capabilities` returns `components.<name>.available`, component `details`,
135
+ `xmatcher-status` queries XMatcher database status without a request body.
136
+
137
+ `capabilities` returns `components.<name>.available`, component `details`,
159
138
  `limits`, and build information. Check the components required for the workflow,
160
139
  checksums, asset release approval, and mode availability. Report GPU use only when
161
140
  the returned device or backend explicitly supports that conclusion.
@@ -176,16 +155,17 @@ described in its detailed contract; consult the deployed capability for its limi
176
155
 
177
156
  ### Upload
178
157
 
179
- `POST /v1/artifacts` returns HTTP 201, an `ArtifactRef`, and a metadata query
180
- URL in the `Location` header.
158
+ Operation: `xmatcher-artifacts`. Pass the local file with `--file`; read the
159
+ returned `ArtifactRef` from CLI `data`. Query its identity with
160
+ `xmatcher-artifact` and `--path-params`, rather than a returned URL.
181
161
 
182
- | Parameter | Location | Requirement |
162
+ | Parameter | CLI argument | Requirement |
183
163
  | --- | --- | --- |
184
- | `filename` | Query | Required; 1–255 characters; no `/` or `\` |
185
- | `kind` | Query | Required; accepted kinds are listed below |
186
- | `media_type` | Query | Required; 1–255 characters; no line breaks |
187
- | `preserve_source` | Query | Default false; preserve original observed text pattern bytes |
188
- | `X-Content-SHA256` | Header | Optional; 64 lowercase hexadecimal characters, hashing the upload bytes |
164
+ | `filename` | `--params` | Required; 1–255 characters; no `/` or `\` |
165
+ | `kind` | `--params` | Required; accepted kinds are listed below |
166
+ | `media_type` | `--params` | Required; 1–255 characters; no line breaks |
167
+ | `preserve_source` | `--params` | Default false; preserve original observed text pattern bytes |
168
+ | `X-Content-SHA256` | `--headers` | Optional; 64 lowercase hexadecimal characters, hashing the upload bytes |
189
169
 
190
170
  | Accepted upload kind | File and processing rules |
191
171
  | --- | --- |
@@ -239,14 +219,15 @@ delta-cli science invoke --tool xrd --endpoint xmatcher-artifact-content `
239
219
  --path-params '{"artifact_id":"art_<returned-id>"}'
240
220
  ```
241
221
 
242
- The HTTP content response contains file bytes with `ETag` and
243
- `X-Artifact-SHA256` headers. A CLI proxy may wrap binary data with `data._binary`,
244
- `content_base64`, `media_type`, and `content_length`. Verify saved content against
245
- the returned SHA-256, and determine its format from the media type and content.
222
+ Read binary content from the documented CLI response fields. The tool proxy may
223
+ wrap it as `data._binary`, `data.content_base64`, `data.media_type`, and
224
+ `data.content_length`. Decode `content_base64` only when the response declares
225
+ that representation. Verify saved content against the artifact's returned
226
+ SHA-256, and determine its format from the media type and content.
246
227
 
247
228
  ## 6. Phase identification and matching
248
229
 
249
- ### XQueryer: `POST /v1/xqueryer/predictions`
230
+ ### XQueryer: `xqueryer-predictions`
250
231
 
251
232
  `pattern` must reference a `model_input_pattern` containing exactly 3,500 points
252
233
  on a uniform 10–90° 2theta grid. Maximum grid error is `1e-6`. Intensities must be
@@ -270,7 +251,7 @@ softmax probability.
270
251
 
271
252
  ### Peak detection and single-phase XMatcher
272
253
 
273
- `POST /v1/xmatcher/detect-peaks` accepts `schema_version`, `pattern`, `params`,
254
+ `xmatcher-detect-peaks` accepts `schema_version`, `pattern`, `params`,
274
255
  and optional `expected_xmatcher_database_sha256`. XMatcher accepts
275
256
  `observed_pattern` or `model_input_pattern` artifacts.
276
257
 
@@ -293,7 +274,7 @@ peak_match_score values and include calibration_adjusted_score. Interpret ranks
293
274
  using `ranking` and `effective_settings`. Learned mode explicitly reports
294
275
  `score_is_probability=false`; do not average these scores with XQueryer probabilities.
295
276
 
296
- ### Multiphase XMatcher: `POST /v1/xmatcher/multiphase-match`
277
+ ### Multiphase XMatcher: `xmatcher-multiphase-match`
297
278
 
298
279
  ```text
299
280
  delta-cli science invoke --tool xrd --endpoint xmatcher-multiphase-match `
@@ -337,7 +318,7 @@ effective settings.
337
318
  | `multiphase_missing_peak_weight` / `multiphase_phase_penalty` | 0.5 / 3.0 | ≥0 |
338
319
  | `multiphase_minimum_phase_contribution_percent` | 8.0 | [0,100) |
339
320
 
340
- ### XDecomposer: `POST /v1/xdecomposer/predictions`
321
+ ### XDecomposer: `xdecomposer-predictions`
341
322
 
342
323
  ```text
343
324
  delta-cli science invoke --tool xrd --endpoint xdecomposer-predictions `
@@ -354,7 +335,7 @@ map them to unique indices in 1–3 when constructing refinement requests.
354
335
 
355
336
  ### XMatcher simulation and XLSX export
356
337
 
357
- `POST /v1/xmatcher/cif-xrd` and `/v1/xmatcher/pdf-peaks-xlsx` share a request model.
338
+ Operations: `xmatcher-cif-xrd` and `xmatcher-pdf-peaks-xlsx`; they share a request model.
358
339
 
359
340
  ```text
360
341
  delta-cli science invoke --tool xrd --endpoint xmatcher-cif-xrd `
@@ -365,14 +346,16 @@ delta-cli science invoke --tool xrd --endpoint xmatcher-cif-xrd `
365
346
  nonnegative weight defaulting to 1. `two_theta_range` must be finite and
366
347
  increasing. `min_intensity` defaults to 0 and must be nonnegative; fwhm and step
367
348
  must be positive. `wavelength` is a string, separate from the numeric `lambda`
368
- field in the simulation API below. `expected_xmatcher_database_sha256` is optional.
349
+ field in `simulation-cif-peaks` below. `expected_xmatcher_database_sha256` is optional.
369
350
 
370
- The peak-table endpoint returns XLSX bytes with media type
371
- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`.
351
+ For peak-table export, use the same `--data` shape with
352
+ `--endpoint xmatcher-pdf-peaks-xlsx`. The response contains XLSX bytes with media
353
+ type `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`; decode
354
+ the CLI binary response as described in section 5.
372
355
 
373
356
  ### MP500, RRUFF, and OPXRD CIF export
374
357
 
375
- `POST /v1/mp500/cif-exports` requires both the candidate entry_id and its identity:
358
+ Operation: `mp500-cif-exports`. It requires both the candidate entry_id and its identity:
376
359
 
377
360
  ```text
378
361
  delta-cli science invoke --tool xrd --endpoint mp500-cif-exports `
@@ -391,7 +374,7 @@ MP500 or RRUFF mismatch errors; do not substitute guessed identifiers.
391
374
 
392
375
  ### CIF block parsing and reflection simulation
393
376
 
394
- CLI endpoint: `simulation-cif-parse`. Request for `POST /v1/simulation/cif-parse`:
377
+ Operation: `simulation-cif-parse`. Pass this request through `--data`:
395
378
 
396
379
  ```json
397
380
  {"schema_version":1,"cif":{"artifact_id":"art_<cif>","sha256":"<sha256>"}}
@@ -404,10 +387,10 @@ delta-cli science invoke --tool xrd --endpoint simulation-cif-parse `
404
387
 
405
388
  The response contains `blocks[]`. Successful blocks include block_index,
406
389
  block_name, formula, cell, volume, site_count, spacegroup, and warnings. Failed
407
- blocks include block_index and error. Inspect individual blocks even when HTTP
408
- status is 200.
390
+ blocks include block_index and error. Inspect individual blocks even when the
391
+ CLI invocation succeeds.
409
392
 
410
- CLI endpoint: `simulation-cif-peaks`. Request for `POST /v1/simulation/cif-peaks`:
393
+ Operation: `simulation-cif-peaks`. Pass this request through `--data`:
411
394
 
412
395
  ```json
413
396
  {"schema_version":1,"cif":{"artifact_id":"art_<cif>","sha256":"<sha256>"},"block":0,"lambda":1.5406,"min_angle":5.0,"max_angle":90.0}
@@ -427,7 +410,7 @@ Neither simulation endpoint depends on XMatcher search assets.
427
410
 
428
411
  ## 8. PDF Reporter peak assignments
429
412
 
430
- CLI endpoint: `pdfreporter-analyses`. Request for `POST /v1/pdfreporter/analyses`:
413
+ Operation: `pdfreporter-analyses`. Pass this request through `--data`:
431
414
 
432
415
  ```json
433
416
  {
@@ -462,9 +445,8 @@ The response includes per-phase theory tables in `phases`, flattened theory in
462
445
  rasterization dependencies are unavailable.
463
446
  Peak statuses are `unmatched`, `unique`, `ambiguous`, and `manual`.
464
447
 
465
- CLI endpoint: `pdfreporter-assignments`. For
466
- `POST /v1/pdfreporter/analyses/assignments`, resubmit the complete analysis input
467
- and add this field:
448
+ Operation: `pdfreporter-assignments`. Resubmit the complete analysis input through
449
+ `--data` and add this field:
468
450
 
469
451
  ```json
470
452
  {"selections":{"38.45|0":"0:0","30.05|0":"none"}}
@@ -500,7 +482,11 @@ processing settings, not additional request fields.
500
482
 
501
483
  ### Basic job submission
502
484
 
503
- `POST /v1/refinement-jobs` requires `Idempotency-Key` with 8–200 characters:
485
+ Operations: `refinement-fullprof`, `refinement-gsasii`, or `refinement-wpem`.
486
+ Pass `Idempotency-Key` through `--headers`, with 8–200 characters. The example
487
+ submits GSAS-II; select the corresponding operation and explicit `backends`
488
+ value for FullProf or PyXplore. Submission and cancellation require the user's
489
+ authorisation for that action.
504
490
 
505
491
  ```text
506
492
  delta-cli science invoke --tool xrd --endpoint refinement-gsasii `
@@ -568,24 +554,20 @@ in `summary.wpem_evidence`.
568
554
  preserve_source=true. This mode prohibits corrected_pattern,
569
555
  provenance_manifest, and basic-mode cycles/refine switches.
570
556
 
571
- Request for `POST /v1/refinement-jobs`, with an idempotency header:
557
+ Submit with `--endpoint refinement-gsasii`, business JSON in `--data`, and the
558
+ idempotency key in `--headers`:
572
559
 
573
- ```json
574
- {
575
- "schema_version":1,
576
- "radiation_profile":"CuKa",
577
- "refinement_pattern":{"observed_pattern":{"artifact_id":"art_<original>","sha256":"<sha256>"}},
578
- "phases":[{"phase_index":1,"name":"phase","cif":{"artifact_id":"art_<cif>","sha256":"<sha256>"}}],
579
- "wavelengths_angstrom":[1.540593,1.544414],
580
- "backends":["gsasii"],
581
- "options":{"timeout_seconds":900,"gsasii":{"workflow_mode":"gsas-report-initial-v1"}}
582
- }
560
+ ```text
561
+ delta-cli science invoke --tool xrd --endpoint refinement-gsasii `
562
+ --data '{"schema_version":1,"radiation_profile":"CuKa","refinement_pattern":{"observed_pattern":{"artifact_id":"art_<original>","sha256":"<sha256>"}},"phases":[{"phase_index":1,"name":"phase","cif":{"artifact_id":"art_<cif>","sha256":"<sha256>"}}],"wavelengths_angstrom":[1.540593,1.544414],"backends":["gsasii"],"options":{"timeout_seconds":900,"gsasii":{"workflow_mode":"gsas-report-initial-v1"}}}' `
563
+ --headers '{"Idempotency-Key":"<stable-unique-key>"}'
583
564
  ```
584
565
 
585
566
  Optional `recipe` controls single-phase baseline/candidates, multiphase baseline,
586
567
  physical bounds, selection rules, and residual peak definitions. Omission uses
587
- the backend default recipe. Complete recipe types are defined in OpenAPI and
588
- the GSAS reference. The official scoring implementation is pinned by version
568
+ the backend default recipe. Only supply a custom recipe when the current
569
+ service schema defines its fields; do not guess nested recipe fields.
570
+ The official scoring implementation is pinned by version
589
571
  and module SHA-256; callers cannot replace it.
590
572
 
591
573
  Report mode accepts a finite nonnegative `ka2_ka1_intensity_ratio` for doublets.
@@ -608,12 +590,13 @@ establish calibration.
608
590
 
609
591
  ### Acceptance, queries, and cancellation
610
592
 
611
- Successful submission returns HTTP 202 with schema_version, job_id,
612
- status=queued, submitted_at, and links.self/events/artifacts. Location points
613
- to the job query route.
593
+ Successful submission returns business `schema_version`, `job_id`,
594
+ `status=queued`, `submitted_at`, and `links.self/events/artifacts` in CLI `data`.
595
+ This means accepted/queued, not convergence or scientific acceptance. Use the
596
+ returned `job_id` with CLI query operations; do not follow the link URLs directly.
614
597
 
615
598
  The same idempotency key and canonical request reuse the original job.
616
- The same key with a different request returns 409 IDEMPOTENCY_CONFLICT.
599
+ The same key with a different request returns IDEMPOTENCY_CONFLICT.
617
600
  Use a new key for an intentional new calculation. After a timeout or disconnect,
618
601
  retain the original key and investigate whether a job exists before resubmitting.
619
602
 
@@ -635,7 +618,8 @@ delta-cli science invoke --tool xrd --endpoint refinement-job-cancel `
635
618
  Job IDs contain `refjob_` followed by 32 lowercase hexadecimal characters.
636
619
  Event after_seq defaults to 0 and must be nonnegative; limit defaults to 100
637
620
  and accepts 1–500. Pass response next_after_seq for the next page.
638
- Artifact lists are deduplicated by artifact_id; download through the content API.
621
+ Artifact lists are deduplicated by artifact_id; download through
622
+ `xmatcher-artifact-content` with `--path-params '{"artifact_id":"art_<returned-id>"}'`.
639
623
 
640
624
  Cancellation returns the job's current state. Continue querying until a terminal
641
625
  state is reached. Cancelling completed or failed jobs returns JOB_STATE_CONFLICT.
@@ -653,14 +637,14 @@ validity, or scientific acceptance. Preserve null or unknown values for unavaila
653
637
 
654
638
  ## 10. Responses and errors
655
639
 
656
- Compute endpoints generally return business JSON directly, without a common
657
- top-level `ok` or `data` success envelope. Health probes, CLI responses, and
658
- gateway aggregate health endpoints each use their own response conventions.
640
+ A successful Delta CLI invocation requires exit code 0 and top-level `ok:true`;
641
+ business results are in `data`. XRD business JSON generally has no additional
642
+ common `ok`/`data` envelope. Read the fields documented for the selected operation;
643
+ health probes have their own business `ok`. Decode binary responses using the
644
+ CLI representation and returned media type described in section 5.
659
645
 
660
- A successful Delta CLI invocation requires exit code 0 and top-level ok=true;
661
- business results are in data. Decode binary responses according to Content-Type.
662
-
663
- Compute error response:
646
+ The CLI reports failures in its top-level `error`. Native business-error details,
647
+ when exposed by the CLI, may have this shape:
664
648
 
665
649
  ```json
666
650
  {
@@ -670,7 +654,9 @@ Compute error response:
670
654
  }
671
655
  ```
672
656
 
673
- Gateway-generated errors include error and request_id but may omit schema_version.
657
+ Gateway-generated business errors may omit schema_version. Preserve the CLI's
658
+ error classification and any returned native details; do not infer success from
659
+ a nested field or bypass the CLI to retrieve an upstream response.
674
660
 
675
661
  | Common error | Meaning / action |
676
662
  | --- | --- |
@@ -683,22 +669,20 @@ Gateway-generated errors include error and request_id but may omit schema_versio
683
669
  | REFINEMENT_LINEAGE_INVALID / INSTRUMENT_INVALID | Invalid provenance, source preservation, or instrument data |
684
670
  | IDEMPOTENCY_CONFLICT / JOB_NOT_FOUND / JOB_STATE_CONFLICT | Conflicting key, missing job, or operation incompatible with job state |
685
671
  | REDIS_UNAVAILABLE / XMATCHER_TIMEOUT | Queue unavailable or matching wait timeout |
686
- | UPSTREAM_UNAVAILABLE / NOT_FOUND | Chemistry gateway connection failure or route not exposed |
672
+ | UPSTREAM_UNAVAILABLE / NOT_FOUND | Upstream unavailable or operation not exposed; report the original CLI error |
687
673
 
688
- HTTP 429 responses may include Retry-After. Proxy errors such as Endpoint is
674
+ Rate-limit failures may include Retry-After. Proxy errors such as Endpoint is
689
675
  disabled and TIER_CONCURRENCY_EXCEEDED are separate from native compute errors.
690
676
  Preserve returned code, message, details, warnings, and request_id. Do not switch
691
677
  endpoints, guess parameters, or replace failed business results with local algorithms.
692
678
 
693
- ## 11. Contracts and references
694
-
695
- - [Registered XRD tool](http://8.141.101.94:8001/api/v1/tools/30)
696
- - [Registered XRD endpoint catalogue](http://8.141.101.94:8001/api/v1/tools/30/endpoints)
697
- - [Registry proxy OpenAPI](http://8.141.101.94:8001/openapi.json)
698
- - [Compute OpenAPI](xrd-cloud-compute-handoff/contracts/openapi.yaml)
699
- - [Compute routes](xrd-cloud-compute-handoff/src/xrd_cloud_compute/api.py)
700
- - [Compute request and response models](xrd-cloud-compute-handoff/src/xrd_cloud_compute/models.py)
701
- - [Compute runtime and input validation](xrd-cloud-compute-handoff/src/xrd_cloud_compute/runtime.py)
702
- - [Chemistry gateway allowlist](delta-sandbox-server/api_server/api/chem_xrd.py) and [forwarding implementation](delta-sandbox-server/api_server/server/xrd_service_client.py)
703
- - [GSAS-II reference](xrd-cloud-compute-handoff/docs/GSASII_REFINEMENT_API_20261012.md)
704
- - [PyXplore reference](xrd-cloud-compute-handoff/docs/PYXPLORE_API_20261010.md)
679
+ ## 11. Contract discovery
680
+
681
+ Use `delta-cli science endpoints list xrd` when this reference is missing an
682
+ operation or conflicts with the deployed catalogue. Use only exact returned
683
+ names. If the catalogue does not provide enough schema to construct a request,
684
+ report the missing contract rather than guessing parameters or service paths.
685
+
686
+ See [Delta Science](../SKILL.md) for shared CLI authentication, response,
687
+ retry, and cross-tool rules. The direct `gsasii` tool is a separate contract;
688
+ its operation names must not be substituted for `xrd` refinement operations.