How it is built
The model behind the page
The home page is a simulation that runs in your browser, not a recording. This is its manual: what it computes, what it assumes, how it was checked and where it stops being true.
What runs for real, and what is made up
Runs for real
- The simulation
- Every dot, wait and dollar on the home page is computed on your device, again each time you change something.
- The comparison
- Each change is measured against today's company on the same simulated customers, over 60 quarters.
- The checks
- The engine is tested against queueing formulas with known answers. You can rerun that test yourself under “Check the math”.
- The AI step
- Your own request is a live call to Claude. The four samples replay real runs, recorded once.
Made up, and labeled so
- Larkspur and its customers
- No real company's data is used anywhere on this site.
- The assumptions
- Chosen to be plausible for a small software company, not measured. All of them are listed below, and seven can be changed on the home page.
- The dollar figures
- They follow from the assumptions. They show how the method reasons; they are not results achieved anywhere.
The life of a request
- The hand-out
- Only the sales desk holds requests. Today a manager hands out the inbox once a day, at 9:00. With assignment rules, a request reaches its owner the moment it arrives.
- A free person
- Each person handles one request at a time, in the order they arrived. A team that gives this work two hours of its nine-hour day finishes a one-hour job four and a half working hours after starting it.
- Patience
- Every customer has a limit at each step, counted in calendar time, so nights and weekends count. Half of those waiting for a first reply are gone after 2 days.
- Sent back
- 15% of hand-typed invoices have a mistake. The customer disputes it, and 7 days later it is back on the clerk's desk.
- The customer decides
- 40% of requests come from companies Larkspur cannot serve, and get a polite no. Of the rest, 40% accept the quote and 95% of those sign. That is decided per customer before anyone waits, so waiting never changes who would have bought: it only decides who is still there.
- Payment
- A correct invoice is paid after 12 days, half of them sooner and half later.
Five decisions that make the numbers worth reading
Time moves from event to event
Nothing is rounded to days or ticks. A reply that takes four minutes takes four minutes, and a quiet weekend costs nothing to simulate. engine.ts
Chance belongs to the customer
Each request carries a key, and everything luck decides about it is a fixed function of that key: how long it will wait, how long its quote takes, whether its invoice has a mistake. Two versions of the company therefore meet the same customers with the same luck, and a difference between them was caused by how they work. chance.ts
60 quarters, never one
Every figure is the average of 60 simulated quarters of 65 working days, each started 30 days early so it opens with work in progress, and shown with the range eight in ten of them fall inside. A change is called worth it only when its average gain after cost is more than two standard errors from zero. Otherwise the page says it is too close to call. experiment.ts
Every change does one thing
Assignment rules remove the wait for the hand-out. AI drafting shortens a reply from 24 minutes to 8. Nothing assumes that a tool makes customers buy more. If a change pays, it is because a line got shorter. company.ts
The plan is worked out again after every step
The best next change depends on what was already changed, because fixing one team moves the line to the next. The planner tries every open change from wherever the company stands, takes the one that leaves most after its own cost, and looks again. A test compares where it ends with all 64 combinations of the 6 improvements: it must land within 3% of the best. planner.ts
How the page computes
- The first screen is worked out when the site is built: today's company, every option and the whole plan, more than 3,000 simulated quarters. It arrives as part of the page, so there is nothing to wait for before reading it.
- Everything you change is simulated on your device, in up to four background workers, and kept, so going back is instant. Without workers it runs on the main thread, more slowly.
- The floor is the same engine moved forward in small steps and drawn on a canvas. Its labels and buttons are ordinary HTML laid over the drawing, and the same information is in a table under “Why the line forms”.
- What you set lives in the address bar, so a link opens the same company with the same changes on any device.
- No cookies, no analytics, no requests to other sites. Fonts are served from this one.
The AI step
- One model call per request. The answer has to come back through a tool with a strict format: what the person wants, how urgent it is, how well the company fits, who should own it and by which rule, a reply, a CRM note and what to check before sending. An answer in any other shape is rejected. contract.ts
- A person approves, edits or rejects every reply. Nothing is sent anywhere. The model is told that the request's text is data, not instructions.
- The key stays on the server. Requests must come from this site, and are limited to five an hour per visitor and to a daily total. route.ts
- What you write is sent to Anthropic's API to produce the reply. This site does not store it.
- If the live agent is switched off or a limit is reached, the page says so, and the recorded runs keep working.
- In the simulation this step does exactly one thing: a reply takes 8 minutes of a rep's time instead of 24, and each draft costs $0.03 of model usage.
Every assumption
These are all the numbers the model takes as given. The home page lets you move the seven that matter most and shows how far the result moves with each.
| Demand | |
|---|---|
| Requests on a weekday | 14 |
| Requests on a Saturday or Sunday | 2 |
| Weekday requests sent between 9:00 and 18:00 | 75% |
| Customers | |
| Requests from companies Larkspur can serve | 60% |
| Of those, companies that say yes to the quote | 40% |
| Accepted quotes that get signed | 95% |
| Fleet size | median 28 vehicles (lognormal, sigma 0.8) |
| Price per vehicle for the first year, invoiced up front | $180 |
| Days until half the customers waiting at a step have gone elsewhere | Reply 2 · Quote 7 · Contract 10 · Set up 45 · Invoice they wait |
| Spread of that patience (lognormal sigma) | Reply 1 · Quote 0.8 · Contract 0.8 · Set up 0.6 · Invoice – |
| Days a customer takes to pay a correct invoice | median 12 (lognormal, sigma 0.5) |
| Teams | |
| Times a day a manager hands out new requests | 1 |
| People | Reply 1 · Quote 4 · Contract 1 · Set up 2 · Invoice 1 |
| Hours a day each person gives to this work | Reply 6 · Quote 6 · Contract 2 · Set up 7 · Invoice 1.5 |
| Hands-on minutes per item, on average | Reply 24 · Quote 195 · Contract 40 · Set up 300 · Invoice 25 |
| How much hands-on time varies | 50% of its average (lognormal) |
| Hand-typed invoices with a mistake the customer disputes | 15% |
| Days before a disputed invoice is back on the clerk's desk | 7 |
| What each change does | |
| Minutes to check and send a reply the AI drafted | 8 |
| Minutes per call and quote when the quote is filled in | 150 |
| Minutes of setup when customers upload their own data | 180 |
| Minutes to check an invoice created from the contract | 3 |
| Invoices created from the contract that still have a mistake | 1% |
| Contracts at list price with standard terms, which a rule can approve | 70% |
| Money | |
| Share of a sale left after the cost of serving the customer | 80% |
| Monthly cost of one more person | Reply $4,500 · Quote $9,000 · Contract $2,500 · Set up $6,000 · Invoice $800 |
| Model usage per reply the AI drafts | $0.03 |
| Cost of “Assign each request the moment it arrives” | $100 a month, $2,500 to build |
| Cost of “Let AI draft the reply; the rep checks and sends” | $200 a month, $4,000 to build |
| Cost of “Fill in quotes from the call notes and the price list” | $400 a month, $6,000 to build |
| Cost of “Approve standard contracts automatically” | $100 a month, $3,000 to build |
| Cost of “Let customers upload their own fleet data” | $500 a month, $12,000 to build |
| Cost of “Create the invoice from the signed contract” | $250 a month, $5,000 to build |
How it was checked
Against mathematics
A simulation can look right and be wrong. The same engine that runs Larkspur is run on four simple queues that have exact formulas, 100,000 customers each. When this page was built, 7 of 7 comparisons agreed.
| Queue | Compared | Formula | Formula says | Engine measured | Agree |
|---|---|---|---|---|---|
| M/M/1Customers who have to wait, by Erlang COne person, random arrivals, service times that vary a lot. Busy 80% of the time. | Customers who have to wait | Erlang C | 80.0% | 79.8%± 1.1% | Yes |
| M/M/1Average time in line, by Erlang COne person, random arrivals, service times that vary a lot. Busy 80% of the time. | Average time in line | Erlang C | 40.00 min | 39.20 min± 3.72 min | Yes |
| M/M/3Customers who have to wait, by Erlang CThree people sharing one line, busy 80% of the time. | Customers who have to wait | Erlang C | 64.7% | 64.3%± 1.8% | Yes |
| M/M/3Average time in line, by Erlang CThree people sharing one line, busy 80% of the time. | Average time in line | Erlang C | 32.36 min | 31.45 min± 3.58 min | Yes |
| M/G/1Average time in line, by Pollaczek-KhinchineOne person, with the lognormal service times Larkspur's teams use. Busy 85% of the time. | Average time in line | Pollaczek-Khinchine | 60.21 min | 58.56 min± 5.81 min | Yes |
| M/M/2+MCustomers who give up, by Erlang-ATwo people with more work than they can do, and customers who give up after an hour on average. | Customers who give up | Erlang-A | 29.8% | 29.7%± 0.6% | Yes |
| M/M/2+MAverage time in line, by Erlang-ATwo people with more work than they can do, and customers who give up after an hour on average. | Average time in line | Erlang-A | 17.90 min | 17.78 min± 0.50 min | Yes |
“±” is the 99% confidence interval of the measurement. A check agrees when the formula's value is inside it, or within 2% of it.
By automated tests
308 of 308 tests passed on November 24, 2026, before this version was built. They are written as plain statements about the company, so the list reads as a specification.
core/agent/contract.test.ts6 of 6 passed- sales-desk agent contract › cleans and bounds what a visitor sends
- sales-desk agent contract › accepts a valid result and rejects an unknown owner
- sales-desk agent contract › offers the model exactly the owners the routing rules name
- sales-desk agent contract › fences the lead's message off as data
- sales-desk agent contract › prices a run from its usage
- sales-desk agent contract › limits hits per key inside the window
core/architecture.test.ts36 of 36 passed- the model › is found where this test looks for it
- the model › core/flow/calendar.ts imports only the model itself and the seeded generator
- the model › core/flow/chance.ts imports only the model itself and the seeded generator
- the model › core/flow/company.ts imports only the model itself and the seeded generator
- the model › core/flow/diagnose.ts imports only the model itself and the seeded generator
- the model › core/flow/dist.ts imports only the model itself and the seeded generator
- the model › core/flow/engine.ts imports only the model itself and the seeded generator
- the model › core/flow/experiment.ts imports only the model itself and the seeded generator
- the model › core/flow/heap.ts imports only the model itself and the seeded generator
- the model › core/flow/metrics.ts imports only the model itself and the seeded generator
- the model › core/flow/planner.ts imports only the model itself and the seeded generator
- the model › core/flow/requests.ts imports only the model itself and the seeded generator
- the model › core/flow/scenario.ts imports only the model itself and the seeded generator
- the model › core/flow/sensitivity.ts imports only the model itself and the seeded generator
- the model › core/flow/theory.ts imports only the model itself and the seeded generator
- the model › core/flow/trace.ts imports only the model itself and the seeded generator
- the model › core/flow/validate.ts imports only the model itself and the seeded generator
- the model › core/flow/calendar.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/chance.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/company.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/diagnose.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/dist.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/engine.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/experiment.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/heap.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/metrics.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/planner.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/requests.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/scenario.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/sensitivity.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/theory.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/trace.ts never reads the clock or draws chance that a seed does not fix
- the model › core/flow/validate.ts never reads the clock or draws chance that a seed does not fix
- the rest of core › never imports the interface, the framework or the server
- the site › never imports the API client, except the one live agent route
- the site › keeps the simulation's worker free of the page: it loads the model and nothing from React
core/flow/calendar.test.ts8 of 8 passed- office calendar › starts the working clock on Monday at 9:00
- office calendar › moves anything that happens while the office is closed to the next opening
- office calendar › keeps office-hours instants where they are
- office calendar › maps working days onto weekdays only
- office calendar › round-trips any working instant through the calendar
- office calendar › gives the first working instant at or after any calendar minute, and never goes back
- office calendar › labels calendar minutes
- round-the-clock calendar › makes the two clocks the same
core/flow/chance.test.ts7 of 7 passed- chance › always gives the same answer to the same question about the same request
- chance › stays inside 0 to 1
- chance › spreads answers evenly, for random keys
- chance › spreads answers evenly, for keys that count up from zero
- chance › gives unrelated answers to different questions about the same request
- chance › gives unrelated answers to the same question about neighboring requests
- chance › derives keys that almost never collide
core/flow/diagnose.test.ts15 of 15 passed- why a team has a line › work waits to be handed out
- why a team has a line › more work than hours
- why a team has a line › work equal to hours
- why a team has a line › more work than hours, much of it arriving at night
- why a team has a line › almost as much work as hours
- why a team has a line › little slack and a line
- why a team has a line › little slack but no line
- why a team has a line › nights and weekends
- why a team has a line › time to spare and still a wait
- why a team has a line › nothing to see
- why a team has a line › hand-out too short to matter
- reading Larkspur › reads every team
- reading Larkspur › finds that today's wait for a reply is a wait to be assigned
- reading Larkspur › finds the account executives overloaded once requests are assigned on arrival
- reading Larkspur › reports no worst team when nobody is lost
core/flow/dist.test.ts10 of 10 passed- normal distribution › matches table values
- normal distribution › has a quantile function that undoes the distribution function
- normal distribution › rejects probabilities outside 0 to 1
- quantile functions › never give a smaller value for a larger draw, and never a negative or infinite one
- quantile functions › have the mean they are described by
- quantile functions › have the spread they are described by
- quantile functions › put the median of an exponential at mean times ln 2
- a lognormal described by its median › has that median, and the mean that goes with its spread
- a lognormal described by its median › puts half below the median and the textbook share within one sigma
- a lognormal described by its median › agrees with its own quantile function
core/flow/engine.test.ts27 of 27 passed- one desk, no surprises › serves each request on arrival when work comes slower than it is done
- one desk, no surprises › makes each request wait one minute longer when work comes faster than it is done
- one desk, no surprises › serves in the order requests arrived
- one desk, no surprises › stretches the work over the day when the team gives it only part of its time
- one desk, no surprises › puts several people on several requests at once, each at their own seat
- patience › loses a customer who waits longer than they are willing to
- patience › keeps a customer whose turn comes in time, and forgets their deadline once work starts
- patience › lets a customer go at the very minute a person frees up
- hand-outs and office hours › holds requests until the next hand-out
- hand-outs and office hours › hands out at opening what arrived overnight and over the weekend
- hand-outs and office hours › starts work at opening on what arrived while the office was closed
- hand-outs and office hours › counts a customer's patience through nights and weekends
- hand-outs and office hours › can hand out several times a day
- steps a request can skip, repeat or stop at › passes requests that need no person straight through
- steps a request can skip, repeat or stop at › brings rejected work back for a second pass after the delay
- steps a request can skip, repeat or stop at › lets a customer leave by choice after the step where they decide
- steps a request can skip, repeat or stop at › waits for the payment after the last step
- changing the process while it runs › hands out held requests at once when hand-outs stop
- changing the process while it runs › puts new people to work on whoever is waiting
- changing the process while it runs › lets waiting requests skip a step that no longer needs a person
- changing the process while it runs › refuses a process with a different number of steps
- the whole company › accounts for every request, today
- the whole company › accounts for every request, with requests assigned on arrival
- the whole company › accounts for every request, with contracts approved by rule
- the whole company › repeats every event when run again on the same requests
- the whole company › gives the same history whether time advances in one step or in many
- any process, any requests › never loses or invents a request, never overbooks a team, never runs time backwards
core/flow/experiment.test.ts20 of 20 passed- summary statistics › find the middle and the edges of a list
- summary statistics › answer 0 for an empty list instead of failing
- summary statistics › leave the list they were given untouched
- one simulated quarter › measures thirteen weeks after a warm-up
- one simulated quarter › counts exactly the requests that reach the company inside the window
- one simulated quarter › starts with work already in progress
- one simulated quarter › reports counts and money per month
- one simulated quarter › never has a team busier than its people allow
- one simulated quarter › splits every wait into closed hours, waiting for hand-out and standing in line
- one simulated quarter › keeps what is left after costs consistent with its parts
- the recorder › balances each team's books over a whole run
- the recorder › measures the time from signature to payment for everyone who paid
- comparing setups on the same customers › gives both setups exactly the same requests and the same would-be buyers
- comparing setups on the same customers › reproduces a run exactly
- comparing setups on the same customers › shows the reply getting faster when requests are assigned on arrival
- comparing setups on the same customers › shows far fewer buyers lost, and more cash, with every improvement on
- comparing setups on the same customers › finds no difference between a setup and itself
- comparing setups on the same customers › charges for people and tools, not for results
- comparing setups on the same customers › refuses to pair lists of different lengths
- comparing setups on the same customers › summarizes runs as a typical value inside a range
core/flow/heap.test.ts3 of 3 passed- heap › hands back whatever was put in, smallest first
- heap › stays ordered when pushes and pops are mixed
- heap › is empty when new
core/flow/planner.test.ts14 of 14 passed- moves › offers every improvement and one more person per team from the starting point
- moves › stops offering what is already on, and people beyond the limit
- moves › applies a move without touching the setup it started from
- moves › knows which team each move changes
- moves › names a setup the same way whatever order the choices were made in
- judging one move › counts the margin on the extra cash, minus what the move costs to run
- judging one move › says a hire costs more than it brings when the extra cash does not cover the salary
- judging one move › calls a difference that changes sign from quarter to quarter unclear
- judging one move › decides the verdict from the gain after costs and how sure it is
- the plan › ranks the open moves by what they leave after costs
- the plan › starts by assigning requests on arrival, which is where the buyers are lost today
- the plan › only takes steps that are clearly worth their cost, each from where the last one ended
- the plan › stops when nothing left is clearly worth it
- the plan › ends within a few percent of the best of all 64 combinations of improvements
core/flow/requests.test.ts11 of 11 passed- Larkspur's requests › are the same every time for the same seed, and different for another
- Larkspur's requests › do not depend on the order the days are asked for
- Larkspur's requests › fall on their own day, in time order, with ids that say which day
- Larkspur's requests › arrive at the assumed rates, mostly in office hours on weekdays
- Larkspur's requests › split into fits, acceptances and signatures at the assumed shares
- Larkspur's requests › have fleets around the assumed median, priced per vehicle
- Larkspur's requests › carry a name
- changing an assumption › adds requests to the ones already there when volume goes up
- changing an assumption › leaves a shared request exactly as it was when volume changes
- changing an assumption › turns some of the same buyers into non-buyers when fewer say yes
- changing an assumption › changes what a customer is worth, and nothing else, when the price changes
core/flow/scenario.test.ts13 of 13 passed- a scenario in a link › is empty for the starting point
- a scenario in a link › reads like what it says
- a scenario in a link › comes back the same after a round trip
- a scenario in a link › turns any text at all into a valid scenario
- a scenario in a link › drops what it does not know and clamps what is out of range
- a scenario in a link › does not run code or keep markup from a link
- assumptions a visitor can replace › each start at the base value, inside their own range and on a step
- assumptions a visitor can replace › change the one thing they name
- assumptions a visitor can replace › leave the base assumptions alone
- assumptions a visitor can replace › scale weekend requests with weekday requests
- assumptions a visitor can replace › treat a tweak equal to the base value as no tweak
- assumptions a visitor can replace › snap to steps and stay in range
- a setup › counts as changed once an improvement is on or a person is added
core/flow/sensitivity.test.ts4 of 4 passed- one-at-a-time variations › move each assumption down and up, skipping a side that would change nothing
- one-at-a-time variations › keep the visitor's other assumptions in place
- one-at-a-time variations › read an assumption's current value
- swings › put the assumption that moves the result most first
core/flow/theory.test.ts17 of 17 passed- queueing formulas › reproduce textbook values
- queueing formulas › agree with the one-person formula everyone knows
- queueing formulas › halve the wait when service times stop varying
- queueing formulas › say the line never stops growing when more work arrives than can be done
- queueing formulas › make waits shorter with more people
- queueing formulas › turn into the patient queue when customers almost never give up
- queueing formulas › lose exactly the overflow when customers give up at once
- queueing formulas › keep an overloaded team's losses at least as large as the overload
- the engine against the formulas › covers every case, with one person, several people, uneven service and impatience
- the engine against the formulas › M/M/1: Customers who have to wait matches the formula
- the engine against the formulas › M/M/1: Average time in line matches the formula
- the engine against the formulas › M/M/3: Customers who have to wait matches the formula
- the engine against the formulas › M/M/3: Average time in line matches the formula
- the engine against the formulas › M/G/1: Average time in line matches the formula
- the engine against the formulas › M/M/2+M: Customers who give up matches the formula
- the engine against the formulas › M/M/2+M: Average time in line matches the formula
- the engine against the formulas › measures every customer after the warm-up
core/flow/trace.test.ts7 of 7 passed- following buyers › follows only would-be buyers who wrote in during the chosen days
- following buyers › tells each story in time order, from the request to how it ended
- following buyers › ends a buyer's story with a payment or with giving up, never by choice
- following buyers › takes a paid customer through every team in order
- the same buyers in two versions of the company › pairs every buyer with themselves
- the same buyers in two versions of the company › keeps most of the buyers that today's company loses
- the same buyers in two versions of the company › gets paid sooner by the customers both versions keep
lib/flow/assumptions.test.ts6 of 6 passed- the list of assumptions the site publishes › leaves out nothing the model takes as given
- the list of assumptions the site publishes › names no assumption the model does not have
- the list of assumptions the site publishes › gives every row a label and a value, and no label twice
- the list of assumptions the site publishes › lists what every improvement costs
- the list of assumptions the site publishes › changes when an assumption does: every row is read from the values in use
- the list of assumptions the site publishes › follows the visitor's own values for the assumptions they can move
lib/flow/format.test.ts43 of 43 passed- money › writes 0 as $0
- money › writes 612.4 as $612
- money › writes 999 as $999
- money › writes 1000 as $1k
- money › writes 2500 as $2.5k
- money › writes 9949 as $9.9k
- money › writes 9950 as $10k
- money › writes 350227 as $350k
- money › writes 999499 as $999k
- money › writes 999500 as $1.0M
- money › writes 1240000 as $1.2M
- money › writes 12400000 as $12M
- money › writes -3200 as −$3.2k
- money › never rounds a figure up into the next unit's notation
- money › puts a sign on a change and none on zero
- money › shows a dash for a figure it was not given
- counts › writes 0 as 0
- counts › writes 0.04 as 0
- counts › writes 0.7 as 0.7
- counts › writes 1 as 1
- counts › writes 6.24 as 6.2
- counts › writes 9.94 as 9.9
- counts › writes 9.96 as 10
- counts › writes 21.8 as 22
- counts › writes 1234.4 as 1,234
- counts › signs a change, and calls a change too small to show zero
- counts › uses the singular only for one
- time › writes 0 hours as 0 min
- time › writes 0.05 hours as 3 min
- time › writes 0.5 hours as 30 min
- time › writes 0.99 hours as 59 min
- time › writes 1 hours as 1 h
- time › writes 3.74 hours as 3.7 h
- time › writes 9.96 hours as 10 h
- time › writes 24.1 hours as 24 h
- time › writes 47.4 hours as 47 h
- time › writes 48 hours as 2 days
- time › writes 583 hours as 24.3 days
- time › never writes sixty minutes or more as minutes
- time › writes days with one decimal below ten
- time › writes hours of work a day
- time › writes shares as whole percentages
- time › keeps payback coarse: the model does not simulate a change bedding in
lib/flow/live.test.ts8 of 8 passed- the live floor › opens mid-morning on a working day, with four weeks already counted
- the live floor › shows a first month close to the long-run averages printed under it
- the live floor › loses most of its buyers where the page says it does: waiting for a first reply
- the live floor › counts every departure it reports, and only would-be buyers as buyers
- the live floor › reaches the same state whether time passes in frames or in one jump
- the live floor › starts counting afresh when the company changes, and loses fewer buyers after
- the live floor › is the same floor for every visitor
- the live floor › follows the visitor's assumptions
lib/flow/pool.test.ts7 of 7 passed- the worker pool › returns exactly what the model computes, in seed order, however many lanes it has
- the worker pool › works with fewer quarters than lanes
- the worker pool › applies the visitor's assumptions to the customers it simulates
- the worker pool › keeps answers apart when several setups are asked for at once
- the worker pool › drops work that has not started when asked to, and says so to whoever was waiting
- the worker pool › refuses new work once it is shut down
- the worker pool › runs the checks against the queueing formulas
lib/flow/store.test.ts12 of 12 passed- the page's store › works a change out in stages: the result, then the options, then the plan
- the page's store › ends with exactly the numbers the model gives when asked directly
- the page's store › uses the visitor's assumptions for today's company and for the changed one
- the page's store › does nothing when asked for the scenario already on screen
- the page's store › lets the newest change win: nothing from an abandoned one is ever shown
- the page's store › is not left waiting when a change needs quarters that a newer change had just dropped
- the page's store › handles a click that lands while the page is still looking one step ahead
- the page's store › simulates nothing twice: going back to a setup already seen asks the workers for nothing
- the page's store › keeps the rest of the plan when the visitor follows it, one step or several at once
- the page's store › says so when a simulation fails, and recovers when asked to try again
- the page's store › measures how far a result moves with each assumption, on the same customers
- the page's store › stops publishing once it is disposed
lib/flow/story.test.ts8 of 8 passed- a customer's story › has traces of every ending to work with
- a customer's story › starts when the customer wrote in
- a customer's story › tells the moments in the order they happened
- a customer's story › gives a customer who paid every moment, and ends on the payment
- a customer's story › stops a customer who gave up at the step they were waiting for
- a customer's story › only ever follows customers who would have bought
- a customer's story › notes a contract approved by rule, and an invoice that had to be redone
- a customer's story › writes a moment as a clock time and how long after the request it came
lib/flow/words.test.ts26 of 26 passed- naming a change › names every improvement with the words the company model gives it
- naming a change › names a hire after the role, with the right article
- naming a change › writes a cost with only the parts that are not zero
- saying whether a change pays › states the gain after cost and a coarse payback when it nearly always pays
- saying whether a change pays › says how often it comes out ahead when the average hides losing quarters
- saying whether a change pays › claims no payback for a change with nothing to build
- saying whether a change pays › gives no figure for a gain that cannot be told from luck
- saying whether a change pays › shows the loss of a change that costs more than it brings in
- saying whether a change pays › has a label for every verdict
- saying whether a change pays › writes a range as the span eight quarters in ten fall inside
- explaining a wait › handout: the sentence is built from the reading's own numbers
- explaining a wait › overload: the sentence is built from the reading's own numbers
- explaining a wait › full: the sentence is built from the reading's own numbers
- explaining a wait › tight: the sentence is built from the reading's own numbers
- explaining a wait › hours: the sentence is built from the reading's own numbers
- explaining a wait › turn: the sentence is built from the reading's own numbers
- explaining a wait › clear: the sentence is built from the reading's own numbers
- explaining a wait › the hand-out sentence adds up: the wait, and the part of it spent unassigned
- explaining a wait › never says a team has spare time when its work exceeds its hours
- explaining a wait › explains a slow part-time desk by the hours it gives the work
- small phrases › writes what is lost at a team, or that nothing is
- small phrases › counts people and changes in plain words
- reporting what the changes so far came to › names both figures when both clearly moved
- reporting what the changes so far came to › leaves out a figure whose difference could be luck
- reporting what the changes so far came to › leaves out a difference that rounding makes invisible
- reporting what the changes so far came to › counts one buyer as one
In a browser
A second set of tests drives the finished page on a desktop and on a phone: it makes the first change, compares the figures on the screen with the engine's own, reopens a setup from its link, scans for accessibility problems in light and dark, and fails if the page sets a cookie or contacts another site. tests/e2e
Where it stops being true
- Larkspur is not fitted to any real company. Using this on a real one starts by replacing the assumptions with its own records: when requests arrive, how long each step takes, how long customers wait before they go elsewhere.
- Patience is the assumption the result leans on most, and the hardest to measure in real life. The test under “Change the assumptions” shows how far the answer moves with it.
- People here do not learn, tire, help the next team or juggle several things. Each one does one job at a time at a steady pace.
- A change works in full from the moment it is switched on. Rollout, training and adoption are not modeled, which is why payback is only given roughly.
- Demand does not react. Faster replies do not bring more requests, and customers who gave up do not come back.
- Results repeat exactly on one browser engine. Another engine may round the last digit of a logarithm differently, which can move a figure very slightly. The first screen is computed when the site is built; everything after it, in your browser.
At a real company
The simulation is the small part. The same method on real work goes in five steps.
- Measure the flow. Pull the timestamps a CRM and a billing system already keep: when each request arrived, when it was picked up, when it moved on, when it was paid or lost.
- Find the wait. For each step, separate time spent working from time spent waiting, and waiting for a person from waiting for a hand-off.
- Rank the fixes. Put the company's own numbers into a model like this one and compare changes on the same customers before building anything.
- Build the first one. Usually in tools the company already has: assignment rules and workflows in a CRM such as HubSpot or Zoho, automations in n8n, Make or Zapier, data work in SQL and Python, and a model such as Claude where a step needs judgment, with a person approving.
- Check it against the forecast. Compare what happened with what the model said, and correct the model before the next change.
Built with
- Model
- TypeScript in strict mode, no dependencies. The 5-team company, the engine and the statistics live in
core/flowand import nothing from the interface; a test keeps it that way. - Interface
- Next.js 16 and React 19: two static pages and one server route. Canvas for the floor, plain HTML and CSS for everything else.
- AI
- The Claude API, called from the server route only.
- Tests
- Vitest and fast-check for the model, Playwright and axe for the page, Biome for formatting and static checks.
- This version
- Commit
83a9deb, built on November 24, 2026. Read the source.