Add renderer and package readiness validation gates

This commit is contained in:
2026-06-15 19:20:56 +02:00
parent 68617e8bc4
commit f78fc3076c
23 changed files with 2350 additions and 389 deletions

View File

@@ -22,9 +22,16 @@ EXPECTED_PACKAGE_KINDS = [
EXPECTED_CMAKE_PACKAGE_TARGETS = [
"panopainter_package_readiness",
"panopainter_windows_app_package_smoke",
"panopainter_windows_appx_package_readiness",
"panopainter_apple_bundle_package_readiness",
"panopainter_android_standard_native_package",
"panopainter_android_standard_apk_package_readiness",
"panopainter_android_quest_apk_package_readiness",
"panopainter_android_focus_apk_package_readiness",
"panopainter_android_vr_native_package_configure",
"panopainter_android_native_package_smoke",
"panopainter_linux_app_package_readiness",
"panopainter_webgl_package_readiness",
"panopainter_linux_webgl_package_readiness",
]
@@ -43,7 +50,15 @@ def powershell_package_kinds(root: Path) -> list[str]:
def shell_package_kinds(root: Path) -> list[str]:
script = (root / "scripts" / "automation" / "package-smoke.sh").read_text(encoding="utf-8")
return sorted(set(re.findall(r'"kind":"([^"]+)"', script)))
match = re.search(r'package_kinds="([^"]+)"', script)
if match:
return sorted(set(filter(None, (value.strip() for value in match.group(1).split(",")))))
quoted_kinds = sorted(set(re.findall(r'"kind":"([^"]+)"', script)))
escaped_kinds = sorted(set(re.findall(r'\\"kind\\":\\"([^\\"]+)\\"', script)))
if quoted_kinds or escaped_kinds:
return sorted(set(quoted_kinds).union(escaped_kinds))
raise RuntimeError("Could not find package kinds defaults in package-smoke.sh")
def count_regex(root: Path, patterns: dict[str, str]) -> dict[str, int]:
@@ -59,13 +74,29 @@ def main() -> int:
expected = sorted(EXPECTED_PACKAGE_KINDS)
ps_kinds = powershell_package_kinds(root)
sh_kinds = shell_package_kinds(root)
script_texts = {
"package-smoke.ps1": (root / "scripts" / "automation" / "package-smoke.ps1").read_text(encoding="utf-8"),
"package-smoke.sh": (root / "scripts" / "automation" / "package-smoke.sh").read_text(encoding="utf-8"),
}
debt_counts = count_regex(root, {
"package-smoke.ps1": r'debt\s*=\s*"DEBT-0011"',
"package-smoke.sh": r'"debt":"DEBT-0011"',
"package-smoke.sh": r'\\"debt\\":\\"DEBT-0011\\"',
})
blocked_counts = count_regex(root, {
"package-smoke.ps1": r'-Status\s+"blocked"',
"package-smoke.sh": r'"status":"blocked"',
status_tokens = ("blocked", "compile-only", "validated")
status_modes = {
name: [token for token in status_tokens if f'"{token}"' in text]
for name, text in script_texts.items()
}
status_mode_present = {
name: {
token: f'"{token}"' in script_texts[name]
for token in ("blocked", "compile-only")
}
for name in ("package-smoke.ps1", "package-smoke.sh")
}
readiness_alignment = count_regex(root, {
"package-smoke.ps1": r'androidNativeValidation',
"package-smoke.sh": r'androidNativeValidation',
})
readiness_mode_counts = {
"package-smoke.ps1": (root / "scripts" / "automation" / "package-smoke.ps1").read_text(encoding="utf-8").count("ReadinessOnly"),
@@ -95,7 +126,10 @@ def main() -> int:
"package-smoke.sh": len(expected),
}
debt_complete = {name: count >= debt_thresholds[name] for name, count in debt_counts.items()}
blocked_complete = {name: count >= len(expected) for name, count in blocked_counts.items()}
status_gate_complete = {
"package-smoke.ps1": status_mode_present["package-smoke.ps1"]["blocked"] and status_mode_present["package-smoke.ps1"]["compile-only"],
"package-smoke.sh": status_mode_present["package-smoke.sh"]["blocked"] and status_mode_present["package-smoke.sh"]["compile-only"],
}
readiness_mode_present = {name: count > 0 for name, count in readiness_mode_counts.items()}
retained_android_native_complete = {
name: count >= 3 for name, count in retained_android_native_counts.items()
@@ -112,7 +146,8 @@ def main() -> int:
all(not values for values in missing.values())
and all(not values for values in unexpected.values())
and all(debt_complete.values())
and all(blocked_complete.values())
and all(status_gate_complete.values())
and all(readiness_alignment.values())
and all(readiness_mode_present.values())
and all(retained_android_native_complete.values())
and all(retained_platform_cmake_complete.values())
@@ -130,7 +165,9 @@ def main() -> int:
"missing": missing,
"unexpected": unexpected,
"debtComplete": debt_complete,
"blockedComplete": blocked_complete,
"statusModes": status_modes,
"statusModePresent": status_mode_present,
"readinessAlignment": readiness_alignment,
"readinessModePresent": readiness_mode_present,
"retainedAndroidNativeComplete": retained_android_native_complete,
"retainedPlatformCmakeComplete": retained_platform_cmake_complete,