feat(github): classify missing private backup targets
This commit is contained in:
@@ -25,6 +25,13 @@ def test_load_github_target_private_backup_evidence_gate_from_committed_snapshot
|
||||
assert snapshot["summary"]["github_connector_readback_count"] == 9
|
||||
assert snapshot["summary"]["github_connector_private_visibility_count"] == 4
|
||||
assert snapshot["summary"]["github_connector_not_found_or_inaccessible_count"] == 5
|
||||
assert snapshot["summary"]["github_missing_target_resolution_count"] == 5
|
||||
assert snapshot["summary"]["github_missing_target_gitea_source_candidate_count"] == 3
|
||||
assert snapshot["summary"]["github_missing_target_internal_remote_source_candidate_count"] == 2
|
||||
assert snapshot["summary"]["github_missing_target_local_worktree_candidate_count"] == 5
|
||||
assert snapshot["summary"]["github_missing_target_canonical_source_ambiguous_count"] == 5
|
||||
assert snapshot["summary"]["github_missing_target_create_private_repo_ready_count"] == 0
|
||||
assert snapshot["summary"]["github_missing_target_refs_sync_ready_count"] == 0
|
||||
assert snapshot["summary"]["private_backup_verified_count"] == 4
|
||||
assert snapshot["summary"]["private_visibility_verified_count"] == 4
|
||||
assert snapshot["summary"]["blocked_target_count"] == 9
|
||||
@@ -48,7 +55,17 @@ def test_load_github_target_private_backup_evidence_gate_from_committed_snapshot
|
||||
assert targets["owenhytsai/ewoooc"]["visibility_evidence_status"] == (
|
||||
"blocked_private_or_absent_not_verified"
|
||||
)
|
||||
assert targets["owenhytsai/ewoooc"]["missing_target_source_resolution_status"] == (
|
||||
"blocked_canonical_source_ambiguous"
|
||||
)
|
||||
assert targets["owenhytsai/ewoooc"]["missing_target_gitea_repo"] == "wooo/ewoooc"
|
||||
assert targets["owenhytsai/ewoooc"]["missing_target_create_private_repo_ready"] is False
|
||||
assert targets["owenhytsai/ewoooc"]["missing_target_refs_sync_ready"] is False
|
||||
assert targets["owenhytsai/ewoooc"]["private_backup_verified"] is False
|
||||
assert targets["owenhytsai/VibeWork"]["missing_target_source_resolution_status"] == (
|
||||
"blocked_product_boundary_and_local_divergence"
|
||||
)
|
||||
assert targets["owenhytsai/VibeWork"]["missing_target_gitea_repo"] == "wooo/vibework"
|
||||
assert targets["nexu-io/open-design"]["visibility_evidence_status"] == (
|
||||
"external_scope_not_backup_target"
|
||||
)
|
||||
@@ -76,6 +93,17 @@ def test_github_target_private_backup_gate_requires_decision_rollup_consistency(
|
||||
load_latest_github_target_private_backup_evidence_gate(tmp_path)
|
||||
|
||||
|
||||
def test_github_target_private_backup_gate_rejects_missing_source_write_flags(tmp_path):
|
||||
_copy_security_snapshots(tmp_path)
|
||||
readiness_path = tmp_path / "github-target-missing-source-readiness.snapshot.json"
|
||||
readiness = json.loads(readiness_path.read_text(encoding="utf-8"))
|
||||
readiness["summary"]["repo_creation_performed"] = True
|
||||
readiness_path.write_text(json.dumps(readiness), encoding="utf-8")
|
||||
|
||||
with pytest.raises(ValueError, match="missing source readiness must remain read-only"):
|
||||
load_latest_github_target_private_backup_evidence_gate(tmp_path)
|
||||
|
||||
|
||||
def _copy_security_snapshots(tmp_path: Path) -> None:
|
||||
source_dir = default_security_dir(Path(__file__))
|
||||
for filename in (
|
||||
@@ -84,5 +112,6 @@ def _copy_security_snapshots(tmp_path: Path) -> None:
|
||||
"github-target-repo-approval-package.snapshot.json",
|
||||
"github-target-probe.snapshot.json",
|
||||
"github-target-connector-readback.snapshot.json",
|
||||
"github-target-missing-source-readiness.snapshot.json",
|
||||
):
|
||||
shutil.copy(source_dir / filename, tmp_path / filename)
|
||||
|
||||
@@ -21,6 +21,10 @@ def test_github_target_private_backup_evidence_gate_endpoint_returns_read_only_g
|
||||
assert data["summary"]["github_connector_readback_count"] == 9
|
||||
assert data["summary"]["github_connector_private_visibility_count"] == 4
|
||||
assert data["summary"]["github_connector_not_found_or_inaccessible_count"] == 5
|
||||
assert data["summary"]["github_missing_target_resolution_count"] == 5
|
||||
assert data["summary"]["github_missing_target_gitea_source_candidate_count"] == 3
|
||||
assert data["summary"]["github_missing_target_create_private_repo_ready_count"] == 0
|
||||
assert data["summary"]["github_missing_target_refs_sync_ready_count"] == 0
|
||||
assert data["summary"]["private_backup_verified_count"] == 4
|
||||
assert data["summary"]["private_visibility_verified_count"] == 4
|
||||
assert data["summary"]["blocked_target_count"] == 9
|
||||
|
||||
Reference in New Issue
Block a user