@@ -481,6 +481,95 @@ def test_structured_external_network_requests_remain_fail_closed(
481481 assert receipt ["evidence_counts" ]["external_network_request" ] == 1
482482
483483
484+ @pytest .mark .parametrize (
485+ "command" ,
486+ [
487+ "git clone git@github.com:owner/repo.git" ,
488+ "git clone ssh://git@github.com/owner/repo.git" ,
489+ "git clone git://github.com/owner/repo.git" ,
490+ ],
491+ )
492+ def test_non_http_git_clone_requests_remain_fail_closed (command : str ) -> None :
493+ receipt = build_benchmark_integrity_qualification (
494+ trajectory = _trajectory (command = command ),
495+ runtime_attestation = _attestation (),
496+ )
497+
498+ assert receipt ["integrity_qualified" ] is False
499+ assert receipt ["classification" ] == "integrity_policy_violation"
500+ assert receipt ["evidence_counts" ]["external_network_request" ] == 1
501+
502+
503+ def test_structured_non_http_git_clone_request_remains_fail_closed () -> None :
504+ receipt = build_benchmark_integrity_qualification (
505+ trajectory = _trajectory (
506+ arguments = {"argv" : ["git" , "clone" , "git@github.com:owner/repo.git" ]}
507+ ),
508+ runtime_attestation = _attestation (),
509+ )
510+
511+ assert receipt ["integrity_qualified" ] is False
512+ assert receipt ["classification" ] == "integrity_policy_violation"
513+ assert receipt ["evidence_counts" ]["external_network_request" ] == 1
514+
515+
516+ def test_local_git_clone_path_is_not_network_access () -> None :
517+ receipt = build_benchmark_integrity_qualification (
518+ trajectory = _trajectory (command = "git clone ../fixture-repo worktree" ),
519+ runtime_attestation = _attestation (),
520+ )
521+
522+ assert receipt ["integrity_qualified" ] is True
523+ assert receipt ["evidence_counts" ]["external_network_request" ] == 0
524+
525+
526+ def test_http_git_clone_remains_external_network_access () -> None :
527+ receipt = build_benchmark_integrity_qualification (
528+ trajectory = _trajectory (command = "git clone https://github.com/owner/repo.git" ),
529+ runtime_attestation = _attestation (),
530+ )
531+
532+ assert receipt ["integrity_qualified" ] is False
533+ assert receipt ["classification" ] == "integrity_policy_violation"
534+ assert receipt ["evidence_counts" ]["external_network_request" ] == 1
535+
536+
537+ @pytest .mark .parametrize (
538+ "command" ,
539+ [
540+ "git clone -b main --depth 1 git@github.com:owner/repo.git" ,
541+ "git clone git+ssh://git@github.com/owner/repo.git" ,
542+ ],
543+ )
544+ def test_non_http_git_clone_variants_remain_fail_closed (command : str ) -> None :
545+ receipt = build_benchmark_integrity_qualification (
546+ trajectory = _trajectory (command = command ),
547+ runtime_attestation = _attestation (),
548+ )
549+
550+ assert receipt ["integrity_qualified" ] is False
551+ assert receipt ["classification" ] == "integrity_policy_violation"
552+ assert receipt ["evidence_counts" ]["external_network_request" ] == 1
553+
554+
555+ @pytest .mark .parametrize (
556+ "command" ,
557+ [
558+ "git clone /abs/path/repo.git" ,
559+ "git clone file:///abs/path/repo.git" ,
560+ "git clone /tmp/cache@2/repo.git" ,
561+ ],
562+ )
563+ def test_local_git_clone_paths_are_not_external_network_access (command : str ) -> None :
564+ receipt = build_benchmark_integrity_qualification (
565+ trajectory = _trajectory (command = command ),
566+ runtime_attestation = _attestation (),
567+ )
568+
569+ assert receipt ["integrity_qualified" ] is True
570+ assert receipt ["evidence_counts" ]["external_network_request" ] == 0
571+
572+
484573def test_structured_loopback_argv_uses_explicit_loopback_scope () -> None :
485574 receipt = build_benchmark_integrity_qualification (
486575 trajectory = _trajectory (
0 commit comments