Repository navigation
fix(haskell): allow single-line func_start blocks past the '< 2 lines' floor - #1443
Merged
Merged
Conversation
…' 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]>
Contributor
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1435.
_slice_by_indentation's hardcoded "block must be >= 2 lines" floor silently droppedevery abstract typeclass method signature (
methodName :: Type, declared inside aclass ... whereblock with no default implementation) -- a legitimate one-line block bydefinition, since there's no equation clause to extend into.
Fix
Gated the floor off for haskell specifically:
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):
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,
getExtensionsinOptions.hs) and +2minor 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 neverrestate an explicit
::signature, invisible tofunc_start's regex regardless of this fix).tests/tools/tree_sitter_accuracy_audit.py --all --ciconfirms zero regressions across all 31baselined 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 (newcase exercises the exact
getExtensions :: a -> Extensionsrepro)tree_sitter_accuracy_audit.py --lang haskell --regenerate+--summary-tabletree_sitter_accuracy_audit.py --all --ci-- all 31 languages clean, no regressionscrucible_check.py --mode both-- both golden masters blessed (expected drift), re-verifiedclean after
audit_check.py --ci --regenerate-- ruff/mypy/dead-key/ast-accuracy all clean🤖 Generated with Claude Code + Gemini (Antigravity CLI)