Skip to content

Commit 86fb94f

Browse files
committed
Refine Markdown heading names and refresh main
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2 parents 9129898 + 402cc81 commit 86fb94f

215 files changed

Lines changed: 46518 additions & 8821 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.codebase-memory.json‎

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,30 @@
1414
},
1515
{
1616
"id": "engine",
17-
"paths": [".codebase-memory.json", "src/mcp/test_impact*", "src/store/store_impact.*"],
17+
"paths": [
18+
".codebase-memory.json",
19+
"src/mcp/test_impact*",
20+
"src/store/store_impact.*",
21+
"scripts/test-impact/**",
22+
"scripts/ci/test-impact-*"
23+
],
1824
"action": "run_all"
1925
},
2026
{
2127
"id": "build",
22-
"paths": ["scripts/**", "test-infrastructure/**", "pkg/**"],
28+
"paths": [
29+
"scripts/build.sh",
30+
"scripts/env.sh",
31+
"scripts/test.sh",
32+
"scripts/run-tests-parallel.sh",
33+
"scripts/run-test-wave.py",
34+
"scripts/path-safety.sh",
35+
"scripts/clean.sh",
36+
"scripts/suite-failure-report.sh",
37+
"scripts/ci/verify-shard-union.sh",
38+
"scripts/embed-frontend.sh",
39+
"/.gitattributes"
40+
],
2341
"action": "run_all"
2442
},
2543
{
@@ -35,13 +53,31 @@
3553
},
3654
{
3755
"id": "contracts",
38-
"paths": ["tests/**/*.{sh,py,json,txt}"],
56+
"paths": ["tests/**/*.{sh,py,json,txt,ps1}"],
3957
"action": "ignore"
4058
},
4159
{
4260
"id": "notices",
4361
"paths": ["NOTICE*", "CHANGELOG*", "THIRD_PARTY*"],
4462
"action": "ignore"
63+
},
64+
{
65+
"id": "repo-data",
66+
"paths": [
67+
"scripts/**",
68+
"pkg/**",
69+
"test-infrastructure/**",
70+
"docs/**",
71+
"**/*.md",
72+
"graph-ui/**",
73+
"tools/**",
74+
"tests/fuzz/corpus/**",
75+
"/{.clang-format,.clang-tidy,.cppcheck,.gitignore,.gitleaksignore,DCO,Formula}",
76+
"/{flake.lock,flake.nix,glama.json,install.ps1,install.sh,server.json}"
77+
],
78+
"action": "referencing_tests",
79+
"key": "path",
80+
"unreferenced": "ignore"
4581
}
4682
],
4783
"unmapped_files": "run_all",

‎.github/codeql/codeql-config.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# CodeQL scope: the repository's first-party source.
2+
#
3+
# Read by .github/workflows/codeql.yml (every scan, full and PR) and by
4+
# scripts/ci/select-lanes.sh (which changed paths select which language's PR
5+
# scan). Keep the lists plain: one path prefix per line, no globs.
6+
#
7+
# paths / paths-ignore narrow what the INTERPRETED languages extract
8+
# (javascript-typescript, python, actions). For c-cpp they have no effect:
9+
# CodeQL extracts exactly what the traced build compiles. A PR's c-cpp scan
10+
# keeps vendored C out by compiling it before tracing starts (except vendored
11+
# files the PR changes); the full scan on main, the dry run and the release
12+
# traces everything, vendored C included.
13+
name: cbm first-party source
14+
paths:
15+
- src
16+
- internal
17+
- graph-ui
18+
- pkg
19+
- scripts
20+
- tests
21+
- .github
22+
paths-ignore:
23+
- internal/cbm/vendored
24+
- graph-ui/vendor
25+
- graph-ui/fixtures
26+
- graph-ui/verification
27+
- tests/fixtures

‎.github/scancode-constraints.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Constraints for the ScanCode install of the license gate (PIP_CONSTRAINT).
2+
# pluggy 1.7.0 (2026-10-15) no longer finds plugincode 32.0.0's class-level
3+
# hookspecs: scancode then crashes at import with "did not find any
4+
# 'pre_scan' hooks" and the gate fails on every run.
5+
pluggy==1.6.0

‎.github/workflows/_lint.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Reusable: lint only (cppcheck + clang-format).
2-
# Security-static and CodeQL gate are separate — see _security.yml.
2+
# Security-static is separate — see _security.yml; CodeQL — see codeql.yml.
33
name: Lint & Security
44

55
on:

‎.github/workflows/_security.yml‎

Lines changed: 8 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Reusable: security-static + CodeQL gate.
1+
# Reusable: security-static + license gate.
2+
# CodeQL is not here: PRs do not run it. It runs on push to main, weekly, and
3+
# inside dry-run.yml / release.yml, which call codeql.yml directly.
24
# Runs independently from lint/test/build — does not block the main pipeline.
35
# Affects overall workflow success status.
46
name: Security Gate
@@ -38,7 +40,11 @@ jobs:
3840
steps:
3941
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4042
- name: Install ScanCode Toolkit
41-
run: pipx install scancode-toolkit
43+
# Pinned: an unpinned install picked up pluggy 1.7.0, which breaks
44+
# scancode at import (see .github/scancode-constraints.txt).
45+
env:
46+
PIP_CONSTRAINT: ${{ github.workspace }}/.github/scancode-constraints.txt
47+
run: pipx install scancode-toolkit==32.5.0
4248
- name: "Gate self-test (a planted violation must be detected)"
4349
run: scripts/license-gate.sh --selftest
4450
- name: "License compliance gate (one finding fails)"
@@ -48,96 +54,3 @@ jobs:
4854
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4955
run: scripts/audit-license-provenance.py
5056

51-
codeql-gate:
52-
if: ${{ inputs.lanes == 'all' || contains(fromJSON(inputs.lanes), 'codeql-gate') }}
53-
runs-on: ubuntu-latest
54-
timeout-minutes: 240
55-
# Without security-events:read this job inherits the workflow's
56-
# contents:read, the code-scanning alert API answers 403, and the gate
57-
# below reported "0 alerts" on every run it has ever made. actions:read is
58-
# what the CodeQL-run poll above needs for the same reason.
59-
permissions:
60-
contents: read
61-
security-events: read
62-
actions: read
63-
steps:
64-
- name: Wait for CodeQL on current commit (max 150 min)
65-
env:
66-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
run: |
68-
# On pull_request events github.sha is the synthetic merge commit;
69-
# CodeQL runs are recorded against the PR head SHA.
70-
CURRENT_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
71-
echo "Waiting for CodeQL to complete on $CURRENT_SHA..."
72-
# 300 attempts x 30s = 150 min. The previous budget was 90 x 30s = 45 min,
73-
# which is shorter than CodeQL actually takes on this repository: a measured
74-
# run on PR #1426 (head 7b72652a) completed with conclusion=success after
75-
# 124 min, 7 minutes AFTER this gate had already given up. That marked at
76-
# least five contributor PRs red for a scan that passed. The job's own
77-
# timeout-minutes is 240, so 150 still leaves headroom.
78-
for attempt in $(seq 1 300); do
79-
LATEST=$(gh api "repos/${{ github.repository }}/actions/workflows/codeql.yml/runs?head_sha=$CURRENT_SHA&per_page=1" \
80-
--jq '.workflow_runs[] | "\(.conclusion) \(.status)"' 2>/dev/null | head -1 || echo "")
81-
if [ -z "$LATEST" ]; then
82-
echo " $attempt/300: no run yet..."; sleep 30; continue
83-
fi
84-
CONCLUSION=$(echo "$LATEST" | cut -d' ' -f1)
85-
STATUS=$(echo "$LATEST" | cut -d' ' -f2)
86-
if [ "$STATUS" = "completed" ] && [ "$CONCLUSION" = "success" ]; then
87-
echo "=== CodeQL passed ==="; exit 0
88-
elif [ "$STATUS" = "completed" ]; then
89-
echo "BLOCKED: CodeQL $CONCLUSION"; exit 1
90-
fi
91-
echo " $attempt/300: $STATUS..."; sleep 30
92-
done
93-
echo "BLOCKED: CodeQL timeout"; exit 1
94-
95-
- name: Check for open code scanning alerts
96-
env:
97-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98-
run: |
99-
# FAIL CLOSED. The previous form was `gh api ... 2>/dev/null || echo "0"`,
100-
# which looks defensive and is the opposite. gh writes the API error
101-
# BODY to stdout, so a 403 made ALERTS the string
102-
# {"message":"Resource not accessible by integration",...,"status":"403"}0
103-
# every `[` comparison then failed as non-integer, the `if` took its
104-
# false branch, and the step printed "CodeQL gate passed (0 alerts)"
105-
# and exited 0. That is exactly how a security gate should NEVER fail:
106-
# silently, in the direction of "everything is fine". An unreadable
107-
# alert list is now an error, not a zero.
108-
# NOTE: this runs in a command substitution, so it must `return`, not
109-
# `exit` -- an `exit` here would only end the subshell and let the
110-
# caller continue with an empty count, recreating the very bug this
111-
# replaces. The callers below check the status explicitly.
112-
count_open_alerts() {
113-
local body status
114-
body=$(gh api 'repos/${{ github.repository }}/code-scanning/alerts?state=open' \
115-
--jq 'length' 2>/dev/null)
116-
status=$?
117-
if [ $status -ne 0 ]; then
118-
echo "BLOCKED: cannot read code scanning alerts (gh exit $status)." >&2
119-
echo " Refusing to treat an unreadable alert list as zero." >&2
120-
echo " Most likely cause: the job lacks security-events:read." >&2
121-
return 1
122-
fi
123-
case "$body" in
124-
''|*[!0-9]*)
125-
echo "BLOCKED: alert count was not a number: ${body:-<empty>}" >&2
126-
return 1
127-
;;
128-
esac
129-
printf '%s' "$body"
130-
}
131-
echo "Waiting 60s for alert API to settle..."
132-
sleep 60
133-
ALERTS=$(count_open_alerts) || exit 1
134-
sleep 15
135-
ALERTS2=$(count_open_alerts) || exit 1
136-
[ "$ALERTS" -lt "$ALERTS2" ] && ALERTS=$ALERTS2
137-
if [ "$ALERTS" -gt 0 ]; then
138-
echo "BLOCKED: $ALERTS open alert(s)"
139-
gh api 'repos/${{ github.repository }}/code-scanning/alerts?state=open' \
140-
--jq '.[] | " #\(.number) [\(.rule.security_severity_level // .rule.severity)] \(.rule.id) — \(.most_recent_instance.location.path):\(.most_recent_instance.location.start_line)"' 2>/dev/null || true
141-
exit 1
142-
fi
143-
echo "=== CodeQL gate passed (0 alerts) ==="

‎.github/workflows/_smoke.yml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ jobs:
9595
steps:
9696
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
9797

98+
# SMOKE_REQUIRE_WRAPPERS=1 needs a Go toolchain for the Go wrapper; the
99+
# macOS runner images have none on PATH.
100+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
101+
with:
102+
go-version-file: pkg/go/go.mod
103+
cache: false
104+
98105
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
99106
with:
100107
name: binaries-${{ matrix.goos }}-${{ matrix.goarch }}
@@ -118,6 +125,7 @@ jobs:
118125
env:
119126
CBM_SMOKE_ARTIFACT_DIR: ${{ runner.temp }}/cbm-artifact
120127
SMOKE_REQUIRE_UI: "1"
128+
SMOKE_REQUIRE_WRAPPERS: "1"
121129

122130
- name: Security audits
123131
run: |
@@ -175,6 +183,13 @@ jobs:
175183
steps:
176184
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
177185

186+
# SMOKE_REQUIRE_WRAPPERS=1 needs a Go toolchain for the Go wrapper; the
187+
# MSYS2 shell below inherits it (path-type: inherit).
188+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
189+
with:
190+
go-version-file: pkg/go/go.mod
191+
cache: false
192+
178193
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
179194
with:
180195
msystem: ${{ matrix.arch == 'arm64' && 'CLANGARM64' || 'CLANG64' }}
@@ -224,6 +239,7 @@ jobs:
224239
env:
225240
SMOKE_ARCH: ${{ matrix.arch }}
226241
SMOKE_REQUIRE_UI: "1"
242+
SMOKE_REQUIRE_WRAPPERS: "1"
227243
run: |
228244
export CBM_SMOKE_ARTIFACT_DIR="$(cygpath -u "$RUNNER_TEMP")/cbm-artifact"
229245
bash test-infrastructure/vm/vm-smoke.sh
@@ -279,6 +295,12 @@ jobs:
279295
steps:
280296
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
281297

298+
# SMOKE_REQUIRE_WRAPPERS=1 needs a Go toolchain for the Go wrapper.
299+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
300+
with:
301+
go-version-file: pkg/go/go.mod
302+
cache: false
303+
282304
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
283305
with:
284306
name: binaries-linux-${{ matrix.arch }}-portable
@@ -301,6 +323,7 @@ jobs:
301323
env:
302324
CBM_SMOKE_ARTIFACT_DIR: ${{ runner.temp }}/cbm-artifact
303325
SMOKE_REQUIRE_UI: "1"
326+
SMOKE_REQUIRE_WRAPPERS: "1"
304327

305328
# The -portable binary is what all linux install/update paths now deliver;
306329
# it MUST start on old glibc (Debian 11 / RHEL 8 / Ubuntu 20.04). Runs it

‎.github/workflows/_test.yml‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
type: string
2626
default: all
2727
test_selection:
28-
description: 'PR test selection (smart CI): the artifact the select-tests job uploaded; the test-unix and test-windows legs run only its tests. Empty = every test (dry run, release, and any PR the selection does not narrow)'
28+
description: 'PR test selection (smart CI): the artifact the select-tests job uploaded; the Linux x86_64 test-unix leg runs only its tests, the arm64, macOS and Windows legs run every test. Empty = every test (dry run, release, and any PR the selection does not narrow)'
2929
type: string
3030
default: ''
3131

@@ -222,7 +222,11 @@ jobs:
222222
ccache-test-${{ matrix.os }}-${{ matrix.cc }}-
223223
224224
- name: Fetch the test selection
225-
if: ${{ inputs.test_selection != '' }}
225+
# Only the Linux x86_64 leg narrows (user decision 2026-10-16): the
226+
# coverage that justifies an omission comes from the Linux x86_64
227+
# producer, so arm64, macOS and Windows code under #ifdef has static
228+
# evidence only and those legs run every test.
229+
if: ${{ inputs.test_selection != '' && runner.os == 'Linux' && runner.arch == 'X64' }}
226230
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
227231
with:
228232
name: ${{ inputs.test_selection }}
@@ -234,7 +238,7 @@ jobs:
234238
CBM_TEST_SHARD: ${{ matrix.shard }}
235239
CBM_TEST_LEG: ${{ matrix.os }}-${{ matrix.cc }}
236240
CBM_SKIP_PERF: ${{ inputs.skip_perf && '1' || '' }}
237-
CBM_TEST_SELECTION_DIR: ${{ inputs.test_selection != '' && format('{0}/test-selection', runner.temp) || '' }}
241+
CBM_TEST_SELECTION_DIR: ${{ inputs.test_selection != '' && runner.os == 'Linux' && runner.arch == 'X64' && format('{0}/test-selection', runner.temp) || '' }}
238242
CCACHE_DIR: ${{ github.workspace }}/.ccache
239243
CCACHE_MAXSIZE: 1500M
240244

@@ -617,13 +621,6 @@ jobs:
617621
ccache-test-${{ matrix.os }}-${{ matrix.msystem }}-${{ github.ref }}-
618622
ccache-test-${{ matrix.os }}-${{ matrix.msystem }}-
619623
620-
- name: Fetch the test selection
621-
if: ${{ inputs.test_selection != '' }}
622-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
623-
with:
624-
name: ${{ inputs.test_selection }}
625-
path: ${{ runner.temp }}/test-selection
626-
627624
- name: Test
628625
shell: msys2 {0}
629626
# AddressSanitizer is unavailable on native ARM64 Windows (LLVM ships no
@@ -651,7 +648,8 @@ jobs:
651648
CBM_TEST_SHARD: ${{ matrix.shard }}
652649
CBM_TEST_LEG: ${{ matrix.os }}-${{ matrix.msystem }}
653650
CBM_SKIP_PERF: ${{ inputs.skip_perf && '1' || '' }}
654-
CBM_TEST_SELECTION_DIR: ${{ inputs.test_selection != '' && format('{0}/test-selection', runner.temp) || '' }}
651+
# Windows legs run every test: see the Linux x86_64-only fetch in test-unix.
652+
CBM_TEST_SELECTION_DIR: ''
655653
CCACHE_DIR: ${{ github.workspace }}/.ccache
656654
CCACHE_MAXSIZE: 1500M
657655

0 commit comments

Comments
 (0)