from pathlib import Path import unittest APP_DIR = Path(__file__).resolve().parents[1] class AgentInstallContractTest(unittest.TestCase): def read(self, relative): return (APP_DIR / relative).read_text(encoding="utf-8") def test_luci_loads_task_window_and_starts_whitelisted_installer(self): makefile = self.read("Makefile") controller = self.read("luasrc/controller/agentflow.lua") status = self.read("luasrc/view/agentflow/status.htm") self.assertIn("+luci-lib-taskd", makefile) self.assertIn('<%+tasks/embed%>', status) for agent in ("codexcli", "claude-code", "opencode", "kimi", "reasonix"): self.assertIn(f'id="agentflow-agent-{agent}"', status) self.assertIn(f"agentflowAgentDialog(true, '{agent}')", status) self.assertNotIn('