chore(release): harden premium skill packaging
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import zipfile
|
||||
|
||||
from scripts.skill_release_package import build_package_plan, write_zip
|
||||
@@ -17,6 +18,13 @@ def test_skill_release_package_dry_run_uses_safe_tracked_files() -> None:
|
||||
assert ".env.local" not in plan["files"]
|
||||
assert not any(path.startswith("scratch/") for path in plan["files"])
|
||||
assert not any("private" in path.lower() for path in plan["files"])
|
||||
assert "RELEASE_MANIFEST.json" in plan["generated_files"]
|
||||
assert "PACKAGE_ACCEPTANCE.json" in plan["generated_files"]
|
||||
assert plan["required_contracts"]["references/real_case_calibration/replay_manifest.json"] is True
|
||||
assert plan["required_contracts"]["references/oracle/three_engine_parity_replay_manifest.json"] is True
|
||||
assert "references/real_case_calibration/replay_manifest.json" in plan["files"]
|
||||
assert "references/oracle/three_engine_parity_replay_manifest.json" in plan["files"]
|
||||
assert "references/oracle/western_oracle_adapter_contract.md" in plan["files"]
|
||||
|
||||
|
||||
def test_skill_release_package_can_write_zip(tmp_path) -> None:
|
||||
@@ -31,10 +39,20 @@ def test_skill_release_package_can_write_zip(tmp_path) -> None:
|
||||
assert "scripts/skill_release_manifest.py" in names
|
||||
assert "INSTALL.md" in names
|
||||
assert "USER_PROMPTS.md" in names
|
||||
assert "RELEASE_MANIFEST.json" in names
|
||||
assert "PACKAGE_ACCEPTANCE.json" in names
|
||||
assert "references/real_case_calibration/replay_manifest.json" in names
|
||||
assert "references/oracle/three_engine_parity_replay_manifest.json" in names
|
||||
assert "references/oracle/western_oracle_adapter_contract.md" in names
|
||||
assert ".env.local" not in names
|
||||
with zipfile.ZipFile(target) as archive:
|
||||
install = archive.read("INSTALL.md").decode("utf-8")
|
||||
prompts = archive.read("USER_PROMPTS.md").decode("utf-8")
|
||||
acceptance = json.loads(archive.read("PACKAGE_ACCEPTANCE.json").decode("utf-8"))
|
||||
assert "python3 scripts/user_invocation_acceptance_check.py" in install
|
||||
assert "https://github.com/732642856/yinduzhanxing" in install
|
||||
assert "guided_topics" in prompts
|
||||
assert "official_blocked" in prompts
|
||||
assert "western_oracle_payload" in prompts
|
||||
assert acceptance["status"] in {"pass", "blocked"}
|
||||
assert acceptance["required_contracts"]["references/oracle/three_engine_parity_replay_manifest.json"] is True
|
||||
|
||||
Reference in New Issue
Block a user