From fb2b5c4920fec2b7266240ae5634a5fbb3784bb0 Mon Sep 17 00:00:00 2001 From: cnc Date: Fri, 5 Jun 2026 06:48:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E8=80=83=E6=89=80=E6=9C=89=E5=88=86?= =?UTF-8?q?=E7=BB=84=EF=BC=8C=E5=AE=8C=E6=88=90=E5=B0=BD=E9=87=8F=E5=A4=9A?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=EF=BC=9A=E6=94=B6=E7=B4=A7RS274=20s?= =?UTF-8?q?ource-map=E8=BE=B9=E7=95=8C=E5=AE=88=E5=8D=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check-linuxcnc-rs274-source-map.sh | 26 +++++++++++++++++++++++-- docs/linuxcnc-rs274-source-map.md | 31 +++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/check-linuxcnc-rs274-source-map.sh b/check-linuxcnc-rs274-source-map.sh index 881a3a2..39ece27 100755 --- a/check-linuxcnc-rs274-source-map.sh +++ b/check-linuxcnc-rs274-source-map.sh @@ -5,8 +5,8 @@ cd "$(dirname "$0")" # LinuxCNC source basis: this guard keeps the local source map aligned with the # LinuxCNC-root relative rs274 manifests that drive native and WASM source-link -# probes. It validates documentation/manifest drift only; it does not interpret -# CNC behavior. +# probes. It validates documentation/manifest drift only; it does not add CNC +# behavior, expand smoke parsing, or interpret G-code. python3 - <<'PY' from pathlib import Path @@ -77,4 +77,26 @@ for section, expected_entries in expected.items(): raise SystemExit( f"docs/linuxcnc-rs274-source-map.md {labels[section]} list no longer matches source manifest" ) + +for phrase in [ + "must not add CNC behavior", + "must not expand the temporary smoke parser", + "source coverage only", + "must not become browser API fields", + "temporary smoke parser fallback behavior", + "Browser-hostile dependencies must remain tracked blockers", + "./check-linuxcnc-rs274-source-map.sh", + "does not interpret G-code", +]: + if phrase not in source_map: + raise SystemExit(f"docs/linuxcnc-rs274-source-map.md missing boundary phrase: {phrase}") + +for entry in [ + "test-native.sh", + "test-linuxcnc-source-link.sh", + "build-wasm.sh", +]: + text = Path(entry).read_text(encoding="utf-8") + if "./check-linuxcnc-rs274-source-map.sh" not in text: + raise SystemExit(f"{entry} must run ./check-linuxcnc-rs274-source-map.sh") PY diff --git a/docs/linuxcnc-rs274-source-map.md b/docs/linuxcnc-rs274-source-map.md index 6a182ed..428adaa 100644 --- a/docs/linuxcnc-rs274-source-map.md +++ b/docs/linuxcnc-rs274-source-map.md @@ -1,6 +1,8 @@ # LinuxCNC rs274 source map -This is the working map for moving from native `librs274` linking to source-level compilation and then to wasm. +This is the working map for moving from native `librs274` linking to +source-level compilation and then to wasm. It is a source-manifest guard only; +it must not add CNC behavior and must not expand the temporary smoke parser. ## Compile assumptions @@ -176,6 +178,33 @@ the browser-safe shims and manifest completeness checks: - persistent parameter file writes. - dynamic INI/HAL queries. +## Boundaries + +- Native and WASM source lists in this document must match + `linuxcnc-rs274-source-files.txt` and + `linuxcnc-rs274-wasm-source-files.txt` exactly. +- Python binding modules, WASM-blocked sources, and WASM-blocked headers are + source coverage only. +- They must not become browser API fields or temporary smoke parser fallback behavior. +- Browser-hostile dependencies must remain tracked blockers until they are + ported, trimmed, wrapped, or replaced by source-backed browser-safe LinuxCNC + adaptations. +- `test-native.sh`, `test-linuxcnc-source-link.sh`, and `build-wasm.sh` must + run `./check-linuxcnc-rs274-source-map.sh` before consuming generated native + objects, source-linked LinuxCNC objects, or browser artifacts. +- The RS274 source-map guard validates LinuxCNC source ownership and manifest + drift only; it does not interpret G-code. + +## Checks + +Run: + +```bash +./check-linuxcnc-rs274-source-map.sh +./test-native.sh +./test-linuxcnc-source-link.sh +``` + The wasm-safe runtime now constructs its detached `EMC_STAT` through LinuxCNC `src/emc/nml_intf/emcops.cc`. The singleton follows LinuxCNC `src/emc/sai/dummyemcstat.cc`, and the required `NMLmsg`/`RCS_STAT_MSG`