From 5ce3c181039cd313b4cd1844f89459c0217be2b1 Mon Sep 17 00:00:00 2001 From: cnc Date: Fri, 5 Jun 2026 07:01:37 +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=A7browser-a?= =?UTF-8?q?pp=20source-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-browser-app-source-map.sh | 12 +++++++++++- docs/linuxcnc-browser-app-source-map.md | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/check-linuxcnc-browser-app-source-map.sh b/check-linuxcnc-browser-app-source-map.sh index 7be57d2..f173695 100755 --- a/check-linuxcnc-browser-app-source-map.sh +++ b/check-linuxcnc-browser-app-source-map.sh @@ -7,7 +7,7 @@ cd "$(dirname "$0")" # LinuxCNC RS274 parameter-file defaults, rs274ngc_pre.cc restore/save/read # file semantics, and the existing OPFS-backed wasm-core bridge. It validates # app integration policy only; it does not add CNC behavior or expand smoke -# parsing. +# parsing, or interpret G-code. linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc} linuxcnc_root=$(cd "$linuxcnc_root" && pwd) @@ -104,10 +104,20 @@ for phrase in [ "parameters/rs274ngc.var", "visible backend selector must stay limited", "./check-linuxcnc-browser-app-source-map.sh", + "does not interpret G-code", ]: if phrase not in source_map: raise SystemExit(f"docs/linuxcnc-browser-app-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-browser-app-source-map.sh" not in text: + raise SystemExit(f"{entry} must run ./check-linuxcnc-browser-app-source-map.sh") + app = Path("web/src/app.js").read_text(encoding="utf-8") if "parse(" in app.replace("parseProgram", ""): raise SystemExit("browser app should route program execution through parseFileWithParameterFile, not direct parse") diff --git a/docs/linuxcnc-browser-app-source-map.md b/docs/linuxcnc-browser-app-source-map.md index 474b49d..822e8e4 100644 --- a/docs/linuxcnc-browser-app-source-map.md +++ b/docs/linuxcnc-browser-app-source-map.md @@ -37,6 +37,11 @@ must not expand the temporary smoke parser. - The app must require OPFS for browser program parsing and call `parseFileWithParameterFile(programPath, parameterPath, "linuxcnc", ...)`. - The visible backend selector must stay limited to the LinuxCNC RS274 backend. +- `test-native.sh`, `test-linuxcnc-source-link.sh`, and `build-wasm.sh` must + run `./check-linuxcnc-browser-app-source-map.sh` before consuming app-backed + browser artifacts or source-linked LinuxCNC objects. +- The browser app source-map guard validates LinuxCNC source-backed bridge + routing and OPFS policy only; it does not interpret G-code. ## Checks @@ -46,6 +51,7 @@ Run: ./check-linuxcnc-browser-app-source-map.sh ./test-native.sh ./test-linuxcnc-source-link.sh +./build-wasm.sh ``` `check-linuxcnc-browser-app-source-map.sh` keeps this document, LinuxCNC source