# GOLIVE — zync.is

Audit date: 2026-07-14. Method: repo docs read + 2 full-codebase cursor sweeps (surface + infra) + live HTTP probes + monorepo typecheck + full zync-app test gate. Evidence cited per criterion. Verdicts: WORKS only on observed behavior, never on code-exists-alone.

## What the product is + the one journey that makes money

**Product:** Zync — business OS for Israeli freelancers/SMBs (Hebrew/RTL-first): invoicing, proposals, contracts + e-signature, CRM/leads, time tracking, expenses/OCR, contractor payouts, client portal, IL tax compliance (Morning/iCount/Rivhit/Invoice4U/EasyCount integrations, PCN874). Successor to VirtuAC. ~175 DB tables, ~200 SPA routes, 2,376 API handlers across 5 Cloudflare Workers (`zync-www` marketing, `zync-app` SPA, `zync-api`, `zync-admin`, `zync-public-api`).

**Who pays:** tenants on subscription tiers (`docs/specs/2026-05-31-zync-subscription.md`): Freelancer free / Business 89 ILS/mo / Enterprise 159 / White Label 250 (last two manually provisioned).

**THE money journey:** visitor hits zync.is → signs up (free Freelancer tenant) → onboards → creates customer + invoice → sends it with a payment link (core value: client pays, IL-compliant doc issued) → hits tier limits/trial end → upgrades to Business via `/settings/plan` checkout → Zync collects 89 ILS/mo.

**Verdict on the journey:** it dead-ends at BOTH payment steps. (1) Client-pays: payment links are generated and emailed but the public `/pay/{token}` page does not exist, and all card gateway adapters (cardcom/payplus/stripe) are throw-on-call stubs. (2) Zync-gets-paid: the only registered subscription adapter is `NullPaymentAdapter` — checkout throws `PaymentProviderNotConfiguredError`, webhook endpoint returns 501 (`packages/payments/src/registry.ts:26`, `null-adapter.ts:38`). No revenue can be collected today.

## Launch-blocking infrastructure facts (verified)

- **Prod domains dead:** `zync.is`, `app.zync.is`, `api.zync.is` all return Cloudflare 403 "DNS points to prohibited IP" (curled 2026-07-12). Only dev is live: `dev.zync.is`, `app.dev.zync.is`, `admin.zync.is` return 200; `app.dev.zync.is/api/health` → `{"status":"ok"}`.
- **CI never fires for prod:** `.github/workflows/main.yml` triggers on branch `main`; repo lives on `master`. Additionally `zync-api`/`zync-app`/`zync-www` wrangler.toml have **no `[env.production]`** yet CI deploys with `--env production`; `zync-admin` + `zync-public-api` are not deployed by CI at all; `zync-public-api` Hyperdrive/KV IDs are placeholders.
- **Billing not configured by design:** `ZYNC_PAYMENT_ADAPTER` defaults `'null'`; no real adapter exists in the codebase. Invoice gateway configs table exists (`payment_gateway_configs`, `test_mode` default true) but adapters are stubs.
- **Cron economy off:** Cloudflare cron triggers disabled on zync-api (5-cron account cap); trial-expiry/invoice-reminder jobs require an external dispatcher (`cronjobs.api` secret) — not verified firing. Dunning has no automated processor. `payment.charge` job documented, no implementation.
- **DB:** Neon + Hyperdrive (zync-api Hyperdrive ID real). Committed branch tree contains 65 SQL migrations and 65 matching journal tags; migration snapshots are a separate integrity failure (30 committed snapshots, 35 absent). `db:seed` broken (`src/seed/run.ts` missing).
- **Test truth:** zync-api retains its Vitest coverage. zync-app normal `pnpm --filter zync-app test` runs 14 Node contract tests plus all 83 Vitest files; fresh full gate: 14/14 Node tests and 83/83 files with 253/253 Vitest tests passed. PR CI separately gates critical Playwright UI-matrix/a11y coverage against an isolated preview. Preview GitHub environment secrets and reviewer protection remain unprovisioned, so the new job fails closed until configured. `packages/payments` and `packages/auth`: zero tests. No signup→pay E2E anywhere.
- **Known deferred gap — nightly UI matrix:** Full role × route × theme × locale × viewport Playwright sweep cannot run nightly yet. Keep PR CI limited to component contracts plus critical role/page matrix; add sharded nightly Chromium/WebKit coverage in a future run before removing this gap.
- **Typecheck:** monorepo `pnpm typecheck` PASSES (rc=0, two runs 2026-07-12; one concurrent run flaked on zync-www#typecheck, standalone re-run 0 errors). Note: turbo picks up stale worktrees under `tmp/wt-*` as workspace tasks — workspace hygiene issue.
- **Email is real:** Resend end-to-end incl. tenant domain verification — no console stub (needs `RESEND_API_KEY` in prod).

## Acceptance criteria w/ verdicts

Reach + entry:
- [ ] AC-01 [BROKEN] — Marketing site loads at zync.is. Evidence: 403 "DNS points to prohibited IP"; dev.zync.is 200.
- [ ] AC-02 [BROKEN] — App loads at app.zync.is. Evidence: 403; only app.dev.zync.is live.
- [ ] AC-03 [WORKS] — Pricing page renders with tiers. Evidence: dev.zync.is/pricing 200 (Hebrew RTL), tiers per spec 2026-05-31-zync-subscription.md.
- [ ] AC-04 [UNVERIFIED] — Visitor completes signup and lands in a fresh tenant. Evidence: dev.zync.is/signup 200; 25 auth endpoints under /api/auth/* judged complete by sweep; verify: scripted signup on dev + confirm tenant row.
- [ ] AC-05 [UNVERIFIED] — Verification email actually arrives. Evidence: real Resend impl (Worker + @zync/notifications); verify: signup with real inbox on dev.
- [ ] AC-06 [UNVERIFIED] — Login + session + 2FA work. Evidence: app.dev.zync.is/login 200, endpoints exist; verify: Playwright login flow on dev.
- [ ] AC-07 [UNVERIFIED] — Onboarding wizard completes for new OWNER. Evidence: spec 2026-05-31-onboarding.md + routes exist; verify: run wizard on dev.
- [ ] AC-08 [UNVERIFIED] — Team invite accept flow works. Evidence: invite endpoints exist; verify: invite→accept on dev.

Core value (invoice a client):
- [ ] AC-09 [UNVERIFIED] — Create customer, create invoice, invoice math/VAT correct. Evidence: invoices router (55 handlers) + zync-api vitest coverage; verify: dev walkthrough.
- [ ] AC-10 [BROKEN] — Send invoice email with working payment link. Evidence: link generated (packages/payments/src/invoice-payment-token.ts:62) + emailed (payment-link.ts:251) but target page absent → recipient gets dead link.
- [ ] AC-11 [MISSING] — Public pay page zync.is/pay/{token} renders invoice + pay CTA. Evidence: no such route in zync-app or zync-www (spec 2026-05-31-invoice-payment-ux.md unimplemented).
- [ ] AC-12 [MISSING] — Client card payment settles via a gateway. Evidence: cardcom/payplus/stripe adapters are throw-on-call stubs; portal pay + staff payment-link POST return 502.
- [ ] AC-13 [UNVERIFIED] — Record manual payment marks invoice paid. Evidence: record-payment endpoint + tests exist; verify: dev walkthrough.
- [ ] AC-14 [UNVERIFIED] — IL-compliant invoice document issued via Morning/iCount/etc. Evidence: real fetch() HTTP adapters for 5 platforms; verify: sandbox creds + one issuance.
- [ ] AC-15 [UNVERIFIED] — Client portal shows invoices to the client. Evidence: portal invoice list exists per sweep; verify: portal login on dev.
- [ ] AC-16 [UNVERIFIED] — Recurring invoices generate on schedule. Evidence: RecurringInvoiceAlarmDO + queue wired; verify: create schedule on dev, wait one cycle.

Zync gets paid:
- [ ] AC-17 [UNVERIFIED] — /settings/plan shows plan comparison + current tier. Evidence: page + UpgradeModal components exist; verify: view on dev.
- [ ] AC-18 [MISSING] — Business-tier checkout collects 89 ILS/mo. Evidence: only NullPaymentAdapter registered (packages/payments/src/registry.ts:26); createCheckoutSession throws PaymentProviderNotConfiguredError (null-adapter.ts:38).
- [ ] AC-19 [MISSING] — Subscription webhook updates zync_subscriptions on payment events. Evidence: null adapter handleWebhook throws; endpoint returns 501.
- [ ] AC-20 [UNVERIFIED] — Tier limits actually gate features (free→business upsell). Evidence: tier-gating + upgrade modal code exists; verify: exceed a free limit on dev.
- [ ] AC-21 [BROKEN] — Trial expiry converts/downgrades automatically. Evidence: cron route + tests exist but wrangler crons disabled; needs external dispatcher (cronjobs.api) — not verified firing.
- [ ] AC-22 [MISSING] — Dunning/payment-retry on failed charge. Evidence: DB + settings + manual API only; no automated processor; manual remind sends no email; payment.charge job unimplemented.

Platform/ops:
- [ ] AC-23 [BROKEN] — Push to default branch deploys to production. Evidence: main.yml triggers on `main`, repo branch is `master`; api/app/www lack [env.production] wrangler sections.
- [ ] AC-24 [BROKEN] — All 5 apps deployed by CI. Evidence: zync-admin + zync-public-api absent from main.yml; zync-public-api Hyperdrive/KV IDs placeholders.
- [ ] AC-25 [WORKS] — Dev environment serves all three user-facing apps. Evidence: dev.zync.is / app.dev.zync.is / admin.zync.is all 200; api health ok (observed 2026-07-12).
- [ ] AC-26 [WORKS] — Monorepo typecheck green. Evidence: `pnpm typecheck` rc=0 (two runs 2026-07-12); one concurrent-run flake on zync-www, standalone 0 errors.
- [ ] AC-27 [BROKEN] — Test suite as wired reflects the written tests. Evidence: zync-app full gate passes 14/14 Node tests and 83/83 Vitest files (253/253 tests); packages/payments + auth have zero tests, no signup→invoice→pay E2E exists, and PR UI matrix/a11y remains blocked until isolated preview secrets and environment reviewers are provisioned.
- [ ] AC-28 [MISSING] — E2E test covers signup→invoice→pay. Evidence: no such spec; Playwright suite covers OS-shell only.
- [ ] AC-29 [BROKEN] — Migration journal consistent + regeneratable DB. Evidence: committed tree has 65 SQL files and 65 matching journal tags; 30 snapshots are present and 35 are missing; db:seed entrypoint missing (`src/seed/run.ts`).
- [ ] AC-30 [BROKEN] — No dead-end nav items in shipped UI. Evidence: `/invoices/drafts` is now wired and dead `/billing` navigation removed; `/payments/*`, `/analytics/*`, and `/integrations/*` remain unwired or stub modules.
- [ ] AC-31 [UNVERIFIED] — Production secrets provisioned (RESEND_API_KEY, JWT_SECRET, DATABASE_URL, INVOICE_PAYMENT_LINK_KEY, OAuth). Evidence: secrets/ has 9 named files locally; CF prod secret state not inspectable from repo; verify: `wrangler secret list` per app.
- [ ] AC-32 [UNVERIFIED] — Tenancy isolation holds on money-path endpoints. Evidence: prior security-audit marathon exists (docs/plans/2026-06-10-security-audit-marathon.md); verify: run security-gate on invoices/payments routes.

## Cut list (explicitly NOT v1 — does not gate launch)

VirtuAC-scale ambitions present in specs/code that should not block go-live: Telegram bot, Zapier/Make integrations + integration hub, OAuth authorization-code provider + public API + API keys UI, AI assistant / system-AI, Vectorize KB search + KB versioning, multi-currency, Italian e-invoice (ITA), mileage logbook, lead scoring, multi-signatory coordination, ticket SLA escalation, admin reports/analytics, accountant export, bad-debt writeoff, uniform format export, desktop/mobile "Zync OS" shells (recent marathons), inventory management, white-label tier tooling. Also cuttable for v1: contractor portal/payouts, calendar 2-way sync, real-time infra polish.

## Scoreboard

**3 WORKS / 9 BROKEN / 6 MISSING / 14 UNVERIFIED** (32 criteria).

Honest estimate: **~60% of the product surface is built, but ~35% of the MONEY JOURNEY is verified working — and 0% of payment collection exists.** Code volume is not the gap; the revenue seam and prod ops are. With 14 UNVERIFIED that could each flip either way on a dev walkthrough, the true works-rate is bounded at 9–72%; the verified floor today is 9%.

Top 5 blockers by launch impact:
1. **No payment collection at all** — subscription checkout is a null adapter and all invoice card gateways are stubs (AC-12/18/19). Pick ONE gateway (e.g. Morning-native payments or Stripe), implement adapter + webhook settlement end-to-end.
2. **`/pay/{token}` page missing while links are already emailed** (AC-10/11) — actively harmful: recipients get dead links. Ship the page or stop emailing links.
3. **Production deploy path never fires** (AC-23/24) — branch `main` vs `master` mismatch, missing `[env.production]` sections, prod domains 403. Nothing can go live until this is fixed.
4. **Scheduled revenue jobs not firing** (AC-21/22) — trial expiry, reminders, dunning depend on disabled/external cron; without them free tenants never convert and failed payments never retry.
5. **Test truth gap on the money path** (AC-27/28) — zero tests on packages/payments and packages/auth, no E2E for signup→invoice→pay, and preview environment provisioning remains absent; zync-app full unit gate is green.
