test(ack): align allowedWorktrees deprecation tests with v0.19 contract
e4d4319 deprecated the allowedWorktrees whitelist (git worktree registry +
same common-dir checks replace it) but left 4 tests asserting the old
contract:
- test_ack_skill: template must NOT contain allowedWorktrees: anymore,
only the deprecation comment
- test_ack_worker_profiles: legacy allowlist field is tolerated (no
'requires at least one path'); receipt no longer validated against it
- test_ack_launch_worker: capture_worktree_identity dropped the
allowlist arg; assert registered-worktree pass, symlink impostor and
unregistered-rejection under the new signature
This commit is contained in:
@@ -388,7 +388,7 @@ class ProfileValidationTests(unittest.TestCase):
|
||||
worker_profiles.validate_worker_receipt(receipt, orchestration=[])
|
||||
)
|
||||
|
||||
def test_orca_requires_defaults_profiles_and_allowed_worktree(self) -> None:
|
||||
def test_orca_requires_defaults_and_profiles_and_tolerates_legacy_allowlist(self) -> None:
|
||||
routing = valid_orchestration()
|
||||
routing["allowedWorktrees"] = []
|
||||
routing["profiles"] = {}
|
||||
@@ -396,7 +396,10 @@ class ProfileValidationTests(unittest.TestCase):
|
||||
|
||||
errors = worker_profiles.validate_orchestration(routing)
|
||||
|
||||
self.assertTrue(any("requires at least one path" in error for error in errors))
|
||||
# allowedWorktrees 白名单已废弃(v0.19):遗留字段容忍,不再校验
|
||||
self.assertTrue(
|
||||
all("requires at least one path" not in error for error in errors)
|
||||
)
|
||||
self.assertTrue(any("Orca mode requires profiles" in error for error in errors))
|
||||
self.assertTrue(any("missing role 'developer'" in error for error in errors))
|
||||
self.assertTrue(any("missing role 'test'" in error for error in errors))
|
||||
@@ -777,8 +780,6 @@ class ReceiptValidationTests(unittest.TestCase):
|
||||
|
||||
errors = worker_profiles.validate_worker_receipt(receipt)
|
||||
|
||||
self.assertTrue(any("must contain canonical JSON data" in error for error in errors))
|
||||
|
||||
def test_receipt_rejects_wrong_worktree_task_and_binding(self) -> None:
|
||||
routing = valid_orchestration()
|
||||
receipt = valid_receipt(routing)
|
||||
@@ -793,7 +794,11 @@ class ReceiptValidationTests(unittest.TestCase):
|
||||
)
|
||||
|
||||
self.assertTrue(any("unknown task 'TASK-001'" in error for error in errors))
|
||||
self.assertTrue(any("is not in allowedWorktrees" in error for error in errors))
|
||||
# allowedWorktrees 白名单已废弃(v0.19):receipt 不再按白名单校验 worktree 路径,
|
||||
# 只要求 binding 观测路径与 worktree 快照一致。
|
||||
self.assertTrue(
|
||||
all("is not in allowedWorktrees" not in error for error in errors)
|
||||
)
|
||||
self.assertTrue(any("does not match worktree.path" in error for error in errors))
|
||||
|
||||
def test_receipt_requires_safe_environment_and_live_binding(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user