# Verification

Date: 2026-10-16. Scope: Dashboard API and Home consumer, without schema, migration, or production-data changes.

## Passed checks

- Dashboard isolated MySQL runner: 13 tests across metrics, API contract, and database integration passed. Existing migrations were replayed only in a randomly named disposable database, which was removed after the run.
- Chrome acceptance: 5 tests passed against the built frontend and actual API. Covers on-time compliance (one on-time and one late completion = 50.0%), old overdue backlog, both target sources, five charts, mixed units, empty response, initial failure/retry, stale data after failed refresh, visibility-based polling, request cancellation, View all navigation, logout, and login as another role.
- Backend regression command: `node --env-file=.env node_modules/vitest/vitest.mjs run test/dashboard-metrics.test.ts test/dashboard-contract.test.ts test/response-contract.test.ts test/swagger.test.ts test/inventory-contract.test.ts test/maintenance-contract.test.ts test/maintenance-recurrence.test.ts` — 26 tests passed.
- Frontend service regression: `node node_modules/vitest/vitest.mjs run test/dashboard.service.test.ts test/notifications.service.test.ts` from apps/app — 5 tests passed.
- API TypeScript check and frontend TypeScript project build passed.
- API `pnpm run build` passed, including Prisma Client generation from the existing schema.
- Frontend `pnpm run build` passed (TypeScript and production Vite bundle).
- Browser production fixture build passed. Vite reports the existing large document-export chunk warning; Dashboard adds no package dependency.
- Scoped diff whitespace check passed. Existing unrelated workspace changes were preserved; the change adds no schema/ERD/migration edits.

## Reproduction

Run `node --env-file=.env prisma/verify-dashboard.cjs --browser` from apps/api. Requires local MySQL create/drop-database permission and Chrome (PILOT_CHROME overrides the default executable). The runner builds a same-origin frontend fixture automatically and never migrates the application's configured database. Browser tests shorten only the 60-second interval to 500ms to verify visible/hidden polling quickly.

The fixture includes more than 100 active SKUs, multiple balances for one SKU, absent balances, archived parts/targets, pending checkout, and a concurrent posted stock transaction. Snapshot checks confirm that one dashboard response does not mix old and new balance states and that reads create no WO, stock movement, or notification records.

## Operational limits

- PM metrics cover actual released WO records, not calendar projections. Generating scheduled WOs remains the existing operational process.
- The view uses the current facility month; there is no custom date selector or historical snapshot.
- Polling refreshes active Home every 60 seconds and on focus; it is not a realtime push channel.
