lmcloud guide

Overview

lmcloud is the shared procedural cloud architecture for LMScript. Instead of declarative infrastructure templates, lmcloud defines a single JSON schema (schema/lmcloud.dsl.json) and a reusable Go runtime library (github.com/lmctl-ai/lmcloud/hostkit) that provider hosts (lmaws, lmazure, lmgcp, lmoci) embed so one LMScript program can run against AWS, Azure, Google Cloud, Oracle Cloud, or local emulators.

Architecture and hostkit packages

The lmcloud repository is organized into modular Go packages and cross-provider conformance suites:

Emulator and endpoint resolution

Every lmcloud host resolves service endpoints using a deterministic precedence chain:

1. cloud.set_endpoint(service | "all", url)
2. LMCLOUD_<SVC>_ENDPOINT
3. LM<PROVIDER>_<SVC>_ENDPOINT
4. LMCLOUD_ENDPOINT
5. LM<PROVIDER>_ENDPOINT
6. Provider-native endpoint variables declared by each host

Plain HTTP URLs are accepted only for loopback hosts (127.0.0.1, localhost, ::1). Non-loopback HTTP URLs are rejected with INVALID_ARGUMENT before any network socket is opened. When no endpoint is configured and live mode is not enabled, the host automatically uses the in-process fake adapter.

Provider host Local emulator Default loopback endpoint Open versus enforce auth
lmaws awssim http://127.0.0.1:4566 Open mode accepts test/test SigV4; --auth enforce validates SigV4 signatures and IAM policy statements.
lmazure azuresim http://127.0.0.1:4577 Open mode accepts devstoreaccount1; --auth enforce validates SharedKey HMAC-SHA256 or Bearer tokens and RBAC rules.
lmgcp gcpsim http://127.0.0.1:4588 Open mode shares REST and gRPC on port 4588; --auth enforce validates OAuth Bearer tokens and GCP IAM bindings.
lmoci ocisim http://127.0.0.1:4599 Open mode isolates tenancies by keyId; --auth enforce validates RSA-SHA256 draft-cavage HTTP signatures and OCI IAM policies.

Service slices and portable semantics

The shared schema covers seven functional slices on the cloud context:

Live safety foundation and cost reservations

Live cloud execution is guarded by hostkit/safety so accidental mutations or runaway spend cannot occur:

Standard lmcode_std_v3 REST and CLI interfaces

Built on lmcode-go with lmcode_std_v3 (226 standard signatures), every lmcloud host supports the 10 standard SAM interfaces and 5 top-level dispatcher functions for turning cloud scripts into HTTP services or structured command-line utilities:

s = load_schema(schema="schema/lmcloud.dsl.json");
p = _lmcode_ s;
  @"/queues/:name/messages"
  fn post_msg(x: RestExchange) -> void implements RestPost {
    let id = cloud.queue_send(x.param("name"), x.body());
    x.status(201);
    x.json("{\"id\":\"" + id + "\"}");
  }

  rest_config("prefix", "/v1");
  cloud.queue_create("orders");
  rest_route("POST", "/queues/:name/messages", "post_msg");
end _lmcode_