# Product and customer analytics: reproducible contracts

All records are original synthetic teaching data. This is a fictional reporting
product, not NeuraPath usage, customer revenue or course pricing. Standard-library
Python and SQLite only; regenerate fixtures and eleven checks with:

```text
python build_and_verify.py
```

The script overwrites its named CSVs, schema.sql and verification-results.json
inside this lab. `database()` loads a fresh in-memory SQLite database from the CSVs.
Identical event-ID replays collapse; conflicting event-ID payloads fail. All event
timestamps use the same canonical UTC format; real heterogeneous sources require
additional timestamp/schema validation.

## Event and user contract

Observation cutoff: 2026-01-16T00:00:00Z exclusive. Assume complete fixture coverage
over the stated window; a real event table alone cannot establish completeness.
Nine registered users: U1–U6 external nonbots with mature seven-day windows, U7
internal, U8 a bot, U9 external but recently registered on January 14.

33 raw event rows include one identical E02 replay; 32 unique IDs remain, including
E32 exactly at the observation cutoff, which is excluded from period metrics.
Only valid report_created, report_published, report_viewed and report_shared events
qualify for the chosen active-user definition. Page views and heartbeats do not.

- January 15 DAU: U1,U2,U3,U5 = 4.
- Rolling 30-day active population, Dec 17 inclusive through Jan 16 exclusive:
  U1,U2,U3,U4,U5,U6,U9 = 7. This is a rolling window, not a full calendar-month total.
- Seven-day activation: first valid report_published in [signup,signup+7 days).
  Mature denominator U1–U6 = 6; activated U1,U3,U5 = 3. U2 is late, U4's publish is
  invalid, U6 publishes exactly at the exclusive boundary. U9 has an early success
  but is excluded from this fully matured-cohort rate just like any immature user.
- Funnel: each user's first valid report_created is the entry, followed by a valid
  report_published in [entry,entry+48 hours). Only mature entries count. U1,U3
  convert among six mature entrants. U5 publishes exactly at 48 hours and does
  not qualify. U9's immature first-entry window is excluded even though it converts.
- Feature sharing: eligible Pro users must also meet the selected external,
  nonbot and activity/window rules. Internal events never establish adoption.

These choices are explicit custom contracts. Analytics platforms can use different
entry selection, identity, time-window and retention semantics.

## Separate business exercises

The subscription snapshot is a separate synthetic monthly MRR exercise in INR
paise, not the January event cohort: starting MRR 70,000, ending 60,000. Expansion
5,000, contraction 8,000, churn 30,000, new 18,000, reactivation 5,000. Four starting
paying customers and one churned customer yield 25% logo churn. NRR uses only
starting-customer value: 37,000/70,000; GRR is 32,000/70,000. Cash receipts, tax and
one-time fees are outside this MRR fixture.

Six market baskets contain bread in four, milk in four and both in three. Eggs
appear in two baskets. Basket membership is binary per product; quantities are not
encoded. Bread→milk support .5, confidence .75 and lift 1.125.

Six external support tickets come from five users during Jan 1–15; U7's internal
ticket is excluded. Seven users are active during that period. Search data has
five valid external searches, three with no results; four searching users, two
with at least one no-result search. A blank query is invalid, not a product failure.

The identity exercise maps anonA and accountC01 to C01 through assumed verified
evidence. anonB remains unresolved. Do not infer identity links from similar names
or turn all unresolved IDs into one customer.

Health-score weights are authored: activity .5, support .3, payment .2. Complete
scores U1=.87 and U2=.45; U3 has missing support input and no complete score.
These uncalibrated teaching weights are not a validated prediction model.

Cohort acquisition contribution is separate from subscription MRR. Channel A:
10 customers, cost 100,000 paise, monthly contribution 20k,30k,40k,20k. Channel B:
5 customers, cost 60,000, contribution 10k,20k,30k. Observed payback is month 4 and
month 3 respectively. No later-month values or causal channel effects are implied.
