Skip to content

Fix F1 Slither detector registration and raw diagnostics - #14

Merged
chokri29 merged 6 commits into
mainfrom
fix/f1-builtin-detector-registration
Nov 5, 2026
Merged

chokri29 merged 6 commits into
mainfrom
fix/f1-builtin-detector-registration

Conversation

@chokri29

@chokri29 chokri29 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Root cause

The Python API integration imported slither.detectors.all_detectors and attempted list(all_detectors). In Slither this is a Python module, not an iterable detector list. The fallback import path is not the supported registry either. As a result, the exception path silently produced detector_list = [], no built-in detectors were registered, and run_detectors() returned an empty result while F1 was still marked successful. This explains the screenshot's Slither signals: 0 and model finding marked ungrounded.

Changes

  • Enumerate built-in detector classes from the all_detectors module using inspect.getmembers, retaining concrete subclasses of AbstractDetector.
  • Fail closed with an explicit F1 execution error if the detector registry cannot be loaded or no detectors register; never report a clean scan from an empty registry.
  • Log registry size, raw result count/check IDs, and filtered result count/check IDs.
  • Expose raw and filtered detector diagnostics in /analyze response metadata for verification.
  • Fix a second issue in main.py: an empty filtered_detectors list previously fell through to the unfiltered raw detector list due to Python's or behavior. The app now respects an explicitly empty filtered set and cannot accidentally bypass its finding filter.
  • Add regression tests for detector module introspection, actual Python API registration/result extraction, fail-closed behavior, and raw-vs-filtered selection.

Validation

CI will run the full pytest suite. The live Render Reentrancy sample remains the final acceptance check: F1 registry should be non-zero, raw results should include reentrancy-eth, filtered results should retain it, and the finding should be grounded.

This PR does not change detector thresholds or add model-generated findings to Slither results.

@chokri29
chokri29 merged commit d547d13 into main Nov 5, 2026
2 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.

1 participant