@gmickel/gno 1.17.0 → 1.19.0

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.
Files changed (167) hide show
  1. package/README.md +18 -4
  2. package/assets/skill/SKILL.md +44 -1
  3. package/assets/skill/mcp-reference.md +21 -0
  4. package/package.json +3 -2
  5. package/spec/AGENTS.md +83 -0
  6. package/spec/CLAUDE.md +83 -0
  7. package/spec/bench-fixture.schema.json +137 -0
  8. package/spec/cli.md +2894 -0
  9. package/spec/db/schema.sql +442 -0
  10. package/spec/evals-agentic.md +510 -0
  11. package/spec/evals.md +1106 -0
  12. package/spec/mcp.md +2229 -0
  13. package/spec/output-schemas/activation-verification.schema.json +515 -0
  14. package/spec/output-schemas/ask.schema.json +366 -0
  15. package/spec/output-schemas/backlinks.schema.json +131 -0
  16. package/spec/output-schemas/bench-result.schema.json +120 -0
  17. package/spec/output-schemas/capture-receipt.schema.json +143 -0
  18. package/spec/output-schemas/collection-list.schema.json +45 -0
  19. package/spec/output-schemas/context-capsule-v1.schema.json +691 -0
  20. package/spec/output-schemas/context-capsule-verification.schema.json +1338 -0
  21. package/spec/output-schemas/context-list.schema.json +21 -0
  22. package/spec/output-schemas/doctor.schema.json +313 -0
  23. package/spec/output-schemas/error.schema.json +30 -0
  24. package/spec/output-schemas/expansion.schema.json +37 -0
  25. package/spec/output-schemas/get.schema.json +140 -0
  26. package/spec/output-schemas/graph-query.schema.json +99 -0
  27. package/spec/output-schemas/graph.schema.json +371 -0
  28. package/spec/output-schemas/links-list.schema.json +186 -0
  29. package/spec/output-schemas/mcp-add-collection-result.schema.json +23 -0
  30. package/spec/output-schemas/mcp-capture-result.schema.json +152 -0
  31. package/spec/output-schemas/mcp-http-error.schema.json +30 -0
  32. package/spec/output-schemas/mcp-job-list.schema.json +58 -0
  33. package/spec/output-schemas/mcp-job-status.schema.json +224 -0
  34. package/spec/output-schemas/mcp-remove-result.schema.json +39 -0
  35. package/spec/output-schemas/mcp-sync-result.schema.json +41 -0
  36. package/spec/output-schemas/mcp-tag-result.schema.json +33 -0
  37. package/spec/output-schemas/models-list.schema.json +93 -0
  38. package/spec/output-schemas/multi-get.schema.json +103 -0
  39. package/spec/output-schemas/process-status.schema.json +119 -0
  40. package/spec/output-schemas/query-diagnose.schema.json +123 -0
  41. package/spec/output-schemas/resident-status.schema.json +154 -0
  42. package/spec/output-schemas/retrieval-trace-common.schema.json +492 -0
  43. package/spec/output-schemas/retrieval-trace-delete.schema.json +16 -0
  44. package/spec/output-schemas/retrieval-trace-export.schema.json +61 -0
  45. package/spec/output-schemas/retrieval-trace-filters.schema.json +139 -0
  46. package/spec/output-schemas/retrieval-trace-judgment.schema.json +15 -0
  47. package/spec/output-schemas/retrieval-trace-list.schema.json +18 -0
  48. package/spec/output-schemas/retrieval-trace-payloads.schema.json +178 -0
  49. package/spec/output-schemas/retrieval-trace-purge.schema.json +31 -0
  50. package/spec/output-schemas/retrieval-trace-qrels.schema.json +303 -0
  51. package/spec/output-schemas/retrieval-trace-replay.schema.json +286 -0
  52. package/spec/output-schemas/retrieval-trace-show.schema.json +69 -0
  53. package/spec/output-schemas/retrieval-trace-summary.schema.json +65 -0
  54. package/spec/output-schemas/search-result.schema.json +154 -0
  55. package/spec/output-schemas/search-results.schema.json +338 -0
  56. package/spec/output-schemas/similar.schema.json +84 -0
  57. package/spec/output-schemas/status.schema.json +676 -0
  58. package/spec/output-schemas/tags-list.schema.json +48 -0
  59. package/src/app/context-runtime-types.ts +3 -0
  60. package/src/app/context-runtime.ts +15 -1
  61. package/src/cli/commands/ask.ts +106 -36
  62. package/src/cli/commands/context-build.ts +56 -9
  63. package/src/cli/commands/daemon.ts +69 -2
  64. package/src/cli/commands/get.ts +64 -3
  65. package/src/cli/commands/models/pull.ts +13 -3
  66. package/src/cli/commands/query.ts +62 -23
  67. package/src/cli/commands/replay.ts +140 -0
  68. package/src/cli/commands/search.ts +48 -3
  69. package/src/cli/commands/shared.ts +3 -1
  70. package/src/cli/commands/status.ts +2 -0
  71. package/src/cli/commands/trace.ts +200 -0
  72. package/src/cli/commands/vsearch.ts +75 -53
  73. package/src/cli/detach.ts +37 -20
  74. package/src/cli/program.ts +329 -27
  75. package/src/config/index.ts +12 -0
  76. package/src/config/retrieval-traces.ts +56 -0
  77. package/src/config/types.ts +41 -0
  78. package/src/core/context-compiler.ts +11 -4
  79. package/src/core/job-manager.ts +19 -0
  80. package/src/core/mutation-generations.ts +33 -0
  81. package/src/core/retrieval-qrels.ts +405 -0
  82. package/src/core/retrieval-replay-candidate.ts +368 -0
  83. package/src/core/retrieval-replay-types.ts +109 -0
  84. package/src/core/retrieval-replay-validation.ts +89 -0
  85. package/src/core/retrieval-replay.ts +441 -0
  86. package/src/core/retrieval-trace-evidence-origin.ts +175 -0
  87. package/src/core/retrieval-trace-export.ts +113 -0
  88. package/src/core/retrieval-trace-filter-normalization.ts +27 -0
  89. package/src/core/retrieval-trace-filters.ts +19 -0
  90. package/src/core/retrieval-trace-management-helpers.ts +247 -0
  91. package/src/core/retrieval-trace-management-types.ts +132 -0
  92. package/src/core/retrieval-trace-management.ts +422 -0
  93. package/src/core/retrieval-trace-request.ts +141 -0
  94. package/src/core/retrieval-trace-session.ts +494 -0
  95. package/src/core/retrieval-trace.ts +472 -0
  96. package/src/llm/cache.ts +13 -3
  97. package/src/llm/nodeLlamaCpp/adapter.ts +10 -1
  98. package/src/llm/nodeLlamaCpp/lifecycle.ts +71 -0
  99. package/src/mcp/context.ts +161 -0
  100. package/src/mcp/http-security.ts +477 -0
  101. package/src/mcp/http-session.ts +272 -0
  102. package/src/mcp/http-transport.ts +370 -0
  103. package/src/mcp/resources/index.ts +141 -134
  104. package/src/mcp/server.ts +19 -79
  105. package/src/mcp/tools/add-collection.ts +3 -1
  106. package/src/mcp/tools/capture.ts +3 -0
  107. package/src/mcp/tools/clear-collection-embeddings.ts +2 -0
  108. package/src/mcp/tools/context.ts +68 -16
  109. package/src/mcp/tools/embed.ts +62 -52
  110. package/src/mcp/tools/get.ts +35 -1
  111. package/src/mcp/tools/index-cmd.ts +88 -74
  112. package/src/mcp/tools/index.ts +96 -2
  113. package/src/mcp/tools/query.ts +95 -64
  114. package/src/mcp/tools/remove-collection.ts +2 -0
  115. package/src/mcp/tools/search.ts +36 -13
  116. package/src/mcp/tools/status.ts +11 -0
  117. package/src/mcp/tools/sync.ts +16 -14
  118. package/src/mcp/tools/trace.ts +143 -0
  119. package/src/mcp/tools/vsearch.ts +71 -38
  120. package/src/mcp/tools/workspace-write.ts +7 -3
  121. package/src/pipeline/answer.ts +167 -26
  122. package/src/pipeline/graph-retrieval.ts +15 -1
  123. package/src/pipeline/hybrid.ts +151 -43
  124. package/src/pipeline/search.ts +36 -3
  125. package/src/pipeline/trace-metadata.ts +47 -0
  126. package/src/pipeline/types.ts +43 -0
  127. package/src/pipeline/vsearch.ts +101 -38
  128. package/src/sdk/client.ts +380 -71
  129. package/src/sdk/documents.ts +48 -1
  130. package/src/sdk/index.ts +17 -0
  131. package/src/sdk/types.ts +28 -0
  132. package/src/serve/background-runtime.ts +12 -212
  133. package/src/serve/context-capsule.ts +67 -8
  134. package/src/serve/embed-scheduler.ts +74 -43
  135. package/src/serve/index.ts +9 -0
  136. package/src/serve/jobs.ts +78 -80
  137. package/src/serve/public/app.tsx +12 -1
  138. package/src/serve/public/components/HealthCenter.tsx +74 -1
  139. package/src/serve/public/globals.built.css +1 -1
  140. package/src/serve/public/lib/workspace-tabs.ts +2 -0
  141. package/src/serve/public/pages/Dashboard.tsx +11 -0
  142. package/src/serve/public/pages/TraceHistory.tsx +478 -0
  143. package/src/serve/public/pages/trace-history-detail.tsx +224 -0
  144. package/src/serve/resident-admission.ts +159 -0
  145. package/src/serve/resident-background-work.ts +39 -0
  146. package/src/serve/resident-request.ts +55 -0
  147. package/src/serve/resident-runtime.ts +490 -0
  148. package/src/serve/resident-status.ts +96 -0
  149. package/src/serve/retrieval-trace.ts +28 -0
  150. package/src/serve/routes/api.ts +629 -239
  151. package/src/serve/routes/mcp.ts +69 -0
  152. package/src/serve/routes/traces.ts +156 -0
  153. package/src/serve/server.ts +276 -37
  154. package/src/serve/status-model.ts +51 -0
  155. package/src/serve/status.ts +5 -0
  156. package/src/store/index.ts +31 -0
  157. package/src/store/migrations/014-retrieval-traces.ts +303 -0
  158. package/src/store/migrations/index.ts +2 -0
  159. package/src/store/retrieval-trace-codec.ts +384 -0
  160. package/src/store/sqlite/adapter.ts +179 -10
  161. package/src/store/sqlite/retrieval-trace-management-store.ts +341 -0
  162. package/src/store/sqlite/retrieval-trace-retention.ts +349 -0
  163. package/src/store/sqlite/retrieval-trace-rows.ts +267 -0
  164. package/src/store/sqlite/retrieval-trace-store.ts +515 -0
  165. package/src/store/types.ts +297 -0
  166. package/src/store/vector/sqlite-vec.ts +76 -1
  167. package/src/store/vector/types.ts +1 -1
@@ -0,0 +1,303 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/retrieval-trace-qrels@1.0",
4
+ "title": "GNO Retrieval Trace Qrels Artifact",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "format", "cases"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "1.0" },
10
+ "format": { "const": "qrels" },
11
+ "cases": {
12
+ "type": "array",
13
+ "minItems": 1,
14
+ "items": { "$ref": "#/definitions/case" }
15
+ }
16
+ },
17
+ "definitions": {
18
+ "hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
19
+ "nullableHash": {
20
+ "oneOf": [{ "$ref": "#/definitions/hash" }, { "type": "null" }]
21
+ },
22
+ "evidence": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "docid",
27
+ "sourceHash",
28
+ "mirrorHash",
29
+ "uri",
30
+ "seq",
31
+ "startLine",
32
+ "endLine",
33
+ "passageHash",
34
+ "rank",
35
+ "plannerRank",
36
+ "score",
37
+ "sources",
38
+ "graphExpanded"
39
+ ],
40
+ "properties": {
41
+ "docid": { "type": "string", "minLength": 1 },
42
+ "sourceHash": { "$ref": "#/definitions/hash" },
43
+ "mirrorHash": { "$ref": "#/definitions/hash" },
44
+ "uri": { "type": "string", "pattern": "^gno://" },
45
+ "seq": {
46
+ "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }]
47
+ },
48
+ "startLine": { "type": "integer", "minimum": 1 },
49
+ "endLine": { "type": "integer", "minimum": 1 },
50
+ "passageHash": { "$ref": "#/definitions/hash" },
51
+ "rank": {
52
+ "oneOf": [{ "type": "integer", "minimum": 1 }, { "type": "null" }]
53
+ },
54
+ "plannerRank": {
55
+ "oneOf": [{ "type": "integer", "minimum": 1 }, { "type": "null" }]
56
+ },
57
+ "score": {
58
+ "oneOf": [{ "type": "number" }, { "type": "null" }]
59
+ },
60
+ "sources": {
61
+ "type": "array",
62
+ "items": { "type": "string", "minLength": 1 }
63
+ },
64
+ "graphExpanded": { "type": "boolean" }
65
+ }
66
+ },
67
+ "target": {
68
+ "$ref": "gno://schemas/retrieval-trace-payloads@1.0#/definitions/judgmentTarget"
69
+ },
70
+ "qrel": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": [
74
+ "qrelId",
75
+ "judgmentId",
76
+ "label",
77
+ "relevance",
78
+ "baselineMissing",
79
+ "target",
80
+ "evidence"
81
+ ],
82
+ "properties": {
83
+ "qrelId": { "type": "string", "minLength": 1 },
84
+ "judgmentId": { "type": "string", "minLength": 1 },
85
+ "label": {
86
+ "enum": ["relevant", "irrelevant", "missing_expected"]
87
+ },
88
+ "relevance": { "enum": [0, 1] },
89
+ "baselineMissing": { "type": "boolean" },
90
+ "target": { "$ref": "#/definitions/target" },
91
+ "evidence": {
92
+ "oneOf": [{ "$ref": "#/definitions/evidence" }, { "type": "null" }]
93
+ }
94
+ }
95
+ },
96
+ "case": {
97
+ "type": "object",
98
+ "additionalProperties": false,
99
+ "required": [
100
+ "caseId",
101
+ "traceId",
102
+ "retrievalRunId",
103
+ "terminalStatus",
104
+ "query",
105
+ "fingerprints",
106
+ "baseline",
107
+ "judgments",
108
+ "qrels"
109
+ ],
110
+ "properties": {
111
+ "caseId": { "type": "string", "minLength": 1 },
112
+ "traceId": { "type": "string", "minLength": 1 },
113
+ "retrievalRunId": { "type": "string", "minLength": 1 },
114
+ "terminalStatus": {
115
+ "enum": ["completed", "partial", "failed", "cancelled"]
116
+ },
117
+ "query": {
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "required": ["text", "digest", "goalText", "goalDigest", "filters"],
121
+ "properties": {
122
+ "text": { "type": "string", "minLength": 1 },
123
+ "digest": { "$ref": "#/definitions/hash" },
124
+ "goalText": {
125
+ "oneOf": [{ "type": "string" }, { "type": "null" }]
126
+ },
127
+ "goalDigest": { "$ref": "#/definitions/nullableHash" },
128
+ "filters": {
129
+ "$ref": "gno://schemas/retrieval-trace-filters@1.0#/definitions/filters"
130
+ }
131
+ }
132
+ },
133
+ "fingerprints": {
134
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/fingerprints"
135
+ },
136
+ "baseline": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": [
140
+ "ranked",
141
+ "capabilities",
142
+ "capabilityOutcomes",
143
+ "fallbackCodes",
144
+ "outcomes"
145
+ ],
146
+ "properties": {
147
+ "ranked": {
148
+ "type": "array",
149
+ "items": { "$ref": "#/definitions/evidence" }
150
+ },
151
+ "capabilities": {
152
+ "type": "array",
153
+ "items": { "type": "string", "minLength": 1 }
154
+ },
155
+ "capabilityOutcomes": {
156
+ "type": "array",
157
+ "items": {
158
+ "type": "object",
159
+ "additionalProperties": false,
160
+ "required": ["capability", "status", "reasonCode"],
161
+ "properties": {
162
+ "capability": { "type": "string" },
163
+ "status": {
164
+ "enum": ["attempted", "used", "unavailable", "failed"]
165
+ },
166
+ "reasonCode": {
167
+ "oneOf": [{ "type": "string" }, { "type": "null" }]
168
+ }
169
+ }
170
+ }
171
+ },
172
+ "fallbackCodes": {
173
+ "type": "array",
174
+ "items": { "type": "string" }
175
+ },
176
+ "outcomes": {
177
+ "type": "object",
178
+ "additionalProperties": false,
179
+ "required": ["opened", "cited", "pinned"],
180
+ "properties": {
181
+ "opened": {
182
+ "type": "array",
183
+ "items": { "$ref": "#/definitions/evidence" }
184
+ },
185
+ "cited": {
186
+ "type": "array",
187
+ "items": { "$ref": "#/definitions/evidence" }
188
+ },
189
+ "pinned": {
190
+ "type": "array",
191
+ "items": { "$ref": "#/definitions/evidence" }
192
+ }
193
+ }
194
+ }
195
+ }
196
+ },
197
+ "judgments": {
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "required": ["history", "effective"],
201
+ "properties": {
202
+ "history": {
203
+ "type": "array",
204
+ "items": {
205
+ "type": "object",
206
+ "additionalProperties": false,
207
+ "required": [
208
+ "judgmentId",
209
+ "label",
210
+ "targetKind",
211
+ "target",
212
+ "createdAtMs",
213
+ "canonicalDigest"
214
+ ],
215
+ "properties": {
216
+ "judgmentId": { "type": "string" },
217
+ "label": {
218
+ "enum": ["relevant", "irrelevant", "missing_expected"]
219
+ },
220
+ "targetKind": {
221
+ "enum": ["document", "chunk", "span", "query"]
222
+ },
223
+ "target": { "$ref": "#/definitions/target" },
224
+ "createdAtMs": { "type": "integer", "minimum": 0 },
225
+ "canonicalDigest": { "$ref": "#/definitions/hash" }
226
+ },
227
+ "allOf": [
228
+ {
229
+ "if": {
230
+ "properties": {
231
+ "targetKind": { "const": "document" }
232
+ },
233
+ "required": ["targetKind"]
234
+ },
235
+ "then": {
236
+ "properties": {
237
+ "target": {
238
+ "$ref": "gno://schemas/retrieval-trace-payloads@1.0#/definitions/documentTarget"
239
+ }
240
+ }
241
+ }
242
+ },
243
+ {
244
+ "if": {
245
+ "properties": { "targetKind": { "const": "chunk" } },
246
+ "required": ["targetKind"]
247
+ },
248
+ "then": {
249
+ "properties": {
250
+ "target": {
251
+ "allOf": [
252
+ { "$ref": "#/definitions/target" },
253
+ {
254
+ "type": "object",
255
+ "properties": { "seq": {} },
256
+ "required": ["seq"]
257
+ }
258
+ ]
259
+ }
260
+ }
261
+ }
262
+ },
263
+ {
264
+ "if": {
265
+ "properties": { "targetKind": { "const": "span" } },
266
+ "required": ["targetKind"]
267
+ },
268
+ "then": {
269
+ "properties": {
270
+ "target": {
271
+ "allOf": [
272
+ { "$ref": "#/definitions/target" },
273
+ {
274
+ "type": "object",
275
+ "properties": {
276
+ "startLine": {},
277
+ "endLine": {}
278
+ },
279
+ "required": ["startLine", "endLine"]
280
+ }
281
+ ]
282
+ }
283
+ }
284
+ }
285
+ }
286
+ ]
287
+ }
288
+ },
289
+ "effective": {
290
+ "type": "array",
291
+ "items": { "type": "string" }
292
+ }
293
+ }
294
+ },
295
+ "qrels": {
296
+ "type": "array",
297
+ "minItems": 1,
298
+ "items": { "$ref": "#/definitions/qrel" }
299
+ }
300
+ }
301
+ }
302
+ }
303
+ }
@@ -0,0 +1,286 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/retrieval-trace-replay@1.0",
4
+ "title": "GNO Retrieval Trace Replay",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "exportId",
10
+ "candidate",
11
+ "verdict",
12
+ "reason",
13
+ "recommendation",
14
+ "applied",
15
+ "cases"
16
+ ],
17
+ "properties": {
18
+ "schemaVersion": { "const": "1.0" },
19
+ "exportId": { "type": "string", "minLength": 1, "maxLength": 128 },
20
+ "candidate": {
21
+ "type": "object",
22
+ "required": ["id", "type"],
23
+ "properties": {
24
+ "id": { "type": "string", "minLength": 1, "maxLength": 128 },
25
+ "type": { "enum": ["bm25", "vector", "hybrid"] },
26
+ "limit": {
27
+ "type": "integer",
28
+ "minimum": 1,
29
+ "maximum": 10000
30
+ },
31
+ "candidateLimit": {
32
+ "type": "integer",
33
+ "minimum": 1,
34
+ "maximum": 10000
35
+ },
36
+ "noExpand": { "type": "boolean" },
37
+ "noRerank": { "type": "boolean" },
38
+ "queryModes": {
39
+ "type": "array",
40
+ "maxItems": 100,
41
+ "uniqueItems": true,
42
+ "items": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["mode", "text"],
46
+ "properties": {
47
+ "mode": { "enum": ["term", "intent", "hyde"] },
48
+ "text": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "maxLength": 8192
52
+ }
53
+ }
54
+ }
55
+ }
56
+ },
57
+ "additionalProperties": false
58
+ },
59
+ "verdict": {
60
+ "enum": ["improved", "unchanged", "regressed", "unreplayable"]
61
+ },
62
+ "reason": {
63
+ "oneOf": [
64
+ {
65
+ "enum": [
66
+ "manifest_missing",
67
+ "manifest_hash_mismatch",
68
+ "trace_missing",
69
+ "redaction_incompatible",
70
+ "query_missing",
71
+ "filters_incomplete",
72
+ "no_retrieval_run",
73
+ "ambiguous_missing_expected_run",
74
+ "source_stale",
75
+ "source_missing",
76
+ "candidate_failed"
77
+ ]
78
+ },
79
+ { "type": "null" }
80
+ ]
81
+ },
82
+ "recommendation": {
83
+ "enum": ["promote", "keep_baseline", "manual_review"]
84
+ },
85
+ "applied": { "const": false },
86
+ "cases": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": [
92
+ "caseId",
93
+ "traceId",
94
+ "terminalStatus",
95
+ "verdict",
96
+ "reason",
97
+ "metrics",
98
+ "fingerprints",
99
+ "capabilityOutcomes",
100
+ "fallbackCodes",
101
+ "qrels"
102
+ ],
103
+ "properties": {
104
+ "caseId": { "type": "string" },
105
+ "traceId": { "type": "string" },
106
+ "terminalStatus": {
107
+ "enum": ["completed", "partial", "failed", "cancelled"]
108
+ },
109
+ "verdict": {
110
+ "enum": ["improved", "unchanged", "regressed", "unreplayable"]
111
+ },
112
+ "reason": {
113
+ "oneOf": [
114
+ { "$ref": "#/properties/reason/oneOf/0" },
115
+ { "type": "null" }
116
+ ]
117
+ },
118
+ "metrics": {
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": [
122
+ "baseline",
123
+ "candidate",
124
+ "baselineCoverage",
125
+ "candidateCoverage"
126
+ ],
127
+ "properties": {
128
+ "baseline": { "$ref": "#/definitions/metrics" },
129
+ "candidate": { "$ref": "#/definitions/metrics" },
130
+ "baselineCoverage": { "type": "number" },
131
+ "candidateCoverage": { "type": "number" }
132
+ }
133
+ },
134
+ "fingerprints": {
135
+ "type": "object",
136
+ "additionalProperties": false,
137
+ "required": ["original", "current", "candidate"],
138
+ "properties": {
139
+ "original": {
140
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/fingerprints"
141
+ },
142
+ "current": {
143
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/fingerprints"
144
+ },
145
+ "candidate": {
146
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/fingerprints"
147
+ }
148
+ }
149
+ },
150
+ "capabilityOutcomes": {
151
+ "type": "object",
152
+ "required": ["baseline", "candidate"],
153
+ "properties": {
154
+ "baseline": {
155
+ "type": "array",
156
+ "items": { "$ref": "#/definitions/capabilityOutcome" }
157
+ },
158
+ "candidate": {
159
+ "type": "array",
160
+ "items": { "$ref": "#/definitions/capabilityOutcome" }
161
+ }
162
+ },
163
+ "additionalProperties": false
164
+ },
165
+ "fallbackCodes": {
166
+ "type": "object",
167
+ "required": ["baseline", "candidate"],
168
+ "properties": {
169
+ "baseline": {
170
+ "type": "array",
171
+ "items": { "type": "string" }
172
+ },
173
+ "candidate": {
174
+ "type": "array",
175
+ "items": { "type": "string" }
176
+ }
177
+ },
178
+ "additionalProperties": false
179
+ },
180
+ "qrels": {
181
+ "type": "array",
182
+ "items": { "$ref": "#/definitions/qrelResult" }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ },
188
+ "definitions": {
189
+ "capabilityOutcome": {
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "required": ["capability", "status", "reasonCode"],
193
+ "properties": {
194
+ "capability": { "type": "string", "minLength": 1 },
195
+ "status": {
196
+ "enum": ["attempted", "used", "unavailable", "failed"]
197
+ },
198
+ "reasonCode": {
199
+ "oneOf": [{ "type": "string" }, { "type": "null" }]
200
+ }
201
+ }
202
+ },
203
+ "metrics": {
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": ["precisionAtK", "recallAtK", "f1AtK", "mrr", "ndcgAtK"],
207
+ "properties": {
208
+ "precisionAtK": { "type": "number" },
209
+ "recallAtK": { "type": "number" },
210
+ "f1AtK": { "type": "number" },
211
+ "mrr": { "type": "number" },
212
+ "ndcgAtK": { "type": "number" }
213
+ }
214
+ },
215
+ "qrelResult": {
216
+ "type": "object",
217
+ "additionalProperties": false,
218
+ "required": [
219
+ "qrelId",
220
+ "label",
221
+ "relevance",
222
+ "baselineRank",
223
+ "plannerRank",
224
+ "candidateRank",
225
+ "rankDelta",
226
+ "opened",
227
+ "cited",
228
+ "pinned",
229
+ "sourceState",
230
+ "diagnostic"
231
+ ],
232
+ "properties": {
233
+ "qrelId": { "type": "string" },
234
+ "label": {
235
+ "enum": ["relevant", "irrelevant", "missing_expected"]
236
+ },
237
+ "relevance": { "enum": [0, 1] },
238
+ "baselineRank": {
239
+ "oneOf": [{ "type": "integer" }, { "type": "null" }]
240
+ },
241
+ "plannerRank": {
242
+ "oneOf": [{ "type": "integer" }, { "type": "null" }]
243
+ },
244
+ "candidateRank": {
245
+ "oneOf": [{ "type": "integer" }, { "type": "null" }]
246
+ },
247
+ "rankDelta": {
248
+ "oneOf": [{ "type": "integer" }, { "type": "null" }]
249
+ },
250
+ "opened": { "type": "boolean" },
251
+ "cited": { "type": "boolean" },
252
+ "pinned": { "type": "boolean" },
253
+ "sourceState": {
254
+ "enum": [
255
+ "unchanged",
256
+ "stale",
257
+ "missing",
258
+ "inactive",
259
+ "no_indexed_content"
260
+ ]
261
+ },
262
+ "diagnostic": {
263
+ "oneOf": [
264
+ {
265
+ "type": "object",
266
+ "additionalProperties": false,
267
+ "required": ["status", "filterReasons", "stageDropReasons"],
268
+ "properties": {
269
+ "status": { "type": "string" },
270
+ "filterReasons": {
271
+ "type": "array",
272
+ "items": { "type": "string" }
273
+ },
274
+ "stageDropReasons": {
275
+ "type": "array",
276
+ "items": { "type": "string" }
277
+ }
278
+ }
279
+ },
280
+ { "type": "null" }
281
+ ]
282
+ }
283
+ }
284
+ }
285
+ }
286
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/retrieval-trace-show@1.0",
4
+ "title": "GNO Retrieval Trace Detail",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "trace",
10
+ "runs",
11
+ "events",
12
+ "judgments",
13
+ "exports",
14
+ "totals",
15
+ "truncated"
16
+ ],
17
+ "properties": {
18
+ "schemaVersion": { "const": "1.0" },
19
+ "trace": {
20
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/trace"
21
+ },
22
+ "runs": {
23
+ "type": "array",
24
+ "items": {
25
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/run"
26
+ }
27
+ },
28
+ "events": {
29
+ "type": "array",
30
+ "items": {
31
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/event"
32
+ }
33
+ },
34
+ "judgments": {
35
+ "type": "array",
36
+ "items": {
37
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/judgment"
38
+ }
39
+ },
40
+ "exports": {
41
+ "type": "array",
42
+ "items": {
43
+ "$ref": "gno://schemas/retrieval-trace-common@1.0#/definitions/exportRow"
44
+ }
45
+ },
46
+ "totals": {
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": ["runs", "events", "judgments", "exports"],
50
+ "properties": {
51
+ "runs": { "type": "integer", "minimum": 0 },
52
+ "events": { "type": "integer", "minimum": 0 },
53
+ "judgments": { "type": "integer", "minimum": 0 },
54
+ "exports": { "type": "integer", "minimum": 0 }
55
+ }
56
+ },
57
+ "truncated": {
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "required": ["runs", "events", "judgments", "exports"],
61
+ "properties": {
62
+ "runs": { "type": "boolean" },
63
+ "events": { "type": "boolean" },
64
+ "judgments": { "type": "boolean" },
65
+ "exports": { "type": "boolean" }
66
+ }
67
+ }
68
+ }
69
+ }