Private
Public Access
0
0

conductor(plan): Mark default_layout_install_20260629 Phase 1 tasks complete [7577d7d]

This commit is contained in:
2026-06-29 14:22:26 -04:00
parent 7577d7d28b
commit 9f1d8cb2d8
@@ -2,52 +2,43 @@
Focus: relocate `tests/artifacts/manualslop_layout_default.ini` to `layouts/default.ini` at repo root; add the parallel `src/paths.py` field, `get_layouts_dir()` accessor, and `src/layouts.py` loader module — exactly the themes pattern (`themes/` + `src/path.py:60,83,150` + `src/theme_models.py` + `src/theme_2.py`).
- [ ] Task 1.1: Verify bundled layout content + themes pattern baseline
- WHERE: `tests/artifacts/manualslop_layout_default.ini` (109 lines), `src/paths.py:60,83,150,210-216`, `src/theme_models.py:181-225`, `src/theme_2.py:340-346`, `themes/` at repo root
- WHAT: confirm files exist with the expected sizes and that the themes pattern is the canonical reference
- HOW: `git log --oneline -- tests/artifacts/manualslop_layout_default.ini` for provenance; `Get-Content src/paths.py | Select-String -Pattern "themes\s*[:=]|themes\s*=|root_dir/"` to map the path-resolution shape
- SAFETY: pure read; no behavior change
- [ ] Task 1.2: `git mv` asset to new home
- [x] Task 1.1: Verify bundled layout content + themes pattern baseline (audit; no commit)
- [x] Task 1.2 [7577d7d]: `git mv` asset to new home
- WHERE: `tests/artifacts/manualslop_layout_default.ini``layouts/default.ini` (new dir at repo root, parallel to `themes/`)
- WHAT: `git mv tests/artifacts/manualslop_layout_default.ini layouts/default.ini`
- HOW: PowerShell `git mv` preserves history; verify with `git status` after
- SAFETY: file rename, no content change; `layouts/` is gitignored? verify — `grep -i "layouts" .gitignore` should return nothing (or only `tests/artifacts/` excluding layouts/)
- [ ] Task 1.3: Update `tests/conftest.py:709` to read from `layouts/`
- WHERE: `tests/conftest.py:709``_default_layout_src = project_root / "tests" / "artifacts" / "manualslop_layout_default.ini"`
- WHAT: change to `_default_layout_src = project_root / "layouts" / "default.ini"`
- HOW: `manual-slop_edit_file`; preserve 1-space indentation per `conductor/code_styleguides/python.md`
- SAFETY: no semantic change to test behavior; same bundled content, new path
- [ ] Task 1.4: Add `layouts` field to `src/paths.py` config dataclass (mirror themes)
- [x] Task 1.3 [7577d7d]: Update `tests/conftest.py:709` to read from `layouts/`
- [x] Task 1.4 [7577d7d]: Add `layouts` field to `src/paths.py` config dataclass (mirror themes line 60)
- WHERE: `src/paths.py:60` (`themes: Path = ...`) — add a `layouts: Path = ...` field right after
- WHAT: add the field declaration matching the `themes` shape exactly
- HOW: `manual-slop_edit_file`; 1-space indent
- SAFETY: additive — does not change existing fields
- [ ] Task 1.5: Resolve `layouts` default in `src/paths.py` (mirror themes)
- WHERE: `src/paths.py:83` (`themes = root_dir / "themes",`) — add `layouts = root_dir / "layouts",` immediately below
- [x] Task 1.5 [7577d7d]: Resolve `layouts` default in `src/paths.py` (mirror themes line 83)
- WHAT: resolve the default path in the `initialize_paths`-style function
- HOW: `manual-slop_edit_file`; ensure the same closure/call-site shape as themes
- SAFETY: additive; existing themes path unchanged
- [ ] Task 1.6: Add `SLOP_GLOBAL_LAYOUTS` env + config override (mirror themes)
- [x] Task 1.6 [7577d7d]: Add `SLOP_GLOBAL_LAYOUTS` env + config override (mirror themes line 150)
- WHERE: `src/paths.py:150` — add `_resolve_path("SLOP_GLOBAL_LAYOUTS", "layouts", root_dir / "layouts", config_path)` line in the same call shape
- WHAT: register the env var + config-file override for `layouts`, parallel to themes
- HOW: `manual-slop_edit_file`; exact-string preserve the existing `_resolve_path` call for themes
- SAFETY: additive; new env var only
- [ ] Task 1.7: Add `get_layouts_dir()` accessor to `src/paths.py` (mirror themes)
- [x] Task 1.7 [7577d7d]: Add `get_layouts_dir()` accessor to `src/paths.py` (mirror themes accessor at ~210)
- WHERE: `src/paths.py:210-216` — add 2 functions (`get_layouts_dir() -> Path` + `get_layouts_project_config_path() -> Path` if themes has it) right after
- WHAT: accessor functions
- HOW: `manual-slop_edit_file`; preserve docstring format
- SAFETY: additive
- [ ] Task 1.8: Create `src/layouts.py` loader module (mirror `src/theme_models.py` + `src/theme_2.py`)
- [x] Task 1.8 [7577d7d]: Create `src/layouts.py` loader module (mirror `src/theme_models.py` + `src/theme_2.py`)
- WHERE: new file `src/layouts.py`
- WHAT: define `LayoutFile` `@dataclass(frozen=True, slots=True)` with `(name: str, raw_text: str, source_path: Path, scope: str)` fields; define `load_layouts_from_dir(path: Path, scope: str) -> dict[str, LayoutFile]` and `load_layouts_from_file(path: Path, scope: str) -> dict[str, LayoutFile]`; define `load_layouts_from_disk() -> None` that calls both with global + project paths; wrap parse errors in `Result` per `conductor/code_styleguides/error_handling.md`
- HOW: model after `src/theme_models.py:181-225` (`load_themes_from_dir`, `load_themes_from_toml`) + `src/theme_2.py:340-346` (`load_themes_from_disk`)
- SAFETY: new file, no existing code modification; uses `from __future__ import annotations` + `@dataclass(frozen=True, slots=True)` per `conductor/code_styleguides/data_oriented_design.md` §8.5
- [ ] Task 1.9: Add `src/layouts.py` to `tests/test_gui2_layout.py`-adjacent test inventory if present; for now, just verify import works
- [x] Task 1.9 [7577d7d]: Verify `src/layouts.py` import + returns dict cleanly
- WHERE: `tests/`
- WHAT: `uv run python -c "from src.layouts import load_layouts_from_disk; print(load_layouts_from_disk())"` to verify the module imports and returns a dict (empty by default since the test cwd has no `layouts/`)
- HOW: direct Python invocation
- SAFETY: pure inspection
- [ ] Task 1.10: Commit phase 1 with git note
- [x] Task 1.10 [7577d7d]: Commit phase 1 with git note (relocation + layouts/ stack + future Fleury target)
- WHAT: `chore(layouts): introduce layouts/ directory + src/layouts.py (themes pattern); relocate default layout asset`
- HOW: standard atomic commit per `conductor/workflow.md` §Task Workflow; attach a 3-line git note explaining: relocation from tests/artifacts; parallel to themes; src/layouts.py mirrors src/theme_models.py + src/theme_2.py; sets up the home for eventual Fleury-style PanelDef migration