# vatshal27/sentialai architecture

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

- Interactive diagram: https://gitdiagram.com/vatshal27/sentialai
- Repository: https://github.com/vatshal27/sentialai

## Overview

SentinelAI’s checked-in product here is a VS Code client for a separately hosted local security backend. The main workflow gates scans on an eligible open workspace, collects files for a backend-supported profile, submits and polls a bounded job, presents findings and coverage, and persists completed results. Separate actions support runtime discovery, project validation, and synthetic Safe Simulation. The README describes backend scanning and runtime capabilities, but backend implementation is not in this tree; those internals are therefore represented only as an external service. The map reflects documented relationships and shown source references, not an inspection of unsampled implementation details.

Main entry points: [`src/extension.ts`](https://github.com/vatshal27/sentialai/blob/main/src/extension.ts) (Extension commands), [`src/services.ts`](https://github.com/vatshal27/sentialai/blob/main/src/services.ts) (Backend API client), [`src/webview.ts`](https://github.com/vatshal27/sentialai/blob/main/src/webview.ts) (Webview assembly), [`src/security-workbench.ts`](https://github.com/vatshal27/sentialai/blob/main/src/security-workbench.ts) (Scan job controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Extension orchestration"]
  node_extension["Extension commands<br/>[extension.ts]"]
end

subgraph group_scan_runtime["Scan and runtime"]
  node_workspace_gate["Workspace eligibility<br/>[extension.ts]"]
  node_file_collection["Workspace collection<br/>[services.ts]"]
  node_capabilities["Profile capabilities<br/>[services.ts]"]
  node_job_controller["Scan job controller"]
  node_backend_api["Backend API client<br/>[services.ts]"]
  node_runtime_discovery["Runtime discovery<br/>[services.ts]"]
  node_runtime_validation["Project validation<br/>[extension.ts]"]
  node_safe_simulation["Safe Simulation<br/>[extension.ts]"]
end

subgraph group_reporting["Reporting"]
  node_runtime_adapter["Runtime report adapter<br/>[runtime-report.ts]"]
  node_report_model["Unified report model<br/>[project-report.ts]"]
  node_report_persistence["Report persistence"]
end

subgraph group_workbench_ui["Workbench interface"]
  node_webview_assembly["Webview assembly<br/>[webview.ts]"]
  node_workbench_ui["Workbench controls"]
  node_results_ui["Findings display<br/>[script-results.ts]"]
  node_runtime_ui["Runtime display<br/>[script-sandbox.ts]"]
end

node_developer(("Developer"))
node_vscode["VS Code host"]
node_backend["Local backend"]
node_report_files["Project report files"]

node_developer -->|"invokes commands"| node_extension
node_vscode -->|"hosts extension"| node_extension
node_extension -->|"checks workspace"| node_workspace_gate
node_extension -->|"collects files"| node_file_collection
node_extension -->|"configures controller"| node_job_controller
node_job_controller -->|"loads profiles"| node_capabilities
node_job_controller -->|"creates and polls jobs"| node_backend_api
node_backend_api -->|"sends scan requests"| node_backend
node_extension -->|"requests discovery"| node_runtime_discovery
node_extension -->|"starts validation"| node_runtime_validation
node_extension -->|"starts simulation"| node_safe_simulation
node_runtime_validation -->|"submits validation"| node_backend_api
node_safe_simulation -->|"submits simulation"| node_backend_api
node_backend_api -->|"requests runtime checks"| node_backend
node_runtime_validation -->|"adapts result"| node_runtime_adapter
node_extension -->|"persists completed result"| node_report_persistence
node_report_persistence -->|"merges and renders"| node_report_model
node_report_persistence -->|"writes JSON and Markdown"| node_report_files
node_extension -->|"opens panel"| node_webview_assembly
node_webview_assembly -->|"includes script"| node_workbench_ui
node_webview_assembly -->|"includes script"| node_results_ui
node_webview_assembly -->|"includes script"| node_runtime_ui
node_workbench_ui -->|"sends workbench messages"| node_extension
node_results_ui -.->|"renders findings in panel"| node_vscode
node_runtime_ui -.->|"renders validation report"| node_vscode

click node_extension "https://github.com/vatshal27/sentialai/blob/main/src/extension.ts"
click node_workspace_gate "https://github.com/vatshal27/sentialai/blob/main/src/extension.ts"
click node_file_collection "https://github.com/vatshal27/sentialai/blob/main/src/services.ts"
click node_capabilities "https://github.com/vatshal27/sentialai/blob/main/src/services.ts"
click node_job_controller "https://github.com/vatshal27/sentialai/blob/main/src/security-workbench.ts"
click node_backend_api "https://github.com/vatshal27/sentialai/blob/main/src/services.ts"
click node_runtime_discovery "https://github.com/vatshal27/sentialai/blob/main/src/services.ts"
click node_runtime_validation "https://github.com/vatshal27/sentialai/blob/main/src/extension.ts"
click node_safe_simulation "https://github.com/vatshal27/sentialai/blob/main/src/extension.ts"
click node_runtime_adapter "https://github.com/vatshal27/sentialai/blob/main/src/webview/runtime-report.ts"
click node_report_model "https://github.com/vatshal27/sentialai/blob/main/src/project-report.ts"
click node_report_persistence "https://github.com/vatshal27/sentialai/blob/main/src/report-persistence.ts"
click node_webview_assembly "https://github.com/vatshal27/sentialai/blob/main/src/webview.ts"
click node_workbench_ui "https://github.com/vatshal27/sentialai/blob/main/src/webview/script-workbench.ts"
click node_results_ui "https://github.com/vatshal27/sentialai/blob/main/src/webview/script-results.ts"
click node_runtime_ui "https://github.com/vatshal27/sentialai/blob/main/src/webview/script-sandbox.ts"

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_extension toneBlue
class node_workspace_gate,node_file_collection,node_capabilities,node_job_controller,node_backend_api,node_runtime_discovery,node_runtime_validation,node_safe_simulation toneAmber
class node_runtime_adapter,node_report_model,node_report_persistence toneMint
class node_webview_assembly,node_workbench_ui,node_results_ui,node_runtime_ui toneRose
class node_developer,node_vscode,node_backend,node_report_files toneIndigo
```

## Components

### Extension orchestration

- [Extension commands](https://github.com/vatshal27/sentialai/blob/main/src/extension.ts): `src/extension.ts`

### Scan and runtime

- [Workspace eligibility](https://github.com/vatshal27/sentialai/blob/main/src/extension.ts): `src/extension.ts`
- [Workspace collection](https://github.com/vatshal27/sentialai/blob/main/src/services.ts): `src/services.ts`
- [Profile capabilities](https://github.com/vatshal27/sentialai/blob/main/src/services.ts): `src/services.ts`
- [Scan job controller](https://github.com/vatshal27/sentialai/blob/main/src/security-workbench.ts): `src/security-workbench.ts`
- [Backend API client](https://github.com/vatshal27/sentialai/blob/main/src/services.ts): `src/services.ts`
- [Runtime discovery](https://github.com/vatshal27/sentialai/blob/main/src/services.ts): `src/services.ts`
- [Project validation](https://github.com/vatshal27/sentialai/blob/main/src/extension.ts): `src/extension.ts`
- [Safe Simulation](https://github.com/vatshal27/sentialai/blob/main/src/extension.ts): `src/extension.ts`

### Reporting

- [Runtime report adapter](https://github.com/vatshal27/sentialai/blob/main/src/webview/runtime-report.ts): `src/webview/runtime-report.ts`
- [Unified report model](https://github.com/vatshal27/sentialai/blob/main/src/project-report.ts): `src/project-report.ts`
- [Report persistence](https://github.com/vatshal27/sentialai/blob/main/src/report-persistence.ts): `src/report-persistence.ts`

### Workbench interface

- [Webview assembly](https://github.com/vatshal27/sentialai/blob/main/src/webview.ts): `src/webview.ts`
- [Workbench controls](https://github.com/vatshal27/sentialai/blob/main/src/webview/script-workbench.ts): `src/webview/script-workbench.ts`
- [Findings display](https://github.com/vatshal27/sentialai/blob/main/src/webview/script-results.ts): `src/webview/script-results.ts`
- [Runtime display](https://github.com/vatshal27/sentialai/blob/main/src/webview/script-sandbox.ts): `src/webview/script-sandbox.ts`

### Other components

- **Developer**
- **VS Code host**
- **Local backend**
- **Project report files**

## Connections

- Developer → Extension commands: invokes commands (evidence: `README.md`)
- VS Code host → Extension commands: hosts extension (evidence: `README.md`)
- Extension commands → Workspace eligibility: checks workspace (evidence: `src/extension.ts`)
- Extension commands → Workspace collection: collects files (evidence: `src/extension.ts`)
- Extension commands → Scan job controller: configures controller (evidence: `src/extension.ts`)
- Scan job controller → Profile capabilities: loads profiles (evidence: `src/security-workbench.ts`)
- Scan job controller → Backend API client: creates and polls jobs (evidence: `src/security-workbench.ts`)
- Backend API client → Local backend: sends scan requests (evidence: `src/services.ts`)
- Extension commands → Runtime discovery: requests discovery (evidence: `src/services.ts`)
- Extension commands → Project validation: starts validation (evidence: `src/extension.ts`)
- Extension commands → Safe Simulation: starts simulation (evidence: `README.md`)
- Project validation → Backend API client: submits validation (evidence: `src/services.ts`)
- Safe Simulation → Backend API client: submits simulation (evidence: `src/services.ts`)
- Backend API client → Local backend: requests runtime checks (evidence: `src/services.ts`)
- Project validation → Runtime report adapter: adapts result (evidence: `src/extension.ts`)
- Extension commands → Report persistence: persists completed result (evidence: `src/extension.ts`)
- Report persistence → Unified report model: merges and renders (evidence: `src/report-persistence.ts`)
- Report persistence → Project report files: writes JSON and Markdown (evidence: `README.md`)
- Extension commands → Webview assembly: opens panel (evidence: `src/extension.ts`)
- Webview assembly → Workbench controls: includes script (evidence: `src/webview.ts`)
- Webview assembly → Findings display: includes script (evidence: `src/webview.ts`)
- Webview assembly → Runtime display: includes script (evidence: `src/webview.ts`)
- Workbench controls → Extension commands: sends workbench messages (evidence: `src/webview/script-workbench.ts`)
- Findings display → VS Code host: renders findings in panel
- Runtime display → VS Code host: renders validation report
