fix(governance): 避免狀態清理儀表板曝光本機路徑
This commit is contained in:
@@ -20,6 +20,10 @@ from typing import Any
|
||||
|
||||
|
||||
TARGET_ROUTE = "/workspace/status-cleanup"
|
||||
PRIVATE_PROJECT_STATUS_PATH = (
|
||||
"/Users/ogt/.claude/projects/-Users-ogt-awoooi/memory/project_current_status.md"
|
||||
)
|
||||
PUBLIC_PROJECT_STATUS_REF = "awoooi_memory/project_current_status.md"
|
||||
|
||||
|
||||
def utc_now_iso() -> str:
|
||||
@@ -63,6 +67,10 @@ def append_boundary_tokens(boundary: str, tokens: list[str]) -> str:
|
||||
return " ".join(parts)
|
||||
|
||||
|
||||
def public_blocker_text(value: str) -> str:
|
||||
return value.replace(PRIVATE_PROJECT_STATUS_PATH, PUBLIC_PROJECT_STATUS_REF)
|
||||
|
||||
|
||||
def section_value(owner_package: dict[str, Any], section_id: str) -> str:
|
||||
for item in owner_package.get("required_update_sections", []):
|
||||
if item.get("section_id") == section_id:
|
||||
@@ -345,13 +353,22 @@ def build_payload(
|
||||
+ str(wazuh_visibility.get("runtime_gate_count", 0)),
|
||||
],
|
||||
)
|
||||
blockers = unique_strings(
|
||||
preflight.get("hard_gates", []),
|
||||
[f"owner_response_preflight:{item}" for item in owner_response_preflight.get("blocking_reasons", [])],
|
||||
[f"execution_plan_blocked_until:{item}" for item in execution_plan.get("blocked_until", [])],
|
||||
[f"apply_gate:{item}" for item in apply_gate.get("blocking_reasons", [])],
|
||||
[f"wazuh_boundary:{wazuh_boundary}"] if wazuh_boundary else [],
|
||||
)
|
||||
blockers = [
|
||||
public_blocker_text(item)
|
||||
for item in unique_strings(
|
||||
preflight.get("hard_gates", []),
|
||||
[
|
||||
f"owner_response_preflight:{item}"
|
||||
for item in owner_response_preflight.get("blocking_reasons", [])
|
||||
],
|
||||
[
|
||||
f"execution_plan_blocked_until:{item}"
|
||||
for item in execution_plan.get("blocked_until", [])
|
||||
],
|
||||
[f"apply_gate:{item}" for item in apply_gate.get("blocking_reasons", [])],
|
||||
[f"wazuh_boundary:{wazuh_boundary}"] if wazuh_boundary else [],
|
||||
)
|
||||
]
|
||||
actions = next_actions(owner_response_preflight, apply_gate)
|
||||
metrics = metric_cards(
|
||||
preflight,
|
||||
|
||||
Reference in New Issue
Block a user