Skip to content

Unofficial Series Code#22

Open
evildarkarchon wants to merge 132 commits intoGuidanceOfGrace:mainfrom
evildarkarchon:unofficial-main
Open

Unofficial Series Code#22
evildarkarchon wants to merge 132 commits intoGuidanceOfGrace:mainfrom
evildarkarchon:unofficial-main

Conversation

@evildarkarchon
Copy link
Contributor

This is the code from my "Unofficial Series", contains all the changes from #20

This way, it won't instantly go from stopping to stopped.
I also moved the xedit regex out of the function so it doesn't compile every time the while loop polls it.
Also, redid some code for correctness and removed some redundancies.
Also moved the lower-case mapped lists to the info dataclass.
Consolidated the code to identify if a process or file name is xedit or not into a single function. It also uses mapped sets of xedit_list_universal and xedit_list_specific that apply the str.lower() method to all entries.
This way, it doesn't drag other processes that have edit at the end of their file name into the mix.
This feature requires xedit >= 4.1.5b and can only be enabled through direct editing of the config file.
This feature is completly use at your own risk, I can not provide support for it.
evildarkarchon and others added 30 commits June 25, 2025 01:15
- Updated coverage.xml to reflect improved test coverage metrics.
- Enhanced logging configuration to include log file details and log level during startup.
- Refactored `GuiController` to load additional settings and improve plugin line validation logic.
- Improved test cases for `GuiController` to ensure proper handling of plugin configurations and file operations.
- Adjusted test utilities for better file handling consistency.
- Removed unnecessary noqa comments for imports in cleaning_service.py and utils.py.
- Updated logging_config.py to use Path.cwd() instead of os.getcwd() for improved compatibility.
- Cleaned up import statements in utils.py for better readability.
Adds a guide to instruct AI programming assistants on the project's architecture, conventions, and constraints.

This file outlines key information, including:
- Core architectural principles like centralized state and layer separation.
- Strict threading rules mandating the use of PySide6 components.
- Essential development and testing commands.
- Test coverage requirements and common workflows.

This guide helps ensure that AI-generated code aligns with project standards, improving consistency and quality.
Establishes a dedicated `tests/test_output` directory for all test-related artifacts like logs and temporary files, improving organization and separating test outputs from source code.

Introduces new Pytest fixtures for creating and managing temporary test files within this directory, complete with automatic cleanup. This simplifies test setup and improves consistency.

The test logging configuration is updated to direct logs to the new output directory. The `.gitignore` file is also updated to exclude test artifacts while keeping the directory structure.
Critical fixes:
- Add safe_popen context manager to prevent subprocess resource leaks
- Replace QMutex with QReadWriteLock in StateManager for better concurrency
- Implement comprehensive cleanup methods in GuiController and MainWindow
- Add deferred config saves to prevent deadlocks
- Move logging outside critical sections in YamlManager

Medium priority fixes:
- Fix Qt object lifetime issues with proper parent relationships
- Add explicit signal disconnection cleanup
- Implement subprocess resource limits with configurable max processes

Also includes comprehensive test suite for thread safety, resource management,
and deadlock prevention scenarios.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add test_output_dir fixture to conftest.py for consistent test file handling
- Update all tests to use centralized fixture instead of tmp_path
- Improve test isolation and cleanup
- Enhance test coverage for edge cases
- Update CLAUDE.md with testing best practices

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update CLAUDE.md with comprehensive development guide
- Remove obsolete documentation files (threading analysis, refactoring summaries)
- Update copilot instructions to be AI-agent agnostic
- Add more detailed command examples and project structure
- Remove fixed issues from documentation

All threading issues have been resolved and the related documentation
is no longer needed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removes the concurrent subprocess management system to enforce a strictly sequential cleaning process. This simplifies the threading model and eliminates potential race conditions associated with managing multiple xEdit instances.

Introduces `contextlib.suppress` for cleaner signal disconnection in the UI, preventing `RuntimeError` exceptions when signals are already disconnected.

Also includes general code cleanup, such as removing trailing whitespace and improving test readability, and significantly updates the AI assistant instruction documents for better guided development.
- Enhanced thread safety in StateManager with proper lock acquisition
- Fixed subprocess management in CleaningService and CleaningWorker
- Improved error handling and resource cleanup
- Added comprehensive deadlock scenario tests
- Updated coverage reports

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Refactors core components to improve efficiency and provide a smoother user experience.

- **GUI Controller**: Enhances plugin parsing speed by using pre-compiled frozensets for faster lookups and adding early exit conditions for irrelevant lines.
- **State Manager**: Prevents UI blocking and potential deadlocks by moving signal emissions outside of critical write locks. Introduces a bulk state change signal to efficiently notify the UI of multiple updates.
- **Utilities**: Improves YAML caching with modification time-based validation, reducing redundant file reads. Optimizes subprocess creation for better performance, especially on Windows.
- **UI Interface**: Implements a priority-based UI update debouncing mechanism and utilizes bulk state changes to ensure more fluid and responsive UI updates.
Complete refactoring of AutoQAC_Interface.py from 961 lines to 84 lines using MixIn classes for better separation of concerns. Added new helper modules for game detection, plugin validation, process utilities, and configuration dialogs.

Main changes:
- Extract UI components into modular MixIn classes in AutoQACLib/ui/mixins/
- Move dialogs to dedicated files in AutoQACLib/ui/dialogs/
- Create MainWindow class using composition of focused mixins
- Add helper modules: game_detection, plugin_validator, process_utils, yaml_manager
- Extract configuration dialogs to separate module
- Update CLAUDE.md with file size limits and GUI development guidelines
- Fix documentation: xEdit uses -QAC flag, not -quickautoclean
- Add comprehensive refactoring plan documentation

File structure improvements:
- One class per file (550 line hard limit)
- Each mixin handles single responsibility
- Better testability and maintainability
- Cleaner dependency injection pattern

Coverage and test updates:
- Update test files for new architecture
- Maintain test coverage requirements
- Update coverage.xml with latest results

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Refactor: Major UI architecture overhaul using MixIn pattern
* Renames `_defer_config_save` to `defer_config_save` for broader access, updating all call sites.
* Improves error handling for deferred configuration saves by collecting and reporting all failures after processing, rather than stopping on the first error.
* Optimizes type hint dependencies by moving various imports into `TYPE_CHECKING` blocks and using string forward references for `cast` where appropriate, reducing runtime overhead.
This commit performs cleanup of obsolete code and updates project metadata:

**Removed deprecated files:**
- Deleted AutoQACLib/utils.py (functionality moved to specialized modules)
- Deleted REFACTORING_PLAN.md (refactoring completed)
- Deleted migrate_to_refactored.py (migration script no longer needed)
- Deleted .coverage and coverage.xml (test artifacts should not be committed)

**Updated .gitignore:**
- Added uv.lock to ignore list
- Added .coverage and coverage.xml to prevent test artifacts from being committed
- Added migrate_to_refactored.py to ignore obsolete migration scripts

**Updated CLAUDE.md:**
- Enhanced project documentation with clearer architecture guidelines
- Added comprehensive testing requirements and coverage targets
- Improved code organization rules and dependency injection patterns

**Updated pyproject.toml:**
- Refined project dependencies and tool configurations
- Updated metadata and package information

**Test updates:**
- Modified tests/test_resource_management.py for current architecture
- Updated tests/test_thread_safety.py to reflect refactored threading model
- Adjusted tests/test_utils.py after utils.py removal

This cleanup consolidates the codebase after the major refactoring effort,
removing transitional code and updating documentation to reflect the current
architecture using StateManager, ConfigManager, and the MixIn pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updates the import of `Callable` for type hinting from `typing` to `collections.abc` within `TYPE_CHECKING` blocks. This change aligns with Python best practices for more robust and standard type definitions.

Also removes an unused "serana" MCP server configuration from `.mcp.json`, streamlining the project's setup.
- Add autoqac-rust as git submodule (https://github.com/evildarkarchon/AutoQAC-rs.git)
- Add Claude Code permissions for Cargo commands in settings
- Add docs/rust-migration-plan.md for Rust implementation documentation
- Update IDE configuration to use uv instead of Poetry
- Remove obsolete .idea/modules.xml
- Add comprehensive docstrings to StateManager class and state property
- Update MainWindow title from "AutoQAC - Refactored" to "AutoQAC"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
**Documentation Updates:**
- Mark Phase 4 as completed (Slint GUI with Fluent Design)
- Mark Phase 5 as completed (Integration & Async Orchestration)
- Update rust-migration-plan.md to reflect current progress

**Claude Code Configuration:**
- Add WebFetch(domain:docs.rs) to allowed tools
- Enable Rust documentation fetching for better code assistance

**Submodule Updates:**
- Update autoqac-rust to commit 8e64996
- Includes complete Slint GUI implementation
- Includes EventLoopBridge for tokio/Slint coordination
- Includes GuiController for state management integration

This commit tracks the completion of major milestones in the Rust
migration roadmap. The core GUI framework is now functional with
proper async coordination between tokio and Slint event loops.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updates the autoqac-rust submodule to include:
- Watch channel-based cancellation system with tokio::select!
- User configuration loading into StateManager (Phase 5 completion)
- Immediate cancellation response for better UX
- Zero compiler warnings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update submodule reference to include newly added files:
- AutoQAC Data/ directory with YAML configuration files and application assets
- CLAUDE.md with comprehensive Rust development documentation
- Application branding assets (icons, SVG files, design files)

This update tracks the addition of foundational configuration structure and
development guidelines for the Rust rewrite (Phase 1-4 of migration).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removes unused .mcp.json configuration file.

Updates autoqac-rust submodule to latest commit with:
- Statistics tracking for cleaning operations (ITMs, UDRs, etc.)
- Enhanced dialog system (warnings, errors, confirmations)
- Improved window close handling during cleaning
- Real-time UI updates for cleaning statistics

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Rewrites the project README to provide comprehensive and up-to-date documentation.

Introduces the new Rust/Slint implementation alongside the existing Python/Qt version, detailing their features, benefits, and quick start guides. Expands on safety guidelines for plugin cleaning, supported games, configuration files, logging, and known issues.

Updates the `autoqac-rust` submodule to its latest commit, incorporating recent improvements and bug fixes from the Rust implementation.
- Remove redundant Cursor rules (testing-comprehensive, thread-safety)
- Remove GitHub Copilot instructions in favor of unified approach
- Streamline CLAUDE.md by removing verbose sections
- Add supported games table with VR variant support
- Add AGENTS.md and GEMINI.md for agent-specific guidance
- Remove autoqac-rust submodule reference
Major rebranding from PACT to AutoQAC across the entire codebase:
- Rename all PACT_* config keys to AutoQAC_* in YAML files
- Update version to 2.0.0 with current date
- Fix typo "Ivalid_XEDIT_File" to "Invalid_XEDIT_File"
- Update Nexus Mods links to correct mod pages

Add migration support for legacy configurations:
- New AutoQACLib/migration.py module
- Auto-migrate old PACT config files on startup
- New AutoQAC Ignore.yaml for user-defined ignore lists

Integrate OpenSpec change management workflow:
- Add openspec/ directory with project specs
- Add OpenSpec instructions to AGENTS.md and CLAUDE.md
- Add slash commands for proposal/apply/archive workflows
- Support for Claude, Gemini, GitHub Copilot, and Kilocode

Update documentation throughout:
- Readme.md: Full rebrand to AutoQAC
- GEMINI.md: Update project context and references
- CLAUDE.md: Update config file documentation
- Format markdown tables consistently

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removes the `autoqac-rust` component and its related structure from the project.

Deletes the `AutoQAC Data/AutoQAC Ignore.yaml` configuration file, which was tied to the removed component. Updates `.gitignore` to prevent this file from being tracked if recreated.

Updates `GEMINI.md` documentation to reflect the removal of the Rust source code and test directories from the project structure.
- Add version constant (__version__ = "2.0.0") to AutoQACLib/__init__.py
- Improve type annotations with specific Callable signatures in cleaning_service.py
- Add thread-safety documentation to _execute_cleaning_command method
- Fix Partial Forms toggle to use deferred config save (prevents deadlock)
- Refactor yaml_settings_write to use public API instead of direct cache access
- Improve subprocess resource manager with QWaitCondition for proper synchronization
- Add proper signal disconnection for stop_button in CleaningProgressDialog
- Fix bulk_state_changed signal disconnection in SignalConnectionMixin
- Update About dialog to use __version__ and correct Python version (3.12+)
- Update logging_config to dynamically fetch version from package
- Clean up test files and remove mock fallback in plugin_validator
- Various formatting fixes (trailing newlines, whitespace consistency)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant