# ClauseGuard
AI-assisted Government Resolution (GR) drafting for Maharashtra — VJTI AI Hackathon 2026
("Shaping Digital Governance", Problem 1: MAHA-GR-ALIGN).
**Live demo**:
clause-guard.streamlit.app (cloud LLM mode; the four sidebar
demo scenarios are pre-cached — fully local Ollama mode is the recording setup, see
`DEPLOYMENT.md`).
Drafts and reviews Maharashtra GRs against a corpus of real ones:
1. **Cross-departmental conflict detection** — retrieval narrows candidate clause pairs,
an LLM (and optionally a fine-tuned MuRIL cross-encoder) screens them, and flagged
conflicts get a drafting-officer-grade explanation citing the conflicting GRs.
2. **Reference tracking** — extracts cited GR numbers/codes, links them to the corpus,
flags stale (superseded) references, suggests successors.
3. **Template compliance** — deterministic scorecard against Manual of Office Procedure
conventions (header, Read block, preamble, numbered clauses, financial-sanction block,
budget head, signature formula, code).
4. **Bilingual terminology** — Marathi ↔ English legal/administrative glossary.
5. **Drafting assistance** — a deterministic template scaffold guarantees every mandatory
section in both languages; an optional AI layer (local Ollama in ollama mode — the
brief never leaves the machine) expands an officer's brief into the preamble and
clauses, digit-audited so no numeral is invented or dropped.
6. **Audit trail** — every review and generation appends to a local JSONL: the
suggestions offered, the deterministic results, and a unified diff of the officer's
edits between submissions.
7. **Export** — the draft and the review report as DOCX (Nirmala UI) or PDF (embedded
Noto fonts with harfbuzz shaping, so Marathi conjuncts render correctly).
## Corpus note
The live portal gr.maharashtra.gov.in returned 503 throughout the hackathon window
(Jul 26–28, 2026). The corpus was therefore built from the **Wayback Machine's archive
of the same portal** (≥20,000 archived * …