Skip to content

Commit 321dcb6

Browse files
committed
Merge main and complete Java record call handling
Preserve the current C/C++ field-binding policy while integrating the Java record accessor change. Handle varargs record components with array return types and reject data targets before sequential LSP call emission, matching the parallel path. Add focused regressions for both cases. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2 parents 9f5f5ab + 402cc81 commit 321dcb6

1,774 files changed

Lines changed: 1932994 additions & 706919 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: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"test_impact": {
3+
"version": 1,
4+
"tests": {
5+
"presets": {
6+
"c-cbm": true
7+
}
8+
},
9+
"rules": [
10+
{
11+
"id": "harness",
12+
"paths": ["tests/test_framework.h", "tests/test_helpers.*", "tests/test_main.c"],
13+
"action": "run_all"
14+
},
15+
{
16+
"id": "engine",
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+
],
24+
"action": "run_all"
25+
},
26+
{
27+
"id": "build",
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+
],
41+
"action": "run_all"
42+
},
43+
{
44+
"id": "grammars",
45+
"paths": ["internal/cbm/vendored/**"],
46+
"action": "run_all"
47+
},
48+
{
49+
"id": "fixtures",
50+
"paths": ["tests/fixtures/*/**"],
51+
"action": "referencing_tests",
52+
"key": "path_segment:2"
53+
},
54+
{
55+
"id": "contracts",
56+
"paths": ["tests/**/*.{sh,py,json,txt,ps1}"],
57+
"action": "ignore"
58+
},
59+
{
60+
"id": "notices",
61+
"paths": ["NOTICE*", "CHANGELOG*", "THIRD_PARTY*"],
62+
"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"
81+
}
82+
],
83+
"unmapped_files": "run_all",
84+
"coverage": {
85+
"compatibility_paths": [
86+
"tests/test_framework.h",
87+
"tests/test_main.c",
88+
"tests/test_helpers.h",
89+
"Makefile.cbm",
90+
"scripts/test-impact/coverage-map.py",
91+
"scripts/test-impact/coverage-merge.py"
92+
]
93+
}
94+
}
95+
}

‎.gitattributes‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@ scripts/hooks/pre-commit text eol=lf
1515
# Chialisp grammar corpus: one case asserts CRLF comment termination, so this
1616
# file must keep its exact bytes on every platform (no eol conversion). (#919)
1717
tools/tree-sitter-chialisp/test/corpus/comments.txt -text
18+
19+
# llvm-profdata text captures: tests/test_profile_text_parser.py checks their
20+
# SHA-256, so they keep their exact bytes on every platform (no eol conversion).
21+
tests/fixtures/profile_text/*.proftext -text
22+
# Golden profile-map outputs: tests/test_profile_map_v2.py compares the
23+
# producer's LF bytes against them, so they keep their exact bytes too.
24+
tests/fixtures/profile_map_v2/*.tsv -text

‎.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: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
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:
6-
workflow_call: {}
6+
workflow_call:
7+
inputs:
8+
lanes:
9+
description: 'PR lane selection (scripts/ci/select-lanes.sh JSON list); "all" = every job (dry run, release)'
10+
type: string
11+
default: all
712

813
permissions:
914
contents: read
1015

1116
jobs:
1217
lint:
13-
runs-on: ubuntu-latest
18+
if: ${{ inputs.lanes == 'all' || contains(fromJSON(inputs.lanes), 'lint') }}
19+
# Pinned, not ubuntu-latest: the LLVM install below adds an
20+
# apt.llvm.org llvm-toolchain-NOBLE repo, which is 24.04 by name. When
21+
# GitHub moves ubuntu-latest to the next LTS this job breaks on a day
22+
# nobody chose. Pin the runner to the release the repo line already names.
23+
runs-on: ubuntu-24.04
1424
# 15 min proved too tight on a slow runner day and a timed-out lint reads
1525
# as "cancelled", which the release graph must treat as a hard stop; keep
16-
# a bound, but one only a genuine hang can hit (normal runtime ~5 min).
17-
timeout-minutes: 30
26+
# a bound, but one only a genuine hang can hit. 30 min stopped being that
27+
# in 2026-10: single-process cppcheck over a src tree that grew ~60 % in
28+
# files took the lint step from ~8 to 22-29 min, and three runs on
29+
# 2026-10-13 were cancelled at 30 min with cppcheck still alive.
30+
timeout-minutes: 45
1831
steps:
1932
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2033

@@ -60,7 +73,9 @@ jobs:
6073
# provability (never suppressed — the NOLINT ban applies here too).
6174
# Vendored-tree diagnostics are path-filtered, mirroring .cppcheck.
6275
lint-mem:
63-
runs-on: ubuntu-latest
76+
if: ${{ inputs.lanes == 'all' || contains(fromJSON(inputs.lanes), 'lint-mem') }}
77+
# Pinned for the same reason as `lint`: llvm-toolchain-noble-21 below.
78+
runs-on: ubuntu-24.04
6479
timeout-minutes: 60
6580
steps:
6681
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎.github/workflows/_security.yml‎

Lines changed: 21 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
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
57

68
on:
7-
workflow_call: {}
9+
workflow_call:
10+
inputs:
11+
lanes:
12+
description: 'PR lane selection (scripts/ci/select-lanes.sh JSON list); "all" = every job (dry run, release)'
13+
type: string
14+
default: all
815

916
permissions:
1017
contents: read
@@ -16,19 +23,28 @@ jobs:
1623
steps:
1724
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1825
- name: "Layer 1: Static allow-list audit"
19-
run: scripts/security-audit.sh
26+
run: |
27+
bash tests/test_security_audit_subprocess_calls.sh
28+
scripts/security-audit.sh
2029
- name: "Layer 6: UI security audit"
21-
run: scripts/security-ui.sh
30+
run: |
31+
bash tests/test_security_ui_urls.sh
32+
scripts/security-ui.sh
2233
- name: "Layer 8: Vendored dependency integrity"
2334
run: scripts/security-vendored.sh
2435

2536
license-gate:
37+
if: ${{ inputs.lanes == 'all' || contains(fromJSON(inputs.lanes), 'license-gate') }}
2638
runs-on: ubuntu-latest
2739
timeout-minutes: 240
2840
steps:
2941
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3042
- name: Install ScanCode Toolkit
31-
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
3248
- name: "Gate self-test (a planted violation must be detected)"
3349
run: scripts/license-gate.sh --selftest
3450
- name: "License compliance gate (one finding fails)"
@@ -38,95 +54,3 @@ jobs:
3854
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3955
run: scripts/audit-license-provenance.py
4056

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

0 commit comments

Comments
 (0)