Fix Populace release and export gates#37
Merged
Conversation
…e producer The releases already on policyengine/populace-us disagree with each other: 1abddeb has no build_manifest.json and an unversioned release_manifest schema, while later releases carry schema_version 1. Every consumer was left to implement its own defensive filter. validate_release_dir() is the single gate: required files, manifest schema version, and build-id agreement between both manifests and the directory name — raising ReleaseContractError that names every violation at once. Verified against the real 9f1260b release (passes) and the real 1abddeb release (rejected with six named failures). Fixes #11. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Hub repo had no way to say which release is current: consumers listed the releases/ tree and guessed, and same-day builds (the ids end in a date) have no defined ordering. publish_release() validates the release directory against the contract (an invalid release uploads nothing), uploads its files, and writes the latest.json pointer LAST so a reader never sees a pointer to files that are not there yet. latest_release() is the consumer side: one call that returns the typed pointer. The Hub client is injected so the suite tests the real ordering against a fake, network-free. Fixes #9. Stacked on #11's contract branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…he artifact CalibrationResult already carries everything an auditor needs — per-target initial/final estimates and tolerance verdicts, the per-epoch loss trajectory, every skipped target with its reason, and the solver options actually used — but none of it left the build machine: the build pushed diagnostics to telemetry and dropped them, and the published .npz kept only closing scalars. "Skipped and reported, never dropped silently" is only true if the report ships. diagnostics_payload() renders the result as strict JSON (non-finite floats become null; the writer passes allow_nan=False so anything that escapes the scrub fails loudly), and write_calibration_diagnostics() writes the calibration_diagnostics.json a release directory publishes next to its manifests. Fixes #10. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 14, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is the live-Populace cleanup after retiring Microplex/eCPS from the production repo surface. It folds the release contract/latest-pointer/calibration-diagnostics draft PRs into one branch and adds release/export gates that should block bad artifacts before publication.
Fixes #9, #10, #11, #18, #24, #25, and #36.
Refs #27, #28, #29, #33, and #34.
Supersedes draft PRs #12, #13, and #14 once merged.
What changed
build_manifest.json,release_manifest.json, andcalibration_diagnostics.jsonbefore publicationlatest.jsonlast, validate exact contract paths on read, and reject partial/invalid uploads before touching the HubNaNin release contract filesrepo_idpolicyengine-us==1.729.0; keeppolicyengine-us-data<1.115.4because 1.115.4 still pins the older engine metadataPolicyEngine/populace-benchmarksValidation
47 passeduv sync --python 3.13 --all-packages --all-extras --dev;ruff check .;pytest=>459 passed, 2 skipped459 passed, 2 skipped410 passed, 6 skippedeachgit diff --checkrg -i "microplex|\\becps\\b|enhanced_cps|enhanced CPS|sound_ecps|mp[-_]?ecps|populace-score-work|score_driver" ./cycleread-only review: final pass had no actionable findingsNotes
This intentionally does not merge PR #21's eCPS parity runner or PR #22's old
build_us_candidate.pypatch. #21 is benchmark-harness material now, and #22 targets a deleted historical build path; the partnership/S-corp values work should be ported to the current Populace build/profile surface separately.