Labels: bug, checks-crate, analyzer-crate
Crate: checks
Description
crates/checks/src/lib.rs registers Box::new(AuthAfterStorageWriteCheck) twice in both all_checks_base() (lines 199 and 230) and default_checks_with_config() (lines 261 and 292) — two independent hardcoded 35-item lists, exactly the "no single source of truth" pattern issue #236 was supposed to fix, still duplicated and now out of sync with itself. Because default_checks_with_config() runs the same check object twice, auth-after-storage-write findings are produced twice for every offending line.
Critically, crates/analyzer/src/lib.rs's scan_directory_with_checks — confirmed by issue #309 to be the function the actual CLI calls — never calls dedup_findings (unlike scan_directory/scan_files, which do). So this duplication is not silently absorbed: real soroban-guard scan runs report every auth-after-storage-write finding twice, doubling counts in --json's summary.total, doubling rows in --markdown/SARIF output, etc.
Acceptance Criteria
Difficulty: intermediate
Labels: bug, checks-crate, analyzer-crate
Crate: checks
Description
crates/checks/src/lib.rsregistersBox::new(AuthAfterStorageWriteCheck)twice in bothall_checks_base()(lines 199 and 230) anddefault_checks_with_config()(lines 261 and 292) — two independent hardcoded 35-item lists, exactly the "no single source of truth" pattern issue #236 was supposed to fix, still duplicated and now out of sync with itself. Becausedefault_checks_with_config()runs the same check object twice,auth-after-storage-writefindings are produced twice for every offending line.Critically,
crates/analyzer/src/lib.rs'sscan_directory_with_checks— confirmed by issue #309 to be the function the actual CLI calls — never callsdedup_findings(unlikescan_directory/scan_files, which do). So this duplication is not silently absorbed: realsoroban-guard scanruns report everyauth-after-storage-writefinding twice, doubling counts in--json'ssummary.total, doubling rows in--markdown/SARIF output, etc.Acceptance Criteria
AuthAfterStorageWriteCheckregistration from both lists.default_checks_with_config()build fromall_checks_base()plus config-driven modifications instead of maintaining a second hand-written list, so this class of drift can't recur.default_checks()/default_checks_with_config()contain no duplicate check names, and a CLI-level test scanning a fixture that would tripauth-after-storage-write, asserting exactly one finding viascan_directory_with_checks.Difficulty: intermediate