@hypercarrier/rarebit 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -0
- package/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/RUNBOOK.md +36 -0
- package/SECURITY.md +11 -0
- package/VISUAL-LANGUAGE.md +89 -0
- package/bin/rarebit.mjs +20 -0
- package/package.json +96 -0
- package/schemas/rarebit.schema.json +618 -0
- package/scripts/e2e-recall-pi083.mjs +199 -0
- package/scripts/e2e-summary-cache.mjs +257 -0
- package/scripts/verify-package.mjs +81 -0
- package/src/automatic-summary-policy.mjs +210 -0
- package/src/extension.mjs +516 -0
- package/src/herdr-activity.mjs +111 -0
- package/src/index.mjs +13 -0
- package/src/lifecycle.mjs +322 -0
- package/src/rarebit-activity.mjs +48 -0
- package/src/rarebit-artifact-state.mjs +839 -0
- package/src/rarebit-cli.mjs +305 -0
- package/src/rarebit-command.mjs +281 -0
- package/src/rarebit-core.mjs +525 -0
- package/src/rarebit-model.mjs +226 -0
- package/src/rarebit-recall.mjs +182 -0
- package/src/rarebit-service.mjs +579 -0
- package/src/rarebit-session.mjs +227 -0
- package/src/rarebit-settings.mjs +79 -0
- package/src/rarebit-store.mjs +771 -0
- package/src/rarebit-visual-language.mjs +110 -0
- package/src/types.d.ts +601 -0
- package/test/automatic-summary-policy.test.mjs +476 -0
- package/test/extension-activity.test.mjs +73 -0
- package/test/fixtures/branch-mixed.json +117 -0
- package/test/fixtures/conformance-corpus.v1.json +306 -0
- package/test/fixtures/truncated-mixed.jsonl +2 -0
- package/test/herdr-activity.test.mjs +93 -0
- package/test/lifecycle-contract-independent.test.mjs +627 -0
- package/test/rarebit-activity.test.mjs +82 -0
- package/test/rarebit-artifact-state.test.mjs +440 -0
- package/test/rarebit-cli.test.mjs +222 -0
- package/test/rarebit-command.test.mjs +127 -0
- package/test/rarebit-core.test.mjs +461 -0
- package/test/rarebit-cross-consumer-conformance.test.mjs +150 -0
- package/test/rarebit-independent-contract.test.mjs +317 -0
- package/test/rarebit-recall.test.mjs +434 -0
- package/test/rarebit-sidecar-protocol.test.mjs +538 -0
- package/test/rarebit-visual-language.test.mjs +75 -0
- package/test/summary-attention-independent.test.mjs +172 -0
- package/test/types-history.ts +13 -0
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://hypercarrier.local/schemas/rarebit-materialization.json",
|
|
4
|
+
"title": "Rarebit compact one-file sidecar protocol",
|
|
5
|
+
"oneOf": [
|
|
6
|
+
{ "$ref": "#/definitions/summary" },
|
|
7
|
+
{ "$ref": "#/definitions/head" },
|
|
8
|
+
{ "$ref": "#/definitions/title" }
|
|
9
|
+
],
|
|
10
|
+
"definitions": {
|
|
11
|
+
"sha256": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
14
|
+
},
|
|
15
|
+
"nullableString": {
|
|
16
|
+
"type": ["string", "null"]
|
|
17
|
+
},
|
|
18
|
+
"nullableNonNegativeNumber": {
|
|
19
|
+
"type": ["number", "null"],
|
|
20
|
+
"minimum": 0
|
|
21
|
+
},
|
|
22
|
+
"branch": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["leafId", "entryCount", "pathHash"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"leafId": { "type": ["string", "null"] },
|
|
28
|
+
"entryCount": { "type": "integer", "minimum": 0 },
|
|
29
|
+
"pathHash": { "$ref": "#/definitions/sha256" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"selection": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"required": [
|
|
36
|
+
"manifestHash",
|
|
37
|
+
"selectorVersion",
|
|
38
|
+
"occurrenceCount",
|
|
39
|
+
"uniquePayloadCount",
|
|
40
|
+
"latestUserSourceEntryId"
|
|
41
|
+
],
|
|
42
|
+
"properties": {
|
|
43
|
+
"manifestHash": { "$ref": "#/definitions/sha256" },
|
|
44
|
+
"selectorVersion": { "type": "string", "minLength": 1 },
|
|
45
|
+
"occurrenceCount": { "type": "integer", "minimum": 0 },
|
|
46
|
+
"uniquePayloadCount": { "type": "integer", "minimum": 0 },
|
|
47
|
+
"latestUserSourceEntryId": { "$ref": "#/definitions/nullableString" }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"model": {
|
|
51
|
+
"oneOf": [
|
|
52
|
+
{ "type": "null" },
|
|
53
|
+
{
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["provider", "id"],
|
|
57
|
+
"properties": {
|
|
58
|
+
"provider": { "type": "string", "minLength": 1 },
|
|
59
|
+
"id": { "type": "string", "minLength": 1 }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"modelProvenance": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": ["source", "status"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"source": { "type": "string", "minLength": 1 },
|
|
70
|
+
"status": { "type": "string", "minLength": 1 },
|
|
71
|
+
"settingsKey": { "type": "string", "minLength": 1 }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"inputCoveragePolicy": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"required": ["strategy", "maxPromptChars"],
|
|
78
|
+
"properties": {
|
|
79
|
+
"strategy": {
|
|
80
|
+
"enum": [
|
|
81
|
+
"complete_or_explicit_overflow",
|
|
82
|
+
"newest_suffix_with_explicit_omission"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"maxPromptChars": { "type": "integer", "minimum": 1 }
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"inputCoverage": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"additionalProperties": false,
|
|
91
|
+
"required": [
|
|
92
|
+
"totalMessageCount",
|
|
93
|
+
"includedMessageCount",
|
|
94
|
+
"omittedMessageCount",
|
|
95
|
+
"omittedTextChars",
|
|
96
|
+
"promptChars",
|
|
97
|
+
"complete"
|
|
98
|
+
],
|
|
99
|
+
"properties": {
|
|
100
|
+
"totalMessageCount": { "type": "integer", "minimum": 0 },
|
|
101
|
+
"includedMessageCount": { "type": "integer", "minimum": 0 },
|
|
102
|
+
"omittedMessageCount": { "type": "integer", "minimum": 0 },
|
|
103
|
+
"omittedTextChars": { "type": "integer", "minimum": 0 },
|
|
104
|
+
"promptChars": { "type": "integer", "minimum": 0 },
|
|
105
|
+
"complete": { "type": "boolean" }
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"error": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"additionalProperties": false,
|
|
111
|
+
"required": ["name", "message"],
|
|
112
|
+
"properties": {
|
|
113
|
+
"name": { "type": "string", "minLength": 1 },
|
|
114
|
+
"message": { "type": "string" }
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"overflow": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"required": ["promptChars", "maxPromptChars", "strategy"],
|
|
121
|
+
"properties": {
|
|
122
|
+
"promptChars": { "type": "integer", "minimum": 0 },
|
|
123
|
+
"maxPromptChars": { "type": "integer", "minimum": 1 },
|
|
124
|
+
"strategy": {
|
|
125
|
+
"enum": ["none", "fixed_contract_exceeds_limit"]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"synthesis": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"additionalProperties": false,
|
|
132
|
+
"required": [
|
|
133
|
+
"schemaVersion",
|
|
134
|
+
"kind",
|
|
135
|
+
"outcome",
|
|
136
|
+
"requestedModel",
|
|
137
|
+
"timing",
|
|
138
|
+
"provider",
|
|
139
|
+
"usage"
|
|
140
|
+
],
|
|
141
|
+
"properties": {
|
|
142
|
+
"schemaVersion": { "const": 1 },
|
|
143
|
+
"kind": { "const": "rarebit_model_synthesis" },
|
|
144
|
+
"outcome": { "type": "string", "minLength": 1 },
|
|
145
|
+
"requestedModel": { "$ref": "#/definitions/model" },
|
|
146
|
+
"timing": {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"additionalProperties": false,
|
|
149
|
+
"required": ["startedAt", "completedAt", "durationMs", "provenance"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"startedAt": { "$ref": "#/definitions/nullableString" },
|
|
152
|
+
"completedAt": { "$ref": "#/definitions/nullableString" },
|
|
153
|
+
"durationMs": { "$ref": "#/definitions/nullableNonNegativeNumber" },
|
|
154
|
+
"provenance": { "const": "local_monotonic_clock" }
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"provider": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"additionalProperties": false,
|
|
160
|
+
"required": [
|
|
161
|
+
"responseProvider",
|
|
162
|
+
"responseProviderSource",
|
|
163
|
+
"responseModel",
|
|
164
|
+
"responseModelSource",
|
|
165
|
+
"responseId",
|
|
166
|
+
"responseIdSource",
|
|
167
|
+
"requestId",
|
|
168
|
+
"requestIdSource"
|
|
169
|
+
],
|
|
170
|
+
"properties": {
|
|
171
|
+
"responseProvider": { "$ref": "#/definitions/nullableString" },
|
|
172
|
+
"responseProviderSource": {
|
|
173
|
+
"$ref": "#/definitions/nullableString"
|
|
174
|
+
},
|
|
175
|
+
"responseModel": { "$ref": "#/definitions/nullableString" },
|
|
176
|
+
"responseModelSource": { "$ref": "#/definitions/nullableString" },
|
|
177
|
+
"responseId": { "$ref": "#/definitions/nullableString" },
|
|
178
|
+
"responseIdSource": { "$ref": "#/definitions/nullableString" },
|
|
179
|
+
"requestId": { "$ref": "#/definitions/nullableString" },
|
|
180
|
+
"requestIdSource": { "$ref": "#/definitions/nullableString" }
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"usage": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"additionalProperties": false,
|
|
186
|
+
"required": [
|
|
187
|
+
"availability",
|
|
188
|
+
"inputTokens",
|
|
189
|
+
"outputTokens",
|
|
190
|
+
"totalTokens",
|
|
191
|
+
"cacheReadTokens",
|
|
192
|
+
"cacheWriteTokens",
|
|
193
|
+
"reasoningTokens",
|
|
194
|
+
"estimatedCostUsd",
|
|
195
|
+
"provenance"
|
|
196
|
+
],
|
|
197
|
+
"properties": {
|
|
198
|
+
"availability": { "enum": ["unavailable", "partial", "reported"] },
|
|
199
|
+
"inputTokens": {
|
|
200
|
+
"$ref": "#/definitions/nullableNonNegativeNumber"
|
|
201
|
+
},
|
|
202
|
+
"outputTokens": {
|
|
203
|
+
"$ref": "#/definitions/nullableNonNegativeNumber"
|
|
204
|
+
},
|
|
205
|
+
"totalTokens": {
|
|
206
|
+
"$ref": "#/definitions/nullableNonNegativeNumber"
|
|
207
|
+
},
|
|
208
|
+
"cacheReadTokens": {
|
|
209
|
+
"$ref": "#/definitions/nullableNonNegativeNumber"
|
|
210
|
+
},
|
|
211
|
+
"cacheWriteTokens": {
|
|
212
|
+
"$ref": "#/definitions/nullableNonNegativeNumber"
|
|
213
|
+
},
|
|
214
|
+
"reasoningTokens": {
|
|
215
|
+
"$ref": "#/definitions/nullableNonNegativeNumber"
|
|
216
|
+
},
|
|
217
|
+
"estimatedCostUsd": {
|
|
218
|
+
"$ref": "#/definitions/nullableNonNegativeNumber"
|
|
219
|
+
},
|
|
220
|
+
"provenance": {
|
|
221
|
+
"type": "object",
|
|
222
|
+
"additionalProperties": false,
|
|
223
|
+
"required": [
|
|
224
|
+
"inputTokens",
|
|
225
|
+
"outputTokens",
|
|
226
|
+
"totalTokens",
|
|
227
|
+
"cacheReadTokens",
|
|
228
|
+
"cacheWriteTokens",
|
|
229
|
+
"reasoningTokens",
|
|
230
|
+
"estimatedCostUsd"
|
|
231
|
+
],
|
|
232
|
+
"properties": {
|
|
233
|
+
"inputTokens": { "$ref": "#/definitions/nullableString" },
|
|
234
|
+
"outputTokens": { "$ref": "#/definitions/nullableString" },
|
|
235
|
+
"totalTokens": { "$ref": "#/definitions/nullableString" },
|
|
236
|
+
"cacheReadTokens": { "$ref": "#/definitions/nullableString" },
|
|
237
|
+
"cacheWriteTokens": { "$ref": "#/definitions/nullableString" },
|
|
238
|
+
"reasoningTokens": { "$ref": "#/definitions/nullableString" },
|
|
239
|
+
"estimatedCostUsd": { "$ref": "#/definitions/nullableString" }
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"automaticSummaryPolicy": {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"additionalProperties": false,
|
|
249
|
+
"required": [
|
|
250
|
+
"contractVersion",
|
|
251
|
+
"decision",
|
|
252
|
+
"queryStatus",
|
|
253
|
+
"queryId",
|
|
254
|
+
"provider",
|
|
255
|
+
"reason",
|
|
256
|
+
"observedAt",
|
|
257
|
+
"validUntil",
|
|
258
|
+
"queriedAt",
|
|
259
|
+
"provenance"
|
|
260
|
+
],
|
|
261
|
+
"properties": {
|
|
262
|
+
"contractVersion": { "const": "rarebit-automatic-summary-policy/1" },
|
|
263
|
+
"decision": { "const": "inhibit" },
|
|
264
|
+
"queryStatus": { "const": "inhibited" },
|
|
265
|
+
"queryId": { "type": "string", "minLength": 1 },
|
|
266
|
+
"provider": { "type": "string", "minLength": 1 },
|
|
267
|
+
"reason": { "type": "string", "minLength": 1 },
|
|
268
|
+
"observedAt": { "type": "string", "format": "date-time" },
|
|
269
|
+
"validUntil": { "type": "string", "format": "date-time" },
|
|
270
|
+
"queriedAt": { "type": "string", "format": "date-time" },
|
|
271
|
+
"provenance": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"additionalProperties": false,
|
|
274
|
+
"required": ["identity", "generation", "association"],
|
|
275
|
+
"properties": {
|
|
276
|
+
"identity": { "type": "string", "minLength": 1 },
|
|
277
|
+
"generation": { "type": "string", "minLength": 1 },
|
|
278
|
+
"association": { "type": "string", "minLength": 1 }
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"summary": {
|
|
284
|
+
"type": "object",
|
|
285
|
+
"additionalProperties": false,
|
|
286
|
+
"required": [
|
|
287
|
+
"schemaVersion",
|
|
288
|
+
"type",
|
|
289
|
+
"status",
|
|
290
|
+
"jobId",
|
|
291
|
+
"sessionId",
|
|
292
|
+
"branch",
|
|
293
|
+
"observedAt",
|
|
294
|
+
"selection",
|
|
295
|
+
"lifecycleBoundary",
|
|
296
|
+
"implementationVersion",
|
|
297
|
+
"synthesisMode",
|
|
298
|
+
"inputCoveragePolicy",
|
|
299
|
+
"promptVersion",
|
|
300
|
+
"model",
|
|
301
|
+
"modelProvenance"
|
|
302
|
+
],
|
|
303
|
+
"properties": {
|
|
304
|
+
"schemaVersion": { "const": 4 },
|
|
305
|
+
"type": { "const": "rarebit_summary" },
|
|
306
|
+
"status": {
|
|
307
|
+
"enum": [
|
|
308
|
+
"ok",
|
|
309
|
+
"ineligible",
|
|
310
|
+
"inhibited",
|
|
311
|
+
"unavailable_overflow",
|
|
312
|
+
"failure"
|
|
313
|
+
]
|
|
314
|
+
},
|
|
315
|
+
"jobId": { "$ref": "#/definitions/sha256" },
|
|
316
|
+
"sessionId": { "type": "string", "minLength": 1 },
|
|
317
|
+
"branch": { "$ref": "#/definitions/branch" },
|
|
318
|
+
"observedAt": { "type": "string", "format": "date-time" },
|
|
319
|
+
"selection": { "$ref": "#/definitions/selection" },
|
|
320
|
+
"lifecycleBoundary": {
|
|
321
|
+
"enum": ["owner_request", "agent_settled", "session_start", "manual"]
|
|
322
|
+
},
|
|
323
|
+
"implementationVersion": {
|
|
324
|
+
"enum": [
|
|
325
|
+
"hc-rarebit-summary-v4",
|
|
326
|
+
"hc-rarebit-summary-v5",
|
|
327
|
+
"hc-rarebit-summary-v6"
|
|
328
|
+
]
|
|
329
|
+
},
|
|
330
|
+
"synthesisMode": { "enum": ["forced", "automatic"] },
|
|
331
|
+
"inputCoveragePolicy": { "$ref": "#/definitions/inputCoveragePolicy" },
|
|
332
|
+
"promptVersion": { "type": "string", "minLength": 1 },
|
|
333
|
+
"model": { "$ref": "#/definitions/model" },
|
|
334
|
+
"modelProvenance": { "$ref": "#/definitions/modelProvenance" },
|
|
335
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
336
|
+
"sessionStatus": {
|
|
337
|
+
"enum": ["user_requested", "finished", "needs_attention"]
|
|
338
|
+
},
|
|
339
|
+
"statusReason": {
|
|
340
|
+
"enum": [
|
|
341
|
+
"owner_request_recorded",
|
|
342
|
+
"all_requests_accomplished",
|
|
343
|
+
"decision",
|
|
344
|
+
"input",
|
|
345
|
+
"approval",
|
|
346
|
+
"blocker",
|
|
347
|
+
"unfinished",
|
|
348
|
+
"uncertain",
|
|
349
|
+
"conflicting_evidence"
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
"inputCoverage": { "$ref": "#/definitions/inputCoverage" },
|
|
353
|
+
"synthesis": { "$ref": "#/definitions/synthesis" },
|
|
354
|
+
"automaticSummaryPolicy": {
|
|
355
|
+
"$ref": "#/definitions/automaticSummaryPolicy"
|
|
356
|
+
},
|
|
357
|
+
"overflow": { "$ref": "#/definitions/overflow" },
|
|
358
|
+
"retryable": { "type": "boolean" },
|
|
359
|
+
"error": { "$ref": "#/definitions/error" }
|
|
360
|
+
},
|
|
361
|
+
"allOf": [
|
|
362
|
+
{
|
|
363
|
+
"oneOf": [
|
|
364
|
+
{
|
|
365
|
+
"properties": { "status": { "const": "ok" } },
|
|
366
|
+
"required": [
|
|
367
|
+
"summary",
|
|
368
|
+
"sessionStatus",
|
|
369
|
+
"statusReason",
|
|
370
|
+
"synthesis"
|
|
371
|
+
],
|
|
372
|
+
"not": {
|
|
373
|
+
"anyOf": [
|
|
374
|
+
{ "required": ["automaticSummaryPolicy"] },
|
|
375
|
+
{ "required": ["overflow"] },
|
|
376
|
+
{ "required": ["retryable"] },
|
|
377
|
+
{ "required": ["error"] }
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"properties": { "status": { "const": "ineligible" } },
|
|
383
|
+
"not": {
|
|
384
|
+
"anyOf": [
|
|
385
|
+
{ "required": ["summary"] },
|
|
386
|
+
{ "required": ["sessionStatus"] },
|
|
387
|
+
{ "required": ["statusReason"] },
|
|
388
|
+
{ "required": ["synthesis"] },
|
|
389
|
+
{ "required": ["automaticSummaryPolicy"] },
|
|
390
|
+
{ "required": ["overflow"] },
|
|
391
|
+
{ "required": ["retryable"] },
|
|
392
|
+
{ "required": ["error"] }
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"properties": { "status": { "const": "inhibited" } },
|
|
398
|
+
"required": ["automaticSummaryPolicy"],
|
|
399
|
+
"not": {
|
|
400
|
+
"anyOf": [
|
|
401
|
+
{ "required": ["summary"] },
|
|
402
|
+
{ "required": ["sessionStatus"] },
|
|
403
|
+
{ "required": ["statusReason"] },
|
|
404
|
+
{ "required": ["synthesis"] },
|
|
405
|
+
{ "required": ["overflow"] },
|
|
406
|
+
{ "required": ["retryable"] },
|
|
407
|
+
{ "required": ["error"] }
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"properties": { "status": { "const": "unavailable_overflow" } },
|
|
413
|
+
"required": ["overflow"],
|
|
414
|
+
"not": {
|
|
415
|
+
"anyOf": [
|
|
416
|
+
{ "required": ["summary"] },
|
|
417
|
+
{ "required": ["sessionStatus"] },
|
|
418
|
+
{ "required": ["statusReason"] },
|
|
419
|
+
{ "required": ["synthesis"] },
|
|
420
|
+
{ "required": ["automaticSummaryPolicy"] },
|
|
421
|
+
{ "required": ["retryable"] },
|
|
422
|
+
{ "required": ["error"] }
|
|
423
|
+
]
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"properties": { "status": { "const": "failure" } },
|
|
428
|
+
"required": ["retryable", "error"],
|
|
429
|
+
"not": {
|
|
430
|
+
"anyOf": [
|
|
431
|
+
{ "required": ["summary"] },
|
|
432
|
+
{ "required": ["sessionStatus"] },
|
|
433
|
+
{ "required": ["statusReason"] },
|
|
434
|
+
{ "required": ["synthesis"] },
|
|
435
|
+
{ "required": ["automaticSummaryPolicy"] },
|
|
436
|
+
{ "required": ["overflow"] }
|
|
437
|
+
]
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"if": {
|
|
444
|
+
"properties": { "sessionStatus": { "const": "finished" } },
|
|
445
|
+
"required": ["sessionStatus"]
|
|
446
|
+
},
|
|
447
|
+
"then": {
|
|
448
|
+
"properties": {
|
|
449
|
+
"statusReason": { "const": "all_requests_accomplished" }
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"if": {
|
|
455
|
+
"properties": { "sessionStatus": { "const": "needs_attention" } },
|
|
456
|
+
"required": ["sessionStatus"]
|
|
457
|
+
},
|
|
458
|
+
"then": {
|
|
459
|
+
"properties": {
|
|
460
|
+
"statusReason": {
|
|
461
|
+
"enum": [
|
|
462
|
+
"decision",
|
|
463
|
+
"input",
|
|
464
|
+
"approval",
|
|
465
|
+
"blocker",
|
|
466
|
+
"unfinished"
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"if": {
|
|
474
|
+
"properties": { "lifecycleBoundary": { "const": "owner_request" } },
|
|
475
|
+
"required": ["lifecycleBoundary"]
|
|
476
|
+
},
|
|
477
|
+
"then": {
|
|
478
|
+
"properties": {
|
|
479
|
+
"selection": {
|
|
480
|
+
"properties": {
|
|
481
|
+
"latestUserSourceEntryId": {
|
|
482
|
+
"type": "string",
|
|
483
|
+
"minLength": 1
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
"sessionStatus": { "const": "user_requested" },
|
|
488
|
+
"statusReason": { "const": "owner_request_recorded" }
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
"else": {
|
|
492
|
+
"not": {
|
|
493
|
+
"properties": { "sessionStatus": { "const": "user_requested" } },
|
|
494
|
+
"required": ["sessionStatus"]
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
]
|
|
499
|
+
},
|
|
500
|
+
"head": {
|
|
501
|
+
"type": "object",
|
|
502
|
+
"additionalProperties": false,
|
|
503
|
+
"required": [
|
|
504
|
+
"type",
|
|
505
|
+
"protocolVersion",
|
|
506
|
+
"sessionId",
|
|
507
|
+
"receiptOffset",
|
|
508
|
+
"receiptLength",
|
|
509
|
+
"receiptHash"
|
|
510
|
+
],
|
|
511
|
+
"properties": {
|
|
512
|
+
"type": { "const": "rarebit_head" },
|
|
513
|
+
"protocolVersion": { "const": 1 },
|
|
514
|
+
"sessionId": { "type": "string", "minLength": 1 },
|
|
515
|
+
"receiptOffset": { "type": "integer", "minimum": 0 },
|
|
516
|
+
"receiptLength": { "type": "integer", "minimum": 1, "maximum": 49152 },
|
|
517
|
+
"receiptHash": { "$ref": "#/definitions/sha256" }
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
"titleEvidence": {
|
|
521
|
+
"type": "object",
|
|
522
|
+
"additionalProperties": false,
|
|
523
|
+
"required": ["provenance", "sourceEntryId"],
|
|
524
|
+
"properties": {
|
|
525
|
+
"provenance": { "type": "string", "minLength": 1 },
|
|
526
|
+
"sourceEntryId": { "$ref": "#/definitions/nullableString" }
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
"title": {
|
|
530
|
+
"type": "object",
|
|
531
|
+
"additionalProperties": false,
|
|
532
|
+
"required": [
|
|
533
|
+
"schemaVersion",
|
|
534
|
+
"type",
|
|
535
|
+
"status",
|
|
536
|
+
"jobId",
|
|
537
|
+
"implementationVersion",
|
|
538
|
+
"sessionId",
|
|
539
|
+
"branch",
|
|
540
|
+
"selectionManifestHash",
|
|
541
|
+
"titleEvidence",
|
|
542
|
+
"promptVersion",
|
|
543
|
+
"model",
|
|
544
|
+
"modelProvenance",
|
|
545
|
+
"applicationMode",
|
|
546
|
+
"priorTitle",
|
|
547
|
+
"title",
|
|
548
|
+
"observedAt"
|
|
549
|
+
],
|
|
550
|
+
"properties": {
|
|
551
|
+
"schemaVersion": { "const": 4 },
|
|
552
|
+
"type": { "const": "rarebit_title" },
|
|
553
|
+
"status": {
|
|
554
|
+
"enum": [
|
|
555
|
+
"proposal",
|
|
556
|
+
"applied",
|
|
557
|
+
"skipped_session_changed",
|
|
558
|
+
"skipped_title_changed",
|
|
559
|
+
"skipped_existing_title",
|
|
560
|
+
"failure"
|
|
561
|
+
]
|
|
562
|
+
},
|
|
563
|
+
"jobId": { "$ref": "#/definitions/sha256" },
|
|
564
|
+
"implementationVersion": { "const": "hc-rarebit-title-v4" },
|
|
565
|
+
"sessionId": { "type": "string", "minLength": 1 },
|
|
566
|
+
"branch": { "$ref": "#/definitions/branch" },
|
|
567
|
+
"selectionManifestHash": { "$ref": "#/definitions/sha256" },
|
|
568
|
+
"titleEvidence": { "$ref": "#/definitions/titleEvidence" },
|
|
569
|
+
"promptVersion": { "type": "string", "minLength": 1 },
|
|
570
|
+
"model": { "$ref": "#/definitions/model" },
|
|
571
|
+
"modelProvenance": { "$ref": "#/definitions/modelProvenance" },
|
|
572
|
+
"applicationMode": { "enum": ["apply", "proposal"] },
|
|
573
|
+
"priorTitle": { "$ref": "#/definitions/nullableString" },
|
|
574
|
+
"title": { "$ref": "#/definitions/nullableString" },
|
|
575
|
+
"observedAt": { "type": "string", "format": "date-time" },
|
|
576
|
+
"synthesis": { "$ref": "#/definitions/synthesis" },
|
|
577
|
+
"retryable": { "type": "boolean" },
|
|
578
|
+
"error": { "$ref": "#/definitions/error" }
|
|
579
|
+
},
|
|
580
|
+
"oneOf": [
|
|
581
|
+
{
|
|
582
|
+
"properties": {
|
|
583
|
+
"status": { "const": "failure" },
|
|
584
|
+
"title": { "type": "null" }
|
|
585
|
+
},
|
|
586
|
+
"required": ["retryable", "error"],
|
|
587
|
+
"not": { "required": ["synthesis"] }
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"properties": {
|
|
591
|
+
"status": { "enum": ["proposal", "applied"] },
|
|
592
|
+
"title": { "type": "string", "minLength": 1 }
|
|
593
|
+
},
|
|
594
|
+
"required": ["synthesis"],
|
|
595
|
+
"not": {
|
|
596
|
+
"anyOf": [{ "required": ["retryable"] }, { "required": ["error"] }]
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"properties": {
|
|
601
|
+
"status": {
|
|
602
|
+
"enum": [
|
|
603
|
+
"skipped_session_changed",
|
|
604
|
+
"skipped_title_changed",
|
|
605
|
+
"skipped_existing_title"
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
"title": { "type": "null" }
|
|
609
|
+
},
|
|
610
|
+
"required": ["synthesis"],
|
|
611
|
+
"not": {
|
|
612
|
+
"anyOf": [{ "required": ["retryable"] }, { "required": ["error"] }]
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
]
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|