Skip to content

Implement Soroban Contract Pattern Library, Finding Deduplication, Rule Testing Sandbox, and Impact Scoring#546

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
NteinPrecious:feature/nteinprecious-issues-494-493-492-491
Jun 25, 2026
Merged

Implement Soroban Contract Pattern Library, Finding Deduplication, Rule Testing Sandbox, and Impact Scoring#546
mijinummi merged 1 commit into
MDTechLabs:mainfrom
NteinPrecious:feature/nteinprecious-issues-494-493-492-491

Conversation

@NteinPrecious

Copy link
Copy Markdown
Contributor

Summary

Implements four new features for Soroban/Stellar contract analysis:

#494: Soroban Contract Pattern Library (src/patterns/stellar/)

  • ContractPatternLibrary class for registering, looking up, and detecting contract patterns
  • Types: ContractPattern, PatternCategory, PatternSeverity, PatternMatch, PatternLookupOptions
  • Support for AST-node, regex, semantic, and custom detection strategies
  • Pattern lookup by name, category, severity, and tags

#493: Soroban Finding Deduplication Engine (src/findings/deduplication/stellar/)

  • DeduplicationEngine class for detecting and merging duplicate findings
  • Types: DedupKey, DedupStrategy, FindingGroup, DedupConfig, DedupResult
  • Configurable strategies: exact match, normalized match, fuzzy match (Levenshtein), same-location
  • Canonical finding selection with severity and metadata prioritization

#492: Soroban Rule Testing Sandbox (tests/sandbox/stellar-rules/)

  • RuleSandbox class for isolated rule testing against sample contracts
  • Sample Soroban contracts: token, auth, storage, event, math
  • runRule, runAllRules, resetSandbox, createSandbox APIs
  • Simulated execution mode for testing without a real analyzer

#491: Soroban Rule Impact Scoring (src/scoring/impact/stellar/)

  • ImpactScorer class for assigning impact scores beyond severity
  • Types: ImpactScore, ImpactFactor, ImpactCategory, ImpactReport, ImpactScoringConfig
  • Scores based on: exploitability, reachability, value-at-risk, business impact
  • Generates ImpactReport with overall impact, per-category breakdown, and recommendations

All implementations follow existing TypeScript/NestJS patterns in the codebase with async/await, proper JSDoc comments, and comprehensive unit tests (67 passing).

Closes #494
Closes #493
Closes #492
Closes #491

…le Testing Sandbox, and Impact Scoring

- Add ContractPatternLibrary (src/patterns/stellar/) for registering,
  looking up, and detecting contract patterns in Soroban AST
- Add DeduplicationEngine (src/findings/deduplication/stellar/) for
  detecting and merging duplicate findings across analysis stages
- Add RuleSandbox (tests/sandbox/stellar-rules/) for isolated rule
  testing against sample Soroban contracts
- Add ImpactScorer (src/scoring/impact/stellar/) for assigning impact
  scores based on exploitability, reachability, value-at-risk, and
  business impact

Closes MDTechLabs#494
Closes MDTechLabs#493
Closes MDTechLabs#492
Closes MDTechLabs#491
@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@NteinPrecious Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mijinummi
mijinummi merged commit 989a2ac into MDTechLabs:main Jun 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants