I have a small deterministic converter prototype that may be useful for PolicyEngine's existing validation and cross-model comparison work: it converts supported PolicyEngine YAML tests into an intermediate fixture JSON format and back to canonical PolicyEngine YAML data.
Current prototype supports
- PolicyEngine YAML test → intermediate fixture JSON → PolicyEngine YAML test round-trips for a documented subset
- Scalar and nested entity input/output maps
- Absolute error margins
- Optional crosswalk remapping for cross-engine conversion when every variable has an explicit mapping
- Loud rejection for unsupported constructs (reforms, extensions, relative error margins, dotted input keys treated as inline parameter reforms, lists, nulls, expression strings)
I verified the current PolicyEngine YAML loader from policyengine-core commit f761573c2a13adecc3826be04af1980d13657e1d (policyengine_core/tools/test_runner.py) before defining the subset.
Corpus evidence
- Source corpus: 10 YAML files from
PolicyEngine/policyengine-us commit fc64cef64ab55c3c48309c7fb304c35e5f3c9184
- Converted files: 10/10
- Rejected files: 0/10 in the selected v0.1 subset corpus
- Generated fixture JSON is validated with a JSON Schema validator in CI
This is intended as a migration/cross-validation utility, not a replacement for PolicyEngine's native test format. The converter refuses ambiguous or engine-specific constructs rather than silently dropping them.
Questions
Would PolicyEngine maintainers be open to this living as:
- an external utility with docs/examples that reference PolicyEngine's current YAML test shape, or
- a small upstream docs/testing contribution if useful?
Given PolicyEngine's existing validation culture, the highest-value next step may be a narrow demonstration on a package slice rather than a broad format discussion.
Evidence packet (external): https://github.com/edithatogo/rulesandprocesses/tree/main/converters/fixtures
I have a small deterministic converter prototype that may be useful for PolicyEngine's existing validation and cross-model comparison work: it converts supported PolicyEngine YAML tests into an intermediate fixture JSON format and back to canonical PolicyEngine YAML data.
Current prototype supports
I verified the current PolicyEngine YAML loader from
policyengine-corecommitf761573c2a13adecc3826be04af1980d13657e1d(policyengine_core/tools/test_runner.py) before defining the subset.Corpus evidence
PolicyEngine/policyengine-uscommitfc64cef64ab55c3c48309c7fb304c35e5f3c9184This is intended as a migration/cross-validation utility, not a replacement for PolicyEngine's native test format. The converter refuses ambiguous or engine-specific constructs rather than silently dropping them.
Questions
Would PolicyEngine maintainers be open to this living as:
Given PolicyEngine's existing validation culture, the highest-value next step may be a narrow demonstration on a package slice rather than a broad format discussion.
Evidence packet (external): https://github.com/edithatogo/rulesandprocesses/tree/main/converters/fixtures