GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - anmolsharma152/nimbus: Autonomous coding agent platform: runs tasks in locked-down Docker sandboxes, runs tests and opens pull requests.

BranchesTags
Open more actions menu

Latest commit

 

History

55 Commits
55 Commits

Folders and files

NameName
Last commit message
Last commit date
.firecrawl
.firecrawl
 
 
.github/workflows
.github/workflows
 
 
backend
backend
 
 
docs
docs
 
 
frontend
frontend
 
 
research
research
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
AGENTS.md
AGENTS.md
 
 
ARCHITECTURE_PLAN.md
ARCHITECTURE_PLAN.md
 
 
PROJECT_STATE.md
PROJECT_STATE.md
 
 
README.md
README.md
 
 
SESSION_HANDOFF.md
SESSION_HANDOFF.md
 
 
TASKS.md
TASKS.md
 
 
docker-compose.yml
docker-compose.yml
 
 
railway.json
railway.json
 
 
render.yaml
render.yaml
 
 

Repository files navigation

☁️ Nimbus

Autonomous Cloud Software Engineering Agent Platform

Delegate coding tasks to an isolated, disposable cloud sandbox that inspects repositories, modifies code, runs test suites, captures tested patches, and opens GitHub Pull Requests with live streaming visibility.

Live Demo

Python 3.13+ FastAPI Next.js 16 PostgreSQL Redis Docker 3-Tier LLM Tests

🌐 Live Web App  |  Engineered by Anmol Sharma  |  GitHub  |  Live Portfolio


πŸ›οΈ System Architecture

πŸ” Click to expand: End-to-End Sequence Diagram
sequenceDiagram
    autonumber
    actor Dev as Developer (Browser)
    participant UI as Next.js 16 Web UI
    participant API as FastAPI Control Plane
    participant DB as PostgreSQL (Asyncpg)
    participant Redis as Redis / arq Queue
    participant Worker as arq Background Worker
    participant LLM as Google Gemini 2.5 (Agent Loop)
    participant Sandbox as Docker Sandbox (/workspace/repo)
    participant GitHub as GitHub REST API

    Dev->>UI: Submit Task Prompt + Target Repo URL
    UI->>API: POST /api/tasks
    API->>DB: Insert Task record (status: PENDING)
    API->>Redis: Enqueue run_agent_loop(task_id, prompt, repo_url)
    API-->>UI: Return task_id
    UI->>API: Open WebSocket /ws/tasks/{task_id}
    
    Redis->>Worker: Dequeue task job
    Worker->>DB: Update Task (status: RUNNING)
    Worker->>API: Broadcast status: running
    API-->>UI: Stream status badge: RUNNING
    
    Worker->>Sandbox: Provision ephemeral container & git clone
    Worker->>Sandbox: git checkout -b nimbus/task-<task_id>
    
    loop Agent Execution Loop (up to 20 turns)
        Worker->>LLM: Send Task Goal + Working Dir Context
        LLM-->>Worker: JSON Tool Command (e.g. bash command)
        Worker->>API: Broadcast command event
        API-->>UI: Stream $ command to Terminal
        Worker->>Sandbox: Execute command in background thread
        Sandbox-->>Worker: Exit code + stdout / stderr
        Worker->>API: Broadcast result event
        API-->>UI: Stream terminal output & test results
    end
    
    Worker->>Sandbox: git add -N . && git diff HEAD
    Sandbox-->>Worker: Capture patch_diff
    Worker->>Sandbox: Commit changes & git push branch
    Worker->>GitHub: POST /repos/{owner}/{repo}/pulls (Draft PR)
    GitHub-->>Worker: Return PR URL
    Worker->>DB: Save patch_diff, pr_url, status: COMPLETED
    Worker->>API: Broadcast status: completed + PR link
    API-->>UI: Render "View Draft PR" Button & Patch Diff Viewer
Loading

πŸ”’ Trust Boundaries & Security Isolation

πŸ” Click to expand: Security & Trust Boundary Architecture
graph TD
    subgraph Trusted Zone ["πŸ”’ Trusted Control Plane (Host / Cloud Cluster)"]
        UI["Web Frontend\n(Next.js 16 App Router)"]
        API["FastAPI Gateway\n(REST & WebSockets)"]
        DB[("PostgreSQL 16\n(Tasks & Append-Only Events)")]
        Redis[("Redis 7\n(arq Queue + Pub/Sub)")]
        Worker["arq Background Worker\n(Non-blocking Async Loop)"]
        Secrets["Secret Vault\n(GEMINI_API_KEY, GITHUB_TOKEN)"]
        LLM["Google Gemini 2.5\n(Structured Reasoning)"]
    end

    subgraph Untrusted Zone ["⚠️ Untrusted Ephemeral Sandbox (Docker / microVM)"]
        Container["Disposable Container Sandbox\nβ€’ Memory Cap: 1 GB\nβ€’ CPU Limit: 2.0 Cores\nβ€’ PIDs Limit: 256\nβ€’ Cap Drop: ALL\nβ€’ No New Privileges\nβ€’ Timeout: 300s"]
        Repo["/workspace/repo\nCloned Repository Code"]
        Tools["Sandboxed Toolchain\n(git, python3, build-essential)"]
    end

    UI <-->|HTTPS / WSS| API
    API <--> DB
    API <--> Redis
    Redis <--> Worker
    Worker <--> DB
    Worker --- Secrets
    Worker <-->|REST API| LLM
    Worker -->|Async Threadpool / isolated pipe| Container
    Container --- Repo
    Container --- Tools
    Worker -->|Transient Auth Header| GitHub["GitHub API\n(Draft Pull Request)"]
Loading

⚑ Task State Machine

πŸ” Click to expand: Task Lifecycle State Machine
stateDiagram-v2
    [*] --> PENDING: User delegates task via UI / API
    PENDING --> RUNNING: Worker dequeues from Redis
    
    state RUNNING {
        [*] --> WorkspaceInit: Provision Ephemeral Docker Container
        WorkspaceInit --> GitClone: Clone repo & create branch nimbus/task-<id>
        GitClone --> ReasoningLoop: Initialize Gemini 2.5 Agent
        
        state ReasoningLoop {
            PlanAction --> EmittingCommand: Generate structured JSON
            EmittingCommand --> ExecutingInSandbox: Run command inside container
            ExecutingInSandbox --> EvaluatingFeedback: Inspect stdout/stderr & test exit code
            EvaluatingFeedback --> PlanAction: Refine fix & repeat
        }
        
        ReasoningLoop --> DiffExtraction: Agent signals completion
        DiffExtraction --> CommitAndPush: Commit changes & push branch
        CommitAndPush --> OpenDraftPR: Create GitHub Draft PR
    }

    RUNNING --> COMPLETED: Success (Patch captured & PR opened)
    RUNNING --> FAILED: Agent exception / syntax failure
    PENDING --> CANCELLED: User cancels task
    RUNNING --> CANCELLED: User cancels task
    
    COMPLETED --> [*]
    FAILED --> [*]
    CANCELLED --> [*]
Loading

πŸ’» Web UI & Live Terminal Experience

The Next.js 16 frontend provides a modern glassmorphic split-pane dashboard:

+---------------------------------------------------------------------------------------+
|  <- Back   Task #42   🌱 nimbus/task-42              [πŸš€ View Draft PR] [🟒 COMPLETED] |
+-------------------------------------------+-------------------------------------------+
| 🎯 USER GOAL                              | πŸ–₯️ AGENT EXECUTION TERMINAL               |
|                                           |                                           |
| "Fix authentication middleware bug and    | 10:40:12 Agent initialized workspace      |
| add unit tests for token verification"    | 10:40:14 $ git status                     |
|                                           | 10:40:15 On branch nimbus/task-42         |
| πŸ“ REPOSITORY                             | 10:40:18 $ pytest tests/test_auth.py      |
| https://github.com/org/repo               | 10:40:20 [Exit code: 1] 1 test failed     |
|                                           | 10:40:24 $ python3 fix_auth.py            |
| πŸ“ GENERATED PATCH DIFF        [Collapse] | 10:40:27 $ pytest tests/test_auth.py      |
| +---------------------------------------+ | 10:40:30 [Exit code: 0] 5 passed in 0.4s  |
| | diff --git a/auth.py b/auth.py        | | 10:40:32 Agent finished: Verified fix!    |
| | + if not token: raise AuthError()     | | 10:40:35 Draft PR opened successfully!  |
| | - if token == None: pass              | |                                         |
| +---------------------------------------+ |                                           |
+-------------------------------------------+-------------------------------------------+

🌟 Key Features

  • ⚑ 100% Non-Blocking Asynchronous Core:
    • FastAPI with asyncpg connection pooling (pool_size=20, max_overflow=10, pool_pre_ping=True).
    • Asynchronous LLM reasoning using Google GenAI's native async client (client.aio.chats).
    • Asynchronous Docker container execution wrappers (asyncio.to_thread) preventing I/O starvation.
  • πŸ›‘οΈ Zero-Trust Workspace Isolation:
    • Ephemeral Docker sandbox per task with hard resource limits (1 GB RAM, 2.0 CPUs, PID cap 256, dropped capabilities, and strict execution timeouts).
    • Secrets are kept outside the sandboxβ€”GitHub authentication is injected via transient basic headers without writing credentials into .git/config.
  • πŸ”„ Append-Only Event Sourcing & Instant Replay:
    • Every log, bash command, terminal output, and status change is persisted in PostgreSQL as a durable TaskEvent.
    • Interrupted browser sessions reconnect to /ws/tasks/{id} and instantly receive full historical playback.
  • πŸ›‘ Real-Time Task Cancellation:
    • POST /api/tasks/{task_id}/cancel endpoint instantly signals running workers and cleans up Docker resources.
  • πŸš€ Automated GitHub Draft PRs:
    • Automatically provisions feature branches (nimbus/task-<task_id>), commits changes, pushes to remote, and creates Draft Pull Requests with patch diff previews.

πŸ“ Repository Layout

Nimbus/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ alembic/              # Database migration scripts & environment
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ db.py             # SQLAlchemy 2.0 async engine & connection pool setup
β”‚   β”‚   β”œβ”€β”€ github_client.py  # GitHub REST API client for Draft PRs & branch pushes
β”‚   β”‚   β”œβ”€β”€ main.py           # FastAPI control plane, REST routes & WebSocket gateway
β”‚   β”‚   β”œβ”€β”€ models.py         # SQLAlchemy relational models (Task, TaskEvent)
β”‚   β”‚   β”œβ”€β”€ settings.py       # Pydantic configuration & env variable schema
β”‚   β”‚   β”œβ”€β”€ worker.py         # arq background worker & async Gemini agent loop
β”‚   β”‚   └── workspace.py      # Ephemeral Docker workspace sandbox adapter
β”‚   β”œβ”€β”€ evals/                # Benchmark runner & automated eval suite
β”‚   β”œβ”€β”€ tests/                # 17 comprehensive unit & integration tests
β”‚   β”œβ”€β”€ Dockerfile.workspace  # Pre-built sandbox workspace container definition
β”‚   └── pyproject.toml        # uv package manager configuration
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/app/
β”‚   β”‚   β”œβ”€β”€ layout.tsx        # App layout with Geist typography & metadata
β”‚   β”‚   β”œβ”€β”€ page.tsx          # Task submission dashboard (prompt + repo URL)
β”‚   β”‚   └── tasks/[id]/       # Real-time streaming terminal & patch diff inspector
β”‚   └── package.json          # Next.js 16 + React 19 + TypeScript config
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ architecture.md       # Full architecture specification & sequence diagrams
β”‚   β”œβ”€β”€ roadmap.md            # Multi-phase milestone delivery roadmap
β”‚   └── security.md           # Security model & container trust boundaries
β”œβ”€β”€ TASKS.md                  # Project task tracker & milestone checklist
β”œβ”€β”€ PROJECT_STATE.md          # Up-to-date development status & technical audit
β”œβ”€β”€ docker-compose.yml        # Local multi-service infrastructure setup
└── .env.example              # Environment variables template

πŸš€ Quickstart & Setup

1. Prerequisites

  • Python 3.13+ with uv installed.
  • Node.js 18+ & npm.
  • Docker running locally.
  • PostgreSQL 16 & Redis 7 (or via Docker Compose).

2. Environment Configuration

cp .env.example .env

Ensure .env contains:

DATABASE_URL=postgresql+asyncpg://nimbus_user:nimbus_password@localhost:5432/nimbus_db
REDIS_URL=redis://localhost:6379/0
GEMINI_API_KEY=your_google_gemini_api_key
GITHUB_TOKEN=your_github_token_for_prs  # Optional

3. Backend Setup

cd backend

# Run database migrations
uv run alembic upgrade head

# Start FastAPI control plane (Terminal 1)
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

# Start arq background worker (Terminal 2)
uv run arq app.worker.WorkerSettings

4. Frontend Setup

cd frontend

# Install dependencies
npm install

# Start Next.js development server (Terminal 3)
npm run dev

Open http://localhost:3000 to submit tasks and inspect live streaming execution!


πŸ§ͺ Testing & Evals Benchmark

Running Backend Unit & Integration Tests

cd backend
uv run pytest
============================== test session starts ==============================
collected 46 items

tests/test_api.py ........                                               [ 17%]
tests/test_auth.py ........                                              [ 34%]
tests/test_browser.py ...                                                [ 41%]
tests/test_credentials.py .....                                          [ 52%]
tests/test_evals.py ..                                                   [ 56%]
tests/test_github_client.py ...                                          [ 63%]
tests/test_llm.py ....                                                   [ 71%]
tests/test_scaling.py ....                                               [ 80%]
tests/test_worker.py ....                                                [ 89%]
tests/test_workspace.py .....                                            [100%]

============================== 46 passed in 7.43s ==============================

Running Autonomous Agent Evaluation Benchmark

cd backend
uv run python evals/eval_runner.py

πŸ—ΊοΈ Multi-Phase Roadmap Status

Phase Milestone Status Key Deliverables
Phase 0 Foundation & Durable State βœ… Completed FastAPI, Postgres asyncpg, Alembic migrations, Redis arq queue, WebSocket gateway
Phase 1 Safe Single-Agent Execution βœ… Completed Isolated Docker sandbox, async Gemini loop, git diff extraction, Next.js UI
Phase 2 Multi-Tenant GitHub Workflow βœ… Completed Ephemeral token injection, branch isolation (nimbus/task-<id>), automated Draft PRs
Phase 3 Product-Grade Scalability πŸ”„ In Progress Distributed Redis Pub/Sub, session reconnect replay, MicroVM provider interface
Phase 4 Browser Automation & Cloud Deploy πŸ“‹ Planned Playwright visual verification, screenshot artifacts, production multi-cloud deploy

πŸ“„ License & Attribution

Developed with ❀️ by Anmol Sharma. Released under the MIT License.

About

Autonomous coding agent platform: runs tasks in locked-down Docker sandboxes, runs tests and opens pull requests.

Topics

agentic-aiai-agentautonomous-agentscloud-agentcode-generationdevindockerfastapigeminillmnextjssoftware-engineering

Resources

Readme

Security policy

Security policy
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.