11//! `agent-runner` — miner CVM HTTP task API (`agent:8080`).
22//!
3- //! Loads the CVM-local work-receipt key from `GBASE_RECEIPT_SK_FILE ` (mode 0600
3+ //! Loads the CVM-local work-receipt key from `BASE_RECEIPT_SK_FILE ` (mode 0600
44//! mount). Dispatch auth (todo 18) is on by default when a trusted challenge
55//! pubkey is configured. Concurrency is clamped to 1..=5 and enforced with a
66//! semaphore (todo 19). Pack execution uses allowlisted Docker when
7- //! `GBASE_DOCKER_BASE ` + `GBASE_ENVIRONMENT_IMAGE ` + `GBASE_PACK_ROOT ` are set;
7+ //! `BASE_DOCKER_BASE ` + `BASE_ENVIRONMENT_IMAGE ` + `BASE_PACK_ROOT ` are set;
88//! otherwise the deterministic stub backend is used. Default egress posture is
99//! OPEN (todo 21).
1010
@@ -33,44 +33,44 @@ use tokio::net::TcpListener;
3333) ]
3434struct Cli {
3535 /// Bind address (compose publishes agent:8080).
36- #[ arg( long, env = "GBASE_RUNNER_BIND " , default_value = "0.0.0.0:8080" ) ]
36+ #[ arg( long, env = "BASE_RUNNER_BIND " , default_value = "0.0.0.0:8080" ) ]
3737 bind : SocketAddr ,
3838 /// Miner-declared max concurrency (clamped to 1..=5 at runtime).
39- #[ arg( long, env = "GBASE_MAX_CONCURRENCY " , default_value_t = 1 ) ]
39+ #[ arg( long, env = "BASE_MAX_CONCURRENCY " , default_value_t = 1 ) ]
4040 max_concurrency : u32 ,
4141 /// Path to the CVM-local receipt mini-secret (mode 0600 file).
42- #[ arg( long, env = "GBASE_RECEIPT_SK_FILE " , default_value = DEFAULT_RECEIPT_SK_PATH ) ]
42+ #[ arg( long, env = "BASE_RECEIPT_SK_FILE " , default_value = DEFAULT_RECEIPT_SK_PATH ) ]
4343 receipt_sk_file : PathBuf ,
4444 /// When set, generate the receipt key if the file is missing (local/dev only).
45- #[ arg( long, env = "GBASE_RECEIPT_SK_GENERATE " , default_value_t = false ) ]
45+ #[ arg( long, env = "BASE_RECEIPT_SK_GENERATE " , default_value_t = false ) ]
4646 receipt_sk_generate : bool ,
4747 /// Disable dispatch auth (local/dev only). Default: auth on when pubkey set.
48- #[ arg( long, env = "GBASE_DISPATCH_AUTH_DISABLE " , default_value_t = false ) ]
48+ #[ arg( long, env = "BASE_DISPATCH_AUTH_DISABLE " , default_value_t = false ) ]
4949 dispatch_auth_disable : bool ,
5050 /// Trusted challenge public key (64 hex) for dispatch auth.
51- #[ arg( long, env = "GBASE_TRUSTED_CHALLENGE_PUBKEY " ) ]
51+ #[ arg( long, env = "BASE_TRUSTED_CHALLENGE_PUBKEY " ) ]
5252 trusted_challenge_pubkey : Option < String > ,
5353 /// Docker Engine HTTP base (socket-proxy). When set with image + pack root → Docker backend.
54- #[ arg( long, env = "GBASE_DOCKER_BASE " ) ]
54+ #[ arg( long, env = "BASE_DOCKER_BASE " ) ]
5555 docker_base : Option < String > ,
5656 /// Digest-pinned environment image for pack runs (`name@sha256:…`).
57- #[ arg( long, env = "GBASE_ENVIRONMENT_IMAGE " ) ]
57+ #[ arg( long, env = "BASE_ENVIRONMENT_IMAGE " ) ]
5858 environment_image : Option < String > ,
5959 /// Host directory of Harbor packs (`{root}/{pack_id}/`).
60- #[ arg( long, env = "GBASE_PACK_ROOT " ) ]
60+ #[ arg( long, env = "BASE_PACK_ROOT " ) ]
6161 pack_root : Option < PathBuf > ,
6262 /// Staging root for agent binds.
6363 #[ arg(
6464 long,
65- env = "GBASE_AGENT_WORK_ROOT " ,
66- default_value = "/tmp/gbase -agent-work"
65+ env = "BASE_AGENT_WORK_ROOT " ,
66+ default_value = "/tmp/base -agent-work"
6767 ) ]
6868 work_root : PathBuf ,
6969 /// Miner-supplied model API key file (mounted into agent; never logged).
70- #[ arg( long, env = "GBASE_MODEL_KEY_FILE " ) ]
70+ #[ arg( long, env = "BASE_MODEL_KEY_FILE " ) ]
7171 model_key_file : Option < PathBuf > ,
7272 /// Egress posture: `open` (default) or `allowlisted_proxy`.
73- #[ arg( long, env = "GBASE_AGENT_EGRESS " , default_value = "open" ) ]
73+ #[ arg( long, env = "BASE_AGENT_EGRESS " , default_value = "open" ) ]
7474 egress : String ,
7575}
7676
@@ -122,12 +122,12 @@ fn build_execution(cli: &Cli) -> Result<ExecutionBackend, String> {
122122 ) {
123123 ( Some ( base) , Some ( image) , Some ( root) ) => {
124124 if image. is_empty ( ) {
125- return Err ( "GBASE_ENVIRONMENT_IMAGE must be non-empty" . into ( ) ) ;
125+ return Err ( "BASE_ENVIRONMENT_IMAGE must be non-empty" . into ( ) ) ;
126126 }
127127 if let Some ( key) = & cli. model_key_file {
128128 if !key. is_file ( ) {
129129 return Err ( format ! (
130- "GBASE_MODEL_KEY_FILE not a file: {}" ,
130+ "BASE_MODEL_KEY_FILE not a file: {}" ,
131131 key. display( )
132132 ) ) ;
133133 }
@@ -146,7 +146,7 @@ fn build_execution(cli: &Cli) -> Result<ExecutionBackend, String> {
146146 hold : Duration :: ZERO ,
147147 } ) ,
148148 _ => Err (
149- "Docker pack execution requires GBASE_DOCKER_BASE + GBASE_ENVIRONMENT_IMAGE + GBASE_PACK_ROOT (or omit all three for stub)"
149+ "Docker pack execution requires BASE_DOCKER_BASE + BASE_ENVIRONMENT_IMAGE + BASE_PACK_ROOT (or omit all three for stub)"
150150 . into ( ) ,
151151 ) ,
152152 }
@@ -177,7 +177,7 @@ async fn serve(cli: Cli) -> Result<(), String> {
177177 let auth_enabled = !cli. dispatch_auth_disable ;
178178 if auth_enabled && trusted. is_none ( ) {
179179 return Err (
180- "dispatch auth enabled but GBASE_TRUSTED_CHALLENGE_PUBKEY unset (or pass --dispatch-auth-disable)"
180+ "dispatch auth enabled but BASE_TRUSTED_CHALLENGE_PUBKEY unset (or pass --dispatch-auth-disable)"
181181 . into ( ) ,
182182 ) ;
183183 }
0 commit comments