Repository navigation
Description
Summary
Three languages (scala, matlab, haskell) show incomplete function detection with 0 false positives, making them safe candidates for regex broadening. Each regex is too NARROW, not wrong -- expanding to cover more legitimate syntax can only find more real matches, not corrupt currently-correct ones.
Related epic: #1261
Per-language measurements
| Language | Files | Real Functions | Found Functions | Recall | False Positives | Precision |
|---|---|---|---|---|---|---|
| scala | 7 | 499 | 205 | 41% | 0 | 100% |
| matlab | 6 | 23 | 7 | 30% | 0 | 100% |
| haskell | 7 | 94 | 4 | 4% | 2 | 67% |
Data from tests/tree_sitter_accuracy_baseline_<lang>.json files.
What patterns are likely being missed
Scala (41% recall, 294 missed)
Real Scala functions use multiple syntactic forms:
- Parenthesis-less definitions:
def foo = ... - Context bounds and implicit parameters:
def foo[T: Bound] = ... - Extension methods and inline definitions
- Curried parameter lists:
def foo(a: Int)(b: String) = ...
Current regex likely only matches the most common form with parens.
Matlab (30% recall, 16 missed)
Matlab functions often appear in methods blocks (inside class definitions) and use various syntax:
- Standalone function definitions:
function output = foo(input) - Methods within
classdef...endblocks - Nested functions and anonymous functions
Current regex likely misses methods-block syntax.
Haskell (4% recall, 90 missed; 2 false positives)
Haskell functions use significant-whitespace definitions that span multiple lines:
- Guard clauses:
foo x | x > 0 = ... - Where-clause local definitions
- Lambda-bound function definitions
Current regex likely only matches simple single-line definitions.
Action
- Examine real corpus samples in
language-crucible/data/{scala,matlab,haskell}to identify all valid definition patterns - For each language:
- Update the
func_startregex ingitgalaxy/standards/language_standards.pyto broaden coverage - Verify no new false positives are introduced (0-false-positive constraint must hold)
- Test against the corpus and existing extraction-gauntlet tests in
tests/extraction/languages/test_<lang>.py
- Update the
- Before pushing, run
python tests/tools/crucible_check.pyto confirm no cross-language regressions
Notes
- This is the safest kind of gap to close: precision is already perfect/near-perfect, so broadening is low-risk
- Good entry point for someone new to the codebase (unlike Tier 1 issues, which require careful investigation)
- Haskell's 2 false positives are minimal; focus on recall expansion but keep an eye on precision
Activity
fix(core): bounding alone wasn't enough for backtick -- fold comment …
fix(core): bound prism.py's unbounded single-quote shield -- closes #…
fix(tests): fix rust/swift tree-sitter ground-truth gaps behind #1311'…
fix(core): broaden scala/matlab/haskell func_start recall -- closes s…
fix(typescript): capture brace-less arrow functions dropped by Mode B…
fix(#2409,#2410): livecode func_start -- Mode D routing + LiveCode Bu…
fix(#2405): contain Mode-D scope desync + handle SerenityOS brace blo…