# rakeesssh007/sovereign-cloud-orchestration-framework architecture

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

- Interactive diagram: https://gitdiagram.com/rakeesssh007/sovereign-cloud-orchestration-framework
- Repository: https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework

## Overview

SCOF is an AWS Terraform policy-as-code framework: developers or a pull-request gate supply Terraform configurations, which are planned and checked against shared Rego controls using a jurisdiction-specific context; violations become diagnostics or gate failures. The graph preserves the developer/VS Code and CI paths, context routing, and the documented control areas. Source excerpts show the CLI, router, and CI gate relationships; policy details and editor wiring are described in the README, so those links cite it.

Main entry points: [`cli/compliance-linter/scof_core.py`](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/cli/compliance-linter/scof_core.py) (Plan and evaluation), [`scripts/ci_gate.py`](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/scripts/ci_gate.py) (CI gate), [`router/policy-routing/scof_router.py`](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/router/policy-routing/scof_router.py) (Context router), [`cli/compliance-linter/scof_lint.py`](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/cli/compliance-linter/scof_lint.py) (CLI linter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entrypoints["Developer and CI"]
  node_editor_tasks["VS Code tasks<br/>[README.md]"]
  node_linter["CLI linter<br/>[scof_lint.py]"]
  node_ci_gate["CI gate<br/>[ci_gate.py]"]
  node_workflow["GitHub Actions workflow"]
end

subgraph group_routing["Context routing"]
  node_router["Context router<br/>[scof_router.py]"]
  node_routing_config["Routing configuration<br/>[routing.json]"]
  node_context_data["Context data"]
  node_control_sets["Control sets<br/>[control_sets.json]"]
end

subgraph group_evaluation["Policy evaluation"]
  node_core["Plan and evaluation<br/>[scof_core.py]"]
  node_policy_library["Shared Rego controls"]
end

subgraph group_feedback["Results and diagnostics"]
  node_diagnostics["Violations and diagnostics<br/>[scof_core.py]"]
end

node_developer(("Developer"))
node_pull_request(("Pull request"))
node_terraform["Terraform"]
node_opa["OPA"]
node_conftest["Conftest"]

node_developer -->|"runs task"| node_editor_tasks
node_editor_tasks -->|"invokes"| node_linter
node_developer -->|"runs"| node_linter
node_linter -->|"calls"| node_core
node_core -->|"plans with"| node_terraform
node_core -->|"evaluates via"| node_opa
node_core -->|"evaluates via"| node_conftest
node_core -->|"loads policies"| node_policy_library
node_core -->|"loads context"| node_context_data
node_core -->|"loads controls"| node_control_sets
node_core -->|"formats results"| node_diagnostics
node_pull_request -->|"triggers gate"| node_workflow
node_workflow -->|"runs"| node_ci_gate
node_ci_gate -->|"resolves context"| node_router
node_router -->|"reads routes"| node_routing_config
node_router -->|"writes context"| node_context_data
node_router -->|"reads controls"| node_control_sets
node_ci_gate -->|"invokes"| node_linter
node_ci_gate -->|"reports gate result"| node_diagnostics

click node_editor_tasks "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/vscode/lightweight-editor-integration/README.md"
click node_linter "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/cli/compliance-linter/scof_lint.py"
click node_ci_gate "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/scripts/ci_gate.py"
click node_router "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/router/policy-routing/scof_router.py"
click node_routing_config "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/router/policy-routing/routing.json"
click node_context_data "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/tree/main/router/policy-routing/contexts"
click node_control_sets "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/router/policy-routing/control_sets.json"
click node_core "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/cli/compliance-linter/scof_core.py"
click node_policy_library "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/tree/main/policies"
click node_diagnostics "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/cli/compliance-linter/scof_core.py"
click node_workflow "https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/.github/workflows/compliance-gate.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_editor_tasks,node_linter,node_ci_gate,node_workflow toneBlue
class node_router,node_routing_config,node_context_data,node_control_sets toneAmber
class node_core,node_policy_library,node_pull_request toneMint
class node_diagnostics toneRose
class node_developer,node_terraform,node_opa,node_conftest toneIndigo
```

## Components

### Developer and CI

- [VS Code tasks](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/vscode/lightweight-editor-integration/README.md): `vscode/lightweight-editor-integration/README.md`
- [CLI linter](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/cli/compliance-linter/scof_lint.py): `cli/compliance-linter/scof_lint.py`
- [CI gate](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/scripts/ci_gate.py): `scripts/ci_gate.py`
- [GitHub Actions workflow](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/.github/workflows/compliance-gate.yml): `.github/workflows/compliance-gate.yml`

### Context routing

- [Context router](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/router/policy-routing/scof_router.py): `router/policy-routing/scof_router.py`
- [Routing configuration](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/router/policy-routing/routing.json): `router/policy-routing/routing.json`
- [Context data](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/tree/main/router/policy-routing/contexts): `router/policy-routing/contexts`
- [Control sets](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/router/policy-routing/control_sets.json): `router/policy-routing/control_sets.json`

### Policy evaluation

- [Plan and evaluation](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/cli/compliance-linter/scof_core.py): `cli/compliance-linter/scof_core.py`
- [Shared Rego controls](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/tree/main/policies): `policies`

### Results and diagnostics

- [Violations and diagnostics](https://github.com/rakeesssh007/sovereign-cloud-orchestration-framework/blob/main/cli/compliance-linter/scof_core.py): `cli/compliance-linter/scof_core.py`

### Other components

- **Developer**
- **Pull request**
- **Terraform**
- **OPA**
- **Conftest**

## Connections

- Developer → VS Code tasks: runs task (evidence: `README.md`)
- VS Code tasks → CLI linter: invokes (evidence: `README.md`)
- Developer → CLI linter: runs (evidence: `README.md`)
- CLI linter → Plan and evaluation: calls (evidence: `cli/compliance-linter/scof_lint.py`)
- Plan and evaluation → Terraform: plans with (evidence: `cli/compliance-linter/scof_core.py`)
- Plan and evaluation → OPA: evaluates via (evidence: `cli/compliance-linter/scof_core.py`)
- Plan and evaluation → Conftest: evaluates via (evidence: `cli/compliance-linter/scof_core.py`)
- Plan and evaluation → Shared Rego controls: loads policies (evidence: `cli/compliance-linter/scof_core.py`)
- Plan and evaluation → Context data: loads context (evidence: `cli/compliance-linter/scof_core.py`)
- Plan and evaluation → Control sets: loads controls (evidence: `cli/compliance-linter/scof_core.py`)
- Plan and evaluation → Violations and diagnostics: formats results (evidence: `cli/compliance-linter/scof_core.py`)
- Pull request → GitHub Actions workflow: triggers gate (evidence: `README.md`)
- GitHub Actions workflow → CI gate: runs (evidence: `README.md`)
- CI gate → Context router: resolves context (evidence: `scripts/ci_gate.py`)
- Context router → Routing configuration: reads routes (evidence: `router/policy-routing/scof_router.py`)
- Context router → Context data: writes context (evidence: `router/policy-routing/scof_router.py`)
- Context router → Control sets: reads controls (evidence: `router/policy-routing/scof_router.py`)
- CI gate → CLI linter: invokes (evidence: `scripts/ci_gate.py`)
- CI gate → Violations and diagnostics: reports gate result (evidence: `scripts/ci_gate.py`)
