Propagate owner gate policy through self-loop executor
This commit is contained in:
@@ -69,13 +69,12 @@ class SelfLoopTestRunner:
|
||||
"""Deterministic self-loop checks that avoid shell execution and secrets."""
|
||||
|
||||
def run(self, runtime: dict[str, Any], baseline: dict[str, Any]) -> list[TestResult]:
|
||||
tests = [
|
||||
return [
|
||||
self._runtime_active(runtime),
|
||||
self._patch_only_policy(baseline),
|
||||
self._owner_gate_policy(baseline),
|
||||
self._portal_domain_smoke(),
|
||||
]
|
||||
return tests
|
||||
|
||||
def _runtime_active(self, runtime: dict[str, Any]) -> TestResult:
|
||||
if runtime.get("status") == "active":
|
||||
@@ -173,7 +172,7 @@ class SelfLoopAgentExecutor:
|
||||
def execute_report(self, report: SelfLoopReport, runtime: dict[str, Any], baseline: dict[str, Any]) -> ExecutionReport:
|
||||
actions = [self.execute_step(step) for step in report.remediation]
|
||||
tests = self.test_runner.run(runtime, baseline)
|
||||
owner_approval_required = any(a.requires_owner_approval for a in actions)
|
||||
owner_approval_required = self.loop.owner_approval_required or any(a.requires_owner_approval for a in actions)
|
||||
failed_tests = [t for t in tests if not t.passed()]
|
||||
if failed_tests:
|
||||
status = "failed_tests"
|
||||
@@ -187,10 +186,11 @@ class SelfLoopAgentExecutor:
|
||||
report = self.loop.evaluate(runtime, baseline)
|
||||
execution = self.execute_report(report, runtime, baseline)
|
||||
acceptance = self.loop.acceptance(report)
|
||||
owner_approval_required = execution.owner_approval_required or acceptance["owner_approval_required"]
|
||||
return {
|
||||
"status": execution.status,
|
||||
"can_unattended_continue": execution.status == "completed" and not execution.owner_approval_required,
|
||||
"owner_approval_required": execution.owner_approval_required or acceptance["owner_approval_required"],
|
||||
"can_unattended_continue": execution.status == "completed" and not owner_approval_required,
|
||||
"owner_approval_required": owner_approval_required,
|
||||
"plan": report.to_dict(),
|
||||
"execution": execution.to_dict(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user