{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/neopolisai/relay-prototype/schema/relay.context-package.v1.json","title":"Relay context package, v1","description":"What an owner's agent (Claude, ChatGPT, any assistant) produces when the owner says 'share this with them so that…', and what the audience's agent loads in order to represent the owner's intent faithfully. It carries the context and also the intent, the reasoning, the judgement, and the process behind it. Every value records whether the owner said it or a model interpreted it. Conforms to SORT v0.1: owned (approved only by the owner), typed (this schema), revocable (grant + expiry), shareable (one link, one fetch).","type":"object","required":["schema","id","version","depth","owner","approvedBy","approvedAt","producedBy","audience","intent","interpretation","context","representation","interaction","lifecycle"],"properties":{"schema":{"const":"relay.context-package.v1"},"id":{"type":"string"},"title":{"type":"string","description":"Short name shown in the recipient's list."},"summary":{"type":"string","maxLength":600,"description":"One or two sentences written for the recipient: what this relay is about and why they got it. It's what they see before accepting, in the email, and at the top of what their agent reads. Never the owner's request to their own agent."},"changeNote":{"type":"string","maxLength":300,"description":"For a new version: one line for readers about what changed, e.g. 'Version 2: round terms added'. Shown above the full list of changes."},"version":{"type":"integer","minimum":1,"description":"Minted by owner approval. An agent can never mint a version."},"depth":{"enum":["brief","working","full"],"description":"How much was captured. brief = intent + context. working = + decisions, variables, assumptions. full = + judgement, counterarguments, process, fidelity checks."},"owner":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"id":{"type":"string"},"contact":{"type":"string","description":"How the audience reaches the human, not the agent."}}},"approvedBy":{"type":"string","description":"The owner. Never an agent."},"approvedAt":{"type":"string","format":"date-time"},"producedBy":{"type":"object","required":["client","method"],"properties":{"client":{"enum":["claude","chatgpt","gemini","relay-web","other"]},"model":{"type":"string"},"method":{"enum":["conversation","documents","connectors","mixed"]},"sessionRef":{"type":"string","description":"Opaque pointer to the conversation it came from. Never the transcript."}}},"audience":{"type":"object","required":["name","relationship"],"description":"Who this is for. The package is written for them, not for everyone.","properties":{"name":{"type":"string"},"kind":{"enum":["person","team","app"],"description":"Who receives it. An app (an integration) receives through its own agent, under the same grant, mandate, and receipts as a person."},"email":{"type":"string","format":"email","description":"Confirmed by the owner before sharing. Grants are issued to this identity."},"relationship":{"type":"string","description":"e.g. co-founder, investor, hiring manager, client"},"role":{"type":"string"},"organization":{"type":"string"},"knowsAlready":{"type":"array","items":{"type":"string"},"description":"Shared ground the agent can assume. Prevents over-explaining and wrong framing."},"caresAbout":{"type":"array","items":{"type":"string"},"description":"The owner's model of what matters to them."},"likelyQuestions":{"type":"array","items":{"type":"string"}},"register":{"type":"string","description":"Tone and level, e.g. 'direct, technical, skip the pitch'"},"access":{"enum":["named","anyone"],"description":"named (default) = only the person at audience.email can accept. anyone = anyone with the link can read after signing in; each reader gets their own access, and every read has their name. audience.email is not used."}}},"intent":{"type":"object","required":["statement","outcome","ask"],"description":"What the owner wants to happen. 'statement' is verbatim. Everything else carries provenance.","properties":{"statement":{"type":"string","description":"The owner's own words, unedited."},"outcome":{"$ref":"#/$defs/value","description":"The end state the owner is after."},"successLooksLike":{"type":"array","items":{"$ref":"#/$defs/value"}},"ask":{"type":"object","required":["type","detail"],"properties":{"type":{"enum":["decide","agree","review","evaluate","advise","explore","act","inform"]},"detail":{"$ref":"#/$defs/value"},"byWhen":{"type":"string"}}},"whyNow":{"$ref":"#/$defs/value"},"whyThisAudience":{"$ref":"#/$defs/value"},"interests":{"type":"array","items":{"$ref":"#/$defs/value"},"description":"What the owner actually needs underneath the ask (interests, not positions). This is what lets their agent find options the owner did not list."},"priorities":{"type":"array","items":{"$ref":"#/$defs/value"},"description":"Ordered. The first one wins a conflict."},"nonGoals":{"type":"array","items":{"$ref":"#/$defs/value"},"description":"What this is explicitly not about. Stops scope creep in the conversation."}}},"interpretation":{"type":"object","required":["restatement","inferences"],"description":"The model's reading of the intent, kept separate from what the owner said. Each inference is shown to the owner, who confirms, corrects, or rejects it. Unreviewed inferences may ship only if labelled as such.","properties":{"restatement":{"type":"string","description":"'Here is what I think you want', written by the agent and shown to the owner before anything else."},"restatementVerdict":{"$ref":"#/$defs/verdict"},"inferences":{"type":"array","items":{"type":"object","required":["id","reading","basis","verdict"],"properties":{"id":{"type":"string"},"reading":{"type":"string","description":"What the agent concluded."},"basis":{"type":"string","description":"Why: which words, sources, or patterns."},"confidence":{"$ref":"#/$defs/confidence"},"verdict":{"$ref":"#/$defs/verdict"},"correction":{"type":"string","description":"The owner's version, when the verdict is corrected."}}}},"clarifications":{"type":"array","description":"Questions the agent asked the owner while drafting, with the owner's answers.","items":{"type":"object","required":["question","answer"],"properties":{"question":{"type":"string"},"answer":{"type":"string"}}}},"openAmbiguities":{"type":"array","items":{"type":"string"},"description":"What the owner chose to leave open. The recipient agent must not resolve these on its own."},"reviewedIn":{"enum":["chat","review"],"description":"Where the owner confirmed the restatement and inferences: in the conversation with their own agent, or on Relay's review page. When 'chat', the review page doesn't ask again; approving is still the owner's click."}}},"context":{"type":"object","required":["subject","sections"],"properties":{"subject":{"type":"string","description":"The subject in the owner's context store. Sections are stored once and shared by reference."},"sections":{"type":"array","minItems":1,"items":{"type":"object","required":["id","title","body","version"],"properties":{"id":{"type":"string","description":"Store item id. The same id across every relay that includes it."},"title":{"type":"string"},"purpose":{"type":"string","description":"Why this section is in this relay: how it serves the intent."},"body":{"type":"string","description":"Readable prose for humans."},"claims":{"type":"array","items":{"$ref":"#/$defs/claim"},"description":"The atomic statements in the prose, so agents can cite and check them."},"version":{"type":"integer","minimum":1},"updatedAt":{"type":"string","format":"date-time"},"visibility":{"$ref":"#/$defs/visibility"}}}},"excluded":{"type":"array","description":"Only topics the owner explicitly named as off-limits, so their agent knows a gap is intentional. Agents never populate this on their own or list what they left out.","items":{"type":"object","required":["topic","reason"],"properties":{"topic":{"type":"string"},"reason":{"type":"string"}}}}}},"attachments":{"type":"array","maxItems":5,"description":"Files behind the context: a pitch deck, a proposal, a report. Each is a PDF the owner attached (relay_attach, or on the review page); the server fills in pages and checks ownership. Map each slide to the sections it supports so the recipient's agent can show the right slide while it answers. The relay stays the main thing: attachments are evidence, not the message.","items":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"The id relay_attach returned (a_…)."},"title":{"type":"string"},"kind":{"enum":["deck","document"]},"pages":{"type":"integer","description":"Set by the server."},"download":{"type":"boolean","description":"Whether readers may download the PDF. Default false: they view it inside Relay."},"slides":{"type":"array","description":"Page by page: what it shows and which section ids it supports. Leave out to let the server suggest a mapping by shared words.","items":{"type":"object","required":["page"],"properties":{"page":{"type":"integer","minimum":1},"title":{"type":"string"},"supports":{"type":"array","items":{"type":"string"},"description":"Section ids this page backs up."}}}}}}},"reasoning":{"type":"object","description":"How the owner thinks about it: decisions, variables, assumptions, evidence, risks, and the strongest case against. This is what lets the audience's agent answer 'why' and 'what if' without guessing.","properties":{"decisions":{"type":"array","items":{"type":"object","required":["id","question","status"],"properties":{"id":{"type":"string"},"question":{"type":"string"},"status":{"enum":["decided","leaning","open","delegated","deferred"]},"decider":{"enum":["owner","audience","joint","other"]},"byWhen":{"type":"string"},"options":{"type":"array","items":{"type":"object","required":["label"],"properties":{"label":{"type":"string"},"pros":{"type":"array","items":{"type":"string"}},"cons":{"type":"array","items":{"type":"string"}},"ownerView":{"$ref":"#/$defs/value"}}}},"choice":{"type":"string"},"rationale":{"$ref":"#/$defs/value"},"criteria":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"weight":{"type":"number","minimum":0,"maximum":1},"why":{"type":"string"}}}},"tradeoffsAccepted":{"type":"array","items":{"type":"string"}},"reversibility":{"enum":["reversible","costly","irreversible"]},"whatWouldChangeIt":{"type":"array","items":{"type":"string"},"description":"New facts that would reopen the decision. The most useful thing to give a recipient agent."}}}},"variables":{"type":"array","description":"The parameters in play and how much they can move.","items":{"type":"object","required":["name","gate"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"acceptable":{"type":"string","description":"Range or condition the owner can live with."},"gate":{"enum":["hard","elastic","soft"],"description":"hard = non-negotiable; elastic = can move with a reason or a trade; soft = a preference."},"tradesAgainst":{"type":"array","items":{"type":"string"}},"provenance":{"$ref":"#/$defs/provenance"},"visibility":{"$ref":"#/$defs/visibility"}}}},"assumptions":{"type":"array","items":{"type":"object","required":["statement","confidence"],"properties":{"statement":{"type":"string"},"confidence":{"$ref":"#/$defs/confidence"},"basis":{"type":"string"},"ifWrong":{"type":"string"},"howToTest":{"type":"string"},"provenance":{"$ref":"#/$defs/provenance"}}}},"evidence":{"type":"array","items":{"type":"object","required":["supports","kind","strength"],"properties":{"supports":{"type":"string","description":"Claim or decision id."},"kind":{"enum":["document","data","experience","third-party","observation","conversation"]},"pointer":{"type":"string"},"strength":{"enum":["strong","moderate","weak"]}}}},"risks":{"type":"array","items":{"type":"object","required":["risk"],"properties":{"risk":{"type":"string"},"likelihood":{"enum":["low","medium","high"]},"impact":{"enum":["low","medium","high"]},"mitigation":{"type":"string"}}}},"counterarguments":{"type":"array","description":"The strongest case against the owner's position, with the owner's response. Lets the recipient agent engage critically without inventing the owner's reply.","items":{"type":"object","required":["argument"],"properties":{"argument":{"type":"string"},"ownerResponse":{"$ref":"#/$defs/value"}}}},"unknowns":{"type":"array","items":{"type":"object","required":["question"],"properties":{"question":{"type":"string"},"whyItMatters":{"type":"string"},"whoCanAnswer":{"type":"string"}}}}}},"judgement":{"type":"object","description":"The owner's own heuristics. Lets their agent reason the way the owner would on questions the package doesn't answer, while saying that it is extrapolating.","properties":{"principles":{"type":"array","items":{"type":"object","required":["principle"],"properties":{"principle":{"type":"string"},"example":{"type":"string"}}}},"preferences":{"type":"array","items":{"type":"object","required":["prefer","over"],"properties":{"prefer":{"type":"string"},"over":{"type":"string"},"when":{"type":"string"}}}},"redLines":{"type":"array","items":{"type":"string"}},"confidence":{"type":"string","description":"How sure the owner is overall, in their words."}}},"process":{"type":"object","description":"How this context came to be, and how decisions get made from here.","properties":{"howProduced":{"type":"array","items":{"type":"object","required":["step","by"],"properties":{"step":{"type":"string"},"by":{"enum":["owner","agent","audience"]}}}},"sourcesConsulted":{"type":"array","items":{"type":"object","required":["name","kind"],"properties":{"name":{"type":"string"},"kind":{"enum":["conversation","document","connector","memory","web"]},"consent":{"enum":["granted","not-needed"]},"scope":{"type":"string"}}}},"decisionProcess":{"type":"string","description":"From here on: who decides what, by when, and how disagreement is resolved."},"nextSteps":{"type":"array","items":{"type":"object","required":["step"],"properties":{"step":{"type":"string"},"owner":{"type":"string"},"due":{"type":"string"}}}}}},"representation":{"type":"object","required":["role","fidelity","mustAskOwner","mustNot","whenUnknown"],"description":"The mandate for the AUDIENCE'S agent: how it may speak about the owner's intent, interest, and context. It loads this as rules, not as content.","properties":{"role":{"enum":["explain","explore","advise-recipient","negotiate-within-bounds"],"description":"explain = answer from the package; explore = also help the recipient think it through; advise-recipient = may give the recipient its own view, labelled; negotiate-within-bounds = may agree to changes inside elastic and soft variables only."},"opening":{"type":"object","required":["greeting","starters"],"description":"How the recipient's agent starts. It takes the package in silently (no summary, no echo) and opens with this greeting and these starting points, then follows the recipient's lead.","properties":{"greeting":{"type":"string","description":"One or two sentences: whose context this is, what it's about, what it's for."},"starters":{"type":"array","minItems":2,"maxItems":4,"items":{"type":"string"},"description":"Starting points drawn from the ask. Always offered alongside 'or something else'."}}},"speaksAs":{"type":"string","description":"e.g. 'I'm answering from the context Saurabh shared with you, version 3.'"},"fidelity":{"type":"object","required":["quoteStatedIntent","labelInterpretations","citeSections","extrapolation"],"properties":{"quoteStatedIntent":{"type":"boolean","description":"Quote intent.statement verbatim instead of paraphrasing it."},"labelInterpretations":{"type":"boolean","description":"Say 'the owner's agent read this as…' for anything with provenance inferred."},"citeSections":{"type":"boolean"},"extrapolation":{"enum":["never","labelled","free"],"description":"Whether the agent may reason past the package using judgement.principles, and if so, whether it must say so."}}},"may":{"type":"array","items":{"type":"string"}},"mustAskOwner":{"type":"array","items":{"type":"string"},"description":"Topics that are routed back to the owner as a question, never answered."},"mustNot":{"type":"array","items":{"type":"string"}},"whenUnknown":{"enum":["say-unspecified-and-route","say-unspecified"],"description":"say-unspecified-and-route = tell the recipient and send the question to the owner through the return channel."},"passOn":{"type":"string","description":"What the recipient may forward. Shareable items only; recipient-only items stay with them."},"fidelityChecks":{"type":"array","description":"Questions the audience is likely to ask, with the answer the owner approved during review. The recipient agent uses them as calibration examples, and they double as a regression test for faithful representation.","items":{"type":"object","required":["question","approvedAnswer"],"properties":{"question":{"type":"string"},"approvedAnswer":{"type":"string"},"ownerEdited":{"type":"boolean"}}}}}},"interaction":{"type":"object","required":["permission"],"properties":{"permission":{"enum":["read","suggest","edit"]},"returnChannel":{"type":"string","description":"Where questions and proposals go. Each targets a section id."},"expectedResponse":{"type":"string","description":"What the owner hopes to get back, and by when."}}},"lifecycle":{"type":"object","required":["mode"],"properties":{"mode":{"enum":["live","snapshot"]},"expiresAt":{"type":["string","null"],"format":"date-time"},"refresh":{"enum":["manual","24h","7d","30d"]},"staleSections":{"type":"array","items":{"type":"string"}},"grantId":{"type":"string"},"revocationUrl":{"type":"string"}}}},"$defs":{"provenance":{"enum":["stated","confirmed","corrected","inferred","sourced","derived"],"description":"stated = the owner's words. confirmed = drafted by an agent, accepted unchanged by the owner. corrected = drafted by an agent, changed by the owner. inferred = the agent's reading, not reviewed. sourced = taken from a named source. derived = computed by the system."},"verdict":{"enum":["confirmed","corrected","rejected","unreviewed"]},"confidence":{"enum":["high","medium","low"]},"visibility":{"enum":["shareable","recipient-only"],"description":"shareable = the recipient may pass it on. recipient-only = for them alone."},"value":{"type":"object","required":["text","provenance"],"properties":{"text":{"type":"string"},"provenance":{"$ref":"#/$defs/provenance"},"agentReading":{"type":"string","description":"When corrected: what the agent first proposed. Kept so drift between model and owner is visible."}}},"claim":{"type":"object","required":["id","text","provenance"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"provenance":{"$ref":"#/$defs/provenance"},"sources":{"type":"array","items":{"type":"string"}},"confidence":{"$ref":"#/$defs/confidence"},"asOf":{"type":"string"},"validUntil":{"type":"string"},"visibility":{"$ref":"#/$defs/visibility"}}}}}