feat(directives): harvest 5 GUI/architecture directives from product-guidelines.md + python.md
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# comprehensive_logging — v1
|
||||
|
||||
**Why this iteration:** Lifted verbatim from `conductor/product-guidelines.md` §"Code Standards & Architecture" (line 38). This is the baseline encoding — the imperative-bullet-with-rationale style currently in production.
|
||||
Future variants will test alternative encodings (rationale-first, before/after) against this baseline.
|
||||
|
||||
**Source:** `conductor/product-guidelines.md:38`
|
||||
|
||||
---
|
||||
|
||||
From `conductor/product-guidelines.md` §"Code Standards & Architecture":
|
||||
- **Comprehensive Logging:** Aggressively log all actions, API payloads, tool calls, and executed scripts. Maintain timestamped JSON-L and markdown logs to ensure total transparency and debuggability.
|
||||
@@ -0,0 +1,16 @@
|
||||
# imgui_scope_verification — v1
|
||||
|
||||
**Why this iteration:** Lifted verbatim from `conductor/product-guidelines.md` §"Code Standards & Architecture" (line 39) + `conductor/workflow.md` §"Code Style" line 9. This is the baseline encoding — the imperative-bullet style currently in production.
|
||||
Future variants will test alternative encodings (rationale-first, tabular) against this baseline.
|
||||
|
||||
**Source:** `conductor/product-guidelines.md:39 + workflow.md:9`
|
||||
|
||||
---
|
||||
|
||||
From `conductor/product-guidelines.md` §"Code Standards & Architecture":
|
||||
- **Mandatory ImGui Verification:** All changes to the GUI (`gui_2.py`) MUST be verified using the custom AST linter (`scripts/check_imgui_scopes.py`) to ensure all ImGui scopes (begin/end, push/pop) are properly matched. Developers should prioritize the use of `src/imgui_scopes.py` context managers (`imscope`) over manual push/pop calls.
|
||||
|
||||
---
|
||||
|
||||
From `conductor/workflow.md` §"Code Style":
|
||||
- **ImGui Defer Patterns:** Use `imscope` context managers or `_render_window_if_open` dispatch helpers to prevent resource leaks and keep the main loop flat. See `conductor/code_styleguides/python.md` for details.
|
||||
@@ -0,0 +1,23 @@
|
||||
# modular_controller_pattern — v1
|
||||
|
||||
**Why this iteration:** Lifted verbatim from `conductor/product-guidelines.md` §"Code Standards & Architecture" (line 40) + `conductor/code_styleguides/python.md` §15 (lines 234-240). This is the baseline encoding — the imperative-bullet style currently in production.
|
||||
Future variants will test alternative encodings (rationale-first, tabular) against this baseline.
|
||||
|
||||
**Source:** `conductor/product-guidelines.md:40 + python.md:234-240`
|
||||
|
||||
---
|
||||
|
||||
From `conductor/product-guidelines.md` §"Code Standards & Architecture":
|
||||
- **Modular Controller Pattern:** To prevent "God Object" bloat in core controllers (like `AppController`), all state-independent or utility logic must be moved to module-level functions. Functions requiring class state should accept the instance as an explicit dependency (`def logic(controller: AppController, ...)`). Massive `if/elif` dispatch blocks must be refactored into handler maps (dictionaries) of module-level functions.
|
||||
|
||||
---
|
||||
|
||||
From `conductor/code_styleguides/python.md` §15:
|
||||
## 15. Modular Controller Pattern
|
||||
|
||||
To prevent "God Object" bloat in core controllers (like `AppController`):
|
||||
|
||||
- **Extract Logic:** Move all state-independent or purely utility logic to module-level functions.
|
||||
- **Dependency Injection:** Module-level functions that require class state should accept the instance as their first argument (e.g., `def my_extracted_logic(controller: AppController, ...)`).
|
||||
- **Handler Maps:** Replace massive `if/elif` blocks (like those in event dispatchers) with dictionaries mapping keys to module-level handler functions.
|
||||
- **Inner Class Extraction:** Never define nested classes or functions within methods. Move them to the module level.
|
||||
@@ -0,0 +1,11 @@
|
||||
# strict_state_management — v1
|
||||
|
||||
**Why this iteration:** Lifted verbatim from `conductor/product-guidelines.md` §"Code Standards & Architecture" (line 37). This is the baseline encoding — the imperative-bullet-with-rationale style currently in production.
|
||||
Future variants will test alternative encodings (rationale-first, before/after) against this baseline.
|
||||
|
||||
**Source:** `conductor/product-guidelines.md:37`
|
||||
|
||||
---
|
||||
|
||||
From `conductor/product-guidelines.md` §"Code Standards & Architecture":
|
||||
- **Strict State Management:** There must be a rigorous separation between the Main GUI rendering thread and daemon execution threads. The UI should *never* hang during AI communication or script execution. Use lock-protected queues and events for synchronization.
|
||||
@@ -0,0 +1,11 @@
|
||||
# ui_delegation_for_hot_reload — v1
|
||||
|
||||
**Why this iteration:** Lifted verbatim from `conductor/product-guidelines.md` §"Code Standards & Architecture" (line 41). This is the baseline encoding — the imperative-bullet-with-rationale style currently in production.
|
||||
Future variants will test alternative encodings (rationale-first, before/after) against this baseline.
|
||||
|
||||
**Source:** `conductor/product-guidelines.md:41`
|
||||
|
||||
---
|
||||
|
||||
From `conductor/product-guidelines.md` §"Code Standards & Architecture":
|
||||
- **UI Delegation for Hot-Reload:** All complex ImGui rendering logic must be extracted from the `App` class into module-level functions named `render_xxx(app: App)`. The `App` class should only contain thin delegation wrappers (`def _render_xxx(self): render_xxx(self)`). This architecture is mandatory for supporting state-preserving hot-reloads of the UI logic.
|
||||
Reference in New Issue
Block a user