Update homepage typewriter prompts with PolicyEngine-computed shares#1022
Open
MaxGhenis wants to merge 2 commits into
Open
Update homepage typewriter prompts with PolicyEngine-computed shares#1022MaxGhenis wants to merge 2 commits into
MaxGhenis wants to merge 2 commits into
Conversation
The hardcoded `winnerPct` and `loserPct` values on the homepage were estimates. Replace them with values computed from actual PolicyEngine 2026 simulations and fix several prompts that were factually wrong: US: - "make the standard deduction universal" — the SD is already effectively universal, so the prompt is a no-op. Replaced with "make the Child Tax Credit fully refundable", which is the actual reform the displayed share captures. - "make the TCJA provisions permanent" — OBBBA already permanentized TCJA in 2025. Replaced with "the no-tax-on-tips deduction". - "expanding Medicaid eligibility" — PolicyEngine's Medicaid model is thin and the prior reform path produced a $0 sim. Replaced with "the senior bonus deduction" (an actual OBBBA provision). - "a flat tax at 25%" — replaced with "raising all income tax rates by 5 points" so the prompt matches the simulated reform. - "capping itemized deductions at $50,000" — PE-US has no clean parameter for an aggregate itemized cap. Replaced with "lowering the SALT cap to $10,000". UK: - "who gains from abolishing the personal allowance" → "who loses". Existing percentages already implied losers; the wording was wrong. - "who benefits from tapering the higher rate threshold" → "who loses from lowering the higher rate threshold to £40,000". - "the marginal tax rate cliff at Universal Credit taper" — the UC taper is a 55% plateau, not a cliff. Replaced with "doubling the UC work allowance". - "scrapping the two-child limit" — the limit is already inf in the PE-UK baseline. Replaced with "doubling child benefit". - "whether Universal Credit cuts push families into poverty" — vague. Replaced with "cutting the UC standard allowance by £10/week". - "means-testing the state pension" — not modelled. Replaced with "a 5% cut to the state pension". - "a £2,000 UBI" — no clean PE parameter. Replaced with "a £40/week universal child benefit". All values produced by the policyengine-prompt-impacts package (new repo: https://github.com/PolicyEngine/policyengine-prompt-impacts). The package owns the reform definitions, runs them against the PolicyEngine 2026 baseline, and emits the array literal pasted into this file. Regenerate via: policyengine-prompt-impacts run --country all --tsx prompts.tsx Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Three fixes from the policyengine-prompt-impacts review: - "raising the top rate to 45%" loserPct corrects from 0.02 to 0.008 (the package previously bumped both bracket 6 and bracket 7; bracket 7 alone is the correct top-rate-only reform). - Two UK prompts dropped the "helps workers" framing — "reducing the UC taper rate to 45%" → "affects workers"; "doubling the UC work allowance" → "who gains from doubling the UC work allowance". - "removing the SALT cap on high earners" → "the distributional impact of removing the SALT cap" (the simulation should reveal the affected group, not the prompt). - Sub-0.2% values previously surfaced as 0.001 (state-tax interaction noise on federal-only reforms). The package now floors these to 0. - "revenue from a 50p additional rate" wraps to multi-line for consistency with surrounding entries (prettier). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The hardcoded
winnerPct/loserPctvalues for the homepage typewriter prompts were guesses. This PR replaces them with values computed from actual PolicyEngine 2026 microsimulations and fixes several prompts that were factually wrong (described a non-reform, used outdated framing, or pointed at parameters PolicyEngine doesn't currently model).The simulation tooling lives in a new repo so it can be re-run on every PolicyEngine bump: https://github.com/PolicyEngine/policyengine-prompt-impacts.
Prompt changes
US
UK
loserPct: 0.85already implied losersinfin the PE-UK baselineThe remaining 19 prompts keep their text; only the percentages change to reflect the live PE 2026 calculations.
How values are computed
Every prompt is paired with a PolicyEngine reform dict in
policyengine-prompt-impacts/src/policyengine_prompt_impacts/reforms/{uk,us}.py. The runner builds a baselineMicrosimulation, builds a reformedMicrosimulation, and reports:share_gain= weighted share of households whosehousehold_net_incomeincreases by more than 1 currency unitshare_lose= weighted share whose net income decreases by more than 1 currency unitFor prompts of the form "who benefits from <existing OBBBA provision>" the simulated reform is the repeal and the displayed values are flipped (
Reform.swap=True).To regenerate after a PE bump:
Test plan
bun run typecheckpasses locally (verified)bun run test— homepage tests pass (verified, 109 passed)/us→ typewriter cycles through the new US prompts, household graph dot shares match the new winner/loser values/uk→ typewriter cycles through the new UK prompts; £ characters render literally (verified — no£escapes)🤖 Generated with Claude Code