Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The public Claude marketplace repo stays at `PolicyEngine/policyengine-claude`,

Skills teach the current stack: the `policyengine` package
(`pe.us.calculate_household`, population `Simulation`, `economic_impact_analysis`)
over certified Populace datasets. Code examples marked `<!-- verify -->` are
over certified Microcosm datasets. Code examples marked `<!-- verify -->` are
executed in CI against the latest release, and an anti-rot lint bans the stale
patterns (archived dataset URIs, deleted APIs) that degraded the previous catalog.

Expand Down
8,295 changes: 4,047 additions & 4,248 deletions dashboard/src/data/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dashboard/src/pages/Guides.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function ReformPipelineGuide() {
<strong>Score &amp; verify.</strong> Runs <code>/analyze-policy</code> inline:
bill text → provisions → parameter mapping → prior anchors → microsim →
comparison against external benchmarks (JCT, CBO, CRFB, TPC, TF) → the
data-calibration check (is the populace release well-calibrated for this
data-calibration check (is the Microcosm release well-calibrated for this
reform's variables?). Yields a verdict — see the /analyze-policy guide.
</li>
<li>
Expand Down
4 changes: 2 additions & 2 deletions docs/structured-output-and-chaining.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ report-logger) gains an extra "Also queue…?" line:
Where should this analysis go?

[x] Local archive
[ ] GitHub issue: PolicyEngine/policyengine-us-data
[ ] GitHub issue: PolicyEngine/microcosm
[ ] Also queue: /encode-policy-v2 (this reform's structural provisions)
[ ] Also queue: /generate-content (blog draft from the analysis)
[ ] Also queue: /review-program on the parameter files this reform touches
Expand All @@ -139,7 +139,7 @@ Verdict → follow-up mapping:
|---|---|
| `PASS` | `/generate-content` → blog post draft |
| `PASS-WITH-NOTES` / `PASS-WITH-CORROBORATION` | `/generate-content` → blog post draft (with notes/caveats section) |
| `INVESTIGATE` | already handled: GH issue in `policyengine-{country}-data` |
| `INVESTIGATE` | already handled: GH issue in the country's data repo (`us` → `PolicyEngine/microcosm`; others → `policyengine-{country}-data`) |
| `structural` | `/encode-policy-v2` → scaffold the required model extension |
| `not-possible` | none |
| `deployed-model-lag` | re-run scheduled for next release (cron-style: after the next `uv pip install -U policyengine-{country}`) |
Expand Down
2 changes: 1 addition & 1 deletion docs/when-to-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ These get pulled in automatically by their trigger keywords, but useful to know
- `policyengine-model-development` — the consolidated engineering skill; its references/ cover variables, parameters, periods, vectorization, tests, and in-model reforms

**Data pipeline / calibration**:
- `policyengine-data` — the Populace stack: certified releases, local-area filtering, fit/calibrate/L0
- `policyengine-data` — the Microcosm stack: certified releases, local-area filtering, fit/calibrate/L0
- `policyengine-calibration-diagnostics` — deviation-signature → calibration-lever registry

**Frontend / dashboards**:
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ def owner_for_artifact(art: Artifact) -> str:
if art.category in {"data-science", "data"} or scope & {
"policyengine-us-data",
"policyengine-uk-data",
"populace",
"microcosm",
"microdf",
"microimpute",
"microcalibrate",
Expand Down
12 changes: 6 additions & 6 deletions scripts/functional_tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"id": "policyengine",
"role": "analysis:python",
"summary": "Canonical Python interface: household calculations, population microsimulation, reform scoring, regional breakdowns via the policyengine package and Populace datasets.",
"summary": "Canonical Python interface: household calculations, population microsimulation, reform scoring, regional breakdowns via the policyengine package and Microcosm datasets.",
"scope_repos": [
"policyengine.py"
],
Expand Down Expand Up @@ -79,9 +79,9 @@
{
"id": "policyengine-data",
"role": "data:populace",
"summary": "The Populace data stack: certified releases, dataset names, local-area filtering, fit/calibrate/L0 concepts.",
"summary": "The Microcosm data stack: certified releases, dataset names, local-area filtering, fit/calibrate/L0 concepts.",
"scope_repos": [
"populace"
"microcosm"
],
"supersedes": [
"policyengine-us-data",
Expand All @@ -97,7 +97,7 @@
"role": "data:diagnostics",
"summary": "Sensitivity registry mapping simulation-vs-benchmark deviations to likely calibration levers.",
"scope_repos": [
"populace"
"microcosm"
],
"supersedes": []
},
Expand Down Expand Up @@ -612,7 +612,7 @@
"role": "analysis:calibration-diagnostics",
"summary": "Stage-6 diagnostic \u2014 hypothesizes which calibration targets are driving a microsim mismatch.",
"scope_repos": [
"policyengine-us-data",
"microcosm",
"policyengine-uk-data",
"calibration-diagnostics"
]
Expand Down Expand Up @@ -1060,4 +1060,4 @@
"supersedes": []
}
]
}
}
4 changes: 2 additions & 2 deletions skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lints the whole tree against the failure modes that rotted the previous catalog

| Skill | What it carries |
|---|---|
| **policyengine** | The canonical Python interface: `pe.us/uk.calculate_household`, population `Simulation` + `economic_impact_analysis` + `calculate_budgetary_impact`, Populace datasets, regional analysis, reform formats, MicroSeries weighting discipline |
| **policyengine** | The canonical Python interface: `pe.us/uk.calculate_household`, population `Simulation` + `economic_impact_analysis` + `calculate_budgetary_impact`, Microcosm datasets, regional analysis, reform formats, MicroSeries weighting discipline |
| **policyengine-prior-scores** | Published reform-score anchors (JCT/CBO/TPC/PE) and the scorekeepers registry, with comparability caveats |

### Domain knowledge
Expand All @@ -42,7 +42,7 @@ lints the whole tree against the failure modes that rotted the previous catalog

| Skill | What it carries |
|---|---|
| **policyengine-data** | The Populace stack: certified releases, dataset registry, local-area filtering philosophy, fit/calibrate/L0 concepts, where to file data work |
| **policyengine-data** | The Microcosm stack: certified releases, dataset registry, local-area filtering philosophy, fit/calibrate/L0 concepts, where to file data work |
| **policyengine-calibration-diagnostics** | Deviation-signature → calibration-lever sensitivity registry |

### Apps
Expand Down
20 changes: 10 additions & 10 deletions skills/policyengine-calibration-diagnostics/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: policyengine-calibration-diagnostics
description: |
Sensitivity registry for PolicyEngine microsim results — maps {program x deviation signature}
to the calibration target or imputed variable most likely driving a mismatch, and reads the
live per-target diagnostics for the current Populace release. The knowledge base behind the
live per-target diagnostics for the current Microcosm release. The knowledge base behind the
calibration-diagnostics agent and /analyze-policy Stage 5.6.
Load when investigating why a microsim result differs from a prior score, or when reviewing
whether a reform classification is calibration-sensitive.
Triggers: "why does my reform not match", "policyengine cost off", "calibration mismatch",
"imputed variable", "takeup rate", "non-filer", "itemizer share", "small state variance",
"calibration target", "populace target", "calibration dashboard", "target-diagnostics",
"calibration target", "Microcosm (formerly Populace) target", "calibration dashboard", "target-diagnostics",
"relative_error", "diagnose mismatch", "deviation signature".
metadata:
category: data
Expand All @@ -22,16 +22,16 @@ registry, and pairs it with the live per-target calibration API so hypotheses ar
real `relative_error` numbers rather than assumptions. When an `/analyze-policy` comparison
returns INVESTIGATE, this skill supplies the ranked candidate causes.

The calibrated microdata is now a **Populace** build (see the `policyengine-data` skill for how
targets, weights, and L0 sparsity work). Calibration targets live in the populace build's target
The calibrated microdata is now a **Microcosm** build (see the `policyengine-data` skill for how
targets, weights, and L0 sparsity work). Calibration targets live in the Microcosm build's target
set — not in a hand-maintained loss file — and their fit is queryable per release from the
dashboard API below.

## When to use

- Stage 5.6 / Stage 6 of `/analyze-policy` — invoked by the `calibration-diagnostics` agent.
- Code review of microsim PRs where the headline number differs from priors.
- Designing or auditing a populace calibration target.
- Designing or auditing a Microcosm calibration target.
- Debugging why a state-level run looks volatile.

## Top-level architecture
Expand All @@ -40,7 +40,7 @@ PolicyEngine microsim results depend on three layers:

1. **Country model logic** (policyengine-us, policyengine-uk, policyengine-canada) — formulas,
parameters.
2. **Calibrated microdata** (Populace) — survey weights + imputations matched to administrative
2. **Calibrated microdata** (Microcosm) — survey weights + imputations matched to administrative
targets.
3. **Behavioral assumptions** (takeup rates, labor-supply elasticities) — usually parameters but
easy to overlook.
Expand All @@ -50,7 +50,7 @@ show up as outright simulation errors, not magnitude drift).

## Live calibration API (check this first)

Per-target fit for the current populace release, no auth, reads the release from Hugging Face:
Per-target fit for the current Microcosm release, no auth, reads the release from Hugging Face:

```
BASE = https://calibration-diagnostics.vercel.app/calibration/dashboard/api/populace
Expand Down Expand Up @@ -164,13 +164,13 @@ imputation. If your deviation signature touches any of these, widen the confiden
## Sources

- **`calibration-diagnostics.vercel.app`** — live per-target diagnostics API and dashboard (first
stop; reads the current populace release). Source: `github.com/PolicyEngine/calibration-diagnostics`.
- **`PolicyEngine/populace`** — where calibration targets, weights, and the L0 sparsity live; the
stop; reads the current Microcosm release). Source: `github.com/PolicyEngine/calibration-diagnostics`.
- **`PolicyEngine/microcosm`** — where calibration targets, weights, and the L0 sparsity live; the
build that produces the certified dataset. See the `policyengine-data` skill.
- `github.com/PolicyEngine/policyengine-us/issues` — known program-level model issues.

## Related skills

- `policyengine-data` — how Populace builds targets, weights, and the sparse-vs-dense tradeoff.
- `policyengine-data` — how Microcosm builds targets, weights, and the sparse-vs-dense tradeoff.
- `policyengine-prior-scores` — what a run is being compared against.
- `policyengine` — running the perturbation tests this skill recommends.
Loading
Loading