Skip to content

[Good First Issue] Deepen per-signature case counts beyond current ~1-pair floor (stretch/lower-priority) #1074

Closed

Description

@squid-protocol

Issue

Every language's _SIMPLE_CASES list currently has almost exactly one case per applicable signature key — there's no equivalent of the extraction gauntlets' 10-15-case "pathological" tier depth per rule.

This is thinner than the "2-3 valid/2-3 invalid/1 pathological" depth epic #813's founding audit already judged inadequate for the sibling suite. An AST-free engine parsing 58 languages at scale has narrow error margins; one edge-case per signature is a smoke test, not a gauntlet.

This is a lower-priority stretch goal — issues #1070-1073 address the harder correctness/security gaps (zero coverage, ghost prevention, ReDoS scaling). Once those close, revisit this issue to deepen coverage on the highest-ambiguity signatures identified along the way.

Solution

For languages and signatures identified as high-ambiguity during work on #1070-#1073:

  1. Add multiple case variants per signature covering:

    • Different syntax eras / language versions
    • Modifier stacking (e.g., private static final vs. private final static)
    • Multi-line splits (e.g., function signatures broken across multiple lines)
    • Nested structures (e.g., nested generics, nested class definitions)
    • Corner cases at file/block boundaries
  2. Target depth: 3-5 case pairs per high-ambiguity signature (positive + negative) as a minimum, approaching the extraction gauntlets' 10-15+ case standard where real code patterns justify it.

  3. Use real language-crucible corpus patterns as inspiration where available; prioritize signatures that surfaced bugs or ambiguity during the audit sweeps in Add ReDoS regression tests for 6 languages with zero current coverage (haskell, kotlin, lua, ruby, scala, swift) #1070-Add ghost-prevention (negative-case) coverage for 17 languages with >70% None in test cases #1073.

Expected depth by completion

After closing #1070-#1073 and then revisiting this issue, each language should have:

  • 3+ case pairs for high-complexity signatures (e.g., generic/template matching, nested structures, modifier combinations)
  • 2+ case pairs for medium-complexity signatures
  • 1+ case pairs for simple/low-ambiguity signatures (existing current state)

Criteria for "high-ambiguity" (pick these first)

Scope note

This is deliberately scoped after the correctness/security gaps are closed. Do not start deepening case counts for any language until #1070-#1073 confirm that language has zero ReDoS gaps, complete negative-case coverage, complete signature coverage, and clean scaling-ratio ReDoS tests. This ordering ensures the test suite gains security ground first, aesthetics second.

Related issues

Resolution (closed via #1087)

PR #1087 delivered this across all 45 languages: 7 batches progressively added multi-case "deep"/adversarial matrices (multi-line splits, modifier stacking, nested generics, boundary noise), moving well past the ~1-pair-per-signature floor this issue was filed against.

Real-world impact, measured against the golden-master corpus (not just local test-file line counts): deepening the cases surfaced several genuine regex bugs (missing syntax bindings — Swift throws, PowerShell hidden/static methods, Lua generic types — plus tighter multiline/nested-bracket bounds closing a couple of ReDoS gaps on closures/lambdas). After fixing those and reblessing both tests/golden_master_audit.json and tests/golden_master_zero_dep_audit.json, a structural diff against the pre-#1087 golden masters (tests/golden_diff.py, same tool crucible-audit uses in CI) shows:

  • 6,046 field-level differences across 92 of the corpus's 143 repos (identical counts in both full-precision and zero-dependency mode, confirming the drift is from the regex/signature-extraction changes themselves, not the ML/networkx-derived scoring)
  • 5,898 of those are real per-file signature/metric corrections (6. Parsed Files), 143 are aggregate ecosystem-summary rollups shifting as a consequence, 4 are top-10 risk-leaderboard reorderings, 1 is an unparsable-artifact classification change
  • Heaviest-affected languages: perl (685 diffs), cpp (630), php (577), rust (414), typescript (381), agc_assembly (300), zig (254), dart (217), java (190), groovy (189)
  • Concretely, these aren't cosmetic: e.g. perl/spamassassin/Message.pm's new function had its Structural Impact score corrected from 666.4 → 522.1 and Control Flow Branches from 527 → 365 for that file overall — the old branch-counting regex was measurably overcounting real Perl control flow before this pass caught it via a deeper adversarial case.

This is stronger evidence the deepened cases were finding real gaps, not just adding volume. See PR #1087 for the full commit-by-commit breakdown.

Activity

  1. added
    good first issue
    testing
    core-engine
    on Aug 5, 2026
  2. squid-protocol commented on Aug 6, 2026

    @squid-protocol
    OwnerAuthor

    Closed via #1087 — see the Resolution section added to the issue description for the golden-master impact summary.

  3. 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-enginegood first issuetesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions