Skip to content

Update homepage typewriter prompts with PolicyEngine-computed shares#1022

Open
MaxGhenis wants to merge 2 commits into
mainfrom
audit-homepage-prompts
Open

Update homepage typewriter prompts with PolicyEngine-computed shares#1022
MaxGhenis wants to merge 2 commits into
mainfrom
audit-homepage-prompts

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

The hardcoded winnerPct / loserPct values 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

Old prompt Why it changed New prompt
"the cost of making the standard deduction universal" SD is already effectively universal "the cost of making the Child Tax Credit fully refundable"
"the impact of making the TCJA provisions permanent" OBBBA permanentized TCJA in 2025 "who benefits from the no-tax-on-tips deduction"
"who benefits from expanding Medicaid eligibility" PE-US Medicaid modelling is thin; sim produced $0 change "who benefits from the senior bonus deduction"
"how a flat tax at 25% compares to the current system" Ambiguous about how it interacts with deductions "the impact of raising all income tax rates by 5 points"
"how capping itemized deductions at $50,000 affects revenue" PE-US has no clean aggregate-itemized-cap parameter "the revenue from lowering the SALT cap to $10,000"

UK

Old prompt Why it changed New prompt
"who gains from abolishing the personal allowance" Hardcoded loserPct: 0.85 already implied losers "who loses from abolishing the personal allowance"
"who benefits from tapering the higher rate threshold" Same gain/loss mismatch "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 "how doubling the UC work allowance helps workers"
"how scrapping the two-child limit affects large families" The limit is already inf in the PE-UK baseline "the cost of doubling child benefit"
"whether Universal Credit cuts push families into poverty" Vague — doesn't map to a parameter change "the poverty impact of cutting the UC standard allowance by £10/week"
"who loses from means-testing the state pension" Means-testing isn't currently modelled "who loses from a 5% cut to the state pension"
"how a £2,000 UBI would affect child poverty" No clean PolicyEngine parameter for a per-person UBI "the poverty impact of a £40/week universal child benefit"

The 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 baseline Microsimulation, builds a reformed Microsimulation, and reports:

  • share_gain = weighted share of households whose household_net_income increases by more than 1 currency unit
  • share_lose = weighted share whose net income decreases by more than 1 currency unit

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

policyengine-prompt-impacts run --country all --tsx prompts.tsx

Test plan

  • bun run typecheck passes locally (verified)
  • bun run test — homepage tests pass (verified, 109 passed)
  • Visit /us → typewriter cycles through the new US prompts, household graph dot shares match the new winner/loser values
  • Visit /uk → typewriter cycles through the new UK prompts; £ characters render literally (verified — no £ escapes)
  • Vercel preview deploys cleanly

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment May 9, 2026 1:16am
policyengine-calculator Ready Ready Preview, Comment May 9, 2026 1:16am
policyengine-calculator-next Ready Ready Preview, Comment May 9, 2026 1:16am
policyengine-website Ready Ready Preview, Comment May 9, 2026 1:16am

Request Review

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant