Repository navigation
Declare the Kentucky tuition tax credit eligibility flag as a boolean - #10105
Merged
Merged
Conversation
The variable is an eligibility flag whose formula returns filing_status != SEPARATE, but it was declared value_type = float with unit = USD, so API and app metadata presented it as a dollar amount. Its only readers are the defined_for of ky_tuition_tax_credit and ky_tuition_tax_credit_potential (core masks with > 0, so True/False behave as 1.0/0.0 did) and YAML inputs; nothing does arithmetic on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 11, 2026 18:34
Contributor
Author
|
Hand-off to the US + core hub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10105 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 1 -3
Lines 76 10 -66
Branches 2 0 -2
=========================================
- Hits 76 10 -66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
US + core hub merge audit, us#10105 at
|
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.
Defect
ky_tuition_tax_credit_eligibleis an eligibility flag. Its label is "Eligible for the Kentucky tuition tax credit", and its formula returns a boolean,filing_status != filing_status.possible_values.SEPARATE. But it was declaredvalue_type = floatwithunit = USD, so API and app metadata presented it as a dollar amount.Change
value_type = floatbecomesvalue_type = bool, andunit = USDis removed. The formula is unchanged. This matches the other Kentucky eligibility flags (ky_ccap_eligible,ky_ktap_eligible,ky_ccap_income_eligible, and so on).changelog.d/ky-tuition-eligible-bool.fixed.md.Readers
git grep ky_tuition_tax_credit_eligibleat the head finds these:ky_tuition_tax_credit.py:13defined_forky_tuition_tax_credit_potential.py:10defined_forky_tuition_tax_credit_eligible.yaml(2 cases),ky_tuition_tax_credit.yaml(2),ky_non_refundable_credit_order.yaml(1)true/falseNothing does arithmetic on the flag, sums it, or reads it as a number.
policyengine-core builds the
defined_formask ascalculate(defined_for, period, map_to=entity) > 0. That holds in the versionuv.lockpins (3.32.8,simulations/simulation.py:847) and in the latest tag (3.33.2, line 1722). SoTrue/Falsegive the same mask as1.0/0.0. Core 3.33's registration check (Variable.check_defined_for_variable) accepts onlyNUMERIC_VALUE_TYPES = (bool, int, float)as adefined_fortarget, andboolis in that list. All three variables are TaxUnit-level. The default changes from0.0toFalse, and both are falsy.Tests
Each file below was run in its own process, in the foreground at nice 0, at head 350c61c. All passed.
tests/policy/baseline/gov/states/ky/tax/income/)credits/tuition_tax/ky_tuition_tax_credit_eligible.yamlcredits/tuition_tax/ky_tuition_tax_credit.yamlcredits/ky_non_refundable_credit_order.yamlky_filing_status.yamlintegration.yamlcredits/dependent_care_credit/ky_cdcc.yamlNo test expectations changed. YAML
true/falseinputs already matched a bool.Invariants (stated and executed)
For every tax unit:
ky_tuition_tax_credit_potential,ky_tuition_tax_credit,ky_non_refundable_credits,ky_files_separately,ky_income_tax,state_income_taxandhousehold_net_income.bool, with metadatavalue_typebool and no unit. In the comparison system, the main declaration really is float withcurrency-USD.The script builds the branch system and a comparison system that swaps main's declaration back in, verbatim, with
replace_variable. Units that supplyky_filing_statusand units that compute it run in separate simulations. (When some tax units supply an input, core treats the variable as an input for the whole array, and the rest get the default.) It checks D1 to D3 in two ways:ky_filing_statussupplied as Single, Joint or Separate, or computedThe computed statuses come from main's role inference and spouse rules, which this PR does not touch. With no roles given, an 18-year-old becomes the inferred spouse. A separated dependent drops a married couple's spouse, which is the defect #9932 fixes.
This check is not in CI: the repo keeps policy cases in YAML and keeps model-building Python tests out of CI. Script, log and power check:
~/reviews/ky-tuition-eligible-bool/differential.py,differential.log,mutation_check.py,mutation.log, all at head 350c61c.Interaction with #9924
#9924 (open draft) edits the same file: it adds a KRS 141.069(4)
referenceand rewrites the comment.git merge-tree --write-treewith #9924's head 591b05c is clean in both orders and gives the same tree (34a597526b). The merged file hasvalue_type = bool, no unit, and #9924's reference and comment. The two PRs can merge in either order.Independent review
GPT-6.1 Sol (Subfleet
review, hard tier) reviewed head 350c61c: APPROVE, no findings. It checked:defined_formasking, entity mapping and defaults;Its sandbox had only read tools. It read the files and #9924's public diff and worked through the merge by hand, without running git or tests. The test logs and
merge-treeresults above come from the author's own runs. Review:~/reviews/ky-tuition-eligible-bool/review-r1.md.Impact
None on any computed amount: this is a metadata change. The flag's values are unchanged, only its type, and the differential check above shows every downstream Kentucky output is identical.
axiom: n/a: variable metadata only (no policy change)
🤖 Generated with Claude Code