jrklaus8/mike-Canada

Canadian legal AI fork: Python sovereignty backend alongside upstream TS, with CanLII/MCP retrieval, LSO compliance surfaces, and RLS hardening

Active development across two stacks. Python backend work includes: fork genesis with FastAPI/Qdrant/CanLII scaffolding, Phase 2 feature expansion (local JWT auth, multi-model council, DOCX redline parser, MCP client), MCP connector evolution to `MikeOSS_MCP_Manager` registering three Canadian legal servers, Canadian terminology and LSO compliance prompt rules, LSO compliance UI tab and AS IS disclaimers, PIPEDA compliance surfaces, login page auth swap, and frontend wiring via `useCanadianChat`. TS backend work: Ollama local inference, `createServerSupabase` RLS JWT passthrough across all routes, and large code extraction from `chatTools.ts`. Deployment configs (`Dockerfile`, `vercel.json`, `render.yaml`) and premium CSS polish round out the commit history. No upstream merge after the initial fork.

View on GitHub →

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

Direction

complianceintegrationinfrastructure

Activity

Themed changes and pull requests touching this fork, newest first. Themed changes that haven't been turned into a public post yet still appear — they're real work even without a published writeup.

📝 jrklaus8 starts wiring Mike into Canadian case law 2 commits 2mo ago searchintegration draft
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.
📝 README architecture summary (PIPEDA, local inference, RLS, Drizzle) 1 commit 2mo ago minor change
📝 README attribution crediting upstream creator willchen96 2 commits 2mo ago minor change

Threads of work (detailed view)

21 threads have been distilled into posts.

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.

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 teaches Mike to speak Canadian

A Canadian fork bakes local legal terminology into the model and the API so the product never sounds American.

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`.

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.