How logeshn554/loopix__ works
Purpose and Entry Points
DevPilot is a local AI-native developer IDE: a React UI drives a Python API that analyzes workspaces, invokes LLM-backed agents, safely edits code, executes tools, and verifies results. Primary startup surfaces are backend/app/main.py (ASGI application), frontend/src/main.tsx (Vite React client), and electron/main.js (desktop shell). Backend is normally served by Uvicorn; Electron can package/embed the web experience.
Client, Desktop, and API Boundary
The frontend is a stateful IDE rather than a thin chat page. frontend/src/App.tsx composes editor, workspace, terminal, git, task, and agent panels; frontend/src/api.ts is its backend boundary. Context providers isolate UI domains, notably frontend/src/core/ai/AIContext.tsx, frontend/src/core/workspace/WorkspaceContext.tsx, and frontend/src/core/editor/EditorContext.tsx. Electron’s main/preload pair, electron/main.js and electron/preload.js, provides desktop integration while retaining the frontend/backend split.
HTTP Gateway and Platform Services
backend/app/main.py mounts the application’s route layer, with chat/agent execution centered in backend/app/routes/chat.py and backend/app/routes/agents.py; workspace and filesystem operations are exposed through backend/app/routes/workspace.py and backend/app/routes/files.py. Gateway controls—authentication, sessions, streaming, rate limiting, and circuit breaking—are separated in backend/app/gateway/auth.py, backend/app/gateway/session_manager.py, and backend/app/gateway/streaming.py. This is the principal boundary between untrusted client requests and execution services.
Agent Orchestration and Planning
The core agent layer converts an intent into planned, stateful execution. backend/app/orchestrator.py, backend/app/agent/planning_engine.py, and backend/app/agent/workflow_engine.py coordinate task progression. The more structured Agent OS supports agent construction, DAG execution, checkpoints, tool policy, verification, and worktrees in backend/app/agent/agent_os/agent/agent_factory.py, backend/app/agent/agent_os/agent/dag_executor.py, and backend/app/agent/agent_os/agent/state_machine.py. Parallel task decomposition/supervision exists independently under backend/app/agent/parallel_agent_system/graph/supervisor.py and backend/app/agent/parallel_agent_system/graph/nodes/decompose.py.
Context, Code Intelligence, and Memory
Before action, the system builds codebase-aware context through indexing, symbol/dependency analysis, search/ranking, and security filtering: backend/app/agent/context_engine/context_engine.py, backend/app/agent/context_engine/symbol_index.py, and backend/app/agent/context_engine/dependency_graph.py. Long-lived semantic and operational memory is modeled separately in backend/app/brain/knowledge_graph.py, backend/app/brain/decision_memory.py, and backend/app/agent/knowledge_store.py. These components feed planning and prompts but should remain distinct from direct workspace mutation.
LLM, Tools, and Execution Boundary
Provider abstraction and routing isolate model vendors from orchestration: backend/app/adapters/router.py, backend/app/adapters/llm.py, and backend/app/agent/agent_os/providers/model_router.py. Agent-selected actions pass through registered filesystem, Git, terminal, search, and web tools (backend/app/tools/dispatcher.py, backend/app/tools/terminal_tool.py, backend/app/tools/file_tools.py). Execution should be mediated by policy/sandbox layers rather than model output; alternate runtime mechanics live in backend/app/agent/agent_runtime/runtime.py and backend/app/agent/agent_os/execution/sandbox.py.
Safety, Transactionality, and Delivery
Security is enforced outside the LLM via permissions, workspace guards, prompt-injection protection, secret redaction, and terminal isolation: backend/app/agent/security/permission_engine.py, backend/app/agent/security/workspace_guard.py, and backend/app/agent/security/prompt_injection_guard.py. Changes are protected by transactional files/worktrees and merge/rollback mechanisms in backend/app/transactional_fs.py, backend/app/merge/file_transaction.py, and backend/app/agent/agent_os/agent/git_worktree_manager.py. Final gates run tests, lint/type/security checks via backend/app/verification/test_runner.py, backend/app/verification/type_checker.py, and backend/app/outcome/release_gate.py.
Infrastructure and External Integrations
Persistence includes SQLAlchemy/Alembic-oriented database infrastructure in backend/app/infrastructure/database/connection.py and migrations, plus agent/workflow stores under backend/app/agent/agent_os/infrastructure/. Observability and asynchronous work are represented by backend/app/infrastructure/observability/telemetry.py, backend/app/infrastructure/queue.py, and backend/app/infrastructure/worker.py. External boundaries include LLM providers, Open VSX/VSIX extension hosting (backend/app/extension_host.py), Git, terminal subprocesses, browser/web tools, and ChromaDB-style vector retrieval described by the context/RAG layer.
Main entry points: planning_engine.py Planning & workflows · dag_executor.py Structured Agent OS · orchestrator.py Intent orchestration · App.tsx IDE workspace UI
Components 22
Client & Desktop
- Electron shell
electron/main.js - Desktop bridge
electron/preload.js - IDE workspace UI · Composes editor, workspace, terminal, Git, task, and agent panels.
frontend/src/App.tsx - UI domain state
frontend/src/core/ai/AIContext.tsx - Backend API client
frontend/src/api.ts
API Gateway
- ASGI application
backend/app/main.py - Chat, agent & workspace routes · Exposes agent execution and workspace/filesystem operations.
backend/app/routes/chat.py - Request controls · Applies authentication, sessions, streaming, rate limits, and circuit breaking.
backend/app/gateway/auth.py
Agent Execution
- Intent orchestration
backend/app/orchestrator.py - Planning & workflows
backend/app/agent/planning_engine.py - Structured Agent OS · Constructs agents and runs checkpointed DAG execution.
backend/app/agent/agent_os/agent/dag_executor.py - Parallel supervision
backend/app/agent/parallel_agent_system/graph/supervisor.py
Context & Memory
- Code context engine · Builds ranked codebase context with symbol and dependency intelligence.
backend/app/agent/context_engine/context_engine.py - Knowledge & decisions
backend/app/brain/knowledge_graph.py
Safe Delivery
- Sandboxed runtime
backend/app/agent/agent_os/execution/sandbox.py - Permission & workspace guards · Enforces permissions, workspace restrictions, and prompt-injection defenses.
backend/app/agent/security/permission_engine.py - Transactional changes · Supports isolated edits, merge, and rollback.
backend/app/transactional_fs.py - Verification & release gate · Runs tests, type/lint/security checks before delivery.
backend/app/verification/test_runner.py
Platform Services
- Model routing
backend/app/adapters/router.py - Tool dispatcher · Dispatches filesystem, Git, terminal, search, and web actions.
backend/app/tools/dispatcher.py - Database & workflow stores
backend/app/infrastructure/database/connection.py - Telemetry & workers · Provides observability and queued background work.
backend/app/infrastructure/queue.py
Connections 22
- Electron shell → Desktop bridge: loads bridge
- Electron shell → IDE workspace UI: hosts
- IDE workspace UI → UI domain state: uses
- IDE workspace UI → Backend API client: calls through
- Backend API client → ASGI application: HTTP/streaming
- ASGI application → Chat, agent & workspace routes: mounts
- Chat, agent & workspace routes → Request controls: protected by
- Request controls → Intent orchestration: authorized requests
- Intent orchestration → Planning & workflows: plans work
- Planning & workflows → Structured Agent OS: runs structured tasks
- Planning & workflows → Parallel supervision: delegates parallel work
- Planning & workflows → Code context engine: retrieves code context
- Planning & workflows → Knowledge & decisions: reads/writes memory
- Structured Agent OS → Model routing: requests models
- Structured Agent OS → Tool dispatcher: selects actions
- Tool dispatcher → Permission & workspace guards: policy check
- Permission & workspace guards → Sandboxed runtime: permits isolated execution
- Sandboxed runtime → Transactional changes: applies guarded changes
- Transactional changes → Verification & release gate: submits changes
- Verification & release gate → Intent orchestration: results and retry signal
- Structured Agent OS → Database & workflow stores: stores state/checkpoints
- Intent orchestration → Telemetry & workers: emits jobs and telemetry