0.3.5-alpha.8
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# file: scripts/audit_distribution_layout.py
|
||||
# version: 21
|
||||
# version: 22
|
||||
|
||||
"""Audit the static distribution layout expected by supported POCs."""
|
||||
|
||||
@@ -24,6 +24,9 @@ FORBIDDEN_PATHS = (
|
||||
|
||||
|
||||
REQUIRED_PATHS = (
|
||||
"crates/apps/game-realtime-transport-fallback-smoke/Cargo.toml",
|
||||
"crates/apps/game-realtime-transport-fallback-smoke/src/main.rs",
|
||||
"crates/apps/game-realtime-transport-fallback-smoke/unit_tests/fallback.rs",
|
||||
"crates/apps/game-realtime-websocket-smoke/Cargo.toml",
|
||||
"crates/apps/game-realtime-webtransport-browser-smoke/Cargo.toml",
|
||||
"crates/apps/game-realtime-webtransport-browser-smoke/src/lib.rs",
|
||||
@@ -356,6 +359,39 @@ def audit_webtransport_browser_smoke(root: pathlib.Path) -> list[str]:
|
||||
violations.append(message)
|
||||
return violations
|
||||
|
||||
|
||||
def audit_realtime_fallback_smoke(root: pathlib.Path) -> list[str]:
|
||||
"""Validate the technical WebTransport-first/WebSocket fallback composition boundary."""
|
||||
|
||||
violations: list[str] = []
|
||||
manifest_path = root / "crates/apps/game-realtime-transport-fallback-smoke/Cargo.toml"
|
||||
main_path = root / "crates/apps/game-realtime-transport-fallback-smoke/src/main.rs"
|
||||
unit_path = root / "crates/apps/game-realtime-transport-fallback-smoke/unit_tests/fallback.rs"
|
||||
if not manifest_path.exists() or not main_path.exists() or not unit_path.exists():
|
||||
return violations
|
||||
manifest = manifest_path.read_text(encoding="utf-8")
|
||||
main = main_path.read_text(encoding="utf-8")
|
||||
unit = unit_path.read_text(encoding="utf-8")
|
||||
required_fragments = (
|
||||
(manifest, 'game-realtime-websocket-lib = { path = "../../common/game-realtime-websocket-lib" }', "DIST-LAYOUT-087: fallback smoke must consume the WebSocket backend directly at composition level"),
|
||||
(manifest, 'game-realtime-webtransport-lib = { path = "../../common/game-realtime-webtransport-lib" }', "DIST-LAYOUT-088: fallback smoke must consume the WebTransport backend directly at composition level"),
|
||||
(main, 'kind == game_realtime_transport_lib::TransportErrorKind::Timeout || kind == game_realtime_transport_lib::TransportErrorKind::Io', "DIST-LAYOUT-089: fallback smoke classification must remain limited to Timeout/Io"),
|
||||
(unit, 'assert!(!super::is_fallback_eligible(game_realtime_transport_lib::TransportErrorKind::Connect));', "DIST-LAYOUT-090: ambiguous WebTransport Connect failures must not trigger fallback"),
|
||||
(main, 'game-realtime-transport-fallback-smoke: PASS', "DIST-LAYOUT-091: fallback smoke must expose a deterministic PASS verdict"),
|
||||
)
|
||||
for content, fragment, message in required_fragments:
|
||||
if fragment not in content:
|
||||
violations.append(message)
|
||||
forbidden_fragments = (
|
||||
"engine-v1-",
|
||||
"game-reflex-poc",
|
||||
"game-snake-poc",
|
||||
)
|
||||
for fragment in forbidden_fragments:
|
||||
if fragment in manifest:
|
||||
violations.append(f"DIST-LAYOUT-092: fallback smoke must not depend on engine/gameplay package: {fragment}")
|
||||
return violations
|
||||
|
||||
def audit_android_native_gradle(root: pathlib.Path) -> list[str]:
|
||||
"""Validate the minimum Gradle contract and multi-ABI native Rust consumers."""
|
||||
|
||||
@@ -446,6 +482,7 @@ def main() -> int:
|
||||
contract_violations.extend(audit_snake_tauri_android_integration(root))
|
||||
contract_violations.extend(audit_snake_tauri_generated_android(root))
|
||||
contract_violations.extend(audit_android_native_gradle(root))
|
||||
contract_violations.extend(audit_realtime_fallback_smoke(root))
|
||||
contract_violations.extend(audit_webtransport_browser_smoke(root))
|
||||
if missing:
|
||||
for relative in missing:
|
||||
|
||||
Reference in New Issue
Block a user