# LinuxCNC switchkins/remap source map This map records the source basis for generated M428/M429/M430 switchkins aliases and config cases. It is a generator/table map only; it must not add CNC behavior, must not expand the temporary smoke parser, and must not expose LinuxCNC source-only assets as browser API fields. ## LinuxCNC Source Basis - `configs/sim/**.ini` files with `REMAP = M428`, `REMAP = M429`, or `REMAP = M430` provide the switchkins configuration roots. - `remap_subs/{428,429,430}remap.ngc` files provide the adjacent `#` assignments. - `src/hal/utils/halcmd_commands.cc` `do_loadusr_cmd()` and `getopt("+wWin:")` define the `loadusr` option model used by the generator. - `src/hal/utils/halcmd_completion.c` documents common `loadusr` `-W/-Wn/-w/-iw` forms preserved by the generator. ## Generated Coverage | Output | Count | Source coverage role | | --- | ---: | --- | | `core/src/linuxcnc_switchkins_remap_table.inc` | 177 | Generated switchkins aliases from LinuxCNC INI/HAL/remap sources. | | `core/tests/linuxcnc_switchkins_remap_config_cases.inc` | 616 | Generated C++ config cases for accepted switchkins config fields. | | `web/public/linuxcnc_switchkins_remap_config_cases.json` | 616 | Generated browser-readable config cases mirroring the C++ cases. | | LinuxCNC M428/M429/M430 remap sources | 31 | LinuxCNC `#` source assignments. | | LinuxCNC switchkins REMAP INI sources | 16 | LinuxCNC configs that declare M428/M429/M430 remaps. | ## Boundaries - `[EMCIO] TOOL_TABLE` entries are source coverage only. They must stay in the kinematics manifest as `tooldata` entries and must not become generated switchkins aliases, config fields, or browser option keys. - `asset`, `metadata`, and `tooldata` inputs referenced by switchkins configs are source coverage, not browser API surface. - Generated tables must continue to derive M428/M429/M430 kinstypes from LinuxCNC remap `#` assignments, not from hand-authored behavior. - `test-native.sh`, `test-linuxcnc-source-link.sh`, and `build-wasm.sh` must run `./check-linuxcnc-switchkins-remap-source-map.sh` before consuming generated config aliases, source-linked LinuxCNC objects, or browser artifacts. - The switchkins/remap source-map guard validates LinuxCNC source/config ownership and generated table drift only; it does not interpret G-code. ## Checks Run: ```bash ./check-linuxcnc-switchkins-remap-source-map.sh ./check-linuxcnc-switchkins-remap-table.sh linuxcnc-kinematics-source-files.txt ./test-native.sh ./test-linuxcnc-source-link.sh ``` `check-linuxcnc-switchkins-remap-source-map.sh` keeps this document, generator source anchors, generated output counts, and source-only `TOOL_TABLE` boundary synchronized.