PolicyEngine / PolicyEngine/microcosm
Kill the count/mean aggregation vocabulary everywhere above the compiler
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 4
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 94
Description
From the 8/13 data weekly. The target compiler already enforces sum-only — SUPPORTED_LEDGER_AGGREGATIONS = frozenset(("sum",)) (packages/microcosm-build/src/microcosm/build/ledger_targets.py:22), with the single declared time_mean carve-out for facts Chronicle asserts are means over time. Counts are sums of indicator/person-count variables; there are no mean targets.
But the count/mean vocabulary keeps resurfacing in layers ABOVE the compiler and has confused the team repeatedly ("we were stuck on this a lot" — María). Known survivals:
- the calibration dashboard's target card shows an "aggregation: sum" field as if count/mean were live alternatives (Anthony removing);
- "source concept" / "measure concept" fields — terminology from the count-era target construction (María traced the lineage in the meeting);
- any remaining
count/meanbranches or labels in Chronicle→target compilation helpers and their tests.
Definition of done: grep-clean above the compiler — no aggregation enum, label, or doc implies non-sum targets exist; the dashboard card reduces toward "Chronicle entry + operations applied" per the operation-taxonomy direction; a compiler-level comment states the sum-only rule and the time_mean carve-out so the next reader doesn't re-invent the taxonomy.
Related meeting rulings recorded for coordination: geography is a plain constraint (thin presentation layers only), and the Chronicle-fact → target operation taxonomy (aging, entity conversion, subsetting) is the enumeration that makes targets code-free — María has partial issues on the UK epic; Anthony defining the lineage schema.
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
Start with packages/microcosm-build/src/microcosm/build/ledger_targets.py:22 and search above the compiler for count/mean branches, labels, enums, and documentation, including the calibration dashboard target card and Chronicle-to-target helpers. Check the related tests while tracing each occurrence. Done means only sum targets remain, the time_mean carve-out is documented at compiler level, and the dashboard wording follows the stated operation-taxonomy direction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100