653 Commits
Author SHA1 Message Date
Martin Vogel 0f9ee74a99 Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 21:36:41 +01:00
Martin Vogel 3730a07bf6 Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 21:07:10 +01:00
Martin Vogel 46f449bc3e Merge pull request #3000 from skynetdqdkfa/fix/cobol-scanner-eof-livelock
fix(cobol): terminate LINE_PREFIX_COMMENT scan at EOF (worker livelock)
2026-11-26 21:03:36 +01:00
Martin Vogel cd4f0d771a Merge pull request #2946 from DavidHLP/fix/issue-2877-go-verification
fix(go): wait for binary verification instead of a deadline
2026-11-26 21:01:43 +01:00
Martin Vogel 7d274fb96b Merge origin/main into fix/cobol-scanner-eof-livelock
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-23 18:30:27 +01:00
Martin Vogel 0676695c01 Merge pull request #2979 from DeusData/fix/objectscript-v1.11.0-1261
fix(objectscript): refresh the grammars to v1.11.0 and land #2368's extraction changes (#1261)
2026-11-23 18:11:41 +01:00
Martin Vogel 2b5ca24e40 Merge pull request #2809 from DavidHLP/fix/local-validation-boundaries
fix: isolate validation and handle empty initialization state
2026-11-23 18:06:29 +01:00
DavidHLP a399d96f90 Merge upstream main into fix/issue-2877-go-verification
Signed-off-by: DavidHLP <lysf15520112973@163.com>
2026-11-21 07:29:30 -08:00
Martin Vogel f75e3587dd Merge origin/main into fix/objectscript-v1.11.0-1261
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-19 18:58:24 +01:00
Martin Vogel 7398a093c6 Merge origin/main into fix/cobol-scanner-eof-livelock
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-19 18:34:29 +01:00
Martin Vogel f89935812d Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-19 18:31:38 +01:00
Martin Vogel 8553d3e5e6 cobol: CPU-capped livelock harness, vendored pin, MANIFEST row (#2998)
The regression harness polled waitpid every 10 ms against a 10 s
wall-clock deadline; a loaded runner can turn that into a false
failure. The child now caps its own CPU time (RLIMIT_CPU, 5 s, no core
file) and the parent does one blocking waitpid: the livelock burns CPU
and is stopped by SIGXCPU, while a busy host only delays the child.
With the scanner fix reverted the test fails with SIGXCPU (status 152);
with it, it passes.

internal/cbm/vendored/grammars/MANIFEST.md records the change under
"Local source patches" (in-house grammar, nothing to re-vendor), and
scripts/vendored-checksums.txt pins the patched cobol/scanner.c and the
updated MANIFEST.md (scripts/security-vendored.sh passes).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-19 18:30:51 +01:00
Martin Vogel 12ed5de74a Trim to the accepted fixes (#2814)
Drop tests/test_mimalloc_preinit.sh and its Step 5 line in
scripts/test.sh: check 1 of tests/test_prod_allocator_contract.sh (#2562)
already reproduces the pre-initialization free(NULL) of mimalloc #1341
against the production allocator object with cbm's override flags. The
mimalloc Makefile dependencies stay.

detect_changes: check the hunk command's snprintf length. With the
pinned flag list a project root of roughly 680 characters or more would
truncate it; such a root now skips hunk scoping (whole-file seeding)
instead of running a cut-off git command.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-19 18:27:00 +01:00
Martin Vogel 4f8b66e2d6 Merge pull request #3037 from DeusData/fix/discover-deploy-env-landing
fix(discover): index deploy config files, skip env only as a virtualenv
2026-11-19 02:37:03 +01:00
Martin Vogel 99f2fe3435 Merge origin/main into fix/issue-2877-go-verification
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-19 02:29:08 +01:00
Martin Vogel d3b0b910fb Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-19 02:25:35 +01:00
Martin Vogel 7929b7d025 test: index an Ansible tree under deploy/ through the sequential semantic pass
A playbook naming a role extracts no imports of its own: its IMPORTS
edges come from the Ansible pass, so the semantic pass builds its import
map from those edges (the slow path). Now that deploy/ is walked for its
configuration files, every repository holding Ansible under deploy/ takes
that path through the sequential pass: trees of 50 files or fewer at any
worker count, any tree at one worker.

pipeline_ansible_under_deploy_sequential_pass indexes a two-file tree at
the default worker count, the same tree at one worker, and the tree with
60 more files at one worker; each must draw the role import, and the
graph must not depend on the worker count.

The test runner's memory core is libc malloc/free, so a fault on this
path that needs the production allocator binding cannot show there. The
smoke already indexes a small project with the shipped binary on every
platform (scripts/smoke-test.sh, Phase 2, where the large templated C++
header guards the tree-sitter allocator); that project now also holds the
playbook and its role under deploy/. Phase 2 must report the project
indexed, and Phase 3 checks that the role import was drawn, so the slow
path was reached.

The smoke check needs the semantic pass to allocate its slow-path
import-map keys through the memory core
(fix/semantic-import-map-allocator); land this after that fix.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-18 21:21:43 +01:00
Martin Vogel beba7f8c0c C/C++: re-extract a header's includers in an incremental refresh
A C-family file's preprocessed pass reads the repository files its quoted
#include lines name, so its graph changes with their bytes even when its
own bytes do not. An incremental refresh after an edit to a header alone
re-extracted only the header, and its includers kept their old expansion.

- The #include lookup resolves only to files the index run covers (its
  discovery, through CBMIncludeScope and the pipeline context's
  indexed_files), so every file an expansion depends on is in the run's
  manifest.
- Each file's lsp_surface row records the files its lookup read
  (included_files; transitive, since the headers a header includes are on
  the includer's own list). It is not part of surface_sha.
- The closure planner adds every stored file whose record names a changed
  or deleted file to the delta as a changed file, which then goes through
  the same surface comparison. One pass over the stored rows.
- CBM_INDEX_FORMAT_VERSION 6 -> 7: an index written before records no
  included files, so it is rebuilt once.
- The graph and content digests cover the new column; a database without
  it keeps its previous digest stream.

Tests: pipeline_c_header_edit_refreshes_includers_incrementally (a header
edit reaches a direct and a transitive includer; the refresh equals a
fresh full index) and index_format_v6_included_files_rebuild.

Refs #2993

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-18 04:05:30 +01:00
Martin Vogel 7f4c3f6007 Merge origin/main into the ObjectScript v1.11.0 refresh
Brings the branch up to main 08a7a586 (#2972, #2547, #2992, #2971,
#2360, #2975 and the action bumps).

scripts/vendored-checksums.txt: main (#2547) re-hashed MANIFEST.md and
haskell/parser.c while this branch re-hashed MANIFEST.md for the
ObjectScript grammars. Took main's file and regenerated it with
scripts/security-vendored.sh --update (1101 files); compared with main
only the ObjectScript entries and the MANIFEST.md line differ, and the
integrity check passes.

Everything else merged without conflict; tests/test_extraction.c keeps
548 TEST and 548 RUN_TEST.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-18 03:01:39 +01:00
Martin Vogel ab3d694d2f Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-18 01:58:06 +01:00
Martin Vogel d6aa33e8b9 Merge origin/main into feat/vbnet-structural-extraction
Brings in main up to abd37003cd:
- #2972 C# local functions: calls inside a local function are attributed
  to it (extract_unified.c, helpers.h, csharp_is_extension_block exported
  as cbm_csharp_is_extension_block, 2 new extraction tests)
- #2547 haskell grammar fork: escaped char literal fix (vendored
  parser.c, tools/tree-sitter-haskell, MANIFEST entry and counts,
  THIRD_PARTY.md, provenance audit FORKS map, checksums)
- #2992 subprocess test tree RSS, #2971 abandoned-request cancellation
  in mcp, #2989 pkgmap manifest candidate order (pipeline_internal.h
  cbm_pkg_entry_t source_rel/source_seq), #2988 CI slowest-suites line,
  #2984/#2985 action bumps

Conflict resolutions:
- internal/cbm/vendored/grammars/MANIFEST.md: main added the haskell
  fork entry directly above the vbnet entry, this branch rewrote the
  vbnet Registration sentence. Kept the haskell entry from main followed
  by the vbnet entry from this branch; main did not change the vbnet line.
- scripts/vendored-checksums.txt: both sides changed only the
  MANIFEST.md hash; regenerated with scripts/security-vendored.sh
  --update (haskell/parser.c hash from main kept, new MANIFEST.md hash).

src/pipeline/pipeline_internal.h, internal/cbm/extract_defs.c and
tests/test_extraction.c merged without conflict; each is the exact
union of both sides (TEST/RUN_TEST 559/559).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-17 22:15:50 +01:00
Martin Vogel 98910f9eda Merge origin/main into fix/scala-package-aware-imports
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-17 22:10:21 +01:00
Martin Vogel e6980cd60b Merge pull request #2547 from Zhuoxi2000/fix-haskell-escaped-char-swallow
fix(haskell): stop escaped char literals at the closing quote (#2439)
2026-11-17 22:06:27 +01:00
DavidHLP faac065ebe chore: merge main into Go verification fix
Signed-off-by: DavidHLP <lysf15520112973@163.com>
2026-11-15 23:37:03 -08:00
DavidHLP fd7dfaf865 fix(ci): skip shadow indexing for full test selections
Pass the existing lane selection to the graph-need probe. When every suite is already required, emit the unchanged all-suite prediction without indexing the repository with the released binary. Keep graph analysis for narrowed C changes and cover both decisions in the prediction contract.

Signed-off-by: DavidHLP <lysf15520112973@163.com>
2026-11-15 23:24:20 -08:00
DavidHLP 657092cfa9 test(mem): retain pre-initialization coverage with current mimalloc
Keep the pre-main free(NULL) regression and test-object dependencies. Main already contains the allocator fix in mimalloc 3.5.3, so retain its implementation and vendored checksums instead of applying the old backport.

Signed-off-by: DavidHLP <lysf15520112973@163.com>
2026-11-15 22:46:24 -08:00
Martin Vogel f854641dcb Merge pull request #2988 from DeusData/fix/ci-slowest-suites-and-cpu-line
ci(test): fix the slowest-suites table on uutils sort; print CPU and SHA support
2026-11-14 14:52:16 +01:00
Martin Vogel a4364704a8 Merge origin/main into fix-haskell-escaped-char-swallow
Brings the branch up to main 1ec2f2623. Conflicts were the grammar
bookkeeping only:

- THIRD_PARTY.md: main's thirteen self-maintained forks (sql, vba added)
  plus haskell make fourteen; the haskell paragraph sits between pascal
  and main's new sql paragraph; main's tree-sitter-vba section is kept.
- MANIFEST.md summary: main's 164 grammars with haskell moved from
  vendored-from-upstream to self-maintained: 138 + 21 + 5 = 164,
  recounted from the tree (164 grammar dirs, 164 parser.c, ABI
  9/78/77). haskell stays only in the self-maintained forks table.
- scripts/vendored-checksums.txt: regenerated with
  scripts/security-vendored.sh --update.

scripts/audit-license-provenance.py merged cleanly: the haskell FORKS
row sits alphabetically between dotenv and javascript, next to main's
sql and vba rows.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 12:54:21 +01:00
Martin Vogel 0bde6dea6c Merge origin/main into the ObjectScript v1.11.0 refresh
Main brought in #2969 (vendored VB6/VBA grammar), #2981 (linear-growth
rewrites in extraction and eight LSP passes, a node for C# operators, C
increments recorded as writes), #2977 (receiver gate in the registry),
#2978 (possible override targets in trace_path), #2966 (CONTRIBUTING test
reference) and #2985 (freebsd-vm action bump).

Two files conflicted:

- internal/cbm/vendored/grammars/MANIFEST.md: the summary header. Took
  main's counts (164 grammars, 20 first-party, ABI 9x/78x/77x), which a
  recount of the merged tree confirms (164 grammar directories, LANGUAGE_VERSION
  13/14/15 = 9/78/77). Kept this branch's 2026-11-13 ObjectScript recount
  line above main's 2026-11-12 vba line; main had folded the 2026-11-11 sql
  line into its vba line, so that line goes. Main's vba prose and table rows
  and this branch's ObjectScript v1.11.0 rows are both present.
- scripts/vendored-checksums.txt: regenerated with
  scripts/security-vendored.sh --update. Only the MANIFEST.md hash moved;
  the result differs from this branch only by main's vba entries and from
  main only by the ObjectScript entries.

Every other file merged cleanly. For each file both sides changed
(THIRD_PARTY.md, extract_calls.c, extract_defs.c, extract_usages.c,
helpers.c, lang_specs.c, tests/test_parse_coverage.c) the merged file
differs from each parent by exactly the other parent's change.
#2981 rewrote objectscript_routine_preceding_tag onto a memoized sibling
search with the same probe; this branch does not touch that function.
ObjectScript stays outside #2977's receiver gate allowlist.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 12:01:28 +01:00
Martin Vogel 2fb3ea169e Merge origin/main into feat/vbnet-structural-extraction
Brings the branch up to main 08ab4a09 (#2966, #2969, #2970, #2977,
#2978, #2981).

scripts/vendored-checksums.txt: main (#2969) vendored the VB6/VBA
grammar while this branch edits MANIFEST.md. Regenerated with
scripts/security-vendored.sh --update (1101 files); only the
MANIFEST.md line differs from main.

Everything else merged without conflict and was checked by hand:
- MANIFEST.md keeps main's vba, sql and jsonnet text; only this
  branch's vbnet registration sentence and custom-handling row differ.
- The language count stays 164 (vendored grammar directories); the
  language-count contract passes. VB.NET adds a language name to the
  README list, not a grammar.
- #2977's receiver gate is an allowlist (gate_scope); VB.NET is not on
  it, so it stays GATE_OFF, and receiver_chain_admits is unchanged.
- The VB.NET case-insensitive retry still hooks
  cbm_registry_resolve_lang, cbm_registry_resolve_ref and
  resolve_call_lang; the Field-call USAGE policy and the enum-member
  gate are intact.
- #2981's linear-growth rewrites in extract_defs.c touch no VB.NET
  function; find_class_body still decides VB.NET first.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 11:33:22 +01:00
Martin Vogel d6d9440fb0 ci(test): fix the slowest-suites table on uutils sort; print CPU and SHA support
The "8 slowest suites" summary in scripts/run-tests-parallel.sh sorted with
`sort -t= -k6 -rn`. uutils sort (Rust coreutils, shipped as sort on newer
runner images) reads the attached form -t= as -t with an inline "=value",
an empty separator, and exits with "separator must be exactly one character
long: ''", leaving the table empty. Pass the separator as its own argument,
which GNU, BSD and uutils sort all parse alike. Informational only: the
script has no set -e and its exit status is unchanged.

scripts/test.sh's environment line now also names the CPU and whether it
has SHA-256 instructions (x86 sha_ni / ARMv8 sha2), the signal
src/foundation/sha256.c uses to choose its hardware or portable backend.
A sanitized runner fingerprints its own large image on that path, so which
CPU a hosted job drew decides how long those fingerprints take. The helper
lives in scripts/env.sh (cpu_summary, opted into via print_env --cpu, so
build.sh, lint.sh and repro.sh print exactly what they did); it reads
/proc/cpuinfo or lscpu on Linux/MSYS2 and sysctl on macOS, reports
"unknown" for anything unreadable, and never fails the caller.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 10:35:55 +01:00
Martin Vogel 08ab4a09fe Merge pull request #2981 from DeusData/perf/linear-growth-sites
fix, perf: C# operator nodes, C increment writes and linear growth in extraction and eight language passes
2026-11-14 10:24:34 +01:00
Martin Vogel 2f37f6fa0d Merge origin/main into feat/vbnet-structural-extraction
Brings the branch up to main d68f491a (#2967, #2968, #2970, #2974).

src/pipeline/registry.c: main (#2968) gives registry_resolve_scoped the
calling definition's test verdict (`caller_test`), adds
cbm_registry_resolve_ref for references (USAGE, READS, WRITES) and
routes calls through a static resolve_call_lang. This branch wraps the
lookups with the VB.NET case-insensitive retry. Resolved by keeping
both: vb_resolve_folded takes `caller_test` and passes it to its own
lookup, and the retry hooks cbm_registry_resolve_lang (false),
cbm_registry_resolve_ref and resolve_call_lang (the caller's verdict),
exactly as main's first lookup in each. Without the hook in
cbm_registry_resolve_ref, VB.NET references would have stopped folding.

internal/cbm/vendored/grammars/MANIFEST.md: main added the sql row next
to the vbnet row this branch edits; both rows kept.

scripts/vendored-checksums.txt: regenerated with
scripts/security-vendored.sh --update; only the MANIFEST.md line
differs from main.

Adapted with the merge: the VB.NET registry test passes `false` as the
new caller_test argument of cbm_registry_resolve_call_scoped (a
production caller).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 00:48:38 +01:00
Martin Vogel 334bad2e41 refactor(path-alias): allocate through the memory core
path_alias.c had 40 raw allocator sites outside the memory core. Every
allocation and its free now go through cbm_alloc/cbm_free in one class,
and the two cbm_strndup copies the file freed itself come from a
core-backed helper. cbm_path_alias_resolve keeps strdup, because
pass_pkgmap.c and the tests free its result with free(); the baseline
drops from 40 to 1. No behaviour changes.

The nearest-ancestor test built its collection with calloc/strdup and
freed it through cbm_path_alias_collection_free; it now frees what it
built with the allocator it used.

Checked under the production allocator, where a block freed by the wrong
side crashes: nest (34 tsconfig files with paths) and immich index
identically to before, and a synthetic project with an extending nested
tsconfig stays identical through full, fallback and incremental reindex
steps.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 00:47:41 +01:00
Martin Vogel eb44c04d4e Merge origin/main into feat/vendor-vba-grammar
Brings in #2974 (incl. the jsonnet scanner patch) and #2970. One conflict:
scripts/vendored-checksums.txt, where #2974 and the vba vendoring both
rewrite the MANIFEST.md line. Resolved by taking main's file and
regenerating it with scripts/security-vendored.sh --update; against main it
differs only in the MANIFEST.md line and the five vba lines, and the
integrity verify passes.

THIRD_PARTY.md, MANIFEST.md and tests/test_parse_coverage.c merged cleanly;
each equals main plus this branch's own change (identical patch-ids), and
test_parse_coverage.c has 76 TEST and 76 RUN_TEST entries (71 at the merge
base, +2 from main, +3 from this branch). The MANIFEST summary (164
grammars) and ABI line (9/78/77) match a recount from the tree.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 00:31:52 +01:00
Martin Vogel 45e20292d3 Merge origin/main into the ObjectScript v1.11.0 refresh
Brings in #2974 and #2970. One conflict: scripts/vendored-checksums.txt,
where #2974 (jsonnet scanner patch) and the vendor commit both rewrite the
MANIFEST.md line. Resolved by taking main's file and regenerating it with
scripts/security-vendored.sh --update; the result differs from main only in
the MANIFEST.md line and the eight refreshed ObjectScript files, and the
integrity verify passes. MANIFEST.md, THIRD_PARTY.md and
tests/test_parse_coverage.c merged cleanly with both sides kept.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 00:21:39 +01:00
Martin Vogel 086967955d chore(vendor): refresh the ObjectScript grammars to upstream v1.11.0
Re-vendors objectscript_udl and objectscript_routine from
intersystems/tree-sitter-objectscript a7ffcdf2de8e to tag v1.11.0
(25cf0f67a380, upstream HEAD); both stay ABI 15. The refreshed scanner
lexes Language = python method bodies with Python's string, triple-quote
and #-comment rules, so a brace inside a Python string, comment or
docstring no longer runs the body past its closing brace and drops the
methods that follow it (#1261).

Both parser.c files are upstream's committed bytes, and regenerating them
from upstream's src/grammar.json and tree-sitter.json with tree-sitter-cli
0.27.1 (upstream's locked version) reproduces them byte-for-byte. The three
local patches recorded in MANIFEST.md are re-applied unchanged: the
objectscript_common.h include repoint, the uint8_t -> int widening of two
loop counters, and the empty-state memcpy guard; upstream v1.11.0 still
carries the original form of all three.

Updates the MANIFEST.md note, pin rows and ABI recount, THIRD_PARTY.md and
scripts/vendored-checksums.txt, and adds two parse-coverage tests: Python
bodies with braces in strings, comments and docstrings parse completely,
and an unclosed Python body is still reported as partial.

Refs #1261, #2368

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 00:18:11 +01:00
Martin Vogel 4c52fb4e1a Merge origin/main into fix/scala-package-aware-imports
Brings in main up to 09bd6bb1 (#2967 FreeBSD peer pid, #2974 graph
variation and content loss fixes).

Resolutions:
- scripts/memory-core-baseline.txt (textual conflict): both sides
  lowered counts in the same hunk. pass_parallel.c keeps this branch's
  29 (arena QNs); pass_pkgmap.c takes main's 80 (#2974 dropped one raw
  free in cbm_pkgmap_build; this branch's pass_pkgmap.c additions add
  no raw site). Both values re-derived by scanning the merged tree with
  scripts/lint-memory-core.py; the lint passes.
- src/pipeline/pass_pkgmap.c (auto-merged): main's deterministic
  manifest order in cbm_pkgmap_build and this branch's Scala package
  index sit in separate functions; the merged file is main plus this
  branch's change unchanged (same per-file patch-id).
- tests/test_edge_imports.c, tests/test_pipeline.c (auto-merged): both
  sides' new tests are kept and registered; main's new tests call no
  function this branch re-signed. Same per-file patch-id as this
  branch's change.

Every other file equals main.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-14 00:17:43 +01:00
Martin Vogel e5b3972429 fix(grammar): give the jsonnet scanner per-parser state
Indexing go/grafana__loki produced a different graph from one run to the
next: each index reported one or two jsonnet files as parse_partial, a
different set every time, and indexing only its 68 jsonnet files reported
21-37 of them, with real definitions and their CALLS/DEFINES/IMPORTS/USAGE
edges missing. Parsed one at a time, every one of those files is clean,
and CBM_WORKERS=1 gave the same graph on every run.

The vendored jsonnet external scanner kept its state (inside a string,
and which quote) in three file-scope globals, so every indexing worker's
parser shared one copy. tree-sitter restores the scanner state right
before each scan and saves it right after; another thread's write in that
window changed the scan in flight, and a quoted string ran past its
closing quote. Its deserialize also ignored the zero-length call that
starts a parse, so a file ending inside an unterminated quote left that
state to every later parse in the process, and no later ||| text block
could be lexed.

The state now lives in the payload from ..._external_scanner_create(),
and deserialize resets it before reading. Lexing logic and the 3-byte
serialized state are unchanged. MANIFEST.md records the local patch next
to the properties scanner's, THIRD_PARTY.md notes it must be re-applied
on re-vendor, and scripts/vendored-checksums.txt is repinned.

Two single-threaded tests in parse_coverage pin it: a second parser run
from inside parser A's input callback, at the byte after A's opening
quote, must not break A's string; and a parse that ends inside a string
must not stop the next one from lexing a ||| block. Both fail on the
unpatched scanner. With the patch, 30 indexes of the 68 files and 5 of
the whole repo each give one result, with no jsonnet file partial.

lint-vendored-scanners (now part of lint-ci) rejects mutable file-scope
state in vendored scanners and the headers next to them. properties and
jsonnet both had it; haskell's and purescript's read-only cases are
whitelisted with their reasons.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-13 18:07:03 +01:00
Martin Vogel cd318253e4 fix(pkgmap): pick the manifest nearest the root when two declare one package
Two manifests can declare the same package name: cli/cli has its own go.mod and
a test fixture's copy with the same module path. cbm_pkgmap_build kept the
first entry in worker order, and which worker parses which manifest is thread
scheduling, so about one index run in thirty mapped the module to the fixture
directory. IMPORTS edges fell from 3,869 to 690 and CALLS from 19,898 to
12,392, with status "indexed" and nothing logged.

The candidates are now ordered by package name, depth below the repository
root and path before the first-wins insertion, so the winner is a property of
the repository. The sequential builders go through the same function.

Two tests hand the same manifests to the merge in both worker orders.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-13 18:06:53 +01:00
Martin Vogel ea98999e08 Merge origin/main into fix/scala-package-aware-imports
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-13 07:37:35 +01:00
Martin Vogel 56f4b91ff6 Merge origin/main into feat/vendor-vba-grammar
Brings in #2957 (sql became a self-maintained fork), #2959 and #2962.
Both sides added a self-maintained grammar fork, so every conflict keeps
both additions:

- MANIFEST.md summary: 164 grammars = 139 vendored-from-upstream + 20
  self-maintained (sql moved over on main, vba added here) + 5
  registry-disagreement; the ABI tally stays 9/78/77 (sql stayed ABI 15).
  The notes and the forks table carry both the sql and the vba rows.
- THIRD_PARTY.md: thirteen further self-maintained forks including sql and
  vba; main's sql paragraph, then this branch's tree-sitter-vba section.
- tests/test_parse_coverage.c: both test blocks and both sets of
  RUN_TEST registrations.
- scripts/vendored-checksums.txt: regenerated with
  security-vendored.sh --update; against main only the MANIFEST.md line
  and the five vba files differ.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-12 23:18:44 +01:00
Martin Vogel fcbfed48d2 Merge pull request #2957 from DeusData/distill/2246-sqlite-grammar
fix(grammar): stop flagging valid SQLite migrations as partially parsed
2026-11-12 22:57:52 +01:00
Martin Vogel c3c56c6ddb chore(vendor): vendor the VB6/VBA tree-sitter grammar
Vendors harumiWeb/tree-sitter-vba (MIT, (c) 2026 harumiWeb) at
83c5c3c3c721 (tag v0.14.5, upstream HEAD), its vba dialect, as a
self-maintained fork in tools/tree-sitter-vba/. This is the precondition
for VB6/VBA extraction (#2564, ported after #1179); it registers no
language yet.

Why generated here: upstream does not track its generated parser (its
ADR 0002), so the fork carries upstream's grammar source in upstream's
layout with no local patch, and parser.c is generated in this repository
with tree-sitter-cli 0.25.10 (ABI 15), the generator every fork here
uses. Upstream's own copy is generated by 0.26.9.

Why this pin: v0.13.0 (the pin #2564 carried) exposes the same procedures
but misreads statements without an ERROR node. On the three corpora
below it yields 1,276 expression_statement nodes where v0.14.5 yields 56
(`Err.Raise a, b, c` after a label loses its callee), and it leaves an
ERROR at `Case obj Is Nothing`.

Why the vba dialect rather than upstream's vb6 one: measured with the
CLI on kellyethridge/VBCorLib @ 100acbbae0c0 (655 VB6 files),
Kr00l/VBCCR @ 4b86c5c2c075 (161 VB6 files, 70 .ctl) and upstream's 481
VBA examples, procedures outside ERROR nodes are 14,084/14,084,
12,385/1,552 and 8,104/6,573 (vba/vb6). vb6 rejects the PtrSafe/LongPtr
forms dual-target VB6 keeps inside #If VBA7 blocks and then loses whole
files; vba never sees fewer procedures in any file. vb6's parser.c is
also 75.8 MB against 48.3 MB.

Provenance by hash: common/define-grammar.js is upstream's blob
5e1f7d758ce1; vba/grammar.js minus its 40-line provenance header is
upstream's blob 9247dbbfe166. Two independent generations are
byte-identical, and identical to a generation from upstream's own layout
and tree-sitter.json. The generated node-types.json is upstream's
checked-in file byte-identical (500e635610), and the parse-table counts
equal upstream's own generated parser. Review: 0 non-ASCII bytes, 0
unmatched characters on full tokenization, one comment (the generator
stamp), no string literal with a space, no external scanner, no call
outside the tree-sitter macros. No upstream script, package hook or
binary was run or vendored.

- internal/cbm/vendored/grammars/vba/: the generated parser.c, the
  tree_sitter/ headers (byte-identical to copies already vendored) and
  upstream's MIT LICENSE byte-identical.
- internal/cbm/grammar_vba.c: compiles and links tree_sitter_vba. No
  CBMLanguage, extension or alias routes to it yet; extraction adds them
  under the vb6/vba names (vb and visualbasic mean VB.NET).
- MANIFEST.md (fork note with the measurements and known gaps, forks
  table, 164 grammars, ABI recount), THIRD_PARTY.md (fork list and a vba
  section), scripts/vendored-checksums.txt, and the FORKS entry in
  scripts/audit-license-provenance.py.
- README.md and the Chocolatey nuspec say 164 languages: the
  language-count contract defines the count as the vendored grammar
  directories.
- tests/test_parse_coverage.c: a dual-target VB6 class module (IDE class
  header, Declare in both #If VBA7 branches, Property Get/Let/Set,
  Implements, events, a label, bare calls) parses with no ERROR node and
  every bare call keeps its callee; a CRLF VB6 form parses clean; broken
  source is still flagged. The class case fails on v0.13.0 and on the vb6
  dialect.

Refs #721, #2564

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-12 21:35:36 +01:00
Martin Vogel 91f457ffbf fix(visualbasic): clear the GCC, cppcheck and vendored-integrity reds
Three CI findings on the port, none a behaviour change:

- vb_canonical_callee measured a segment as `dot - seg` and bounded it
  with `o + len + 1 >= cap`; GCC 13 on x86_64 (fortified memcpy, -O2)
  cannot rule out a wrapped sum and fails the prod build with
  -Werror=stringop-overflow. Measure the segment with strcspn and bound
  it as `len >= cap - o - 1`, which cannot wrap because o < cap holds.
  Reproduced and cleared with the CI image's GCC 13.3 on x86_64.
- vb_as_clause_type returned `text[0] ? text : NULL` after cutting at the
  first '('; cppcheck 2.20 cannot see that the cut can empty the string
  and reports knownConditionTrueFalse. Return NULL when '(' is the first
  character, then cut. Reproduced and cleared with cppcheck 2.20.
- The MANIFEST.md edit of this branch was missing its line in
  scripts/vendored-checksums.txt (security-vendored.sh --update; only
  that line changes).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-12 20:42:00 +01:00
Martin Vogel 583e71b6ac Merge origin/main into fix/scala-package-aware-imports (#2360)
Bring #2360 up to date with main b3ec08da (#2427 registry test verdict,
#2962 MSan CI, #2952 Windows stdio guard). The merge is clean and needs
no follow-up edit: #2360's code makes no cbm_registry_add* call and never
used is_test_qn, and Scala definitions register through the shared
seeders in pass_definitions.c, pass_parallel.c and pipeline_incremental.c,
which #2427 already passes the extractor verdict through for every
language. The branch's own change against main is byte-identical to
28948f29's against f5d57465.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-12 19:23:57 +01:00
Martin Vogel 74affb1990 Merge branch 'main' into fix/test-impact-gate 2026-11-12 19:07:58 +01:00
Martin Vogel ad257095a5 Merge branch 'main' into distill/2246-sqlite-grammar 2026-11-12 19:07:55 +01:00
Martin Vogel f9dc6503ae ci(test-impact): narrow every test leg, on fork PRs, with base tooling
Three changes to how PR CI consumes the test-impact selection (user
decisions R150 and R151, 2026-11-11).

Fork PRs. select-tests ran only when vars.TEST_IMPACT_MODE was `gate`, and
GitHub passes no repository variables to a pull_request run from a fork:
all 24 fork runs in the last 40 PR runs skipped the job, maintainer-started
ones included. The condition is now (vars.TEST_IMPACT_MODE || 'gate') ==
'gate'. Setting the variable to anything else (e.g. `shadow`) still turns
the gate off for same-repository and Dependabot PRs; for fork PRs the off
switch is the default in the expression on main. No pull_request_target,
no new permissions, no secrets.

Base tooling. select-tests built and ran the PR checkout's own engine,
test-impact-select.sh and selection.py, so a change to them could narrow
its own tests. The job now checks out the merge base (HEAD^1 of the merge
ref) into a worktree, builds that engine and runs that copy of the script
with --repo pointing at the PR checkout. test-impact-select.sh separates
the tooling (its own checkout) from the repository under test (--repo).
Until this lands, a PR's merge base has no --repo: the job then fails and,
as before, every test runs.

All legs. Only the Linux x86_64 test leg consumed a selection. A narrowed
answer now also produces portable/ (selection.py --whole-suites with the
platform-specific suites of the base and HEAD), and the arm64 and macOS
test-unix legs and the Windows leg run that view: platform-neutral suites
as selected, every platform-specific suite whole. No portable view, no
narrowing there. Sanitizer, TSan, MSan, diag and LSan lanes still run
every test. The shard harness already slices the selected list, so the
sharded arm64 leg and the shard-completeness proof need no change.

docs/SMART_CI.md and README.md follow; tests/test_lane_wiring_contract.sh
pins the new wiring.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-11 19:50:31 +01:00
Martin Vogel dd3c50f4d5 feat(test-impact): platform-suite classification and a portable view
selection.py learns two things the CI needs to narrow test legs other than
Linux x86_64, where the coverage map is recorded:

- `platform-suites --repo DIR --rev REV...` lists the platform-specific
  runner suites: those whose defining test file holds a SKIP_PLATFORM( call
  or an #if/#ifdef on an OS or architecture macro (the two markers
  scripts/check-no-test-skips.sh names for a genuinely platform-specific
  test), and those tests/test_main.c registers under such a conditional.
  Every revision given is read and the results are united, so a change
  cannot declassify a suite by dropping its conditionals. Any git failure
  exits 1.
- `filter --whole-suites FILE` writes the view for such a leg: every listed
  suite runs whole there, its per-test tokens collapsed to the suite; a
  listed suite the answer did not select is added and marked optional (a
  build that does not register it drops it with a notice, as a full run
  never runs it); the answer's own required suites stay required. An
  unusable list runs everything.

Nothing consumes the new view yet. Contract cases in
tests/test_test_impact_selection.sh.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-11 19:50:30 +01:00