Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

fix(ci): route the new lanes through canonical leg entries

Martin Vogelf5baf1baef67
diff --git a/.github/workflows/_lint.yml b/.github/workflows/_lint.yml
index ec85f8406..d8d1c5e51 100644
--- a/.github/workflows/_lint.yml
+++ b/.github/workflows/_lint.yml
@@ -73,4 +73,4 @@ jobs:
sudo apt-get install -y clang-tidy-22
- name: Memory-analyzer gate
- run: make -f Makefile.cbm lint-mem-ci CLANG_TIDY=clang-tidy-22
+ run: scripts/ci/lint-mem.sh clang-tidy-22
diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml
index c11a29bcb..2a20d1bba 100644
--- a/.github/workflows/_test.yml
+++ b/.github/workflows/_test.yml
@@ -218,9 +218,9 @@ jobs:
- name: Test (clang-22, ASan+UBSan + off-by-default ASan checks)
env:
ASAN_OPTIONS: "detect_stack_use_after_return=1:detect_invalid_pointer_pairs=2:strict_string_checks=1:detect_stack_use_after_scope=1"
- run: >
- scripts/test.sh CC=clang-22 CXX=clang++-22
- SANITIZE="-fsanitize=address,undefined,pointer-compare,pointer-subtract -fno-omit-frame-pointer -fno-optimize-sibling-calls"
+ run: |
+ scripts/test.sh CC=clang-22 CXX=clang++-22 \
+ SANITIZE="-fsanitize=address,undefined,pointer-compare,pointer-subtract -fno-omit-frame-pointer -fno-optimize-sibling-calls"
- name: Compiler cache (save)
if: always()
@@ -258,16 +258,10 @@ jobs:
key: buildx-msan-${{ hashFiles('test-infrastructure/Dockerfile.msan') }}
- name: Build MSan image (cached layers)
- run: |
- docker buildx create --use --name msan-builder
- docker buildx build \
- --cache-from type=local,src=/tmp/.buildx-msan \
- --cache-to type=local,dest=/tmp/.buildx-msan,mode=max \
- -f test-infrastructure/Dockerfile.msan \
- -t cbm-msan:ci --load test-infrastructure/
+ run: scripts/ci/msan-lane.sh build
- name: MSan full suite (no exclusions — x86-64 is the real test)
- run: docker run --rm -e MSAN_EXCLUDE="" -v "$PWD:/src" -w /src cbm-msan:ci
+ run: scripts/ci/msan-lane.sh run
# macOS leak coverage. LeakSanitizer runs by default under ASan on Linux, so
# test-unix's ubuntu legs have always had it; on macOS it is off by default
diff --git a/scripts/ci/lint-mem.sh b/scripts/ci/lint-mem.sh
new file mode 100644
index 000000000..61fe96074
--- /dev/null
+++ b/scripts/ci/lint-mem.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# clang-analyzer memory gate — the canonical entry, used by every venue.
+#
+# Path-sensitive analysis for leak paths, null derefs and uninitialized reads.
+# Findings are gated: each one is either fixed, or carries an argued entry in
+# scripts/lint-mem-whitelist.txt that is pinned to the sha256 of the function
+# it argues about, so it expires when that function changes. See
+# scripts/lint-mem-gate.py.
+#
+# Locally: make -f Makefile.cbm lint-mem-ci (or `lint-mem` for the
+# non-gating triage view over the same checks).
+#
+# Usage: scripts/ci/lint-mem.sh [CLANG_TIDY_BINARY]
+set -euo pipefail
+
+cd "$(dirname "$0")/../.."
+
+CLANG_TIDY_BIN="${1:-${CLANG_TIDY:-clang-tidy}}"
+
+exec make -f Makefile.cbm lint-mem-ci CLANG_TIDY="$CLANG_TIDY_BIN"
diff --git a/scripts/ci/msan-lane.sh b/scripts/ci/msan-lane.sh
new file mode 100644
index 000000000..31f8c080a
--- /dev/null
+++ b/scripts/ci/msan-lane.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+# MemorySanitizer lane — the canonical entry, used by every venue.
+#
+# MSan needs every linked library instrumented or reads of memory those
+# libraries wrote report as uninitialized, so the lane runs inside an image
+# carrying an MSan-built libc++/libc++abi/libunwind and zlib
+# (test-infrastructure/Dockerfile.msan). Building that image is the expensive
+# part, hence the buildx layer cache.
+#
+# Locally the same lane is reached through the compose service:
+# ./test-infrastructure/run.sh msan
+# which shares scripts/msan.sh with this path — one harness, both venues.
+#
+# Usage: scripts/ci/msan-lane.sh [build|run|all] (default: all)
+set -euo pipefail
+
+cd "$(dirname "$0")/../.."
+
+CACHE_DIR="${MSAN_BUILDX_CACHE:-/tmp/.buildx-msan}"
+IMAGE="${MSAN_IMAGE:-cbm-msan:ci}"
+BUILDER="${MSAN_BUILDER:-msan-builder}"
+MODE="${1:-all}"
+
+build_image() {
+ echo "=== MSan image (buildx, cached layers) ==="
+ # A builder may already exist from a previous step or a retried job.
+ docker buildx create --use --name "$BUILDER" 2>/dev/null || docker buildx use "$BUILDER"
+ docker buildx build \
+ --cache-from "type=local,src=$CACHE_DIR" \
+ --cache-to "type=local,dest=$CACHE_DIR,mode=max" \
+ -f test-infrastructure/Dockerfile.msan \
+ -t "$IMAGE" --load test-infrastructure/
+}
+
+run_suite() {
+ # MSAN_EXCLUDE is deliberately empty: a sanitizer that skips code asserts
+ # coverage it does not have. scripts/msan.sh warns loudly if it is ever set.
+ echo "=== MSan full suite (no exclusions) ==="
+ docker run --rm -e MSAN_EXCLUDE="" -v "$PWD:/src" -w /src "$IMAGE"
+}
+
+case "$MODE" in
+ build) build_image ;;
+ run) run_suite ;;
+ all) build_image; run_suite ;;
+ *) echo "usage: $0 [build|run|all]" >&2; exit 2 ;;
+esac