新增 PChome controlled apply artifact retention
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
@@ -76,6 +76,7 @@ from services.pchome_mapping_backlog_service import (
|
||||
build_pchome_direct_mapping_candidate_exception_resolution_closeout_package,
|
||||
build_pchome_direct_mapping_retry_candidate_decision_package,
|
||||
build_pchome_direct_mapping_retry_candidate_exception_auto_resolution_package,
|
||||
build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_artifact_retention_package,
|
||||
build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_compact_readback_package,
|
||||
build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_drift_recovery_package,
|
||||
build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_drift_verifier_package,
|
||||
@@ -1528,6 +1529,40 @@ def test_direct_mapping_retry_candidate_exception_controlled_apply_receipt_repla
|
||||
assert drift_compact["summary"]["compact_readback_artifact_materialized_count"] == 1
|
||||
assert drift_compact["post_compact_artifact_verifier"]["hash_match"] is True
|
||||
assert drift_compact["safety"]["writes_database"] is False
|
||||
retention = build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_artifact_retention_package(
|
||||
artifact_root=tmp_path,
|
||||
run_id=run_id,
|
||||
engine=engine,
|
||||
source_compact_readback=drift_compact,
|
||||
keep_latest_per_family=1,
|
||||
materialize_artifacts=True,
|
||||
)
|
||||
assert retention["result"] == "DIRECT_MAPPING_RETRY_EXCEPTION_CONTROLLED_APPLY_ARTIFACT_RETENTION_POLICY_READY"
|
||||
assert retention["summary"]["retention_family_count"] == 8
|
||||
assert retention["summary"]["artifact_count"] >= 8
|
||||
assert retention["summary"]["retained_artifact_count"] > 0
|
||||
assert retention["summary"]["prune_candidate_count"] >= 1
|
||||
assert retention["summary"]["artifact_count"] == (
|
||||
retention["summary"]["retained_artifact_count"]
|
||||
+ retention["summary"]["prune_candidate_count"]
|
||||
)
|
||||
assert retention["summary"]["retention_prune_executes_count"] == 0
|
||||
assert retention["summary"]["retention_artifact_materialized_count"] == 1
|
||||
assert retention["summary"]["retention_artifact_hash_match_count"] == 1
|
||||
assert retention["post_retention_artifact_verifier"]["hash_match"] is True
|
||||
assert retention["safety"]["deletes_artifacts"] is False
|
||||
assert retention["safety"]["retention_prune_executes"] is False
|
||||
assert retention["safety"]["writes_database"] is False
|
||||
protected_paths = set(retention["protected_active_chain_paths"])
|
||||
assert drift_compact["compact_artifact"]["relative_path"] in protected_paths
|
||||
prune_candidates = [
|
||||
artifact
|
||||
for family in retention["family_reports"]
|
||||
for artifact in family["artifacts"]
|
||||
if artifact["retention_decision"] == "candidate_for_retention_prune"
|
||||
]
|
||||
assert prune_candidates
|
||||
assert all(candidate["delete_in_package"] is False for candidate in prune_candidates)
|
||||
assert call_count["search"] == 2
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user