conductor(plan): Mark Phase 2 tasks 2.3-2.6 + 2.8 complete (GREEN helpers + _post_init wiring + test path fix)
Tasks 2.3 + 2.5 [f3cd7bc2]: module-level installer + drain helper added in src/gui_2.py. Task 2.4 [3d87f8e7]: wired into App._post_init before the warmup-complete registration block. Task 2.6 [3d87f8e7]: all 3 RED tests now pass after absolute-path fix on _GUI_SCRIPT. Task 2.8 [3d87f8e7]: phase-2 atomic commit landed. Task 2.7 (adjacent test_gui* batch) remains pending for the orchestrator.
This commit is contained in:
@@ -58,22 +58,22 @@ Focus: ship `layouts/default.ini` to `cwd/manualslop_layout.ini` when the file i
|
||||
- WHERE: `tests/test_default_layout_install.py`
|
||||
- HOW: `uv run pytest tests/test_default_layout_install.py -v --tb=short --timeout=120`
|
||||
- Expected: 3 tests fail because no install logic exists yet; the temp-workspace INI is empty or absent post-launch
|
||||
- [ ] Task 2.3: Implement `_install_default_layout_if_empty` helper
|
||||
- [x] Task 2.3 [f3cd7bc2]: Implement `_install_default_layout_if_empty` helper
|
||||
- WHERE: new module-level function `_install_default_layout_if_empty(src_ini: Path, dst_ini: Path) -> Result[bool]` near `_diag_layout_state` (`src/gui_2.py:584-615`)
|
||||
- WHAT: reads `src_ini` text, decides if `dst_ini` is "missing/empty" (file size < 1000 bytes OR zero `[Window][` lines), copies bundled → dst on true, returns Result[True]; on false returns Result[False]; on `OSError` returns Result with ErrorInfo per `conductor/code_styleguides/error_handling.md`
|
||||
- HOW: `shutil.copy2` for atomic copy; `sys.stderr.write(f"[GUI] installed default layout: {src_ini} -> {dst_ini}\n")` for the user-visible log
|
||||
- SAFETY: thread-safe (no shared state); pure file I/O; 1-space indentation per project rule
|
||||
- [ ] Task 2.4: Wire the helper into `App._post_init`
|
||||
- [x] Task 2.4 [3d87f8e7]: Wire the helper into `App._post_init`
|
||||
- WHERE: `src/gui_2.py:570-582` (`App._post_init` body)
|
||||
- WHAT: call `_install_default_layout_if_empty` BEFORE `_diag_layout_state`; append ErrorInfo to `app._startup_timeline_errors` if `not result.ok`
|
||||
- HOW: `install_result = _install_default_layout_if_empty_result(app, src_path, dst_path)`; if not ok, drain via `_startup_timeline_errors` per the existing pattern at line 580-582
|
||||
- SAFETY: `_post_init` runs on the main thread (HelloImGui callback), no race
|
||||
- [ ] Task 2.5: Add drain helper `_install_default_layout_if_empty_result`
|
||||
- [x] Task 2.5 [f3cd7bc2]: Add drain helper `_install_default_layout_if_empty_result`
|
||||
- WHERE: `src/gui_2.py` near other drain helpers (line 1448 area: `_post_init_callback_result`)
|
||||
- WHAT: `Result[None]` wrapper for the install; mirrors the existing `Result`-returning pattern for `_post_init_callback_result` and `_diag_layout_state_ini_text_result`
|
||||
- HOW: same pattern; signature `def _install_default_layout_if_empty_result(app, src_path, dst_path) -> Result[bool]`
|
||||
- SAFETY: append-to-drain convention per `conductor/code_styleguides/error_handling.md`
|
||||
- [ ] Task 2.6: Verify phase 2.1 tests now pass
|
||||
- [x] Task 2.6 [3d87f8e7]: Verify phase 2.1 tests now pass
|
||||
- WHERE: `tests/test_default_layout_install.py`
|
||||
- HOW: `uv run pytest tests/test_default_layout_install.py -v --tb=short --timeout=120`
|
||||
- Expected: all 3 pass; the post-launch INI has 7+ `[Window][X]` entries
|
||||
@@ -81,7 +81,7 @@ Focus: ship `layouts/default.ini` to `cwd/manualslop_layout.ini` when the file i
|
||||
- WHERE: `tests/test_gui2_layout.py`, `tests/test_gui_diagnostics.py`, `tests/test_layout_reorganization.py`
|
||||
- HOW: `uv run python scripts/run_tests_batched.py --tier test_gui*` (per `conductor/workflow.md` §"Tier 2 Autonomous Sandbox" — use the batched runner, never raw pytest for batched verification)
|
||||
- Expected: prior batch_green preserved; no _post_init regressions
|
||||
- [ ] Task 2.8: Commit phase 2 with git note
|
||||
- [x] Task 2.8 [3d87f8e7]: Commit phase 2 with git note
|
||||
- WHAT: `fix(gui): install default layout when cwd/manualslop_layout.ini is empty`
|
||||
- HOW: standard atomic commit; git note = "Installs bundled `layouts/default.ini` (resolved via the new src/layouts.py path resolution) to cwd when the user's INI is missing or empty, restoring visible panels on first-run / post-deletion. Drains errors to `_startup_timeline_errors` per data-oriented convention."
|
||||
- [ ] Task 2.9: User Manual Verification
|
||||
|
||||
Reference in New Issue
Block a user