feat(skill-learning): merge plugin skill updates
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from beaver.skills.learning.preservation import check_preservation
|
||||
from beaver.skills.learning.preservation import check_plugin_merge_preservation, check_preservation
|
||||
|
||||
|
||||
def test_preservation_passes_when_base_sections_remain() -> None:
|
||||
@ -25,3 +25,29 @@ def test_preservation_flags_dropped_section() -> None:
|
||||
assert report["passed"] is False
|
||||
assert report["risk_level"] == "high"
|
||||
assert "Safety" in report["dropped_sections"]
|
||||
|
||||
|
||||
def test_plugin_merge_preservation_checks_local_and_upstream_and_conflicts() -> None:
|
||||
report = check_plugin_merge_preservation(
|
||||
local_content="# Local\n\n## Review\n\nKeep review.\n",
|
||||
upstream_content="# Upstream\n\n## Safety\n\nDo not leak secrets.\n",
|
||||
draft_content="# Draft\n\n## Review\n\nKeep review.\n\n## Safety\n\nDo not leak secrets.\n",
|
||||
merge_decisions={"resolved_conflicts": ["ordering"], "unresolved_conflicts": []},
|
||||
)
|
||||
|
||||
assert report["mode"] == "plugin_three_way"
|
||||
assert report["passed"] is True
|
||||
assert report["local"]["passed"] is True
|
||||
assert report["upstream"]["passed"] is True
|
||||
|
||||
|
||||
def test_plugin_merge_preservation_fails_unresolved_conflicts() -> None:
|
||||
report = check_plugin_merge_preservation(
|
||||
local_content="# Local\n\n## Review\n\nKeep review.\n",
|
||||
upstream_content="# Upstream\n\n## Safety\n\nDo not leak secrets.\n",
|
||||
draft_content="# Draft\n\n## Review\n\nKeep review.\n",
|
||||
merge_decisions={"unresolved_conflicts": ["Safety conflict"]},
|
||||
)
|
||||
|
||||
assert report["passed"] is False
|
||||
assert report["unresolved_conflicts"] == ["Safety conflict"]
|
||||
|
||||
Reference in New Issue
Block a user