How mathangi18/mdr works
MDR Legal Evidence Workshop is a browser-based regulatory reading and legal-assessment application. Participants authenticate, query a frozen MDR corpus, inspect cited evidence and plain-language explanations, and save editable legal decisions; generated drafts are not approved meanings. Its runtime combines retrieval, graph context, and rule-based or local-model explanations, while assessment storage keeps participant drafts separate. The README also documents isolated adapter-training code. Backend excerpts are partial, so some documented frontend/API relationships use README evidence; unsampled implementation links are omitted.
Main entry points: app.py Authenticated API · loop.py Evidence answering · model.py Local draft model · run.py Adapter training
Components 24
Workshop interface
- Workshop UI
workshop_deployment/frontend/index.html - Assessment editor
workshop_deployment/frontend/assessment.js - Review interface
workshop_deployment/frontend/review.js - Inference interface
workshop_deployment/frontend/inference.js - Hosted access
workshop_deployment/frontend/hosted.js
Query and explanation
- Authenticated API
workshop_deployment/backend/app.py - Evidence answering
workshop_deployment/backend/loop.py - Hybrid retrieval
workshop_deployment/backend/retrieval.py - Concept matching
workshop_deployment/backend/concepts.py - Plain-language rules
workshop_deployment/backend/explanation.py - Local draft model
workshop_deployment/backend/model.py - Inference metrics
workshop_deployment/backend/telemetry.py - Result contracts
workshop_deployment/backend/schemas.py
Legal assessment
- Legal graph contract
workshop_deployment/backend/legal_graph.py - Decision validation
workshop_deployment/backend/review.py - Draft revisions
workshop_deployment/backend/store.py
Corpus and persistence
- Regulatory corpus
workshop_deployment/bundle/corpus.sqlite - Source documents
workshop_deployment/bundle/source_documents - SQLite access
workshop_deployment/backend/storage.py - Graph connector
workshop_deployment/backend/connector.py
Model training
- Training dataset
training/data.py - Adapter training
training/run.py
Other components
- Participant
- Training operator
Connections 26
- Participant → Workshop UI: uses
README.md - Workshop UI → Authenticated API: requests
README.md - Assessment editor → Authenticated API: submits decisions
README.md - Review interface → Authenticated API: requests review
README.md - Inference interface → Authenticated API: requests drafts
README.md - Hosted access → Authenticated API: accesses
README.md - Authenticated API → Evidence answering: dispatches queries
workshop_deployment/backend/app.py - Evidence answering → Hybrid retrieval: searches evidence
workshop_deployment/backend/loop.py - Evidence answering → Concept matching: detects concepts
workshop_deployment/backend/loop.py - Evidence answering → Plain-language rules: explains evidence
workshop_deployment/backend/loop.py - Evidence answering → Result contracts: builds results
workshop_deployment/backend/loop.py - Hybrid retrieval → SQLite access: reads through
workshop_deployment/backend/retrieval.py - SQLite access → Regulatory corpus: queries
README.md - Authenticated API → Decision validation: validates decisions
workshop_deployment/backend/app.py - Decision validation → Legal graph contract: edits graph
workshop_deployment/backend/review.py - Authenticated API → Draft revisions: loads and saves
workshop_deployment/backend/app.py - Draft revisions → SQLite access: uses connections
workshop_deployment/backend/store.py - Authenticated API → Source documents: serves PDFs
workshop_deployment/backend/app.py - Authenticated API → Regulatory corpus: serves corpus
workshop_deployment/backend/app.py - Authenticated API → Local draft model: requests generation
workshop_deployment/backend/app.py - Local draft model → Plain-language rules: decomposes drafts
workshop_deployment/backend/model.py - Local draft model → Inference metrics: measures inference
workshop_deployment/backend/model.py - Evidence answering → Graph connector: uses graph links
- Training operator → Adapter training: runs training
README.md - Adapter training → Training dataset: loads dataset code
training/run.py - Adapter training → Local draft model: uses model definitions
training/run.py