# chakhchoukh-chaimae/secugate-lite architecture

> Architecture diagram of the GitHub repository chakhchoukh-chaimae/secugate-lite, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chakhchoukh-chaimae/secugate-lite
- Repository: https://github.com/chakhchoukh-chaimae/secugate-lite

## Overview

SecuGate-Lite is a small access-monitoring demonstration: it turns access-log lines and scan reports into shared Signals, detects duplicates and suspicious activity, then produces alerts and optionally asks an operator to approve sensitive actions. The README describes the three-agent contract and end-to-end workflow; sampled source shows how the demo calls that workflow. State such as seen signals, failure counts, and the alert journal is passed in memory, not stored in a database. The graph omits unshown external integrations; source excerpts support the internal calls shown.

Main entry points: [`main.py`](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/main.py) (Demo runner), [`src/workflow.py`](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/workflow.py) (Workflow dispatch), [`src/alerte.py`](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/alerte.py) (Alert creation), [`src/contrat.py`](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/contrat.py) (Signal and verdict types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_demo["Demo and approval"]
  node_demo_runner["Demo runner<br/>[main.py]"]
  node_terminal["Console"]
end

subgraph group_pipeline["Signal processing"]
  node_workflow["Workflow dispatch<br/>[workflow.py]"]
  node_access_normalizer["Access normalization<br/>[collecte.py]"]
  node_scan_normalizer["Scan normalization<br/>[collecte.py]"]
  node_detection["Dedup and analysis<br/>[detection.py]"]
end

subgraph group_contract_alerts["Contract and alerts"]
  node_signal_contract["Signal and verdict types<br/>[contrat.py]"]
  node_procedures["Procedure knowledge<br/>[contrat.py]"]
  node_alert_agent["Alert creation<br/>[alerte.py]"]
  node_alert_journal["Alert journal<br/>[workflow.py]"]
end

node_access_sources(("Access events"))
node_scan_sources(("Scan reports"))
node_operator(("Operator"))

node_demo_runner -->|"calls handlers"| node_workflow
node_demo_runner -->|"prints and prompts"| node_terminal
node_operator -->|"answers prompt"| node_demo_runner
node_access_sources -->|"provides sample lines"| node_demo_runner
node_scan_sources -->|"provides sample reports"| node_demo_runner
node_workflow -->|"normalizes access"| node_access_normalizer
node_workflow -->|"normalizes scan"| node_scan_normalizer
node_access_normalizer -->|"creates Signal"| node_signal_contract
node_scan_normalizer -->|"creates Signal"| node_signal_contract
node_workflow -->|"deduplicates and analyzes"| node_detection
node_detection -->|"searches procedures"| node_procedures
node_detection -->|"uses Signal and creates Verdict"| node_signal_contract
node_workflow -->|"creates alert"| node_alert_agent
node_alert_agent -->|"uses alert types"| node_signal_contract
node_alert_agent -->|"appends alert"| node_alert_journal
node_demo_runner -->|"validates response"| node_alert_agent

click node_demo_runner "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/main.py"
click node_workflow "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/workflow.py"
click node_access_normalizer "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/collecte.py"
click node_scan_normalizer "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/collecte.py"
click node_detection "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/detection.py"
click node_signal_contract "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/contrat.py"
click node_procedures "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/contrat.py"
click node_alert_agent "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/alerte.py"
click node_alert_journal "https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/workflow.py"

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_demo_runner,node_terminal toneBlue
class node_workflow,node_access_normalizer,node_scan_normalizer,node_detection toneAmber
class node_signal_contract,node_procedures,node_alert_agent,node_alert_journal toneMint
class node_access_sources,node_scan_sources,node_operator toneIndigo
```

## Components

### Demo and approval

- [Demo runner](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/main.py): `main.py`
- **Console**

### Signal processing

- [Workflow dispatch](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/workflow.py): `src/workflow.py`
- [Access normalization](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/collecte.py): `src/collecte.py`
- [Scan normalization](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/collecte.py): `src/collecte.py`
- [Dedup and analysis](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/detection.py): `src/detection.py`

### Contract and alerts

- [Signal and verdict types](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/contrat.py): `src/contrat.py`
- [Procedure knowledge](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/contrat.py): `src/contrat.py`
- [Alert creation](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/alerte.py): `src/alerte.py`
- [Alert journal](https://github.com/chakhchoukh-chaimae/secugate-lite/blob/main/src/workflow.py): `src/workflow.py`

### Other components

- **Access events**
- **Scan reports**
- **Operator**

## Connections

- Demo runner → Workflow dispatch: calls handlers (evidence: `main.py`)
- Demo runner → Console: prints and prompts (evidence: `main.py`)
- Operator → Demo runner: answers prompt (evidence: `main.py`)
- Access events → Demo runner: provides sample lines (evidence: `main.py`)
- Scan reports → Demo runner: provides sample reports (evidence: `main.py`)
- Workflow dispatch → Access normalization: normalizes access (evidence: `src/workflow.py`)
- Workflow dispatch → Scan normalization: normalizes scan (evidence: `src/workflow.py`)
- Access normalization → Signal and verdict types: creates Signal (evidence: `src/collecte.py`)
- Scan normalization → Signal and verdict types: creates Signal (evidence: `src/collecte.py`)
- Workflow dispatch → Dedup and analysis: deduplicates and analyzes (evidence: `src/workflow.py`)
- Dedup and analysis → Procedure knowledge: searches procedures (evidence: `src/detection.py`)
- Dedup and analysis → Signal and verdict types: uses Signal and creates Verdict (evidence: `src/detection.py`)
- Workflow dispatch → Alert creation: creates alert (evidence: `src/workflow.py`)
- Alert creation → Signal and verdict types: uses alert types (evidence: `src/alerte.py`)
- Alert creation → Alert journal: appends alert (evidence: `src/alerte.py`)
- Demo runner → Alert creation: validates response (evidence: `main.py`)
