---
title: "Every branch"
url: https://services.dev/docs/examples/legal/branches
captured: [legal-suite.txt]
---
# Every branch

URL: https://services.dev/docs/examples/legal/branches

> Each human and outside branch the legal brand's files can take, run in the sandbox with no person and no outside system, each picked by the magic value that produces it.

*legal's words: matter is a job, asset is a subject, review is a task, signer is a member, network is a pool, outcome is a end (examples/legal/brand.ts).*

All but two of the branches its six Services can take run in the sandbox, with no person and no outside system. A magic value on the order picks each one: a party's email, a value under `metadata.sandbox`, or a member's id. The brand's own suite orders one matter per value, over HTTP and MCP, and checks where each one lands:

```bash
npx services.dev verify --surface all
```

```txt title="magic values: metadata.sandbox.asks = { settle: accept }, metadata.sandbox.asks = { settle: counter }, metadata.sandbox.asks = { settle: close the file }, metadata.sandbox.outside = { reject: [name_unavailable] }, metadata.sandbox.outside = { reject: [missing_specimen] }, metadata.sandbox.outside = { reject: [fee_deficiency] }, metadata.sandbox.outside = { reject: [a_code_no_route_names] }, metadata.sandbox.review = pass, metadata.sandbox.review = flag_once, party.email = signs@example.test, party.email = declines@example.test, party.email = silent@example.test, metadata.sandbox.outside = ack, metadata.sandbox.outside = reject_once, metadata.sandbox.outside = alerts, metadata.sandbox.talk = open, metadata.sandbox.talk = advice, member = mbr_eligible, member = mbr_lapsed_credential, member = mbr_lapsed_coverage, member = mbr_out_of_region, watch.url = https://fails-once.example.test/suite, watch.url = https://down.example.test/suite, watch.url = https://hooks.example.test/suite"
✓ service.order · sk_test_ · metadata.sandbox.asks = { settle: accept }                           202 OK
✓ service.order · sk_test_ · metadata.sandbox.asks = { settle: counter }                          202 OK
✓ service.order · sk_test_ · metadata.sandbox.asks = { settle: close the file }                   202 OK
✓ service.order · sk_test_ · metadata.sandbox.outside = { reject: [name_unavailable] }            202 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.outside = { reject: [missing_specimen] }            202 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.outside = { reject: [fee_deficiency] }              202 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.outside = { reject: [a_code_no_route_names] }       202 OK → delivered
✓ service.order · sk_test_ · act_refused · litigate                                               403 BLOCKED
✓ service.order · sk_test_ · act_refused · litigate · mcp                                         400 BLOCKED
✓ service.order · sk_test_ · region_not_ratified · contract-review · client_region = US-FL        403 BLOCKED
✓ service.order · sk_test_ · region_not_ratified · contract-review · client_region = US-FL · mcp  400 BLOCKED
✓ service.order · sk_test_ · metadata.sandbox.review = pass                                       202 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.review = pass · mcp                                 200 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.review = flag_once                                  202 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.review = flag_once · mcp                            200 OK → delivered
✓ service.order · sk_test_ · a party input's email = signs@example.test                           202 OK → delivered
✓ service.order · sk_test_ · a party input's email = signs@example.test · mcp                     200 OK → delivered
✓ service.order · sk_test_ · a party input's email = declines@example.test                        202 OK → ended
✓ service.order · sk_test_ · a party input's email = declines@example.test · mcp                  200 OK → ended
✓ service.order · sk_test_ · a party input's email = silent@example.test                          202 OK → ended
✓ service.order · sk_test_ · a party input's email = silent@example.test · mcp                    200 OK → ended
✓ service.order · sk_test_ · metadata.sandbox.outside = ack                                       202 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.outside = ack · mcp                                 200 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.outside = reject_once                               202 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.outside = reject_once · mcp                         200 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.outside = alerts                                    202 OK → delivered
✓ service.order · sk_test_ · metadata.sandbox.outside = alerts · mcp                              200 OK → delivered
✓ job.message · sk_test_ · metadata.sandbox.talk = open                                           200 OK
✓ job.message · sk_test_ · metadata.sandbox.talk = open · mcp                                     200 OK
✓ job.message · sk_test_ · metadata.sandbox.talk = advice                                         200 OK
✓ job.message · sk_test_ · metadata.sandbox.talk = advice · mcp                                   200 OK
✓ task.offer · owner session · a member id = mbr_eligible                                         200 OK
✓ task.offer · owner session · a member id = mbr_lapsed_credential                                403 BLOCKED
✓ task.offer · owner session · a member id = mbr_lapsed_coverage                                  200 OK
✓ task.offer · owner session · a member id = mbr_out_of_region                                    403 BLOCKED
✓ task.offer · auth · a key where only a person acts                                              403 BLOCKED
```

## Each value, and what it runs

| Magic value | The branch | Walked on |
|---|---|---|
| a party's email `signs@example.test` | The party acts at once: consents, answers, signs, and takes the first choice. | [Contract review](https://services.dev/docs/examples/legal/contract-review.md) |
| a party's email `declines@example.test` | The party declines, and the matter ends at $0 with the reason declined. | the suite |
| a party's email `silent@example.test` | The party never answers: the ask reminds, expires, opens once more, and the second expiry lapses the matter. | the suite |
| `metadata.sandbox.review = pass` | Every adversarial round passes the draft on the first try. | the suite |
| `metadata.sandbox.review = flag_once` | The first adversarial round flags the draft, the AI redoes it, and the next round passes. | the suite |
| `metadata.sandbox.outside = { reject: [name_unavailable] }` | The state turns down the company's name, and the founders rename it. | [Company formation](https://services.dev/docs/examples/legal/formation.md) |
| `metadata.sandbox.outside = { reject: [missing_specimen] }` | The office rejects the response, and the client uploads the specimen again. | the suite |
| `metadata.sandbox.outside = { reject: [fee_deficiency] }` | The office rejects it, and the routed fee step pays before it's filed again. | the suite |
| `metadata.sandbox.outside = { reject: [a_code_no_route_names] }` | A code the Service doesn't name goes back to the draft. | the suite |
| `metadata.sandbox.outside = ack` | The office, the state or the recipient accepts the first submission, and its receipt releases the charge. | the suite |
| `metadata.sandbox.outside = reject_once` | The first submission is rejected, the step it routes to repairs it, and the second is accepted. | the suite |
| `metadata.sandbox.outside = alerts` | The office accepts with an alert, and that receipt still releases the charge. | the suite |
| `metadata.sandbox.asks = { settle: accept }`, `counter` or `close the file` | The client takes that choice at the demand letter's settle step. | [Demand letter](https://services.dev/docs/examples/legal/demand-letter.md) |
| `metadata.sandbox.propose = { settlement: [3800] }` | The other side's reply offers $3,800. | [Demand letter](https://services.dev/docs/examples/legal/demand-letter.md) |
| `metadata.sandbox.talk = open` | The AI's answer in the thread isn't advice, so the client reads it at once. | the suite |
| `metadata.sandbox.talk = advice` | The AI's answer in the thread is advice, held until the attorney adopts it. | [Contract review](https://services.dev/docs/examples/legal/contract-review.md) |
| member `mbr_eligible` | Holds every credential everywhere, with coverage: eligible for every review, and offered it last. | [One job, every side](https://services.dev/docs/examples/legal/walk.md) |
| member `mbr_lapsed_credential`, `mbr_out_of_region`, `mbr_lapsed_coverage` | Ineligible on the credential or the region. A lapsed policy is covered by the Pool's own. | [The attorneys' Pool](https://services.dev/docs/examples/legal/pool.md) |

## Time is a test clock

Dates need no magic value. An order on a test clock moves when you advance it: [Docket watch](https://services.dev/docs/examples/legal/docket-watch.md) moves one eight days to mint two Monday checks, and [Company formation](https://services.dev/docs/examples/legal/formation.md) reads the clocks its receipt opens.

## Two the sandbox leaves to you

No magic value reaches either branch, so the suite counts neither as a pass. Each runs on a test clock with your own reviewer or courier:

- **The second look.** A draft the panel still flags after its three rounds goes to `second_look`. The sandbox's reviewer flags once at most.
- **The courier.** `send` falls back to `courier` when certified delivery never returns a receipt. Under `outside = never` the courier is silent too, so the suite skips it:

```bash
npx services.dev verify --surface all
```

```txt title="magic values: metadata.sandbox.asks = { settle: accept }, metadata.sandbox.asks = { settle: counter }, metadata.sandbox.asks = { settle: close the file }, metadata.sandbox.outside = { reject: [name_unavailable] }, metadata.sandbox.outside = { reject: [missing_specimen] }, metadata.sandbox.outside = { reject: [fee_deficiency] }, metadata.sandbox.outside = { reject: [a_code_no_route_names] }, metadata.sandbox.review = pass, metadata.sandbox.review = flag_once, party.email = signs@example.test, party.email = declines@example.test, party.email = silent@example.test, metadata.sandbox.outside = ack, metadata.sandbox.outside = reject_once, metadata.sandbox.outside = alerts, metadata.sandbox.talk = open, metadata.sandbox.talk = advice, member = mbr_eligible, member = mbr_lapsed_credential, member = mbr_lapsed_coverage, member = mbr_out_of_region, watch.url = https://fails-once.example.test/suite, watch.url = https://down.example.test/suite, watch.url = https://hooks.example.test/suite"
  no submit step the sandbox answers falls back to a step it answers, so silence stops the job: magic value metadata.sandbox.outside = never · service.order
```

## Refusals need no value

Two answers come from the rules table itself. An order for a refused act answers `act_refused` with its referral, and an order from a state an advice row doesn't ratify answers `region_not_ratified` with the waitlist. Both charge nothing, and [the rules table](https://services.dev/docs/examples/legal/rules.md) shows each.

[Magic values](https://services.dev/docs/reference/magic-values.md) lists every value the sandbox reads.

---

- Up: [The legal example](https://services.dev/docs/examples/legal.md)
- Previous: [One job, every side](https://services.dev/docs/examples/legal/walk.md)
- Next: [The customer portal](https://services.dev/docs/examples/legal/customer-portal.md)
