# kryvasis/cortex architecture

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

- Interactive diagram: https://gitdiagram.com/kryvasis/cortex
- Repository: https://github.com/kryvasis/cortex

## Overview

Cortex is a human-governed network configuration assurance application: users create or reuse a session, upload sanitized configurations or collect authorized evidence, review mapped findings, and export reports and integrity receipts. The README documents the main React → Flask → Java architecture and major capabilities; the Iskabon native probe suite and Debian SDK are optional inputs/integrations. Some implementation relationships are documented rather than sampled, so those edges cite the README; native scan orchestration is supported by the excerpted entry point.

Main entry points: [`bridge/app.py`](https://github.com/kryvasis/cortex/blob/main/bridge/app.py) (Flask API), [`src/TrinetraConfigIngestor.java`](https://github.com/kryvasis/cortex/blob/main/src/TrinetraConfigIngestor.java) (Config ingestion), [`Iskabon/src/main.cpp`](https://github.com/kryvasis/cortex/blob/main/Iskabon/src/main.cpp) (Probe CLI), [`frontend/src/pages/UploadView.jsx`](https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/UploadView.jsx) (Upload and collect)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Assessment workspace"]
  node_workspace_ui["Workspace UI<br/>[App.jsx]"]
  node_upload_ui["Upload and collect<br/>[UploadView.jsx]"]
  node_review_ui["Assessment review<br/>[ResultsView.jsx]"]
  node_topology_ui["Topology view<br/>[TopologyView.jsx]"]
  node_assurance_ui["Assurance view<br/>[AssuranceView.jsx]"]
end

subgraph group_bridge["API and evidence"]
  node_flask_api["Flask API<br/>[app.py]"]
  node_fetch_boundary["Fetch boundary<br/>[live_fetcher.py]"]
  node_sbc_api["SDK API<br/>[sbc_api.py]"]
  node_sbc_relay["Host relay<br/>[sbc_relay.py]"]
  node_evidence_graph["Evidence graph<br/>[evidence_graph.py]"]
  node_guide_proxy["Guide proxy<br/>[assistant_api.py]"]
end

subgraph group_engine["Assurance engine"]
  node_java_ingest["Config ingestion"]
  node_vendor_adapters["Vendor adapters"]
  node_checks["Mapped checks"]
  node_findings["Findings and scoring"]
  node_remediation["Remediation planning"]
  node_topology["Topology analysis"]
  node_audit_state[("Session evidence")]
  node_reports["Reports and receipts"]
end

subgraph group_optional["Optional collection"]
  node_sdk_agent["Debian SDK agent<br/>[server.py]"]
  node_sdk_scan["SDK scanning<br/>[scanner.py]"]
  node_iskabon_cli["Probe CLI<br/>[main.cpp]"]
  node_probe_planner["Probe planner<br/>[planner.cpp]"]
  node_probe_scanner["Probe scanner<br/>[scanner.cpp]"]
  node_probe_store[("Probe sessions<br/>[session_store.cpp]")]
end

node_assessor(("Assessor"))

node_assessor -->|"uses"| node_workspace_ui
node_workspace_ui -->|"opens"| node_upload_ui
node_upload_ui -->|"submits evidence"| node_flask_api
node_flask_api -->|"collects through"| node_fetch_boundary
node_flask_api -->|"invokes ingestion"| node_java_ingest
node_java_ingest -->|"uses adapters"| node_vendor_adapters
node_java_ingest -->|"evaluates"| node_checks
node_checks -->|"scores findings"| node_findings
node_java_ingest -->|"records evidence"| node_audit_state
node_review_ui -->|"requests results"| node_flask_api
node_review_ui -->|"reviews guidance"| node_remediation
node_remediation -->|"reads stored evidence"| node_audit_state
node_topology_ui -->|"requests topology"| node_flask_api
node_flask_api -->|"requests analysis"| node_topology
node_topology -->|"supplies graph view"| node_evidence_graph
node_assurance_ui -->|"requests coverage"| node_flask_api
node_flask_api -->|"generates reports"| node_reports
node_reports -->|"verifies chain"| node_audit_state
node_flask_api -->|"proxies chat"| node_guide_proxy
node_upload_ui -->|"requests SDK scan"| node_sbc_api
node_sbc_api -->|"uses relay"| node_sbc_relay
node_sbc_relay -->|"fetches bundle"| node_sdk_agent
node_sdk_agent -->|"runs scan"| node_sdk_scan
node_sdk_agent -->|"serves mTLS"| node_sbc_relay
node_iskabon_cli -->|"builds jobs"| node_probe_planner
node_iskabon_cli -->|"runs jobs"| node_probe_scanner
node_iskabon_cli -->|"stores results"| node_probe_store

click node_workspace_ui "https://github.com/kryvasis/cortex/blob/main/frontend/src/App.jsx"
click node_upload_ui "https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/UploadView.jsx"
click node_review_ui "https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/ResultsView.jsx"
click node_topology_ui "https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/TopologyView.jsx"
click node_assurance_ui "https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/AssuranceView.jsx"
click node_flask_api "https://github.com/kryvasis/cortex/blob/main/bridge/app.py"
click node_fetch_boundary "https://github.com/kryvasis/cortex/blob/main/bridge/live_fetcher.py"
click node_sbc_api "https://github.com/kryvasis/cortex/blob/main/bridge/sbc_api.py"
click node_sbc_relay "https://github.com/kryvasis/cortex/blob/main/bridge/sbc_relay.py"
click node_evidence_graph "https://github.com/kryvasis/cortex/blob/main/bridge/evidence_graph.py"
click node_guide_proxy "https://github.com/kryvasis/cortex/blob/main/bridge/assistant_api.py"
click node_java_ingest "https://github.com/kryvasis/cortex/blob/main/src/TrinetraConfigIngestor.java"
click node_vendor_adapters "https://github.com/kryvasis/cortex/blob/main/src/VendorConnectorRegistry.java"
click node_checks "https://github.com/kryvasis/cortex/blob/main/src/TrinetraCompliance.java"
click node_findings "https://github.com/kryvasis/cortex/blob/main/src/TrinetraComplianceScorer.java"
click node_remediation "https://github.com/kryvasis/cortex/blob/main/src/TrinetraRemediationPlanner.java"
click node_topology "https://github.com/kryvasis/cortex/blob/main/src/TrinetraTopologyBuilder.java"
click node_audit_state "https://github.com/kryvasis/cortex/blob/main/src/TrinetraSession.java"
click node_reports "https://github.com/kryvasis/cortex/blob/main/src/TrinetraAuditReportBuilder.java"
click node_sdk_agent "https://github.com/kryvasis/cortex/blob/main/sbc_agent/server.py"
click node_sdk_scan "https://github.com/kryvasis/cortex/blob/main/sbc_agent/scanner.py"
click node_iskabon_cli "https://github.com/kryvasis/cortex/blob/main/Iskabon/src/main.cpp"
click node_probe_planner "https://github.com/kryvasis/cortex/blob/main/Iskabon/src/planner/planner.cpp"
click node_probe_scanner "https://github.com/kryvasis/cortex/blob/main/Iskabon/src/probes/scanner.cpp"
click node_probe_store "https://github.com/kryvasis/cortex/blob/main/Iskabon/src/session/session_store.cpp"

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_workspace_ui,node_upload_ui,node_review_ui,node_topology_ui,node_assurance_ui toneBlue
class node_flask_api,node_fetch_boundary,node_sbc_api,node_sbc_relay,node_evidence_graph,node_guide_proxy toneAmber
class node_java_ingest,node_vendor_adapters,node_checks,node_findings,node_remediation,node_topology,node_audit_state,node_reports toneMint
class node_sdk_agent,node_sdk_scan,node_iskabon_cli,node_probe_planner,node_probe_scanner,node_probe_store toneRose
class node_assessor toneIndigo
```

## Components

### Assessment workspace

- [Workspace UI](https://github.com/kryvasis/cortex/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Upload and collect](https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/UploadView.jsx): `frontend/src/pages/UploadView.jsx`
- [Assessment review](https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/ResultsView.jsx): `frontend/src/pages/ResultsView.jsx`
- [Topology view](https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/TopologyView.jsx): `frontend/src/pages/TopologyView.jsx`
- [Assurance view](https://github.com/kryvasis/cortex/blob/main/frontend/src/pages/AssuranceView.jsx): `frontend/src/pages/AssuranceView.jsx`

### API and evidence

- [Flask API](https://github.com/kryvasis/cortex/blob/main/bridge/app.py): `bridge/app.py`
- [Fetch boundary](https://github.com/kryvasis/cortex/blob/main/bridge/live_fetcher.py): `bridge/live_fetcher.py`
- [SDK API](https://github.com/kryvasis/cortex/blob/main/bridge/sbc_api.py): `bridge/sbc_api.py`
- [Host relay](https://github.com/kryvasis/cortex/blob/main/bridge/sbc_relay.py): `bridge/sbc_relay.py`
- [Evidence graph](https://github.com/kryvasis/cortex/blob/main/bridge/evidence_graph.py): `bridge/evidence_graph.py`
- [Guide proxy](https://github.com/kryvasis/cortex/blob/main/bridge/assistant_api.py): `bridge/assistant_api.py`

### Assurance engine

- [Config ingestion](https://github.com/kryvasis/cortex/blob/main/src/TrinetraConfigIngestor.java): `src/TrinetraConfigIngestor.java`
- [Vendor adapters](https://github.com/kryvasis/cortex/blob/main/src/VendorConnectorRegistry.java): `src/VendorConnectorRegistry.java`
- [Mapped checks](https://github.com/kryvasis/cortex/blob/main/src/TrinetraCompliance.java): `src/TrinetraCompliance.java`
- [Findings and scoring](https://github.com/kryvasis/cortex/blob/main/src/TrinetraComplianceScorer.java): `src/TrinetraComplianceScorer.java`
- [Remediation planning](https://github.com/kryvasis/cortex/blob/main/src/TrinetraRemediationPlanner.java): `src/TrinetraRemediationPlanner.java`
- [Topology analysis](https://github.com/kryvasis/cortex/blob/main/src/TrinetraTopologyBuilder.java): `src/TrinetraTopologyBuilder.java`
- [Session evidence](https://github.com/kryvasis/cortex/blob/main/src/TrinetraSession.java): `src/TrinetraSession.java`
- [Reports and receipts](https://github.com/kryvasis/cortex/blob/main/src/TrinetraAuditReportBuilder.java): `src/TrinetraAuditReportBuilder.java`

### Optional collection

- [Debian SDK agent](https://github.com/kryvasis/cortex/blob/main/sbc_agent/server.py): `sbc_agent/server.py`
- [SDK scanning](https://github.com/kryvasis/cortex/blob/main/sbc_agent/scanner.py): `sbc_agent/scanner.py`
- [Probe CLI](https://github.com/kryvasis/cortex/blob/main/Iskabon/src/main.cpp): `Iskabon/src/main.cpp`
- [Probe planner](https://github.com/kryvasis/cortex/blob/main/Iskabon/src/planner/planner.cpp): `Iskabon/src/planner/planner.cpp`
- [Probe scanner](https://github.com/kryvasis/cortex/blob/main/Iskabon/src/probes/scanner.cpp): `Iskabon/src/probes/scanner.cpp`
- [Probe sessions](https://github.com/kryvasis/cortex/blob/main/Iskabon/src/session/session_store.cpp): `Iskabon/src/session/session_store.cpp`

### Other components

- **Assessor**

## Connections

- Assessor → Workspace UI: uses
- Workspace UI → Upload and collect: opens
- Upload and collect → Flask API: submits evidence
- Flask API → Fetch boundary: collects through
- Flask API → Config ingestion: invokes ingestion
- Config ingestion → Vendor adapters: uses adapters
- Config ingestion → Mapped checks: evaluates
- Mapped checks → Findings and scoring: scores findings
- Config ingestion → Session evidence: records evidence
- Assessment review → Flask API: requests results
- Assessment review → Remediation planning: reviews guidance
- Remediation planning → Session evidence: reads stored evidence
- Topology view → Flask API: requests topology
- Flask API → Topology analysis: requests analysis
- Topology analysis → Evidence graph: supplies graph view
- Assurance view → Flask API: requests coverage
- Flask API → Reports and receipts: generates reports
- Reports and receipts → Session evidence: verifies chain
- Flask API → Guide proxy: proxies chat
- Upload and collect → SDK API: requests SDK scan
- SDK API → Host relay: uses relay
- Host relay → Debian SDK agent: fetches bundle
- Debian SDK agent → SDK scanning: runs scan (evidence: `sbc_agent/server.py`)
- Debian SDK agent → Host relay: serves mTLS
- Probe CLI → Probe planner: builds jobs (evidence: `Iskabon/src/main.cpp`)
- Probe CLI → Probe scanner: runs jobs (evidence: `Iskabon/src/main.cpp`)
- Probe CLI → Probe sessions: stores results (evidence: `Iskabon/src/main.cpp`)
