fix(windows99): surface scoped relink receipt readback
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 1m41s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 1m41s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
This commit is contained in:
@@ -133,6 +133,56 @@ def _valid_scoped_relink_dry_run_packet() -> dict:
|
||||
}
|
||||
|
||||
|
||||
def _valid_scoped_relink_dry_run_receipt() -> dict:
|
||||
return {
|
||||
"schema_version": "windows99_vmx_source_scoped_relink_dry_run_receipt_v1",
|
||||
"receipt_ref": (
|
||||
"receipt://awoooi/windows99/windows99-vmx-source-relink-dry-run-111"
|
||||
),
|
||||
"status": "reviewer_validation_passed_no_write",
|
||||
"ready": True,
|
||||
"reviewer_validation_passed": True,
|
||||
"controlled_relink_dry_run_ready": True,
|
||||
"plan_id": "windows99-vmx-source-relink-dry-run-111",
|
||||
"target_host_alias": "99",
|
||||
"target_vm_aliases": ["111"],
|
||||
"target_selector": {
|
||||
"host_alias": "99",
|
||||
"vm_aliases": ["111"],
|
||||
"missing_vmx_aliases": ["111"],
|
||||
"secret_collection_allowed": False,
|
||||
"vm_power_change_allowed": False,
|
||||
"runtime_write_allowed": False,
|
||||
},
|
||||
"source_of_truth_diff": {
|
||||
"expected_vmx_path_present_count": 0,
|
||||
"candidate_source_count": 1,
|
||||
"candidate_source_fingerprint_count": 1,
|
||||
"candidate_identity_evidence_ref": (
|
||||
"console://awoooi/windows99/candidate-identity-redacted-111"
|
||||
),
|
||||
"source_fingerprint_ref": "fingerprint://awoooi/windows99/vmx-source-111",
|
||||
"backup_ref": "backup://awoooi/windows99/pre-relink-redacted-111",
|
||||
"raw_path_output": False,
|
||||
"path_fingerprint_only": True,
|
||||
"bounded_identity_metadata_only": True,
|
||||
},
|
||||
"operation_boundaries": {
|
||||
"request_payload_saved": False,
|
||||
"secret_value_read": False,
|
||||
"raw_path_output": False,
|
||||
"vmx_file_content_read": False,
|
||||
"remote_write_performed": False,
|
||||
"runtime_write_performed": False,
|
||||
"host_reboot_performed": False,
|
||||
"vm_power_change_performed": False,
|
||||
"windows_registry_apply_performed": False,
|
||||
"scheduled_task_write_performed": False,
|
||||
"apply_gate_opened": False,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_windows99_vmx_source_locator_builder_is_no_secret_check_mode() -> None:
|
||||
repair_package = build_windows99_vmx_source_repair_package(
|
||||
_scorecard(),
|
||||
@@ -284,6 +334,74 @@ def test_windows99_vmx_source_locator_builder_projects_redacted_receipt() -> Non
|
||||
assert payload["vm_power_change_performed"] is False
|
||||
|
||||
|
||||
def test_windows99_vmx_source_locator_builder_projects_scoped_relink_receipt() -> None:
|
||||
repair_package = build_windows99_vmx_source_repair_package(
|
||||
_scorecard(),
|
||||
generated_at="2026-07-03T11:21:00+08:00",
|
||||
)
|
||||
|
||||
payload = build_windows99_vmx_source_locator_readback(
|
||||
_scorecard(),
|
||||
repair_package=repair_package,
|
||||
collector_receipt={
|
||||
"schema_version": "windows99_vmx_source_locator_receipt_v1",
|
||||
"collector_readback_present": True,
|
||||
"collector_collection_status": (
|
||||
"collected_windows99_vmx_source_locator_stdout"
|
||||
),
|
||||
"target_host_alias": "99",
|
||||
"target_vm_aliases": ["111"],
|
||||
"expected_vmx_path_present_count": 0,
|
||||
"candidate_source_count": 1,
|
||||
"candidate_source_fingerprint_count": 1,
|
||||
"alias_hint_candidate_count": 0,
|
||||
"identity_metadata_read": True,
|
||||
"bounded_identity_metadata_only": True,
|
||||
"identity_target_hint_count": 0,
|
||||
"identity_unassigned_ubuntu_candidate_count": 1,
|
||||
"locate_status": (
|
||||
"single_identity_unassigned_ubuntu_candidate_requires_confirmation"
|
||||
),
|
||||
},
|
||||
scoped_relink_dry_run_receipt=_valid_scoped_relink_dry_run_receipt(),
|
||||
generated_at="2026-07-10T10:16:00+08:00",
|
||||
)
|
||||
|
||||
assert payload["status"] == "collector_readback_scoped_relink_dry_run_ready"
|
||||
assert payload["safe_next_step"] == (
|
||||
"rerun_no_secret_collector_and_scorecard_no_vm_power_change"
|
||||
)
|
||||
assert payload["controlled_relink_dry_run_ready"] is True
|
||||
assert payload["controlled_relink_dry_run_blocker"] == ""
|
||||
assert payload["controlled_relink_dry_run_receipt_present"] is True
|
||||
assert payload["controlled_relink_dry_run_reviewer_validation_passed"] is True
|
||||
assert payload["controlled_relink_dry_run_validation_status"] == (
|
||||
"reviewer_validation_passed_no_write"
|
||||
)
|
||||
assert payload["verified_source_or_identity_evidence_required"] is False
|
||||
assert payload["candidate_relink_dry_run_ready"] is True
|
||||
assert payload["candidate_identity_evidence_sufficient"] is True
|
||||
plan = payload["controlled_relink_dry_run_plan"]
|
||||
assert plan["ready"] is True
|
||||
assert plan["reviewer_validation_passed"] is True
|
||||
assert plan["receipt_ref"] == (
|
||||
"receipt://awoooi/windows99/windows99-vmx-source-relink-dry-run-111"
|
||||
)
|
||||
assert plan["source_diff"]["source_fingerprint_ref"] == (
|
||||
"fingerprint://awoooi/windows99/vmx-source-111"
|
||||
)
|
||||
assert plan["source_diff"]["backup_ref"] == (
|
||||
"backup://awoooi/windows99/pre-relink-redacted-111"
|
||||
)
|
||||
assert plan["source_diff"]["raw_path_output"] is False
|
||||
assert plan["apply_allowed_by_this_plan"] is False
|
||||
assert plan["remote_write_performed"] is False
|
||||
assert plan["vm_power_change_performed"] is False
|
||||
assert payload["remote_write_performed"] is False
|
||||
assert payload["vm_power_change_performed"] is False
|
||||
assert payload["secret_value_read"] is False
|
||||
|
||||
|
||||
def test_windows99_candidate_confirmation_validator_accepts_redacted_packet() -> None:
|
||||
repair_package = build_windows99_vmx_source_repair_package(
|
||||
_scorecard(),
|
||||
@@ -614,8 +732,9 @@ def test_windows99_vmx_source_locator_endpoint_returns_public_safe_readback(
|
||||
assert response.status_code == 200
|
||||
payload = response.json()
|
||||
assert payload["schema_version"] == "windows99_vmx_source_locator_readback_v1"
|
||||
assert payload["status"] == (
|
||||
"collector_readback_verified_source_required_before_relink_dry_run"
|
||||
assert payload["status"] == "collector_readback_scoped_relink_dry_run_ready"
|
||||
assert payload["safe_next_step"] == (
|
||||
"rerun_no_secret_collector_and_scorecard_no_vm_power_change"
|
||||
)
|
||||
assert payload["target_vm_aliases"] == ["111"]
|
||||
assert payload["locator_check_mode_ready"] is True
|
||||
@@ -628,20 +747,22 @@ def test_windows99_vmx_source_locator_endpoint_returns_public_safe_readback(
|
||||
assert payload["identity_unassigned_ubuntu_candidate_count"] == 1
|
||||
assert payload["candidate_confirmation_required"] is True
|
||||
assert payload["human_confirmation_required_for_dry_run"] is False
|
||||
assert payload["verified_source_or_identity_evidence_required"] is True
|
||||
assert payload["controlled_relink_dry_run_ready"] is False
|
||||
assert payload["controlled_relink_dry_run_blocker"] == (
|
||||
"verified_vmx_source_or_identity_evidence_missing"
|
||||
)
|
||||
assert payload["controlled_relink_dry_run_plan"]["plan_id"] == (
|
||||
"windows99-vmx-source-relink-dry-run-111"
|
||||
)
|
||||
assert payload["controlled_relink_dry_run_plan"]["remote_write_performed"] is False
|
||||
assert payload["verified_source_or_identity_evidence_required"] is False
|
||||
assert payload["controlled_relink_dry_run_ready"] is True
|
||||
assert payload["controlled_relink_dry_run_blocker"] == ""
|
||||
assert payload["controlled_relink_dry_run_receipt_present"] is True
|
||||
assert payload["controlled_relink_dry_run_reviewer_validation_passed"] is True
|
||||
plan = payload["controlled_relink_dry_run_plan"]
|
||||
assert plan["plan_id"] == "windows99-vmx-source-relink-dry-run-111"
|
||||
assert plan["ready"] is True
|
||||
assert plan["reviewer_validation_passed"] is True
|
||||
assert plan["remote_write_performed"] is False
|
||||
assert plan["vm_power_change_performed"] is False
|
||||
assert payload["candidate_confirmation_status"] == (
|
||||
"blocked_single_unassigned_ubuntu_candidate_identity_not_confirmed"
|
||||
)
|
||||
assert payload["candidate_identity_evidence_sufficient"] is False
|
||||
assert payload["candidate_relink_dry_run_ready"] is False
|
||||
assert payload["candidate_identity_evidence_sufficient"] is True
|
||||
assert payload["candidate_relink_dry_run_ready"] is True
|
||||
assert payload["apply_allowed_by_candidate_confirmation_gate"] is False
|
||||
assert payload["public_lan_topology_redacted"] is True
|
||||
assert payload["raw_path_output"] is False
|
||||
|
||||
Reference in New Issue
Block a user