Skip to Content

Assurance Case Model

This page documents the core data model for assurance cases in the TEA Platform. Understanding this model is essential for developers working with the data layer.

Overview

An assurance case is a structured argument demonstrating that a system meets specific requirements. In the TEA Platform, this is modelled as a hierarchical structure of elements.

AssuranceCase ├── AssuranceElement (Goal - Top Level) │ ├── AssuranceElement (Strategy) │ │ ├── AssuranceElement (PropertyClaim) │ │ │ └── AssuranceElement (Evidence) │ │ └── AssuranceElement (PropertyClaim) │ │ └── AssuranceElement (Evidence) │ └── AssuranceElement (Context) └── Comments

Core Entities

AssuranceCase

The top-level container for an assurance argument.

FieldTypeDescription
idUUIDPrimary key
nameStringCase title
descriptionStringCase description
modeEnumSTANDARD or ADVANCED
publishStatusEnumDRAFT, READY_TO_PUBLISH, or PUBLISHED
createdByIdUUIDUser who created the case

Key Relations:

  • elements - All AssuranceElements in the case
  • userPermissions - Individual user access
  • teamPermissions - Team-based access
  • comments - Discussion threads

AssuranceElement

The building blocks of an assurance case. All element types share a unified model with type-specific fields.

FieldTypeDescription
idUUIDPrimary key
caseIdUUIDParent assurance case
elementTypeEnumType of element (see below)
parentIdUUIDParent element (for hierarchy)
nameStringElement label
descriptionStringMain content/claim
assumptionStringOptional assumption text
justificationStringOptional justification (strategies)
contextString[]Context references
urlStringEvidence URL (evidence elements)

Element Types

The elementType enum defines the available element types:

TypePurposeGSN Notation
GOALTop-level claim to be demonstratedGoal (rectangle)
STRATEGYArgument approach for decomposing goalsStrategy (parallelogram)
PROPERTY_CLAIMSpecific claim supporting a strategyGoal (rectangle)
EVIDENCEArtefact supporting a claimSolution (circle)
CONTEXTBackground informationContext (rounded rectangle)
ASSUMPTIONStated assumptionAssumption (ellipse with ‘A’)
JUSTIFICATIONRationale for argument choicesJustification (ellipse with ‘J’)
MODULEReference to another caseModule (rectangle with line)
AWAY_GOALReference to goal in another moduleAway Goal
CONTRACTInterface between modulesContract

Element Roles

Elements can have a role to indicate their position:

  • TOP_LEVEL - The root goal of the assurance case
  • SUPPORTING - Elements that support the argument

Relationships

Hierarchical Structure

Elements form a tree through the parentId relationship:

// Parent-child relationship element.parent // AssuranceElement | null element.children // AssuranceElement[]

Evidence can support multiple claims through a many-to-many relationship:

// EvidenceLink model { evidenceId: string // The evidence element claimId: string // The property claim being supported }

Defeaters (Dialogical Reasoning)

Elements can be marked as defeaters to challenge other elements:

// Defeater relationship element.isDefeater // boolean element.defeatsElementId // UUID of challenged element element.defeatedBy // Elements challenging this one

Permissions Model

Permission Levels

Access is controlled through four levels:

LevelCan ViewCan CommentCan EditCan Manage
VIEWYesNoNoNo
COMMENTYesYesNoNo
EDITYesYesYesNo
ADMINYesYesYesYes

Permission Sources

Permissions can come from:

  1. Direct user permission (CasePermission)
  2. Team membership (CaseTeamPermission + TeamMember)
  3. Case ownership (creator has implicit ADMIN)

Publishing Workflow

Cases go through a three-stage publishing workflow:

DRAFT → READY_TO_PUBLISH → PUBLISHED

When published, a Release is created with:

  • Snapshot of the case content
  • Version number
  • Community settings (comments enabled/disabled)

Prisma Schema Reference

The full schema is defined in prisma/schema.prisma. Key models:

  • AssuranceCase - Case container
  • AssuranceElement - Elements (unified model)
  • EvidenceLink - Evidence-to-claim relationships
  • CasePermission - User permissions
  • CaseTeamPermission - Team permissions
  • Comment - Internal comments
  • Release - Published versions
  • ReleaseSnapshot - Version snapshots

Generating Types

After schema changes, run npx prisma generate to update the TypeScript types. The generated client is output to src/generated/prisma.

Working with the Model

Fetching a Case with Elements

import { prisma } from '@/lib/db' const caseWithElements = await prisma.assuranceCase.findUnique({ where: { id: caseId }, include: { elements: { include: { children: true, evidenceLinksFrom: true, evidenceLinksTo: true, } }, userPermissions: true, teamPermissions: true, } })

Creating an Element

const newElement = await prisma.assuranceElement.create({ data: { caseId: caseId, elementType: 'PROPERTY_CLAIM', parentId: parentId, name: 'PC1', description: 'The system performs accurately', createdById: userId, } })

Further Reading