🐛 fix(playbook): address reported repo issues

normalize Windows path-like TOML config values, regenerate .agents/index.md on sync, keep the SKILLS.md superpowers section route-only, and ignore generated Python cache dirs.

add regression coverage for load_config() and the standards sync behavior touched by these fixes.
This commit is contained in:
csh
2026-03-10 10:10:28 +08:00
parent c3f81371e2
commit 94395056ea
7 changed files with 155 additions and 101 deletions
+40
View File
@@ -1,4 +1,6 @@
import tempfile
import unittest
from pathlib import Path
from scripts import playbook
@@ -18,6 +20,44 @@ key = 1
with self.assertRaises(ValueError):
playbook.loads_toml_minimal(raw)
def test_load_config_preserves_windows_users_path_in_basic_string(self):
with tempfile.TemporaryDirectory() as tmp_dir:
config_path = Path(tmp_dir) / "playbook.toml"
config_path.write_text(
'[playbook]\nproject_root = "C:\\Users\\demo\\workspace"\n',
encoding="utf-8",
)
data = playbook.load_config(config_path)
self.assertEqual(data["playbook"]["project_root"], r"C:\Users\demo\workspace")
def test_load_config_preserves_windows_escape_like_segments_for_path_keys(self):
with tempfile.TemporaryDirectory() as tmp_dir:
config_path = Path(tmp_dir) / "playbook.toml"
config_path.write_text(
'[playbook]\nproject_root = "C:\\tmp\\notes"\n\n'
'[install_skills]\nagents_home = "D:\\new\\tab"\n',
encoding="utf-8",
)
data = playbook.load_config(config_path)
self.assertEqual(data["playbook"]["project_root"], r"C:\tmp\notes")
self.assertEqual(data["install_skills"]["agents_home"], r"D:\new\tab")
def test_load_config_keeps_already_escaped_windows_path(self):
with tempfile.TemporaryDirectory() as tmp_dir:
config_path = Path(tmp_dir) / "playbook.toml"
config_path.write_text(
'[playbook]\nproject_root = "C:\\\\Users\\\\demo\\\\workspace"\n',
encoding="utf-8",
)
data = playbook.load_config(config_path)
self.assertEqual(data["playbook"]["project_root"], r"C:\Users\demo\workspace")
if __name__ == "__main__":
unittest.main()