PolicyEngine / PolicyEngine/microcosm

Kill the count/mean aggregation vocabulary everywhere above the compiler

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

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/mean branches 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.