Skip to content

feat: standardised Soroban rule execution pipeline#552

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
michaelvic123:feat/soroban-execution-pipeline
Jun 26, 2026
Merged

feat: standardised Soroban rule execution pipeline#552
mijinummi merged 1 commit into
MDTechLabs:mainfrom
michaelvic123:feat/soroban-execution-pipeline

Conversation

@michaelvic123

@michaelvic123 michaelvic123 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Closes #497


What

Introduces src/pipeline/stellar/ — a standardised execution pipeline for Soroban rules that replaces ad-hoc, inconsistent rule dispatch across analyzers.

Why

Rule execution behaviour was inconsistent: some analyzers called standalone functions directly, others skipped rules entirely, and there was no shared failure-handling or dependency ordering for Soroban-specific checks.

Changes

New files — src/pipeline/stellar/

File Purpose
types.ts SorobanRuleContext (extends RuleContext with source + filePath) and toViolation helper
soroban-pipeline.ts analyseSorobanContract() — single entry point, builds executor, registers all rules
rules/access-control.rule.ts MissingAccessControlRule, WeakRoleHierarchyRule
rules/upgradeability.rule.ts MissingUpgradeGuardRule (depends on access-control stage)
rules/cross-contract.rule.ts UnsafeCrossContractRule
rules/optimization.rule.ts InefficientSymbolUsageRule
rules/events.rule.ts ExcessiveEventTopicsRule
rules/visibility.rule.ts InconsistentVisibilityRule

How it works

  • Each existing standalone function in rules/stellar/ is wrapped in a BaseRule subclass — no logic duplicated
  • MissingUpgradeGuardRule.getDependencies() returns ['soroban/missing-access-control'], enforcing stage order through the existing dependency graph
  • All pipeline failures surface in ExecutionResult.errors rather than throwing, consistent with the existing executor
  • analyseSorobanContract(source, filePath) is the only public API callers need

Verification

  • Zero new TypeScript errors (error count identical to main baseline)
  • ESLint: 0 errors, 0 warnings after auto-fix
  • All 31 Stellar regression tests pass

Implements a standardised pipeline for Soroban rule execution
under src/pipeline/stellar/, resolving inconsistent rule dispatch
across analyzers.

- SorobanRuleContext extends RuleContext with source + filePath
- toViolation helper normalises all rule outputs into RuleViolation
- Seven rule wrappers adapt existing standalone functions into
  BaseRule subclasses (access-control, weak-role-hierarchy,
  upgrade-guard, cross-contract, symbol-usage, events, visibility)
- MissingUpgradeGuardRule declares getDependencies() on access-control
  to enforce stage ordering through the existing dependency graph
- analyseSorobanContract() is the single entry point: builds the
  executor, registers all rules, and returns ExecutionResult
- Zero new TypeScript errors; all 31 regression tests pass
@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@michaelvic123 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 6e331bb into MDTechLabs:main Jun 26, 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

Development

Successfully merging this pull request may close these issues.

Implement Soroban Rule Execution Pipeline

2 participants