feat(skill): add immutable package registry and receipts
This commit is contained in:
@@ -52,6 +52,27 @@ def test_canonical_hash_is_cross_language_stable(fixture: dict) -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_report_document_v1_keeps_legacy_skill_identity_compatibility(fixture: dict) -> None:
|
||||
assert "skillName" not in fixture["provenance"]
|
||||
assert "skillVersion" not in fixture["provenance"]
|
||||
assert validate_report_document(fixture).valid
|
||||
|
||||
|
||||
def test_optional_skill_identity_accepts_registry_values_and_rejects_malformed_values(fixture: dict) -> None:
|
||||
current = json.loads(json.dumps(fixture))
|
||||
current["provenance"]["skillName"] = "jyotish-vedic-astrology"
|
||||
current["provenance"]["skillVersion"] = "6.9.14"
|
||||
assert validate_report_document(current).valid
|
||||
|
||||
bad_name = json.loads(json.dumps(fixture))
|
||||
bad_name["provenance"]["skillName"] = "Bad Package"
|
||||
assert validate_report_document(bad_name).valid is False
|
||||
|
||||
bad_version = json.loads(json.dumps(fixture))
|
||||
bad_version["provenance"]["skillVersion"] = "v6"
|
||||
assert validate_report_document(bad_version).valid is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"malformed",
|
||||
[
|
||||
@@ -260,6 +281,8 @@ def test_validator_accepts_synthetic_producer_output() -> None:
|
||||
"birthPlaceLabel": "合成地点",
|
||||
},
|
||||
"provenance": {
|
||||
"skillName": "jyotish-vedic-astrology",
|
||||
"skillVersion": "6.9.14",
|
||||
"skillSourceCommit": None,
|
||||
"skillSnapshotSha256": "c" * 64,
|
||||
"calculationHash": "d" * 64,
|
||||
|
||||
Reference in New Issue
Block a user