# The Startup as code

URL: /code/builders/startup/business-as-code · Id: `page:code/builders/startup/business-as-code`

> A Startup is a definition plus a loop that keeps it true, built on five pillars from the model to composition, each a set of files and calls.

A [Startup](/business/nouns/startup) is a definition plus a loop that keeps the running business true to it. Each of the five pillars below is a set of files, records and calls.

## The model: Nouns, Verbs and Events
A [Noun](/business/nouns/noun) is a type of record: its properties, its [Relationships](/business/nouns/relationship), and the [Verbs](/business/nouns/verb) that act on it. A [Thing](/business/nouns/thing) is one instance, with a stable id, a current state, and the properties of its Nouns.

Take a Startup that sells lesson booking to independent music teachers. It declares a `Lesson` Noun in `nouns/Lesson.mdx`, with a `student`, a `startsAt` and a `status`. Every lesson a teacher books is a Thing at an address such as `https://api.sb/lessons.example/lessons/lsn_42`.

A Verb is what can be done to a Noun. Each Verb has six forms, and every [Interface](/business/nouns/interface) uses the same six:

| Name | Example | Where it appears |
| --- | --- | --- |
| verb | `books` | Prose: a parent books a `Lesson`. |
| action | `book` | The call: `Lesson.book`. |
| activity | `booking` | The state while the [Action](/business/nouns/action) runs. |
| event | `booked` | The [Event](/business/nouns/event): `Lesson.booked`. |
| reverse | `bookedBy` | The record read backward: who booked it. |
| inverse | `cancel` | The Verb that undoes it. |

An [Action](/business/nouns/action) is one Verb performed by a [Worker](/business/nouns/worker) on a Thing. An [Event](/business/nouns/event) is the immutable record of what happened, such as `Lesson.booked`. Actions change; Events never do.

State is [computed from Events](/code/builders/startup/computed-state), never set by hand. The view of any scope reads the same records, addressed by a [view address](/code/views/view-address) and rendered by a [Dashboard](/business/nouns/dashboard) as Markdown, screens or JSON.

## The loop: Goals, Experiments and Decisions
A [Goal](/business/nouns/goal) holds [Key Results](/business/nouns/key-result) read live from [Metrics](/business/nouns/metric), and every Startup holds one: its [Minimum Success Criteria](/business/nouns/minimum-success-criteria). The [weekly test](/business/weekly-test) ranks the gap and runs one [Experiment](/business/nouns/experiment) on the weakest slot of the [Founding Hypothesis](/business/founding-hypothesis).

A file in [`experiments/`](/code/file-conventions/experiments) is one Experiment: the [Hypothesis](/business/nouns/hypothesis), the value it varies, and the Metrics that pick the winner. Each measured [Process](/business/nouns/process) names the [Setting](/business/nouns/setting), budget or [Limit](/business/nouns/limit) its reading moves, as [actuating loops](/code/builders/startup/actuating-loops) shows.

Every run ends in [Evidence](/business/nouns/evidence) and a [Decision](/business/nouns/decision). [The experiment guide](/code/run-an-experiment) takes one from a file to a Decision.

## Authority: Permissions, Limits and Mandates
Every Action records who acted (`by`), for whom (`for`), and under which [Mandate](/business/nouns/mandate). A [Role](/business/nouns/role) file declares its contract in [`agents/`](/code/file-conventions/roles): its `limits`, its `mandates`, and its `autonomy` rung, `assist`, `supervised` or `full`, per decision class.

Every Limit is checked before the call runs. A call over its Limit does not fail: it returns a `pending` Action with reason `awaitingAction`, held by an [Approval](/business/nouns/approval). Approved, it runs; refused, it ends `refused`; unanswered by its deadline, it ends `canceled`.

Limits inherit, and a child only tightens. [Mandates and limits](/agents/mandates-and-limits) lists where each one lives.

## Rehearsal and change: Modes, Changes and Versions
A call picks its [Mode](/business/nouns/mode). `try` runs and stores nothing, `send` returns a `pending` Action at once, and `do` waits for the result, as [Modes](/code/api/guides/modes) shows. The `test` environment runs the same definition with simulated payments, ad spend and filings, as [test and live](/code/builders/startup/test-and-live) explains.

Nobody edits a live definition in place. Every edit is a [Change](/business/nouns/change): writes previewed on a branch, checked, approved where a Limit requires it, and merged as one unit. No author approves their own Change.

Each merge produces a new [Version](/business/nouns/version) at a fingerprint. An [Order](/business/nouns/order) keeps the Version of the [Offer](/business/nouns/offer) it bought, so a price Change never rewrites a past sale. [Ship my changes](/code/ship-my-changes) takes a Change from review to the live address.

## Composition: inheritance and projection
A [Startup Template](/business/nouns/startup-template) is a definition other Startups extend, overriding only what differs. The root of the [catalog](/start/templates) carries [Teams](/business/nouns/team), [Systems](/business/nouns/system), Processes and Offers. The lesson-booking Startup declares its `Lesson` Noun and its Offers, and inherits the rest.

A Startup pins the Version it extends. When the Startup Template improves, the upgrade arrives as a Change the Startup reviews, never as a silent rewrite.

Below the template, a Noun inherits another's properties, and a Thing can be several Nouns at once. A [Dataset](/business/nouns/dataset) served through an API is also [Software](/business/nouns/software), with the properties of both. Each Verb projects to an API route, an SDK method, a CLI command, an MCP call and an Event, all named `Noun.verb`:

**Ask**

```text
Place the latest order with an offer.
```

**API**

```bash
curl -X POST https://api.sb/ledgerlark.com/orders/place \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"offer":"offer_1"}'
```

```json
{
  "api": "https://api.sb/ledgerlark.com",
  "order": {
    "$id": "https://api.sb/ledgerlark.com/orders/order_1",
    "$type": "Order",
    "total": {
      "amount": 400,
      "currency": "USD"
    },
    "status": "placed"
  },
  "action": {
    "$id": "https://api.sb/ledgerlark.com/actions/action_1",
    "operation": "Order.place",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/ledgerlark.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const order = await $.Order.place({ offer: 'offer_1' })
```

**CLI**

```bash
npx startup-builder do Order.place --json '{"offer":"offer_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Order.place({ offer: 'offer_1' })"
  }
}
```

One write adds a Verb's endpoint, SDK method, agent tool, [App](/business/nouns/app) button and reference row.

## Next
[What happens on every call](/code/builders/startup/actions-and-modes) follows one Action from the call to its last Event. [Business-as-Code](/business/business-as-code) states the five pillars for founders.