# Quickstart — Spec 118 Golden Master Deep Drift v2

Spec reference: `/Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/118-baseline-drift-engine/spec.md`

## Prereqs

- Docker running
- Dependencies installed: `vendor/bin/sail composer install`
- Containers up: `vendor/bin/sail up -d`

## Run the minimum checks

- Format (dirty only): `vendor/bin/sail bin pint --dirty --format agent`
- Tests (focused): `vendor/bin/sail artisan test --compact --filter=Baseline` (adjust filter to match added tests)

## Manual verification flow (admin)

1) In `/admin`, open a Baseline Profile and set capture mode to **Full content**.
2) Run **Capture baseline (full content)** and select a source tenant.
3) Open Monitoring → Operations → the capture `OperationRun`:
   - Verify `context.target_scope` renders a “Target” (no “No target scope details…”).
   - Verify `context.baseline_capture.evidence_capture` and `context.baseline_capture.gaps` exist.
   - If capture was incomplete, verify `context.baseline_capture.resume_token` exists and UI offers **Resume capture**.
4) In `/admin/t/{tenant}`, open Baseline Compare and run **Compare now (full content)**.
5) Open Monitoring → the compare `OperationRun`:
   - Verify coverage proof is recorded (`context.baseline_compare.coverage`).
   - Verify evidence capture stats and evidence gaps are present.
   - Verify “Why no findings?” is explained via `context.baseline_compare.reason_code` when applicable.
6) Open Findings:
   - Verify drift findings appear when policy settings differ.
   - Verify findings include fidelity/provenance fields for baseline and current evidence.

## Forcing a resumable run (dev-only)

To test resume behavior without waiting for real throttling:

- Temporarily reduce the per-run capture budget in config (planned in Spec 118) so the run cannot process the full scope.
- Re-run capture/compare and verify a resume token is recorded and **Resume capture** continues work without duplicating already-captured subjects.

## Troubleshooting

- If UI changes don’t appear, run assets: `vendor/bin/sail npm run dev`.
- If tests fail due to stale schema, run: `vendor/bin/sail artisan migrate`.
