System Diagram

The Critical Control Management data model, mapped — 48 models, 128 relationships

🔍 For serious exploration, open the Interactive Diagram Viewer — it adds pan, mouse-wheel zoom, fit-to-screen, full-screen mode, per-module tabs, the full 128-relationship ERD, and a focus mode that draws just one model and its neighbours at a chosen depth. Person and Position fan out to almost every model (37 of the 128 links), so the viewer hides those links by default — a toggle brings them back. The diagrams below are the readable, static summary of the principal links only.


Architecture Overview

Seven areas mirror the sidebar menu. Every arrow means "one row of the left model is referenced by many rows of the right model".

flowchart LR
    subgraph REG["🏗️ Site register"]
        Organisation --> MineSite --> OperatingArea
        MineSite --> Equipment
    end

    subgraph REF["📚 Publications & requirements"]
        PublicationAuthority --> Publication --> Requirement --> SiteObligation
    end

    subgraph RISK["⚠️ Risk & controls"]
        PrincipalHazard --> HazardScenario --> MaterialUnwantedEvent --> CriticalControl
        CriticalControl --> ControlPerformanceStandard
        PrincipalHazard --> PrincipalHazardManagementPlan
    end

    subgraph VER["✅ Verification"]
        VerificationTemplate --> VerificationSchedule --> VerificationEvent --> ControlDeficiency
    end

    subgraph EVT["🚨 Events & investigations"]
        AdverseEvent --> Investigation --> InvestigationFinding
        AdverseEvent --> InjuryRecord
        AdverseEvent --> LossRecord
    end

    subgraph ACT["🛠️ Actions & work"]
        CorrectiveAction --> WorkOrder --> RestorationVerification
        Audit --> AuditFinding
        ManagementOfChange --> ChangeImpact
    end

    subgraph MON["📊 Monitoring"]
        Kpi --> KpiResult
        Notification
    end

    MineSite --> PrincipalHazard
    MineSite --> AdverseEvent
    CriticalControl --> VerificationTemplate
    ControlDeficiency --> CorrectiveAction
    InvestigationFinding --> CorrectiveAction
    AuditFinding --> CorrectiveAction

The Compliance Spine

Publications become site obligations; the trail from external rule to local accountability.

erDiagram
    PublicationAuthority ||--o{ Publication : "authority_id"
    Publication ||--o{ PublicationSection : "publication_id"
    Publication ||--o{ Requirement : "publication_id"
    PublicationSection ||--o{ Requirement : "publication_section_id"
    Requirement ||--o{ SiteObligation : "requirement_id"
    MineSite ||--o{ SiteObligation : "mine_site_id"

The Bowtie: Hazard → MUE → Control

erDiagram
    MineSite ||--o{ PrincipalHazard : "mine_site_id"
    PrincipalHazard ||--o{ HazardScenario : "principal_hazard_id"
    PrincipalHazard ||--o{ MaterialUnwantedEvent : "principal_hazard_id"
    HazardScenario ||--o{ MaterialUnwantedEvent : "hazard_scenario_id"
    MaterialUnwantedEvent ||--o{ CriticalControl : "material_unwanted_event_id"
    CriticalControl ||--o{ ControlPerformanceStandard : "critical_control_id"
    CriticalControl ||--o{ ControlApplicability : "critical_control_id"
    PrincipalHazard ||--o{ PrincipalHazardManagementPlan : "principal_hazard_id"
    PrincipalHazardManagementPlan ||--o{ PlanSection : "plan_id"
    PrincipalHazardManagementPlan ||--o{ PlanRequirementLink : "plan_id"

The Verification Loop

Verify → fail → restrict → correct → repair → independently verify restoration → release. A COMPLETE work order never restores a control by itself.

erDiagram
    CriticalControl ||--o{ VerificationTemplate : "critical_control_id"
    VerificationTemplate ||--o{ VerificationQuestion : "verification_template_id"
    VerificationTemplate ||--o{ VerificationSchedule : "verification_template_id"
    VerificationSchedule ||--o{ VerificationEvent : "verification_schedule_id"
    VerificationEvent ||--o{ VerificationResponse : "verification_event_id"
    VerificationEvent ||--o{ ControlDeficiency : "verification_event_id"
    ControlDeficiency ||--o{ CorrectiveAction : "control_deficiency_id"
    CorrectiveAction ||--o{ WorkOrder : "corrective_action_id"
    WorkOrder ||--o{ WorkOrderTask : "work_order_id"
    WorkOrder ||--o{ RestorationVerification : "work_order_id"
    CriticalControl ||--o{ RestorationVerification : "critical_control_id"

Events, Investigations and Actions

Lagging indicators tied back to the controls that should have prevented them.

erDiagram
    MineSite ||--o{ AdverseEvent : "mine_site_id"
    AdverseEvent ||--o{ EventHazardLink : "adverse_event_id"
    PrincipalHazard ||--o{ EventHazardLink : "principal_hazard_id"
    AdverseEvent ||--o{ EventControlLink : "adverse_event_id"
    CriticalControl ||--o{ EventControlLink : "critical_control_id"
    AdverseEvent ||--o{ PersonInvolvement : "adverse_event_id"
    AdverseEvent ||--o{ InjuryRecord : "adverse_event_id"
    AdverseEvent ||--o{ LossRecord : "adverse_event_id"
    AdverseEvent ||--o{ Investigation : "adverse_event_id"
    Investigation ||--o{ InvestigationTimelineEvent : "investigation_id"
    Investigation ||--o{ InvestigationFinding : "investigation_id"
    InvestigationFinding ||--o{ CorrectiveAction : "investigation_finding_id"
    Audit ||--o{ AuditFinding : "audit_id"
    AuditFinding ||--o{ CorrectiveAction : "audit_finding_id"
    ManagementOfChange ||--o{ ChangeImpact : "management_of_change_id"

Reading the Diagrams

  • A ||--o{ B means one row of A is referenced by many rows of B (the label is the foreign-key column on B).
  • These static diagrams show principal links only — cross-cutting references (every model's mine_site_id, person_id, position_id, operating_area_id, equipment_id columns) are omitted for readability. The interactive viewer's Full ERD shows all 128 relationships, with the people/position noise toggleable.
  • CriticalControl is the hub of the domain — the viewer's Focus mode defaults to it.

Diagrams are derived from the generated schema metadata (apps/critical_control_management/generated/json/critical_control_management_relationship_metadata.json). If the DSL schema changes, regenerate the metadata (python -m codegen.cli all critical_control_management) and update this page and the viewer's embedded data.