Implement Sanjay Gandhi Niradhar Scheme Rules

Claude Code·Haiku 5.5·Unknown author·18h ago·3hr 13min·1 Checkpoint·12 file changes·+346·29.2K tokens

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:

  1. Read CLAUDE.md (the rulebook rules), the change set, and the files of the affected scheme(s): mh.sanjay_gandhi_niradhar.
  2. 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_until on the old condition to the day before 2019-09-01, and add a new condition with the same id and valid_from: 2019-09-01.
    • condition removed: only set valid_until to the day before 2019-09-01.
    • every new value or condition gets source / metadata.reference with doc gr-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.yaml with a safe default that keeps existing results unchanged.
  3. 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 cites GR 201908211212469922 p.<page> clause <clause> in source.
  4. Add an entry at the top of CHANGELOG.md (English, Hindi, Marathi) linking to the document.
  5. Run python -m niyam_rulebook test and fix problems until it prints 0 failed with no PROBLEM lines.
  6. 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.

18h ago·2m

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), and disabled (default true).
  • Changelog: an entry at the top in English, Hindi and Marathi, linking the GR.

Choices to review

  • launched is 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.
  • disabled defaults 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.
47f3e1drule(mh.sanjay_gandhi_niradhar): The Sanjay Gandhi Niradhar Anudan Yojana is set out with its eligibility criteria and revi (+9 more) Source: GR 201908211212469922 dated 2019-08-20 - c1 scheme_created mh.sanjay_gandhi_niradhar: The Sanjay Gandhi Niradhar Anudan Yojana is set out with its eligibility criteria and revised benefits, applying from 1 September 2019. - c2 condition_added residency_maharashtra: Applicant must be a resident of Maharashtra, for at least 15 years. - c3 condition_added age_min: Minimum age of 18 years. - c4 condition_added age_max: Age must be below 65 years; at 65 the beneficiary moves to Shravanbal or the Indira Gandhi old age scheme. - c5 parameter_update annual_family_income_max: Annual family income limit of Rs 21,000 for beneficiaries other than disabled persons (if the family is not on the BPL list). - c6 parameter_update annual_family_income_max_disabled: Annual family income limit of Rs 50,000 for disabled (divyang) beneficiaries. - c7 condition_added no_other_regular_scheme_benefit: A person already receiving a regular monthly financial benefit under any other government scheme is not eligible. - c8 benefit_changed monthly_benefit: Monthly assistance raised from Rs 600 to Rs 1000 per beneficiary (including widows with no child). - c9 benefit_changed monthly_benefit_widow_one_child: Widow beneficiaries with 1 child get Rs 1100 per month (previously Rs 600). - c10 benefit_changed monthly_benefit_widow_two_or_more_children: Widow beneficiaries with 2 or more children get Rs 1200 per month (previously Rs 600). Niyam-Job: job_20261010_4ca1c594 Niyam-Confidence: 0.81 Niyam-Decision: human_review Niyam-Trace: 3b8585a7e7d785209ba47634d4f8ae13 Entire-Checkpoint: 01M4K309R73SB7WZRVFZZ29Q4M+346