Supervised AI System with Engineering Lead Supervisor and Cloud Assistant
Ein intelligentes Supervisor-System, das AI-Agenten ΓΌberwacht, Risiken bewertet und bei kritischen Entscheidungen automatisch eingreift.
- π― STOP-Score System: Automatische Risikobewertung (0-100) basierend auf verschiedenen Faktoren
- π‘οΈ Enforcement Gate: HARD STOP bei kritischen Entscheidungen (Score β₯ 70)
- π¨βπΌ Engineering Lead Supervisor: Meta-Supervisor fΓΌr Planung, Delegation und Verifikation
- βοΈ Cloud Assistant: AusfΓΌhrender Agent mit Evidence-Based Reporting
- π Task Management: VollstΓ€ndiges Task-Tracking mit Status, Logs und Audit-Trail
- π Audit Log: LΓΌckenlose Dokumentation aller Agent-Aktionen
- π Dashboard: React-basierte UI fΓΌr Monitoring und Management
- π Authentication: JWT-based authentication mit Token Rotation
- π₯ User Management: CRUD operations mit Role-Based Access Control
- βοΈ Email Verification: Token-based email verification system
- π Password Reset: Secure password reset mit 1-hour expiry tokens
- π‘οΈ Rate Limiting: Brute-force protection auf Login und sensitive Endpoints
- Demo Invite System: User-Onboarding mit Invite-Codes und Usage-Limits
- SQLite Database: Leichtgewichtige, lokale Datenpersistenz
- Queue System: Redis (production) oder In-Memory (development)
- REST API: VollstΓ€ndige HTTP API fΓΌr alle Operationen
- Node.js: β₯20.0.0
- npm: β₯10.0.0
- Git: FΓΌr Versionskontrolle
# Repository klonen
git clone <REPOSITORY_URL>
cd Optimizecodecloudagents
# Dependencies installieren
npm install
# Environment-Variablen konfigurieren
cp .env.example .env
# .env editieren und Werte anpassen
# Data-Verzeichnis erstellen
mkdir -p data# Backend starten (Development Mode)
npm run backend:dev
# Frontend starten (Development Mode - separates Terminal)
npm run dev
# Tests ausfΓΌhren
npm test# Frontend build
npm run build
# Backend build
npm run backend:build
# Backend starten
npm run backend:startServer lΓ€uft auf: http://localhost:3000
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ENGINEERING_LEAD_SUPERVISOR β
β (Planung, Delegation, Review, STOP-Decision) β
ββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β
ββββ Plan erstellen
ββββ Tasks an Cloud Assistant delegieren
ββββ Evidence verifizieren
ββββ STOP-Score bewerten
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLOUD_ASSISTANT β
β (Task-Execution, Evidence-Collection) β
ββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β
ββββ Tasks ausfΓΌhren
ββββ Logs sammeln
ββββ Evidence bereitstellen
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ENFORCEMENT_GATE β
β (HARD STOP bei STOP_SCORE β₯ 70) β
ββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β
ββββ Score berechnen
ββββ STOP erzwingen
ββββ Human Review anfordern
Backend:
- Node.js v20+
- TypeScript
- Express.js
- SQLite (better-sqlite3)
- Redis (optional)
Frontend:
- React 18
- TypeScript
- Vite
- Tailwind CSS
- Radix UI Components
VollstΓ€ndige Dokumentation in docs/:
- Developer Guide: Setup, Entwicklung, Testing
- Architecture: System-Design, Datenmodelle, Flows
- Contributing: Contribution-Guidelines, Code-Standards
- Agent Installation Guide: π Agents installieren und konfigurieren
GET /api # API Info
GET /health # Health Check# Authentication
POST /api/auth/login # Login mit Email/Password
POST /api/auth/logout # Logout & Token revocation
POST /api/auth/refresh # Access Token erneuern
GET /api/auth/verify # Token validieren
GET /api/auth/me # Aktuellen User abrufen
# User Management (Admin/Self)
GET /api/users # List users (Admin only)
GET /api/users/me # Current user profile
GET /api/users/stats # User statistics (Admin only)
GET /api/users/:id # Get user by ID
POST /api/users # Create user (Admin only)
PATCH /api/users/:id # Update user
POST /api/users/:id/password # Change password
DELETE /api/users/:id # Delete user (Admin only)
# Email Verification
POST /api/email-verification/send # Send verification email
POST /api/email-verification/verify # Verify email with token
GET /api/email-verification/status # Check verification status
# Password Reset
POST /api/password-reset/request # Request password reset
POST /api/password-reset/verify # Verify reset token
POST /api/password-reset/reset # Reset password with tokenPOST /api/tasks # Create Task
GET /api/tasks # List Tasks
GET /api/tasks/:id # Get Task DetailsGET /api/audit # List Audit Entries
GET /api/audit/:id # Get Audit Entry DetailsGET /api/enforcement/blocked # List Blocked Tasks (STOP-Score β₯ 70)
POST /api/enforcement/approve # Human Approval
POST /api/enforcement/reject # Human RejectionPOST /api/demo/invites # Create Invite (Admin)
POST /api/demo/redeem # Redeem Invite
GET /api/demo/stats # Demo Statistics
GET /api/demo/users/:id # User Usage StatsDetaillierte API-Dokumentation: API Docs (coming soon)
Optimizecodecloudagents/
βββ src/
β βββ index.ts # Backend Entry Point
β βββ api/ # REST API Routes
β β βββ health.ts
β β βββ tasks.ts
β β βββ audit.ts
β β βββ enforcement.ts
β β βββ demo.ts
β βββ audit/ # Audit & Enforcement
β β βββ enforcementGate.ts
β β βββ stopScorer.ts
β βββ db/ # Database Layer
β β βββ database.ts
β βββ queue/ # Queue System
β β βββ queue.ts
β βββ demo/ # Demo Invite System
β β βββ inviteManager.ts
β β βββ types.ts
β βββ components/ # React Components
β βββ App.tsx # Frontend Entry Point
β βββ main.tsx # Vite Entry
βββ data/ # SQLite Database
βββ logs/ # PM2 Logs
βββ docs/ # Documentation
βββ package.json
βββ tsconfig.json
βββ vite.config.ts
βββ ecosystem.config.cjs # PM2 Config
Siehe .env.example fΓΌr vollstΓ€ndige Konfiguration:
# Server
PORT=3000
NODE_ENV=development
# Database
SQLITE_PATH=./data/app.sqlite
# Queue
REDIS_URL=redis://localhost:6379
QUEUE_ENABLED=false
# Supervisor
STOP_SCORE_THRESHOLD=70
MAX_PARALLEL_AGENTS=4- TypeScript Strict Mode: Keine
anyTypes - JSDoc: Alle Funktionen dokumentieren
- Namenskonventionen:
- camelCase: Variablen
- PascalCase: Komponenten/Klassen
- SCREAMING_SNAKE_CASE: Konstanten
- Error Handling: try/catch fΓΌr alle async Operationen
- Testing: Jest-basierte Tests fΓΌr alle Features
Details: Contributing Guide
Server: 178.156.178.70 User: root Path: /root/cloud-agents Process Manager: PM2
# 1. SSH to server
ssh root@178.156.178.70
# 2. Navigate to project
cd /root/cloud-agents
# 3. Pull latest changes
git pull origin main
# 4. Install dependencies
npm ci
# 5. Build
npm run backend:build
# 6. Restart PM2
pm2 restart cloud-agents-backend
# 7. Check logs
pm2 logs cloud-agents-backend
# 8. Health check
curl http://localhost:3000/healthDetaillierte Deployment-Docs: GIT_UND_DEPLOYMENT_ANWEISUNGEN.md
# All tests
npm test
# Watch mode
npm test -- --watch
# Coverage
npm test -- --coverageAccess Tokens:
- Validity: 15 minutes
- Purpose: API authentication
- Automatic refresh via refresh token
Refresh Tokens:
- Validity: 7 days
- Token rotation on refresh (security best practice)
- Stored in-memory blacklist on logout
Security Features:
- Separate secrets for access/refresh tokens
- Unique JWT IDs (jti) for refresh tokens
- Issuer and Audience validation
- Token revocation on logout
- Ready for Redis in production
Role-Based Access Control (RBAC):
- Admin: Full system access, user management
- User: Own profile access, password change
- Demo: Read-only access
Features:
- bcrypt password hashing (10 salt rounds)
- Email uniqueness enforcement
- Case-insensitive email lookup
- User activation/deactivation
- Last login tracking
- Self-deletion prevention
Token System:
- Secure 32-byte hex tokens
- 24-hour expiry
- One-time use (marked as used after verification)
- Automatic old token invalidation
Flow:
- User registers β verification token generated
- Email sent with verification link (DEV: token returned in API)
- User clicks link β token verified β email marked as verified
Token System:
- Secure 32-byte hex tokens
- 1-hour expiry (more secure than email verification)
- One-time use
- Automatic old token invalidation
Security Features:
- No user enumeration (always returns success)
- Inactive users cannot reset password
- Token marked as used after successful reset
- New password hashed with bcrypt before storage
IP-Based Protection:
- Login: 5 attempts per 15 minutes
- Password Reset: 3 attempts per hour
- Email Verification: 3 attempts per hour
Implementation:
- In-memory store (Redis-ready for production)
- Automatic cleanup of expired entries
- Real-time IP tracking
- Returns retry-after time on rate limit
Status Codes:
200: Success401: Unauthorized (invalid credentials/token)403: Forbidden (inactive account, no permission)429: Too Many Requests (rate limit exceeded)
- Input Validation: Zod-Schema-Validierung auf allen Endpoints
- STOP-Score: Automatisches Blocking bei kritischen Operationen
- Audit Log: LΓΌckenlose Dokumentation aller Aktionen
- Environment Variables: Keine Secrets im Code
- Password Requirements: Minimum 8 characters
Siehe auch: Security Guide (coming soon)
express: Web Frameworkbetter-sqlite3: SQLite Databasebcrypt: Password hashingjsonwebtoken: JWT authenticationzod: Schema Validationreact: Frontend Framework@radix-ui/*: UI Components
typescript: Type Safetyvite: Build Tooltsx: TypeScript Runtimetailwindcss: Styling
VollstΓ€ndige Liste: package.json
Contributions sind willkommen! Bitte lies zuerst den Contributing Guide.
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m "feat: add amazing feature" - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
ProprietΓ€r - Step2Job GmbH
- Issues: GitHub Issues
- Docs:
docs/Verzeichnis - Email: support@step2job.de
- Authentication & User Management (Agent 2 - Security Expert)
- JWT-based authentication mit token rotation
- User Management mit RBAC (Admin/User/Demo)
- Email verification system
- Password reset functionality
- Rate limiting on sensitive endpoints
- 19 comprehensive tests (all passing)
- OpenAPI/Swagger Documentation
- Postman Collection
- WebSocket Real-time Updates
- Integration APIs (GitHub, Slack, Linear)
- Multi-Provider AI Support
- Memory System
Erstellt: 2025-12-26 Version: 0.1.0
π€ Generated with Claude Code Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com