Work
Open in
Work gets a product's jobs done by agents and people, each step on the cheapest worker that meets its grade. Every step is checked, supervised where the law asks, then delivered and accepted under an Outcome contract.
Capability families
A Service API sells an outcome, an Agent API a worker, and a Marketplace the supply of many sellers. Each needs the same layer: someone does a step, someone else checks it, and the buyer accepts the result. People are a Function kind, so human work, review and licensed sign-off are designed in.
| Family | What it gives every product |
|---|---|
| Cases | A work Thing as a graph of steps with declared ends: intake, a conflict check, a quote, the steps, delivery and acceptance |
| Tasks and queues | A human step raises a task in its Role's queue, routed by skill and credential. A task is claimed under a lease, handed off with its context, and escalated when its clock runs out |
| Staffing and escalation | Each step names a Function kind and a fallback. A step moves from agent to person behind the same Verb and price, and back when the agent earns it |
| Review | Adversarial ("harden it"), affirmative ("yes, and"), recursive, sampled and four-eyes review, each a step kind; moderation of what members post is the same step. The doer is never the checker |
| Assurance grades | Seven grades, weakest first: declared, estimated, sampled, graded, attested, measured, confirmed. Each check earns a grade, and an Offer sells one |
| Licensed supervision | Credentialed Roles, sign-off as an act reserved to them, supervision ratios and an oversight record; privilege classes, ethical walls, retention and legal hold |
| Delivery and acceptance | A delivery carries its evidence. An acceptor accepts within a window, a rejection gets its remedy, and a dispute runs on one path |
| Agents inside the product | An agent per Customer, with tools drawn from the Verbs, its own memory and skills, and spend brakes. Leases hold its work, and its record shows what it did |
| Supply | Workers and suppliers join, are verified and matched, and hold capacity and a track record; a firm brings its own members. A Marketplace's suppliers use the same family |
| Booking and orders | Calendars, availability, holds, waitlists and no-show fees; orders with inventory holds, shipment and returns |
A grade caps how the Offer may price. An output price needs at least graded. An outcome price needs the outcome measured or confirmed, by the acceptor, an evaluator or an outside oracle.
Lifecycles and states
| Thing | States | What moves it |
|---|---|---|
| A case | opened, screened, quoted, then its own seen states, delivered, accepted, closed; or declined, rejected, remedied, disputed | The buyer's Verbs, the conflict check, the steps, and the acceptance clock |
| A task | open, claimed, done; or released, escalated, expired | A worker's claim and completion, a lease that lapses, a clock that runs out |
| A review | requested, passed; or changes_asked, revised, then requested again | The checker's verdict; recursive review loops until it passes or escalates |
| A sign-off | awaiting, then signed or refused | A holder of the credentialed Role; a refusal sends the step back |
| An agent's run | working, braked, then working again on approval; or lease_lapsed, reassigned | A brake it hits, the person its mandate names, a lease that runs out |
| A booking | held, confirmed, then attended, no_show or cancelled | The buyer's Verbs, the calendar's clock, and the rule that charges a no-show fee |
| An order | placed, claimed, filled, then accepted, contested or returned | The supplier's claim and fill, the rematch clock, and the buyer's acceptance |
| A delivery | sent, in_window, then accepted, rejected or lapsed | The acceptor, or the window's clock; the Outcome contract says what a lapse does |
| A dispute | opened, answered, resolved | Either party, with the receipt and the delivery's evidence |
Seen is a state and unseen is a step. The Filing's ordered, drafting, drafted, signed, filing, filed and accepted are what the buyer watches; the review and the paralegal's check inside drafting stay private.
What you declare, what the platform does
| You declare | The platform does |
|---|---|
| The work Noun and its seen states | Serves each state as the buyer's view, and each move as a Verb on every Interface |
| Steps, each with a Function kind, a Role and a fallback | Raises tasks, routes them by Role, skill and credential, and escalates on a failed check |
| A review pattern on a step | Assigns a checker who is not the doer, runs rounds until a pass or an escalation, and keeps each verdict |
| The grade an Offer sells | Computes the grade the path earns, and refuses a deploy whose price or remedy needs more |
| A floor: none, a signature, or a licensed practice | Reserves the act to a credentialed Role, holds the supervision ratio, and writes the oversight record |
| An Outcome contract: done, acceptor, window, remedy | Charges on acceptance, runs the window, applies the remedy, and opens the dispute path |
| A brake on an agent | Stops the agent at it, asks the person its mandate names, and resumes on approval |
| A calendar, a hold window and a no-show fee | Offers the free times, holds a slot, confirms it, and charges the fee under the published rule |
| Nothing else | Leases, handoff packets, queues, clocks, evidence, and the check that every step can be staffed |
Example
The Filing, with an adversarial review and a supervised check, sold at the measured grade: the Customer's acceptance measures each outcome.
import { define, workflow, agentic } from 'apis.dev'
/** Each Customer's annual report, drafted, hardened, checked, signed and filed, charged once when accepted. */
export default define({
name: 'filings', domain: 'filings.apis.dev',
…
Filing: { // the case your buyer watches
company: 'string', year: 'number',
status: {
order: [],
draft: { in: 'ordered', run: workflow(async ($, filing) => {
const { form } = await $.generative('Draft the annual report for {company}', filing,
{ returns: { form: 'string' } })
await $.review(form, { pattern: 'adversarial' }) // an agent tries to break it
await $.human('Check the draft', { form },
{ role: 'paralegal', supervisor: 'attorney' }) // attests the draft
return { form }
}) },
sign: 'drafted', // seen: the Customer's turn
file: { in: 'signed', run: agentic('File the signed report with the state') },
accept: 'filed', reject: 'filed', // the Customer accepts, or it is redone
},
},
on: { 'Filing.ordered': 'Filing.draft', 'Filing.signed': 'Filing.file' },
offer: {
'Filing.order': { price: 25, when: 'accepted', accept: 'customer',
acceptWithin: '7d', remedy: 'redo', grade: 'measured' },
},
})Deploy refuses the file if no one holds paralegal, or if no attorney can supervise the paralegals it has. A rejected filing is redone at no charge.
Contracts with the other subsystems
Work proposes, and the Runtime's gate commits. Nothing a worker does reaches the record, the bill or the buyer except through a Verb.
| Subsystem | What Work takes from it | What Work gives it |
|---|---|---|
| Definition and compile | The case graph, staffing, grades and floors, checked at deploy | The roster and the grade each path earns, which the staffing and economic checks read |
| Identity, access and policy | Roles, credentials, acts reserved to licensed people, mandates for agents, single-use links, shared-case grants | Who claimed, reviewed, supervised or signed each step |
| Model and records | Case files, privilege classes, retention and legal hold on records | Comments, assignments and evidence attached to the case's records |
| Data and Sources | Outside submissions and their typed acknowledgements, such as a government office's receipt | Corrections to Source data, reviewed before they apply |
| Runtime | Steps, clocks, waits and the gate | Tasks a $.human step raises; every verdict and sign-off as an Event |
| Commerce | The Outcome contract on the Offer; client funds held until acceptance | The acceptance that charges; the remedy that refunds or credits; each worker's or supplier's share |
| Interfaces and distribution | One conversation per case; the client and delivery contracts that UIs render | The case's state, its allowed moves and who holds the ball, for any principal |
| Trust and operations | Brakes, evals, and the outside check of each grade | The supervision record, review evidence and traces of every agent's run |
What Customers and their agents meet
- The case, not the work. The buyer watches seen states move. The steps, reviews and checks inside them stay private.
- Their turn is a Verb. Approve the quote, sign, accept or reject, through the API, MCP, the SDK or the CLI.
- A grade before they order. The offer card prints the grade, and each delivery carries the evidence of the review that earned it.
- One charge, once. The fee is charged on the move the Outcome contract names; a rejection gets its remedy at no charge.
- An agent as client. An agent files the matter, approves the quote, accepts or contests, and pays. The one act the law reserves for a person goes to that person by a single-use link.
- A worker's shift. A worker claims a task, completes it or hands it off through the API, so a delivery UI never invents state.
- One dispute path. A dispute carries the receipt and the delivery's evidence, and its answer is an Event.
Every step names its worker, its checker and its grade, so a Service API is a promise the platform can keep.