{
  "entry_points": [
    "app/main.py (FastAPI application bootstrap and route registration)",
    "app/proxy.py (HTTP endpoint /v1/chat/completions)",
    "app/reports.py (Dashboard and report generation endpoints)"
  ],
  "data_flow": [
    "External client -> app/proxy.py (receives /v1/chat/completions request)",
    "app/proxy.py -> app/store.py (writes run/request metadata to SQLite)",
    "app/proxy.py -> upstream llama.cpp (forwards LLM request)",
    "upstream llama.cpp -> app/proxy.py -> app/redaction.py (sanitizes response for secrets)",
    "app/redaction.py -> External client (returns sanitized response)",
    "Dashboard client -> app/reports.py -> app/store.py (queries SQLite for aggregation)",
    "app/reports.py -> Dashboard client (returns aggregated stats)"
  ],
  "risks": [
    "app/proxy.py: Unvalidated external input forwarding; risk of prompt injection, upstream abuse, or metadata leakage",
    "app/store.py: Direct SQLite inserts; risk of SQL injection, race conditions, or unbounded database growth without cleanup",
    "app/redaction.py: Security-critical sanitization; risk of regex bypass, incomplete secret removal, or false positives stripping legitimate data",
    "app/main.py: Route exposure; risk of unauthenticated dashboard access, misconfigured CORS, or debug endpoints left enabled",
    "app/reports.py: Heavy aggregation queries; risk of database performance degradation or exposing sensitive patterns through aggregated stats"
  ]
}