diff --git a/core/engine.py b/core/engine.py index 611d65e..47a7fee 100644 --- a/core/engine.py +++ b/core/engine.py @@ -1,7 +1,8 @@ """ Coordinates the full SwiftBox loop: input -> normalize -> decide -> act -> state -> verify - + +Entry point for external callers Does not contain policy — reads everything from config. """ @@ -83,6 +84,7 @@ def load_host_config(path: str | Path) -> HostConfig: repo_source=data.get("repo", {}).get("source"), repo_branch=data.get("repo", {}).get("branch", "main"), verify_checksums=data.get("repo", {}).get("verify_checksums", True), + ssh_config=data.get("ssh"), # None for local hosts ) @@ -259,8 +261,13 @@ def run( host_config.name, host_config.execution_mode, host_config.dry_run, ) - # Detect - issues = run_all_checks(checks, host_config.name) + + if host_config.ssh_config: + logger.info("SSH mode: running checks remotely on %s", host_config.ssh_config.get("host")) + from adapters.ssh.checks import run_ssh_checks + issues = run_ssh_checks(host_config, checks) + else: + issues = run_all_checks(checks, host_config.name) actionable = [i for i in issues if i.status != CheckStatus.OK] logger.info("%d checks run, %d require attention", len(issues), len(actionable))