Experiments
A file in experiments/ is one Experiment, the Hypothesis, what it varies, who is assigned and the Metrics that judge it, started on merge.
A file in experiments/ is one Experiment: the Hypothesis under test, the value it varies, the unit assigned, and the Metrics that pick the winner. It implements Experimentation.
leaseline/experiments/reply-with-the-lease.mdxone Experimentprompts/support-reply.mdthe controlsupport-reply@lease.mdthe challenger arm
Reference
MDX. Frontmatter is the Experiment; the body is the reasoning, which the Decision cites when it concludes.
| Key | Type | Holds |
|---|---|---|
hypothesis | string | The belief, stated so the primary Metric can prove it wrong. Required |
varies | path or key | What changes: a file such as prompts/, an Offer, a Page, or a Setting such as settings.trial. Required |
arms | map | Each arm's value; control is the current one. A file's arms are its @arm siblings instead |
unit | visitor | customer | contact | conversation | request | Who is assigned. Set by what varies when omitted |
split | map | Each arm's share of units. Even by default |
metric | Metric id | The primary Metric. Required |
guardrails | Metric ids | Metrics that stop the Experiment the moment one breaches |
window, minN | duration, integer | How long it runs, and the fewest exposed units per arm before a verdict |
Examples
Minimal
---
hypothesis: A 30-day trial turns more managers into paying Customers than a 14-day trial.
varies: settings.trial
arms: { control: 14d, month: 30d }
metric: outside-paying-customers
---Leaseline
Leaseline's support Agent answers property managers. The challenger reply cites the manager's own lease record before it explains anything.
---
hypothesis: Replies that quote the manager's lease record resolve more Conversations with no person involved than replies that explain the feature.
varies: prompts/ support-reply
unit: conversation
metric: agent-resolution-rate
guardrails: [resolution-time]
window: 21d
minN: 120
---
Most questions are about one lease. Showing that lease answers the question the manager asked.Code that branches on an arm asks the Flag the file compiles to. The answer is the same for a unit every time, and the Exposure is recorded for you:
import { $ } from 'startup-builder'
const { variant } = await $.Flag.evaluate({ flag: 'reply-with-the-lease', unit: 'conversation_1', default: 'control' })$.choose('reply-with-the-lease', is the same call, resolving to the arm's key.
What it builds
On merge, the StartupBuilder compiles the file into a running test.
- a Hypothesis, bound with
Hypothesis.test - an Experiment in
draft, with one Variant per arm andcontrolmarked - a Flag that assigns each unit by a keyed hash, read by
Flag.evaluate Experiment.start, once each arm clears its gates; an Agent's instructions first pass their Evaluators offline, then run in shadow- an Exposure when a unit meets its arm, and a Readout per arm each day
Experiment.concludewithship,killoriterate;shipopens a Change that makes the winner the file
Good to know
- The stakes of what varies pick the method. A Price, a refund Limit or Offer terms never run as a bandit, and their winner waits a business day.
- Two Customers in one market never see two Prices for one Offer. Test a Price as a sibling Offer for new Customers.
- The legal floor, Consent, AI disclosure and refund rights are never varied: a file that varies them is refused at its Change.
- The Agent running an Experiment never edits its
metricorguardrails. - A losing arm is killed and kept, with every Exposure on the record.