From aa6e79ac644a01e55a9b1f647bbfb4d93d61f170 Mon Sep 17 00:00:00 2001 From: cnc Date: Wed, 3 Jun 2026 19:11:22 +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=E3=80=82=E7=A6=81=E6=AD=A2=E9=A1=BA?= =?UTF-8?q?=E6=89=8B=E6=89=A9=E5=8A=9F=E8=83=BD=20smoke?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:收敛第 2/6 组 manifest/source-link 约束,公共 manifest source lister 只接受单个 manifest group 名称或 all,拒绝 core,header 这类复合 filter,避免 source coverage 查询静默误用;未扩展 smoke 功能。验证:CNC_SIM_ALL_NATIVE_GUARDRAILS_ONLY=1 ./test-all-native.sh、./test-native.sh、./test-linuxcnc-source-link.sh 均通过。 --- list-linuxcnc-manifest-sources.sh | 5 +++++ test-all-native.sh | 9 +++++++++ test-native.sh | 1 + 3 files changed, 15 insertions(+) diff --git a/list-linuxcnc-manifest-sources.sh b/list-linuxcnc-manifest-sources.sh index b45a624..9b2c8dd 100755 --- a/list-linuxcnc-manifest-sources.sh +++ b/list-linuxcnc-manifest-sources.sh @@ -29,6 +29,11 @@ checks_duplicate_group() { LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest" linuxcnc_root=$(cd "$linuxcnc_root" && pwd) +if [[ "$filter_group" != "all" && ! "$filter_group" =~ ^[A-Za-z0-9_-]+$ ]]; then + echo "manifest source filter must be a manifest group name: $filter_group" >&2 + exit 1 +fi + if [[ "$filter_group" != "all" ]] && ! contains_group "$allowed_groups" "$filter_group"; then echo "unknown manifest source filter: $filter_group" >&2 exit 1 diff --git a/test-all-native.sh b/test-all-native.sh index d51de34..c386f5a 100755 --- a/test-all-native.sh +++ b/test-all-native.sh @@ -1171,6 +1171,15 @@ if grep -E '\.(hh|h)$' <<<"$native_manifest_core" >/dev/null; then echo "native manifest core compile group includes headers" >&2 exit 1 fi +if ./list-linuxcnc-source-manifest-sources.sh "$manifest" core,header >"$unknown_filter_log" 2>&1; then + echo "native manifest source lister accepted a compound filter" >&2 + exit 1 +fi +if ! grep -F "manifest source filter must be a manifest group name: core,header" "$unknown_filter_log" >/dev/null; then + echo "native manifest source lister did not report compound filters clearly" >&2 + sed -n '1,20p' "$unknown_filter_log" >&2 + exit 1 +fi if ./list-linuxcnc-source-manifest-sources.sh "$manifest" bogus >"$unknown_filter_log" 2>&1; then echo "native manifest source lister accepted unknown filter" >&2 exit 1 diff --git a/test-native.sh b/test-native.sh index 773432e..82ec3c6 100755 --- a/test-native.sh +++ b/test-native.sh @@ -95,6 +95,7 @@ grep -F 'LinuxCNC source basis: the RS274 dump probe pairs LinuxCNC interpreter' grep -F 'LinuxCNC source basis: the bridge smoke source list is limited to the' list-linuxcnc-bridge-smoke-project-sources.sh >/dev/null grep -F 'LinuxCNC source basis: the RS274 API source list combines CMake-listed core' list-linuxcnc-rs274-api-project-sources.sh >/dev/null grep -F 'LinuxCNC source basis: manifest listers expose LinuxCNC-root relative source' list-linuxcnc-manifest-sources.sh >/dev/null +grep -F 'manifest source filter must be a manifest group name: $filter_group' list-linuxcnc-manifest-sources.sh >/dev/null grep -F 'manifest source must be LinuxCNC-root relative: $path' list-linuxcnc-manifest-sources.sh >/dev/null grep -F 'LinuxCNC source basis: linuxcnc-rs274-source-files.txt enumerates the native' list-linuxcnc-source-manifest-sources.sh >/dev/null grep -F 'LinuxCNC source basis: linuxcnc-kinematics-source-files.txt tracks' list-linuxcnc-kinematics-manifest-sources.sh >/dev/null