Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions core/engine.py
Original file line number Diff line number Diff line change
@@ -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.
"""

Expand Down Expand Up @@ -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
)


Expand Down Expand Up @@ -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))

Expand Down
Loading