# amirzaafouri/false-positive-reduction-system architecture

> Architecture diagram of the GitHub repository amirzaafouri/false-positive-reduction-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amirzaafouri/false-positive-reduction-system
- Repository: https://github.com/amirzaafouri/false-positive-reduction-system

## Overview

#### Purpose and runtime

False Positive Validation Platform is an in-development .NET 8 ASP.NET Core service that receives test-failure tickets and is intended to classify them as false positives, defects, infrastructure issues, or other outcomes. Its implemented focus is Jira webhook intake, not the broader planned evidence, rerun, AI, persistence, or ticket-update workflow.

- Host entry point: `src/Api/Program.cs`
- Solution root: `IncidentValidationEngine.slnx`
- Container orchestration exists at `docker-compose.yml`

#### API boundary and composition

The API layer exposes HTTP endpoints and composes the application and infrastructure layers through dependency-injection extension methods. This is the external boundary for Jira and future ticketing integrations.

- Startup and route registration: `src/Api/Program.cs`
- Jira webhook endpoint: `src/Api/Endpoints/JiraWebhookEndpoints.cs`
- Application registrations: `src/Api/Configuration/ApplicationServiceExtensions.cs`
- Infrastructure registrations: `src/Api/Configuration/InfrastructureServiceExtensions.cs`

Control enters through the Jira endpoint, which delegates rather than embedding intake/parsing policy in the HTTP layer.

#### Application intake orchestration

The application layer owns the intake use case and its ports. `IncidentIntakeService` coordinates conversion of a received ticket payload into an application-level incident intake model, while depending on abstractions for payload parsing.

- Intake use case: `src/Application/UseCases/IncidentIntakeService.cs`
- Intake contract: `src/Application/Interfaces/IIncidentIntakeService.cs`
- Parser port: `src/Application/Interfaces/ITicketPayloadParser.cs`
- Transfer model: `src/Application/Common/IncidentIntake.cs`

This boundary permits ticket-system-specific parsers to be replaced without coupling the API or use case to Jira payload structure.

#### Domain decision model

The domain project defines the central incident and classification vocabulary needed by a future validation/decision engine. It is intentionally independent of HTTP and Jira concerns.

- Incident aggregate/model: `src/Domain/Entities/Incident.cs`
- Classification entity: `src/Domain/Entities/Classification.cs`
- Decision entity: `src/Domain/Entities/Decision.cs`
- Classification enum: `src/Domain/Enums/IncidentClassification.cs`

The README’s rerun/evidence/rule workflow is architectural intent; no dedicated decision-engine, evidence-collection, or self-healing implementation appears in the supplied tree.

#### Jira infrastructure adapter

Infrastructure supplies the Jira-specific implementation of the application parser port. It is the integration boundary where Jira webhook payload semantics are interpreted before the application intake flow receives normalized data.

- Jira parser: `src/Infrastructure/Ticketing/Jira/JiraPayloadParser.cs`
- Infrastructure project: `src/Infrastructure/Infrastructure.csproj`
- Parser abstraction consumed upstream: `src/Application/Interfaces/ITicketPayloadParser.cs`

Jira is the only concrete external service integration visible. Jira REST ticket actions, Xray, Azure DevOps, and ServiceNow integrations are not present.

#### Primary request flow

1. Jira sends an HTTP webhook to `src/Api/Endpoints/JiraWebhookEndpoints.cs`.
2. The endpoint resolves `IIncidentIntakeService`.
3. `IncidentIntakeService` uses `ITicketPayloadParser`.
4. The registered Jira adapter parses the payload into `IncidentIntake`.
5. The resulting intake is the handoff point for future domain incident creation, evidence/rerun validation, classification, and ticket automation.

#### Material gaps and infrastructure

The repository is structured as Clean Architecture—API → Application → Domain, with Infrastructure implementing application ports—but currently contains no visible EF Core context/migrations, PostgreSQL access, Serilog setup, OpenAPI configuration, background processing, or AI provider client. `docker-compose.yml` indicates infrastructure is planned or locally orchestrated, but concrete service wiring should be verified before extending it.

Main entry points: [`src/Api/Program.cs`](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Program.cs) (API startup), [`src/Application/UseCases/IncidentIntakeService.cs`](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/UseCases/IncidentIntakeService.cs) (Incident intake service), [`src/Domain/Entities/Incident.cs`](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Entities/Incident.cs) (Incident), [`src/Infrastructure/Ticketing/Jira/JiraPayloadParser.cs`](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Infrastructure/Ticketing/Jira/JiraPayloadParser.cs) (Jira payload parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_program["API startup<br/>composition root<br/>[Program.cs]"]
  node_webhook["Jira webhook endpoint<br/>HTTP endpoint"]
  node_application_registration["Application registrations<br/>DI extension"]
  node_infrastructure_registration["Infrastructure registrations<br/>DI extension"]
end

subgraph group_application["Application"]
  node_intake_contract["Incident intake contract<br/>application interface"]
  node_intake_service["Incident intake service<br/>use case"]
  node_parser_port["Ticket payload parser<br/>application port"]
  node_incident_intake["Incident intake<br/>transfer model<br/>[IncidentIntake.cs]"]
end

subgraph group_domain["Domain"]
  node_incident["Incident<br/>domain model<br/>[Incident.cs]"]
  node_classification["Classification<br/>domain entity<br/>[Classification.cs]"]
  node_decision["Decision<br/>domain entity<br/>[Decision.cs]"]
  node_classification_enum["Incident classification<br/>domain enum"]
end

subgraph group_infrastructure["Infrastructure"]
  node_jira_parser["Jira payload parser<br/>Jira adapter"]
end

node_jira{{"Jira<br/>external ticketing"}}
node_compose["Container orchestration<br/>Docker Compose<br/>[docker-compose.yml]"]

node_jira -->|"sends webhook"| node_webhook
node_program -->|"registers routes"| node_webhook
node_program -->|"composes"| node_application_registration
node_program -->|"composes"| node_infrastructure_registration
node_webhook -->|"resolves"| node_intake_contract
node_intake_contract -->|"implemented by"| node_intake_service
node_intake_service -->|"uses"| node_parser_port
node_jira_parser -->|"implements"| node_parser_port
node_infrastructure_registration -->|"registers"| node_jira_parser
node_jira_parser -->|"parses into"| node_incident_intake
node_intake_service -->|"returns"| node_incident_intake
node_incident_intake -.->|"future creation"| node_incident
node_incident -.->|"future classification"| node_classification
node_classification -->|"uses"| node_classification_enum
node_incident -.->|"future decision"| node_decision

click node_program "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Program.cs"
click node_webhook "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Endpoints/JiraWebhookEndpoints.cs"
click node_application_registration "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Configuration/ApplicationServiceExtensions.cs"
click node_infrastructure_registration "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Configuration/InfrastructureServiceExtensions.cs"
click node_intake_contract "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/Interfaces/IIncidentIntakeService.cs"
click node_intake_service "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/UseCases/IncidentIntakeService.cs"
click node_parser_port "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/Interfaces/ITicketPayloadParser.cs"
click node_incident_intake "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/Common/IncidentIntake.cs"
click node_incident "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Entities/Incident.cs"
click node_classification "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Entities/Classification.cs"
click node_decision "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Entities/Decision.cs"
click node_classification_enum "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Enums/IncidentClassification.cs"
click node_jira_parser "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Infrastructure/Ticketing/Jira/JiraPayloadParser.cs"
click node_compose "https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/docker-compose.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_webhook,node_application_registration,node_infrastructure_registration toneBlue
class node_intake_contract,node_intake_service,node_parser_port,node_incident_intake toneAmber
class node_incident,node_classification,node_decision,node_classification_enum toneMint
class node_jira_parser toneRose
class node_jira,node_compose toneNeutral
```

## Components

### API

HTTP boundary and composition root.

- [API startup](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Program.cs): composition root · `src/Api/Program.cs`
- [Jira webhook endpoint](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Endpoints/JiraWebhookEndpoints.cs): HTTP endpoint · `src/Api/Endpoints/JiraWebhookEndpoints.cs`
- [Application registrations](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Configuration/ApplicationServiceExtensions.cs): DI extension · `src/Api/Configuration/ApplicationServiceExtensions.cs`
- [Infrastructure registrations](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Api/Configuration/InfrastructureServiceExtensions.cs): DI extension · `src/Api/Configuration/InfrastructureServiceExtensions.cs`

### Application

Intake use case and integration ports.

- [Incident intake contract](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/Interfaces/IIncidentIntakeService.cs): application interface · `src/Application/Interfaces/IIncidentIntakeService.cs`
- [Incident intake service](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/UseCases/IncidentIntakeService.cs): use case · Coordinates normalized ticket intake. · `src/Application/UseCases/IncidentIntakeService.cs`
- [Ticket payload parser](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/Interfaces/ITicketPayloadParser.cs): application port · `src/Application/Interfaces/ITicketPayloadParser.cs`
- [Incident intake](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Application/Common/IncidentIntake.cs): transfer model · Normalized handoff for future validation. · `src/Application/Common/IncidentIntake.cs`

### Domain

Independent incident decision vocabulary.

- [Incident](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Entities/Incident.cs): domain model · `src/Domain/Entities/Incident.cs`
- [Classification](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Entities/Classification.cs): domain entity · `src/Domain/Entities/Classification.cs`
- [Decision](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Entities/Decision.cs): domain entity · `src/Domain/Entities/Decision.cs`
- [Incident classification](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Domain/Enums/IncidentClassification.cs): domain enum · False positive, defect, infrastructure issue, or other. · `src/Domain/Enums/IncidentClassification.cs`

### Infrastructure

Jira-specific port implementation.

- [Jira payload parser](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/src/Infrastructure/Ticketing/Jira/JiraPayloadParser.cs): Jira adapter · Interprets Jira webhook payloads. · `src/Infrastructure/Ticketing/Jira/JiraPayloadParser.cs`

### Other components

- **Jira**: external ticketing · Only concrete external integration.
- [Container orchestration](https://github.com/amirzaafouri/false-positive-reduction-system/blob/main/docker-compose.yml): Docker Compose · Planned or local infrastructure; concrete wiring is unverified. · `docker-compose.yml`

## Connections

- Jira → Jira webhook endpoint: sends webhook
- API startup → Jira webhook endpoint: registers routes
- API startup → Application registrations: composes
- API startup → Infrastructure registrations: composes
- Jira webhook endpoint → Incident intake contract: resolves
- Incident intake contract → Incident intake service: implemented by
- Incident intake service → Ticket payload parser: uses
- Jira payload parser → Ticket payload parser: implements
- Infrastructure registrations → Jira payload parser: registers
- Jira payload parser → Incident intake: parses into
- Incident intake service → Incident intake: returns
- Incident intake → Incident: future creation
- Incident → Classification: future classification
- Classification → Incident classification: uses
- Incident → Decision: future decision
