feat: update
This commit is contained in:
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user