# Sales capacity, quotas and pipeline (declared before any simulation)

The study's published parts forecast revenue from the drivers that produce it: trips, prices and charges in the first
part, and active drivers, their cohorts and trips per driver in the second. Both forecast forward from history. This
part asks the planning question backwards: given a target for new annual recurring revenue (new ARR), do the planned
sales reps, their ramp, their territories and their quotas produce enough pipeline and closed revenue to meet it, and
which planning assumptions decide whether the plan reconciles? No published page plans headcount, quotas or pipeline,
or asks how often a plan meets its target.

The data is explicitly synthetic: a made-up software company that sells annual contracts through three sales segments.
Every rate is a labelled assumption in `protocol-capacity.json`, none is measured, and the results are properties of
those assumptions. The method carries; the numbers do not. It stands in for the annual capacity plan of a software
company, where a target is turned into headcount and quotas; it is synthetic so that no company's data is shared.

This file and `protocol-capacity.json` were written and committed before any code that plans or simulates existed.
The published results files of the first two parts are unchanged; this part writes new files only.

## 1. The company

Three segments, each with its own quota (new ARR a fully ramped rep is asked to close in a year), ramp, win rate, deal
size and sales cycle. Values in `protocol-capacity.json` (`segments`, `base`):

| | Small business | Mid-market | Enterprise |
|---|---:|---:|---:|
| Share of the target | 25% | 40% | 35% |
| Quota, US$ a year | 600,000 | 900,000 | 1,500,000 |
| Reps today | 7 | 7 | 4 |
| Months to full ramp | 3 | 5 | 7 |
| Win rate of an opportunity | 25% | 20% | 15% |
| Mean deal, US$ of ARR | 30,000 | 75,000 | 200,000 |
| Mean sales cycle, months | 2 | 4 | 6 |
| On-target earnings, US$ | 150,000 | 200,000 | 280,000 |

Shared inputs: the new-ARR target is US$20,000,000 for a plan year of 12 months, split by quarter 22%, 24%, 26% and 28%.
A fully ramped rep in a staffed territory closes 85% of quota on average (attainment). Annual attrition is 20%. A seat
left empty stays empty for 2.5 months on average (time to fill). A new hire starts 1.5 months after the planned start
on average (hiring lag). 40% of opportunities arrive inbound (marketing), the rest are found by the rep. While a
territory has no rep, its inbound opportunities are worked by others at half the usual win rate (vacancy cover). Deal
sizes spread with a lognormal sigma of 0.7. A rep's loaded cost is 1.25 times on-target earnings.

## 2. The plans

**Top-down plan (target divided by quota).** Headcount per segment = the segment's share of the target divided by its
quota, rounded up. Hires = headcount minus today's reps, planned to start in months 1, 2 and 3 in turn (small business
first). On paper it reconciles: its quota capacity, the sum of every seat's quota, is at least the target.

**Bottom-up capacity plan of the same headcount.** Expected new ARR closed in the plan year, from ramped and staffed
territory-months times productivity times coverage: for each territory and month, the probability it is staffed and at
which month of tenure (a Markov chain of hiring lag, ramp, attrition and vacancy), the opportunities that implies, the
win rate, the mean deal and the probability the deal closes inside the plan year. It is computed exactly, in
expectation, from the same assumptions the simulation draws from; it is the spreadsheet a planning team would build.

**Capacity plans sized to the target.** Starting from the top-down headcount, add one new hire at a time to the segment
with the lowest expected bookings against its share of the target (ties: small business, mid-market, enterprise); the
k-th added hire starts in month 1, 2 or 3 in turn. The *expected plan* is the first headcount whose expected bookings
reach the target. The *80% plan* is the first whose target is met in at least 80% of simulated years (main seed,
4,000 years).

## 3. Mechanics, the same in the plan and the simulation

- **Territories.** One rep per territory. Today's territories, and one new territory per planned hire from its planned
  start month. A new territory's inbound opportunities start at its planned start month.
- **Ramp.** In tenure month k (k = 1 is the first month in seat), a rep produces min(1, (k − 0.5) / R) of a ramped
  rep's own opportunities, R the segment's months to full ramp times `ramp_scale`.
- **Hiring lag.** Months from the planned start to the first month in seat: geometric on 0, 1, 2 and so on, with the
  declared mean.
- **Attrition.** A rep leaves at the end of any month with probability 1 − (1 − annual attrition)^(1/12). The territory
  is then empty for a geometric number of months (1 or more) with mean `time_to_fill_months`, and the backfill starts
  at tenure month 1.
- **Opportunities.** Per territory and month, Poisson counts: inbound at rate lambda_in whenever the territory exists;
  rep-sourced at rate lambda_rep times the ramp factor when staffed. lambda_in + lambda_rep is calibrated so a ramped
  rep in a staffed territory closes `attainment` x quota a year on average: (lambda_in + lambda_rep) = attainment x
  quota / (12 x win rate x mean deal), with lambda_in = `inbound_share` of the total. So win rate and deal size set the
  pipeline needed and the spread of outcomes, and attainment sets the average output.
- **Wins.** Rep-sourced opportunities win at the segment's win rate; inbound ones at the win rate when staffed and at
  `vacancy_cover` times it when the territory is empty. An open opportunity is not lost when its rep leaves.
- **Cycle.** A won deal created in month m closes in month m + c, c = 1 + Poisson(mean cycle x `cycle_scale` − 1).
  Bookings of the plan year are the won deals that close in months 1 to 12, whenever they were created.
- **Deal size.** Lognormal with the segment's mean deal times `deal_mean_scale` and sigma `deal_size_sigma`.
- **Before the year.** Today's territories run for 18 months before month 1, starting from the stationary state of the
  territory chain, so the year opens with the pipeline and the tenure mix a steady team would have. New territories do
  not exist before the year.
- **Simulation.** Won deals per territory-month are drawn directly as Poisson counts at the win-thinned rates (the same
  distribution as drawing every opportunity and then its outcome). Pipeline figures (opportunities created, open
  pipeline at each quarter's start) are expectations from the plan calculation, not simulated.

## 4. What is reported

- **The gap:** the top-down plan's quota capacity against its expected bookings, in US$ and as a share of the target.
- **The plan bridge:** quota capacity to expected bookings in five sequential steps, in this order: attainment below
  quota (every seat open and ramped all year, no attrition, deals closing as they are created); start dates and hiring
  lag (new seats open at their planned start, reps arriving after the lag); ramp (new hires ramp, and today's reps start
  the year at their stationary tenure, given staffed); attrition and vacancy (today's seats start from the full
  stationary state, including empty ones, and reps leave and are backfilled, with the backfill's ramp); pipeline timing
  (sales cycles on: deals created before the year close in it, deals created late close after it). The pieces sum
  exactly to the gap; that is bookkeeping, and another order would move part of each piece to another.
- **How often the target is met:** the share of simulated years meeting the annual target, and the share meeting each
  quarter's target, with Wilson 95% intervals; the 10th, 50th and 90th percentiles of bookings.
- **Attainment distribution:** among reps in seat all 12 months and fully ramped at month 1, the share closing at least
  quota, and the 10th, 50th and 90th percentiles of attainment.
- **Pipeline:** the expected value of opportunities created in the plan year against the pipeline the target needs at
  the plan's win rates (each segment's target divided by its win rate), and the expected open pipeline at each quarter's
  start as a multiple of that quarter's target.
- **Capacity plans:** headcount per segment, expected bookings, the share of years met, and the added loaded cost a year
  of the added reps.
- **A self-test, not evidence:** the simulated mean against the plan calculation's expectation. They come from the same
  assumptions, so agreement only shows the two codes implement the same model.

## 5. Which assumptions decide

- **One at a time:** every input in `ranges` moved to its low and its high value, all else at base: the top-down plan's
  expected bookings as a share of the target, and the 80% plan's share of years met (2,000 years). An input flips the
  80% plan when either end leaves it met in fewer than half of the simulated years.
- **Two at a time:** the two inputs with the largest swing in the top-down plan's expected bookings (as a share of the
  target) are swept jointly on a 5 by 5 grid over their ranges: the 80% plan's share of years met (2,000 years) and
  the top-down plan's expected bookings, with the boundary where the 80% plan stops being met.
- **Seeds:** the base case of both plans re-run with five more seeds.

All scenarios use the same random numbers (common random numbers), so differences between them are not noise from the
draw.

## 6. Declared predictions

- **P1.** In the base case the top-down plan meets the annual target in fewer than 10% of simulated years. Supported:
  the Wilson upper bound is below 10%. Direction only: the point estimate is below 10% and the upper bound is not.
  Not supported: the point estimate is 10% or more.
- **P2.** The four timing pieces of the plan bridge (start dates and hiring lag, ramp, attrition and vacancy, pipeline
  timing) together take more expected bookings than attainment below quota. Supported if their absolute sum is larger;
  not supported otherwise.

Both are reported whatever they show.

## 7. Limits declared before running

- Synthetic company and assumed rates; one shape of company. The results describe these assumptions.
- New ARR only: no renewals, churn, expansion, discounts or price changes.
- Opportunities are independent and a territory never runs out of accounts; attrition does not depend on performance;
  every territory in a segment is alike; quarter targets are fixed shares, with no seasonality in demand.
- Attainment is one average for every ramped rep; reps differ only by chance.

## Frozen-results check

The results file is pinned by sha256 in its tests, and a re-run from the committed protocol, with no network,
reproduces it byte for byte.
