feat: update
This commit is contained in:
@@ -612,7 +612,7 @@ class AckKnowledgeTests(unittest.TestCase):
|
||||
)
|
||||
self.assertFalse(any("knowledgeFile" in error for error in errors))
|
||||
|
||||
def test_cli_fails_closed_for_missing_repo_root_and_wrong_binding(self) -> None:
|
||||
def test_cli_uses_tasks_layout_instead_of_stale_repo_path(self) -> None:
|
||||
data = example_data()
|
||||
task = {
|
||||
"id": "BUG-002",
|
||||
@@ -683,7 +683,7 @@ class AckKnowledgeTests(unittest.TestCase):
|
||||
)
|
||||
|
||||
self.assertEqual(inferred.returncode, 1)
|
||||
self.assertIn("project.repoPath", inferred.stderr)
|
||||
self.assertNotIn("project.repoPath", inferred.stderr)
|
||||
self.assertIn("与当前知识文件", inferred.stderr)
|
||||
self.assertIn("symlink", inferred.stderr)
|
||||
self.assertEqual(explicit.returncode, 1)
|
||||
|
||||
@@ -65,12 +65,20 @@ def orchestration() -> dict:
|
||||
|
||||
def board(project_root: Path) -> dict:
|
||||
return {
|
||||
"version": 1,
|
||||
"project": {
|
||||
"name": "test-project",
|
||||
"repoPath": str(project_root),
|
||||
"orchestration": orchestration(),
|
||||
},
|
||||
"workerReceipts": [],
|
||||
"tasks": [{"id": "TASK-001"}],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "TASK-001",
|
||||
"title": "test task",
|
||||
"status": "open",
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +98,8 @@ def worktree_identity(path: Path) -> dict:
|
||||
|
||||
def plan_for(path: Path, executable: Path) -> dict:
|
||||
profile = orchestration()["profiles"]["codex-dev-standard"]
|
||||
task_board = board(path)
|
||||
board_hash = worker_profiles.canonical_sha256(task_board)
|
||||
identity = worktree_identity(path)
|
||||
executable_metadata = executable.stat()
|
||||
argv = worker_profiles.render_worker_argv(
|
||||
@@ -121,6 +131,8 @@ def plan_for(path: Path, executable: Path) -> dict:
|
||||
{
|
||||
"protocolVersion": 1,
|
||||
"backend": "orca",
|
||||
"projectRoot": str(path),
|
||||
"boardHash": board_hash,
|
||||
"profileId": "codex-dev-standard",
|
||||
"profileHash": profile_digest,
|
||||
"createdFor": created_for,
|
||||
@@ -134,6 +146,7 @@ def plan_for(path: Path, executable: Path) -> dict:
|
||||
"protocolVersion": 1,
|
||||
"backend": "orca",
|
||||
"projectRoot": str(path),
|
||||
"boardHash": board_hash,
|
||||
"taskId": "TASK-001",
|
||||
"attemptId": "TASK-001-A1",
|
||||
"role": "developer",
|
||||
@@ -362,6 +375,44 @@ class EnvironmentAndExecutableTests(unittest.TestCase):
|
||||
|
||||
|
||||
class PlanTests(unittest.TestCase):
|
||||
def test_authoritative_board_is_derived_from_project_root_without_repo_path(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
project = Path(temporary).resolve()
|
||||
ack_dir = project / "docs" / "ack"
|
||||
ack_dir.mkdir(parents=True)
|
||||
task_board = board(project)
|
||||
del task_board["project"]["repoPath"]
|
||||
(ack_dir / "tasks.yaml").write_text(
|
||||
json.dumps(task_board),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
loaded_root, loaded_board = launch_worker.load_authoritative_board(
|
||||
str(project)
|
||||
)
|
||||
|
||||
self.assertEqual(loaded_root, project)
|
||||
self.assertEqual(loaded_board, task_board)
|
||||
|
||||
def test_authoritative_board_ignores_legacy_repo_path(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
project = Path(temporary).resolve()
|
||||
ack_dir = project / "docs" / "ack"
|
||||
ack_dir.mkdir(parents=True)
|
||||
task_board = board(project)
|
||||
task_board["project"]["repoPath"] = "/legacy/other-worktree"
|
||||
(ack_dir / "tasks.yaml").write_text(
|
||||
json.dumps(task_board),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
loaded_root, loaded_board = launch_worker.load_authoritative_board(
|
||||
str(project)
|
||||
)
|
||||
|
||||
self.assertEqual(loaded_root, project)
|
||||
self.assertEqual(loaded_board, task_board)
|
||||
|
||||
def test_plan_uses_exact_renderer_and_binds_created_for(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
project = Path(temporary).resolve()
|
||||
@@ -410,6 +461,8 @@ class PlanTests(unittest.TestCase):
|
||||
{
|
||||
"protocolVersion": 1,
|
||||
"backend": "orca",
|
||||
"projectRoot": str(project),
|
||||
"boardHash": worker_profiles.canonical_sha256(task_board),
|
||||
"profileId": plan["profileId"],
|
||||
"profileHash": plan["profileHash"],
|
||||
"createdFor": {
|
||||
|
||||
+11
-1
@@ -67,7 +67,7 @@ class AckSkillContentTests(unittest.TestCase):
|
||||
):
|
||||
self.assertTrue((ack_dir / relative_path).is_file(), relative_path)
|
||||
version = (ack_dir / "VERSION").read_text(encoding="utf-8").strip()
|
||||
self.assertEqual(version, "0.14.0")
|
||||
self.assertEqual(version, "0.14.1")
|
||||
self.assertIn(
|
||||
f'ackVersion: "{version}"',
|
||||
(ack_dir / "examples" / "tasks.example.yaml").read_text(encoding="utf-8"),
|
||||
@@ -84,6 +84,16 @@ class AckSkillContentTests(unittest.TestCase):
|
||||
)
|
||||
self.assertTrue((ack_dir / "references" / "feishu-bug-intake.md").is_file())
|
||||
|
||||
def test_task_template_derives_project_files_without_persisted_root_paths(self) -> None:
|
||||
template = (
|
||||
REPO_ROOT / "skills" / "ack" / "templates" / "tasks.template.yaml"
|
||||
).read_text(encoding="utf-8")
|
||||
|
||||
self.assertNotIn("repoPath:", template)
|
||||
self.assertNotIn("devWorktree:", template)
|
||||
self.assertIn("allowedWorktrees:", template)
|
||||
self.assertIn('knowledgeFile: "docs/ack/knowledge.yaml"', template)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user