PolicyEngine / PolicyEngine/policyengine-scorecard
Baseline as a first-class attribute of every score
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 32
Description
Max (8/2): "we should have the baseline as a first class attribute of the score in our db." The day supplied four independent proofs: PWBM tables scored vs TCJA-extension; JCX-29-25 scored vs current policy (twin of JCX-35-25 vs present law); TPC's CTC set scored vs current law + Senate Title VII; and PE's own two-child-limit run, where the 2026 current-law baseline already contains AB2025's abolition so "removal" had to be measured against a reinstated counterfactual. A score's meaning IS its (reform, baseline) pair — baseline can't live half-inside ReformRef.baseline JSON and half in conditions.baseline_policy strings.
Schema change
baselinesregistry table:baseline_key(hash) ·label(closed slug vocabulary, extend deliberately:current_law|current_policy|tcja_extension|pre_ab2025|current_law_plus_senate_title_vii| …) ·description·framework·spec_json(nullable — many external baselines are named conventions, not expressible parameter dicts) ·provenance(the source's own words defining it).baseline_keycolumn onexternal_scores,pe_results, andpe_exhibits(FK to registry). Claim-id hashing unchanged (ReformRef keeps carrying baseline content for the hash) — this is an additive queryable projection, no id migration.comparisonsview exposes both the claim's baseline label and the PE result's actually-run baseline. Guard: rows where claim-baseline ≠ pe-baseline can never render as plain agreement — auto-annotateconstructed(orconcept_mismatch) unless a registry equivalence says otherwise. App (#9): baseline chip on every row, same pattern as vintage chips.- Migration of existing data: Urban rows →
current_law(2023); fullpart/solo exhibits → baselinecurrent_lawwith input-override reform; harvest ingest maps the stagedbaseline_policy/baseline_hint/conditions.baselinefields into registry entries (PWBM, JCT, TPC ones enumerated in COLLATION.md). - PE-side rule: every run records the baseline it actually executed (e.g. tonight's two-child rows: reform=
pre_ab2025→current_lawdirection made explicit rather than implied by sign).
Grounding artifacts: ~/populace-sotsn-takeup/results/uk/two_child_reinstate_2026.json (the reinstated-counterfactual construction), COLLATION.md §ingest-worklist item 3 (baseline variants are load-bearing).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read COLLATION.md §ingest-worklist item 3 and the two_child_reinstate_2026.json grounding artifact first, then trace the external_scores, pe_results, pe_exhibits, and comparisons data paths. Done means baselines are registry-backed, existing data is migrated, executed and claimed baselines are exposed and mismatches are annotated, and every score displays its baseline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100