# M1 Local Contract Smoke The M1 local smoke is a fast contract check for the current HWLAB MVP runtime. It runs only on the local machine, uses short-lived localhost processes, and does not deploy or call the frozen DEV endpoint. Run it from the repository root: ```sh node scripts/m1-contract-smoke.mjs ``` The equivalent npm entry point is: ```sh npm run m1:smoke ``` ## What It Checks - Starts `hwlab-cloud-api` on `127.0.0.1` with an ephemeral port and checks `/health`, `/live`, `GET /v1`, and `POST /rpc`. - Verifies the cloud-api runtime returns degraded `system.health` when DB persistence is not connected, describes the REST and JSON-RPC adapter surface, registers a gateway/box/capability, and records an accepted `hardware.operation.request` in process-local memory. - Starts `hwlab-gateway-simu`, `hwlab-box-simu`, and `hwlab-patch-panel` on ephemeral localhost ports. - Checks simulator health and status payloads, confirms cross-device propagation is `patch-panel-only`, writes a local box port value, and routes a signal through the patch panel fixture. - Parses `fixtures/mvp/runtime.json` through the CLI dry-run path and verifies the dry-run output names the MVP route, closed loops, evidence fixture, and the no-DEV/PROD-change disclaimer. ## Boundary This smoke is not the future DEV e2e acceptance test. It intentionally does not: - deploy to DEV or PROD; - call `http://74.48.78.17:16667`; - run browser e2e; - read secrets, tokens, kubeconfig, tunnel credentials, or deploy manifests; - validate real gateway, router, frp, edge proxy, agent, worker, or hardware behavior; - replace the L5 deploy manifest work. The check is scoped to local M1 contract readiness: existing cloud-api, patch-panel, simulator, and CLI dry-run runtime paths can be started or parsed and still agree on the frozen service IDs, DEV environment, JSON-RPC surface, DB degradation contract, and patch-panel-only topology assumptions. ## Follow-On DEV e2e A later real DEV e2e should run against the deployed DEV route, exercise the actual cloud-web/cloud-api, gateway/router/tunnel path, hardware trusted closed loop, agent automation closed loop, evidence persistence, and cleanup behavior. That later test should produce deployment/evidence artifacts and must remain separate from this local smoke harness. ## L2 Runtime Smoke The L2 simulator runtime has a separate local check: ```sh npm run l2:smoke ``` It starts two `hwlab-gateway-simu` and two `hwlab-box-simu` processes on ephemeral localhost ports. It proves simulator identity, AI/AO/DI/DO/FREQ state operations, gateway register/heartbeat/capability/invoke forwarding, error codes, audit/evidence shapes, and the patch-panel-only propagation boundary. It does not call DEV or PROD.