The legal example

The running jobjob_7Hq2 · waiting · on claim · $149.00 held · sign · tsk_7Hq2

A brand shaped like api.lawyer. Six Services a licensed practice sells, one Pool of attorneys and patent practitioners, one rules table, and api.lawyer's own suite passing against what they generate.

legal's wordsmatter is a jobasset is a subjectreview is a tasksigner is a membernetwork is a pooloutcome is a end

The legal example is a brand shaped like api.lawyer, built from one folder: its words, a rules table, a Pool of attorneys and patent practitioners, and six Services. AI does the work on every matter. Each licensed act is a step a credentialed person attests in their own session, so the brand meets licensing by design.

It proves people and the gate, measured against api.lawyer, the hand-built brand it's shaped like.

Four counts, each read from the run that produced it. api.lawyer's suite is its front-door probes; its behavior lives in its flow tests and its routes, so those are counted too:

MeasureOfResultRead it
api.lawyer's behavior tests: its four playbook suites and its gate, settle and eligibility suites, at a6b27b177 tests60 covered by the generated brand · 17 not ported, because a Service names its own stepsIts behavior tests
api.lawyer's routes69 routes25 served as its clients call them · 17 adapted · 27 decidedRoute by route
api.lawyer's own suite: its front-door probes, unchanged17 probes17 passed · 0 failedThe suite
The brand's own suite, generated from its contract268 cases from 84 rows267 passed · 1 failed · 99 skippedIts suite

When no attorney claims a review, the fill ladder climbs. On a test clock moved two hours, then two more, it raises the fee and then widens to the tier below, where a member claims it:

Call
→ POST /test_clocks/tc_7Hq3/advance {"to":"2h"}
magic values: client.email = signs@example.test
# the record: task.posted → task.raised → task.widened → task.claimed → attested
  14:02 · task.posted · tsk_7Hq2 · $50.00 · dispatch cascade
  16:02 · task.raised · tsk_7Hq2 · $55.00 · raise 10% 2h · funded by the brand
  18:02 · task.widened · tsk_7Hq2 · opened reviewer · widen 4h
  18:02 · task.claimed · tsk_7Hq2 · mbr_7Hq4 · simulated
  ladder  raise 10% 2h: raised to $55.00 · widen 4h: opened reviewer · posted $50.00, now $55.00
ServicePriceCharged onThe person, and their payWho sells that fee
Provisional patent application$199, or $79 when the applicant signs and filesthe office's receipta patent practitioner signs, $150the brand
Contract review$99acceptancean attorney admitted where the client is advises, $50the attorney
Demand letter$149the delivery receiptan attorney admitted where the client is signs, $75the attorney
Company formation$299the state's receiptan attorney advises on the entity, and on the 83(b) when founders vest, $60 eachthe attorney
Trademark response$349the office's receiptan attorney signs the response, $175the attorney
Docket watch$12 a monththe start of each montha watcher acknowledges a date in its last week, $4 an actthe brand

The brand's own suite, generated from its contract, runs every row by its credentials and the branches its files write, over HTTP and MCP. A skipped case never counts as a pass: on a test run, the live and delegated keys' cases wait for --live, and Every branch names the rest.

Run
npx services.dev verify --surface all
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
legal · 235 HTTP cases and 33 MCP cases from 84 rows: each row by its live credentials and magic values, with its auth, audience, replay and next cases · http://localhost:8787/verify/suite.json
✗ subject.withdraw · member session · none                                                        answered 404 EMPTY not_found, expected 200 OK
267 passed · 1 failed · 99 skipped
  live mode only, run with --live: credential sk_live_ · 35 rows
  live mode only, run with --live: credential dlg_ · 31 rows
  live mode only, run with --live: credential tk_ · 17 rows

check reads the folder back: each file with its line count, and each Service with what one matter leaves you. Build it adds them one at a time.

Run
npx services.dev check
magic values: none
brand.ts · 10 lines · legal · api.lawyer · words job → matter, subject → asset, task → review, member → signer, pool → network, end → outcome
rules.ts · 36 lines · rules 2026-10 · 6 Services · 16 rows · 1 shared
pools/attorneys.ts · 20 lines · attorneys · 4 roles: attorney, practitioner, watcher, student · joins in 3 steps · cascade · hold 24h
services/contract-review.ts · 16 lines · $99 per job, within 48 hours, charged on acceptance.
  ledger  +$99.00 · attorney's fee $50.00, sold by the attorney (rail member) · brand $49.00 · AI $1.26 (example) · coverage $4.00 · you $43.74
services/demand-letter.ts · 26 lines · $149 per job, within 48 hours, charged on send's receipt.
  ledger  +$149.00 · attorney's fee $75.00, sold by the attorney (rail member) · brand $74.00 · AI $2.10 (example) · coverage $4.00 · you $67.90
services/docket-watch.ts · 10 lines · $12 per month, charged at the start of each month.
  ledger  +$12.00 · AI $0.84 (example) · watcher $4.00 · coverage $4.00 · you $3.16
services/formation.ts · 30 lines · $299 per job, within 48 hours, charged on form_entity's receipt.
  ledger  +$299.00 · attorney's fee $60.00 at advise_entity, sold by the attorney (rail member) · attorney's fee $60.00 at advise_83b, sold by the attorney (rail member) · brand $179.00 · AI $0.84 (example) · coverage $8.00 · you $170.16
services/provisional-patent.ts · 24 lines · $199 per job, within 5 days, charged on file's receipt.
  ledger  +$199.00 · AI $2.10 (example) · practitioner $150.00 (rail brand) · coverage $4.00 · you $42.90
services/trademark-response.ts · 21 lines · $349 per job, within 48 hours, charged on file's receipt.
  ledger  +$349.00 · attorney's fee $175.00, sold by the attorney (rail member) · brand $174.00 · AI $2.10 (example) · coverage $4.00 · you $167.90
✓ ready to sell · 6 Services · each keeps at least 3% of every job

dev serves the folder on localhost: every surface, the three apps, and a test key. Here it also seeds twelve simulated attorneys in a market that's hard to fill, which is how the ladder above climbed:

Run
npx services.dev dev --members 12 --market tight --no-try
magic values: client.email = signs@example.test
legal
  contract-review     An attorney signs at advise, stamped. The client consents first.
  demand-letter       An attorney signs at sign, stamped. The client consents first and decides at settle.
  docket-watch        A watcher does the ack step.
  formation           An attorney does advise_entity and advise_83b. A founder consents first. Every founder signs at adopt.
  provisional-patent  A practitioner signs at sign, stamped. The applicant consents first and answers at questions.
  trademark-response  An attorney signs at respond, stamped. The client consents first and uploads at evidence.
  domain              https://api.lawyer · agents.json, openapi.json and every doc_url name it; localhost serves them
  site                http://localhost:8787/
  api                 POST http://localhost:8787/matters {"service":"<service>"}
  key                 sk_test_7Hq2 · a call with no key uses it, on localhost only
  mcp                 http://localhost:8787/mcp · stdio: npx services.dev mcp
  cli                 npx services.dev <service> k=v …
  sdk                 connect({ origin: 'http://localhost:8787' }).<service>.order(input)
  docs                http://localhost:8787/llms.txt
  buyers              http://localhost:8787/portal
  attorneys           http://localhost:8787/attorneys · join at /attorneys/join, or npx services.dev signers add attorneys <email>
  verifier            vt_test_7Hq2 · the only writer of verified facts, at POST /<network>/signers/:id/verify
  market              tight · 12 simulated signers in attorneys, each act labeled simulated · the fill ladder climbs before a review is claimed
  you                 http://localhost:8787/console
PageWhat it shows
Build itEach file, with check after it
One job, every sideOne patent matter, as the buyer, the applicant, the practitioner and the owner see it
Every branchEach human and outside branch, and the magic value that produces it
The customer portalThe applicant's screens, from order to acceptance
The delivery portalA practitioner's screens, from the offer to their pay
The owner consoleThree matters at once: one filed, one holding advice, one waiting on the client's direction
The moneyEvery ledger before you sell and after delivery, on both rails, and what an early end costs
What the brand getsAPI, CLI, MCP, SDK, Site, Docs and App, in matter words
The rules tableEvery row, illustrative, with its position
The attorneys' PoolJoin, verify, offers, conflicts and the fill ladder
Provisional patent applicationA stamped signature, a receipt that releases the charge, of record, two prices
Contract reviewConsent first, held advice, three ratified states, two sellers
Demand letterAn outbound submission, a floor only the client sets, a decision
Company formationAn open act, advice an attorney gives, a name the state turns down, three clocks that outlive the matter
Trademark responseTyped rejections routed to the client's evidence or a fee, and an abandoned end
Docket watchA subscription on a patent family that routes an office action to its Service
When the attorney declinesA paid decline on the merits, the client's direction, a second attorney
Porting api.lawyerRoute by route, test by test, and what was decided
Take your first real matterEvery outside system a real matter depends on, and the contract it meets