Repository: PolicyEngine/policyengine-us (language: python)

Issue:
Calculation issue in various state-level taxes
While doing some testing on the Policy2Code back-end changes, I find that even when calculating outputs for a family from Alabama, I receive a value for both of these variables that does not equal the default value defined in the metadata. There may be some sort of calculation issue here, perhaps not checking to ensure the household lives in Illinois (unless Illinois collects universally, which I wouldn't put past them).


Discussion / hints:
Indeed, missing `defined_for = StateCode.IL`: https://github.com/PolicyEngine/policyengine-us/blob/master/policyengine_us/variables/gov/states/il/tax/income/credits/il_eitc.py
This is also true for `mt_eitc`, as well as potentially some other Illinois taxes and credits.
There should be a couple of state level variables - need to check and add a defined for 

Fix patch:
diff --git a/changelog_entry.yaml b/changelog_entry.yaml
index e69de29bb2d..dce3e8d6c46 100644
--- a/changelog_entry.yaml
+++ b/changelog_entry.yaml
@@ -0,0 +1,4 @@
+- bump: patch
+  changes:
+    fixed:
+    - Add defined_for metadata for all state level variables.
diff --git a/policyengine_us/variables/gov/states/ca/tax/income/credits/earned_income/ca_is_qualifying_child_for_caleitc.py b/policyengine_us/variables/gov/states/ca/tax/income/credits/earned_income/ca_is_qualifying_child_for_caleitc.py
index a2f8fd7eb77..f247cae94f2 100644
--- a/policyengine_us/variables/gov/states/ca/tax/income/credits/earned_income/ca_is_qualifying_child_for_caleitc.py
+++ b/policyengine_us/variables/gov/states/ca/tax/income/credits/earned_income/ca_is_qualifying_child_for_caleitc.py
@@ -7,6 +7,7 @@ class ca_is_qualifying_child_for_caleitc(Variable):
     label = "Child qualifies for CalEITC"
     definition_period = YEAR
     reference = "https://www.ftb.ca.gov/file/personal/credits/EITC-calculator/Help/QualifyingChildren"
+    defined_for = StateCode.CA
 
     def formula(person, period, parameters):
         # CalEITC uses federal EITC rules regarding qualifying children
diff --git a/policyengine_us/variables/gov/states/ct/tax/income/additions/ct_section_179_expense_add_back.py b/policyengine_us/variables/gov/states/ct/tax/income/additions/ct_section_179_expense_add_back.py
index 394f6ad4b34..162afc218b8 100644
--- a/policyengine_us/variables/gov/states/ct/tax/income/additions/ct_section_179_expense_add_back.py
+++ b/policyengine_us/variables/gov/states/ct/tax/income/additions/ct_section_179_expense_add_back.py
@@ -8,4 +8,5 @@ class ct_section_179_expense_add_back(Variable):
     definition_period = YEAR
     documentation = "Add 80 percent of the section 179 amount deducted in determining federal AGI."
     reference = "https://portal.ct.gov/-/media/DRS/Forms/2022/Income/2022-CT-1040-Instructions_1222.pdf#page=7"
+    defined_for = StateCode.CT
     # use federal variables if they are added later
diff --git a/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income.py b/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income.py
index d019b6b7980..0bfc4d61260 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income.py
@@ -7,6 +7,7 @@ class il_base_income(Variable):
     label = "IL base income"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     adds = ["adjusted_gross_income", "il_base_income_additions"]
     subtracts = ["il_base_income_subtractions"]
diff --git a/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income_additions.py b/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income_additions.py
index 4b0d820e397..b2e461a9c0e 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income_additions.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income_additions.py
@@ -7,5 +7,6 @@ class il_base_income_additions(Variable):
     label = "IL base income additions"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     adds = "gov.states.il.tax.income.base.additions"
diff --git a/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income_subtractions.py b/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income_subtractions.py
index 44b7194e025..2b644b5ccde 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income_subtractions.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/base_income/il_base_income_subtractions.py
@@ -7,5 +7,6 @@ class il_base_income_subtractions(Variable):
     label = "IL base income subtractions"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     adds = "gov.states.il.tax.income.base.subtractions"
diff --git a/policyengine_us/variables/gov/states/il/tax/income/credits/il_eitc.py b/policyengine_us/variables/gov/states/il/tax/income/credits/il_eitc.py
index 2aec09cf64f..21dc19e29a0 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/credits/il_eitc.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/credits/il_eitc.py
@@ -8,6 +8,7 @@ class il_eitc(Variable):
     unit = USD
     definition_period = YEAR
     reference = "https://www2.illinois.gov/rev/programs/EIC/Pages/default.aspx"
+    defined_for = StateCode.IL
 
     def formula(tax_unit, period, parameters):
         federal_eitc = tax_unit("eitc", period)
diff --git a/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_aged_blind_exemption.py b/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_aged_blind_exemption.py
index e4e52405044..6b7a16aaa8b 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_aged_blind_exemption.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_aged_blind_exemption.py
@@ -7,6 +7,7 @@ class il_aged_blind_exemption(Variable):
     label = "IL aged and blind exemption"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     def formula(tax_unit, period, parameters):
         aged_blind_count = tax_unit("aged_blind_count", period)
diff --git a/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_dependent_exemption.py b/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_dependent_exemption.py
index 0c4c17c6309..55d258c4648 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_dependent_exemption.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_dependent_exemption.py
@@ -7,6 +7,7 @@ class il_dependent_exemption(Variable):
     label = "Illinois dependent exemption"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     def formula(tax_unit, period, parameters):
         amount = parameters(
diff --git a/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_personal_exemption.py b/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_personal_exemption.py
index 4aef9d8dc62..4ee5e2eafa3 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_personal_exemption.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_personal_exemption.py
@@ -7,6 +7,7 @@ class il_personal_exemption(Variable):
     label = "Illinois personal exemption amount"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     def formula(tax_unit, period, parameters):
         il_is_personal_exemption_eligible = tax_unit(
diff --git a/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_personal_exemption_eligibility_status.py b/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_personal_exemption_eligibility_status.py
index 9b90cb02500..aaf9d533487 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_personal_exemption_eligibility_status.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/exemptions/il_personal_exemption_eligibility_status.py
@@ -16,6 +16,7 @@ class il_personal_exemption_eligibility_status(Variable):
         "Whether The Tax Unit Is Eligible For The Illinois Personal Exemption"
     )
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     def formula(tax_unit, period, parameters):
         personal_eligibility_amount = parameters(
diff --git a/policyengine_us/variables/gov/states/il/tax/income/il_taxable_income.py b/policyengine_us/variables/gov/states/il/tax/income/il_taxable_income.py
index 71e785e4685..fe7c0055b66 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/il_taxable_income.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/il_taxable_income.py
@@ -7,6 +7,7 @@ class il_taxable_income(Variable):
     label = "IL taxable income"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     def formula(tax_unit, period, parameters):
         base_income = tax_unit("il_base_income", period)
diff --git a/policyengine_us/variables/gov/states/il/tax/income/il_use_tax.py b/policyengine_us/variables/gov/states/il/tax/income/il_use_tax.py
index a1b27889348..58670af4256 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/il_use_tax.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/il_use_tax.py
@@ -7,6 +7,7 @@ class il_use_tax(Variable):
     label = "IL use tax"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
 
     def formula(tax_unit, period, parameters):
         # Tiered amount if income below a threshold, otherwise a percentage of AGI.
diff --git a/policyengine_us/variables/gov/states/il/tax/income/pass_through/il_pass_through_entity_tax_credit.py b/policyengine_us/variables/gov/states/il/tax/income/pass_through/il_pass_through_entity_tax_credit.py
index 6ce14c83179..2c7dff00a31 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/pass_through/il_pass_through_entity_tax_credit.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/pass_through/il_pass_through_entity_tax_credit.py
@@ -7,3 +7,4 @@ class il_pass_through_entity_tax_credit(Variable):
     label = "IL Pass-Through Entity Tax Credit"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
diff --git a/policyengine_us/variables/gov/states/il/tax/income/pass_through/il_pass_through_withholding.py b/policyengine_us/variables/gov/states/il/tax/income/pass_through/il_pass_through_withholding.py
index 8e68daf59fb..b865e5a6350 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/pass_through/il_pass_through_withholding.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/pass_through/il_pass_through_withholding.py
@@ -7,3 +7,4 @@ class il_pass_through_withholding(Variable):
     label = "IL Pass-Through Withholding"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.IL
diff --git a/policyengine_us/variables/gov/states/il/tax/income/schedule_m/il_schedule_m_additions.py b/policyengine_us/variables/gov/states/il/tax/income/schedule_m/il_schedule_m_additions.py
index 2bd5356fa33..07799801b94 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/schedule_m/il_schedule_m_additions.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/schedule_m/il_schedule_m_additions.py
@@ -8,3 +8,4 @@ class il_schedule_m_additions(Variable):
     unit = USD
     definition_period = YEAR
     reference = "https://www2.illinois.gov/rev/forms/incometax/Documents/currentyear/individual/il-1040-schedule-m.pdf"
+    defined_for = StateCode.IL
diff --git a/policyengine_us/variables/gov/states/il/tax/income/schedule_m/il_schedule_m_subtractions.py b/policyengine_us/variables/gov/states/il/tax/income/schedule_m/il_schedule_m_subtractions.py
index 5ba1638ac8b..2b47ea1858a 100644
--- a/policyengine_us/variables/gov/states/il/tax/income/schedule_m/il_schedule_m_subtractions.py
+++ b/policyengine_us/variables/gov/states/il/tax/income/schedule_m/il_schedule_m_subtractions.py
@@ -8,3 +8,4 @@ class il_schedule_m_subtractions(Variable):
     unit = USD
     definition_period = YEAR
     reference = "https://www2.illinois.gov/rev/forms/incometax/Documents/currentyear/individual/il-1040-schedule-m.pdf"
+    defined_for = StateCode.IL
diff --git a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_add_backs.py b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_add_backs.py
index 5e602bcd372..ed93770a9b6 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_add_backs.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_add_backs.py
@@ -10,6 +10,7 @@ class in_add_backs(Variable):
     reference = (
         "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-1-3.5"
     )
+    defined_for = StateCode.IN
 
     adds = [
         "in_bonus_depreciation_add_back",
diff --git a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_bonus_depreciation_add_back.py b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_bonus_depreciation_add_back.py
index 4aa91e3b1cc..dbc01452ebc 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_bonus_depreciation_add_back.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_bonus_depreciation_add_back.py
@@ -9,3 +9,4 @@ class in_bonus_depreciation_add_back(Variable):
     documentation = "Income (or loss) included in Federal AGI under Section 168(k)'s bonus depreciation less the amount that would have been included without it."
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-1-3.5"  # (a)(15)
     # use federal variables if they are added later
+    defined_for = StateCode.IN
diff --git a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_nol_add_back.py b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_nol_add_back.py
index e70bbbc5ab8..f0864f7a67d 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_nol_add_back.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_nol_add_back.py
@@ -11,3 +11,4 @@ class in_nol_add_back(Variable):
     )
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-1-3.5"  # (a)(16)
     # use federal variables if they are added later
+    defined_for = StateCode.IN
diff --git a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_oos_municipal_obligation_interest_add_back.py b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_oos_municipal_obligation_interest_add_back.py
index e519bb01196..7045f8c06d5 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_oos_municipal_obligation_interest_add_back.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_oos_municipal_obligation_interest_add_back.py
@@ -9,3 +9,4 @@ class in_oos_municipal_obligation_interest_add_back(Variable):
     documentation = "Add back for interest earned from a direct obligation of a state or political subdivision other than Indiana for obligations purchased after Dec. 31, 2011."
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-1-3.5"  # (a)(21)
     # use (total state/municipal obligation interest) - (Indiana's) if those data are added later
+    defined_for = StateCode.IN
diff --git a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_other_add_backs.py b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_other_add_backs.py
index 4b5d9b26d9b..76f7f05bd90 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_other_add_backs.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_other_add_backs.py
@@ -11,3 +11,4 @@ class in_other_add_backs(Variable):
         "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-1-3.5"
     )
     # use federal variables if they are added later
+    defined_for = StateCode.IN
diff --git a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_section_179_expense_add_back.py b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_section_179_expense_add_back.py
index 877cfeea132..ca1ca43b7ab 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_section_179_expense_add_back.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_section_179_expense_add_back.py
@@ -9,3 +9,4 @@ class in_section_179_expense_add_back(Variable):
     documentation = "Federal IRC Section 179 expenses less IRC Section 179 expenses if they had been calculated with a $25,000 ceiling."
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-1-3.5"  # (a)(17)(A)
     # use federal variables if they are added later
+    defined_for = StateCode.IN
diff --git a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_tax_add_back.py b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_tax_add_back.py
index c23054c235d..4cbe3f5f591 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_tax_add_back.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/add_backs/in_tax_add_back.py
@@ -9,3 +9,4 @@ class in_tax_add_back(Variable):
     documentation = "Add backs for certain taxes deducted from federal Schedules C, C-EZ, E and/or F."
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-1-3.5"  # (a)(2)
     # use federal variables if they are added later
+    defined_for = StateCode.IN
diff --git a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_deductions.py b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_deductions.py
index 04ab675b944..e02dadb085d 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_deductions.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_deductions.py
@@ -8,6 +8,7 @@ class in_deductions(Variable):
     unit = USD
     definition_period = YEAR
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3"
+    defined_for = StateCode.IN
 
     adds = [
         "in_renters_deduction",
diff --git a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_homeowners_property_tax_deduction.py b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_homeowners_property_tax_deduction.py
index 2af3c885725..a0a6955d6bf 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_homeowners_property_tax_deduction.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_homeowners_property_tax_deduction.py
@@ -8,6 +8,7 @@ class in_homeowners_property_tax_deduction(Variable):
     unit = USD
     definition_period = YEAR
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3"
+    defined_for = StateCode.IN
 
     def formula(tax_unit, period, parameters):
         p = parameters(period).gov.states["in"].tax.income
diff --git a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_military_service_deduction.py b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_military_service_deduction.py
index f0ee3a48d2e..64088bc87f4 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_military_service_deduction.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_military_service_deduction.py
@@ -8,6 +8,7 @@ class in_military_service_deduction(Variable):
     definition_period = YEAR
     unit = USD
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-2-4"  # (a)(1)
+    defined_for = StateCode.IN
 
     def formula(tax_unit, period, parameters):
         person = tax_unit.members
diff --git a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_nol.py b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_nol.py
index 10d5066b6b8..52243086829 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_nol.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_nol.py
@@ -11,3 +11,4 @@ class in_nol(Variable):
     reference = (
         "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-2-2.5"
     )
+    defined_for = StateCode.IN
diff --git a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_nonpublic_school_deduction.py b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_nonpublic_school_deduction.py
index d037801dfc0..2b2ec2df107 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_nonpublic_school_deduction.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_nonpublic_school_deduction.py
@@ -8,6 +8,7 @@ class in_nonpublic_school_deduction(Variable):
     definition_period = YEAR
     unit = USD
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-2-22"  # (d)(1)
+    defined_for = StateCode.IN
 
     def formula(tax_unit, period, parameters):
         p = (
diff --git a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_other_deductions.py b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_other_deductions.py
index 67325dc86d6..e3650257bea 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_other_deductions.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_other_deductions.py
@@ -9,3 +9,4 @@ class in_other_deductions(Variable):
     definition_period = YEAR
     documentation = "Other deductions available in Indiana including those for civil service annuities, disability retirement, government or civic group capital contributions, human services for Medicaid recipients,  infrastructure fund gifts, indiana lottery winings annuity, Indiana partnership long-term care policy premiums, military retirement income or survivor's benefits, National Guard and reserve component members, Olympic/Paralymic medal winners, qualified patents income eemption, railroad unemployment and sickness benefits, repayment of previously taxed income deductions, COVID-related employee retention credit dissalowed expenses, and Indiana-only tax-exempt bonds."
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-2"
+    defined_for = StateCode.IN
diff --git a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_renters_deduction.py b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_renters_deduction.py
index b76c4c13ad0..e54c06415ac 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_renters_deduction.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_renters_deduction.py
@@ -8,6 +8,7 @@ class in_renters_deduction(Variable):
     unit = USD
     definition_period = YEAR
     reference = "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-2-6"
+    defined_for = StateCode.IN
 
     def formula(tax_unit, period, parameters):
         p = parameters(period).gov.states["in"].tax.income
diff --git a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_unemployment_compensation_deduction.py b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_unemployment_compensation_deduction.py
index 641366a6a04..123b380d9b2 100644
--- a/policyengine_us/variables/gov/states/in/tax/income/deductions/in_unemployment_compensation_deduction.py
+++ b/policyengine_us/variables/gov/states/in/tax/income/deductions/in_unemployment_compensation_deduction.py
@@ -10,6 +10,7 @@ class in_unemployment_compensation_deduction(Variable):
     reference = (
         "http://iga.in.gov/legislative/laws/2021/ic/titles/006#6-3-2-10"
     )
+    defined_for = StateCode.IN
 
     def formula(tax_unit, period, parameters):
         p = parameters(period).gov.states["in"].tax.income.deductions
diff --git a/policyengine_us/variables/gov/states/ma/tax/income/credits/ma_covid_19_essential_employee_premium_pay_program/claimed_ma_covid_19_essential_employee_premium_pay_program_2020.py b/policyengine_us/variables/gov/states/ma/tax/income/credits/ma_covid_19_essential_employee_premium_pay_program/claimed_ma_covid_19_essential_employee_premium_pay_program_2020.py
index 5d19ded06e8..8763741e876 100644
--- a/policyengine_us/variables/gov/states/ma/tax/income/credits/ma_covid_19_essential_employee_premium_pay_program/claimed_ma_covid_19_essential_employee_premium_pay_program_2020.py
+++ b/policyengine_us/variables/gov/states/ma/tax/income/credits/ma_covid_19_essential_employee_premium_pay_program/claimed_ma_covid_19_essential_employee_premium_pay_program_2020.py
@@ -11,3 +11,4 @@ class claimed_ma_covid_19_essential_employee_premium_pay_program_2020(
     )
     definition_period = YEAR
     reference = "https://www.mass.gov/info-details/covid-19-essential-employee-premium-pay-program"
+    defined_for = StateCode.MA
diff --git a/policyengine_us/variables/gov/states/ma/tax/income/is_ma_income_tax_exempt.py b/policyengine_us/variables/gov/states/ma/tax/income/is_ma_income_tax_exempt.py
index 3273ef21f2c..631aa81d55e 100644
--- a/policyengine_us/variables/gov/states/ma/tax/income/is_ma_income_tax_exempt.py
+++ b/policyengine_us/variables/gov/states/ma/tax/income/is_ma_income_tax_exempt.py
@@ -8,6 +8,7 @@ class is_ma_income_tax_exempt(Variable):
     unit = USD
     definition_period = YEAR
     reference = "https://malegislature.gov/Laws/GeneralLaws/PartI/TitleIX/Chapter62/Section5"
+    defined_for = StateCode.MA
 
     def formula(tax_unit, period, parameters):
         agi = tax_unit("ma_agi", period)
diff --git a/policyengine_us/variables/gov/states/md/tax/income/credits/eitc/federal_eitc_without_age_minimum.py b/policyengine_us/variables/gov/states/md/tax/income/credits/eitc/federal_eitc_without_age_minimum.py
index 512764d4388..910e3cec92f 100644
--- a/policyengine_us/variables/gov/states/md/tax/income/credits/eitc/federal_eitc_without_age_minimum.py
+++ b/policyengine_us/variables/gov/states/md/tax/income/credits/eitc/federal_eitc_without_age_minimum.py
@@ -9,6 +9,7 @@ class federal_eitc_without_age_minimum(Variable):
     documentation = "The federal EITC with the minimum age condition ignored."
     definition_period = YEAR
     reference = "https://casetext.com/statute/code-of-maryland/article-tax-general/title-10-income-tax/subtitle-7-income-tax-credits/section-10-704-effective-until-6302023-for-earned-income"
+    defined_for = StateCode.MD
 
     def formula(tax_unit, period, parameters):
         # set up simulation clone
diff --git a/policyengine_us/variables/gov/states/mt/tax/income/credits/mt_eitc.py b/policyengine_us/variables/gov/states/mt/tax/income/credits/mt_eitc.py
index 7c4ea113b43..1ab02388337 100644
--- a/policyengine_us/variables/gov/states/mt/tax/income/credits/mt_eitc.py
+++ b/policyengine_us/variables/gov/states/mt/tax/income/credits/mt_eitc.py
@@ -8,6 +8,7 @@ class mt_eitc(Variable):
     unit = USD
     definition_period = YEAR
     reference = "https://leg.mt.gov/bills/mca/title_0150/chapter_0300/part_0230/section_0180/0150-0300-0230-0180.html"
+    defined_for = StateCode.MT
 
     def formula(person, period, parameters):
         federal_eitc = person.tax_unit("eitc", period)
diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/mt_deductions_indiv.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/mt_deductions_indiv.py
index 103289cafd0..5c130696e49 100644
--- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/mt_deductions_indiv.py
+++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/mt_deductions_indiv.py
@@ -7,6 +7,7 @@ class mt_deductions_indiv(Variable):
     label = "The total amount of Montana deductions and exemptions when married filing separately"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.MT
 
     def formula(person, period, parameters):
         standard_deduction = person("mt_standard_deduction_indiv", period)
diff --git a/policyengine_us/variables/gov/states/mt/tax/income/mt_applicable_ald_deductions.py b/policyengine_us/variables/gov/states/mt/tax/income/mt_applicable_ald_deductions.py
index 5fa18fabe30..6f5c6f4fc61 100644
--- a/policyengine_us/variables/gov/states/mt/tax/income/mt_applicable_ald_deductions.py
+++ b/policyengine_us/variables/gov/states/mt/tax/income/mt_applicable_ald_deductions.py
@@ -7,6 +7,7 @@ class mt_applicable_ald_deductions(Variable):
     label = "Montana applicable above-the-line deductions "
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.MT
 
     def formula(person, period, parameters):
         ald_deductions = person.tax_unit("above_the_line_deductions", period)
diff --git a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_additions.py b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_additions.py
index 0a39a23d093..9ea657e413f 100644
--- a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_additions.py
+++ b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_additions.py
@@ -9,3 +9,4 @@ class nj_additions(Variable):
     documentation = "Additions to federal AGI to get NJ total income."
     definition_period = YEAR
     reference = "https://law.justia.com/codes/new-jersey/2022/title-54/section-54-8a-36/"
+    defined_for = StateCode.NJ
diff --git a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_agi_subtractions.py b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_agi_subtractions.py
index dad06b32f51..7cb05ea56c4 100644
--- a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_agi_subtractions.py
+++ b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_agi_subtractions.py
@@ -9,5 +9,6 @@ class nj_agi_subtractions(Variable):
     documentation = "Subtractions from federal AGI to get NJ total income."
     definition_period = YEAR
     reference = "https://law.justia.com/codes/new-jersey/2022/title-54/section-54-8a-36/"
+    defined_for = StateCode.NJ
 
     adds = "gov.states.nj.tax.income.subtractions"
diff --git a/policyengine_us/variables/gov/states/nm/tax/income/credits/eitc/nm_eitc_demographic_eligible.py b/policyengine_us/variables/gov/states/nm/tax/income/credits/eitc/nm_eitc_demographic_eligible.py
index b2562d74a76..743b732d797 100644
--- a/policyengine_us/variables/gov/states/nm/tax/income/credits/eitc/nm_eitc_demographic_eligible.py
+++ b/policyengine_us/variables/gov/states/nm/tax/income/credits/eitc/nm_eitc_demographic_eligible.py
@@ -6,6 +6,7 @@ class nm_eitc_demographic_eligible(Variable):
     entity = TaxUnit
     label = "Meets demographic eligibility for New Mexico EITC"
     definition_period = YEAR
+    defined_for = StateCode.NM
 
     def formula(tax_unit, period, parameters):
         # New Mexico applies the same criteria as the federal EITC, but
diff --git a/policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_additions.py b/policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_additions.py
index d7c3a650665..8fe95c5766a 100644
--- a/policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_additions.py
+++ b/policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_additions.py
@@ -12,5 +12,6 @@ class ny_additions(Variable):
         title="N.Y. Comp. Codes R. & Regs. tit. 20 § 112.2",
         href="https://casetext.com/regulation/new-york-codes-rules-and-regulations/title-20-department-of-taxation-and-finance/chapter-ii-income-taxes-and-estate-taxes/subchapter-a-new-york-state-personal-income-tax-under-article-22-of-the-tax-law/article-2-residents/part-112-new-york-adjusted-gross-income-of-a-resident-individual/section-1122-modifications-increasing-federal-adjusted-gross-income",
     )
+    defined_for = StateCode.NY
 
     # No additions modeled in PolicyEngine US.
diff --git a/policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_agi_subtractions.py b/policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_agi_subtractions.py
index 128b740bc84..b50d4d3d42b 100644
--- a/policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_agi_subtractions.py
+++ b/policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_agi_subtractions.py
@@ -12,6 +12,7 @@ class ny_agi_subtractions(Variable):
         title="N.Y. Comp. Codes R. & Regs. tit. 20 § 112.3",
         href="https://casetext.com/regulation/new-york-codes-rules-and-regulations/title-20-department-of-taxation-and-finance/chapter-ii-income-taxes-and-estate-taxes/subchapter-a-new-york-state-personal-income-tax-under-article-22-of-the-tax-law/article-2-residents/part-112-new-york-adjusted-gross-income-of-a-resident-individual/section-1123-modifications-reducing-federal-adjusted-gross-income",
     )
+    defined_for = StateCode.NY
 
     def formula(tax_unit, period, parameters):
         taxable_ss = add(tax_unit, period, ["taxable_social_security"])
diff --git a/policyengine_us/variables/gov/states/ny/tax/income/ny_non_refundable_credits.py b/policyengine_us/variables/gov/states/ny/tax/income/ny_non_refundable_credits.py
index 055e8eb5c6c..33b82e69927 100644
--- a/policyengine_us/variables/gov/states/ny/tax/income/ny_non_refundable_credits.py
+++ b/policyengine_us/variables/gov/states/ny/tax/income/ny_non_refundable_credits.py
@@ -7,6 +7,7 @@ class ny_non_refundable_credits(Variable):
     label = "NY capped non-refundable tax credits"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.NY
 
     def formula(tax_unit, period, parameters):
         credits = parameters(
diff --git a/policyengine_us/variables/gov/states/oh/tax/income/additions/oh_bonus_depreciation_add_back.py b/policyengine_us/variables/gov/states/oh/tax/income/additions/oh_bonus_depreciation_add_back.py
index eeab26b56a1..5bb97d874bc 100644
--- a/policyengine_us/variables/gov/states/oh/tax/income/additions/oh_bonus_depreciation_add_back.py
+++ b/policyengine_us/variables/gov/states/oh/tax/income/additions/oh_bonus_depreciation_add_back.py
@@ -6,5 +6,6 @@ class oh_bonus_depreciation_add_back(Variable):
     entity = Person
     label = "Ohio bonus depreciation add back"
     definition_period = YEAR
+    defined_for = StateCode.OH
     documentation = ""
     reference = ""
diff --git a/policyengine_us/variables/gov/states/oh/tax/income/additions/oh_other_add_backs.py b/policyengine_us/variables/gov/states/oh/tax/income/additions/oh_other_add_backs.py
index 14bbce69a22..49fbee0331d 100644
--- a/policyengine_us/variables/gov/states/oh/tax/income/additions/oh_other_add_backs.py
+++ b/policyengine_us/variables/gov/states/oh/tax/income/additions/oh_other_add_backs.py
@@ -6,5 +6,6 @@ class oh_other_add_backs(Variable):
     entity = Person
     label = "Ohio other add backs"
     definition_period = YEAR
+    defined_for = StateCode.OH
     documentation = ""
     reference = ""
diff --git a/policyengine_us/variables/gov/states/oh/tax/income/deductions/oh_section_179_expense_add_back.py b/policyengine_us/variables/gov/states/oh/tax/income/deductions/oh_section_179_expense_add_back.py
index 5d29df11a81..e49525ff1d3 100644
--- a/policyengine_us/variables/gov/states/oh/tax/income/deductions/oh_section_179_expense_add_back.py
+++ b/policyengine_us/variables/gov/states/oh/tax/income/deductions/oh_section_179_expense_add_back.py
@@ -8,4 +8,5 @@ class oh_section_179_expense_add_back(Variable):
     definition_period = YEAR
     documentation = ""
     reference = ""
+    defined_for = StateCode.OH
     # use federal variables if they are added later
diff --git a/policyengine_us/variables/gov/states/oh/tax/income/deductions/oh_uniformed_services_retirement_income_deduction.py b/policyengine_us/variables/gov/states/oh/tax/income/deductions/oh_uniformed_services_retirement_income_deduction.py
index b36a1ca2574..3f38596b82e 100644
--- a/policyengine_us/variables/gov/states/oh/tax/income/deductions/oh_uniformed_services_retirement_income_deduction.py
+++ b/policyengine_us/variables/gov/states/oh/tax/income/deductions/oh_uniformed_services_retirement_income_deduction.py
@@ -8,3 +8,4 @@ class oh_uniformed_services_retirement_income_deduction(Variable):
     definition_period = YEAR
     unit = USD
     reference = "https://tax.ohio.gov/static/forms/ohio_individual/individual/2022/it1040-bundle.pdf#page=4"
+    defined_for = StateCode.OH
diff --git a/policyengine_us/variables/gov/states/or/tax/income/credits/or_non_refundable_credits.py b/policyengine_us/variables/gov/states/or/tax/income/credits/or_non_refundable_credits.py
index 6f02ae38eeb..823b453fe05 100644
--- a/policyengine_us/variables/gov/states/or/tax/income/credits/or_non_refundable_credits.py
+++ b/policyengine_us/variables/gov/states/or/tax/income/credits/or_non_refundable_credits.py
@@ -7,5 +7,6 @@ class or_non_refundable_credits(Variable):
     label = "OR uncapped non-refundable tax credits"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.OR
 
     adds = "gov.states.or.tax.income.credits.nonrefundable"
diff --git a/policyengine_us/variables/gov/states/or/tax/income/credits/or_refundable_credits.py b/policyengine_us/variables/gov/states/or/tax/income/credits/or_refundable_credits.py
index 5c26d431c51..84738dc59fc 100644
--- a/policyengine_us/variables/gov/states/or/tax/income/credits/or_refundable_credits.py
+++ b/policyengine_us/variables/gov/states/or/tax/income/credits/or_refundable_credits.py
@@ -7,5 +7,6 @@ class or_refundable_credits(Variable):
     label = "Oregon refundable tax credits"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.OR
 
     adds = "gov.states.or.tax.income.credits.refundable"
diff --git a/policyengine_us/variables/gov/states/or/tax/income/credits/wfhdc/or_cdcc_relevant_expenses.py b/policyengine_us/variables/gov/states/or/tax/income/credits/wfhdc/or_cdcc_relevant_expenses.py
index f6e5dd37117..a816a926922 100644
--- a/policyengine_us/variables/gov/states/or/tax/income/credits/wfhdc/or_cdcc_relevant_expenses.py
+++ b/policyengine_us/variables/gov/states/or/tax/income/credits/wfhdc/or_cdcc_relevant_expenses.py
@@ -8,6 +8,7 @@ class or_cdcc_relevant_expenses(Variable):
     unit = USD
     definition_period = YEAR
     reference = "https://oregon.public.law/statutes/ors_315.264"
+    defined_for = StateCode.OR
 
     def formula(tax_unit, period, parameters):
         p_cdcc = parameters(period).gov.irs.credits.cdcc
diff --git a/policyengine_us/variables/gov/states/or/tax/income/or_income_tax_before_refundable_credits.py b/policyengine_us/variables/gov/states/or/tax/income/or_income_tax_before_refundable_credits.py
index 1868e11c607..aa8d2556880 100644
--- a/policyengine_us/variables/gov/states/or/tax/income/or_income_tax_before_refundable_credits.py
+++ b/policyengine_us/variables/gov/states/or/tax/income/or_income_tax_before_refundable_credits.py
@@ -7,6 +7,7 @@ class or_income_tax_before_refundable_credits(Variable):
     label = "OR income tax before refundable credits"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.OR
 
     def formula(tax_unit, period, parameters):
         income_tax_before_credits = tax_unit(
diff --git a/policyengine_us/variables/gov/states/pa/tax/income/taxable_income/pa_nontaxable_pension_income.py b/policyengine_us/variables/gov/states/pa/tax/income/taxable_income/pa_nontaxable_pension_income.py
index 0c6a528a28c..58877032a54 100644
--- a/policyengine_us/variables/gov/states/pa/tax/income/taxable_income/pa_nontaxable_pension_income.py
+++ b/policyengine_us/variables/gov/states/pa/tax/income/taxable_income/pa_nontaxable_pension_income.py
@@ -9,6 +9,7 @@ class pa_nontaxable_pension_income(Variable):
     documentation = "US taxable pension income excluded from PA AGI."
     definition_period = YEAR
     reference = "https://www.revenue.pa.gov/FormsandPublications/FormsforIndividuals/PIT/Documents/2021/2021_pa-40in.pdf#page=8"
+    defined_for = StateCode.PA
 
     def formula(person, period, parameters):
         retired = person("is_retired", period)
diff --git a/policyengine_us/variables/gov/states/sc/tax/income/credits/college_tuition/sc_tuition_credit_eligible.py b/policyengine_us/variables/gov/states/sc/tax/income/credits/college_tuition/sc_tuition_credit_eligible.py
index 3f025b0ef71..99f4e50aa70 100644
--- a/policyengine_us/variables/gov/states/sc/tax/income/credits/college_tuition/sc_tuition_credit_eligible.py
+++ b/policyengine_us/variables/gov/states/sc/tax/income/credits/college_tuition/sc_tuition_credit_eligible.py
@@ -11,3 +11,4 @@ class sc_tuition_credit_eligible(Variable):
         "https://www.scstatehouse.gov/code/t12c006.php",
         # South Carolina Legal Code | SECTION 12-6-3385 (B)(3)(b)
     )
+    defined_for = StateCode.SC
diff --git a/policyengine_us/variables/gov/states/sc/tax/income/credits/eitc/sc_eitc.py b/policyengine_us/variables/gov/states/sc/tax/income/credits/eitc/sc_eitc.py
index d8bbd43e4f9..8e5ea5d3b07 100644
--- a/policyengine_us/variables/gov/states/sc/tax/income/credits/eitc/sc_eitc.py
+++ b/policyengine_us/variables/gov/states/sc/tax/income/credits/eitc/sc_eitc.py
@@ -8,6 +8,7 @@ class sc_eitc(Variable):
     unit = USD
     definition_period = YEAR
     reference = "https://dor.sc.gov/forms-site/Forms/TC60_2021.pdf"
+    defined_for = StateCode.SC
 
     def formula(tax_unit, period, parameters):
         federal_eitc = tax_unit("eitc", period)
diff --git a/policyengine_us/variables/gov/states/sc/tax/income/subtractions/military_retirement/sc_military_deduction_indv.py b/policyengine_us/variables/gov/states/sc/tax/income/subtractions/military_retirement/sc_military_deduction_indv.py
index 820ef95270d..32610f06fe7 100644
--- a/policyengine_us/variables/gov/states/sc/tax/income/subtractions/military_retirement/sc_military_deduction_indv.py
+++ b/policyengine_us/variables/gov/states/sc/tax/income/subtractions/military_retirement/sc_military_deduction_indv.py
@@ -11,6 +11,7 @@ class sc_military_deduction_indv(Variable):
         "https://dor.sc.gov/forms-site/Forms/IITPacket_2021.pdf#page=17",
     )
     definition_period = YEAR
+    defined_for = StateCode.SC
 
     def formula(person, period, parameters):
         head_or_spouse = person("is_tax_unit_head_or_spouse", period)
diff --git a/policyengine_us/variables/gov/states/sc/tax/income/subtractions/retirement/sc_retirement_cap.py b/policyengine_us/variables/gov/states/sc/tax/income/subtractions/retirement/sc_retirement_cap.py
index c3bafa3baf4..7601d43799f 100644
--- a/policyengine_us/variables/gov/states/sc/tax/income/subtractions/retirement/sc_retirement_cap.py
+++ b/policyengine_us/variables/gov/states/sc/tax/income/subtractions/retirement/sc_retirement_cap.py
@@ -7,6 +7,7 @@ class sc_retirement_cap(Variable):
     label = "South Carolina retirement income subtraction cap"
     unit = USD
     definition_period = YEAR
+    defined_for = StateCode.SC
 
     def formula(person, period, parameters):
         p = parameters(period).gov.states.sc.tax.income.subtractions.retirement
diff --git a/policyengine_us/variables/gov/states/sc/tax/income/subtractions/retirement/sc_retirement_deduction_indv.py b/policyengine_us/variables/gov/states/sc/tax/income/subtractions/retirement/sc_retirement_deduction_indv.py
index 6267ef5f89f..2367eb83dbb 100644
--- a/policyengine_us/variables/gov/states/sc/tax/income/subtractions/retirement/sc_retirement_deduction_indv.py
+++ b/policyengine_us/variables/gov/states/sc/tax/income/subtractions/retirement/sc_retirement_deduction_indv.py
@@ -11,6 +11,7 @@ class sc_retirement_deduction_indv(Variable):
         "https://dor.sc.gov/forms-site/Forms/IITPacket_2021.pdf#page=17",
     )
     definition_period = YEAR
+    defined_for = StateCode.SC
 
     def formula(person, period, parameters):
         p = parameters(period).gov.states.sc.tax.income.subtractions.retirement
diff --git a/policyengine_us/variables/gov/states/va/tax/income/va_non_refundable_credits.py b/policyengine_us/variables/gov/states/va/tax/income/va_non_refundable_credits.py
index 67c417498d1..e6277f12813 100644
--- a/policyengine_us/variables/gov/states/va/tax/income/va_non_refundable_credits.py
+++ b/policyengine_us/variables/gov/states/va/tax/income/va_non_refundable_credits.py
@@ -10,5 +10,6 @@ class va_non_refundable_credits(Variable):
     reference = (
         "https://law.lis.virginia.gov/vacodefull/title58.1/chapter3/article2/"
     )
+    defined_for = StateCode.VA
 
     adds = "gov.states.va.tax.income.credits.non_refundable"
diff --git a/policyengine_us/variables/gov/states/va/tax/income/va_refundable_credits.py b/policyengine_us/variables/gov/states/va/tax/income/va_refundable_credits.py
index 31413a26cc3..31ed4662f40 100644
--- a/policyengine_us/variables/gov/states/va/tax/income/va_refundable_credits.py
+++ b/policyengine_us/variables/gov/states/va/tax/income/va_refundable_credits.py
@@ -10,4 +10,6 @@ class va_refundable_credits(Variable):
     reference = (
         "https://law.lis.virginia.gov/vacodefull/title58.1/chapter3/article2/"
     )
+    defined_for = StateCode.VA
+
     adds = "gov.states.va.tax.income.credits.refundable"


Test patch:
diff --git a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/income/il_base_income.yaml b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/income/il_base_income.yaml
index 417b952e514..ea3328e8372 100644
--- a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/income/il_base_income.yaml
+++ b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/income/il_base_income.yaml
@@ -5,6 +5,7 @@
     dividend_income: 2_500
     taxable_pension_income: 1_000
     il_schedule_m_subtractions: 100
+    state_code: IL
   output:
     il_base_income: 8_900
 
@@ -15,6 +16,7 @@
     tax_exempt_interest_income: 4_500
     il_schedule_m_additions: 1_300
     il_schedule_m_subtractions: 50
+    state_code: IL
   output:
     il_base_income: 30_750
 
@@ -23,5 +25,6 @@
   input:
     adjusted_gross_income: 5_000
     taxable_social_security: 1_300
+    state_code: IL
   output:
     il_base_income: 3_700
diff --git a/policyengine_us/tests/policy/baseline/gov/states/in/tax/income/in_military_service_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/in/tax/income/in_military_service_deduction.yaml
index 2d4626c5f53..c89926dfc10 100644
--- a/policyengine_us/tests/policy/baseline/gov/states/in/tax/income/in_military_service_deduction.yaml
+++ b/policyengine_us/tests/policy/baseline/gov/states/in/tax/income/in_military_service_deduction.yaml
@@ -7,6 +7,10 @@
     tax_units:
       tax_unit:
         members: person1
+    households:
+      household:
+        members: [person1]
+        state_code: IN
   output:
     in_military_service_deduction: 5_000
 
@@ -20,6 +24,10 @@
         military_service_income: 5_000
     tax_units:
       tax_unit:
-        members: ["person1", "person2"]
+        members: [person1, person2]
+    households:
+      household:
+        members: [person1, person2]
+        state_code: IN
   output:
     in_military_service_deduction: 10_000
diff --git a/policyengine_us/tests/policy/baseline/gov/states/in/tax/income/in_nonpublic_school_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/in/tax/income/in_nonpublic_school_deduction.yaml
index 4c2ab67a8c3..a3c37577fc5 100644
--- a/policyengine_us/tests/policy/baseline/gov/states/in/tax/income/in_nonpublic_school_deduction.yaml
+++ b/policyengine_us/tests/policy/baseline/gov/states/in/tax/income/in_nonpublic_school_deduction.yaml
@@ -8,6 +8,10 @@
         is_in_k12_nonpublic_school: true
     tax_unit: 
       members: [child1, child2]
+    households:
+      household:
+        members: [child1, child2]
+        state_code: IN
   output:
     in_nonpublic_school_deduction: 2_000
 
@@ -19,5 +23,9 @@
         is_in_k12_nonpublic_school: true
     tax_unit: 
       members: [child1]
+    households:
+      household:
+        members: [child1]
+        state_code: IN
   output:
     in_nonpublic_school_deduction: 1_000
diff --git a/policyengine_us/tests/policy/baseline/gov/states/md/tax/income/credits/eitc/federal_eitc_without_age_minimum.yaml b/policyengine_us/tests/policy/baseline/gov/states/md/tax/income/credits/eitc/federal_eitc_without_age_minimum.yaml
index b586b116548..b2bb1274e03 100644
--- a/policyengine_us/tests/policy/baseline/gov/states/md/tax/income/credits/eitc/federal_eitc_without_age_minimum.yaml
+++ b/policyengine_us/tests/policy/baseline/gov/states/md/tax/income/credits/eitc/federal_eitc_without_age_minimum.yaml
@@ -4,6 +4,7 @@
     age: 19
     employment_income: 5_000
     md_qualifies_for_unmarried_childless_eitc: true
+    state_code: MD
   output:
     eitc: 0
     federal_eitc_without_age_minimum: 382.50