From e6aa357217a5de0b4fb10e04ca8118180bd17db1 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 9 Oct 2026 11:38:33 -0400 Subject: [PATCH 1/2] Document per-country environments and test every workspace US path (#1086) #1143 gave each country its own policyengine-core pin, so uv now refuses any install that asks for a US extra together with a UK extra. The agent guide's Commands section did not say so; it now does, and says to keep one UV_PROJECT_ENVIRONMENT per country. The lock-level pin test checked `--all-packages --extra us` and each per-package US extra. It now also checks `--all-packages --extra policyengine` (the path the first trial found drawing a newer core) and both US extras together. All resolve policyengine-core 3.32.5, policyengine-us 2.2.1 and spm-calculator 1.0.0. Co-Authored-By: Claude Opus 5.5 --- changelog.d/1086-per-country-env-docs.changed.md | 1 + docs/agent-guide.md | 9 +++++++++ .../tests/engine_free/shared/test_engine_core_pins.py | 8 +++++++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 changelog.d/1086-per-country-env-docs.changed.md diff --git a/changelog.d/1086-per-country-env-docs.changed.md b/changelog.d/1086-per-country-env-docs.changed.md new file mode 100644 index 000000000..f4a2d2afe --- /dev/null +++ b/changelog.d/1086-per-country-env-docs.changed.md @@ -0,0 +1 @@ +The agent guide now says that each country keeps its own policyengine-core pin (microcosm#1086), so no environment can hold both engines: uv refuses any sync that asks for a US extra together with a UK extra, such as `uv sync --all-packages --extra us --extra uk` or `uv sync --all-packages --all-extras`, and each country needs its own `UV_PROJECT_ENVIRONMENT`. The lock-level pin test also checks the workspace-wide US install paths `--all-packages --extra policyengine` and `--all-packages --extra policyengine --extra us`. Each resolves policyengine-core 3.32.5, policyengine-us 2.2.1 and spm-calculator 1.0.0, like the paths it already checked. diff --git a/docs/agent-guide.md b/docs/agent-guide.md index ca981de83..55407eac6 100644 --- a/docs/agent-guide.md +++ b/docs/agent-guide.md @@ -23,6 +23,15 @@ uv run pytest # focused test while developing uv run ruff check . # lint ``` +Each country keeps its own policyengine-core pin (#1086). The extras that +install policyengine-us pin the core the certified US default was built with, +and the extras that install policyengine-uk follow policyengine-uk's own core +floor. So no environment can hold both engines: uv refuses any sync that asks +for a US extra (`us`, or `microcosm-frame`'s `policyengine`) together with a +UK extra, such as `uv sync --all-packages --extra us --extra uk` or +`uv sync --all-packages --all-extras`. To keep both countries set up, point +`UV_PROJECT_ENVIRONMENT` at a separate directory outside the checkout for each. + PR CI (`.github/workflows/test.yml`) has `lint`, `engine-free`, `engine-us`, `engine-uk`, `integration-uk`, and `wheels` jobs, plus the `select-countries` orchestration job. diff --git a/packages/microcosm-build/tests/engine_free/shared/test_engine_core_pins.py b/packages/microcosm-build/tests/engine_free/shared/test_engine_core_pins.py index b59b585a7..a1a1848bc 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_engine_core_pins.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_engine_core_pins.py @@ -93,8 +93,14 @@ def test_every_us_engine_extra_pins_the_us_core(package: str, extra: str) -> Non def _us_install_paths() -> list[tuple[str, ...]]: + # Workspace installs name each US extra alone, then all of them together. + extra_names = sorted({extra for _, extra in US_EXTRAS}) return [ - ("--all-packages", "--extra", "us"), + *(("--all-packages", "--extra", extra) for extra in extra_names), + ( + "--all-packages", + *(arg for extra in extra_names for arg in ("--extra", extra)), + ), *(("--package", package, "--extra", extra) for package, extra in US_EXTRAS), ] From 07975552eb3d1da350e9e60708b7f34cb800d488 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 9 Oct 2026 13:48:14 -0400 Subject: [PATCH 2/2] Name the extras that install policyengine-us in the guide note Review nit on #1169: `microcosm-frame[us]` installs no engine and does not conflict with the UK extras, so "a US extra (`us`, ...)" was ambiguous. Name `microcosm-build[us]`, `microcosm-data[us]` and `microcosm-frame[policyengine]` in the guide and the changelog fragment. Co-Authored-By: Claude Opus 5.5 --- changelog.d/1086-per-country-env-docs.changed.md | 2 +- docs/agent-guide.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/changelog.d/1086-per-country-env-docs.changed.md b/changelog.d/1086-per-country-env-docs.changed.md index f4a2d2afe..a7fdb4ea7 100644 --- a/changelog.d/1086-per-country-env-docs.changed.md +++ b/changelog.d/1086-per-country-env-docs.changed.md @@ -1 +1 @@ -The agent guide now says that each country keeps its own policyengine-core pin (microcosm#1086), so no environment can hold both engines: uv refuses any sync that asks for a US extra together with a UK extra, such as `uv sync --all-packages --extra us --extra uk` or `uv sync --all-packages --all-extras`, and each country needs its own `UV_PROJECT_ENVIRONMENT`. The lock-level pin test also checks the workspace-wide US install paths `--all-packages --extra policyengine` and `--all-packages --extra policyengine --extra us`. Each resolves policyengine-core 3.32.5, policyengine-us 2.2.1 and spm-calculator 1.0.0, like the paths it already checked. +The agent guide now says that each country keeps its own policyengine-core pin (microcosm#1086), so no environment can hold both engines: uv refuses any sync that asks for an extra that installs policyengine-us (`microcosm-build[us]`, `microcosm-data[us]` or `microcosm-frame[policyengine]`) together with one that installs policyengine-uk, such as `uv sync --all-packages --extra us --extra uk` or `uv sync --all-packages --all-extras`, and each country needs its own `UV_PROJECT_ENVIRONMENT`. The lock-level pin test also checks the workspace-wide US install paths `--all-packages --extra policyengine` and `--all-packages --extra policyengine --extra us`. Each resolves policyengine-core 3.32.5, policyengine-us 2.2.1 and spm-calculator 1.0.0, like the paths it already checked. diff --git a/docs/agent-guide.md b/docs/agent-guide.md index 55407eac6..56e305cb9 100644 --- a/docs/agent-guide.md +++ b/docs/agent-guide.md @@ -27,9 +27,10 @@ Each country keeps its own policyengine-core pin (#1086). The extras that install policyengine-us pin the core the certified US default was built with, and the extras that install policyengine-uk follow policyengine-uk's own core floor. So no environment can hold both engines: uv refuses any sync that asks -for a US extra (`us`, or `microcosm-frame`'s `policyengine`) together with a -UK extra, such as `uv sync --all-packages --extra us --extra uk` or -`uv sync --all-packages --all-extras`. To keep both countries set up, point +for an extra that installs policyengine-us (`microcosm-build[us]`, +`microcosm-data[us]` or `microcosm-frame[policyengine]`) together with one that +installs policyengine-uk, such as `uv sync --all-packages --extra us --extra uk` +or `uv sync --all-packages --all-extras`. To keep both countries set up, point `UV_PROJECT_ENVIRONMENT` at a separate directory outside the checkout for each. PR CI (`.github/workflows/test.yml`) has `lint`, `engine-free`, `engine-us`,