Files
violin/scripts/guard/scope.py
T

24 lines
718 B
Python

"""Scope validation for the Violin guard package."""
from __future__ import annotations
import argparse
from pathlib import Path
from guard.core import CheckResult, load_yaml, validate_scope_data
def validate_scope(args: argparse.Namespace) -> int:
scope_path = Path(args.scope)
if not scope_path.exists():
result = CheckResult()
result.add_error(f"scope file not found: {scope_path}")
result.add_info(
"BOOTSTRAP REQUIRED: run the engagement bootstrap from playbooks/scoping.md §0 before any target interaction"
)
result.print()
return 1
result = validate_scope_data(load_yaml(scope_path))
result.print()
return result.exit_code()