# Quickstart: Baseline Compare Matrix: High-Density Operator Mode

## Goal

Turn the existing baseline compare matrix into a denser operator surface without changing its underlying compare truth. Multi-tenant use should favor high-density cross-tenant scanning, while single-tenant use should collapse into a calmer compact comparison view.

## Implementation Sequence

1. Add page-level presentation state.
   - Add `auto`, `dense`, and `compact` route-local mode state.
   - Resolve the active mode from visible tenant count unless the operator explicitly overrides it.
   - Expose `lastUpdatedAt`, staged-filter state, and passive auto-refresh state on the page.

2. Build the dense multi-tenant rendering contract.
   - Keep the subject column sticky.
   - Reduce dense-cell chrome to state, trust, freshness, and attention.
   - Move repeated follow-up links into compact secondary affordances.

3. Build the compact single-tenant rendering contract.
   - Replace the pseudo-matrix layout with a compact subject-result list.
   - Remove repeated tenant headers and repeated metadata blocks.
   - Preserve subject focus and existing drilldowns.

4. Compress supporting context.
   - Convert heavy filters to staged apply/reset semantics.
   - Replace the current long policy-type list with a more compact operator-first control.
   - Group or collapse legends so they remain available without dominating the page.
   - Separate blocking refresh from passive auto-refresh and last-updated status.

5. Extend regression coverage.
   - Cover mode resolution, dense multi-tenant layout, compact single-tenant layout, staged filters, and non-blocking refresh cues.
   - Keep existing Spec 190 matrix truth, drilldown continuity, and RBAC guarantees green.

## Suggested Test Files

- `apps/platform/tests/Feature/Filament/BaselineCompareMatrixPageTest.php`
- `apps/platform/tests/Feature/Baselines/BaselineCompareMatrixBuilderTest.php`
- `apps/platform/tests/Feature/Guards/ActionSurfaceContractTest.php`
- `apps/platform/tests/Browser/Spec190BaselineCompareMatrixSmokeTest.php`

## Minimum Verification Commands

Run all commands through Sail from `apps/platform`.

```bash
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/Baselines/BaselineCompareMatrixBuilderTest.php
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Guards/ActionSurfaceContractTest.php
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Browser/Spec190BaselineCompareMatrixSmokeTest.php
cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent
```

## Manual Acceptance Checklist

1. Open a baseline profile whose matrix has multiple visible tenants and confirm `auto` resolves to dense mode.
2. Verify the first subject column remains visible while horizontally scrolling dense mode.
3. Confirm dense cells foreground compare state, trust, freshness, and attention before links or long prose.
4. Open a matrix that resolves to one visible tenant and confirm `auto` resolves to compact mode instead of a one-column matrix.
5. Change heavy filters and confirm the page stages those changes until the operator applies them.
6. Confirm active filter count and filter summary reflect the applied state clearly.
7. Confirm legends are still understandable but no longer dominate the top of the page.
8. Trigger or observe queued/running compare work and confirm passive auto-refresh does not look like a permanent blocking load.
9. Confirm the page shows when the current matrix payload was last updated.
10. Verify tenant compare, finding, and run drilldowns still preserve the existing matrix context.

## Deployment Notes

- No migration is expected.
- No new asset registration is expected.
- No queue topology change is expected because compare execution semantics stay unchanged.