This issue tracks the initial stage-contract hardening work for the US data harness engineering branch.
The implementation adds a stricter semantic contract surface for canonical data stages without wiring it into runtime orchestration yet.
Scope:
- Add shared canonical JSON helpers for deterministic metadata serialization.
- Make stage-contract constructors and JSON loading share the same validation expectations.
- Reject non-standard JSON constants such as NaN and infinity for contract metadata.
- Add canonical five-stage IDs, contract-type mappings, and substage membership checks.
- Preserve legacy CPS package-level lazy exports where practical to avoid import churn.
- Keep stage/substage examples in tests only, with validation that they match the canonical shape.
Out of scope:
- Runtime migration from step manifests to stage contracts.
- Moving stage folders or refactoring Modal orchestration.
- Conditional rerun/reuse implementation.
- Generated documentation publication.
Validation:
- Focused stage-contract, canonical JSON, run-context, TRO, step-manifest, and CPS export tests pass.
- Ruff passes on touched files.
This issue tracks the initial stage-contract hardening work for the US data harness engineering branch.
The implementation adds a stricter semantic contract surface for canonical data stages without wiring it into runtime orchestration yet.
Scope:
Out of scope:
Validation: