PolicyEngine / PolicyEngine/policyengine-app-v2

Update modelled_policies handling for programs.yaml structural changes

Open
#779 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1
Forks
3
Avg merge
1d 50m
Merged PRs (30d)
39

Description

Context

policyengine-us#7716 updates the structure of policyengine_us/programs.yaml, changing the verified_years string field to separate verified_start_year/verified_end_year integers.

This matters for app-v2 because modelled_policies in the API metadata response is sourced directly from programs.yaml via the modelled_policies class attribute in policyengine_us/system.py:

modelled_policies = COUNTRY_DIR / "programs.yaml"

Current state in app-v2

  • metadataUtils.ts:181 reads data.modelled_policies and normalises it into state with a safe fallback (?? { core: {}, filtered: {} })
  • metadataReducer.ts stores it as state.modelledPolicies
  • The type is defined in types/metadata.ts
  • No UI component in app-v2 currently renders this data (unlike the old app, which had PoliciesModelledPopup.jsx)

What needs to happen

  1. Update the modelled_policies TypeScript type in types/metadata.ts to reflect the new verified_start_year/verified_end_year integer fields once PR #7716 merges
  2. Decide whether to implement a UI equivalent to the old app's PoliciesModelledPopup using this richer structured data, or keep it as unused state

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with types/metadata.ts, then trace app/src/libs/metadataUtils.ts:181 and app/src/reducers/metadataReducer.ts:99 to understand the current modelled_policies flow. Review policyengine-us PR #7716 and the old PoliciesModelledPopup.jsx reference; done means the TypeScript type matches the new fields and the issue's UI-versus-unused-state decision is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.