Skip to content

Add initial stage contract harness foundation#914

Merged
anth-volk merged 14 commits intomainfrom
feat/data-stage-structure
May 7, 2026
Merged

Add initial stage contract harness foundation#914
anth-volk merged 14 commits intomainfrom
feat/data-stage-structure

Conversation

@anth-volk
Copy link
Copy Markdown
Collaborator

Fixes #913

Summary

  • Add the initial stage-contract schema surface for the US data harness engineering work.
  • Add canonical stage and substage identifiers with stage-to-contract-type validation.
  • Add shared canonical JSON helpers and use them for stage contracts, fingerprints, TROs, step manifests, release manifests, and run contexts.
  • Harden direct contract constructors so they match JSON-loading validation and normalize nested sequence fields.
  • Preserve legacy CPS lazy export names and remove duplicate root exports.

Validation

  • uv run --no-sync pytest tests/unit/test_stage_contracts.py tests/unit/test_trace_tro.py::test_canonical_json_bytes_match_serialize tests/unit/test_step_manifest.py::test_step_manifest_serialization_is_deterministic tests/unit/test_run_context.py tests/unit/datasets/test_cps_lazy_exports.py
  • uv run --no-sync ruff check policyengine_us_data/stage_contracts policyengine_us_data/utils/canonical_json.py policyengine_us_data/utils/trace_tro.py policyengine_us_data/utils/step_manifest.py policyengine_us_data/utils/release_manifest.py policyengine_us_data/utils/run_context.py policyengine_us_data/datasets/cps/init.py policyengine_us_data/init.py tests/unit/test_stage_contracts.py tests/unit/datasets/test_cps_lazy_exports.py

@anth-volk anth-volk force-pushed the feat/data-stage-structure branch 4 times, most recently from fccc986 to 78062a9 Compare May 7, 2026 14:39
@anth-volk anth-volk force-pushed the feat/data-stage-structure branch from 5867c58 to 01ea144 Compare May 7, 2026 21:56
@anth-volk anth-volk force-pushed the feat/data-stage-structure branch from 01ea144 to 017be4c Compare May 7, 2026 22:09
@anth-volk anth-volk marked this pull request as ready for review May 7, 2026 22:37
@anth-volk anth-volk merged commit 41a687b into main May 7, 2026
12 checks passed
@anth-volk anth-volk deleted the feat/data-stage-structure branch May 7, 2026 22:37
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.

Harden stage contracts for initial harness engineering

2 participants