chore: remove dead clear_cache from ai.py, deduplicate CACHE_ROOT

- Delete unused clear_cache() from ai.py (luminos.py imports it from
  capabilities.py)
- Remove CACHE_ROOT import from ai.py (was only used by dead function)
- Replace local CACHE_ROOT constant in capabilities.py with import
  from cache.py (single source of truth)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeff Smith 2026-03-30 13:52:38 -06:00
parent 811fe3514c
commit dceff144b6
2 changed files with 2 additions and 17 deletions

View file

@ -25,7 +25,7 @@ import tree_sitter_javascript
import tree_sitter_rust
import tree_sitter_go
from luminos_lib.cache import CACHE_ROOT, _CacheManager, _get_investigation_id
from luminos_lib.cache import _CacheManager, _get_investigation_id
from luminos_lib.capabilities import check_ai_dependencies
MODEL = "claude-sonnet-4-20250514"
@ -1382,21 +1382,6 @@ def _run_investigation(client, target, report, show_hidden=False,
return brief, detailed, flags
# ---------------------------------------------------------------------------
# Cache cleanup
# ---------------------------------------------------------------------------
def clear_cache():
"""Remove all investigation caches under /tmp/luminos/."""
import shutil
if os.path.isdir(CACHE_ROOT):
shutil.rmtree(CACHE_ROOT)
print(f"Cleared cache: {CACHE_ROOT}", file=sys.stderr)
else:
print(f"No cache to clear ({CACHE_ROOT} does not exist).",
file=sys.stderr)
# ---------------------------------------------------------------------------
# Public interface
# ---------------------------------------------------------------------------

View file

@ -123,7 +123,7 @@ def print_status():
print(f"\n Install all with:\n pip install {' '.join(all_pkgs)}\n")
CACHE_ROOT = "/tmp/luminos"
from luminos_lib.cache import CACHE_ROOT
def clear_cache():