itdove/ai-guardian#1166: feat: interactive file/directory scan with Allow Always from web console and TUI#1209
Conversation
- Add POST /api/scan endpoint with path validation and blocked system dirs - Add scan_path method to MultiDaemonClient with local fallback - Wire scan functionality into TUI and web console directory scan pages - Add configurable timeout parameter to _rest_request - Add unit tests for scan endpoint 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
9 tasks
Tests in test_web_pages_phase4.py import _format_severity from directory_scan — restore the function removed during scan UI refactor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Path("/usr").exists() returns True on Windows via MSYS/Git Bash.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Jira Issue: #1166
Description
Add interactive file/directory scanning with "Allow Always" functionality from both the web console and TUI.
Key changes:
rest_api.py,scanner.py), with corresponding web page (web/pages/directory_scan.py) and TUI screen (tui/directory_scan.py) for interactive scan initiation and result display.violation_rescan.pymodule enabling rescan of violations and one-click allowlisting directly from the violations view. Both web (web/pages/violations.py) and TUI (tui/violations.py) updated with "Allow Always" buttons in violation detail modals.multi_client.pyto support the new scan and rescan flows.web/services/daemon_service.pyto wire up new endpoints.test_scan_endpoint.pyfor directory scan API andtest_violation_rescan.pyfor rescan/allowlist logic, usingpytest tmp_pathfixtures.Assisted-by: Claude
Testing
Steps to test
ai-guardian daemon startai-guardian tui), navigate to Directory Scan, run a scan, verify resultspytest tests/unit/test_scan_endpoint.py tests/unit/test_violation_rescan.py -vScenarios tested
Deployment considerations