Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions DEPLOY.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
# DEPLOY: Deployment Instructions
# Deployment Instructions

The project consists of multiple deployable artifacts:
## Render Deployment

## Server Deployment (Docker)
1. Ensure Docker and docker-compose are installed.
2. Configure `server.properties` or environment variables for database credentials.
3. Run `docker-compose up --build -d` to launch the Game Server, STUN Server, and MySQL database.
Jules Autopilot is primarily deployed to Render using a Go-first architecture.

## Client Deployment
1. Build the client using Gradle: `./gradlew :client:build`
2. Run the client: `./gradlew :client:run`
### Environment Setup
When setting up a new service on Render, configure the following:

## Web Deployment (Hetzner / bobsgameweb)
*(To be expanded as the web port is finalized)*
- Target: 30-player cross-platform multiplayer, leaderboards, and live editing.
- Ensure all WebSocket proxy layers are configured to bridge web traffic to the Netty TCP backend.
1. **Build Command:**
```bash
pnpm install && pnpm run build && cd backend-go && go build -o jules-backend main.go
```
2. **Start Command:**
```bash
cd backend-go && ./jules-backend
```

### Required Environment Variables

Ensure these environment variables are set in your Render dashboard:

- `NODE_VERSION`: `20.20.2` (Required for building Vite SPA)
- `BUN_VERSION`: `1.3.4` (Currently legacy fallback but recommended for consistency)
- `GO_VERSION`: `1.26.0` (Ensure this matches the `go.mod` file)
- `CGO_ENABLED`: `1` (Required by the wazero runtime and SQLite driver)
- `JULES_API_KEY`: Your master API key for orchestration.

### Troubleshooting Deploys

1. **Go Version Mismatches:**
If Render complains about `go.mod requires go >= x.y.z`, ensure that `backend-go/go.mod` specifies exactly the Go version available in Render's environment (currently `1.26.0`), or use `render.yaml` to pin the `go` version explicitly.

2. **Frontend Build Failures:**
The React UI requires Node 20.x to compile correctly. If `pnpm run build` fails, verify that `NODE_VERSION` is explicitly set in Render.

3. **Out of Memory (OOM):**
The frontend build step (`vite build`) can be memory intensive. On Free or Starter tiers, Vite may OOM. If this happens, configure `NODE_OPTIONS=--max-old-space-size=4096`.
62 changes: 53 additions & 9 deletions MEMORY.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,53 @@
# MEMORY: Observations & Design Preferences

- **Architecture:** The project is deeply modular, with distinct `client`, `server`, and `shared` modules.
- **Language:** Migrating towards modern Java 21 features. Strong preference for clean, well-structured, straightforward code.
- **UI/UX:** Every feature must be comprehensively represented in the UI. No hidden functionality. Must have exhaustive tooltips, labels, and documentation.
- **Submodules:** The project aggressively incorporates external open-source projects as git submodules in `libs/` and `references/` to study their features, algorithms, and workflows.
- **Versioning:** A single `VERSION.md` file serves as the universal source of truth for the project version. Every build/session requires a version increment and a corresponding `CHANGELOG.md` entry.
- **AI Collaboration:** Continuous, iterative development through agent handoffs (Gemini -> Claude -> GPT), with strict requirements for updating `HANDOFF.md` and following `UNIVERSAL_LLM_INSTRUCTIONS.md`.
- **Refactoring:** Legacy code (e.g., Swing-based editors) is being actively modernized, ported to JavaFX/Web/C++ (Qt6), and refined for extreme robustness.
# Memory Document: Ongoing Observations & Context

## Project State (v3.5.1)

Jules Autopilot has successfully pivoted to a **Go-first architecture**.
The `server/` directory and backend-only JS dependencies have been removed.

### Core Observations
1. **Architecture:**
- Frontend: Vite SPA (React 19, Tailwind v4).
- Backend: Go runtime (Fiber) serving APIs, WebSockets, and static assets.
- Database: SQLite + GORM.
- Workspaces: PNPM workspaces manage packages like `@jules/shared` and `@jules/cli`.
2. **Deployment Challenges:**
- The Go version in `backend-go/go.mod` must match the build environment exactly (currently pinned to `1.26.0` for Render).
3. **Missing/Incomplete Features (Identified for Implementation):**
- **Git Diff Monitoring:** Background Shadow Pilot anomaly detection is missing native git diff monitoring.
- **CI Pipeline Auto-Fix:** Shadow Pilot has anomaly logging but the CI pipeline auto-fix is incomplete.
- **Submodule Status Check:** Real-time submodule git status checks in the Go backend are not fully wired to the `/system/status` UI.

### Design Preferences
- **No SSR:** The frontend relies exclusively on Client-Side Rendering (SPA mode) to avoid Next.js overhead.
- **Single Source of Truth:** `VERSION.md` is the absolute source of truth for versions, updated via `scripts/update-version.js`.
- **Universal Instructions:** All AI interactions must refer back to `LLM_INSTRUCTIONS.md`.

## Agent Directives
- Always check this file before altering the project's macro structure.
- Prioritize Go runtime stability over Node.js fallback mechanisms.



JULES AGENT LAST 5 MESSAGES:

---

---

---

---


=== Recent Commits ===
3a494a0 fix: update LM Studio model to gemma-4-26b-a4b-it-qat-heretic (actually loaded)
0a950f0 feat: nudge sends instructions+docs+agent msgs+commits, no recovery guidance
03f22a3 feat: recovery prompt structured as instructions+docs+agent msgs+commits+instructions
ea9bfed feat: skip nudge if last message from user, include last 5 agent msgs + docs + commits in recovery
7b3bcf5 chore: register services, change port 8081->8082, add Windows service scripts
a3470e0 chore: add .suno_new_session/ to gitignore
06b74a2 chore: cleanup dirty state
4eb0a03 sec: upgrade axios@^1.12.0, esbuild@latest
4431d37 Merge branch 'feat-shadow-pilot-git-diff-ui-12323440949671972104'
68b0a18 chore: cleanup jules-autopilot dirty state\n\n- Untrack packages/shared/dist/ (built outputs), add to .gitignore\n- Commit security upgrades (package.json, pnpm-lock.yaml)
115 changes: 39 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,57 @@
# EXTREME WIP ALPHA DEVELOPED "IN THE OPEN," DON'T BOTHER TRYING TO USE IT UNLESS YOU PLAN ON HACKING ON IT TO GET IT WORKING
# Jules Autopilot (Go Primary Runtime)

# bob's game
> **The ultra-fast, autonomous command center for Google Jules.**

This repository contains the modernized source code for "Bob's Game" (2012), updated to run on modern Java 21 infrastructure.
Jules Autopilot is a high-performance, minimalist orchestration platform for the Google Jules AI agent. It replaces slow official interfaces with a unified, real-time dashboard, powered by a robust Go backend runtime.

## Architecture
## 🚀 The Stack

The project is split into three Gradle modules:
This project has been pivoted to a Go-first architecture to ensure maximum performance, operational reliability, and zero friction:

- **`:client`**: The game client (LWJGL 3, OpenGL, OpenAL).
- **`:server`**: The backend infrastructure (Game Server, Index Server, STUN Server).
- **`:shared`**: Shared logic, networking packets, and utilities.
- **Backend/Runtime:** [Go](https://go.dev) (High-performance API, WebSocket server, Scheduler, and Static SPA host)
- **Frontend:** [Vite](https://vitejs.dev) + [React 19](https://react.dev) (Pure SPA, no SSR overhead)
- **Database:** [GORM](https://gorm.io) + SQLite (Zero-config local persistence)
- **Queue & Automation:** Native Go task queue and RAG indexer
- **Styling:** [TailwindCSS v4](https://tailwindcss.com)

For a detailed breakdown of the project structure and dependencies, see [STRUCTURE.md](STRUCTURE.md).
## 🛠️ Getting Started

## Prerequisites

- JDK 21
- Docker (optional, for server deployment)

## Building

To build all modules:

```bash
./gradlew build
```

## Running the Client
### Prerequisites
- [Go 1.21+](https://go.dev) installed.
- [Node.js](https://nodejs.org) and [pnpm](https://pnpm.io) for frontend development.

### Installation
```bash
./gradlew :client:run
```

## Running the Editor
# Clone the repository
git clone https://github.com/your-repo/jules-autopilot.git
cd jules-autopilot

To run the legacy Swing-based Level Editor:
# Install frontend dependencies
pnpm install

```bash
./gradlew :client:runEditor
# Build the frontend and shared packages
pnpm run build
```

**New Editor Features:**
- **Select All (Ctrl+A)**: Selects the entire map, sprite, or tileset in the respective editors.
- **Replace Color**: New menu item in "Palette Tools" to swap a color index globally across the tileset.
### Running the Command Center
You can run the entire stack via the Go backend (which serves the built frontend):

## Running the Server
1. **Start the Go Runtime:**
```bash
cd backend-go
go run main.go
```
*The dashboard will be available at `http://localhost:8080`.*

You can run the server locally or via Docker.
2. **Frontend Dev Mode (Optional):**
```bash
pnpm run dev
```

### Local
## 🏗️ Architecture

```bash
./gradlew :server:run
```

### Docker

Build and start the full stack (Game Server, STUN Server, MySQL Database):

```bash
docker-compose up --build
```

Configuration is handled via Environment Variables (see `docker-compose.yml`) or a `server.properties` file in the working directory.

## Features

- **Modern Tech Stack**: Java 21, Gradle 8.5, LWJGL 3, Netty 4, HikariCP.
- **Security**: BCrypt password hashing with automatic legacy migration.
- **Containerization**: Full Docker support.
- **CI/CD**: GitHub Actions workflow included.

## Changelog

### Modernization Phase (Current)
- **Migrated to Gradle**: Multi-module project structure.
- **Updated Java**: Targeted Java 21.
- **Upgraded LWJGL**: Migrated from 2 to 3 (GLFW, OpenAL, STB).
- **Upgraded Netty**: Migrated from 3 to 4.
- **Security**: Added BCrypt password hashing.
- **Infrastructure**: Added Docker and CI/CD support.
- **Editor**: Re-enabled legacy Swing Editor, added 'Select All' and 'Replace Color' features.

## Roadmap

- [x] Modernize Build System (Gradle)
- [x] Upgrade Java to 21
- [x] Migrate Networking to Netty 4
- [x] Migrate Graphics to LWJGL 3
- [x] Re-enable Level Editor
- [ ] Port Editor to LibGDX / Scene2D (Future)
- [ ] Implement remaining TODO items
┌──────────────────────────────────────────┐
│ Browser (Vite SPA) │
│ http://localhost:3006 (Dev) │
│ http://localhost:8080 (Prod)
39 changes: 15 additions & 24 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
# Project Roadmap

## Completed
- [x] **Submodule Updates**: All submodules updated to latest upstream versions.
- [x] **Branch Merging**: Merged `modernize-*` feature branches into `main`.
- [x] **Documentation**: Created Dashboard, Versioning, and LLM Instructions.
- [x] **Structure**: Clarified project directory structure.
- [x] **CI/CD**: Established a robust CI/CD pipeline (GitHub Actions).
- [x] **Project Merging**: Implement feature to merge multiple project files.
- [x] **Build Environment**: Resolve Gradle incompatibility with Java 25 (Standardized on Java 21).
This roadmap outlines the major structural plans and strategic milestones for the Jules Autopilot Orchestrator.
For granular tasks and immediate bug fixes, see `TODO.md`.

## In Progress
- [ ] **Modernization**: Continue refactoring legacy Java code to modern standards.
- [ ] **Testing**: Increase unit test coverage.

## Planned
- [ ] **Game Logic**: Enhance Lua scripting capabilities.
- [ ] **Networking**: Optimize client-server communication.
- [ ] **UI**: Upgrade UI components using TWL.
- [ ] **Performance**: Profile and optimize rendering loop.
- [ ] **Undo System**: Improve undo functionality (prevent wrapping, skip redundant states).

## Backlog
- [ ] Localization support.
- [ ] Cross-platform packaging improvements.
- [ ] Random sprite output.
- [ ] Move map up/down functionality.
## Milestone: v1.0.0 (Current) — "Deep Autonomous Node"
* [x] **Cross-Session Historical Intelligence**: The Autopilot now monitors for COMPLETED sessions, vectorizes the final result, and saves it into the `MemoryChunk` table for dual-layer RAG.
* [x] **Borg Discovery Handshake**: Added `GET /api/manifest` endpoint, broadcasting node capabilities and version for Borg assimilation.
* [x] **Session Replay Engine**: Added `GET /api/sessions/:id/replay` to provide a high-definition timeline of a session's entire history, optimized for Borg.
* [x] **Interactive Session Replay**: Integrated a `SessionReplayDialog` component accessible via a History icon on each session card.
* [x] **Global Fleet Heartbeat**: Added a "Fleet Pulse" section to the sidebar with a real-time active job counter and a pulsing brain icon.
* [x] **Autonomous Self-Healing**: The Autopilot actively monitors for the `FAILED` state, uses the Council Supervisor to analyze the error context, and autonomously messages Jules with a recovery plan.
* [x] **Visual Cognitive Status**: Session cards feature real-time "HEALING" and "EVALUATING" badges.
* [x] **Borg Fleet Summary API**: Implemented `GET /api/fleet/summary` for providing the Borg meta-orchestrator with a high-signal JSON payload of the fleet's state.
* [x] **Autonomous Issue Conversion**: Background daemon fetches open GitHub issues, evaluates if they are "Self-Healable", and autonomously spawns new Jules sessions.
* [x] **Continuous RAG Indexing**: Periodic background job chunks and embeds the repository into SQLite for "Long-Term Memory".
* [x] **Autonomous Multi-Agent Debates**: High-risk implementation plans trigger a background debate between a Security Architect and a Senior Engineer before auto-approval.
* [x] **Queue Telemetry**: A
18 changes: 10 additions & 8 deletions VISION.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# VISION: The Ultimate Omni-Engine
# Vision Document: Jules Task Queue & Autopilot Orchestrator

The ultimate goal of this project is to create the absolute most complete, robust, useful, and functional game engine and editor in existence—an "omni-engine" capable of matching and exceeding the 1:1 functionality of every other major 2D game engine (Defold, LÖVE, Phaser, Construct, GameMaker, RPG Maker).
## 1. Ultimate Goal
To build the most powerful, over-engineered, and scalable autonomous multi-agent operating system for the "Jules" coding assistant ecosystem. Jules Autopilot exists to solve the underlying bottleneck of AI development: strict rate limits and isolated execution loops.

The project aims to synthesize the best features from dozens of specialized sprite editors, tilemap editors, and voxel tools, integrating them into a cohesive, cross-platform, multi-language suite. It encompasses:
1. **A high-performance C++ core** (integrated with Ultimate++).
2. **A modernized Java backend and client** (Java 21, LWJGL 3, Netty 4).
3. **A versatile Web port** capable of 30-player cross-platform multiplayer.
4. **Advanced Generative AI tools** for sprite generation, animation interpolation, and 3D voxel creation.
## 2. Core Philosophy
The core philosophy revolves around three principles:
- **Set It and Forget It:** An engineer should be able to create an infinitely complex, 20-step epic issue on GitHub, label it "Jules", and walk away for 48 hours while the system orchestrates 5 different LLM models to autonomously research, plan, write, test, and deploy the feature.
- **Extreme Telemetry:** Every single token, API request, terminal output string, and AST modification must be deterministically logged, tracked, and attributed to a workspace budget to prevent cost overruns.
- **Agent Symphony:** Hard boundaries between the *Architecural Agent* (Claude, reasoning), the *Execution Agent* (Gemini, speed/large context), and the *Auditor Agent* (GPT-4o, AST verification).

This omni-engine will support seamless game editing, live multiplayer server deployments (e.g., to Hetzner), and global leaderboards.
## 3. Future Horizon (v1.0.0 and beyond)
We envision Jules evolving into a Kubernetes-native swarm capable of spinning up ephemeral Docker WebContainers per agent node. It will feature real-time visual workflow tracing (via native WebSockets) and proactive, background "Shadow Pilot" capabilities where agents silently fix regressions and zero-day vulnerabilities in the codebase before a human even files a ticket.
2 changes: 1 addition & 1 deletion src/main/java/com/bobsgame/puzzle/Grid.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Grid {
public Block[][] blocks;
public int screenX = 0;
public int screenY = 0;

public int lastGarbageHoleX = 0;
public boolean garbageHoleDirectionToggle = true;

Expand Down
Loading