Refactor Mattermost and Slack integration workflows to remove legacy Fidelity variables, streamline command execution, and enhance documentation for project profiles. Update scripts and README files to reflect changes in directory structure and configuration precedence, ensuring a consistent approach to project knowledge management across profiles. Improve error handling and validation in profile creation and doctor commands, and enhance test coverage for profile-related functionalities.

This commit is contained in:
2026-05-21 14:13:21 -06:00
parent 1ad707373a
commit ad230e1abe
28 changed files with 263 additions and 120 deletions

View File

@@ -48,6 +48,35 @@ class ProfileTests(unittest.TestCase):
self.assertEqual(profile.relative_to_root(root / "a" / "b", root=root), "a/b")
self.assertEqual(profile.relative_to_root(Path("/external/path"), root=root), "/external/path")
def test_create_profile_writes_isolated_layout(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
result = profile.create_profile("demo-project", "Demo Project", root=root)
self.assertEqual(result["knowledge_dir"], "workspaces/demo-project/project-knowledge")
self.assertTrue((root / "profiles" / "demo-project" / "workspace.json").is_file())
self.assertTrue((root / "workspaces" / "demo-project" / "project-knowledge" / "00-start" / "start-here.md").is_file())
self.assertTrue((root / "workspaces" / "demo-project" / "inbox" / "README.md").is_file())
def test_doctor_reports_clean_layout(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
profile.create_profile("demo", root=root)
result = profile.doctor("demo", root=root)
self.assertTrue(result["ok"])
self.assertTrue(result["checks"]["root_project_knowledge_absent"])
def test_doctor_rejects_root_level_project_data_dirs(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
profile.create_profile("demo", root=root)
(root / "project-knowledge").mkdir()
result = profile.doctor("demo", root=root)
self.assertFalse(result["ok"])
self.assertFalse(result["checks"]["root_project_knowledge_absent"])
if __name__ == "__main__":
unittest.main()