dev.cocore.inference.dispatch

cocore.dev

Schema Diff

+72 -0

From

CID
bafyreie2gz2hieb...
Indexed At
2026-06-25 16:59 UTC
View this version

To

CID
bafyreifgxhv32r6...
Indexed At
2026-07-26 20:05 UTC
View this version

Compatibility Analysis

Breaking Changes Detected

3 breaking changes, 23 non-breaking changes.

Breaking Changes (3)
  • RequiredEdgeAdded RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items", src: "dev.cocore.inference.dispatch:input.tools:items", tgt: "dev.cocore.inference.dispatch:input.tools:items.type", kind: "prop", name: Some("type") }
  • RequiredEdgeAdded RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items", src: "dev.cocore.inference.dispatch:input.tools:items", tgt: "dev.cocore.inference.dispatch:input.tools:items.function", kind: "prop", name: Some("function") }
  • RequiredEdgeAdded RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function", src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.name", kind: "prop", name: Some("name") }
Non-Breaking Changes (23)
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.name" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.schema" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.strict" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.toolChoice" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.toolChoiceFunction" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.description" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.name" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.parameters" }
  • AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.type" }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.outputSchema", kind: "prop", name: Some("outputSchema") }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.toolChoice", kind: "prop", name: Some("toolChoice") }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.toolChoiceFunction", kind: "prop", name: Some("toolChoiceFunction") }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.tools", kind: "prop", name: Some("tools") }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.name", kind: "prop", name: Some("name") }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.schema", kind: "prop", name: Some("schema") }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.strict", kind: "prop", name: Some("strict") }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.tools", tgt: "dev.cocore.inference.dispatch:input.tools:items", kind: "items", name: None }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.description", kind: "prop", name: Some("description") }
  • AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.parameters", kind: "prop", name: Some("parameters") }

Migration Guidance

Added Elements

  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.name" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.schema" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.strict" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.toolChoice" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.toolChoiceFunction" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.description" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.name" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.parameters" }
  • AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.type" }

Additional Notes

  • Breaking: RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function", src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.name", kind: "prop", name: Some("name") }
  • Breaking: RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items", src: "dev.cocore.inference.dispatch:input.tools:items", tgt: "dev.cocore.inference.dispatch:input.tools:items.type", kind: "prop", name: Some("type") }
  • Breaking: RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items", src: "dev.cocore.inference.dispatch:input.tools:items", tgt: "dev.cocore.inference.dispatch:input.tools:items.function", kind: "prop", name: Some("function") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.outputSchema", kind: "prop", name: Some("outputSchema") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.toolChoice", kind: "prop", name: Some("toolChoice") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.toolChoiceFunction", kind: "prop", name: Some("toolChoiceFunction") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.tools", kind: "prop", name: Some("tools") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.name", kind: "prop", name: Some("name") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.schema", kind: "prop", name: Some("schema") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.strict", kind: "prop", name: Some("strict") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.tools", tgt: "dev.cocore.inference.dispatch:input.tools:items", kind: "items", name: None }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.description", kind: "prop", name: Some("description") }
  • Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.parameters", kind: "prop", name: Some("parameters") }
1 1
{
2 2
  "$type": "com.atproto.lexicon.schema",
3 3
  "defs": {
4 4
    "main": {
5 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 14
        },
15 15
        {
16 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 17
          "name": "ConfidentialUnavailable"
18 18
        }
19 19
      ],
20 20
      "input": {
21 21
        "encoding": "application/json",
22 22
        "schema": {
23 23
          "properties": {
24 24
            "maxTokensOut": {
25 25
              "minimum": 1,
26 26
              "type": "integer"
27 27
            },
28 28
            "model": {
29 29
              "minLength": 1,
30 30
              "type": "string"
31 31
            },
32 32
            "nonce": {
33 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 34
              "maxLength": 64,
35 35
              "minLength": 32,
36 36
              "type": "string"
37 37
            },
38 +
            "outputSchema": {
39 +
              "description": "Optional JSON Schema to constrain the model output. When present, the published job record carries this schema and the provider passes it to the inference engine as response_format guided decoding. The schema is public (not encrypted) — it describes the output shape, not the input.",
40 +
              "properties": {
41 +
                "name": {
42 +
                  "description": "Schema name (maps to OpenAI response_format.json_schema.name).",
43 +
                  "type": "string"
44 +
                },
45 +
                "schema": {
46 +
                  "description": "The actual JSON Schema object that constrains the model output.",
47 +
                  "type": "object"
48 +
                },
49 +
                "strict": {
50 +
                  "description": "Whether to enforce strict schema adherence.",
51 +
                  "type": "boolean"
52 +
                }
53 +
              },
54 +
              "type": "object"
55 +
            },
38 56
            "priceCeiling": {
39 57
              "properties": {
40 58
                "amount": {
41 59
                  "minimum": 0,
42 60
                  "type": "integer"
43 61
                },
44 62
                "currency": {
45 63
                  "minLength": 1,
46 64
                  "type": "string"
47 65
                }
48 66
              },
49 67
              "required": [
50 68
                "amount",
51 69
                "currency"
52 70
              ],
53 71
              "type": "object"
54 72
            },
55 73
            "prompt": {
56 74
              "minLength": 1,
57 75
              "type": "string"
58 76
            },
59 77
            "requireConfidential": {
60 78
              "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 79
              "type": "boolean"
62 80
            },
63 81
            "targetProviderDid": {
64 82
              "description": "Pin dispatch to a specific provider DID instead of letting the advisor route.",
65 83
              "format": "did",
66 84
              "type": "string"
85 +
            },
86 +
            "toolChoice": {
87 +
              "description": "Optional tool choice strategy. 'auto' (default), 'none', or 'required'. Additive.",
88 +
              "knownValues": [
89 +
                "auto",
90 +
                "none",
91 +
                "required"
92 +
              ],
93 +
              "type": "string"
94 +
            },
95 +
            "toolChoiceFunction": {
96 +
              "description": "When toolChoice is 'required', force the model to call this specific function. Maps to OpenAI tool_choice object form. Additive.",
97 +
              "maxLength": 256,
98 +
              "type": "string"
99 +
            },
100 +
            "tools": {
101 +
              "description": "Optional list of tool/function definitions the model may call. Public (not encrypted). The published job record carries this list and the provider passes it to the inference engine.",
102 +
              "items": {
103 +
                "properties": {
104 +
                  "function": {
105 +
                    "properties": {
106 +
                      "description": {
107 +
                        "maxLength": 4096,
108 +
                        "type": "string"
109 +
                      },
110 +
                      "name": {
111 +
                        "maxLength": 256,
112 +
                        "type": "string"
113 +
                      },
114 +
                      "parameters": {
115 +
                        "description": "JSON Schema for the function's arguments.",
116 +
                        "type": "object"
117 +
                      }
118 +
                    },
119 +
                    "required": [
120 +
                      "name"
121 +
                    ],
122 +
                    "type": "object"
123 +
                  },
124 +
                  "type": {
125 +
                    "knownValues": [
126 +
                      "function"
127 +
                    ],
128 +
                    "type": "string"
129 +
                  }
130 +
                },
131 +
                "required": [
132 +
                  "type",
133 +
                  "function"
134 +
                ],
135 +
                "type": "object"
136 +
              },
137 +
              "maxLength": 128,
138 +
              "type": "array"
67 139
            }
68 140
          },
69 141
          "required": [
70 142
            "model",
71 143
            "prompt",
72 144
            "maxTokensOut",
73 145
            "priceCeiling"
74 146
          ],
75 147
          "type": "object"
76 148
        }
77 149
      },
78 150
      "output": {
79 151
        "description": "A Server-Sent Events stream of `meta`, `chunk`, `complete`, and `error` frames (see the method description for payloads).",
80 152
        "encoding": "text/event-stream"
81 153
      },
82 154
      "type": "procedure"
83 155
    }
84 156
  },
85 157
  "id": "dev.cocore.inference.dispatch",
86 158
  "lexicon": 1
87 159
}

Compare Other Versions

Lexicon Garden

@