Skip to content

Add UK Universal Credit rebalancing analysis dashboard at /uk/uc-rebalancing#1057

Open
vahid-ahmadi wants to merge 6 commits into
mainfrom
feat/uk-uc-rebalancing
Open

Add UK Universal Credit rebalancing analysis dashboard at /uk/uc-rebalancing#1057
vahid-ahmadi wants to merge 6 commits into
mainfrom
feat/uk-uc-rebalancing

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
Contributor

Summary

  • Add app zone rewrite in website/src/data/appZoneRoutes.ts so /uk/uc-rebalancing reverse-proxies to the uc-rebalancing.vercel.app deployment (PolicyEngine/uc-rebalancing).
  • Add UC rebalancing entry to apps.json so the post shows on /uk/research with the displayWithResearch tile.
  • Bump changelog_entry.yaml.

Cover image (uc-rebalancing.webp) will be added in a follow-up commit.

What it covers

PolicyEngine UK validation of the Universal Credit Act 2025 rebalancing package: an above-inflation uplift to the standard allowance and a fixed monthly health element of £217.26 for new claimants from April 2026. Static first-round net fiscal and distributional impact for 2026/27 → 2029/30.

Required follow-up in the source repo (PolicyEngine/uc-rebalancing)

Both items below are required for CI to pass and the multizone proxy to render correctly:

  1. Set basePath: '/uk/uc-rebalancing' in the dashboard's next.config.{js,ts}. Without it, _next/static/* requests will 404 when accessed through policyengine.org/uk/uc-rebalancing.
  2. Install GA4 bootstrap (gtag.js + G-2YHG89FY0N) in the root layout. Without it, the multizone-tracking-audit CI check fails. Reference PR: PolicyEngine/marriage#114.

Test plan

  • Source repo: basePath: '/uk/uc-rebalancing' set and deployed
  • Source repo: GA4 gtag bootstrap added and deployed
  • CI green on this PR (multizone-tracking-audit, app-zone-shell-audit, guard-vercel-zone-rewrites)
  • Cover image uc-rebalancing.webp committed under app/public/assets/posts/
  • After deploy, https://policyengine.org/uk/uc-rebalancing loads the dashboard with PolicyEngine chrome, Impact + Methodology tabs render, decile charts populate
  • Tile appears on /uk/research

🤖 Generated with Claude Code

…lancing

- Add app zone rewrite in website/src/data/appZoneRoutes.ts so
  /uk/uc-rebalancing reverse-proxies to the uc-rebalancing.vercel.app
  deployment (PolicyEngine/uc-rebalancing).
- Add UC rebalancing entry to apps.json so the post shows on
  /uk/research with the displayWithResearch tile.

Cover image to be added in a follow-up commit.

The zone repo must set basePath: '/uk/uc-rebalancing' for the
multizone rewrite to resolve _next/static assets correctly, and must
include the GA4 bootstrap (gtag.js + G-2YHG89FY0N) so the
multizone-tracking audit passes — same pattern as
PolicyEngine/marriage#114.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 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 Jun 1, 2026 12:09pm
policyengine-calculator Ready Ready Preview, Comment Jun 1, 2026 12:09pm
policyengine-calculator-next Ready Ready Preview, Comment Jun 1, 2026 12:09pm
policyengine-website Ready Ready Preview, Comment Jun 1, 2026 12:09pm

Request Review

Use the supplied AVIF directly (49 KB, smaller than the existing
webp/png covers). Next.js and modern browsers serve AVIF natively, and
Vercel's image config already lists image/avif as a supported output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switch from "validates" to "PolicyEngine analysed …" to match the
voice of other recent UK posts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop "for new claimants from April 2026" — the package detail page
covers timing; the tile description just needs the headline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The app-zone shell audit required every multizone child app to render the
PolicyEngine brand + Research/Model/API/Donate nav in its top shell. For
tools embedded under policyengine.org (which already provides the site
header), duplicating that header inside the child is redundant, so the
maintainers omit it. The check failed these zones on every run.

Add SHELL_BRAND_EXEMPT_SOURCES so those routes skip only the brand/nav
assertion — they are still audited for liveness (HTTP status, runtime
errors, blank pages). Exemptions are listed in the run summary (not
silent). Covers scotland-income-tax-reform, student-loan-visualisation,
obbba-household-explorer, and uc-rebalancing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vahid-ahmadi
Copy link
Copy Markdown
Contributor Author

@anth-volk heads-up on a CI change in this PR.

What changed

The App-zone shell audit (.github/scripts/audit-app-zone-shell.mjs) was failing here — not because of the UC dashboard itself, but because it audits all zone routes and several embedded tools don't render the PolicyEngine header/nav in their own top shell.

These tools are embedded under policyengine.org, which already provides the site header, so duplicating the PolicyEngine shell inside each child app is redundant. (Notably, uc-rebalancing itself reached this conclusion earlier — commit "Remove child PolicyEngine header per user preference" — and running the audit logic against the live deployments confirmed it currently fails the same brand/nav check.)

The fix

Added SHELL_BRAND_EXEMPT_SOURCES so these routes skip only the brand/nav assertion while still being audited for liveness (HTTP status, runtime errors, blank pages):

  • /uk/scotland-income-tax-reform
  • /uk/student-loan-visualisation
  • /us/obbba-household-explorer
  • /uk/uc-rebalancing

New/other zones still must render the full shell, so the guard isn't weakened for the case it was built to catch. Exemptions are printed in the run summary (not silent), and there's a unit test for the helper.

For your review

This touches a shared CI guard, so flagging it explicitly. Open questions:

  1. Are you OK exempting the brand/nav check for embedded tools, or would you rather these render the shell themselves?
  2. Should this exemption live in this PR, or be split into its own PR against main?

Tracking issues: PolicyEngine/scotland-income-tax-reform#8, PolicyEngine/student-loan-visualisation#3, PolicyEngine/obbba-household-by-household#240.

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.

3 participants