2.0 KiB
2.0 KiB
Specification: GUI 2.py Cleanup & Structural Awareness
Overview
This track focuses on a comprehensive cleanup of src/gui_2.py, deriving best practices for maintaining the Python codebase, and updating the relevant guidelines. It also includes enhancing the MCP tools to better understand Python structural conventions such as annotations.
Functional Requirements
gui_2.pyCleanup:- Reorganize the
__init__method and object state. - Improve type hints and annotations throughout the file.
- Refactor layout and rendering logic for better readability.
- Improve general code structure and maintainability.
- Reorganize the
- Guidelines Update:
- Analyze the cleanup process to derive best practices.
- Update
conductor/product-guidelines.mdwith high-level maintenance strategies. - Update
conductor/code_styleguides/python.mdwith specific coding conventions discovered during the cleanup.
- MCP Tools Enhancements:
- Improve parsing of Python type annotations.
- Enhance the extraction of class and method outlines.
- Add support for recognizing specific ImGui/Dear PyGui patterns to improve structural awareness.
Non-Functional Requirements
- Ensure changes do not break existing functionality or introduce regressions.
- Maintain the "1-space indentation" rule as strictly defined in the Python code styleguide.
- All refactoring should aim to reduce token consumption when analyzing the file with AI.
Acceptance Criteria
gui_2.pyis successfully refactored, specifically focusing on__init__declarations and type hints.- Both
conductor/product-guidelines.mdandconductor/code_styleguides/python.mdare updated with the newly derived insights. - MCP tools (e.g.,
py_get_skeleton,py_get_code_outline) exhibit improved awareness of annotations and GUI patterns. - Automated tests pass and manual GUI verification confirms no regressions.
Out of Scope
- Major architectural changes to the underlying
AppControlleror DAG Engine logic. - Rewriting
gui_2.pyin a different UI framework.