feat(skill): add immutable package registry and receipts

This commit is contained in:
Jesse_Chen
2026-08-14 16:37:53 +08:00
parent 0fd111d16b
commit c1f1819de1
1191 changed files with 462035 additions and 124 deletions
+23
View File
@@ -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,