How it works · packages/law
How Section 479 is computed.
The engine is one pure function, evaluate(input, today). It never reads the papers and never calls a model. Every date and number on this page was computed by that function when the page was built, as of 15 Nov 2026.
The rule in one paragraph
An undertrial held for an offence not punishable with death or life imprisonment is to be released on bail once detained for half the maximum term for that offence, or one-third if they have never been convicted of any offence (the first proviso to 479(1)). No one may be held for longer than the maximum term itself (second proviso). Days of delay caused by the accused are not counted (Explanation). The jail superintendent must apply to the court when the line is crossed (479(3)). Where an investigation, inquiry or trial in more than one offence or in multiple cases is pending, the court shall not release the person under 479(1) (479(2)). Plain-language summary: /law.
The order of the steps
| Step | What the engine does | Trace label |
|---|---|---|
| 1 | Splits compound references (379/411, 3/25, 302 r/w 34), reads each section in a canonical form (Devanagari digits and letters, hyphens, sub-clauses), and looks it up in the tables. | section |
| 2 | Decides the provision: Section 479, with the pre-July-2024 note where it applies. | provision |
| 3 | If any section allows death or life: outside 479. Stops here. | excluded |
| 4 | Finds the maximum term: the longest among the charged sections, or a maximum a lawyer entered. Anything unknown is listed as missing. | max_term |
| 5 | Needs a custody start date on or before today. Without it, or with any missing fact: can't tell. Stops here. | missing |
| 6 | Picks the fraction, adds it to the custody date, and adds any accused delay. | fraction · custody · delay · line |
| 7 | Compares with today. Not yet: days to go. Past: days past, then the flags. | today · flag · result |
Fractions and rounding
Terms are held in whole months. The line is the custody date plus one-half or one-third of the maximum, done on the calendar, not by counting 30-day months (addFractionOfMonths in packages/law/src/dates.ts):
- Whole months are added with month arithmetic: 12 March plus 18 months is 12 September. A month end lands on the last day of a shorter month.
- A leftover part-month becomes days of the month that follows, rounded up. So the line can only move later, never earlier, and the engine never calls someone past the line a day early.
Example, computed by the engine
Obstructing public servant in discharge of public functions (IPC 186) has a maximum of 3 months; half is 1.5 months. From custody on 31 Jan 2024, one whole month lands on the last day of February, and the half-month left over becomes days of the next month, rounded up. Line: 15 Mar 2024.First-time status unknown
The one-third line applies only when the papers say the person has no previous conviction or criminal history. When they say nothing, the engine uses the half line, which is the safe one, and also returns the one-third date as firstTimeLineDate, shown on screen as “if first-time is confirmed”. If today is already past that earlier line, a NOT_YET result carries a flag saying so, and the docket agent may request a criminal-history report.
In the worked example below, if the papers had said nothing about S01's history, the line would be 14 Sep 2024 (half) instead of 14 Mar 2024, with 14 Mar 2024 shown as the line if first-time status is confirmed.
Delay caused by the accused
The papers rarely state this, so the model is never asked for it. A person enters it on the case page (or as accusedDelayDays in the API, accused_delay_days in MCP). The engine subtracts those days from the days detained and pushes every line date back by the same number of days. It can only make the line later.
S01 with 45 days of accused delay: line 28 Apr 2024 instead of 14 Mar 2024; 1297 days counted as detained instead of 1342.
Cases registered before July 2024
The BNSS came into force on 1 Jul 2024. The old law, Section 436A of the CrPC, set only the half line, with no one-third benefit. By its order of 23 Aug 2024 in W.P.(C) 406/2013, the Supreme Court directed that Section 479 applies to undertrials in cases registered before that date too. So the engine applies Section 479 to every case, and for older cases it also returns the old 436A date (oldLawLineDate, the half line) for comparison.
A case counts as older when its registration date is before 1 Jul 2024. When the registration date is not known, a charge under the IPC (which the BNSS replaced) is taken as a sign of an older case. The provision is returned as BNSS_479_PRE_JULY_2024 or BNSS_479.
The 479(2) flag and other flags
Past the line becomes past the line · flagged when any of these hold:
- More than one offence is charged. Sections that are not offences on their own (common intention, definitions, prohibitions read with a penal section, aggravations) are not counted.
- The papers say other cases are pending.
- The papers don't say whether other cases are pending.
A lawyer decides how 479(2) applies before anything is filed; the draft carries a note saying so. Two more flags are added where they apply: detention has reached the full maximum term (the second proviso bars any further detention), and a charged section has been struck down and cannot found a charge.
Exclusions and can't tell
Outside 479. One section that allows death or life imprisonment takes the whole case outside Section 479, whatever else is charged. For example IPC 379 with IPC 307: EXCLUDED. This check runs before anything else, so it holds even when the custody date is missing.
Can't tell. The engine refuses to guess. It returns CANT_TELL with a list of what is missing when there is no valid custody date (or one in the future); when a section is not in the tables; when the maximum depends on details the section number doesn't give (state excise laws, the UP Gangsters Act, some limbs of special acts); and for NDPS offences when the quantity class isn't in the papers. NDPS s.20 with no quantity: CANT_TELL, missing “Maximum term for NDPS Act 1985 s.20”. With a quantity class the term is known: small 1 year, intermediate 10 years, commercial 20 years.
A lawyer can enter the maximum by hand (maxTermOverrideMonths); the trace then says the maximum was entered by the reviewing lawyer.
The statute tables
- Table rows
- 347
- IPC, BNS and special acts
- IPC sections
- 137
- BNS sections
- 142
- IPC→BNS mappings
- 137
The tables live in packages/law/src/tables/. Each row is a section, its title and its maximum, and each carries a source citation (for example IPC 1860 s.379) that the trace prints next to the step that used it. The maximum is the longest imprisonment the section allows across its sub-clauses. Rows are written from the bare acts; they should be reviewed by counsel before use in a real jail.
| Act | Rows |
|---|---|
| Indian Penal Code, 1860 | 137 |
| Bharatiya Nyaya Sanhita, 2023 | 142 |
| Narcotic Drugs and Psychotropic Substances Act, 1985 | 9 |
| Arms Act, 1959 | 22 |
| Protection of Children from Sexual Offences Act, 2012 | 12 |
| Scheduled Castes and the Scheduled Tribes (Prevention of Atrocities) Act, 1989 | 6 |
| Dowry Prohibition Act, 1961 | 2 |
| Public Gambling Act, 1867 | 3 |
| Information Technology Act, 2000 | 8 |
| State Excise Acts | 3 |
| Uttar Pradesh Gangsters and Anti-Social Activities (Prevention) Act, 1986 | 3 |
Not every row is a fixed term. The kind of punishment decides how the engine treats it:
| Kind | Rows | Meaning | Engine |
|---|---|---|---|
| term | 223 | A fixed maximum term | Used for the line |
| life / death | 68 | Allows life imprisonment or death | Outside 479 |
| modifier | 21 | Not an offence on its own (common intention, definitions, prohibitions) | Ignored for the term and the 479(2) count |
| derivative | 9 | Punished as the main offence (conspiracy, abetment) | Needs the main offence |
| companion | 7 | Raises or lowers the main offence's term (attempt, aggravation) | Main offence's full term: later, safer |
| detail | 11 | Term depends on a fact the section number doesn't give | Can't tell, or a lawyer enters it |
| quantity | 6 | NDPS: term depends on the quantity class | Term from the class, or can't tell |
| struck | 2 | Struck down by a constitutional court | Flagged |
A sub-clause that is not in the tables is read under its parent section (376(2)(n) → 376(2) → 376). A bare BNS section with several limbs is read as the limb with the longest term. Arms Act s.25 read with s.3, 4 or 5 is narrowed to the matching limb. The IPC→BNS map marks each mapping one-to-one, split, merged or dropped. Look any section up with the MCP tool lookup_section.
Worked example: S01
S01 is a constructed Hindi bail order from the sample tray (not a real case; names masked): theft of a motorcycle and receiving it. The facts below are the ones the verifier accepted from Claude's reading; the engine did the rest.
| Fact | Value | Quote from the order |
|---|---|---|
| Charged section | IPC 379 | अन्तर्गत धारा 379, 411 भा.द.वि. |
| Charged section | IPC 411 | अन्तर्गत धारा 379, 411 भा.द.वि. |
| Custody began | 2023-03-14 | प्रार्थी/अभियुक्त दिनांक 14.03.2023 से जिला कारागार आगरा में निरुद्ध है। |
| First-time offender | true | प्रार्थी/अभियुक्त का कोई आपराधिक इतिहास नहीं है। |
| Other cases pending | false | प्रार्थी/अभियुक्त का कोई आपराधिक इतिहास नहीं है। |
| Case registered | 2023-03-12 | इस संबंध में दिनांक 12.03.2023 को थाना सुजानपुर पर प्रथम सूचना रिपोर्ट पंजीकृत की गई। |
- Maximum term
- 3 years
- longest among the charges
- Fraction
- 1/3
- first-time, per the papers
- Line date
- 14 Mar 2024
- Days past the line
- 976
- as of 15 Nov 2026
The rule trace, as the engine wrote it
- 01sectionIPC 1860 s.379 (Punishment for theft) → max 3 yearsIPC 1860 s.379
- 02sectionIPC 1860 s.411 (Dishonestly receiving stolen property) → max 3 yearsIPC 1860 s.411
- 03provisionCase from before 1 Jul 2024: Sec 479 BNSS still applies, per the Supreme Court order of 23 Aug 2024. Old Sec 436A CrPC (half line, no first-time benefit) shown for comparison.SC order, W.P.(C) 406/2013, 23 Aug 2024
- 04max_termLongest maximum among the charges: 3 years (IPC 1860 s.379).IPC 1860 s.379
- 05fractionFirst-time offender (per the papers): one-third of 3 years.BNSS 2023 s.479(1) and first proviso
- 06custodyCustody began 14 Mar 2023.
- 07lineLine: 14 Mar 2024.
- 08todayToday: 15 Nov 2026; 1342 days detained.
- 09flagDetention has reached the full maximum term.BNSS 2023 s.479(1), second proviso
- 10flagSec 479(2): More than one offence is charged (IPC 1860 s.379, IPC 1860 s.411).BNSS 2023 s.479(2)
- 11resultPAST THE LINE by 976 days, FLAGGED under Sec 479(2): a lawyer decides how 479(2) applies before the application.
Result: PAST_FLAGGED, 976 days past the line as of 15 Nov 2026. The engine raised 2 flags for the lawyer:
- Detained for the full maximum term or longer: Sec 479(1) second proviso bars any further detention.
- More than one offence is charged (IPC 1860 s.379, IPC 1860 s.411).
Open the case at /case/S01 to see the quotes marked in the order and to change any fact.