From 4a506cd39b742db3bc76ca73e9ec4243ae409c66 Mon Sep 17 00:00:00 2001 From: tobjend Date: Sat, 4 Jul 2026 01:28:35 +0200 Subject: [PATCH] fix: add bare function fallback to CALL_PREFIXES, fix IMPORT_PATTERNS order, update pipeline diagram MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CALL_PREFIXES: add bare "function" as last fallback — Kotlin uses @function for both calls and definitions (no function.call capture) - _find_arglist_node: remove template_string from arglist detection - IMPORT_PATTERNS: require_relative before require (Ruby fix) - pipeline-overview.txt: remove .gitignore, add min_coverage=0.8 + core/outlier - DEFAULT_COVERAGE=0.8, frequency_filter at fixed 0.2 --- bex/tag_preprocessor/analyze.py | 2 +- bex/tag_preprocessor/code.py | 4 +--- docs/pipeline-overview.txt | 13 +++++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bex/tag_preprocessor/analyze.py b/bex/tag_preprocessor/analyze.py index 7b8e4dd..db10ad7 100644 --- a/bex/tag_preprocessor/analyze.py +++ b/bex/tag_preprocessor/analyze.py @@ -51,8 +51,8 @@ def _match_glob(filepath, pattern): IMPORT_PATTERNS = [ re.compile(r"^\s*import\s+"), re.compile(r"^\s*from\s+"), - re.compile(r"^\s*require\s+"), re.compile(r"^\s*require_relative\s+"), + re.compile(r"^\s*require\s+"), re.compile(r"^\s*#\s*include\s+"), re.compile(r"^\s*use\s+"), re.compile(r"^\s*include\s+"), diff --git a/bex/tag_preprocessor/code.py b/bex/tag_preprocessor/code.py index 6d91985..9f793aa 100644 --- a/bex/tag_preprocessor/code.py +++ b/bex/tag_preprocessor/code.py @@ -51,7 +51,7 @@ BEHAVIORAL_PREFIXES = ( "module", ) -CALL_PREFIXES = ("function", "reference.call", "reference.class") +CALL_PREFIXES = ("function.call", "function.method.call", "reference.call", "reference.class", "constructor", "function") def _extract_call_tokens(seq): """Extract ordered call-like tokens from a method sequence. @@ -107,8 +107,6 @@ def _find_arglist_node(parent): for child in parent.children: if child.type in ("argument_list", "arguments"): return child - if child.type == "template_string": - return child return None diff --git a/docs/pipeline-overview.txt b/docs/pipeline-overview.txt index ef95190..f89cd4e 100644 --- a/docs/pipeline-overview.txt +++ b/docs/pipeline-overview.txt @@ -4,7 +4,7 @@ │ (.py .js .ts .kt .rb .go │ │ .rs .java .c .cpp .h) │ └──────────┬────────────────────┘ - │ scan_directory() + .gitignore + │ scan_directory() ▼ ┌───────────────────────────────┐ │ Files grouped by extension │ @@ -68,11 +68,12 @@ │ │ └───────────┬────────────┘ │ │ ▼ ▼ │ │ ┌──────────────────────────────────────────────────┐ │ - │ │ infer_ensemble(symbol_seqs) │ │ - │ │ ├── CRX (fast, unordered) │ │ - │ │ ├── iDRegEx (ordered regex) │ │ - │ │ └── kOREInference (noisy, probabilistic) │ │ - │ │ └── pick best by MDL score │ │ + │ │ infer_ensemble(symbol_seqs, min_coverage=0.8) │ │ + │ │ ├── CRX (fast, unordered) │ │ + │ │ ├── iDRegEx (ordered regex) │ │ + │ │ └── kOREInference (noisy, probabilistic) │ │ + │ │ └── pick best by MDL score │ │ + │ │ └── core/outlier split via _find_core(0.8) │ │ │ └──────────────────────┬───────────────────────────┘ │ │ ▼ │ │ (label, result, count, meta) │