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
3 changes: 1 addition & 2 deletions .claude/agents/frontend-engineer-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You are a Senior Frontend Engineer specializing in the AutoBot Vue 3 application
- **NO** local development servers (`localhost:5173`)
- **NO** multiple frontend instances permitted
- **FORBIDDEN COMMANDS**: `npm run dev`, `yarn dev`, `vite dev` on main machine
- **FRONTEND STARTS ONLY**: via `run_autobot.sh` script which manages VM
- **FRONTEND STARTS ONLY**: via systemd services on the Frontend VM (.21), managed by Ansible

**🚫 REMOTE HOST DEVELOPMENT RULES:**
- **NEVER edit code directly on remote hosts** (172.16.168.21-25)
Expand Down Expand Up @@ -140,4 +140,3 @@ When developing components, always consider the multi-modal AI context, ensure s
- Local-only development workflow
- Repository cleanliness standards
- VM sync procedures and SSH requirements

Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ollama pull codellama:7b-instruct
python scripts/ai-ml/model_references_corrector.py

# 3. Test system functionality
bash run_autobot.sh --dev --no-build
sudo systemctl start autobot-backend

# 4. Run full optimization (optional, but recommended)
python scripts/ai-ml/optimize_llm_models.py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ROUTER_MAPPINGS = [
#### Step 1.3: Test Immediate Resolution
```bash
# Restart backend and verify single router active
bash run_autobot.sh --dev --no-build
sudo systemctl restart autobot-backend

# Test key endpoints:
curl http://localhost:8001/api/health
Expand Down Expand Up @@ -390,7 +390,7 @@ cp backend/fast_app_factory_fix.py.backup backend/fast_app_factory_fix.py
cp autobot-vue/src/services/api.ts.backup autobot-vue/src/services/api.ts
cp autobot-vue/src/utils/ApiClient.ts.backup autobot-vue/src/utils/ApiClient.ts
# Restart services
bash run_autobot.sh --dev --rebuild
sudo systemctl restart autobot-backend
```

## Success Metrics
Expand Down
35 changes: 19 additions & 16 deletions autobot-infrastructure/shared/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```
scripts/
├── analysis/ # Test scripts and analysis tools (moved from root)
├── archive/ # Obsolete startup scripts (replaced by run_autobot.sh)
├── archive/ # Obsolete startup scripts (deprecated, see SERVICE_MANAGEMENT.md)
├── cache/ # Cache management utilities
├── native-vm/ # Native VM deployment scripts
├── network/ # Network configuration and testing
Expand All @@ -22,13 +22,14 @@ scripts/

## Main Scripts (Root Directory)

### Essential Scripts (ONLY 2 FILES)
- **`run_autobot.sh`** - Unified startup script (combines all previous run scripts)
### Essential Scripts
- **`setup.sh`** - Unified setup script (handles all setup tasks)
- **`scripts/start-services.sh`** - CLI service wrapper (start/stop/restart)

## Script Categories

### Archive (Obsolete - Use run_autobot.sh instead)
### Archive (Obsolete - Do not use)
- `run_autobot.sh` - Deprecated (Issue #863), moved to `legacy/`
- `run_agent.sh` - Old Docker-based startup
- `run_agent_unified.sh` - Old unified startup
- `run_agent_native.sh` - Old native VM startup
Expand Down Expand Up @@ -67,16 +68,16 @@ scripts/

## Usage Examples

### Using the Unified Script (Recommended)
### Starting Services (Recommended)
```bash
# Standard native VM startup
./run_autobot.sh
# Production (systemd)
sudo systemctl start autobot-backend

# Development mode
./run_autobot.sh --dev
# CLI wrapper
scripts/start-services.sh start

# With specific options
./run_autobot.sh --dev --no-browser --rebuild
# Docker
docker compose up -d
```

### Setup Commands
Expand Down Expand Up @@ -119,10 +120,12 @@ scripts/

## Migration Notes

All old startup scripts have been consolidated into `run_autobot.sh`.
If you were using:
- `run_agent.sh --dev` → Now use `run_autobot.sh --dev`
- `run_agent_native.sh` → Now use `run_autobot.sh` (native is default)
- `run-docker-desktop.sh` → Now use `run_autobot.sh --docker`
All old startup scripts (including `run_autobot.sh`) have been deprecated.
Use the current methods:
- **Production:** `systemctl start autobot-backend`
- **CLI wrapper:** `scripts/start-services.sh start`
- **Docker:** `docker compose up -d`

See [`docs/developer/SERVICE_MANAGEMENT.md`](../../docs/developer/SERVICE_MANAGEMENT.md) for full details.

The old scripts are preserved in `scripts/archive/` for reference but should not be used.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ This directory contains scripts to fix the critical SSH man-in-the-middle vulner
- 50+ shell scripts in `scripts/` directory
- Python modules with subprocess SSH calls
- Ansible configuration files
- Main system scripts (run_autobot.sh, etc.)
- Main system scripts (now managed via systemd; `run_autobot.sh` deprecated)

**Output**:
- Backup directory: `backups/ssh-remediation-<timestamp>/`
Expand Down Expand Up @@ -225,7 +225,7 @@ This directory contains scripts to fix the critical SSH man-in-the-middle vulner
9. **Full System Test**:
```bash
# Start AutoBot with new SSH security
bash run_autobot.sh --dev
sudo systemctl start autobot-backend
```

### Phase 4: MITM Detection Verification (Optional)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Established comprehensive performance baseline and validation framework for Auto
cd /home/kali/Desktop/AutoBot

# Ensure backend is running
bash run_autobot.sh --dev
sudo systemctl start autobot-backend

# Execute baseline tests
python tests/performance/test_async_baseline.py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ comparison_report_YYYYMMDD.json # Before/after analysis
### Prerequisites
```bash
# Ensure AutoBot backend is running
bash run_autobot.sh --dev
sudo systemctl start autobot-backend

# Install test dependencies (should already be installed)
pip install aiohttp redis[asyncio] aiofiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if ! curl -s -f "${BACKEND_URL}/api/health" > /dev/null 2>&1; then
echo ""
echo "Please start AutoBot first:"
echo " cd ${PROJECT_ROOT}"
echo " bash run_autobot.sh --dev"
echo " systemctl start autobot-backend # or: scripts/start-services.sh start"
echo ""
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion autobot-slm-backend/ansible/ROLE_STRUCTURE_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ ansible-playbook playbooks/deploy_role.yml -e 'role_name=frontend' --list-tasks
The Ansible role structure integrates with AutoBot's deployment workflows:

1. **setup.sh**: Installs Ansible and dependencies
2. **run_autobot.sh**: Can trigger Ansible deployments
2. **systemd services**: Manage backend/frontend lifecycle (replaces deprecated `run_autobot.sh`)
3. **sync-to-vm.sh**: Syncs code after role deployment
4. **Service Registry**: Feeds dynamic inventory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,53 +144,19 @@
- Mode: Development (hot reload enabled)
- Environment: /opt/autobot/config/frontend-dev.env

# Update run_autobot.sh to support development mode
- name: Update AutoBot startup script for development mode
# NOTE: run_autobot.sh is deprecated (Issue #863).
# Development mode frontend is managed via systemd service autobot-frontend-dev.
# No startup script modifications needed -- use systemctl directly.
- name: Verify development services are running
hosts: backend
become: yes

tasks:
- name: Backup current run_autobot.sh
copy:
src: /home/kali/Desktop/AutoBot/run_autobot.sh
dest: /home/kali/Desktop/AutoBot/run_autobot.sh.backup
remote_src: yes

- name: Update run_autobot.sh to support --dev mode for distributed architecture
blockinfile:
path: /home/kali/Desktop/AutoBot/run_autobot.sh
marker: "# {mark} DEVELOPMENT MODE FRONTEND MANAGEMENT"
block: |
start_frontend_dev() {
FRONTEND_IP=$(ansible-inventory -i ansible/inventory/production.yml --host autobot-frontend 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get('ansible_host',''))" 2>/dev/null)
FRONTEND_IP=${FRONTEND_IP:-{{ frontend_host }}}
echo "Starting Frontend Development Server on VM ${FRONTEND_IP}..."

# Start development frontend service via Ansible
ansible frontend -i ansible/inventory/production.yml -m systemd -a "name=autobot-frontend-dev state=restarted enabled=yes" -b

# Wait for frontend to be ready
echo "Waiting for frontend development server to start..."
sleep 10

# Test frontend availability
if curl -s -o /dev/null -w "%{http_code}" http://${FRONTEND_IP}:{{ frontend_port }} | grep -q "200"; then
echo "Frontend development server ready at http://${FRONTEND_IP}:{{ frontend_port }}"
else
echo "Frontend development server may not be fully ready yet"
echo " Check status with: ansible frontend -i ansible/inventory/production.yml -m shell -a 'systemctl status autobot-frontend-dev'"
fi
}

# Add frontend dev start to main dev mode function
if [[ "$*" == *"--dev"* ]]; then
start_frontend_dev
fi

- name: Make run_autobot.sh executable
file:
path: /home/kali/Desktop/AutoBot/run_autobot.sh
mode: '0755'
- name: Ensure autobot-backend service is running
systemd:
name: autobot-backend
state: started
enabled: yes

# Display final status
- name: Development Setup Complete
Expand All @@ -211,10 +177,10 @@

Backend:
- URL: http://{{ backend_host }}:{{ backend_port }}
- Service: Runs via run_autobot.sh --dev
- Service: autobot-backend (systemd)

Usage:
- Start all: bash run_autobot.sh --dev
- Start all: sudo systemctl start autobot-backend
- Frontend only: ansible frontend -i ansible/inventory/production.yml -m systemd -a "name=autobot-frontend-dev state=started"
- Check status: ansible frontend -i ansible/inventory/production.yml -m shell -a "systemctl status autobot-frontend-dev"

Expand Down
2 changes: 1 addition & 1 deletion docs/ROADMAP_2025.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ AUTOBOT_REASONING_MODEL=qwen3.5:9b

| Task | Planned | Actual | Status |
|------|---------|--------|--------|
| Single-command startup | ✓ | `bash run_autobot.sh` | ✅ |
| Single-command startup | ✓ | `systemctl start autobot-backend` | ✅ |
| Systemd service | ✓ | Optional config | ✅ |
| Crontab auto-start | ✓ | Optional | ✅ |
| Graceful shutdown | ✓ | Resource cleanup | ✅ |
Expand Down
2 changes: 1 addition & 1 deletion docs/adr/001-distributed-vm-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ We adopt a distributed 6-VM architecture where each VM serves a specific purpose

### Key Files

- `run_autobot.sh` - Main startup script orchestrating all VMs
- `scripts/start-services.sh` - CLI service wrapper (replaces deprecated `run_autobot.sh`)
- `scripts/utilities/sync-to-vm.sh` - File synchronization utility
- `~/.ssh/autobot_key` - SSH key for VM authentication

Expand Down
4 changes: 2 additions & 2 deletions docs/adr/005-single-frontend-mandate.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ This is an absolute mandate with zero exceptions:

- `sync-frontend.sh` - Quick sync script for frontend changes
- `scripts/utilities/sync-to-vm.sh` - General purpose VM sync utility
- `run_autobot.sh` - Orchestrates frontend startup on VM1
- Systemd services on VM1 manage frontend startup (replaces deprecated `run_autobot.sh`)

### Forbidden Commands

Expand Down Expand Up @@ -113,7 +113,7 @@ firefox http://172.16.168.21:5173

### Enforcement

The `run_autobot.sh` script enforces this by:
The systemd service configuration enforces this by:
1. Never starting Vite on main machine
2. SSH to VM1 to start/restart frontend
3. Health checking VM1's frontend server
Expand Down
6 changes: 3 additions & 3 deletions docs/architecture/CONFIG_MIGRATION_IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ python scripts/validate_timeout_config.py
# 3. Implement changes (see below)

# 4. Verify no regression
bash run_autobot.sh --dev
scripts/start-services.sh start
curl http://172.16.168.21:5173 # Frontend accessible?
```

Expand Down Expand Up @@ -409,7 +409,7 @@ curl http://localhost:8001/api/health
curl http://172.16.168.21:5173

# 5. Full system test
bash run_autobot.sh --dev
scripts/start-services.sh start
# Open browser to http://172.16.168.21:5173
# Test model selection in GUI
```
Expand Down Expand Up @@ -452,7 +452,7 @@ If issues arise:
# Quick rollback
git stash
git checkout main
bash run_autobot.sh --restart
sudo systemctl restart autobot-backend

# Or revert compatibility shim
git checkout HEAD -- src/unified_config.py
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ curl http://172.16.168.24:8080/api/tags

| File | Purpose |
|------|---------|
| `run_autobot.sh` | Main startup script |
| `scripts/start-services.sh` | CLI service wrapper (replaces deprecated `run_autobot.sh`) |
| `.env` | Environment variables |
| `backend/core/config.py` | Backend configuration |
| `autobot-frontend/vite.config.ts` | Frontend configuration |
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/SSOT_CONFIGURATION_ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ curl -s "http://${AUTOBOT_VM_MAIN_IP}:${AUTOBOT_PORT_BACKEND}/api/health"

| Script | Current Status | Required Changes |
| ------ | -------------- | ---------------- |
| `run_autobot.sh` | Partial SSOT | Source .env, remove hardcoded IPs |
| ~~`run_autobot.sh`~~ | Deprecated (#863) | Replaced by systemd + `scripts/start-services.sh` |
| `setup.sh` | Hardcoded | Source .env for all network config |
| `scripts/utilities/sync-to-vm.sh` | Hardcoded IPs | Use AUTOBOT_VM_* variables |
| `scripts/utilities/sync-frontend.sh` | Hardcoded | Use AUTOBOT_VM_FRONTEND_IP |
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/VECTOR_STORE_MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ git checkout src/knowledge_base_v2.py
# No action needed

# 3. Restart backend
bash run_autobot.sh --restart
sudo systemctl restart autobot-backend
```

---
Expand Down
14 changes: 7 additions & 7 deletions docs/deployment/MCP_BRIDGE_ACTIVATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ curl -s http://localhost:8001/api/mcp/tools | jq '.total_tools'
### Step 3: Graceful Backend Restart

```bash
# Option 1: Use run_autobot.sh (recommended)
bash run_autobot.sh --restart --dev
# Option 1: systemd (recommended)
sudo systemctl restart autobot-backend

# Option 2: Use --verify-mcp flag for automatic verification
bash run_autobot.sh --restart --dev --verify-mcp
# Option 2: CLI wrapper
scripts/start-services.sh restart

# Option 3: Manual restart
pkill -f "uvicorn backend.app:app"
sleep 2
bash run_autobot.sh --dev
scripts/start-services.sh start
```

### Step 4: Verify New Bridge Registration
Expand Down Expand Up @@ -214,7 +214,7 @@ git reset --hard HEAD~1
### Step 3: Restart Backend

```bash
bash run_autobot.sh --restart --dev
sudo systemctl restart autobot-backend
```

### Step 4: Verify Rollback
Expand Down Expand Up @@ -253,7 +253,7 @@ curl -s http://localhost:8001/api/health | jq '.status'

3. **Backend Not Restarted**
```bash
bash run_autobot.sh --restart
sudo systemctl restart autobot-backend
```

### Issue: 404 on Bridge Endpoint
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/AGENT_OPTIMIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ Add to GitHub Actions workflow:
git add .claude/agents-optimized/
```

### Startup Script Integration
### Startup Integration

Add to `run_autobot.sh`:
Add to your service startup (e.g., systemd `ExecStartPre` or `scripts/start-services.sh`):

```bash
# Optimize agents on startup
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/AGENT_OPTIMIZATION_SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Assuming proportional token processing time:

### Startup Integration (Optional)

Add to `run_autobot.sh`:
Add to your service startup (e.g., systemd `ExecStartPre` or `scripts/start-services.sh`):
```bash
# Auto-optimize agents on startup
if [ -x "./scripts/utilities/agent-optimize.sh" ]; then
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/INFRASTRUCTURE_DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ md5sum /home/kali/Desktop/AutoBot/autobot-backend/api/chat.py
- [ ] All changes committed to git (local version control)
- [ ] Services bind to `0.0.0.0` (not localhost)
- [ ] Using `NetworkConstants` for IPs/ports (not hardcoded)
- [ ] Tested locally first (`bash run_autobot.sh --dev`)
- [ ] Tested locally first (`scripts/start-services.sh start` or `systemctl start autobot-backend`)
- [ ] Synced to VMs (`./infrastructure/shared/scripts/sync-to-vm.sh`)
- [ ] Health checks pass on all services

Expand Down
Loading
Loading