Skip to content

fix(haskell): wire haskell into class_start named-entity extraction (#1295) - #1377

Merged
squid-protocol merged 2 commits into
mainfrom
fix/haskell-class-start-named-extraction-1295
Aug 12, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/haskell-class-start-named-extraction-1295

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Extends #1264's per-language class_start named-entity extraction to haskell, per epic #1295. No language_standards.py regex change -- pure ground-truth fix, same shape as rust's union_item fix.

Haskell's own class_start regex already intentionally matches data(?:\s+family)?|newtype|class|type(?:\s+family)? under an "Object / Entity Declarations" comment. NODE_MAPS["haskell"]["class_node_types"] in tests/tools/tree_sitter_accuracy_audit.py only had {"class_decl", "class"} -- missing tree-sitter-haskell's separate node types for data/newtype/type declarations (data_type, newtype, type_synomym -- the misspelling is the grammar's own, kept verbatim -- data_family, type_family), all of which expose a usable name field natively (no _get_node_name branch needed). Confirmed via pandoc's data PandocOutput/data Filter/etc. Added all 5 node types.

real_classes/found_classes 1→16, extra_classes 15→0 -- a perfect match, not an accepted-gap case like csharp/zig/rust.

This PR was implemented by an independent Gemini/Antigravity delegation pass (epic #1295's first cross-model implementation), then independently re-verified end to end before merge -- re-read the diff, re-ran tree_sitter_accuracy_audit.py --lang haskell --ci, and re-ran the relevant pytest suites myself rather than trusting the subagent's own "verified" self-report alone.

Verification

  • python tests/tools/tree_sitter_accuracy_audit.py --lang haskell --ci -- clean
  • python tests/tools/crucible_check.py -- both modes PASS
  • python tests/tools/audit_check.py --regenerate -- ruff findings were pure line-shifts
  • python -m pytest tests/core_engine/ tests/extraction/ -- 6585 passed, 2 skipped, 11 xfailed, 3 xpassed

Test plan

  • tree_sitter_accuracy_audit.py --lang haskell --ci clean
  • crucible_check.py both modes clean
  • audit_check.py clean
  • Full core_engine/extraction suite passes

🤖 Generated with Claude Code

squid-protocol and others added 2 commits August 12, 2026 16:39
Haskell's class_start regex intentionally matches data, newtype, class, and type (representing Object / Entity Declarations).
Prior to this fix, the tree-sitter accuracy audit only considered class_decl and class as Haskell's class_node_types. This caused a ground-truth measurement gap where real declarations (like data and newtype) found by GitGalaxy were incorrectly flagged as extra.

By including data_type, newtype, type_synomym, data_family, and type_family in NODE_MAPS['haskell']['class_node_types'], we corrected this measurement gap. The name field is naturally resolvable for all of them, so _get_node_name works out-of-the-box. This successfully drops extra_classes to zero, allowing us to safely add haskell to _CLASS_START_NAMED_EXTRACTION_LANGS.
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 8fc2abe into main Aug 12, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the fix/haskell-class-start-named-extraction-1295 branch August 12, 2026 21:05
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.

1 participant