feat: standardised Soroban rule execution pipeline#552
Merged
mijinummi merged 1 commit intoJun 26, 2026
Conversation
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
|
@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! 🚀 |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/types.tsSorobanRuleContext(extendsRuleContextwithsource+filePath) andtoViolationhelpersoroban-pipeline.tsanalyseSorobanContract()— single entry point, builds executor, registers all rulesrules/access-control.rule.tsMissingAccessControlRule,WeakRoleHierarchyRulerules/upgradeability.rule.tsMissingUpgradeGuardRule(depends on access-control stage)rules/cross-contract.rule.tsUnsafeCrossContractRulerules/optimization.rule.tsInefficientSymbolUsageRulerules/events.rule.tsExcessiveEventTopicsRulerules/visibility.rule.tsInconsistentVisibilityRuleHow it works
rules/stellar/is wrapped in aBaseRulesubclass — no logic duplicatedMissingUpgradeGuardRule.getDependencies()returns['soroban/missing-access-control'], enforcing stage order through the existing dependency graphExecutionResult.errorsrather than throwing, consistent with the existing executoranalyseSorobanContract(source, filePath)is the only public API callers needVerification
mainbaseline)