{
  "format": "wire-edm-post",
  "schemaVersion": 2,
  "manifest": {
    "id": "example.linuxcnc-wire-edm",
    "name": "Example LinuxCNC Wire EDM",
    "version": "1.1.0",
    "engineApiVersion": "1",
    "description": "Minimal deterministic fixture post.",
    "targets": [
      {
        "manufacturer": "LinuxCNC",
        "controllerManufacturer": "LinuxCNC",
        "controller": "LinuxCNC 2.9",
        "firmware": {
          "status": "known",
          "versions": [
            "2.9"
          ]
        },
        "machineModels": []
      }
    ],
    "capabilities": {
      "circularInterpolation": "none",
      "controllerCompensation": "none",
      "operations": "single",
      "passes": "single",
      "threading": "none",
      "wireSeparation": [],
      "programStops": false,
      "taperAxes": false,
      "technologySelection": false,
      "initialWirePosition": true
    },
    "execution": {
      "initialWirePosition": "required",
      "compensationLifecycle": "none",
      "compensationRequiredForEveryOperation": false
    },
    "output": {
      "fileExtension": "ngc",
      "lineEnding": "lf",
      "encoding": "utf-8",
      "finalNewline": true,
      "blockNumbering": {
        "mode": "none"
      },
      "programEnvelope": {
        "prefix": [],
        "suffix": []
      }
    },
    "properties": {
      "coordinatePrecision": {
        "type": "integer",
        "description": "Digits after the decimal separator before optional trailing-zero trimming.",
        "required": true,
        "minimum": 0,
        "maximum": 6,
        "suggestedValue": 3
      }
    },
    "authoredFor": {
      "appVersion": "0.0.686",
      "documentationUrl": "https://github.com/Insignifi4nt/wireedm-gcode-parser/tree/v0.0.686/docs/post-authoring/v1"
    }
  },
  "dialect": {
    "id": "linuxcnc.gcode-2.9",
    "description": "Small vocabulary evidenced from the LinuxCNC 2.9 G-code quick reference.",
    "commands": {
      "distance.absolute": {
        "template": "G90",
        "parameters": {},
        "effects": [
          "distance.absolute"
        ],
        "requires": [],
        "evidenceRefs": [
          "linuxcnc-g90"
        ]
      },
      "motion.linear": {
        "template": "G1 X{x} Y{y}",
        "parameters": {
          "x": {
            "type": "number",
            "role": "motion.end-x",
            "description": "X endpoint coordinate.",
            "format": {
              "style": "fixed",
              "fractionDigits": {
                "kind": "property",
                "property": "coordinatePrecision"
              },
              "decimalSeparator": ".",
              "trimTrailingZeros": true,
              "negativeZero": "zero"
            }
          },
          "y": {
            "type": "number",
            "role": "motion.end-y",
            "description": "Y endpoint coordinate.",
            "format": {
              "style": "fixed",
              "fractionDigits": {
                "kind": "property",
                "property": "coordinatePrecision"
              },
              "decimalSeparator": ".",
              "trimTrailingZeros": true,
              "negativeZero": "zero"
            }
          }
        },
        "effects": [
          "position.changed"
        ],
        "requires": [
          "distance.absolute"
        ],
        "evidenceRefs": [
          "linuxcnc-g1"
        ]
      },
      "program.end": {
        "template": "M02",
        "parameters": {},
        "effects": [
          "program.ended"
        ],
        "requires": [],
        "evidenceRefs": [
          "linuxcnc-m2"
        ]
      }
    }
  },
  "source": {
    "language": "javascript",
    "entrypoint": "createPost",
    "code": "export function createPost(api) {\n  return {\n    onEvent(event) {\n      if (event.kind === 'program-start') return api.emitCommand('distance.absolute', {});\n      if (event.kind === 'position') return api.emitMotion('motion.linear', { x: event.to.x, y: event.to.y });\n      if (event.kind === 'motion' && event.motion === 'linear') return api.emitMotion('motion.linear', { x: event.end.x, y: event.end.y });\n      if (event.kind === 'motion') throw new Error('Circular motion is not supported.');\n      if (event.kind === 'program-end') return api.emitCommand('program.end', {});\n      api.consume('No controller block is required for this event.');\n    }\n  };\n}"
  },
  "sources": [
    {
      "id": "source.linuxcnc-gcode-2.9",
      "kind": "controller-reference",
      "name": "LinuxCNC 2.9 G-code Quick Reference",
      "uri": "https://linuxcnc.org/docs/html/gcode.html",
      "mediaType": "text/html",
      "contentSha256": "e8a33470af7a15eea446ee55d42ec30c4688d589e98019a0c62dba1634a3d319",
      "documentNumber": "LinuxCNC G-Code Quick Reference",
      "revision": "2.9 fetched 2026-08-28"
    }
  ],
  "evidence": [
    {
      "id": "linuxcnc-g90",
      "sourceRef": "source.linuxcnc-gcode-2.9",
      "selector": {
        "location": "G90, G91 — Distance Mode",
        "section": "G-code quick reference",
        "exact": "G90, G91 — Distance Mode"
      },
      "claim": "LinuxCNC 2.9 assigns G90 to absolute distance mode.",
      "supports": [
        {
          "kind": "command",
          "id": "distance.absolute"
        }
      ],
      "appliesTo": {
        "controllerManufacturers": [
          "LinuxCNC"
        ],
        "controllerModels": [
          "LinuxCNC 2.9"
        ],
        "machineModels": [],
        "firmware": "2.9"
      },
      "review": {
        "status": "reviewed",
        "reviewer": "wire-edm-workbench-research",
        "reviewedAt": "2026-08-28T00:00:00.000Z"
      }
    },
    {
      "id": "linuxcnc-m2",
      "sourceRef": "source.linuxcnc-gcode-2.9",
      "selector": {
        "location": "M2, M30 — Program End",
        "section": "M-code quick reference",
        "exact": "M2, M30 — Program End"
      },
      "claim": "LinuxCNC 2.9 assigns M2 to program end.",
      "supports": [
        {
          "kind": "command",
          "id": "program.end"
        }
      ],
      "appliesTo": {
        "controllerManufacturers": [
          "LinuxCNC"
        ],
        "controllerModels": [
          "LinuxCNC 2.9"
        ],
        "machineModels": [],
        "firmware": "2.9"
      },
      "review": {
        "status": "reviewed",
        "reviewer": "wire-edm-workbench-research",
        "reviewedAt": "2026-08-28T00:00:00.000Z"
      }
    },
    {
      "id": "linuxcnc-g1",
      "sourceRef": "source.linuxcnc-gcode-2.9",
      "selector": {
        "location": "G0, G1 — Linear Move",
        "section": "G-code quick reference",
        "exact": "G0, G1 — Linear Move"
      },
      "claim": "LinuxCNC 2.9 assigns G1 to coordinated linear motion.",
      "supports": [
        {
          "kind": "command",
          "id": "motion.linear"
        }
      ],
      "appliesTo": {
        "controllerManufacturers": [
          "LinuxCNC"
        ],
        "controllerModels": [
          "LinuxCNC 2.9"
        ],
        "machineModels": [],
        "firmware": "2.9"
      },
      "review": {
        "status": "reviewed",
        "reviewer": "wire-edm-workbench-research",
        "reviewedAt": "2026-08-28T00:00:00.000Z"
      }
    }
  ],
  "fixtures": [
    {
      "id": "single-closed-contour-minimum-precision",
      "description": "One linear closed contour at the minimum coordinate precision.",
      "planFixture": "core.single-closed-contour.v1",
      "properties": {
        "coordinatePrecision": 0
      },
      "expectedProgram": "G90\nG1 X10 Y0\nG1 X10 Y10\nG1 X0 Y10\nG1 X0 Y0\nM02",
      "expectedArtifact": "G90\nG1 X10 Y0\nG1 X10 Y10\nG1 X0 Y10\nG1 X0 Y0\nM02\n",
      "evidenceRefs": [
        "linuxcnc-g90",
        "linuxcnc-g1",
        "linuxcnc-m2"
      ]
    },
    {
      "id": "single-closed-contour-maximum-precision",
      "description": "One linear closed contour at the maximum coordinate precision.",
      "planFixture": "core.single-closed-contour.v1",
      "properties": {
        "coordinatePrecision": 6
      },
      "expectedProgram": "G90\nG1 X10 Y0\nG1 X10 Y10\nG1 X0 Y10\nG1 X0 Y0\nM02",
      "expectedArtifact": "G90\nG1 X10 Y0\nG1 X10 Y10\nG1 X0 Y10\nG1 X0 Y0\nM02\n",
      "evidenceRefs": [
        "linuxcnc-g90",
        "linuxcnc-g1",
        "linuxcnc-m2"
      ]
    }
  ]
}
