Prismatic IR PVM Web

Prismatic IR PVM Web

17 files Web

Overview

Prismatic IR PVM Web provides the LiveView interface for the Investigation and Risk Process Virtual Machine, delivering interactive dashboards for case management, evidence review, and risk assessment visualization. Built with Phoenix LiveView for real-time server-rendered updates, it enables investigators to manage complex due diligence cases, review multi-source evidence chains, and track risk assessment workflows without page reloads or client-side rendering frameworks.

The application serves as the presentation layer for the Prismatic IR PVM core engine. While the core engine orchestrates investigation workflows, executes risk scoring models, and manages case state machines, the web layer renders those states into actionable visual interfaces. Every case transition, evidence attachment, and risk score update propagates in real time through PubSub broadcasts over WebSocket connections, ensuring all connected investigators see synchronized case state without manual refreshing.

The dashboard integrates with the platform's RBAC authorization system to enforce role-based access to investigation data. Analyst, reviewer, and manager roles see different dashboard views with appropriate data scope restrictions, ensuring that sensitive investigation materials are only visible to authorized personnel. All user interactions generate audit trail entries for regulatory compliance with GDPR and internal governance requirements.

Architecture

IR PVM Engine --[PubSub]--> LiveView Channels --> Browser (WebSocket)
      |                            |
      +-- Case State Events        +-- Case Dashboard
      +-- Evidence Updates         +-- Evidence Viewer
      +-- Risk Score Changes       +-- Risk Heatmaps
      +-- Workflow Transitions     +-- Workflow Console
                                        |
Prismatic Auth --[RBAC]--> Role-Based View Filtering
                                        |
Prismatic Web --[Components]--> Shared Layout + Navigation

All view logic follows pure function principles, computing display state from case data without side effects. User interactions dispatch events through LiveView handles, which delegate to the core engine's GenServer API for state transitions under OTP supervision tree management.

Key Modules

ModuleResponsibility
PrismaticIrPvmWebWeb application entry point and router configuration
PrismaticIrPvmWeb.CaseDashboardLiveCase listing with filtering, sorting, and status tracking
PrismaticIrPvmWeb.CaseDetailLiveIndividual case view with timeline and evidence summary
PrismaticIrPvmWeb.EvidenceViewerLiveEvidence review interface with annotation and provenance
PrismaticIrPvmWeb.RiskDashboardLiveRisk heatmaps and trend visualization across portfolios
PrismaticIrPvmWeb.WorkflowConsoleLiveVisual workflow tracking with state machine diagrams
PrismaticIrPvmWeb.ComponentsShared LiveView components for case cards, timelines, risk gauges
PrismaticIrPvmWeb.Components.CaseTimelineInteractive timeline component with milestone and SLA indicators

Key Features

Case Management Dashboard

  • Interactive case management interface with filtering, sorting, and status tracking across investigation portfolios
  • Case timeline visualization showing investigation progression, milestone completion, and SLA adherence
  • Bulk operations for case assignment, priority adjustment, and status transitions with confirmation dialogs
  • Case search with full-text query support across case titles, descriptions, and evidence metadata

Evidence Viewer

The evidence viewer provides a rich interface for reviewing multi-format evidence items collected during investigations. Each evidence item displays its source, collection timestamp, confidence scoring, and chain of custody information.

  • Rich evidence review interface with document preview, annotation capabilities, and evidence chain visualization
  • Multi-format support for documents, images, structured data, and OSINT intelligence reports
  • Evidence provenance tracking showing source, collection timestamp, and confidence scoring for each item
  • Side-by-side comparison mode for evaluating conflicting evidence from different sources
# Evidence viewer LiveView mount
defmodule PrismaticIrPvmWeb.EvidenceViewerLive do
  use PrismaticIrPvmWeb, :live_view

  @impl true
  def mount(%{"case_id" => case_id}, _session, socket) do
    if connected?(socket) do
      PrismaticIrPvm.subscribe_evidence(case_id)
    end

    evidence = PrismaticIrPvm.list_evidence(case_id)
    {:ok, assign(socket, case_id: case_id, evidence: evidence, selected: nil)}
  end

  @impl true
  def handle_info({:evidence_added, item}, socket) do
    evidence = [item | socket.assigns.evidence]
    {:noreply, assign(socket, evidence: evidence)}
  end

  @impl true
  def handle_event("select_evidence", %{"id" => id}, socket) do
    selected = Enum.find(socket.assigns.evidence, & &1.id == id)
    {:noreply, assign(socket, selected: selected)}
  end
end

Risk Visualization

  • Dynamic risk heat maps displaying assessment results across entity portfolios with drill-down capability
  • Trend charts correlating risk score evolution with investigation events and evidence milestones
  • Comparative risk views enabling side-by-side entity assessment for related-party investigations
  • Risk distribution histograms showing portfolio-level risk concentration patterns

Workflow Console

  • Visual workflow status tracking with state machine diagrams, milestone indicators, and SLA countdown displays
  • One-click workflow actions for common transitions (approve, escalate, request information, close)
  • Configurable notification preferences for workflow events with telemetry integration
  • Workflow history audit showing every state transition with actor, timestamp, and justification

Case Timeline Component

The interactive timeline component renders investigation progression with color-coded milestones, SLA indicators, and evidence attachment markers:

defmodule PrismaticIrPvmWeb.Components.CaseTimeline do
  use Phoenix.Component

  attr :events, :list, required: true
  attr :sla_deadlines, :list, default: []

  def timeline(assigns) do
    ~H"""
    <div class="relative border-l-2 border-gray-700 ml-4">
      <%= for event <- @events do %>
        <div class="mb-6 ml-6">
          <div class={"absolute -left-2 w-4 h-4 rounded-full #{event_color(event.type)}"} />
          <div class="text-sm text-gray-400"><%= format_timestamp(event.timestamp) %></div>
          <div class="font-medium text-white"><%= event.title %></div>
          <div class="text-sm text-gray-500"><%= event.description %></div>
        </div>
      <% end %>
    </div>
    """
  end
end

Role-Based Access Control

The dashboard enforces strict RBAC policies that control what each user role can see and do within the investigation interface:

RoleCase AccessEvidence ActionsWorkflow Actions
AnalystAssigned cases onlyView, annotateSubmit for review
ReviewerTeam casesView, annotate, verifyApprove, request changes
ManagerAll casesFull accessAll transitions, assign
AuditorAll cases (read-only)View onlyNone

Routes

# Mount the IR PVM dashboard in your Phoenix router
scope "/investigations", PrismaticIrPvmWeb do
  live "/", CaseDashboardLive, :index
  live "/cases/:id", CaseDetailLive, :show
  live "/cases/:id/evidence", EvidenceViewerLive, :index
  live "/risk", RiskDashboardLive, :index
  live "/workflow", WorkflowConsoleLive, :index
end
RouteView
/investigationsCase dashboard with portfolio overview
/investigations/cases/:idIndividual case detail with timeline
/investigations/cases/:id/evidenceEvidence viewer for specific case
/investigations/riskRisk dashboard with heatmaps and trends
/investigations/workflowWorkflow console with state machine tracking

Usage

# Subscribe to case updates in a LiveView
def mount(%{"id" => case_id}, _session, socket) do
  PrismaticIrPvm.subscribe_case(case_id)
  {:ok, assign(socket, case: PrismaticIrPvm.get_case!(case_id))}
end

# Handle real-time case state updates
def handle_info({:case_updated, case_data}, socket) do
  {:noreply, assign(socket, case: case_data)}
end

# Handle workflow transition actions
def handle_event("approve_case", %{"case_id" => id}, socket) do
  case PrismaticIrPvm.transition_case(id, :approve, socket.assigns.current_user) do
    {:ok, updated_case} -> {:noreply, assign(socket, case: updated_case)}
    {:error, reason} -> {:noreply, put_flash(socket, :error, reason)}
  end
end

NABLA Compliance

NABLA AxiomIR PVM Web EnforcementImplementation
Provenance MandatoryEvery displayed evidence item shows source and chain of custodyEvidence viewer renders full provenance metadata
Signal PluralityRisk visualizations aggregate multiple evidence signalsRisk heatmaps combine scores from independent assessment methods
Audit TrailAll user interactions logged for complianceEvery click, view, and transition generates audit entries
Time DecayStale evidence items visually markedTimestamp-based freshness indicators on evidence cards
Contradiction PreservationConflicting evidence displayed without forced resolutionSide-by-side comparison mode preserves analyst judgment

Testing

LiveView tests verify component rendering, PubSub subscription handling, and RBAC enforcement. Route tests validate authentication requirements on all investigation paths. Evidence viewer tests verify multi-format rendering and annotation persistence. Risk dashboard tests verify heatmap computation and trend chart data accuracy with known fixtures.

Integration tests exercise the full pipeline from IR PVM engine events through PubSub to LiveView DOM updates. Performance tests verify mount times under 150ms and event processing under 50ms. Timeline component tests verify correct rendering order, SLA indicator visibility, and event color coding.

Integration Points

ApplicationRelationship
Prismatic IR PVMCore investigation engine providing case data and workflows
Prismatic WebShared LiveView components, layout templates, and navigation
Prismatic AuthAuthentication and RBAC for investigation view access
Prismatic DDDue diligence case data feeding investigation workflows
Prismatic APIREST API gateway exposing investigation data programmatically

Performance

OperationLatencyNotes
Dashboard mount< 150msInitial case list with filtering
Case detail load< 100msIncluding timeline and evidence summary
Evidence viewer mount< 200msWith document preview rendering
PubSub event processing< 50msFrom engine event to DOM update
Workflow transition< 100msIncluding audit trail logging
Timeline render< 80msUp to 200 events with SLA markers

Telemetry events: [:prismatic, :ir_pvm_web, :page_load], [:prismatic, :ir_pvm_web, :case_viewed], [:prismatic, :ir_pvm_web, :workflow_action].


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL