dev.cocore.inference.dispatch
Schema Diff
+15 -1
Compatibility Analysis
Backward Compatible
Backward compatible. 4 non-breaking changes.
Non-Breaking Changes (4)
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.nonce" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.requireConfidential" }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.nonce", kind: "prop", name: Some("nonce") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.requireConfidential", kind: "prop", name: Some("requireConfidential") }
Migration Guidance
Added Elements
AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.nonce" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.requireConfidential" }
Additional Notes
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.nonce", kind: "prop", name: Some("nonce") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.requireConfidential", kind: "prop", name: Some("requireConfidential") }
1
1
{
2
2
"$type": "com.atproto.lexicon.schema",
3
3
"defs": {
4
4
"main": {
5
-
"description": "Submit an inference request and stream the result back as Server-Sent Events. Authenticates the requester, runs the dispatch core, and emits typed SSE frames. Unlike `submit` (which returns URIs to poll), `dispatch` drives the full request and streams plaintext output chunks until completion.\n\nSSE events:\n * `meta` — { jobUri, jobCid, authUri, inputCommitment, providerDid, sessionId }\n * `chunk` — { seq, text } (plaintext, decrypted)\n * `complete` — { tokensIn, tokensOut, receiptUri, providerCredit? }\n * `error` — { reason, code }",
5
+
"description": "Submit an inference request and stream the result back as Server-Sent Events. Authenticates the requester, runs the dispatch core, and emits typed SSE frames. Unlike `submit` (which returns URIs to poll), `dispatch` drives the full request and streams plaintext output chunks until completion.\n\nConfidentiality: by default the AppView seals the prompt to the chosen provider on the caller's behalf (`best-effort` tier) — convenient, but the AppView is in the plaintext path. A caller that needs privacy FROM the provider sets `requireConfidential` and supplies a fresh `nonce`; the AppView then runs the verified, enclave-bound ephemeral handshake and either confirms an `attested-confidential` session or fails closed with the `ConfidentialUnavailable` error. For genuine end-to-end confidentiality the prompt is sealed at the client edge (SDK/browser) and the AppView forwards ciphertext only; this method's server-side seal path is always `best-effort`.\n\nSSE events:\n * `meta` — { jobUri, jobCid, authUri, inputCommitment, providerDid, sessionId, tier }\n * `sessionKey` — { ephemeralPubKey, nonce, attestationCid, signature } (only when `requireConfidential`; the enclave-signed fresh key the requester verifies before sealing)\n * `chunk` — { seq, text } (plaintext, decrypted)\n * `complete` — { tokensIn, tokensOut, receiptUri, tier, providerCredit? }\n * `error` — { reason, code }",
6
6
"errors": [
7
7
{
8
8
"description": "The caller is not authenticated.",
9
9
"name": "AuthRequired"
10
10
},
11
11
{
12
12
"description": "The body failed validation.",
13
13
"name": "InvalidRequest"
14
+
},
15
+
{
16
+
"description": "requireConfidential was set but no provider could satisfy the attested-confidential tier (no verified+bound MDA chain, cdHash not in the known-good set, posture failed, or the ephemeral session handshake did not verify). The request was NOT downgraded; no prompt was sealed.",
17
+
"name": "ConfidentialUnavailable"
14
18
}
15
19
],
16
20
"input": {
17
21
"encoding": "application/json",
18
22
"schema": {
19
23
"properties": {
20
24
"maxTokensOut": {
21
25
"minimum": 1,
22
26
"type": "integer"
23
27
},
24
28
"model": {
25
29
"minLength": 1,
26
30
"type": "string"
27
31
},
32
+
"nonce": {
33
+
"description": "Fresh lowercase-hex freshness challenge (>=16 random bytes) supplied by the caller when `requireConfidential` is set. The provider's enclave signs (ephemeralPubKey || nonce || attestationCid) so the caller can prove the ephemeral seal key was minted for THIS request and is not replayed. Required when requireConfidential is true; ignored otherwise.",
34
+
"maxLength": 64,
35
+
"minLength": 32,
36
+
"type": "string"
37
+
},
28
38
"priceCeiling": {
29
39
"properties": {
30
40
"amount": {
31
41
"minimum": 0,
32
42
"type": "integer"
33
43
},
34
44
"currency": {
35
45
"minLength": 1,
36
46
"type": "string"
37
47
}
38
48
},
39
49
"required": [
40
50
"amount",
41
51
"currency"
42
52
],
43
53
"type": "object"
44
54
},
45
55
"prompt": {
46
56
"minLength": 1,
47
57
"type": "string"
48
58
},
59
+
"requireConfidential": {
60
+
"description": "Demand the `attested-confidential` tier: the chosen provider must present a verified, signing-key-bound Apple MDA chain, a known-good measured cdHash, the hardened-runtime posture, and a fresh enclave-signed ephemeral session key bound to `nonce`. If no eligible provider is available the request fails closed with `ConfidentialUnavailable` rather than silently downgrading to best-effort. Optional / additive; absent or false means best-effort.",
61
+
"type": "boolean"
62
+
},
49
63
"targetProviderDid": {
50
64
"description": "Pin dispatch to a specific provider DID instead of letting the advisor route.",
51
65
"format": "did",
52
66
"type": "string"
53
67
}
54
68
},
55
69
"required": [
56
70
"model",
57
71
"prompt",
58
72
"maxTokensOut",
59
73
"priceCeiling"
60
74
],
61
75
"type": "object"
62
76
}
63
77
},
64
78
"output": {
65
79
"description": "A Server-Sent Events stream of `meta`, `chunk`, `complete`, and `error` frames (see the method description for payloads).",
66
80
"encoding": "text/event-stream"
67
81
},
68
82
"type": "procedure"
69
83
}
70
84
},
71
85
"id": "dev.cocore.inference.dispatch",
72
86
"lexicon": 1
73
87
}