PolicyEngine / PolicyEngine/chronicle

build-bundle silently skips packages whose aliases drifted from the db/data layout

Open
#78 0 comments 0 reactions 0 assignees View on GitHub

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.