Private
Public Access
chore(layouts): introduce layouts/ directory + src/layouts.py; relocate default layout asset
TIER-2 READ AGENTS.md, conductor/workflow.md, conductor/edit_workflow.md, conductor/tier2/githooks/forbidden-files.txt, conductor/tracks/tier2_leak_prevention_20260620/spec.md, conductor/code_styleguides/data_oriented_design.md, conductor/code_styleguides/error_handling.md, conductor/code_styleguides/type_aliases.md, conductor/product-guidelines.md, conductor/code_styleguides/python.md, docs/guide_meta_boundary.md before Phase 1 Task 1.10. Phase 1 of default_layout_install_20260629: - tests/artifacts/manualslop_layout_default.ini -> layouts/default.ini (git mv preserves history; same content, new parallel-to-themes home) - src/paths.py: layouts: Path field + SLOP_GLOBAL_LAYOUTS env override + get_layouts_dir() accessor (mirror themes at 60/83/150/210+) - src/layouts.py: new LayoutFile @dataclass(frozen=True, slots=True) + load_layouts_from_dir/file + load_layouts_from_disk consumer (mirror src/theme_models.py + src/theme_2.py; Result drain per error_handling) - tests/conftest.py:709: reads from layouts/default.ini
This commit is contained in:
@@ -58,6 +58,7 @@ class PathsConfig:
|
||||
tool_presets: Path
|
||||
personas: Path
|
||||
themes: Path
|
||||
layouts: Path
|
||||
workspace_profiles: Path
|
||||
credentials: Path
|
||||
logs_dir: Path
|
||||
@@ -81,6 +82,7 @@ def _default_paths_config() -> PathsConfig:
|
||||
tool_presets = root_dir / "tool_presets.toml",
|
||||
personas = root_dir / "personas.toml",
|
||||
themes = root_dir / "themes",
|
||||
layouts = root_dir / "layouts",
|
||||
workspace_profiles = root_dir / "workspace_profiles.toml",
|
||||
credentials = root_dir / "credentials.toml",
|
||||
logs_dir = root_dir / "logs" / "sessions",
|
||||
@@ -148,6 +150,7 @@ def initialize_paths(config_path: Optional[Path] = None) -> PathsConfig:
|
||||
tool_presets = _resolve_path("SLOP_GLOBAL_TOOL_PRESETS", "tool_presets", root_dir / "tool_presets.toml", config_path),
|
||||
personas = _resolve_path("SLOP_GLOBAL_PERSONAS", "personas", root_dir / "personas.toml", config_path),
|
||||
themes = _resolve_path("SLOP_GLOBAL_THEMES", "themes", root_dir / "themes", config_path),
|
||||
layouts = _resolve_path("SLOP_GLOBAL_LAYOUTS", "layouts", root_dir / "layouts", config_path),
|
||||
workspace_profiles = _resolve_path("SLOP_GLOBAL_WORKSPACE_PROFILES", "workspace_profiles", root_dir / "workspace_profiles.toml", config_path),
|
||||
credentials = _resolve_path("SLOP_CREDENTIALS", "credentials", root_dir / "credentials.toml", config_path),
|
||||
logs_dir = _resolve_path("SLOP_LOGS_DIR", "logs_dir", root_dir / "logs" / "sessions", config_path),
|
||||
@@ -211,6 +214,11 @@ def get_global_themes_path() -> Path:
|
||||
[C: src/theme_2.py:load_themes_from_disk]"""
|
||||
return _cfg().themes
|
||||
|
||||
def get_layouts_dir() -> Path:
|
||||
"""Global layouts directory. Frozen at initialize_paths() time.
|
||||
[C: src/layouts.py:load_layouts_from_disk]"""
|
||||
return _cfg().layouts
|
||||
|
||||
def get_project_themes_path(project_root: Path) -> Path:
|
||||
"""[C: src/theme_2.py:load_themes_from_disk]"""
|
||||
return project_root / "project_themes.toml"
|
||||
|
||||
Reference in New Issue
Block a user