Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 0 additions & 116 deletions .github/qualification-ledger.sh

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
# Skips Lint + Test since the code is identical to Phase 1.
# After Publish, NotifyConsumers waits for the release to be visible on
# PyPI and sends a policyengine-release repository dispatch (version plus
# the certified UK bundle identity and qualification digests) to consumer
# repos so they open version-bump PRs, then a released-bundle replay
# request to policyengine-scorecard. New consumers are dispatched in
# the certified UK bundle identity) to consumer repos so they open
# version-bump PRs, then a released-bundle replay request to
# policyengine-scorecard. New consumers are dispatched in
# separate, non-blocking steps.

name: Push to main
Expand Down Expand Up @@ -275,9 +275,9 @@ jobs:
version: "0.13.4"
- name: Install policyengine without country models
run: uv pip install -e . --system
# The payload carries the certified UK bundle identity and, for an
# automatically qualified pair, the qualification receipt digest.
# client_payload.version stays first, as existing updaters read only it.
# The payload carries the version and the certified UK bundle identity.
# Its qualification member is always null and is kept only so the
# consumers that read it need no change.
- name: Build the release dispatch payload
env:
VERSION: ${{ needs.Publish.outputs.version }}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/796.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The UK qualification pipeline that the removed `certify-uk-release.yaml` ran is gone: `scripts/check_uk_candidate.py`, the replay probe, the UK candidate, qualification and ledger modules, `.github/qualification-ledger.sh`, the data files and scorecard receipt and status schemas only it read, and their tests. The `qualified_exact_pair` basis and `certify-data --qualified-pair-id` go with it, and a model refuses to load a bundle whose certificate names that basis. `scripts/release_consumers.py` now builds the release dispatch and the scorecard's replay request itself; both are unchanged.
15 changes: 9 additions & 6 deletions docs/engineering/skills/data-certification.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pinned model version. Certification refuses a build that has none of them:
the certificate at load time only when that file holds a matching record
for the running model and core. The certificate names the core it ran
with. Certification refuses a record for other manifest bytes, another
build, model, wheel or core, and a record given with `--qualified-pair-id`.
build, model, wheel or core.
Commit the records file with the bundle.
`certify-build` uses this basis whenever the model is not the build's own.
Such a certificate always binds its core (`core_binding: certified`), and
Expand All @@ -130,9 +130,10 @@ pinned model version. Certification refuses a build that has none of them:
with a warning; the claim is made good only by this repository's test suite
passing on the pinned pair. A compatibility record replaces it when both
apply.
- **`qualified_exact_pair`.** A receipt of the retired UK qualification
workflow (`--qualified-pair-id`). No .py release has pinned a certificate
on it, and no new certification uses it.
- **`qualified_exact_pair` (removed).** The basis of the retired UK
qualification workflow. No .py release pinned a certificate on it.
Certification no longer offers it, and a model refuses to load a bundle
whose certificate names it.

### The compatibility check

Expand Down Expand Up @@ -527,9 +528,11 @@ certification uses this route.

**The UK qualification workflow.** `certify-uk-release.yaml` qualified each
new policyengine-uk wheel or uk-data release before promotion and recorded a
receipt in the `uk-qualification-ledger` branch, the basis
receipt for each pair it accepted, certified on the basis
`qualified_exact_pair`. The compatibility check and the scheduled workflow
replace it.
replace it. The workflow was removed first, and its code, data files, tests
and basis afterwards. Its receipts are kept on the
`uk-qualification-ledger` branch.

**The UK default switch (policyengine.py#685, October 2026).**

Expand Down
4 changes: 2 additions & 2 deletions docs/receipts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Schema v1 covers UK results and is defined by `policyengine.provenance.receipt.E
| `reform`, `baseline` | Both are required. Each is `current_law` or a digest of the reform bound to its representation (see below). |
| `fiscal_year` | What a year label means: year 2027 is the fiscal year from 6 April 2027 to 5 April 2028, shown as `2027-28`. v1 allows only this convention. |
| `years` | The reported years, sorted and unique. |
| `supported_years` | The years the installed model projects the dataset to, from the dataset's own year (policyengine-uk's `extend_single_year_dataset`, without running a formula; the same rule as the qualification `supported_years` gate). A reported year outside them is unsupported: policyengine-core fills it by carrying or uprating the latest inputs, so its results are not evidence. `unsupported_years` lists them. The certified 1.58.0 dataset projects to 2024–2030, so a 2031-32 figure on it is unsupported. |
| `supported_years` | The years the installed model projects the dataset to, from the dataset's own year (policyengine-uk's `extend_single_year_dataset`, without running a formula). A reported year outside them is unsupported: policyengine-core fills it by carrying or uprating the latest inputs, so its results are not evidence. `unsupported_years` lists them. The certified 1.58.0 dataset projects to 2024–2030, so a 2031-32 figure on it is unsupported. |
| `outputs_sha256` | Optional digest of the output payload the receipt binds. |
| `runtime` | Python version, platform and CI run URL. It is for diagnosis and is part of no digest. |

Expand Down Expand Up @@ -182,7 +182,7 @@ const digest = (value) => createHash("sha256").update(canonicalize(dropNulls(val

Reform digests are the exception: a reform payload is digested with its nulls kept, because there a null can mean something. `Scenario.from_reform({"p": {"2027": None}})` removes a value that `{"p": {}}` keeps, so the two must not share a digest. Reform payloads may also hold infinite numbers, which PolicyEngine parameters use for an uncapped threshold and JSON cannot hold. `inf` is digested as the object `{"$nonfinite": "Infinity"}` and `-inf` as `{"$nonfinite": "-Infinity"}`, and a payload that uses the key `$nonfinite` itself is refused, so no other payload digests like an infinity. The encoding happens inside strict conversion, so a payload it refuses without infinities, such as one with colliding keys, is refused with them too. NaN is refused, and a payload without infinities digests as before, except one whose strings, keys or dates are subclasses that override how `str` or `date` render: those now digest by their characters and their date, as content digests do. The JavaScript above covers content digests only: a JavaScript verifier of reform digests must keep nulls, replace `Infinity` and `-Infinity` with the reserved objects before canonicalizing, and refuse a payload with a `$nonfinite` key.

The pre-promotion replay interface with policyengine-scorecard follows a different rule, set by its own schemas: plain RFC 8785 over the document as sent, nulls included. `policyengine.provenance.canonical.canonical_sha256` computes that.
The replay request each release sends policyengine-scorecard (`scripts/release_consumers.py scorecard-request`) follows a different rule, set by the scorecard's own schemas: plain RFC 8785 over the document as sent, nulls included. `policyengine.provenance.canonical.canonical_sha256` computes that.

| Digest | Value hashed |
|---|---|
Expand Down
6 changes: 0 additions & 6 deletions scripts/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ def _certify_data(args: argparse.Namespace) -> int:
argv.append("--skip-artifact-check")
if args.core_version:
argv.extend(["--core-version", args.core_version])
if args.qualified_pair_id:
argv.extend(["--qualified-pair-id", args.qualified_pair_id])
if args.compatibility_record:
argv.extend(["--compatibility-record", args.compatibility_record])
if args.regional_compatibility_record:
Expand Down Expand Up @@ -332,10 +330,6 @@ def _parser() -> argparse.ArgumentParser:
"--core-version",
help="policyengine-core version to check against core claims and pin.",
)
certify.add_argument(
"--qualified-pair-id",
help="Admit the exact pair on automated qualification (needs --core-version).",
)
certify.add_argument(
"--compatibility-record",
help=(
Expand Down
9 changes: 0 additions & 9 deletions scripts/certify_data_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ def main(argv=None) -> int:
"claims and pin in the bundle."
),
)
parser.add_argument(
"--qualified-pair-id",
default=None,
help=(
"Admit the exact model, core and data release on automated "
"qualification of this pair (requires --core-version)."
),
)
parser.add_argument(
"--accept-regional-model-mismatch",
metavar="REASON",
Expand Down Expand Up @@ -194,7 +186,6 @@ def main(argv=None) -> int:
regional_release_kind=args.regional_release_kind,
drop_regional_release=args.drop_regional_release,
core_version=args.core_version,
qualified_pair_id=args.qualified_pair_id,
regional_model_mismatch_reason=args.accept_regional_model_mismatch,
regional_input_surface_evidence=(
json.loads(args.regional_input_surface_evidence.read_text())
Expand Down
Loading