#!/usr/bin/env python3 """Compiler-independent guard for the 0.31.7 H3 navigation patch.""" from pathlib import Path ROOT = Path(__file__).resolve().parents[2] html = (ROOT / 'src/admin/web/index.html').read_text() assert '0.32.3' in (ROOT / "Cargo.toml").read_text() assert '',1)[0] body = (ROOT / 'src/proxy/cache_helpers.rs').read_text() assert 'let navigation_method = method == Method::GET || method == Method::HEAD;' in body assert body.count('std::time::Duration::from_millis(35)') >= 2 assert 'let bounded_h3_navigation = request.version() == Version::HTTP_3' in body assert 'Body::new(body::ReplayBody::new(frame, tail))' in body assert '|| method == Method::GET' not in body.split('async fn normalize_h3_h1_unknown_body',1)[1].split('// Ignore a small number',1)[0] h3 = (ROOT / 'src/http3.rs').read_text() assert '"http3_peer_cancelled_before_headers"' in h3 assert '"http3_peer_cancelled_after_headers"' in h3 assert '"http3_response_write_error"' in h3 assert 'stream_id={stream_id}' in h3 and 'body_bytes_sent={sent_body_bytes}' in h3 diagnostics = (ROOT / 'src/http3/diagnostics.rs').read_text() assert 'http3_navigation_complete' in diagnostics and 'http3_navigation_started' in diagnostics assert 'Err(error)=>{requests.abort_all();return Err(error.into());}' not in h3 rust_tests = (ROOT / 'src/proxy/tests/h3_navigation_tests.rs').read_text() for marker in ('h3_bodyless_get_and_head_are_normalized_for_http1_navigation', 'h3_get_with_payload_retains_payload_for_http1_upstream', 'h3_stalled_empty_get_does_not_block_navigation', 'h3_stalled_cache_probe_bypasses_without_blocking_navigation', 'h3_cache_probe_replays_nonempty_get_without_dropping_bytes'): assert marker in rust_tests, marker print('PASS: RustProxy 0.31.7 original logo, H3 empty-GET receive lifecycle, bounded probe, per-stream diagnostics and drain invariants')