Skip to content

Commit 41f4196

Browse files
committed
Merge branch 'upstream/main' into fix/java-enum-extraction and resolve conflict in extract_defs.c
2 parents 6cb4f2e + feadbe1 commit 41f4196

111 files changed

Lines changed: 47139 additions & 2557 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.

.github/issue-labeler.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
# Config for github/issue-labeler (.github/workflows/issue-labeler.yml).
2-
# Non-versioned format: one regex per label, matched against title + body.
1+
# Config for the Issue area labeler (.github/workflows/issue-labeler.yml).
2+
# FORMAT (parsed line-wise by the workflow): one rule per line, exactly
3+
# "label": 'regex'
4+
# Patterns are compiled as JavaScript RegExp with the `i` flag applied by
5+
# the workflow — do NOT use PCRE-only syntax like inline `(?i)` groups
6+
# (that broke every run, #764). Matched against issue title + body.
37
# Additive only — these never remove a maintainer's manual label.
48

5-
"windows": '(?i)\b(windows|win\s?1[01]|powershell|\.ps1|mapped drive|smb share|unc path)\b'
9+
"windows": '\b(windows|win\s?1[01]|powershell|\.ps1|mapped drive|smb share|unc path)\b'
610

7-
"stability/performance": '(?i)(out of memory|\boom\b|memory leak|segfault|sigsegv|sigbus|crash(es|ed|ing)?|core dumped|\bhang(s|ing)?\b|deadlock|freezes?|time(s)?\s?out|timeout|never finishes|cgroup)'
11+
"stability/performance": '(out of memory|\boom\b|memory leak|segfault|sigsegv|sigbus|crash(es|ed|ing)?|core dumped|\bhang(s|ing)?\b|deadlock|freezes?|time(s)?\s?out|timeout|never finishes|cgroup)'
812

9-
"parsing/quality": '(?i)(trace_path|query_graph|search_graph|calls? edge|missing (edges|nodes)|false positive|zero edges|0 edges|module node|not indexed|extraction|wrong (node|label))'
13+
"parsing/quality": '(trace_path|query_graph|search_graph|calls? edge|missing (edges|nodes)|false positive|zero edges|0 edges|module node|not indexed|extraction|wrong (node|label))'
1014

11-
"editor/integration": '(?i)(cursor|vscode|vs code|opencode|codex|claude code|gemini cli|antigravity|mcp client|\.mcp\.json|installer)'
15+
"editor/integration": '(cursor|vscode|vs code|opencode|codex|claude code|gemini cli|antigravity|mcp client|\.mcp\.json|installer)'
1216

13-
"ux/behavior": '(?i)(web ui|\bui\b|dashboard|3d graph|visuali[sz]ation|watcher|project name|frontend)'
17+
"ux/behavior": '(web ui|\bui\b|dashboard|3d graph|visuali[sz]ation|watcher|project name|frontend)'
1418

15-
"cypher": '(?i)\bcypher\b'
19+
"cypher": '\bcypher\b'
1620

17-
"language-request": '(?i)(language support|hybrid lsp|new language support|support for \w+ language)'
21+
"language-request": '(language support|hybrid lsp|new language support|support for \w+ language)'
Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Issue area labeler
22

33
# Adds area labels to new/edited issues based on keyword regexes in
4-
# .github/issue-labeler.yml. Additive only (sync-labels off): it never
5-
# removes a label a maintainer set by hand. Base bug/enhancement labels
6-
# already come from the issue forms.
4+
# .github/issue-labeler.yml. Additive only (addLabels never removes): it
5+
# never touches a label a maintainer set by hand. Base bug/enhancement
6+
# labels already come from the issue forms.
7+
#
8+
# Implemented with first-party actions/github-script (not a third-party
9+
# labeler action) so every pattern is compiled as a JavaScript RegExp with
10+
# the `i` flag applied centrally — inline `(?i)` groups are PCRE-only and
11+
# threw `SyntaxError: Invalid group` on every issue (#764). A pattern that
12+
# fails to compile now fails the run loudly instead of silently no-oping.
713

814
on:
915
issues:
@@ -16,13 +22,38 @@ jobs:
1622
triage:
1723
runs-on: ubuntu-latest
1824
permissions:
25+
contents: read
1926
issues: write
2027
steps:
21-
- uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4
28+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
29+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
2230
with:
23-
configuration-path: .github/issue-labeler.yml
24-
enable-versioned-regex: 0
25-
include-title: 1
26-
include-body: 1
27-
sync-labels: 0
28-
repo-token: ${{ secrets.GITHUB_TOKEN }}
31+
script: |
32+
const fs = require('fs');
33+
const text = [context.payload.issue.title, context.payload.issue.body]
34+
.filter(Boolean).join('\n');
35+
const rules = [];
36+
const bad = [];
37+
// Config format: one rule per line — "label": 'regex' (see the
38+
// header comment in .github/issue-labeler.yml).
39+
for (const line of fs.readFileSync('.github/issue-labeler.yml', 'utf8').split('\n')) {
40+
const m = line.match(/^"([^"]+)":\s*'(.*)'\s*$/);
41+
if (!m) continue;
42+
try { rules.push({ label: m[1], re: new RegExp(m[2], 'i') }); }
43+
catch (e) { bad.push(`${m[1]}: ${e.message}`); }
44+
}
45+
if (rules.length === 0 && bad.length === 0) {
46+
core.setFailed('no labeling rules parsed from .github/issue-labeler.yml');
47+
return;
48+
}
49+
const labels = rules.filter(r => r.re.test(text)).map(r => r.label);
50+
if (labels.length) {
51+
await github.rest.issues.addLabels({
52+
owner: context.repo.owner,
53+
repo: context.repo.repo,
54+
issue_number: context.issue.number,
55+
labels,
56+
});
57+
}
58+
core.info(`matched: ${labels.join(', ') || '(none)'}`);
59+
if (bad.length) core.setFailed(`invalid label regex(es): ${bad.join('; ')}`);

.github/workflows/pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ jobs:
5151
PR: ${{ github.event.pull_request.number }}
5252
REPO: ${{ github.repository }}
5353
run: |
54-
FILES=$(gh pr diff "$PR" --repo "$REPO" --name-only)
54+
# The full .diff endpoint rejects large-but-valid PRs at 20k lines.
55+
# The paginated files endpoint remains filename-only for this gate.
56+
FILES=$(gh api --paginate "repos/$REPO/pulls/$PR/files?per_page=100" --jq '.[].filename')
5557
printf '%s\n' "$FILES"
5658
if printf '%s\n' "$FILES" | grep -qE '^(src/|internal/|scripts/build\.sh|scripts/smoke-test\.sh|scripts/env\.sh|Makefile\.cbm)'; then
5759
echo "product=true" >> "$GITHUB_OUTPUT"

Makefile.cbm

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,15 @@ CXXFLAGS_PROD = $(CXXFLAGS_COMMON) -O2
6363

6464
# Test flags: debug + sanitizers (override SANITIZE= to disable on Windows)
6565
SANITIZE = -fsanitize=address,undefined -fno-omit-frame-pointer
66-
CFLAGS_TEST = $(CFLAGS_COMMON) -g -O1 $(SANITIZE)
66+
EDITOR_TEST_DEFINES = -DCBM_JSON_LIKE_ENABLE_TEST_API=1 \
67+
-DCBM_TOML_EDIT_ENABLE_TEST_API=1 -DCBM_YAML_ENABLE_TEST_API=1 \
68+
-DCBM_TEXT_EDIT_ENABLE_TEST_API=1 -DCBM_CLI_ENABLE_TEST_API=1
69+
CFLAGS_TEST = $(CFLAGS_COMMON) $(EDITOR_TEST_DEFINES) -g -O1 $(SANITIZE)
6770
CXXFLAGS_TEST = $(CXXFLAGS_COMMON) -g -O1 $(SANITIZE)
6871

6972
# TSan (can't combine with ASan)
7073
TSAN_SANITIZE = -fsanitize=thread -fno-omit-frame-pointer
71-
CFLAGS_TSAN = $(CFLAGS_COMMON) -g -O1 \
74+
CFLAGS_TSAN = $(CFLAGS_COMMON) $(EDITOR_TEST_DEFINES) -g -O1 \
7275
$(TSAN_SANITIZE)
7376
CXXFLAGS_TSAN = $(CXXFLAGS_COMMON) -g -O1 \
7477
$(TSAN_SANITIZE)
@@ -132,6 +135,8 @@ EXTRACTION_SRCS = \
132135
$(CBM_DIR)/extract_k8s.c \
133136
$(CBM_DIR)/helpers.c \
134137
$(CBM_DIR)/lang_specs.c \
138+
$(CBM_DIR)/macro_table.c \
139+
$(CBM_DIR)/iris_export_xml.c \
135140
$(CBM_DIR)/service_patterns.c
136141

137142
# LSP resolvers (compiled as one unit via lsp_all.c)
@@ -174,7 +179,7 @@ STORE_SRCS = src/store/store.c
174179
CYPHER_SRCS = src/cypher/cypher.c
175180

176181
# MCP server module (new)
177-
MCP_SRCS = src/mcp/mcp.c src/mcp/index_supervisor.c
182+
MCP_SRCS = src/mcp/mcp.c src/mcp/index_supervisor.c src/mcp/compact_out.c
178183

179184
# Discover module (new)
180185
DISCOVER_SRCS = \
@@ -237,7 +242,10 @@ WATCHER_SRCS = src/watcher/watcher.c
237242
GIT_SRCS = src/git/git_context.c
238243

239244
# CLI module (new)
240-
CLI_SRCS = src/cli/cli.c src/cli/progress_sink.c src/cli/hook_augment.c
245+
CLI_SRCS = src/cli/cli.c src/cli/progress_sink.c src/cli/hook_augment.c \
246+
src/cli/agent_clients.c src/cli/agent_profiles.c \
247+
src/cli/config_json_like.c src/cli/config_toml_edit.c src/cli/config_yaml_edit.c \
248+
src/cli/config_text_edit.c
241249

242250
# UI module (graph visualization)
243251
UI_SRCS = \
@@ -369,6 +377,8 @@ TEST_CS_LSP_SRCS = tests/test_cs_lsp.c
369377

370378
TEST_CS_LSP_BENCH_SRCS = tests/test_cs_lsp_bench.c
371379

380+
TEST_PERL_LSP_SRCS = tests/test_perl_lsp.c
381+
372382
TEST_SCOPE_SRCS = tests/test_scope.c
373383

374384
TEST_TYPE_REP_SRCS = tests/test_type_rep.c
@@ -391,7 +401,9 @@ TEST_INTEGRATION_SRCS = tests/test_integration.c tests/test_incremental.c tests/
391401
TEST_TRACES_SRCS = tests/test_traces.c
392402

393403

394-
TEST_CLI_SRCS = tests/test_cli.c
404+
TEST_CLI_SRCS = tests/test_cli.c tests/test_agent_clients.c tests/test_agent_profiles.c \
405+
tests/test_config_json_like.c \
406+
tests/test_config_toml_edit.c tests/test_config_yaml_edit.c tests/test_config_text_edit.c
395407

396408
TEST_MEM_SRCS = tests/test_mem.c
397409

@@ -448,6 +460,7 @@ TEST_REPRO_SRCS = \
448460
tests/repro/repro_issue581.c \
449461
tests/repro/repro_issue787.c \
450462
tests/repro/repro_issue842.c \
463+
tests/repro/repro_issue964.c \
451464
tests/repro/repro_invariant_calls.c \
452465
tests/repro/repro_invariant_graph.c \
453466
tests/repro/repro_invariant_breadth.c \
@@ -472,7 +485,7 @@ TEST_REPRO_SRCS = \
472485
tests/repro/repro_lsp_java_cs.c \
473486
tests/repro/repro_lsp_kt_php_rust.c
474487

475-
ALL_TEST_SRCS =$(TEST_FOUNDATION_SRCS) $(TEST_EXTRACTION_SRCS) $(TEST_STORE_SRCS) $(TEST_CYPHER_SRCS) $(TEST_MCP_SRCS) $(TEST_DISCOVER_SRCS) $(TEST_GRAPH_BUFFER_SRCS) $(TEST_PIPELINE_SRCS) $(TEST_WATCHER_SRCS) $(TEST_LZ4_SRCS) $(TEST_ZSTD_SRCS) $(TEST_ARTIFACT_SRCS) $(TEST_SQLITE_WRITER_SRCS) $(TEST_GO_LSP_SRCS) $(TEST_C_LSP_SRCS) $(TEST_PHP_LSP_SRCS) $(TEST_CS_LSP_SRCS) $(TEST_CS_LSP_BENCH_SRCS) $(TEST_SCOPE_SRCS) $(TEST_TYPE_REP_SRCS) $(TEST_PY_LSP_SRCS) $(TEST_PY_LSP_BENCH_SRCS) $(TEST_PY_LSP_STRESS_SRCS) $(TEST_PY_LSP_SCALE_SRCS) $(TEST_TS_LSP_SRCS) $(TEST_JAVA_LSP_SRCS) $(TEST_KOTLIN_LSP_SRCS) $(TEST_RUST_LSP_SRCS) $(TEST_TRACES_SRCS) $(TEST_CLI_SRCS) $(TEST_MEM_SRCS) $(TEST_UI_SRCS) $(TEST_HTTPD_SRCS) $(TEST_SECURITY_SRCS) $(TEST_YAML_SRCS) $(TEST_SEMANTIC_SRCS) $(TEST_AST_PROFILE_SRCS) $(TEST_SLAB_ALLOC_SRCS) $(TEST_SIMHASH_SRCS) $(TEST_STACK_OVERFLOW_SRCS) $(TEST_INTEGRATION_SRCS)
488+
ALL_TEST_SRCS =$(TEST_FOUNDATION_SRCS) $(TEST_EXTRACTION_SRCS) $(TEST_STORE_SRCS) $(TEST_CYPHER_SRCS) $(TEST_MCP_SRCS) $(TEST_DISCOVER_SRCS) $(TEST_GRAPH_BUFFER_SRCS) $(TEST_PIPELINE_SRCS) $(TEST_WATCHER_SRCS) $(TEST_LZ4_SRCS) $(TEST_ZSTD_SRCS) $(TEST_ARTIFACT_SRCS) $(TEST_SQLITE_WRITER_SRCS) $(TEST_GO_LSP_SRCS) $(TEST_C_LSP_SRCS) $(TEST_PHP_LSP_SRCS) $(TEST_CS_LSP_SRCS) $(TEST_CS_LSP_BENCH_SRCS) $(TEST_PERL_LSP_SRCS) $(TEST_SCOPE_SRCS) $(TEST_TYPE_REP_SRCS) $(TEST_PY_LSP_SRCS) $(TEST_PY_LSP_BENCH_SRCS) $(TEST_PY_LSP_STRESS_SRCS) $(TEST_PY_LSP_SCALE_SRCS) $(TEST_TS_LSP_SRCS) $(TEST_JAVA_LSP_SRCS) $(TEST_KOTLIN_LSP_SRCS) $(TEST_RUST_LSP_SRCS) $(TEST_TRACES_SRCS) $(TEST_CLI_SRCS) $(TEST_MEM_SRCS) $(TEST_UI_SRCS) $(TEST_HTTPD_SRCS) $(TEST_SECURITY_SRCS) $(TEST_YAML_SRCS) $(TEST_SEMANTIC_SRCS) $(TEST_AST_PROFILE_SRCS) $(TEST_SLAB_ALLOC_SRCS) $(TEST_SIMHASH_SRCS) $(TEST_STACK_OVERFLOW_SRCS) $(TEST_INTEGRATION_SRCS)
476489

477490

478491
# ── Build directories ────────────────────────────────────────────
@@ -626,6 +639,14 @@ $(BUILD_DIR)/test-runner: $(ALL_TEST_SRCS) $(PROD_SRCS) $(EXTRACTION_SRCS) $(AC_
626639
test: $(BUILD_DIR)/test-runner
627640
cd $(CURDIR) && $(BUILD_DIR)/test-runner
628641

642+
# Focused native development is intentionally a separate, explicit target so
643+
# an inherited TEST_SUITES value cannot silently narrow the gating test target.
644+
TEST_SUITES ?=
645+
test-focused: $(BUILD_DIR)/test-runner
646+
@test -n "$(strip $(TEST_SUITES))" || \
647+
(echo "TEST_SUITES is required for test-focused"; exit 2)
648+
cd $(CURDIR) && $(BUILD_DIR)/test-runner $(TEST_SUITES)
649+
629650
# ── Cumulative bug-reproduction runner (RED by design, non-gating) ──
630651
# Mirrors test-runner's link line but uses repro_main.c (own main + counters)
631652
# and TEST_REPRO_SRCS instead of ALL_TEST_SRCS. Exits non-zero while any bug is

0 commit comments

Comments
 (0)