Whole file
shivprime94/file-itr
The author described this change as “fix(itr-engine): count VDA toward basic-exemption residual for 111A/112/112A (#26)”. It counts as a record because the check below fails on the code as it stood at e6604879d and passes on e34e2c23a, with nothing else changed between the two runs.
Projectshivprime94/file-itr
Fix saved2026-08-01
Sharing licenceMIT · LICENSE
Change size+9 −3
What the code was meant to do, written into the code itself as a save note
fix(itr-engine): count VDA toward basic-exemption residual for 111A/112/112A (#26)
The change
| 94 | 94 | table.get("exemption.ltcg_112a", ay_ref_date).value, Decimal("0")) | |
| 95 | 95 | ||
| 96 | 96 | # Residents set unexhausted basic exemption against 111A/112/112A — never | |
| 97 | - | # VDA (s.115BBH). check_scope already refuses non-residents in Phase 1, | |
| 98 | - | # but guard anyway so the rule stays load-bearing if that changes. | |
| 97 | + | # VDA (s.115BBH). VDA still *consumes* the exemption residual for the | |
| 98 | + | # purpose of measuring what remains: if VDA alone already fills total | |
| 99 | + | # income above the BEL, no 111A/112/112A relief remains. check_scope | |
| 100 | + | # already refuses non-residents in Phase 1, but guard anyway so the rule | |
| 101 | + | # stays load-bearing if that changes. | |
| 99 | 102 | if taxpayer.resident and table.get( | |
| 100 | 103 | "basic_exemption.adjust_against_special_cg", ay_ref_date).value: | |
| 101 | - | unexhausted = max(exemption_limit - slab_base, Decimal("0")) | |
| 104 | + | # Income that is taxed but cannot itself absorb BEL still counts toward | |
| 105 | + | # whether any BEL residual exists (VDA @ s.115BBH). | |
| 106 | + | bel_base = slab_base + raw[Bucket.VDA_115BBH] | |
| 107 | + | unexhausted = max(exemption_limit - bel_base, Decimal("0")) | |
| 102 | 108 | order = [Bucket(v) for v in | |
| 103 | 109 | table.get("engine.basic_exemption_adjust_order", ay_ref_date).value] | |
| 104 | 110 | for b in order: |
The check that tells the two apart
fail→pass·skills/itr-india/engine/tests/test_rates.py::test_basic_exemption_residual_reduced_by_vda
Check file skills/itr-india/engine/tests/test_rates.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before ite6604879d78049efe91f4b0af41457d9d5aa60bc
Broken version dated2026-08-01
Moduleskills.itr-india.engine.rates
Units changedcompute_tax
Fingerprint1d2de134228865af
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in shivprime94/file-itr
- 2026-08-01compute_interest
- 2026-08-01apply_setoff
- 2026-07-29fix(itr-engine): validate_rule rejects swapped effective_to/effective_from