Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

Fix UK behavioral response calculations returning zero FTE impacts - #2740

Merged
nikhilwoodruff merged 2 commits into
masterfrom
fix-uk-behav-responses
Sep 1, 2025
Merged

nikhilwoodruff merged 2 commits into
masterfrom
fix-uk-behav-responses

Conversation

@vahid-ahmadi

@vahid-ahmadi vahid-ahmadi commented Aug 28, 2025 •

Copy link
Copy Markdown
Collaborator

Fixes #2741

Problem

The behavioral response implementation for the UK was systematically returning zero FTE (Full-Time Equivalent) impacts despite valid policy reforms with significant income effects. This affected the accuracy of dynamic scoring for tax and benefit policy changes on the UK site.

Root Cause

The web application was using outdated parameter names that don't match what the UK backend API expects for behavioral response elasticities. While the US parameters were correctly configured, the UK parameters were using an old naming convention (gov.simulation.labor_supply_responses.*) instead of the correct API parameters.

Solution

Updated the behavioral response parameter names in PolicyRightSidebar.jsx to match the UK API expectations:

  • Changed gov.simulation.labor_supply_responses.income_elasticity → gov.behavioral_responses.labor_supply_income_elasticity
  • Changed gov.simulation.labor_supply_responses.substitution_elasticity → gov.behavioral_responses.labor_supply_substitution_elasticity

@vahid-ahmadi vahid-ahmadi self-assigned this Aug 28, 2025
Copilot AI review requested due to automatic review settings August 28, 2025 16:15
@vercel

vercel Bot commented Aug 28, 2025 •

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
policyengine-app Ready Ready Preview Comment Aug 28, 2025 4:21pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request fixes a bug where UK behavioral response calculations were returning zero FTE impacts due to mismatched parameter names between the frontend and backend API. The fix updates the parameter names to use the correct UK API naming convention.

  • Updated behavioral response parameter names for UK calculations to match backend API expectations
  • Changed from old gov.simulation.labor_supply_responses.* naming to correct gov.behavioral_responses.* naming
  • Added changelog entry documenting the fix

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/pages/policy/PolicyRightSidebar.jsx Updated UK behavioral response parameter names to match API expectations
changelog_entry.yaml Added changelog entry for the bug fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread changelog_entry.yaml
@nikhilwoodruff
nikhilwoodruff merged commit dd6b063 into master Sep 1, 2025
4 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in policyengine-app Sep 1, 2025
@nikhilwoodruff
nikhilwoodruff deleted the fix-uk-behav-responses branch September 1, 2025 13:17

This branch was successfully deployed

1 active deployment
Preview — 244ef93a Deployed Aug 28, 2025 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Debug UK behavioral response calculations returning zero FTE impacts

3 participants