Skip to content

Commit 9a36be4

Browse files
authored
Merge pull request #380 from PolicyEngine/release-bundle-single-country-fallback
Add release bundle skill guidance
2 parents 55ce4c6 + ae93451 commit 9a36be4

6 files changed

Lines changed: 103 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ from branches in `PolicyEngine/policyengine.py`; never create fork PRs.
99

1010
For repository-wide API, testing, documentation, release, or package-boundary
1111
changes, read `docs/engineering/skills/repository-guidance.md`.
12+
13+
For certified release-bundle updates or reviews, read
14+
`docs/engineering/skills/release-bundles.md`.

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Before making or reviewing repository-wide API, testing, documentation, release,
1515
or package-boundary changes, read
1616
`docs/engineering/skills/repository-guidance.md`.
1717

18+
Before updating or reviewing certified release bundles, read
19+
`docs/engineering/skills/release-bundles.md`.
20+
1821
## Repository Boundaries
1922

2023
`policyengine.py` is the user-facing analysis package. It wraps

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ Before opening, replacing, or sharing a PR, read
1919
Before making or reviewing repository-wide API, testing, documentation, release,
2020
or package-boundary changes, read
2121
`docs/engineering/skills/repository-guidance.md`.
22+
23+
Before updating or reviewing certified release bundles, read
24+
`docs/engineering/skills/release-bundles.md`.

changelog.d/378.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add AI-facing release-bundle guidance for single-country refreshes and compatibility fallbacks.

docs/engineering/skills/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ Current skills:
1313
changelog-fragment requirements, PR head verification, and title conventions.
1414
- `repository-guidance.md`: policyengine.py structure, commands, package
1515
boundaries, test expectations, and repo-specific anti-patterns.
16+
- `release-bundles.md`: certified release-bundle refresh workflow, model/data
17+
compatibility gates, expected files, and bundle-specific tests.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Release Bundles
2+
3+
Use this skill when updating or reviewing a `policyengine.py` certified release
4+
bundle for US, UK, or both countries.
5+
6+
## Core Rules
7+
8+
Open release-bundle implementation work on a fresh branch from current `main`.
9+
If the checkout is dirty, use a clean worktree instead of overwriting unrelated
10+
changes.
11+
12+
Do not hand-edit bundled release manifests for normal updates. Use the existing
13+
single-country refresh script so model wheels, data artifacts, `pyproject.toml`,
14+
and TRACE TROs move together:
15+
16+
```bash
17+
python scripts/refresh_release_bundle.py --country us --model-version 1.715.2
18+
python scripts/refresh_release_bundle.py --country uk --model-version 2.89.0
19+
```
20+
21+
When a new data release is part of the certification, pass it explicitly:
22+
23+
```bash
24+
python scripts/refresh_release_bundle.py --country us \
25+
--model-version 1.715.2 \
26+
--data-version 1.115.5
27+
```
28+
29+
There is no supported `all` mode. If a user asks to update both US and UK, run
30+
the single-country workflow for one country, inspect the result, then run it for
31+
the other country.
32+
33+
UK data is private. Set `HUGGING_FACE_TOKEN` or `HF_TOKEN` before refreshing UK
34+
bundles.
35+
36+
## Certification Order
37+
38+
For one country, first attempt full bundle certification with the existing
39+
refresh script and a country data release manifest that supports the target
40+
model by exact build version or matching `data_build_fingerprint`.
41+
42+
If full certification is not possible, the fallback is a country-data release
43+
manifest assertion through `compatible_model_packages`. This fallback must be
44+
created with the country data repo's release-manifest tooling, not by manually
45+
editing the `policyengine.py` bundle. Tell the user clearly that this fallback is
46+
only the data-release publisher claiming compatibility; there is currently no
47+
validation or verification proving that the setup actually works.
48+
49+
For that fallback, use the country data repo's release-manifest builder or
50+
publishing path with `additional_compatible_specifiers` set to the target model
51+
specifier, for example `("==1.715.2",)` for US or `("==2.89.0",)` for UK.
52+
Publish the updated country data release manifest before touching the `.py`
53+
bundle.
54+
55+
After a country-data fallback manifest is published, rerun
56+
`scripts/refresh_release_bundle.py` for that country and point at the updated
57+
data release manifest revision if needed.
58+
59+
## Expected Files
60+
61+
A real `.py` refresh should normally change only:
62+
63+
- `src/policyengine/data/release_manifests/{country}.json`
64+
- `src/policyengine/data/release_manifests/{country}.trace.tro.jsonld`
65+
- `pyproject.toml`
66+
- `uv.lock`, only if the lockfile is intentionally refreshed
67+
- one Towncrier fragment under `changelog.d/`
68+
69+
Unexpected files are a reason to stop and inspect the diff.
70+
71+
## Testing
72+
73+
For release-bundle script or manifest changes, run:
74+
75+
```bash
76+
POLICYENGINE_SKIP_COUNTRY_IMPORTS=1 uv run pytest --noconftest \
77+
tests/test_bundle_refresh.py
78+
79+
uv run pytest \
80+
tests/test_release_manifests.py \
81+
tests/test_trace_tro.py
82+
```
83+
84+
For a real data artifact change, also run and review snapshot diffs:
85+
86+
```bash
87+
PE_UPDATE_SNAPSHOTS=1 uv run pytest tests/test_household_calculator_snapshot.py
88+
```
89+
90+
Before opening a PR, run the standard repository checks from
91+
`repository-guidance.md`.

0 commit comments

Comments
 (0)