Skip to content

populace.data.contract: enforce the release artifact contract at the producer#12

Closed
PavelMakarchuk wants to merge 1 commit into
mainfrom
release-contract
Closed

populace.data.contract: enforce the release artifact contract at the producer#12
PavelMakarchuk wants to merge 1 commit into
mainfrom
release-contract

Conversation

@PavelMakarchuk

Copy link
Copy Markdown
Contributor

Fixes #11.

What

Adds populace.data.contract — the single gate every release must pass before publishing:

  • Required files: build_manifest.json, release_manifest.json, sound_ecps_replacement_comparison.json.
  • Versioned manifest: release_manifest.json must carry schema_version == 1; unversioned manifests (the 1abddeb-era shape) are rejected by name.
  • Build-id agreement: both manifests must agree with the releases/<build_id> directory name about which build this is.
  • Artifact provenance: every artifacts entry must carry path, repo_id, sha256.

validate_release_dir() raises ReleaseContractError naming every violation at once — a publisher sees the full repair list, not one failure per run.

Why

The three releases on policyengine/populace-us are mutually inconsistent: 1abddeb has no build manifest and an unversioned release-manifest schema, while later releases carry schema_version: 1. Every consumer was re-implementing its own defensive filter (the calibration-diagnostics dashboard literally filters to releases containing build_manifest.json). The charter makes "stage manifests are load-bearing" a binding rule; the contract belongs with the producer.

Testing

  • 16 new behavioral tests, including a regression test for the exact 1abddeb shape.
  • Verified against the Hub: the real 9f1260b release passes, the real 1abddeb release is rejected with six named failures.
  • Full workspace suite: 368 passed, 4 skipped. ruff check clean. uv build --wheel packages/populace-data succeeds.

Not in this PR

🤖 Generated with Claude Code

…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>
@MaxGhenis

Copy link
Copy Markdown
Contributor

Superseded by #37, which merged the release artifact contract into main with the latest pointer, calibration diagnostics, stricter validation, and CI coverage.

@MaxGhenis MaxGhenis closed this Jun 14, 2026
@MaxGhenis MaxGhenis deleted the release-contract branch June 14, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define and enforce a release artifact contract for populace-us (releases differ in files and manifest schema)

2 participants