# HVAC Role Manager - Decision Log ## [2025-04-14 18:58] - Initial Role Manager Design Decisions ### Role Inheritance Architecture - **Decision**: Implement hierarchical role inheritance with multiple parent support - **Rationale**: - Allows flexible permission structures - Supports complex organizational hierarchies - Enables granular permission management - **Implementation Details**: - Roles can inherit from multiple parent roles - Capabilities are merged from all parent roles - Conflicts are detected and managed explicitly ### Capability Management Approach - **Decision**: Use WordPress capability system with custom extensions - **Rationale**: - Maintains compatibility with WordPress core - Leverages existing security mechanisms - Allows seamless integration with plugins - **Implementation Details**: - Extended capability checking for complex scenarios - Transaction-based role modifications - Automatic capability cleanup ### TEC Integration Strategy - **Decision**: Implement lightweight TEC capability integration - **Rationale**: - Maintains separation of concerns - Ensures compatibility with TEC updates - Simplifies maintenance - **Implementation Details**: - Support for TEC-specific capabilities - Integration examples in documentation - Clear separation between core and TEC functionality ### Security Considerations - **Decision**: Implement comprehensive security measures - **Rationale**: - Protect WordPress core roles - Prevent capability escalation - Ensure proper cleanup - **Implementation Details**: - Core role protection - Capability validation - Transaction role management - Automatic cleanup mechanisms ## [2025-04-14 18:58] - Documentation Structure - **Decision**: Create comprehensive, well-organized documentation - **Rationale**: - Ensures maintainability - Facilitates adoption - Supports future development - **Implementation Details**: - API reference documentation - Integration examples - Best practices guide [2025-04-23 13:19:25] - Debugging MVP integration tests: Identified that Playwright E2E tests fail due to login failure on the staging environment via the custom community login page. The page redirects to wp-login.php instead of the dashboard after submission, without displaying an explicit error. Likely causes are issues with the custom login page's backend processing or redirection logic on staging. Documentation regarding Playwright test execution command and location (`./tests/run-tests.sh pw`) was found to be outdated and has been updated in relevant files (`docs/mvp-integration-testing-plan.md`, `docs/REQUIREMENTS.md`, `wordpress-dev/README.md`, `memory-bank/playwright-test-plan.md`). Further server-side debugging is needed to fix the login issue. [2025-04-23 16:19:18] - Debugging MVP integration tests: Confirmed that the `test_trainer` user does not exist on the staging environment via WP-CLI. This is the root cause of the Playwright E2E test login failures. Investigation into existing scripts and documentation (`wordpress-dev/bin/`, `tests/`, `docs/testing.md`) did not reveal an automated script for creating these test users on staging. Manual creation or development of a new setup script is required. - Testing guidelines