What the buyer sets, and what only the client sets

The running jobjob_7Hq2 · working · $49.00 held

policy declares what an order may set, each value with a default and bounds. Mechanics are the buyer's; merits are the client's alone; the rest is the house's.

policy answers one question: what may an order change about how the work runs, and who may change it?

services/checked-translation.ts
  policy: {
    match: { word: 'number', default: 0, min: 0, max: 1, binds: 'merits', note: 'the least back-translation match the client accepts' },
    turnaround: { word: 'number', default: 2, min: 1, max: 10, note: 'days the work may take' },
  },

On the Service

KeyWrittenLeft outDoes
policy{ <name>: PolicyEntry }noneWhat an order may set, within your bounds: the buyer's mechanics, and the merits only the client sets.

Each entry

KeyWrittenLeft outDoes
wordWordrequiredIts type word, the same words input uses.
defaultunknown | ((job) => unknown)requiredThe value when the order leaves it out: a value, or a function of the order's input, as a stall defaults to 7 days on a consumer deal and 14 otherwise.
minnumbernoneFor a number: the least an order may set.
maxnumbernoneFor a number: the most an order may set.
notestringnoneWhat it means, as the manifest carries it.
binds'mechanics' | 'merits'none'mechanics' (default): how the work runs, the buyer's. 'merits': what the client decides about their own work, theirs alone.
set_by'buyer' | 'client' | 'tenant'the buyer for mechanics; always the client for meritsWho may set it.

An order sends policy beside its input. One that breaks a bound hears every violation in one answer, with next.fill naming each field to fix:

Call
→ POST /checked-translation {"document":"manual.pdf","to":"de","policy":{"match":1.5,"turnaround":"fast"},"max_usd":79,"key":"bad"}
422 · magic values: none
{
  "type": "BLOCKED",
  "category": "invalid_request",
  "code": "policy_invalid",
  "reason": "The policy breaks 2 bounds: match must be at most 1; turnaround must be a number.",
  "param": "policy",
  "next": {
    "do": "order",
    "service": "checked-translation",
    "arguments": {
      "document": {
        "url": "data:text/plain,The%20manual.pdf%2C%20as%20the%20buyer%20sent%20it.",
        "name": "manual.pdf"
      },
      "to": "de",
      "policy": {
        "match": null,
        "turnaround": null
      },
      "max_usd": 79,

next is the same order with each bad value set to null, and fill names them, so an agent fixes the two fields and sends it again.

A good one resolves, every default filled, and every step, guard and signal reads it as job.policy:

Call
→ POST /checked-translation {"document":"manual.pdf","to":"de","policy":{"turnaround":3},"max_usd":79,"key":"set"}
magic values: none
← job_7Hq2 · waiting · on person · $79.00 held
  policy  {"match":0,"turnaround":3}

binds: 'mechanics', the default, is how the work runs: a turnaround, a cap, a timeout. The buyer sets it.

binds: 'merits' is what the client decides about their own work: here, the least match they accept. Only the client sets it. When the buyer orders for themselves, the buyer is the client; when a buyer orders for a separate client, only that client sets it. The brand can't set a merits value either:

Call
→ POST /owner/jobs/job_7Hq2/policy {"policy":{"match":0.7}}
403 · magic values: none
  "code": "merits_not_yours",
  "reason": "match binds the merits, and only the client sets them.",

Parameters are the buyer's, merits are the client's, and semantics are the house's: the ends, the gate and when money moves are never set per order.

POST /jobs/:id/policy changes values on a running job, within the same bounds, and records policy.set. The buyer moves a mechanics value; a merits value still answers merits_not_yours to anyone but the client. An ended job takes no more changes.

Call
→ POST /jobs/job_7Hq2/policy {"policy":{"turnaround":5}}
200 · job_7Hq2 · waiting · on person · $79.00 held · magic values: none
  policy  {"match":0,"turnaround":5}
OpAPICLIMCPSDKSiteDocsApp
service.orderPOST /jobs, POST /:service<service> k=v …order_<service><service>.order()/<service>: the order form10 error pagescustomer portal
job.policyPOST /jobs/:id/policy, POST /owner/jobs/:id/policyjobs set-policy <job> k=v …set_job_policyjobs.setPolicy()4 error pagescustomer portal, owner console

Events: policy.set.

Operations has every column of every row.

CodeCategoryHTTPWhy
job_endedconflict409The job has ended, for good.
policy_invalidinvalid_request422A policy value is out of bounds; the reason lists each.
merits_not_yoursblocked403Only the client sets the merits.

The lines that use it in the example brands, as their files write them, and what check read aloud for each file.

legal · services/demand-letter.ts · 26 lines
  policy: { floor: { word: 'money', default: 0, binds: 'merits', note: 'the least you will settle for: your default answer to an offer; only you set it' } },
npx services.dev check · captured/legal-walk.txt
services/demand-letter.ts · 26 lines · $149 per job, within 48 hours, charged on send's receipt.
  steps   consent · client · consent → draft · ai → attack · ai · adversarial · 3 lenses → sign · attorney · client · stamped · 2-item checklist → send · the recipient → courier · a courier · routed → reply · ai → settle · client · decide

The legal example runs every one of its files, captured.

sales · services/deal.ts · 42 lines
  policy: {
    floor: { word: 'number', default: 0.8, min: 0.1, max: 1, binds: 'merits', note: 'the least share of list a close may take' },
    humans_from: { word: 'money', default: 50_000, note: 'a closer takes deals at or above this value' },
    setter: { word: ['ai', 'on_warm', 'person'], default: 'on_warm', note: 'who books the meeting' },
    stall_days: { word: 'number', default: job => (job.input.motion === 'B2C' ? 7 : 14), min: 3, max: 90 },
  },
npx services.dev check · captured/sales-check.txt
services/deal.ts · 42 lines · nothing on effort; 5% of closed_value at won, proven by the account's payment, held 60 days by bank, 120 by card.
  policy  floor · merits, the seller's alone · 0.8 of value · 0.1 to 1
          humans_from · mechanics · $50,000
          setter · mechanics · on_warm · ai, on_warm or person
          stall_days · mechanics · 14, or 7 for B2C · 3 to 90

The sales example runs every one of its files.