{
 "version": 1,
 "operations": [
  {
   "method": "POST",
   "path": "/runs",
   "role": "member",
   "summary": "Begin a run, and say so before doing any of it. The row exists from this moment, which is what makes a run that is still happening — or one whose process died holding it — something you can see.",
   "body": {
    "kind": "what sort of work this is",
    "label": "what it is about, for a person reading a list",
    "self": "the handle of the self doing it",
    "parent": "the run that asked, when this is part of a swarm"
   }
  },
  {
   "method": "POST",
   "path": "/runs/:id/steps",
   "role": "member",
   "summary": "Append a step. Send the frame you are already streaming: its type, its step name and its rawEvent. The same rows are what a watcher reads and what an auditor reads.",
   "body": {
    "type": "the event type, e.g. StepStarted",
    "name": "the step name, e.g. recall",
    "data": "the rawEvent",
    "cost": "what THIS run spent — never what its children spent, so a total is a sum"
   }
  },
  {
   "method": "POST",
   "path": "/runs/:id/finish",
   "role": "member",
   "summary": "End a run. Appends the closing step and stops the heartbeat mattering.",
   "body": {
    "ok": "false if it failed",
    "why": "what went wrong, when it did"
   }
  },
  {
   "method": "GET",
   "path": "/runs",
   "role": "member",
   "summary": "Runs that are still open, oldest sign of life first. A run whose process died is one that is still open with a heartbeat that stopped — which is the thing a span cannot tell you.",
   "query": {
    "stale": "seconds without a step before a run is called stale; default 900"
   }
  },
  {
   "method": "GET",
   "path": "/runs/:id",
   "role": "member",
   "summary": "One run, everything it started, and its steps from the beginning. The same rows a live watcher is reading."
  },
  {
   "method": "GET",
   "path": "/runs/:id/steps",
   "role": "member",
   "summary": "Steps after a sequence number. Watching live is asking with the last seq you saw; replaying is asking with 0.",
   "query": {
    "after": "the last seq you have",
    "limit": "how many at most; default 500"
   }
  },
  {
   "method": "GET",
   "path": "/people/:key/memories",
   "role": "member",
   "summary": "What this person of yours has said is true of them, in the scope you ask for. General memories (no scope) come back everywhere.",
   "query": {
    "scope": "your own word for the part of your product this call is in",
    "project": "your project id, when the call is inside one",
    "history": "1 to include memories that have been superseded"
   }
  },
  {
   "method": "POST",
   "path": "/people/:key/memories",
   "role": "member",
   "summary": "Keep something this person said. A restatement of something already held writes nothing and names what it matched.",
   "body": {
    "text": "their words, kept verbatim",
    "scope": "leave out for a memory true of them everywhere",
    "project": "your project id",
    "source": "stated|agreed|observed",
    "corrects": "the id of the memory this replaces; its validity is closed rather than overwritten",
    "label": "a name for the person, stored once",
    "valid_from": "optional ISO date or time when the fact began to hold (added in contract version 1, additive; returned as heldFrom)",
    "valid_to": "optional ISO date or time when it stopped holding (heldTo)"
   }
  },
  {
   "method": "DELETE",
   "path": "/people/:key/memories/:id",
   "role": "member",
   "summary": "Forget one. The row is removed, not flagged, and what was removed comes back."
  },
  {
   "method": "GET",
   "path": "/selves",
   "role": "member",
   "summary": "The tenant's selves with counts of what they hold. A key scoped to one subject lists that subject's selves only (added in contract version 1, additive).",
   "query": {
    "subject": "only the selves belonging to this user of yours",
    "kind": "only selves of this kind (self, person, place, thing, or one of the tenant's identityKinds); added in contract version 1, additive"
   }
  },
  {
   "method": "POST",
   "path": "/selves",
   "role": "admin",
   "summary": "Give birth to a self. Fails if the handle exists.",
   "body": {
    "kind": "what the self stands for: self (default), person, place, thing, or one of the tenant's identityKinds; listed and counted apart (GET /selves?kind=, GET /selves/aggregate); added in contract version 1, additive",
    "character": "optional {personality: Big Five 0..1 | genome: {effectsSeed, seed}, axes?: {stance: -1..1}, tastes?: {taste: -1..1}, bands?: {trait: 0..1, how far it may sit from the set point}, pinned?: [taste or stance names held where they are set]}: who it is beneath its charter; bands and pinned are a role's limits, kept whatever it lives through",
    "procedure": "optional: how it works at birth",
    "handle": "lowercase id",
    "name": "what people call it",
    "charter": "{purpose, answersTo?, authority?: {reach?: source ids}, reviewBy?}",
    "persona": "{default?, surfaces?}",
    "interests": "string[]",
    "routine": "{mode?: scheduled|on-activity, read?, reflect?, reflectAfter?, maxCalls?, maxTokens?}",
    "identity": "[{kind, key, value}]",
    "seed": "{story?, lessons?: [{claim, appliesWhen?, surfaces?}]}",
    "subject": "the user of yours it belongs to",
    "program": "its own instructions per step, after the tenant's",
    "orient": "false to skip orientation (bulk births)",
    "status": "active|paused"
   }
  },
  {
   "method": "PUT",
   "path": "/selves/:handle",
   "role": "admin",
   "summary": "Declare a self: born if absent; otherwise what a person sets (name, charter, persona, routine, interests) is brought in line. Identity and history are never overwritten.",
   "body": {
    "kind": "what the self stands for: self (default), person, place, thing, or one of the tenant's identityKinds; listed and counted apart (GET /selves?kind=, GET /selves/aggregate); added in contract version 1, additive",
    "...": "as POST /selves, without handle"
   }
  },
  {
   "method": "GET",
   "path": "/selves/:handle",
   "role": "member",
   "summary": "A self in full: identity, lessons as the core holds them, its procedure and trials, the faults it carries, what is true now, recent episodes, proposals, usage, jobs, outcomes, record integrity, and life: the persona linked to it, the newest world it lives in and its member there (null when it lives in none)."
  },
  {
   "method": "PATCH",
   "path": "/selves/:handle",
   "role": "admin",
   "summary": "Change what a person sets. status is active, paused or retired: retired is terminal (added in contract version 1, additive): the self keeps its record and reads as before, every write to it is refused with 409, no routine or work runs for it, and nothing brings it back; erase it with POST /selves/:handle/erasure.",
   "body": {
    "name": "",
    "handle": "a new handle; the self keeps its whole life",
    "charter": "",
    "persona": "",
    "routine": "",
    "interests": "",
    "program": "",
    "status": "active|paused"
   }
  },
  {
   "method": "GET",
   "path": "/selves/:handle/procedure",
   "role": "member",
   "summary": "How this self does the work: the adopted text, every candidate on trial with the gate's reading of it, and every version with the diff and the items that decided it."
  },
  {
   "method": "PUT",
   "path": "/selves/:handle/procedure",
   "role": "admin",
   "summary": "Write the procedure yourself. Ends any trial; recorded as authority, never as evidence.",
   "body": {
    "text": "how this self should do the work",
    "why": "optional reason"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/procedure/revert",
   "role": "admin",
   "summary": "Go back to an earlier procedure.",
   "body": {
    "version": "which version",
    "why": "optional reason"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/intake",
   "role": "member",
   "summary": "What a self with a character takes in: news, posts, conversations, literature, media, experiences, meals, purchases. Moves its stances, tastes, temperament, affect and capacities as its personality lets it; never how it works.",
   "body": {
    "items": "[{kind, source, stance?: {axis: -1..1}, intensity?: 0..1, arousal?: 0..1, valence?: -1..1, demand?: 0..1, taste?: {name: -1..1}, body?: {nutrition?, rest?, strain?}}]"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/settle",
   "role": "member",
   "summary": "The world settled something a stance bears on: the stance is pulled toward it and sources that pushed the other way lose trust. Grounding, kept apart from drift.",
   "body": {
    "axis": "the stance",
    "truth": "where the outcome sits, -1..1",
    "outcome": "what settled it",
    "weight": "optional 0..2"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/character/event",
   "role": "admin",
   "summary": "A life event moves temperament directly, scaled by the self's sensitivity; part of it fades back toward its set point.",
   "body": {
    "name": "the event",
    "delta": "{openness?, conscientiousness?, extraversion?, agreeableness?, neuroticism?}, each within ±0.3"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/identity",
   "role": "admin",
   "summary": "A person sets or removes one identity row directly.",
   "body": {
    "kind": "value|trait|commitment|taste|voice|expertise|relationship",
    "key": "",
    "value": "null removes"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/context",
   "role": "member",
   "summary": "The self's context for one call on one surface, and a ticket for its work and outcome. The answer also carries `parts` (added in contract version 1, additive; the preamble string is unchanged): { identity, life, procedure, lessons, reading, person, notice } as separate strings, each null when that part is not in the preamble.",
   "body": {
    "surface": "where it is being asked",
    "task": "what it is being asked",
    "item": "the item this work is on, in your own terms; a trial pairs on it (default: the ticket)",
    "taskClass": "the kind of task; faults are kept per class (default: default)",
    "interactive": "false for background calls",
    "person": "your own identifier for the person this turn is for; the self is told what they have said is true of them",
    "personLabel": "a name for that person, stored once",
    "personScope": "your word for the part of your product this call is in",
    "personProject": "your project id, when the call is inside one"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/run",
   "role": "admin",
   "summary": "Queue a routine step now.",
   "body": {
    "job": "orient|read|reflect|dream|battery|maintain|fetch"
   }
  },
  {
   "method": "GET",
   "path": "/selves/:handle/export",
   "role": "member",
   "summary": "Identity, lessons and the whole hash-chained record, without authority."
  },
  {
   "method": "POST",
   "path": "/selves/:handle/erasure",
   "role": "admin",
   "summary": "Erase one self of this tenant and its whole record, for good. Dry run by default: it returns what would go (rows per table, the record's length and head hash) and writes nothing. A real erasure needs dry_run false and confirm equal to the handle; it removes the self, its identity, record, lessons, tickets, proposals, jobs, usage, work, residence, passages, the events that name it, the runs it made with their steps and the personas linked to it, and writes a receipt (counts and hashes, the handle only as a hash) into the tenant's erasure chain. A member key is refused; another tenant's self is never found. Added in contract version 1, additive.",
   "body": {
    "dry_run": "true (default) | false",
    "confirm": "the handle, for a real erasure",
    "blank_worlds": "true to clear the words and memories of the self's linked personas from the worlds they lived in, in the same erasure; the dry run lists those worlds as worlds_holding_words (added in contract version 1, additive)"
   }
  },
  {
   "method": "POST",
   "path": "/tenant/export",
   "role": "admin",
   "summary": "Export this tenant's own selves as one bundle (format living-worlds.tenant/1: each self as the self export gives it, with its whole hash-chained record, no authority). Dry run by default: counts only. A real export writes a receipt (counts, the bundle's hash) into the tenant's erasure chain. A member key is refused. Added in contract version 1, additive.",
   "body": {
    "dry_run": "true (default) | false"
   }
  },
  {
   "method": "GET",
   "path": "/tenant/erasures",
   "role": "admin",
   "summary": "The tenant's erasure chain, oldest first: every erasure and export receipt with its hash link, and broken_at (null when the chain verifies). Added in contract version 1, additive."
  },
  {
   "method": "POST",
   "path": "/selves/:handle/memory/retract",
   "role": "member",
   "summary": "Retract something in a self's OWN memory that was recorded wrongly (an episode a product sent, a fact or a note). Name it by seq, by ref (the source reference sent as refs.ref) or by text (its brief, exactly), and say why. The record is a hash chain and is never edited: the episode is left out of reading (archived) and a new entry in the chain says what was retracted, why and by whom. Retracting what is already retracted writes a second entry and reports it under already. The birth episode cannot be retracted. A lesson drawn from an episode is doubted through POST /lessons/:id/contest. Added in contract version 1, additive.",
   "body": {
    "reason": "why (required, kept in the record)",
    "seq": "the episode's sequence number",
    "ref": "its source reference (refs.ref)",
    "text": "its brief, exactly",
    "type": "narrow to this episode type"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/memory/supersede",
   "role": "member",
   "summary": "Replace something in a self's own memory: the same as retract, and a new episode in its place that names what it supersedes (refs.supersedes) and the retraction entry (refs.retraction). The replacement has the type of what it replaces unless it gives one. Added in contract version 1, additive.",
   "body": {
    "reason": "why (required)",
    "seq": "the episode's sequence number",
    "ref": "its source reference (refs.ref)",
    "text": "its brief, exactly",
    "replacement": "{ brief, type?, thought?, importance?, refs? }"
   }
  },
  {
   "method": "GET",
   "path": "/selves/:handle/record",
   "role": "member",
   "summary": "The self's record, in order, a page at a time: every episode and decision as a hash-chained entry.",
   "query": {
    "after": "the last seq you hold (default: from the start)",
    "limit": "up to 1000 (default 200)",
    "type": "only entries of this type or its family, e.g. practice or belief.moved"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/episodes",
   "role": "member",
   "summary": "Record something that happened to a self in your product, in your own type (a session kept, a lived day, a sale). It reflects on it like anything else.",
   "body": {
    "type": "your own lowercase name, e.g. session.kept",
    "brief": "what happened",
    "thought": "optional",
    "refs": "optional object",
    "surface": "optional",
    "importance": "0..1",
    "idempotency_key": "optional (or the Idempotency-Key header): the same key for the same self records nothing the second time and answers the first call's seq with replayed true; the same key with a different episode is 409 (added in contract version 1, additive)"
   }
  },
  {
   "method": "POST",
   "path": "/lessons/:id/contest",
   "role": "member",
   "summary": "A person doubts a lesson; it returns to being a hunch.",
   "body": {
    "by": "who",
    "why": "optional reason"
   }
  },
  {
   "method": "POST",
   "path": "/tickets/:id/work",
   "role": "member",
   "summary": "What was done with a context.",
   "body": {
    "brief": "what was asked and answered",
    "thought": "optional"
   }
  },
  {
   "method": "POST",
   "path": "/tickets/:id/outcome",
   "role": "member",
   "summary": "How it went, credited to the lessons served on the ticket. A person's verdict is a signal; what the world later did is happened. Both move belief, never practice. A check sent here is read as an outcome: only a registered checker, at POST /checks, can move how a self works.",
   "body": {
    "signal": "a person's verdict, -1..1",
    "happened": "what the world did: 1 or 0",
    "label": "useful, not useful, used...",
    "detail": "optional reason",
    "by": "who",
    "check": "optional {name, ran?, passed}: read as happened = passed"
   }
  },
  {
   "method": "POST",
   "path": "/tickets/:id/links",
   "role": "member",
   "summary": "Link a ticket (the answer a self gave) to what the answer cited: a simulation, run, world, design or population, by its id. Repeating a link changes nothing. A later outcome on the ticket then scores the thing (GET /links/:kind/:ref/scores).",
   "body": {
    "kind": "simulation|run|world|design|population",
    "ref": "the id of the thing"
   }
  },
  {
   "method": "GET",
   "path": "/links/:kind/:ref/scores",
   "role": "member",
   "summary": "Every ticket linked to a thing with the outcomes recorded against it, each with its time, and how many of them said it happened. Several outcomes per ticket, at different times, are normal: the decision first, what happened later."
  },
  {
   "method": "GET",
   "path": "/selves/:handle/recommendations",
   "role": "member",
   "summary": "A self's past recommendations (its tickets), newest first, each with its work, what it cited, and every outcome with its time, a verdict (signal) or what the world did (happened). A page at a time.",
   "query": {
    "limit": "1..100, default 20",
    "after": "the next_cursor of the last page",
    "surface": "only tickets of this surface"
   }
  },
  {
   "method": "GET",
   "path": "/checkers",
   "role": "member",
   "summary": "The instruments registered in this project: the only things that can mint a check."
  },
  {
   "method": "POST",
   "path": "/checkers",
   "role": "admin",
   "summary": "Register an instrument. Its key is shown once; verdicts sent with it are minted as checks, the only evidence that can change how a self works.",
   "body": {
    "id": "lowercase id",
    "name": "what the check is, e.g. npm test",
    "authoredBy": "who wrote its criteria; a check whose criteria a self wrote never moves that self's practice"
   }
  },
  {
   "method": "POST",
   "path": "/checkers/:id/revoke",
   "role": "admin",
   "summary": "Revoke an instrument's key. Checks it already minted stand in the record."
  },
  {
   "method": "POST",
   "path": "/checks",
   "role": "checker",
   "summary": "A checker's verdicts on a self's work, with the checker's own key. They close one episode: belief and the fault ledger read them, and a trial's gate when they are for one of its arms.",
   "body": {
    "self": "the self's handle (or ticket)",
    "ticket": "the ticket the work was done on; item, task class and version come from it",
    "taskClass": "the kind of task",
    "episode": "optional id for the episode these close",
    "results": "[{item, passed, ran?: complete|partial|inflight|never, ground?: what failed against what, detail?, practice?: the version that did the work}]"
   }
  },
  {
   "method": "POST",
   "path": "/observations",
   "role": "member",
   "summary": "Push what happened in your own systems. It is read as from inside the organisation.",
   "body": {
    "source": "id",
    "items": "[{title, body?, url?, publishedAt?}]",
    "audience": "handles, or empty for all",
    "trust": "0..1"
   }
  },
  {
   "method": "GET",
   "path": "/observations",
   "role": "member",
   "summary": "Recent observations, quarantined ones marked.",
   "query": {
    "limit": "1..200"
   }
  },
  {
   "method": "GET",
   "path": "/sources",
   "role": "member",
   "summary": "The tenant's sources and their last read."
  },
  {
   "method": "PUT",
   "path": "/sources/:id",
   "role": "admin",
   "summary": "Declare a source.",
   "body": {
    "kind": "feed|brave-news|brave-web|mcp|http",
    "label": "",
    "config": "connector settings; secrets by env or file name only",
    "channel": "news|social|trade|own",
    "lineage": "internal|external",
    "trust": "0..1",
    "scheduled": "bool",
    "audience": "handles",
    "every_minutes": ">=15"
   }
  },
  {
   "method": "GET",
   "path": "/proposals",
   "role": "member",
   "summary": "Suggested changes.",
   "query": {
    "status": "open|approved|rejected|superseded|all"
   }
  },
  {
   "method": "POST",
   "path": "/proposals/:id",
   "role": "admin",
   "summary": "Accept or decline a suggested change.",
   "body": {
    "decision": "approved|rejected",
    "by": "who"
   }
  },
  {
   "method": "GET",
   "path": "/events",
   "role": "member",
   "summary": "What happened, in order, after an id.",
   "query": {
    "after": "last id seen",
    "limit": "1..500"
   }
  },
  {
   "method": "GET",
   "path": "/swarms",
   "role": "member",
   "summary": "The tenant's swarms: its designs whose members are selves, with members, process, protocol and last run."
  },
  {
   "method": "PUT",
   "path": "/swarms/:id",
   "role": "admin",
   "summary": "Declare a swarm and its members (replaces membership): the next version of the design of selves called :id, keeping its process and protocol.",
   "body": {
    "name": "",
    "purpose": "",
    "members": "[{handle, weight?, role?}]"
   }
  },
  {
   "method": "GET",
   "path": "/swarms/:id",
   "role": "member",
   "summary": "A swarm (its design's latest version), its members and recent runs, each with its round."
  },
  {
   "method": "POST",
   "path": "/swarms/:id/runs",
   "role": "member",
   "summary": "Put one question to every member: a run of the swarm's design. Rounds (delphi, debate, critique-revise) follow on by themselves.",
   "body": {
    "question": "",
    "choices": "optional 2..8 strings",
    "brief": "optional background",
    "requestedBy": "who"
   }
  },
  {
   "method": "GET",
   "path": "/swarm-runs/:id",
   "role": "member",
   "summary": "A run: answers so far, tally (combined by the design's protocol), status, each answer's ticket, and the chain of rounds it belongs to."
  },
  {
   "method": "POST",
   "path": "/swarm-runs/:id/decide",
   "role": "member",
   "summary": "The principal picks: every member that chose is rated on whether its calls match the principal's. Moves belief, never practice.",
   "body": {
    "pick": "index of the chosen choice, from 0",
    "by": "who decided (default: the key's label)"
   }
  },
  {
   "method": "POST",
   "path": "/swarm-runs/:id/result",
   "role": "checker",
   "summary": "What the world chose, measured by a registered checker: one check per member that chose, on the run as the item (the only settlement that reaches a member's practice), and an outcome for the lessons its ticket served.",
   "body": {
    "pick": "index of what the world chose, from 0",
    "taskClass": "optional (default swarm:<id>)",
    "ground": "a short stable label for what measured it, e.g. crowd-meter; recurring failures are grouped by it",
    "detail": "optional narrative"
   }
  },
  {
   "method": "GET",
   "path": "/designs",
   "role": "member",
   "summary": "Swarm designs: the platform's templates (read-only: audience-test, ab-test, panel-delphi, diffusion) and the tenant's own, latest version of each.",
   "query": {
    "who": "population | personas | selves",
    "status": "active | retired | template"
   }
  },
  {
   "method": "GET",
   "path": "/designs/:key",
   "role": "member",
   "summary": "A design at a version (?version=, default latest), its versions and its recent runs."
  },
  {
   "method": "PUT",
   "path": "/designs/:key",
   "role": "admin",
   "summary": "Save a design's next version (unchanged writes nothing), validated against its pack or its selves. Template keys are refused: start from one with from.",
   "body": {
    "name": "",
    "purpose": "",
    "from": "a template or design key to start from (spec fields given override it)",
    "status": "active | retired",
    "spec": "{who: {population: {pack, simulate, represents?, seed?, segments?, rake?} | personas: {pack, where?, limit?} | selves: [{handle, weight?, role?}], tiers?: {voiced?, surrogate?}}, structure?: {mixing?, graph?, homophily?, stubbornness?, seeding?: {share, who?}}, process?: {kind: one-off|rounds|debate|delphi (living: not yet), rounds?}, protocol?: {kind: ssr|stance-dist (populations) | vote|consensus|stance-dist|critique-revise (selves), threshold?}, time?: {step, horizon, report_every?, scale?, reference_date?}, stimulus?, variants?, ab?, measures?, voice?, dynamics?, observe?: {tool, args?, members?, max?}, calibration?: {targets: [{measure?, metric, target, tolerance?}]}, seeds?}"
   }
  },
  {
   "method": "POST",
   "path": "/designs/:key/runs",
   "role": "member",
   "summary": "Run a design. Selves: a swarm run (any key). Population or personas: a simulation run in /sim/runs (admin key), or one per variant on the same seeds with a compare link.",
   "body": {
    "stimulus": "{text, kind?} (or the design's own)",
    "variants": "[{label, text}] 2..3",
    "seed": "override the population's seed",
    "reference_date": "YYYY-MM-DD",
    "hold": "true: wait for observations, then release",
    "version": "run an earlier version",
    "question": "selves: the question",
    "choices": "selves: 2..8",
    "brief": "selves: background"
   }
  },
  {
   "method": "POST",
   "path": "/designs/:key/ask",
   "role": "member",
   "summary": "Bulk ask: one question to n members in one call. Selves: a weighted sample, each answer weighted by what it stands for. Population or personas (admin key): n voiced members, evenly or a weighted stratum sample, rated against the choices; partial results stream in the run's progress and sim.progress events.",
   "body": {
    "question": "",
    "choices": "optional 2..11 strings",
    "n": "1..500",
    "strata": "[category dimensions or \"segment\"]",
    "seed": "",
    "brief": "selves: background"
   }
  },
  {
   "method": "PATCH",
   "path": "/tenant",
   "role": "admin",
   "summary": "Tenant settings.",
   "body": {
    "contentPolicy": "{minors: allow|refuse, real_persons: refuse|consented_only, deceased: allow|refuse, restricted: [words]} or null: what personas and days of this project may describe (added in contract version 1, additive); with none set, minors and deceased persons are allowed and a real person always needs consent_ref",
    "budgets": "{self?: {day?, life?}, world?: {life?}, run?: {life?}} of ceilings by meter, or null to clear (added in contract version 1, additive; see the note budgets): self meters calls, tokens_in, tokens_out, seconds; world meter ticks; run meter any cost key a run is charged under; none set means no ceiling",
    "models": "{chat?: {rungs?: [rung names], model?, effort?}, voice?: {rungs?, model?, effort?} (what voices population members; chat when unset), embed?: {rung?, model?}} or null: which of this core's rungs and models answer this tenant; never a URL or key",
    "timezone": "IANA",
    "vocabulary": "{organisation: how your selves refer to you, e.g. the house}",
    "program": "{orient|read|reflect|context|swarm: {instruction}}: your own logic for each step",
    "policy": "{ratersToPromote, retireAfter, recordBudget, recordsConfirm (its own records confirm lessons), confirmGraceDays, heldBudget, candidateBudget, perPersonCap, procedureTrials, procedureBudget}",
    "identityKinds": "your own identity kinds beyond the core's",
    "battery": "{version, items}",
    "dailyCalls": "tenant-wide ceiling",
    "webhook": "{url, handles?, kinds?} to set (secret returned once; see the webhooks note) or null to remove",
    "tools": "{mcp_url, auth: {tokenEnv: a variable granted to this tenant (LW_SECRET_<TENANT>_*)} | {tokenFile} | null, dialect?: standard|praecise, host?, effects?: [tool names that have effects], timeout_ms? 100..30000 (15000), max_output? 200..20000 chars (4000), budget? 1..12 calls per run (4)} or null: the tenant MCP endpoint its selves may call during work; a raw secret is refused"
   }
  },
  {
   "method": "GET",
   "path": "/tenant/tools",
   "role": "member",
   "summary": "The tenant's own tools: its endpoint setting (the credential never shown; auth.via env|file) and the tools it lists, each with effects (bool) and the selves allowed it. ?refresh=1 skips the cache."
  },
  {
   "method": "GET",
   "path": "/packs",
   "role": "member",
   "summary": "Persona packs this tenant can use: the platform's (standard; read-only) and its own, latest version of each, with what each extends."
  },
  {
   "method": "POST",
   "path": "/packs",
   "role": "admin",
   "summary": "Declare a pack of the tenant's own, or write its next version. It may extend a platform pack or one of its own (pinned to that pack's latest version). A platform pack key is refused (403): platform packs are read-only.",
   "body": {
    "key": "lower_snake",
    "label": "",
    "description": "",
    "extends": "a pack key, or null"
   }
  },
  {
   "method": "GET",
   "path": "/packs/:key",
   "role": "member",
   "summary": "A pack at a version (?version=, default latest), its versions, and every dimension it carries: its own over those it inherits, each at the pinned version."
  },
  {
   "method": "GET",
   "path": "/dimensions",
   "role": "member",
   "summary": "Declared persona dimensions, latest version of each, platform and own; ?pack= narrows to one pack."
  },
  {
   "method": "POST",
   "path": "/dimensions",
   "role": "admin",
   "summary": "Declare a dimension in one of the tenant's packs: its next version (an unchanged declaration writes nothing) and the pack's next version pinning it. Validated per type; every fault comes back at once in faults [{path, message}] (400). A dimension that plausibly duplicates an inherited one (the same key stem, e.g. age and age_band, or spec.refines naming it) is refused (409, faults at inherited.<key>) until the caller chooses: inherited: {<key>: {derive: fn}} makes the inherited dimension the pack's own, DERIVED from this one (never drawn, so members never contradict themselves), or {<key>: \"keep\"} keeps drawing both (recorded in spec.keeps). Examples per type: scalar {range: {min: 18, max: 90}, distribution: {kind: \"normal\", params: {mean: 40, sd: 12}}}; category {categories: [{label: \"north\", share: 0.4}, {label: \"south\", share: 0.6}]}; derived category {categories: [\"under 30\", \"30+\"], derived: {from: [\"age\"], fn: {kind: \"band\", of: \"age\", edges: [30], labels: [\"under 30\", \"30+\"]}}}; embedding {dims: 512}; set {items: [\"vinyl\", \"streaming\"], max_items: 2}; timeseries {of: \"number\", dynamics: {kind: \"drift\", rate: 0.01}}; edge {relation: \"friend\", structure: \"mixing_group\", homophily: [\"region\", \"age_band\"]}; event_process {process: \"poisson\", rate: {mean: 2, per: \"month\"}}.",
   "body": {
    "pack": "your pack key",
    "key": "lower_snake",
    "label": "",
    "type": "scalar | category | embedding | set | timeseries | edge | event_process",
    "inherited": "{<inherited key>: {derive: {kind: band|lookup|arith, ...}} | \"keep\"} when this key duplicates an inherited one",
    "spec": "{range: {min, max} (scalar) | categories: [label | {label, share}], open? (category) | dims: 1..4096 (embedding) | items?, max_items? (set) | of: number|category|vector|point|object, dims? (timeseries) | relation, structure: explicit|mixing_group, homophily: [dimension keys] (mixing_group edge), to?: persona|self|group (edge) | process: poisson|hawkes|scheduled|renewal, rate: {mean >= 0, per: day|week|month|year} (event_process); distribution?: {kind: normal {mean, sd} | lognormal {mu, sigma} | uniform | beta {a, b} | gamma {shape, rate} | poisson {lambda} | categorical {shares: {label: share}} | empirical | fixed | derived (with from), params, source?: {kind: research|data|hand|derived, ref}}, derived?: {from: [1..8 dimension keys], fn: {kind: band, of, edges: [ascending], labels: [edges+1]} | {kind: lookup, of, map: {value: result}, default?} | {kind: arith, op: add|sub|mul|div|min|max, args: [keys | numbers | \"$reference_year\"]}}, refines?: <inherited key>, conditional_on?: [{dimension, when?, tilt: {}}], dynamics?: static | {kind: drift, rate: <per day>} | {kind: decay, half_life_days: >0} | {kind: event, on: name | [names]}, effects?: [{measure, direction: up|down|mixed|none, strength?: 0..1}], privacy?: normal|special_aggregate_only, ui_group?: Identity|Life|Money|Taste & style|Social|Shopping|custom}"
   }
  },
  {
   "method": "GET",
   "path": "/dimensions/:pack/:key",
   "role": "member",
   "summary": "One dimension at a version (?version=, default latest) and its versions."
  },
  {
   "method": "DELETE",
   "path": "/dimensions/:pack/:key",
   "role": "admin",
   "summary": "Retire a dimension from one of your packs: the pack's next version no longer carries it. Its versions stay readable; refused while another of the pack's dimensions leans on it, or when the pack only inherits it."
  },
  {
   "method": "GET",
   "path": "/personas",
   "role": "member",
   "summary": "The tenant's personas (current versions), filtered by any dimension of a pack. Special-category values are withheld and cannot be filtered on here.",
   "query": {
    "pack": "pack key (needed to filter)",
    "where": "JSON {dimension key: value | {in: [..]} | {gte|lte|gt|lt: n} (scalars) | {has: item} (sets) | {exists: bool}}",
    "self": "voiced by this self",
    "limit": "1..1000 (100)",
    "after": "handle to page after",
    "retired": "1 to include retired"
   }
  },
  {
   "method": "POST",
   "path": "/personas",
   "role": "admin",
   "summary": "Create a persona: values validated against its pack's dimensions; about is who they are in their own words, read by the voice before their traits (a persona linked to a self speaks in the self's words and character, and its about is the story of the life the self has lived).",
   "body": {
    "real_person": "true when the persona stands for a real person (the consented route; added in contract version 1, additive)",
    "consent_ref": "the id of that person's consent record (required with real_person)",
    "likeness_allowed": "true when the person consented to their likeness being drawn",
    "deceased": "true when the person has died",
    "handle": "",
    "pack": "",
    "values": "{dimension key: value}",
    "about": "free text, at most 4000 characters",
    "grounding": "demographic | persona (default) | evidence (provenance required)",
    "provenance": "{source, ...}",
    "self": "handle of the self that voices it"
   }
  },
  {
   "method": "GET",
   "path": "/personas/aggregate",
   "role": "member",
   "summary": "Counts per group of a category, set or mixing-group dimension, with mean/min/max of a scalar measure. When a special-category dimension is involved, groups under 10 are suppressed.",
   "query": {
    "pack": "",
    "by": "dimension key",
    "measure": "scalar dimension key",
    "where": "JSON {dimension key: value | {in: [..]} | {gte|lte|gt|lt: n} (scalars) | {has: item} (sets) | {exists: bool}}"
   }
  },
  {
   "method": "GET",
   "path": "/personas/export",
   "role": "member",
   "summary": "Export a pack's personas as JSON or CSV text (special-category values withheld).",
   "query": {
    "pack": "",
    "format": "json | csv",
    "where": "JSON {dimension key: value | {in: [..]} | {gte|lte|gt|lt: n} (scalars) | {has: item} (sets) | {exists: bool}}"
   }
  },
  {
   "method": "POST",
   "path": "/personas/import",
   "role": "admin",
   "summary": "Import personas from CSV (header: handle, grounding?, dimension keys; sets as a|b, JSON cells allowed) or JSON (a list). Good rows are written, bad rows reported per row with their faults; dryRun writes nothing.",
   "body": {
    "pack": "",
    "format": "csv | json",
    "data": "CSV text or a list of personas",
    "grounding": "default for rows",
    "provenance": "default for rows",
    "dryRun": "boolean"
   }
  },
  {
   "method": "GET",
   "path": "/personas/:handle/memories",
   "role": "member",
   "summary": "What a persona remembers and said, with the words, across the worlds it lived in (newest first): each world's dated memories (private ones withheld) and voices, and which of its copies.",
   "query": {
    "world": "only this world",
    "limit": "1..2000 (500)"
   }
  },
  {
   "method": "GET",
   "path": "/personas/:handle",
   "role": "member",
   "summary": "A persona at a version (?version=, default current) and its versions. Special-category values are withheld."
  },
  {
   "method": "PUT",
   "path": "/personas/:handle",
   "role": "admin",
   "summary": "Write a persona's next version (re-validated against its pack's latest version). merge keeps values not named; self links (or null unlinks) the self that voices it.",
   "body": {
    "values": "",
    "merge": "boolean",
    "pack": "",
    "grounding": "",
    "provenance": "",
    "self": "handle or null"
   }
  },
  {
   "method": "DELETE",
   "path": "/personas/:handle",
   "role": "admin",
   "summary": "Retire a persona. Its versions stay readable. With purge=1 (added in contract version 1, additive) every version is removed and its words and memories are cleared from the worlds it lived in, with a receipt in the erasure chain: a dry run lists what would go; send confirm equal to the handle to do it. For a persona that stood for a real person.",
   "query": {
    "purge": "1 to remove every version and clear its words from worlds",
    "confirm": "the handle, with purge=1, for the real removal"
   }
  },
  {
   "method": "POST",
   "path": "/sim/runs",
   "role": "admin",
   "summary": "Start a simulation run: a population drawn from a pack (or a selection of personas), a stimulus, measures, a voiced tier (free text rated by SSR, with collapse checks) and dynamics (adoption over mixing groups, or opinion over an explicit graph). Runs as `simulate-voice` then `simulate` jobs; watch sim.progress / sim.done in /events. At most 3 queued or running per tenant (429).",
   "body": {
    "pack": "the pack whose dimensions the population is drawn from",
    "population": "{simulate: rows, represents?: people (each row stands for represents/simulate), seed?, segments?: [{name, share, values: {dimension: value | {shares} | {range: [lo, hi]} | {distribution}}}], rake?: [category dims] | {dim: {label: share}}, mixing?: {by: [dims or a mixing_group edge], edges?: {dim: [cut points]}}} or {personas: {where?, limit?, handles?, copies?, years_before? (a self-linked persona begins that many years younger, to live its past up to its age now)}, represents?, mixing?}",
    "stimulus": "{text, kind?, structure?, images?: [at most 4 base64 data: URLs (jpeg, png, webp), each under 400,000 characters], shown to every voiced member with the words}",
    "measures": "[purchase_intent | appeal | share_intent | attend_intent | {key, anchors: [5 statements low..high] | [[..], [..]], ask?}] (default purchase_intent)",
    "voice": "{members: 0..500 voiced by the tenant's model, rated by SSR; retest?: 0..20 (2); prior?: true; expected_sd?: 1.1; temperature?; strata?: [category dims or \"segment\"] for a weighted stratum sample}",
    "dynamics": "{model: adoption, channels: {name: rate/day | {default, general, <segment>, \"dim=value\", \"scalar<25\", \"scalar>=65\", \"scalar=18..24\": rate} (every key is checked: an unknown one is refused by name)}, imitation?, across?: 0..1, fatigue?, fatigue_shape?, appeal?: scalar dim, appeal_measure?, events?: [{at, exposure, half_life?, duration?, who?}], event_process?: {rate: {mean, per}, exposure, half_life?, who?}} | {model: opinion, graph?: {edges: [[listener, speaker, w?]]}, homophily?: [dims], stubbornness?: 0..1, rate?}",
    "step": "any duration (\"10min\", \"1h\", \"1d\")",
    "horizon": "a duration (\"40d\")",
    "report_every": "a duration",
    "chunk": "rows per chunk",
    "seeds": "1..20 (spread across seeds)",
    "reference_date": "YYYY-MM-DD the run's time starts at (default today): durations map onto the calendar from it, and derived dimensions (a cohort from age) count years from it",
    "hold": "true: created but not started until POST /sim/runs/:id/observations {release: true}",
    "observe": "{tool, args?, members?: voiced|all, max?: 1..5000}: pull per-member observations from one of the tenant's read-only tools first",
    "calibration": "{targets: [{measure?, metric: mean|would_act|have_it_end|ever_had_it_end, target, tolerance?}]}: checked in results.calibration"
   }
  },
  {
   "method": "GET",
   "path": "/sim/runs",
   "role": "member",
   "summary": "Simulation runs, newest first, with status, progress and the design (and version) each was made from.",
   "query": {
    "status": "queued|running|done|failed|cancelled",
    "limit": "1..100 (20)",
    "design": "only this design's runs"
   }
  },
  {
   "method": "GET",
   "path": "/sim/runs/:id",
   "role": "member",
   "summary": "One run: spec, progress {phase, voiced, voice_of, seed, seeds, step, steps, pct}, and when done its aggregate results (represented vs simulated, reactions per measure with distribution, divides, would_act and collapse checks, adoption curves with the seed spread, opinion) and results.trust (version 1): fidelity tier mix, seed spread, reliability (test-retest), collapse warnings, calibration state with raw/debiased/calibrated signals, and the design's backtest skill against naive baselines. Special-category dimensions only in groups of 10+."
  },
  {
   "method": "GET",
   "path": "/sim/runs/:id/members",
   "role": "member",
   "summary": "A run's sampled members, a page at a time by stable index: segment, weight, public traits (special-category values never), and the persona's handle when members are personas.",
   "query": {
    "after": "the last index of the previous page",
    "limit": "1..1000 (100)"
   }
  },
  {
   "method": "POST",
   "path": "/sim/runs/:id/observations",
   "role": "admin",
   "summary": "External per-member observations: values of the pack's dimensions keyed by member index, before the run starts (a held run) or between its steps. They replace drawn values in profiles, rates and breakdowns. release: true starts a held run.",
   "body": {
    "observations": "[{i, values: {dimension: value}}] (at most 5000 per call)",
    "source": "what produced them",
    "release": "true starts a held run"
   }
  },
  {
   "method": "GET",
   "path": "/sim/compare",
   "role": "member",
   "summary": "Two finished runs side by side (an A/B of stimuli or designs): per measure means, would-act and JSD between distributions, adoption at the end, and whether they ran on the same seeds.",
   "query": {
    "a": "run id",
    "b": "run id"
   }
  },
  {
   "method": "POST",
   "path": "/backtests",
   "role": "admin",
   "summary": "Backtest: fit the release of a design, a run or an inline release on a measured series BEFORE the cut and forecast after it; scored only out of sample at each horizon (MAPE, sMAPE, MAE, pinball, cumulative error) beside naive baselines (last period carried forward, no further change, seasonal-naive when the cadence has a season), with a plain verdict on whether the model beat each. A signal and an outcome make it a calibration pair. All faults come back at once in faults [{path, message}].",
   "body": {
    "subject": "what the series measures",
    "series": "{values: [8..1000 numbers >= 0], kind: cumulative|per_period, cadence: hour|day|week|month|quarter, start?: YYYY-MM-DD, measure?: adoption (new adopters per period, default) | attention (level per period)}",
    "cut": "points before the cut (4..n-1), or a date with series.start",
    "horizons": "days, 1..8 (default [7, 30, 90])",
    "design": "a design key (its release seeds the fit)",
    "run": "or a run id",
    "release": "or {channels, imitation, fatigue, fatigue_shape}",
    "seed": "whole number (1): the same seed, the same fit",
    "season": "periods per season (default day 7, week 52, month 12, quarter 4)",
    "margin": "0..1 (0.05): how much lower the MAE must be to count as beating",
    "signal": "{run, metric: mean|would_act|have_it_end|ever_had_it_end, measure?} (debiased by the run's measured prior) or {value, metric?}",
    "outcome": "number observed (default: the total after the cut to the longest horizon)"
   }
  },
  {
   "method": "GET",
   "path": "/backtests",
   "role": "member",
   "summary": "Backtests, newest first, with their verdicts.",
   "query": {
    "design": "only this design's",
    "subject": "only this subject's",
    "limit": "1..100 (20)"
   }
  },
  {
   "method": "GET",
   "path": "/backtests/:id",
   "role": "member",
   "summary": "One backtest: the series, the fitted parameters (with an in-sample error that is never judged), per-horizon scores and skill against each baseline, the verdict, and the forecast with its 10–90% band beside the actuals and baselines."
  },
  {
   "method": "GET",
   "path": "/calibration",
   "role": "member",
   "summary": "The tenant's calibration maps, per design and signal metric: isotonic (5+ backtests) or bounded linear (3+) from the swarm signal to the observed outcome, with the leave-one-out error; uncalibrated below 3. Runs show raw, debiased and calibrated values in results.trust.",
   "query": {
    "design": "only this design's"
   }
  },
  {
   "method": "POST",
   "path": "/primitives/course",
   "role": "member",
   "summary": "One person's years, age by age: household money (income, work, retirement, buffer, borrowing, spending) under an economy that moves between regimes, and the body (height, weight, lean share) under an energy balance and activity. Stateless and seeded; a model with stated parameters, `basis: modelled`, validity echoed.",
   "body": {
    "seed": "number",
    "id": "person",
    "birth_year": "year",
    "from_age": "default 18",
    "to_age": "default 90",
    "household": "{start_assets?, base_income?, profile?, retire_age?, ...: household parameters; unknown names refused}",
    "body": "{height_cm?, weight_kg?, activity?, params?}",
    "lifestyle": "{surplus_kcal?, activity?}",
    "macro": "{seed?, spec?: {regimes, transition, start}}"
   }
  },
  {
   "method": "POST",
   "path": "/primitives/demand",
   "role": "member",
   "summary": "Budget shares across categories by an almost-ideal demand system with its restrictions checked (adding up, homogeneity, symmetry), exact elasticities, and a person's choice among options by a logit with their own price sensitivity.",
   "body": {
    "model": "{alpha, beta, gamma, alpha0?}",
    "prices": "[number] one per category",
    "budget": "number",
    "options": "{quality: [number], prices: [number], sensitivity?}"
   }
  },
  {
   "method": "POST",
   "path": "/primitives/trial",
   "role": "member",
   "summary": "An offer put in front of a sample of people drawn from a household income process: the share who respond with the sampling interval, the parameter interval and the backtest error kept apart. Called checked only when a backtest error is given.",
   "body": {
    "seed": "number",
    "n": "10..20000",
    "year": "year",
    "offer": "{point: [taste position], price, quality?}",
    "params": "trial parameters",
    "household": "household parameters",
    "age_lo": "18",
    "age_hi": "85",
    "perturb": "relative parameter spread, default 0.15",
    "backtest_error": "absolute error of a registered backtest of this kind of trial"
   }
  },
  {
   "method": "POST",
   "path": "/primitives/retention",
   "role": "member",
   "summary": "Repeat purchase until a customer quietly stops: a cohort simulated beside the closed-form expectation, with satisfaction moving the dropout chance.",
   "body": {
    "model": "{rate_shape, rate_scale, drop_a, drop_b, satisfaction_effect}",
    "seed": "number",
    "n": "10..50000",
    "horizon": "time units",
    "satisfaction": "-1..1"
   }
  },
  {
   "method": "POST",
   "path": "/primitives/taste",
   "role": "member",
   "summary": "A moving culture in a taste space and a person's taste in it, year by year: formed in their own years, drawn toward the present at their own pace.",
   "body": {
    "seed": "number",
    "person": "number",
    "birth_year": "year",
    "from_year": "year",
    "to_year": "year",
    "params": "taste parameters"
   }
  },
  {
   "method": "GET",
   "path": "/markets/stress",
   "role": "member",
   "summary": "Market stress scenarios on a capacity market (buyer segments by elasticity, providers by region, cost and capacity, posted, auction or order-book clearing), in their fixed order with variants; the trace fields, the standard market's basis and what is validated."
  },
  {
   "method": "POST",
   "path": "/markets/stress",
   "role": "member",
   "summary": "One scenario run, reproducible by seed: the manifest (seed, every parameter, the shock schedule with dates, summary, stylized facts, validation band) and the trace as JSONL text, one row per tick and actor, with its sha256. Needs the project in LW_COMPUTE_TENANTS.",
   "body": {
    "scenario": "baseline | demand_drop | glut_exit | partition | energy_spike | liquidity_drought",
    "variant": "a variant id from GET /markets/stress; default the scenario's",
    "seed": "0..2^31",
    "ticks": "days, 30..1825; default 1080",
    "spec": "your own capacity market {ticks, regions, segments, providers, mechanism?, ...}; default the standard market",
    "glut_capacity": "glut_exit on your own spec: the share of capacity the glut adds",
    "rows": "false for the manifest only",
    "from": "first tick of the trace, default 0",
    "to": "last tick of the trace"
   }
  },
  {
   "method": "POST",
   "path": "/primitives/returns",
   "role": "member",
   "summary": "A purchase kept or returned: the return chance from fit gap, price and satisfaction (with each buyer's own tendency), the day of a return inside the window, and the wear of what is kept; the simulated share beside the integrated one.",
   "body": {
    "model": "{base_rate, fit_effect, price_effect, reference_price, satisfaction_effect, propensity_sd, window_days, timing_shape, timing_scale_days, wears_per_month, wear_satisfaction_effect, wear_decay_per_month}",
    "seed": "number",
    "n": "10..50000",
    "months": "0..120",
    "purchase": "{fit_gap 0..1, price, satisfaction -1..1, fit_gaps?: {place: 0..1} (per place on the body; the chance reads 1 - prod(1 - gap), never below fit_gap)}"
   }
  },
  {
   "method": "POST",
   "path": "/primitives/wear",
   "role": "member",
   "summary": "How a garment ages with wearing and washing from a fabric's test numbers: abrasion, pilling grade, colour change, shrinkage and shape loss at given wear counts, and the satisfaction they cost.",
   "body": {
    "fabric": "{abrasion_cycles, pilling_cycles, colour_wash_grade (grey-scale grade after the wash test, 5 = no change), colour_test_washes? (home washes the test stands for, default 5), shrinkage_after_washes_pct, recovery_pct}",
    "wearing": "{martindale_cycles_per_wear, wears_per_wash, shape_loss_wears, weights}",
    "wears": "[number]",
    "fit_gap": "0..1"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/rectify",
   "role": "member",
   "summary": "Correct a model's answers with a small real sample (prediction-powered inference, PPI++): an estimate and interval that stay valid however wrong the model is, beside the real-sample-only answer, and the effective sample size the model adds. Per cell and poststratified with cells and shares. Nothing is stored.",
   "body": {
    "labelled": "[{y, f}]: real answers y beside the model's f for the same units",
    "unlabelled": "[f]: the model's answers where no real one exists",
    "share": "true for a 0/1 outcome (interval kept in [0, 1])",
    "alpha": "default 0.05",
    "lambda": "weight on the model in [0, 1]; tuned by default",
    "cells": "instead: [{cell, labelled, unlabelled}]",
    "shares": "with cells: {cell: population share}"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/allocate",
   "role": "member",
   "summary": "Where to spend the next real answers: labels per cell, more where the model is hardest to correct, every cell at least 2, summing to the budget.",
   "body": {
    "cells": "[{cell, sdResidual, sdClassical?, share?, cost?}]",
    "budget": "total labels"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/intervals",
   "role": "member",
   "summary": "Intervals that keep their coverage (conformal): split; by subgroup, so no cell is covered only on average; or weighted to recent years, so a change of regime widens them instead of hiding.",
   "body": {
    "method": "split | group | weighted",
    "alpha": "miscoverage, default 0.1",
    "scores": "split and weighted: past |error| values",
    "predictions": "split and weighted: points to put intervals round",
    "calibration": "group: [{groups, score}]",
    "points": "group: [{groups, prediction}]",
    "times": "weighted: when each score was made",
    "now": "weighted",
    "halfLife": "weighted: years for a score's weight to halve"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/regions",
   "role": "member",
   "summary": "Regions forecast as the nation plus an offset that fades (AR(1)), so a region inherits a national stall instead of its own old slope; gains that taper as life expectancy rises, fitted over many populations; and a score against the truth.",
   "body": {
    "national": "[{year, e0}]",
    "regions": "{region: [{year, e0}]}",
    "nationalForecast": "[{year, e0}]",
    "horizon": "years ahead",
    "nationalSd": "sd of the national forecast",
    "pooled": "{population: [{year, e0}]} to fit tapered gains",
    "start": "e0 to project from with the fitted gains",
    "years": "default 10",
    "predicted": "{region: value}",
    "truth": "{region: value}"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/kin",
   "role": "member",
   "summary": "Expected siblings (older, younger, alive) from fertility and survival alone, with their variance, per cell; beside a simulation's counts and a survey's, it says whether the rates or the simulation's linking of births to parents is at fault.",
   "body": {
    "schedules": "{fertility, survival} by single year of age, or {year: {fertility, survival}}",
    "cells": "[{cell, birthYear, egoAge}]",
    "birthYear": "without cells",
    "egoAge": "without cells; omit for lifetime",
    "alive": "true to count siblings still alive at egoAge",
    "simulated": "{cell: count}",
    "survey": "{cell: count}",
    "tolerance": "default 0.1"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/cells",
   "role": "member",
   "summary": "Subgroups held to the truth: multicalibration over overlapping groups (patches learned and applied to new units), small cells smoothed across ordered age bands, or each cell checked against its own sampling-noise floor.",
   "body": {
    "method": "multicalibrate | smooth | floor",
    "units": "multicalibrate: [{p, y, groups}]",
    "apply": "multicalibrate: [{p, groups}] to correct",
    "alpha": "multicalibrate: tolerance, default 0.02",
    "cells": "smooth: [{party, ageIndex, n, mean}]; floor: [{cell, predicted, observed, n}]",
    "priorSdRW": "smooth: step between age bands, default 0.05",
    "shares": "smooth: {party|age: share}",
    "q": "floor: default 0.95"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/assimilate",
   "role": "member",
   "summary": "A running world corrected by what it observes (ensemble Kalman filter, or a particle filter for non-Gaussian state), or parameter space ruled out before expensive runs (history matching on Gaussian-process emulators). Seeded: the same body gives the same answer.",
   "body": {
    "method": "enkf | particle | history",
    "particles": "particle: particles × state, moved to the observation time",
    "weights": "particle: before this observation",
    "logLikelihood": "particle: one per particle",
    "essThreshold": "particle: resample below this share, default 0.5",
    "ensemble": "enkf: members × parameters",
    "predicted": "enkf: members × observations",
    "observed": "enkf",
    "obsSd": "enkf: one or per observation",
    "inflation": "enkf: default 1",
    "X": "history: design points",
    "outputs": "history: simulator outputs per design point",
    "targets": "history: [{value, obsSd, modelDiscrepancySd}]",
    "candidates": "history: points to test, or bounds and nCandidates",
    "cutoff": "history: default 3",
    "seed": "default 1"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/trajectories",
   "role": "member",
   "summary": "One member's path against observed panel paths: how often a category changes by age band and how much more after life events (the switch dynamics to declare, with bootstrap intervals), and each observed start replayed through the population's rules (dimensions given, and the standard life state and events) and scored: change simulated against observed with the gap's 95% interval, the end's Brier score beside nothing changing, and a verdict that calls a trait calibrated only on held-out rows. Nothing is stored.",
   "body": {
    "rows": "[{id, years, start, end, events?: [{key, at?}], weight?, group?}]",
    "fit": "{key, ages?, events?, days?} or a list of them",
    "replay": "{dims?, standard?, keys, draws?, budget?, held_out?}",
    "seed": "default 1"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/recalibrate",
   "role": "member",
   "summary": "Parameters held with their uncertainty, updated by observations: the one recalibration every model and product calls. Bayesian (the current values and sds are the prior; the posterior mode with Laplace uncertainty comes back), with the latest observations held out and scored before and after, and the band of the data the fit covers. method ensemble updates a black-box simulator's parameter draws from its runs (ensemble Kalman). Nothing is stored.",
   "body": {
    "family": "gaussian | binomial",
    "params": "[{name, value, sd (0 holds it fixed), transform?: none | log | logit}]",
    "observations": "[{y, n? (binomial trials), mean: {param: coefficient}, scale?: {param: coefficient} (gaussian log sigma), offset?, scale_offset?, at?, weight?}]",
    "random_sd": "binomial: the param that is a random intercept's sd, integrated out",
    "forget": "(0, 1]: widen the prior first, for drift",
    "holdout": "share of the latest observations kept out, default 0.2",
    "scores": "the scores that prompted this, kept with the result",
    "method": "ensemble: then params, theta (members x params), predicted (members x observations), observed, obs_sd, seed?, inflation?"
   }
  },
  {
   "method": "POST",
   "path": "/calibrate/score",
   "role": "member",
   "summary": "Forecasts with uncertainty scored properly: CRPS, log score, PIT and coverage of the 50, 80 and 95 percent intervals, and with a reference, paired CRPS skill with a bootstrap interval. Computed as scoringrules computes them. Nothing is stored.",
   "body": {
    "forecasts": "[{predictive: {kind: gaussian, mu, sigma} | {kind: ensemble, members} | {kind: quantiles, levels, values}, y}]",
    "reference": "one predictive per forecast, for skill",
    "levels": "coverage levels",
    "seed": "default 1"
   }
  },
  {
   "method": "GET",
   "path": "/compute/kinds",
   "role": "member",
   "summary": "The Ipnops Compute kinds each Living Worlds area calls (climate, driving, robots, cities, health, agents, worlds3d, physics, games, twins), each with its parameters, inputs and outputs, and the machines serving it now. compute_allowed says whether this project may submit jobs (added in contract version 1, additive): a project not listed by the operator is refused with 403 on submission."
  },
  {
   "method": "POST",
   "path": "/compute/files",
   "role": "member",
   "summary": "Upload an input file for a compute job (the body is the file, up to 200 MB); returns its id. Kept by the service for 7 days.",
   "query": {
    "name": "the file's name"
   }
  },
  {
   "method": "POST",
   "path": "/compute/jobs",
   "role": "member",
   "summary": "Start one compute kind. Parameters are checked against the kind's declared types before it is sent; inputs are files this project uploaded. Needs the project in LW_COMPUTE_TENANTS.",
   "body": {
    "kind": "a kind from GET /compute/kinds",
    "params": "{name: value}",
    "inputs": "{input: file id}",
    "max_seconds": "60..21600, default 3600",
    "idempotency_key": "the same key returns the same job",
    "pool": "a pool id, default the Ipnops fleet",
    "webhook": "optional: an https address of this project's, called when the job ends, signed with the project's compute webhook secret (set it first with POST /compute/webhook-secret; see the note compute_webhooks)"
   }
  },
  {
   "method": "POST",
   "path": "/compute/estimate",
   "role": "member",
   "summary": "What one compute job would cost at most, with nothing started (added in contract version 1, additive). The body is a submit's without files: kind, params (checked against the kind's declared types), max_seconds, pool; the core passes it to the compute service's estimate and returns { estimate: { kind, dimension (gpu_seconds or cpu_seconds), max_seconds, compute_units, minutes, typical (null: no measured duration is held), basis, starts_nothing, billed: false }, units } where units says what compute_units, minutes and max_seconds are. An upper bound, not a prediction. The same gate as POST /compute/jobs: the project must be in LW_COMPUTE_TENANTS (403 otherwise); 503 with the reason when the compute side is not connected (IPNOPS_COMPUTE_KEY).",
   "body": {
    "kind": "a kind from GET /compute/kinds, e.g. lw.life_run",
    "params": "{name: value}",
    "max_seconds": "60..21600 (default 3600)",
    "pool": "optional"
   }
  },
  {
   "method": "GET",
   "path": "/compute/jobs/:id",
   "role": "member",
   "summary": "A job this project started: state, progress, result and its outputs' sizes. wait_s keeps reading it, every few seconds, up to that many seconds (600 at most) and answers when it ends.",
   "query": {
    "wait_s": "0..600"
   }
  },
  {
   "method": "GET",
   "path": "/compute/jobs/:id/outputs/:name",
   "role": "member",
   "summary": "One output of a finished job: as JSON { name, size, base64 } up to 20 MB, or with raw=1 its bytes streamed from Ipnops with no cap beyond Ipnops' own, with content-type, content-length and x-sha256 (a Range header is passed on; added in contract version 1, additive).",
   "query": {
    "raw": "1: the bytes, not JSON"
   }
  },
  {
   "method": "GET",
   "path": "/compute/jobs",
   "role": "member",
   "summary": "This project's compute jobs, newest first, a page at a time: { jobs: [ { id, kind, created_by, created_at, webhook } ], next_cursor } (null at the end). live=1 adds each job of the page as Ipnops shows it now (state, progress, outputs, served_by, usage), or live_error. A removed job is not listed (added in contract version 1, additive).",
   "query": {
    "limit": "1..100, default 50",
    "after": "the next_cursor of the page before",
    "live": "1: each job's state from Ipnops"
   }
  },
  {
   "method": "GET",
   "path": "/compute/jobs/:id/events",
   "role": "member",
   "summary": "A job of this project's events as Ipnops streams them (server-sent events: queued, started, progress, done, failed, cancelled), passed on as they come; the stream ends when the job has ended. after, or a Last-Event-ID header, resumes after that event (added in contract version 1, additive).",
   "query": {
    "after": "the id of the last event seen"
   }
  },
  {
   "method": "POST",
   "path": "/compute/jobs/:id/cancel",
   "role": "member",
   "summary": "Cancel a job of this project at Ipnops; answers { job } as it stands after. A job that has ended is answered as it is (added in contract version 1, additive)."
  },
  {
   "method": "DELETE",
   "path": "/compute/jobs/:id",
   "role": "member",
   "summary": "Remove a job of this project: cancelled first when it has not ended, then each of its output files deleted at Ipnops where Ipnops allows (a held file stays and is named with the reason). Answers { removed, cancelled, state, outputs: { name: { file, deleted, reason? } }, note }; the job is then gone from every route of this project. Ipnops keeps its own record of the job, and the job's inputs are the project's files (DELETE /compute/files/:id) (added in contract version 1, additive)."
  },
  {
   "method": "GET",
   "path": "/compute/files/:id",
   "role": "member",
   "summary": "A file this project uploaded, as its bytes from Ipnops (content-type, content-length, x-sha256; a Range header is passed on). Another project's file is a 404 (added in contract version 1, additive)."
  },
  {
   "method": "DELETE",
   "path": "/compute/files/:id",
   "role": "member",
   "summary": "Delete a file this project uploaded, at Ipnops and here: 409 while a job or a hold keeps it; a file Ipnops no longer has (uploads are kept 7 days) is removed here with a note. Another project's file is a 404 (added in contract version 1, additive)."
  },
  {
   "method": "POST",
   "path": "/compute/webhook-secret",
   "role": "admin",
   "summary": "Make or replace this project's compute webhook secret (whsec_ and base64), answered once and never shown again; the old one stops at once. Every webhook of the project's compute jobs is signed with it: see the note compute_webhooks (added in contract version 1, additive)."
  },
  {
   "method": "DELETE",
   "path": "/compute/webhook-secret",
   "role": "admin",
   "summary": "Remove this project's compute webhook secret: a job that names a webhook is then refused until a secret is set again (added in contract version 1, additive)."
  },
  {
   "method": "POST",
   "path": "/compute/pipelines/:name",
   "role": "member",
   "summary": "Kinds chained: drive (carla.drive, then drive.plan from its camera and path: the plan beside the path driven) or voice (speech.say, speech.transcribe with the word error rate, face.animate).",
   "body": {
    "map": "drive",
    "weather": "drive",
    "frames": "drive",
    "traffic": "drive",
    "seed": "drive",
    "at_s": "drive",
    "text": "voice",
    "voice": "voice",
    "language": "voice",
    "identity": "voice",
    "face": "voice: false to skip the face",
    "pool": "a pool id"
   }
  },
  {
   "method": "POST",
   "path": "/twins",
   "role": "member",
   "summary": "Build a twin loop: a twin of a real system (domain weather: station temperature from a global AI weather model against live METAR readings), its subjects and its parameters with their uncertainty (the prior).",
   "body": {
    "name": "1..64 letters, digits, _ . -",
    "domain": "weather",
    "config": "{points: [{id, lat, lon}], model?, variable?, offset?, hours?, leads_h?, members?, issue_delay_h?, embargo_h?, readings?, baseline?, station_bias?, forget?, pool?}",
    "params": "[{name, value, sd}] to replace the prior's"
   }
  },
  {
   "method": "GET",
   "path": "/twins",
   "role": "member",
   "summary": "The project's twin loops."
  },
  {
   "method": "GET",
   "path": "/twins/:id",
   "role": "member",
   "summary": "A twin loop: its config, current parameters and band, every cycle with its scores, and every calibration with its fit and held-out check."
  },
  {
   "method": "POST",
   "path": "/twins/:id/readings",
   "role": "member",
   "summary": "Readings as they arrived, pushed or pulled from the domain's live source; each keeps when it is for and when it arrived, and a revision is a new reading.",
   "body": {
    "readings": "[{subject, at, value, arrived?}]",
    "pull": "{from, to}: from the domain's source (at most 40 days)",
    "source": "a name for pushed readings"
   }
  },
  {
   "method": "GET",
   "path": "/twins/:id/readings",
   "role": "member",
   "summary": "The readings a twin holds, newest first, each with its subject, the moment it is for, when it arrived and where it came from (a name for pushed readings, the domain's source, or physical:<level>:<sensor> for an admitted measurement).",
   "query": {
    "subject": "one subject",
    "limit": "1..500; default 100"
   }
  },
  {
   "method": "POST",
   "path": "/twins/:id/measurements",
   "role": "member",
   "summary": "Typed measurements from a verified sensor, held against the twin's solved band by the same admission as POST /physical/measurements/admissions: inform always, validate and recalibrate only inside the band, at or above the floor, from a sensor that reads the surroundings (placement environment), recalibrate only when measured and not inferred. A weather twin stores as a reading the temperature in celsius that may validate, and nothing else; the answer says per measurement what it may be used for and whether it was stored. A refused measurement is reported with its code and the others go on.",
   "body": {
    "measurements": "[{subject: one of the twin's points, at: when the value is for, measurement: {v: 1, kind, value, unit, attestation, modality?, placement?, sensor_id?}}], 1..1000",
    "floor": "lowest attestation level accepted; default soft"
   }
  },
  {
   "method": "POST",
   "path": "/twins/:id/cycles",
   "role": "member",
   "summary": "Run the twin forward from an origin on Ipnops Compute, with the baseline beside it on the readings as they stood when the cycle was issued. The parameters are the latest calibration whose data had all arrived by then.",
   "body": {
    "origin": "a time on a 6-hour boundary"
   }
  },
  {
   "method": "POST",
   "path": "/twins/:id/cycles/:cycle/collect",
   "role": "member",
   "summary": "Read a cycle's jobs back when they end (read every few seconds, up to wait_s) and store every forecast: the twin's, its uncalibrated prior's and the baseline's, each marked validated or not and why. A live cycle's forecasts are sealed in the accuracy ledger.",
   "body": {
    "wait_s": "1..7200, default 600"
   }
  },
  {
   "method": "POST",
   "path": "/twins/:id/cycles/:cycle/score",
   "role": "member",
   "summary": "Score a cycle's forecasts against the readings that have arrived: CRPS, log score, PIT and coverage per method on shared cases, and paired skill of the twin against the baseline and against its own prior. Each forecast keeps the reading it was scored against."
  },
  {
   "method": "POST",
   "path": "/twins/:id/recalibrate",
   "role": "member",
   "summary": "Update the twin's parameters from its scored cycles not yet used (POST /calibrate/recalibrate on each forecast's own design), the current parameters as the prior; cycles issued after the data's last arrival use the result.",
   "body": {
    "cycles": "only these cycle ids",
    "holdout": "share of the latest observations held out, default 0.2"
   }
  },
  {
   "method": "PUT",
   "path": "/physical/sites/:id",
   "role": "admin",
   "summary": "Enrol a site, or replace its key: the key the site signs its batches and its command receipts with. Needs the project in LW_PHYSICAL_COMMAND_TENANTS.",
   "body": {
    "site_key": "the site's key as ed25519:<64 lowercase hex> or p256:<66 lowercase hex, compressed>, from the site's operator tooling"
   }
  },
  {
   "method": "GET",
   "path": "/physical/sites",
   "role": "member",
   "summary": "The project's enrolled sites: id, key, the last command sequence number issued and the last batch sequence number accepted."
  },
  {
   "method": "POST",
   "path": "/physical/commands",
   "role": "admin",
   "summary": "Issue one command to a site, only for a twin inside its solved band: the twin must be calibrated, every value inside the band, and the twin's forecasts proven (at least 20 scored, 80% inside their 90% interval). The command is a setpoint or a trajectory chunk (an action chunk of a learned policy), signed by the core's command signer with the twin's certificate; the site decides on its own policy and answers with a signed receipt. The mode is shadow by default. Mode actuate is signed only when the project is in LW_PHYSICAL_COMMAND_TENANTS and a stored approval, signed by an enrolled approver key, covers the site, the system class, the actuator and the kind through the command's expiry and has not been revoked; otherwise 403 actuation_not_approved. The site decides again on its own stage and approvals. Needs a configured signer (503 otherwise).",
   "body": {
    "site": "an enrolled site id",
    "twin": "a twin loop id",
    "band_key": "the band coefficient the setpoint, or the joint position of a trajectory (radian), is, mean.<name> or scale.<name>",
    "effort_band_key": "trajectory only: the band coefficient that bounds joint effort (newton metre); required when the steps carry tau",
    "target": "{actuator_id, scope}",
    "setpoint": "{quantity, unit, value}; exactly one of setpoint and trajectory",
    "trajectory": "{chunk_index, dof, step_ms, steps: [{q, tau?, xyz?}], start: {q, dq, ddq}, limits: {q_min, q_max, dq_max, ddq_max, dddq_max, tau_max?, xyz_min?, xyz_max?}}; every step must lie inside the band (409 outside_solved_band) and q_min and q_max are clipped to it",
    "policy_sha256": "the site's operator policy hash, 64 hex",
    "model_sha256": "the model's hash, 64 hex",
    "birth_record_sha256": "optional, 64 hex",
    "envelope": "setpoint only: {min?, max?, max_rate_per_s}, clipped to the band; the site applies its own stricter envelope",
    "ttl_s": "1..300; default 60",
    "mode": "shadow (the default) or actuate",
    "system_class": "the class of system the actuator belongs to, a lowercase name; required for actuate"
   }
  },
  {
   "method": "PUT",
   "path": "/physical/approvers/:id",
   "role": "admin",
   "summary": "Enrol an approver key, or replace it: the hardware-held key whose signature makes an actuation approval valid. Needs the project in LW_PHYSICAL_COMMAND_TENANTS.",
   "body": {
    "key": "the approver's key as ed25519:<64 lowercase hex>"
   }
  },
  {
   "method": "GET",
   "path": "/physical/approvers",
   "role": "member",
   "summary": "The project's enrolled approver keys."
  },
  {
   "method": "POST",
   "path": "/physical/approvals",
   "role": "admin",
   "summary": "Store an actuation approval: the request body is its canonical JSON text byte for byte (format actuation-approval, version 1). Verified against an enrolled approver key, for this project and an enrolled site, not yet ended; valid for at most 31 days. The same record twice is accepted once; a different record with the same id is a 409. Codes: malformed, not_canonical, unsupported_format, approval_too_long, unknown_approver, bad_signature, wrong_tenant, approval_expired, approval_conflict."
  },
  {
   "method": "GET",
   "path": "/physical/approvals",
   "role": "member",
   "summary": "The project's approvals with their site, class, actuators, kinds, validity and status (active, pending, expired or revoked)."
  },
  {
   "method": "POST",
   "path": "/physical/approvals/:id/revocation",
   "role": "admin",
   "summary": "Revoke an approval. Core stops issuing under it at once; the site's own copy is removed at the site by its operator, and a receipt that reports an execution under a revoked approval is recorded with an alert."
  },
  {
   "method": "GET",
   "path": "/physical/commands",
   "role": "member",
   "summary": "Commands issued, newest first, each with what the site decided (decision, code, ledger position) once its receipt is in.",
   "query": {
    "site": "one site",
    "limit": "1..200; default 50"
   }
  },
  {
   "method": "POST",
   "path": "/physical/receipts",
   "role": "member",
   "summary": "A site's receipt for a command, as its canonical JSON text (the request body, byte for byte). Verified against the key registered for the site and recorded; a replay of the same receipt is accepted once, a different receipt with the same sequence number is a 409. A receipt is recorded with an alert when it contradicts what core issued: executed_in_shadow_mode, execution_unapproved, execution_under_revoked_approval, mode_differs or command_hash_differs."
  },
  {
   "method": "GET",
   "path": "/physical/kinds",
   "role": "member",
   "summary": "The physical interface: every measurement kind with its family, unit, range, whether it is measured or inferred, and the twin variable it validates; the derived signals; the purpose domains and the usual kinds of system; the integrations (robot_middleware, industrial_server, motion_bus, message_broker, vehicle_bus, register_device) with the systems and purposes they serve, the kinds and units they carry, their attestation ceiling (soft), that they are observe only and shadow only, and what has and has not been run; the capabilities (measure, plan, gate, actuate). Stateless; it reaches no site."
  },
  {
   "method": "POST",
   "path": "/physical/purposes/checks",
   "role": "member",
   "summary": "Check a description of what a system is for: its purpose domains, the quantities it measures, the actions it can take, its safe operating limits and its twin. Answers every issue with a code; an action without a limit, a limit in the wrong unit, an unknown kind and a request to act are errors. Stores nothing and acts on nothing.",
   "body": {
    "v": "the number 1",
    "name": "string",
    "purpose": "[compute|processing|physics|motion|measurement|environment|energy|fluid_thermal|structure]",
    "system": "optional kind of system",
    "quantities": "[{kind, unit?, axes?, rate_hz?, uncertainty_sd?}]",
    "integrations": "optional [integration id]: checked against the systems and purposes it serves and the kinds it carries",
    "actions": "[{action: setpoint|trajectory|mode|model_update|calibration_update, quantity, unit, min?, max?}]",
    "limits": "[{quantity, unit, min, max, max_rate_per_s?}]",
    "twin": "{id?, variables: [string]}"
   }
  },
  {
   "method": "POST",
   "path": "/physical/measurements/admissions",
   "role": "member",
   "summary": "Decide what one typed measurement may be used for against a twin's solved band: inform always; validate and recalibrate only inside the band, only at or above the attestation floor, and recalibrate only when the sensor measured it rather than inferred it. Outside the band, or with no band, it validates nothing. Stateless.",
   "body": {
    "measurement": "{v: 1, kind, value, unit, uncertainty_sd?, attestation: soft|device|se|tee|dice|tpm, modality?: direct|inferred, placement?: environment|device}",
    "band": "the twin's band, {mean.<variable>: [min, max]}, or null",
    "floor": "lowest attestation level accepted; default soft"
   }
  },
  {
   "method": "GET",
   "path": "/physical/measurements/stats",
   "role": "admin",
   "summary": "What the admissions route has been asked since this core started, for this project: per key label, requests, accepted, informs-only (could not validate), refused with the code, and by kind with the units seen, and when one was last seen. Counts only, kept in memory, emptied by a restart (since says from when)."
  },
  {
   "method": "POST",
   "path": "/physical/signals",
   "role": "member",
   "summary": "Compute a derived signal (tilt_angle, vibration_rms, angular_speed, field_strength, dew_point, mechanical_power, pressure_height_change) from verified measurements, only inside the regime it is valid in; its attestation is the lowest of its inputs. Stateless.",
   "body": {
    "signal": "name",
    "inputs": "[{kind, value, unit, attestation}]",
    "reference": "reference pressure in pascals, for pressure_height_change"
   }
  },
  {
   "method": "GET",
   "path": "/calibrate/trajectories",
   "role": "member",
   "summary": "The registered replay on the GSS panels 2006-2010: for each categorical attitude, change on the held-out waves against what the fitted switching gives, and whether it held; the switching prior that gives; and how often the household rules end a household where it really ended after its life events."
  },
  {
   "method": "POST",
   "path": "/forecasts",
   "role": "admin",
   "summary": "Register a forecast BEFORE the moment it is for (409 once target_at has passed): value and 10–90% band, how it was made, an inputs hash (or inputs to hash), and the naive baselines' values for skill.",
   "body": {
    "subject": "what is forecast",
    "target_at": "ISO date/time it is for",
    "value": "number",
    "low": "10% quantile",
    "high": "90% quantile",
    "method": "name (e.g. swarm+release)",
    "design": "design key",
    "run": "run id",
    "inputs": "anything; hashed (sha256, canonical JSON) when inputs_hash is absent",
    "inputs_hash": "",
    "baselines": "{name: value}, e.g. {last: 120, no_change: 0}"
   }
  },
  {
   "method": "GET",
   "path": "/forecasts",
   "role": "member",
   "summary": "Registered forecasts, by target date, each with its outcome once scored.",
   "query": {
    "subject": "",
    "method": "",
    "scored": "true | false",
    "limit": "1..500 (50)"
   }
  },
  {
   "method": "DELETE",
   "path": "/forecasts/:id",
   "role": "admin",
   "summary": "Remove a registered forecast and its outcome."
  },
  {
   "method": "POST",
   "path": "/forecasts/actuals",
   "role": "admin",
   "summary": "Post actuals; every open forecast for that subject and day, made before it, is scored at once (absolute and percentage error, sMAPE, pinball, within band, error of each baseline).",
   "body": {
    "actuals": "[{subject, at, value}] (or one at the top level)",
    "source": "where they came from"
   }
  },
  {
   "method": "POST",
   "path": "/forecasts/actuals/pull",
   "role": "admin",
   "summary": "Pull actuals from one of the tenant's read-only tools (called with {subject, ...args}, answering {actuals: [{at, value}]}) and score them.",
   "body": {
    "tool": "tool name",
    "subject": "",
    "args": "{}"
   }
  },
  {
   "method": "GET",
   "path": "/forecasts/ledger",
   "role": "member",
   "summary": "The accuracy ledger: per method, design or the whole tenant: scored count, MAE, MAPE, sMAPE, pinball, band coverage, skill against each baseline (1 - MAE/MAE baseline), month by month; per design also its backtests' skill.",
   "query": {
    "by": "method | design | tenant",
    "subject": ""
   }
  },
  {
   "method": "POST",
   "path": "/sim/runs/:id/cancel",
   "role": "admin",
   "summary": "Stop a queued, running or paused run for good (409 once finished)."
  },
  {
   "method": "POST",
   "path": "/sim/runs/:id/pause",
   "role": "admin",
   "summary": "Pause a running run: status pausing until its next chunk boundary (a voiced batch in flight finishes first), then paused. A paused run holds no worker and survives restarts; idempotent."
  },
  {
   "method": "GET",
   "path": "/universe",
   "role": "member",
   "summary": "This project's universe: its laws (the weakest gate any self here may run), its kinds of world, and how many worlds and residents it has."
  },
  {
   "method": "PATCH",
   "path": "/universe",
   "role": "admin",
   "summary": "Set the laws. The floor may be raised; it is never looser than the core's own.",
   "body": {
    "gateFloor": "{trialsNeeded?, alpha?, maxUnchecked?}"
   }
  },
  {
   "method": "PUT",
   "path": "/universe/kinds/:id",
   "role": "admin",
   "summary": "Declare a kind of world as data: what it is made of, where selves work in it, the checks that can fail there (none makes it belief-only), a stricter local gate, and what an arriving self must re-earn. A kind worlds were made under cannot be changed.",
   "body": {
    "description": "",
    "places": "[...]",
    "hosts": "[worker|studio|body]",
    "taskClasses": "[...]",
    "checks": "[check names]",
    "gate": "optional {trialsNeeded, alpha, maxUnchecked}, never looser than the laws",
    "seed": "optional first state of a world of this kind",
    "quarantine": "optional {beliefs?: true, baseline?: procedure text an arriving self must beat}",
    "dayMs": "optional wall milliseconds per world-day"
   }
  },
  {
   "method": "GET",
   "path": "/worlds/:id/residents",
   "role": "member",
   "summary": "The selves who live in this world."
  },
  {
   "method": "POST",
   "path": "/selves/:handle/travel",
   "role": "admin",
   "summary": "Move a self into a world: its first arrival, or a crossing. Its record goes with it untouched, a running trial stays behind, and the destination kind's quarantine applies. Refused if its gate is looser than the laws.",
   "body": {
    "to": "the world's id"
   }
  },
  {
   "method": "GET",
   "path": "/selves/:handle/passages",
   "role": "member",
   "summary": "Where a self lives, every border it crossed, and whether its record shows it arrived whole each time."
  },
  {
   "method": "POST",
   "path": "/checkers/:id/audit",
   "role": "admin",
   "summary": "Report a checker's verdicts on items known to be bad. One pass on a bad item suspends it, and every adoption it helped decide is named for review.",
   "body": {
    "knownBad": "[{item, passed}]: what it returned on each known-bad item"
   }
  },
  {
   "method": "POST",
   "path": "/worlds",
   "role": "admin",
   "summary": "Make a world in this project's universe. With no pack it is a place selves live in (kind optional: its seed is the world's first state). With a pack it also holds a living population: members drawn from a pack go on over simulated time (households, ties, circles, followers, life events from event_process dimensions, word of mouth, fatigue, bounded memory). Created paused at tick 0; the reply carries the plan (see /worlds/:id/plan).",
   "body": {
    "kind": "a kind declared at PUT /universe/kinds/:id (optional)",
    "name": "text",
    "pack": "the pack",
    "population": "{simulate: 2..20000 members, represents?, seed?, segments?, mixing?}, or {personas: {handles? | where?, limit?, copies?}, seed?}: a world made only of personas may hold one member (a persona world: one life on the world's clock, no ties to others); see the note persona_world",
    "stimulus": "{text, kind?}: what members meet and are voiced about",
    "stimuli": "[{key, label?, text?, kind?, channels?, images?: [at most 4 base64 data: URLs, each under 400,000 characters]}]: further stimuli on the timeline, named by an intervention's params.stimulus; their pictures go to the model with their words when a member is voiced on them, and are counted (pictures), not returned, when the world is read",
    "time": "{start: YYYY-MM-DD, horizon: \"30d\", step?: \"1d\", resolution?: [{until, step}] (finer steps early), scale?: realtime|1h=1min|1h=1s|1d=1min|1d=10s|1d=1s|1w=1s|{sim, real}}",
    "feed": "{channels: {name: rate/day}, imitation?, across?, fatigue?, fatigue_shape?, potential?: 0..1 the share who could ever take it up (the rest hear of it but never take it up)}",
    "social": "{ties?, household?, influencers?, follows?, circles?: {by, size}, homophily?, pull?}",
    "life": "{processes?: [event_process dims], budget?: scalar dim, age?: scalar dim}",
    "memory": "{cap?: 1..64, reflect_days?, consolidate_days?}",
    "budget": "{calls_per_day?: members voiced by the model per simulated day (the realism knob)}",
    "interventions": "[{at, kind, label?, params?}]"
   }
  },
  {
   "method": "GET",
   "path": "/worlds",
   "role": "member",
   "summary": "Worlds, newest first: status (paused|running|done|failed), tick, parent and branch tick.",
   "query": {
    "status": "paused|running|done|failed",
    "limit": "1..200 (50)"
   }
  },
  {
   "method": "GET",
   "path": "/worlds/:id",
   "role": "member",
   "summary": "One world: spec, clock (tick, sim time, target), run (scale and whether it was capped), interventions, pending voiced members."
  },
  {
   "method": "DELETE",
   "path": "/worlds/:id",
   "role": "admin",
   "summary": "Delete a world with its member states and log. Its branches stay (they no longer name a parent)."
  },
  {
   "method": "POST",
   "path": "/worlds/:id/run",
   "role": "admin",
   "summary": "Run the world in real time at its scale, capped to what the model and the arithmetic sustain (the reply says so). At most 3 running per tenant (429).",
   "body": {
    "scale": "optional: a preset or {sim, real}",
    "calls_per_day": "optional: members voiced per simulated day"
   }
  },
  {
   "method": "POST",
   "path": "/worlds/:id/pause",
   "role": "admin",
   "summary": "Pause a running world; idempotent."
  },
  {
   "method": "POST",
   "path": "/worlds/:id/step",
   "role": "admin",
   "summary": "Advance a paused world by ticks (default 1) as fast as the arithmetic goes; voiced members still answer.",
   "body": {
    "ticks": "1..10000"
   }
  },
  {
   "method": "POST",
   "path": "/worlds/:id/jump",
   "role": "admin",
   "summary": "Advance a paused world to a later time.",
   "body": {
    "to": "a duration from the start (\"14d\"), seconds or a date"
   }
  },
  {
   "method": "POST",
   "path": "/worlds/:id/branch",
   "role": "admin",
   "summary": "Branch at a tick the world has reached (default now): the new world shares everything before it (re-simulated, with the recorded voices, no model calls) and goes on with its own interventions. The parent is untouched.",
   "body": {
    "at": "tick",
    "name": "text"
   }
  },
  {
   "method": "GET",
   "path": "/worlds/:id/plan",
   "role": "member",
   "summary": "Feasibility: the requested and effective (capped) scale, what limits it (model or arithmetic), model calls per second needed, estimated real time to the horizon, model calls to the horizon, and a plain sentence.",
   "query": {
    "scale": "a preset or sim=real",
    "calls_per_day": "members voiced per simulated day"
   }
  },
  {
   "method": "GET",
   "path": "/worlds/:id/replay",
   "role": "member",
   "summary": "The world's log, tick by tick: aggregates (have_it, aware, opinion, new adopters, exposures, life events, daily circle tiles), up to 25 sampled events per tick, group leanings.",
   "query": {
    "from": "tick",
    "to": "tick",
    "limit": "1..2000 (500)",
    "events": "false to leave events out"
   }
  },
  {
   "method": "GET",
   "path": "/worlds/:id/members",
   "role": "member",
   "summary": "Members, paged, at the current or an earlier tick: public traits (aggregate-only dimensions withheld), household, circle, awareness, opinion.",
   "query": {
    "after": "member index",
    "limit": "1..500 (100)",
    "tick": "a reached tick"
   }
  },
  {
   "method": "GET",
   "path": "/worlds/:id/members/:i",
   "role": "member",
   "summary": "One member: as in the list, plus ties, memory (private life events withheld) and how they look (appearance: age, build, hair, skin, posture, visible energy and dress, each with what caused it; world spec appearance names which traits to read), the life events they went through (life), and what last changed each trait an event touched (causes: the event, or the trait whose change led to it, with its basis: measured and its reference, stated, definition or assumed).",
   "query": {
    "tick": "a reached tick"
   }
  },
  {
   "method": "GET",
   "path": "/worlds/:id/interventions",
   "role": "member",
   "summary": "The world's interventions."
  },
  {
   "method": "GET",
   "path": "/worlds/:id/voices",
   "role": "member",
   "summary": "What members said (params.voice.notice lets a voiced member see the condition of things they use, in this or another of the tenant's worlds), in their own words: each answer with its date, member, persona, the intervention and stimulus it was about, and its rated measures; reflections; and each voiced moment (an intervention with params.voice) read as a whole per measure (rated, distribution, mean, share who would act). An answer to a moment measure is carried as moments: {key: {text, feel}} on the answer, and per voiced moment as moment_measures: {key: {answered, prompt, label?, feel_mean, answers}} (see the note moment_measures).",
   "query": {
    "member": "a member index",
    "intervention": "an intervention id",
    "after": "a tick",
    "limit": "1..1000 (200)"
   }
  },
  {
   "method": "POST",
   "path": "/worlds/:id/lives",
   "role": "admin",
   "summary": "A defined self joins a world of lives: a persona (its age and gender, and its own words for the voice) or an age and sex take the place of the living life of that sex nearest that age; from then on it is advanced by the same hazards.",
   "body": {
    "persona": "a persona handle",
    "age": "years",
    "sex": "female | male",
    "children": "0..20",
    "partnered": "boolean"
   }
  },
  {
   "method": "POST",
   "path": "/worlds/:id/interventions",
   "role": "admin",
   "summary": "Add an intervention while paused, at or after the current time (409 otherwise).",
   "body": {
    "at": "duration from the start, seconds or a date",
    "kind": "drop|campaign|outside|price|influencer|life",
    "label": "text",
    "params": "{exposure?, duration?, half_life?, who?, factor? (price), count? (influencer), member?, event? (life)}"
   }
  },
  {
   "method": "POST",
   "path": "/worlds/:id/advance",
   "role": "admin",
   "summary": "A world of lives (made with POST /worlds {lives: {count, hazards, seed?, places?, year?}}): advance it {months: 1..1200} by its hazard table. Returns the world in aggregate: lives held and alive, the year, births, deaths and partnerships so far, and which hazards are measured and which are placeholders.",
   "body": {
    "months": "1..1200"
   }
  },
  {
   "method": "GET",
   "path": "/worlds/:id/lives/:life",
   "role": "member",
   "summary": "Meet a life in a world of lives: its own record as it knows it (age, partner and for how long, children and their ages, whether it lives with its mother) and the same in its own words."
  },
  {
   "method": "POST",
   "path": "/worlds/:id/lives/:life/voice",
   "role": "admin",
   "summary": "A met life's voiced decision, written back. decision: birth (a woman), partner (forming a partnership), separate or leave (their parent's household), in the next months (default 12). The life answers through this tenant's model with its story as memory (and its own words when it is a defined persona); the world host anchors the answer to the population's hazard (a voice moves one life around the level, never sets it) and draws the outcome as a real event. An answer with no chance in it is did-not-run and changes nothing.",
   "body": {
    "decision": "birth | partner | separate | leave",
    "months": "1..60"
   }
  },
  {
   "method": "POST",
   "path": "/worlds/:id/save",
   "role": "admin",
   "summary": "Save a world of lives to object storage, so it outlives the host's memory and comes back exactly."
  },
  {
   "method": "PATCH",
   "path": "/worlds/:id/interventions/:iid",
   "role": "admin",
   "summary": "Change an intervention that has not happened yet, while paused."
  },
  {
   "method": "DELETE",
   "path": "/worlds/:id/interventions/:iid",
   "role": "admin",
   "summary": "Remove an intervention that has not happened yet, while paused."
  },
  {
   "method": "POST",
   "path": "/sim/runs/:id/resume",
   "role": "admin",
   "summary": "Continue a paused run from its checkpoint: resuming, then running. Results equal an uninterrupted run with the same seed. 429 when the tenant already has its maximum active runs."
  },
  {
   "method": "DELETE",
   "path": "/sim/runs/:id",
   "role": "admin",
   "summary": "Delete a run with its observations and results, for good (404 when not the tenant's). Event sim.deleted."
  },
  {
   "method": "POST",
   "path": "/sim/runs/delete",
   "role": "admin",
   "summary": "Delete many runs at once; those not found come back under missing.",
   "body": {
    "ids": "[ids], 1..200"
   }
  },
  {
   "method": "POST",
   "path": "/sim/runs/:id/archive",
   "role": "admin",
   "summary": "Archive (archived: true, the default) or bring back (false) a run. Archived runs leave lists unless ?archived=1 (only archived) or all.",
   "body": {
    "archived": "true | false"
   }
  },
  {
   "method": "POST",
   "path": "/sim/runs/archive",
   "role": "admin",
   "summary": "Archive or bring back many runs at once.",
   "body": {
    "ids": "[ids], 1..200",
    "archived": "true | false"
   }
  },
  {
   "method": "DELETE",
   "path": "/backtests/:id",
   "role": "admin",
   "summary": "Delete a backtest and its calibration pair, for good (404 when not the tenant's). Event backtest.deleted."
  },
  {
   "method": "POST",
   "path": "/backtests/delete",
   "role": "admin",
   "summary": "Delete many backtests at once; those not found come back under missing.",
   "body": {
    "ids": "[ids], 1..200"
   }
  },
  {
   "method": "POST",
   "path": "/backtests/:id/archive",
   "role": "admin",
   "summary": "Archive (archived: true, the default) or bring back (false) a backtest. Archived backtests leave lists unless ?archived=1 (only archived) or all.",
   "body": {
    "archived": "true | false"
   }
  },
  {
   "method": "POST",
   "path": "/backtests/archive",
   "role": "admin",
   "summary": "Archive or bring back many backtests at once.",
   "body": {
    "ids": "[ids], 1..200",
    "archived": "true | false"
   }
  },
  {
   "method": "DELETE",
   "path": "/designs/:id",
   "role": "admin",
   "summary": "Delete every version of the tenant's own design (templates are never touched; runs keep their results), for good (404 when not the tenant's). Event design.deleted."
  },
  {
   "method": "POST",
   "path": "/designs/delete",
   "role": "admin",
   "summary": "Delete many designs at once; those not found come back under missing.",
   "body": {
    "ids": "[ids], 1..200"
   }
  },
  {
   "method": "POST",
   "path": "/designs/:id/archive",
   "role": "admin",
   "summary": "Archive (archived: true, the default) or bring back (false) a design. Archived designs leave lists unless ?archived=1 (only archived) or all.",
   "body": {
    "archived": "true | false"
   }
  },
  {
   "method": "POST",
   "path": "/designs/archive",
   "role": "admin",
   "summary": "Archive or bring back many designs at once.",
   "body": {
    "ids": "[ids], 1..200",
    "archived": "true | false"
   }
  },
  {
   "method": "PUT",
   "path": "/selves/:handle/tools",
   "role": "admin",
   "summary": "Which tenant tools a self may call during work (its charter's authority.tools) and whether it may use tools with effects.",
   "body": {
    "tools": "[tool names; a trailing * matches a prefix; [] none]",
    "effects": "read (default) | act"
   }
  },
  {
   "method": "GET",
   "path": "/tenant",
   "role": "member",
   "summary": "This tenant: name, timezone, settings (a webhook secret never), what its model calls resolve to, and its members."
  },
  {
   "method": "GET",
   "path": "/tenant/members",
   "role": "member",
   "summary": "Who may manage this tenant: the owner of record, admins and members, by account id with the email beside it."
  },
  {
   "method": "GET",
   "path": "/work/schedules",
   "role": "member",
   "summary": "Standing work: each schedule, its cadence, when it runs next, and its last run.",
   "query": {
    "self": "only this self's"
   }
  },
  {
   "method": "POST",
   "path": "/work/schedules",
   "role": "admin",
   "summary": "Give a self standing work. A task answers its instructions; research reads the web for its topics (one per line) into the self's memory. Times are the tenant's timezone.",
   "body": {
    "self": "handle",
    "kind": "task|research",
    "title": "",
    "instructions": "",
    "every_hours": "1..672, default 24",
    "at_hour": "0..23 or null",
    "weekdays": "[1..7] ISO, or null for every day",
    "review_required": "true holds the output for a person",
    "deliver": "an object your product reads when it is done, e.g. {slack: true}",
    "status": "active|paused",
    "by": "who"
   }
  },
  {
   "method": "PATCH",
   "path": "/work/schedules/:id",
   "role": "admin",
   "summary": "Change a schedule. A new cadence counts from its last run.",
   "body": {
    "...": "any field of POST /work/schedules except self"
   }
  },
  {
   "method": "DELETE",
   "path": "/work/schedules/:id",
   "role": "admin",
   "summary": "Remove a schedule. Its items stay."
  },
  {
   "method": "POST",
   "path": "/work/schedules/:id/run",
   "role": "admin",
   "summary": "Run it now, unless an item of it is already queued or running. Its cadence is untouched.",
   "body": {
    "by": "who"
   }
  },
  {
   "method": "POST",
   "path": "/work/items",
   "role": "member",
   "summary": "Ask a self for one piece of work. It is run as a `work` job; watch for work.done in /events. With start_after (added in contract version 1, additive) it is one-off work at a set time: the item waits queued and is not started before then; a time already past starts it at once.",
   "body": {
    "self": "handle",
    "title": "what you would like done",
    "instructions": "",
    "requested_by": "who",
    "kind": "request|handoff",
    "parent_id": "the item this was handed on from",
    "start_after": "optional ISO 8601 date and time with its offset, at most 366 days ahead, such as 2026-12-01T09:00:00Z"
   }
  },
  {
   "method": "GET",
   "path": "/work/items",
   "role": "member",
   "summary": "Items newest first, a page at a time, with counts per local day and status.",
   "query": {
    "self": "only this self's",
    "status": "queued|running|needs_review|approved|rejected|done|failed",
    "day": "YYYY-MM-DD, local",
    "before": "the last id of the previous page",
    "limit": "1..100",
    "days": "how many days of counts, default 14"
   }
  },
  {
   "method": "GET",
   "path": "/work/items/:id",
   "role": "member",
   "summary": "One item, its output {text, sources, summary}, and its schedule."
  },
  {
   "method": "POST",
   "path": "/work/items/:id/retry",
   "role": "member",
   "summary": "Put a failed item back in the queue, as it was asked."
  },
  {
   "method": "POST",
   "path": "/work/items/:id/deliveries",
   "role": "member",
   "summary": "Record what your product did with a finished item's output on one channel (the core delivers nowhere itself). Replaces that channel's record.",
   "body": {
    "channel": "e.g. slack",
    "results": "[{channel, posted, why?}] or whatever your product reports"
   }
  },
  {
   "method": "POST",
   "path": "/work/items/:id/review",
   "role": "admin",
   "summary": "Decide an item that waited for review.",
   "body": {
    "decision": "approved|rejected",
    "by": "who",
    "note": "why",
    "rating": "-2..5"
   }
  },
  {
   "method": "GET",
   "path": "/jobs",
   "role": "member",
   "summary": "Recent and pending jobs, and the model slot's state."
  },
  {
   "method": "GET",
   "path": "/hub/tools",
   "role": "member",
   "summary": "Shared tools this tenant may call through the core (web and news search first), each with its effect, licence and AI-use terms, today's limit and use. The provider's key stays in the core."
  },
  {
   "method": "POST",
   "path": "/hub/tools/:name/call",
   "role": "member",
   "summary": "Call a shared tool. Items come with provenance and the provider's terms; any that address a model are withheld with the reason. 402 off the subscription, 403 an effect beyond observe without an admin key, 429 at the daily limit or the provider's rate.",
   "body": {
    "args": "the tool's arguments, e.g. {query, count?, freshness?, country?}"
   }
  },
  {
   "method": "GET",
   "path": "/usage",
   "role": "member",
   "summary": "What this tenant used, per day of its own time zone (added in contract version 1, additive): selves (calls, tokens in and out, seconds of model time; per self with by=self), hub (calls and cost in micro-dollars), web_search (used, refused, cost in US dollars), runs (started, and the sum of each number runs were charged under their cost keys), sim_runs (created, by status), compute_jobs (submitted, by kind: their compute units are the compute server's records, not the core's), and totals. The core holds no price per model token, so there is no money figure for selves. When the tenant set ceilings (PATCH /tenant { budgets }, see the note budgets) the report also carries `budgets`: the ceilings and, per self, world and run, each limit with what is used and left.",
   "query": {
    "days": "1..90, default 30",
    "by": "self, for the selves' use per self per day"
   }
  },
  {
   "method": "GET",
   "path": "/hub/usage",
   "role": "member",
   "summary": "This tenant's hub use per day and tool: calls, cached, refused, items, withheld and cost.",
   "query": {
    "days": "1..90, default 30"
   }
  },
  {
   "method": "GET",
   "path": "/hub/calls",
   "role": "member",
   "summary": "The hub's audit for this tenant: every call, refusals included, newest first.",
   "query": {
    "limit": "1..500, default 100"
   }
  },
  {
   "method": "GET",
   "path": "/web-search/today",
   "role": "member",
   "summary": "Today's web search allowance (one per tenant, midnight to midnight in Europe/London): the limit, searches used, refused and avoided by the cache, the hit rate and the cost, per kind of caller."
  },
  {
   "method": "GET",
   "path": "/web-search/usage",
   "role": "member",
   "summary": "Web search use per day and kind of caller: used, refused, avoided by the cache, hit rate and cost.",
   "query": {
    "days": "1..90, default 30"
   }
  },
  {
   "method": "PUT",
   "path": "/web-search/allowance",
   "role": "admin",
   "summary": "Set the tenant's daily web search limit and the share each kind of caller may use.",
   "body": {
    "daily_limit": "searches a day, or null for the platform default",
    "shares": "{research?, sources?, interactive?: a fraction 0..1, or null for no cap}"
   }
  },
  {
   "method": "POST",
   "path": "/web-search/ask",
   "role": "member",
   "summary": "Before a product searches on its own key: a fresh cached result (free, not counted), or one search taken from today's allowance. 429 with reason limit when the day or the caller's share is spent.",
   "body": {
    "kind": "news|web",
    "query": "",
    "freshness": "pd|pw|pm|py",
    "country": "two letters",
    "caller": "interactive|research|sources",
    "cached_only": "true: the cache only, nothing taken from the day"
   }
  },
  {
   "method": "POST",
   "path": "/web-search/results",
   "role": "member",
   "summary": "Keep what a product's own search returned, so the next caller with the same search is served from the cache while it is fresh.",
   "body": {
    "kind": "news|web",
    "query": "",
    "freshness": "",
    "country": "",
    "items": "[{title, body?, url?, publishedAt?, via?}]"
   }
  },
  {
   "method": "GET",
   "path": "/contract",
   "role": "member",
   "summary": "This contract."
  },
  {
   "method": "POST",
   "path": "/mcp",
   "role": "member",
   "summary": "The same capabilities as MCP tools, for agents. Streamable HTTP, both protocol eras."
  },
  {
   "method": "GET",
   "path": "/mcp",
   "role": "member",
   "summary": "405. The GET stream was removed in MCP 2026-07-28; named here so the refusal is contractual rather than a gap."
  },
  {
   "method": "DELETE",
   "path": "/mcp",
   "role": "member",
   "summary": "405. Sessions were removed in MCP 2026-07-28; there is nothing to delete."
  },
  {
   "method": "POST",
   "path": "/people/:key/erasure",
   "role": "admin",
   "summary": "Forget one person of yours, for good: the person and every memory about them, superseded ones included. Dry run by default (counts, writes nothing); a real erasure needs dry_run false and confirm equal to the key, and writes a receipt (counts, the key only as a hash) into the tenant's erasure chain. Added in contract version 1, additive.",
   "body": {
    "dry_run": "true (default) | false",
    "confirm": "the person's key, for a real erasure"
   }
  },
  {
   "method": "POST",
   "path": "/tenant/keys",
   "role": "admin",
   "summary": "Mint a narrower key, shown once: role member with a subject (it reaches that subject's selves and person only, enforced by the core) or role aggregate (aggregate routes only, counts never rows). Added in contract version 1, additive.",
   "body": {
    "role": "member | aggregate",
    "subject": "your own id for the person (member keys from this route)",
    "label": "a name for the key"
   }
  },
  {
   "method": "GET",
   "path": "/tenant/keys",
   "role": "admin",
   "summary": "The tenant's keys by prefix: role, label, subject, when made and revoked. Never the keys themselves. Added in contract version 1, additive."
  },
  {
   "method": "DELETE",
   "path": "/tenant/keys/:prefix",
   "role": "admin",
   "summary": "Revoke a subject or aggregate key by its prefix (admin keys are revoked on the platform). Added in contract version 1, additive."
  },
  {
   "method": "GET",
   "path": "/selves/aggregate",
   "role": "member",
   "summary": "Counts of the tenant's selves by kind or status, or of their episodes by type, with groups of fewer than five selves folded into other. The one kind of route an aggregate key may read besides persona aggregates. Added in contract version 1, additive.",
   "query": {
    "by": "kind (default) | status | episode_type"
   }
  },
  {
   "method": "POST",
   "path": "/selves/:handle/days",
   "role": "member",
   "summary": "Live one planned day ahead as this self: the stops met in order by one life that carries what happened earlier (energy, feeling, earlier moments) into what comes later; a moment per stop {at, title, text, feel -1..1, energy 0..1} and a summary. estimate_only returns the cost (model calls) and runs nothing; record true keeps the day as one episode (origin rehearsal) on the self. The project's content policy applies. Added in contract version 1, additive.",
   "body": {
    "date": "YYYY-MM-DD",
    "place": "optional",
    "stops": "[{at: HH:MM, title, text, place?, images?: [https]}], in the order of the day, at most 24",
    "conditions": "optional text, for example from GET /places/conditions",
    "record": "true to keep the day as an episode",
    "estimate_only": "true for the cost only"
   }
  },
  {
   "method": "POST",
   "path": "/personas/:handle/days",
   "role": "member",
   "summary": "Live one planned day ahead as this persona, as POST /selves/:handle/days (nothing is recorded on a persona). A persona that stands for a real person needs its consent reference; the project's content policy applies. Added in contract version 1, additive.",
   "body": {
    "date": "YYYY-MM-DD",
    "place": "optional",
    "stops": "[{at: HH:MM, title, text, place?, images?}]",
    "conditions": "optional text",
    "estimate_only": "true for the cost only"
   }
  },
  {
   "method": "GET",
   "path": "/places/conditions",
   "role": "member",
   "summary": "Conditions for a place on a date: temperature range, rain, wind and cloud from monthly normals (CHELSA V2.1 climatologies 1981-2010 at about 1 km, CC0; basis climatology, source and citation named) and daylight hours computed from the sun. Not a forecast: for days ahead run the compute kind weather.forecast. Added in contract version 1, additive.",
   "query": {
    "lat": "degrees",
    "lon": "degrees",
    "date": "YYYY-MM-DD"
   }
  }
 ],
 "notes": {
  "tenant_creation": "POST /platform/tenants answers 201 with { tenant: {id, name}, admin, member, allocation }. admin and member are the two keys, plain strings, shown this once (the core keeps only their hashes); the admin key makes selves, decides proposals and changes settings, the member key reads and records. allocation is { selves, sources, dailyCalls }.",
  "events_feed": "GET /events answers { events: [ { id, at, kind, handle, data } ] } in order, those with an id above `after` (1 to 500 of them, 100 by default); the cursor is the last id you saw. handle is the self the event names, or null. data depends on kind.",
  "proposal_events": "proposal.raised and proposal.refused carry data { proposal: id, change: { kind, key, value } or a removal, rationale (cut at 400 characters), faults: [] } (faults hold the core's reasons when it refused the proposal itself). proposal.decided carries { proposal, decision: approved|rejected, by, change }. A proposal is answered with POST /proposals/:id and an ADMIN key of the tenant; a member key is refused with 403; `by` names who decided and is kept with the decision. An open proposal on the same kind and key is superseded when a newer one is raised.",
  "accepted_kinds": "A self's `kind` is free text (default self): persona is accepted and stored as given and changes nothing the core does. An identity row's kind is one of value, trait, commitment, taste, voice, expertise, relationship, or one the tenant declared in settings.identityKinds; its key is any text of 1 to 200 characters and its value any JSON. A commitment with the key ai and any value is therefore accepted as plain data; the core attaches no meaning to it.",
  "years_before": "In population.personas, years_before (0 to 100 whole years) makes a persona linked to a self begin that many years younger than the self is now: age at start = age now less years_before, never below 0. The world's start is the BEGINNING of the years lived, not the day after them: a world started years_before years ago and run for that long ends with the persona as old as the self is now.",
  "webhooks": "Delivery by webhook is the same stream as GET /events, in order, signed: the body is { tenant, events: [ { id, at, kind, handle, data } ] }, the header lw-signature is the hex HMAC-SHA256 of the raw body under the secret that PATCH /tenant returned once, a receiver answers 2xx to accept, and anything else is tried again from the same event (at least once: a receiver that sees an id twice drops it). PATCH /tenant webhook takes { url, handles?, kinds? } (added in contract version 1, additive): handles keeps the events that name one of those selves (an event that names no self, such as a world's, is left out when handles is given), kinds keeps the kinds named exactly or by a prefix ending in * (world.*), both must hold, and an event a filter leaves out is never sent and never comes back (the cursor moves past it); with neither, every event is sent, as before. Retention: events are never deleted by the core; they stay readable through GET /events for the life of the tenant, and the erasure of a self deletes the events that name it. The events of a world (world.*) name no self, so a self, paused or not, is never the subject of one; world.paused, world.running, world.advanced and world.done also carry world_time, the world's own date at that tick (ISO 8601, UTC), the same as `at` of the world's answer.",
  "budgets": "Ceilings per self, world and run (added in contract version 1, additive). Set by a tenant admin with PATCH /tenant { budgets } (null clears them), kept in the tenant's settings; all are optional and none set means the core behaves as before. A ceiling applies to every self, every world and every run of the tenant, and is counted in what the core already meters for GET /usage (nothing new is counted): a self in its calls, tokens_in, tokens_out and seconds (the thinking ledger of the usage report's `selves`), over a day and over its whole life; a world in its ticks (the ticks it has logged, each with the time it was written), over a day and over its life; a run in any key it is charged under (the keys of the report's `runs.cost`), over its life. A day is the day the ledger is kept in, the tenant's own time zone (UTC unless the tenant set one). A run's cost is kept as one total with no day, so a run has a life ceiling only (a day ceiling on a run is refused with 400 when it is set); a world's ticks are counted in the tenant's own day, not in UTC unless that is the tenant's zone, and a tick written before the core kept its time of writing counts in the life only. A call that would pass a ceiling is refused before anything is spent: 429, code budget_exhausted, { error, code, reason, budget: { scope, id, window, meter, limit, used } } where reason names the scope, the id, the window, the limit and the amount used; the headers are those of the rate_limits note: RateLimit-Remaining 0, RateLimit-Limit the limit, and for a day window Retry-After and RateLimit-Reset at the next midnight of the tenant's day; a life window carries none, and it never lifts. A thought of a self, a world's run and a world's step are refused when the amount used has reached the ceiling (a step also when its ticks would pass it); a running world stops at its ceiling (the day's or the life's) and is paused, to be run again after the day's midnight; a charge to a run is refused when the total it would bring the run to is over the ceiling. The model call itself is unknown until it ends, so a single call can end past a token or seconds ceiling by its own size. What is left is read on GET /usage as `budgets` (only when ceilings are set): the ceilings and, per self, world and run (500 each, newest first), each limit with used and left.",
  "life_over_a_span": "One self's life over a past span is a compute job, not a chain of world calls: POST /compute/jobs with kind lw.life_run and params { seed?, birth_date? (ISO date), span_months? or until?, time_scale? (world days per clock day), member?, limit?, after?, mode? (run or rehearse) }; the project must be in the operator's compute list. POST /compute/estimate takes the same kind and params and answers what the span would cost at most, in the contract's units, before anything is started. The wire checks the types of the parameters; the worker enforces the ranges (span_months 1 to 1440, limit 1 to 10000) and refuses with a code that begins the error text. The result carries items, each { id, kind (episode, relationship, formative_event or opinion), month, world_time (ISO date), tick }, with an id that is stable for the same seed and parameters, an items_total, next_cursor (the id to send as `after`; null at the end) and a clock { birth_date, time_scale, age_months, clock_days, world_date }. The same seed gives the same items. A caller asks POST /compute/estimate first for the cost, then reads state and progress from GET /compute/jobs/:id once the job is started. Synthetic only: a real person's record is refused by the worker.",
  "rate_limits": "A 429 answer carries { error, code } and, from the hub, the allowance and the budgets, { reason }. code is budget_exhausted (a ceiling the tenant set is reached: see the note budgets), places_taken (the runs or worlds a tenant may have at once are all in use), daily_limit (a day's allowance of searches or of a shared tool is used up; it resets at 00:00 UTC) or provider_rate (a provider is at its own rate; try again after the time the message names). The sentence in error is unchanged for version 1 callers. A 429 also carries headers (added in contract version 1, additive): RateLimit-Remaining: 0 always; RateLimit-Limit when the limit is a number (the runs or worlds at once, a day's calls of a shared tool, a day's searches); and Retry-After with RateLimit-Reset, both whole seconds, when the time it lifts is known: a shared tool's day at the next 00:00 UTC, the web searches at the next midnight of the allowance's own day (LW_ALLOWANCE_ZONE, Europe/London unless the operator sets another), a provider after the wait its message names. places_taken carries no Retry-After: a place frees when a run ends, and the core does not guess when. A 429 with the code rate_limited carries only RateLimit-Remaining.",
  "vocabulary": "Four words are fixed across the platform's pages and routes (added in contract version 1, additive; no route changes). A WORLD is a place with a clock that selves or a population live in: /worlds, it has a tick, can be paused, stepped, jumped and branched. A RUN is one execution that is recorded as it happens: a simulation run (/sim/runs), a swarm run (/swarm-runs), a design's run (/designs/:key/runs), a compute job (/compute/jobs) or a recorded agent run (/runs); a run is never a world, though a run may make or use one. A DESIGN is a saved, versioned template for asking or measuring (audience-test, ab-test, panel-delphi, diffusion, or the tenant's own): /designs and /swarms; running a design makes runs. A PANEL is the set of members a design puts a question to: the selves of a swarm or the personas drawn from a pack; it is a part of a design, not a separate object and not a route. A TEST in a route name means a design of kind audience-test or ab-test, never a trial run of the service.",
  "persona_world": "A world made only of personas (POST /worlds with population.personas) may hold a single member: a persona world, one life followed through the world's clock, with no ties to others and no word of mouth; it remembers, meets life events and is voiced as any member (added in contract version 1, additive). A population world (population.simulate) still holds 2..20000 members, and a persona world of two or more members (several handles, or copies) is checked as before.",
  "moment_measures": "A voiced intervention's params.voice.measures may hold, beside its scale measures, moment measures {key, kind: \"moment\", label?, prompt?: at most 1000 characters} (added in contract version 1, additive; a list without a moment means what it meant). A scale measure is rated by semantic similarity (SSR) into a distribution over its points, and that rating is what moves the member's opinion; a moment is not rated: the member says in their own words how the moment was (prompt, or \"how this moment was for you\") and gives a feel from -1 (bad) to 1 (good). The words are remembered with the feel as their tone and move no opinion. Every key is named once, a list holds at least one scale measure, and a moment measure is refused outside a world's voiced intervention (POST /sim/runs measures). GET /worlds/:id/voices carries each answer's moments {key: {text, feel}} and, per voiced moment, moment_measures {key: {answered, prompt, label?, feel_mean (weighted by what each member stands for, null when none answered), answers: at most 12 {member, text, feel}}}; GET /personas/:handle/memories carries a voice's moments too. A reply whose moment has no words or no numeric feel leaves that moment out; nothing is invented.",
  "compute_webhooks": "A compute job's end, sent to the project (added in contract version 1, additive). A tenant admin makes the project's secret with POST /compute/webhook-secret (shown once; replacing it stops the old one at once), then POST /compute/jobs takes webhook: an https address on the public internet (or one the operator granted the project), refused with 409 while the project has no secret and with 503 while this core relays no webhooks. When the job ends (done, failed or cancelled), Ipnops calls the core's own receiver, POST /compute/hooks/ipnops, which takes no project key: it checks Ipnops' x-ipnops-caller-signature with the secret Ipnops handed the core's account and answers 202 whatever job it names, so the answer tells nobody whose job it is. For a job a project started with a webhook, one delivery is queued (a repeat of the same job and state queues nothing more); it reads the job again from Ipnops and POSTs { type: \"compute.job.ended\", at, id, kind, state, error, job } (job as GET /compute/jobs/:id shows it) to the project's address with no redirect followed, signed with the project's secret in Ipnops' scheme: webhook-id msg_<job id>_<state> (the same on every retry), webhook-timestamp (Unix seconds of the attempt), webhook-signature v1,<base64 HMAC-SHA256 of \"<webhook-id>.<webhook-timestamp>.<raw body>\"> keyed with the bytes of the base64 after whsec_ (Standard Webhooks v1; reject a timestamp more than 300 s from your clock), and x-lw-signature sha256=<hex HMAC-SHA256 of the raw body keyed with the whole secret as UTF-8>. An answer other than 2xx is tried again by the core's clock, three attempts ten minutes apart. Nothing is sent for a job of another project, a removed job, or after the secret is removed.",
  "retired": "A self's status is active, paused or retired. Retired is final: reads and the export still work, every other write to the self is refused with 409, no routine or work runs for it, and the status never changes back. POST /selves/:handle/erasure removes it for good."
 }
}