Files
breadcrumb-the-shire/agent-system/runs/ARCH-GATEWAY-COMPLIANCE-001/execution-report.json

347 lines
17 KiB
JSON

{
"task_id": "ARCH-GATEWAY-COMPLIANCE-001",
"plan_ref": "agent-system/runs/ARCH-GATEWAY-COMPLIANCE-001/plan.json",
"status": "done",
"changed_files": [
{
"path": "lib/Service/Access/PermissionGateway.php",
"summary": "DELETED — pure 9-method pass-through to PermissionService. All ~40 callers now use PermissionService directly."
},
{
"path": "lib/Service/Auth/AuthSavedFilterGateway.php",
"summary": "DELETED — 1-method pass-through to UserSavedFilterService. Caller inlined."
},
{
"path": "lib/Service/Auth/AuthTenantSsoGateway.php",
"summary": "DELETED — 4-method pass-through to TenantSsoService (same Auth domain). Callers inlined."
},
{
"path": "lib/Service/Auth/AuthAvatarGateway.php",
"summary": "DELETED — 2-method pass-through to UserAvatarService. Callers inlined."
},
{
"path": "lib/Service/AddressBook/AddressBookDirectoryGateway.php",
"summary": "DELETED — 4-dep facade violating single-dep contract. Orchestration moved to AddressBookService with 4 direct deps."
},
{
"path": "lib/Service/Settings/ThemeConfigService.php",
"summary": "DELETED — renamed to ThemeConfigGateway (config reader = gateway pattern)."
},
{
"path": "lib/Service/Settings/ThemeConfigGateway.php",
"summary": "CREATED — renamed from ThemeConfigService. Identical logic, correct naming."
},
{
"path": "lib/Service/Settings/SettingsAppGateway.php",
"summary": "S4: ThemeConfigService type hint changed to ThemeConfigGateway. Constructor now depends on SettingsMetadataGateway + ThemeConfigGateway — both Gateways, zero Service deps. Violation resolved."
},
{
"path": "lib/Service/Auth/AuthPermissionGateway.php",
"summary": "DELETED — 2-method pass-through to PermissionService. Callers now inject PermissionService directly."
},
{
"path": "lib/Service/User/UserPermissionGateway.php",
"summary": "DELETED — 1-method pass-through to PermissionService. Caller now injects PermissionService directly."
},
{
"path": "lib/Service/AddressBook/AddressBookAvatarGateway.php",
"summary": "DELETED — 1-method pass-through to UserAvatarService. Caller now injects UserAvatarService directly."
},
{
"path": "lib/Service/AddressBook/AddressBookCustomFieldGateway.php",
"summary": "DELETED (Re-Run RG-001) — 2-method gateway wrapping UserCustomFieldValueService + TenantCustomFieldOptionRepository. Calls inlined into AddressBookService."
},
{
"path": "lib/Service/Auth/AuthScopeGateway.php",
"summary": "DELETED (Re-Run RG-004) — pure pass-through to TenantScopeService. All callers now inject TenantScopeService directly."
},
{
"path": "lib/Service/Directory/DirectoryScopeGateway.php",
"summary": "DELETED (Re-Run RG-005) — pure pass-through to TenantScopeService. All callers now inject TenantScopeService directly."
},
{
"path": "lib/Service/User/UserScopeGateway.php",
"summary": "DELETED (Re-Run RG-006) — pure pass-through to TenantScopeService. All callers now inject TenantScopeService directly."
},
{
"path": "lib/Service/Import/Profile/DepartmentImportGateway.php",
"summary": "Re-Run RG-002: Removed DepartmentService dep. Now repo-only gateway (DepartmentRepositoryInterface, TenantRepositoryInterface)."
},
{
"path": "lib/Service/Import/Profile/DepartmentImportProfile.php",
"summary": "Re-Run RG-002: Added direct DepartmentService dep. Calls createFromAdmin() on service instead of gateway."
},
{
"path": "lib/Service/Import/Profile/UserImportGateway.php",
"summary": "Re-Run RG-003: Removed UserAccountService dep. Now repo-only gateway (4 repository interfaces)."
},
{
"path": "lib/Service/Import/Profile/UserImportProfile.php",
"summary": "Re-Run RG-003: Added direct UserAccountService dep. Calls createFromAdmin() on service instead of gateway."
},
{
"path": "lib/Service/AddressBook/AddressBookService.php",
"summary": "Re-Run RG-001+005: Replaced AddressBookCustomFieldGateway with UserCustomFieldValueService. Replaced DirectoryScopeGateway with TenantScopeService."
},
{
"path": "lib/Service/AddressBook/AddressBookServicesFactory.php",
"summary": "Re-Run: Added TenantScopeService constructor dep. Removed AddressBookCustomFieldGateway creation."
},
{
"path": "lib/Service/Auth/ApiTokenService.php",
"summary": "Re-Run RG-004: Changed dep AuthScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/Auth/ApiTokenEndpointService.php",
"summary": "Re-Run RG-004: Changed dep AuthScopeGateway → TenantScopeService."
},
{
"path": "lib/Http/ApiAuth.php",
"summary": "Re-Run RG-004: Changed dep AuthScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/Auth/AuthGatewayFactory.php",
"summary": "Re-Run RG-004: Removed createAuthScopeGateway(). Added getTenantScopeService() accessor."
},
{
"path": "lib/Service/Auth/AuthServicesFactory.php",
"summary": "Re-Run RG-004: Removed createAuthScopeGateway() delegate. ApiTokenService gets TenantScopeService via authGatewayFactory."
},
{
"path": "lib/Service/Org/DepartmentService.php",
"summary": "Re-Run RG-005: Changed dep DirectoryScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/Access/UserAuthorizationPolicy.php",
"summary": "Re-Run RG-005: Changed dep DirectoryScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/Access/TenantAuthorizationPolicy.php",
"summary": "Re-Run RG-005: Changed dep DirectoryScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/Access/DepartmentAuthorizationPolicy.php",
"summary": "Re-Run RG-005: Changed dep DirectoryScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/Access/AccessPolicyFactory.php",
"summary": "Re-Run RG-005: Changed dep DirectoryScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/Directory/DirectoryGatewayFactory.php",
"summary": "Re-Run RG-005: Removed createDirectoryScopeGateway(). Added getTenantScopeService() accessor."
},
{
"path": "lib/Service/Directory/DirectoryServicesFactory.php",
"summary": "Re-Run RG-005: DepartmentService gets TenantScopeService from directoryGatewayFactory. createDirectoryScopeGateway() → getTenantScopeService()."
},
{
"path": "lib/Service/User/UserAccountService.php",
"summary": "Re-Run RG-006: Changed dep UserScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/User/UserTenantContextService.php",
"summary": "Re-Run RG-006: Changed dep UserScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/CustomField/UserCustomFieldValueService.php",
"summary": "Re-Run RG-006: Changed dep UserScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/CustomField/CustomFieldServicesFactory.php",
"summary": "Re-Run RG-006: Changed dep UserScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/User/UserGatewayFactory.php",
"summary": "Re-Run RG-006: Removed createUserScopeGateway(). Added getTenantScopeService() accessor."
},
{
"path": "lib/Service/User/UserServicesFactory.php",
"summary": "Re-Run RG-006: UserAccountService and UserTenantContextService get TenantScopeService from userGatewayFactory. Removed createUserScopeGateway() delegate."
},
{
"path": "lib/Service/Import/ImportService.php",
"summary": "Re-Run RG-006: Changed dep UserScopeGateway → TenantScopeService."
},
{
"path": "lib/Service/Import/ImportServicesFactory.php",
"summary": "Re-Run RG-002+003+006: Added TenantScopeService constructor dep. Updated UserImportProfile + DepartmentImportProfile construction. ImportService gets TenantScopeService."
},
{
"path": "lib/App/Container/Registrars/AuthRegistrar.php",
"summary": "Re-Run RG-004: Removed AuthScopeGateway registration. ApiTokenEndpointService gets TenantScopeService."
},
{
"path": "lib/App/Container/Registrars/DirectoryRegistrar.php",
"summary": "Re-Run RG-005: Removed DirectoryScopeGateway registration."
},
{
"path": "lib/App/Container/Registrars/UserRegistrar.php",
"summary": "Re-Run RG-006: Removed UserScopeGateway registration."
},
{
"path": "lib/App/Container/Registrars/ServiceFactoryRegistrar.php",
"summary": "Re-Run RG-005+006: Changed DirectoryScopeGateway → TenantScopeService for AccessPolicyFactory. Changed UserScopeGateway → TenantScopeService for CustomFieldServicesFactory. Added TenantScopeService to ImportServicesFactory and AddressBookServicesFactory wiring."
},
{
"path": "lib/Support/helpers/app.php",
"summary": "Re-Run RG-004: ApiAuth::configure() resolver changed AuthScopeGateway → TenantScopeService."
},
{
"path": "pages/admin/users/index().php",
"summary": "Re-Run RG-005: Changed DirectoryScopeGateway → TenantScopeService (3 occurrences)."
},
{
"path": "pages/admin/users/create().php",
"summary": "Re-Run RG-005: Changed DirectoryScopeGateway → TenantScopeService."
},
{
"path": "pages/admin/users/edit($id).php",
"summary": "Re-Run RG-005: Changed DirectoryScopeGateway → TenantScopeService."
},
{
"path": "pages/admin/users/access-pdf-bulk().php",
"summary": "Re-Run RG-005: Changed DirectoryScopeGateway → TenantScopeService."
},
{
"path": "pages/admin/departments/create().php",
"summary": "Re-Run RG-005: Changed DirectoryScopeGateway → TenantScopeService."
},
{
"path": "pages/admin/departments/edit($id).php",
"summary": "Re-Run RG-005: Changed DirectoryScopeGateway → TenantScopeService."
},
{
"path": "tests/Service/AddressBook/AddressBookServiceTest.php",
"summary": "Re-Run: Mocks updated — DirectoryScopeGateway → TenantScopeService, AddressBookCustomFieldGateway → UserCustomFieldValueService."
},
{
"path": "tests/Service/Access/UserAuthorizationPolicyTest.php",
"summary": "Re-Run: Mocks updated — DirectoryScopeGateway → TenantScopeService."
},
{
"path": "tests/Service/Access/TenantAuthorizationPolicyTest.php",
"summary": "Re-Run: Mocks updated — DirectoryScopeGateway → TenantScopeService."
},
{
"path": "tests/Service/Access/DepartmentAuthorizationPolicyTest.php",
"summary": "Re-Run: Mocks updated — DirectoryScopeGateway → TenantScopeService."
},
{
"path": "tests/Service/User/UserAccountServiceTest.php",
"summary": "Re-Run: Mocks updated — UserScopeGateway → TenantScopeService."
},
{
"path": "tests/Service/Import/ImportServiceTest.php",
"summary": "Re-Run: Mocks updated — UserScopeGateway → TenantScopeService."
}
],
"guard_evidence": [
{
"guard_id": "GR-CORE-001",
"status": "pass",
"evidence": "All gateway violations resolved. Initial run: 9 gateways fixed. Re-Run: 7 additional findings (RG-001..RG-007) fixed — AddressBookCustomFieldGateway deleted, DepartmentImportGateway/UserImportGateway stripped to repo-only, AuthScopeGateway/DirectoryScopeGateway/UserScopeGateway deleted (pure pass-throughs to TenantScopeService). Zero Gateway→Service injections remain: rg scan of all *Gateway.php constructors finds 0 Service imports."
},
{
"guard_id": "GR-CORE-002",
"status": "pass",
"evidence": "Strict layering preserved. Repositories stay in Repository layer, Services in Service layer. No new cross-layer violations. DI container registrars updated to match new wiring. No circular dependencies introduced."
},
{
"guard_id": "GR-TEST-001",
"status": "pass",
"evidence": "591 tests run, 0 errors introduced by this task. 1 pre-existing failure (TranslationKeysTest) verified on clean branch via git stash. All task-related tests green."
},
{
"guard_id": "GR-TEST-002",
"status": "pass",
"evidence": "Test modifications are strictly wiring-level, not behavioral: (1) Mock type hints updated where deleted gateways were replaced by their underlying dependency (e.g. DirectoryScopeGateway→TenantScopeService). (2) Mock method names updated where AddressBookDirectoryGateway facade methods (listTenants, listDepartments, listActiveRoles, isStrictScope) were replaced by direct repository/service calls with their native method names (list, listByTenantIds, listActive, isStrict). (3) One removed mock (listOptionsByDefinitionIds) where the gateway was deleted and the call was inlined. All test assertions and behavioral expectations remain identical — zero behavioral regressions."
},
{
"guard_id": "GR-LANG-001",
"status": "pass",
"evidence": "All PHP files follow PSR-4 namespace conventions. No new use-statement conflicts. Import ordering fixed by php-cs-fixer."
},
{
"guard_id": "GR-LANG-002",
"status": "pass",
"evidence": "PHPStan level 5: 0 new errors from this task. 4 pre-existing errors in tests/Architecture/AuthzUiContractTest.php (nullable offset warnings) verified present on clean branch before task changes."
}
],
"commands": [
{ "cmd": "docker compose exec php vendor/bin/phpunit --no-coverage", "result": "pass" },
{
"cmd": "docker compose exec php vendor/bin/phpstan analyse -c phpstan.neon --no-progress",
"result": "pass"
},
{
"cmd": "docker compose exec php vendor/bin/php-cs-fixer fix --dry-run --config=.php-cs-fixer.dist.php",
"result": "pass"
},
{
"cmd": "rg 'AuthScopeGateway|DirectoryScopeGateway|UserScopeGateway|AddressBookCustomFieldGateway' lib/ pages/ tests/ --type php",
"result": "pass"
},
{
"cmd": "grep -r Gateway→Service injection scan across all *Gateway.php constructors",
"result": "pass"
},
{
"cmd": "git stash && docker compose exec php vendor/bin/phpunit --filter TranslationKeysTest (verify pre-existing); git stash pop",
"result": "fail_preexisting",
"notes": "TranslationKeysTest fails identically on clean branch — confirmed pre-existing, not caused by this task."
},
{
"cmd": "docker compose exec php vendor/bin/phpstan analyse -c phpstan.neon --no-progress | grep AuthzUiContractTest",
"result": "fail_preexisting",
"notes": "4 errors all in tests/Architecture/AuthzUiContractTest.php — nullable offset warnings. Confirmed pre-existing."
}
],
"quality_gate_results": [
{
"gate_id": "QG-001",
"result": "pass",
"notes": "591 tests, 0 errors introduced by this task. 1 pre-existing failure in TranslationKeysTest (missing i18n key 'No active roles are configured yet.') — verified pre-existing: same failure reproduces on clean branch (git stash → phpunit → same failure). This task introduced zero test failures."
},
{
"gate_id": "QG-002",
"result": "pass",
"notes": "0 new PHPStan errors introduced by this task. 4 pre-existing errors exist in tests/Architecture/AuthzUiContractTest.php (nullable offset warnings) — these are unrelated to gateway refactoring and present on the clean branch before any task changes. This task introduced zero PHPStan errors."
},
{
"gate_id": "QG-003",
"result": "pass",
"notes": "Architecture contract preserved. No gateway wraps a Service class."
},
{
"gate_id": "QG-004",
"result": "pass",
"notes": "Zero structural matches for AuthScopeGateway, DirectoryScopeGateway, UserScopeGateway, AddressBookCustomFieldGateway across lib/, tests/, pages/. All *Gateway.php constructors verified: zero Service imports remain."
},
{
"gate_id": "QG-006",
"result": "pass",
"notes": "php-cs-fixer fix --dry-run: 0 of 522 files need fixing."
}
],
"test_results": [
{ "name": "tests/Service/Access/UserAuthorizationPolicyTest.php", "result": "pass" },
{ "name": "tests/Service/Access/TenantAuthorizationPolicyTest.php", "result": "pass" },
{ "name": "tests/Service/Access/DepartmentAuthorizationPolicyTest.php", "result": "pass" },
{ "name": "tests/Service/Access/RoleAuthorizationPolicyTest.php", "result": "pass" },
{ "name": "tests/Service/Access/PermissionAuthorizationPolicyTest.php", "result": "pass" },
{ "name": "tests/Service/Access/SettingsAuthorizationPolicyTest.php", "result": "pass" },
{ "name": "tests/Service/AddressBook/AddressBookServiceTest.php", "result": "pass" },
{ "name": "tests/Service/Auth/AuthServiceTest.php", "result": "pass" },
{ "name": "tests/Service/Auth/AuthSessionTenantContextServiceTest.php", "result": "pass" },
{ "name": "tests/Service/Auth/RememberMeServiceTest.php", "result": "pass" },
{ "name": "tests/Service/Import/ImportServiceTest.php", "result": "pass" },
{ "name": "tests/Service/Tenant/TenantScopeServiceTest.php", "result": "pass" },
{ "name": "tests/Service/User/UserAccountServiceTest.php", "result": "pass" },
{ "name": "tests/Service/Settings/SettingsAppGatewayTest.php", "result": "pass" },
{ "name": "tests/Support/ThemeResolutionTest.php", "result": "pass" },
{ "name": "tests/Architecture/ContainerFactoryContractTest.php", "result": "pass" }
],
"open_items": []
}