feat: add carpenter walkthrough release gate (hydration, readiness, material link review)

Implements the plan from the carpenter walkthrough audit: make the
project flow -> final review -> PDF path measurable and safe to gate
CI on.

- projectHydrationService loads a project's geometry/labor/materials/
  rentals/packages/calculation in parallel and reports per-resource
  timing plus the slowest resource, so hydration SLA breaches are
  visible instead of silent
- projectReadiness centralizes the blocking checks final review must
  pass before a quote can be sent (name, customer, description,
  materials/labor present, zero-price lines)
- pdfSourceSignature detects when a generated PDF is stale relative to
  the current project data, so a carpenter doesn't send an outdated
  quote
- MaterialLinkReview + new customer-projects match-preview/link
  endpoints let a user review and confirm suggested master-material
  matches instead of silently auto-linking
- ProjectFlow refactored around the new hydration/readiness utilities;
  FinalReview surfaces readiness checks and unlinked material counts
- CI: the carpenter smoke test (full-roof-quote-flow.spec.js) is now
  a blocking gate on main, with the rest of the Playwright suite
  running best-effort alongside it
- docs/qa/CARPENTER_WALKTHROUGH_RELEASE_GATE.md documents the gate and
  the monthly production audit procedure

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
alexpolo1
2026-08-20 13:20:33 +02:00
parent db34ee96ed
commit 9b7df90385
23 changed files with 1737 additions and 298 deletions

View File

@@ -0,0 +1,43 @@
# Carpenter Walkthrough Release Gate
## Blocking CI gate
Every pull request to `main` runs `tests/full-roof-quote-flow.spec.js` as a blocking Playwright smoke test against the CI server. It verifies app login, supported roof types, geometry calculation and the core pricing basis.
The remaining Playwright suite is still best-effort while legacy scenarios are stabilized. Artifact upload is always best-effort and must not decide CI status.
## Monthly production audit
Run `tests/monthly-carpenter-audit.spec.js` against the production-like target with a known audit project:
```bash
cd tests
PLAYWRIGHT_BASE_URL=https://tilbudsgiveren.alw.dk \
PLAYWRIGHT_USERNAME="$PLAYWRIGHT_USERNAME" \
PLAYWRIGHT_PASSWORD="$PLAYWRIGHT_PASSWORD" \
AUDIT_PROJECT_ID=392 \
CARPENTER_HYDRATION_SLA_MS=5000 \
npx playwright test monthly-carpenter-audit.spec.js --project=chromium --reporter=list
```
The audit fails when:
- project hydration exceeds the explicit SLA
- ProjectFlow and Final Review disagree about unlinked material count
- controlled quote total changes unexpectedly
- a newly generated PDF is stale, invalid or longer than three pages
- the browser observes API 5xx responses or console errors
- the mobile page has horizontal overflow
Do not use the monthly audit as an automated production write from CI. Run it deliberately with the designated audit project after deploy and during the monthly carpenter review.
## Release evidence
Record:
- commit and environment
- hydration duration
- PDF page count
- API/console failures
- readiness/material-link count
- screenshot/video paths when a gate fails