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

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
MaxGhenis added a commit that referenced this pull request Oct 27, 2026
…it do

A fuzz of round 10's generation against markdown-it-py 4.2, parse5 7.3
and bun 1.3 found five links no reading refused. HTML decodes an
attribute's references before the URL Standard strips its C0 controls
and spaces, so `href="&#32;https://..."` and `href="&#12;https://..."`
are links; the enclosed reading held the decoded space as `%20` first,
and the value no longer started a URL. markdown-it strips whitespace
from a destination's ends before following it (`str.strip`, in mdurl),
so `[a](< https://... >)`, a destination padded with U+3000 or U+00A0,
and `[a](<&#32;https://...>)` are links too; the angle reading did not
strip at all. Each enclosed value is now decoded without holding, then
stripped as its renderer strips it, then held.

Over 200,000 generated links, 113,469 render to a line link of this
repository and each is refused as written. The five shapes are in the
counterexample test. The round-10 timing strings get 2 s of their own:
all grow linearly, but under load they pushed the shared budget over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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