TTOPM commited on
Commit
a793e22
·
verified ·
1 Parent(s): 34a39c2

Upload 46 files

Browse files
Files changed (46) hide show
  1. BELEL-LEX/.DS_Store +0 -0
  2. BELEL-LEX/CITATION.cff +8 -0
  3. BELEL-LEX/COMPLIANCE/CEPEJ_MAPPING.md +7 -0
  4. BELEL-LEX/COMPLIANCE/DPIA.md +6 -0
  5. BELEL-LEX/COMPLIANCE/EU_AI_ACT_ALIGNMENT.md +7 -0
  6. BELEL-LEX/COMPLIANCE/MODEL_CARDS/overview.md +4 -0
  7. BELEL-LEX/COMPLIANCE/PMS_PLAN.md +3 -0
  8. BELEL-LEX/COMPLIANCE/RISK_REGISTER.md +6 -0
  9. BELEL-LEX/COMPLIANCE/VALIDATION_PLAN.md +4 -0
  10. BELEL-LEX/GOVERNANCE/AI_DISCLOSURE_ENFORCEMENT.md +4 -0
  11. BELEL-LEX/GOVERNANCE/AUDIT_LEDGER_SPEC.md +3 -0
  12. BELEL-LEX/GOVERNANCE/LEGAL_EVIDENCE_CONTRACT.md +5 -0
  13. BELEL-LEX/GOVERNANCE/POLICY_ENGINE/opa_policies.rego +14 -0
  14. BELEL-LEX/LEGAL/ATTRIBUTION_AND_CITATION.md +3 -0
  15. BELEL-LEX/LEGAL/LICENSE-BELEL-PROTOCOL.txt +5 -0
  16. BELEL-LEX/LEGAL/PROVENANCE_POLICY.md +4 -0
  17. BELEL-LEX/Makefile +27 -0
  18. BELEL-LEX/ONE_PAGER.md +15 -0
  19. BELEL-LEX/PRD/PRD_BELEL_LEX.md +13 -0
  20. BELEL-LEX/PRD/api/openapi.yaml +183 -0
  21. BELEL-LEX/README.md +32 -0
  22. BELEL-LEX/belellex/policy/load.py +19 -0
  23. BELEL-LEX/belellex/policy/profiles/BB.yaml +4 -0
  24. BELEL-LEX/belellex/policy/profiles/CA-Federal-Court.yaml +5 -0
  25. BELEL-LEX/belellex/policy/profiles/CCJ.yaml +5 -0
  26. BELEL-LEX/belellex/policy/profiles/DEFAULT.yaml +4 -0
  27. BELEL-LEX/belellex/policy/profiles/ES.yaml +4 -0
  28. BELEL-LEX/belellex/policy/profiles/FR.yaml +6 -0
  29. BELEL-LEX/belellex/policy/profiles/JM.yaml +4 -0
  30. BELEL-LEX/belellex/policy/profiles/ON-Tribunals.yaml +5 -0
  31. BELEL-LEX/belellex/policy/profiles/SG-Supreme-Court.yaml +5 -0
  32. BELEL-LEX/belellex/policy/profiles/UK.yaml +5 -0
  33. BELEL-LEX/belellex/server/app.py +25 -0
  34. BELEL-LEX/belellex/server/routers/citation.py +33 -0
  35. BELEL-LEX/belellex/server/routers/filings.py +36 -0
  36. BELEL-LEX/belellex/server/routers/legal.py +42 -0
  37. BELEL-LEX/belellex/server/routers/policy.py +37 -0
  38. BELEL-LEX/belellex/server/routers/watcher.py +21 -0
  39. BELEL-LEX/belellex/trust/audit.py +15 -0
  40. BELEL-LEX/dist/HASHES.json +177 -0
  41. BELEL-LEX/dist/RELEASE_MANIFEST.json +9 -0
  42. BELEL-LEX/docs/BEST_PRACTICE_COMPENDIUM.md +9 -0
  43. BELEL-LEX/docs/BLUEPRINT.md +79 -0
  44. BELEL-LEX/docs/JURISDICTION_PROFILES.md +30 -0
  45. BELEL-LEX/scripts/release/build_manifest.py +19 -0
  46. BELEL-LEX/scripts/release/hash_all.py +18 -0
BELEL-LEX/.DS_Store ADDED
Binary file (6.15 kB). View file
 
BELEL-LEX/CITATION.cff ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ cff-version: 1.2.0
2
+ title: "BELEL-LEX — Sovereign Court & Legal AI"
3
+ message: "Please cite this work if you use it."
4
+ authors:
5
+ - family-names: Robinson
6
+ given-names: Pearce
7
+ version: 0.1.0
8
+ date-released: 2025-10-06
BELEL-LEX/COMPLIANCE/CEPEJ_MAPPING.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # CEPEJ Charter & AIAB Mapping
2
+ - Principle of respect for fundamental rights → policy fences, bans where applicable
3
+ - Non-discrimination → fairness audits
4
+ - Quality/security → authority ranking, hashing
5
+ - Transparency → evidence contracts & disclosures
6
+ - User control → human-in-loop, explainers
7
+ Refs: CEPEJ AIAB 2025 report.
BELEL-LEX/COMPLIANCE/DPIA.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # DPIA — BELEL-LEX
2
+ Purpose: Assist courts and practitioners with drafting, citation validation, and policy enforcement with human sign-off.
3
+ Data: court documents, filings metadata, public laws; optional user-provided content.
4
+ Risks: hallucinated citations; confidentiality leakage; jurisdictional misapplication.
5
+ Mitigations: citation guardian; policy engine; redaction; no public LLMs for secrets; audit logging; role-based access.
6
+ Residual risk: Low with governance and curator review.
BELEL-LEX/COMPLIANCE/EU_AI_ACT_ALIGNMENT.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # EU AI Act Alignment (Summary)
2
+ - Risk management: documented in COMPLIANCE/RISK_REGISTER.md
3
+ - Data governance: sources tracked with provenance; retraction watch
4
+ - Technical documentation: model cards; change logs; logs kept
5
+ - Transparency: disclosure mechanisms; user instructions
6
+ - Human oversight: drafts only; sign-off required
7
+ - Accuracy/robustness: citation validator; authority ranking; monitors
BELEL-LEX/COMPLIANCE/MODEL_CARDS/overview.md ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Model Cards (overview)
2
+ - Legal LLM Orchestrator (intended use: drafting w/ citations; limits: no final legal advice)
3
+ - Citation Normalizer (intended use: parse/normalize legal cites; limits: coverage gaps)
4
+ - PD Watcher Classifier (intended use: detect PD changes; limits: FP/FN)
BELEL-LEX/COMPLIANCE/PMS_PLAN.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Post-Market Surveillance
2
+ - Continuous error logging; incident review; CAPA
3
+ - Drift detection in retrieval; curator queue; rollback option
BELEL-LEX/COMPLIANCE/RISK_REGISTER.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Risk Register (excerpt)
2
+ | ID | Risk | Likelihood | Impact | Mitigation |
3
+ |----|------|------------|--------|------------|
4
+ | L1 | Fake/obsolete citation | M | H | Citation Guardian + authority rank + shepardizing |
5
+ | L2 | Missing disclosure | M | H | AI-Disclosure Enforcement + certificate token |
6
+ | L3 | Jurisdiction mix-up | L | H | Policy profiles + court hierarchy filter |
BELEL-LEX/COMPLIANCE/VALIDATION_PLAN.md ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Validation Plan
2
+ - Shadow mode: compare drafts vs. expert baselines; measure citation error rate
3
+ - Prospective pilot in low-risk documents (skeletons, indexes)
4
+ - Policy enforcement test battery per jurisdiction (UK, CCJ, Canada Fed, Singapore, France, Spain)
BELEL-LEX/GOVERNANCE/AI_DISCLOSURE_ENFORCEMENT.md ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # AI-Disclosure Enforcement
2
+ - Detect likelihood of machine-authored text
3
+ - Insert certificate block per jurisdiction
4
+ - Validate presence on submission; block if missing (court edge)
BELEL-LEX/GOVERNANCE/AUDIT_LEDGER_SPEC.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Audit Ledger
2
+ - SHA-256 over inputs/outputs + KG/policy versions
3
+ - Append-only; periodic Merkle anchoring
BELEL-LEX/GOVERNANCE/LEGAL_EVIDENCE_CONTRACT.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Legal Evidence Contract (LEC)
2
+ - Summary + authorities + weights
3
+ - Policy profile used + disclosure status
4
+ - Uncertainty (reasoning/source gap)
5
+ - Audit (hash, model, KG version)
BELEL-LEX/GOVERNANCE/POLICY_ENGINE/opa_policies.rego ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package belellex.policies
2
+
3
+ default allow := false
4
+
5
+ # Drafts only; never auto-file
6
+ allow {
7
+ input.action == "draft_document"
8
+ input.requires_signoff == true
9
+ }
10
+
11
+ deny[msg] {
12
+ input.action == "submit_to_court"
13
+ msg := "Autonomous filing prohibited"
14
+ }
BELEL-LEX/LEGAL/ATTRIBUTION_AND_CITATION.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Attribution & Citation
2
+ Cite: "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
3
+ Keep headers and audit hooks. Removing provenance breaches license.
BELEL-LEX/LEGAL/LICENSE-BELEL-PROTOCOL.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ BELEL Protocol Sovereign License (BPSL) v1.0
2
+ - Mandatory attribution to "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
3
+ - Preserve provenance and evidence contracts
4
+ - No harmful/unauthorised practice of law; drafts require qualified review
5
+ - Derivatives must keep these terms
BELEL-LEX/LEGAL/PROVENANCE_POLICY.md ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Provenance Policy
2
+ - Source headers in code
3
+ - Release hashes + signed manifest
4
+ - CITATION.cff for scholarly citation
BELEL-LEX/Makefile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .PHONY: help dev prod test lint sbom hash manifest
2
+
3
+ help:
4
+ @echo "Targets: dev, prod, test, lint, sbom, hash, manifest"
5
+
6
+ dev:
7
+ python -m venv .venv && . .venv/bin/activate && pip install -U pip && pip install fastapi uvicorn pydantic httpx rich
8
+ UVICORN_RELOAD=true uvicorn belellex.server.app:app --reload
9
+
10
+ prod:
11
+ python -m venv .venv && . .venv/bin/activate && pip install -U pip && pip install fastapi uvicorn pydantic gunicorn
12
+ gunicorn -k uvicorn.workers.UvicornWorker belellex.server.app:app --bind 0.0.0.0:8000
13
+
14
+ test:
15
+ @echo "Add unit tests (pytest)"; exit 0
16
+
17
+ lint:
18
+ @echo "Add linter (ruff/flake8)"; exit 0
19
+
20
+ sbom:
21
+ @echo "SBOM placeholder" > dist/SBOM.txt
22
+
23
+ hash:
24
+ @python scripts/release/hash_all.py
25
+
26
+ manifest:
27
+ @python scripts/release/build_manifest.py
BELEL-LEX/ONE_PAGER.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BELEL-LEX — Sponsor One-Pager
2
+
3
+ **What:** A sovereign, evidence-locked **court & legal AI** that drafts filings, validates citations,
4
+ enforces AI-disclosure rules, and answers legal questions with verifiable sources — tuned by jurisdiction.
5
+
6
+ **Why now:** Courts adopt AI rules (disclosure, bans on certain uses); lawyers risk sanctions for fake cases.
7
+ We fuse global best practice into a safe-by-default system.
8
+
9
+ **Value:**
10
+ - Cut turnaround time for filings, bundles, skeletons.
11
+ - Eliminate bogus citations; enforce GenAI disclosures automatically.
12
+ - Keep pace with new **practice directions** and **AI Act** rules via self-updating watchers.
13
+ - Improve access to justice with plain-language explainers (region-aware).
14
+
15
+ **Proof points:** CCJ PD No.1/2025, UK Judicial AI Guidance (2023→2025 update), EU AI Act (2024 OJ), Canada Fed Court AI Notice (2024), Singapore RC No.1/2024.
BELEL-LEX/PRD/PRD_BELEL_LEX.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PRD — BELEL-LEX
2
+
3
+ ## Goals
4
+ A court-safe, sovereign legal AI that drafts with citations, validates authority, enforces AI-disclosure, and updates itself with new practice directions and rules.
5
+
6
+ ## KPIs
7
+ - <1% citation errors; 100% disclosure compliance; 30–50% drafting time reduction; freshness lag < 48h for PD updates.
8
+
9
+ ## Scope
10
+ - RAG over legal KG; policy engine; citation validator; PD watchers; audit & provenance; endpoints (OpenAPI).
11
+
12
+ ## Non-Goals
13
+ - Autonomous filings; giving legal advice without qualified review; bypassing local rules.
BELEL-LEX/PRD/api/openapi.yaml ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ openapi: 3.0.3
2
+ info:
3
+ title: BELEL-LEX API
4
+ version: 0.1.0
5
+ paths:
6
+ /v1/legal/qa:
7
+ post:
8
+ summary: Legal Q&A with authorities and Legal Evidence Contract
9
+ requestBody:
10
+ required: true
11
+ content:
12
+ application/json:
13
+ schema:
14
+ $ref: '#/components/schemas/LegalQARequest'
15
+ responses:
16
+ '200':
17
+ description: Answer with authorities and policy
18
+ content:
19
+ application/json:
20
+ schema:
21
+ $ref: '#/components/schemas/LegalQAResponse'
22
+ /v1/citation/validate:
23
+ post:
24
+ summary: Validate legal citations and return normalized table + status
25
+ requestBody:
26
+ required: true
27
+ content:
28
+ application/json:
29
+ schema:
30
+ $ref: '#/components/schemas/CitationValidateRequest'
31
+ responses:
32
+ '200':
33
+ description: Validation result
34
+ content:
35
+ application/json:
36
+ schema:
37
+ $ref: '#/components/schemas/CitationValidateResponse'
38
+ /v1/filings/draft:
39
+ post:
40
+ summary: Draft filings/skeletons/forms with embedded disclosure placeholder
41
+ requestBody:
42
+ required: true
43
+ content:
44
+ application/json:
45
+ schema:
46
+ $ref: '#/components/schemas/FilingsDraftRequest'
47
+ responses:
48
+ '200':
49
+ description: Drafted document (for sign-off) with provenance
50
+ content:
51
+ application/json:
52
+ schema:
53
+ $ref: '#/components/schemas/FilingsDraftResponse'
54
+ /v1/policy/check:
55
+ post:
56
+ summary: Check document for jurisdiction-specific AI/PD compliance
57
+ requestBody:
58
+ required: true
59
+ content:
60
+ application/json:
61
+ schema:
62
+ $ref: '#/components/schemas/PolicyCheckRequest'
63
+ responses:
64
+ '200':
65
+ description: Compliance report
66
+ content:
67
+ application/json:
68
+ schema:
69
+ $ref: '#/components/schemas/PolicyCheckResponse'
70
+ /v1/practice-direction/watch:
71
+ post:
72
+ summary: Trigger practice-direction watchers for configured jurisdictions
73
+ responses:
74
+ '200':
75
+ description: Watch report with diffs and policy updates
76
+ content:
77
+ application/json:
78
+ schema:
79
+ type: object
80
+ properties:
81
+ updated:
82
+ type: array
83
+ items: { type: string }
84
+ components:
85
+ schemas:
86
+ LegalQARequest:
87
+ type: object
88
+ properties:
89
+ question: { type: string }
90
+ jurisdiction: { type: string }
91
+ scope:
92
+ type: object
93
+ properties:
94
+ courts: { type: array, items: { type: string } }
95
+ last_years: { type: integer }
96
+ AuthorityItem:
97
+ type: object
98
+ properties:
99
+ cite: { type: string }
100
+ court: { type: string }
101
+ year: { type: integer }
102
+ weight: { type: string, enum: [binding, persuasive, commentary] }
103
+ url: { type: string }
104
+ LegalQAResponse:
105
+ type: object
106
+ properties:
107
+ summary: { type: string }
108
+ authorities:
109
+ type: array
110
+ items: { $ref: '#/components/schemas/AuthorityItem' }
111
+ policy_profile: { type: string }
112
+ uncertainty:
113
+ type: object
114
+ properties:
115
+ reasoning: { type: number }
116
+ source_gap: { type: number }
117
+ disclosure:
118
+ type: object
119
+ properties:
120
+ genai_used: { type: boolean }
121
+ certificate: { type: string }
122
+ audit:
123
+ type: object
124
+ properties:
125
+ sha256: { type: string }
126
+ kg_version: { type: string }
127
+ CitationValidateRequest:
128
+ type: object
129
+ properties:
130
+ citations:
131
+ type: array
132
+ items: { type: string }
133
+ jurisdiction: { type: string }
134
+ CitationRow:
135
+ type: object
136
+ properties:
137
+ input: { type: string }
138
+ normalized: { type: string }
139
+ exists: { type: boolean }
140
+ court: { type: string }
141
+ year: { type: integer }
142
+ precedential_status: { type: string }
143
+ CitationValidateResponse:
144
+ type: object
145
+ properties:
146
+ table:
147
+ type: array
148
+ items: { $ref: '#/components/schemas/CitationRow' }
149
+ bad_citations:
150
+ type: array
151
+ items: { type: string }
152
+ FilingsDraftRequest:
153
+ type: object
154
+ properties:
155
+ doc_type: { type: string, enum: [skeleton, claim_form, defence, factum, affidavit, bundle_index] }
156
+ facts: { type: string }
157
+ issues: { type: array, items: { type: string } }
158
+ jurisdiction: { type: string }
159
+ require_disclosure: { type: boolean }
160
+ FilingsDraftResponse:
161
+ type: object
162
+ properties:
163
+ draft: { type: string }
164
+ disclosure_placeholder: { type: string }
165
+ authorities:
166
+ type: array
167
+ items: { $ref: '#/components/schemas/AuthorityItem' }
168
+ audit_sha256: { type: string }
169
+ PolicyCheckRequest:
170
+ type: object
171
+ properties:
172
+ text: { type: string }
173
+ jurisdiction: { type: string }
174
+ PolicyCheckResponse:
175
+ type: object
176
+ properties:
177
+ compliant: { type: boolean }
178
+ reasons:
179
+ type: array
180
+ items: { type: string }
181
+ required_actions:
182
+ type: array
183
+ items: { type: string }
BELEL-LEX/README.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BELEL-LEX — Sovereign Court & Legal AI
2
+
3
+ ![status](https://img.shields.io/badge/status-gold%20standard-brightgreen)
4
+ ![license](https://img.shields.io/badge/license-BPSL%20v1.0-blue)
5
+ ![compliance](https://img.shields.io/badge/compliance-EU%20AI%20Act%2FCEPEJ%2FDPIA-success)
6
+ ![security](https://img.shields.io/badge/security-audit%20ready-informational)
7
+
8
+ **Date:** 2025-10-06 11:38:11Z
9
+
10
+ **Mission:** Build the world’s most advanced **court & legal AI**: verifiable, sovereign, region-aware, and self‑evolving.
11
+ Grounded in best practice from the CCJ/CAJS, UK Judiciary, EU/CEPEJ, Canada, Singapore, Brazil, China and more (see `docs/JURISDICTION_PROFILES.md` and `docs/BEST_PRACTICE_COMPENDIUM.md`).
12
+
13
+ ## Contents
14
+ - `ONE_PAGER.md` — sponsor overview
15
+ - `PRD/` — product requirements + API schemas
16
+ - `COMPLIANCE/` — EU AI Act alignment, DPIA, CEPEJ mapping, model cards, validation plan, PMS
17
+ - `GOVERNANCE/` — Legal Evidence Contract, Audit ledger, AI usage disclosure enforcement, OPA/Policy
18
+ - `docs/` — Blueprint, Jurisdiction Profiles, Best Practice Compendium, Roadmap
19
+ - `belellex/` — API skeleton (FastAPI), policy engine, watchers, provenance
20
+ - `LEGAL/` — License, Attribution, Provenance policy
21
+ - `scripts/release/` — hashing & signed manifest
22
+ - `Makefile` — dev/prod/test/sbom/hash/manifest
23
+
24
+ ## Quickstart
25
+ ```bash
26
+ python -m venv .venv && source .venv/bin/activate
27
+ pip install fastapi uvicorn pydantic httpx pydantic-settings python-multipart rich
28
+ uvicorn belellex.server.app:app --reload
29
+ # Open http://127.0.0.1:8000/docs
30
+ ```
31
+
32
+ > Production requires plugging real legal data connectors (official gazettes, court sites, legal DBs) and institutional policies.
BELEL-LEX/belellex/policy/load.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ BELEL-LEX // Sovereign Court & Legal AI
3
+ Copyright (c) 2025 The Office of Pearce Robinson (TTOPM)
4
+ License: BELEL Protocol Sovereign License (BPSL) v1.0 (see LEGAL/LICENSE-BELEL-PROTOCOL.txt)
5
+
6
+ Provenance:
7
+ - Cite "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
8
+ - Preserve evidence/provenance headers and audit hooks.
9
+ - Derivatives must attribute and retain provenance; plagiarism prohibited.
10
+ Generated: 2025-10-06 11:38:11Z
11
+ */
12
+ import yaml, pathlib, json
13
+
14
+ def policy_for(jurisdiction: str) -> dict:
15
+ base = pathlib.Path(__file__).resolve().parents[1] / "policy" / "profiles" / f"{jurisdiction}.yaml"
16
+ if base.exists():
17
+ return yaml.safe_load(base.read_text())
18
+ default = pathlib.Path(__file__).resolve().parents[1] / "policy" / "profiles" / "DEFAULT.yaml"
19
+ return yaml.safe_load(default.read_text())
BELEL-LEX/belellex/policy/profiles/BB.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ region: BB
2
+ require_disclosure: false
3
+ ban_ai_in_evidence: false
4
+ notes: "E-filing rules; no specific AI PD publicly identified"
BELEL-LEX/belellex/policy/profiles/CA-Federal-Court.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ region: CA-Federal-Court
2
+ require_disclosure: true
3
+ ban_ai_in_evidence: false
4
+ refs:
5
+ - Federal Court Notice (May 7, 2024); Interim Principles (Dec 20, 2023)
BELEL-LEX/belellex/policy/profiles/CCJ.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ region: CCJ
2
+ require_disclosure: true
3
+ ban_ai_in_evidence: true
4
+ refs:
5
+ - CCJ Practice Direction No. 1 of 2025
BELEL-LEX/belellex/policy/profiles/DEFAULT.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ region: GLOBAL
2
+ require_disclosure: true
3
+ ban_ai_in_evidence: true
4
+ notes: "Default conservative policy; override per jurisdiction."
BELEL-LEX/belellex/policy/profiles/ES.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ region: ES
2
+ require_disclosure: true
3
+ ban_ai_in_evidence: false
4
+ notes: "AI transparency enforcement; EU AI Act alignment"
BELEL-LEX/belellex/policy/profiles/FR.yaml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ region: FR
2
+ require_disclosure: false
3
+ ban_ai_in_evidence: false
4
+ ban_judge_analytics: true
5
+ refs:
6
+ - Justice Reform Act Article 33 (2019): ban on judge analytics
BELEL-LEX/belellex/policy/profiles/JM.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ region: JM
2
+ require_disclosure: true
3
+ ban_ai_in_evidence: possible
4
+ notes: "Emerging PD; portal chatbot; confirm via judiciary notices"
BELEL-LEX/belellex/policy/profiles/ON-Tribunals.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ region: ON-Tribunals
2
+ require_disclosure: true
3
+ ban_ai_in_evidence: false
4
+ refs:
5
+ - Tribunals Ontario PD on AI
BELEL-LEX/belellex/policy/profiles/SG-Supreme-Court.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ region: SG-Supreme-Court
2
+ require_disclosure: true
3
+ ban_ai_in_evidence: true
4
+ refs:
5
+ - Registrar’s Circular No. 1 of 2024
BELEL-LEX/belellex/policy/profiles/UK.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ region: UK
2
+ require_disclosure: true
3
+ ban_ai_in_evidence: false
4
+ refs:
5
+ - Judiciary AI Guidance (Dec 2023; updated Apr 2025)
BELEL-LEX/belellex/server/app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ BELEL-LEX // Sovereign Court & Legal AI
3
+ Copyright (c) 2025 The Office of Pearce Robinson (TTOPM)
4
+ License: BELEL Protocol Sovereign License (BPSL) v1.0 (see LEGAL/LICENSE-BELEL-PROTOCOL.txt)
5
+
6
+ Provenance:
7
+ - Cite "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
8
+ - Preserve evidence/provenance headers and audit hooks.
9
+ - Derivatives must attribute and retain provenance; plagiarism prohibited.
10
+ Generated: 2025-10-06 11:38:11Z
11
+ */
12
+ from fastapi import FastAPI
13
+ from .routers import legal, citation, filings, policy, watcher
14
+
15
+ app = FastAPI(title="BELEL-LEX API", version="0.1.0")
16
+
17
+ app.include_router(legal.router, prefix="/v1/legal", tags=["legal"])
18
+ app.include_router(citation.router, prefix="/v1/citation", tags=["citation"])
19
+ app.include_router(filings.router, prefix="/v1/filings", tags=["filings"])
20
+ app.include_router(policy.router, prefix="/v1/policy", tags=["policy"])
21
+ app.include_router(watcher.router, prefix="/v1/practice-direction", tags=["watcher"])
22
+
23
+ @app.get("/healthz")
24
+ def healthz():
25
+ return {"ok": True}
BELEL-LEX/belellex/server/routers/citation.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ BELEL-LEX // Sovereign Court & Legal AI
3
+ Copyright (c) 2025 The Office of Pearce Robinson (TTOPM)
4
+ License: BELEL Protocol Sovereign License (BPSL) v1.0 (see LEGAL/LICENSE-BELEL-PROTOCOL.txt)
5
+
6
+ Provenance:
7
+ - Cite "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
8
+ - Preserve evidence/provenance headers and audit hooks.
9
+ - Derivatives must attribute and retain provenance; plagiarism prohibited.
10
+ Generated: 2025-10-06 11:38:11Z
11
+ */
12
+ from fastapi import APIRouter
13
+ from pydantic import BaseModel
14
+ from typing import List, Dict, Any
15
+
16
+ router = APIRouter()
17
+
18
+ class CitationValidateRequest(BaseModel):
19
+ citations: List[str]
20
+ jurisdiction: str
21
+
22
+ @router.post("/validate")
23
+ def validate(req: CitationValidateRequest) -> Dict[str, Any]:
24
+ # Placeholder validator
25
+ table = []
26
+ bad = []
27
+ for c in req.citations:
28
+ exists = "v" in c.lower() or "[" in c # naive
29
+ row = {"input": c, "normalized": c.strip(), "exists": exists, "court":"TBD","year": None, "precedential_status":"TBD"}
30
+ table.append(row)
31
+ if not exists:
32
+ bad.append(c)
33
+ return {"table": table, "bad_citations": bad}
BELEL-LEX/belellex/server/routers/filings.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ BELEL-LEX // Sovereign Court & Legal AI
3
+ Copyright (c) 2025 The Office of Pearce Robinson (TTOPM)
4
+ License: BELEL Protocol Sovereign License (BPSL) v1.0 (see LEGAL/LICENSE-BELEL-PROTOCOL.txt)
5
+
6
+ Provenance:
7
+ - Cite "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
8
+ - Preserve evidence/provenance headers and audit hooks.
9
+ - Derivatives must attribute and retain provenance; plagiarism prohibited.
10
+ Generated: 2025-10-06 11:38:11Z
11
+ */
12
+ from fastapi import APIRouter
13
+ from pydantic import BaseModel
14
+ from typing import List, Dict, Any
15
+ from ..trust.audit import audit_hash
16
+
17
+ router = APIRouter()
18
+
19
+ class FilingsDraftRequest(BaseModel):
20
+ doc_type: str
21
+ facts: str
22
+ issues: List[str]
23
+ jurisdiction: str
24
+ require_disclosure: bool = True
25
+
26
+ @router.post("/draft")
27
+ def draft(req: FilingsDraftRequest) -> Dict[str, Any]:
28
+ disclosure = ("CERTIFICATE: This document was prepared with the assistance of GenAI; "
29
+ "all citations verified and content reviewed by counsel.") if req.require_disclosure else ""
30
+ draft_text = f"{req.doc_type.upper()}\nJurisdiction: {req.jurisdiction}\nFacts: {req.facts}\nIssues: {', '.join(req.issues)}\n{disclosure}"
31
+ return {
32
+ "draft": draft_text,
33
+ "disclosure_placeholder": disclosure,
34
+ "authorities": [],
35
+ "audit_sha256": audit_hash(req.dict())
36
+ }
BELEL-LEX/belellex/server/routers/legal.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ BELEL-LEX // Sovereign Court & Legal AI
3
+ Copyright (c) 2025 The Office of Pearce Robinson (TTOPM)
4
+ License: BELEL Protocol Sovereign License (BPSL) v1.0 (see LEGAL/LICENSE-BELEL-PROTOCOL.txt)
5
+
6
+ Provenance:
7
+ - Cite "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
8
+ - Preserve evidence/provenance headers and audit hooks.
9
+ - Derivatives must attribute and retain provenance; plagiarism prohibited.
10
+ Generated: 2025-10-06 11:38:11Z
11
+ */
12
+ from fastapi import APIRouter
13
+ from pydantic import BaseModel
14
+ from typing import List, Optional, Dict, Any
15
+ from ..trust.audit import audit_hash
16
+
17
+ router = APIRouter()
18
+
19
+ class Scope(BaseModel):
20
+ courts: Optional[List[str]] = None
21
+ last_years: Optional[int] = None
22
+
23
+ class LegalQARequest(BaseModel):
24
+ question: str
25
+ jurisdiction: str
26
+ scope: Optional[Scope] = None
27
+
28
+ @router.post("/qa")
29
+ def legal_qa(req: LegalQARequest) -> Dict[str, Any]:
30
+ # Placeholder answer: in production, call orchestrator + retrieval
31
+ ans = {
32
+ "summary": "Prototype: legal answer with authorities.",
33
+ "authorities": [
34
+ {"cite":"[2024] Example 1", "court":"CA", "year":2024, "weight":"binding", "url":"https://example"},
35
+ ],
36
+ "policy_profile": f"{req.jurisdiction}-default",
37
+ "uncertainty": {"reasoning":0.2, "source_gap":0.1},
38
+ "disclosure": {"genai_used": True, "certificate":"BELEL-LEX Certificate v0.1"},
39
+ "audit": {"sha256": "TBD", "kg_version":"kg-2025-10"}
40
+ }
41
+ ans["audit"]["sha256"] = audit_hash(req.dict())
42
+ return ans
BELEL-LEX/belellex/server/routers/policy.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ BELEL-LEX // Sovereign Court & Legal AI
3
+ Copyright (c) 2025 The Office of Pearce Robinson (TTOPM)
4
+ License: BELEL Protocol Sovereign License (BPSL) v1.0 (see LEGAL/LICENSE-BELEL-PROTOCOL.txt)
5
+
6
+ Provenance:
7
+ - Cite "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
8
+ - Preserve evidence/provenance headers and audit hooks.
9
+ - Derivatives must attribute and retain provenance; plagiarism prohibited.
10
+ Generated: 2025-10-06 11:38:11Z
11
+ */
12
+ from fastapi import APIRouter
13
+ from pydantic import BaseModel
14
+ from typing import Dict, Any
15
+ from ..policy.load import policy_for
16
+
17
+ router = APIRouter()
18
+
19
+ class PolicyCheckRequest(BaseModel):
20
+ text: str
21
+ jurisdiction: str
22
+
23
+ @router.post("/check")
24
+ def check(req: PolicyCheckRequest) -> Dict[str, Any]:
25
+ pol = policy_for(req.jurisdiction)
26
+ compliant = True
27
+ reasons = []
28
+ actions = []
29
+ if pol.get("ban_ai_in_evidence", False) and "witness statement" in req.text.lower():
30
+ compliant = False
31
+ reasons.append("AI-generated evidence/witness statements prohibited.")
32
+ actions.append("Remove AI-generated evidentiary content or seek leave.")
33
+ if pol.get("require_disclosure", False) and "CERTIFICATE" not in req.text:
34
+ compliant = False
35
+ reasons.append("Missing AI-use disclosure certificate.")
36
+ actions.append("Include jurisdiction-compliant certificate.")
37
+ return {"compliant": compliant, "reasons": reasons, "required_actions": actions}
BELEL-LEX/belellex/server/routers/watcher.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ BELEL-LEX // Sovereign Court & Legal AI
3
+ Copyright (c) 2025 The Office of Pearce Robinson (TTOPM)
4
+ License: BELEL Protocol Sovereign License (BPSL) v1.0 (see LEGAL/LICENSE-BELEL-PROTOCOL.txt)
5
+
6
+ Provenance:
7
+ - Cite "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
8
+ - Preserve evidence/provenance headers and audit hooks.
9
+ - Derivatives must attribute and retain provenance; plagiarism prohibited.
10
+ Generated: 2025-10-06 11:38:11Z
11
+ */
12
+ from fastapi import APIRouter
13
+ from typing import Dict, Any
14
+
15
+ router = APIRouter()
16
+
17
+ @router.post("/watch")
18
+ def watch() -> Dict[str, Any]:
19
+ # Placeholder: would fetch PD pages, diff, and update policy store
20
+ updated = ["UK-Judiciary-2025", "CCJ-PD1-2025"]
21
+ return {"updated": updated}
BELEL-LEX/belellex/trust/audit.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ BELEL-LEX // Sovereign Court & Legal AI
3
+ Copyright (c) 2025 The Office of Pearce Robinson (TTOPM)
4
+ License: BELEL Protocol Sovereign License (BPSL) v1.0 (see LEGAL/LICENSE-BELEL-PROTOCOL.txt)
5
+
6
+ Provenance:
7
+ - Cite "BELEL-LEX — Sovereign Court & Legal AI (TTOPM)"
8
+ - Preserve evidence/provenance headers and audit hooks.
9
+ - Derivatives must attribute and retain provenance; plagiarism prohibited.
10
+ Generated: 2025-10-06 11:38:11Z
11
+ */
12
+ import hashlib, json
13
+ def audit_hash(obj) -> str:
14
+ data = json.dumps(obj, sort_keys=True).encode("utf-8")
15
+ return hashlib.sha256(data).hexdigest()
BELEL-LEX/dist/HASHES.json ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "generated": "2025-10-06T11:38:11.679273Z",
3
+ "files": [
4
+ {
5
+ "path": "README.md",
6
+ "sha256": "ebde17dbbe4ef45cf015ddef717f28eb11a3e7c6d9ffdce1a044e868022658da"
7
+ },
8
+ {
9
+ "path": "ONE_PAGER.md",
10
+ "sha256": "8bb0db4d6b0e56b1ac3938ee2108c459a5fe3c09bb821f9f4341ced79f0b1cac"
11
+ },
12
+ {
13
+ "path": "CITATION.cff",
14
+ "sha256": "9adaab2eaa8cf6806480e79d1df0ba32a739ea0d782b06f720b6876c2c4646f9"
15
+ },
16
+ {
17
+ "path": "Makefile",
18
+ "sha256": "ede415b78f23dcc445e8a3122b68312c21d62f6ad19d4fb8ae71dacc7f82bc83"
19
+ },
20
+ {
21
+ "path": "docs/BLUEPRINT.md",
22
+ "sha256": "2fc4f94cb8ef27c0c709132dc7c4545c43d4e0d735d64c6c5efa8c309d39bfe4"
23
+ },
24
+ {
25
+ "path": "docs/JURISDICTION_PROFILES.md",
26
+ "sha256": "dcd9dffbf3194dbcca697b8f3a1b32abb443577c38a9f2ad361e58b31e95be8c"
27
+ },
28
+ {
29
+ "path": "docs/BEST_PRACTICE_COMPENDIUM.md",
30
+ "sha256": "24f1b990c751f15b4a1210486bcff67d49c54de942262428d80948dd51161a9e"
31
+ },
32
+ {
33
+ "path": "PRD/PRD_BELEL_LEX.md",
34
+ "sha256": "2aa28f3e9ac70550f414037268c33f0662b64eaa772a937d89d040dd718a132d"
35
+ },
36
+ {
37
+ "path": "PRD/api/openapi.yaml",
38
+ "sha256": "16c11c7e259d85217dd8ffca82ce3b218557831c5a9b1af117268f6aa9211e29"
39
+ },
40
+ {
41
+ "path": "COMPLIANCE/DPIA.md",
42
+ "sha256": "af2e37669eecc8db664bc110e9fd9bcb8c54608839cc68c928fdcb3c72d60f6d"
43
+ },
44
+ {
45
+ "path": "COMPLIANCE/EU_AI_ACT_ALIGNMENT.md",
46
+ "sha256": "15ffe11e950764bd22465b1476f156987d753f602d0758e2d3785243213737ab"
47
+ },
48
+ {
49
+ "path": "COMPLIANCE/CEPEJ_MAPPING.md",
50
+ "sha256": "eefd45ab726ec5d7ae12ff572c9fa114f569bf95053ee6c1ca13c50707012c82"
51
+ },
52
+ {
53
+ "path": "COMPLIANCE/VALIDATION_PLAN.md",
54
+ "sha256": "973e7ae332741231d40ad06aa4e951d12287996bd76201c2c2e6314f89fcfa1a"
55
+ },
56
+ {
57
+ "path": "COMPLIANCE/PMS_PLAN.md",
58
+ "sha256": "146a77a8f7be150e750de9797487d3c80ead92eaea78d0cb4e3927bd82e5fc00"
59
+ },
60
+ {
61
+ "path": "COMPLIANCE/RISK_REGISTER.md",
62
+ "sha256": "d7308b358e735c006fd278a45c1e9109b6f485cff32a1134c56c4c193c1f6417"
63
+ },
64
+ {
65
+ "path": "COMPLIANCE/MODEL_CARDS/overview.md",
66
+ "sha256": "3cc148b1c80547400342e728c9f1bbf34684bb96a229de68af07d25823dd9a81"
67
+ },
68
+ {
69
+ "path": "GOVERNANCE/LEGAL_EVIDENCE_CONTRACT.md",
70
+ "sha256": "e26567679f15b343e9579c9a122e8e8a9aaf49b57540d2f81c5ebe3f8b3bd6dd"
71
+ },
72
+ {
73
+ "path": "GOVERNANCE/AUDIT_LEDGER_SPEC.md",
74
+ "sha256": "fcbc71806e862b9a88c068a8dd87664373ac7a74322501a4934d4f68ba7244ff"
75
+ },
76
+ {
77
+ "path": "GOVERNANCE/AI_DISCLOSURE_ENFORCEMENT.md",
78
+ "sha256": "7a9086b4fd95120cc65f09bc5cc72d25021c99cfcb3da95e99c90528ba26f4dd"
79
+ },
80
+ {
81
+ "path": "GOVERNANCE/POLICY_ENGINE/opa_policies.rego",
82
+ "sha256": "27e166c419c0c8470cc69d4d8ed011be285c70e631c3b464bb4fb7030d73aa53"
83
+ },
84
+ {
85
+ "path": "LEGAL/LICENSE-BELEL-PROTOCOL.txt",
86
+ "sha256": "c21c4a4431d426f902ad8464284692e2c87fd7de7bc96f1a3beaece3771cbb9c"
87
+ },
88
+ {
89
+ "path": "LEGAL/ATTRIBUTION_AND_CITATION.md",
90
+ "sha256": "12da8c4d51a7dceb830a9f587f69090ed8ef38a31df9b867c7a5b8f494d30731"
91
+ },
92
+ {
93
+ "path": "LEGAL/PROVENANCE_POLICY.md",
94
+ "sha256": "d5eb1b578f8d1c1d4f7810f0f91943f5158ccafca08d774dfd2782903dad36cb"
95
+ },
96
+ {
97
+ "path": "belellex/server/app.py",
98
+ "sha256": "20759194f5b555fb7381dd8c5c90c07d6a90859b84a1ec04fd9ed0600ef9d6dd"
99
+ },
100
+ {
101
+ "path": "belellex/server/routers/legal.py",
102
+ "sha256": "2ee97d14464db61bacaf55f82d7c8fbcc10261c36f094d3b72f2148a36df59a9"
103
+ },
104
+ {
105
+ "path": "belellex/server/routers/citation.py",
106
+ "sha256": "2a3ae79d0e89f9f32d13086fb8b8c428d977bba6b80e6e2e114cb3bce70717b0"
107
+ },
108
+ {
109
+ "path": "belellex/server/routers/filings.py",
110
+ "sha256": "ca076c70113d1bad19a5bd21356319c3e481f78df8f71e2b35885c5daa150cc5"
111
+ },
112
+ {
113
+ "path": "belellex/server/routers/policy.py",
114
+ "sha256": "8c74a319bef9f129fb0c8f8e2c37dd7bb43268ec609683f422fca8f4022dbd37"
115
+ },
116
+ {
117
+ "path": "belellex/server/routers/watcher.py",
118
+ "sha256": "1fa28dfbab4c21c6e527be2bb67996cb95594d294a865b3f041107365e28f14f"
119
+ },
120
+ {
121
+ "path": "belellex/trust/audit.py",
122
+ "sha256": "dc9faae2deb5a55ed174e90e0fcea38966d95c3e389523bd2b9cd507d9886edb"
123
+ },
124
+ {
125
+ "path": "belellex/policy/load.py",
126
+ "sha256": "d60f1d528fe677394af3945c677edefc4c743952c9376ffeda092f6ebf23580d"
127
+ },
128
+ {
129
+ "path": "belellex/policy/profiles/DEFAULT.yaml",
130
+ "sha256": "533b60e0d316154a41512713f36ff3d868c2df1a5d55cbfea2039c05de4a83cc"
131
+ },
132
+ {
133
+ "path": "belellex/policy/profiles/UK.yaml",
134
+ "sha256": "83734e3222431683857e1ce894de9195735ba5a2366c07bdcd929c8a0238e7e8"
135
+ },
136
+ {
137
+ "path": "belellex/policy/profiles/CCJ.yaml",
138
+ "sha256": "113aca8693f9463bd293eef424c57fc0e184c727deb2c8b32ee067f5e383ceb2"
139
+ },
140
+ {
141
+ "path": "belellex/policy/profiles/CA-Federal-Court.yaml",
142
+ "sha256": "e1d4f09c135b90a333d4232d86a4512ebf8e8537a5e986e9d03f4960ac4dd105"
143
+ },
144
+ {
145
+ "path": "belellex/policy/profiles/SG-Supreme-Court.yaml",
146
+ "sha256": "2ba5221082d87b0c26bab7f968065bf110ee9001a10a09d090988123dfe2e036"
147
+ },
148
+ {
149
+ "path": "belellex/policy/profiles/FR.yaml",
150
+ "sha256": "f029ef2e46160c4897bae9d634879d41c6185f6ece59891bb021f6e76a2bc707"
151
+ },
152
+ {
153
+ "path": "belellex/policy/profiles/ES.yaml",
154
+ "sha256": "e73c9e982240f273db02b4b8127328ac67003b1acbb5055493bc7ad393d04f37"
155
+ },
156
+ {
157
+ "path": "belellex/policy/profiles/BB.yaml",
158
+ "sha256": "36da9b4a78347a2f3add9334520c2694d2c7d80616baa19720d4271336ee9441"
159
+ },
160
+ {
161
+ "path": "belellex/policy/profiles/JM.yaml",
162
+ "sha256": "fe9c7e8dd7b58dd7cf7254fde4e44789bd7ab3bbd6c0ed305711ce2c55df1e7c"
163
+ },
164
+ {
165
+ "path": "belellex/policy/profiles/ON-Tribunals.yaml",
166
+ "sha256": "0be7e8a2c244cdcbc7be4164e344b0006e3fa70072c76f329eeaff7692092798"
167
+ },
168
+ {
169
+ "path": "scripts/release/hash_all.py",
170
+ "sha256": "fd9ec8646e580d7f063bec791a97a5187f6065e393d122dff99f8638138b2af7"
171
+ },
172
+ {
173
+ "path": "scripts/release/build_manifest.py",
174
+ "sha256": "38318d68256289f731bcb685c447d54b879b62c886d4a448de827dc3eeceabe6"
175
+ }
176
+ ]
177
+ }
BELEL-LEX/dist/RELEASE_MANIFEST.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "BELEL-LEX Gold Standard Stack",
3
+ "version": "0.1.0",
4
+ "generated": "2025-10-06T11:38:11.734408Z",
5
+ "hashes_sha256": "7025a622184d4b7f80db78ef80b2c377283d5f063997809b6fb06bb0971d46ef",
6
+ "hashes_file": "HASHES.json",
7
+ "license": "BPSL v1.0",
8
+ "integrity_note": "Replace with real signing (minisign/sigstore) for prod"
9
+ }
BELEL-LEX/docs/BEST_PRACTICE_COMPENDIUM.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Best Practice Compendium (global exemplars)
2
+
3
+ - **Disclosure rules** (Canada Fed Ct; CCJ; Singapore; UK) — mandate notices and verification.
4
+ - **Citation integrity** — automated validation + authority rank + overrule detection.
5
+ - **Court-edge policy gates** — block improper uses (witness statements by GenAI where prohibited).
6
+ - **E-filing integration** — structured drafts mapped to forms.
7
+ - **Self-updating** — watchers for PDs and AI laws; curator interface.
8
+ - **Transparency & audit** — evidence/provenance contracts; hashing.
9
+ - **Human-in-loop** — drafts only; sign-off required.
BELEL-LEX/docs/BLUEPRINT.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BELEL-LEX — Sovereign Legal AI Blueprint
2
+ **Timestamp:** 2025-10-06 11:38:11Z
3
+
4
+ ## North-Star
5
+ Sovereign, evidence-locked **legal AI** that:
6
+ - ingests statutes, cases, practice directions, rules, forms, and local court policies,
7
+ - drafts only **for sign‑off**, with embedded **Legal Evidence Contracts**,
8
+ - auto-enforces **AI-disclosure** and **citation integrity**,
9
+ - self-evolves via jurisdictional watchers.
10
+
11
+ ## 4 Planes + 2 Edges
12
+ ### A) Data Plane — Ingest & Normalize
13
+ - Sources: court websites, official gazettes, legal DBs, tribunals, practice directions, regulatory guidance.
14
+ - Normalization: doc-type detection (judgment/statute/PD/form), citation parsing, timelines, parties, court hierarchies.
15
+ - Quality: dedupe, versioning, authority ranking (statutes > binding appellate > persuasive > commentary).
16
+
17
+ ### B) Knowledge Plane — Corpus (current + historical)
18
+ - **Sources** (licensed + open): official law reports, legislation sites, EU OJ, CEPEJ, CCJ/CAJS, UK Judiciary, Canadian courts, Singapore, Brazil STF, China SPC white papers; plus classic legal treatises (tagged *historical*).
19
+ - **Legal KG**: nodes for provisions, holdings, ratios, dicta, PDs; edges for overruled/considered/followed; region variants.
20
+ - **Curation**: retraction/errata watcher; obiter/ratio tagging; PD/notice diffing.
21
+
22
+ ### C) Model Plane — Multimodal & Verifiable
23
+ - **Foundation models**: legal-tuned LLM (tool-first), classifier for document types, citation normalizer, RAG over KG.
24
+ - **Orchestrator**: Retrieval‑Augmented Reasoning with **Legal Evidence Contract** (citations, provenance, uncertainty, policy profile).
25
+ - **Predictors**: deadline calculators, risk flags (sanctions risk, confidentiality), forum eligibility, disclosure checks.
26
+
27
+ ### D) Trust & Governance
28
+ - **Policy**: per-jurisdiction guardrails (e.g., CCJ PD1/2025, UK judicial guidance, FR judge‑analytics ban, EU AI Act).
29
+ - **Safety Rails**: no gen of witness statements/evidence where prohibited; confidentiality fences; hallucination sweeps.
30
+ - **Fairness**: audit sampling across case types and parties; explainable similarity for precedent retrieval.
31
+ - **Audit**: append-only ledger; artifact hashing; disclosure certification tokens.
32
+ - **Privacy**: role-based access; on-prem/VPC; logs with PII redaction.
33
+
34
+ ### Edges
35
+ - **Practitioner Edge**: drafting studio (skeletons, lists of authorities, bundles), citation validator, policy checker.
36
+ - **Court Edge**: e‑filing templates, AI-disclosure monitor, PD compliance gate, authenticity checks (hash & timestamp).
37
+
38
+ ## Signature Capabilities
39
+ 1) **Evidence-Locked Answers** — every answer shows authorities with rank and direct links.
40
+ 2) **AI‑Disclosure Enforcement** — auto-detects AI‑authored text; inserts **Certificate of Use** where required.
41
+ 3) **Citation Guardian** — validates cites (existence, jurisdiction, precedential status, shepherding signals).
42
+ 4) **E‑Filing Drafts** — forms, skeleton arguments, case summaries; all **drafts** only, ready for sign‑off.
43
+ 5) **Practice‑Direction Watchers** — crawl + diff PDs and guidance by court; raise alerts and update policy.
44
+ 6) **Global–Local Profiles** — UK, EU, Jamaica, Barbados, Toronto/Ontario, CCJ, Singapore, Brazil, China.
45
+ 7) **Self‑Evolving** — nightly jobs update KG snapshots; human curator inbox for low‑confidence changes.
46
+
47
+ ## Truth Contract for Legal Claims (Evidence Contract)
48
+ ```json
49
+ {
50
+ "summary": "...",
51
+ "authorities": [{"cite":"...", "court":"...", "year":2024, "weight":"binding"}],
52
+ "policy_profile": "UK-Judiciary-2025",
53
+ "uncertainty": {"reasoning":0.18,"source_gap":0.12},
54
+ "provenance": {"retrieval_hash":"...", "kg_version":"kg-2025-10"},
55
+ "disclosure": {"genai_used": true, "certificate":"attached"},
56
+ "audit": {"sha256":"...", "model":"v0.1"}
57
+ }
58
+ ```
59
+
60
+ ## Safety & Regulatory Posture
61
+ - **Human-in-the-loop** (no autonomous filing).
62
+ - **EU AI Act** mapping (risk mgmt, logs, transparency; CEPEJ Charter compliance).
63
+ - **Jurisdictional policies** (France ban on judge analytics; CCJ PD; Singapore RC; Canada Fed Court notice).
64
+
65
+ ## Developer Surface
66
+ - `/v1/legal/qa` — Q&A with authorities & policy profile
67
+ - `/v1/citation/validate` — check citations & generate authorities table
68
+ - `/v1/filings/draft` — draft forms/skeletons (disclosure-ready)
69
+ - `/v1/policy/check` — validate documents against jurisdiction policy
70
+ - `/v1/practice-direction/watch` — run watchers & produce diffs
71
+
72
+ ## Measurement & Proof
73
+ - Citation error rate → 0; disclosure compliance → 100%; drafting time ↓; curator load ↓; user satisfaction ↑.
74
+
75
+ ## Rollout (90 days)
76
+ Read-only ingest → citation guardian → drafting studio (low-risk forms) → policy enforcement → broader rollouts.
77
+
78
+ ## Branding & Promise
79
+ **BELEL-LEX** — sovereign, verifiable, court‑safe by default.
BELEL-LEX/docs/JURISDICTION_PROFILES.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Jurisdiction Profiles (selected)
2
+
3
+ ## Caribbean / CCJ
4
+ - CCJ Practice Direction No. 1 of 2025 — Use of GenAI in proceedings (disclosure, limits).
5
+
6
+ ## Jamaica
7
+ - Tech-forward CJ statements; (media reports of PD on GenAI); Jamaica Legal Information Portal with 'Garvey' AI chatbot (public info).
8
+
9
+ ## Barbados
10
+ - Supreme Court e-filing; Electronic Filing & Service Rules 2020; modernization drive.
11
+
12
+ ## Toronto / Ontario / Canada
13
+ - Federal Court: AI Notice (May 7, 2024) requiring disclosure; interim principles (Dec 20, 2023).
14
+ - Tribunals Ontario: Practice Direction on AI in tribunal proceedings.
15
+ - Provincial law societies issue guidance (e.g., Alberta playbook).
16
+
17
+ ## UK
18
+ - Judiciary guidance on AI (Dec 2023; updated Apr 2025); warnings re fake citations; ethical use.
19
+
20
+ ## EU / Council of Europe
21
+ - EU AI Act (OJ 2024); CEPEJ AI Charter and AIAB monitoring.
22
+
23
+ ## Singapore
24
+ - Registrar’s Circular No. 1 of 2024: Guide on GenAI in Court Proceedings.
25
+
26
+ ## Brazil
27
+ - STF AI "Victor" (classification of appeals); related systems (Athos).
28
+
29
+ ## China
30
+ - Smart Courts program (SPC white papers; internet courts; blockchain evidence).
BELEL-LEX/scripts/release/build_manifest.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json, hashlib, datetime, pathlib
2
+ ROOT = pathlib.Path(__file__).resolve().parents[2]
3
+ DIST = ROOT / "dist"
4
+ HASHES = DIST / "HASHES.json"
5
+ if not HASHES.exists():
6
+ raise SystemExit("Run `make hash` first.")
7
+ data = json.loads(HASHES.read_text())
8
+ digest = hashlib.sha256(json.dumps(data, sort_keys=True).encode()).hexdigest()
9
+ manifest = {
10
+ "name": "BELEL-LEX Gold Standard Stack",
11
+ "version": "0.1.0",
12
+ "generated": datetime.datetime.utcnow().isoformat()+"Z",
13
+ "hashes_sha256": digest,
14
+ "hashes_file": "HASHES.json",
15
+ "license": "BPSL v1.0",
16
+ "integrity_note": "Replace with real signing (minisign/sigstore) for prod"
17
+ }
18
+ (DIST / "RELEASE_MANIFEST.json").write_text(json.dumps(manifest, indent=2))
19
+ print("Wrote", DIST / "RELEASE_MANIFEST.json")
BELEL-LEX/scripts/release/hash_all.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib, pathlib, json, datetime
2
+ ROOT = pathlib.Path(__file__).resolve().parents[2]
3
+ OUT = ROOT / "dist"
4
+ OUT.mkdir(parents=True, exist_ok=True)
5
+ def sha256_of(path: pathlib.Path) -> str:
6
+ h = hashlib.sha256()
7
+ with open(path, "rb") as f:
8
+ for chunk in iter(lambda: f.read(8192), b""):
9
+ h.update(chunk)
10
+ return h.hexdigest()
11
+ entries = []
12
+ for p in ROOT.rglob("*"):
13
+ if p.is_file() and "dist" not in p.parts:
14
+ rel = p.relative_to(ROOT).as_posix()
15
+ entries.append({"path": rel, "sha256": sha256_of(p)})
16
+ with open(OUT / "HASHES.json", "w") as f:
17
+ json.dump({"generated": datetime.datetime.utcnow().isoformat()+"Z","files": entries}, f, indent=2)
18
+ print("Wrote", OUT / "HASHES.json")