PolicyEngine / PolicyEngine/chronicle
build-bundle silently skips packages whose aliases drifted from the db/data layout
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 11h 48m
- Merged PRs (30d)
- 45
Description
Problem
SOURCE_PACKAGE_ALIASES has drifted out of sync with the reorganized db/data manifests and packages/* directory layout, so ledger build-bundle (which iterates the alias map) silently skips the renamed/consolidated packages instead of failing.
Observed while rebuilding the canonical consumer_facts.jsonl for the populace US build (2026-07-03): the alias-driven path could not reproduce a complete export. Examples of drifted entries:
- PEP national + state aliases → now
census/pep_2024_age_sex - two IRA packages → consolidated into
irs_soi/ira_contributions z1_household_net_worth→ renamed..._2026
Workaround used: iterate packages/*/*/source_package.yaml directly (the authoring surface), which produced 78,089 consumer fact rows vs the incomplete alias-driven set.
Why it matters
A silently-incomplete facts export propagates into consumer builds as "reference did not match a Ledger fact identifier" failures far downstream (or worse, missing targets that don't fail at all) — this is how the populace fiscal-refresh build broke on jct.tax_expenditures.cy2024.salt_deduction.revenue_loss.
Suggested fix
Re-sync the alias map to the current layout, and make build-bundle fail loudly when an alias resolves to a missing directory (or derive the package list from packages/* and drop the parallel alias map entirely).
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
Trace the ledger build-bundle entry point and the SOURCE_PACKAGE_ALIASES map, then compare its resolved directories with db/data manifests and packages/*/*/source_package.yaml. Rebuild consumer_facts.jsonl to verify renamed and consolidated packages are included; done means missing aliases no longer produce a silent incomplete export and are either corrected or reported loudly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100