{
  "repo": "tidbcloud/aiops",
  "binary": "investibook-backend",
  "binary_path": "platform/investibook/backend/main.py",
  "dependencies": {
    "InvestibookBackendLifecycle.StartupLifespan": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Workspace, template, runtime config, and screenshot directories must exist or be creatable"
          ],
          "operations": [
            {
              "operation": "PREPARE LOCAL RUNTIME STATE",
              "trigger": "Initialize directories, migrate local DB state, and seed templates before serving requests",
              "conditions": [
                "FastAPI lifespan startup runs"
              ],
              "implementation": "lifespan -> mkdir(...) + _db_init + _db_migrate_messages_v1_to_v2 + _seed_templates"
            }
          ]
        }
      },
      "services": []
    },
    "InvestibookBackendLifecycle.ShutdownLifespan": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /health": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /api/chat": {
      "infrastructure": {},
      "services": [
        {
          "name": "acp-agent-subprocess",
          "target_interface": "ACP JSON-RPC session",
          "operation_type": "subprocess",
          "conditions": [
            "A chat request starts or reuses an ACP session"
          ],
          "operations": [
            {
              "operation": "RUN ACP CHAT SESSION",
              "trigger": "Handle chat through an ACP-compatible coding agent subprocess",
              "conditions": [
                "chat endpoint is invoked"
              ],
              "implementation": "backend API -> ACP client/session -> agent subprocess stdin/stdout"
            }
          ]
        }
      ]
    },
    "HTTP GET /api/chat/stream": {
      "infrastructure": {},
      "services": [
        {
          "name": "acp-agent-subprocess",
          "target_interface": "ACP JSON-RPC session",
          "operation_type": "subprocess",
          "conditions": [
            "A streaming chat request starts or reuses an ACP session"
          ],
          "operations": [
            {
              "operation": "STREAM ACP EVENTS",
              "trigger": "Forward ACP session updates over SSE",
              "conditions": [
                "stream endpoint is invoked"
              ],
              "implementation": "backend API -> ACP client/session -> asyncio queue -> SSE stream"
            }
          ]
        }
      ]
    },
    "HTTP GET /api/session/new": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /api/session/{id}/history": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Session state is persisted locally"
          ],
          "operations": [
            {
              "operation": "READ SESSION STATE",
              "trigger": "Load stored session history",
              "conditions": [
                "history endpoint is invoked"
              ],
              "implementation": "session history handler -> local DB/filesystem backed query"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP DELETE /api/session/{id}": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Session state exists locally"
          ],
          "operations": [
            {
              "operation": "DELETE SESSION STATE",
              "trigger": "Remove stored session state",
              "conditions": [
                "delete session endpoint is invoked"
              ],
              "implementation": "session delete handler -> local DB/filesystem mutation"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP GET /screenshots/*": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Requested screenshot file exists under the aiops diagnostic data directory"
          ],
          "operations": [
            {
              "operation": "READ STATIC DIAGNOSTIC ASSET",
              "trigger": "Serve a screenshot from the mounted screenshots directory",
              "conditions": [
                "path exists"
              ],
              "implementation": "FastAPI StaticFiles mount on /screenshots"
            }
          ]
        }
      },
      "services": []
    },
    "HTTP GET /workspace-screenshots/*": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Requested file exists under workspace screenshot storage"
          ],
          "operations": [
            {
              "operation": "READ WORKSPACE SCREENSHOT ASSET",
              "trigger": "Serve a screenshot from the workspace screenshot directory",
              "conditions": [
                "path exists"
              ],
              "implementation": "FastAPI StaticFiles mount on /workspace-screenshots"
            }
          ]
        }
      },
      "services": []
    }
  }
}
