Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions .github/workflows/_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,30 @@ jobs:
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Exclude 1.28 GB of generated grammar parser.c tables and tools/graph-ui
# while keeping scanner.c + headers for lint-vendored-scanners.
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/internal/cbm/vendored/grammars/*/parser.c
!/tools/
!/graph-ui/
# Tests must pass or fail — no SKIPs except genuinely platform-specific
# ones (SKIP_PLATFORM / #ifdef). Fails the lint phase on any plain SKIP().
- name: No-skips policy (tests pass or fail)
run: bash scripts/check-no-test-skips.sh

- name: Install build deps
timeout-minutes: 10
run: APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev cmake

- name: Install LLVM 20
timeout-minutes: 10
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" | sudo tee /etc/apt/sources.list.d/llvm-20.list
APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update
sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y clang-format-20
APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc >/dev/null
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" | sudo tee /etc/apt/sources.list.d/llvm-20.list >/dev/null
sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update
sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev cmake clang-format-20
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cppcheck-cache
Expand Down Expand Up @@ -81,18 +88,23 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/internal/cbm/vendored/grammars/
!/tools/
!/graph-ui/
- name: Install build deps
timeout-minutes: 10
run: APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev

- name: Install LLVM 21 (pinned analyzer toolchain)
timeout-minutes: 10
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list
APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update
sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y clang-tidy-21
APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc >/dev/null
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list >/dev/null
sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update
sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev clang-tidy-21
- name: Memory-analyzer gate
run: scripts/ci/lint-mem.sh clang-tidy-21
33 changes: 31 additions & 2 deletions .github/workflows/_memwaste.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,19 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install deps
timeout-minutes: 10
run: APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev python3 clang llvm
run: APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev python3 clang llvm ccache
- name: Compiler cache (content-verified)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-memwaste-event-linux-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-memwaste-event-linux-${{ github.ref }}-
ccache-memwaste-event-linux-
- name: Event lane on this repository
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
run: |
# `cmd | tee` reports TEE's status: without this a failing lane
# (a missing exec bit, a build error) passes the step and only
Expand All @@ -66,12 +77,30 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/tools/
!/graph-ui/
- name: Install deps
timeout-minutes: 10
run: APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev python3 clang llvm
run: APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev python3 clang llvm ccache
- name: Compiler cache (content-verified)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-memwaste-scaling-linux-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-memwaste-scaling-linux-${{ github.ref }}-
ccache-memwaste-scaling-linux-
- name: CPU scaling lane (src/ at 2x against 4x)
# Report-only: the script exits 1 when it flags a super-linear function.
continue-on-error: true
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
run: |
# `cmd | tee` reports TEE's status: without this a failing lane
# (a missing exec bit, a build error) passes the step and only
Expand Down
44 changes: 43 additions & 1 deletion .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ jobs:
- name: Install ccache (macOS)
if: startsWith(matrix.os, 'macos')
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_CLEANUP: "1"
HOMEBREW_NO_ENV_HINTS: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: command -v ccache >/dev/null 2>&1 || brew install ccache

# Verified compiler cache: CCACHE_COMPILERCHECK=content keys every entry
Expand Down Expand Up @@ -315,6 +320,14 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/internal/cbm/vendored/
!/tools/
!/graph-ui/
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
Expand Down Expand Up @@ -347,10 +360,19 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/internal/cbm/vendored/
!/tools/
- uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version: "22"
cache: npm
cache-dependency-path: graph-ui/package-lock.json

- name: CodeAtlasWeb leg (install, unit, style, promises, acceptance, build)
env:
Expand All @@ -360,6 +382,9 @@ jobs:
# the whole leg whenever NuGet is unreachable. Its own switch skips it
# (the Nix flake sets the same).
ONNXRUNTIME_NODE_INSTALL: skip
# Hosted Ubuntu runners intermittently advertise unreachable IPv6
# routes to registry.npmjs.org (ENETUNREACH); prefer IPv4 first.
NODE_OPTIONS: "--dns-result-order=ipv4first"
run: scripts/ci/test-ui.sh

# ThreadSanitizer data-race gate. The threaded production surfaces (watcher,
Expand Down Expand Up @@ -502,7 +527,18 @@ jobs:
# runner drew the 23 bottle, and passed on the ones that drew 22). A
# test verdict must be a function of the code, not of the image snapshot;
# moving to a newer major is a deliberate one-line bump here.
- name: Homebrew bottle cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/Library/Caches/Homebrew
key: brew-lsan-llvm22-macos-arm64-v1

- name: Install LSan-capable toolchain
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_CLEANUP: "1"
HOMEBREW_NO_ENV_HINTS: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: brew install llvm@22 ccache

- name: Compiler cache (content-verified, restore)
Expand Down Expand Up @@ -557,7 +593,12 @@ jobs:

- name: Install deps (macOS)
if: runner.os == 'macOS'
run: brew install ccache
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_CLEANUP: "1"
HOMEBREW_NO_ENV_HINTS: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: command -v ccache >/dev/null 2>&1 || brew install ccache

- name: Compiler cache (content-verified)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
Expand Down Expand Up @@ -749,6 +790,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: repo
sparse-checkout: scripts/ci

- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/cache-warm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ jobs:
ccache-test-${{ matrix.os }}-${{ matrix.cc }}-${{ github.ref }}-
ccache-test-${{ matrix.os }}-${{ matrix.cc }}-
- name: Build (test runner + product, no tests)
- name: Build (test runner + product with test seams, no tests)
run: |
source scripts/env.sh
make -j"$(getconf _NPROCESSORS_ONLN)" -f Makefile.cbm \
build/c/test-runner cbm CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
build/c/test-runner cbm TEST_SEAMS=1 CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
CCACHE_MAXSIZE: 2500M

- name: ccache stats
run: ccache -sv || ccache -s
Expand Down Expand Up @@ -103,13 +103,13 @@ jobs:
ccache-test-windows-latest-CLANG64-${{ github.ref }}-
ccache-test-windows-latest-CLANG64-
- name: Build (test runner + product, no tests)
- name: Build (test runner + product with test seams, no tests)
run: |
source scripts/env.sh
make -j"$(nproc)" -f Makefile.cbm build/c/test-runner cbm CC=clang CXX=clang++
make -j"$(nproc)" -f Makefile.cbm build/c/test-runner cbm TEST_SEAMS=1 CC=clang CXX=clang++
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
CCACHE_MAXSIZE: 2500M

- name: ccache stats
run: ccache -sv || ccache -s
Expand Down
42 changes: 40 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,59 @@ jobs:
# only what a traced compiler invocation actually compiles.
CBM_NO_CCACHE: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Checkout (c-cpp)
if: ${{ matrix.language == 'c-cpp' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# The PR scan reads the merge commit's first parent (the base) to
# find the vendored files the PR changes.
fetch-depth: ${{ inputs.light && 2 || 1 }}
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/tools/
- name: Checkout (non-C languages)
if: ${{ matrix.language != 'c-cpp' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
filter: blob:none
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/internal/cbm/vendored/
!/tools/
- name: Install build dependencies
if: ${{ matrix.language == 'c-cpp' }}
timeout-minutes: 10
run: APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev
run: APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev ccache

# Compiler cache ONLY for the untraced vendored prebuild below; the traced
# CodeQL build step keeps job-level CBM_NO_CCACHE=1 so every traced unit
# actually invokes the compiler.
- name: Compiler cache for untraced third-party prebuild
if: ${{ matrix.language == 'c-cpp' && inputs.light }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ccache-codeql-vendored-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-codeql-vendored-${{ github.ref }}-
ccache-codeql-vendored-
# PR c-cpp: compile the third-party objects (tree-sitter grammars,
# sqlite, mimalloc, lz4, zstd, the tree-sitter runtime: ~1.3 GB of
# vendored C against ~45 MB first-party) BEFORE tracing starts, so the
# traced build below compiles first-party code only ...
- name: Build third-party objects (PR scan, untraced)
if: ${{ matrix.language == 'c-cpp' && inputs.light }}
env:
CBM_NO_CCACHE: "0"
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 1500M
run: scripts/build.sh --vendored-only

# ... except the vendored files this PR changes: those are rebuilt
Expand Down Expand Up @@ -132,6 +168,8 @@ jobs:
uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4
with:
category: "/language:${{ matrix.language }}"
upload-database: ${{ !inputs.light }}
wait-for-processing: true

# Alert policy: the default branch carries ZERO open code-scanning
# alerts. Any open alert on the analysed ref fails this leg: on main the
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,24 @@ jobs:
persist-credentials: false
- name: Check out the merge base's selection tooling
run: git worktree add --detach "$RUNNER_TEMP/base-tooling" HEAD^1
- name: Build the merge base's engine
- name: Fetch the merge base's engine (verified main artifact)
id: engine
env:
GH_TOKEN: ${{ github.token }}
run: |
base_sha="$(git rev-parse HEAD^1)"
if "$RUNNER_TEMP/base-tooling/scripts/ci/test-impact-bundle.sh" --fetch-engine "$base_sha" "$RUNNER_TEMP/base-tooling/build/c"; then
echo "hit=true" >> "$GITHUB_OUTPUT"
else
echo "hit=false" >> "$GITHUB_OUTPUT"
fi
- name: Build the merge base's engine (fallback when no main artifact exists)
if: ${{ steps.engine.outputs.hit != 'true' }}
timeout-minutes: 20
env:
# Never use ccache in select-tests: the merge-base engine must come
# solely from a verified main artifact or a clean base-tooling build.
CBM_NO_CCACHE: "1"
run: |
APT_RETRIES=3; [ -f /etc/apt/apt-mirrors.txt ] && APT_RETRIES=0; sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 --error-on=any update && sudo apt-get -o Acquire::Retries=$APT_RETRIES -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y zlib1g-dev
cd "$RUNNER_TEMP/base-tooling"
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/test-impact-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,21 @@ jobs:
include-hidden-files: true # the graph lives in .codebase-memory/
retention-days: 30
if-no-files-found: error

# Publish the main-built selection engine binary alongside its SHA-256
# receipt so PR select-tests can fetch a provenance-verified base engine
# directly from this main workflow run (no PR cache scope, no ccache).
- name: Stage the main selection engine artifact
run: |
mkdir -p "$RUNNER_TEMP/engine"
cp build/c/codebase-memory-mcp "$RUNNER_TEMP/engine/codebase-memory-mcp"
digest="$(sha256sum "$RUNNER_TEMP/engine/codebase-memory-mcp" | awk '{print $1}')"
printf '{"commit":"%s","sha256":"%s"}\n' "${{ github.sha }}" "$digest" > "$RUNNER_TEMP/engine/engine.json"
- name: Upload the main selection engine
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-impact-engine-${{ github.sha }}
path: ${{ runner.temp }}/engine
retention-days: 30
if-no-files-found: error
Loading