lmdebug guide

Overview

lmdebug consolidates Linux networking utilities, system performance monitors, /proc process inspectors, YARA and hash-based threat detection, libpcap packet analysis, and the 226-signature lmcode_std_v3 standard library into a single binary. Rather than parsing inconsistent text tables from external shell tools, agents and scripts invoke lmdebug on the CLI or through compiled _lmcode_ bytecode to receive deterministic objects and JSON documents.

Domain architecture and introspection modes

The executable partitions functionality across six typed domain contexts so read-only queries, packet captures, and state mutations remain isolated and composable:

Audited mutation framework and security boundaries

Every state-changing operation in lmdebug (link.set, sys.set, proc.kill, detect.hash_import, detect.quarantine, and detect.restore) is governed by a fail-closed change framework:

Cross-tool segment timing and TLS 1.3 packet correlation

lmdebug pairs with lmssl (v0.2.0+) to correlate application-visible request timing with wire-level packet captures on loopback or offline fixtures without root privileges:

Standard lmcode_std_v3 REST and CLI interfaces

lmdebug embeds the 226-signature lmcode_std_v3 standard catalog, enabling any _lmcode_ script to expose its diagnostic or planning logic as an HTTP microservice or stateless CLI tool:

p = _lmcode_ cli="lmdebug" install="github:lmctl-ai/lmdebug@latest";
@"--iface"
fn opt_iface(x: RestExchange) -> void implements CliOption {
  x.set("iface", x.query("iface"));
}

@"ethtool"
fn cmd_ethtool(x: RestExchange) -> void implements CliCommand {
  let lnk = net.ethtool_link(x.get("iface"));
  x.send(lnk.iface() + ":up=" + str(lnk.link_detected()));
}

@"/proc/:pid"
fn get_proc(x: RestExchange) -> void implements RestGet {
  let info = proc.show(int(x.param("pid")));
  x.json("{\"pid\":" + str(info.pid()) + ",\"name\":\"" + info.name() + "\"}");
}

rest_config("session", "global");
assert_eq(rest_cli(str_split("--iface=lo ethtool", " ")), "lo:up=true");
end _lmcode_