diff --git a/app/utils/browser.py b/app/utils/browser.py index ea06b0f..560c7af 100644 --- a/app/utils/browser.py +++ b/app/utils/browser.py @@ -48,19 +48,8 @@ class Browser: lazily-loaded singleton factory `get_browser()`. """ - def __init__(self, storage_dir: Optional[Path] = None) -> None: - """ - Args: - storage_dir: Base directory for run artifacts. Defaults to settings.sandbox.storage - (typically /data) if not provided. - """ - if storage_dir is None: - try: - # Prefer your settings model’s configured storage path - storage_dir = Path(settings.sandbox.storage) - except Exception: - storage_dir = Path("/data") - + def __init__(self) -> None: + storage_dir = Path("/data") self.storage_dir: Path = storage_dir # ----------------------------------------------------------------------- @@ -69,15 +58,13 @@ class Browser: @staticmethod def _get_rule_engine(): """ - Retrieve the rules engine instance from the Flask application config. + Retrieve the rules engine instance from the application state. Returns: RuleEngine or None: The engine if available, or None if not configured. """ - try: - return current_app.config.get("RULE_ENGINE") - except Exception: - return None + from app.state import get_rules_engine + return get_rules_engine() @staticmethod def _summarize_results(results: List[Dict[str, Any]]) -> Dict[str, int]: @@ -537,14 +524,11 @@ except Exception: @singleton_loader -def get_browser(storage_dir: Optional[Path] = None) -> Browser: +def get_browser() -> Browser: """ Lazily construct and cache a singleton Browser instance. - Args: - storage_dir: Optional override for artifact base directory. - Returns: Browser: The singleton instance. """ - return Browser(storage_dir=storage_dir) + return Browser() diff --git a/docs/roadmap.md b/docs/roadmap.md index 88d015f..8acb3c7 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,9 +1,9 @@ # SneakyScope — Roadmap (Updated 8-21-25) ## Priority 1 – Core Analysis / Stability -* why are the rules not finding anything now? * if cloudflare, we notate and badge it, along with a blurp that explains how cloudflare is both used for good and evil. * need a generalized "total score" for the site. something that is a quick 0/10 (guessing on the number), so new analyst don't have to think on the details. +* make a "dectorators" file to unify imports ## Priority 2 – UI / UX * Rules Lab (WYSIWYG tester): paste a rule, validate/compile, run against sample text; lightweight nav entry.