conductor(track): init default_layout_install_20260629 (empty INI -> install default; layouts/ at root + src/layouts.py; reset_layout path cleanup)

Bug: when cwd/manualslop_layout.ini is missing/empty after first-run,
post-deletion, or post-corrupt-INI, the GUI panels are not visible
despite show_windows[name] = True. Root cause is structural: imgui.begin
without [Window][name] + DockId in the INI produces a floating window
that gets clipped by the full-screen dockspace. Empirically confirmed:
8s of running produces a 585-byte INI containing only [Window][Debug##Default].

Fix shape (4 phases):
  Phase 1: relocate tests/artifacts/manualslop_layout_default.ini ->
           layouts/default.ini (at repo root, parallel to themes/ per
           user directive 'no configs in src/'); add src/paths.py
           'layouts' field + SLOP_GLOBAL_LAYOUTS env override (mirror
           themes pattern at line 60/83/150/210-216); add src/layouts.py
           loader module (mirror src/theme_models.py + src/theme_2.py
           contract; LayoutFile = @dataclass(frozen=True, slots=True)
           per the C11/Odin/Jai-in-Python value-type mandate).
  Phase 2: install-on-empty-INI in App._post_init. _install_default_layout_if_empty
           helper + drain helper, called BEFORE _diag_layout_state and
           BEFORE immapp.run. logs '[GUI] installed default layout: <src> -> <dst>'.
  Phase 3: drop hardcoded 'tests/artifacts/live_gui_workspace/...' path
           from src/commands.py:reset_layout line 369-376 (dead code in
           production; violates 'production code defaults to immediate
           directory' directive 2026-06-29).
  Phase 4: 3-test regression suite in tests/test_default_layout_install.py
           + 1 unit test in tests/test_reset_layout.py; user manual verify
           (delete INI, run sloppy.py standalone, see panels).

TDD red-first per task. Atomic per-task commits with git notes (per
conductor/workflow.md §Task Workflow step 9-10). No day estimates per
conductor/workflow.md §Tier 1 Track Initialization Rules.

Out of scope (deferred): panel_defs_fleury_migration - migrate the ~40
render_x functions to declarative PanelDef records per Ryan Fleury's
raddbg 'type view' / 'lens' pattern. Spec §Eventual Normalization Target
documents the design sketch + the transcripts at docs/transcripts/.
This track sets up layouts/ at repo root + src/layouts.py as the typed
loader so the future migration has somewhere to land.

Tracks.md row will be added in Phase 4 (Task 4.6) when the track ships.
This commit is contained in:
ed
2026-06-29 14:02:41 -04:00
parent 47564bb56a
commit 5ad062b13a
4 changed files with 491 additions and 0 deletions
@@ -0,0 +1,75 @@
# Track state for default_layout_install_20260629
# Updated by Tier 2 Tech Lead as tasks complete
[meta]
track_id = "default_layout_install_20260629"
name = "Default Layout Install + Hardcoded Path Cleanup + layouts/ Stack"
status = "active"
current_phase = 0
last_updated = "2026-06-29"
[blocked_by]
# None. This track is independent.
[blocks]
# None. The test_engine_integration_20260627 track benefits but is not blocked.
[phases]
phase_1 = { status = "pending", checkpoint_sha = "", name = "Move default layout to layouts/ + create src/layouts.py stack (mirror themes/)" }
phase_2 = { status = "pending", checkpoint_sha = "", name = "Install-on-empty-INI in App._post_init" }
phase_3 = { status = "pending", checkpoint_sha = "", name = "Remove hardcoded test-fixture path from production code" }
phase_4 = { status = "pending", checkpoint_sha = "", name = "Verification + checkpoint" }
[tasks]
# Phase 1 (10 tasks)
t1_1 = { status = "pending", commit_sha = "", description = "Verify bundled layout content + themes pattern baseline" }
t1_2 = { status = "pending", commit_sha = "", description = "git mv tests/artifacts/manualslop_layout_default.ini -> layouts/default.ini" }
t1_3 = { status = "pending", commit_sha = "", description = "Update tests/conftest.py:709 to layouts/default.ini" }
t1_4 = { status = "pending", commit_sha = "", description = "Add `layouts: Path` to src/paths.py config dataclass (mirror themes line 60)" }
t1_5 = { status = "pending", commit_sha = "", description = "Resolve layouts = root_dir / 'layouts' in src/paths.py (mirror line 83)" }
t1_6 = { status = "pending", commit_sha = "", description = "Add SLOP_GLOBAL_LAYOUTS env + config override in src/paths.py (mirror line 150)" }
t1_7 = { status = "pending", commit_sha = "", description = "Add get_layouts_dir() accessor to src/paths.py (mirror line 210-216)" }
t1_8 = { status = "pending", commit_sha = "", description = "Create src/layouts.py loader module (mirror src/theme_models.py + src/theme_2.py)" }
t1_9 = { status = "pending", commit_sha = "", description = "Verify src/layouts.py imports + returns empty dict cleanly" }
t1_10 = { status = "pending", commit_sha = "", description = "Commit phase 1 with git note (relocation + layouts/ stack + future Fleury target)" }
# Phase 2 (9 tasks)
t2_1 = { status = "pending", commit_sha = "", description = "Write 3 failing tests in tests/test_default_layout_install.py" }
t2_2 = { status = "pending", commit_sha = "", description = "Confirm RED (tests fail for install-logic-missing reason)" }
t2_3 = { status = "pending", commit_sha = "", description = "Implement _install_default_layout_if_empty helper in src/gui_2.py" }
t2_4 = { status = "pending", commit_sha = "", description = "Wire helper into App._post_init BEFORE _diag_layout_state" }
t2_5 = { status = "pending", commit_sha = "", description = "Add drain helper _install_default_layout_if_empty_result per data-oriented convention" }
t2_6 = { status = "pending", commit_sha = "", description = "Confirm GREEN (all 3 tests pass)" }
t2_7 = { status = "pending", commit_sha = "", description = "Run adjacent tests/test_gui*.py batch; no regression" }
t2_8 = { status = "pending", commit_sha = "", description = "Commit phase 2 with git note" }
t2_9 = { status = "pending", commit_sha = "", description = "User Manual Verification: standalone launch with deleted INI; panels visible" }
# Phase 3 (7 tasks)
t3_1 = { status = "pending", commit_sha = "", description = "Write tests/test_reset_layout.py failing test for path cleanup" }
t3_2 = { status = "pending", commit_sha = "", description = "Confirm RED (test reads source via inspect and asserts dead path is gone)" }
t3_3 = { status = "pending", commit_sha = "", description = "Remove hardcoded tests/artifacts/... line from src/commands.py:reset_layout" }
t3_4 = { status = "pending", commit_sha = "", description = "Update commands.reset_layout docstring (line 351-362)" }
t3_5 = { status = "pending", commit_sha = "", description = "Confirm GREEN" }
t3_6 = { status = "pending", commit_sha = "", description = "Run tests/test_commands*.py batch; no regression" }
t3_7 = { status = "pending", commit_sha = "", description = "Commit phase 3 with git note" }
# Phase 4 (6 tasks)
t4_1 = { status = "pending", commit_sha = "", description = "Run batched verification per workflow.md §Phase Completion Verification" }
t4_2 = { status = "pending", commit_sha = "", description = "Empirical reproduction of original bug (production cwd, manual)" }
t4_3 = { status = "pending", commit_sha = "", description = "Phase 4 checkpoint commit + verification git note" }
t4_4 = { status = "pending", commit_sha = "", description = "Append phase checkpoint SHAs to plan.md" }
t4_5 = { status = "pending", commit_sha = "", description = "Commit final plan update" }
t4_6 = { status = "pending", commit_sha = "", description = "Add row to conductor/tracks.md + commit in same batch" }
[verification]
phase_4_g1_install_on_empty_ini = false
phase_4_g2_overrides_cleared = false
phase_4_g3_path_cleanup = false
phase_4_g4_regression_tests = false
phase_4_g5_layouts_at_root = false
phase_4_g6_paths_layouts_field = false
phase_4_g7_src_layouts_py = false
phase_4_g8_conftest_path_update = false
phase_4_no_test_paths_in_src = false
phase_4_no_configs_in_src = false
phase_4_user_signoff = false