Skip to content

Add ghost-prevention (negative-case) coverage for 17 languages with >70% None in test cases #1073

Closed

Description

@squid-protocol

Issue

In 17 of 45 languages, over 70% of that language's _SIMPLE_CASES entries have None in the negative-snippet slot (meaning zero false-positive/ghost-prevention testing for most of that language's signatures).

This mirrors exactly the "invalid — Ghost Prevention" tier gap epic #813's founding audit found in the extraction gauntlets and fixed before closing — the same rigor bar was never applied retroactively to this suite's non-extraction-pillar signatures.

Worst offenders (100% None in negative slot):

  • kotlin: 49/49 cases
  • lua: 49/49 cases

Very high (>90% None):

  • ruby: 49/50 cases
  • swift: 49/50 cases
  • dart: 49/50 cases
  • go: 49/50 cases
  • php: 49/50 cases

High (>80% None):

  • perl: 50/51 cases
  • powershell: 48/49 cases
  • java: 48/49 cases
  • objective-c: 44/45 cases
  • python: 33/37 cases
  • javascript: 35/40 cases
  • haskell: 43/44 cases
  • solidity: 37/38 cases
  • embedded_python: 46/50 cases

Solution

For each signature currently paired with None, add a realistic negative/lookalike snippet per how_to_add_a_language.md's Strict Testing Prompt item 1: "every positive snippet must be realistic code... not a synthetic string engineered to match" — same bar applies to negatives.

Priority order: by real-world language popularity, since a false-positive in a commonly-scanned language has the widest blast radius. Python, JavaScript, Java, Go, Rust, C++ should be prioritized before less commonly-scanned languages.

Process:

  1. For each _SIMPLE_CASES entry currently with None as the negative snippet:

    • Write a realistic lookalike that closely resembles the positive case in structure but should NOT match the rule's documented semantics.
    • Example: if the signature is api and the positive case is requests.get(url), a negative might be response.get() (method call, not HTTP API).
    • Test locally with python -m pytest tests/extraction/languages/test_<lang>_strict.py -v to confirm the negative case indeed does NOT match.
  2. After closing negative-case gaps for all 17 languages, re-run the full _strict.py suite to ensure no regressions and false-positive patterns are now caught.

Files to modify

All tests/extraction/languages/test_<lang>_strict.py files for: kotlin, lua, ruby, swift, dart, go, php, perl, powershell, java, objective-c, python, javascript, haskell, solidity, embedded_python, and one more to be identified in a full audit.

Related issues

Activity

  1. added
    testing
    core-engine
    on Aug 5, 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

    core-enginetesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions