Rahat, end to end ↗ · ADR-018 · outcome contracts and independent evaluation

Rahat Harness Architecture

How a Rahat agent answers a message: one exact check, then the model reads, code checks, and a second model grades judgment. Bourdain, the where-to-eat agent, has answered through this harness since October 4.

Accepted In production since Oct 4 Judge in shadow 5 amendments · Oct 4–17
a model does it code does it, exactly a second model, fresh context a platform store control plane not built yet the message you're watching

One message, start to finish

Every message gets one exact check first. A lookup is answered by code. An ask, typed or tapped, goes to the harness, where the model reads and researches and code decides what counts as done. Pick a message to watch its path; hover or tap any box to see what happens there.

Watch
INBOUND · ONE EXACT CHECK, THEN THE MODEL Message Telegram · one trace id Exact command? the manifest's grammar · no guessing Lookup · code answers /list · /who · /where · /cost · /kb · /help Reply never empty Ask · handed over as words /coffee → “coffee” · /eat · /dessert · /save · “more” Devices & schedules own pipelines · no model lookup code reply · under a second ask anything else → the model as words THE HARNESS · EIGHT STEPS 1 Understand model → typed frame + a sanity check Reading rules tenant code 2 Contract code → checklist musts + shoulds 3 Execute model + tools cites evidence ids 4 Verify code → failures each with a hint 5 Judge fresh model in shadow today 6 Control send · repair · drop never empty 7 Render templates facts from evidence 8 Record trace + ledger the last ask kept the reply a must fails → repair with the hints, at most twice Memo cache not built yet Tools · allow-list knowledge base first · Maps · web no network if nothing to find calls evidence PLATFORM STORES · READ AT STEP TIME Where you are Telegram share or the phone's push Scoped state turn · session · day · trip · standing last ask · where you are (3 h) Knowledge base places · facts with source and time saves · gazetteer · feed mentions Source registry → web Maps grounding · search a place's own page Trace + cost ledger a span per step a row per billable event last ask · where you are base first · written back only for what the base lacks spans · cost Brake per ask: 12 tool calls · 10 searches · $0.50, a wide ask 18 · 14 · $0.80 · no daily cap · a degraded answer says so in one line
readyPick a message above to watch its path. Hover or tap any box to see what happens there.
What the picture shows. Code answers only what it can answer exactly: a lookup reads the knowledge base and the session, the same memory the harness reads. Everything that asks for something reaches the model, and only the model's answers are checked and judged. The facts in a reply come from evidence records with a source and a read time; the model picks places but never writes a number.

Where each part stands

As of October 17. Sections refer to the ADR.

Routing

Live
§2.1 · A4

One exact check, then the model. A command is a lookup or an ask; there is no second pipeline with a memory of its own.

The eight steps

Live
§2.2 · A1 · A3

Serving Bourdain since Oct 4, with the tenant's reading rules between Understand and Contract.

One model wire

Partly
§2.3

Every harness call goes through it. Three older paths outside the harness still reach the model their own way.

Manifest and outcomes

Live
§2.4 · §2.5

Grammar, tools, budgets and judge settings in manifest.json; a versioned outcome library per agent.

Evidence and knowledge base

Live
§2.6

Every fact with its source and read time. It now grows every night with no model: an open-data gazetteer, food feeds, places' own pages.

Sources and scoped state

Live
§2.7 · A2 · A5

A policy per host; five scopes with expiry; where you are from the phone or Telegram, for three hours.

The judge

Shadow
§2.8

Logs a verdict on every answer. It earns a say at 50 owner labels and 80% agreement; corrections have labeled answers since Oct 11.

Cost

Live
§2.9 · A1

A ledger row per billable event, /cost by day, week and month, a brake per ask. No daily cap.

Traces and evals

Live
§2.10

A span per step; outcome-scored replay every night. The golden set is re-recorded in November.

Gate order

Live
§2.11

Code gates run before model gates, in an order a test pins.

Memo cache · /prep

Not built
§2.1 · Phase 3

The cached answer for a repeated ask, and building a trip's knowledge base before the trip. The database-first path comes first.

A second tenant

Parked
Phase 4

Parked by the owner on Oct 11. Fraser checks workouts against a contract in code, but isn't a tenant.

Five amendments since it was proposed

Each one is the code catching up with something the household ran into. The ADR's §7 has the full text.

A1Oct 4 · 5 · 11

Reading rules, and a brake for wide asks

The first morning in serve mode answered seven of eight asks with nothing. Code now settles what the household's words make plain: a follow-up keeps the ask, no one named means the usual party.

A2Oct 14 · 15

Publisher feeds, by the owner's decision

Twenty event calendars and four food feeds are read even where robots.txt asks readers out. No mirrors, caches or proxies; failures show in the daily health line.

A3Oct 15

Research only when something is to be found

A save, a verdict or a question runs without the network, in two rounds. “Search”, “use Gemini” or “something new” always widens the hunt.

A4Oct 17

One brain, one memory

/coffee asked “where are you?” from an old trip's tables. Now an ask goes to the harness as words, and a lookup reads the harness's own memory.

A5Oct 17

Where you are

A location shared in Telegram, or pushed by the phone, is where every ask ranks from for three hours. A town said alone moves it too.

What the judge sees, and the say it has to earn

The judge can't be talked into agreeing, because it never sees the work: it gets the inputs and the answer, nothing in between, and it may not introduce a fact. Its say over a reply grows only as its verdicts match what the household actually said.

Executor · model + tools its prompt its reasoning its tool transcript earlier verdicts NEVER SHOWN What the judge receives the ask · the frame · the contract the structured answer the evidence records it rests on the agent's checklist, with examples Judge · fresh context Gemini Flash, temperature 0 model + prompt version pinned into every verdict row judgment outcomes only: never a fact, never a hard rule Per outcome pass / fail / unsure one line of reason the evidence ids it relied on a reason citing a fact not in evidence fails the judge's own validation AUTHORITY, EARNED BY AGREEMENT WITH THE OWNER'S LABELS shadow logs only · under 80% annotate one caution line · 80%+ block or repair 90%+ per outcome Bourdain's judge today At least 50 owner labels before anything leaves shadow; a judge falls a level after two weeks below its threshold. The verifier runs first, always: the judge grades only answers that passed every mechanical must.
What the picture shows. Independence comes from the boundary, not from a second vendor. The judge is pinned to a model and a prompt version, may not add facts, and stays advisory until its verdicts agree with the owner's own corrections and acceptances.

The knowledge base

One record per physical place, with two kinds of truth around it: what the web says, every claim with its source and read time, and what the household says, every save and verdict with who said it and when. Facts are never overwritten; a new reading is a new row, and the newest dated source wins.

HOW IT GETS IN · EVERY ROW CARRIES ITS SOURCE AND A TRACE every askkb_search your saveskb_save critics' listskb_list · kb_acclaim food feedsnightly · kb_mention the gazetteeropen data · promoted the seedmigrated, every field kb_place one physical location · brands group them id = name + geohash (or city + address) cuisine · price · status · founded format + room tags · merges logged WHAT THE WEB SAYS kb_fact · the evidence record claim · value · source url + name + rank method · read time · freshness · trace TYPED PROJECTIONS OF FACTS kb_hours kb_rating, counted kb_menu_item status · phone · site kb_acclaim ← a critic's list, dated about WHAT THE HOUSEHOLD SAYS kb_savewho · heard from kb_verdictchain · price · loved kb_visitwhen · who · what kb_aliasa misheard name views: recent meals · regularsvariety window · loved twice a report (“3.9 on their site”) is evidence too,and outranks the web for the household's bar about WHERE · COORDINATES NATIVE · MINUTES LABELED “ABOUT” kb_location kb_landmark kb_leg · trip or home
What the picture shows. The evidence record is one table, kb_fact; hours, ratings and menu items are typed projections of it, so every number in a reply traces to a URL and a time. The household's own words sit on the other side of the same place, as evidence of a different kind. The base now grows every night without a model, so an ask finds more of the answer already there.

Who owns what

Three kinds of code, three speeds of change. The control plane governs every agent and changes rarely. The harness runs one message and is built once. A tenant supplies data and tools, and is where product work happens week to week.

Control plane

core/ · new_plane/ · shared
  • Cost ledger: a row per model call, search, fetch and judge call; /cost.
  • Traces: one id per message, a span per step, a replay viewer.
  • Judge service: one call shape and calibration; checklists come from tenants.
  • Eval runner: outcome-scored replay from recorded calls, every night.
  • Weekly command screener: proposes commands; the owner approves.

Harness

core/harness/ · built once
  • Inbound: exact commands, then the model; lookups and asks.
  • Frame and contract schemas with bounded retries.
  • One model wire: tools, structured output, search, recorded calls.
  • Verifier, controller, renderer, recorder.
  • Scoped state and the time and place primitives.

Tenant: Bourdain

agents/bourdain/ · data and tools
  • Manifest: grammar, 22 tools, budgets, banned phrases.
  • System prompt and the reading rules.
  • Outcome library and judge checklist, versioned data.
  • Tools that read the knowledge base first.
  • Golden sets, kept private.

The order of work

ADR-018

The decision

AcceptedProposed Oct 3 with the owner's decisions.
Phase 1a

Foundations

Done · Oct 3Wire, ledger, traces, knowledge base, manifest, scopes.
Phase 1b

The loop

Done · Oct 4Verifier, controller, renderer, judge, eval runner.
Phase 2

Shadow

Done · Oct 4The harness ran beside the old route, with a daily diff.
Phase 3

Serve

Live · Oct 4Bourdain answers through the harness. Not done: /prep; the judge's say.
Phase 4

A second tenant

Parked · Oct 11A manifest, a library, a checklist, a table set.
The decision record: ADR-018 on GitHub The whole system: Rahat Architecture Updated October 17, 2026