fixos 2.2.55__tar.gz → 2.2.57__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fixos-2.2.55 → fixos-2.2.57}/PKG-INFO +1 -1
- fixos-2.2.57/VERSION +1 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/agent/autonomous.py +15 -9
- {fixos-2.2.55 → fixos-2.2.57}/fixos/agent/autonomous_session.py +205 -4
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/_cleanup_space.py +229 -7
- fixos-2.2.57/fixos/cli/fix_cmd.py +926 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/main.py +3 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/orchestrate_cmd.py +21 -8
- {fixos-2.2.55 → fixos-2.2.57}/fixos/orchestrator/graph.py +17 -5
- {fixos-2.2.55 → fixos-2.2.57}/fixos/orchestrator/orchestrator.py +94 -11
- {fixos-2.2.55 → fixos-2.2.57}/fixos.egg-info/PKG-INFO +1 -1
- {fixos-2.2.55 → fixos-2.2.57}/fixos.egg-info/SOURCES.txt +1 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos.egg-info/top_level.txt +1 -0
- {fixos-2.2.55 → fixos-2.2.57}/pyproject.toml +1 -1
- fixos-2.2.57/tests/unit/test_auto_no_llm.py +233 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_quick_snapshot.py +2 -2
- fixos-2.2.55/VERSION +0 -1
- fixos-2.2.55/fixos/cli/fix_cmd.py +0 -416
- {fixos-2.2.55 → fixos-2.2.57}/.env.example +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/CHANGELOG.md +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/LICENSE +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/MANIFEST.in +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/README.md +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/README.md +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/TEST_RESULTS.md +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/TEST_RESULTS_V2.md +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/alpine/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/arch/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/base/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/broken-audio/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/broken-full/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/broken-network/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/broken-thumbnails/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/debian/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/docker-compose.multi-system.yml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/docker-compose.yml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/fedora/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/test-multi-system.sh +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/test-scenarios.sh +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/ubuntu/Dockerfile +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docker/validate-scenario.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docs/examples/advanced_usage.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/docs/examples/quickstart.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/__main__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/agent/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/agent/hitl.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/agent/hitl_session.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/agent/session_core.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/agent/session_handlers.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/agent/session_io.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/anonymizer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/__main__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/_cleanup_docker_volumes.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/_cleanup_flatpak.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/_cleanup_home.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/_cleanup_snap.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/_cleanup_system.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/_cleanup_utils.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/_cleanup_venvs.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/ask_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/cleanup_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/config_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/dashboard.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/features_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/history_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/jetbrains_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/output_formatter.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/profile_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/projects_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/provider_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/quick_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/quickfix_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/report_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/rollback_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/scan_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/shared.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/shell_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/token_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli/watch_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/cli.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/config.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/config_interactive.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/constants.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/_flatpak_analysis_mixin.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/_flatpak_execution_mixin.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/_flatpak_recommendations_mixin.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/_storage_container_mixin.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/_storage_system_mixin.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/_storage_user_mixin.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/cache_discovery.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/_shared.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/audio.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/file_analysis.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/hardware.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/packages.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/resources.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/security.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/storage_optimization.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/system_core.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/checks/thumbnails.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/dev_project_analyzer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/disk_analyzer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/docker_network_cleanup.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/docker_startup_optimizer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/flatpak_analyzer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/jetbrains_ai.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/jetbrains_recovery.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/native_scan.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/orphaned_workloads.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/process_chains.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/project_scanner.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/quick_snapshot.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/service_cleanup.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/service_details.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/service_scanner.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/storage_analyzer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/system_checks.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/utils.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/diagnostics/venv_cleanup.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/endpoint_refresh.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/auditor.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/catalog.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/data/packages.yaml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/data/profiles/developer.yaml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/data/profiles/office.yaml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/data/profiles/sysadmin.yaml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/installer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/profiles.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/features/renderer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/fixes/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/interactive/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/interactive/cleanup_planner.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/llm_shell.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/orchestrator/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/orchestrator/executor.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/orchestrator/rollback.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/orphan_pins.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/platform_utils.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/base.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/builtin/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/builtin/audio.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/builtin/disk.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/builtin/hardware.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/builtin/resources.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/builtin/security.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/builtin/thumbnails.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/plugins/registry.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/profiles/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/profiles/desktop.yaml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/profiles/developer.yaml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/profiles/minimal.yaml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/profiles/server.yaml +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/providers/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/providers/gemini_native.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/providers/llm.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/providers/llm_analyzer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/providers/schemas.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/system_checks.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/utils/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/utils/anonymizer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/utils/terminal.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/utils/timeout.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/utils/web_search.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos/watch.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos.egg-info/dependency_links.txt +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos.egg-info/entry_points.txt +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/fixos.egg-info/requires.txt +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/pytest.ini +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/requirements-dev.txt +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/requirements.txt +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/scripts/pyqual-calibrate.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/setup.cfg +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/setup.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/conftest.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/test_anonymization_layers.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/test_audio_broken.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/test_cli.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/test_diagnostics_integration.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/test_executor.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/test_multi_system.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/test_network_broken.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/e2e/test_thumbnails_broken.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/test_fixos.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/__init__.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_anonymizer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_ask_and_nl_group.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cache_discovery.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_docker_volumes.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_effectiveness.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_planner.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_retention.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_safety.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_space.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_tmp.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cleanup_utils.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_cli_main.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_core.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_dashboard.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_dev_project_analyzer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_disk_analyzer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_docker_network_cleanup.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_docker_startup_optimizer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_endpoint_refresh.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_executor.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_gemini_native_client.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_jetbrains_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_jetbrains_recovery.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_llm_auth_stop.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_llm_provider.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_native_scan.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_ollama_endpoint.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_orchestrator.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_orphan_pins.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_orphaned_workloads.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_packaging_data.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_process_chains.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_project_scanner.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_projects_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_quick_cmd.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_resources_quick.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_security_quick.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_service_cleanup.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_service_scanner.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_shell_ux.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_storage_analyzer.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_system_checks_parallel.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_venv_cleanup.py +0 -0
- {fixos-2.2.55 → fixos-2.2.57}/tests/unit/test_version_parity.py +0 -0
fixos-2.2.57/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2.57
|
|
@@ -9,22 +9,22 @@ Refactored: Now uses AutonomousSession class for better modularity.
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
11
|
from .autonomous_session import (
|
|
12
|
-
AutonomousSession,
|
|
13
|
-
AgentReport,
|
|
14
|
-
FixAction,
|
|
15
|
-
SYSTEM_PROMPT_AUTONOMOUS,
|
|
16
12
|
FORBIDDEN_COMMANDS,
|
|
17
13
|
SUDO_PREFIXES,
|
|
14
|
+
SYSTEM_PROMPT_AUTONOMOUS,
|
|
15
|
+
AgentReport,
|
|
16
|
+
AutonomousSession,
|
|
17
|
+
FixAction,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
__all__ = [
|
|
21
|
-
"run_autonomous_session",
|
|
22
|
-
"AutonomousSession",
|
|
23
|
-
"AgentReport",
|
|
24
|
-
"FixAction",
|
|
25
|
-
"SYSTEM_PROMPT_AUTONOMOUS",
|
|
26
21
|
"FORBIDDEN_COMMANDS",
|
|
27
22
|
"SUDO_PREFIXES",
|
|
23
|
+
"SYSTEM_PROMPT_AUTONOMOUS",
|
|
24
|
+
"AgentReport",
|
|
25
|
+
"AutonomousSession",
|
|
26
|
+
"FixAction",
|
|
27
|
+
"run_autonomous_session",
|
|
28
28
|
]
|
|
29
29
|
|
|
30
30
|
|
|
@@ -33,6 +33,9 @@ def run_autonomous_session(
|
|
|
33
33
|
config,
|
|
34
34
|
show_data: bool = True,
|
|
35
35
|
max_fixes: int = 10,
|
|
36
|
+
auto_confirm: bool = False,
|
|
37
|
+
use_llm: bool | None = None,
|
|
38
|
+
dry_run: bool = False,
|
|
36
39
|
) -> AgentReport:
|
|
37
40
|
"""
|
|
38
41
|
Uruchamia autonomiczny tryb agenta.
|
|
@@ -45,5 +48,8 @@ def run_autonomous_session(
|
|
|
45
48
|
config=config,
|
|
46
49
|
show_data=show_data,
|
|
47
50
|
max_fixes=max_fixes,
|
|
51
|
+
auto_confirm=auto_confirm,
|
|
52
|
+
use_llm=use_llm,
|
|
53
|
+
dry_run=dry_run,
|
|
48
54
|
)
|
|
49
55
|
return session.run()
|
|
@@ -120,11 +120,18 @@ class AutonomousSession:
|
|
|
120
120
|
config: FixOsConfig,
|
|
121
121
|
show_data: bool = True,
|
|
122
122
|
max_fixes: int = 10,
|
|
123
|
+
auto_confirm: bool = False,
|
|
124
|
+
use_llm: bool | None = None,
|
|
125
|
+
dry_run: bool = False,
|
|
123
126
|
):
|
|
124
127
|
self.diagnostics = diagnostics
|
|
125
128
|
self.config = config
|
|
126
129
|
self.show_data = show_data
|
|
127
130
|
self.max_fixes = max_fixes
|
|
131
|
+
self.auto_confirm = auto_confirm
|
|
132
|
+
self.use_llm = use_llm
|
|
133
|
+
self.dry_run = dry_run
|
|
134
|
+
self._heuristic_queue: list[dict[str, Any]] | None = None
|
|
128
135
|
self.llm = LLMClient(config)
|
|
129
136
|
self.report = AgentReport()
|
|
130
137
|
self.fix_count = 0
|
|
@@ -133,6 +140,22 @@ class AutonomousSession:
|
|
|
133
140
|
self.start_time = time.time()
|
|
134
141
|
self._setup_timeout()
|
|
135
142
|
|
|
143
|
+
def _is_llm_active(self) -> bool:
|
|
144
|
+
"""Return True if LLM calls should be used, False for LLM-free heuristic mode."""
|
|
145
|
+
if getattr(self, "use_llm", None) is False:
|
|
146
|
+
return False
|
|
147
|
+
if getattr(self, "use_llm", None) is True:
|
|
148
|
+
return True
|
|
149
|
+
llm_obj = getattr(self, "llm", None)
|
|
150
|
+
if llm_obj is not None and not isinstance(llm_obj, LLMClient):
|
|
151
|
+
return True
|
|
152
|
+
cfg = getattr(self, "config", None)
|
|
153
|
+
if cfg is None:
|
|
154
|
+
return False
|
|
155
|
+
if hasattr(cfg, "validate") and callable(cfg.validate):
|
|
156
|
+
return len(cfg.validate()) == 0
|
|
157
|
+
return bool(getattr(cfg, "api_key", None))
|
|
158
|
+
|
|
136
159
|
def _setup_timeout(self) -> None:
|
|
137
160
|
"""Setup session timeout handler."""
|
|
138
161
|
|
|
@@ -148,17 +171,34 @@ class AutonomousSession:
|
|
|
148
171
|
|
|
149
172
|
def _confirm_start(self) -> bool:
|
|
150
173
|
"""Ask user for confirmation before starting autonomous mode."""
|
|
174
|
+
import sys
|
|
175
|
+
|
|
176
|
+
llm_active = self._is_llm_active()
|
|
177
|
+
model_label = (
|
|
178
|
+
getattr(self.config, "model", "unknown")
|
|
179
|
+
if llm_active
|
|
180
|
+
else "heurystyki lokalne (bez LLM)"
|
|
181
|
+
)
|
|
151
182
|
print(f"\n{'═' * UI_BORDER_WIDTH}")
|
|
152
183
|
print(" ⚠️ TRYB AUTONOMICZNY – agent sam wykonuje komendy!")
|
|
153
184
|
print(" Naciśnij Ctrl+C w dowolnym momencie aby przerwać.")
|
|
154
185
|
print("═" * UI_BORDER_WIDTH)
|
|
155
186
|
print(f"\n Max napraw: {self.max_fixes}")
|
|
156
187
|
print(f" Timeout sesji: {self.config.session_timeout}s")
|
|
157
|
-
print(f" Model: {
|
|
188
|
+
print(f" Model: {model_label}")
|
|
189
|
+
|
|
190
|
+
if getattr(self, "auto_confirm", False):
|
|
191
|
+
print(" Potwierdzenie: automatyczne (--yes / fixos auto)")
|
|
192
|
+
return True
|
|
158
193
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
194
|
+
try:
|
|
195
|
+
confirm = input(
|
|
196
|
+
"\n Czy na pewno chcesz uruchomić tryb autonomiczny? (yes/N): "
|
|
197
|
+
).strip()
|
|
198
|
+
except EOFError:
|
|
199
|
+
if not (hasattr(sys.stdin, "isatty") and sys.stdin.isatty()):
|
|
200
|
+
print(" Brak interaktywnego terminala — anulowano (użyj --yes lub fixos auto).")
|
|
201
|
+
return False
|
|
162
202
|
if confirm.lower() not in ("yes", "tak"):
|
|
163
203
|
print(" Anulowano. Użyj --mode hitl dla trybu z potwierdzeniem.")
|
|
164
204
|
return False
|
|
@@ -166,6 +206,8 @@ class AutonomousSession:
|
|
|
166
206
|
|
|
167
207
|
def _initialize_messages(self) -> None:
|
|
168
208
|
"""Initialize LLM message history with system prompt and diagnostics."""
|
|
209
|
+
if not self._is_llm_active():
|
|
210
|
+
return
|
|
169
211
|
anon_str, anon_report = anonymize(str(self.diagnostics))
|
|
170
212
|
if self.show_data:
|
|
171
213
|
display_anonymized_preview(anon_str, anon_report)
|
|
@@ -181,6 +223,156 @@ class AutonomousSession:
|
|
|
181
223
|
},
|
|
182
224
|
]
|
|
183
225
|
|
|
226
|
+
@staticmethod
|
|
227
|
+
def _is_command_applicable_on_host(cmd: str) -> bool:
|
|
228
|
+
"""Check whether a heuristic repair command targets tools/units present on this host."""
|
|
229
|
+
import shlex
|
|
230
|
+
import shutil
|
|
231
|
+
from pathlib import Path
|
|
232
|
+
|
|
233
|
+
try:
|
|
234
|
+
tokens = shlex.split(cmd)
|
|
235
|
+
except ValueError:
|
|
236
|
+
tokens = cmd.split()
|
|
237
|
+
idx = 0
|
|
238
|
+
while idx < len(tokens) and (
|
|
239
|
+
tokens[idx] in ("sudo", "env", "nohup") or "=" in tokens[idx] or tokens[idx].startswith("-")
|
|
240
|
+
):
|
|
241
|
+
idx += 1
|
|
242
|
+
if idx >= len(tokens):
|
|
243
|
+
return False
|
|
244
|
+
prog = tokens[idx]
|
|
245
|
+
if (
|
|
246
|
+
prog in ("dnf", "yum", "pacman", "zypper", "apk", "ufw", "firewall-cmd")
|
|
247
|
+
and shutil.which(prog) is None
|
|
248
|
+
):
|
|
249
|
+
return False
|
|
250
|
+
return not (
|
|
251
|
+
prog == "systemctl"
|
|
252
|
+
and "firewalld" in tokens
|
|
253
|
+
and shutil.which("firewall-cmd") is None
|
|
254
|
+
and not Path("/lib/systemd/system/firewalld.service").exists()
|
|
255
|
+
and not Path("/usr/lib/systemd/system/firewalld.service").exists()
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
def _build_heuristic_actions(self) -> list[dict[str, Any]]:
|
|
259
|
+
"""Build deterministic repair and safe cleanup actions without LLM."""
|
|
260
|
+
from .session_core import package_cleanup_guard
|
|
261
|
+
|
|
262
|
+
actions: list[dict[str, Any]] = []
|
|
263
|
+
seen_commands: set[str] = set()
|
|
264
|
+
|
|
265
|
+
def _add_candidate(cmd: str, reason: str, severity: str = "warning") -> None:
|
|
266
|
+
cmd_clean = (cmd or "").strip()
|
|
267
|
+
if not cmd_clean or cmd_clean in seen_commands:
|
|
268
|
+
return
|
|
269
|
+
if self._is_forbidden(cmd_clean) or package_cleanup_guard(cmd_clean):
|
|
270
|
+
return
|
|
271
|
+
if not self._is_command_applicable_on_host(cmd_clean):
|
|
272
|
+
return
|
|
273
|
+
seen_commands.add(cmd_clean)
|
|
274
|
+
if reason and reason not in self.report.problems_found:
|
|
275
|
+
self.report.problems_found.append(reason)
|
|
276
|
+
actions.append(
|
|
277
|
+
{
|
|
278
|
+
"action": "EXEC",
|
|
279
|
+
"command": cmd_clean,
|
|
280
|
+
"reason": reason or "Naprawa heurystyczna (bez LLM)",
|
|
281
|
+
"analysis": f"[{severity}] {reason or cmd_clean}",
|
|
282
|
+
"severity": severity,
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
diag = self.diagnostics if isinstance(self.diagnostics, dict) else {}
|
|
287
|
+
|
|
288
|
+
# 1. Inspect findings already present in diagnostics dict
|
|
289
|
+
for key, val in diag.items():
|
|
290
|
+
if isinstance(val, dict):
|
|
291
|
+
for item in val.get("findings", []) or val.get("problems", []) or []:
|
|
292
|
+
if isinstance(item, dict) and item.get("command"):
|
|
293
|
+
sev = str(item.get("severity", "warning")).lower()
|
|
294
|
+
if sev in ("critical", "warning", "high", "error"):
|
|
295
|
+
_add_candidate(
|
|
296
|
+
str(item["command"]),
|
|
297
|
+
str(item.get("title") or item.get("description") or key),
|
|
298
|
+
sev,
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
# 2. Run offline diagnostic plugins if no findings were pre-populated
|
|
302
|
+
if not actions and diag.get("_run_plugins", True) is not False:
|
|
303
|
+
try:
|
|
304
|
+
from ..plugins.base import Severity
|
|
305
|
+
from ..plugins.registry import PluginRegistry
|
|
306
|
+
|
|
307
|
+
registry = PluginRegistry()
|
|
308
|
+
registry.discover()
|
|
309
|
+
for res in registry.run():
|
|
310
|
+
for finding in res.findings:
|
|
311
|
+
if finding.command and finding.severity in (
|
|
312
|
+
Severity.CRITICAL,
|
|
313
|
+
Severity.WARNING,
|
|
314
|
+
):
|
|
315
|
+
_add_candidate(
|
|
316
|
+
finding.command,
|
|
317
|
+
f"{finding.title}: {finding.description}",
|
|
318
|
+
finding.severity.value,
|
|
319
|
+
)
|
|
320
|
+
except Exception: # noqa: BLE001, S110
|
|
321
|
+
pass
|
|
322
|
+
|
|
323
|
+
# 3. Extract safe disk cleanup suggestions if disk_analysis is present
|
|
324
|
+
disk_analysis = diag.get("disk_analysis")
|
|
325
|
+
if isinstance(disk_analysis, dict):
|
|
326
|
+
suggestions = disk_analysis.get("suggestions", [])
|
|
327
|
+
if suggestions:
|
|
328
|
+
try:
|
|
329
|
+
from ..interactive.cleanup_planner import CleanupPlanner
|
|
330
|
+
|
|
331
|
+
plan = CleanupPlanner().create_cleanup_plan(suggestions)
|
|
332
|
+
for item in plan.get("prioritized_actions", []):
|
|
333
|
+
if item.get("safe") and item.get("command"):
|
|
334
|
+
_add_candidate(
|
|
335
|
+
str(item["command"]),
|
|
336
|
+
str(item.get("description") or "Bezpieczne czyszczenie dysku"),
|
|
337
|
+
str(item.get("priority") or "medium"),
|
|
338
|
+
)
|
|
339
|
+
except Exception: # noqa: BLE001, S110
|
|
340
|
+
pass
|
|
341
|
+
|
|
342
|
+
return actions
|
|
343
|
+
|
|
344
|
+
def _process_heuristic_turn(self) -> bool:
|
|
345
|
+
"""Execute one deterministic turn without calling an LLM."""
|
|
346
|
+
self._check_timeout()
|
|
347
|
+
if self._heuristic_queue is None:
|
|
348
|
+
self._heuristic_queue = self._build_heuristic_actions()
|
|
349
|
+
|
|
350
|
+
if not self._heuristic_queue:
|
|
351
|
+
self._handle_done()
|
|
352
|
+
return False
|
|
353
|
+
|
|
354
|
+
remaining = self._get_remaining_time()
|
|
355
|
+
print(
|
|
356
|
+
f" ⟳ Tura {self.fix_count + 1}/{self.max_fixes} | ⏰ {remaining}s pozostało (tryb bez LLM)"
|
|
357
|
+
)
|
|
358
|
+
action_data = self._heuristic_queue.pop(0)
|
|
359
|
+
analysis = action_data.get("analysis", "")
|
|
360
|
+
reason = action_data.get("reason", "")
|
|
361
|
+
cmd = action_data.get("command", "")
|
|
362
|
+
print(f"\n 📋 Analiza: {analysis}")
|
|
363
|
+
print(f" 🎯 Akcja: EXEC – {reason}")
|
|
364
|
+
|
|
365
|
+
if getattr(self, "dry_run", False):
|
|
366
|
+
print(f" [DRY-RUN] Pominięto wykonanie: {cmd}")
|
|
367
|
+
self.report.fixes_applied.append(
|
|
368
|
+
FixAction(command=cmd, reason=reason, result="[DRY-RUN]", success=True)
|
|
369
|
+
)
|
|
370
|
+
self.fix_count += 1
|
|
371
|
+
return True
|
|
372
|
+
|
|
373
|
+
self._handle_exec(action_data)
|
|
374
|
+
return True
|
|
375
|
+
|
|
184
376
|
def _get_remaining_time(self) -> int:
|
|
185
377
|
"""Get remaining session time in seconds."""
|
|
186
378
|
from . import get_remaining_time
|
|
@@ -376,6 +568,9 @@ class AutonomousSession:
|
|
|
376
568
|
|
|
377
569
|
Returns False if session should end, True to continue.
|
|
378
570
|
"""
|
|
571
|
+
if not self._is_llm_active():
|
|
572
|
+
return self._process_heuristic_turn()
|
|
573
|
+
|
|
379
574
|
self._check_timeout()
|
|
380
575
|
remaining = self._get_remaining_time()
|
|
381
576
|
print(
|
|
@@ -468,6 +663,9 @@ def run_autonomous_session(
|
|
|
468
663
|
config: FixOsConfig,
|
|
469
664
|
show_data: bool = True,
|
|
470
665
|
max_fixes: int = 10,
|
|
666
|
+
auto_confirm: bool = False,
|
|
667
|
+
use_llm: bool | None = None,
|
|
668
|
+
dry_run: bool = False,
|
|
471
669
|
) -> AgentReport:
|
|
472
670
|
"""Run autonomous session (backward compatible wrapper)."""
|
|
473
671
|
session = AutonomousSession(
|
|
@@ -475,5 +673,8 @@ def run_autonomous_session(
|
|
|
475
673
|
config=config,
|
|
476
674
|
show_data=show_data,
|
|
477
675
|
max_fixes=max_fixes,
|
|
676
|
+
auto_confirm=auto_confirm,
|
|
677
|
+
use_llm=use_llm,
|
|
678
|
+
dry_run=dry_run,
|
|
478
679
|
)
|
|
479
680
|
return session.run()
|
|
@@ -144,13 +144,24 @@ def _remove_path(path: Path) -> tuple[bool, str]:
|
|
|
144
144
|
else:
|
|
145
145
|
shutil.rmtree(path)
|
|
146
146
|
return True, "usunięto"
|
|
147
|
+
except PermissionError as exc:
|
|
148
|
+
return False, f"PERMISSION_DENIED:{exc}"
|
|
147
149
|
except OSError as exc:
|
|
150
|
+
if path.is_dir() and not path.is_symlink():
|
|
151
|
+
shutil.rmtree(path, ignore_errors=True)
|
|
152
|
+
if not path.exists():
|
|
153
|
+
return True, "usunięto"
|
|
154
|
+
return True, "oczyszczono zawartość"
|
|
148
155
|
return False, str(exc)
|
|
149
156
|
|
|
150
157
|
|
|
158
|
+
_MAX_DISPLAY_CANDIDATES = 50
|
|
159
|
+
|
|
160
|
+
|
|
151
161
|
def _display_candidates(title: str, candidates: list[dict]) -> None:
|
|
152
162
|
click.echo(f"\n{click.style(title, fg='magenta', bold=True)}")
|
|
153
|
-
|
|
163
|
+
shown = candidates[:_MAX_DISPLAY_CANDIDATES]
|
|
164
|
+
for index, item in enumerate(shown, 1):
|
|
154
165
|
size = _format_bytes(item.get("size_bytes", 0))
|
|
155
166
|
detail = item.get("note", "")
|
|
156
167
|
suffix = f" — {detail}" if detail else ""
|
|
@@ -158,23 +169,104 @@ def _display_candidates(title: str, candidates: list[dict]) -> None:
|
|
|
158
169
|
f" [{index:3d}] {click.style(item['description'], fg='yellow')}: "
|
|
159
170
|
f"{size}{suffix}"
|
|
160
171
|
)
|
|
161
|
-
|
|
172
|
+
if len(candidates) > _MAX_DISPLAY_CANDIDATES:
|
|
173
|
+
hidden = candidates[_MAX_DISPLAY_CANDIDATES:]
|
|
174
|
+
hidden_bytes = sum(item.get("size_bytes", 0) for item in hidden)
|
|
175
|
+
click.echo(
|
|
176
|
+
f" ... i {len(hidden)} pozostałych pozycji "
|
|
177
|
+
f"({_format_bytes(hidden_bytes)})"
|
|
178
|
+
)
|
|
179
|
+
total_bytes = sum(item.get("size_bytes", 0) for item in candidates)
|
|
180
|
+
click.echo(
|
|
181
|
+
f"\n Kandydatów: {len(candidates)} (łącznie {_format_bytes(total_bytes)})"
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def _batch_sudo_remove_tmp(items: list[dict], path_key: str = "path") -> tuple[int, int]:
|
|
186
|
+
"""Remove root-owned /tmp items in batches using non-interactive sudo if available."""
|
|
187
|
+
if not items or shutil.which("sudo") is None:
|
|
188
|
+
return 0, 0
|
|
189
|
+
safe_items = []
|
|
190
|
+
for item in items:
|
|
191
|
+
p = Path(item[path_key])
|
|
192
|
+
if p.parent == Path("/tmp") and not any(
|
|
193
|
+
p.name.startswith(pref) for pref in _EXCLUDED_TMP_PREFIXES
|
|
194
|
+
):
|
|
195
|
+
safe_items.append(item)
|
|
196
|
+
if not safe_items:
|
|
197
|
+
return 0, 0
|
|
198
|
+
removed = 0
|
|
199
|
+
freed = 0
|
|
200
|
+
chunk_size = 500
|
|
201
|
+
for start in range(0, len(safe_items), chunk_size):
|
|
202
|
+
chunk = safe_items[start : start + chunk_size]
|
|
203
|
+
cmd = ["sudo", "-n", "rm", "-rf", "--", *[str(it[path_key]) for it in chunk]]
|
|
204
|
+
try:
|
|
205
|
+
res = _run_cmd(cmd, timeout=60)
|
|
206
|
+
if res.returncode == 0:
|
|
207
|
+
removed += len(chunk)
|
|
208
|
+
freed += sum(int(it.get("size_bytes", 0) or 0) for it in chunk)
|
|
209
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
210
|
+
break
|
|
211
|
+
return removed, freed
|
|
162
212
|
|
|
163
213
|
|
|
164
214
|
def _remove_selected(
|
|
165
215
|
candidates: list[dict], selected: list[int], path_key: str = "path"
|
|
166
216
|
) -> None:
|
|
217
|
+
verbose = len(selected) <= _MAX_DISPLAY_CANDIDATES
|
|
218
|
+
removed_count = 0
|
|
219
|
+
failed_count = 0
|
|
220
|
+
freed_bytes = 0
|
|
221
|
+
perm_denied_items: list[dict] = []
|
|
167
222
|
for index in selected:
|
|
168
223
|
item = candidates[index]
|
|
169
224
|
ok, detail = _remove_path(item[path_key])
|
|
170
|
-
|
|
171
|
-
|
|
225
|
+
if ok:
|
|
226
|
+
removed_count += 1
|
|
227
|
+
freed_bytes += int(item.get("size_bytes", 0) or 0)
|
|
228
|
+
elif detail.startswith("PERMISSION_DENIED:"):
|
|
229
|
+
perm_denied_items.append(item)
|
|
230
|
+
detail = detail.removeprefix("PERMISSION_DENIED:")
|
|
231
|
+
failed_count += 1
|
|
232
|
+
else:
|
|
233
|
+
failed_count += 1
|
|
234
|
+
if verbose:
|
|
235
|
+
style = "green" if ok else "red"
|
|
236
|
+
click.echo(click.style(f" {item['description']}: {detail}", fg=style))
|
|
237
|
+
if perm_denied_items:
|
|
238
|
+
sudo_removed, sudo_freed = _batch_sudo_remove_tmp(perm_denied_items, path_key=path_key)
|
|
239
|
+
if sudo_removed > 0:
|
|
240
|
+
removed_count += sudo_removed
|
|
241
|
+
freed_bytes += sudo_freed
|
|
242
|
+
failed_count = max(0, failed_count - sudo_removed)
|
|
243
|
+
if verbose:
|
|
244
|
+
click.echo(
|
|
245
|
+
click.style(
|
|
246
|
+
f" Usunięto przez sudo (/tmp): {sudo_removed} pozycji ({_format_bytes(sudo_freed)})",
|
|
247
|
+
fg="green",
|
|
248
|
+
)
|
|
249
|
+
)
|
|
250
|
+
if not verbose:
|
|
251
|
+
click.echo(
|
|
252
|
+
click.style(
|
|
253
|
+
f" Usunięto {removed_count}/{len(selected)} pozycji "
|
|
254
|
+
f"(zwolniono {_format_bytes(freed_bytes)})",
|
|
255
|
+
fg="green" if failed_count == 0 else "yellow",
|
|
256
|
+
)
|
|
257
|
+
)
|
|
258
|
+
if failed_count:
|
|
259
|
+
click.echo(
|
|
260
|
+
click.style(f" Nie udało się usunąć: {failed_count} pozycji", fg="red")
|
|
261
|
+
)
|
|
172
262
|
|
|
173
263
|
|
|
174
264
|
def _show_dry_run_commands(commands: list[list[str]]) -> None:
|
|
175
265
|
click.echo(click.style("[TRYB DRY-RUN] - brak faktycznych zmian", fg="cyan"))
|
|
176
|
-
for command in commands:
|
|
266
|
+
for command in commands[:_MAX_DISPLAY_CANDIDATES]:
|
|
177
267
|
click.echo(f" $ {' '.join(command)}")
|
|
268
|
+
if len(commands) > _MAX_DISPLAY_CANDIDATES:
|
|
269
|
+
click.echo(f" ... i {len(commands) - _MAX_DISPLAY_CANDIDATES} pozostałych komend")
|
|
178
270
|
|
|
179
271
|
|
|
180
272
|
# ── snap revisions ───────────────────────────────────────────────────────
|
|
@@ -194,11 +286,16 @@ def _snap_disabled_revisions() -> list[dict] | None:
|
|
|
194
286
|
if len(parts) < 3 or "disabled" not in line.lower():
|
|
195
287
|
continue
|
|
196
288
|
name, version, rev = parts[0], parts[1], parts[2]
|
|
289
|
+
snap_file = Path(f"/var/lib/snapd/snaps/{name}_{rev}.snap")
|
|
290
|
+
try:
|
|
291
|
+
size_bytes = snap_file.stat().st_size if snap_file.is_file() else 0
|
|
292
|
+
except OSError:
|
|
293
|
+
size_bytes = 0
|
|
197
294
|
candidates.append(
|
|
198
295
|
{
|
|
199
296
|
"description": f"{name} (rewizja {rev})",
|
|
200
297
|
"note": f"v{version}",
|
|
201
|
-
"size_bytes":
|
|
298
|
+
"size_bytes": size_bytes,
|
|
202
299
|
"command": ["sudo", "snap", "remove", name, "--revision", rev],
|
|
203
300
|
}
|
|
204
301
|
)
|
|
@@ -604,6 +701,21 @@ def _gitive_container_names() -> set[str] | None:
|
|
|
604
701
|
return {name for name in result.stdout.split() if name}
|
|
605
702
|
|
|
606
703
|
|
|
704
|
+
def _discover_gitive_rootfs_dirs(root: Path) -> list[Path]:
|
|
705
|
+
"""Find workspace `rootfs` directories under `root` without descending into `rootfs`."""
|
|
706
|
+
import os
|
|
707
|
+
|
|
708
|
+
found: list[Path] = []
|
|
709
|
+
for dirpath, dirnames, _filenames in os.walk(root):
|
|
710
|
+
if "rootfs" in dirnames:
|
|
711
|
+
rootfs_path = Path(dirpath) / "rootfs"
|
|
712
|
+
if rootfs_path.is_dir():
|
|
713
|
+
found.append(rootfs_path)
|
|
714
|
+
dirnames.remove("rootfs")
|
|
715
|
+
found.sort()
|
|
716
|
+
return found
|
|
717
|
+
|
|
718
|
+
|
|
607
719
|
def _cleanup_gitive(
|
|
608
720
|
json_output: bool, dry_run: bool, list_only: bool, yes: bool
|
|
609
721
|
) -> None:
|
|
@@ -615,7 +727,7 @@ def _cleanup_gitive(
|
|
|
615
727
|
if names is None:
|
|
616
728
|
error = "Nie udało się zweryfikować powiązania z kontenerami (docker niedostępny)"
|
|
617
729
|
elif root.is_dir():
|
|
618
|
-
for rootfs in
|
|
730
|
+
for rootfs in _discover_gitive_rootfs_dirs(root):
|
|
619
731
|
workspace = rootfs.parent
|
|
620
732
|
if not rootfs.is_dir() or workspace.is_symlink():
|
|
621
733
|
continue
|
|
@@ -1593,3 +1705,113 @@ def _display_cleanup_policies(json_output: bool = False) -> None:
|
|
|
1593
1705
|
click.echo(" fixos cleanup --policy # wyświetla tę tabelę polityk i retencji\n")
|
|
1594
1706
|
|
|
1595
1707
|
|
|
1708
|
+
def _cleanup_build_caches(
|
|
1709
|
+
json_output: bool,
|
|
1710
|
+
dry_run: bool,
|
|
1711
|
+
list_only: bool,
|
|
1712
|
+
yes: bool,
|
|
1713
|
+
home_dir: Path | None = None,
|
|
1714
|
+
) -> None:
|
|
1715
|
+
"""Clean safe regenerable build/package caches (Cargo target/debug, ~/.npm/_cacache, conda tarballs)."""
|
|
1716
|
+
home = home_dir or Path.home()
|
|
1717
|
+
dirs_to_size: list[Path] = []
|
|
1718
|
+
seen_resolved: set[Path] = set()
|
|
1719
|
+
file_candidates: list[dict] = []
|
|
1720
|
+
|
|
1721
|
+
github_root = home / "github"
|
|
1722
|
+
if github_root.is_dir():
|
|
1723
|
+
for pat in ("*/*/target/debug", "*/*/packages/*/target/debug"):
|
|
1724
|
+
for dbg in sorted(github_root.glob(pat)):
|
|
1725
|
+
if dbg.is_dir() and not dbg.is_symlink():
|
|
1726
|
+
try:
|
|
1727
|
+
real = dbg.resolve()
|
|
1728
|
+
except OSError:
|
|
1729
|
+
real = dbg
|
|
1730
|
+
if real not in seen_resolved:
|
|
1731
|
+
seen_resolved.add(real)
|
|
1732
|
+
dirs_to_size.append(dbg)
|
|
1733
|
+
|
|
1734
|
+
npm_cache = home / ".npm" / "_cacache"
|
|
1735
|
+
if npm_cache.is_dir() and not npm_cache.is_symlink():
|
|
1736
|
+
dirs_to_size.append(npm_cache)
|
|
1737
|
+
|
|
1738
|
+
conda_pkgs = home / "miniconda3" / "pkgs"
|
|
1739
|
+
if conda_pkgs.is_dir():
|
|
1740
|
+
for ext in ("*.tar.bz2", "*.conda"):
|
|
1741
|
+
for archive in sorted(conda_pkgs.glob(ext)):
|
|
1742
|
+
try:
|
|
1743
|
+
if archive.is_file() and not archive.is_symlink():
|
|
1744
|
+
file_candidates.append(
|
|
1745
|
+
{
|
|
1746
|
+
"description": f"miniconda3/pkgs/{archive.name}",
|
|
1747
|
+
"path": archive,
|
|
1748
|
+
"size_bytes": archive.stat().st_size,
|
|
1749
|
+
"note": "archiwum pakietu conda",
|
|
1750
|
+
}
|
|
1751
|
+
)
|
|
1752
|
+
except OSError:
|
|
1753
|
+
continue
|
|
1754
|
+
|
|
1755
|
+
sizes = _dir_sizes(dirs_to_size) if dirs_to_size else {}
|
|
1756
|
+
candidates: list[dict] = []
|
|
1757
|
+
for d in dirs_to_size:
|
|
1758
|
+
sz = sizes.get(str(d))
|
|
1759
|
+
if sz is None:
|
|
1760
|
+
sz = _dir_size(d)
|
|
1761
|
+
if sz <= 0:
|
|
1762
|
+
continue
|
|
1763
|
+
try:
|
|
1764
|
+
rel = str(d.relative_to(home))
|
|
1765
|
+
except ValueError:
|
|
1766
|
+
rel = str(d)
|
|
1767
|
+
candidates.append(
|
|
1768
|
+
{
|
|
1769
|
+
"description": f"~/{rel}",
|
|
1770
|
+
"path": d,
|
|
1771
|
+
"size_bytes": sz,
|
|
1772
|
+
"note": "regenerowalny cache kompilacji/pakietów",
|
|
1773
|
+
}
|
|
1774
|
+
)
|
|
1775
|
+
candidates.extend(file_candidates)
|
|
1776
|
+
candidates.sort(key=lambda item: (-item.get("size_bytes", 0), item["description"]))
|
|
1777
|
+
|
|
1778
|
+
if json_output:
|
|
1779
|
+
_echo_json(
|
|
1780
|
+
{
|
|
1781
|
+
"candidates": [
|
|
1782
|
+
{
|
|
1783
|
+
"description": c["description"],
|
|
1784
|
+
"path": str(c["path"]),
|
|
1785
|
+
"size_bytes": c["size_bytes"],
|
|
1786
|
+
"note": c["note"],
|
|
1787
|
+
}
|
|
1788
|
+
for c in candidates
|
|
1789
|
+
],
|
|
1790
|
+
"total_bytes": sum(c["size_bytes"] for c in candidates),
|
|
1791
|
+
}
|
|
1792
|
+
)
|
|
1793
|
+
return
|
|
1794
|
+
|
|
1795
|
+
if not candidates:
|
|
1796
|
+
click.echo(click.style("Brak cache kompilacji/pakietów do wyczyszczenia.", fg="green"))
|
|
1797
|
+
return
|
|
1798
|
+
|
|
1799
|
+
_display_candidates("CACHE KOMPILACJI I PAKIETÓW (target/debug, npm, conda):", candidates)
|
|
1800
|
+
if list_only:
|
|
1801
|
+
return
|
|
1802
|
+
|
|
1803
|
+
selected = (
|
|
1804
|
+
list(range(len(candidates)))
|
|
1805
|
+
if yes
|
|
1806
|
+
else _choose(candidates, "Numery pozycji do usunięcia (np. 1,2, all)")
|
|
1807
|
+
)
|
|
1808
|
+
if not selected:
|
|
1809
|
+
click.echo("Pominięto.")
|
|
1810
|
+
return
|
|
1811
|
+
if dry_run:
|
|
1812
|
+
_show_dry_run_commands([["rm", "-rf", str(candidates[i]["path"])] for i in selected])
|
|
1813
|
+
return
|
|
1814
|
+
if not yes and not _confirm_remove():
|
|
1815
|
+
click.echo("Anulowano.")
|
|
1816
|
+
return
|
|
1817
|
+
_remove_selected(candidates, selected)
|