Repository navigation
Description
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:
-
Add multiple case variants per signature covering:
- Different syntax eras / language versions
- Modifier stacking (e.g.,
private static finalvs.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
-
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.
-
Use real
language-cruciblecorpus 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)
- Signatures already identified as producing false-positives or false-negatives during 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
- Rules with quantifier/nesting complexity (adjacent quantifiers, nested delimiters)
- Multi-rule interactions (cross-rule ambiguity tests from epic Epic: Strict & exact regex test coverage for all structural signatures, per language #518's harness)
- Language-specific syntax variants (different object/module/class definition styles)
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
- Epic Epic: Harden the strict structural-signature test suite (non-extraction-pillar rules) per language #1069: Harden the strict structural-signature test suite (non-extraction-pillar rules) per language
- Epic Epic: Harden the four extraction gauntlets (function/args/class/dependency) per language #813: Harden the four extraction gauntlets... per language (CLOSED 2026-08-03)
- Epic Epic: Strict & exact regex test coverage for all structural signatures, per language #518: Strict & exact regex test coverage for all structural signatures, per language (CLOSED)
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'snewfunction 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
squid-protocol commentedon Aug 6, 2026
Closed via #1087 — see the Resolution section added to the issue description for the golden-master impact summary.
test(extraction): deepen strict structural-signature coverage across …
Docs testing updates (#1091)