# omarxhero/tasdiq architecture

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

- Interactive diagram: https://gitdiagram.com/omarxhero/tasdiq
- Repository: https://github.com/omarxhero/tasdiq

## Overview

Tasdiq is a telecom-verified fraud decision service for instant payments. A bank submits a transaction to the API; the decision engine verifies the bank policy, gathers CAMARA signals in progressive phases, combines them with behavioral risk, and returns an approve/escalate/decline result with step-up constraints. The API also records decisions and invokes an inline tripwire; separate async endpoints support explanations, bilingual reports, and cluster investigations. The graph reflects documented calls and README-described capabilities; some async wiring and external integrations are documented but not fully shown in the excerpts.

Main entry points: [`app/main.py`](https://github.com/omarxhero/tasdiq/blob/master/app/main.py) (Decision API), [`app/engine/decide.py`](https://github.com/omarxhero/tasdiq/blob/master/app/engine/decide.py) (Progressive engine), [`app/ai/tools.py`](https://github.com/omarxhero/tasdiq/blob/master/app/ai/tools.py) (Sealed tool belt), [`app/signals/nac.py`](https://github.com/omarxhero/tasdiq/blob/master/app/signals/nac.py) (CAMARA client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rail["Decision rail"]
  node_api["Decision API<br/>[main.py]"]
  node_engine["Progressive engine<br/>[decide.py]"]
  node_weighting["Risk scoring<br/>[weighting.py]"]
  node_signals["CAMARA client<br/>[nac.py]"]
  node_config["Runtime config<br/>[config.py]"]
end

subgraph group_controls["Policy and audit"]
  node_policy["Signed policies<br/>[policy.py]"]
  node_ledger[("Dual audit ledger<br/>[ledger.py]")]
  node_tripwire["Cluster tripwire<br/>[tripwire.py]"]
end

subgraph group_investigation["AI investigation"]
  node_agent["Async AI agent<br/>[agent.py]"]
  node_tools["Sealed tool belt<br/>[tools.py]"]
  node_vault[("PII vault<br/>[tools.py]")]
end

subgraph group_integrations["External services"]
  node_nokia{{"Nokia NaC"}}
  node_model{{"Guide-listed model"}}
  node_tsa{{"Timestamp authority"}}
end

node_bank(("Bank client"))

node_bank -->|"submits transaction"| node_api
node_api -->|"calls decision"| node_engine
node_engine -->|"verifies bundle"| node_policy
node_engine -->|"fetches signals"| node_signals
node_engine -->|"evaluates signals"| node_weighting
node_engine -->|"returns decision"| node_api
node_api -->|"returns outcome"| node_bank
node_signals -->|"queries CAMARA"| node_nokia
node_signals -->|"reads settings"| node_config
node_api -->|"appends decision"| node_ledger
node_api -->|"records declines"| node_tripwire
node_api -->|"runs async tasks"| node_agent
node_api -->|"appends agent record"| node_ledger
node_agent -->|"requests probes"| node_tools
node_tools -->|"resolves identifiers"| node_vault
node_tools -->|"re-queries CAMARA"| node_signals
node_tools -->|"logs investigation"| node_ledger
node_agent -->|"generates drafts"| node_model
node_ledger -->|"anchors chain"| node_tsa
node_tripwire -.->|"prompts investigation"| node_agent

click node_api "https://github.com/omarxhero/tasdiq/blob/master/app/main.py"
click node_engine "https://github.com/omarxhero/tasdiq/blob/master/app/engine/decide.py"
click node_weighting "https://github.com/omarxhero/tasdiq/blob/master/app/engine/weighting.py"
click node_signals "https://github.com/omarxhero/tasdiq/blob/master/app/signals/nac.py"
click node_config "https://github.com/omarxhero/tasdiq/blob/master/app/config.py"
click node_policy "https://github.com/omarxhero/tasdiq/blob/master/app/policy.py"
click node_ledger "https://github.com/omarxhero/tasdiq/blob/master/app/ledger.py"
click node_tripwire "https://github.com/omarxhero/tasdiq/blob/master/app/tripwire.py"
click node_agent "https://github.com/omarxhero/tasdiq/blob/master/app/ai/agent.py"
click node_tools "https://github.com/omarxhero/tasdiq/blob/master/app/ai/tools.py"
click node_vault "https://github.com/omarxhero/tasdiq/blob/master/app/ai/tools.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_api,node_engine,node_weighting,node_signals,node_config,node_bank toneBlue
class node_policy,node_ledger,node_tripwire toneAmber
class node_agent,node_tools,node_vault toneMint
class node_nokia,node_model,node_tsa toneRose
```

## Components

### Decision rail

- [Decision API](https://github.com/omarxhero/tasdiq/blob/master/app/main.py): `app/main.py`
- [Progressive engine](https://github.com/omarxhero/tasdiq/blob/master/app/engine/decide.py): `app/engine/decide.py`
- [Risk scoring](https://github.com/omarxhero/tasdiq/blob/master/app/engine/weighting.py): `app/engine/weighting.py`
- [CAMARA client](https://github.com/omarxhero/tasdiq/blob/master/app/signals/nac.py): `app/signals/nac.py`
- [Runtime config](https://github.com/omarxhero/tasdiq/blob/master/app/config.py): `app/config.py`

### Policy and audit

- [Signed policies](https://github.com/omarxhero/tasdiq/blob/master/app/policy.py): `app/policy.py`
- [Dual audit ledger](https://github.com/omarxhero/tasdiq/blob/master/app/ledger.py): `app/ledger.py`
- [Cluster tripwire](https://github.com/omarxhero/tasdiq/blob/master/app/tripwire.py): `app/tripwire.py`

### AI investigation

- [Async AI agent](https://github.com/omarxhero/tasdiq/blob/master/app/ai/agent.py): `app/ai/agent.py`
- [Sealed tool belt](https://github.com/omarxhero/tasdiq/blob/master/app/ai/tools.py): `app/ai/tools.py`
- [PII vault](https://github.com/omarxhero/tasdiq/blob/master/app/ai/tools.py): `app/ai/tools.py`

### External services

- **Nokia NaC**
- **Guide-listed model**
- **Timestamp authority**

### Other components

- **Bank client**

## Connections

- Bank client → Decision API: submits transaction (evidence: `README.md`)
- Decision API → Progressive engine: calls decision (evidence: `app/main.py`)
- Progressive engine → Signed policies: verifies bundle (evidence: `app/engine/decide.py`)
- Progressive engine → CAMARA client: fetches signals (evidence: `app/engine/decide.py`)
- Progressive engine → Risk scoring: evaluates signals (evidence: `app/engine/decide.py`)
- Progressive engine → Decision API: returns decision (evidence: `app/engine/decide.py`)
- Decision API → Bank client: returns outcome (evidence: `README.md`)
- CAMARA client → Nokia NaC: queries CAMARA (evidence: `README.md`)
- CAMARA client → Runtime config: reads settings (evidence: `app/signals/nac.py`)
- Decision API → Dual audit ledger: appends decision (evidence: `app/main.py`)
- Decision API → Cluster tripwire: records declines (evidence: `app/main.py`)
- Decision API → Async AI agent: runs async tasks (evidence: `app/main.py`)
- Decision API → Dual audit ledger: appends agent record (evidence: `app/main.py`)
- Async AI agent → Sealed tool belt: requests probes (evidence: `app/ai/agent.py`)
- Sealed tool belt → PII vault: resolves identifiers (evidence: `app/ai/tools.py`)
- Sealed tool belt → CAMARA client: re-queries CAMARA (evidence: `app/ai/tools.py`)
- Sealed tool belt → Dual audit ledger: logs investigation (evidence: `app/ai/tools.py`)
- Async AI agent → Guide-listed model: generates drafts (evidence: `README.md`)
- Dual audit ledger → Timestamp authority: anchors chain (evidence: `README.md`)
- Cluster tripwire → Async AI agent: prompts investigation (evidence: `README.md`)
