# sys-sharedbuilds/agnitia_hackathon architecture

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

- Interactive diagram: https://gitdiagram.com/sys-sharedbuilds/agnitia_hackathon
- Repository: https://github.com/sys-sharedbuilds/agnitia_hackathon

## Overview

SwitchOn accepts telecom activation orders, resolves each product into a dependency-aware task plan, and executes the plan durably with compensation on failure. Operators use the console to submit and inspect orders, events, metrics, catalogues, reconciliation, and verification proofs. The API persists order/read-model state while Temporal workers run activities against the downstream systems. The README documents Redis Streams and cryptographic certificates as product capabilities; their implementation relationships are shown only where supported. Several auxiliary backend subsystems are unsampled, so their connections are omitted or marked unverified.

Main entry points: [`services/orchestrator/activities.py`](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/activities.py) (Task activities), [`services/order_api/routes/orders.py`](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/routes/orders.py) (Order handling), [`web/app/Shell.tsx`](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/Shell.tsx) (Operator console), [`services/order_api/main.py`](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/main.py) (Order API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Operator console"]
  node_console["Operator console<br/>[Shell.tsx]"]
  node_order_views["Order views<br/>[page.tsx]"]
  node_activation_view["Activation view<br/>[page.tsx]"]
  node_ops_views["Ops and proof views<br/>[page.tsx]"]
end

subgraph group_control["Order control plane"]
  node_api["Order API<br/>[main.py]"]
  node_order_routes["Order handling<br/>[orders.py]"]
  node_catalog["Product plans<br/>[catalog.py]"]
  node_order_store[("Order read model<br/>[db.py]")]
  node_stream_route["Event stream API<br/>[stream.py]"]
  node_metrics["Metrics API<br/>[metrics.py]"]
end

subgraph group_execution["Durable execution"]
  node_temporal["Temporal service"]
  node_worker["Workflow worker<br/>[worker.py]"]
  node_workflow["Activation workflow<br/>[activation.py]"]
  node_activities["Task activities<br/>[activities.py]"]
  node_event_publisher["Event publisher<br/>[events.py]"]
  node_event_bus["Redis Streams"]
  node_projection["Read-model projection<br/>[projector.py]"]
  node_reconciler["State reconciler<br/>[reconciler.py]"]
  node_certificate["Consistency proofs<br/>[crypto.py]"]
  node_baseline["Baseline engine<br/>[baseline.py]"]
end

subgraph group_integrations["External systems"]
  node_oms["OMS mock"]
  node_inventory["Inventory mock"]
  node_network["Network mock"]
  node_billing["Billing mock"]
  node_notification["Notification mock"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_console
node_console -.->|"navigates"| node_order_views
node_console -.->|"navigates"| node_activation_view
node_console -.->|"navigates"| node_ops_views
node_console -->|"uses API"| node_api
node_activation_view -.->|"submits orders"| node_api
node_order_views -.->|"reads orders"| node_api
node_ops_views -.->|"requests ops data"| node_api
node_api -->|"routes requests"| node_order_routes
node_order_routes -->|"reads and writes"| node_order_store
node_order_routes -->|"resolves plans"| node_catalog
node_order_routes -.->|"starts workflows"| node_temporal
node_order_routes -->|"runs baseline"| node_baseline
node_worker -->|"connects worker"| node_temporal
node_temporal -.->|"dispatches tasks"| node_worker
node_worker -->|"registers workflow"| node_workflow
node_workflow -->|"schedules activities"| node_activities
node_activities -->|"calls"| node_oms
node_activities -->|"calls"| node_inventory
node_activities -->|"calls"| node_network
node_activities -->|"calls"| node_billing
node_activities -.->|"calls"| node_notification
node_activities -->|"publishes events"| node_event_publisher
node_event_publisher -.->|"publishes to"| node_event_bus
node_stream_route -.->|"streams events"| node_event_bus
node_projection -.->|"updates read model"| node_order_store
node_reconciler -.->|"checks state"| node_order_store
node_order_routes -->|"signs certificate"| node_certificate
node_metrics -->|"queries metrics"| node_order_store

click node_console "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/Shell.tsx"
click node_order_views "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/orders/page.tsx"
click node_activation_view "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/new/page.tsx"
click node_ops_views "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/reconciler/page.tsx"
click node_api "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/main.py"
click node_order_routes "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/routes/orders.py"
click node_catalog "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/shared/catalog.py"
click node_order_store "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/db.py"
click node_stream_route "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/routes/stream.py"
click node_metrics "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/routes/metrics.py"
click node_worker "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/worker.py"
click node_workflow "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/workflows/activation.py"
click node_activities "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/activities.py"
click node_event_publisher "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/events.py"
click node_projection "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/projector.py"
click node_reconciler "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/reconciler.py"
click node_certificate "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/shared/crypto.py"
click node_baseline "https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/baseline.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_console,node_order_views,node_activation_view,node_ops_views toneBlue
class node_api,node_order_routes,node_catalog,node_order_store,node_stream_route,node_metrics toneAmber
class node_temporal,node_worker,node_workflow,node_activities,node_event_publisher,node_event_bus,node_projection,node_reconciler,node_certificate,node_baseline toneMint
class node_oms,node_inventory,node_network,node_billing,node_notification toneRose
class node_operator toneIndigo
```

## Components

### Operator console

- [Operator console](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/Shell.tsx): `web/app/Shell.tsx`
- [Order views](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/orders/page.tsx): `web/app/orders/page.tsx`
- [Activation view](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/new/page.tsx): `web/app/new/page.tsx`
- [Ops and proof views](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/web/app/reconciler/page.tsx): `web/app/reconciler/page.tsx`

### Order control plane

- [Order API](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/main.py): `services/order_api/main.py`
- [Order handling](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/routes/orders.py): `services/order_api/routes/orders.py`
- [Product plans](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/shared/catalog.py): `shared/catalog.py`
- [Order read model](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/db.py): `services/order_api/db.py`
- [Event stream API](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/routes/stream.py): `services/order_api/routes/stream.py`
- [Metrics API](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/order_api/routes/metrics.py): `services/order_api/routes/metrics.py`

### Durable execution

- **Temporal service**
- [Workflow worker](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/worker.py): `services/orchestrator/worker.py`
- [Activation workflow](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/workflows/activation.py): `services/orchestrator/workflows/activation.py`
- [Task activities](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/activities.py): `services/orchestrator/activities.py`
- [Event publisher](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/events.py): `services/orchestrator/events.py`
- **Redis Streams**
- [Read-model projection](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/projector.py): `services/orchestrator/projector.py`
- [State reconciler](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/reconciler.py): `services/orchestrator/reconciler.py`
- [Consistency proofs](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/shared/crypto.py): `shared/crypto.py`
- [Baseline engine](https://github.com/sys-sharedbuilds/agnitia_hackathon/blob/main/services/orchestrator/baseline.py): `services/orchestrator/baseline.py`

### External systems

- **OMS mock**
- **Inventory mock**
- **Network mock**
- **Billing mock**
- **Notification mock**

### Other components

- **Operator**

## Connections

- Operator → Operator console: uses (evidence: `README.md`)
- Operator console → Order views: navigates
- Operator console → Activation view: navigates
- Operator console → Ops and proof views: navigates
- Operator console → Order API: uses API (evidence: `README.md`)
- Activation view → Order API: submits orders
- Order views → Order API: reads orders
- Ops and proof views → Order API: requests ops data
- Order API → Order handling: routes requests (evidence: `services/order_api/main.py`)
- Order handling → Order read model: reads and writes (evidence: `services/order_api/routes/orders.py`)
- Order handling → Product plans: resolves plans (evidence: `services/order_api/routes/orders.py`)
- Order handling → Temporal service: starts workflows
- Order handling → Baseline engine: runs baseline (evidence: `services/order_api/routes/orders.py`)
- Workflow worker → Temporal service: connects worker (evidence: `services/orchestrator/worker.py`)
- Temporal service → Workflow worker: dispatches tasks
- Workflow worker → Activation workflow: registers workflow (evidence: `services/orchestrator/worker.py`)
- Activation workflow → Task activities: schedules activities (evidence: `services/orchestrator/workflows/activation.py`)
- Task activities → OMS mock: calls (evidence: `services/orchestrator/activities.py`)
- Task activities → Inventory mock: calls (evidence: `services/orchestrator/activities.py`)
- Task activities → Network mock: calls (evidence: `services/orchestrator/activities.py`)
- Task activities → Billing mock: calls (evidence: `services/orchestrator/activities.py`)
- Task activities → Notification mock: calls
- Task activities → Event publisher: publishes events (evidence: `services/orchestrator/activities.py`)
- Event publisher → Redis Streams: publishes to
- Event stream API → Redis Streams: streams events
- Read-model projection → Order read model: updates read model
- State reconciler → Order read model: checks state
- Order handling → Consistency proofs: signs certificate (evidence: `services/order_api/routes/orders.py`)
- Metrics API → Order read model: queries metrics (evidence: `services/order_api/routes/metrics.py`)
