claimtrace 0.1.0__tar.gz

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 (62) hide show
  1. claimtrace-0.1.0/LICENSE +21 -0
  2. claimtrace-0.1.0/PKG-INFO +497 -0
  3. claimtrace-0.1.0/README.md +459 -0
  4. claimtrace-0.1.0/pyproject.toml +85 -0
  5. claimtrace-0.1.0/setup.cfg +4 -0
  6. claimtrace-0.1.0/src/claimtrace/__init__.py +19 -0
  7. claimtrace-0.1.0/src/claimtrace/__main__.py +5 -0
  8. claimtrace-0.1.0/src/claimtrace/_finite.py +23 -0
  9. claimtrace-0.1.0/src/claimtrace/_simple_yaml.py +184 -0
  10. claimtrace-0.1.0/src/claimtrace/api.py +368 -0
  11. claimtrace-0.1.0/src/claimtrace/cli.py +1657 -0
  12. claimtrace-0.1.0/src/claimtrace/completion.py +1631 -0
  13. claimtrace-0.1.0/src/claimtrace/constants.py +13 -0
  14. claimtrace-0.1.0/src/claimtrace/errors.py +21 -0
  15. claimtrace-0.1.0/src/claimtrace/export/__init__.py +5 -0
  16. claimtrace-0.1.0/src/claimtrace/export/directory.py +223 -0
  17. claimtrace-0.1.0/src/claimtrace/export/experimental/__init__.py +2 -0
  18. claimtrace-0.1.0/src/claimtrace/export/experimental/datacite.py +19 -0
  19. claimtrace-0.1.0/src/claimtrace/export/experimental/ro_crate.py +22 -0
  20. claimtrace-0.1.0/src/claimtrace/export/readme.py +705 -0
  21. claimtrace-0.1.0/src/claimtrace/export/zip.py +23 -0
  22. claimtrace-0.1.0/src/claimtrace/importers/__init__.py +17 -0
  23. claimtrace-0.1.0/src/claimtrace/importers/base.py +96 -0
  24. claimtrace-0.1.0/src/claimtrace/importers/chimerax.py +953 -0
  25. claimtrace-0.1.0/src/claimtrace/importers/directory.py +43 -0
  26. claimtrace-0.1.0/src/claimtrace/importers/experimental/__init__.py +2 -0
  27. claimtrace-0.1.0/src/claimtrace/importers/experimental/chimerax.py +64 -0
  28. claimtrace-0.1.0/src/claimtrace/importers/experimental/molviewspec.py +76 -0
  29. claimtrace-0.1.0/src/claimtrace/importers/generic.py +42 -0
  30. claimtrace-0.1.0/src/claimtrace/importers/image.py +182 -0
  31. claimtrace-0.1.0/src/claimtrace/importers/molviewspec.py +1330 -0
  32. claimtrace-0.1.0/src/claimtrace/importers/pymol.py +1297 -0
  33. claimtrace-0.1.0/src/claimtrace/models/__init__.py +68 -0
  34. claimtrace-0.1.0/src/claimtrace/models/artifacts.py +5 -0
  35. claimtrace-0.1.0/src/claimtrace/models/provenance.py +5 -0
  36. claimtrace-0.1.0/src/claimtrace/models/semantic_layer.py +566 -0
  37. claimtrace-0.1.0/src/claimtrace/models/validation.py +68 -0
  38. claimtrace-0.1.0/src/claimtrace/package/__init__.py +2 -0
  39. claimtrace-0.1.0/src/claimtrace/package/checksums.py +74 -0
  40. claimtrace-0.1.0/src/claimtrace/package/layout.py +229 -0
  41. claimtrace-0.1.0/src/claimtrace/package/paths.py +102 -0
  42. claimtrace-0.1.0/src/claimtrace/package/registry.py +373 -0
  43. claimtrace-0.1.0/src/claimtrace/package/resources.py +183 -0
  44. claimtrace-0.1.0/src/claimtrace/path_hints.py +22 -0
  45. claimtrace-0.1.0/src/claimtrace/py.typed +1 -0
  46. claimtrace-0.1.0/src/claimtrace/resources/schema/semantic-layer.schema.json +2213 -0
  47. claimtrace-0.1.0/src/claimtrace/resources/schema/validation-report.schema.json +278 -0
  48. claimtrace-0.1.0/src/claimtrace/resources/templates/ligand-binding-pose.yml +48 -0
  49. claimtrace-0.1.0/src/claimtrace/resources/templates/simple-structure-view.yml +32 -0
  50. claimtrace-0.1.0/src/claimtrace/resources/validation/rules.yaml +138 -0
  51. claimtrace-0.1.0/src/claimtrace/schemas.py +29 -0
  52. claimtrace-0.1.0/src/claimtrace/validation/__init__.py +5 -0
  53. claimtrace-0.1.0/src/claimtrace/validation/engine.py +2688 -0
  54. claimtrace-0.1.0/src/claimtrace/validation/findings.py +36 -0
  55. claimtrace-0.1.0/src/claimtrace/validation/rules.py +67 -0
  56. claimtrace-0.1.0/src/claimtrace/visual_semantics.py +394 -0
  57. claimtrace-0.1.0/src/claimtrace.egg-info/PKG-INFO +497 -0
  58. claimtrace-0.1.0/src/claimtrace.egg-info/SOURCES.txt +60 -0
  59. claimtrace-0.1.0/src/claimtrace.egg-info/dependency_links.txt +1 -0
  60. claimtrace-0.1.0/src/claimtrace.egg-info/entry_points.txt +2 -0
  61. claimtrace-0.1.0/src/claimtrace.egg-info/requires.txt +12 -0
  62. claimtrace-0.1.0/src/claimtrace.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shuyu Zhong
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,497 @@
1
+ Metadata-Version: 2.4
2
+ Name: claimtrace
3
+ Version: 0.1.0
4
+ Summary: Traceable review packages for PyMOL, ChimeraX, and MolViewSpec molecular figures.
5
+ Author: Shuyu Zhong
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/GeraltZeroZhong/ClaimTrace
8
+ Project-URL: Repository, https://github.com/GeraltZeroZhong/ClaimTrace
9
+ Project-URL: Issues, https://github.com/GeraltZeroZhong/ClaimTrace/issues
10
+ Keywords: molecular-visualization,scientific-claims,auditability,pymol,chimerax,molviewspec,json-schema
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Typing :: Typed
22
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: pydantic>=2.7
27
+ Requires-Dist: typer>=0.16
28
+ Requires-Dist: rich>=13
29
+ Requires-Dist: jsonschema>=4.22
30
+ Requires-Dist: PyYAML>=6.0.1
31
+ Requires-Dist: Pillow>=10
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=8; extra == "dev"
34
+ Requires-Dist: build>=1.2; extra == "dev"
35
+ Requires-Dist: twine>=5; extra == "dev"
36
+ Requires-Dist: ruff>=0.9; extra == "dev"
37
+ Dynamic: license-file
38
+
39
+ # ClaimTrace
40
+
41
+ Turn a molecular-viewer scene into a clear, self-contained review package.
42
+
43
+ Give ClaimTrace one PyMOL `.pml`, ChimeraX `.cxc`, MolViewSpec `.mvsj`, or
44
+ MolViewSpec `.mvsx` file. It creates an ordinary folder that preserves the
45
+ original scene, lists what the scene contains and references, and gives you an
46
+ editable checklist for recording the figure's message.
47
+
48
+ One scene file is enough to start. You can add a rendered panel, structure,
49
+ map, table, or supporting result later. ClaimTrace reads scene files locally; it
50
+ does not launch the molecular viewer, run scene commands, or download remote
51
+ resources.
52
+
53
+ ## Quick start: create a draft
54
+
55
+ ### 1. Install ClaimTrace
56
+
57
+ ClaimTrace requires Python 3.10 or newer. Install it from PyPI:
58
+
59
+ ```bash
60
+ python -m pip install claimtrace
61
+ claimtrace --version
62
+ ```
63
+
64
+ This works in Bash and PowerShell. A virtual environment is optional, but
65
+ useful if you want to keep ClaimTrace separate from other Python tools.
66
+
67
+ ### 2. Create a package
68
+
69
+ Open a terminal in the folder containing your scene, then run `claimtrace init`.
70
+ For example:
71
+
72
+ ```bash
73
+ claimtrace init "figure_A.pml"
74
+ ```
75
+
76
+ Use the same command with any supported scene format:
77
+
78
+ ```bash
79
+ claimtrace init "figure_A.cxc"
80
+ claimtrace init "figure_A.mvsj"
81
+ claimtrace init "figure_A.mvsx"
82
+ ```
83
+
84
+ ClaimTrace creates `scene-package/`, copies the original scene, records the
85
+ content it can recognize, and writes an `answers.yml` tailored to that scene.
86
+ The terminal prints the paths it created and the next commands to run.
87
+
88
+ | Scene format | What ClaimTrace records |
89
+ | --- | --- |
90
+ | PyMOL `.pml` | Commands, selections, visual operations, camera state, and referenced files |
91
+ | ChimeraX `.cxc` | Common commands, model and selection references, camera and visibility intent, and local or database resources |
92
+ | MolViewSpec `.mvsj` | Scene nodes, snapshots, parameters, resources, metadata, and exact JSON locations |
93
+ | MolViewSpec `.mvsx` | Scene entry, archive members, checksums, embedded resources, snapshots, and scene operations |
94
+
95
+ ### 3. See what ClaimTrace found
96
+
97
+ ```bash
98
+ claimtrace inspect "scene-package"
99
+ ```
100
+
101
+ The report shows the files in the package, recognized scene operations,
102
+ referenced resources, and the first questions that still need your input. A
103
+ command or node that ClaimTrace cannot confidently interpret is preserved with
104
+ its source file and line number or JSON Pointer, so it can still be reviewed.
105
+
106
+ ### 4. Describe the figure
107
+
108
+ Open `scene-package/answers.yml` in a text editor. Start by replacing the two
109
+ claim placeholders:
110
+
111
+ ```yaml
112
+ claim:
113
+ claim_text: Figure 1A shows the highlighted region in the molecular structure.
114
+ figure_ref: Figure 1A
115
+ ```
116
+
117
+ Keep the generated `claim_type`, operation IDs, and reference IDs unchanged.
118
+ If you only have the scene file and no supporting evidence yet, use:
119
+
120
+ ```yaml
121
+ evidence: []
122
+ ```
123
+
124
+ Review the generated `uncertainty` statement as well. Replace its placeholder
125
+ with a caveat you can stand behind, or use `uncertainty: []` when no separate
126
+ caveat applies to a simple descriptive view.
127
+
128
+ If the generated file contains review entries for colors or labels, follow the
129
+ `review_instruction` beside each one. The next section explains the available
130
+ choices.
131
+
132
+ When attached files support the claim, add a short evidence entry. For a simple
133
+ panel reviewed against its render and structure, for example:
134
+
135
+ ```yaml
136
+ evidence:
137
+ - evidence_kind: manual_rationale
138
+ method_name: Author visual review
139
+ result_summary: The rendered panel and attached structure were reviewed together.
140
+ source_artifact_roles: [render_image, structure]
141
+ ```
142
+
143
+ Now check the file:
144
+
145
+ ```bash
146
+ claimtrace complete "scene-package" --check-answers "scene-package/answers.yml"
147
+ ```
148
+
149
+ This command does not modify the package. It tells you what this particular
150
+ scene still needs. Edit the same file and rerun the check until the required
151
+ items are resolved, then apply it:
152
+
153
+ ```bash
154
+ claimtrace complete "scene-package" --answers "scene-package/answers.yml"
155
+ claimtrace validate "scene-package" --mode draft --format text
156
+ ```
157
+
158
+ You now have a usable draft. It can stay in draft mode while you gather the
159
+ final render, source model, or supporting analysis. The rest of this README is
160
+ reference material for completing, replaying, or sharing the package.
161
+
162
+ ## Complete `answers.yml`
163
+
164
+ `answers.yml` connects what ClaimTrace found in the scene with what you intend
165
+ the figure to communicate.
166
+
167
+ ### Main fields
168
+
169
+ | Field | What to record |
170
+ | --- | --- |
171
+ | `claim.claim_text` | The main statement conveyed by the figure or panel |
172
+ | `claim.figure_ref` | The manuscript, slide, or panel label |
173
+ | `evidence[].method_name` | How a linked result, measurement, validation, or review was produced |
174
+ | `evidence[].result_summary` | What the attached result shows and how it supports the claim |
175
+ | `uncertainty[].statement` | A useful caveat, limitation, or alternative explanation |
176
+ | `reuse.license` / `reuse.citation` | Source, license, and citation information when known |
177
+
178
+ You do not need to invent evidence to create a draft. Keep `evidence: []` until
179
+ you have a supporting file or a review note you can describe accurately.
180
+
181
+ ### Review colors, labels, and other visual meanings
182
+
183
+ ClaimTrace adds a `scene_semantics_by_operation` entry when a color, label, or
184
+ other visual choice may carry scientific meaning. Choose the description that
185
+ matches the figure:
186
+
187
+ - Use `user_confirmed_meaning` when the visual choice communicates part of the
188
+ panel's message.
189
+ - Use `user_declared_no_scientific_meaning` when it is only for contrast or
190
+ readability.
191
+ - Use `claim_critical: false` when the operation is unrelated to the claim.
192
+
193
+ For example:
194
+
195
+ ```yaml
196
+ scene_semantics_by_operation:
197
+ - operation_ids: [op:...]
198
+ meaning_status: user_confirmed_meaning
199
+ meaning: Magenta marks the ligand discussed in this panel.
200
+ claim_critical: true
201
+ ```
202
+
203
+ Generated IDs such as `op:...` connect your answer to a specific scene
204
+ operation. Keep them unchanged. `claimtrace inspect "scene-package"` shows the
205
+ original command and source line or JSON Pointer when you need more context.
206
+
207
+ ## Add files and share the package
208
+
209
+ ### Include the files you already have
210
+
211
+ You can add a scene, rendered panel, structure, and supporting result in one
212
+ command. Replace the `.pml` path with any supported scene format:
213
+
214
+ ```bash
215
+ claimtrace init --native "figure_A.pml" --image "figure_A.png" --artifact "model.cif" --artifact "contacts.csv" --out "scene-package"
216
+ ```
217
+
218
+ Repeat `--native`, `--image`, or `--artifact` when a panel uses multiple files.
219
+ Add files that arrive later without recreating the package:
220
+
221
+ ```bash
222
+ claimtrace add-artifact "scene-package" "contacts.csv" --role contact_table
223
+ ```
224
+
225
+ Common roles include `structure`, `map`, `trajectory`, `topology`,
226
+ `contact_table`, `validation_report`, and `evidence_document`.
227
+
228
+ ### Check whether the package is ready to share
229
+
230
+ Archive validation checks the files and context relevant to the claim: source
231
+ data, final render, camera or view state, scene resources, linked evidence, and
232
+ author-reviewed visual meanings.
233
+
234
+ ```bash
235
+ claimtrace validate "scene-package" --mode archive --format text
236
+ ```
237
+
238
+ Treat the output as a to-do list. Once it passes, export a directory or zip:
239
+
240
+ ```bash
241
+ claimtrace export "scene-package" --mode archive --out "scene-package.zip"
242
+ ```
243
+
244
+ Validation modes let the package grow with your work:
245
+
246
+ | Mode | Best used for |
247
+ | --- | --- |
248
+ | `draft` | Writing the claim while files and answers are still arriving |
249
+ | `internal` | A lab or project handoff |
250
+ | `share` | Sending the package to a collaborator or reviewer |
251
+ | `archive` | Creating a durable, self-contained directory or zip |
252
+
253
+ ## Understand what ClaimTrace records
254
+
255
+ ### Scene observations and replay evidence
256
+
257
+ ClaimTrace separates what is present in the scene file from what you confirm by
258
+ running the viewer or reviewing the underlying analysis.
259
+
260
+ | ClaimTrace can read from the scene | Add when available |
261
+ | --- | --- |
262
+ | A reference to `model.cif` or another resource | A successful replay, render, or viewer log |
263
+ | A native selection or selector | Confirmation that the selection is valid and non-empty |
264
+ | Representation, color, label, or camera commands | The final panel and viewer or environment details |
265
+ | A distance or measurement command | The measured value, method, cutoff, units, and interpretation |
266
+ | A render or output path | Evidence that the attached pixels came from this scene and data |
267
+
268
+ `Recognized` means that a command or node was found in the file. After replaying
269
+ a scene, attach a render, log, or environment note when that behavior matters
270
+ to the review.
271
+
272
+ Dynamic content, macros, and commands that cannot be interpreted reliably stay
273
+ visible as items for author review. MolViewSpec files are read as structured
274
+ JSON or as inventoried archives. ClaimTrace checks common required parameters
275
+ and parent relationships for recognized MolViewSpec nodes. For full schema
276
+ validation, use official MolViewSpec tooling. Uncertain content stays visible
277
+ for review.
278
+
279
+ The automatic question set follows the scene content. A displayed ligand alone
280
+ does not trigger binding-pose questions; pocket, binding-site, contact, or
281
+ measurement context is also required. Use `--template` to choose a question set
282
+ explicitly.
283
+
284
+ ### Scientific details worth including
285
+
286
+ Use this table as a starting point and add details required by your method.
287
+
288
+ | Figure content | Context to include |
289
+ | --- | --- |
290
+ | Ligand or binding pose | Ligand and model identity; chain, residue, atom, or selection definition; pose source; contact or distance method, cutoff, and units; relevant protonation, alternate-location, density, docking, or validation caveats |
291
+ | Trajectory or MD-derived view | Topology and trajectory identity; software and version; force field; sampling length and replicas; equilibration and frame-selection rule; analysis definition and uncertainty |
292
+ | Density or potential map | Map identity and type; reconstruction or calculation source; resolution where relevant; contour level and units; fitted model; map-model or method-specific validation |
293
+ | Computed model | Method and version; input, source, or model identifier; confidence and uncertainty measures; relevant validation; wording that distinguishes prediction from experiment |
294
+ | Model comparison | Both source models; alignment or comparison method; selection definition; metric and units; linked result supporting the comparison |
295
+
296
+ Measurement operations are recorded as intent until you supply the measured
297
+ value, method, cutoff, units, and interpretation. A color ramp over a generic
298
+ numeric field also needs context, such as whether an atom `b` field represents
299
+ crystallographic B-factors, AlphaFold pLDDT, or another imported quantity.
300
+
301
+ Passing archive validation means the package passed ClaimTrace's configured
302
+ blocking checks for completeness and traceability. Scientific interpretation
303
+ remains a reviewer judgment, so read the warnings, waivers, non-blocking notes,
304
+ and linked evidence alongside the package.
305
+
306
+ ## Replay and review
307
+
308
+ ### Replay an original scene
309
+
310
+ Exported packages keep the original scene under `native/`. Start the viewer in
311
+ that directory when the scene uses relative paths.
312
+
313
+ | Format | Replay guidance |
314
+ | --- | --- |
315
+ | `.pml` | Start PyMOL in `scene-package/native/` so relative `load` paths resolve |
316
+ | `.cxc` | Start ChimeraX in the same directory so relative `open` paths resolve |
317
+ | `.mvsj` | Open it in a Mol* viewer with MolViewSpec support; a browser may not expose adjacent local files |
318
+ | `.mvsx` | Open the archive directly; embedded relative resources remain inside it |
319
+
320
+ For example:
321
+
322
+ ```bash
323
+ cd "scene-package/native"
324
+ pymol "figure_A.pml"
325
+ ```
326
+
327
+ Or, from the same directory:
328
+
329
+ ```bash
330
+ chimerax "figure_A.cxc"
331
+ ```
332
+
333
+ A local `.mvsj` opened in a browser cannot always access adjacent files. Serve
334
+ the files from URLs or build a standard `.mvsx` when those resources need to
335
+ travel together.
336
+
337
+ A standard `.mvsx` contains a top-level `index.mvsj`. If an archive contains
338
+ exactly one differently named or nested `.mvsj`, ClaimTrace can still read it
339
+ for static review, but reports that it must be rebuilt before standard MVSX
340
+ replay. A referenced file that is missing from the archive must be added at the
341
+ path used by `index.mvsj`; placing a sibling file outside the archive does not
342
+ make it self-contained.
343
+
344
+ An MVSX file is already a viewer archive. A ClaimTrace package adds the figure
345
+ claim, author explanations, supporting files, validation report, and package
346
+ checksums around that viewer archive.
347
+
348
+ PyMOL `.pse` sessions can be attached as additional evidence, but they are not
349
+ one of the four scene formats accepted by `claimtrace init <scene-file>`.
350
+
351
+ ### Review a package you received
352
+
353
+ 1. Extract the zip and open its generated `README.md`.
354
+ 2. Read the claim, evidence, caveats, visual meanings, and open items.
355
+ 3. Open the panel in `renders/` and replay the scene when a viewer is available.
356
+ 4. Use `checksums/sha256.txt` or `claimtrace validate` to check file integrity.
357
+
358
+ `semantic_layer.json` is the complete machine-readable record for deeper
359
+ inspection or downstream tooling.
360
+
361
+ ## Windows, PowerShell, and WSL
362
+
363
+ Native Windows PowerShell and WSL use different path syntax and usually
364
+ different Python environments. Install and run ClaimTrace in the environment
365
+ whose paths you are using.
366
+
367
+ ### Native Windows PowerShell
368
+
369
+ ```powershell
370
+ Set-Location "C:\Users\YourName\Documents\review-visualization"
371
+ claimtrace init ".\figure_A.mvsj"
372
+ ```
373
+
374
+ ### WSL Bash
375
+
376
+ ```bash
377
+ cd "/mnt/c/Users/YourName/Documents/review-visualization"
378
+ claimtrace init "./figure_A.mvsj"
379
+ ```
380
+
381
+ Replace `.mvsj` with `.pml`, `.cxc`, or `.mvsx` in either example. Inside WSL,
382
+ translate `C:\Users\...` to `/mnt/c/Users/...`. Paths stored in a package are
383
+ package-relative, avoiding machine-specific absolute paths in the exported package.
384
+
385
+ To extract and validate a zip in PowerShell:
386
+
387
+ ```powershell
388
+ Expand-Archive -Path ".\scene-package.zip" -DestinationPath ".\scene-package-roundtrip"
389
+ claimtrace validate ".\scene-package-roundtrip" --mode archive --format text
390
+ ```
391
+
392
+ On Linux or WSL, Python can perform the same extraction:
393
+
394
+ ```bash
395
+ python -m zipfile -e "scene-package.zip" "scene-package-roundtrip"
396
+ claimtrace validate "scene-package-roundtrip" --mode archive --format text
397
+ ```
398
+
399
+ ## Command and file reference
400
+
401
+ ### Main commands
402
+
403
+ | Command | Purpose |
404
+ | --- | --- |
405
+ | `claimtrace init <scene-file>` | Create a draft from `.pml`, `.cxc`, `.mvsj`, or `.mvsx` and write a tailored `answers.yml` |
406
+ | `claimtrace inspect <package>` | Show files, scene observations, references, and open questions |
407
+ | `claimtrace complete ... --check-answers ...` | Check an edited answers file without changing the package |
408
+ | `claimtrace complete ... --answers ...` | Apply author context to the semantic layer |
409
+ | `claimtrace add-artifact ...` | Add a supporting file later |
410
+ | `claimtrace validate ...` | Check a draft, handoff, share package, or archive |
411
+ | `claimtrace export ...` | Validate and write a directory or zip |
412
+ | `claimtrace quickstart` | Print the shortest copy-and-paste workflow |
413
+
414
+ Run `claimtrace <command> --help` for command-specific options.
415
+
416
+ ### Package layout
417
+
418
+ ```text
419
+ scene-package/
420
+ answers.yml
421
+ semantic_layer.json
422
+ native/
423
+ renders/
424
+ data/
425
+ evidence/
426
+ semantic/
427
+ checksums/ # added during export
428
+ schema/ # added during export
429
+ README.md # generated for the recipient
430
+ validation_report.json # added during export
431
+ claimtrace-export.json # identifies a completed ClaimTrace export
432
+ ```
433
+
434
+ `semantic_layer.json` is the canonical machine-readable manifest. Exported
435
+ packages add a reader-oriented README, schemas, validation report, and checksum
436
+ inventory.
437
+
438
+ ## Troubleshooting
439
+
440
+ | What you see | What to try |
441
+ | --- | --- |
442
+ | `No matching distribution found for claimtrace` | Check the package name, network connection, Python version, and configured package index. From a source checkout, use `python -m pip install .` |
443
+ | `claimtrace: command not found` | Check the active environment with `python -m pip show claimtrace`, reopen the shell, or run `python -m claimtrace --help` |
444
+ | `Input file not found` | Check the current folder, quote paths containing spaces, and use the path syntax for your current shell |
445
+ | `Output directory already exists` | Choose another `--out` path. Use `--force` only when the target is an existing ClaimTrace package you intend to replace |
446
+ | A referenced local file is unresolved | Add the file with `claimtrace add-artifact`, or rerun `init` with `--artifact` |
447
+ | `Invalid MolViewSpec JSON` | Use the reported line and column, save the file as UTF-8 JSON, and rerun `init` |
448
+ | A PyMOL or ChimeraX scene is not valid UTF-8 | Re-save the script as UTF-8 (a UTF-8 BOM is accepted) and rerun `init` |
449
+ | An item needs author review | Run `claimtrace inspect "scene-package"`, then record whether the item affects the figure in `answers.yml` |
450
+ | Answer checking lists remaining fields | Keep editing the same file and rerun `--check-answers`; the package changes only after you use `--answers` |
451
+ | An MVSX member is missing | Rebuild the `.mvsx` with the file at the path used by `index.mvsj`; an outside sibling cannot satisfy an archive member |
452
+ | ClaimTrace reports a nonstandard MVSX entry | Move or rename the intended scene to top-level `index.mvsj` before viewer replay |
453
+ | Archive validation is not ready | Start with the required items in the report; draft mode remains available while you complete them |
454
+ | An operation ID is unknown | Keep the edited file. Generate `answers.new.yml` for comparison with `claimtrace complete "scene-package" --emit-template > "scene-package/answers.new.yml"` |
455
+
456
+ Useful help commands:
457
+
458
+ ```bash
459
+ claimtrace --help
460
+ claimtrace quickstart
461
+ claimtrace init --help
462
+ claimtrace complete --help
463
+ ```
464
+
465
+ ## Python API and development
466
+
467
+ ### Python API
468
+
469
+ ```python
470
+ from claimtrace import init_package, load_package, validate_package
471
+
472
+ pkg = init_package(
473
+ native="figure_A.pml",
474
+ image="figure_A.png",
475
+ out="scene-package",
476
+ )
477
+ report = validate_package(pkg, mode="draft")
478
+ loaded = load_package("scene-package")
479
+ ```
480
+
481
+ The `native` argument accepts `.pml`, `.cxc`, `.mvsj`, or `.mvsx`. The CLI is
482
+ the most guided route because it creates and explains `answers.yml`; the
483
+ top-level Python functions and `claimtrace.api` expose the same package
484
+ operations for scripts and integrations.
485
+
486
+ ### Development
487
+
488
+ ```bash
489
+ python -m pip install -e '.[dev]'
490
+ python -m pytest
491
+ python -m build
492
+ python -m twine check dist/*
493
+ ```
494
+
495
+ ## License
496
+
497
+ ClaimTrace is released under the MIT License. See `LICENSE` for the full text.