synos-lab-agent — Laboratory agent runtime
tags: [general]
synos-lab-agent — Laboratory agent runtime
Section titled “synos-lab-agent — Laboratory agent runtime”Classification: PUBLIC
Crate: fruit/crates/synos-lab-agent/
Milestone: v14+
License: Apache-2.0
Version: v111.0.0 “Last Light”
What It Is
Section titled “What It Is”synos-lab-agent is the OS-native half of the GRIMOIRE “enter a node → a real Firecracker lab boots locally and opens in a terminal” loop. It solves the gap between the Cloudflare-hosted game client (which cannot open local ws:// connections due to browser CORS/mixed-content restrictions) and the synos-lab-sandbox orchestrator (which had zero callers before this crate). The agent verifies Ed25519-signed Launch Grants offline, drives the orchestrator’s Unix-socket protocol, and opens a terminal into the resulting Firecracker microVM.
Architecture
Section titled “Architecture”Modules
Section titled “Modules”| Module | Purpose |
|---|---|
grant | Launch Grant verification gate — offline Ed25519 verification of synos_member_token-format tokens against baked world-server public key |
url_scheme | synos:// URL parsing and validation for x-scheme-handler/synos dispatch |
ipc | Unix domain socket IPC server for receiving launch requests from the URL handler |
orchestrator_client | Orchestrator protocol client driving synos-lab-sandbox’s Unix-socket API |
terminal | Terminal spawn and PTY management for opening user-facing shell into Firecracker microVM |
status_server | Loopback WebSocket status server (ws/wss) for the browser game UI to subscribe to lab state |
register_client | Localhost HTTP client for the grimoire-daemon register-flag endpoint |
flag | Random flag generation and management for CTF lab scenarios |
How It’s Wired
Section titled “How It’s Wired”- synos-member-token — The
grantmodule verifies Launch Grants offline using the same bakedSYNOS_MEMBER_TOKEN_PUBKEYthe member-token gate trusts. No network call is required; a forged, expired, or replayed grant is rejected before any orchestrator call. - synos-lab-sandbox —
orchestrator_clientdrives thelab-orchestrator’s Unix-socket protocol as its first real client. The agent deliberately uses only the always-compiledorchestrator_protocolmodule (not thefirecracker-gatedtap_device/firecracker_apimodules). - grimoire-daemon —
register_clientcalls the localhost register-flag endpoint to notify the daemon when a lab is launched or exited. - WebSocket status server —
status_serverusestokio-rustlsforwss://when operator-provisioned cert/key pairs are present, falling back tows://otherwise. The browser game UI subscribes to lab state transitions. - Two binaries —
synos-lab-agentis the long-running daemon.synos-lab-url-handleris a thin binary registered as the desktop’sx-scheme-handler/synostarget with zero verification logic of its own, ensuring the one and only trust boundary is the daemon.
Future Ideas
Section titled “Future Ideas”- Add
synos-lab-agent-brokerfor multi-lab scheduling across a local cluster of Firecracker-capable hosts. - Implement
grantrenewal so long-running labs can refresh their Launch Grant without user interaction. - Wire
flagmodule intosynos-threat-huntingso CTF flags becomeHuntFindingartifacts in the unified findings store.