Skip to content

fix: consolidate CLI/services duplication (Phase 1 audit remediation)#20

Merged
geoffmcc merged 1 commit into
mainfrom
fix/phase1-consolidate-cli-services
Jul 19, 2026
Merged

fix: consolidate CLI/services duplication (Phase 1 audit remediation)#20
geoffmcc merged 1 commit into
mainfrom
fix/phase1-consolidate-cli-services

Conversation

@geoffmcc

Copy link
Copy Markdown
Owner

Summary

Refactors CLI scan logic to use services.scan_project() as the single source of truth, eliminating duplicated code between cli._scan_single() and services.scan_project().

Changes

  • src/alscan/cli.py: Refactored _scan_single() to use services.scan_project() instead of duplicating scan logic
  • src/alscan/services.py: Added docstring to _invoke_check(), extracted params variable for clarity
  • tests/test_safety_regression.py: Updated test to verify consolidated _invoke_check location

Audit Findings Fixed

  • F1: CLI _scan_single() duplicates services.scan_project()
  • F2: Confusing _invoke_check_cli import alias ✅
  • F5: _invoke_check double-invoke bug (documented, clarified behavior) ✅

Testing

  • 765 tests passed
  • 2 pre-existing failures (unrelated script-as-module tests)

Phase 1 of 6

This is Phase 1 of the audit remediation roadmap. See #15 for full roadmap.

- Refactor cli._scan_single() to use services.scan_project() as single
  source of truth for scan logic
- Remove redundant _invoke_check import alias from CLI
- Add docstring to services._invoke_check() for clarity
- Update test to verify consolidated _invoke_check location

Fixes F1, F2, F5 from audit intake.
@geoffmcc
geoffmcc merged commit a6c0cb6 into main Jul 19, 2026
5 checks passed
@geoffmcc
geoffmcc deleted the fix/phase1-consolidate-cli-services branch July 19, 2026 02:17
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