{"record":{"id":"09f4791d0b6580d8","repo":"astrid-runtime/astrid","slug":"this-executable-is-an-astrid-provider-companion-n","errorCode":null,"errorMessage":"this executable is an Astrid provider companion, not an interactive command","messagePattern":"this executable is an Astrid provider companion, not an interactive command","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fskit/src/main.rs","lineNumber":78,"sourceCode":"    let response = run().await;\n    match response {\n        Ok(response) => {\n            if serde_json::to_writer(std::io::stdout().lock(), &response).is_err() {\n                std::process::exit(2);\n            }\n            println!();\n        },\n        Err(error) => {\n            eprintln!(\"{PROVIDER_NAME}: {error:#}\");\n            std::process::exit(2);\n        },\n    }\n}\n\nasync fn run() -> Result<StorageProviderResponseV1> {\n    let arguments = std::env::args_os().skip(1).collect::<Vec<_>>();\n    if arguments.as_slice() != [std::ffi::OsStr::new(\"--astrid-provider-stdio-v1\")] {\n        bail!(\"this executable is an Astrid provider companion, not an interactive command\");\n    }\n    let mut bytes = Vec::new();\n    std::io::stdin()\n        .lock()\n        .take(MAX_REQUEST_BYTES + 1)\n        .read_to_end(&mut bytes)\n        .context(\"read provider request\")?;\n    if bytes.len() as u64 > MAX_REQUEST_BYTES {\n        bail!(\"provider request exceeds limit\");\n    }\n    let request: StorageProviderRequestV1 =\n        serde_json::from_slice(&bytes).context(\"decode provider request\")?;\n    if request.protocol_version != STORAGE_PROVIDER_PROTOCOL_V1 {\n        bail!(\"unsupported provider protocol {}\", request.protocol_version);\n    }\n    let request_id = request.request_id;\n    let outcome = match execute(request).await {\n        Ok(success) => StorageProviderOutcomeV1::Success(success),","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fskit/src/main.rs#L60-L96","documentation":"The fskit provider companion binary is not a general-purpose CLI. run() requires exactly one argument, the literal --astrid-provider-stdio-v1, under which it speaks a request/response protocol on stdin/stdout. Any other invocation is rejected to prevent accidental interactive use.","triggerScenarios":"Running the binary with no arguments, with the wrong flag, or with extra arguments — anything other than exactly `binary --astrid-provider-stdio-v1`.","commonSituations":"A developer runs the executable directly from a terminal to 'try it out'; a supervisor or script launches it with the wrong protocol flag (e.g. an outdated protocol version string); packaging/wrapper scripts add extra arguments.","solutions":["Launch the binary with exactly one argument: --astrid-provider-stdio-v1","Check how the process is spawned (kernel/supervisor config) and correct the argument list","Do not use this binary interactively; use the kernel admin tooling instead"],"exampleFix":"// before\n$ astrid-storage-provider-fskit --mount /mnt/data\n// after\n$ astrid-storage-provider-fskit --astrid-provider-stdio-v1","handlingStrategy":"validation","validationCode":"// spawn check (client side)\nconst PROTOCOL_FLAG: &str = \"--astrid-provider-stdio-v1\";\nassert_eq!(args, vec![PROTOCOL_FLAG], \"companion must be launched with exactly the stdio v1 protocol flag\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never invoke the companion manually; let the kernel spawn it","Keep the protocol flag constant shared between kernel and companion builds","Check process supervisor/service definitions for stale launch arguments"],"tags":["cli","protocol","rust"],"backgroundTag":"invalid-cli-argument","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}