Keep moving without stopping at every little thing: build the whole app out per FABLE-BUILD-PROMPT.md, hold the Cloudflare deploy (deliberately โ deploy when there's more to show), and never touch her original repo/main.
relaunch-v2 โ main untouched)Two commits pushed to AmplifAI-Your-Business/testvirtualrestyle:
661f922 Phase 1 (re-home off Lovable โ was already built last session, committed this session)267234a Phases 2+3 + safety fixes (this session's build)src/components/ComplianceKit.tsx + src/lib/compliance.ts): watermark now reads "Virtually Staged" (legible pill, all download paths), original photo exported alongside, one-click zip = labeled + clean (paid only) + original + disclosure.txt, copy-paste disclosure line, AI-disclosure toggle. Buttons on the result view AND gallery viewer.src/components/EditRoom.tsx + supabase/functions/edit-room/): brush a mask over one item โ Gemini regenerates โ the browser composites so ONLY the masked region can change. Pixel-diff proof: 0 changed pixels outside the mask, exact, zero tolerance (verified live; dev builds expose window.__vr_lastEdit for re-testing). Sequential edits supported; edits save back to the gallery (saveEditedStagedImage).credits + credit_grants tables, spend_generation / refund_generation / grant_credits RPCs (migrations 20260704120000 + 20260704150000). Spend order: tester โ Pro โ paid credits (clean) โ free allowance (watermarked). Server-side ONLY โ this also fixed a pre-existing double-spend bug (client + server both spent quota). Failed generations auto-refund.stripe-webhook verifies signatures + grants idempotently (replay = no-op). Pricing page + landing cards rebuilt; Unlimited/Brokerage tiers removed.ghl-sync on signup (tag virtualrestyle-signup), webhook tags on purchase (virtualrestyle-paid/-pro). Verified live against her GHL, then test contact deleted./privacy + /terms (src/pages/Legal.tsx) with AB 723/MLS disclosure duty spelled out. Branding centralized in src/lib/brand.ts (per PRD, for the later Base44 white-label port).app-reviewer agent found 3 MUST FIX, all fixed same session:
refund_generation was callable by any signed-in user โ now REVOKEd from clients, service_role only; stage-room/edit-room refund via service client. Verified: user call โ 403, balance unchanged.productId ref) โ fixed, returns 200.Plus: global error boundary (white-screen guard), working forgot-password, gallery load-failure state, password min 8, mailto โ brand.ts.
scratchpad/test_backend.py): 9/9 โ webhook missing/bad sig rejected, valid grant, replay idempotent, balance math, checkout test-mode URLs (pack + pro), GHL synced.PROJECTS/Virtual Restyle/verification/.npm run build clean.uyloerfniphfxjvnuwmn: 2 new migrations applied; functions deployed: stage-room, edit-room, create-checkout, stripe-webhook, ghl-sync, check-subscription (+ Phase 1's email fns). Secrets set: STRIPE_SECRET_KEY = sk_test (TEST mode on purpose), STRIPE_WEBHOOK_SECRET (generated; copy in scratchpad whsec.txt โ regenerate at launch from the real Stripe endpoint), GHL_API_KEY, GHL_LOCATION_ID, plus Phase 1's GEMINI/RESEND keys.cd "PROJECTS/Virtual Restyle/app" && npm run dev โ http://localhost:8080. Test login: srverva+vrtest1@gmail.com / VrTest!2026#Phase1 (~5 test credits left).STRIPE_SECRET_KEY to the live key + create a real webhook endpoint in the Stripe dashboard pointing at https://uyloerfniphfxjvnuwmn.supabase.co/functions/v1/stripe-webhook + set its signing secret.mailer_autoconfirm; CORS: pin Access-Control-Allow-Origin to the final domain.Sondra staged a real photo and Gemini altered the structure (removed a bay window) โ first-pass staging relied on prompt-only preservation (the edit loop's pixel guarantee never applied to first-pass, by design). Fix shipped + deployed (commit da959da): every staging is now reviewed by a second vision model (gemini-flash-latest, env GEMINI_JUDGE_MODEL) comparing original vs staged structure. On failure โ one automatic retry with the judge's findings in the prompt โ if still failing, the spend is auto-refunded and the UI shows an amber "structure check" notice ("you were not charged โ re-stage"). Judge validated against her exact drifted pair: correctly flagged the removed bay window. Clean stagings verified passing (structureVerified:true, ~33s). Also fixed: Landing's orphan Pro mention now links to /pricing. Cost note: adds 1-2 cheap judge calls (+1 possible image retry) per staging, on her Gemini key.
SUPABASE_VIRTUALRESTYLE_DB_PASSWORD in master .env (never provided).spfgqgoakyvtjyywpmtw untouched = rollback.Generated for the CEO Dashboard · source: PROJECTS/Virtual Restyle/handoffs/virtual-restyle-phase2-3-full-build-2026-07-04.md ๐ค