System Diagram

The Corporate Legal Operations data model, mapped — 19 models

🔍 Open the Interactive Diagram Viewer — pan, mouse-wheel zoom, fit-to-screen, full-screen, per-area tabs, the full ERD, and a focus mode that draws one model and its neighbours at a chosen depth. LegalMatter, Person and BusinessUnit are hub tables, so their links can be hidden to declutter the overview.


Architecture overview

A business request is triaged and converted into a matter; the matter carries its work (issues, tasks, risks, decisions, approvals), its outside-counsel engagement and spend, and its documents, communications and knowledge — with SLAs tracking responsiveness.

flowchart LR
    subgraph INTAKE["📥 Intake & matters"]
        LegalRequest
        IntakeQuestion
        LegalMatter
        MatterStakeholder
    end
    subgraph WORK["🧑‍⚖️ Matter work"]
        MatterIssue
        MatterTask
        LegalRisk
        LegalDecision
        Approval
    end
    subgraph COUNSEL["💷 Counsel & spend"]
        CounselEngagement
        SpendEntry
    end
    subgraph DOCUMENTS["📄 Documents & knowledge"]
        MatterDocument
        Communication
        KnowledgeItem
    end
    subgraph SLA["⏱️ Service levels"]
        ServiceLevel
        SLAInstance
    end
    subgraph DIRECTORY["🗂️ Directory"]
        BusinessUnit
        Person
        Organisation
    end

    BusinessUnit --> Person
    Organisation --> LegalMatter
    Person --> LegalRequest
    BusinessUnit --> LegalRequest
    LegalRequest --> IntakeQuestion
    LegalRequest --> LegalMatter
    BusinessUnit --> LegalMatter
    LegalMatter --> MatterStakeholder
    LegalMatter --> MatterIssue
    LegalMatter --> MatterTask
    LegalMatter --> LegalRisk
    LegalMatter --> LegalDecision
    LegalMatter --> Approval
    LegalMatter --> CounselEngagement
    CounselEngagement --> SpendEntry
    LegalMatter --> MatterDocument
    MatterDocument --> Communication
    ServiceLevel --> SLAInstance
    LegalRequest --> SLAInstance
    LegalMatter --> KnowledgeItem

Intake & matters

LegalRequest (with structured IntakeQuestions) is triaged and converts into a LegalMatter (via source_request_id); MatterStakeholder records who is involved.

Matter work

MatterIssue, MatterTask (self-nesting predecessors), LegalRisk, LegalDecision and Approval all hang off the matter.

Counsel & spend

CounselEngagement sets up internal/external counsel; SpendEntry books invoices and forecasts against the engagement and the matter budget.

Documents & knowledge

MatterDocument (privilege + versioning), Communication and reusable KnowledgeItem (harvested from a source matter).

Service levels

ServiceLevel defines the targets; SLAInstance runs the clock on a request or matter, pausable when awaiting the business.

Regenerating this diagram

The interactive viewer is generated — after any DSL, menu_config.yaml or schema/diagram_config.yaml change, re-run:

python scripts/build_diagram_viewer.py clo