jrklaus8/mike-Canada
Canadian legal AI fork: Python sovereignty backend alongside upstream TS, with CanLII/MCP retrieval, LSO compliance surfaces, and RLS hardening
jrklaus8/mike-Canada is a Canadian adaptation of willchen96/mike structured as a dual-stack repo. The fork's first commit drops a new Python/FastAPI backend tree into the same repository, then merges the unmodified upstream TypeScript codebase underneath it. From that point forward, Canadian features are built in the Python layer while the TS backend runs mostly untouched.
The Python side covers Canadian-specific concerns: a system prompt enforcing McGill Guide citations, SCC/ONCA authority hierarchy, and an anti-hallucination guard ("I cannot verify this claim with the available CanLII context"); an MCP connector registering A2AJ (https://api.a2aj.ca/mcp), CourtListener (https://mcp.courtlistener.com), and @ansvar/canadian-law-mcp as OpenAI Responses API tools; a local-JWT auth module (SovereigntyAuth) framed around LSO data sovereignty; LSO compliance UI with Rule 3.1-2 and Rule 6.1-1 disclosures; and PIPEDA-facing surfaces including a privacy policy page, cookie consent banner, and signup consent gates.
The TS backend gets two substantive changes: an Ollama streaming client for local inference, and a refactor of createServerSupabase to pass the request JWT so Supabase RLS actually applies per-user rather than running under the service-role key. That RLS change is threaded through all route files (chat, documents, downloads, projects, tabular, user, workflows).
Several features are stubs or mock implementations. Phase 2's MultiModelCouncil is asyncio.sleep(1) returning hardcoded strings. The CanLII and Justice Canada endpoints return invented case data. The SovereigntyAuth token endpoint issues tokens with no credential validation. The LSO compliance log export button calls alert(). The Ansvar stdio MCP server is defined structurally but not wired.
The two stacks don't share auth, retrieval, or prompt logic - they duplicate those concerns without connecting. Most Canadian feature commits are isolated to the Python tree and carry little upstream-merge risk but also limited integration with the real app.
What's in it
- Canadian data sovereignty Built to keep client data on domestic infrastructure, with the AI able to run locally and sign-in moving onto a self-hosted token system.
- Live Canadian legal sources Connects the assistant to Canadian case-law and legal data feeds like CanLII and CourtListener instead of relying on bundled content.
- PIPEDA compliance, out of the box Ships the privacy policy, terms, consent flow, and cookie banner Canadian privacy law expects.
- Law Society of Ontario framing Wraps the assistant in Ontario-specific lawyer duties and prominent 'use at your own risk' disclaimers.
- Speaks Canadian legal Prompt-layer tuning steers the assistant toward Canadian legal terminology and citation conventions.
- Demo-stage lookups The Canadian legal results look live but are partly mock data for now - polish ahead of real retrieval.
Direction
complianceintegrationinfrastructure
Activity
Threads of work (detailed view)
jrklaus8 starts wiring Mike into Canadian case law
A Canada-focused fork lays the groundwork for looking up Canadian legislation and court decisions inside the chat - though the plumbing still runs on placeholder data.
Deployment configs, CSS polish, and mock legal endpoints dressed as real integrations
Two commits bundle a backend Dockerfile, `vercel.json`, `render.yaml`, animated CSS, and what look like CanLII and Justice Canada integrations. The deployment files are real. The legal integrations return fabricated data.
jrklaus8 is loosening Mike-Canada's grip on any single AI vendor
The Canadian fork is moving onto a routing layer that lets it switch between model providers without rebuilding the app.
jrklaus8 builds Mike a Canadian privacy front door
The mike-Canada fork bolts on a full PIPEDA-aligned consent flow in one pass.
PIPEDA compliance surfaces: privacy policy, terms, cookie banner, and signup consent gates
Commit `0a864f44` adds a set of privacy-compliance UI components aimed at Canada's PIPEDA: a `/privacy` page, a `/terms` page, a cookie consent banner, and consent checkboxes on signup. All frontend, no backend dependencies.
jrklaus8 stops Mike from querying its database as a superuser
A fix in the Canadian fork closes a gap that let every request reach across the lines meant to separate one user's data from another's.
Ollama local inference added; Supabase client refactored to pass user JWT for RLS enforcement
The two most importable commits in this fork. One adds a clean Ollama streaming client to the TS LLM layer. The other closes a tenant-isolation gap by threading the request JWT through every Supabase call so Row Level Security actually applies.
jrklaus8 bakes Ontario's conduct rules into Mike
The Canada fork stops treating professional-responsibility rules as a footnote and writes them straight into how the assistant behaves.
LSO compliance panel and AS IS disclaimers added to the UI
Two commits add jurisdiction-specific professional-responsibility framing to the product: an `LSOComplianceTab` component spelling out Law Society of Ontario duties, and "AS IS / not legal advice" disclaimers across the README, chat view, and initial landing screen.
jrklaus8 plugs Mike into Canadian case law
The Canada fork now answers with Canadian case and legislation citations, surfaced right inside the chat.
useCanadianChat hook wires Next.js UI to Python backend; CanLII fallback viewer added to DocPanel
Two commits bridge the upstream TypeScript frontend to jrklaus8's Python sovereignty backend. The assistant page is rewired to call `/api/v1/query` instead of the upstream TS chat route, and DocPanel gets a fallback branch for MCP-sourced documents.
jrklaus8 plugs Mike into Canada's case law
mike-Canada now reaches out to live Canadian and US legal databases instead of relying on whatever's loaded in-house.
MCP connector wires A2AJ, CourtListener, and Ansvar as OpenAI Responses API tools
Three commits evolve `mcp_connector.py` from a simple httpx client into a `MikeOSS_MCP_Manager` that registers multiple Canadian legal MCP servers as tools via the OpenAI Responses API. The endpoint URLs and the A2AJ guide notebook are the most practically useful outputs.
jrklaus8 teaches Mike to speak Canadian
A Canadian fork bakes local legal terminology into the model and the API so the product never sounds American.
System prompt adds Canadian legal terminology rules: "Blackline" over "Redline," no "attorneys"
Commit `69d1dc9` extends the Canadian system prompt with two terminology rules and renames the redline parser to match. Small change, but it shows the fork is enforcing Canadian legal idiom at the prompt layer rather than leaving it to convention.
jrklaus8 yanks Supabase out of mike-Canada's front door
A login screen rebuilt around the idea that Canadian lawyers' credentials shouldn't leave Canadian soil.
Login page drops Supabase auth in favor of local JWT endpoint
Commit `5061e2d` rewrites the login page to POST credentials to `/api/v1/auth/token` on the Python backend instead of calling `supabase.auth.signInWithPassword`. The JWT comes back and gets stored in `localStorage` as `canadian_jwt`.
jrklaus8 splits Canadian tribunal work into two parallel tracks
A new routing layer sends procedural and substantive legal questions down separate analysis paths - and runs them at the same time.
Phase 2 Python backend: local JWT auth, multi-model council, redline parser, MCP stub
A single "Phase 2" commit fleshes out the Python backend with four new modules. The concepts are sound - local JWT auth, concurrent multi-model analysis, DOCX tracked-changes parsing. The implementations are mostly scaffolding and stubs.
jrklaus8 builds Mike a Canadian compliance spine before the legal brain
A ground-up fork that bolts a Canada-specific backend onto Mike's interface, leading with Law Society of Ontario compliance rather than features.
Fork genesis: Python sovereignty backend grafted onto upstream TS codebase
jrklaus8 starts not by modifying willchen96/mike but by committing an entirely new Python tree alongside it. The result is a dual-stack repo where Canadian features live in a separate FastAPI service that shares a repo with the unmodified upstream Bun/Express backend.