goldilocks-ml 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.
- goldilocks_ml-0.1.0/.agents/skills/catchup/SKILL.md +62 -0
- goldilocks_ml-0.1.0/.agents/skills/github-cli/SKILL.md +79 -0
- goldilocks_ml-0.1.0/.agents/skills/make-a-pr/SKILL.md +64 -0
- goldilocks_ml-0.1.0/.agents/skills/plan/SKILL.md +63 -0
- goldilocks_ml-0.1.0/.agents/skills/report/SKILL.md +55 -0
- goldilocks_ml-0.1.0/.agents/skills/triage/SKILL.md +48 -0
- goldilocks_ml-0.1.0/.agents/skills/use-uv/SKILL.md +28 -0
- goldilocks_ml-0.1.0/.github/workflows/ci.yml +132 -0
- goldilocks_ml-0.1.0/.github/workflows/docs.yml +56 -0
- goldilocks_ml-0.1.0/.github/workflows/release.yml +64 -0
- goldilocks_ml-0.1.0/.gitignore +34 -0
- goldilocks_ml-0.1.0/AGENTS.md +88 -0
- goldilocks_ml-0.1.0/CHANGELOG.md +38 -0
- goldilocks_ml-0.1.0/LICENSE +28 -0
- goldilocks_ml-0.1.0/PKG-INFO +145 -0
- goldilocks_ml-0.1.0/README.md +110 -0
- goldilocks_ml-0.1.0/deposits/README.md +32 -0
- goldilocks_ml-0.1.0/deposits/k_points/README.md +11 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_distance/README.md +6 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_distance/qrf/README.md +124 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_distance/qrf/manifest.json +36 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_distance/qrf/metadata.json +174 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_distance/qrf/model.json +529 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_index/qrf/README.md +243 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_index/qrf/manifest.json +43 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_index/qrf/metadata.json +164 -0
- goldilocks_ml-0.1.0/deposits/k_points/k_index/qrf/model.json +350 -0
- goldilocks_ml-0.1.0/deposits/metallicity/README.md +12 -0
- goldilocks_ml-0.1.0/deposits/metallicity/is_metal/cgcnn/README.md +132 -0
- goldilocks_ml-0.1.0/deposits/metallicity/is_metal/cgcnn/manifest.json +28 -0
- goldilocks_ml-0.1.0/deposits/metallicity/is_metal/cgcnn/metadata.json +163 -0
- goldilocks_ml-0.1.0/deposits/metallicity/is_metal/cgcnn/model.json +570 -0
- goldilocks_ml-0.1.0/deposits/metallicity/representation/README.md +14 -0
- goldilocks_ml-0.1.0/deposits/metallicity/representation/cgcnn/README.md +99 -0
- goldilocks_ml-0.1.0/deposits/metallicity/representation/cgcnn/manifest.json +26 -0
- goldilocks_ml-0.1.0/deposits/metallicity/representation/cgcnn/metadata.json +177 -0
- goldilocks_ml-0.1.0/deposits/metallicity/representation/cgcnn/model.json +31 -0
- goldilocks_ml-0.1.0/docs/cli-reference.md +77 -0
- goldilocks_ml-0.1.0/docs/deposit-format.md +101 -0
- goldilocks_ml-0.1.0/docs/index.md +46 -0
- goldilocks_ml-0.1.0/docs/inference.md +67 -0
- goldilocks_ml-0.1.0/docs/installation.md +44 -0
- goldilocks_ml-0.1.0/docs/notebooks/k_distance-qrf.ipynb +421 -0
- goldilocks_ml-0.1.0/docs/notebooks/metallicity-cgcnn.ipynb +427 -0
- goldilocks_ml-0.1.0/docs/publishing.md +103 -0
- goldilocks_ml-0.1.0/docs/training/index.md +69 -0
- goldilocks_ml-0.1.0/docs/training/models/hubbard_u/index.md +18 -0
- goldilocks_ml-0.1.0/docs/training/models/index.md +39 -0
- goldilocks_ml-0.1.0/docs/training/models/k_points/index.md +18 -0
- goldilocks_ml-0.1.0/docs/training/models/k_points/k_distance-qrf.md +57 -0
- goldilocks_ml-0.1.0/docs/training/models/k_points/k_index-qrf.md +61 -0
- goldilocks_ml-0.1.0/docs/training/models/magnetism/index.md +18 -0
- goldilocks_ml-0.1.0/docs/training/models/metallicity/index.md +19 -0
- goldilocks_ml-0.1.0/docs/training/models/metallicity/is_metal-cgcnn.md +60 -0
- goldilocks_ml-0.1.0/docs/training/models/metallicity/representation-cgcnn.md +42 -0
- goldilocks_ml-0.1.0/docs/training/protocol.md +160 -0
- goldilocks_ml-0.1.0/docs/training/run-bundle.md +55 -0
- goldilocks_ml-0.1.0/docs/training/your-data.md +83 -0
- goldilocks_ml-0.1.0/docs/troubleshooting.md +51 -0
- goldilocks_ml-0.1.0/mkdocs.yml +76 -0
- goldilocks_ml-0.1.0/protocols/README.md +19 -0
- goldilocks_ml-0.1.0/protocols/k_points/k_distance/qrf/goldilocks_kdist_ultra.v1.toml +60 -0
- goldilocks_ml-0.1.0/protocols/k_points/k_index/qrf/d5ds2_64f16.v1.toml +70 -0
- goldilocks_ml-0.1.0/protocols/metallicity/is_metal/cgcnn/matbench_mp_is_metal.v1.toml +64 -0
- goldilocks_ml-0.1.0/protocols/metallicity/is_metal/cgcnn/matbench_mp_is_metal.v2.toml +69 -0
- goldilocks_ml-0.1.0/protocols/synthetic/classification.toml +41 -0
- goldilocks_ml-0.1.0/protocols/synthetic/regression.toml +38 -0
- goldilocks_ml-0.1.0/pyproject.toml +92 -0
- goldilocks_ml-0.1.0/scripts/matbench_to_snapshot.py +113 -0
- goldilocks_ml-0.1.0/scripts/psdi_kindex_to_snapshot.py +179 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/__init__.py +12 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/artifacts.py +57 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/baselines.py +280 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/cli.py +591 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/console.py +59 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/evaluation.py +588 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/hashing.py +26 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/inference.py +282 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/__init__.py +3 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/__init__.py +8 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_distance/__init__.py +3 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_distance/qrf/__init__.py +9 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_distance/qrf/embedding.py +198 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_distance/qrf/features.py +369 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_distance/qrf/predictor.py +224 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_distance/qrf/trainer.py +610 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_index/__init__.py +3 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_index/qrf/__init__.py +3 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_index/qrf/features.py +256 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/k_points/k_index/qrf/predictor.py +199 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/metallicity/__init__.py +3 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/metallicity/is_metal/__init__.py +3 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/metallicity/is_metal/cgcnn/__init__.py +29 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/metallicity/is_metal/cgcnn/graphs.py +87 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/metallicity/is_metal/cgcnn/predictor.py +171 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/models/metallicity/is_metal/cgcnn/trainer.py +453 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/protocol.py +632 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/psdi.py +390 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/registry.py +260 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/runs.py +281 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/snapshot.py +429 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/splitting.py +167 -0
- goldilocks_ml-0.1.0/src/goldilocks_ml/tabular.py +93 -0
- goldilocks_ml-0.1.0/tests/conftest.py +211 -0
- goldilocks_ml-0.1.0/tests/fixtures/kdist/features.csv +121 -0
- goldilocks_ml-0.1.0/tests/fixtures/kdist/id_prop.csv +120 -0
- goldilocks_ml-0.1.0/tests/fixtures/kdist/manifest.json +25 -0
- goldilocks_ml-0.1.0/tests/fixtures/metallic/features.csv +121 -0
- goldilocks_ml-0.1.0/tests/fixtures/metallic/id_prop.csv +120 -0
- goldilocks_ml-0.1.0/tests/fixtures/metallic/manifest.json +25 -0
- goldilocks_ml-0.1.0/tests/test_cgcnn.py +367 -0
- goldilocks_ml-0.1.0/tests/test_cli.py +633 -0
- goldilocks_ml-0.1.0/tests/test_evaluation.py +439 -0
- goldilocks_ml-0.1.0/tests/test_inference.py +440 -0
- goldilocks_ml-0.1.0/tests/test_kindex_qrf.py +270 -0
- goldilocks_ml-0.1.0/tests/test_kindex_snapshot.py +97 -0
- goldilocks_ml-0.1.0/tests/test_protocol.py +467 -0
- goldilocks_ml-0.1.0/tests/test_psdi.py +542 -0
- goldilocks_ml-0.1.0/tests/test_qrf.py +375 -0
- goldilocks_ml-0.1.0/tests/test_registry.py +305 -0
- goldilocks_ml-0.1.0/tests/test_runs.py +182 -0
- goldilocks_ml-0.1.0/tests/test_snapshot.py +310 -0
- goldilocks_ml-0.1.0/tests/test_splitting.py +267 -0
- goldilocks_ml-0.1.0/uv.lock +3717 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: catchup
|
|
3
|
+
description: Orient yourself at the start of work in goldilocks-ml by checking git state, PRs, issues, milestones, artifacts, and recent progress. Use at session start or when resuming after a break.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Catch up
|
|
7
|
+
|
|
8
|
+
Do not start overlapping work until local and remote state agree.
|
|
9
|
+
|
|
10
|
+
## 1. Local state
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
git status -sb
|
|
14
|
+
git remote -v
|
|
15
|
+
git branch -vv
|
|
16
|
+
git log --oneline --decorate --graph --all -20
|
|
17
|
+
git diff --stat
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Preserve all existing changes. Distinguish real content edits from generated
|
|
21
|
+
files, permission-only changes, experiment output, and large artifacts.
|
|
22
|
+
|
|
23
|
+
## 2. Remote state
|
|
24
|
+
|
|
25
|
+
Use the `github-cli` skill.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
gh pr list --repo stfc/goldilocks-ml --state open --limit 20
|
|
29
|
+
gh issue list --repo stfc/goldilocks-ml --state open --limit 20
|
|
30
|
+
gh issue list --repo stfc/goldilocks-ml --state all --limit 10 \
|
|
31
|
+
--search "sort:updated-desc"
|
|
32
|
+
gh api repos/stfc/goldilocks-ml/milestones
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Read the relevant issue bodies and recent comments. Check whether each open PR
|
|
36
|
+
closes an issue and whether CI exists and passes.
|
|
37
|
+
|
|
38
|
+
## 3. ML-specific state
|
|
39
|
+
|
|
40
|
+
For active model work, identify without exposing secrets:
|
|
41
|
+
|
|
42
|
+
- dataset snapshot/hash and whether it is locally available;
|
|
43
|
+
- model/checkpoint files and whether they are tracked, cached, or missing;
|
|
44
|
+
- the config, seed, split, feature schema, and target contract in use;
|
|
45
|
+
- the last evaluation report and its baseline;
|
|
46
|
+
- external blockers such as PSDI credentials, staging review, or Core contract
|
|
47
|
+
changes.
|
|
48
|
+
|
|
49
|
+
Do not load an untrusted pickle to inspect it. Do not print tokens.
|
|
50
|
+
|
|
51
|
+
## 4. Report
|
|
52
|
+
|
|
53
|
+
Summarize:
|
|
54
|
+
|
|
55
|
+
- current branch and working-tree state;
|
|
56
|
+
- open PRs and active issues;
|
|
57
|
+
- milestones and stale/placeholder candidates;
|
|
58
|
+
- artifact and dataset readiness;
|
|
59
|
+
- discrepancies and the safest next action.
|
|
60
|
+
|
|
61
|
+
If work exists locally but not remotely, preserve and integrate it before
|
|
62
|
+
reimplementing it.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github-cli
|
|
3
|
+
description: Use the gh CLI for GitHub issues, PRs, comments, checks, Actions, and milestones in stfc/goldilocks-ml. Use whenever reading or writing GitHub state from an agent session.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitHub CLI
|
|
7
|
+
|
|
8
|
+
Repository: `stfc/goldilocks-ml`.
|
|
9
|
+
|
|
10
|
+
Use structured `gh` commands with `--json` and `--jq`. Do not scrape GitHub web
|
|
11
|
+
pages. Use `--body-file` for multiline text.
|
|
12
|
+
|
|
13
|
+
## Rules
|
|
14
|
+
|
|
15
|
+
- Never push or merge directly to `main`.
|
|
16
|
+
- PR descriptions are human-authored. An agent never writes or drafts one.
|
|
17
|
+
- Never edit or delete GitHub text authored by someone else; add a comment.
|
|
18
|
+
- Agent-authored issues, comments, and reviews must end with:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
Written by an agent on behalf of <user>.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Inspect
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gh issue list --repo stfc/goldilocks-ml --state open --limit 20 \
|
|
28
|
+
--json number,title,milestone,updatedAt
|
|
29
|
+
gh pr list --repo stfc/goldilocks-ml --state open --limit 20 \
|
|
30
|
+
--json number,title,headRefName,baseRefName,reviewDecision,statusCheckRollup
|
|
31
|
+
gh pr view <N> --repo stfc/goldilocks-ml \
|
|
32
|
+
--json state,mergeStateStatus,isDraft,reviewDecision,baseRefName,headRefName
|
|
33
|
+
gh pr checks <N> --repo stfc/goldilocks-ml
|
|
34
|
+
gh run list --repo stfc/goldilocks-ml --branch <branch>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Use `gh api` for fields not exposed by high-level commands:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
gh api repos/stfc/goldilocks-ml/issues/<N>
|
|
41
|
+
gh api repos/stfc/goldilocks-ml/milestones
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Write safely
|
|
45
|
+
|
|
46
|
+
Fetch existing text before editing text the agent owns. Prefer a new issue
|
|
47
|
+
comment for progress, decisions, verification, and handoff history.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
gh issue comment <N> --repo stfc/goldilocks-ml --body-file /tmp/comment.md
|
|
51
|
+
gh issue create --repo stfc/goldilocks-ml --title "..." --body-file /tmp/issue.md
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
An agent does not run `gh pr create` unless the human supplies the complete PR
|
|
55
|
+
body file. Before any PR operation, verify the current branch and base.
|
|
56
|
+
|
|
57
|
+
## Milestones and sub-issues
|
|
58
|
+
|
|
59
|
+
Every issue needs a milestone. REST milestone updates use the milestone number:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
gh api repos/stfc/goldilocks-ml/issues/<N> --method PATCH -F milestone=<number>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Sub-issue operations require database IDs, not issue numbers:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
CHILD_ID=$(gh api repos/stfc/goldilocks-ml/issues/<child> --jq .id)
|
|
69
|
+
gh api repos/stfc/goldilocks-ml/issues/<parent>/sub_issues \
|
|
70
|
+
--method POST -F sub_issue_id="$CHILD_ID"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Gotchas
|
|
74
|
+
|
|
75
|
+
- `--body-file` replaces or posts exactly what is in the file; inspect it first.
|
|
76
|
+
- A passing check is not proof that the correct dataset, split, or model artifact
|
|
77
|
+
was used; inspect scientific evidence separately.
|
|
78
|
+
- If no CI is configured, state that plainly and rely on documented local
|
|
79
|
+
verification.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: make-a-pr
|
|
3
|
+
description: Prepare tested goldilocks-ml changes for a human to open as a pull request. Use after implementation, evaluation, tests, and self-review are complete.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Make a PR
|
|
7
|
+
|
|
8
|
+
The agent creates a feature branch, commits, pushes, and hands facts to the
|
|
9
|
+
human. The human opens the PR and writes its body.
|
|
10
|
+
|
|
11
|
+
## Preconditions
|
|
12
|
+
|
|
13
|
+
- Work is on `feat/...`, `fix/...`, `docs/...`, `test/...`, or `chore/...`, not
|
|
14
|
+
`main`.
|
|
15
|
+
- One concrete issue exists, has a milestone, and the PR will close it.
|
|
16
|
+
- Code checks pass.
|
|
17
|
+
- Scientific claims have reproducible evidence: dataset hash, split, seed,
|
|
18
|
+
configuration, baseline, metrics, and relevant slices.
|
|
19
|
+
- Released artifacts have manifests, checksums, compatibility versions, and a
|
|
20
|
+
model card where applicable.
|
|
21
|
+
|
|
22
|
+
## Self-review
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git status -sb
|
|
26
|
+
git diff main...HEAD
|
|
27
|
+
git log main..HEAD --oneline
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Check for secrets, large files, private paths, generated experiment state,
|
|
31
|
+
notebooks with outputs, accidental formatting, and unexplained metric changes.
|
|
32
|
+
|
|
33
|
+
Run the checks that exist in the current branch, normally:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv run ruff check src tests
|
|
37
|
+
uv run ruff format --check src tests
|
|
38
|
+
uv run pytest
|
|
39
|
+
uv build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Commit and push
|
|
43
|
+
|
|
44
|
+
Use conventional, imperative commit messages and one logical change per commit.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git push -u origin <branch>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Do not force-push reviewed history unless asked.
|
|
51
|
+
|
|
52
|
+
## Human handoff
|
|
53
|
+
|
|
54
|
+
Provide only:
|
|
55
|
+
|
|
56
|
+
- branch name;
|
|
57
|
+
- `git log main..HEAD --oneline`;
|
|
58
|
+
- `git diff main...HEAD --stat`;
|
|
59
|
+
- checks/evaluations run and their outcomes;
|
|
60
|
+
- artifact/dataset identifiers where relevant;
|
|
61
|
+
- `Closes #N` for the human-authored PR body.
|
|
62
|
+
|
|
63
|
+
Do not draft the PR description and do not run `gh pr create` unless the human
|
|
64
|
+
provides the complete body file.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: Turn a concrete goldilocks-ml feature, model experiment, refactor, or release task into an implementation plan recorded as a GitHub issue. Use before multi-step work or when the user asks for a plan.
|
|
4
|
+
argument-hint: [topic]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Plan work as an issue
|
|
8
|
+
|
|
9
|
+
Use the `github-cli` skill. Search open and recently closed issues before
|
|
10
|
+
creating anything.
|
|
11
|
+
|
|
12
|
+
## Gate
|
|
13
|
+
|
|
14
|
+
Create an issue only when it describes one shippable PR or model release and
|
|
15
|
+
contains:
|
|
16
|
+
|
|
17
|
+
- a concrete problem;
|
|
18
|
+
- evidence/current state;
|
|
19
|
+
- a proposed approach;
|
|
20
|
+
- explicit scope and non-goals;
|
|
21
|
+
- verifiable acceptance criteria;
|
|
22
|
+
- a milestone.
|
|
23
|
+
|
|
24
|
+
Do not create roadmap mirrors, placeholders, decision-only issues, or one issue
|
|
25
|
+
per phase. Put phases and decisions inside the feature issue.
|
|
26
|
+
|
|
27
|
+
For model work, settle or explicitly gate:
|
|
28
|
+
|
|
29
|
+
- dataset snapshot and target/label contract;
|
|
30
|
+
- feature schema and Core compatibility boundary;
|
|
31
|
+
- leakage-resistant split strategy;
|
|
32
|
+
- baseline, primary metrics, and reporting slices;
|
|
33
|
+
- reproducibility inputs (seed, config, dependency versions);
|
|
34
|
+
- artifact bundle, manifest, model card, checksums, and publication target.
|
|
35
|
+
|
|
36
|
+
## Structure
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
## Problem
|
|
40
|
+
|
|
41
|
+
## Evidence and current state
|
|
42
|
+
|
|
43
|
+
## Proposed approach
|
|
44
|
+
|
|
45
|
+
## Scientific and data contract
|
|
46
|
+
|
|
47
|
+
## Scope
|
|
48
|
+
|
|
49
|
+
## Non-goals
|
|
50
|
+
|
|
51
|
+
## Implementation plan
|
|
52
|
+
|
|
53
|
+
## Verification
|
|
54
|
+
|
|
55
|
+
## Acceptance criteria
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
Written by an agent on behalf of <user>.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Write the body to a temporary file, inspect it, then create the issue with
|
|
62
|
+
`--repo stfc/goldilocks-ml --body-file`. Report the new issue URL and any open
|
|
63
|
+
decision that genuinely blocks implementation.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: report
|
|
3
|
+
description: Record goldilocks-ml progress as a GitHub issue comment. Use at session end, after a milestone, when an experiment completes, or when work is blocked and needs a durable handoff.
|
|
4
|
+
argument-hint: [issue number]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Report progress
|
|
8
|
+
|
|
9
|
+
Use the `github-cli` skill. Add history as a comment; do not rewrite another
|
|
10
|
+
author's issue body.
|
|
11
|
+
|
|
12
|
+
## Collect evidence
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git status -sb
|
|
16
|
+
git log main..HEAD --oneline 2>/dev/null
|
|
17
|
+
git diff main...HEAD --stat 2>/dev/null
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
For model or data work, also capture:
|
|
21
|
+
|
|
22
|
+
- dataset snapshot/hash;
|
|
23
|
+
- target and feature contract versions;
|
|
24
|
+
- split strategy and seed;
|
|
25
|
+
- config and git commit;
|
|
26
|
+
- baseline and evaluation metrics/slices;
|
|
27
|
+
- artifact paths, SHA-256 digests, and publication state;
|
|
28
|
+
- commands actually run and whether they passed.
|
|
29
|
+
|
|
30
|
+
Never report an uncommitted local path as if it were a durable artifact. Never
|
|
31
|
+
include credentials or private URLs.
|
|
32
|
+
|
|
33
|
+
## Comment format
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
## Progress
|
|
37
|
+
|
|
38
|
+
### Completed
|
|
39
|
+
|
|
40
|
+
### Evidence
|
|
41
|
+
|
|
42
|
+
### Decisions
|
|
43
|
+
|
|
44
|
+
### Remaining work
|
|
45
|
+
|
|
46
|
+
### Blockers
|
|
47
|
+
|
|
48
|
+
### Git state
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
Written by an agent on behalf of <user>.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Post with a body file to the relevant issue in `stfc/goldilocks-ml`. If no issue
|
|
55
|
+
exists, create one only if the work passes the `plan` skill's issue gate.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: triage
|
|
3
|
+
description: Triage the stfc/goldilocks-ml issue board by closing placeholders, folding duplicates, assigning milestones, and keeping one concrete issue per PR or model release. Use when catchup finds board drift.
|
|
4
|
+
argument-hint: [optional scope]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Triage issues
|
|
8
|
+
|
|
9
|
+
Use the `github-cli` skill. Inspect before mutating; propose changes to the user
|
|
10
|
+
before closing or restructuring text written by others.
|
|
11
|
+
|
|
12
|
+
## Inventory
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
gh issue list --repo stfc/goldilocks-ml --state open --limit 200 \
|
|
16
|
+
--json number,title,body,labels,milestone,updatedAt
|
|
17
|
+
gh issue list --repo stfc/goldilocks-ml --state closed --limit 100 \
|
|
18
|
+
--json number,title,closedAt
|
|
19
|
+
gh api repos/stfc/goldilocks-ml/milestones
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Cross-check open issues against branches, PRs, recent merges, sibling-repository
|
|
23
|
+
dependencies, and the current release milestone.
|
|
24
|
+
|
|
25
|
+
## Classify
|
|
26
|
+
|
|
27
|
+
- **Keep:** concrete, shippable, current, correctly scoped, and assigned.
|
|
28
|
+
- **Expand:** valid feature but missing evidence, approach, scientific contract,
|
|
29
|
+
verification, or acceptance criteria.
|
|
30
|
+
- **Fold:** duplicate, decision, experiment phase, or sub-step of another issue.
|
|
31
|
+
- **Close:** stale placeholder, roadmap mirror, superseded design, completed work,
|
|
32
|
+
or work outside this repository's boundary.
|
|
33
|
+
|
|
34
|
+
For ML issues, distinguish a research question from a release issue. An open
|
|
35
|
+
ended experiment needs a decision rule and bounded deliverable before it is a
|
|
36
|
+
shippable issue. A model release issue must name its dataset/target contract,
|
|
37
|
+
evaluation bar, and artifact output.
|
|
38
|
+
|
|
39
|
+
## Execute safely
|
|
40
|
+
|
|
41
|
+
- Comment before closing so the reason and destination are durable.
|
|
42
|
+
- Do not edit or delete text authored by someone else.
|
|
43
|
+
- Every agent-authored comment ends with the required attribution.
|
|
44
|
+
- Assign a milestone to every surviving issue.
|
|
45
|
+
- Do not burst-file replacements; consolidate first.
|
|
46
|
+
|
|
47
|
+
Finish with a table of kept, expanded, folded, and closed issues plus any
|
|
48
|
+
remaining dependency or milestone mismatch.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: use-uv
|
|
3
|
+
description: Use uv for all Python package management in this project. Use when installing dependencies, running Python commands, adding packages, building, or managing environments. Never use pip, venv, or pipx.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Use uv
|
|
7
|
+
|
|
8
|
+
Use `uv` for every Python package and environment operation.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
uv sync --group dev
|
|
12
|
+
uv run pytest
|
|
13
|
+
uv run ruff check src tests
|
|
14
|
+
uv run ruff format --check src tests
|
|
15
|
+
uv run python -c "..."
|
|
16
|
+
uv add <package>
|
|
17
|
+
uv add --group dev <package>
|
|
18
|
+
uv build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- Do not activate a virtual environment manually.
|
|
22
|
+
- Do not use `pip`, `pipx`, `venv`, or `virtualenv`.
|
|
23
|
+
- Declare dependencies in `pyproject.toml` and commit `uv.lock` once the project
|
|
24
|
+
has one.
|
|
25
|
+
- Use optional dependency groups for heavyweight or platform-specific ML
|
|
26
|
+
stacks when they are not required by every workflow.
|
|
27
|
+
- If a command shown here does not yet exist in the repository, establish the
|
|
28
|
+
corresponding configuration before treating it as a required check.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- name: Check out repository
|
|
20
|
+
uses: actions/checkout@v6
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
enable-cache: true
|
|
27
|
+
|
|
28
|
+
- name: Install development dependencies
|
|
29
|
+
run: uv sync --frozen --group dev --extra models
|
|
30
|
+
|
|
31
|
+
- name: Check formatting
|
|
32
|
+
run: uv run --frozen ruff format --check .
|
|
33
|
+
|
|
34
|
+
- name: Lint
|
|
35
|
+
run: uv run --frozen ruff check .
|
|
36
|
+
|
|
37
|
+
- name: Test
|
|
38
|
+
run: uv run --frozen pytest
|
|
39
|
+
|
|
40
|
+
# A notebook is committed with its outputs, so anything the machine that
|
|
41
|
+
# ran it printed ships to the public site. A home directory is the one
|
|
42
|
+
# that gets there by accident.
|
|
43
|
+
- name: Refuse a workstation path in the documentation
|
|
44
|
+
run: |
|
|
45
|
+
if grep -rIn -e '/Users/' -e '/home/' docs/; then
|
|
46
|
+
echo "::error::a local path reached docs/; clear the cell output that carries it"
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# A base install must stay light and must still train. Both halves of that
|
|
51
|
+
# promise break silently -- one stray module-level import in the CLI pulls in
|
|
52
|
+
# the scientific stack, and the unit suite would not notice because it runs
|
|
53
|
+
# with the extra installed.
|
|
54
|
+
base-install:
|
|
55
|
+
runs-on: ubuntu-latest
|
|
56
|
+
steps:
|
|
57
|
+
- name: Check out repository
|
|
58
|
+
uses: actions/checkout@v6
|
|
59
|
+
|
|
60
|
+
- name: Install uv
|
|
61
|
+
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
62
|
+
with:
|
|
63
|
+
python-version: "3.12"
|
|
64
|
+
|
|
65
|
+
- name: Install the package alone
|
|
66
|
+
run: |
|
|
67
|
+
uv venv /tmp/base
|
|
68
|
+
uv pip install --python /tmp/base/bin/python .
|
|
69
|
+
|
|
70
|
+
- name: Refuse a heavy base install
|
|
71
|
+
run: |
|
|
72
|
+
/tmp/base/bin/python - <<'PY'
|
|
73
|
+
import importlib.util as util
|
|
74
|
+
heavy = [
|
|
75
|
+
name
|
|
76
|
+
for name in ("torch", "torch_geometric", "pymatgen", "matminer",
|
|
77
|
+
"dscribe", "sklearn", "sklearn_quantile", "numpy")
|
|
78
|
+
if util.find_spec(name) is not None
|
|
79
|
+
]
|
|
80
|
+
if heavy:
|
|
81
|
+
raise SystemExit(
|
|
82
|
+
"the base install pulled in the model stack: " + ", ".join(heavy)
|
|
83
|
+
)
|
|
84
|
+
print("base install is clean")
|
|
85
|
+
PY
|
|
86
|
+
|
|
87
|
+
- name: Refuse a heavy import
|
|
88
|
+
run: |
|
|
89
|
+
/tmp/base/bin/python - <<'PY'
|
|
90
|
+
import sys
|
|
91
|
+
import goldilocks_ml.cli # noqa: F401
|
|
92
|
+
import goldilocks_ml.inference # noqa: F401
|
|
93
|
+
leaked = sorted(
|
|
94
|
+
name
|
|
95
|
+
for name in sys.modules
|
|
96
|
+
if name.split(".")[0] in {
|
|
97
|
+
"torch", "torch_geometric", "pymatgen", "matminer",
|
|
98
|
+
"dscribe", "sklearn", "sklearn_quantile", "numpy",
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
if leaked:
|
|
102
|
+
raise SystemExit("importing the CLI loaded: " + ", ".join(leaked))
|
|
103
|
+
print("the CLI and inference seam import nothing heavy")
|
|
104
|
+
PY
|
|
105
|
+
|
|
106
|
+
- name: Train with the built-in baselines
|
|
107
|
+
run: |
|
|
108
|
+
/tmp/base/bin/goldilocks-ml train run protocols/synthetic/regression.toml \
|
|
109
|
+
--dataset tests/fixtures/kdist --output /tmp/run/regression
|
|
110
|
+
/tmp/base/bin/goldilocks-ml train run protocols/synthetic/classification.toml \
|
|
111
|
+
--dataset tests/fixtures/metallic --output /tmp/run/classification
|
|
112
|
+
test -f /tmp/run/regression/metrics.json
|
|
113
|
+
test -f /tmp/run/classification/metrics.json
|
|
114
|
+
|
|
115
|
+
- name: Report a missing extra clearly
|
|
116
|
+
run: |
|
|
117
|
+
/tmp/base/bin/python - <<'PY'
|
|
118
|
+
from goldilocks_ml.registry import get_feature_contract, get_trainer
|
|
119
|
+
|
|
120
|
+
for lookup, name in (
|
|
121
|
+
(get_trainer, "quantile_random_forest"),
|
|
122
|
+
(get_feature_contract, "comp_struct_soap_lattice_metal.v1"),
|
|
123
|
+
):
|
|
124
|
+
try:
|
|
125
|
+
lookup(name)
|
|
126
|
+
except ValueError as error:
|
|
127
|
+
if "models" not in str(error):
|
|
128
|
+
raise SystemExit(f"{name} should name the extra: {error}")
|
|
129
|
+
print(f"{name}: {error}")
|
|
130
|
+
else:
|
|
131
|
+
raise SystemExit(f"{name} resolved without its dependencies")
|
|
132
|
+
PY
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: pages-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- name: Check out repository
|
|
20
|
+
uses: actions/checkout@v6
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
enable-cache: true
|
|
27
|
+
|
|
28
|
+
- name: Install documentation dependencies
|
|
29
|
+
run: uv sync --frozen --group docs
|
|
30
|
+
|
|
31
|
+
- name: Build documentation
|
|
32
|
+
run: uv run --frozen mkdocs build --strict
|
|
33
|
+
|
|
34
|
+
- name: Upload GitHub Pages artifact
|
|
35
|
+
if: github.event_name == 'push'
|
|
36
|
+
uses: actions/upload-pages-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
path: site
|
|
39
|
+
|
|
40
|
+
deploy:
|
|
41
|
+
if: github.event_name == 'push'
|
|
42
|
+
needs: build
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
permissions:
|
|
45
|
+
pages: write
|
|
46
|
+
id-token: write
|
|
47
|
+
environment:
|
|
48
|
+
name: github-pages
|
|
49
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
50
|
+
steps:
|
|
51
|
+
- name: Configure GitHub Pages
|
|
52
|
+
uses: actions/configure-pages@v5
|
|
53
|
+
|
|
54
|
+
- name: Deploy GitHub Pages
|
|
55
|
+
id: deployment
|
|
56
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Publish on PyPI
|
|
2
|
+
|
|
3
|
+
# Driven by a tag, so what reaches PyPI is always a commit in the history.
|
|
4
|
+
# Shaped after stfc/janus-core's release workflow, so both packages are
|
|
5
|
+
# released the same way.
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
tags:
|
|
9
|
+
# After vMajor.Minor.Patch anything is allowed, except "/".
|
|
10
|
+
- v[0-9]+.[0-9]+.[0-9]+*
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
# A fork that pushes a tag must not try to publish.
|
|
16
|
+
if: github.repository == 'stfc/goldilocks-ml'
|
|
17
|
+
environment:
|
|
18
|
+
# Registered as the trusted publisher's environment on PyPI. Renaming it
|
|
19
|
+
# here means editing the publisher there too, or the upload is refused.
|
|
20
|
+
name: pypi
|
|
21
|
+
url: https://pypi.org/p/goldilocks-ml
|
|
22
|
+
permissions:
|
|
23
|
+
# For PyPI's trusted publishing.
|
|
24
|
+
id-token: write
|
|
25
|
+
# For creating the GitHub release.
|
|
26
|
+
contents: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Check out repository
|
|
30
|
+
uses: actions/checkout@v6
|
|
31
|
+
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
34
|
+
with:
|
|
35
|
+
python-version: "3.12"
|
|
36
|
+
|
|
37
|
+
# A tag that disagrees with the packaged version publishes a release
|
|
38
|
+
# nobody can find from the history.
|
|
39
|
+
- name: Check the tag matches the packaged version
|
|
40
|
+
run: |
|
|
41
|
+
packaged=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)
|
|
42
|
+
tagged="${GITHUB_REF_NAME#v}"
|
|
43
|
+
if [ "$packaged" != "$tagged" ]; then
|
|
44
|
+
echo "::error::tag $GITHUB_REF_NAME does not match version $packaged"
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
- name: Build
|
|
49
|
+
run: uv build
|
|
50
|
+
|
|
51
|
+
- name: Check the artifacts are well formed
|
|
52
|
+
run: uvx twine check --strict dist/*
|
|
53
|
+
|
|
54
|
+
- name: Create the GitHub release
|
|
55
|
+
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
|
|
56
|
+
with:
|
|
57
|
+
artifacts: "dist/*"
|
|
58
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
59
|
+
draft: false
|
|
60
|
+
skipIfReleaseExists: true
|
|
61
|
+
generateReleaseNotes: true
|
|
62
|
+
|
|
63
|
+
- name: Publish to PyPI
|
|
64
|
+
run: uv publish
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
.venv/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
.mypy_cache/
|
|
8
|
+
.coverage
|
|
9
|
+
htmlcov/
|
|
10
|
+
dist/
|
|
11
|
+
build/
|
|
12
|
+
site/
|
|
13
|
+
*.egg-info/
|
|
14
|
+
|
|
15
|
+
# Local data, model artifacts, and experiment state
|
|
16
|
+
local_data/
|
|
17
|
+
artifacts/
|
|
18
|
+
checkpoints/
|
|
19
|
+
mlruns/
|
|
20
|
+
wandb/
|
|
21
|
+
outputs/
|
|
22
|
+
|
|
23
|
+
# Secrets and local configuration
|
|
24
|
+
.env
|
|
25
|
+
.env.*
|
|
26
|
+
!.env.example
|
|
27
|
+
*token*
|
|
28
|
+
|
|
29
|
+
# Training run bundles
|
|
30
|
+
local_runs/
|
|
31
|
+
|
|
32
|
+
# Files a notebook downloads or writes while it runs, and the docs build cache
|
|
33
|
+
docs/notebooks/goldilocks-*/
|
|
34
|
+
.cache/
|