Implement Sanjay Gandhi Niradhar Scheme Rules
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-201908211212469922 (date 2019-08-20).
Do this:
- Read CLAUDE.md (the rulebook rules), the change set, and the files of the affected scheme(s): mh.sanjay_gandhi_niradhar.
- Apply every change in the change set, following CLAUDE.md exactly:
- parameter change: add a new dated value under
values:starting 2019-09-01. Never edit or delete older values. - condition change: set
valid_untilon the old condition to the day before 2019-09-01, and add a new condition with the same id andvalid_from: 2019-09-01. - condition removed: only set
valid_untilto the day before 2019-09-01. - every new value or condition gets
source/metadata.referencewith docgr-201908211212469922, 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 2019-09-01: just below, at, and just above each limit, plus one case dated before 2019-09-01 proving the old rule still applies. Each case citesGR 201908211212469922 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.
This document creates a new scheme. Read docs/FORMAT.md first and create every file it describes: the scheme YAML (id exactly as in the change set), one parameter file per number or list, the test file, and the source entry (already registered for you). Use only person fields from schema/person.yaml; if the document needs a fact that is missing, add a field with a default that keeps people eligible.
The Sanjay Gandhi Niradhar scheme is now in the rulebook. python -m niyam_rulebook test prints tests: 49 passed, 0 failed with no PROBLEM lines (25 existing Ladki Bahin cases, 24 new).
What I added
- Scheme:
schemes/mh/sanjay_gandhi_niradhar.yaml. Five conditions: Maharashtra residence for 15 years, age 18 or more, age under 65, family income limit, and no regular benefit from another scheme. Each has its quote and page from the change set. The benefit is Rs 1,000, or Rs 1,100 for a widow with one child and Rs 1,200 for a widow with two or more. - Parameters: five files under
parameters/mh/sanjay_gandhi_niradhar/: the monthly amounts and the two income limits. All are dated 2019-09-01 and cite the GR. - Tests:
tests/mh/sanjay_gandhi_niradhar.yaml, 24 cases covering each limit (just below, at, just above), the widow amounts, and a case dated 2019-08-31 showing the scheme is not in force yet. - Schema: three new person fields, each with a default that keeps people eligible:
years_in_maharashtra(default 15),children_count(default 0), anddisabled(default true). - Changelog: an entry at the top in English, Hindi and Marathi, linking the GR.
Choices to review
launchedis 2019-09-01, not the GR date of 2019-08-20. Conditions only start on 1 September, and with an earlier launch date the scheme would report people as eligible before it applies.disableddefaults to true, so when the field is unknown, the higher Rs 50,000 limit applies. That is the default you asked for, but it lets non-disabled families with income up to Rs 50,000 through. Change it if you prefer the stricter reading.- The 15-year residence rule uses the new field, so it is stricter than the change set's literal
state == 'MH'expression.
Gaps you should know about before this goes live
- Beneficiary categories are not modelled. The change set skipped them (widows, destitute women, disabled people, and so on). As written, any Maharashtra resident aged 18 to 64 with income under the limit and no other benefit is eligible, including men. This is over-inclusive and needs the category conditions added before anyone relies on the result.
- The Below Poverty Line (BPL) list is not modelled. The Rs 21,000 limit applies "if the family is not on the BPL list", and no person field covers that.
- Two ambiguities from the change set are encoded as written. The Rs 21,000 limit is inclusive, and any regular benefit from another scheme (including central pensions) disqualifies.