Merge remote-tracking branch 'origin/main' into codex/ai-automation-codebase-review-20260710
This commit is contained in:
@@ -527,6 +527,7 @@ async def enqueue_iwooos_wazuh_manager_posture_candidate_once(
|
||||
proposal_data={
|
||||
"source": "iwooos_wazuh_manager_posture_scheduler",
|
||||
"risk_level": "low",
|
||||
"execution_priority": 0,
|
||||
"action": "run_bounded_no_write_wazuh_manager_posture_readback",
|
||||
},
|
||||
decision_path=_BACKFILL_DECISION_PATH,
|
||||
|
||||
@@ -586,6 +586,10 @@ def build_ansible_decision_audit_payload(
|
||||
and str((signal.get("labels") or {}).get("namespace") or "").strip()
|
||||
})
|
||||
proposal_risk_level = str(proposal_data.get("risk_level") or "").strip().lower()
|
||||
execution_priority = proposal_data.get("execution_priority", 100)
|
||||
if not isinstance(execution_priority, int) or isinstance(execution_priority, bool):
|
||||
execution_priority = 100
|
||||
execution_priority = max(0, min(execution_priority, 100))
|
||||
idempotency_key = f"ansible-candidate:{project_id}:{incident_id}"
|
||||
input_payload = {
|
||||
"incident_id": incident_id,
|
||||
@@ -602,6 +606,7 @@ def build_ansible_decision_audit_payload(
|
||||
"executor": "ansible",
|
||||
"execution_backend": "ansible",
|
||||
"single_writer_executor": "awoooi-ansible-executor-broker",
|
||||
"execution_priority": execution_priority,
|
||||
"decision_path": decision_path,
|
||||
"idempotency_key": idempotency_key,
|
||||
"router_source_sha": os.getenv("AWOOOI_BUILD_COMMIT_SHA", "")
|
||||
|
||||
@@ -3185,7 +3185,19 @@ async def claim_pending_check_modes(
|
||||
'ansible_execution_skipped'
|
||||
)
|
||||
)
|
||||
ORDER BY candidate.created_at ASC
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN candidate.input ->> 'work_item_id' LIKE 'P0-%'
|
||||
THEN 0
|
||||
WHEN candidate.input ->> 'execution_priority'
|
||||
~ '^[0-9]{1,3}$'
|
||||
THEN LEAST(
|
||||
(candidate.input ->> 'execution_priority')::int,
|
||||
100
|
||||
)
|
||||
ELSE 100
|
||||
END ASC,
|
||||
candidate.created_at ASC
|
||||
LIMIT :limit
|
||||
FOR UPDATE SKIP LOCKED
|
||||
"""),
|
||||
|
||||
@@ -46,10 +46,10 @@ ProbeRunner = Callable[..., Awaitable[ReadOnlyProbeResult]]
|
||||
_POSTCONDITION_REGISTRY: dict[str, tuple[AssetPostcondition, ...]] = {
|
||||
"ansible:wazuh-manager-posture-readback": (
|
||||
AssetPostcondition(
|
||||
"host_112_wazuh_manager_control_binary",
|
||||
"host_112_wazuh_manager_unit_loaded",
|
||||
"security",
|
||||
"host_112",
|
||||
"test -f /var/ossec/bin/wazuh-control",
|
||||
"systemctl show --property=LoadState --value wazuh-manager.service | grep -Fxq loaded",
|
||||
),
|
||||
AssetPostcondition(
|
||||
"host_112_wazuh_manager_runtime",
|
||||
|
||||
Reference in New Issue
Block a user