Skip to content

Commit fc80ed0

Browse files
authored
Merge branch 'main' into fix/windows-utf8-watcher-paths
2 parents f1e36b5 + d211526 commit fc80ed0

199 files changed

Lines changed: 31800 additions & 4099 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/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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ jobs:
2323
runs-on: ubuntu-24.04
2424
# 15 min proved too tight on a slow runner day and a timed-out lint reads
2525
# as "cancelled", which the release graph must treat as a hard stop; keep
26-
# a bound, but one only a genuine hang can hit (normal runtime ~5 min).
27-
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
2831
steps:
2932
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3033

‎.github/workflows/_security.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ jobs:
3838
steps:
3939
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4040
- name: Install ScanCode Toolkit
41-
run: pipx install scancode-toolkit
41+
# Pinned: an unpinned install picked up pluggy 1.7.0, which breaks
42+
# scancode at import (see .github/scancode-constraints.txt).
43+
env:
44+
PIP_CONSTRAINT: ${{ github.workspace }}/.github/scancode-constraints.txt
45+
run: pipx install scancode-toolkit==32.5.0
4246
- name: "Gate self-test (a planted violation must be detected)"
4347
run: scripts/license-gate.sh --selftest
4448
- name: "License compliance gate (one finding fails)"

‎.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

‎.github/workflows/pr.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ jobs:
8686
path: ${{ runner.temp }}/test-selection
8787
if-no-files-found: error
8888
overwrite: true
89+
# The selection a veto discarded (written only when one did): evidence
90+
# for the vetoes, never read by a test leg.
91+
- name: Upload the vetoed selection
92+
if: ${{ !cancelled() && steps.select.outcome != 'skipped' }}
93+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
94+
with:
95+
name: test-selection-vetoed
96+
path: ${{ runner.temp }}/test-impact/selection-vetoed.json
97+
if-no-files-found: ignore
98+
overwrite: true
8999

90100
test:
91101
needs: [changes, lint, select-tests]
@@ -190,6 +200,13 @@ jobs:
190200
steps:
191201
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
192202

203+
# SMOKE_REQUIRE_WRAPPERS=1 needs a Go toolchain for the Go wrapper; the
204+
# macOS runner images have none on PATH.
205+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
206+
with:
207+
go-version-file: pkg/go/go.mod
208+
cache: false
209+
193210
- name: Install deps (Ubuntu)
194211
if: matrix.os == 'ubuntu-latest'
195212
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev ccache
@@ -232,6 +249,7 @@ jobs:
232249
env:
233250
CCACHE_DIR: ${{ github.workspace }}/.ccache
234251
CCACHE_MAXSIZE: 1000M
252+
SMOKE_REQUIRE_WRAPPERS: "1"
235253

236254
- name: Build prod + smoke (macOS)
237255
if: matrix.os == 'macos-14'
@@ -242,6 +260,7 @@ jobs:
242260
env:
243261
CCACHE_DIR: ${{ github.workspace }}/.ccache
244262
CCACHE_MAXSIZE: 1000M
263+
SMOKE_REQUIRE_WRAPPERS: "1"
245264

246265
- name: Build prod + smoke (Windows)
247266
if: matrix.os == 'windows-latest'
@@ -252,6 +271,7 @@ jobs:
252271
env:
253272
CCACHE_DIR: ${{ github.workspace }}/.ccache
254273
CCACHE_MAXSIZE: 1000M
274+
SMOKE_REQUIRE_WRAPPERS: "1"
255275

256276
# ── Waste sanitizer, REPORT-ONLY: memory + CPU waste on this repository and
257277
# the per-function scaling lane (Linux). Deliberately NOT in ci-ok's needs:

‎.github/workflows/release.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,15 @@ jobs:
283283
# move the release tag. (A floating HEAD also broke the 0.8.0 release:
284284
# HEAD had become a commit touching .github/workflows/, and the App
285285
# token may not create refs pointing at workflow-modifying commits.)
286+
# The Go wrapper is a nested module: `go install
287+
# .../pkg/go/cmd/codebase-memory-mcp@vX.Y.Z` and @latest resolve its
288+
# versions from pkg/go/v* tags only (without one, Go fetches the whole
289+
# repository, which is over its 500 MB module limit).
286290
run: |
287291
git tag -f "$VERSION" "$GITHUB_SHA"
288292
git push origin "$VERSION" --force
293+
git tag -f "pkg/go/$VERSION" "$GITHUB_SHA"
294+
git push origin "pkg/go/$VERSION" --force
289295
290296
- uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
291297
with:
@@ -510,6 +516,12 @@ jobs:
510516
else
511517
npm publish --access public --provenance
512518
fi
519+
# `next` is "the newest you can opt into": once a stable release
520+
# exists, an older RC must not stay behind it (0.9.1-rc.1 did until
521+
# v0.12.1). Re-runnable: dist-tag add is idempotent.
522+
if [[ "$RELEASE_VERSION" != *-* ]]; then
523+
npm dist-tag add "codebase-memory-mcp@$V" next
524+
fi
513525
514526
# ── PyPI ─────────────────────────────────────────────────
515527
- name: Setup Python

‎Makefile.cbm‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ PREPROCESSOR_SRC = $(CBM_DIR)/preprocessor.cpp
449449
SQLITE_WRITER_SRC = $(CBM_DIR)/sqlite_writer.c
450450

451451
# Store module (new)
452-
STORE_SRCS = src/store/store.c src/store/architecture_projection.c src/store/store_impact.c src/store/store_graph_digest.c src/store/store_content_digest.c
452+
STORE_SRCS = src/store/store.c src/store/graph_mem.c src/store/architecture_projection.c src/store/store_impact.c src/store/store_graph_digest.c src/store/store_content_digest.c
453453

454454
# Cypher module (new)
455455
CYPHER_SRCS = src/cypher/cypher.c
@@ -540,7 +540,9 @@ PIPELINE_SRCS = \
540540
src/pipeline/pass_operator.c \
541541
src/pipeline/pass_shell.c \
542542
src/pipeline/pass_terraform.c \
543+
src/pipeline/pass_ansible.c \
543544
src/pipeline/pass_docker.c \
545+
src/pipeline/pass_envjoin.c \
544546
src/pipeline/pass_ci.c \
545547
src/pipeline/pass_similarity.c \
546548
src/pipeline/pass_semantic_edges.c \
@@ -744,6 +746,7 @@ TEST_STORE_SRCS = \
744746
tests/test_store_impact.c \
745747
tests/test_store_scope.c \
746748
tests/test_store_graph_digest.c \
749+
tests/test_graph_mem.c \
747750
tests/test_store_search.c \
748751
tests/test_store_arch.c \
749752
tests/test_architecture_projection.c \
@@ -843,7 +846,7 @@ TEST_PY_LSP_SCALE_SRCS = tests/test_py_lsp_scale.c
843846

844847
TEST_TS_LSP_SRCS = tests/test_ts_lsp.c
845848
TEST_JAVA_LSP_SRCS = tests/test_java_lsp.c tests/test_java_lsp_coverage.c
846-
TEST_KOTLIN_LSP_SRCS = tests/test_kotlin_lsp.c
849+
TEST_KOTLIN_LSP_SRCS = tests/test_kotlin_lsp.c tests/test_kotlin_typed_calls.c
847850
TEST_RUST_LSP_SRCS = tests/test_rust_lsp.c
848851

849852
TEST_INTEGRATION_SRCS = tests/test_integration.c tests/test_incremental.c tests/test_lang_contract.c tests/test_edge_imports.c tests/test_edge_structural.c tests/test_lsp_resolution_probe.c tests/test_node_creation_probe.c tests/test_edge_types_probe.c tests/test_convergence_probe.c tests/test_matrix_known_classes.c tests/test_matrix_new_constructs.c tests/test_grammar_probe_a.c tests/test_grammar_probe_b.c tests/test_grammar_probe_c.c tests/test_grammar_probe_d.c tests/test_grammar_probe_e.c tests/test_grammar_probe_f.c tests/test_grammar_probe_g.c tests/test_conditional_variants.c tests/test_spawns.c

0 commit comments

Comments
 (0)