## Summary - implement Spec 192 across the targeted Filament record, detail, and edit pages with explicit action-surface inventory and guard coverage - add the focused Spec 192 browser smoke, feature tests, and spec artifacts under `specs/192-record-header-discipline` - improve unhandled promise rejection diagnostics by correlating 419s to the underlying Livewire request URL - disable panel-wide database notification polling on the admin, tenant, and system panels and cover the mitigation with focused tests ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/DatabaseNotificationsPollingTest.php` - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/DatabaseNotificationsPollingTest.php tests/Feature/Filament/UnhandledRejectionLoggerAssetTest.php tests/Feature/Filament/FilamentNotificationsAssetsTest.php tests/Feature/Workspaces/ManagedTenantsLivewireUpdateTest.php tests/Feature/Filament/AdminSmokeTest.php` - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - manual integrated-browser verification of the Spec 192 surfaces and the notification-polling mitigation ## Notes - Livewire v4 / Filament v5 compliance remains unchanged. - Provider registration stays in `bootstrap/providers.php`. - No Global Search behavior was expanded. - No destructive action confirmation semantics were relaxed. - The full test suite was not run in this PR. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #226
338 lines
15 KiB
PHP
338 lines
15 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support\Ui\ActionSurface;
|
|
|
|
use App\Filament\Resources\AlertDestinationResource\Pages\ViewAlertDestination;
|
|
use App\Filament\Resources\BackupSetResource\Pages\ViewBackupSet;
|
|
use App\Filament\Resources\BaselineProfileResource\Pages\ViewBaselineProfile;
|
|
use App\Filament\Resources\BaselineSnapshotResource\Pages\ViewBaselineSnapshot;
|
|
use App\Filament\Resources\EvidenceSnapshotResource\Pages\ViewEvidenceSnapshot;
|
|
use App\Filament\Resources\FindingExceptionResource\Pages\ViewFindingException;
|
|
use App\Filament\Resources\FindingResource\Pages\ViewFinding;
|
|
use App\Filament\Resources\PolicyVersionResource\Pages\ViewPolicyVersion;
|
|
use App\Filament\Resources\ProviderConnectionResource\Pages\ViewProviderConnection;
|
|
use App\Filament\Resources\ReviewPackResource\Pages\ViewReviewPack;
|
|
use App\Filament\Resources\TenantResource\Pages\EditTenant;
|
|
use App\Filament\Resources\TenantResource\Pages\ViewTenant;
|
|
use App\Filament\Resources\TenantReviewResource\Pages\ViewTenantReview;
|
|
use App\Filament\Resources\Workspaces\Pages\ViewWorkspace;
|
|
use App\Support\WorkspaceIsolation\TenantOwnedModelFamilies;
|
|
|
|
final class ActionSurfaceExemptions
|
|
{
|
|
/**
|
|
* @param array<string, string> $componentReasons
|
|
*/
|
|
public function __construct(
|
|
private readonly array $componentReasons,
|
|
) {}
|
|
|
|
public static function baseline(): self
|
|
{
|
|
return new self(array_merge([
|
|
// Baseline allowlist for legacy surfaces. Keep shrinking this list.
|
|
// Declared system table pages are discovered directly; deferred system tooling stays out of scope by not opting in.
|
|
'App\\Filament\\Pages\\Auth\\Login' => 'Auth entry page is out-of-scope for action-surface retrofits in spec 082.',
|
|
'App\\Filament\\Pages\\BreakGlassRecovery' => 'Break-glass flow is governed by dedicated security specs and tests.',
|
|
'App\\Filament\\Pages\\ChooseTenant' => 'Tenant chooser has no contract-style table action surface.',
|
|
'App\\Filament\\Pages\\ChooseWorkspace' => 'Workspace chooser has no contract-style table action surface.',
|
|
'App\\Filament\\Pages\\Monitoring\\Alerts' => 'Monitoring alerts remains exempt because the active admin alerts surface resolves through the cluster entry at /admin/alerts, not this page-class route.',
|
|
'App\\Filament\\Pages\\Tenancy\\RegisterTenant' => 'Tenant onboarding route is covered by onboarding/RBAC specs.',
|
|
'App\\Filament\\Pages\\TenantDashboard' => 'Dashboard retrofit deferred; widget and summary surfaces are excluded from this contract.',
|
|
'App\\Filament\\Pages\\Workspaces\\ManagedTenantOnboardingWizard' => 'Onboarding wizard has dedicated conformance tests in spec 172 (OnboardingVerificationTest, OnboardingVerificationClustersTest, OnboardingVerificationV1_5UxTest) and remains exempt from blanket discovery.',
|
|
'App\\Filament\\Pages\\Workspaces\\ManagedTenantsLanding' => 'Managed-tenant landing retrofit deferred to workspace feature track.',
|
|
], TenantOwnedModelFamilies::actionSurfaceBaselineExemptions()));
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public function all(): array
|
|
{
|
|
return $this->componentReasons;
|
|
}
|
|
|
|
public function reasonForClass(string $className): ?string
|
|
{
|
|
return $this->componentReasons[$className] ?? null;
|
|
}
|
|
|
|
public function hasClass(string $className): bool
|
|
{
|
|
return array_key_exists($className, $this->componentReasons);
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array{
|
|
* surfaceKey: string,
|
|
* classification: string,
|
|
* canonicalNoun: string,
|
|
* panelScope: string,
|
|
* ownerScope: string,
|
|
* routeKind: string,
|
|
* requiresHeaderRemediation: bool,
|
|
* exceptionReason: ?string,
|
|
* maxVisiblePrimaryActions: int,
|
|
* allowsNoPrimaryAction: bool,
|
|
* requiresGroupedSecondaryActions: bool,
|
|
* requiresDangerSeparation: bool,
|
|
* allowsPrimaryNavigation: bool,
|
|
* browserSmokeRequired: bool
|
|
* }>
|
|
*/
|
|
public static function spec192RecordPageInventory(): array
|
|
{
|
|
return [
|
|
ViewBaselineProfile::class => [
|
|
'surfaceKey' => 'baseline_profile_view',
|
|
'classification' => 'remediation_required',
|
|
'canonicalNoun' => 'Baseline profile',
|
|
'panelScope' => 'admin',
|
|
'ownerScope' => 'workspace-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => true,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => false,
|
|
'requiresGroupedSecondaryActions' => true,
|
|
'requiresDangerSeparation' => false,
|
|
'allowsPrimaryNavigation' => false,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewEvidenceSnapshot::class => [
|
|
'surfaceKey' => 'evidence_snapshot_view',
|
|
'classification' => 'remediation_required',
|
|
'canonicalNoun' => 'Evidence snapshot',
|
|
'panelScope' => 'tenant',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => true,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => false,
|
|
'requiresGroupedSecondaryActions' => false,
|
|
'requiresDangerSeparation' => true,
|
|
'allowsPrimaryNavigation' => false,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewFindingException::class => [
|
|
'surfaceKey' => 'finding_exception_view',
|
|
'classification' => 'remediation_required',
|
|
'canonicalNoun' => 'Finding exception',
|
|
'panelScope' => 'tenant',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => true,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => false,
|
|
'requiresDangerSeparation' => true,
|
|
'allowsPrimaryNavigation' => false,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewTenantReview::class => [
|
|
'surfaceKey' => 'tenant_review_view',
|
|
'classification' => 'remediation_required',
|
|
'canonicalNoun' => 'Tenant review',
|
|
'panelScope' => 'tenant',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => true,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => false,
|
|
'requiresGroupedSecondaryActions' => true,
|
|
'requiresDangerSeparation' => true,
|
|
'allowsPrimaryNavigation' => false,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
EditTenant::class => [
|
|
'surfaceKey' => 'tenant_edit',
|
|
'classification' => 'remediation_required',
|
|
'canonicalNoun' => 'Tenant',
|
|
'panelScope' => 'admin',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'edit',
|
|
'requiresHeaderRemediation' => true,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => true,
|
|
'requiresDangerSeparation' => true,
|
|
'allowsPrimaryNavigation' => false,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewTenant::class => [
|
|
'surfaceKey' => 'tenant_view',
|
|
'classification' => 'workflow_heavy_special_type',
|
|
'canonicalNoun' => 'Tenant',
|
|
'panelScope' => 'admin',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => 'Tenant detail remains a workflow-heavy hub for external links, verification/setup, and lifecycle operations. It may show one dominant next step, but it must never silently fall back to a flat multi-button strip.',
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => true,
|
|
'requiresDangerSeparation' => true,
|
|
'allowsPrimaryNavigation' => false,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewProviderConnection::class => [
|
|
'surfaceKey' => 'provider_connection_view',
|
|
'classification' => 'minor_alignment_only',
|
|
'canonicalNoun' => 'Provider connection',
|
|
'panelScope' => 'admin',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => true,
|
|
'requiresDangerSeparation' => true,
|
|
'allowsPrimaryNavigation' => true,
|
|
'browserSmokeRequired' => false,
|
|
],
|
|
ViewFinding::class => [
|
|
'surfaceKey' => 'finding_view',
|
|
'classification' => 'minor_alignment_only',
|
|
'canonicalNoun' => 'Finding',
|
|
'panelScope' => 'tenant',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => true,
|
|
'requiresDangerSeparation' => true,
|
|
'allowsPrimaryNavigation' => true,
|
|
'browserSmokeRequired' => false,
|
|
],
|
|
ViewReviewPack::class => [
|
|
'surfaceKey' => 'review_pack_view',
|
|
'classification' => 'compliant_reference',
|
|
'canonicalNoun' => 'Review pack',
|
|
'panelScope' => 'tenant',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => false,
|
|
'requiresDangerSeparation' => false,
|
|
'allowsPrimaryNavigation' => true,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewAlertDestination::class => [
|
|
'surfaceKey' => 'alert_destination_view',
|
|
'classification' => 'compliant_reference',
|
|
'canonicalNoun' => 'Alert destination',
|
|
'panelScope' => 'admin',
|
|
'ownerScope' => 'workspace-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => false,
|
|
'requiresDangerSeparation' => false,
|
|
'allowsPrimaryNavigation' => true,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewPolicyVersion::class => [
|
|
'surfaceKey' => 'policy_version_view',
|
|
'classification' => 'compliant_reference',
|
|
'canonicalNoun' => 'Policy version',
|
|
'panelScope' => 'admin',
|
|
'ownerScope' => 'workspace-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => false,
|
|
'requiresDangerSeparation' => false,
|
|
'allowsPrimaryNavigation' => true,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewWorkspace::class => [
|
|
'surfaceKey' => 'workspace_view',
|
|
'classification' => 'compliant_reference',
|
|
'canonicalNoun' => 'Workspace',
|
|
'panelScope' => 'admin',
|
|
'ownerScope' => 'workspace-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => false,
|
|
'requiresDangerSeparation' => false,
|
|
'allowsPrimaryNavigation' => true,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewBaselineSnapshot::class => [
|
|
'surfaceKey' => 'baseline_snapshot_view',
|
|
'classification' => 'compliant_reference',
|
|
'canonicalNoun' => 'Baseline snapshot',
|
|
'panelScope' => 'admin',
|
|
'ownerScope' => 'workspace-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => false,
|
|
'requiresDangerSeparation' => false,
|
|
'allowsPrimaryNavigation' => true,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
ViewBackupSet::class => [
|
|
'surfaceKey' => 'backup_set_view',
|
|
'classification' => 'compliant_reference',
|
|
'canonicalNoun' => 'Backup set',
|
|
'panelScope' => 'tenant',
|
|
'ownerScope' => 'tenant-owned',
|
|
'routeKind' => 'view',
|
|
'requiresHeaderRemediation' => false,
|
|
'exceptionReason' => null,
|
|
'maxVisiblePrimaryActions' => 1,
|
|
'allowsNoPrimaryAction' => true,
|
|
'requiresGroupedSecondaryActions' => true,
|
|
'requiresDangerSeparation' => true,
|
|
'allowsPrimaryNavigation' => true,
|
|
'browserSmokeRequired' => true,
|
|
],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array{
|
|
* surfaceKey: string,
|
|
* classification: string,
|
|
* canonicalNoun: string,
|
|
* panelScope: string,
|
|
* ownerScope: string,
|
|
* routeKind: string,
|
|
* requiresHeaderRemediation: bool,
|
|
* exceptionReason: ?string,
|
|
* maxVisiblePrimaryActions: int,
|
|
* allowsNoPrimaryAction: bool,
|
|
* requiresGroupedSecondaryActions: bool,
|
|
* requiresDangerSeparation: bool,
|
|
* allowsPrimaryNavigation: bool,
|
|
* browserSmokeRequired: bool
|
|
* }|null
|
|
*/
|
|
public static function spec192RecordPageSurface(string $className): ?array
|
|
{
|
|
return self::spec192RecordPageInventory()[$className] ?? null;
|
|
}
|
|
}
|