Skip to content

fix(haskell): allow single-line func_start blocks past the '< 2 lines' floor - #1443

Merged
squid-protocol merged 1 commit into
mainfrom
fix/haskell-1435-line-count-floor
Aug 13, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/haskell-1435-line-count-floor

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Fixes #1435. _slice_by_indentation's hardcoded "block must be >= 2 lines" floor silently dropped
every abstract typeclass method signature (methodName :: Type, declared inside a
class ... where block with no default implementation) -- a legitimate one-line block by
definition, since there's no equation clause to extend into.

Fix

Gated the floor off for haskell specifically:

if not block or (len(block.splitlines()) < 2 and lang_id != "haskell"):
    continue

A single-line match is virtually always a real, legitimate typeclass method signature --
func_start's own regex already requires an explicit :: type-signature marker to match at all,
which is a strong enough signal on its own.

Root-caused by Claude, implemented by Gemini (agy/Antigravity CLI) in an isolated worktree,
independently re-verified end-to-end by Claude before push.

Results, and an honest correction to this issue's own framing

Independently re-measured live before/after (the tool's own "baseline" column reflects the
committed JSON, not a true live pre-fix comparison):

found_functions (of 94) extra_functions
Before fix 52 26
After fix 53 28

The issue's own framing ("explains most of the recall gap") was too optimistic -- the real effect
is +1 real function recovered (the issue's own repro, getExtensions in Options.hs) and +2
minor new false positives. The fix is correct, safe, and narrowly scoped, just smaller in impact
than hoped. The bulk of haskell's remaining recall gap turns out to be a separate, harder problem
-- filed as #1442 (typeclass instance implementations and where-clause locals that never
restate an explicit :: signature, invisible to func_start's regex regardless of this fix).

tests/tools/tree_sitter_accuracy_audit.py --all --ci confirms zero regressions across all 31
baselined languages (checked specifically for the class of ripple effect that bit issue #1419's
zig PR).

Test plan

  • tests/extraction/languages/test_haskell.py / test_haskell_strict.py -- 149 passed (new
    case exercises the exact getExtensions :: a -> Extensions repro)
  • tree_sitter_accuracy_audit.py --lang haskell --regenerate + --summary-table
  • tree_sitter_accuracy_audit.py --all --ci -- all 31 languages clean, no regressions
  • crucible_check.py --mode both -- both golden masters blessed (expected drift), re-verified
    clean after
  • audit_check.py --ci --regenerate -- ruff/mypy/dead-key/ast-accuracy all clean

🤖 Generated with Claude Code + Gemini (Antigravity CLI)

…' floor (#1435)

_slice_by_indentation had a hardcoded "must be >= 2 lines" floor that
silently dropped every abstract typeclass method signature (methodName ::
Type, declared inside a class ... where block with no default
implementation) -- a one-line block by definition, since there's no
equation clause to extend into. Gated the floor off for haskell only.

Correction to this issue's own framing: independently re-measured live
before/after (not just the committed baseline, which was stale) and the
real effect on this corpus is +1 real function recovered (getExtensions in
Options.hs, the issue's own repro) and +2 minor new false positives, not
"most of the recall gap" as originally estimated. The bulk of haskell's
remaining gap turns out to be a separate, harder problem: typeclass
instance implementations and where-clause locals that never restate an
explicit `::` signature, which func_start's regex structurally requires to
match at all -- filed as a follow-up issue, out of scope for this fix.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Gemini 3.1 Pro <[email protected]>
@squid-protocol
squid-protocol merged commit f2704eb into main Aug 13, 2026
27 checks passed
@squid-protocol
squid-protocol deleted the fix/haskell-1435-line-count-floor branch August 13, 2026 14:57
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

haskell func_start: hardcoded '< 2 lines' floor in _slice_by_indentation drops every abstract typeclass method signature

1 participant