150 Handoff To Session 152
Documentation for Sessions
Session 150 → Session 152 Handoff
What Session 150 Completed
Code (32 new files, 2 modified)
Sandbox Orchestrator NestJS App — APIs/sandbox-orchestrator/
- Complete NestJS application managing Firecracker microVM lifecycle
- 11 REST endpoints matching
SelfHostedProviderHTTP contract exactly - Services: FirecrackerService, NetworkService, VmExecutorService, SandboxManagerService, CleanupService
- Auth: ApiKeyGuard (X-API-Key header, constant-time comparison)
- Streaming: VncProxyService (WebSocket ↔ TCP for live VM desktop viewing)
- Monitoring: Prometheus metrics at GET /metrics
- Health: GET /health (used by SelfHostedProvider.onModuleInit())
- Build:
nx build sandbox-orchestrator— PASSES CLEAN
VM Rootfs Image — deployment/sandbox-orchestrator/
Dockerfile.rootfs— Ubuntu 22.04 + XFCE4 + Chrome + xdotool + scrot + x11vnc + SSHvm-init.sh— PID 1 inside VM (parses kernel boot args, starts desktop stack)vm-network.sh— Static IP from kernel cmdlinebuild-rootfs.sh— Docker → ext4 conversion pipelineDockerfile.orchestrator— NestJS app imagesandbox-orchestrator.service— systemd unitnginx.conf— Reverse proxy with SSL + WebSocket for VNC
Server Scripts — tools/scripts/sandbox/
provision-server.sh— Full server setup (Firecracker, KVM, Node.js, nginx, SSL)setup-network.sh— Bridge + TAP + NAT networkingdeploy-orchestrator.sh— Build → rsync → restart → health check
Enhanced SelfHostedProvider — APIs/backend-ai-api/.../self-hosted.provider.ts
- API key header (X-API-Key from SANDBOX_API_KEY env)
- 2-retry with exponential backoff (1s, 3s) on 5xx/timeout
- 60s health monitoring (critical alert after 3 consecutive failures)
- 45s screenshot timeout (up from 30s)
SSH ControlMaster — APIs/sandbox-orchestrator/.../vm-executor.service.ts
- ControlMaster=auto, ControlPath=/tmp/ssh-sandbox-%r@%h, ControlPersist=300
- ~95% latency reduction on subsequent SSH commands (50-100ms → 2-5ms)
- Socket cleanup in firecracker.service.ts stopVM()
Infrastructure
Hetzner Server — LIVE AND ACCESSIBLE
- Server: AX42-U #2938512
- IP: 144.76.69.55
- IPv6: 2a01:4f8:191:81f5::2
- Location: Falkenstein, Germany (FSN1)
- OS: Ubuntu 24.04.3 LTS
- Kernel: 6.8.0-90-generic
- CPU: AMD Ryzen 7 PRO 8700GE (8c/16t)
- RAM: 128 GB DDR5
- Storage: 2× 476.9GB Samsung NVMe
- KVM: AVAILABLE at /dev/kvm
SSH Access — KEY-BASED ONLY
- SSH key:
~/.ssh/id_ed25519([email protected]) - Key installed on server at
/root/.ssh/authorized_keys - Password auth: DISABLED
- SSH alias configured:
ssh sandboxworks from local machine - SSH config at
~/.ssh/config→ Host sandbox
Security
- SANDBOX_API_KEY generated:
W8Wp0ltL8El_qRnXyoUoD0ffuSfZzmbn7Y7SVrx1k8s - Added to
.env.local(SANDBOX_SERVER_URL commented out until orchestrator deployed) - Hostname set to
sandbox-gograb
Documentation
docs/english/sessions/S150/150-work-report.md— Full session summary (technical + non-technical)docs/english/sessions/S150/150-daily-summary-2026-02-27.md— Daily decisionsdocs/english/architecture/session-150-infrastructure-and-vision-report.md— Consolidated infrastructure research + Jarvis memory architecture analysis (THE comprehensive document)- 5 architecture decision docs auto-generated by MCP
MCP Intelligence
- 8 decisions logged with calibrated confidence ≥ 0.88
- 3 conventions added (orchestrator deployment, rootfs building, VM networking)
- 1 reflection with 6 synthesized lessons
- 1 outcome reported (success, 5/5)
- MEMORY.md updated with server details
What Session 152 Needs to Do
Remaining Server Setup (DNS first, then provisioning)
- DNS — User must add A record in Cloudflare:
sandbox→144.76.69.55(proxy OFF) - Run provision-server.sh — Installs Firecracker, KVM modules, Node.js, nginx, certbot
- Run setup-network.sh — Creates br-sandbox bridge, TAP networking, NAT rules
- Build rootfs —
sudo bash build-rootfs.sh(needs Docker on the server) - Deploy orchestrator —
bash deploy-orchestrator.sh sandbox(builds NX app, rsync, systemd) - SSL —
certbot --nginx -d sandbox.gograb.space(after DNS propagates) - Uncomment
SANDBOX_SERVER_URL=https://sandbox.gograb.spacein.env.local - E2E test — Trigger Computer Use from frontend, verify full observe-think-act loop
Per-User Persistent VM Model (2-3 days)
- Add Firecracker snapshot support (
CreateSnapshot/LoadSnapshotAPI) - New
UserMachineServicewith states: creating → active → snapshotting → sleeping → waking - New endpoints:
POST /machines/{userId},POST /machines/{userId}/snapshot,POST /machines/{userId}/wake - Modify
SelfHostedProviderto supportgetOrCreateMachine(userId)for single-task flows - Snapshot-on-idle (30min), restore-on-demand (~10ms VMM + ~300-500ms app warmup)
Jarvis Memory Architecture Improvements (from the vision report)
- Importance decay on memories (exponential, daysSinceLastAccess)
- Request-aware cognitive load budgeting
- Auto-generated User Brief per user (200-token daily summary)
- Knowledge graph for multi-hop reasoning (entity extraction + relationships)
- VM-as-memory integration (Chrome state as queryable context)
Key File Locations
| What | Path |
|---|---|
| Orchestrator app | APIs/sandbox-orchestrator/src/ |
| Rootfs + deployment | deployment/sandbox-orchestrator/ |
| Provisioning scripts | tools/scripts/sandbox/ |
| SelfHostedProvider | APIs/backend-ai-api/src/app/infrastructure/services/sandbox/self-hosted.provider.ts |
| Provider factory | APIs/backend-ai-api/src/app/infrastructure/services/sandbox/sandbox-provider.factory.ts |
| Provider interface | APIs/backend-ai-api/src/app/infrastructure/services/sandbox/sandbox-provider.interface.ts |
| Env vars | .env.local (search for SANDBOX_) |
| SSH config | ~/.ssh/config (Host sandbox) |
| SSH key | ~/.ssh/id_ed25519 |
| Consolidated report | docs/english/architecture/session-150-infrastructure-and-vision-report.md |
| Plan file | .claude/plans/mighty-gathering-snail.md |
Quick Commands
# SSH into server
ssh sandbox
# Build orchestrator
npx nx build sandbox-orchestrator
# Type-check backend-ai-api
npx tsc --noEmit --project APIs/backend-ai-api/tsconfig.app.json
# Deploy to server
bash tools/scripts/sandbox/deploy-orchestrator.sh sandbox