fix(awooop): 移除 tenants 公開內部狀態碼
All checks were successful
Code Review / ai-code-review (push) Successful in 14s
CD Pipeline / tests (push) Successful in 1m33s
CD Pipeline / build-and-deploy (push) Successful in 4m1s
CD Pipeline / post-deploy-checks (push) Successful in 1m35s

This commit is contained in:
Your Name
2026-06-15 03:19:09 +08:00
parent 6a2ceb7fa6
commit 8eff94a4f5
6 changed files with 115 additions and 35 deletions

View File

@@ -726,6 +726,26 @@ def _source_scope_id(index: int) -> str:
return f"SRC-{index:03d}"
def _public_source_risk(value: Any) -> str:
risk = str(value or "").strip().lower()
if risk in {"high", "medium", "low"}:
return risk
return "unknown"
def _public_source_readiness(value: Any) -> str:
readiness = str(value or "").strip().lower()
if "refs" in readiness and "parity" in readiness:
return "need_refs_evidence"
if "target" in readiness and "decision" in readiness:
return "need_target_decision"
if "internal_remote" in readiness or ("remote" in readiness and "decision" in readiness):
return "need_internal_remote_decision"
if "scope" in readiness and "review" in readiness:
return "need_scope_review"
return "need_owner_evidence"
def _public_surface_source_refs(surface: Mapping[str, Any]) -> list[str]:
return [f"SRCREF-{index:03d}" for index, _ in enumerate(surface.get("source_keys") or [], start=1)]
@@ -778,8 +798,8 @@ def _build_source_repo_assets(
"product_name": product["product_name"],
"category": product["category"],
"scope_status": row.get("scope_status") or "unknown",
"readiness_state": row.get("readiness_state") or "unknown",
"risk": row.get("risk") or "UNKNOWN",
"readiness_state": _public_source_readiness(row.get("readiness_state")),
"risk": _public_source_risk(row.get("risk")),
"primary_ready": bool(row.get("primary_ready")),
"blocker_count": len(row.get("blockers") or []),
"runtime_gate_count": 0,