Update Niyam Rulebook for Government Document

Claude Code·Sonnet 5.5·Unknown author·yesterday·1min·3 Checkpoints·2 file changes·+94·8.8K 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-202407031335114330 (date 2024-07-03).

Do this:

  1. Read CLAUDE.md (the rulebook rules), the change set, and the files of the affected scheme(s): mh.ladki_bahin.
  2. 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_until on the old condition to the day before 2024-07-03, and add a new condition with the same id and valid_from: 2024-07-03.
    • condition removed: only set valid_until to the day before 2024-07-03.
    • every new value or condition gets source / metadata.reference with doc gr-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.yaml with a safe default that keeps existing results unchanged.
  3. 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 cites GR 202407031335114330 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.

yesterday·57.9s

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 unmarried to 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.yaml already had the other_unmarried_beneficiary_in_family field, so I made no schema change.
  • Contract staff (c4): I added a value of [regular, pensioner] from 2024-07-03 to disqualifying_govt_jobs.yaml.
  • Other-scheme limit (c5): I set valid_until: 2024-07-02 on the old other_scheme_limit condition. 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-02 on farm_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.