fix(governance): align current P0 with program ledger
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m4s
CD Pipeline / build-and-deploy (push) Successful in 4m43s
CD Pipeline / post-deploy-checks (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m4s
CD Pipeline / build-and-deploy (push) Successful in 4m43s
CD Pipeline / post-deploy-checks (push) Has been cancelled
This commit is contained in:
@@ -7123,6 +7123,94 @@ def _load_ai_automation_professional_review() -> dict[str, Any]:
|
||||
return payload if isinstance(payload, dict) else {}
|
||||
|
||||
|
||||
def _align_authoritative_current_p0_execution_focus(
|
||||
payload: dict[str, Any],
|
||||
next_item: dict[str, Any],
|
||||
) -> None:
|
||||
"""Keep the formal program order authoritative without hiding ops work."""
|
||||
existing_parallel_focus = _dict(payload.get("parallel_operational_focus"))
|
||||
existing_current_focus = _dict(payload.get("current_p0_execution_focus"))
|
||||
next_work_item_id = str(next_item.get("id") or "")
|
||||
if (
|
||||
not existing_parallel_focus
|
||||
and existing_current_focus
|
||||
and str(existing_current_focus.get("workplan_id") or "")
|
||||
!= next_work_item_id
|
||||
):
|
||||
existing_parallel_focus = copy.deepcopy(existing_current_focus)
|
||||
payload["parallel_operational_focus"] = existing_parallel_focus
|
||||
|
||||
runtime_progress = _dict(next_item.get("runtime_progress"))
|
||||
missing_stage_ids = _strings(runtime_progress.get("missing_stage_ids"))
|
||||
dependencies = _strings(next_item.get("dependencies"))
|
||||
is_runtime_closure = next_work_item_id == "AIA-P0-001"
|
||||
current_focus = {
|
||||
"schema_version": "awoooi_current_p0_execution_focus_v2",
|
||||
"source": "ai_automation_program_ledger",
|
||||
"workplan_id": next_work_item_id,
|
||||
"priority": str(next_item.get("priority") or ""),
|
||||
"state": str(next_item.get("status") or ""),
|
||||
"stage": (
|
||||
"production_runtime_closure"
|
||||
if is_runtime_closure
|
||||
else "program_work_item_execution"
|
||||
),
|
||||
"lane": (
|
||||
"ai_agent_runtime_closure"
|
||||
if is_runtime_closure
|
||||
else "ai_automation_program"
|
||||
),
|
||||
"primary_blocker": (
|
||||
",".join(missing_stage_ids)
|
||||
or str(next_item.get("problem") or "")
|
||||
),
|
||||
"next_executable_step": str(next_item.get("next_action") or ""),
|
||||
"readiness_percent": _int(runtime_progress.get("completion_percent")),
|
||||
"active_blocker_count": len(missing_stage_ids),
|
||||
"blocker_group_counts": {
|
||||
"runtime_stage_gap": len(missing_stage_ids),
|
||||
"dependency": len(dependencies),
|
||||
},
|
||||
"ready_package_count": 0,
|
||||
"ready_packages": [],
|
||||
"no_secret_verifier_ready": False,
|
||||
"scoped_relink_dry_run_ready": False,
|
||||
"autostart_check_mode_ready": False,
|
||||
"service_data_backup_closed": False,
|
||||
"parallel_operational_focus_id": str(
|
||||
existing_parallel_focus.get("workplan_id") or ""
|
||||
),
|
||||
"operation_boundaries": {
|
||||
"low_medium_high_controlled_apply_allowed": True,
|
||||
"critical_break_glass_required": True,
|
||||
"secret_value_read": False,
|
||||
"host_reboot": False,
|
||||
"vm_power_change": False,
|
||||
"github_api": False,
|
||||
},
|
||||
}
|
||||
payload["current_p0_execution_focus"] = current_focus
|
||||
|
||||
summary = _dict(payload.setdefault("summary", {}))
|
||||
rollups = _dict(payload.setdefault("rollups", {}))
|
||||
for target in (summary, rollups):
|
||||
target["current_p0_execution_focus_workplan_id"] = next_work_item_id
|
||||
target["current_p0_execution_focus_priority"] = current_focus["priority"]
|
||||
target["current_p0_execution_focus_stage"] = current_focus["stage"]
|
||||
target["current_p0_execution_focus_lane"] = current_focus["lane"]
|
||||
target["current_p0_execution_focus_next_executable_step"] = current_focus[
|
||||
"next_executable_step"
|
||||
]
|
||||
target["current_p0_execution_focus_ready_package_count"] = 0
|
||||
target["current_p0_execution_focus_no_secret_verifier_ready"] = False
|
||||
target["parallel_operational_focus_workplan_id"] = str(
|
||||
existing_parallel_focus.get("workplan_id") or ""
|
||||
)
|
||||
target["parallel_operational_focus_stage"] = str(
|
||||
existing_parallel_focus.get("stage") or ""
|
||||
)
|
||||
|
||||
|
||||
def _apply_ai_automation_program_ledger(payload: dict[str, Any]) -> None:
|
||||
summary = _dict(payload.setdefault("summary", {}))
|
||||
rollups = _dict(payload.setdefault("rollups", {}))
|
||||
@@ -7430,6 +7518,7 @@ def _apply_ai_automation_program_ledger(payload: dict[str, Any]) -> None:
|
||||
tracked_asset_unit_count
|
||||
)
|
||||
rollups["ai_automation_program_completion_percent"] = completion_percent
|
||||
_align_authoritative_current_p0_execution_focus(payload, next_item)
|
||||
|
||||
|
||||
def _apply_commander_inserted_requirement_work_items(
|
||||
|
||||
Reference in New Issue
Block a user