# LEXCALIBER: SYSTEM COMPILATION & SPECIFICATION MANIFESTO
**Powered by Noctaris**
**Classification:** Pre-Litigation Paralegal Intelligence Engine
**Target Vertical:** Personal Injury & Catastrophic Tort Law
**Deployment Architecture:** Tauri v2 Thin Client (Rust) & Supabase BaaS (PostgreSQL + pgvector)

---

## █ Section 1: The Sovereign Stack Philosophy
LexCaliber is built as an institutional weapon that sits directly on the managing partner’s desktop, bypassing legacy software bloat to enforce absolute operational sovereignty.

**The "API Harness" Trap:** Attempting to build direct API integrations into legacy legal software (like Filevine, Needles, or Clio) is a catastrophic trap. Legacy CMS platforms are fragile and poorly documented.
**The Stateless Export Solution:** LexCaliber is completely agnostic to the firm's internal tech stack. It delivers a finished product by exporting pristine, dynamically formatted `.docx` Demand Letters and immutable `.pdf` Medical Chronologies directly to the local machine. The legacy CMS is reduced to a passive filing cabinet.

---

## █ Section 2: The 9-Vertex Architectural Matrix
**I. The Foundation Layer (The Enclave)**
*   **Vertex 1 (The Vault):** PostgreSQL (Supabase) enforcing hard multi-tenant isolation and Row-Level Security (RLS).
*   **Vertex 2 (The Enclave):** Zero-Data Retention (ZDR) processing boundary.
*   **Vertex 3 (The Axiom Index):** pgvector instance for semantic embeddings, permanently eliminating "Ghost Vectors" and mathematically hard-linking facts to source PDF coordinates.

**II. The Cognitive Layer (The Intelligence)**
*   **Vertex 4 (The Router):** Model-agnostic orchestration engine.
*   **Vertex 5 (The Cache):** Modal-hosted Cache-Augmented Generation (CAG) for massive medical files.
*   **Vertex 6 (The Auditor):** Veracity metric guardian checking against statutory caps.

**III. The Surface Layer (The Interface)**
*   **Vertex 7 (The Shell):** Tauri v2 hardware-locked desktop binary (Rust).
*   **Vertex 8 (The Broker):** Pydantic-to-Zod schema bridge housing MCP Connectors (iManage, NetDocuments).
*   **Vertex 9 (The Ex Nihilo Surface):** SvelteKit-rendered Vantablack void with native spring physics (The Design_Blade).

---

## █ Section 3: The 1-2-3 Operational Pipeline
1.  **THE DRAW (Intake & Ingestion):** Raw records forwarded to secure AWS SES/S3 drop. Marker-based classification (Crash/Medical/Bill).
2.  **THE ANCHOR (Medical Chronologies & Damages):** Axiom Index maps extracted CPT/ICD-10 codes. Dual-Ledger System compiles Vanguard Ledger (gross) & Shadow Ledger (audited).
3.  **THE STRIKE (Demand Generation & Bad Faith):** Multi-agent sequence (Actuary -> Storyteller -> Closer) drafts the Bifurcated Demand (Colossus data + "Day in the Life" prose). Cryptographic stateless export.

---

## █ Section 4: Advanced Sub-Workflows & Tactical Dragnets
*   **The Insurance Discovery Dragnet:** Scans police reports for LLCs/DOT numbers to trigger vicarious liability claims. Integrates with ISO ClaimSearch and Accurint for skip tracing and umbrella policy hunting.
*   **The Course & Scope Counter-Attack Protocol:** Automatically generates Spoliation Letters demanding Period 1/2/3 digital logs, GPS telemetry, and ELD data when adjusters claim a commercial driver was "off-duty."
*   **The Autonomic Procurement Engine:** Uses DocuSign MCP to text HIPAA releases, tracks 30-day deadlines, and autonomously faxes formal HITECH Act Violation Demands to hospitals.

---

## █ Section 5: Technical Schema (Vertex 1 PostgreSQL Vault)
*   Enabled `pgvector` for semantic embeddings.
*   Multi-tenant architecture enforcing native PostgreSQL Row-Level Security (RLS) policies on `tenants`, `cases`, `case_documents_axioms`, and `medical_specials`.
*   Dual-Ledger integration built directly into the `medical_specials` schema (`gross_billed_amount` vs `cpt_audited_amount`).

---

## █ Section 6: Intellectual Property & Aesthetics
*   **The Rust Binary Vault:** Local client backend compiled into optimized Rust machine code via Tauri v2, permanently hardware-bound via UUID hash to block license-sharing.
*   **Total Cloud Isolation:** Master prompts and "Vibe Coding" variables reside exclusively on the secure Noctaris Cloud behind enterprise firewalls.
*   **Brand Aesthetic:** "The Vantablack Weapon" (Raw Graphite, Obsidian Lancet, Datum Lock). No gavels, no scales. Pure industrial sovereignty.
