feat: 完善策略优选项目工作流
This commit is contained in:
1 parent
a26fd32eba
commit
5d6627af50
45 files changed
+7235
-768
No files matched your search
@@ -131,6 +131,34 @@ def test_seed_creates_once_and_never_overwrites_admin_changes(tmp_paths: Paths)
|
||||
assert customized_soul.read_text(encoding="utf-8") == "管理员现场修改"
|
||||
|
||||
|
||||
def test_seed_upgrades_only_an_exact_known_legacy_default(
|
||||
tmp_paths: Paths,
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
assert seed.ensure_strategy_selection_agents()
|
||||
intent_soul = tmp_paths.agent_dir(seed.STRATEGY_INTENT_AGENT_ID) / "SOUL.md"
|
||||
legacy_content = b"legacy bundled intent soul\r\n"
|
||||
intent_soul.write_bytes(legacy_content)
|
||||
monkeypatch.setitem(
|
||||
seed._LEGACY_DEFAULT_SOUL_HASHES,
|
||||
seed.STRATEGY_INTENT_AGENT_ID,
|
||||
seed._normalized_text_hash(legacy_content),
|
||||
)
|
||||
|
||||
assert seed.ensure_strategy_selection_agents() == []
|
||||
assert (
|
||||
intent_soul.read_bytes()
|
||||
== _asset(
|
||||
seed.STRATEGY_INTENT_AGENT_ID,
|
||||
"SOUL.md",
|
||||
).read_bytes()
|
||||
)
|
||||
|
||||
intent_soul.write_text("管理员现场修改", encoding="utf-8")
|
||||
assert seed.ensure_strategy_selection_agents() == []
|
||||
assert intent_soul.read_text(encoding="utf-8") == "管理员现场修改"
|
||||
|
||||
|
||||
class _SkillStorage:
|
||||
def __init__(self, skills: list[Skill]) -> None:
|
||||
self._skills = skills
|
||||
|
||||
Reference in new issue
Block a user