Section 05
Court Coverage
Which courts come first, what reconnaissance of the old codebase reveals about each, and the migration hazards that must be resolved before any of it is trusted.
Priority courts
The agreed focus: Supreme Court, District Courts (eCourts), Tribunals, and the High Courts of Allahabad, Punjab & Haryana, Patna and Delhi, with High Courts leading.
Everything below was measured from the old tree rather than assumed. Several findings change the sequencing.
| Court | Live repo | Last touched | Transport | Captcha | Readiness |
|---|---|---|---|---|---|
| Punjab & Haryana HC | phc-services3.0 | 2026-07-15 | JSON API | None on API path | Best |
| Allahabad HC | highcourt-allahbad | 2026-07-28 | HTTP | Securimage + trained model | Strong |
| Allahabad HC — Lucknow bench | highcourt-lucknow | 2026-07-28 | HTTP | Same, trained model | Strong |
| Delhi HC | highcourt_delhi | 2026-07-16 | HTTP | Image | Good |
| Supreme Court | supreme-court3.0 | 2026-03-11 | HTTP | Arithmetic | Good |
| District eCourts | district-court-web | 2026-07-22 | HTTP + some browser | Securimage, audio available | High value |
| Tribunals (14 repos) | varied | 2023–2026 | Mixed | Varied | Fragmented |
| Patna HC | patna_hc | 2023-07-25 | Selenium | Image | Deferred |
Three findings that change the plan
1. Punjab & Haryana has a clean public JSON API easiest, not hardest
The old repo contains a detailed reconnaissance set under phhc-skills/ — and it documents something valuable. The court runs a Next.js 14 frontend over a FastAPI + PostgreSQL backend at livedb9010.phhc.gov.in, and that backend is:
- Publicly accessible without authentication
- Not behind the bot protection. The PerimeterX/HUMAN script guards only the
new.phhc.gov.infrontend domain - Free of any captcha on the API path
- Free of the CSRF token requirement, which applies only to HTML navigation
No HTML parsing, no captcha model, no browser. This is the cheapest connector in the entire fleet and the strongest possible proof of the connector interface — which is why it should be first.
One recommendation in that recon doc should not be carried forward
It suggests "use rotating user agents if doing heavy loads." Do not. Rotating identity to avoid detection converts Clerkify from a legitimate data consumer into an adversary, and it directly contradicts the good-citizen rules in Connector Framework.
The right posture: one honest, identifiable user agent with a contact address, comfortably inside the observed limits (500 ms delay, 3 concurrent), and if the court ever objects, a conversation with the registry. A court that can identify us can also whitelist us — and that is a far better long-term position than one that ends in a block.
2. All district eCourts share one codebase and one captcha highest leverage in the fleet
The captured markup shows every district court portal running ecourtindia_v6 with Securimage, the open-source PHP captcha library — 175 and 112 references respectively across the old repos.
The consequence is large: district courts are not hundreds of integrations. They are one connector and one captcha model, parameterised by state and district. A single Securimage-trained model plausibly unlocks the majority of India's district judiciary at once — by far the best coverage-per-effort ratio available.
Securimage ships an audio captcha, and the old code already captured it
The same markup contains securimage_play, captcha_image_audio and SecurimageAudio — the accessibility audio alternative, present and reachable.
Securimage's audio output is spoken digits and letters on a controlled noise floor, which is a far easier recognition problem than its deliberately distorted image. Evaluate the audio path before investing in image model training for eCourts. It may need no per-court model at all, and it is the single highest-value experiment available in M1 — a day of work that could remove a whole category of ongoing cost.
3. Patna High Court is three years stale — and is deferred out of M1
Of the priority courts, patna_hc was last touched 25 July 2023 — roughly three years ago — against a fleet where the other priority repos were updated within the last month. It also carries 9 Selenium files, the transport that costs 50–100× an HTTP call.
Decision: Patna is out of scope for now and moves to the M6 fleet migration. When it is picked up, it should be a fresh HTTP implementation rather than a port — migrating three-year-old Selenium code would preserve both the cost problem and the fragility.
One thing to check independently of the rebuild
A connector untouched for three years, against a court site that has almost certainly changed, is likely to be already broken or silently degraded in production today. If there are live users tracking Patna matters, that is worth verifying against the court site on its own timeline — it is a current-customer question, not a rebuild question, and deferring the rebuild does not defer it.
Migration hazards in the old repositories
Nothing tells you which repository is actually running
Most priority courts have two to four repositories, and the names do not identify the live one. mymunshi-deployment looks like the answer but its manifests list only three repositories in total — DRT, reat-serveces, DRAT-services — so there is no record of what is deployed.
Before any migration work: audit the live servers (pm2 list and the checked-out paths) and record the result. Reading the wrong repository would mean reimplementing a superseded connector and discovering it only when the canary fails against production behaviour.
| Court | Candidate repos | Most likely live | Hazard |
|---|---|---|---|
| Supreme Court | supreme-court, 2.0, 3.0 | 3.0 | Original has 288 commits vs 17 — history is in the old one |
| Punjab & Haryana | phc-services, 2.0, 3.0, new-phhc-services | 3.0 | new-phhc-services is 1 commit — an abandoned start |
| Delhi HC | hc-delhi-services, hc-delhi2.0, highcourt-delhi, highcourt_delhi | highcourt_delhi | Hyphen vs underscore. highcourt-delhi has 0 Python files |
| Allahabad HC | highcourt-allahbad, ecourt-allahabad-2.0 | highcourt-allahbad | Repo name is misspelled; 2.0 is older despite the name |
| District courts | district-court-web, ecourts-districts, akshit_ecourts | district-court-web | ecourts-districts has 204 commits — likely the real history |
Note the recurring pattern: each rewrite created a new repository rather than replacing the old one. Version numbers in names are not reliable — ecourt-allahabad-2.0 is older than the unnumbered highcourt-allahbad. This is the clearest possible argument for the single-monorepo decision, where a connector has one location and a git history.
Benches are not separate courts
The old tree has highcourt-allahbad and highcourt-lucknow as separate repositories. They are one court — Allahabad High Court, sitting at Allahabad and at its Lucknow bench. The same applies to Punjab & Haryana High Court, which serves Punjab, Haryana and Chandigarh from a single seat.
This needs modelling properly, because it is user-visible: an advocate says "Allahabad High Court, Lucknow bench", not "Lucknow High Court".
court:
id: allahabad-hc
name: "High Court of Judicature at Allahabad"
benches:
- id: allahabad-hc.allahabad
name: "Allahabad"
base_url: "https://allahabadhighcourt.in"
- id: allahabad-hc.lucknow
name: "Lucknow Bench"
base_url: "https://elegalix.allahabadhighcourt.in"
connector: allahabad_hc # one connector, bench as a parameter
One connector, bench as a parameter. The alternative — a connector per bench — is how the old system ended up with two repositories that must be fixed twice whenever the court changes anything shared.
The M1 four
Chosen to prove the connector interface against the widest possible variety, rather than to maximise court count. If the abstraction survives these four, it will survive the remaining sixty-six.
With Patna deferred, M1 is smaller and faster — a good outcome for the riskiest milestone in the plan. The four remaining courts still cover the four distinct connector shapes that matter: a clean API, a captcha-and-benches court, a parameterised multi-instance court, and a non-image captcha.
Public JSON API, no captcha, no HTML parsing. Proves the interface end to end with the fewest confounding variables. Should be working within days.
Existing Securimage model to port, plus the bench model exercised for real. The most active repo in the old fleet, so the domain knowledge is current.
One connector parameterised by state and district. Includes the audio captcha experiment, which should run in the first week because a positive result changes the captcha strategy for a large share of the fleet.
Arithmetic captcha rather than character recognition, exercising the type-dispatch design in the captcha pipeline rather than assuming every captcha is an image of text.
Delhi High Court is deliberately held back to M2 despite being a priority. It is a conventional HTTP-plus-image-captcha court, which by then will be well-trodden ground — it adds coverage rather than information, and M1's job is information.
What deferring Patna leaves unproven
All four M1 courts use HTTP. That means M1 no longer exercises transport: browser at all — the path Patna was carrying. It is not needed for M1 to succeed, but it cannot stay unproven indefinitely: ~15 of the old repos still drive Selenium, so some court in the fleet will need it.
Recommendation: prove browser transport in M2 alongside Delhi, using whichever court genuinely requires it — and treat "browser transport works end to end, with per-court concurrency honoured" as an explicit gate before M6 begins. Discovering the browser path is broken during a 66-court migration would be an expensive place to find out.
Tribunals
Fourteen repositories of widely varying age — tribunals, tribunals-NGT, tribunals-itat, ngt, NCLT-services, NCLAT-services, DRT, DRT-2.0, DRAT-services, AFT-Delhi, aft-chandigarh, cgit, confonet2.0, vaad. Two are empty of Python entirely.
Tribunals are lower priority than the High Courts for M1 and belong in the M6 fleet migration, with one exception worth noting: DRT, reat-serveces and DRAT-services are the only three repositories appearing in any deployment manifest. That may indicate they are the most recently or carefully deployed services — or simply that the manifests were abandoned mid-use. Worth resolving during the live-server audit, since it is the only deployment evidence that exists.
Coverage roadmap
| Phase | Courts | Rationale |
|---|---|---|
| M1 | P&H, Allahabad (both benches), District eCourts, Supreme Court | Maximum variety — prove the abstraction |
| M2 | Delhi HC, plus one browser-transport court | Adds coverage; closes the browser gap before M6 |
| M3 | Cause lists for all M1–M2 courts | Layout variance is the real work here |
| M6 | Remaining ~66: Patna, other High Courts, all tribunals, RERA, consumer forums | Mechanical once the framework holds |
Coverage is never limited by subscription plan — see Tenancy, Roles & Plans. Restricting which courts a plan may track would make the product worse at its one job while saving nothing, since cost scales per matter rather than per court.