# Bevia Local — Extension Protocol v1.5

> **Audience:** anyone (or any coding agent) building against a running
> Bevia Local engine — an input sensor, an output surface, an automation,
> an agent, a Lens. This document is the contract; the SDK
> (`@bevia/sdk`) is a convenience over it. If you can
> speak HTTP to localhost, you can build for Bevia in any language —
> including ones that don't exist yet.
>
> **Doctrine:** validation, never permission. The engine may say *"I
> can't understand this payload"*; it never says *"you may not build
> that."* Guardrails protect the owner's data, not Bevia's control.
> The owner decides what
> connects and what each connection may do; the engine only enforces
> the schema and the owner's grants.
>
> **The shape in one sentence:** Bevia is an open runtime around a
> closed constitutional engine. Open intake, open output, open events,
> an inert proposal door — and nothing that reaches past the doors the
> engine already governs.

## 1. The shape of the world

The Bevia engine is a local HTTP daemon on `127.0.0.1:<port>`. It never
listens beyond loopback unless the owner enables the LAN phone door.
Everything — Bevia's own Chrome extension, Obsidian plugin, desktop app
and developer workspace included — talks to it through this same
protocol. Third-party programs are not second-class: they use the
identical surface Bevia's own clients use.

```
anything ──POST /intake/*──▶ ┌──────────────────┐ ──ask, one understanding──────▶ anything
                              │   Bevia engine   │ ──GET /events/stream──────────▶ anything
anything ──POST /propose───▶  │                  │ ──POST /mcp (JSON-RPC)────────▶ any AI
                              │  governed World  │
anything ──POST /proposals/   │  (localhost)     │
           receipt ────────▶  └──────────────────┘
```

- **Inputs (sensors)** turn what something knows into evidence and POST
  it in. A sensor never ranks, filters, or interprets — the engine
  decides what matters (the 85%-maintenance doctrine).
- **Outputs (surfaces)** read the published World and render it. They
  never compute the map themselves.
- **Subscribers** react to what happened — a publication, a new
  Attention insight, an admitted capture — and do whatever they do.
- **Proposers** say *"I think X about Y"*. A proposal establishes
  nothing; the owner resolves it. An accepted `action` is an
  authorization the proposer carries out itself, reporting back with a
  receipt that becomes evidence.
- **Nothing touches the database.** The engine's data directory is
  private; the wire protocol is the only supported seam. This is what
  lets the internal schema evolve without breaking your program.

Finding the port: the desktop app displays it (Sensors room), pins it
across restarts (`engine-port` file in the engine data dir), and writes
it with a working token into `~/Bevia/Developer/bevia-workspace.json`
when you press **Build on Bevia**.

## 2. Pairing and capabilities — how a program earns a token

Every call is authenticated with a bearer token minted by pairing.
Pairing is owner-initiated: the desktop app shows a short-lived code
(Sensors room → pair), and the program exchanges it once:

```
POST /pair
{ "code": "<code from the app>", "name": "Thesis Guard", "kind": "extension",
  "capabilities": ["capture", "read", "subscribe", "propose"] }
→ { "sensor_id": "…", "token": "…", "capabilities": ["capture","read","subscribe","propose"], "pending": [] }
```

Store the token; send it on every request as `Authorization: Bearer
<token>`. The owner sees every paired program in the app — its name,
kind, what it may do, and what it asked for — and can revoke or narrow
any of them at any time. That is the entire permission system, and it
belongs to the owner, not to Bevia.

**Routes are gated by capability, never by kind.** `kind` is a
display label (`extension`, `browser`, `obsidian`, `developer`, `n8n`,
whatever names your program); what a token may do is its capability
set. The closed vocabulary:

| Capability | Opens | Default for |
|---|---|---|
| `capture` | `POST /intake/capture`, `/intake/validate`, the capture proxy | every paired program |
| `read` | one understanding at a time (`/world-inspect?entity=`), `/followthrough`, `/published-document`, `/world/history`, and the MCP answer tools at `/mcp` (Bevia's answer tools, or Verify's four: `reality_check`, `nuance_briefing`, `verify_holds`, `verify_brief` — §5b). The whole-World reads (`/world-snapshot`, `/publication`, `/world-inspect` with no entity, `/world-diff`) answer 403 `whole_world_owner_only` unless the key holds `control`. | `mcp`, `developer` — an AI client's (`mcp`) key reads only through `/mcp`; the other read doors refuse it (2026-11-18) |
| `evidence` | the originals: raw moment text (doors this SDK does not call) | `developer` |
| `ask` | routes that invoke the model the owner configured — `/query` and friends. They spend the owner's fuel. On a Bevia engine, `ask` with no `read` also opens the MCP answer tools (`bevia_ask`, `bevia_brief`, `bevia_ground`, `bevia_challenge`, `bevia_coach`, and `bevia_capture` with `capture`). | `obsidian`, `developer` |
| `subscribe` | `GET /events`, `GET /events/stream` | `developer` |
| `propose` | `POST /propose`, `/proposals`, `/proposals/withdraw`, `/proposals/receipt` | `developer` |
| `substrate_export` | `GET /export-substrate` — the WHOLE substrate. Renamed from `export` on 2026-09-09: a Block Share's `export` is a different, bounded right that never reaches this door. Pairing with `capabilities: ["export"]` is refused as `unknown_capability`. | nobody — owner-grant only |
| `source_contract` | `POST /source-contracts` (propose the declared structure of a custom source), `GET /source-contracts` (read back what is registered). Activation and revocation are the owner's, from the app — not doors a paired program can reach. Also `POST /dossiers`, `POST /dossiers/clue`, `GET /dossiers`, `GET`/`POST /dossiers/philosophy`, `POST /dossiers/stop`, `POST /dossiers/delete`, `POST /dossiers/name` (§4b). | any pairing may ask |
| `control` | the whole-World reads and the map (`/world-snapshot`, `/publication`, `/world-inspect` with no entity, `/world-diff`); the Experience Plane's knobs (projection settings, feedback, ratification); Blocks and Shares: `GET`/`POST /blocks`, `GET /blocks/vocabulary`, `POST /blocks/preview`, `POST /blocks/editions`, `GET`/`POST /shares`, `POST /shares/key`, `POST /shares/preview`, `POST /shares/revoke` (2026-11-18) | nobody — owner-grant only; never a Share's or an AI client's key |

**Asking for capabilities.** A pairing may ask for any of `capture`,
`read`, `evidence`, `ask`, `subscribe`, `propose`. The grant follows
one rule:

- **From this machine (loopback):** you get the self-serve capabilities
  you asked for. The whole World stays the owner's: see `control`.
- **A vault the Bevia app itself writes** is let in when it connects,
  with `capture` and `ask`: it sends notes in and asks, and never reads
  the World.
- **From another device (LAN):** you get your kind's default, and what
  you asked for beyond it is recorded as `pending`. The owner grants it
  from the app. A phone never reads the map by asking.
- `substrate_export` and `control` are never granted by asking. The owner grants
  them, after the fact, from the app (a host-only door).

Unknown capability names are refused by name (`400 unknown_capability`).
`GET /whoami` answers *"does this engine still recognize me, and what
may I do?"* — `{ sensor_id, name, kind, capabilities, pending }` — for
truthful linked-state UI. Off-device tokens carry a 90-day sliding
expiry; same-machine tokens do not.

## 3. Intake — `POST /intake/capture`

The evidence atom is the **conversation turn**: who said what, when,
where. Anything can be expressed this way — a chat is turns, a Garmin
run is one "turn" from a device, a Zotero annotation is one turn
quoting the source, a brokerage fill is one turn from the broker. The
engine compiles evidence into moments, episodes and the World; your sensor's only job is honest evidence.

```json
{
  "capture": {
    "thread_id": "zotero-annotations-2026-07-15",
    "source_platform": "zotero",
    "source_kind": "zotero_annotation",
    "source_url": "zotero://select/items/ABC123",
    "captured_at": "2026-07-15T18:20:00Z",
    "conversation": [
      {
        "speaker": "user",
        "text": "Highlighted: 'Spatial memory consolidates during sleep' — relates to my atlas-of-attention idea.",
        "emitted_at": "2026-07-15T18:19:42Z"
      }
    ]
  }
}
```

Field contract:

| Field | Required | Meaning |
|---|---|---|
| `capture.thread_id` | **yes** | Stable id for this stream of evidence. Re-sending the same thread upserts — duplicates are impossible by construction (`thread_id` + turn index is the identity). |
| `capture.conversation[]` | **yes** (non-empty) | The turns. Turns with empty `text` are skipped, not errors. |
| `conversation[].text` | per-turn | The verbatim evidence. The engine wants what WAS, not your summary of it. |
| `conversation[].speaker` | no | Who produced it (`user`, `assistant`, a name, a device). Defaults to `unknown`. |
| `conversation[].emitted_at` | no | ISO-8601 event time for this turn. **Event time matters:** the map anchors to when things happened, not when Bevia learned of them. Garbage stamps fall back safely. |
| `conversation[].follow_through` | no | `{ suggestion_id, relation: "intention" \| "report" }` — links this turn to a tracked suggestion from the follow-through document. Linkage on evidence is by declared carrier only; there is no free-form correlation field, by design. |
| `capture.captured_at` | no | ISO-8601 fallback time for the whole capture. |
| `capture.source_platform` | no | Human-readable origin (`zotero`, `garmin`, `terminal`). |
| `capture.source_kind` | no | Machine origin class; defaults to `extension_session`. Pick one and keep it stable. |
| `capture.source_url` | no | Deep link back to the source — this is the evidence trail users can drill into. |
| `conversation[].upstream_id` | no | The SOURCE's own immutable id for the record this turn transcribes — the citation key that lets a later reader point at the exact original. Not the de-duplication key; `thread_id` is not this. |
| `conversation[].source_appended_at` | no | When the source WROTE the row, if that differs from when the event happened. Kept as a disclosed fact and never read as event time. |
| `conversation[].record` | no | The source's own STRUCTURED record for this turn, verbatim JSON (a plain object, at most 32 KiB serialized; over the cap it is dropped whole, never truncated, and the turn still lands). Faithful content, never authority: no field here classifies the turn, establishes identity or claims standing. Which fields mean anything is declared by the engine's contract for the `source_kind`. |
| `capture.location` | no | WHERE the capture happened, when the source established it: `{ provider, domain_id, anchor_id, pose, label }`, posemesh-first. A domain is a namespace, not a coordinate frame; without a frame the place is recorded as nominated, never as occupancy. |
| `capture.session_facts` | no | `{ started_at, ended_at, total_turns, end_reason }` — facts the source states about the SESSION. Boundaries, never any turn's clock. |
| `capture.source_contract` | for namespaced kinds | `{ contract_id, manifest_digest? }` — which registered contract this capture is submitted under. Required for a custom (dotted) `source_kind`; the runtime resolves it against its own registry and stamps what the registry said. |
| `capture.source_version` | no | The source's own version of its structure, checked against the contract's. |
| `envelope` | no | Carried to every landed row's metadata verbatim (`capture_envelope`). NOT inert: the engine reads `watched_root` and `origin_remote` from it when resolving which project a row was filed under. Send only facts the source established. |

**Fields a caller may never send, at any level:** `evidence_shape` (how
evidence is shaped is declared engine-side per `source_kind`) and the
authority fields `source_object`, `source_state`, `source_attestation`,
`standing`, `scoring_basis`, `establishment_basis`, `role_basis`,
`authority`, `trusted`. A remote program carries raw source evidence; the
engine's trusted adapters establish source authority. The engine ignores
or verifies these (a forged attestation is refused and the capture lands
with no source object); the SDK refuses them before they leave.

Limits: 16 MB per request, 500 turns per capture (split bigger
streams). Responses: `200 { written, skipped, unchanged, item_errors }`,
`400` with the exact reason, `401` unpaired, `413` over limits, `503`
while a World is being cleared (retry once the pause lifts).

**Send everything the owner consented to; never pre-filter for
"importance."** Deciding significance is the engine's job, and
today's noise is tomorrow's insight (attention doctrine).

## 4. The playground — `POST /intake/validate`

The dry-run twin of capture: same auth, same shape-check, same
normalizer, **writes nothing**. This is how you (or your coding agent)
iterate:

```
POST /intake/validate  { ...capture body... }
→ { "valid": true, "would_create": 12, "skipped": 1, "errors": [] }
→ { "valid": false, "errors": ["capture.thread_id required"] }
```

Build loop: write → validate → fix → capture.

## 4a. Source contracts — `POST /source-contracts` (`source_contract`)

How a program tells this engine that a source it has never heard of is
ORGANIZED. A paired program REGISTERS a structure (a JSON manifest:
which field is the record's id, which is its clock, which fields group it,
whether the population is finite). The access key is the only permission:
a well-formed manifest is active on arrival
for the registering program, with no approval step. The owner may revoke
it from the app. Registering a structure is never agreement with the
builder's reading of the source.

```
POST /source-contracts { manifest }  → { receipt: { contract_id, manifest_digest, source_kind, source_version, adapter_name, adapter_version, runtime_id, status: active|revoked (proposed only on pre-2026-10-29 registries), proposed_at, activated_at?, authorized_sensor_ids, means }, already_registered, next }
GET  /source-contracts[?contract_id=] → { receipts: [...] }
```

Refusals at capture, by name: `contract_required`, `inline_manifest`,
`unknown_contract`, `contract_revoked`,
`digest_mismatch`, `source_kind_mismatch`, `source_version_mismatch`,
`sensor_not_authorized`.

## 4b. Dossiers — `POST /dossiers` (`source_contract`)

How a program says who or what a dossier is about, in one plain sentence
("Sophie works at Duke CE."), with clues added later ("her email is
sophie@duke.edu"). The sentence is taken as stated: no approval step, no
question back. The dossier's id is the engine's own. Your `key` is your
own name for it (a staff id, say): declaring the same key again replaces
that dossier's sentence and clues with the ones you send. Without a key,
each call is a new dossier. `revision` changes when the words change. A
dossier never merges or changes what the World holds.

```
POST /dossiers { sentence, clues?: [string], key?, name? } → { ok, dossier: { dossier_id, sentence, clues: [{ text, added_at, via }], sdk_key, declared_via, declared_by, revision, declared_at, updated_at, stopped_at, name }, created, changed }   (201 new, 200 restated; 409 when the name is taken)
POST /dossiers/clue { dossier_id, clue }            → { ok, dossier, changed }   (404 when the dossier is not yours)
GET  /dossiers                                       → { dossiers: [...] }        (only the dossiers you declared)
POST /dossiers/stop { dossier_id, stopped: true | false } → { ok, rule: 'dossier-lifecycle/v1', dossier, changed }   (404 when the dossier is not yours)
POST /dossiers/delete { dossier_id }                 → { ok, rule: 'dossier-lifecycle/v1', deleted: { dossier_id, filings, reading } }   (404 when not yours)
POST /dossiers/name { dossier_id, name }             → { ok, rule: 'dossier-name/v1', dossier, changed }   (404 when not yours; 409 when the name is taken)
```

**The name** (`dossier-name/v1`). `name` is who or what the dossier is
about, in your words ("Sophie"); at most 120 characters, taken as stated,
never derived from the sentence. No two dossiers of one owner share a
name — compared with case, width and spacing set aside — so a declare or
rename that would duplicate one is refused 409 ("You already have a
dossier named “Sophie”."); a dossier's own name again is no duplicate.
Naming never moves `revision`, so nothing is filed again. When a question
to `/query` carries a dossier's name as whole words, the Matter of the
sources filed into that dossier join the answer's evidence (owner asks
only).

**Stop updating, resume, delete.** `stopped: true` stops updating a
dossier: it is not filed or read again (no model call for it) and what it
has stays as it is; its readout says "Stopped updating on <date>" and each
dossier carries `stopped_at` (null while updating). Stopping twice keeps
the first date. New words or a clue on a stopped dossier are kept and it
stays stopped. `stopped: false` resumes; the next dossier run catches up on
what changed. Delete removes the dossier's declaration, filings and
reading, never Matter or sources; there is no undo.

Limits: a sentence up to 2,000 characters, up to 50 clues of up to 1,000
characters, a key up to 200. A paired program may not restate by
`dossier_id`; that is the owner's, from the app.

**The assessment philosophy.** One setting for the whole World: the lens
every dossier's Assessment section is written under. The default is
`evidence standards` (what each point rests on, how sure and why, what is
not known, another explanation, what would change the view). Send a
preset's name (`evidence standards`, `patterns and changes`, `promises and
follow-through`, `strengths and risks`) or your own plain words, up to
1,000 characters, taken as stated. A change makes each dossier be read
again on the engine's next dossier run; the call itself reads nothing.

```
GET  /dossiers/philosophy                 → { ok, philosophy: { text, kind: 'preset' | 'own' }, default, presets: [string] }
POST /dossiers/philosophy { philosophy }  → { ok, philosophy, changed, default, presets }   (400 when empty or too long)
```

## 5. Read — the published World (`read`)

Reads serve the **published** World: what the publication pass built
last, pinned, with completeness stamps — never a live replay of the
moving substrate. No publication yet ⇒ an honest `not_published`,
never an empty answer dressed as one.

**The World is history and present together.** The durable World a
publication carries (`durable_world`, schema
`bevia-durable-world-value/v1`) keeps a Matter whose basis was
superseded as a row with `current_standing: "superseded"`, beside the
lineage operation that moved it onto successors the World also holds.
That row is history, never population. `durable_world.matter.length` is
NOT the size of the World. The current World is the projection:

- **current Matter** = rows whose `current_standing` is one of
  `established | candidate | open | unknown` (`unknown` is current: the
  source carried no standing);
- Matter-scoped carriers (`anchors`, `where`, `occurred_when`, `facets`,
  `claim_versions`) follow their Matter;
- **relations** keep only those whose endpoints are current — a Matter id
  must be current; a `condition:<id>` endpoint must be one a current
  Matter declares; a NAMESPACED REFERENT in a source's own identity space
  (`pos_txn:T142-0818-0243`) is never a Matter and is always current;
- **references** keep those whose subject a current Matter holds;
- history carriers (`states`, `lineage`, `lineage_operations`,
  `applied_packets`, `measurements`) cross verbatim and carry no public
  contract.

The SDK ships this projection as `currentWorld()` / `world.current()`.

**What a Matter carries.** `id`, `claim` (null = a recorded unknown),
`member_of`, `current_standing`, `evidence_refs[]`, `contributors[]`,
`provenance { origin, note }` (origin is lawfully null: the compiler is
an instrument, not the origin), `unknowns[]` (verbatim, never trimmed),
`admitted_in`, optional `when`, `why`, `source_sequence`,
`support_population` (corroboration and recurrence as two numbers, never
one score), `conditions[]` and `succession` (a typed hold — `held` with
reason `no_successor | ambiguous_successor | successor_not_delivered` —
when the basis was superseded and no lawful successor could be
delivered; the Matter is current and disclosed as held).

**Evidence identity.** A receipt's `ref` is an exact identity:
`semantic_moment:<id>` or `raw_moment:<id>`, optionally `:span:<n>`. The
bare `moment:` prefix is retired; a reader that meets it may resolve it
only when the collection it sits in declares which store it meant.
Follow a receipt by identity or not at all — never by matching prose,
never by picking a neighbour.

**Condition history.** A Matter's `conditions[]` holds ONE row per
declaring record, in packet order, never edited: `id`, `status: open |
resolved | unknown`, `declared_when` (the declaring record's own clock),
`record_id`, `carrier_id`, `upstream_id`, `source_ref`, the declaration's
own `standing`, `carried_in[]` (packets that re-carried the same
declaration — provenance, never additional history) and `revised_from[]`.
The CURRENT status of a condition identity is its latest declaration by
the declaration's own clock (clocked before unclocked; then instant; then
declaring record; then admitting packet). Three source declarations
(11:30 open · 18:20 open · 23:58 resolved) are three rows and a current
status of `resolved`. A condition's references (names, asset ids) live on
`World.references` under the endpoint `condition:<id>`.

**Relations.** `{ id, subject, predicate, object, declarant,
evidence_refs, current_standing, admitted_in, succession?,
re_elected_from?, reference? }`. Predicates a source's own words may
establish: `corrects`, `contradicts`, `supports`. The predicate the
person's own explicit act establishes (Settle this, 2026-10-03;
`declared-decision` lane): `settles` — the act Matter ("You decided: …")
`settles` the reading Matter it answers; declarant `user:<id>`, evidenced
only by the act's own record, never by a reading or a model. Predicates a
source's own STRUCTURED REFERENCE FIELD may establish, under a lane contract:
`returns_against` (a POS return's `ref_receipt` → the transaction it
returns against). Such a relation always carries `reference`:
`{ basis: "source_declared_structured_reference", lane, reference_field,
reference_value, source_record_id, subject_identity, target_identity,
target_record_id, target_resolution: "exact" | "absent" | "ambiguous",
contract_predicate }`. It is `established` ONLY on an `exact` target that
names its record; an `absent` or `ambiguous` target crosses as a relation
of standing `unknown` with a null target — explicitly unresolved, never
bound to a likely candidate. The predicate is the lane contract's; no
caller may name one, and a reference predicate on any other basis is
refused.

**Relation succession** (ratified 2026-09-19). Succession is not
authority. When a relation's endpoint is superseded: exactly one
successor carries the receipts the endpoint cited for the relation → the
relation continues onto it (`succession: { status: "re_elected",
successor, declaring_refs }`, the predecessor row stays `superseded`,
pointing forward); no successor carries them → `held`, reason
`authority_not_carried`; several do → `held`, reason
`ambiguous_successor` — nothing chosen, nothing duplicated; withdrawn or
revoked → no continuation.

**Share-bounded reads.** A credential the owner minted against a Block
Share is a bounded reader whatever capabilities it lists: every read must
evaluate Share → Block → Rights → Edition and answer only from that
projection, or fail closed (`block_aperture_closed`). Generic `read` is
never sufficient for a Share credential, and a Share credential never
reaches the owner's whole World. That aperture is served through
`POST /mcp`, and it hands out answers and flat cited lists only
(2026-11-18): `bevia_brief` returns the Share's own understandings that
match the words, each `{ said, source, date }`, at most 12, no model; and
`bevia_ask`, only on a Share carrying the `answer` right, is answered by
the owner's AI under the owner's limit, reply `ask-answer-only/v1`. A
Share without `answer` is read by the recipient's own AI and spends
nothing of the owner's. Who answers is the maker's choice. The whole-World
doors below are the owner's only (the app, or a program the owner granted
`control`).

| Route | What it answers |
|---|---|
| `GET /world-snapshot` | The publication's World snapshot: `durable_world` (the governed World, HISTORY AND CURRENT — project it, see above), `published { version, basis_seq }`, `completeness`, `convergence`, and `publication_transition` when the newest publication carries no snapshot yet and an older one was served. Refuses at HTTP 200 with `{ world_snapshot_missing: true, code, reason }` (`not_published`, `pointer_unreadable`, `stale_builder`, `parse_failure`, `schema_unknown`, `builder_mismatch`, `wrong_principal`). The concept readings beside `durable_world` are an older layer and carry no contract. Owner only: 403 `whole_world_owner_only` without `control`. |
| `GET /world-inspect?entity=<id>` | `{ ok, inspection }` — why this Matter or relation exists: `found: matter \| relation \| not-established`, claim, standing, establishing spans, admitting packet facts, standing history, lineage, unknowns. Omitting `entity` asks for the index of every understanding: owner only. A namespaced referent endpoint answers `not-established`: it is a source identity, not a Matter. |
| `GET /world-diff?from=<seq>&to=<seq>` | The compass diff (North / East / South / West) between two states. Owner only: 403 `whole_world_owner_only` without `control`. |
| `GET /followthrough` | Every tracked suggestion and its assessment. |
| `GET /published-document?name=attention/insights` | Attention — what the publisher selected as worth noticing. Also `objectives/index`, `followthrough/index`, `objectives/goal/<id>`. |
| `GET /world/history?limit=` | The publication chain, newest first: `{ version, basis_seq, published_at, manifest }` each. |
| `GET /publication[?manifest=<hash>]` | One publication as a single document set — the World and every instrument document it carries. Owner only: 403 `whole_world_owner_only` without `control`. |
| `/territories` | Retired with the legacy geography it read; answers HTTP 410. |
| `POST /mcp` | JSON-RPC 2.0, `tools/list` + `tools/call`: the answer tools: `bevia_ask`, `bevia_brief`, `bevia_ground`, `bevia_challenge`, `bevia_coach`, and one write tool, `bevia_capture`. Open to `read`, or to `ask` alone on a Bevia engine. No tool hands out the World. If your surface is an AI, this is your door. For a Share credential it is the only door, and it is a Block aperture. |

**The World as it was.** Every read that takes `?manifest=<hash>`
(`/world-inspect`, `/published-document`, `/followthrough`,
`/world-diff`, `/publication`) answers from THAT publication, exactly
as it was published then. `GET /world/history` lists the hashes. A
timeline, a "what did I believe in March" view, a belief-change
explorer are all reads over this chain; none of them recompute
anything.

**Recall (`ask`, no spend).** `POST /recall { "names": ["aisle 8", "loc-7f3a"], "from": "2026-11-01", "to": "2026-11-14", "limit": 50 }` → the fast read for robots and agents: the meanings on the grid rows those names are (equality only, case and spacing set aside), in the window when one is given, newest first, each `{ matter_id, meaning, at, at_basis, axes[], open_conditions[], source_link }`, plus `unmatched` (names no row carries), `picked`, `left_out` (counted, never hidden) and `took_ms`. Names, a window, or both; `from` and `to` together. No model, no plan, no writer, and never behind Ask's one-at-a-time gate. Owner credentials only: a share-bound credential is refused `share_scoped`. `"me": true` adds the id the owner declared for this credential (refused `no_declared_identity` when none).

**Who is asking.** The owner declares, in the app, who a paired credential is — an anchor kind, an id and a label, e.g. `posemesh:participant` `galbot-echo-01` "Galbot Echo". No credential can declare its own. `GET /whoami` returns it as `declared_identity`. Ask reads it so "I" and "my" in a question look up that id; it is never evidence.

**Ask (`ask`).** `POST /query { "question": "…" }` → the engine's
grounded answer over the published map: `{ librarian, consultant,
evidence[], method, degraded }`, plus, when the engine produced them,
`answer_md` and `answer_plain` (the checked answer), `honest_gaps`,
`narrower_questions`, `confidence`, `coverage`, `stored_records`
(each found meaning with its check's verdict) and `responsiveness` — to
the owner's own app. Every other credential receives the answer only
(`ask-answer-only/v1`, 2026-11-18): `answer_md`, `answer_plain`,
`honest_gaps`, `narrower_questions`, `general_said`, the one clarifying
question, and `cited` — each `{ said, source, date }`, at most 12. An
absent field is not carried — never empty, never "checked". When the
owner has configured no AI fuel, the answer degrades honestly to a
deterministic grounded readout — handle both. `/query` spends the
owner's fuel, which is why it is its own capability.

Optional body fields: `scope` (where the person stands),
`clarification_response` (the answer to a `clarify` posture),
`trace: true` (adds `trace`, whose `plan` is what was searched), and
`conversation: { turns: [{ id, speaker: "person" | "bevia", text }] }`
— the chat's earlier turns, oldest first (`conversation-context/v1`).
The engine keeps the newest within its own limits and reads them only
to understand the new question; they are never evidence, and an
earlier Bevia answer never supports a claim. `trace.plan.conversation`
names the turns read, left out and shortened, and a plain disclosure
joins `honest_gaps` when any were left out. Not the same field as an
intake capture's `conversation[]`, which is evidence.

**The originals (`evidence`).** An owner-granted door returns the raw moment text behind a reading;
the SDK does not call it. Reads carry identifiers;
evidence text is only reachable through this capability.

## 5b. The MCP door on both engines — `POST /mcp` (`read`, or `ask` alone on Bevia)

One engine, two product modes: **Bevia** and **Verify**. Both serve
`POST /mcp` — JSON-RPC 2.0, `initialize`, `ping`, `tools/list`,
`tools/call` — under the `read` capability (on a Bevia engine, `ask`
alone opens the same answer tools), with a token earned by the same
pairing (§2). If your surface is an AI, this is your door on either
engine. `tools/list` always carries the current family: discover, never
hardcode a tool name.

**Bevia mode.** The answer tools: `bevia_ask`, `bevia_brief`,
`bevia_ground`, `bevia_challenge`, `bevia_coach`, and one write tool,
`bevia_capture` (with `ask` alone, only when the key also holds
`capture`). Each returns one answer with the sources it cites. No tool
hands out the World; with `ask` alone, any other tool name answers
`ask_answers_only`. A vault the Bevia app itself writes is let in when it
connects, with `capture` and `ask`. For a Share credential it is the only door, and it is a
Block aperture (§5).

**Verify mode.** Four tools, all read-only: no model call, nothing
written, nothing leaving the machine.

<!-- verify-tools: the rows of this table must equal, in order, what a
Verify engine's tools/list serves; the SDK's contract-drift proof
checks it against the engine source. -->

| Tool | Reads | Arguments | Answer |
|---|---|---|---|
| `reality_check` | Verify's published reality-evidence family, never the live store | `question?`, `project?`, `since?`, `until?`, `revision?`, `path_prefixes?`, `session?` | one text block: the JSON `bevia-reality-check/v1` result (below) |
| `nuance_briefing` | the World the engine holds, composed each time | exactly one of `repository_root` or `work_id`; `how_did_we_get_here?`, `depth?` | markdown text, and `structuredContent`: the briefing, or the lineage walk of one item |
| `verify_holds` | the person's own recorded Hold and Go ahead acts | `root?`, `paths?`, `area?` | plain text, and `structuredContent`: `{ held, holds[], authority }` |
| `verify_brief` | one whiteboard as the person sees it in Verify | `whiteboard` (required), `agent?`, `per_section?` | markdown text, and `structuredContent`: the brief, or `{ resolved: false, reason, candidates[] }` |

`reality_check` is Verify's main tool and is always served. The other
three are composed by the engine from the World it holds; an engine
without one lists `reality_check` alone. `tools/list` says which.

**`reality_check`.**

```
tools/call { "name": "reality_check", "arguments": {
  "question": "did the last agent finish this?",   // optional
  "project": "my-repo",        // repository name, folder name, or part of the origin remote
  "since": "<ISO>", "until": "<ISO>",   // default: the 14 days ending at the publication's clock
  "revision": "<commit SHA>", "path_prefixes": ["src/"],
  "session": "<the asking session's id>"  // scopes to that session's latest request; omit for the window
} }
```

The result is `bevia-reality-check/v1`: `publication` (the publication it
read — every result names it), `scope`, `coverage`, `assessment`
(`checked_current | landed_unchecked | partial | claimed_not_found |
implemented_undecided | regressed | inconclusive`), `summary`, `chains[]`
(per commit, pull request or path: `events[]` in four classes that are
never collapsed — what a person decided, what an agent claimed, what git
observed, what a command's own source declared — and `rungs[]` DECIDED →
CLAIMED → LOCAL → COMMITTED → PUSHED → MERGED → CHECKED_AT_REVISION →
CURRENT, each `observed | unsupported | unobservable`), `limits[]`, and
`answer { word, line, explanation[], safe_to_assume[], as_of }` — the
plain answer every surface prints as given. A rung Verify cannot see
never counts as a negative, and no rung means "correct".

Before the first publication that carries the family, the tool answers
`{ ok: false, code: "not_published", document, reason }` with
`isError: true`. That is the answer; say so and ask again after the next
publication. When capture moved the evidence since the last publication
and a refresh failed, the result carries `stale: { reason, note }` rather
than answering silently from the past.

**`nuance_briefing`.**

```
tools/call { "name": "nuance_briefing", "arguments": {
  "repository_root": "/abs/path/to/repo",   // or "work_id": "<a Work's id>" — exactly one
  "how_did_we_get_here": "<Matter id, or the line as the briefing shows it>",   // optional
  "depth": 12                                // with how_did_we_get_here only: default 12, at most 50
} }
```

What stands now for one job — the person's current goals, rules,
decisions and plan, with dates, their own words and what is locked in —
and what was tried and set aside (replaced, erased, changed, reopened:
history, never a rule by itself). Read it beside the repository's own
instruction files, never instead of them. With `how_did_we_get_here`
the answer is the lineage walk of that one item instead: what it
replaced and what replaced it, each step with who performed it and
when; a longer chain than `depth` names the next id rather than being
cut. The text block is the markdown; `structuredContent` is the typed
briefing (`aperture`, `generated_at`, `model_called: false`, `stands`,
`set_aside`, `left_out`, `not_read`, …) or walk (`item`, `back[]`,
`forward[]`, `more_above[]`, `more_below[]`, …).

**`verify_holds`.**

```
tools/call { "name": "verify_holds", "arguments": {
  "root": "/abs/path/to/repo",           // the repository root, as the person follows it in Verify
  "paths": ["src/billing/"],             // relative to the root, or absolute under it
  "area": "<an area name from the person's areas map>"
} }
```

Whether the person recorded a hold or an approval requirement on these
paths or this area. `structuredContent` is `{ held, holds: [{ record_id,
root, paths, area, words, at }], authority }`: branch on `held`, never
on the text. Verify reports the person's decision; Verify is not the
authority. No hold recorded is not a go-ahead: when in doubt, ask the
person.

**`verify_brief`.**

```
tools/call { "name": "verify_brief", "arguments": {
  "whiteboard": "<a repository folder or name, or a Work or suggested project board id or name>",
  "agent": "codex",        // optional: which coding tool you are, so the brief names the rules it does not load
  "per_section": 8         // optional: default 8, at most 40; every section says how many it left out
} }
```

Brings an agent up to speed on one of the person's whiteboards: the
goal, the rules (which coding tools load each), the plan, open
questions both ways, the exceptions that need the person, the holds the person
recorded, and the conversations to read for detail. An exact id or name
picks the whiteboard; anything else answers `{ resolved: false, reason,
candidates[] }` to choose from, never a guess. A resolved brief's
`structuredContent` is `{ resolved: true, whiteboard, as_of,
model_called: false, written: false, agent, sections, holds[],
conversations[], not_read[], authority }`.

A host tool that cannot answer (a missing or doubled Aperture, an item
the World does not hold) answers `{ ok: false, reason }` with
`isError: true`.

**What a Verify engine serves.** Verify is a product mode, not a second
engine: `GET /health` (answers `mode: "verify"`), `POST /intake/capture`,
`POST /pair`, `POST /mcp`, custom sources (`/source-contracts`,
`/intake/validate`: a builder registers and dry-runs, the owner may
revoke), and the owner's own doors (host-only). Every
other door in this document — `/whoami`, the World reads, `/query`,
`/events*`, `/propose*`, `/export-substrate` — answers
`404 { error, mode: "verify" }` on a Verify engine. The SDK types
that refusal `wrong_mode`. Evidence that needs one of Bevia's optional
intake lanes is refused by name at the shared capture door.

**Work is the owner's.** A Work — the bounded piece of work Verify reads
conversations against — is declared by the person in their own app
(a host-only door). It is not a
builder door and the SDK does not wrap it. What a program knows about
the work arrives as evidence through `POST /intake/capture`, where the
person's own declaration decides what it belongs to.

## 6. Events — `GET /events`, `GET /events/stream` (`subscribe`)

The runtime tells you what happened; you decide what to do about it.

```
GET /events                       → { ok, events: [], cursor, kinds }      (the head — start here)
GET /events?after=<cursor>        → { ok, events: [...], cursor, more }
GET /events/stream?after=<cursor> → text/event-stream                       (resume with Last-Event-ID)
```

The vocabulary:

| Event | When | `data` |
|---|---|---|
| `world.published` | the publication pass produced a new version | `version`, `basis_seq`, `manifest` |
| `attention.created` | an insight appears that the previous publication did not carry | `kind`, `headline`, `why_now`, `matter_ids`, `publication_version` |
| `capture.admitted` | a capture landed as a moment | `subject.id` = moment id, `source_kind`, `write_kind` |
| `proposal.created` / `proposal.resolved` / `proposal.withdrawn` / `proposal.receipt` | the proposal ledger moved | `subject.id` = proposal id; `resolved` carries `outcome` and, for an action, `authorized` |

Rules a subscriber can rely on:

- **Events carry identity, never evidence text.** A subscriber that
  wants the substance reads it through the read doors, gated by their
  own capability.
- **Pull, never push.** The engine never calls out. Your program
  connects; the stream polls the ledgers every two seconds and sends a
  keepalive comment every twenty.
- **No cursor = the head.** A fresh subscriber starts now. Read the
  World for the state; do not replay how it
  was built.
- **Every event's `id` is a cursor.** Resume from any event and nothing
  before it is replayed. Filter with `?kinds=world.published,attention.created`.
- **Retention.** Publication and proposal events are as durable as the
  publication chain and the ledger. Engine facts (`capture.admitted`)
  are read from the engine's own consequence ledger,
  which prunes completed rows after a few days — a subscriber away for
  weeks should re-read the World rather than expect every capture
  event.

## 7. Proposals — `POST /propose` (`propose`)

Anything that wants to push meaning or action toward Bevia uses this
door, never direct mutation.

```
POST /propose
{ "kind": "action",
  "subject": { "text": "the AAPL position", "matter_ids": ["…"] },
  "proposal": { "text": "Reduce the position by 20%." },
  "basis": { "evidence_refs": ["…"], "reason": "Two contradicting theses in this week's publication." },
  "expires_at": "2026-09-09T00:00:00Z" }
→ { "ok": true, "proposal": { "proposal_id": "…", "status": "proposed", … } }
```

`kind` ∈ `insight` · `relationship` · `objective` · `action` · `note`.
`proposal` is a non-empty object — `{ text }` or a typed proposition.

**What a proposal is.** A durable, inert row: *who* proposed *what*
about *which subject*, citing *what*. It establishes nothing, is never itself admitted
as evidence, and is never read as World truth (storing a proposal never
upgrades its standing). Only the owner resolves it — `accepted` or
`declined` — from the app, through a host-only door.
A decision is never silently overwritten (`409 already_resolved`).

**Governed actions.** An accepted `action` proposal is an
**authorization**: the `proposal.resolved` event carries
`authorized: true`, and the proposer carries the action out itself —
Bevia never executes anything in the outside world. When it is done,
it reports:

```
POST /proposals/receipt
{ "proposal_id": "…", "outcome": "done" | "failed" | "partial",
  "summary": "Sold 20% at 101.30, order 8812.", "source_url": "https://broker.example/orders/8812" }
→ { "ok": true, "proposal": { …, "receipts": [ … ] }, "moment_id": "…" }
```

The receipt lands twice on purpose: on the ledger (the linkage
decision → authorization → outcome, derivable from the proposal alone)
and as **one evidence turn** on the thread `bevia-proposal:<id>`
(`source_kind: runtime_receipt`, speaker = your program), so the World
sees what happened as an observation attributed to the program that
acted. Later observations about the outcome — a fill, a P&L line, a
follow-up — arrive through ordinary intake on the same thread.

Bevia owns: *was this proposed, who approved it, what authority
existed, what actually happened.* The action belongs outside.

`GET /proposals[?status=&id=]` lists yours (the host sees all).
`POST /proposals/withdraw { proposal_id }` retracts one still open.

## 8. The capture proxy

> The proxy observes. MCP serves. The wire is never edited.

An intake path for chat apps that cannot run the browser extension: the
engine relays a standard chat-completions endpoint to the owner's local
model server, byte for byte, and observes each exchange as raw evidence
under `capture`. The owner sets it up from the desktop app; the SDK does
not call it.

## 9. Export — `GET /export-substrate` (`substrate_export`, owner-grant only)

The whole portable bundle, the same NDJSON the Cloud emits, round-trips into
any Bevia host through the owner's import in the app. Export is free at every tier
(substrate is user-owned). The owner grants this capability to a
backup tool or a move to another machine from the app; a pairing cannot ask
for it. Most programs want neither: they ask (`ask`) and read one
understanding at a time (`read`).

## 10. Versioning promise

This is protocol **v1.5** (v1.2 — capabilities, events, proposals,
history, structured intake, source contracts, `GET /health`, the
governed-World read contract in §5; v1.3 — §5b: the MCP door stated for
both product modes, Bevia's tool family, and the doors a Verify engine
serves; v1.4 — §5b states Verify's four tools, `reality_check`,
`nuance_briefing`, `verify_holds` and `verify_brief`, where v1.3 named
`reality_check` alone; v1.5 — the whole World and the map are the owner's
only: `read` opens one understanding at a time and the MCP answer tools,
and `ask` alone opens the same answer tools on a Bevia engine). Nothing a
v1.3 program sends changed. What `read` opens narrowed in v1.5: a program
that read `/world-snapshot`, `/publication`, `/world-diff` or the
`/world-inspect` index with `read` alone now gets 403
`whole_world_owner_only`, the map is the owner's only, and the Bevia MCP
door lists the answer tools only. The commitment: **valid v1
evidence will be understood by every future engine version.** New
evidence kinds, richer schemas, new event kinds and new proposal kinds
arrive as additions, never as breaking changes to v1 fields. A token
paired before capabilities existed keeps exactly the access it had. If
the engine ever can't parse something, it tells you exactly why —
malformed payloads are rejected; meanings never are.

One read-side change since v1.1 is semantic rather than structural and is
stated plainly: since 2026-09-18 the durable World holds superseded
Matter beside current Matter. A program that treated
`durable_world.matter` as the World has been over-counting since then;
read the current projection (§5).

`GET /health` → `{ ok: true, service: "bevia-local" }`, unauthenticated
liveness; no substrate fact rides on it.

## 11. What we will never build

No approval program, no curated store, no revenue gate, no phone-home.
An extension is files on the owner's machine talking to an engine on
the owner's machine. Bevia never calls your program; your program
calls Bevia. Bevia never executes an action in the outside world; it
records that one was proposed, authorized and reported. Bevia's job is
to keep this contract legible, stable, and hard to corrupt — not to
decide what gets built. The weirder the better.

---

*Rendered from the Bevia Local extension protocol v1.5 for public readers:
owner-only doors are named only as host-only, and internal paths are
removed. This rendering is served at
<https://www.bevia.co/build/PROTOCOL.md>. Instructions for a coding agent:
[`AGENTS.md`](AGENTS.md) and the
[app-builder skill](skills/bevia-app-builder/SKILL.md).*
