Skip to content

Domain Implementation Results

ClassificationTypeBase ClassValidation Rules
String VOModelNameSimpleValueObject<string>NotNull, NotEmpty, Trim, MaxLength(100)
String VOModelVersionSimpleValueObject<string>NotNull, NotEmpty, SemVer regex
String VOModelPurposeSimpleValueObject<string>NotNull, NotEmpty, Trim, MaxLength(500)
String VOEndpointUrlSimpleValueObject<string>NotNull, NotEmpty, URI format
String VOIncidentDescriptionSimpleValueObject<string>NotNull, NotEmpty, Trim, MaxLength(2000)
String VOResolutionNoteSimpleValueObject<string>NotNull, NotEmpty, Trim, MaxLength(2000)
Comparable VODriftThresholdComparableSimpleValueObject<decimal>Between(0.0, 1.0)
Comparable VOAssessmentScoreComparableSimpleValueObject<int>Between(0, 100), IsPassing
Smart EnumRiskTierSimpleValueObject<string>4 values, RequiresComplianceAssessment, IsProhibited
Smart EnumDeploymentStatusSimpleValueObject<string>6 values, transition map
Smart EnumDeploymentEnvironmentSimpleValueObject<string>2 values (Staging, Production)
Smart EnumAssessmentStatusSimpleValueObject<string>5 values, transition map
Smart EnumCriterionResultSimpleValueObject<string>3 values (Pass, Fail, NotApplicable)
Smart EnumIncidentSeveritySimpleValueObject<string>4 values, RequiresQuarantine
Smart EnumIncidentStatusSimpleValueObject<string>4 values, transition map
AggregateInterfacesCore Patterns
AIModelIAuditable, ISoftDeletableWithUserDual factory, Soft Delete guard
ModelDeploymentIAuditableDual factory, state transitions
ComplianceAssessmentIAuditableDual factory, child entity management
ModelIncidentIAuditableDual factory, state transitions
EntityParent AggregateRole
AssessmentCriterionComplianceAssessmentAssessment criterion, result recording
ServiceCross-Domain TargetsRole
RiskClassificationServiceAIModelPurpose keyword -> risk tier classification
DeploymentEligibilityServiceAIModel, Assessment, Incident3-step deployment eligibility verification
SpecificationTarget AggregatePurpose
ModelNameSpecAIModelModel name search
ModelRiskTierSpecAIModelRisk tier filter
DeploymentByModelSpecModelDeploymentDeployment lookup by model
DeploymentActiveSpecModelDeploymentActive deployment filter
DeploymentQuarantinedSpecModelDeploymentQuarantined deployment filter
AssessmentByModelSpecComplianceAssessmentAssessment lookup by model
AssessmentByDeploymentSpecComplianceAssessmentAssessment lookup by deployment
AssessmentPendingSpecComplianceAssessmentIncomplete assessment filter
IncidentByModelSpecModelIncidentIncident lookup by model
IncidentByDeploymentSpecModelIncidentIncident lookup by deployment
IncidentOpenSpecModelIncidentUnresolved incident filter
IncidentBySeveritySpecModelIncidentIncident filter by severity
AggregateEventTrigger
AIModelRegisteredEventModel registration
AIModelRiskClassifiedEventRisk tier reclassification
AIModelVersionUpdatedEventVersion update
AIModelUpdatedEventInformation update
AIModelArchivedEventModel archive
AIModelRestoredEventModel restore
ModelDeploymentCreatedEventDeployment creation
ModelDeploymentSubmittedForReviewEventReview submission
ModelDeploymentActivatedEventDeployment activation
ModelDeploymentQuarantinedEventDeployment quarantine
ModelDeploymentRemediatedEventQuarantine remediation
ModelDeploymentDecommissionedEventDeployment decommission
ComplianceAssessmentCreatedEventAssessment creation
ComplianceAssessmentCriterionEvaluatedEventCriterion evaluation
ComplianceAssessmentCompletedEventAssessment completion
ModelIncidentReportedEventIncident reporting
ModelIncidentInvestigatingEventInvestigation start
ModelIncidentResolvedEventIncident resolution
RepositoryAdditional Methods
IAIModelRepositoryExists(spec), GetByIdIncludingDeleted(id)
IDeploymentRepositoryExists(spec), Find(spec)
IAssessmentRepositoryExists(spec), Find(spec)
IIncidentRepositoryExists(spec), Find(spec)
AiGovernance.Domain/
├── SharedModels/
│ └── Services/
│ ├── RiskClassificationService.cs
│ └── DeploymentEligibilityService.cs
└── AggregateRoots/
├── Models/
│ ├── AIModel.cs
│ ├── IAIModelRepository.cs
│ ├── ValueObjects/ (ModelName, ModelVersion, ModelPurpose, RiskTier)
│ └── Specifications/ (ModelNameSpec, ModelRiskTierSpec)
├── Deployments/
│ ├── ModelDeployment.cs
│ ├── IDeploymentRepository.cs
│ ├── ValueObjects/ (DeploymentStatus, DeploymentEnvironment, EndpointUrl, DriftThreshold)
│ └── Specifications/ (DeploymentByModelSpec, DeploymentActiveSpec, DeploymentQuarantinedSpec)
├── Assessments/
│ ├── ComplianceAssessment.cs
│ ├── AssessmentCriterion.cs
│ ├── IAssessmentRepository.cs
│ ├── ValueObjects/ (AssessmentScore, AssessmentStatus, CriterionResult)
│ └── Specifications/ (AssessmentByModelSpec, AssessmentByDeploymentSpec, AssessmentPendingSpec)
└── Incidents/
├── ModelIncident.cs
├── IIncidentRepository.cs
├── ValueObjects/ (IncidentSeverity, IncidentStatus, IncidentDescription, ResolutionNote)
└── Specifications/ (IncidentByModelSpec, IncidentByDeploymentSpec, IncidentOpenSpec, IncidentBySeveritySpec)

Unit tests are organized into four categories: Value Object, Aggregate, Domain Service, and Architecture. A total of 268 tests run across 2 assemblies for the entire solution.

CategoryTest File CountTest Target
Value Objects15Creation, validation, Smart Enum transition rules for 16 VO types
Aggregates4Create, state transitions, guards, CreateFromValidated for 4 Aggregate types
Domain Services1RiskClassificationService keyword classification
Architecture3Domain/Application architecture rules, layer dependencies
Total23

The 268 tests include both unit tests (AiGovernance.Tests.Unit) and integration tests (AiGovernance.Tests.Integration).

In the next step, we define how these domain rules are orchestrated into use cases in the Application Business Requirements.