# Homa LAB — paid-media automation fleet (Monochrome handoff)

Source for the automation behind Homa's LAB Meta + Google programs. Companion to the handoff doc: https://homa-lab-handoff.pages.dev

## ⚠️ TWO kinds of infra in here — they transfer differently

### 1. Cloudflare Workers (`/workers`) — deploy in your Cloudflare account
Each folder = one worker (`worker.js` or `src/worker.js` + `wrangler.toml`, which carries the cron + KV bindings).
- `signal-audiences` — refreshes ~10 Meta behavioral custom audiences (every 6h)
- `homa-lab-meta-audience-sync` — feeds 3 lookalike seed audiences (daily)
- `homa-lab-customer-match-sync` — PostHog → Google Data Manager Customer Match + offline value feed (daily)
- `homa-metro-go` — redirect worker for metro-carousel DPA links
- `lab-live-dashboard`, `sitewide-dashboard`, `lab-daily-report` — reporting

Deploy: `cd workers/<name> && npm i && npx wrangler secret put <NAME>` (see SECRETS.md) then `npx wrangler deploy`. Recreate any KV namespaces and update their ids in `wrangler.toml`.

### 2. Cron scripts (`/cron-scripts`) — NOT Cloudflare; MUST be re-hosted
These run today as **launchd jobs on Shawn's Mac** and stop when it's off. You must re-host them on your own scheduler/server (or port to Workers). See REHOST.md.
- `capi_sync.py` — Meta CAPI: replays lab_ funnel conversions server-side (every 2h)
- `catalog_sync.py` — DPA catalog / product-set refresh
- (+ the `com.homa.*.plist` launchd definitions showing schedule/command)

## Secrets
None are in this repo (verified). See SECRETS.md for the list of names each component needs; get the values from Shawn out-of-band.
