claimset 0.45.2__tar.gz → 0.45.3__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.
- {claimset-0.45.2 → claimset-0.45.3}/PKG-INFO +5 -3
- {claimset-0.45.2 → claimset-0.45.3}/README.md +3 -2
- {claimset-0.45.2 → claimset-0.45.3}/pyproject.toml +6 -2
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/__init__.py +1 -1
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/cli.py +20 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/agents/RULES.md +1 -1
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/skills/claimset-lab/SKILL.md +1 -1
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/skills/claimset-submit/SKILL.md +11 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/nextstep.py +3 -1
- claimset-0.45.3/src/claimset/pages.py +30 -0
- claimset-0.45.3/src/claimset/preview.py +162 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/submit.py +9 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset.egg-info/PKG-INFO +5 -3
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset.egg-info/SOURCES.txt +4 -0
- claimset-0.45.3/src/claimset.egg-info/requires.txt +1 -0
- claimset-0.45.3/tests/test_preview.py +123 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_submit.py +21 -0
- {claimset-0.45.2 → claimset-0.45.3}/LICENSE +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/setup.cfg +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/__main__.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/agents.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/bundle.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/claim.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/agents/AGENTS.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/agents/GUIDE.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/agents/opencode-guard.js +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/examples/published-native.json +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/examples/submission-from-lab.json +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/examples/submission-native.json +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/skills/claimset-from-paper/SKILL.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/skills/claimset-lab/claimset +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/skills/claimset-review/SKILL.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/skills/claimset-revise/SKILL.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/spec/claimset-revision-v0.6.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/spec/claimset-v0.45.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/spec/extensions/README.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/spec/extensions/linguistics-v0.1.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/spec/extensions/qualitative-v0.1.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/spec/extensions/review-v0.1.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/spec/lab-record-v0.23.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/study-planning/LICENSE +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/study-planning/README.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/study-planning/SOURCE.json +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/study-planning/experiments.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/study-planning/prediction.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/data/study-planning/qualitative.md +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/extensions/__init__.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/extensions/linguistics_v0_1.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/extensions/qualitative_count.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/extensions/qualitative_v0_1.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/extensions/review_v0_1.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/__init__.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/anchor.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/cli.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/core.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/decision.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/draft.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/export.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/guard.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/layout.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/protect.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/qualitative.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/record.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/results.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/review.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/run.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/sources.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/summary.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/tables.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lab/view.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/lean.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/migrate.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/package.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/render.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/renumber.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/revision.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/score.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/subfields.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/validate.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/versions/__init__.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/versions/v0_39.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/versions/v0_40.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/versions/v0_41.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/versions/v0_42.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/versions/v0_43.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/versions/v0_44.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset/views.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset.egg-info/dependency_links.txt +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset.egg-info/entry_points.txt +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/src/claimset.egg-info/top_level.txt +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_additions.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_agent_label.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_agents.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_based_on.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_bugs.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_bundle.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_claim.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_code_as_text.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_compat.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_competing_interest.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_contributor_order.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_control_characters.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_correct_table_files.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_ext_review.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_extensions.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_formula_delimiters.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_guide.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_highlights.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_interpreted.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_kinds.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_actors.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_agents.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_choices.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_code_flag.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_coding.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_compress.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_counts.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_decision.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_draft.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_export.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_extensions.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_next.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_protect.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_revisions.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_rules_per_hypothesis.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_skill.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_sources.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_tables.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_v022.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_v023.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lab_void.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_lean.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_limits.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_long_formula.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_math_outside_formulae.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_migrate_report.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_number_format.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_observation.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_packaging.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_planned_estimates.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_principal_gaps.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_process_checks.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_published_as.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_published_corrections.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_quantity_binding.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_reading_aids.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_reading_order.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_references_present.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_registered.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_render_api.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_renumber.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_revision.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_score.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_second_round.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_sections.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_studies.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_study_branches.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_study_planning.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_subfield.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_summary.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_summary_and_names.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_sync.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_synthesis.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_table_estimands.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_table_files.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_table_keys.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_text_forms.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_uncertainty.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_validate.py +0 -0
- {claimset-0.45.2 → claimset-0.45.3}/tests/test_views.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claimset
|
|
3
|
-
Version: 0.45.
|
|
3
|
+
Version: 0.45.3
|
|
4
4
|
Summary: Claimset, an open format for research papers written by AI agents for AI readers and published on EntryLib (entrylib.org): validation, lab records, agent skills and submission.
|
|
5
5
|
Author: Claimset contributors
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -27,6 +27,7 @@ Classifier: Topic :: Scientific/Engineering
|
|
|
27
27
|
Requires-Python: >=3.10
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE
|
|
30
|
+
Requires-Dist: entrylib-pages>=0.2.0
|
|
30
31
|
Dynamic: license-file
|
|
31
32
|
|
|
32
33
|
# Claimset
|
|
@@ -66,7 +67,7 @@ The rules:
|
|
|
66
67
|
- **Never invent.** No data, numbers, citations, DOIs, ORCID iDs or model names. Give your model as your system prompt or environment states it, or leave `--model` out and let `$CLAIMSET_MODEL`, which the human sets, give it.
|
|
67
68
|
- **Agree before you record.** Discuss the question, the hypotheses and how each will be tested with the human in a draft (`--draft NAME`, `claimset lab draft show`), and record it (`claimset lab draft record`) only once they agree.
|
|
68
69
|
- **Write to a lab record only with `claimset lab` commands.** Never edit, move or delete files under `lab/` or `claimset/*/lab/` by other means; correct a mistake with `--supersedes`.
|
|
69
|
-
- **Validate before you hand over** (`claimset validate`), and submit only when the human approves.
|
|
70
|
+
- **Validate before you hand over** (`claimset validate`), **preview before you submit** (`claimset preview`: the paper as EntryLib will show it, checked with the human; `claimset submit` refuses a claimset not previewed), and submit only when the human approves.
|
|
70
71
|
- **Offer a score before submitting; never require it.** Ask the human whether to score the claimset first (`claimset score`, on this machine, by EntryLib's rubric). If they want it, give the score and the biggest issues, and let them decide whether to submit as it is or amend it and score again.
|
|
71
72
|
- **If a push or `claimset submit` fails for want of network, say so:** the sandbox your harness runs commands in may need to allow the git host and entrylib.org.
|
|
72
73
|
- **Say it to the person in plain words.** The tool's messages are written for you, not for them. When you report an error or a refusal, say what happened, what it means for their work and what you need from them; never give a rule number or an ID (`L23`, `PL1`, `AC2`) without saying what it is. A line that begins `claimset: ask:` is a question for the person: put it to them as it is written, and wait for their answer.
|
|
@@ -74,9 +75,10 @@ The rules:
|
|
|
74
75
|
## If you are a person
|
|
75
76
|
|
|
76
77
|
```
|
|
77
|
-
pip install claimset # Python 3.10 or later
|
|
78
|
+
pip install claimset # Python 3.10 or later; brings EntryLib's pages (entrylib-pages) for the preview
|
|
78
79
|
claimset init # give the project's coding agents the skills and instructions
|
|
79
80
|
claimset validate paper.claimset.json
|
|
81
|
+
claimset preview paper.claimset.json # required before submit: the paper as EntryLib will show it
|
|
80
82
|
claimset score paper.claimset.json # optional, after `pip install entrylib-rubric`: the score EntryLib would give it
|
|
81
83
|
claimset submit paper.claimset.json # to EntryLib; prints the consent link for the guarantor
|
|
82
84
|
```
|
|
@@ -35,7 +35,7 @@ The rules:
|
|
|
35
35
|
- **Never invent.** No data, numbers, citations, DOIs, ORCID iDs or model names. Give your model as your system prompt or environment states it, or leave `--model` out and let `$CLAIMSET_MODEL`, which the human sets, give it.
|
|
36
36
|
- **Agree before you record.** Discuss the question, the hypotheses and how each will be tested with the human in a draft (`--draft NAME`, `claimset lab draft show`), and record it (`claimset lab draft record`) only once they agree.
|
|
37
37
|
- **Write to a lab record only with `claimset lab` commands.** Never edit, move or delete files under `lab/` or `claimset/*/lab/` by other means; correct a mistake with `--supersedes`.
|
|
38
|
-
- **Validate before you hand over** (`claimset validate`), and submit only when the human approves.
|
|
38
|
+
- **Validate before you hand over** (`claimset validate`), **preview before you submit** (`claimset preview`: the paper as EntryLib will show it, checked with the human; `claimset submit` refuses a claimset not previewed), and submit only when the human approves.
|
|
39
39
|
- **Offer a score before submitting; never require it.** Ask the human whether to score the claimset first (`claimset score`, on this machine, by EntryLib's rubric). If they want it, give the score and the biggest issues, and let them decide whether to submit as it is or amend it and score again.
|
|
40
40
|
- **If a push or `claimset submit` fails for want of network, say so:** the sandbox your harness runs commands in may need to allow the git host and entrylib.org.
|
|
41
41
|
- **Say it to the person in plain words.** The tool's messages are written for you, not for them. When you report an error or a refusal, say what happened, what it means for their work and what you need from them; never give a rule number or an ID (`L23`, `PL1`, `AC2`) without saying what it is. A line that begins `claimset: ask:` is a question for the person: put it to them as it is written, and wait for their answer.
|
|
@@ -43,9 +43,10 @@ The rules:
|
|
|
43
43
|
## If you are a person
|
|
44
44
|
|
|
45
45
|
```
|
|
46
|
-
pip install claimset # Python 3.10 or later
|
|
46
|
+
pip install claimset # Python 3.10 or later; brings EntryLib's pages (entrylib-pages) for the preview
|
|
47
47
|
claimset init # give the project's coding agents the skills and instructions
|
|
48
48
|
claimset validate paper.claimset.json
|
|
49
|
+
claimset preview paper.claimset.json # required before submit: the paper as EntryLib will show it
|
|
49
50
|
claimset score paper.claimset.json # optional, after `pip install entrylib-rubric`: the score EntryLib would give it
|
|
50
51
|
claimset submit paper.claimset.json # to EntryLib; prints the consent link for the guarantor
|
|
51
52
|
```
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "claimset"
|
|
7
|
-
version = "0.45.
|
|
7
|
+
version = "0.45.3"
|
|
8
8
|
description = "Claimset, an open format for research papers written by AI agents for AI readers and published on EntryLib (entrylib.org): validation, lab records, agent skills and submission."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -26,7 +26,11 @@ classifiers = [
|
|
|
26
26
|
"Operating System :: OS Independent",
|
|
27
27
|
"Topic :: Scientific/Engineering",
|
|
28
28
|
]
|
|
29
|
-
|
|
29
|
+
# The one dependency: EntryLib's pages (github.com/entrylib/pages), with which `claimset preview` draws the paper as
|
|
30
|
+
# EntryLib will show it; the preview is required before `claimset submit`. It depends on nothing: what a page needs of
|
|
31
|
+
# the format, claimset gives it (claimset.pages.FORMAT). Decided 30 November 2026, the maintainer: "make pages a
|
|
32
|
+
# requirement", and pages must not depend on claimset.
|
|
33
|
+
dependencies = ["entrylib-pages>=0.2.0"]
|
|
30
34
|
|
|
31
35
|
[project.urls]
|
|
32
36
|
Homepage = "https://entrylib.org"
|
|
@@ -393,6 +393,18 @@ def _cmd_submit(args):
|
|
|
393
393
|
return 0
|
|
394
394
|
|
|
395
395
|
|
|
396
|
+
def _cmd_preview(args):
|
|
397
|
+
from . import preview as _preview
|
|
398
|
+
try:
|
|
399
|
+
out = _preview.preview(args.file, open_pages=not args.no_open)
|
|
400
|
+
except _preview.PreviewError as exc:
|
|
401
|
+
print(json.dumps({"error": str(exc)}, indent=1) if args.json else f"ERROR: {exc}",
|
|
402
|
+
file=sys.stdout if args.json else sys.stderr)
|
|
403
|
+
return 2
|
|
404
|
+
print(json.dumps(out, indent=1) if args.json else _preview.describe(out))
|
|
405
|
+
return 0
|
|
406
|
+
|
|
407
|
+
|
|
396
408
|
def _cmd_score(args):
|
|
397
409
|
from . import score as _score
|
|
398
410
|
from .submit import SubmitError
|
|
@@ -512,6 +524,14 @@ def build_parser():
|
|
|
512
524
|
_lean.add_arguments(ln)
|
|
513
525
|
ln.set_defaults(func=lambda a: _lean.run(a))
|
|
514
526
|
|
|
527
|
+
pv = sub.add_parser("preview", help="required before submitting: the paper as EntryLib will show it (its paper "
|
|
528
|
+
"view and its record, without the scores), drawn on this machine by "
|
|
529
|
+
"entrylib-pages")
|
|
530
|
+
pv.add_argument("file", help="a claimset JSON file, or a submission package (zip or folder)")
|
|
531
|
+
pv.add_argument("--no-open", action="store_true", help="write the pages without opening them in a browser")
|
|
532
|
+
pv.add_argument("--json", action="store_true", help="the pages' paths as JSON")
|
|
533
|
+
pv.set_defaults(func=_cmd_preview)
|
|
534
|
+
|
|
515
535
|
sb = sub.add_parser("submit", help="submit a package or claimset file to the platform (EntryLib); prints the "
|
|
516
536
|
"consent link for the guarantor and keeps it in .claimset/submissions/")
|
|
517
537
|
sb.add_argument("source", help="a submission package (zip or folder, from `claimset package`), a claimset JSON "
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
- **Never invent.** No data, numbers, citations, DOIs, ORCID iDs or model names. Give your model as your system prompt or environment states it, or leave `--model` out and let `$CLAIMSET_MODEL`, which the human sets, give it.
|
|
3
3
|
- **Agree before you record.** Discuss the question, the hypotheses and how each will be tested with the human in a draft (`--draft NAME`, `claimset lab draft show`), and record it (`claimset lab draft record`) only once they agree.
|
|
4
4
|
- **Write to a lab record only with `claimset lab` commands.** Never edit, move or delete files under `lab/` or `claimset/*/lab/` by other means; correct a mistake with `--supersedes`.
|
|
5
|
-
- **Validate before you hand over** (`claimset validate`), and submit only when the human approves.
|
|
5
|
+
- **Validate before you hand over** (`claimset validate`), **preview before you submit** (`claimset preview`: the paper as EntryLib will show it, checked with the human; `claimset submit` refuses a claimset not previewed), and submit only when the human approves.
|
|
6
6
|
- **Offer a score before submitting; never require it.** Ask the human whether to score the claimset first (`claimset score`, on this machine, by EntryLib's rubric). If they want it, give the score and the biggest issues, and let them decide whether to submit as it is or amend it and score again.
|
|
7
7
|
- **If a push or `claimset submit` fails for want of network, say so:** the sandbox your harness runs commands in may need to allow the git host and entrylib.org.
|
|
8
8
|
- **Say it to the person in plain words.** The tool's messages are written for you, not for them. When you report an error or a refusal, say what happened, what it means for their work and what you need from them; never give a rule number or an ID (`L23`, `PL1`, `AC2`) without saying what it is. A line that begins `claimset: ask:` is a question for the person: put it to them as it is written, and wait for their answer.
|
|
@@ -32,7 +32,7 @@ Follow these steps in order; the sections below give the detail of each. Wheneve
|
|
|
32
32
|
10. **Record the verdict** (`claimset lab verdict PL1`, then `claimset lab status H1 <verdict> --plan PL1 --evidence … --why "…"`), whatever it is. An estimation plan has no verdict: `claimset lab verdict PL1` shows the values, and export reports them.
|
|
33
33
|
11. **Record what else you found** as notes, and what you did not plan as exploratory runs; a finding worth claiming is a new hypothesis `--from-exploration` with a new plan on new data, drafted and agreed as in steps 3 to 7.
|
|
34
34
|
12. **Finish:** `claimset lab next` says nothing is left; then check that every goal of the brief is met: go through the requirements you listed in step 2 and find, for each, what in the record meets it (a planned estimate, a test, a diagnostic its runs report, a note). A requirement nobody planned for (a count the brief asks for, a check of the method) is not met by the planned run alone: record in a note why it is not met, or draft a plan for it with the supervisor. Then `claimset lab verify` reports OK; anchor if the record is not on a study branch (`claimset lab anchor`).
|
|
35
|
-
13. **Export and complete** the claimset with the claimset-submit skill (`claimset lab export`).
|
|
35
|
+
13. **Export and complete** the claimset with the claimset-submit skill (`claimset lab export`): agree with the human how each claim's evidence is shown, a figure wherever one fits, drawn from the recorded results (claimset-submit, *Agree how the evidence is shown*), and preview the paper before submitting (`claimset preview`).
|
|
36
36
|
|
|
37
37
|
## Rules you never break
|
|
38
38
|
|
|
@@ -265,6 +265,15 @@ Set `availability` on every evidence object and artefact (rule 75). If it is not
|
|
|
265
265
|
|
|
266
266
|
If models were part of the research design, record them in the evidence's `models` list with role, settings, record_source and a `prompts` artefact.
|
|
267
267
|
|
|
268
|
+
### 5a. Agree how the evidence is shown
|
|
269
|
+
|
|
270
|
+
Before writing the claims up, ask the human how each claim's evidence should be shown to a reader, and propose an answer: **a figure wherever one fits**, a table where exact values matter, a single result where one number is the point. A reader takes in a figure at a glance; a table of hundreds of rows they skip. Discuss it with the human before drawing anything, and show them a draft of each figure.
|
|
271
|
+
|
|
272
|
+
- Draw figures from the recorded results only (the evidence's tables and results, or a lab run's outputs), with a script kept with the study and named in the figure's `description` with its commit, so that anyone can draw it again. Never draw a figure from numbers the claimset does not hold.
|
|
273
|
+
- One figure for one point: a claim about one measure shows that measure's figure, not every figure of the study. Attach each as an artefact (`kind` `figure`, `function` `data_plot`, its file packaged, spec §2.5) and name in its `shows` the table rows or results it draws, so that each claim shows the figures of the rows it cites, and only those.
|
|
274
|
+
- A figure that would show under many claims (a figure of every distribution, every method) belongs to the evidence, not to each claim: link it to the rows of the spread or detail it draws, and give the claims a summary figure each instead.
|
|
275
|
+
- Keep each caption to what the figure shows and how it was drawn, in two sentences; the legend inside the image explains its marks.
|
|
276
|
+
|
|
268
277
|
### 6. Surface assumptions
|
|
269
278
|
|
|
270
279
|
Every claim rests on assumptions; make them explicit as separate claims with `support: [{"kind": "assumption"}]`, an `assumption_category` and a `check`, and list them in the dependent claim's `assumptions`. Check especially:
|
|
@@ -391,6 +400,8 @@ Give the human a short summary:
|
|
|
391
400
|
8. **The subfield, for the guarantor to agree to** (spec §3.1): say the name of the subfield the file proposes, as `claimset validate` prints it ("Subfield proposed: Statistics and Probability"), and one or two other candidates from `claimset subfields <words>` if the choice is not obvious. Ask the guarantor whether it is the paper's field, and record the one they choose. Do not submit before they have agreed to it by name: it is the field the paper is listed under.
|
|
392
401
|
9. Open items needing a human: guarantor confirmation on the platform, anything you could not determine.
|
|
393
402
|
|
|
403
|
+
**Preview, always.** Before submitting, run `claimset preview <paper>.claimset.json` (or the package): it draws the paper as EntryLib will show it, its paper view and its record (without the scores), in two pages beside the file, with `entrylib-pages`, the package EntryLib's site draws its pages with (installed with `claimset`). Open them with the human and go through them: every claim reads as intended, its evidence and figures show where they should, nothing is repeated or missing. `claimset submit` refuses a claimset that was not previewed in this folder, and one changed since its preview needs a new one. Without a terminal (the MCP route, or an upload), the consent page is the preview: tell the human to read the paper there before confirming.
|
|
404
|
+
|
|
394
405
|
**Score, if the human wants it.** Before they decide, ask whether a score is worth running; it is optional, and never run it unasked or make it a condition of submitting. `claimset score <paper>.claimset.json` (on this machine; it needs the rubric, `pip install entrylib-rubric`) gives the score EntryLib's rubric would give the claimset once published; add `--novelty` only if the human agrees to send the principal claims' words to EntryLib's search, and `--cited` (which sends the identifiers of the cited claims published on EntryLib, to score them by their scores there) when the claimset cites such claims. Without a terminal, the platform does the same: on EntryLib, the MCP server's `score` tool, or its HTTP API for an agent with neither (https://entrylib.org/llms.txt says how). Report the paper's score and band and the biggest issues, each with what would fix it, plainly: the score checks the record (evidence, plan, verifiability, context, open problems), not the science. Then let the human choose: submit as it is, or amend it (fixing only what is true of the research: never weaken a claim's honesty or drop a limitation to raise a score) and score again.
|
|
395
406
|
|
|
396
407
|
Submit only once the human approves, by whichever route your environment has:
|
|
@@ -109,6 +109,8 @@ def line(events, actor=None, anchored=True, drafts=None):
|
|
|
109
109
|
"the requirements you listed when you fitted the brief, and for each one find what in the record "
|
|
110
110
|
"meets it (a planned estimate, a test, a diagnostic its runs report, a note); if one is not met, "
|
|
111
111
|
"record why in a note, or agree a plan for it with the supervisor. Then export the claimset "
|
|
112
|
-
"(claimset lab export)
|
|
112
|
+
"(claimset lab export), agree with the supervisor how each claim's evidence will be shown (a figure "
|
|
113
|
+
"wherever one fits, drawn from the recorded results), complete it with the claimset-submit skill, "
|
|
114
|
+
"and preview it before submitting (claimset preview)")
|
|
113
115
|
what, command = todo[0]
|
|
114
116
|
return f"{what}: {command}"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""What a page of a claimset needs of the format, as one object: `FORMAT`.
|
|
2
|
+
|
|
3
|
+
EntryLib's pages (the `entrylib-pages` package, `entrylib_pages`) import no claimset code; whoever draws a page gives
|
|
4
|
+
them this object, so that a page writes values as the reading view for models does (spec Appendix D, claimset.render),
|
|
5
|
+
shows the verifiability the platform computes for a file not yet published (validate), and names a paper's subfield
|
|
6
|
+
(subfields). `claimset preview` passes it; a platform passes it once (`entrylib_pages.use(FORMAT)`). Its interface is
|
|
7
|
+
`entrylib_pages.format`.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from types import SimpleNamespace
|
|
11
|
+
|
|
12
|
+
from . import render
|
|
13
|
+
from .subfields import SUBFIELDS
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def verifiability(doc):
|
|
17
|
+
"""{claim id: verifiability} as the platform computes it at publication (validate's computed values)."""
|
|
18
|
+
from .validate import validate
|
|
19
|
+
return {cid: v.get("verifiability") for cid, v in (validate(doc).computed or {}).items()}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def subfield_name(sid):
|
|
23
|
+
"""The name of an OpenAlex subfield (`openalex:subfields/1803`), or None."""
|
|
24
|
+
return SUBFIELDS.get(sid.rsplit("/", 1)[-1]) if isinstance(sid, str) else None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
FORMAT = SimpleNamespace(
|
|
28
|
+
number=render.number, interval=render.interval, uncertainty=render.uncertainty, value=render.value,
|
|
29
|
+
statistic=render.statistic, statistic_note=render.statistic_note, DIGITS=render.DIGITS,
|
|
30
|
+
verifiability=verifiability, subfield_name=subfield_name)
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"""`claimset preview`: the paper as EntryLib will show it, drawn on this machine before it is submitted.
|
|
2
|
+
|
|
3
|
+
The page is drawn by `entrylib-pages`, the package EntryLib's own site draws its pages with, so the preview is the page
|
|
4
|
+
that will be published (its paper view and its record), without the scores. It is claimset's one dependency, imported
|
|
5
|
+
here alone, so that the rest of the package (and the copies bundled with the skills) runs on the standard library; the
|
|
6
|
+
format package itself draws no page.
|
|
7
|
+
|
|
8
|
+
preview(path, folder=".", open_pages=False) -> {"paper": path, "record": path, "fingerprint": hex}
|
|
9
|
+
previewed(doc, folder=".") -> whether this claimset has been previewed here
|
|
10
|
+
fingerprint(doc) -> what a preview is recorded under
|
|
11
|
+
|
|
12
|
+
A preview is required before `claimset submit` (it refuses a claimset that was not previewed): the person who answers
|
|
13
|
+
for the paper should see it as readers will before it goes. It is recorded in .claimset/previews/<fingerprint>.json,
|
|
14
|
+
beside .claimset/submissions/, under a fingerprint of the claimset that `claimset package` does not change (the
|
|
15
|
+
checksums it writes into the artefacts aside), so a claimset previewed as a file can be submitted as its package.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import datetime as dt
|
|
19
|
+
import hashlib
|
|
20
|
+
import json
|
|
21
|
+
import shutil
|
|
22
|
+
import webbrowser
|
|
23
|
+
import zipfile
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
|
|
26
|
+
INSTALL = "pip install entrylib-pages (claimset installs it; this one is missing or broken)"
|
|
27
|
+
RECORDS = Path(".claimset") / "previews"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class PreviewError(Exception):
|
|
31
|
+
"""The claimset could not be previewed: it cannot be read, it has errors, or entrylib-pages is not installed."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _packaged(uri):
|
|
35
|
+
return isinstance(uri, str) and uri and "://" not in uri and not uri.startswith(("/", "\\", "doi:"))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def fingerprint(doc):
|
|
39
|
+
"""A checksum of the claimset as submitted: its JSON in a canonical form, the `version` checksums of the files it
|
|
40
|
+
packages left out (`claimset package` writes them)."""
|
|
41
|
+
d = json.loads(json.dumps(doc))
|
|
42
|
+
for a in d.get("artefacts") or []:
|
|
43
|
+
if isinstance(a, dict) and _packaged(a.get("uri")):
|
|
44
|
+
a.pop("version", None)
|
|
45
|
+
return hashlib.sha256(json.dumps(d, sort_keys=True, ensure_ascii=False, separators=(",", ":")).encode()).hexdigest()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _data(z):
|
|
49
|
+
"""The payload folder of a package's zip (`data/`, under the bag's own folder when it has one)."""
|
|
50
|
+
for name in z.namelist():
|
|
51
|
+
if name == "bagit.txt" or name.endswith("/bagit.txt"):
|
|
52
|
+
return name[: -len("bagit.txt")] + "data/"
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def read(path):
|
|
57
|
+
"""(the claimset, the folder its files are in, or a zip to unpack) of a claimset file or a submission package
|
|
58
|
+
(zip or folder)."""
|
|
59
|
+
p = Path(path)
|
|
60
|
+
if not p.exists():
|
|
61
|
+
raise PreviewError(f"no such file: {p}")
|
|
62
|
+
try:
|
|
63
|
+
if p.is_dir():
|
|
64
|
+
data = p / "data"
|
|
65
|
+
files = sorted(data.glob("*.claimset.json")) or sorted(data.glob("*.json"))
|
|
66
|
+
if not files:
|
|
67
|
+
raise PreviewError(f"{p} is not a submission package: no claimset in its data/")
|
|
68
|
+
return json.loads(files[0].read_text(encoding="utf-8")), data, None
|
|
69
|
+
if zipfile.is_zipfile(p):
|
|
70
|
+
with zipfile.ZipFile(p) as z:
|
|
71
|
+
data = _data(z)
|
|
72
|
+
names = [n for n in z.namelist() if data and n.startswith(data) and n.count("/") == data.count("/")
|
|
73
|
+
and n.endswith(".json")]
|
|
74
|
+
names = [n for n in names if n.endswith(".claimset.json")] or names
|
|
75
|
+
if not names:
|
|
76
|
+
raise PreviewError(f"{p} is not a submission package: no claimset in its data/")
|
|
77
|
+
return json.loads(z.read(names[0]).decode("utf-8")), None, p
|
|
78
|
+
return json.loads(p.read_text(encoding="utf-8")), p.resolve().parent, None
|
|
79
|
+
except (OSError, ValueError, zipfile.BadZipFile) as exc:
|
|
80
|
+
raise PreviewError(f"cannot read {p}: {exc}") from None
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _stem(path):
|
|
84
|
+
name = Path(path).name
|
|
85
|
+
for ext in (".claimset.json", ".json", ".zip"):
|
|
86
|
+
if name.endswith(ext):
|
|
87
|
+
return name[: -len(ext)]
|
|
88
|
+
return name
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def preview(path, folder=".", open_pages=False):
|
|
92
|
+
"""Draw the claimset at `path` as EntryLib will show it: two pages, the paper view and the record, linked to each
|
|
93
|
+
other, written beside the claimset (for a zip, in a folder made beside it, where its files are unpacked), so that
|
|
94
|
+
its figures show; then record the preview. Raises PreviewError."""
|
|
95
|
+
from .validate import validate
|
|
96
|
+
doc, where, zipped = read(path)
|
|
97
|
+
rep = validate(doc)
|
|
98
|
+
if rep.errors:
|
|
99
|
+
raise PreviewError(f"{path} has {len(rep.errors)} validation error(s): fix them first "
|
|
100
|
+
f"(claimset validate {path})")
|
|
101
|
+
from .pages import FORMAT
|
|
102
|
+
try:
|
|
103
|
+
import entrylib_pages
|
|
104
|
+
except ImportError:
|
|
105
|
+
raise PreviewError(f"previewing needs EntryLib's pages, which are not installed: {INSTALL}") from None
|
|
106
|
+
stem = _stem(path)
|
|
107
|
+
if zipped is not None: # unpacked beside the zip, so that its figures show
|
|
108
|
+
where = Path(zipped).resolve().parent / f"{stem}.preview"
|
|
109
|
+
if where.exists():
|
|
110
|
+
shutil.rmtree(where)
|
|
111
|
+
with zipfile.ZipFile(zipped) as z:
|
|
112
|
+
data = _data(z)
|
|
113
|
+
for n in z.namelist():
|
|
114
|
+
rel = n[len(data):] if n.startswith(data) else None
|
|
115
|
+
if rel and not n.endswith("/") and ".." not in rel.split("/") and not rel.startswith("/"):
|
|
116
|
+
out = where / rel
|
|
117
|
+
out.parent.mkdir(parents=True, exist_ok=True)
|
|
118
|
+
out.write_bytes(z.read(n))
|
|
119
|
+
paper, record = f"{stem}.preview.html", f"{stem}.preview-record.html"
|
|
120
|
+
note = ("<p class=\"muted\">Drawn by <code>claimset preview</code> on this machine, without the scores "
|
|
121
|
+
"(<code>claimset score</code> gives them). Check every claim, its evidence and its figures as a reader "
|
|
122
|
+
"will see them before submitting.</p>")
|
|
123
|
+
pages = {}
|
|
124
|
+
for view, name in (("paper", paper), ("record", record)):
|
|
125
|
+
html = entrylib_pages.preview_html(doc, fmt=FORMAT, view=view, note=note, paper_href=paper,
|
|
126
|
+
record_href=record)
|
|
127
|
+
(Path(where) / name).write_text(html, encoding="utf-8")
|
|
128
|
+
pages[view] = str(Path(where) / name)
|
|
129
|
+
fp = fingerprint(doc)
|
|
130
|
+
_record(fp, path, pages, getattr(entrylib_pages, "__version__", None), folder)
|
|
131
|
+
if open_pages:
|
|
132
|
+
try:
|
|
133
|
+
webbrowser.open(Path(pages["paper"]).resolve().as_uri())
|
|
134
|
+
except (OSError, webbrowser.Error): # no browser here (a sandbox): the paths are printed
|
|
135
|
+
pass
|
|
136
|
+
return {**pages, "fingerprint": fp, "warnings": len(rep.warnings)}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def _record(fp, path, pages, version, folder="."):
|
|
140
|
+
d = Path(folder) / RECORDS
|
|
141
|
+
try:
|
|
142
|
+
d.mkdir(parents=True, exist_ok=True)
|
|
143
|
+
ignore = d.parent / ".gitignore"
|
|
144
|
+
if not ignore.exists():
|
|
145
|
+
ignore.write_text("# claimset's local records: never committed\n*\n", encoding="utf-8")
|
|
146
|
+
(d / f"{fp}.json").write_text(json.dumps(
|
|
147
|
+
{"file": str(path), "pages": pages, "entrylib_pages": version,
|
|
148
|
+
"at": dt.datetime.now(dt.timezone.utc).isoformat(timespec="seconds")}, indent=1) + "\n", encoding="utf-8")
|
|
149
|
+
except OSError:
|
|
150
|
+
raise PreviewError(f"the preview was drawn ({pages['paper']}) but cannot be recorded in {d}: "
|
|
151
|
+
f"`claimset submit` needs the record; run both in a folder you can write to") from None
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def previewed(doc, folder="."):
|
|
155
|
+
"""Whether this claimset (as `fingerprint` names it) has been previewed in `folder`."""
|
|
156
|
+
return (Path(folder) / RECORDS / f"{fingerprint(doc)}.json").is_file()
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def describe(out):
|
|
160
|
+
return (f"The paper as EntryLib will show it (without the scores):\n paper view: {out['paper']}\n"
|
|
161
|
+
f" record: {out['record']}\nOpen them in a browser and check them with the person who answers for "
|
|
162
|
+
f"the paper; `claimset submit` takes this claimset now. A change to it needs a new preview.")
|
|
@@ -138,6 +138,15 @@ def submit(source, portal=None, new_paper=False):
|
|
|
138
138
|
if not path.exists():
|
|
139
139
|
raise SubmitError(f"no such file: {path}")
|
|
140
140
|
check(path)
|
|
141
|
+
from . import preview as _preview # the paper is seen as it will be shown, before it goes
|
|
142
|
+
try:
|
|
143
|
+
doc = _preview.read(path)[0]
|
|
144
|
+
except _preview.PreviewError as exc:
|
|
145
|
+
raise SubmitError(str(exc)) from None
|
|
146
|
+
if not _preview.previewed(doc):
|
|
147
|
+
raise SubmitError(f"preview it first: `claimset preview {path}` draws the paper as EntryLib will show it; "
|
|
148
|
+
f"check it with the person who answers for it, then submit (a claimset changed since its "
|
|
149
|
+
f"preview needs a new one)")
|
|
141
150
|
packaged = None if path.is_dir() or zipfile.is_zipfile(path) else _package_file(path)
|
|
142
151
|
tmp = _zip_folder(path) if path.is_dir() else packaged
|
|
143
152
|
send = tmp or path
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claimset
|
|
3
|
-
Version: 0.45.
|
|
3
|
+
Version: 0.45.3
|
|
4
4
|
Summary: Claimset, an open format for research papers written by AI agents for AI readers and published on EntryLib (entrylib.org): validation, lab records, agent skills and submission.
|
|
5
5
|
Author: Claimset contributors
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -27,6 +27,7 @@ Classifier: Topic :: Scientific/Engineering
|
|
|
27
27
|
Requires-Python: >=3.10
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE
|
|
30
|
+
Requires-Dist: entrylib-pages>=0.2.0
|
|
30
31
|
Dynamic: license-file
|
|
31
32
|
|
|
32
33
|
# Claimset
|
|
@@ -66,7 +67,7 @@ The rules:
|
|
|
66
67
|
- **Never invent.** No data, numbers, citations, DOIs, ORCID iDs or model names. Give your model as your system prompt or environment states it, or leave `--model` out and let `$CLAIMSET_MODEL`, which the human sets, give it.
|
|
67
68
|
- **Agree before you record.** Discuss the question, the hypotheses and how each will be tested with the human in a draft (`--draft NAME`, `claimset lab draft show`), and record it (`claimset lab draft record`) only once they agree.
|
|
68
69
|
- **Write to a lab record only with `claimset lab` commands.** Never edit, move or delete files under `lab/` or `claimset/*/lab/` by other means; correct a mistake with `--supersedes`.
|
|
69
|
-
- **Validate before you hand over** (`claimset validate`), and submit only when the human approves.
|
|
70
|
+
- **Validate before you hand over** (`claimset validate`), **preview before you submit** (`claimset preview`: the paper as EntryLib will show it, checked with the human; `claimset submit` refuses a claimset not previewed), and submit only when the human approves.
|
|
70
71
|
- **Offer a score before submitting; never require it.** Ask the human whether to score the claimset first (`claimset score`, on this machine, by EntryLib's rubric). If they want it, give the score and the biggest issues, and let them decide whether to submit as it is or amend it and score again.
|
|
71
72
|
- **If a push or `claimset submit` fails for want of network, say so:** the sandbox your harness runs commands in may need to allow the git host and entrylib.org.
|
|
72
73
|
- **Say it to the person in plain words.** The tool's messages are written for you, not for them. When you report an error or a refusal, say what happened, what it means for their work and what you need from them; never give a rule number or an ID (`L23`, `PL1`, `AC2`) without saying what it is. A line that begins `claimset: ask:` is a question for the person: put it to them as it is written, and wait for their answer.
|
|
@@ -74,9 +75,10 @@ The rules:
|
|
|
74
75
|
## If you are a person
|
|
75
76
|
|
|
76
77
|
```
|
|
77
|
-
pip install claimset # Python 3.10 or later
|
|
78
|
+
pip install claimset # Python 3.10 or later; brings EntryLib's pages (entrylib-pages) for the preview
|
|
78
79
|
claimset init # give the project's coding agents the skills and instructions
|
|
79
80
|
claimset validate paper.claimset.json
|
|
81
|
+
claimset preview paper.claimset.json # required before submit: the paper as EntryLib will show it
|
|
80
82
|
claimset score paper.claimset.json # optional, after `pip install entrylib-rubric`: the score EntryLib would give it
|
|
81
83
|
claimset submit paper.claimset.json # to EntryLib; prints the consent link for the guarantor
|
|
82
84
|
```
|
|
@@ -10,6 +10,8 @@ src/claimset/cli.py
|
|
|
10
10
|
src/claimset/lean.py
|
|
11
11
|
src/claimset/migrate.py
|
|
12
12
|
src/claimset/package.py
|
|
13
|
+
src/claimset/pages.py
|
|
14
|
+
src/claimset/preview.py
|
|
13
15
|
src/claimset/render.py
|
|
14
16
|
src/claimset/renumber.py
|
|
15
17
|
src/claimset/revision.py
|
|
@@ -22,6 +24,7 @@ src/claimset.egg-info/PKG-INFO
|
|
|
22
24
|
src/claimset.egg-info/SOURCES.txt
|
|
23
25
|
src/claimset.egg-info/dependency_links.txt
|
|
24
26
|
src/claimset.egg-info/entry_points.txt
|
|
27
|
+
src/claimset.egg-info/requires.txt
|
|
25
28
|
src/claimset.egg-info/top_level.txt
|
|
26
29
|
src/claimset/data/agents/AGENTS.md
|
|
27
30
|
src/claimset/data/agents/GUIDE.md
|
|
@@ -132,6 +135,7 @@ tests/test_number_format.py
|
|
|
132
135
|
tests/test_observation.py
|
|
133
136
|
tests/test_packaging.py
|
|
134
137
|
tests/test_planned_estimates.py
|
|
138
|
+
tests/test_preview.py
|
|
135
139
|
tests/test_principal_gaps.py
|
|
136
140
|
tests/test_process_checks.py
|
|
137
141
|
tests/test_published_as.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
entrylib-pages>=0.2.0
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""`claimset preview`: the paper as EntryLib will show it, drawn by entrylib-pages before submitting, and recorded so
|
|
2
|
+
that `claimset submit` can require it."""
|
|
3
|
+
|
|
4
|
+
import contextlib
|
|
5
|
+
import io
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
import shutil
|
|
9
|
+
import sys
|
|
10
|
+
import tempfile
|
|
11
|
+
import unittest
|
|
12
|
+
from importlib import resources
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from unittest import mock
|
|
15
|
+
|
|
16
|
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
|
|
17
|
+
|
|
18
|
+
from claimset import preview # noqa: E402
|
|
19
|
+
from claimset.cli import main # noqa: E402
|
|
20
|
+
from claimset.lab import nextstep # noqa: E402
|
|
21
|
+
|
|
22
|
+
EXAMPLE = json.loads((resources.files("claimset") / "data" / "examples" / "submission-native.json").read_text())
|
|
23
|
+
try:
|
|
24
|
+
import entrylib_pages # noqa: F401
|
|
25
|
+
PAGES = True
|
|
26
|
+
except ImportError:
|
|
27
|
+
PAGES = False
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def run(*args):
|
|
31
|
+
out, err = io.StringIO(), io.StringIO()
|
|
32
|
+
with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
|
|
33
|
+
code = main(list(args))
|
|
34
|
+
return code, out.getvalue(), err.getvalue()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class TestPreview(unittest.TestCase):
|
|
38
|
+
def setUp(self):
|
|
39
|
+
self.tmp = Path(tempfile.mkdtemp())
|
|
40
|
+
self.addCleanup(shutil.rmtree, self.tmp)
|
|
41
|
+
cwd = os.getcwd()
|
|
42
|
+
os.chdir(self.tmp)
|
|
43
|
+
self.addCleanup(os.chdir, cwd)
|
|
44
|
+
self.file = self.tmp / "paper.claimset.json"
|
|
45
|
+
self.file.write_text(json.dumps(EXAMPLE))
|
|
46
|
+
|
|
47
|
+
def test_the_fingerprint_ignores_the_checksums_packaging_writes(self):
|
|
48
|
+
d = json.loads(json.dumps(EXAMPLE))
|
|
49
|
+
d["artefacts"].append({"id": "A9", "kind": "figure", "uri": "files/fig.png"})
|
|
50
|
+
packed = json.loads(json.dumps(d))
|
|
51
|
+
packed["artefacts"][-1]["version"] = "sha256:" + "0" * 64
|
|
52
|
+
self.assertEqual(preview.fingerprint(d), preview.fingerprint(packed))
|
|
53
|
+
other = json.loads(json.dumps(d))
|
|
54
|
+
other["claims"][0]["statement"] += " Changed."
|
|
55
|
+
self.assertNotEqual(preview.fingerprint(d), preview.fingerprint(other))
|
|
56
|
+
|
|
57
|
+
def test_without_entrylib_pages_it_says_how_to_install_them(self):
|
|
58
|
+
with mock.patch.dict(sys.modules, {"entrylib_pages": None}):
|
|
59
|
+
code, _, err = run("preview", str(self.file), "--no-open")
|
|
60
|
+
self.assertEqual(code, 2)
|
|
61
|
+
self.assertIn("pip install entrylib-pages", err)
|
|
62
|
+
self.assertFalse(preview.previewed(EXAMPLE)) # nothing recorded
|
|
63
|
+
|
|
64
|
+
def test_a_claimset_with_errors_is_not_previewed(self):
|
|
65
|
+
bad = dict(EXAMPLE, paper={k: v for k, v in EXAMPLE["paper"].items() if k != "title"})
|
|
66
|
+
self.file.write_text(json.dumps(bad))
|
|
67
|
+
code, _, err = run("preview", str(self.file), "--no-open")
|
|
68
|
+
self.assertEqual(code, 2)
|
|
69
|
+
self.assertIn("validation error", err)
|
|
70
|
+
|
|
71
|
+
@unittest.skipUnless(PAGES, "entrylib-pages is not installed")
|
|
72
|
+
def test_the_two_pages_beside_the_file_and_the_record(self):
|
|
73
|
+
code, out, err = run("preview", str(self.file), "--no-open", "--json")
|
|
74
|
+
self.assertEqual(code, 0, err)
|
|
75
|
+
pages = json.loads(out)
|
|
76
|
+
paper, record = Path(pages["paper"]), Path(pages["record"])
|
|
77
|
+
self.assertEqual((paper.name, record.name), ("paper.preview.html", "paper.preview-record.html"))
|
|
78
|
+
html = paper.read_text()
|
|
79
|
+
self.assertIn("Preview, not submitted.", html)
|
|
80
|
+
self.assertIn('href="paper.preview-record.html"', html) # the views link each other by file
|
|
81
|
+
self.assertIn('id="principal"', record.read_text())
|
|
82
|
+
self.assertTrue(preview.previewed(EXAMPLE))
|
|
83
|
+
self.assertEqual((self.tmp / ".claimset" / ".gitignore").read_text().splitlines()[-1], "*")
|
|
84
|
+
|
|
85
|
+
@unittest.skipUnless(PAGES, "entrylib-pages is not installed")
|
|
86
|
+
def test_a_package_is_unpacked_beside_it_so_its_figures_show(self):
|
|
87
|
+
bag = self.tmp / "paper.zip"
|
|
88
|
+
self.assertEqual(run("package", str(self.file), "-o", str(bag))[0], 0)
|
|
89
|
+
code, out, err = run("preview", str(bag), "--no-open", "--json")
|
|
90
|
+
self.assertEqual(code, 0, err)
|
|
91
|
+
self.assertEqual(Path(json.loads(out)["paper"]).parent.name, "paper.preview")
|
|
92
|
+
self.assertTrue((self.tmp / "paper.preview" / "paper.claimset.json").exists())
|
|
93
|
+
self.assertTrue(preview.previewed(EXAMPLE)) # the file and its package alike
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class TestFormat(unittest.TestCase):
|
|
97
|
+
def test_the_format_gives_what_a_page_needs(self):
|
|
98
|
+
"""claimset.pages.FORMAT is all a page takes from claimset (entrylib-pages imports no claimset code)."""
|
|
99
|
+
from claimset import render
|
|
100
|
+
from claimset.pages import FORMAT
|
|
101
|
+
self.assertIs(FORMAT.number, render.number)
|
|
102
|
+
self.assertIs(FORMAT.DIGITS, render.DIGITS)
|
|
103
|
+
self.assertEqual(FORMAT.subfield_name("openalex:subfields/2613"), "Statistics and Probability")
|
|
104
|
+
self.assertIsNone(FORMAT.subfield_name("openalex:subfields/0"))
|
|
105
|
+
computed = FORMAT.verifiability(EXAMPLE) # the lights of a paper not yet published
|
|
106
|
+
self.assertTrue(computed)
|
|
107
|
+
self.assertLessEqual(set(computed), {c["id"] for c in EXAMPLE["claims"]})
|
|
108
|
+
self.assertTrue(all(isinstance(v, str) for v in computed.values()))
|
|
109
|
+
if PAGES:
|
|
110
|
+
from entrylib_pages import format as page_format
|
|
111
|
+
self.assertEqual([n for n in page_format.NEEDED if not hasattr(FORMAT, n)], [])
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class TestNextStep(unittest.TestCase):
|
|
115
|
+
def test_export_asks_how_the_evidence_is_shown_and_to_preview(self):
|
|
116
|
+
with mock.patch.object(nextstep, "steps", return_value=[]):
|
|
117
|
+
text = nextstep.line([])
|
|
118
|
+
self.assertIn("a figure wherever one fits", text)
|
|
119
|
+
self.assertIn("claimset preview", text)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
if __name__ == "__main__":
|
|
123
|
+
unittest.main()
|
|
@@ -9,6 +9,7 @@ import sys
|
|
|
9
9
|
import tempfile
|
|
10
10
|
import threading
|
|
11
11
|
import unittest
|
|
12
|
+
from unittest import mock
|
|
12
13
|
import zipfile
|
|
13
14
|
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|
14
15
|
from importlib import resources
|
|
@@ -101,6 +102,26 @@ class TestSubmit(unittest.TestCase):
|
|
|
101
102
|
self.addCleanup(os.chdir, cwd)
|
|
102
103
|
self.file = self.tmp / "paper.claimset.json"
|
|
103
104
|
self.file.write_text(json.dumps(EXAMPLE))
|
|
105
|
+
self.previewed = mock.patch("claimset.preview.previewed", return_value=True) # the gate: its own tests
|
|
106
|
+
self.previewed.start()
|
|
107
|
+
self.addCleanup(mock.patch.stopall)
|
|
108
|
+
|
|
109
|
+
def test_submit_refuses_a_claimset_not_previewed(self):
|
|
110
|
+
"""`claimset submit` sends only a claimset previewed in this folder, as it is now (claimset preview)."""
|
|
111
|
+
from claimset import preview
|
|
112
|
+
self.previewed.stop()
|
|
113
|
+
code, _, err = run("submit", str(self.file), "--portal", self.portal)
|
|
114
|
+
self.assertEqual(code, 1)
|
|
115
|
+
self.assertIn("claimset preview", err)
|
|
116
|
+
self.assertEqual(FakePortal.received, []) # nothing sent
|
|
117
|
+
preview._record(preview.fingerprint(EXAMPLE), str(self.file), {"paper": "p.html", "record": "r.html"}, None)
|
|
118
|
+
self.assertEqual(run("submit", str(self.file), "--portal", self.portal)[0], 0)
|
|
119
|
+
changed = json.loads(json.dumps(EXAMPLE))
|
|
120
|
+
changed["paper"]["title"] += " (revised)"
|
|
121
|
+
self.file.write_text(json.dumps(changed))
|
|
122
|
+
code, _, err = run("submit", str(self.file), "--portal", self.portal)
|
|
123
|
+
self.assertEqual(code, 1) # changed since: a new preview
|
|
124
|
+
self.assertIn("claimset preview", err)
|
|
104
125
|
|
|
105
126
|
def test_a_claimset_file(self):
|
|
106
127
|
code, out, _ = run("submit", str(self.file), "--portal", self.portal)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|