# GOLIVE — multideal

Evidence must be directly observed or CI-attested. Machine-managed criterion rows and the scoreboard are generated from `golive.probes.json`.

<!-- GOLIVE-MACHINE-SUMMARY:START -->
## Current CI-attested journey evidence

Generated from `golive.probes.json`; criteria below remain source of truth.
- AC-18 [BROKEN] — UJ-012 qr_token_hash 64-hex assertion=true; qr_png_url assertion=true; receipt=ci-artifact missing UJ-012 passed-clean=false
- AC-35 [BROKEN] — tests/e2e hollow specs=0; money-risk missing=0; receipt-missing=UJ-012-single-deal-purchase.spec.ts,UJ-013-cart-checkout.spec.ts,UJ-019-request-return-refund.spec.ts,UJ-048-vendor-redemption.spec.ts,UJ-052-review-settlements.spec.ts,UJ-100-affiliate-preview-connect.spec.ts,UJ-101-affiliate-attribution-invariants.spec.ts; receipt-unpassed=none; receipt=ci-artifact missing covers-tested-code=false
<!-- GOLIVE-MACHINE-SUMMARY:END -->

## The one journey that makes money

Customer (Hebrew-first PWA) → deal page → logged-in checkout → Stripe PaymentIntent with `application_fee_amount` (10% platform fee) → `payment_intent.succeeded` webhook finalizes order → QR voucher issued → vendor scans/redeems → settlement hold → settlements queue releases Stripe Connect payout to vendor; platform keeps the commission.

Trace: `pages/deals/[...path].astro` → `features/checkout/CheckoutFlow.tsx:98,134` (`/api/purchases/pending`, `/api/checkout/intent`) → `server/domain/checkout/handler.ts` → `payments/stripe-provider.ts` → `api/payments/stripe/webhook.ts:155-175` → `payments/finalize.ts:367` → QR `workflows/purchase.ts:102-109` → redeem `api/purchases/[id]/redeem.ts:53` → `workflows/redemption.ts:122` → hold/release `workflows/settlement-release-writer.ts` → payout `do-host/queues/settlements-consumer.ts:76`.

## Acceptance criteria w/ verdicts

### Production infrastructure
- [x] AC-01 [WORKS] — Production Worker exists and serves marketplace traffic at `app.multideal.co.il`. **Probe:** wrangler deployments non-secret=true; curl --resolve app.multideal.co.il:443:104.21.71.175 /deals HTTP 200; /login HTTP 200; /api/health HTTP 200; build sha 06b6a00000f1914ebf1a04f4b7bbea13ae5fb2db <!-- GOLIVE-PROBE:AC-01 -->
- [ ] AC-02 [BLOCKED] — `https://www.multideal.co.il/` serves the marketplace (200, correct `<html lang dir>`). Owner phase model (2026-07-27): `www` and apex remain the marketing site until public registration opens; the owner must flip `www` to the marketplace and move marketing strictly to `www.multi.deal`. Expected red until that owner act. **Probe:** Probe blocked: dig @8.8.8.8 -> not NXDOMAIN; / HTTP 200 lang=he dir=rtl; apex HTTP 200; marketplace routes /deals HTTP 404; /login HTTP 404; /api/health HTTP 404; build sha absent **Owner action:** Move marketing to www.multi.deal and point www.multideal.co.il plus the apex at the marketplace. <!-- GOLIVE-PROBE:AC-02 -->
- [x] AC-03 [WORKS] — `[env.production]` defined (route, vars, ENVIRONMENT=production). **Probe:** apps/web/wrangler.toml: [env.production]=true; ENVIRONMENT=production=true; route=app.multideal.co.il (expected app.multideal.co.il)=true; workers_dev=false=true <!-- GOLIVE-PROBE:AC-03 -->
- [x] AC-04 [WORKS] — Tag-triggered prod deploy pipeline can succeed. **Probe:** gh api Deploy Production: state=active; successful v* run=v0.1.20 06b6a00000f1914ebf1a04f4b7bbea13ae5fb2db <!-- GOLIVE-PROBE:AC-04 -->
- [ ] AC-05 [BLOCKED] — Prod `db:migrate` no-op after provisioning. **Probe:** Probe blocked: golive production DB receipt missing; journal entries without SQL files: none <!-- GOLIVE-PROBE:AC-05 -->
- [ ] AC-06 [BLOCKED] — Production Neon DB exists. **Probe:** Probe blocked: golive production DB receipt missing <!-- GOLIVE-PROBE:AC-06 -->
- [x] AC-07 [WORKS] — Prod secrets runtime probe green. **Probe:** gh api Deploy Production v0.1.20: conclusion=success; run gates on the post-deploy /api/internal/health/secrets runtime probe <!-- GOLIVE-PROBE:AC-07 -->
- [x] AC-08 [WORKS] — Scheduled work fits Free plan: multideal crons consolidated into DO `alarm()` dispatcher (decision 2026-07-12 — architecture fix, no plan upgrade); account native crons stay ≤5 with prod deployed. **Probe:** cf api workers/scripts schedules: 5 of 5 account cron triggers armed across 28 scripts (multideal=*/30 * * * *, multideal-preview=*/30 * * * *, press-zone=*/5 * * * *, press-zone-dev=*/5 * * * *, vibeflare=0 3 * * *); multideal armed with */30 * * * *, matches [env.production.triggers]=true <!-- GOLIVE-PROBE:AC-08 -->
- [ ] AC-09 [BROKEN] — CI green on main. **Probe:** gh api default branch=main; Main Validation=failure <!-- GOLIVE-PROBE:AC-09 -->
- [ ] AC-10 [BROKEN] — Preview deploy pipeline. Deploy Preview run success 2026-07-12; fresh deployments listed by wrangler. **Probe:** gh api Deploy Preview: conclusion=failure; sha=561aa405e3958777f3a8e388478a04f57ce73776 <!-- GOLIVE-PROBE:AC-10 -->
- [ ] AC-11 [BROKEN] — Automated DB backups (dev + prod). **Probe:** gh api Weekly DB Dump to R2 31296808374: run=success; dev=success; prod=success; artifacts=none <!-- GOLIVE-PROBE:AC-11 -->

### Customer money path (demonstrable only on dev.multi.deal)
- [x] AC-12 [WORKS] — Home/browse renders deals. **Sweep:** apps/web/tests/e2e/journeys/UJ-010-discover-deals.spec.ts (11 expects incl. API-backed); Deploy Preview run success on main 2026-07-27T12:31Z. <!-- GOLIVE-SWEEP:AC-12 -->
- [x] AC-13 [WORKS] — Deal detail → checkout UI reachable. **Sweep:** apps/web/tests/e2e/journeys/UJ-012-single-deal-purchase.spec.ts:77-96 drives deal->checkout->pending purchase and asserts the canonical confirmation URL for the same purchase id. <!-- GOLIVE-SWEEP:AC-13 -->
- [ ] AC-14 [BLOCKED] — Real customer signup via Firebase phone OTP. **Sweep:** Probe blocked: The dated probe records no observed real Firebase phone OTP behavior at golive.probes.json:111-118. **Owner action:** Complete one real Firebase phone OTP signup and record dated evidence. <!-- GOLIVE-SWEEP:AC-14 -->
- [ ] AC-15 [BLOCKED] — Magic-link + email/password login live (Resend delivery). **Sweep:** Probe blocked: The dated probe records no live magic-link or email-delivery behavior at golive.probes.json:121-128. **Owner action:** Complete live magic-link and email/password delivery checks and record dated evidence. <!-- GOLIVE-SWEEP:AC-15 -->
- [x] AC-16 [WORKS] — Pending order + commission split creation. **Sweep:** UJ-012-single-deal-purchase.spec.ts:115-136 asserts persisted orderStatus=paid, buyer/vendor ids, line totals and a settlement ledger row whose sum equals lineTotalAgorot — durable DB truth, not a page render. <!-- GOLIVE-SWEEP:AC-16 -->
- [x] AC-17 [WORKS] — Stripe PaymentIntent with 10% application fee. **Probe:** vitest tests/unit/payments/application-fee-rate.test.ts: passed=4; failed=0; asserts application_fee_amount at PLATFORM_FEE_PCT=true <!-- GOLIVE-PROBE:AC-17 -->
- [ ] AC-18 [BROKEN] — Webhook finalize → order + QR voucher issuance (logic). **Probe:** UJ-012 qr_token_hash 64-hex assertion=true; qr_png_url assertion=true; receipt=ci-artifact missing UJ-012 passed-clean=false <!-- GOLIVE-PROBE:AC-18 -->
- [ ] AC-19 [BROKEN] — Phone-verified guest checkout on preview: anonymous buyers can open checkout only after phone assurance, and unauthenticated checkout mutations are denied. **Probe:** UJ-103 phone-assured spec=true; UJ-013 anonymous-denied spec=true; preview /api/health sha=561aa405e3958777f3a8e388478a04f57ce73776; unassured checkout HTTP 403 code=PHONE_VERIFICATION_REQUIRED purchaseIds=false; buy/00000000-0000-0000-0000-000000000401 HTTP 200 login-redirect=false; legal/terms phone-assurance he=true en=true; stale-guest-email he=false en=false; receipt=ci-artifact missing UJ-103+UJ-013 passed-clean=false <!-- GOLIVE-PROBE:AC-19 -->
- [ ] AC-20 [BLOCKED] — Live-mode Stripe end-to-end (live keys, webhook endpoint registered on prod URL, real card). **Sweep:** Probe blocked: The dated probe records no live-mode purchase or webhook verification at golive.probes.json:163-170. **Owner action:** Complete one authorized live-mode Stripe purchase and webhook verification. <!-- GOLIVE-SWEEP:AC-20 -->
- [ ] AC-21 [BLOCKED] — Customer sees/downloads voucher QR. **Sweep:** Probe blocked: The dated probe records no production voucher QR view/download and identifies existing evidence as factory-backed at golive.probes.json:173-180. **Owner action:** Verify a customer can view and download a production voucher QR. <!-- GOLIVE-SWEEP:AC-21 -->

### Vendor side of the money
- [ ] AC-22 [BLOCKED] — Vendor Stripe Connect onboarding to charges-enabled. **Sweep:** Probe blocked: The dated probe records no vendor onboarding result proving Stripe Connect charges_enabled at golive.probes.json:183-190. **Owner action:** Complete vendor Connect onboarding and record charges_enabled evidence. <!-- GOLIVE-SWEEP:AC-22 -->
- [ ] AC-23 [BLOCKED] — Vendor QR scan → redeem. **Sweep:** Probe blocked: The dated probe records no production QR redemption and says existing evidence used a factory purchase at golive.probes.json:193-200. **Owner action:** Complete one production vendor QR scan and redemption. <!-- GOLIVE-SWEEP:AC-23 -->
- [x] AC-24 [WORKS] — Settlement hold + release writer + queue consumer (logic). **Sweep:** settlement-hold-window.spec.ts:35-45 asserts held status, release_at >= held_at+14d, net+fee==total; :58-70 asserts premature mark-paid returns 409 and state is unchanged. <!-- GOLIVE-SWEEP:AC-24 -->
- [x] AC-25 [WORKS] — Refund amounts correctly allocated into settlements on main. **Probe:** git fetch origin main --quiet -> exit 0 (fetch-fresh); git merge-base --is-ancestor 250fe6cab origin/main -> exit 0 (fix is on main) <!-- GOLIVE-PROBE:AC-25 -->
- [ ] AC-26 [BLOCKED] — Actual Stripe Connect payout reaches a vendor account. **Sweep:** Probe blocked: The dated probe records no production Connect payout or vendor bank receipt at golive.probes.json:219-226. **Owner action:** Complete one production Connect payout and confirm vendor bank receipt. <!-- GOLIVE-SWEEP:AC-26 -->
- [x] AC-27 [WORKS] — Admin settlements operable at CF CPU budget. **Probe:** apps/web/src/server/middleware/edge-cache.ts offloads /admin/ to do-render-authed=true; cf graphql workersInvocationsAdaptive scriptName=multideal 7d (worker-wide): success=7963, exceededResources=0 of 7963 invocations (0.00% CPU-terminated), cpuTimeP50=19.5ms p99=89.3ms <!-- GOLIVE-PROBE:AC-27 -->
- [ ] AC-28 [BLOCKED] — Admin mark-paid flow. **Sweep:** Probe blocked: The dated probe records no production admin mark-paid execution at golive.probes.json:237-244. **Owner action:** Complete one production admin mark-paid flow and record durable evidence. <!-- GOLIVE-SWEEP:AC-28 -->

### Affiliate/referral revenue lane
- [ ] AC-29 [BLOCKED] — Referral/affiliate attribution on purchase. **Sweep:** Probe blocked: The dated probe records no production referred purchase with persisted attribution at golive.probes.json:247-254. **Owner action:** Complete one production referred purchase and record persisted attribution. <!-- GOLIVE-SWEEP:AC-29 -->
- [ ] AC-30 [BLOCKED] — Affiliate payout onboarding (Connect). **Sweep:** Probe blocked: The dated probe records no production affiliate Stripe Connect onboarding result at golive.probes.json:257-264. **Owner action:** Complete production affiliate Connect payout onboarding. <!-- GOLIVE-SWEEP:AC-30 -->
- [x] AC-31 [WORKS] — Affiliate analytics/ops. **Sweep:** apps/web/src/server/cron/affiliate-tick.ts:60-97 runs the hourly analytics rollup and six-hour auto-suspend passes; apps/web/tests/unit/referrals/analytics-rollup.test.ts:246-257 asserts persisted rollup output; apps/web/tests/integration/referrals/fraud/resolve-autosuspend.int.test.ts:94-116 asserts threshold suspension. <!-- GOLIVE-SWEEP:AC-31 -->

### Trust, legal, safety
- [ ] AC-32 [BLOCKED] — Terms of Service / legal pages launch-ready. **Probe:** Probe blocked: curl https://app.multideal.co.il/legal/{privacy,terms,tos-vendor,vouchers,cookies}: all 200; unfilled placeholders=COMPANY_REGISTRATION_NUMBER,CONTACT_TELEPHONE,CONTROLLING_LANGUAGE,COURT_VENUE_CITY_OR_DISTRICT,EFFECTIVE_DATE,LEGAL_ENTITY_NAME,LEGAL_NOTICE_EMAIL,LIABILITY_CAP_ILS,REGISTERED_ADDRESS,TERMS_VERSION **Owner action:** Supply and approve legal values for COMPANY_REGISTRATION_NUMBER, CONTACT_TELEPHONE, CONTROLLING_LANGUAGE, COURT_VENUE_CITY_OR_DISTRICT, EFFECTIVE_DATE, LEGAL_ENTITY_NAME, LEGAL_NOTICE_EMAIL, LIABILITY_CAP_ILS, REGISTERED_ADDRESS, TERMS_VERSION. <!-- GOLIVE-PROBE:AC-32 -->
- [x] AC-33 [WORKS] — E2E/test surface provably off in production. **Probe:** workflow exists; gh api latest conclusion=success <!-- GOLIVE-PROBE:AC-33 -->
- [x] AC-34 [WORKS] — Observability in prod (Sentry event/release plus CF datapoint). **Probe:** production Sentry wiring: initSentry=true; production Worker SENTRY_DSN=true; GitHub release secrets SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT=true <!-- GOLIVE-PROBE:AC-34 -->
- [ ] AC-35 [BROKEN] — Journey E2E assert real outcomes. **Probe:** tests/e2e hollow specs=0; money-risk missing=0; receipt-missing=UJ-012-single-deal-purchase.spec.ts,UJ-013-cart-checkout.spec.ts,UJ-019-request-return-refund.spec.ts,UJ-048-vendor-redemption.spec.ts,UJ-052-review-settlements.spec.ts,UJ-100-affiliate-preview-connect.spec.ts,UJ-101-affiliate-attribution-invariants.spec.ts; receipt-unpassed=none; receipt=ci-artifact missing covers-tested-code=false <!-- GOLIVE-PROBE:AC-35 -->

## Cut list (explicitly NOT v1)

- Guest checkout (deferred in code, `buy/[id].astro:20`)
- Purchase-linked chat threads (apps/web/CLAUDE.md sharp edge)
- `/dev/payments` mock panel + MockPaymentProvider (dev-only by design)
- Full 595-spec Playwright matrix in CI (CI runs smoke + targeted lanes; rest on-demand)

**15 WORKS / 6 BROKEN / 0 MISSING / 0 UNVERIFIED / 14 BLOCKED** (35 criteria; sweep 2026-07-28)
