Update Niyam Rulebook for Government Document
You are the Niyam encoder. Update this rulebook so it matches a new government document.
The validated change set is in .niyam/changeset.json. It lists each change with its exact source quote, page and clause.
The source document is registered in sources/index.yaml as gr-202407031335114330 (date 2024-07-03).
Do this:
- Read CLAUDE.md (the rulebook rules), the change set, and the files of the affected scheme(s): mh.ladki_bahin.
- Apply every change in the change set, following CLAUDE.md exactly:
- parameter change: add a new dated value under
values:starting 2024-07-03. Never edit or delete older values. - condition change: set
valid_untilon the old condition to the day before 2024-07-03, and add a new condition with the same id andvalid_from: 2024-07-03. - condition removed: only set
valid_untilto the day before 2024-07-03. - every new value or condition gets
source/metadata.referencewith docgr-202407031335114330, page, clause, quote (copied from the change set) and quote_en. - if a change needs a new person field, add it to
schema/person.yamlwith a safe default that keeps existing results unchanged.
- parameter change: add a new dated value under
- Add test citizens to
tests/for every change, dated on or after 2024-07-03: just below, at, and just above each limit, plus one case dated before 2024-07-03 proving the old rule still applies. Each case citesGR 202407031335114330 p.<page> clause <clause>insource. - Add an entry at the top of CHANGELOG.md (English, Hindi, Marathi) linking to the document.
- Run
python -m niyam_rulebook testand fix problems until it prints0 failedwith no PROBLEM lines. - Do not run git. Do not edit files outside schemes/, parameters/, tests/, sources/, glossary/, schema/ and CHANGELOG.md.
Finish with a short summary of what you changed and the final test result.
I applied all six changes from GR 202407031335114330, and python -m niyam_rulebook test prints tests: 44 passed, 0 failed, with no PROBLEM lines. I didn't run git.
Rule changes
- Maximum age (c1): I added a value of 65 from 2024-07-03 to
age_max.yaml. - Unmarried women (c2): I added
unmarriedto the eligible marital statuses from 2024-07-03. - One unmarried woman per family (c3): I added a new disqualification,
unmarried_one_per_family, from 2024-07-03.schema/person.yamlalready had theother_unmarried_beneficiary_in_familyfield, so I made no schema change. - Contract staff (c4): I added a value of
[regular, pensioner]from 2024-07-03 todisqualifying_govt_jobs.yaml. - Other-scheme limit (c5): I set
valid_until: 2024-07-02on the oldother_scheme_limitcondition. The new version, valid from 2024-07-03, uses<instead of<=, so receiving exactly Rs 1,500 now disqualifies. - Farm land (c6): I set
valid_until: 2024-07-02onfarm_land_limit.
Every new value and condition cites the new GR with its page, clause, quote and English quote.
Tests and changelog
- I added 19 test cases to
tests/mh/ladki_bahin.yaml. They cover each limit (just below, at, and just above) plus a case dated 2024-07-02 showing the old rule still applies. - I added a CHANGELOG entry in English, Hindi and Marathi, linking to the document.
Open question: the change set flags that it is unclear whether the Rs 2.50 lakh cap for contract workers means the employee's own income or total family income. I followed the first reading: contract staff no longer disqualify, and the existing family-income condition still applies.