# Wishdeal Factory buyer-path - iteration 5 ship log

**Date:** 2026-05-09 (continued autonomous /loop)

## What shipped

### New scripts on `ubuntu@40.160.2.121`

| File | Purpose | Cron |
|---|---|---|
| `hero-polish-cli.py` | Calls Claude CLI on top N by Adoptability. Generates eyebrow + h1 + lede JSON to `/home/ubuntu/factory/director/hero-polish/<slug>.json`. Runs once manually then on-demand. | manual |
| `apply-polished-heroes.py` | Reads JSON output, injects polished hero block above existing hero on each product page. Idempotent marker `WD_HERO_POLISH_v1`. | `*/5` |
| `regen-feedback-page.py` | `/factory/feedback/<slug>/` - per-product feedback form. Sentiment, 1-5 usefulness, free-text message, optional email. | 50 hourly |
| `feedback-route.js` + `patch-api-add-feedback-stripe.py` | Adds `/api/feedback` (POST capture, GET admin-gated read) and `/api/stripe-webhook` (placeholder validating signatures when STRIPE_WEBHOOK_SECRET is set, logs unsigned for inspection). | one-time |
| `regen-sitemap-v2.py` | Replacement sitemap that includes catalog, pricing, fresh, compare, outreach-launcher, operator-partnership, honest, plus per-product index, pricing, faq, case-studies, about, for, vs, security, plus unlock pages. | 55 hourly |
| `brand-applicator.py` | Reads palette-audit.json. For each "vanilla" product (top N by Adoptability), injects per-product brand override CSS (palette + typography from brand brief). Idempotent marker `WD_BRAND_OVERRIDE_v1`. | every 4 hr |

### Live URLs

- https://wishdeal.com/factory/feedback/`<slug>`/ - 172 feedback pages live. Submits to `/api/feedback`.
- https://wishdeal.com/factory/api/feedback - LIVE feedback endpoint. POST captures sentiment + usefulness + message + email. JSONL at `/home/ubuntu/factory/inbox/feedback.jsonl`. GET requires admin key.
- https://wishdeal.com/factory/api/stripe-webhook - LIVE placeholder webhook receiver. Logs all payloads to `stripe-webhook.jsonl`. When `STRIPE_WEBHOOK_SECRET` env var is set, validates signatures and on `checkout.session.completed` mints dossier token + queues fulfillment record.
- 4 of 10 top products have polished hero blocks live (more landing every ~3-5 min as Claude CLI completes).
- 10 vanilla products got per-product brand override applied.

### Polished hero examples (live now)

| Product | Polished h1 |
|---|---|
| bookkeeper-ai | "Bookkeepers, end the close report crunch" |
| dispatch-ai | "Dispatch managers, send the right load first time" |
| nurture-ai | "Sales teams, stop chasing follow-ups in a Google Sheet" |
| roofing-ai | "Estimators, clear bid backlogs before they cost you deals" |

(6 more landing as Claude CLI completes the queue. Apply-polished-heroes cron picks them up every 5 min.)

### Brand-applied products (10 vanilla → branded)

| Slug | Accent | Fonts |
|---|---|---|
| webinar-ai | #4361ee | Space Grotesk + DM Sans |
| account-based-sales-ai | #6366f1 | Sora + Manrope |
| competitor-tracker | #f97316 | Space Grotesk + Inter |
| capacity-planner-ai | #d95f3b | Sora + DM Sans |
| helpdesk-ai | #3b6ef8 | Space Grotesk + Inter |
| procurement-ai | #2d6be4 | Sora + Inter |
| unit-economics-ai | #a8d92e | Space Grotesk + Inter |
| referral-ai | #c4f135 | Space Grotesk + DM Sans |
| afterhours | #a87a32 | Plus Jakarta Sans + Inter |
| api-monetization-ai | #6d28d9 | Space Grotesk + Inter |

11 vanilla products remain; the cron will re-run the applicator every 4 hours to pick up new brand briefs.

### Sitemap

Regenerated with **723 URLs** (up from ~150 in the older sitemap). Includes pricing, fresh, compare, outreach-launcher, operator-partnership, honest, all 172 product pages with their sub-pages, and 172 unlock pages. Excluded: admin/, api/, repair-queue/.

### Stripe webhook architecture (placeholder, ready for keys)

When Wes wires Stripe:

1. Set `STRIPE_WEBHOOK_SECRET` env var on factory-api service
2. Set `FACTORY_FROM_EMAIL` env var
3. Add Postmark/SendGrid integration in the `mintAndSend` block (TODO comment in code)
4. Add `https://wishdeal.com/factory/api/stripe-webhook` as the webhook endpoint in Stripe dashboard

The receiver already:
- Validates Stripe signature (HMAC-SHA256 of `t.payload`)
- Parses `checkout.session.completed`
- Mints dossier token via existing `mintDossierToken()`
- Logs fulfillment record to `dossier-fulfillment.jsonl`

The only thing missing is the email-send call. That's a 5-line addition once Wes picks SendGrid/Postmark.

## Buyer flow now (post-iter5)

1. Browse free at `/factory/`, `/factory/catalog/`, `/factory/fresh/`
2. Compare ideas at `/factory/compare/` (shortlist via localStorage)
3. Land on a product page → see polished hero (if top 10), per-product brand override (if was vanilla), pricing band with 4 tiers, Hero Insight ("Who this is for / not for / what you'd adopt"), FAQ link
4. Click "Unlock dossier $5" → unlock page with detailed teaser → email-capture form
5. Email captured → JSONL at `intent-capture.jsonl` → Wes runs `mint-dossier-link.sh <slug>` and emails URL
6. Buyer reads gated dossier at `/factory/api/dossier/<slug>?t=<token>` (markdown or HTML)
7. Buyer drops feedback at `/factory/feedback/<slug>/` → JSONL at `feedback.jsonl`
8. **WHEN STRIPE WIRES**: same flow, but step 5-6 automate. Webhook → mint → email.

## What still needs work

- **Stripe wiring** still needs Wes's keys.
- **Email-send integration** (Postmark/SendGrid) for the auto-fulfill path.
- **Hero polish CLI** is finishing in background; cron applies as they land. Should run on next 10 (top 11-20) in subsequent iterations.
- **Brand applicator** has 11 vanilla products left to address.
- **Captures admin** could surface feedback too (right now only intent captures).

## Next 5 recommended autonomous tasks

1. **Captures + Feedback unified admin.** Merge `/factory/admin/captures/` to also show `/api/feedback` data. Per-product unified view: who captured intent, who left feedback, sentiment trend.
2. **Hero polish next 10.** Run `hero-polish-cli.py 20` to push polish to top 20.
3. **Brand applicator on remaining 11 vanilla.** Just runs the cron more aggressively or once with N=11.
4. **Operator inbox.** A `/factory/admin/inbox/` that shows: intent captures + feedback + Stripe webhook events + dossier-fulfillment events, all on one timeline. Becomes Wes's daily morning page.
5. **Send-dossier-from-admin.** Add a button in `/factory/admin/captures/` that opens `mailto:` with the email pre-filled and the dossier link pre-filled (mints token via JS calling `/api/mint-token` with admin-key).

## Files changed inventory

- New: 6 Python generators + 1 Node route file + 1 patcher
- New: 172 `/srv/sites/factory/feedback/<slug>/index.html`
- New: `/home/ubuntu/factory/director/hero-polish/<slug>.json` (4 so far, 10 expected)
- New: `/home/ubuntu/factory/dossiers-private/...` (already existed but auto-fulfillment ledger added)
- Modified: `/home/ubuntu/factory/api/server.js` (added 2 routes; backup `.bak.before-feedback-stripe`)
- Modified: 4 product pages (polished hero block; more landing as CLI finishes)
- Modified: 10 product pages (brand override CSS injected)
- Modified: `/srv/sites/factory/sitemap.xml` (723 URLs vs ~150)
- Modified: crontab (4 new entries)

## Cumulative iter1-iter5

**31 buyer-facing pages and admin tools live.** **2 active intent captures + 2 feedback entries** in production data. **Repair queue at 96% complete, 87/172 fully complete.** **All 172 products have brand briefs, financials, FAQ, dossier teaser, dossier full (gated), pricing band, hero insight, outreach pack, email drip, feedback form.**

Real buyer can today:
1. Browse 172 ideas with adoptability scoring, badges, filters
2. Compare any subset side-by-side
3. Read a tiered pricing page
4. Submit interest on any product (real captured email)
5. Receive a gated dossier URL (manual mint via CLI; auto-mint when Stripe wires)
6. Submit dossier feedback (real captured)
7. Browse "what's just shipped" page
8. Use the outreach launcher with copy-LinkedIn/Gmail-draft buttons

The buyer path is fully in place. The remaining work is Stripe + email automation + content quality lifts.
