## Summary - add a workspace-scoped baseline compare matrix page under baseline profiles - derive matrix tenant summaries, subject rows, cell states, freshness, and trust from existing snapshots, compare runs, and findings - add confirmation-gated `Compare assigned tenants` actions on the baseline detail and matrix surfaces without introducing a workspace umbrella run - preserve matrix navigation context into tenant compare and finding drilldowns and add centralized matrix badge semantics - include spec, plan, data model, contracts, quickstart, tasks, and focused feature/browser coverage for Spec 190 ## Verification - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Unit/Badges/BaselineCompareMatrixBadgesTest.php tests/Feature/Baselines/BaselineCompareMatrixBuilderTest.php tests/Feature/Baselines/BaselineCompareMatrixCompareAllActionTest.php tests/Feature/Baselines/BaselineComparePerformanceGuardTest.php tests/Feature/Filament/BaselineCompareMatrixPageTest.php tests/Feature/Filament/BaselineProfileCompareStartSurfaceTest.php tests/Feature/Rbac/BaselineCompareMatrixAuthorizationTest.php tests/Feature/Guards/ActionSurfaceContractTest.php tests/Feature/Guards/NoAdHocStatusBadgesTest.php tests/Feature/Guards/NoDiagnosticWarningBadgesTest.php` - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - completed an integrated-browser smoke flow locally for matrix render, differ filter, finding drilldown round-trip, and `Compare assigned tenants` confirmation/action Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #221
5.5 KiB
5.5 KiB
Quickstart: Workspace Baseline Compare Matrix V1
Goal
Implement one workspace-scoped baseline compare matrix that lets an operator inspect visible assigned tenants against one baseline reference, trigger compare execution across the visible assigned set, and drill into existing tenant compare or finding surfaces without introducing a new persisted cross-tenant compare artifact.
Implementation Sequence
-
Add the new workspace matrix page and baseline entry action.
- Add a new workspace Filament page for
/admin/baseline-profiles/{record}/compare-matrix. - Add
Open compare matrixto the existing baseline profile detail header. - Keep the page scoped to one selected baseline profile and one explicit reference snapshot.
- Add a new workspace Filament page for
-
Build the live aggregation layer over existing truth.
- Create a narrow matrix builder under the existing baseline-support namespace.
- Use
BaselineSnapshotTruthResolverandBaselineSnapshotItemfor the reference axis. - Use latest relevant
baseline_compareruns plus theircontext['baseline_compare']payload for freshness, coverage, and trust. - Use compare-created findings for technical difference severity and drilldown targets.
- Keep the matrix derived only; do not add persistence.
-
Add compare-all fan-out without a workspace umbrella run.
- Extend the baseline compare start path so the matrix and baseline detail can iterate visible assigned tenants and call the existing tenant compare start logic.
- Keep confirmation, queued toast behavior, and run observability aligned with existing
OperationRunsemantics. - Report partial success, already queued, and blocked starts honestly from the underlying per-tenant results.
-
Bind filtering, subject focus, and drilldown continuity.
- Add policy-type, state, and severity filters.
- Add tenant and subject sorting.
- Reuse
CanonicalNavigationContext,RelatedNavigationResolver, and existing destination routes for tenant, finding, and run drilldowns. - Preserve a clear return path to the matrix.
-
Add regression coverage.
- Cover live aggregation, compare-all, stale/no-result/ambiguous truth, visible-set RBAC filtering, and drilldown continuity.
- Add one browser smoke test to prove the interactive matrix surface renders and performs the core operator flow.
Suggested Test Files
apps/platform/tests/Feature/Baselines/BaselineCompareMatrixBuilderTest.phpapps/platform/tests/Feature/Baselines/BaselineCompareMatrixCompareAllActionTest.phpapps/platform/tests/Feature/Filament/BaselineCompareMatrixPageTest.phpapps/platform/tests/Feature/Rbac/BaselineCompareMatrixAuthorizationTest.phpapps/platform/tests/Browser/Spec190BaselineCompareMatrixSmokeTest.phpapps/platform/tests/Feature/Guards/ActionSurfaceContractTest.php
Existing Suites To Extend Or Keep Green
apps/platform/tests/Feature/Baselines/BaselineCompareStatsTest.phpapps/platform/tests/Feature/Baselines/BaselineCompareFindingsTest.phpapps/platform/tests/Feature/Baselines/BaselineProfileAuthorizationTest.phpapps/platform/tests/Feature/Filament/WorkspaceOverview*suites that currently consume baseline attention summariesapps/platform/tests/Feature/Guards/ActionSurfaceContractTest.php
Minimum Verification Commands
Run all commands through Sail from apps/platform.
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Baselines/BaselineCompareMatrixBuilderTest.php
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Baselines/BaselineCompareMatrixCompareAllActionTest.php
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/BaselineCompareMatrixPageTest.php
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Rbac/BaselineCompareMatrixAuthorizationTest.php
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Baselines/BaselineCompareStatsTest.php
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Baselines/BaselineCompareFindingsTest.php
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Guards/ActionSurfaceContractTest.php
cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent
Manual Acceptance Checklist
- Open a baseline profile with a usable reference snapshot and verify
Open compare matrixlands on the new workspace matrix page. - Confirm the page shows the selected baseline profile, reference snapshot, visible assigned tenant count, and truthful per-tenant and per-subject summaries.
- Filter the matrix by policy type and by state and confirm the visible rows, columns, and counts update without implying hidden tenants.
- Open a differing, missing, or ambiguous cell and confirm the drilldown reaches an existing tenant compare or finding surface with a clear return path.
- Trigger
Compare assigned tenantsand confirm the modal describessimulation only, the launch fans out to visible assigned tenants only, and partial success is visible. - Verify a tenant with no prior compare reads as
Not compared, not healthy. - Verify a tenant with stale compare truth reads as stale and does not look current.
- Verify a user with partial tenant visibility sees only allowed tenants and no hidden-tenant aggregate counts.
Deployment Notes
- No new database migration is expected.
- No new assets are planned; normal Filament asset publishing behavior remains unchanged.
Compare assigned tenantsreuses existing tenant compare runs only, so no new queue worker topology or deployment artifact is required.