Skip to content

haskell func_start: trailing-apostrophe (prime) function names collapse into their unprimed sibling #1565

Closed

Description

@squid-protocol

Summary

Haskell's idiomatic "prime" naming convention (f/f', go/go', convertWithOpts/convertWithOpts') is not preserved through the detection pipeline. Primed siblings are incorrectly deduplicated and merged with their unprimed counterparts, resulting in false negatives (missing primed function) and false positives (bogus entries under wrong names at wrong line numbers).

Details

The func_start regex correctly captures primed names: tested in isolation, convertWithOpts' :: ... \n convertWithOpts' scriptingEngine istty datadir opts = do matches with group "convertWithOpts'" intact, and the name-capture character class ([a-zA-Z_][a-zA-Z0-9_\']*) includes ' as expected.

However, in the actual engine output, the primed sibling is lost downstream. Concrete repro using pinned language-crucible/data/haskell/pandoc corpus:

  • Real definitions:

    • convertWithOpts (line 83-84, 2 args)
    • convertWithOpts' (line 138-144, 4 args, the real workhorse the first one delegates to)
  • Actual database state after scan (via galaxyscope language-crucible/data/haskell/pandoc --config .galaxyscope.yaml --db-only and querying function_data):

  • Result: The real convertWithOpts' function name never appears in the database. Its identity (trailing ') was dropped and it got folded into the convertWithOpts name family, with a start_line landing in between the two real definitions.

Root Cause

Most likely not a regex capture problem, but detector.py's "same-name continuation walk" / _slice_by_indentation dedup logic (the same subsystem referenced in the func_start regex's own inline comment about deduping same-name-same-indent clauses) is comparing names in a way that treats convertWithOpts and convertWithOpts' as the same key — losing the prime distinction.

Impact

Double fault:

  1. Real primed function's args-count and identity are never recorded (false negative — "missing")
  2. Bogus entry appears under wrong (unprimed) name at a line belonging to neither real definition (false positive — misattribution)

Related Work

Activity

  1. added
    bug
    data-integrity
    core-engine
    on Aug 14, 2026
  2. added this to the v2.4.8 milestone on Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginedata-integrity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions