Your Name commited on
Commit
65111eb
·
1 Parent(s): 357abae

Fix repository structure: Moved files to root

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. AutoForge/.env.example → .env.example +0 -0
  2. AutoForge/.gitignore → .gitignore +0 -0
  3. AutoForge/GitHub.md +0 -212
  4. AutoForge/backend/agents/__pycache__/__init__.cpython-312.pyc +0 -0
  5. AutoForge/backend/agents/__pycache__/code_agent.cpython-312.pyc +0 -0
  6. AutoForge/backend/agents/__pycache__/diagnosis_agent.cpython-312.pyc +0 -0
  7. AutoForge/backend/agents/__pycache__/planner.cpython-312.pyc +0 -0
  8. AutoForge/backend/agents/__pycache__/repair_agent.cpython-312.pyc +0 -0
  9. AutoForge/backend/agents/__pycache__/task_handlers.cpython-312.pyc +0 -0
  10. AutoForge/backend/agents/__pycache__/test_agent.cpython-312-pytest-9.1.1.pyc +0 -0
  11. AutoForge/backend/agents/__pycache__/test_agent.cpython-312.pyc +0 -0
  12. AutoForge/backend/analysis/__pycache__/__init__.cpython-312.pyc +0 -0
  13. AutoForge/backend/analysis/__pycache__/static_analyzer.cpython-312.pyc +0 -0
  14. AutoForge/backend/api/__pycache__/__init__.cpython-312.pyc +0 -0
  15. AutoForge/backend/api/__pycache__/auth.cpython-312.pyc +0 -0
  16. AutoForge/backend/api/__pycache__/providers.cpython-312.pyc +0 -0
  17. AutoForge/backend/api/__pycache__/schemas.cpython-312.pyc +0 -0
  18. AutoForge/backend/api/__pycache__/settings.cpython-312.pyc +0 -0
  19. AutoForge/backend/api/__pycache__/workflows.cpython-312.pyc +0 -0
  20. AutoForge/backend/core/__pycache__/__init__.cpython-312.pyc +0 -0
  21. AutoForge/backend/core/__pycache__/config.cpython-312.pyc +0 -0
  22. AutoForge/backend/core/__pycache__/dependencies.cpython-312.pyc +0 -0
  23. AutoForge/backend/core/__pycache__/encryption.cpython-312.pyc +0 -0
  24. AutoForge/backend/core/__pycache__/security.cpython-312.pyc +0 -0
  25. AutoForge/backend/db/__pycache__/__init__.cpython-312.pyc +0 -0
  26. AutoForge/backend/db/__pycache__/session.cpython-312.pyc +0 -0
  27. AutoForge/backend/db/models/__pycache__/__init__.cpython-312.pyc +0 -0
  28. AutoForge/backend/events/__pycache__/__init__.cpython-312.pyc +0 -0
  29. AutoForge/backend/events/__pycache__/publisher.cpython-312.pyc +0 -0
  30. AutoForge/backend/execution/__pycache__/__init__.cpython-312.pyc +0 -0
  31. AutoForge/backend/execution/__pycache__/docker_runner.cpython-312.pyc +0 -0
  32. AutoForge/backend/execution/__pycache__/result_parser.cpython-312.pyc +0 -0
  33. AutoForge/backend/execution/__pycache__/sandbox.cpython-312.pyc +0 -0
  34. AutoForge/backend/execution/__pycache__/verification.cpython-312.pyc +0 -0
  35. AutoForge/backend/llm/__pycache__/__init__.cpython-312.pyc +0 -0
  36. AutoForge/backend/llm/__pycache__/base.cpython-312.pyc +0 -0
  37. AutoForge/backend/llm/__pycache__/types.cpython-312.pyc +0 -0
  38. AutoForge/backend/llm/providers/__pycache__/__init__.cpython-312.pyc +0 -0
  39. AutoForge/backend/llm/providers/__pycache__/gemini_provider.cpython-312.pyc +0 -0
  40. AutoForge/backend/llm/providers/__pycache__/mock_provider.cpython-312.pyc +0 -0
  41. AutoForge/backend/llm/providers/__pycache__/openai_provider.cpython-312.pyc +0 -0
  42. AutoForge/backend/memory/__pycache__/__init__.cpython-312.pyc +0 -0
  43. AutoForge/backend/memory/__pycache__/attempt_repository.cpython-312.pyc +0 -0
  44. AutoForge/backend/memory/__pycache__/task_repository.cpython-312.pyc +0 -0
  45. AutoForge/backend/memory/__pycache__/workflow_repository.cpython-312.pyc +0 -0
  46. AutoForge/backend/orchestration/__pycache__/__init__.cpython-312.pyc +0 -0
  47. AutoForge/backend/orchestration/__pycache__/dag_engine.cpython-312.pyc +0 -0
  48. AutoForge/backend/orchestration/__pycache__/dag_schema.cpython-312.pyc +0 -0
  49. AutoForge/backend/orchestration/__pycache__/dag_validator.cpython-312.pyc +0 -0
  50. AutoForge/backend/orchestration/__pycache__/errors.cpython-312.pyc +0 -0
AutoForge/.env.example → .env.example RENAMED
File without changes
AutoForge/.gitignore → .gitignore RENAMED
File without changes
AutoForge/GitHub.md DELETED
@@ -1,212 +0,0 @@
1
- # AutoForge (AgentOS)
2
-
3
- AutoForge is an autonomous DAG-based code generation and verification platform. Users submit natural-language software tasks; the system plans, generates code, tests, analyzes, executes in Docker, verifies, and autonomously repairs failures — with full workflow history persisted in PostgreSQL.
4
-
5
- **Project Status:** Fully implemented MVP (Phases 1-20 completed).
6
-
7
- The system supports the full autonomous loop:
8
- - Frontend React DAG visualization and event streaming
9
- - Gemini 3.1 Pro LLM adapter for planning and code generation
10
- - Docker Sandbox execution and verification
11
- - Automated failure diagnosis and repair
12
- - Full PostgreSQL state persistence and user isolation
13
-
14
- ## Architecture
15
-
16
- ```mermaid
17
- flowchart TB
18
- FE[Frontend] --> API[Backend API]
19
- API --> ORCH[Workflow Orchestrator]
20
- ORCH --> PLANNER[Planner LLM]
21
- ORCH --> MEM[(PostgreSQL)]
22
- PLANNER --> DAG[DAG Engine]
23
- DAG --> CODE[Code Agent]
24
- DAG --> TEST[Test Agent]
25
- DAG --> ANALYSIS[Static Analysis]
26
- CODE --> DOCKER[Docker Sandbox]
27
- TEST --> DOCKER
28
- ANALYSIS --> DOCKER
29
- DOCKER --> VERIFY[Verification]
30
- ```
31
-
32
- Phase 1 implements the **API**, **PostgreSQL memory layer**, **authentication**, **LLM provider abstraction**, and **workflow persistence**.
33
-
34
- ## Repository Structure
35
-
36
- ```text
37
- AgentOS/
38
- ├── backend/ # FastAPI application
39
- │ ├── api/ # HTTP routes (auth, workflows, settings)
40
- │ ├── agents/ # Agent modules (Phase 2+)
41
- │ ├── orchestration/ # DAG engine (Phase 2+)
42
- │ ├── execution/ # Docker sandbox (Phase 2+)
43
- │ ├── analysis/ # Static analysis (Phase 2+)
44
- │ ├── memory/ # Workflow repository
45
- │ ├── llm/ # Provider abstraction
46
- │ ├── db/ # Models and migrations
47
- │ └── events/ # Event publisher
48
- ├── frontend/ # React + Vite web UI (Phase 5)
49
- ├── benchmark/ # Evaluation suite (Phase 5)
50
- ├── docker/ # Dockerfiles
51
- ├── tests/ # Backend tests
52
- ├── docker-compose.yml
53
- └── .env.example
54
- ```
55
-
56
- ## Local Setup
57
-
58
- ### Prerequisites
59
-
60
- - Docker and Docker Compose
61
- - Python 3.12+ (for local development without Docker)
62
-
63
- ### Quick Start (Docker)
64
-
65
- ```bash
66
- cp .env.example .env
67
- docker compose up --build -d
68
- ```
69
-
70
- ### Hugging Face Space Deployment
71
- For deploying AutoForge to a public Hugging Face Space, please refer to the [Hugging Face Deployment Guide](HUGGINGFACE_DEPLOYMENT.md).
72
-
73
- Services:
74
-
75
- | Service | URL |
76
- |-----------|----------------------------|
77
- | Frontend | http://localhost:5173 |
78
- | Backend | http://localhost:8000 |
79
- | API docs | http://localhost:8000/docs |
80
- | PostgreSQL| localhost:5432 |
81
-
82
- Migrations run automatically when the backend container starts.
83
-
84
- ### Local Development (without Docker backend)
85
-
86
- ```bash
87
- # Start PostgreSQL only
88
- docker compose up -d postgres
89
-
90
- # Create virtual environment and install dependencies
91
- python -m venv .venv
92
- source .venv/bin/activate # Windows: .venv\Scripts\activate
93
- pip install -r backend/requirements.txt
94
-
95
- # Copy and configure environment
96
- cp .env.example .env
97
-
98
- # Run migrations
99
- alembic upgrade head
100
-
101
- # Start API server
102
- uvicorn backend.main:app --reload --port 8000
103
- ```
104
-
105
- ### Frontend Development
106
-
107
- ```bash
108
- cd frontend
109
- npm install
110
- npm run dev
111
- ```
112
-
113
- The Vite dev server runs at http://localhost:5173 and proxies `/api` requests to the backend at http://localhost:8000.
114
-
115
- For Docker (backend + frontend + PostgreSQL):
116
-
117
- ```bash
118
- docker compose up --build
119
- ```
120
-
121
- ## Environment Variables
122
-
123
- See [`.env.example`](.env.example). Key variables:
124
-
125
- | Variable | Description |
126
- |----------------|------------------------------------------|
127
- | `DATABASE_URL` | Async PostgreSQL connection string |
128
- | `SECRET_KEY` | JWT signing secret |
129
- | `ENCRYPTION_KEY` | Key material for API credential encryption |
130
- | `MAX_RETRIES` | Max repair attempts (default: 4) |
131
- | `DOCKER_HOST` | Docker socket for sandbox (later phases) |
132
-
133
- Never commit `.env` files with real secrets.
134
-
135
- ## API Endpoints (Phase 1)
136
-
137
- | Method | Endpoint | Description |
138
- |--------|---------------------------------|--------------------------|
139
- | POST | `/auth/signup` | Create account |
140
- | POST | `/auth/login` | Obtain JWT token |
141
- | GET | `/auth/me` | Current user |
142
- | POST | `/workflows` | Create workflow |
143
- | GET | `/workflows` | List user workflows |
144
- | GET | `/workflows/{workflow_id}` | Get workflow details |
145
- | POST | `/workflows/{workflow_id}/start` | Plan, validate, and execute DAG |
146
- | GET | `/workflows/{workflow_id}/tasks` | List workflow tasks |
147
- | GET | `/workflows/{workflow_id}/events` | List workflow events (supports `after_id`) |
148
- | GET | `/workflows/{workflow_id}/events/stream` | SSE live event stream |
149
- | GET | `/workflows/{workflow_id}/attempts` | List repair/execution attempts |
150
- | GET | `/settings/providers` | List LLM providers and models |
151
- | POST | `/settings/api-credentials` | Store encrypted API key |
152
- | GET | `/settings/api-credentials` | List credentials (redacted) |
153
- | DELETE | `/settings/api-credentials/{id}` | Delete credential |
154
- | GET | `/health` | Health + DB connectivity |
155
-
156
- ## Database Schema
157
-
158
- PostgreSQL tables (Phase 1):
159
-
160
- - `users` — authentication
161
- - `workflows` — workflow records with status and planner output
162
- - `tasks` — DAG task nodes (schema ready; populated in Phase 2)
163
- - `attempts` — generation/execution attempts
164
- - `events` — workflow event stream
165
- - `api_credentials` — encrypted user LLM API keys
166
-
167
- ## LLM Provider Abstraction
168
-
169
- Providers implement:
170
-
171
- - `generate()` — text completion
172
- - `generate_structured()` — JSON output
173
- - `estimate_cost()` — token cost estimation
174
-
175
- Currently supported: **OpenAI** and **Gemini**.
176
- The workflow engine resolves providers through `get_llm_provider()` — no provider-specific code in API routes.
177
-
178
- Users can securely enter their own API keys (OpenAI or Gemini) directly in the frontend Settings page. The keys are encrypted at rest in the database and automatically injected into the containerized runner during execution.
179
-
180
- ## Running Tests
181
-
182
- ```bash
183
- # Ensure PostgreSQL is running
184
- docker compose up -d postgres
185
-
186
- # Run migrations (if not already applied)
187
- alembic upgrade head
188
-
189
- # Install dependencies and run tests
190
- pip install -r backend/requirements.txt
191
- pytest -v
192
- ```
193
-
194
- Tests use a real PostgreSQL connection and truncate tables between test cases.
195
-
196
- ## Security Considerations
197
-
198
- - Passwords stored as bcrypt hashes
199
- - API keys encrypted at rest (Fernet-derived key from `ENCRYPTION_KEY`)
200
- - JWT authentication on all workflow endpoints
201
- - Users cannot access other users' workflows
202
- - Generated code execution will run only inside Docker (Phase 2+)
203
-
204
- ## Known Limitations
205
-
206
- - Docker sandbox requires Docker on the host for real code execution
207
- - LLM calls require a valid API key (OpenAI supported)
208
- - Benchmark runner not yet implemented
209
-
210
- ## License
211
-
212
- See LICENSE (to be added).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
AutoForge/backend/agents/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (225 Bytes)
 
AutoForge/backend/agents/__pycache__/code_agent.cpython-312.pyc DELETED
Binary file (4.54 kB)
 
AutoForge/backend/agents/__pycache__/diagnosis_agent.cpython-312.pyc DELETED
Binary file (4.38 kB)
 
AutoForge/backend/agents/__pycache__/planner.cpython-312.pyc DELETED
Binary file (4.19 kB)
 
AutoForge/backend/agents/__pycache__/repair_agent.cpython-312.pyc DELETED
Binary file (4.21 kB)
 
AutoForge/backend/agents/__pycache__/task_handlers.cpython-312.pyc DELETED
Binary file (5.11 kB)
 
AutoForge/backend/agents/__pycache__/test_agent.cpython-312-pytest-9.1.1.pyc DELETED
Binary file (4.63 kB)
 
AutoForge/backend/agents/__pycache__/test_agent.cpython-312.pyc DELETED
Binary file (4.52 kB)
 
AutoForge/backend/analysis/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (227 Bytes)
 
AutoForge/backend/analysis/__pycache__/static_analyzer.cpython-312.pyc DELETED
Binary file (5.47 kB)
 
AutoForge/backend/api/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (160 Bytes)
 
AutoForge/backend/api/__pycache__/auth.cpython-312.pyc DELETED
Binary file (3.09 kB)
 
AutoForge/backend/api/__pycache__/providers.cpython-312.pyc DELETED
Binary file (1.41 kB)
 
AutoForge/backend/api/__pycache__/schemas.cpython-312.pyc DELETED
Binary file (6.76 kB)
 
AutoForge/backend/api/__pycache__/settings.cpython-312.pyc DELETED
Binary file (4.24 kB)
 
AutoForge/backend/api/__pycache__/workflows.cpython-312.pyc DELETED
Binary file (18.8 kB)
 
AutoForge/backend/core/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (161 Bytes)
 
AutoForge/backend/core/__pycache__/config.cpython-312.pyc DELETED
Binary file (2.28 kB)
 
AutoForge/backend/core/__pycache__/dependencies.cpython-312.pyc DELETED
Binary file (2.13 kB)
 
AutoForge/backend/core/__pycache__/encryption.cpython-312.pyc DELETED
Binary file (1.99 kB)
 
AutoForge/backend/core/__pycache__/security.cpython-312.pyc DELETED
Binary file (2.21 kB)
 
AutoForge/backend/db/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (159 Bytes)
 
AutoForge/backend/db/__pycache__/session.cpython-312.pyc DELETED
Binary file (1.3 kB)
 
AutoForge/backend/db/models/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (9.49 kB)
 
AutoForge/backend/events/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (205 Bytes)
 
AutoForge/backend/events/__pycache__/publisher.cpython-312.pyc DELETED
Binary file (1.78 kB)
 
AutoForge/backend/execution/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (237 Bytes)
 
AutoForge/backend/execution/__pycache__/docker_runner.cpython-312.pyc DELETED
Binary file (11.3 kB)
 
AutoForge/backend/execution/__pycache__/result_parser.cpython-312.pyc DELETED
Binary file (2.18 kB)
 
AutoForge/backend/execution/__pycache__/sandbox.cpython-312.pyc DELETED
Binary file (2.33 kB)
 
AutoForge/backend/execution/__pycache__/verification.cpython-312.pyc DELETED
Binary file (3.75 kB)
 
AutoForge/backend/llm/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (160 Bytes)
 
AutoForge/backend/llm/__pycache__/base.cpython-312.pyc DELETED
Binary file (2.57 kB)
 
AutoForge/backend/llm/__pycache__/types.cpython-312.pyc DELETED
Binary file (996 Bytes)
 
AutoForge/backend/llm/providers/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (1.4 kB)
 
AutoForge/backend/llm/providers/__pycache__/gemini_provider.cpython-312.pyc DELETED
Binary file (4.66 kB)
 
AutoForge/backend/llm/providers/__pycache__/mock_provider.cpython-312.pyc DELETED
Binary file (2.41 kB)
 
AutoForge/backend/llm/providers/__pycache__/openai_provider.cpython-312.pyc DELETED
Binary file (4.6 kB)
 
AutoForge/backend/memory/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (163 Bytes)
 
AutoForge/backend/memory/__pycache__/attempt_repository.cpython-312.pyc DELETED
Binary file (4.11 kB)
 
AutoForge/backend/memory/__pycache__/task_repository.cpython-312.pyc DELETED
Binary file (6.21 kB)
 
AutoForge/backend/memory/__pycache__/workflow_repository.cpython-312.pyc DELETED
Binary file (6.08 kB)
 
AutoForge/backend/orchestration/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (265 Bytes)
 
AutoForge/backend/orchestration/__pycache__/dag_engine.cpython-312.pyc DELETED
Binary file (8.61 kB)
 
AutoForge/backend/orchestration/__pycache__/dag_schema.cpython-312.pyc DELETED
Binary file (2.74 kB)
 
AutoForge/backend/orchestration/__pycache__/dag_validator.cpython-312.pyc DELETED
Binary file (4.7 kB)
 
AutoForge/backend/orchestration/__pycache__/errors.cpython-312.pyc DELETED
Binary file (1.3 kB)