generate_system_ldr
Generates a new .ldr ladder-logic file for multiple independent ControlSpec recipes in one SystemSpec, allocating internal M/T/C and validating acceptance cases before writing a new artifact.
Instructions
Generate a new .ldr for two or more independent ControlSpec recipes in one SystemSpec.
Never use this for one recipe, dependent ordered steps or caller-authored IR: use
generate_control_ldr, generate_sequence_ldr or generate_ldr respectively. This tool
allocates internal M/T/C, permits shared inputs, rejects explicit overlaps, checks
acceptance and writes only a new artifact. Validation failure writes nothing. It does not
execute existing IR or return a trace; use simulate_ladder for that.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"output_name": "<output_name>",
"spec": "<spec>",
"io_contract": "<io_contract>"
},
"name": "generate_system_ldr"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | System requirement plus one or more independent control recipes. | |
| acceptance | No | Optional executable scan cases checked before and after encoding. | |
| io_contract | Yes | Complete user-authorized physical X inputs and Y outputs. | |
| output_name | Yes | New plain .ldr filename in the artifact directory; never overwrites. | |
| strict_writers | No | When true, reject conflicting or unsafe multiple device writers. | |
| target_profile | No | Optional sampled CPU/header profile; omit to use the default profile. | |
| require_acceptance | No | When true, reject generation unless acceptance cases are supplied. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Validation error code, message and written=false. | |
| artifact | No | Artifact metadata on success; absent when validation fails before writing. | |
| warnings | No | Generation or verification warnings; empty when none were reported. | |
| diagnosis | No | LDR failure diagnosis, when available. | |
| response_mode | Yes | Compact or full response. |