Whole file
shivprime94/file-itr
The author described this change as “fix(itr-engine): validate_rule rejects swapped effective_to/effective_from”. It counts as a record because the check below fails on the code as it stood at 2199e31cd and passes on af9da664e, with nothing else changed between the two runs.
Projectshivprime94/file-itr
Fix saved2026-07-29
Sharing licenceMIT · LICENSE
Change size+4 −0
What the code was meant to do, written into the code itself as a save note
fix(itr-engine): validate_rule rejects swapped effective_to/effective_from
The change
| 36 | 36 | raise RuleValidationError(f"Rule {r.key!r} invalid confidence {r.confidence!r}") | |
| 37 | 37 | if r.confidence == "contested" and not r.contested_note: | |
| 38 | 38 | raise RuleValidationError(f"Contested rule {r.key!r} must carry a contested_note") | |
| 39 | + | if r.effective_to is not None and r.effective_to < r.effective_from: | |
| 40 | + | raise RuleValidationError( | |
| 41 | + | f"Rule {r.key!r} has effective_to ({r.effective_to}) before " | |
| 42 | + | f"effective_from ({r.effective_from})") | |
| 39 | 43 | ||
| 40 | 44 | ||
| 41 | 45 | class RuleTable: |
The check that tells the two apart
fail→pass·skills/itr-india/engine/tests/test_rulebase.py::test_swapped_effective_window_fails
Check file skills/itr-india/engine/tests/test_rulebase.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 it2199e31cd2b55df5cee6de265014991b1ac695ba
Broken version dated2026-07-29
Moduleskills.itr-india.engine.rulebase
Units changedvalidate_rule
Fingerprint5fcdb013eaf20aab
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-08-01fix(itr-engine): count VDA toward basic-exemption residual for 111A/112/112A (#26)