feat(agent): add --doctor preflight self-test mode with structured checks
This commit is contained in:
1 parent
d2fdd5be44
commit
be92bb2493
5 files changed
+311
-2
No files matched your search
@@ -1,8 +1,31 @@
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
from config import load_runtime_settings
|
||||
from doctor import run_doctor
|
||||
from healing import execute_heal_and_verify, should_heal
|
||||
from main import main
|
||||
|
||||
__all__ = ["main", "should_heal", "execute_heal_and_verify"]
|
||||
__all__ = ["main", "should_heal", "execute_heal_and_verify", "run_doctor"]
|
||||
|
||||
|
||||
def cli(argv=None):
|
||||
parser = argparse.ArgumentParser(description="Threat Engine Agent")
|
||||
parser.add_argument(
|
||||
"--doctor",
|
||||
action="store_true",
|
||||
help="Run startup self-tests and exit.",
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
if args.doctor:
|
||||
settings = load_runtime_settings()
|
||||
ok = run_doctor(settings)
|
||||
return 0 if ok else 1
|
||||
|
||||
main()
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
raise SystemExit(cli(sys.argv[1:]))
|
||||
Reference in new issue
Block a user