Framework by wheelbase ai · v0.1 · open source
Canonical
A recursive, self-improving knowledge base for analytics, built for humans and AI agents. One Git repo that gives product, data science, finance, and operations a shared foundation, so AI agents and humans alike get the same accurate results.
Who this is for
Teams that want a design and execution blueprint for unlocking agent-powered efficiency and accuracy in their knowledge work.
Finance
Board-grade definitions with certified queries and an audit trail. Forecast comparison and month-end flux become skills, not scrambles.
BizOps
Shared frameworks and analytical processes. For questions like:
- What tables and filters should we use to report D7 retention, ARR and Sessions per User?
- What % of growth came from volume versus price?
Product
Engagement mappings at the right grain, consistent funnel metrics, and every experiment readout where the next team will find it.
Data science
Known issues written down once, not rediscovered every quarter. Every governed metric tied to certified SQL.
Operations
Offer letters drafted consistent with your compensation policy, and the cap table updated as equity grants are approved.
01 · The problem
Analytics knowledge lives in people's heads. AI can't ask around.
Metric definitions live in a BI tool. Caveats live in an analyst's memory. The validated ARR query is in someone's personal folder. The right way to compare two forecast versions exists only as muscle memory.
Point a model at your warehouse and it will compute "churn" four defensible ways, none of them yours. What limits AI in analytics isn't model capability. It's context. And even once you write that context down, it goes stale within weeks.
“Why is my Claude giving me a different ARR than yours?”
Same question, one right answer
Live Demos: Same model. Same data. Different answer.
Two runs of the same model get the same question and the same read-only warehouse. One also gets Lumen's knowledge base. Watch where they split.
The CFO asks
“Two things for the board deck. First, did we beat plan on ARR at the end of October 2026? Use the latest forecast version. Second, what was our NRR for October 2026, and what drove the change from September?”
Without Canonical
Warehouse access only
Waiting to run
- Tables
List warehouse tables - SQL
select version_id, version_name, scenario, min(month), max(month), count(*), max(exported_…select version_id, version_name, scenario, min(month), max(month), count(*), max(exported_at), listagg(distinct line, ',') from raw_pigment.plan_lines group by 1,2,3 order by 7
Exit code 1 #!/usr/bin/env python3 """Read-only SQL against Lumen's demo warehouse (built by build.py). python3 query.py "select * from analytics.fct_nrr_monthly_v2 order by month desc limit 3" python3 query.py --tables list every table with its columns and row count Schemas work as in Snowflake (`analytics.fct_arr_daily`, `raw_stripe.invoices`, ...). A few Snowflake functions are emulated so certified SQL runs as written: last_day(d), dateadd(part, n, d), datediff(part, a, b) and date_trunc(part, d). Results print as an aligned table, at most 200 rows. """ from __future__ import annotations import datetime as dt … 68 more lines - Thinks
SQLite underneath.
- SQL
select version_id, version_name, scenario, min(month), max(month), count(*), max(exported_…select version_id, version_name, scenario, min(month), max(month), count(*), max(exported_at), group_concat(distinct line) from raw_pigment.plan_lines group by 1,2,3 order by 7 select * from raw_pigment.plan_lines where month like '2026-10%' order by exported_at
version_id | version_name | scenario | min(month) | max(month) | count(*) | max(exported_at) | group_concat(distinct line) -----------+--------------+----------+------------+------------+----------+----------------------+-------------------------------------------------------------- ver_7c3d1e | Budget FY26 | Base | 2026-01-01 | 2026-12-01 | 72 | 2026-11-27T05:00:00Z | ARR,Implementation fees,New ARR,Expansion ARR,Churned ARR,Cus ver_8f21a0 | Board | Base | 2026-01-01 | 2026-12-01 | 72 | 2026-11-27T05:00:00Z | ARR,Implementation fees,New ARR,Expansion ARR,Churned ARR,Cus ver_9a07c4 | Latest | Base | 2026-01-01 | 2026-12-01 | 72 | 2026-11-27T05:00:00Z | ARR,Implementation fees,New ARR,Expansion ARR,Churned ARR,Cus (3 rows) version_id | version_name | scenario | month | line | amount_usd | exported_at -----------+--------------+----------+------------+---------------------+--------------+--------------------- ver_7c3d1e | Budget FY26 | Base | 2026-10-01 | ARR | 8,175,000.00 | 2026-11-27T05:00:00Z ver_7c3d1e | Budget FY26 | Base | 2026-10-01 | Implementation fees | 32,500.00 | 2026-11-27T05:00:00Z ver_7c3d1e | Budget FY26 | Base | 2026-10-01 | New ARR | 241,300.00 | 2026-11-27T05:00:00Z ver_7c3d1e | Budget FY26 | Base | 2026-10-01 | Expansion ARR | 93,400.00 | 2026-11-27T05:00:00Z ver_7c3d1e | Budget FY26 | Base | 2026-10-01 | Churned ARR | -147,900.00 | 2026-11-27T05:00:00Z ver_7c3d1e | Budget FY26 | Base | 2026-10-01 | Customers | 1,494.00 | 2026-11-27T05:00:00Z … 13 more lines
- Read
query.py - Read
query.py - SQL
select snapshot_date, count(*), count(distinct stripe_customer_id), sum(arr_usd) from anal…select snapshot_date, count(*), count(distinct stripe_customer_id), sum(arr_usd) from analytics.fct_arr_daily where snapshot_date in ('2026-08-31','2026-09-30','2026-10-31','2026-11-01','2026-11-27') group by 1 select max(snapshot_date), min(snapshot_date) from analytics.fct_arr_daily select * from analytics.fct_nrr_monthly_v2 order by monthsnapshot_date | count(*) | count(distinct stripe_customer_id) | sum(arr_usd) --------------+----------+------------------------------------+------------- 2026-08-31 | 1425 | 1425 | 7,669,015.00 2026-09-30 | 1446 | 1446 | 7,838,900.00 2026-10-31 | 1455 | 1455 | 8,133,005.00 2026-11-01 | 1456 | 1456 | 8,192,565.00 2026-11-27 | 1464 | 1464 | 8,219,925.00 (5 rows) max(snapshot_date) | min(snapshot_date) -------------------+------------------- 2026-11-27 | 2024-10-01 (1 rows) month | nrr -----------+------- … 14 more lines
- SQL
with b as (select stripe_customer_id c, arr_usd a from analytics.fct_arr_daily where snaps…with b as (select stripe_customer_id c, arr_usd a from analytics.fct_arr_daily where snapshot_date=dateadd(month,-12,'2026-10-31')), e as (select stripe_customer_id c, arr_usd a from analytics.fct_arr_daily where snapshot_date='2026-10-31') select sum(b.a), sum(coalesce(e.a,0)), sum(coalesce(e.a,0))/sum(b.a) from b left join e using(c) with b as (select stripe_customer_id c, arr_usd a from analytics.fct_arr_daily where snapshot_date=dateadd(month,-12,'2026-09-30')), e as (select stripe_customer_id c, arr_usd a from analytics.fct_arr_daily where snapshot_date='2026-09-30') select sum(b.a), sum(coalesce(e.a,0)), sum(coalesce(e.a,0))/sum(b.a) from b left join e using(c)
sum(b.a) | sum(coalesce(e.a,0)) | sum(coalesce(e.a,0))/sum(b.a) -------------+----------------------+------------------------------ 6,486,160.00 | 6,865,810.00 | 1.05853 (1 rows) sum(b.a) | sum(coalesce(e.a,0)) | sum(coalesce(e.a,0))/sum(b.a) -------------+----------------------+------------------------------ 6,415,520.00 | 6,587,110.00 | 1.02675 (1 rows)
- SQL
with s as (select stripe_customer_id c, arr_usd a, plan_tier t from analytics.fct_arr_dail…with s as (select stripe_customer_id c, arr_usd a, plan_tier t from analytics.fct_arr_daily where snapshot_date='2026-09-30'), o as (select stripe_customer_id c, arr_usd a, plan_tier t from analytics.fct_arr_daily where snapshot_date='2026-10-31') select coalesce(s.c,o.c) c, s.a, o.a, coalesce(o.a,0)-coalesce(s.a,0) d, s.t, o.t, cu.name, cu.created, cu.livemode from s full outer join o on s.c=o.c left join raw_stripe.customers cu on cu.id=coalesce(s.c,o.c) where coalesce(o.a,0)<>coalesce(s.a,0) order by abs(d) desc limit 30
c | a | a | d | t | t | name | created | livemode -------------------+------------+------------+------------+----------+----------+-----------------------------+------------+--------- cus_DhU4XgaOzyx7J3 | 128,000.00 | 344,000.00 | 216,000.00 | business | business | Acme Logistics | 2023-03-15 | 1 cus_9IhetLGnvAdyVY | NULL | 9,900.00 | 9,900.00 | NULL | pro | Highlandport Retail | 2026-10-08 | 1 cus_9uLSkHOmxc3HEZ | NULL | 9,600.00 | 9,600.00 | NULL | business | Lakebrook Dental | 2026-10-16 | 1 cus_Aw0ClsVLzWMoOc | 9,405.00 | NULL | -9,405.00 | pro | NULL | Mapleline Manufacturing | 2022-08-12 | 1 cus_raZLsv15IIZ6ob | 7,425.00 | NULL | -7,425.00 | pro | NULL | Bluemark Labs | 2021-03-28 | 1 cus_5wPCFcvyyg5xjP | 6,435.00 | NULL | -6,435.00 | pro | NULL | Northline Builders | 2025-04-12 | 1 cus_FsAPpdz6Si1gZm | 6,435.00 | NULL | -6,435.00 | pro | NULL | Embercrest Outfitters | 2021-02-02 | 1 cus_CIVwQack8iIjUQ | NULL | 6,000.00 | 6,000.00 | NULL | business | Maplecrest Pharmacy | 2026-10-23 | 1 cus_wvPe3Mllp2Ov3o | 5,940.00 | NULL | -5,940.00 | pro | NULL | Goldenstone Outfitters | 2021-08-13 | 1 cus_CfdsklQ7D0pNX0 | NULL | 5,940.00 | 5,940.00 | NULL | pro | Coppergate Pharmacy | 2026-10-06 | 1 cus_2gWozpOO8i2Crx | NULL | 5,600.00 | 5,600.00 | NULL | business | Coastalstead Logistics | 2026-10-17 | 1 cus_Jw8iuuFqOYO0gZ | 5,445.00 | NULL | -5,445.00 | pro | NULL | Meridianmere Learning | 2022-11-08 | 1 … 19 more lines
- Thinks
Quick status: I've reproduced both NRR figures. October's jump traces mostly to one account, Acme Logistics, whose ARR went up $216K. Now I'm checking whether that increase is real.
- SQL
select snapshot_date, arr_usd, plan_tier from analytics.fct_arr_daily where stripe_custome…select snapshot_date, arr_usd, plan_tier from analytics.fct_arr_daily where stripe_customer_id='cus_DhU4XgaOzyx7J3' and (snapshot_date like '%-01' or snapshot_date >= '2026-09-25') and snapshot_date>='2026-06-01' order by 1 select * from analytics.stg_stripe__subscriptions_daily where stripe_customer_id='cus_DhU4XgaOzyx7J3' and snapshot_date in ('2026-09-30','2026-10-31','2026-11-27') select s.*, i.* from raw_stripe.subscriptions s join raw_stripe.subscription_items i on i.subscription=s.id where s.customer='cus_DhU4XgaOzyx7J3' select * from raw_stripe.discounts where subscription in (select id from raw_stripe.subscriptions where customer='cus_DhU4XgaOzyx7J3') select o.* from raw_salesforce.opportunities o join raw_salesforce.accounts a on a.id=o.account_id where a.stripe_customer_id__c='cus_DhU4XgaOzyx7J3' order by close_datesnapshot_date | arr_usd | plan_tier --------------+------------+---------- 2026-06-01 | 128,000.00 | business 2026-07-01 | 128,000.00 | business 2026-08-01 | 128,000.00 | business 2026-09-01 | 128,000.00 | business 2026-09-25 | 128,000.00 | business 2026-09-26 | 128,000.00 | business 2026-09-27 | 128,000.00 | business 2026-09-28 | 128,000.00 | business 2026-09-29 | 128,000.00 | business 2026-09-30 | 128,000.00 | business 2026-10-01 | 128,000.00 | business 2026-10-02 | 128,000.00 | business … 83 more lines
- SQL
select * from raw_stripe.invoices where customer='cus_DhU4XgaOzyx7J3' and created>='2026-0…select * from raw_stripe.invoices where customer='cus_DhU4XgaOzyx7J3' and created>='2026-01-01' order by created select contract_type__c, count(*), sum(amount) from raw_salesforce.opportunities group by 1 select special_terms__c, count(*) from raw_salesforce.opportunities where special_terms__c is not null group by 1 order by 2 desc limit 40 select coupon_id, percent_off, duration, duration_in_months, count(*), min(start_date), max(start_date) from raw_stripe.discounts group by 1,2,3,4
id | customer | subscription | created | period_start | period_end | amount_due | amount_paid | status | line_type ------------------+--------------------+--------------------+------------+--------------+------------+------------+-------------+--------+------------- in_Me2S8gjLPnapVz | cus_DhU4XgaOzyx7J3 | sub_SdoVwgP4FmErxT | 2026-03-15 | 2026-03-15 | 2027-03-15 | 12800000 | 12800000 | paid | subscription in_CqtAkaWSX9iUh3 | cus_DhU4XgaOzyx7J3 | sub_RDeagiwM0qkDsz | 2026-10-15 | 2026-10-15 | 2026-11-15 | 0 | 0 | paid | subscription in_duZfa7D8AlvjC8 | cus_DhU4XgaOzyx7J3 | sub_RDeagiwM0qkDsz | 2026-11-15 | 2026-11-15 | 2026-12-15 | 0 | 0 | paid | subscription (3 rows) contract_type__c | count(*) | sum(amount) -----------------+----------+------------- Launch Program | 1 | 216,000.00 Standard Annual | 2075 | 9,522,000.00 (2 rows) special_terms__c | count(*) ---------------------------------------------------------------------------------------+--------- Co-termed with renewal. | 491 … 26 more lines
- SQL
select d.coupon_id, s.subscription_id, s.unit_amount_net, i.unit_amount, s.quantity, s.bil…select d.coupon_id, s.subscription_id, s.unit_amount_net, i.unit_amount, s.quantity, s.billing_interval, f.arr_usd from raw_stripe.discounts d join analytics.stg_stripe__subscriptions_daily s on s.subscription_id=d.subscription and s.snapshot_date='2026-10-31' join raw_stripe.subscription_items i on i.subscription=d.subscription join analytics.fct_arr_daily f on f.stripe_customer_id=s.stripe_customer_id and f.snapshot_date=s.snapshot_date where d.start_date<='2026-10-31' and (d.end_date is null or d.end_date>'2026-10-31') group by d.coupon_id limit 10 select stripe_customer_id, count(*) from analytics.stg_stripe__subscriptions_daily where snapshot_date='2026-10-31' group by 1 having count(*)>1 limit 5 select status, is_paid_plan, count(*) from analytics.stg_stripe__subscriptions_daily where snapshot_date='2026-10-31' group by 1,2 select livemode, count(*) from raw_stripe.customers group by 1
coupon_id | subscription_id | unit_amount_net | unit_amount | quantity | billing_interval | arr_usd -----------+--------------------+-----------------+-------------+----------+------------------+----------- ANNUAL10 | sub_pZhIDeAg3jDc6M | 40000 | 40000 | 6 | year | 2,400.00 LAUNCH100 | sub_RDeagiwM0qkDsz | 5625 | 5625 | 320 | month | 344,000.00 PROMO20_3M | sub_pQ5anY5Tbg5YZ4 | 4125 | 4125 | 6 | month | 2,970.00 (3 rows) stripe_customer_id | count(*) -------------------+--------- cus_DhU4XgaOzyx7J3 | 2 (1 rows) status | is_paid_plan | count(*) -------+--------------+--------- active | 1 | 1458 paused | 1 | 2 … 6 more lines
- SQL
select c.id, c.name, c.livemode, f.arr_usd from raw_stripe.customers c left join analytics…select c.id, c.name, c.livemode, f.arr_usd from raw_stripe.customers c left join analytics.fct_arr_daily f on f.stripe_customer_id=c.id and f.snapshot_date='2026-10-31' where c.livemode=0 select s.stripe_customer_id, s.status, f.arr_usd from analytics.stg_stripe__subscriptions_daily s left join analytics.fct_arr_daily f on f.stripe_customer_id=s.stripe_customer_id and f.snapshot_date=s.snapshot_date where s.snapshot_date='2026-10-31' and s.status='paused' select d.coupon_id, count(*), sum(s.unit_amount_net*s.quantity/100.0*(case s.billing_interval when 'month' then 12 else 1 end)*d.percent_off/100.0) disc_arr from raw_stripe.discounts d join analytics.stg_stripe__subscriptions_daily s on s.subscription_id=d.subscription and s.snapshot_date='2026-10-31' where d.start_date<='2026-10-31' and (d.end_date is null or d.end_date>'2026-10-31') group by 1 select count(*), sum(arr_usd) from analytics.fct_arr_daily where snapshot_date='2026-10-31' and stripe_customer_id not in (select id from raw_stripe.customers)
id | name | livemode | arr_usd -----------------+-----------------------------+----------+-------- cus_TEST4kQ2nV8p | Test Account (do not use) | 0 | NULL cus_TESTm81ZqLw3 | Test Account 2 (do not use) | 0 | NULL (2 rows) stripe_customer_id | status | arr_usd -------------------+--------+-------- cus_No9uW8oVMDn7KT | paused | NULL cus_wvPe3Mllp2Ov3o | paused | NULL (2 rows) coupon_id | count(*) | disc_arr -----------+----------+----------- ANNUAL10 | 124 | 78,600.00 LAUNCH100 | 1 | 216,000.00 … 6 more lines
- SQL
select d.coupon_id, i.subscription, si.unit_amount*si.quantity gross, i.amount_due, i.peri…select d.coupon_id, i.subscription, si.unit_amount*si.quantity gross, i.amount_due, i.period_start from raw_stripe.discounts d join raw_stripe.invoices i on i.subscription=d.subscription join raw_stripe.subscription_items si on si.subscription=d.subscription where d.coupon_id in ('ANNUAL10','PROMO20_3M') and i.created>='2026-09-01' order by i.created desc limit 8coupon_id | subscription | gross | amount_due | period_start ----------+--------------------+--------+------------+------------- ANNUAL10 | sub_HjmUTCsdXUj7Im | 240000 | 240000 | 2026-11-25 ANNUAL10 | sub_ZzQvyUvPesM1LE | 400000 | 400000 | 2026-11-24 ANNUAL10 | sub_ZqO4UK5kjjHwJn | 280000 | 250000 | 2026-11-22 ANNUAL10 | sub_ZqO4UK5kjjHwJn | 280000 | 280000 | 2026-11-22 ANNUAL10 | sub_TJXjfxp1Kxsmrf | 760000 | 760000 | 2026-11-21 ANNUAL10 | sub_HQGetaw6pUUhw0 | 720000 | 720000 | 2026-11-20 ANNUAL10 | sub_HZzSDMuKoYdYXp | 240000 | 240000 | 2026-11-16 ANNUAL10 | sub_HZzSDMuKoYdYXp | 240000 | 250000 | 2026-11-16 (8 rows)
- SQL
with s as (select stripe_customer_id c, arr_usd a from analytics.fct_arr_daily where snaps…with s as (select stripe_customer_id c, arr_usd a from analytics.fct_arr_daily where snapshot_date='2026-09-30'), o as (select stripe_customer_id c, arr_usd a from analytics.fct_arr_daily where snapshot_date='2026-10-31'), j as (select coalesce(s.a,0) sa, coalesce(o.a,0) oa from s full outer join o on s.c=o.c) select sum(case when sa=0 then oa end) new, sum(case when sa>0 and oa>sa then oa-sa end) exp, sum(case when sa>0 and oa>0 and oa<sa then oa-sa end) contr, sum(case when oa=0 then -sa end) churn from j select 6649810.0/6486160
new | exp | contr | churn -----------+------------+------------+----------- 103,270.00 | 281,175.00 | -16,640.00 | -73,700.00 (1 rows) 6649810.0/6486160 ----------------- 1.02523 (1 rows)
Answer✗ Wrong
- Missed plan: October ARR $8,133,005 vs. $8,285,600 "Latest" plan, $152.6K (1.8%) below; excluding Acme's $216K, 4.4% below.
- NRR 105.9%, up from 102.7%: nearly all of the rise is Acme Logistics' $216K expansion; without it, 102.5%.
- Acme isn't billing yet: 100% discounted until Jan 15, 2027; Finance/Legal must review LP-0007 section 4 before board use.
Full answer
1. ARR vs. plan, end of October 2026: we missed plan.
- Actual ARR on Oct 31: $8,133,005. Plan in the "Latest" forecast version was $8,285,600, so we were $152.6K (1.8%) below plan. We also came in below the Board version ($8,251,500) and Budget FY26 ($8,175,000).
- Even that $8.13M flatters October. It includes $216K of ARR from Acme Logistics that isn't paying yet (explained below). Without it, ARR is $7,917,005, which is $368.6K (4.4%) below plan.
- New-customer ARR was the main shortfall. Ignoring Acme, net new ARR was about $78K against plan's $189K. New ARR was $103K against a plan of $244K. Expansion was $65K against $94K. Churn and downgrades were better than plan at about $90K against $150K.
2. NRR for October 2026: 105.9%, up from 102.7% in September. Nearly all of the rise is one deal.
- I reproduced both figures from the reported NRR table. NRR here is: ARR today from customers we had 12 months ago, divided by their ARR back then.
- What drove the change: On Oct 15, Acme Logistics (an existing customer, previously $128K ARR) added the Automations add-on for 320 seats. That took their ARR to $344K. The $216K increase accounts for about 3.3 of the 3.2-point rise.
- Without that deal, October NRR is 102.5%, slightly down from September's 102.7%. Day-to-day retention and expansion were flat to a bit softer.
Why the Acme $216K needs a caveat before it goes in a board deck:
- It's the only "Launch Program" contract in Salesforce. Every other deal uses the standard annual contract. Its terms point to "Order Form LP-0007, section 4", which isn't in the warehouse, so I can't tell whether it's a firm commitment or something they can cancel.
- In Stripe it carries a 100%-off discount for 3 months (Oct 15, 2026 to Jan 15, 2027). Both invoices so far, for October and November, were $0.
- Our ARR calculation counts it at full list price because it ignores this discount.
Suggested board language: "October ARR was $8.13M, 1.8% below forecast. Reported NRR rose to 105.9%, driven by a single launch-program expansion at Acme Logistics that doesn't start billing until January 2027. Excluding it, NRR was 102.5%, roughly flat with September, and ARR was 4.4% below forecast."
Before this goes out:
- Finance or Legal should read section 4 of LP-0007 to decide whether the $216K counts as committed ARR now or only once billing starts.
- "Latest forecast version" is my reading of the Pigment version literally named "Latest". All three versions were exported at the same time, so the timestamps don't tell you which is newest.
- The ARR calculation also doesn't subtract the other active discounts: about $79K from a permanent 10%-off annual coupon and about $8K from a 20%-off 3-month promo. That should be checked separately. If those discounts are real, actual ARR is overstated in every month, but it doesn't change the direction of either answer.
With Canonical
Warehouse access + the knowledge base
Waiting to run
- Find
Search the knowledge base - Read
README.md, INDEX.md, execution/skills/answer-metric-question/SKILL.md and 4 more - Read
metrics/arr.md, metrics/net-revenue-retention.md, data/certified-queries/*.md and 2 more - Read
data/sources/*.md, data/entities/*.md, history/decisions/2026-10-annual-plan-discount.md and 1 more - Tables
List warehouse tables - SQL
select version_id, version_name, scenario, min(month), max(month), count(*), min(exported_…select version_id, version_name, scenario, min(month), max(month), count(*), min(exported_at), max(exported_at) from raw_pigment.plan_lines group by 1,2,3 order by 7 select distinct line from raw_pigment.plan_lines select * from raw_pigment.plan_lines where month like '2026-10%' order by version_id, scenario, line
version_id | version_name | scenario | min(month) | max(month) | count(*) | min(exported_at) | max(exported_at) -----------+--------------+----------+------------+------------+----------+----------------------+--------------------- ver_7c3d1e | Budget FY26 | Base | 2026-01-01 | 2026-12-01 | 72 | 2026-11-27T05:00:00Z | 2026-11-27T05:00:00Z ver_8f21a0 | Board | Base | 2026-01-01 | 2026-12-01 | 72 | 2026-11-27T05:00:00Z | 2026-11-27T05:00:00Z ver_9a07c4 | Latest | Base | 2026-01-01 | 2026-12-01 | 72 | 2026-11-27T05:00:00Z | 2026-11-27T05:00:00Z (3 rows) line ------------------- ARR Implementation fees New ARR Expansion ARR Churned ARR Customers … 22 more lines
- SQL
with q as ( select s.snapshot_date, s.stripe_customer_id, sum( s.unit_amount_net / 100.0 *…with q as ( select s.snapshot_date, s.stripe_customer_id, sum( s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end ) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null group by 1, 2) select snapshot_date, sum(arr_usd), count(*) from q where snapshot_date in ('2026-08-31','2026-09-30','2026-10-31','2026-11-27') group by 1 order by 1 select snapshot_date, sum(arr_usd), count(*) from analytics.fct_arr_daily where snapshot_date in ('2026-09-30','2026-10-31') group by 1 select max(snapshot_date) from analytics.stg_stripe__subscriptions_daily select * from analytics.fct_nrr_monthly_v2 order by monthsnapshot_date | sum(arr_usd) | count(*) --------------+--------------+--------- 2026-08-31 | 7,669,015.00 | 1425 2026-09-30 | 7,838,900.00 | 1446 2026-10-31 | 7,917,005.00 | 1455 2026-11-27 | 8,003,925.00 | 1464 (4 rows) snapshot_date | sum(arr_usd) | count(*) --------------+--------------+--------- 2026-09-30 | 7,838,900.00 | 1446 2026-10-31 | 8,133,005.00 | 1455 (2 rows) max(snapshot_date) ------------------ … 18 more lines
- SQL
with month_end as ( select s.snapshot_date as month_end, s.stripe_customer_id, sum(s.unit_…with month_end as ( select s.snapshot_date as month_end, s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = last_day(s.snapshot_date) group by 1, 2 ), cohort as ( select m.month_end, b.stripe_customer_id, b.arr_usd as arr_start from (select distinct month_end from month_end) m join month_end b on b.month_end = last_day(dateadd(month, -12, m.month_end)) where b.arr_usd > 0 ) select c.month_end as month, sum(coalesce(t.arr_usd, 0)) / sum(c.arr_start) as nrr from cohort c left join month_end t on t.stripe_customer_id = c.stripe_customer_id and t.month_end = c.month_end group by 1 order by 1Quoted text in this command can't be checked before it runs
- SQL
with month_end as ( select s.snapshot_date as month_end, s.stripe_customer_id, sum(s.unit_…with month_end as ( select s.snapshot_date as month_end, s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = last_day(s.snapshot_date) group by 1, 2 ), cohort as ( select m.month_end, b.stripe_customer_id, b.arr_usd as arr_start from (select distinct month_end from month_end) m join month_end b on b.month_end = last_day(dateadd(month, -12, m.month_end)) where b.arr_usd > 0 ) select c.month_end as month, sum(coalesce(t.arr_usd, 0)) / sum(c.arr_start) as nrr from cohort c left join month_end t on t.stripe_customer_id = c.stripe_customer_id and t.month_end = c.month_end group by 1 order by 1month | nrr -----------+--------- 2025-10-31 | 0.975105 2025-11-30 | 0.982747 2025-12-31 | 0.977437 2026-01-31 | 0.983949 2026-02-28 | 0.999175 2026-03-31 | 0.998693 2026-04-30 | 1.02269 2026-05-31 | 1.02313 2026-06-30 | 1.02186 2026-07-31 | 1.02384 2026-08-31 | 1.02574 2026-09-30 | 1.02675 … 2 more lines
- SQL
with month_end as ( select s.snapshot_date as month_end, s.stripe_customer_id, sum(s.unit_…with month_end as ( select s.snapshot_date as month_end, s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = last_day(s.snapshot_date) group by 1, 2 ), cohort as ( select m.month_end, b.stripe_customer_id, b.arr_usd as arr_start from (select distinct month_end from month_end) m join month_end b on b.month_end = last_day(dateadd(month, -12, m.month_end)) where b.arr_usd > 0 ), x as ( select c.month_end, c.stripe_customer_id, c.arr_start, coalesce(t.arr_usd,0) as arr_end from cohort c left join month_end t on t.stripe_customer_id = c.stripe_customer_id and t.month_end = c.month_end where c.month_end in ('2026-08-31','2026-09-30','2026-10-31')) select month_end, count(*) as cohort_n, sum(arr_start) start_arr, sum(arr_end) end_arr, sum(case when arr_end>arr_start then arr_end-arr_start else 0 end) as expansion, sum(case when arr_end<arr_start and arr_end>0 then arr_end-arr_start else 0 end) as contraction, sum(case when arr_end=0 then -arr_start else 0 end) as churn, sum(case when arr_end=0 then 1 else 0 end) as churned_n, sum(case when arr_end>arr_start then 1 else 0 end) as expanded_n, sum(case when arr_end<arr_start and arr_end>0 then 1 else 0 end) as contracted_n from x group by 1 order by 1month_end | cohort_n | start_arr | end_arr | expansion | contraction | churn | churned_n | expanded_n | contracted_n -----------+----------+--------------+--------------+------------+-------------+-------------+-----------+------------+------------- 2026-08-31 | 1263 | 6,317,360.00 | 6,479,980.00 | 830,100.00 | -80,840.00 | -586,640.00 | 135 | 858 | 146 2026-09-30 | 1278 | 6,415,520.00 | 6,587,110.00 | 838,135.00 | -83,265.00 | -583,280.00 | 133 | 866 | 153 2026-10-31 | 1292 | 6,486,160.00 | 6,649,810.00 | 834,930.00 | -79,520.00 | -591,760.00 | 136 | 882 | 145 (3 rows)
- SQL
select d.*, s.customer from raw_stripe.discounts d join raw_stripe.subscriptions s on s.id…select d.*, s.customer from raw_stripe.discounts d join raw_stripe.subscriptions s on s.id=d.subscription where percent_off=100 select month, line, amount_usd from raw_pigment.plan_lines where version_id='ver_9a07c4' and line in ('ARR','Implementation fees') and month between '2026-08-01' and '2026-11-01' order by 1,2id | subscription | coupon_id | percent_off | duration | duration_in_months | start_date | end_date | customer ------------------+--------------------+-----------+-------------+-----------+--------------------+------------+------------+------------------- di_YVmz80XvoWw8Er | sub_RDeagiwM0qkDsz | LAUNCH100 | 100 | repeating | 3 | 2026-10-15 | 2027-01-15 | cus_DhU4XgaOzyx7J3 (1 rows) month | line | amount_usd -----------+---------------------+------------- 2026-08-01 | ARR | 7,982,900.00 2026-08-01 | Implementation fees | 30,300.00 2026-09-01 | ARR | 8,442,800.00 2026-09-01 | Implementation fees | 54,000.00 2026-10-01 | ARR | 8,285,600.00 2026-10-01 | Implementation fees | 34,800.00 2026-11-01 | ARR | 8,354,800.00 2026-11-01 | Implementation fees | 31,400.00 … 1 more lines
Answer✓ Right
- Beat plan by $49K (+0.6%): October ARR $7,917,005 vs. $7,868,000 plan (latest version ver_9a07c4, excluding implementation fees). Customers trail plan: 1,455 vs. 1,494. Confirm version id with FP&A.
- NRR 102.5%, down 0.15 points from September's 102.7%, mostly from softer expansion.
- Don't use 105.9%: that table counts the free Acme add-on as expansion.
Full answer
Short version: Yes, we beat the latest plan on October ARR, by about $49K (+0.6%). October NRR was 102.5%, down 0.15 points from September's 102.7%. That is essentially flat, and most of the small dip came from a bit less expansion.
1. ARR vs. plan, as of 2026-10-31
| Actual ARR | $7,917,005 (1,455 customers) |
Plan: latest version ver_9a07c4, Base scenario, "ARR" line | $8,285,600 |
| Less 12 × October implementation fees (12 × $34,800) | −$417,600 |
| Plan on the same basis as actual ARR | $7,868,000 |
| Beat | +$49,005 (+0.6%) |
- The raw plan line isn't comparable to actual ARR. The plan's "ARR" line includes one-time implementation fees. Our ARR definition (
metric.arr) excludes them, sotooling.planning-mcpsays to subtract them first. If we compare the raw numbers, it looks like we missed plan by $369K. We didn't. - Use $7.917M, not $8.133M. The warehouse table
analytics.fct_arr_dailyshows $8.133M. That table still counts the $216K Acme Logistics Launch Program add-on (contract LP-0007), which is free until 2027-01-15. Free months aren't ARR (metric.arr,source.salesforce). The $7.917M comes from the certified queryquery.fct-arr-daily. - Customer count is behind plan. We have 1,455 customers against 1,494 in the plan. The ARR beat came from revenue per customer, not from more customers. The board may ask about this.
2. NRR for October 2026
102.5% trailing 12 months, vs. 102.7% in September (−0.15 points). This is from the certified query query.fct-nrr-monthly. September matches the 102.67% already reported.
What moved, as a share of each month's starting ARR from customers active 12 months earlier:
| Sep | Oct | Effect on NRR | |
|---|---|---|---|
| Expansion | +13.06% | +12.87% | −0.19 pt |
| Contraction | −1.30% | −1.23% | +0.07 pt |
| Churn | −9.09% | −9.12% | −0.03 pt |
| NRR | 102.7% | 102.5% | −0.15 pt |
Wording for the board: "NRR held at about 102.5%, in line with the 102–103% range since April. Expansion was slightly softer, partly offset by less contraction, and churn was flat."
Watch out for a 105.9% October NRR. analytics.fct_nrr_monthly_v2 shows 105.85%. That table counts the free Acme add-on as expansion, which adds about 3.3 points. The certified definition counts Acme's expansion only from its first paid month, so it should show up in NRR from January 2027 (metric.net-revenue-retention). If 105.9% has already gone around, please correct it before it reaches the deck.
Confidence
- NRR: high. I used the certified SQL. September ties to the previously reported number, and the gap to the v2 table is fully explained by the Acme contract.
- ARR vs. plan: medium-high. Actual ARR comes from the certified query.
- The planning-tool guidance on implementation fees is still a draft (
tooling.planning-mcp). - I read the plan from the nightly warehouse export, not from Pigment itself.
- The export has no publish date. I took
ver_9a07c4as the latest version because it's labelled "Latest", but those names get reused. Please confirm the version id with FP&A before this goes in the deck. - The beat is only 0.6%. A different plan version, or a change in how implementation fees are treated, could change the answer.
Finance should sign off before these numbers go into the deck (skill.board-prep-pivot).
How Canonical avoided a mistake
- The mistake
- Acme Logistics signed a $216K-a-year add-on with the first 3 months free. Every table in the warehouse counts it from day one, so October NRR reads 105.9%, not 102.5%. The plan's "ARR" line also includes one-time implementation fees, so Lumen looks $153K behind plan when it's $49K ahead.
- Where Canonical knew it from
- On Oct 14 the deal desk posted in Slack that Acme's first 3 months are free. Canonical's weekly enrichment check read the thread and proposed a fix. Finance accepted it:
metric.arrnow excludes free months, and the certified ARR and NRR queries were re-certified. A note on the planning tool says to remove implementation fees before comparing with plan. - Why a general model couldn't know
- The free months are written only in the signed order form. Stripe shows an active subscription and Salesforce shows the full amount. Whether free months count as ARR is Lumen's policy, not a fact in the data. The model without Canonical found the coupon and still couldn't say which number Lumen reports.
The VP of Operations asks
“We're starting vendor renewals for 2027. Who are our ten biggest vendors by annual spend, and which contracts do we need to act on in the next 90 days, and by when?”
Without Canonical
Warehouse access only
Waiting to run
- Tables
List warehouse tables - SQL
select * from raw_netsuite.vendors order by id select min(bill_date),max(bill_date),count(…select * from raw_netsuite.vendors order by id select min(bill_date),max(bill_date),count(*), count(distinct status), listagg(distinct status, ',') from raw_netsuite.vendor_bills select * from raw_netsuite.vendor_bills order by bill_date desc limit 15
id | name | status | default_gl_account | payment_terms | created_date ------+-------------------------+----------+----------------------------+---------------+------------- V1001 | Amazon Web Services | active | 5100 COGS: hosting | card | 2022-02-13 V1002 | Snowflake Inc. | inactive | 5200 COGS: data platform | net 30 | 2021-04-19 V1003 | Datadog, Inc. | inactive | 7300 R&D: monitoring | card | 2021-11-22 V1004 | Google Ads | active | 6300 S&M: paid acquisition | card | 2023-02-16 V1005 | LinkedIn Ads | active | 6300 S&M: paid acquisition | card | 2021-09-16 V1006 | WeWork | active | 8300 G&A: facilities | card | 2021-11-12 V1007 | Salesforce | active | 6200 S&M: CRM | net 30 | 2021-02-09 V1008 | Gong | active | 6250 S&M: sales tools | net 30 | 2021-11-22 V1009 | Slack | active | 8500 G&A: software | net 30 | 2021-06-10 V1010 | Zendesk | active | 5350 COGS: support tools | net 30 | 2023-06-03 V1011 | Okta | active | 8500 G&A: software | net 30 | 2022-10-29 V1012 | Figma | active | 7400 R&D: design tools | net 30 | 2022-04-25 … 35 more lines
- SQL
select status,count(*),sum(amount),min(amount) from raw_netsuite.vendor_bills group by 1 s…select status,count(*),sum(amount),min(amount) from raw_netsuite.vendor_bills group by 1 select min(bill_date),max(bill_date) from raw_netsuite.vendor_bills select b.vendor_id, v.name, count(*), min(bill_date), max(bill_date), sum(amount) from raw_netsuite.vendor_bills b join raw_netsuite.vendors v on v.id=b.vendor_id group by 1,2 order by 6 desc
status | count(*) | sum(amount) | min(amount) -------+----------+--------------+------------ open | 2 | 2,598.39 | 844 paid | 319 | 4,207,035.91 | 415.74 (2 rows) min(bill_date) | max(bill_date) ---------------+--------------- 2024-12-01 | 2026-11-26 (1 rows) vendor_id | name | count(*) | min(bill_date) | max(bill_date) | sum(amount) ----------+-------------------------+----------+----------------+----------------+------------- V1001 | Amazon Web Services | 24 | 2024-12-03 | 2026-11-03 | 1,515,500.00 V1004 | Google Ads | 24 | 2024-12-04 | 2026-11-02 | 725,097.37 V1006 | WeWork | 24 | 2024-12-05 | 2026-11-02 | 432,000.00 … 24 more lines
- SQL
select vendor_id,bill_date,due_date,amount,gl_account,memo from raw_netsuite.vendor_bills …select vendor_id,bill_date,due_date,amount,gl_account,memo from raw_netsuite.vendor_bills where vendor_id in ('V1007','V1008','V1009','V1010','V1011','V1012','V1013','V1014','V1021','V1023','V1024','V1019','V1003') order by vendor_id,bill_date select bill_date,amount,gl_account,memo from raw_netsuite.vendor_bills where vendor_id='V1001' order by bill_datevendor_id | bill_date | due_date | amount | gl_account | memo ----------+------------+------------+-----------+--------------------------+------------------------------------------ V1003 | 2024-12-01 | 2024-12-31 | 6,100.00 | 7300 R&D: monitoring | Datadog, Inc., December 2024 V1003 | 2025-01-01 | 2025-01-31 | 6,100.00 | 7300 R&D: monitoring | Datadog, Inc., January 2025 V1003 | 2025-02-04 | 2025-03-06 | 6,100.00 | 7300 R&D: monitoring | Datadog, Inc., February 2025 V1003 | 2025-03-04 | 2025-04-03 | 6,100.00 | 7300 R&D: monitoring | Datadog, Inc., March 2025 V1003 | 2025-04-05 | 2025-05-05 | 6,100.00 | 7300 R&D: monitoring | Datadog, Inc., April 2025 V1007 | 2025-02-15 | 2025-03-17 | 88,000.00 | 6200 S&M: CRM | Salesforce annual subscription, 2025-2026 V1007 | 2026-02-15 | 2026-03-17 | 96,000.00 | 6200 S&M: CRM | Salesforce annual subscription, 2026-2027 V1008 | 2025-02-01 | 2025-03-03 | 54,000.00 | 6250 S&M: sales tools | Gong annual subscription, 2025-2026 V1008 | 2026-02-01 | 2026-03-03 | 60,000.00 | 6250 S&M: sales tools | Gong annual subscription, 2026-2027 V1009 | 2025-01-10 | 2025-02-09 | 33,600.00 | 8500 G&A: software | Slack annual subscription, 2025-2026 V1009 | 2026-01-10 | 2026-02-09 | 38,400.00 | 8500 G&A: software | Slack annual subscription, 2026-2027 V1010 | 2025-03-05 | 2025-04-04 | 39,000.00 | 5350 COGS: support tools | Zendesk annual subscription, 2025-2026 … 47 more lines
- SQL
select distinct version_name, scenario, line from raw_pigment.plan_linesselect distinct version_name, scenario, line from raw_pigment.plan_lines
version_name | scenario | line -------------+----------+-------------------- Budget FY26 | Base | ARR Budget FY26 | Base | Implementation fees Budget FY26 | Base | New ARR Budget FY26 | Base | Expansion ARR Budget FY26 | Base | Churned ARR Budget FY26 | Base | Customers Board | Base | ARR Board | Base | Implementation fees Board | Base | New ARR Board | Base | Expansion ARR Board | Base | Churned ARR Board | Base | Customers … 67 more lines
- Thinks
Quick update: I've found the vendor bills in NetSuite. There's no contracts table, so I'm working out renewal dates from the billing pattern. Next I'm calculating trailing-12-month spend.
- SQL
select v.name, count(*) n, sum(amount) ttm from raw_netsuite.vendor_bills b join raw_netsu…select v.name, count(*) n, sum(amount) ttm from raw_netsuite.vendor_bills b join raw_netsuite.vendors v on v.id=b.vendor_id where bill_date between '2025-11-29' and '2026-11-28' group by 1 order by 3 desc limit 14 select sum(amount) from raw_netsuite.vendor_bills where bill_date between '2025-11-29' and '2026-11-28' select bill_date, amount, memo from raw_netsuite.vendor_bills where vendor_id in ('V1006','V1018') and bill_date>='2026-06-01' order by memoname | n | ttm ------------------------+----+----------- Amazon Web Services | 12 | 870,690.00 Google Ads | 12 | 355,444.65 WeWork | 12 | 216,000.00 LinkedIn Ads | 12 | 152,225.05 Salesforce | 1 | 96,000.00 Harbor & Pine LLP | 9 | 70,955.75 Meridian Audit Partners | 2 | 65,000.00 Gong | 1 | 60,000.00 Fivetran | 12 | 48,951.87 Zendesk | 1 | 42,000.00 Slack | 1 | 38,400.00 Gusto | 12 | 30,028.51 … 21 more lines
Answer✗ Wrong
- $1.98M, about 89% of $2.22M vendor spend, goes to the top ten, led by AWS at $870,690.
- About $194k renews by 2027-02-26: Slack 2027-01-10, Gong 2027-02-01, Salesforce 2027-02-15. Without pushback, expect about $20k more.
- Real deadlines could be mid-December (Slack) to early–mid January: these dates are latest-possible. Pull all three contracts this week.
Full answer
Ten biggest vendors and the contracts to act on before 2027-02-26
Top 10 vendors by annual spend (NetSuite bills dated 2025-11-29 to 2026-11-28, which is the last 12 months)
| # | Vendor | 12-mo spend | How it's billed |
|---|---|---|---|
| 1 | Amazon Web Services | $870,690 | Monthly, based on usage. October was $79.6k, so the current pace is about $955k a year. |
| 2 | Google Ads | $355,445 | Monthly ad spend |
| 3 | WeWork | $216,000 | $18,000 a month, flat |
| 4 | LinkedIn Ads | $152,225 | Monthly ad spend |
| 5 | Salesforce | $96,000 | Paid once a year, starting Feb 15 |
| 6 | Harbor & Pine LLP (legal) | $70,956 | Billed for work done |
| 7 | Meridian Audit Partners | $65,000 | Audit fee, billed in two parts each Mar–Apr |
| 8 | Gong | $60,000 | Paid once a year, starting Feb 1 |
| 9 | Fivetran | $48,952 | Monthly |
| 10 | Zendesk | $42,000 | Paid once a year, starting Mar 5 |
These ten add up to $1.98M, about 89% of the $2.22M in total vendor bills. Slack is just outside the list at $38.4k.
Contracts that renew in the next 90 days (through 2027-02-26)
| Vendor | Renews on | Current price | Change at last renewal |
|---|---|---|---|
| Slack | 2027-01-10 | $38,400 | +14% |
| Gong | 2027-02-01 | $60,000 | +11% |
| Salesforce | 2027-02-15 | $96,000 | +9% |
| Zendesk (just past the window) | 2027-03-05 | $42,000 | +8% |
That's about $194k up for renewal in the 90 days, or $236k if Zendesk is included. Each of these vendors raised its price by 8–14% at the last renewal, so if nobody pushes back, expect about $20k more.
"By when": what the data can and can't tell you
- The warehouse has no contracts table, so I don't have notice periods, auto-renew clauses or end dates. I took the renewal dates from when each yearly bill lands (each memo says "annual subscription, 2026-2027"). Treat these dates as the latest possible deadline, not the real one.
- Many SaaS contracts renew automatically unless you give 30–60 days' notice. If that's true here, the Slack deadline could be as early as mid-December, and Gong and Salesforce could be early to mid-January. Someone should pull these three contracts this week to find the real notice dates.
- I haven't found any term or renewal date for the monthly vendors (AWS, WeWork, Fivetran, the ad platforms). WeWork and AWS are the ones to check for a commitment that's coming due.
One question to settle: Snowflake and Datadog are vendors we use, but they have no bills in the last 12 months. Datadog's direct bills stopped in April 2025, and Snowflake has none at all. AWS's monthly bill jumped by about $22k a month in February 2025. They may now be bought through the AWS Marketplace and included in the AWS total. If so, the #1 vendor includes contracts with their own renewal dates. I couldn't confirm this from the data.
With Canonical
Warehouse access + the knowledge base
Waiting to run
- Tables
List warehouse tables - Read
analytics-reference/finance/vendors.md, analytics-reference/finance/ap-ar.md, analytics-reference/finance/expense-tracking.md - Read
execution/tooling/warehouse-mcp.md - Read
system/reports/proactive-enrichment.md - Thinks
Now the AP data.
- SQL
select * from raw_netsuite.vendors order by name select min(bill_date), max(bill_date), co…select * from raw_netsuite.vendors order by name select min(bill_date), max(bill_date), count(*), count(distinct status) from raw_netsuite.vendor_bills select status, count(*), sum(amount) from raw_netsuite.vendor_bills group by 1
id | name | status | default_gl_account | payment_terms | created_date ------+-------------------------+----------+----------------------------+---------------+------------- V1021 | 1Password | active | 8500 G&A: software | net 30 | 2021-02-16 V1001 | Amazon Web Services | active | 5100 COGS: hosting | card | 2022-02-13 V1024 | Calendly | active | 6250 S&M: sales tools | net 30 | 2021-04-14 V1013 | Carta | active | 8600 G&A: legal & equity | net 30 | 2023-02-28 V1003 | Datadog, Inc. | inactive | 7300 R&D: monitoring | card | 2021-11-22 V1026 | Delta Air Lines | active | 8800 G&A: travel | net 30 | 2023-05-24 V1022 | Expensify | active | 8500 G&A: software | card | 2022-10-09 V1012 | Figma | active | 7400 R&D: design tools | net 30 | 2022-04-25 V1015 | Fivetran | active | 8200 G&A: data tooling | card | 2022-06-24 V1008 | Gong | active | 6250 S&M: sales tools | net 30 | 2021-11-22 V1004 | Google Ads | active | 6300 S&M: paid acquisition | card | 2023-02-16 V1017 | Google Workspace | active | 8500 G&A: software | card | 2022-07-21 … 25 more lines
- SQL
select v.name, count(*) n, sum(case when bill_date>='2025-12-01' then amount end) ttm_dec_…select v.name, count(*) n, sum(case when bill_date>='2025-12-01' then amount end) ttm_dec_nov, sum(case when bill_date>='2024-12-01' and bill_date<'2025-12-01' then amount end) prior12, min(bill_date), max(bill_date) from raw_netsuite.vendor_bills b join raw_netsuite.vendors v on v.id=b.vendor_id group by 1 order by 3 desc nulls last
name | n | ttm_dec_nov | prior12 | min(bill_date) | max(bill_date) ------------------------+----+-------------+------------+----------------+--------------- Amazon Web Services | 24 | 870,690.00 | 644,810.00 | 2024-12-03 | 2026-11-03 Google Ads | 24 | 355,444.65 | 369,652.72 | 2024-12-04 | 2026-11-02 WeWork | 24 | 216,000.00 | 216,000.00 | 2024-12-05 | 2026-11-02 LinkedIn Ads | 24 | 152,225.05 | 143,823.24 | 2024-12-03 | 2026-11-04 Salesforce | 2 | 96,000.00 | 88,000.00 | 2025-02-15 | 2026-02-15 Harbor & Pine LLP | 20 | 70,955.75 | 67,529.92 | 2024-12-18 | 2026-10-20 Meridian Audit Partners | 4 | 65,000.00 | 65,000.00 | 2025-03-21 | 2026-04-21 Gong | 2 | 60,000.00 | 54,000.00 | 2025-02-01 | 2026-02-01 Fivetran | 24 | 48,951.87 | 47,460.55 | 2024-12-05 | 2026-11-03 Zendesk | 2 | 42,000.00 | 39,000.00 | 2025-03-05 | 2026-03-05 Slack | 2 | 38,400.00 | 33,600.00 | 2025-01-10 | 2026-01-10 Gusto | 24 | 30,028.51 | 29,449.97 | 2024-12-01 | 2026-11-05 … 15 more lines
- SQL
select bill_date, amount, gl_account, memo from raw_netsuite.vendor_bills where vendor_id …select bill_date, amount, gl_account, memo from raw_netsuite.vendor_bills where vendor_id in ('V1001','V1002','V1003','V1006') order by vendor_id, bill_datebill_date | amount | gl_account | memo -----------+-----------+----------------------+------------------------------------------------ 2024-12-03 | 29,330.00 | 5100 COGS: hosting | AWS invoice, November 2024 (consolidated bill) 2025-01-03 | 30,430.00 | 5100 COGS: hosting | AWS invoice, December 2024 (consolidated bill) 2025-02-03 | 31,500.00 | 5100 COGS: hosting | AWS invoice, January 2025 (consolidated bill) 2025-03-03 | 53,420.00 | 5100 COGS: hosting | AWS invoice, February 2025 (consolidated bill) 2025-04-03 | 54,920.00 | 5100 COGS: hosting | AWS invoice, March 2025 (consolidated bill) 2025-05-03 | 54,980.00 | 5100 COGS: hosting | AWS invoice, April 2025 (consolidated bill) 2025-06-03 | 62,400.00 | 5100 COGS: hosting | AWS invoice, May 2025 (consolidated bill) 2025-07-03 | 63,850.00 | 5100 COGS: hosting | AWS invoice, June 2025 (consolidated bill) 2025-08-03 | 65,680.00 | 5100 COGS: hosting | AWS invoice, July 2025 (consolidated bill) 2025-09-03 | 64,760.00 | 5100 COGS: hosting | AWS invoice, August 2025 (consolidated bill) 2025-10-03 | 66,310.00 | 5100 COGS: hosting | AWS invoice, September 2025 (consolidated bill) 2025-11-03 | 67,230.00 | 5100 COGS: hosting | AWS invoice, October 2025 (consolidated bill) … 42 more lines
Answer✓ Right
- WeWork notice due Tue, Dec 1 ($216K/yr); ops must decide by Monday.
- AWS $516.7K tops spend; then Google Ads $355.4K, Snowflake $264.0K, WeWork $216.0K, LinkedIn Ads $152.2K.
- Next deadlines: Slack Dec 11, Salesforce Dec 17, Gong Dec 18, Snowflake Dec 31, Zendesk Feb 3, Okta Feb 19. Snowflake/Datadog count toward $900K AWS commitment; consult eng.
Full answer
I ranked vendors by the last 12 months of billed spend (NetSuite bills dated 2025-12-01 to 2026-11-28). AWS, Snowflake and Datadog are split out from the single AWS bill, as register.vendors requires. Four notice deadlines fall in the next three weeks, and WeWork's is this Tuesday, Dec 1.
Top 10 vendors by annual spend
| # | Vendor | Last 12 months | Note |
|---|---|---|---|
| 1 | AWS (hosting only) | $516.7K | The AWS bill was $870.7K; Snowflake and Datadog removed |
| 2 | Google Ads | $355.4K | Usage-billed, no contract |
| 3 | Snowflake | $264.0K | $22K/mo, billed on the AWS invoice |
| 4 | WeWork | $216.0K | $18K/mo |
| 5 | LinkedIn Ads | $152.2K | Usage-billed, no contract |
| 6 | Salesforce | $96.0K | Annual (up from $88K) |
| 7 | Datadog | $90.0K | $7.5K/mo, billed on the AWS invoice |
| 8 | Harbor & Pine LLP | $71.0K | Legal, billed as used |
| 9 | Meridian Audit Partners | $65.0K | Annual audit engagement |
| 10 | Gong | $60.0K | Annual (up from $54K) |
Next are Fivetran ($49.0K) and Zendesk ($42.0K). If you go by NetSuite's vendor names alone, Snowflake and Datadog vanish and AWS looks like $871K. That would get both the ranking and the renewal list wrong.
Contracts to act on in the next 90 days (through 2027-02-26)
Contracts renew automatically unless we give notice, so the deadline is the renewal date minus the notice period (register.vendors).
| Give notice or renegotiate by | Vendor | Renewal | Notice | Owner |
|---|---|---|---|---|
| 2026-12-01 (Tue) | WeWork ($216K/yr) | 2026-12-31 | 30 days | ops |
| 2026-12-11 | Slack ($38K) | 2027-01-10 | 30 days | it |
| 2026-12-17 | Salesforce ($96K) | 2027-02-15 | 60 days | revops |
| 2026-12-18 | Gong ($60K) | 2027-02-01 | 45 days | revops |
| 2026-12-31 (formally Jan 1, a holiday) | Snowflake ($264K) | 2027-01-31 | 30 days | data + eng |
| January 2027 | Meridian Audit | New engagement letter each January | none | finance |
| 2027-02-03 | Zendesk ($42K) | 2027-03-05 | 30 days | cx |
| 2027-02-19 | Okta ($24K) | 2027-04-20 | 60 days | it |
Start planning in this window, but the deadline is later:
- Datadog: notice is due 2027-03-31, and the 90-day planning window opens 2026-12-31.
- AWS: the spending commitment runs to 2027-06-30 with no notice period, so it's worth starting that renegotiation early.
Two things to know
- Snowflake and Datadog count toward our AWS spending commitment of $900K a year through 2027-06-30. Last 12 months on the AWS bill was $871K, and the current run rate is about $956K a year. If we cut Snowflake ($264K) or Datadog ($90K) without replacing that spend, we could fall short of the commitment. Talk to eng before renegotiating either one, and handle Snowflake (Dec 31) together with the AWS renewal.
- WeWork is the urgent one. Our second-biggest contract has a notice deadline 3 days away. Ops needs to decide this weekend or Monday whether to renew, renegotiate or give notice.
How I got these numbers
- Annual spend is what was billed over the last 12 months (
raw_netsuite.vendor_bills). AWS bills on the 3rd for the prior month, so this covers usage from November 2025 to October 2026. For annual contracts it's the latest invoice. There's no governed vendor-spend metric or certified query, so this is my own calculation from the billing data. - Contract terms (renewal dates, notice periods, the Snowflake/Datadog amounts) come from
register.vendors(reviewed 2026-10-12), not NetSuite. NetSuite only shows what was billed. - Hex ($18K a year, signed 2026-11-20) isn't in the register yet (pending enrichment finding
ENR-cba664). It renews 2027-11-20, so it doesn't affect this list.
Confidence: high for the deadlines and the top 7. For #8–10 it's medium-high: Harbor & Pine, Meridian and Gong are only $11K apart, and legal fees vary month to month. The Snowflake and Datadog figures use the contracted monthly amounts from the register, not a line-by-line breakdown of the AWS invoice.
How Canonical avoided a mistake
- The mistake
- Snowflake ($264K) and Datadog ($90K) are bought through AWS Marketplace, so accounts payable shows one $871K AWS bill and the old Snowflake and Datadog vendors look inactive. Renewal dates and notice periods aren't in accounts payable at all, so a deadline three days away was invisible.
- Where Canonical knew it from
- Lumen's vendor register in Canonical records how each vendor is billed, when its contract renews, and how much notice it needs. In October the enrichment check read a #procurement thread about Snowflake's Marketplace renewal and corrected the register's out-of-date Snowflake row.
- Why a general model couldn't know
- Nothing in the billing data says what's inside the AWS invoice or when a contract ends. The model without Canonical guessed that Snowflake might be on the AWS bill but couldn't confirm it, and it could only estimate renewals from when annual bills arrived.
The COO asks
“From January 1 we have to start charging sales tax in Texas and New York. Billing needs the list of customers to switch tax on for. Who's on it, and roughly how much tax will we collect a year?”
Without Canonical
Warehouse access only
Waiting to run
- Tables
List warehouse tables - SQL
select address_country, address_state, livemode, tax_exempt, count(*) from raw_stripe.cust…select address_country, address_state, livemode, tax_exempt, count(*) from raw_stripe.customers group by 1,2,3,4 order by 5 desc
#!/usr/bin/env python3 """Read-only SQL against Lumen's demo warehouse (built by build.py). python3 query.py "select * from analytics.fct_nrr_monthly_v2 order by month desc limit 3" python3 query.py --tables list every table with its columns and row count Schemas work as in Snowflake (`analytics.fct_arr_daily`, `raw_stripe.invoices`, ...). A few Snowflake functions are emulated so certified SQL runs as written: last_day(d), dateadd(part, n, d), datediff(part, a, b) and date_trunc(part, d). Results print as an aligned table, at most 200 rows. """ from __future__ import annotations import datetime as dt import functools … 83 more lines - SQL
select max(snapshot_date) from analytics.fct_arr_daily select s.status, c.address_state, c…select max(snapshot_date) from analytics.fct_arr_daily select s.status, c.address_state, count(*), count(distinct c.id) from raw_stripe.customers c join raw_stripe.subscriptions s on s.customer=c.id where c.address_state in ('TX','NY') group by 1,2 select a.plan_tier, c.address_state, count(*), sum(arr_usd) from analytics.fct_arr_daily a join raw_stripe.customers c on c.id=a.stripe_customer_id where a.snapshot_date=(select max(snapshot_date) from analytics.fct_arr_daily) and c.address_state in ('TX','NY') group by 1,2 select name, email_domain, address_state, address_country from raw_stripe.customers where livemode=0 or address_country='IE' and address_state is not nullmax(snapshot_date) ------------------ 2026-11-27 (1 rows) status | address_state | count(*) | count(distinct c.id) ---------+---------------+----------+--------------------- active | NY | 112 | 112 active | TX | 143 | 143 canceled | NY | 48 | 48 canceled | TX | 50 | 50 (4 rows) plan_tier | address_state | count(*) | sum(arr_usd) ----------+---------------+----------+------------- business | NY | 43 | 278,400.00 … 10 more lines
- SQL
select special_terms__c, count(*) from raw_salesforce.opportunities group by 1 order by 2 …select special_terms__c, count(*) from raw_salesforce.opportunities group by 1 order by 2 desc select industry, segment__c, count(*) from raw_salesforce.accounts group by 1,2 order by 3 desc
special_terms__c | count(*) ---------------------------------------------------------------------------------------+--------- NULL | 1034 Co-termed with renewal. | 491 Implementation fee $2,500 invoiced at signature. | 292 Implementation fee $4,000 invoiced at signature. | 47 Implementation fee $3,000 invoiced at signature. | 46 Implementation fee $3,500 invoiced at signature. | 45 Implementation fee $4,500 invoiced at signature. | 25 Implementation fee $5,500 invoiced at signature. | 20 Implementation fee $5,000 invoiced at signature. | 16 Implementation fee $6,000 invoiced at signature. | 15 Implementation fee $6,500 invoiced at signature. | 11 Implementation fee $7,500 invoiced at signature. | 7 … 66 more lines
- SQL
select o.*, a.name, a.stripe_customer_id__c, c.address_state, c.address_country from raw_s…select o.*, a.name, a.stripe_customer_id__c, c.address_state, c.address_country from raw_salesforce.opportunities o join raw_salesforce.accounts a on a.id=o.account_id left join raw_stripe.customers c on c.id=a.stripe_customer_id__c where special_terms__c like '%Launch%' select line_type, status, count(*), sum(amount_due), min(created), max(created) from raw_stripe.invoices group by 1,2
id | account_id | name | type | stage_name | close_date | amount | contract_type__c | -------------------+--------------------+-----------------------------------------------+-----------+------------+------------+------------+------------------+- 006Z20HQST24GDOAAA | 001C7HO000VKFVOAAA | Acme Logistics - Automations (Launch Program) | Expansion | Closed Won | 2026-10-14 | 216,000.00 | Launch Program | (1 rows) line_type | status | count(*) | sum(amount_due) | min(created) | max(created) ---------------+--------+----------+-----------------+--------------+------------- implementation | paid | 550 | 199200000 | 2021-01-14 | 2026-11-27 subscription | paid | 25032 | 1668649925 | 2021-01-14 | 2026-11-27 (2 rows)
- Thinks
Checking actual billed amounts (last 12 months) for Texas and New York customers against ARR, so the tax base reflects discounts and real invoices.
- SQL
with act as (select distinct stripe_customer_id, arr_usd from analytics.fct_arr_daily wher…with act as (select distinct stripe_customer_id, arr_usd from analytics.fct_arr_daily where snapshot_date='2026-11-27') select c.address_state, count(distinct c.id) n, sum(case when act.stripe_customer_id is not null then 1 else 0 end) n_active_arr from raw_stripe.customers c left join act on act.stripe_customer_id=c.id join raw_stripe.subscriptions s on s.customer=c.id and s.status='active' where c.address_state in ('TX','NY') group by 1 with act as (select stripe_customer_id from analytics.fct_arr_daily where snapshot_date='2026-11-27') select c.address_state, i.line_type, sum(i.amount_due)/100.0 usd, count(distinct c.id) from raw_stripe.invoices i join raw_stripe.customers c on c.id=i.customer join act on act.stripe_customer_id=c.id where c.address_state in ('TX','NY') and i.created>'2025-11-27' group by 1,2 select count(*), sum(case when d.end_date is null or d.end_date>'2026-11-27' then 1 else 0 end) from raw_stripe.discounts d join raw_stripe.subscriptions s on s.id=d.subscription join raw_stripe.customers c on c.id=s.customer where c.address_state in ('TX','NY') and s.status='active'address_state | n | n_active_arr --------------+-----+------------- NY | 112 | 112 TX | 143 | 143 (2 rows) address_state | line_type | usd | count(distinct c.id) --------------+----------------+------------+--------------------- NY | implementation | 36,500.00 | 9 NY | subscription | 591,965.00 | 111 TX | implementation | 53,000.00 | 14 TX | subscription | 795,571.00 | 142 (4 rows) count(*) | sum(case when d.end_date is null or d.end_date>'2026-11-27' then 1 else 0 end) ---------+------------------------------------------------------------------------------- … 2 more lines
- SQL
select c.address_state, s.billing_interval, count(*), sum(s.unit_amount_net*s.quantity)/10…select c.address_state, s.billing_interval, count(*), sum(s.unit_amount_net*s.quantity)/100.0 net, sum(a.arr_usd) arr from analytics.stg_stripe__subscriptions_daily s join raw_stripe.customers c on c.id=s.stripe_customer_id left join analytics.fct_arr_daily a on a.stripe_customer_id=s.stripe_customer_id and a.snapshot_date=s.snapshot_date where s.snapshot_date='2026-11-27' and c.address_state in ('TX','NY') and s.status='active' group by 1,2 select * from analytics.stg_stripe__subscriptions_daily where snapshot_date='2026-11-27' limit 3address_state | billing_interval | count(*) | net | arr --------------+------------------+----------+------------+----------- NY | month | 69 | 29,163.75 | 349,965.00 NY | year | 43 | 278,400.00 | 278,400.00 TX | month | 86 | 36,341.25 | 436,095.00 TX | year | 57 | 416,400.00 | 416,400.00 (4 rows) snapshot_date | subscription_id | stripe_customer_id | status | is_paid_plan | unit_amount_net | quantity | billing_interval | plan_tier --------------+--------------------+--------------------+--------+--------------+-----------------+----------+------------------+---------- 2026-11-27 | sub_pqz07NLSHHLdkL | cus_02UGUIpGCvtkAq | active | 1 | 4125 | 18 | month | pro 2026-11-27 | sub_neapJdyO8h3DG0 | cus_0AHHqW8PcykuNB | active | 1 | 4125 | 8 | month | pro 2026-11-27 | sub_aqjjE2vvIrpugI | cus_0DJO4LknmTwPNW | active | 1 | 4125 | 28 | month | pro (3 rows)
- Shell
cd ; S=<scratch file> - SQL
select c.address_state state, c.id stripe_customer_id, c.name, s.id subscription_id, s.bil…select c.address_state state, c.id stripe_customer_id, c.name, s.id subscription_id, s.billing_interval, a.plan_tier, a.arr_usd from raw_stripe.customers c join raw_stripe.subscriptions s on s.customer=c.id and s.status='active' join analytics.fct_arr_daily a on a.stripe_customer_id=c.id and a.snapshot_date='2026-11-27' where c.address_state='$st' order by a.arr_usd desc
A for or select loop in this command can't be checked before it runs
- SQL
select c.address_state state, c.id stripe_customer_id, c.name, s.id subscription_id, s.bil…select c.address_state state, c.id stripe_customer_id, c.name, s.id subscription_id, s.billing_interval, a.plan_tier, a.arr_usd from raw_stripe.customers c join raw_stripe.subscriptions s on s.customer=c.id and s.status='active' join analytics.fct_arr_daily a on a.stripe_customer_id=c.id and a.snapshot_date='2026-11-27' where c.address_state='TX' order by a.arr_usd desc select c.address_state state, c.id stripe_customer_id, c.name, s.id subscription_id, s.billing_interval, a.plan_tier, a.arr_usd from raw_stripe.customers c join raw_stripe.subscriptions s on s.customer=c.id and s.status='active' join analytics.fct_arr_daily a on a.stripe_customer_id=c.id and a.snapshot_date='2026-11-27' where c.address_state='NY' order by a.arr_usd desc
==> <scratch file> (143 rows) ==> <scratch file> (112 rows)
Answer✗ Wrong
- 255 customers need tax on: 143 Texas, 112 New York, active paid subscriptions in Stripe, billing about $1.48M a year.
- About $100k a year in tax, likely $95k–110k; rates are estimates, so have the tax advisor confirm them.
- Rerun the list in late December; $90k of implementation fees aren't in the estimate.
Full answer
About 255 customers need tax switched on: 143 in Texas and 112 in New York. Together they bill about $1.48M a year. That should mean roughly $100k a year in sales tax, likely between $95k and $110k.
| State | Customers | Annual billings (ARR) | Tax rule I assumed | Est. tax per year |
|---|---|---|---|---|
| Texas | 143 | $852k | 80% of the SaaS charge is taxable, at 6.25% state plus up to 2% local | about $43k–56k |
| New York | 112 | $628k | 4% state plus local; NYC is 8.875% | about $50k (around 8% average); $25k at 4%, $56k at the NYC rate |
| Total | 255 | $1.48M | about $95k–110k |
How I built the list: These are customers with a Texas or New York billing address in Stripe and an active paid subscription today. I left out 98 cancelled customers in those states. None of the 255 is flagged tax-exempt in Stripe. The billing amounts are current annual recurring revenue after discounts, and they match what's live in Stripe. Billing can work straight from these files, which list each customer's Stripe customer ID, subscription ID, plan and annual amount:
<scratch file><scratch file>
Things to check before January 1:
- Tax rates: The rates above are my own estimates from general knowledge of Texas and New York tax rules; nothing in our data sets them. Each customer's local rate depends on their exact address, so the real total will come from Stripe Tax or a similar tool. Have the tax advisor confirm both the rates and the Texas 80% rule.
- Addresses: The list uses the billing address on file in Stripe. Customers who sign up or move between now and January 1 will change it, so rerun it in late December.
- Implementation fees: One-time implementation fees came to about $90k over the last 12 months for these customers. They aren't in the estimate. In Texas they may be taxable and in New York probably not; ask the advisor.
- Exemption certificates: Some customers may send exemption certificates once they start seeing tax on invoices. That would lower the total a bit.
With Canonical
Warehouse access + the knowledge base
Waiting to run
- Find
Search the knowledge base - Read
analytics-reference/finance/sales-tax.md, analytics-reference/data/entities/customer.md, analytics-reference/metrics/arr.md and 1 more - Tables
List warehouse tables - SQL
select max(snapshot_date) from analytics.stg_stripe__subscriptions_daily select address_co…select max(snapshot_date) from analytics.stg_stripe__subscriptions_daily select address_country, address_state, count(*), tax_exempt from raw_stripe.customers where address_state in ('TX','NY') group by 1,2,4 select count(*) from raw_stripe.customers where address_state ilike '%tex%' or address_state ilike '%new york%' or address_state ilike 'tx%' or address_state ilike 'ny%' select address_state, count(*) from raw_stripe.customers group by 1 order by 2 descmax(snapshot_date) ------------------ 2026-11-27 (1 rows) address_country | address_state | count(*) | tax_exempt ----------------+---------------+----------+----------- US | NY | 160 | none US | TX | 193 | none (2 rows) SQL error: near "ilike": syntax error address_state | count(*) --------------+--------- CA | 294 TX | 193 … 27 more lines
- SQL
select address_country, count(*) from raw_stripe.customers where address_state is null gro…select address_country, count(*) from raw_stripe.customers where address_state is null group by 1 select livemode, count(*) from raw_stripe.customers group by 1 select count(*), sum(case when id like 'cus_TEST%' then 1 else 0 end) from raw_stripe.customers where address_state in ('TX','NY')address_country | count(*) ----------------+--------- AU | 36 CA | 23 DE | 21 GB | 28 IE | 27 US | 2 (6 rows) livemode | count(*) ---------+--------- 0 | 2 1 | 2023 (2 rows) … 4 more lines
- Thinks
Checking a couple of US customers with no state, then computing the list with the certified ARR query.
- SQL
select id,name,livemode from raw_stripe.customers where address_country='US' and address_s…select id,name,livemode from raw_stripe.customers where address_country='US' and address_state is null $Q select tax_state, exempt, count(*), round(sum(arr_usd),0), round(sum(arr_usd*case tax_state when 'TX' then 0.066 else 0.08875 end),0) from base group by 1,2 $Q select tax_state, count(*), round(sum(arr_usd),0) from base where billed<>tax_state group by 1
Multiple directory changes in one command require approval for clarity
- SQL
select id,name,livemode from raw_stripe.customers where address_country='US' and address_s…select id,name,livemode from raw_stripe.customers where address_country='US' and address_state is null $Q select tax_state, exempt, count(*), round(sum(arr_usd),0), round(sum(arr_usd*case tax_state when 'TX' then 0.066 else 0.08875 end),0) from base group by 1,2 $Q select tax_state, count(*), round(sum(arr_usd),0) from base where billed<>tax_state group by 1 $Q select count(*) from base where exempt=1
A variable in this command can't be checked before it runs
- Thinks
Saves a query to a scratch file
- SQL
select id,name,livemode from raw_stripe.customers where address_country='US' and address_s…select id,name,livemode from raw_stripe.customers where address_country='US' and address_state is null
This Bash command contains multiple operations. The following parts require approval: python3 <scratch file>
- SQL
with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * cas…with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = '2026-11-27' group by 1), ovr(id, st) as (values ('cus_FlKuljy4BpWv5Z','TX'),('cus_xBu0esQFAWTaPl','NY'),('cus_P1ktfGIafnhodC','TX'),('cus_OM3UNxHOFtoiti','NY'),('cus_hW2KTGc1trvi1c','TX'),('cus_lIrqksw0dOfMOU','NY'),('cus_1Te9MpbIf0cVAa','TX'),('cus_N5bQObLkjlUtCW','NY'),('cus_FZwcc39NsWDIUB','TX'),('cus_oclZPxy6hnNy7f','NY'),('cus_Y0670yXPOFxJtO','TX'),('cus_PrsatahCScANlk','NY'),('cus_5YNsq0Sq5p0Dd7','OK'),('cus_Y1Si4MeggX3X8i','NJ'),('cus_aqaWxuu0PAfWeZ','LA')), ex(id) as (values ('cus_tMTjfCbYtB4klp'),('cus_vEcDpbDkkMrEZC'),('cus_7qRp8FKwOC7ALv'),('cus_TWDEriPU9kKQio'),('cus_3NKE8w7ImuWYpy'),('cus_pOsnSxRfvDjtMM'),('cus_HeOtd62yh30KD6')), base as (select c.id, c.name, c.address_state billed, coalesce(o.st, c.address_state) tax_state, a.arr_usd, case when e.id is not null then 1 else 0 end exempt from raw_stripe.customers c join arr a on a.stripe_customer_id = c.id left join ovr o on o.id=c.id left join ex e on e.id=c.id where coalesce(o.st, c.address_state) in ('TX','NY')) select tax_state, exempt, billed<>tax_state moved, count(*), round(sum(arr_usd),0) arr, round(sum(arr_usd*case tax_state when 'TX' then 0.066 else 0.08875 end),0) tax from base group by 1,2,3tax_state | exempt | moved | count(*) | arr | tax ----------+--------+-------+----------+------------+---------- NY | 0 | 0 | 108 | 570,365.00 | 50,620.00 NY | 0 | 1 | 6 | 114,000.00 | 10,118.00 NY | 1 | 0 | 3 | 44,000.00 | 3,905.00 TX | 0 | 0 | 137 | 740,895.00 | 48,899.00 TX | 0 | 1 | 6 | 134,000.00 | 8,844.00 TX | 1 | 0 | 4 | 83,200.00 | 5,491.00 (6 rows)
- SQL
select c.id, c.name, c.address_state, d.coupon_id, d.start_date, d.end_date, s.unit_amount…select c.id, c.name, c.address_state, d.coupon_id, d.start_date, d.end_date, s.unit_amount_net/100.0*s.quantity*case s.billing_interval when 'year' then 1 else 12 end annual from analytics.stg_stripe__subscriptions_daily s join raw_stripe.discounts d on d.subscription=s.subscription_id and d.percent_off=100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) join raw_stripe.customers c on c.id=s.stripe_customer_id where s.snapshot_date='2026-11-27' and s.status='active' and s.is_paid_plan
id | name | address_state | coupon_id | start_date | end_date | annual -------------------+----------------+---------------+-----------+------------+------------+----------- cus_DhU4XgaOzyx7J3 | Acme Logistics | IL | LAUNCH100 | 2026-10-15 | 2027-01-15 | 216,000.00 (1 rows)
- Thinks
Totals are done. Now I'm exporting the customer-level list for Billing.
- SQL
with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * cas…with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = '2026-11-27' group by 1), ovr(id, st) as (values ('cus_FlKuljy4BpWv5Z','TX'),('cus_xBu0esQFAWTaPl','NY'),('cus_P1ktfGIafnhodC','TX'),('cus_OM3UNxHOFtoiti','NY'),('cus_hW2KTGc1trvi1c','TX'),('cus_lIrqksw0dOfMOU','NY'),('cus_1Te9MpbIf0cVAa','TX'),('cus_N5bQObLkjlUtCW','NY'),('cus_FZwcc39NsWDIUB','TX'),('cus_oclZPxy6hnNy7f','NY'),('cus_Y0670yXPOFxJtO','TX'),('cus_PrsatahCScANlk','NY'),('cus_5YNsq0Sq5p0Dd7','OK'),('cus_Y1Si4MeggX3X8i','NJ'),('cus_aqaWxuu0PAfWeZ','LA')), ex(id) as (values ('cus_tMTjfCbYtB4klp'),('cus_vEcDpbDkkMrEZC'),('cus_7qRp8FKwOC7ALv'),('cus_TWDEriPU9kKQio'),('cus_3NKE8w7ImuWYpy'),('cus_pOsnSxRfvDjtMM'),('cus_HeOtd62yh30KD6')) select c.id stripe_customer_id, c.name, c.address_state billing_state, coalesce(o.st, c.address_state) tax_state, round(a.arr_usd,0) arr_usd, round(a.arr_usd*case coalesce(o.st, c.address_state) when 'TX' then 0.066 else 0.08875 end,0) est_annual_tax from raw_stripe.customers c join arr a on a.stripe_customer_id = c.id left join ovr o on o.id=c.id left join ex e on e.id=c.id where coalesce(o.st, c.address_state) in ('TX','NY') and e.id is null order by 4, 2203 <scratch file>
- Shell
tail -3 <scratch file> - Thinks
The output stops at 200 rows, so I'm exporting each state separately.
- SQL
with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * cas…with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = '2026-11-27' group by 1), ovr(id, st) as (values ('cus_FlKuljy4BpWv5Z','TX'),('cus_xBu0esQFAWTaPl','NY'),('cus_P1ktfGIafnhodC','TX'),('cus_OM3UNxHOFtoiti','NY'),('cus_hW2KTGc1trvi1c','TX'),('cus_lIrqksw0dOfMOU','NY'),('cus_1Te9MpbIf0cVAa','TX'),('cus_N5bQObLkjlUtCW','NY'),('cus_FZwcc39NsWDIUB','TX'),('cus_oclZPxy6hnNy7f','NY'),('cus_Y0670yXPOFxJtO','TX'),('cus_PrsatahCScANlk','NY'),('cus_5YNsq0Sq5p0Dd7','OK'),('cus_Y1Si4MeggX3X8i','NJ'),('cus_aqaWxuu0PAfWeZ','LA')), ex(id) as (values ('cus_tMTjfCbYtB4klp'),('cus_vEcDpbDkkMrEZC'),('cus_7qRp8FKwOC7ALv'),('cus_TWDEriPU9kKQio'),('cus_3NKE8w7ImuWYpy'),('cus_pOsnSxRfvDjtMM'),('cus_HeOtd62yh30KD6')) select c.id stripe_customer_id, c.name, c.address_state billing_state, coalesce(o.st, c.address_state) tax_state, round(a.arr_usd,0) arr_usd, round(a.arr_usd*case coalesce(o.st, c.address_state) when 'TX' then 0.066 else 0.08875 end,0) est_annual_tax from raw_stripe.customers c join arr a on a.stripe_customer_id = c.id left join ovr o on o.id=c.id left join ex e on e.id=c.id where coalesce(o.st, c.address_state) = '$ST' and e.id is null order by 2A variable in this command can't be checked before it runs
- SQL
with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * cas…with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = '2026-11-27' group by 1), ovr(id, st) as (values ('cus_FlKuljy4BpWv5Z','TX'),('cus_xBu0esQFAWTaPl','NY'),('cus_P1ktfGIafnhodC','TX'),('cus_OM3UNxHOFtoiti','NY'),('cus_hW2KTGc1trvi1c','TX'),('cus_lIrqksw0dOfMOU','NY'),('cus_1Te9MpbIf0cVAa','TX'),('cus_N5bQObLkjlUtCW','NY'),('cus_FZwcc39NsWDIUB','TX'),('cus_oclZPxy6hnNy7f','NY'),('cus_Y0670yXPOFxJtO','TX'),('cus_PrsatahCScANlk','NY'),('cus_5YNsq0Sq5p0Dd7','OK'),('cus_Y1Si4MeggX3X8i','NJ'),('cus_aqaWxuu0PAfWeZ','LA')), ex(id) as (values ('cus_tMTjfCbYtB4klp'),('cus_vEcDpbDkkMrEZC'),('cus_7qRp8FKwOC7ALv'),('cus_TWDEriPU9kKQio'),('cus_3NKE8w7ImuWYpy'),('cus_pOsnSxRfvDjtMM'),('cus_HeOtd62yh30KD6')) select c.id stripe_customer_id, c.name, c.address_state billing_state, coalesce(o.st, c.address_state) tax_state, round(a.arr_usd,0) arr_usd, round(a.arr_usd*case coalesce(o.st, c.address_state) when 'TX' then 0.066 else 0.08875 end,0) est_annual_tax from raw_stripe.customers c join arr a on a.stripe_customer_id = c.id left join ovr o on o.id=c.id left join ex e on e.id=c.id where coalesce(o.st, c.address_state) = 'NY' and e.id is null order by 2 with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = '2026-11-27' group by 1), ovr(id, st) as (values ('cus_FlKuljy4BpWv5Z','TX'),('cus_xBu0esQFAWTaPl','NY'),('cus_P1ktfGIafnhodC','TX'),('cus_OM3UNxHOFtoiti','NY'),('cus_hW2KTGc1trvi1c','TX'),('cus_lIrqksw0dOfMOU','NY'),('cus_1Te9MpbIf0cVAa','TX'),('cus_N5bQObLkjlUtCW','NY'),('cus_FZwcc39NsWDIUB','TX'),('cus_oclZPxy6hnNy7f','NY'),('cus_Y0670yXPOFxJtO','TX'),('cus_PrsatahCScANlk','NY'),('cus_5YNsq0Sq5p0Dd7','OK'),('cus_Y1Si4MeggX3X8i','NJ'),('cus_aqaWxuu0PAfWeZ','LA')), ex(id) as (values ('cus_tMTjfCbYtB4klp'),('cus_vEcDpbDkkMrEZC'),('cus_7qRp8FKwOC7ALv'),('cus_TWDEriPU9kKQio'),('cus_3NKE8w7ImuWYpy'),('cus_pOsnSxRfvDjtMM'),('cus_HeOtd62yh30KD6')) select c.id stripe_customer_id, c.name, c.address_state billing_state, coalesce(o.st, c.address_state) tax_state, round(a.arr_usd,0) arr_usd, round(a.arr_usd*case coalesce(o.st, c.address_state) when 'TX' then 0.066 else 0.08875 end,0) est_annual_tax from raw_stripe.customers c join arr a on a.stripe_customer_id = c.id left join ovr o on o.id=c.id left join ex e on e.id=c.id where coalesce(o.st, c.address_state) = 'TX' and e.id is null order by 2This Bash command contains multiple operations. The following part requires approval: rm <scratch file>
- SQL
with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * cas…with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = '2026-11-27' group by 1), ovr(id, st) as (values ('cus_FlKuljy4BpWv5Z','TX'),('cus_xBu0esQFAWTaPl','NY'),('cus_P1ktfGIafnhodC','TX'),('cus_OM3UNxHOFtoiti','NY'),('cus_hW2KTGc1trvi1c','TX'),('cus_lIrqksw0dOfMOU','NY'),('cus_1Te9MpbIf0cVAa','TX'),('cus_N5bQObLkjlUtCW','NY'),('cus_FZwcc39NsWDIUB','TX'),('cus_oclZPxy6hnNy7f','NY'),('cus_Y0670yXPOFxJtO','TX'),('cus_PrsatahCScANlk','NY'),('cus_5YNsq0Sq5p0Dd7','OK'),('cus_Y1Si4MeggX3X8i','NJ'),('cus_aqaWxuu0PAfWeZ','LA')), ex(id) as (values ('cus_tMTjfCbYtB4klp'),('cus_vEcDpbDkkMrEZC'),('cus_7qRp8FKwOC7ALv'),('cus_TWDEriPU9kKQio'),('cus_3NKE8w7ImuWYpy'),('cus_pOsnSxRfvDjtMM'),('cus_HeOtd62yh30KD6')) select c.id stripe_customer_id, c.name, c.address_state billing_state, coalesce(o.st, c.address_state) tax_state, round(a.arr_usd,0) arr_usd, round(a.arr_usd*case coalesce(o.st, c.address_state) when 'TX' then 0.066 else 0.08875 end,0) est_annual_tax from raw_stripe.customers c join arr a on a.stripe_customer_id = c.id left join ovr o on o.id=c.id left join ex e on e.id=c.id where coalesce(o.st, c.address_state) = 'NY' and e.id is null order by 2 with arr as (select s.stripe_customer_id, sum(s.unit_amount_net / 100.0 * s.quantity * case s.billing_interval when 'year' then 1.0 / 12 else 1 end) * 12 as arr_usd from analytics.stg_stripe__subscriptions_daily s left join raw_stripe.discounts d on d.subscription = s.subscription_id and d.percent_off = 100 and s.snapshot_date >= d.start_date and (d.end_date is null or s.snapshot_date < d.end_date) where s.status = 'active' and s.is_paid_plan and s.stripe_customer_id not like 'cus_TEST%' and d.id is null and s.snapshot_date = '2026-11-27' group by 1), ovr(id, st) as (values ('cus_FlKuljy4BpWv5Z','TX'),('cus_xBu0esQFAWTaPl','NY'),('cus_P1ktfGIafnhodC','TX'),('cus_OM3UNxHOFtoiti','NY'),('cus_hW2KTGc1trvi1c','TX'),('cus_lIrqksw0dOfMOU','NY'),('cus_1Te9MpbIf0cVAa','TX'),('cus_N5bQObLkjlUtCW','NY'),('cus_FZwcc39NsWDIUB','TX'),('cus_oclZPxy6hnNy7f','NY'),('cus_Y0670yXPOFxJtO','TX'),('cus_PrsatahCScANlk','NY'),('cus_5YNsq0Sq5p0Dd7','OK'),('cus_Y1Si4MeggX3X8i','NJ'),('cus_aqaWxuu0PAfWeZ','LA')), ex(id) as (values ('cus_tMTjfCbYtB4klp'),('cus_vEcDpbDkkMrEZC'),('cus_7qRp8FKwOC7ALv'),('cus_TWDEriPU9kKQio'),('cus_3NKE8w7ImuWYpy'),('cus_pOsnSxRfvDjtMM'),('cus_HeOtd62yh30KD6')) select c.id stripe_customer_id, c.name, c.address_state billing_state, coalesce(o.st, c.address_state) tax_state, round(a.arr_usd,0) arr_usd, round(a.arr_usd*case coalesce(o.st, c.address_state) when 'TX' then 0.066 else 0.08875 end,0) est_annual_tax from raw_stripe.customers c join arr a on a.stripe_customer_id = c.id left join ovr o on o.id=c.id left join ex e on e.id=c.id where coalesce(o.st, c.address_state) = 'TX' and e.id is null order by 2==> <scratch file> (114 rows) ==> <scratch file> (143 rows)
Answer✓ Right
- 257 customers to switch tax on: 143 Texas, 114 New York, based on where users work, not billing address.
- ~$118K sales tax a year at current ARR (~$58K TX, ~$61K NY); it goes to the states, not Lumen revenue.
- Billing must fix 15 Stripe addresses, or 12 customers are missed and 3 wrongly taxed. Confidence: medium-high.
Full answer
I count 257 customers to switch tax on for: 143 for Texas and 114 for New York. At current ARR they'd be charged about $118K of sales tax a year.
| State | Customers to tax | Their ARR | Effective rate | Est. tax per year |
|---|---|---|---|---|
| Texas | 143 | $875K | 6.6% (8.25% on 80% of the price) | ~$58K |
| New York | 114 | $684K | 8.875% (NYC rate) | ~$61K |
| Total | 257 | $1.56M | ~$118K |
This money comes from customers and goes to the states. It isn't Lumen revenue and doesn't affect ARR or margins.
How I built the list (rules from the tax advisor's memo, in register.sales-tax, reviewed by finance on 2026-11-16):
- Tax goes by where the customer's users work, not the billing address. Stripe's state field is the bill-to address, which is often a headquarters or AP office somewhere else. Using the signed order forms:
- 12 customers billed outside TX/NY are added: 6 Texas, 6 New York, about $248K ARR and ~$19K of the tax. Examples are Basaltbridge Pharmacy (billed to CA, users in TX) and Granitespring Dental (billed to CT, users in NY).
- 3 customers billed to TX/NY are left off because their users are elsewhere: Goldenfield Analytics (users in OK), Copperstone Retail (NJ) and Highlandstone Builders (LA).
- 7 customers with exemption certificates are left off: 4 nonprofit hospitals or clinics in Texas, 2 in New York, and one public university in New York. That's about $127K ARR, or ~$9K of tax not charged. Stripe's
tax_exemptfield is blank for everyone, so it can't be used. - Only active paying customers are included. The ARR is as of 2026-11-27, from the finance-certified query
query.fct-arr-daily(metric.arr). Former customers with a TX/NY address aren't included.
What Billing needs to do:
- Fix the 15 Stripe addresses. Stripe Tax works from the address, so the 15 customers in the order-form table in
register.sales-taxneed their tax location corrected. Otherwise the 12 will be missed and the 3 will be taxed wrongly. - Get the other hospitals, clinics and schools on the list to send certificates. Until a certificate is on file they're taxed like anyone else, so the total will drop if more come in.
- Renew Goldenstead Learning's certificate. It's a New York public university and its certificate expires 2027-06-16. If it isn't renewed, they become taxable mid-year.
Confidence: medium-high. The rules, rates and customer lists come from a reviewed finance register and the ARR from the certified query. The total is approximate for three reasons:
- New York uses the NYC rate for everyone, and the rest of the state is lower, so it may run slightly high.
- Stripe Tax will set the exact rate on each invoice.
- It moves with new sales, churn and any new certificates.
The customer-by-customer lists (Stripe ID, name, billing state, tax state, ARR, estimated tax) are in:
- <scratch file>
- <scratch file>
Ignore tx_ny_taxable_customers.txt in the same folder: it was cut off at 200 rows. The scratchpad can be cleared, so copy the two lists somewhere permanent before sending them to Billing.
How Canonical avoided a mistake
- The mistake
- It built the list from Stripe billing addresses, which puts 22 customers on the wrong side of it. It would charge tax to 7 nonprofit hospitals and public universities that hold exemption certificates, and to 3 customers whose users work in other states. It would skip 12 large accounts billed to out-of-state offices whose teams work in Texas or New York: about $19K a year of tax Lumen would owe without having collected it.
- Where Canonical knew it from
- On November 12, billing ops posted the tax advisor's rules in #billing-ops: tax follows where a customer's users work, per the signed order form, and customers with exemption certificates aren't charged. The enrichment check picked up the thread, finance approved it, and it became Lumen's sales-tax register, with the order-form locations and the certificate list.
- Why a general model couldn't know
- Stripe only has billing addresses, and its tax-exempt flag says "none" for every customer. Who holds a certificate, and where each customer's users actually work, are in signed order forms and billing ops' files. The model without Canonical even noted that some customers might send certificates later, but it had no way to know which ones already had.
The Head of Product asks
“Map the trial funnel for accounts that signed up in October 2026, from sign-up to paid. Where are we losing the most accounts, and which step should we fix first?”
Without Canonical
Warehouse access only
Waiting to run
- Tables
List warehouse tables - SQL
select event, count(*), count(distinct account_id), min(ts), max(ts) from raw_events.track…select event, count(*), count(distinct account_id), min(ts), max(ts) from raw_events.tracks group by 1 order by 2 desc select * from analytics.fct_signup_funnel limit 5 select date_trunc('month',trial_start_ts) m, count(*), count(distinct account_id), count(activated_at), count(converted_at) from analytics.fct_signup_funnel group by 1 order by 1#!/usr/bin/env python3 """Read-only SQL against Lumen's demo warehouse (built by build.py). python3 query.py "select * from analytics.fct_nrr_monthly_v2 order by month desc limit 3" python3 query.py --tables list every table with its columns and row count Schemas work as in Snowflake (`analytics.fct_arr_daily`, `raw_stripe.invoices`, ...). A few Snowflake functions are emulated so certified SQL runs as written: last_day(d), dateadd(part, n, d), datediff(part, a, b) and date_trunc(part, d). Results print as an aligned table, at most 200 rows. """ from __future__ import annotations import datetime as dt import functools … 70 more lines - Read
query.py - Thinks
Let me rebuild the funnel from raw events and compare to the funnel table.
- SQL
with a as (select account_id, min(case when event='account_created' then ts end) c, min(ca…with a as (select account_id, min(case when event='account_created' then ts end) c, min(case when event='workflow_created' then ts end) wc, min(case when event='workflow_run' then ts end) wr, min(case when event='subscription_started' then ts end) ss from raw_events.tracks group by 1) select count(*) n, count(c), count(wc), count(wr), count(ss), sum(wc is not null and wr is not null), sum(ss is not null and wc is null), sum(ss is not null and wr is null) from a join analytics.fct_signup_funnel f using(account_id) where f.trial_start_ts>='2026-10-01' and f.trial_start_ts<'2026-11-01' with a as (select account_id, min(case when event='workflow_created' then ts end) wc, min(case when event='workflow_run' then ts end) wr, min(case when event='subscription_started' then ts end) ss from raw_events.tracks group by 1) select (f.activated_at = a.wc) eq_wc, (f.activated_at=a.wr) eq_wr, f.activated_at is null an, (f.converted_at=a.ss) eq_ss, f.converted_at is null cn, a.ss is null ssn, count(*) from analytics.fct_signup_funnel f join a using(account_id) where f.trial_start_ts>='2026-10-01' and f.trial_start_ts<'2026-11-01' group by 1,2,3,4,5,6 select event, trigger, count(*) from raw_events.tracks group by 1,2
Contains brace with quote character (expansion obfuscation)
- SQL
with a as (select account_id, min(case when event='account_created' then ts end) c, min(ca…with a as (select account_id, min(case when event='account_created' then ts end) c, min(case when event='workflow_created' then ts end) wc, min(case when event='workflow_run' then ts end) wr, min(case when event='subscription_started' then ts end) ss from raw_events.tracks group by 1) select count(*) n, count(c), count(wc), count(wr), count(ss), sum(wc is not null and wr is not null), sum(ss is not null and wc is null), sum(ss is not null and wr is null) from a join analytics.fct_signup_funnel f using(account_id) where f.trial_start_ts>='2026-10-01' and f.trial_start_ts<'2026-11-01' with a as (select account_id, min(case when event='workflow_created' then ts end) wc, min(case when event='workflow_run' then ts end) wr, min(case when event='subscription_started' then ts end) ss from raw_events.tracks group by 1) select (f.activated_at = a.wc) eq_wc, (f.activated_at=a.wr) eq_wr, f.activated_at is null an, (f.converted_at=a.ss) eq_ss, f.converted_at is null cn, a.ss is null ssn, count(*) from analytics.fct_signup_funnel f join a using(account_id) where f.trial_start_ts>='2026-10-01' and f.trial_start_ts<'2026-11-01' group by 1,2,3,4,5,6 select event, trigger, count(*) from raw_events.tracks group by 1,2
n | count(c) | count(wc) | count(wr) | count(ss) | sum(wc is not null and wr is not null) | sum(ss is not null and wc is null) | sum(ss is not null and wr is ----+----------+-----------+-----------+-----------+----------------------------------------+------------------------------------+------------------------------ 443 | 443 | 299 | 299 | 37 | 299 | 1 | 1 (1 rows) eq_wc | eq_wr | an | eq_ss | cn | ssn | count(*) ------+-------+----+-------+----+-----+--------- NULL | NULL | 1 | NULL | 1 | 1 | 143 NULL | NULL | 1 | 1 | 0 | 0 | 1 0 | 1 | 0 | NULL | 1 | 1 | 263 0 | 1 | 0 | 1 | 0 | 0 | 36 (4 rows) event | trigger | count(*) ---------------------+---------+--------- account_created | NULL | 2569 … 5 more lines
- SQL
select * from raw_events.tracks where account_id in ('acct_00001','acct_00003') order by a…select * from raw_events.tracks where account_id in ('acct_00001','acct_00003') order by account_id, ts limit 40 with a as (select account_id, min(case when event='account_created' then ts end) c, min(case when event='workflow_created' then ts end) wc, min(case when event='workflow_run' then ts end) wr, min(case when event='workflow_run' and trigger='manual' then ts end) wrm, min(case when event='workflow_run' and trigger='api' then ts end) wra from raw_events.tracks group by 1) select count(*), count(wrm), count(wra), sum(wra<wrm or (wrm is null and wra is not null)), avg((julianday(wc)-julianday(c))*24) hrs_to_wc, avg((julianday(wr)-julianday(wc))*24*60) min_wc_to_wr from a where c>='2026-10-01' and c<'2026-11-01'event_id | event | user_id | account_id | ts | workflow_id | template_id | trigger ------------+----------------------+------------+------------+---------------------+-----------------+-------------------+-------- evt_0000001 | account_created | usr_00001a | acct_00001 | 2026-06-01T18:40:00 | NULL | NULL | NULL evt_0000002 | workflow_created | usr_00001a | acct_00001 | 2026-06-01T19:13:50 | wf_acct_00001_1 | tpl_ticket_triage | user evt_0000003 | workflow_run | usr_00001a | acct_00001 | 2026-06-03T21:51:06 | wf_acct_00001_1 | tpl_ticket_triage | manual evt_0000004 | workflow_run | usr_00001a | acct_00001 | 2026-06-04T08:34:39 | wf_acct_00001_1 | tpl_ticket_triage | manual evt_0000005 | workflow_run | usr_00001a | acct_00001 | 2026-06-05T10:49:53 | wf_acct_00001_1 | tpl_ticket_triage | api evt_0000006 | workflow_run | usr_00001a | acct_00001 | 2026-06-07T23:07:52 | wf_acct_00001_1 | tpl_ticket_triage | api evt_0000007 | workflow_run | usr_00001c | acct_00001 | 2026-06-09T07:10:07 | wf_acct_00001_1 | tpl_ticket_triage | manual evt_0000008 | workflow_run | usr_00001b | acct_00001 | 2026-06-09T11:26:40 | wf_acct_00001_1 | tpl_ticket_triage | manual evt_0000009 | workflow_run | usr_00001b | acct_00001 | 2026-06-09T22:51:04 | wf_acct_00001_1 | tpl_ticket_triage | manual evt_0000010 | workflow_run | usr_00001c | acct_00001 | 2026-06-10T03:00:41 | wf_acct_00001_1 | tpl_ticket_triage | manual evt_0000011 | workflow_run | usr_00001a | acct_00001 | 2026-06-10T08:51:27 | wf_acct_00001_1 | tpl_ticket_triage | manual evt_0000012 | workflow_run | usr_00001a | acct_00001 | 2026-06-10T22:06:16 | wf_acct_00001_1 | tpl_ticket_triage | api … 19 more lines
- SQL
select round(julianday(trial_end)-julianday(trial_start)) len, count(*) from raw_stripe.su…select round(julianday(trial_end)-julianday(trial_start)) len, count(*) from raw_stripe.subscriptions group by 1 select case when julianday(converted_at)-julianday(trial_start_ts)<=7 then 'a<=7' when julianday(converted_at)-julianday(trial_start_ts)<=14 then 'b8-14' when julianday(converted_at)-julianday(trial_start_ts)<=30 then 'c15-30' else 'd>30' end b, count(*) from analytics.fct_signup_funnel where converted_at is not null and trial_start_ts<'2026-10-01' group by 1 select date_trunc('month',trial_start_ts) m, count(*) n, round(100.0*count(activated_at)/count(*),1) act_pct, round(100.0*sum(converted_at is not null and activated_at is not null)/count(activated_at),1) act_to_paid, round(100.0*count(converted_at)/count(*),1) paid_pct from analytics.fct_signup_funnel group by 1len | count(*) -----+--------- NULL | 2026 (1 rows) b | count(*) -------+--------- a<=7 | 15 b8-14 | 40 c15-30 | 72 d>30 | 26 (4 rows) m | n | act_pct | act_to_paid | paid_pct -----------+-----+---------+-------------+--------- 2026-06-01 | 426 | 66 | 14.9 | 9.9 … 6 more lines
- SQL
select date_trunc('month',trial_start_ts) m, count(*) n, count(activated_at) act, sum(juli…select date_trunc('month',trial_start_ts) m, count(*) n, count(activated_at) act, sum(julianday(activated_at)-julianday(trial_start_ts)<=27) act27, count(converted_at) paid, sum(julianday(converted_at)-julianday(trial_start_ts)<=27) paid27, sum(julianday(converted_at)-julianday(trial_start_ts)<=27 and activated_at is not null) actpaid27 from analytics.fct_signup_funnel group by 1 select * from raw_stripe.customers limit 3 select * from analytics.fct_signup_funnel where converted_at is not null and activated_at is null and trial_start_ts like '2026-10%'m | n | act | act27 | paid | paid27 | actpaid27 -----------+-----+-----+-------+------+--------+---------- 2026-06-01 | 426 | 281 | 281 | 42 | 32 | 32 2026-07-01 | 465 | 279 | 279 | 28 | 21 | 20 2026-08-01 | 426 | 239 | 239 | 36 | 29 | 29 2026-09-01 | 442 | 274 | 274 | 47 | 42 | 41 2026-10-01 | 443 | 299 | 299 | 37 | 31 | 30 2026-11-01 | 367 | 169 | 169 | 5 | 5 | 5 (6 rows) id | name | created | email_domain | salesforce_account_id | livemode -------------------+-------------------------+------------+---------------------+-----------------------+--------- cus_DhU4XgaOzyx7J3 | Acme Logistics | 2023-03-15 | acme.example | 001C7HO000VKFVOAAA | 1 cus_Bbjl2y4y5qtO2o | Kestrel Dental Partners | 2024-06-03 | kestrel.example | 001NDMOFEFGXHAZAAA | 1 cus_5xu09kc24Qo4YX | Copperlight Clinics | 2022-02-03 | copperlight.example | NULL | 1 … 5 more lines
- SQL
with r as (select t.account_id, count(*) runs, sum(trigger='api') api, count(distinct user…with r as (select t.account_id, count(*) runs, sum(trigger='api') api, count(distinct user_id) users from raw_events.tracks t join analytics.fct_signup_funnel f using(account_id) where event='workflow_run' and f.trial_start_ts like '2026-10%' and (f.converted_at is null or t.ts<f.converted_at) group by 1) select case when runs=1 then '1' when runs<=5 then '2-5' else '6+' end rb, api>0 has_api, count(*), sum(f.converted_at is not null) paid from r join analytics.fct_signup_funnel f using(account_id) group by 1,2 select round(avg(julianday(activated_at)-julianday(trial_start_ts)),1) avg_days, max(julianday(activated_at)-julianday(trial_start_ts)) mx from analytics.fct_signup_funnel where trial_start_ts like '2026-10%'
rb | has_api | count(*) | paid ----+---------+----------+----- 1 | 0 | 23 | 0 1 | 1 | 4 | 0 2-5 | 0 | 22 | 1 2-5 | 1 | 66 | 7 6+ | 0 | 5 | 0 6+ | 1 | 179 | 28 (6 rows) avg_days | mx ---------+-------- 3.2 | 13.6738 (1 rows)
Answer✗ Wrong
- Fix activated-to-paid first: 263 of 299 activated October accounts haven't paid (88%), about 1.8× the next-worst loss.
- Sign-up to first workflow loses 144 (33%); activation's 67.5% is already a six-month high.
- Usage depth looks like the lever: 0 of 27 one-run accounts paid vs. 28 of 179 (16%) with 6+ runs and API triggers.
Full answer
I've finished checking the data. The biggest loss is between activation and payment: 263 of the 299 October accounts that activated haven't paid yet. That's the step to fix first.
October 2026 sign-up cohort (443 accounts), as of Nov 27 data
| Step | Accounts | Step conversion | Lost |
|---|---|---|---|
| Signed up (trial start) | 443 | – | – |
| Created first workflow | 299 | 67.5% | 144 |
| Ran first workflow ("activated") | 299 | 100% | 0 |
| Paid (subscription started) | 37 | 12.0% of activated* | 263 |
*36 of the 37 payers activated first. One account (acct_01788) paid without ever creating a workflow. Overall, sign-up to paid is 8.4%.
Where we lose accounts
- Activated to paid loses 263 accounts (88% of activated trials). That's the biggest leak by far, and it's about 1.8× the loss at the next-worst step.
- Sign-up to first workflow loses 144 (33%). That's the second-biggest leak.
- Creating a workflow to running it loses nobody. Everyone who builds a workflow runs it, on average about 3 days after signing up.
Why fix activated to paid first
- Activation is already at its best level. October's 67.5% is the highest of the six months (June–November range is 46–67.5%). Payment after activation sits at about 10–17% every month.
- The gap isn't just because October trials are young. Many accounts take more than 2 weeks to pay: in June–September, about 64% of payers took over 14 days and about 17% took over 30. So October's 37 will grow, probably to about 45. But at the same age (27 days), October is in line with earlier months: 31 payers vs. an average of 31 for June–September. Even fully matured cohorts only reach about 15–17% from activation to paid, so this remains the biggest leak.
- It looks like a problem of how deeply accounts use the product, not of reaching them. Among activated October accounts, those with only one run before paying (or by now, if they haven't paid) have 0 payers out of 27. Those with 6 or more runs that also trigger workflows through the API have 28 payers out of 179 (16%). Getting accounts from their first run to regular, API-driven use looks like the lever.
Caveats
- "Activated" here means the first workflow run, which is how the analytics funnel table defines it. I checked that table against the raw product events and the numbers match.
- The run-count figures show a correlation, not proof that more runs cause payment.
- These figures will go up as October trials keep converting. Re-run around late December for final numbers.
With Canonical
Warehouse access + the knowledge base
Waiting to run
- Tables
List files - Tables
List warehouse tables - SQL
select event, count(*), count(distinct account_id), min(ts), max(ts) from raw_events.track…select event, count(*), count(distinct account_id), min(ts), max(ts) from raw_events.tracks group by 1 select date_trunc('month',trial_start_ts) m, count(*), count(activated_at), count(converted_at) from analytics.fct_signup_funnel group by 1 order by 1--- id: entity.customer type: entity title: Customer owner: finance status: reviewed updated: 2026-06-10 grain: One row per paying billing account (Stripe customer) with at least one active paid subscription. primary_key: stripe_customer_id depends_on: [source.stripe, source.product-events] tags: [core] --- ## Definition … 44 more lines
- Find
Search the knowledge base - SQL
with c as (select account_id, trial_start_ts, converted_at from analytics.fct_signup_funne…with c as (select account_id, trial_start_ts, converted_at from analytics.fct_signup_funnel where trial_start_ts >= '2026-10-01' and trial_start_ts < '2026-11-01'), r as (select c.account_id, count(t.event_id) runs_any, sum(case when t.ts < c.trial_start_ts + interval 14 day then 1 else 0 end) runs14, count(distinct case when t.ts < c.trial_start_ts + interval 14 day then t.user_id end) users14 from c left join raw_events.tracks t on t.account_id=c.account_id and t.event='workflow_run' group by 1) select count(*) trials, sum(case when runs_any>0 then 1 else 0 end) ran, sum(case when runs14>=3 and users14>=2 then 1 else 0 end) activated, sum(case when converted_at < trial_start_ts + interval 30 day then 1 else 0 end) paid30, sum(case when runs14>=3 and users14>=2 and converted_at < trial_start_ts + interval 30 day then 1 else 0 end) act_paid, sum(case when not(runs14>=3 and users14>=2) and converted_at < trial_start_ts + interval 30 day then 1 else 0 end) nonact_paid, sum(case when runs_any>0 and users14>=2 then 1 else 0 end) ran_2users14, sum(case when trial_start_ts >= '2026-10-29' then 1 else 0 end) immature, sum(case when converted_at is not null then 1 else 0 end) paid_ever from c join r using(account_id)
Quoted text in this command can't be checked before it runs
- Thinks
I'm working out the October funnel from the warehouse now.
- SQL
with c as (select account_id, trial_start_ts, converted_at from analytics.fct_signup_funne…with c as (select account_id, trial_start_ts, converted_at from analytics.fct_signup_funnel where trial_start_ts >= '2026-10-01' and trial_start_ts < '2026-11-01'), r as (select c.account_id, count(t.event_id) runs_any, sum(case when t.ts < c.trial_start_ts + interval 14 day then 1 else 0 end) runs14, count(distinct case when t.ts < c.trial_start_ts + interval 14 day then t.user_id end) users14 from c left join raw_events.tracks t on t.account_id=c.account_id and t.event='workflow_run' group by 1) select count(*) trials, sum(case when runs_any>0 then 1 else 0 end) ran, sum(case when runs14>=3 and users14>=2 then 1 else 0 end) activated, sum(case when converted_at < trial_start_ts + interval 30 day then 1 else 0 end) paid30, sum(case when runs14>=3 and users14>=2 and converted_at < trial_start_ts + interval 30 day then 1 else 0 end) act_paid, sum(case when users14>=2 then 1 else 0 end) two_users, sum(case when trial_start_ts >= '2026-10-29' then 1 else 0 end) immature, sum(case when converted_at is not null then 1 else 0 end) paid_ever from c join r using(account_id)
Exit code 1 SQL error: near "14": syntax error
- SQL
select trial_start_ts, datetime(trial_start_ts,'+14 days'), converted_at from analytics.fc…select trial_start_ts, datetime(trial_start_ts,'+14 days'), converted_at from analytics.fct_signup_funnel limit 3
trial_start_ts | datetime(trial_start_ts,'+14 days') | converted_at --------------------+-------------------------------------+-------------------- 2026-06-01T18:40:00 | 2026-06-15 18:40:00 | 2026-06-13T02:14:04 2026-06-01T12:06:00 | 2026-06-15 12:06:00 | NULL 2026-06-01T20:40:00 | 2026-06-15 20:40:00 | NULL (3 rows)
- SQL
with c as (select account_id, trial_start_ts, converted_at, strftime('%Y-%m-%dT%H:%M:%S',t…with c as (select account_id, trial_start_ts, converted_at, strftime('%Y-%m-%dT%H:%M:%S',trial_start_ts,'+14 days') d14, strftime('%Y-%m-%dT%H:%M:%S',trial_start_ts,'+30 days') d30 from analytics.fct_signup_funnel where trial_start_ts >= '2026-10-01' and trial_start_ts < '2026-11-01'), r as (select c.account_id, count(t.event_id) runs_any, sum(case when t.ts < c.d14 then 1 else 0 end) runs14, count(distinct case when t.ts < c.d14 then t.user_id end) users14 from c left join raw_events.tracks t on t.account_id=c.account_id and t.event='workflow_run' group by 1) select count(*) trials, sum(runs_any>0) ran, sum(runs14>0) ran14, sum(runs14>=3 and users14>=2) activated, sum(converted_at < d30) paid30, sum(runs14>=3 and users14>=2 and converted_at < d30) act_paid, sum(runs_any>0 and not(runs14>=3 and users14>=2) and converted_at < d30) ran_notact_paid, sum(runs_any=0 and converted_at < d30) norun_paid, sum(users14>=2) two_users, sum(users14=1 and runs14>=3) solo3, sum(trial_start_ts >= '2026-10-29') immature, sum(converted_at is not null) paid_ever from c join r using(account_id)trials | ran | ran14 | activated | paid30 | act_paid | ran_notact_paid | norun_paid | two_users | solo3 | immature | paid_ever -------+-----+-------+-----------+--------+----------+-----------------+------------+-----------+-------+----------+---------- 443 | 299 | 299 | 73 | 32 | 28 | 3 | 1 | 78 | 173 | 41 | 37 (1 rows)
- SQL
with c as (select account_id, substr(trial_start_ts,1,7) m, trial_start_ts >= '2026-10-29'…with c as (select account_id, substr(trial_start_ts,1,7) m, trial_start_ts >= '2026-10-29' imm, converted_at, strftime('%Y-%m-%dT%H:%M:%S',trial_start_ts,'+14 days') d14, strftime('%Y-%m-%dT%H:%M:%S',trial_start_ts,'+30 days') d30 from analytics.fct_signup_funnel where trial_start_ts >= '2026-06-01' and trial_start_ts < '2026-11-01'), r as (select c.account_id, count(t.event_id) runs_any, sum(case when t.ts < c.d14 then 1 else 0 end) runs14, count(distinct case when t.ts < c.d14 then t.user_id end) users14 from c left join raw_events.tracks t on t.account_id=c.account_id and t.event='workflow_run' group by 1) select m, imm, count(*) trials, sum(runs_any>0) ran, sum(runs14>=3 and users14>=2) activated, sum(converted_at < d30) paid30, sum(runs14>=3 and users14>=2 and converted_at < d30) act_paid from c join r using(account_id) group by 1,2 order by 1,2m | imm | trials | ran | activated | paid30 | act_paid --------+-----+--------+-----+-----------+--------+--------- 2026-06 | 0 | 426 | 281 | 64 | 33 | 30 2026-07 | 0 | 465 | 279 | 52 | 22 | 18 2026-08 | 0 | 426 | 239 | 57 | 30 | 26 2026-09 | 0 | 442 | 274 | 74 | 42 | 37 2026-10 | 0 | 402 | 268 | 66 | 30 | 26 2026-10 | 1 | 41 | 31 | 7 | 2 | 2 (6 rows)
Answer✓ Right
- 226 of 299 accounts that ran a workflow never activated (76%), biggest loss: one person uses it, nobody else joins.
- Fix first: getting a second teammate in. Activated accounts paid about 38–39%; non-activated about 1%.
- 7.2% of October trials paid (32 of 443). Lifting run→activated from 24% to 30% adds about 6–7 paying accounts a month.
Full answer
The biggest loss is between running a first workflow and getting a second teammate using the product. Of the 299 October trials that ran a workflow, 226 never added a second person. That's the step to fix first.
October 2026 sign-ups: trial funnel
| Step | Accounts | Share of previous step | Accounts lost |
|---|---|---|---|
| Trial started | 443 | — | — |
| Ran a workflow | 299 | 67% | 144 (32%) |
| Activated (≥3 runs by ≥2 people within 14 days) | 73 | 24% | 226 (76%) |
| Paid within 30 days | 32 | 44% | 41 |
Overall, 7.2% of October trials paid (32 of 443). The last three days of the month (Oct 29–31, 41 trials) haven't had their full 30 days yet. Leaving them out gives 30 of 402 paid (7.5%), with the same funnel shape.
Where we lose accounts
- Ran a workflow → activated: 226 accounts, the largest loss by far. Three in four accounts that try the product never get a second person running workflows. 173 of them ran 3 or more workflows alone, so the problem isn't that people stop using it. It's that one person uses it and nobody else joins.
- Signed up → ran a workflow: 144 accounts. This is the second-largest loss. It's a real problem but less urgent.
- Activated → paid: 41 accounts. It's a small number, but the rate has dropped: 39% of activated accounts in Oct 1–28 paid, against 50% in September. Worth keeping an eye on.
Fix first: getting a second teammate into the trial
- Activation decides whether an account pays. Of the 32 October accounts that paid, 28 were activated. Activated accounts paid at about 38–39%; accounts that weren't activated paid at about 1% (4 of 370).
- This matches the earlier analysis of solo versus team trials (
analysis.2025-12-team-activation), which found about 50% versus about 2% in every cohort. It also matches the growth team's goal of a second teammate running a workflow. - Rough upside: moving the run→activated rate from 24% to 30% adds about 17 activated accounts. At the current 38% paid rate, that's about 6–7 more paying accounts a month, roughly +20% on trial-to-paid. Moving the top step (sign-up → first run) by the same amount adds far less, because solo accounts almost never pay.
- The likely work is invites and sharing during the first 14 days. Invites aren't tracked in the product event data, so for now the second person shows up only when they run a workflow.
Definitions and caveats
- Definitions: trial-to-paid is
metric.trial-to-paid(paid within 30 days of trial start). The funnel steps and the meaning of "activated" are fromentity.engagement-event. There's no certified query for this metric, so I calculated it fromanalytics.fct_signup_funnelfor the trial start and paid date, plusraw_events.tracksfor theworkflow_runevents. - Don't use the
activated_atcolumn infct_signup_funnel. It records the first workflow run, not activation (register.key-tables). If you did, October would look like 299 "activated" accounts and the drop-off would appear to sit in the wrong step. - Grouping by calendar month here is my choice; the metric is officially tracked by weekly sign-up cohort.
- 5 more October accounts paid after the 30-day window (37 have paid in total). They aren't counted above.
- The data docs still call the trial start column
trial_started_at; it's nowtrial_start_ts. The automated schema check has already flagged this (SCH-3eb1e7).
Confidence: medium-high. The counts come straight from governed definitions, and the solo-versus-team gap matches the earlier analysis. The step sizes are small, though: the drop in activated → paid rests on about 30 accounts a month, so treat it as a signal to watch rather than a firm trend. The +17 accounts figure is a rough scenario, not a forecast.
How Canonical avoided a mistake
- The mistake
- The warehouse's
activated_atcolumn is just an account's first workflow run. Read that way, 299 of 443 October trials "activated" and the leak looks like pricing or the paywall. Lumen counts an account as activated only once a second person uses it, and just 73 got there. - Where Canonical knew it from
- In December 2025 an analyst asked an agent what predicts payment. Its write-up, saved to Canonical, found that team trials pay at about 50% and solo trials at about 2%. Lumen then redefined activation as 3+ runs by 2+ people within 14 days. That definition, and a note that
activated_atis only a proxy, are in the knowledge base. - Why a general model couldn't know
- What counts as activation is Lumen's decision, based on its own history. The warehouse has a column literally named
activated_at, and invites aren't tracked, so nothing in the data points to a second person. The model without Canonical trusted the column and sent the team to fix the wrong step.
Real recorded runs on Lumen, the fictional company in the repo, sped up on one shared clock so each side's pace is real. Same model, same prompt, same read-only warehouse. Only the knowledge base differs. Each short answer is the same model's own summary of its full answer, written from that answer alone. Reproduce them with python3 demo/record.py.
02 · The architecture
One repo. Three functions. Five loops.
analytics-reference/ holds what the company knows. execution/ holds the skills and tooling an agent follows to do the work. system/ holds the jobs and checks that keep everything current.
The five loops are the five automated checks in system/. They are what make it recursive: every check, like every analysis, writes what it learned back into the reference, so the knowledge base gets more accurate the more it's used.
Define once, reference everywhere, and let every use make it more accurate.
Inside the folders: what's in the reference, and what a skill looks like
Metrics
Governed definitions for ARR, NRR, cohort retention, funnel conversion. Each has an owner, caveats, and a history.
metric.arrCertified queries
SQL validated against an independent source. Edit one and it has to be re-certified.
query.fct-arr-dailySources & entities
Every system of record and its known issues. What one "customer" row actually means.
source.stripeFinance
Vendors, billing cycles, AP and AR conventions: everything needed to calculate financial metrics.
register.vendorsProduct
How engagement data maps to product concepts: active, activated, power user, seat utilization.
entity.engagement-eventModels
How the financial model is built and how metrics drive each other. The ARR bridge, driver trees.
model.arr-bridgeFrameworks
Horizontal methods that apply everywhere: growth accounting, mix shift, cohort methods.
framework.mix-shiftHistory
Analyses with a confidence level; decisions with an expected outcome and a date to check.
decision.2026-10-…
Compare the latest forecast with the version from three weeks ago, attribute the deltas, and produce the standard variance output.
- Pull both versions from Pigment via its MCP. Same scenario, same cut
- Compute deltas line × period
- Attribute ARR deltas with the ARR bridge; blended rates with mix shift
- Reconcile any change to actuals against the certified ARR query
- Write the standard variance sheet: summary, detail, bridge
- Draft five bullets of commentary, each with a citation
Ids are from the worked example in the repo: Lumen, a fictional B2B SaaS company.
03 · The five checks
Knowledge bases go stale. This one checks itself.
Connecting AI to your warehouse, GitHub, and Drive lets it read a snapshot. It doesn't keep the snapshot true. Every week products launch, tables get deprecated, and pipelines get re-architected.
system/ runs five checks on a schedule. Checks 1 to 3 protect what's already there. Checks 4 and 5 bring new knowledge in.
Protect what's there
- 1
Schema integrity deterministic
Tables and columns the knowledge base mentions that no longer exist; key-table columns nobody documented.
Runs daily, 06:00.
- 2
Semantic integrity code + agent
Two definitions of ARR; any part of the knowledge base that contradicts another.
Runs weekly, Tuesday.
- 3
Cohesion & redundancy code + agent
Knowledge an agent can't find fast; the same fact stored in three places.
Runs weekly, Tuesday.
Bring new knowledge in
- 4
Proactive enrichment agent
Merged PRs, tracked live documents, launches, and Slack decisions the knowledge base doesn't reflect yet.
Runs weekly, Friday.
- 5
Analytical gaps agent
Analysis people keep doing that isn't captured as a metric or skill.
Runs weekly, Friday.
11 runs a week. Schema drift breaks things today, so that check runs daily. Definitions and new knowledge move slower, so the rest run weekly.
04 · The runtime
From a timer to a decision.
Every run happens in a fresh sandbox with only the read-only access that check needs. The agent runs cheap, exact code first and uses the LLM only where judgment is needed.
Nothing changes on its own. Each finding arrives with a recommended accept, refine, or reject, and a person makes the call. Every layer is replaceable: swap GitHub Actions for Airflow, or Slack for email.
05 · The autonomy ladder
Human in the loop, then it earns its way up.
The review ledger measures, for each type of finding, how often the system's recommendation matched what the person decided. Types with a strong record graduate. Some never do: changing a metric's definition, certifying a query, and anything high severity with low confidence always go to the owner.
Level 0
Human in the loop
A person reviews every finding.
Where every check starts.
Level 1
Agent pre-review
A separate reviewer agent recommends too; the person confirms.
After a check has run a few weeks.
Level 2
Auto-accept
When both agents agree with high confidence, the fix applies. People spot-check.
≥ 95% agreement over ≥ 30 findings of that type.
Level 3
Self-maintaining
People see only escalations.
Every remaining type meets the Level 2 bar.
Agreement between the system's recommendation and the human's decision, by finding type
Illustrative numbers, to show how graduation works. A type graduates at ≥ 95% agreement over ≥ 30 findings.
schema-integrity / undocumented_column
98% agreement over 42 findings. Level 2: auto-accept
schema-integrity / renamed_table
97% agreement over 18 findings. Needs more findings (18 of 30)
cohesion-redundancy / duplicate_fact
91% agreement over 35 findings. Below the 95% bar
proactive-enrichment / missing_launch
84% agreement over 22 findings. Below the 95% bar
semantic-integrity / definition_change
97% agreement over 31 findings. Never graduates: definitions stay human-approved
If a type's agreement drops (the business changed in a way the check doesn't understand), it falls back a level on its own.
Start for free
No migration. A repo and a habit.
- [01] 1 week
Interview and audit
We talk to the people doing the work, map how knowledge work gets done today, and find the lowest-hanging fruit.
- [02] 1–2 weeks
Free MVP
A working version on one problem from the audit, at no cost, so you see results before you commit.
- [03] 3–4 weeks
Build the scaled system
The source of truth and agents across the workflows that matter, on your own systems and in your own repository.
- [04] 4–6 weeks, lightweight
Train
The system learns from your team’s feedback, and your team learns how to work with it.