From 807d574d3181093c305423d3667b5b768593c464 Mon Sep 17 00:00:00 2001 From: ahmido Date: Sun, 29 Mar 2026 21:14:17 +0000 Subject: [PATCH] feat: add tenant governance aggregate contract and action surface follow-ups (#199) ## Summary - amend the operator UI constitution and related SpecKit templates for the new UI/UX governance rules - add Spec 168 artifacts plus the tenant governance aggregate implementation used by the tenant dashboard, banner, and baseline compare landing surfaces - normalize Filament action surfaces around clickable-row inspection, grouped secondary actions, and explicit action-surface declarations across enrolled resources and pages - fix post-suite regressions in membership cache priming, finding workflow state refresh, tenant review derived-state invalidation, and tenant-bound backup-set related navigation ## Commit Series - `docs: amend operator UI constitution` - `spec: add tenant governance aggregate contract` - `feat: add tenant governance aggregate contract` - `refactor: normalize filament action surfaces` - `fix: resolve post-suite state regressions` ## Testing - `vendor/bin/sail artisan test --compact` - Result: `3176 passed, 8 skipped (17384 assertions)` ## Notes - Livewire v4 / Filament v5 stack remains unchanged - no provider registration changes; `bootstrap/providers.php` remains the relevant location - no new global-search resources or asset-registration changes in this branch Co-authored-by: Ahmed Darrazi Reviewed-on: https://git.cloudarix.de/ahmido/TenantAtlas/pulls/199 --- .github/agents/copilot-instructions.md | 4 +- .specify/memory/constitution.md | 474 ++++-- .specify/templates/plan-template.md | 7 +- .specify/templates/spec-template.md | 26 +- .specify/templates/tasks-template.md | 13 +- app/Filament/Pages/BaselineCompareLanding.php | 21 +- app/Filament/Pages/InventoryCoverage.php | 18 + app/Filament/Pages/Monitoring/Operations.php | 19 + app/Filament/Pages/NoAccess.php | 13 + .../TenantlessOperationRunViewer.php | 18 + app/Filament/Pages/TenantDiagnostics.php | 13 + .../Pages/TenantRequiredPermissions.php | 13 + .../Resources/AlertDeliveryResource.php | 5 +- .../Resources/AlertDestinationResource.php | 8 - app/Filament/Resources/AlertRuleResource.php | 8 - .../Resources/BackupScheduleResource.php | 8 +- ...upScheduleOperationRunsRelationManager.php | 37 +- .../BackupItemsRelationManager.php | 69 +- .../Resources/BaselineProfileResource.php | 14 +- .../Resources/EvidenceSnapshotResource.php | 49 +- app/Filament/Resources/FindingResource.php | 5 +- .../Resources/OperationRunResource.php | 10 +- app/Filament/Resources/PolicyResource.php | 4 +- .../VersionsRelationManager.php | 9 +- .../Resources/ProviderConnectionResource.php | 2 +- app/Filament/Resources/RestoreRunResource.php | 23 +- app/Filament/Resources/ReviewPackResource.php | 4 +- app/Filament/Resources/TenantResource.php | 79 +- .../TenantMembershipsRelationManager.php | 42 + .../Resources/TenantReviewResource.php | 5 +- .../WorkspaceMembershipsRelationManager.php | 85 +- .../Workspaces/WorkspaceResource.php | 6 +- .../System/Pages/Directory/Tenants.php | 14 + .../System/Pages/Directory/Workspaces.php | 14 + app/Filament/System/Pages/Ops/Failures.php | 14 + app/Filament/System/Pages/Ops/Runs.php | 14 + app/Filament/System/Pages/Ops/Stuck.php | 14 + .../System/Pages/Security/AccessLogs.php | 13 + .../Widgets/Dashboard/BaselineCompareNow.php | 31 +- .../Widgets/Dashboard/NeedsAttention.php | 67 +- .../Tenant/BaselineCompareCoverageBanner.php | 35 +- app/Services/Auth/CapabilityResolver.php | 20 +- .../TenantReviewLifecycleService.php | 28 +- .../Tenants/TenantActionPolicySurface.php | 2 +- .../Baselines/BaselineCompareStats.php | 29 + .../Baselines/TenantGovernanceAggregate.php | 111 ++ .../TenantGovernanceAggregateResolver.php | 71 + .../Resolvers/BackupSetReferenceResolver.php | 2 +- .../ActionSurface/ActionSurfaceExemptions.php | 11 +- .../Ui/DerivedState/DerivedStateFamily.php | 6 +- .../TenantOwnedModelFamilies.php | 4 +- docs/HANDOVER.md | 6 +- docs/product/principles.md | 27 +- docs/product/standards/README.md | 4 +- specs/082-action-surface-contract/spec.md | 11 +- specs/166-finding-governance-health/spec.md | 6 +- ...-scoped-derived-state.logical.openapi.yaml | 81 + .../checklists/requirements.md | 34 + .../tenant-governance-aggregate.openapi.yaml | 335 +++++ .../data-model.md | 213 +++ .../plan.md | 260 ++++ .../quickstart.md | 81 + .../research.md | 49 + .../spec.md | 202 +++ .../tasks.md | 217 +++ tests/Browser/TenantMembershipsPageTest.php | 52 + ...ckupScheduleLifecycleAuthorizationTest.php | 41 + ...heduleOperationRunsRelationManagerTest.php | 4 +- .../Baselines/BaselineCompareStatsTest.php | 117 ++ .../BaselineCompareSummaryAssessmentTest.php | 82 + .../TenantGovernanceAggregateResolverTest.php | 326 ++++ .../Evidence/EvidenceSnapshotResourceTest.php | 12 +- .../BaselineCompareCoverageBannerTest.php | 41 + .../BaselineCompareSummaryConsistencyTest.php | 109 ++ .../Filament/NeedsAttentionWidgetTest.php | 62 + ...nantGovernanceAggregateMemoizationTest.php | 122 ++ .../Guards/ActionSurfaceContractTest.php | 1318 ++++++++++++++++- .../DerivedStateConsumerAdoptionGuardTest.php | 3 +- ...ackupItemsRelationManagerSemanticsTest.php | 15 +- .../TenantActionSurfaceConsistencyTest.php | 30 +- .../TenantLifecycleActionVisibilityTest.php | 1 - .../TenantReviewUiContractTest.php | 23 + .../Tenants/TenantActionPolicySurfaceTest.php | 13 +- 83 files changed, 5016 insertions(+), 492 deletions(-) create mode 100644 app/Support/Baselines/TenantGovernanceAggregate.php create mode 100644 app/Support/Baselines/TenantGovernanceAggregateResolver.php create mode 100644 specs/168-tenant-governance-aggregate-contract/checklists/requirements.md create mode 100644 specs/168-tenant-governance-aggregate-contract/contracts/tenant-governance-aggregate.openapi.yaml create mode 100644 specs/168-tenant-governance-aggregate-contract/data-model.md create mode 100644 specs/168-tenant-governance-aggregate-contract/plan.md create mode 100644 specs/168-tenant-governance-aggregate-contract/quickstart.md create mode 100644 specs/168-tenant-governance-aggregate-contract/research.md create mode 100644 specs/168-tenant-governance-aggregate-contract/spec.md create mode 100644 specs/168-tenant-governance-aggregate-contract/tasks.md create mode 100644 tests/Browser/TenantMembershipsPageTest.php create mode 100644 tests/Feature/Baselines/TenantGovernanceAggregateResolverTest.php create mode 100644 tests/Feature/Filament/TenantGovernanceAggregateMemoizationTest.php diff --git a/.github/agents/copilot-instructions.md b/.github/agents/copilot-instructions.md index 12042b33..49de59d3 100644 --- a/.github/agents/copilot-instructions.md +++ b/.github/agents/copilot-instructions.md @@ -114,6 +114,8 @@ ## Active Technologies - PostgreSQL using existing `findings`, `finding_exceptions`, related decision tables, and existing DB-backed summary sources; no schema changes required (166-finding-governance-health) - PHP 8.4.15 + Laravel 12, Filament v5, Livewire v4, Pest v4, Tailwind CSS v4, existing `ArtifactTruthPresenter`, `OperationUxPresenter`, `RelatedNavigationResolver`, `AppServiceProvider`, `BadgeCatalog`, `BadgeRenderer`, and current Filament resource/page seams (167-derived-state-memoization) - PostgreSQL unchanged; feature adds no persistence and relies on request-local in-memory state only (167-derived-state-memoization) +- PHP 8.4.15 + Laravel 12, Filament v5, Livewire v4, Pest v4, existing `BaselineCompareStats`, `BaselineCompareSummaryAssessor`, `BaselineCompareLanding`, `BaselineCompareNow`, `NeedsAttention`, `BaselineCompareCoverageBanner`, and `RequestScopedDerivedStateStore` from Spec 167 (168-tenant-governance-aggregate-contract) +- PostgreSQL unchanged; no new persistence, cache store, or durable summary artifac (168-tenant-governance-aggregate-contract) - PHP 8.4.15 (feat/005-bulk-operations) @@ -133,8 +135,8 @@ ## Code Style PHP 8.4.15: Follow standard conventions ## Recent Changes +- 168-tenant-governance-aggregate-contract: Added PHP 8.4.15 + Laravel 12, Filament v5, Livewire v4, Pest v4, existing `BaselineCompareStats`, `BaselineCompareSummaryAssessor`, `BaselineCompareLanding`, `BaselineCompareNow`, `NeedsAttention`, `BaselineCompareCoverageBanner`, and `RequestScopedDerivedStateStore` from Spec 167 - 167-derived-state-memoization: Added PHP 8.4.15 + Laravel 12, Filament v5, Livewire v4, Pest v4, Tailwind CSS v4, existing `ArtifactTruthPresenter`, `OperationUxPresenter`, `RelatedNavigationResolver`, `AppServiceProvider`, `BadgeCatalog`, `BadgeRenderer`, and current Filament resource/page seams - 166-finding-governance-health: Added PHP 8.4.15 + Laravel 12, Filament v5, Livewire v4, Pest v4, Tailwind CSS v4, existing `Finding`, `FindingException`, `FindingRiskGovernanceResolver`, `BadgeCatalog`, `BadgeRenderer`, `FilterOptionCatalog`, and tenant dashboard widgets -- 165-baseline-summary-trust: Added PHP 8.4, Laravel 12, Blade, Filament v5, Livewire v4 + Filament v5, Livewire v4, Pest v4, Laravel Sail, existing `BaselineCompareStats`, `BaselineCompareExplanationRegistry`, `ReasonPresenter`, `BadgeCatalog` or `BadgeRenderer`, `UiEnforcement`, and `OperationRunLinks` diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index 8338df7b..ddd66d0b 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -1,32 +1,32 @@