From 40d61bf3d83432383b6ce7f29f3d90fc99cfcd6f Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 8 Jun 2026 10:15:54 -0400 Subject: [PATCH] docs(todo): mark Tasks 1+2 as SHIPPED for test_full_live_workflow fix --- TODO_test_full_live_workflow.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/TODO_test_full_live_workflow.md b/TODO_test_full_live_workflow.md index 1e96dcbe..5d5aa3d7 100644 --- a/TODO_test_full_live_workflow.md +++ b/TODO_test_full_live_workflow.md @@ -2,22 +2,24 @@ **Report:** `docs/reports/test_full_live_workflow_root_cause_20260608.md` **Failure reproducibility:** 100% in tier-3 batch, 0% in isolation -**Status:** Not started (investigation only; no fix code yet) +**Status:** Tasks 1+2 SHIPPED (commit `6ecb31ea`); Tasks 3-7 remaining ## Tasks (simple, ordered by ROI) -### 1. [HIGH] Add deterministic signal endpoint +### 1. [HIGH] Add deterministic signal endpoint ✅ SHIPPED (commit 6ecb31ea) - **What:** Add `GET /api/project_switch_status` returning `{"in_progress": bool, "path": str | null, "error": str | null}`. - **Where:** `src/api_hooks.py` (new handler) + `src/app_controller.py` (track `_project_switch_in_progress` + `_project_switch_error` state). - **Why:** Polling the project dict is fragile (returns stale state from prior tests). Polling a purpose-built signal is deterministic. - **Pattern:** See `src/api_hooks.py:336-363` (`/api/warmup_wait`) for the existing pattern of "block until condition, return final state". - **Acceptance:** Test polls `/api/project_switch_status` until `in_progress == False` and `path == expected` and `error is None`. Times out after 30s with clear error. +- **Note on test fix:** The 2nd unit test (`test_get_project_switch_status_default_is_idle`) was originally written without mocking `_make_request`, so it leaked through to the live `live_gui` session and got the real `active_project_path` back. Fixed in same commit by adding `patch.object(client, "_make_request")` mock. The live test (`test_live_project_switch_status_endpoint_idle`) was also loosened: `path` can be `None` or `str` (a project may be loaded at session start). -### 2. [HIGH] Reset project state in `_handle_reset_session` +### 2. [HIGH] Reset project state in `_handle_reset_session` ✅ SHIPPED (commit 6ecb31ea) - **What:** Add `self.project = {}; self.active_project_path = ""; self.project_paths = []` (or call a new `_reset_project_state` helper) at the start of `_handle_reset_session`. - **Where:** `src/app_controller.py:3244-3296`. - **Why:** The session-scoped `live_gui` fixture shares the controller across 48 tests. Prior tests leave stale project state. The reset handler currently clears AI session but not project state. - **Acceptance:** After `client.click("btn_reset")` followed by the new project-creation click, the test sees a clean project state regardless of which tests ran before it in the tier-3 batch. +- **Implementation note:** Mirrors `__init__` default-project branch (lines 1743-1745): creates a fresh `project_manager.default_project(reset_name)`, sets `active_project_path = ""`, `project_paths = []`, reinitializes workspace manager. 3 unit tests pass. No regression in 9 related tests. ### 3. [MED] Replace `os.path.abspath("tests/artifacts/temp_project.toml")` with fixture-provided path - **What:** Have the `live_gui` fixture provide `temp_project_path` (str) derived from its own `temp_workspace` directory.