diff --git a/PLAN.md b/PLAN.md index 023f281..0e72c40 100644 --- a/PLAN.md +++ b/PLAN.md @@ -29,7 +29,7 @@ running a Federated Core can install as a CoreDesktop sibling. | Teams and domains | A person can belong to several teams; each team works on **one website domain** (with its subdomains) (2026-11-25) | | Hosting (multi-tenant) | On a cloud, with **Garage** as the object storage we install, and the cloud's managed Postgres (2026-11-25) | -## Where things stand (2026-11-26) +## Where things stand (2026-11-30) **Every phase is built, 0–14**, Phase 12's part 5 (roles from the Core's groups) included, and all of it is merged into `main` and pushed (the user @@ -56,6 +56,26 @@ writes the post; the user pastes each subreddit's rules once (kept in filled in or copies the title and text, posts, and marks it posted. The warnings come from the pasted rules and the posts marked as posted. +**Metrics, from testing (2026-11-30).** Fixes from looking at the live +Stripe data: +- *Customers* means those who have spent more than $0, as Stripe counts + total spend: successful charges, captured less refunded. The sync now + reads charges too (`KindCharge`, and their events); sync state version + 2 makes an older database read everything once. `metrics.Spenders` + serves the Stripe card's count and Metrics → Customers. +- MRR and cohorts count only **paid** invoices (open ones count once + paid). +- A customer whose earliest recurring invoice is a renewal + (`subscription_cycle`) was a customer already: their first payment is + reactivation (move `existing`, `Model.Existing`), not new, and puts them + in no cohort. A $0 trial signup before it still makes them new. On the + live data, 38 customers. +- Cohorts show every cohort to the latest month, each as two rows: the + share of starting MRR, and the dollars (`Cohort.MRR`). The start month's + cohort is labelled *existing customers* (`Model.Base`). The CSVs follow. +- The live data shows yearly Federated - Good renewals at $700 since July + 2026 (it was $70, then $190 from March): for the user to confirm. + **Next: testing by hand with TEST.md**, in three passes: local, then server with the Core, then multi-tenant (TEST.md's table says which sections go with each pass). What the passes find gets fixed as it comes. @@ -1129,7 +1149,8 @@ into `main`. **Parts 1 to 6 built, and merged into `main` on 2026-11-22** descriptions). Products are read on every sync; without Products access, the sync says so and names come from the line descriptions. `metrics.Products` lists each product's last 12 - months billed (paid and open invoices). Margins are a default plus + months billed (paid and open invoices; MRR, since 2026-11-30, paid + only). Margins are a default plus per-product overrides, under Metrics → Gross margin by product. `WeightedMargin` gives the revenue-weighted margin. - On the live account, the first full sync read 857 customers, @@ -1143,8 +1164,8 @@ into `main`. **Parts 1 to 6 built, and merged into `main` on 2026-11-22** - **Built 2026-11-22** (no schema change): - `metrics.Build` measures each customer's MRR at each month's last second (the current month: now). It sums the recurring lines of - paid and open invoices in the main currency whose period covers - that moment. + paid invoices in the main currency whose period covers that moment + (open ones too, until 2026-11-30). - A normal line is divided by its interval (a year counts as 12 months, a week as 52/12). A proration is spread over its actual part-period, so an upgrade counts from its day. Under a cent counts @@ -1155,7 +1176,7 @@ into `main`. **Parts 1 to 6 built, and merged into `main` on 2026-11-22** paid then. NRR over 12 months is what the customers of 12 months ago pay now ÷ what they paid then. - Cohorts are by the first paid month, with the retained share of - starting MRR for up to 12 months. + starting MRR (since 2026-11-30: and the dollars, every month). - **Start month.** When 20+ customers and most of the MRR appear as new in one month, the app suggests counting from it. That's what happened in January 2025 on the live account: billing came back to @@ -1174,8 +1195,9 @@ into `main`. **Parts 1 to 6 built, and merged into `main` on 2026-11-22** tie. - **Built 2026-11-22** (schema 20: `crm_matches`, the user's choices only): - - `metrics.Matches` matches every customer with a paid or open - invoice, in this order: + - `metrics.Matches` matches every customer who has spent more than + $0 (until 2026-11-30: every customer with a paid or open invoice), + in this order: 1. the user's choice; 2. an Account Hermes created from here (a done `stripe-customer:` CRM action); @@ -1258,7 +1280,7 @@ into `main`. **Parts 1 to 6 built, and merged into `main` on 2026-11-22** CLV:CAC. - `metrics.Export` writes eight tables as CSV, amounts in dollars: MRR month by month (every month), NRR by cohort and revenue by - cohort (24 months), CAC by month and by channel, the spend log, + cohort (every cohort, every month, since 2026-11-30), CAC by month and by channel, the spend log, products and margins, and customers with their MRR and CRM match. Each is downloaded at `/metrics/export/.csv`, linked under its table. diff --git a/README.md b/README.md index b056d92..4f802db 100644 --- a/README.md +++ b/README.md @@ -144,10 +144,11 @@ Edit the brief and answer those questions ("not tested" is a fine answer), then - **Bing:** with a Bing Webmaster API key (Settings → Search engines), Bing's weekly clicks and impressions, its top searches, and its crawl issues. **Metrics (Metrics).** With the Stripe key from Settings → Website & sales (give it read access to Customers, Invoices, Credit notes, Charges and Refunds, and Events too), Supermarket reads your whole Stripe history once, then the changes every hour. Under *Gross margin by product*, each product shows what it billed over the last 12 months; give each its margin (what you keep after the cost of delivering it), or leave it at the default, 60%. CLV uses them. Metrics shows: -- MRR today, ARR, the number of paying customers, the average per customer, and NRR for the month and over 12 months; +- MRR today, ARR, the number of paying customers, the average per customer, and NRR for the month and over 12 months (MRR counts paid invoices only); - a 24-month chart; - each month's movements (new, expansion, contraction, churn, reactivation), with a page per month listing each customer's move; -- cohorts by the month customers first paid, with the share of their starting MRR they still pay. +- cohorts by the month customers first paid, followed to the latest month: the share of their starting MRR they still pay, and the dollars. With a start month set, its cohort is the existing customers; a customer whose first invoice in Stripe is a renewal was a customer already, and counts as reactivation, not new; +- a customer count that, like Stripe's, takes only customers who have spent more than $0 (payments less refunds). MRR is built from the invoice lines (each recurring line's amount after discounts, spread over its billing period), so past months are exact. *Spend and CAC* (under Metrics): log what marketing and sales cost each month, by channel, by hand or by pasting a CSV (`month,channel,amount,note`). origami.chat and explee.com campaign spend comes in on its own. CAC is the month's spend over the customers who first paid that month, with a steadier three-month figure. Over the last 12 months it's also shown per channel, using each new customer's first step in the funnel (a reply, a visit, an outreach email), matched by email. diff --git a/TEST.md b/TEST.md index 0d0f882..c6e4722 100644 --- a/TEST.md +++ b/TEST.md @@ -511,8 +511,12 @@ Throughout, also notice: - [ ] With the Stripe key's read access widened (Customers, Invoices, Credit notes, Charges and Refunds, Events), Metrics → *Sync now* reads your whole history the first time and says so. -- [ ] The counts of customers, invoices, credit notes and refunds match - Stripe's dashboard (draft invoices aren't counted). +- [ ] The counts of invoices, credit notes and refunds match Stripe's + dashboard (draft invoices aren't counted). +- [ ] After the first sync with this version (it reads everything once, + charges included), *Customers* matches Stripe's customer list + filtered to total spend above $0, and says "of N in Stripe" (deleted + customers left out). *Payments* counts the charges. - [ ] A later *Sync now* applies only the changes since the last one; a payment or refund made in Stripe shows up within the hour. - [ ] The currencies listed are the ones you bill in. @@ -524,8 +528,13 @@ Throughout, also notice: ### MRR, movements and NRR - [ ] Metrics shows MRR today, close to Stripe's own MRR figure (Billing → - Overview). Small differences come from how each counts prorations and - open invoices. + Overview). Small differences come from how each counts prorations, + and Supermarket counts only paid invoices. +- [ ] A customer with only an unpaid (open) invoice isn't in MRR or any + cohort; once it's paid, they are. +- [ ] A customer whose first invoice in Stripe is a renewal shows as + *existing* in that month's moves, counted under reactivation, not + new, and is in no cohort. One with a $0 trial before paying is new. - [x] The month-by-month table's net change adds up: new + expansion + reactivation − contraction − churn. - [ ] Open a month: each customer's move is listed with the MRR before @@ -534,6 +543,11 @@ Throughout, also notice: from that month appears; *Count from …* makes those customers the starting base, and the suggestion goes away. - [x] Cohorts start at 100% in their first month. +- [ ] Cohorts list every cohort, each followed to the latest month. Each + is two rows: the percentages, and the dollars lined up under them; + the month, customers and starting MRR sit across both. +- [ ] With *Count from* set, that month's cohort says *existing + customers*; with it cleared, none does. ### Spend and CAC @@ -576,6 +590,8 @@ Throughout, also notice: - [x] Before Hermes has copied the CRM, Metrics → Customers and the CRM says no Accounts are copied, and lists every customer with billing. +- [ ] It lists only customers who have spent more than $0: not trials, + not ones with only unpaid invoices, not ones refunded in full. - [ ] Once Accounts are copied (after the CRM bridge works), customers are matched by stored ID, email or domain; check a few against EspoCRM. Gmail-style addresses never match by domain.