fix(reboot): expose windows99 management channel readback
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 41s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped

This commit is contained in:
Your Name
2026-07-02 15:19:09 +08:00
parent 25148d0752
commit aaa617f00f
14 changed files with 983 additions and 195 deletions

View File

@@ -2564,6 +2564,8 @@ def _enrich_from_current_readbacks(payload: dict[str, Any]) -> None:
windows99_verify_collection = _dict(
reboot_slo.get("windows99_verify_collection")
)
windows99_management = _dict(reboot_slo.get("windows99_management_channel"))
windows99_ssh_batch = _dict(windows99_management.get("ssh_batch"))
reboot_preflight_rollups = _dict(reboot_preflight.get("rollups"))
reboot_preflight_target_selector = _dict(reboot_preflight.get("target_selector"))
reboot_active_blockers = _strings(reboot_slo.get("active_blockers"))
@@ -2657,6 +2659,27 @@ def _enrich_from_current_readbacks(payload: dict[str, Any]) -> None:
state["windows99_verify_collection_post_verifier"] = str(
windows99_verify_collection.get("post_verifier") or ""
)
state["windows99_management_readback_present"] = bool(
windows99_management.get("readback_present") is True
)
state["windows99_management_host_reachable"] = bool(
windows99_management.get("host_reachable") is True
)
state["windows99_remote_execution_channel_ready"] = bool(
windows99_management.get("remote_execution_channel_ready") is True
)
state["windows99_ssh_batch_status"] = str(
windows99_ssh_batch.get("status") or "unknown"
)
state["windows99_rdp_console_reachable"] = bool(
windows99_management.get("rdp_console_reachable") is True
)
state["windows99_winrm_http_open"] = bool(
windows99_management.get("winrm_http_open") is True
)
state["windows99_winrm_https_open"] = bool(
windows99_management.get("winrm_https_open") is True
)
state["stale_snapshot_or_old_cd_runs_must_not_reopen_closed_work"] = True
state["p0_004_template_copy_apply_gate_production_http_status"] = 200
state["p0_004_template_copy_apply_gate_runtime_readback_state"] = (
@@ -2829,6 +2852,23 @@ def _enrich_from_current_readbacks(payload: dict[str, Any]) -> None:
evidence["windows99_verify_collection_host99_uptime_known"] = bool(
windows99_verify_collection.get("host99_uptime_known") is True
)
evidence["windows99_management_readback_present"] = state[
"windows99_management_readback_present"
]
evidence["windows99_management_host_reachable"] = state[
"windows99_management_host_reachable"
]
evidence["windows99_remote_execution_channel_ready"] = state[
"windows99_remote_execution_channel_ready"
]
evidence["windows99_ssh_batch_status"] = state[
"windows99_ssh_batch_status"
]
evidence["windows99_rdp_console_reachable"] = state[
"windows99_rdp_console_reachable"
]
evidence["windows99_winrm_http_open"] = state["windows99_winrm_http_open"]
evidence["windows99_winrm_https_open"] = state["windows99_winrm_https_open"]
evidence["drill_preflight_status"] = str(reboot_preflight.get("status") or "")
evidence["drill_preflight_ready"] = (
reboot_preflight_rollups.get("preflight_ready") is True
@@ -2892,7 +2932,8 @@ def _enrich_from_current_readbacks(payload: dict[str, Any]) -> None:
"controlled service/data/backup readback visible as the source "
"selector for these blockers. For Windows 99, use the "
"windows99_verify_collection packet to collect no-secret Verify "
"stdout and rerun the scorecard. For StockPlatform "
"stdout, keep windows99_management_channel visible for the current "
"remote execution blocker, and rerun the scorecard. For StockPlatform "
"freshness/ingestion postgres_not_ready, use the production "
"migration/control-channel path with target selector, dry-run, "
"rollback, public API verifier, and KM/RAG/MCP/PlayBook writeback. "
@@ -3092,6 +3133,18 @@ def _set_rollups_and_summary(
"windows99_verify_collection_host99_uptime_known": (
state.get("windows99_verify_collection_host99_uptime_known") is True
),
"windows99_management_readback_present": (
state.get("windows99_management_readback_present") is True
),
"windows99_remote_execution_channel_ready": (
state.get("windows99_remote_execution_channel_ready") is True
),
"windows99_ssh_batch_status": str(
state.get("windows99_ssh_batch_status") or "unknown"
),
"windows99_rdp_console_reachable": (
state.get("windows99_rdp_console_reachable") is True
),
"p0_004_runtime_readback_ready": p0_004_ready,
"reboot_drill_preflight_runtime_readback_ready": (
state.get("reboot_drill_preflight_runtime_readback_state") == "ready"
@@ -3148,6 +3201,27 @@ def _set_rollups_and_summary(
"windows99_verify_collection_post_verifier": str(
state.get("windows99_verify_collection_post_verifier") or ""
),
"windows99_management_readback_present": (
state.get("windows99_management_readback_present") is True
),
"windows99_management_host_reachable": (
state.get("windows99_management_host_reachable") is True
),
"windows99_remote_execution_channel_ready": (
state.get("windows99_remote_execution_channel_ready") is True
),
"windows99_ssh_batch_status": str(
state.get("windows99_ssh_batch_status") or "unknown"
),
"windows99_rdp_console_reachable": (
state.get("windows99_rdp_console_reachable") is True
),
"windows99_winrm_http_open": (
state.get("windows99_winrm_http_open") is True
),
"windows99_winrm_https_open": (
state.get("windows99_winrm_https_open") is True
),
"latest_successful_deployed_source_sha": latest_source_sha,
"latest_successful_deployed_source_short_sha": latest_source_sha[:10],
"latest_successful_deploy_marker": str(

View File

@@ -43,6 +43,8 @@ def _build_payload(scorecard: dict[str, Any], path: Path) -> dict[str, Any]:
post_reboot_readiness = _dict(scorecard.get("post_reboot_readiness"))
stockplatform = _dict(scorecard.get("stockplatform_data_freshness"))
windows99 = _dict(scorecard.get("windows99_vmware_autostart"))
windows99_management = _dict(scorecard.get("windows99_management_channel"))
windows99_ssh_batch = _dict(windows99_management.get("ssh_batch"))
source_controls = _dict(scorecard.get("source_controls"))
active_blockers = _strings(scorecard.get("active_blockers"))
required_checks = {
@@ -53,6 +55,10 @@ def _build_payload(scorecard: dict[str, Any], path: Path) -> dict[str, Any]:
"windows_update_no_auto_reboot_ready": (
windows99.get("windows_update_no_auto_reboot_ready") is True
),
"windows99_management_channel_ready": (
windows99.get("verify_ready") is True
or windows99_management.get("remote_execution_channel_ready") is True
),
"service_green": post_reboot_readiness.get("service_green") is True,
"product_data_green": post_reboot_readiness.get("product_data_green") is True,
"backup_core_green": post_reboot_readiness.get("backup_core_green") is True,
@@ -197,6 +203,31 @@ def _build_payload(scorecard: dict[str, Any], path: Path) -> dict[str, Any]:
"windows99_host99_uptime_known": (
windows99_verify_collection["host99_uptime_known"] is True
),
"windows99_management_readback_present": (
windows99_management.get("readback_present") is True
),
"windows99_host_reachable": (
windows99_management.get("host_reachable") is True
),
"windows99_remote_execution_channel_ready": (
windows99_management.get("remote_execution_channel_ready") is True
),
"windows99_can_collect_vmware_verify_without_secret": (
windows99_management.get("can_collect_vmware_verify_without_secret") is True
),
"windows99_ssh_batch_ready": windows99_ssh_batch.get("ready") is True,
"windows99_ssh_batch_status": str(
windows99_ssh_batch.get("status") or "unknown"
),
"windows99_winrm_http_open": (
windows99_management.get("winrm_http_open") is True
),
"windows99_winrm_https_open": (
windows99_management.get("winrm_https_open") is True
),
"windows99_rdp_console_reachable": (
windows99_management.get("rdp_console_reachable") is True
),
}
return {
"schema_version": _API_SCHEMA_VERSION,
@@ -238,6 +269,10 @@ def _build_payload(scorecard: dict[str, Any], path: Path) -> dict[str, Any]:
"windows99_update_no_auto_reboot_ready": rollups[
"windows99_update_no_auto_reboot_ready"
],
"windows99_remote_execution_channel_ready": rollups[
"windows99_remote_execution_channel_ready"
],
"windows99_ssh_batch_status": rollups["windows99_ssh_batch_status"],
"readback": {
"workplan_id": "P0-006",
"workplan_title": "主機重啟自動偵測、自動觸發與 10 分鐘恢復 SLO",
@@ -273,6 +308,10 @@ def _build_payload(scorecard: dict[str, Any], path: Path) -> dict[str, Any]:
"windows99_verify_collection_can_collect_no_secret": rollups[
"windows99_verify_collection_can_collect_no_secret"
],
"windows99_remote_execution_channel_ready": rollups[
"windows99_remote_execution_channel_ready"
],
"windows99_ssh_batch_status": rollups["windows99_ssh_batch_status"],
},
"reboot_sop_progress": sop_progress,
"controlled_service_data_backup_readback": (
@@ -283,6 +322,7 @@ def _build_payload(scorecard: dict[str, Any], path: Path) -> dict[str, Any]:
"stockplatform_data_freshness": stockplatform,
"windows99_vmware_autostart": windows99,
"windows99_verify_collection": windows99_verify_collection,
"windows99_management_channel": windows99_management,
"source_controls": source_controls,
"active_blockers": active_blockers,
"required_checks": required_checks,
@@ -547,6 +587,7 @@ def _reboot_sop_current_phase(active_blockers: list[str], can_claim_slo: bool) -
"fresh_all_host_reboot_event_missing",
"all_required_hosts_not_in_10_minute_reboot_window",
"windows99_vmware_autostart_readback_missing",
"windows99_remote_execution_channel_unavailable",
"windows99_vmrun_missing",
"windows99_vmware_vmx_missing",
"windows99_vmware_autostart_config_not_ready",
@@ -593,6 +634,7 @@ def _reboot_sop_primary_blocker(active_blockers: list[str]) -> str:
"host_boot_observation_older_than_target_window",
"host_uptime_unknown",
"windows99_vmware_autostart_readback_missing",
"windows99_remote_execution_channel_unavailable",
"windows99_vmrun_missing",
"windows99_vmware_vmx_missing",
"windows99_vmware_autostart_config_not_ready",