diff --git a/wasm-port/docs/porting-steps-standalone.md b/wasm-port/docs/porting-steps-standalone.md index a981175..1d15488 100644 --- a/wasm-port/docs/porting-steps-standalone.md +++ b/wasm-port/docs/porting-steps-standalone.md @@ -488,6 +488,11 @@ Current verified progress: script compares that map against every `.c` and `.cc` entry in `tools/source-manifest.txt`, so future LinuxCNC source additions fail validation unless they also get an explicit standalone source compile probe. +- `tools/verify_no_standalone_cnc_semantics.sh` now guards against + reintroducing a standalone `Interp::convert_g()` definition outside + `vendor/linuxcnc/`. This keeps G-code group conversion on the vendored + LinuxCNC `interp_convert.cc` path instead of allowing the wrapper layer to + grow another project-authored conversion implementation. ## Phase 4: Port INI Parsing Without Editing Upstream @@ -786,8 +791,8 @@ Keep these documents under `wasm-port/docs/`: Continue expanding the standalone interpreter core from the verified minimal traverse path: -1. replace the temporary minimal `convert_g()` implementation with calls into - vendored LinuxCNC interpreter conversion code. +1. keep `convert_g()` execution on vendored LinuxCNC interpreter conversion + code and reject any new standalone `Interp::convert_g()` implementation. 2. identify and shim the native runtime symbols blocking direct compilation of `interp_convert.cc`, `interp_execute.cc`, and related interpreter files. 3. keep fixture coverage as regression protection while deleting temporary diff --git a/wasm-port/tests/native/verify_native_probes.sh b/wasm-port/tests/native/verify_native_probes.sh index 5976218..74cfbfb 100755 --- a/wasm-port/tests/native/verify_native_probes.sh +++ b/wasm-port/tests/native/verify_native_probes.sh @@ -10,6 +10,7 @@ CANON_ERROR_FIXTURE_DIR="$ROOT_DIR/tests/fixtures/canon_errors" NAMEDPARAM_INI_FIXTURE="$ROOT_DIR/tests/fixtures/ini/namedparams.ini" "$ROOT_DIR/tools/verify_vendor_sync.sh" +"$ROOT_DIR/tools/verify_no_standalone_cnc_semantics.sh" "$ROOT_DIR/tools/build_native_probes.sh" check_source_probe_coverage() { diff --git a/wasm-port/tools/verify_no_standalone_cnc_semantics.sh b/wasm-port/tools/verify_no_standalone_cnc_semantics.sh new file mode 100755 index 0000000..41a63a9 --- /dev/null +++ b/wasm-port/tools/verify_no_standalone_cnc_semantics.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" + +TMP_FILE="$(mktemp)" +trap 'rm -f "$TMP_FILE"' EXIT + +find \ + "$ROOT_DIR/runtime" \ + "$ROOT_DIR/tests" \ + "$ROOT_DIR/tools" \ + -type f \ + \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' -o -name '*.hh' -o -name '*.hpp' -o -name '*.js' -o -name '*.ts' \) \ + ! -path "$ROOT_DIR/vendor/*" \ + ! -path "$ROOT_DIR/runtime/ui/ini-panel/linuxcnc_ini.js" \ + -print0 | + xargs -0 grep -nE '^[[:space:]]*int[[:space:]]+Interp::convert_g[[:space:]]*\(' > "$TMP_FILE" || true + +if [[ -s "$TMP_FILE" ]]; then + echo "standalone Interp::convert_g definitions are not allowed:" >&2 + cat "$TMP_FILE" >&2 + exit 1 +fi + +echo "standalone CNC semantics guard complete"