Audit Phase 10: Error & Logging Boundaries#53
Audit Phase 10: Error & Logging Boundaries#53google-labs-jules[bot] wants to merge 7 commits intomainfrom
Conversation
- Created docs/audit/PHASE10_AUDIT.md - Verified compliance with ADR-012, ADR-013, ADR-014, ADR-016 - Identified blocking violations in Exception Taxonomy and Driver Leaks (MySQL/Redis) - Status: BLOCKED
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
- Established full ADR-012 Exception Taxonomy extending RepositoryException. - Updated GenericMySQLRepository to wrap PDOException and catch all Throwables to prevent leaks. - Updated GenericRedisRepository to wrap driver exceptions and use InvalidPaginationException/UnsafeOperationException. - Updated GenericMongoRepository to wrap Mongo exceptions. - Sanitized exception messages to be deterministic and non-leaking. - Verified all new exception classes are defined and present.
- Refactored `paginate`/`paginateBy` in all Generic Repositories to catch `\Throwable` for strict no-leak guarantee. - Implemented specific exception mapping: `InvalidArgumentException` → `InvalidPaginationException`, Driver failures → `QueryExecutionException`/`DriverOperationException`. - Verified all exception classes exist and inherit correctly from `RepositoryException`. - Updated Audit file to PASS.
…taxonomy. - Updated GenericMySQLRepositoryExceptionTest to assert QueryExecutionException. - Updated GenericMongoRepositoryExceptionTest to assert QueryExecutionException and DriverOperationException. - Updated GenericMySQLCoverageTest and GenericMongoCoverageTest to align with new exception hierarchy and messages. - Updated GenericRedisCoverageTest to assert UnsafeOperationException. - Updated GenericMySQLRepositoryFakeTest to expect InvalidFilterException instead of InvalidArgumentException. - All tests now assert strictly typed exceptions and deterministic messages as per ADR-012.
Updated: - GenericMongoCoverageTest::testGetCollectionObjThrowsExceptionIfNameMissing - GenericMongoCoverageTest::testGetCollectionObjThrowsExceptionIfDriverFails - GenericMySQLCoverageTest::testGetPdoThrowsExceptionWhenDriverIsNotPdo All tests now assert QueryExecutionException and the deterministic 'Find operation failed.' message, reflecting the strict no-leak boundaries of Phase 10.
- Updated `RepositoryInterfaceSignatureTest.php` with correct `ReflectionClass` generics and `ReflectionType` handling. - Updated `MongoCastingRegressionTest.php` to use strict `MockObject` types and avoid `object::class` mocking. - Removed dead catch block in `GenericRedisRepositoryFakeTest.php`. - No source code changes. All tests align with strict typing requirements.
- Updated RepositoryInterfaceSignatureTest to use ReflectionNamedType safely and fixed union type sorting. - Refactored MongoCastingRegressionTest to use a typed factory method for the anonymous repository class, resolving generic type mismatches. - All changes are strictly within the test suite.
Performed a comprehensive read-only audit of the codebase against Phase 10 requirements. Identified significant ADR-012 violations where driver exceptions leak and the mandatory exception taxonomy is missing. The project is marked as BLOCKED pending remediation.
PR created automatically by Jules for task 4092440656989575566 started by @Maatify