Skip to content

Project Requirements Specification

The EU AI Act (enacted in 2024, fully enforced in 2026) classifies AI systems by risk level and mandates conformity assessments, post-deployment monitoring, and incident reporting for high-risk AI. Organizations must manage the entire lifecycle of AI models — from model registration, risk classification, deployment approval, compliance assessment, to incident response.

This system automates AI model governance within a single bounded context. It implements the core requirements of the EU AI Act (risk tier classification, conformity assessment, incident management) using DDD tactical patterns and the Functorium framework, serving as a full-stack DDD example that demonstrates practical patterns across the Domain/Application/Adapter layers.

  1. Automate core EU AI Act requirements (risk tier classification, compliance assessment, incident management)
  2. Implement independent lifecycles of 4 Aggregates and cross-domain rules using DDD tactical patterns
  3. Demonstrate practical application of LanguageExt IO advanced features (Timeout, Retry, Fork, Bracket)
  4. Automate OpenTelemetry 3-Pillar observability using Source Generators
  5. Provide a full-stack DDD reference implementation of the Functorium framework
PersonaRoleCore Goal
AI Governance AdministratorAI model registration, deployment approval, risk tier classificationManage the entire lifecycle of organizational AI models and ensure regulatory compliance
Compliance OfficerCompliance assessment, incident investigation, audit reportingEvaluate EU AI Act requirement compliance and respond promptly to incidents
Metric TypeMetricTargetMeasurement Method
LeadingModel registration completion rate> 95%Success ratio relative to registration requests
LeadingIncident auto-quarantine response time< 1 secondTime from Critical incident report to deployment quarantine
LaggingCompliance assessment pass rate> 80%Passed ratio relative to total assessments
LaggingAverage unresolved incident resolution time< 24 hoursAverage time from Reported to Resolved
  • .NET 10 / C# 14
  • Functorium framework (DDD Building Blocks, LanguageExt IO, Source Generator)
  • FastEndpoints (HTTP API)
  • OpenTelemetry 3-Pillar (Metrics, Tracing, Logging)
  • InMemory / Sqlite persistence switching

Scope explicitly excluded from this project:

  • Model training pipeline — Model training/fine-tuning is the responsibility of the ML platform; this system handles only governance of trained models
  • A/B testing platform — Model performance comparison experiments are conducted on a separate experimentation platform; this system manages only regulatory compliance of deployed models
  • Real-time dashboard — Model performance monitoring dashboards are provided by a separate observability platform; this system is responsible only up to creating incidents when drift thresholds are exceeded

EnglishDefinition
AIModelAn AI/ML model registered and subject to governance
ModelNameName of the AI model (100 characters or fewer)
ModelVersionModel version in SemVer format
ModelPurposeDescription of the model’s intended use (500 characters or fewer)
RiskTierEU AI Act-based 4-level classification: Minimal, Limited, High, Unacceptable
ModelDeploymentA deployment instance of an AI model in a production environment
DeploymentStatusCurrent status of the deployment (Draft, PendingReview, Active, Quarantined, Decommissioned, Rejected)
DeploymentEnvironmentTarget deployment environment: Staging, Production
EndpointUrlService endpoint of the deployed model
DriftThresholdModel performance drift detection threshold (0.0~1.0)
ComplianceAssessmentRegulatory compliance assessment for a deployment
AssessmentCriterionIndividual criterion item of a compliance assessment
AssessmentScoreComposite assessment score in range 0~100; passing score is 70 or above
AssessmentStatusAssessment progress status (Initiated, InProgress, Passed, Failed, RequiresRemediation)
CriterionResultIndividual criterion evaluation result: Pass, Fail, NotApplicable
ModelIncidentAccident/issue report related to an AI model
IncidentSeverityCritical, High, Medium, Low
IncidentStatusIncident progress status (Reported, Investigating, Resolved, Escalated)
IncidentDescriptionDetailed description of the incident (2000 characters or fewer)
ResolutionNoteIncident resolution record (2000 characters or fewer)
RiskClassificationServiceRisk tier classification based on model purpose keywords
DeploymentEligibilityServiceCross-Aggregate eligibility verification before deployment
HealthCheckHealth status check of a deployed model
DriftReportModel performance drift monitoring result
ModelRegistryExternal model metadata repository

IDStoryPriority
US-001As an AI Governance Administrator, I want to register an AI model to understand the current state of AI models within the organization.P0
US-002As an AI Governance Administrator, I want to classify a model’s risk tier to determine the appropriate management level per EU AI Act regulations.P0
US-003As an AI Governance Administrator, I want to deploy a model to serve it in the production environment.P0
US-004As an AI Governance Administrator, I want to submit a deployment for review to get approval through eligibility verification.P0
US-005As an AI Governance Administrator, I want to quarantine a problematic deployment to prevent further damage.P0
US-006As an AI Governance Administrator, I want to search models and deployment status to manage them by risk tier and status filters.P1
IDStoryPriority
US-007As a Compliance Officer, I want to initiate a compliance assessment to verify a deployment’s regulatory compliance.P0
US-008As a Compliance Officer, I want to report an incident to document the issue and prompt an immediate response.P0
US-009As a Compliance Officer, I want to investigate and resolve incidents to identify root causes and prevent recurrence.P1
US-010As a Compliance Officer, I want to search incident lists by severity/status to respond according to priority.P1

AggregateCore ResponsibilityState TransitionsKey Events
AIModelModel registration, risk tier classification, archive/restore(None, Soft Delete guard)RegisteredEvent, RiskClassifiedEvent, ArchivedEvent
ModelDeploymentDeployment creation, state transitions, health check recordingDraft -> PendingReview -> Active -> Quarantined -> DecommissionedCreatedEvent, ActivatedEvent, QuarantinedEvent
ComplianceAssessmentAssessment creation, criterion evaluation, score calculation, completionInitiated -> InProgress -> Passed/Failed/RequiresRemediationCreatedEvent, CriterionEvaluatedEvent, CompletedEvent
ModelIncidentIncident reporting, investigation, resolution, escalationReported -> Investigating -> Resolved/EscalatedReportedEvent, ResolvedEvent

  1. Model name must be 100 characters or fewer and must not be empty
  2. Model version must be in SemVer format
  3. Model purpose must be 500 characters or fewer and must not be empty
  4. Risk tier is classified into 4 levels: Minimal, Limited, High, Unacceptable
  5. Automatic risk tier classification based on model purpose keywords is supported
  6. Archived models cannot be modified (Soft Delete guard)
  7. Archive and restore operations are idempotent
  1. Endpoint URL must be a valid HTTP/HTTPS URL
  2. Drift threshold must be in the range 0.0~1.0
  3. Deployment status transitions follow only the defined transition map (6 states, 2 terminal states)
  4. Health checks can be recorded
  1. Default assessment criteria of 3: Data Governance, Technical Documentation, Security Review
  2. For High/Unacceptable tiers, an additional 3 criteria: Human Oversight, Bias Assessment, Transparency
  3. For Unacceptable tier, an additional 1 criterion: Prohibition Review
  4. All criteria must be evaluated before the assessment can be completed
  5. The composite score is automatically calculated as the Pass ratio among applicable criteria (0~100)
  6. 70 or above is Passed, 40~69 is RequiresRemediation, below 40 is Failed
  1. Incident description must be 2000 characters or fewer
  2. Critical/High severity incidents trigger automatic deployment quarantine
  3. Incident status transitions follow only the defined transition map
  1. Risk Tier Classification: Risk tier is determined by analyzing model purpose keywords (RiskClassificationService)
  2. Deployment Eligibility Verification: Prohibited tier check -> Compliance assessment check -> Unresolved incident check (DeploymentEligibilityService)
  3. Automatic Assessment Initiation on Risk Tier Upgrade: RiskClassifiedEvent -> Create assessment for each active deployment (EventHandler)
  4. Automatic Deployment Quarantine on Critical Incident: ReportedEvent -> Quarantine deployment (EventHandler)

Use CaseInputCore LogicOutputPriority
RegisterModelCommandName, Version, PurposeVO composition -> Risk classification -> Model creationModelIdP0
ClassifyModelRiskCommandModelId, RiskTierModel lookup -> Reclassify -> UpdateP0
CreateDeploymentCommandModelId, Url, Env, DriftVO composition -> Model verification -> Deployment creationDeploymentIdP0
SubmitDeploymentForReviewCommandDeploymentIdDeployment lookup -> Eligibility verification -> SubmitP0
ActivateDeploymentCommandDeploymentId, AssessmentIdDeployment/Assessment lookup -> Pass verification -> ActivateP0
QuarantineDeploymentCommandDeploymentId, ReasonDeployment lookup -> QuarantineP0
InitiateAssessmentCommandModelId, DeploymentIdModel/Deployment lookup -> Assessment creationAssessmentIdP0
ReportIncidentCommandDeploymentId, Severity, DescVO composition -> Deployment lookup -> Incident creationIncidentIdP0

Success Scenario:

Given: A valid model name, SemVer version, and model purpose are provided
When: An AI Governance Administrator registers a model
Then: The model is created, the risk tier is automatically classified based on purpose keywords, and a ModelId is returned

Rejection Scenario:

Given: The model name is empty and the version is not in SemVer format
When: An AI Governance Administrator registers a model
Then: Both errors are returned simultaneously (ApplyT parallel validation)

SubmitDeploymentForReviewCommand Acceptance Criteria

Section titled “SubmitDeploymentForReviewCommand Acceptance Criteria”

Success Scenario:

Given: A deployment in Draft status exists, the model is not in a prohibited tier, the compliance assessment has passed, and there are no unresolved incidents
When: An AI Governance Administrator submits for review
Then: The deployment status transitions to PendingReview

Rejection Scenario (Prohibited Tier):

Given: A deployment referencing a model with Unacceptable risk tier exists
When: An AI Governance Administrator submits for review
Then: A ProhibitedModel error is returned and the deployment status remains unchanged

Rejection Scenario (Failed Compliance):

Given: A High risk tier model has no passed compliance assessment
When: An AI Governance Administrator submits for review
Then: A ComplianceAssessmentRequired error is returned

Success Scenario (Auto-Quarantine):

Given: A deployment in Active status exists
When: A Compliance Officer reports a Critical severity incident
Then: The incident is created in Reported status, and the event handler automatically quarantines the deployment

InitiateAssessmentCommand Acceptance Criteria

Section titled “InitiateAssessmentCommand Acceptance Criteria”

Success Scenario:

Given: A registered model and deployment exist
When: A Compliance Officer initiates an assessment
Then: Assessment criteria are automatically generated based on the risk tier (Minimal: 3, High: 6, Unacceptable: 7) and an AssessmentId is returned
Use CaseInputQuery StrategyOutputPriority
GetModelByIdQueryModelIdIModelDetailQueryModel detail (deployment/assessment/incident aggregation)P0
SearchModelsQueryRiskTier?, Page, SizeIAIModelQueryModel listP1
GetDeploymentByIdQueryDeploymentIdIDeploymentDetailQueryDeployment detailP0
SearchDeploymentsQueryStatus?, Env?, Page, SizeIDeploymentQueryDeployment listP1
GetAssessmentByIdQueryAssessmentIdIAssessmentRepositoryAssessment detail (including criteria)P0
GetIncidentByIdQueryIncidentIdIIncidentRepositoryIncident detailP0
SearchIncidentsQuerySeverity?, Status?, Page, SizeIIncidentQueryIncident listP1
Trigger EventActionPriority
ModelIncident.ReportedEventAuto-quarantine deployment on Critical/High severity (QuarantineDeploymentOnCriticalIncidentHandler)P0
AIModel.RiskClassifiedEventAuto-create assessment for active deployments on High/Unacceptable upgrade (InitiateAssessmentOnRiskUpgradeHandler)P0

QuarantineDeploymentOnCriticalIncidentHandler Acceptance Criteria

Section titled “QuarantineDeploymentOnCriticalIncidentHandler Acceptance Criteria”
Given: A Critical severity incident is reported for a deployment in Active status
When: The ReportedEvent is published
Then: The event handler auto-quarantines the deployment, including the severity in the quarantine reason

InitiateAssessmentOnRiskUpgradeHandler Acceptance Criteria

Section titled “InitiateAssessmentOnRiskUpgradeHandler Acceptance Criteria”
Given: A model upgraded from Minimal to High risk tier has 2 Active deployments
When: The RiskClassifiedEvent is published
Then: The event handler creates a ComplianceAssessment for each active deployment (2 total)

Prohibited StatePrevention StrategyFunctorium Pattern
Unacceptable tier model having active deploymentsriskTier.IsProhibited check in DeploymentEligibilityServiceSmart Enum domain property (RiskTier.IsProhibited) + Domain Service
Deployment transitioning directly from Draft to ActiveStructurally blocked by DeploymentStatus transition mapSmart Enum + HashMap transition map (CanTransitionTo)
Assessment completed without all criteria evaluatedComplete() method returns Fin.Fail when unevaluated criteria existAggregate Root guard method

PriorityCriteriaUse Case CountNotes
P0 (Required)Cannot ship without it12MVP: Command 8 + Query 4 (ID lookup) + EventHandler 2
P1 (Important)Competitiveness weakened without it5Search/Filter: Query 3 + Incident investigation/resolution
P2 (Optional)Differentiating if presentEfCore/Dapper persistence, Prometheus dashboard

MilestoneScopeTargetDependencies
Phase 1 (MVP)P0 Use Cases + InMemory PersistenceWeek 4
Phase 2P1 Use Cases + Sqlite PersistenceWeek 8Phase 1 Complete
Phase 3P2 + Observability Dashboard + Alert RulesWeek 12Phase 2 Complete

IDQuestionCategoryBlockingOwner
Q-001Should ComplianceAssessment criteria be dynamically loaded from an external configuration file?engineeringNon-blockingArchitect
Q-002Is integration with external notification systems (Slack, PagerDuty) needed for incident escalation?productNon-blockingPM
Q-003Should registration of Unacceptable tier models be blocked entirely, or is blocking only deployment sufficient?legalNon-blockingLegal
Q-004Is automatic incident creation needed when model drift threshold is exceeded?engineeringNon-blockingArchitect

  1. architecture-design — Project structure + infrastructure design
  2. domain-develop — Detailed design + implementation of each Aggregate
  3. application-develop — Use case implementation
  4. adapter-develop — Persistence + API implementation
  5. observability-develop — Observability design + implementation
  6. test-develop — Test authoring
  7. review — Code review + documentation