@morehao/trendradar-contract 0.6.0 → 0.7.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/CHANGELOG.md +40 -0
- package/README.md +22 -19
- package/fixtures/digest-degraded.json +8 -6
- package/fixtures/digest-empty-lang.json +8 -6
- package/fixtures/digest-en.json +103 -0
- package/fixtures/digest-missing-optional.json +8 -6
- package/fixtures/digest-normal.json +20 -14
- package/fixtures/release-degraded.json +6 -5
- package/fixtures/release-empty.json +2 -2
- package/fixtures/release-normal.json +10 -8
- package/fixtures/release-weekly.json +5 -4
- package/gen/ts/index.d.ts +15 -10
- package/gen/ts/index.js +219 -84
- package/package.json +1 -1
- package/schema/api.v2.yaml +1 -1
- package/schema/{digest.v2.json → digest.v3.json} +4 -4
- package/schema/{ipc.v3.json → ipc.v4.json} +17 -9
- package/schema/{model.v2.json → model.v3.json} +5 -4
- package/schema/{releases.v2.json → releases.v3.json} +15 -11
- package/schema/version-info.v2.json +3 -3
- package/version-map.json +10 -10
package/gen/ts/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Ajv from 'ajv/dist/2020.js'
|
|
3
3
|
import addFormats from 'ajv-formats'
|
|
4
4
|
|
|
5
|
-
export const contractVersion = "0.
|
|
5
|
+
export const contractVersion = "0.7.1"
|
|
6
6
|
|
|
7
7
|
export const errorCatalog = {
|
|
8
8
|
"INTERNAL": {
|
|
@@ -77,7 +77,7 @@ export const errorCatalog = {
|
|
|
77
77
|
|
|
78
78
|
export const fixtures = {
|
|
79
79
|
"normal": {
|
|
80
|
-
"schema":
|
|
80
|
+
"schema": 3,
|
|
81
81
|
"date": "2026-10-30",
|
|
82
82
|
"period": "daily",
|
|
83
83
|
"languages": [
|
|
@@ -88,7 +88,7 @@ export const fixtures = {
|
|
|
88
88
|
],
|
|
89
89
|
"count": 6,
|
|
90
90
|
"degraded": false,
|
|
91
|
-
"contentHash": "sha256:
|
|
91
|
+
"contentHash": "sha256:23a470aa53d1e26ec722d3bbef3d33e7fcd330ba71b331afd8f2d9e433cb22c2",
|
|
92
92
|
"contentHashAlgo": "jcs-sha256-v1",
|
|
93
93
|
"coreVersion": "0.1.0",
|
|
94
94
|
"generatedAt": "2026-10-30T00:05:00Z",
|
|
@@ -103,8 +103,9 @@ export const fixtures = {
|
|
|
103
103
|
"forks": 17800,
|
|
104
104
|
"rank": 1,
|
|
105
105
|
"source": "trending-html",
|
|
106
|
-
"
|
|
107
|
-
"
|
|
106
|
+
"summarySource": "model",
|
|
107
|
+
"summary": "Go 官方仓库,今日新增 star 位居榜单前列。",
|
|
108
|
+
"summaryLang": "zh"
|
|
108
109
|
},
|
|
109
110
|
{
|
|
110
111
|
"fullName": "gin-gonic/gin",
|
|
@@ -116,8 +117,9 @@ export const fixtures = {
|
|
|
116
117
|
"forks": 8100,
|
|
117
118
|
"rank": 2,
|
|
118
119
|
"source": "trending-html",
|
|
119
|
-
"
|
|
120
|
-
"
|
|
120
|
+
"summarySource": "model",
|
|
121
|
+
"summary": "流行的 Go Web 框架,热度持续。",
|
|
122
|
+
"summaryLang": "zh"
|
|
121
123
|
},
|
|
122
124
|
{
|
|
123
125
|
"fullName": "python/cpython",
|
|
@@ -129,8 +131,9 @@ export const fixtures = {
|
|
|
129
131
|
"forks": 30500,
|
|
130
132
|
"rank": 3,
|
|
131
133
|
"source": "trending-html",
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
+
"summarySource": "model",
|
|
135
|
+
"summary": "CPython 官方实现,今日关注度上升。",
|
|
136
|
+
"summaryLang": "zh"
|
|
134
137
|
},
|
|
135
138
|
{
|
|
136
139
|
"fullName": "psf/requests",
|
|
@@ -142,8 +145,9 @@ export const fixtures = {
|
|
|
142
145
|
"forks": 9400,
|
|
143
146
|
"rank": 4,
|
|
144
147
|
"source": "trending-html",
|
|
145
|
-
"
|
|
146
|
-
"
|
|
148
|
+
"summarySource": "model",
|
|
149
|
+
"summary": "经典 Python HTTP 库,稳居热榜。",
|
|
150
|
+
"summaryLang": "zh"
|
|
147
151
|
},
|
|
148
152
|
{
|
|
149
153
|
"fullName": "rust-lang/rust",
|
|
@@ -155,8 +159,9 @@ export const fixtures = {
|
|
|
155
159
|
"forks": 13200,
|
|
156
160
|
"rank": 5,
|
|
157
161
|
"source": "trending-html",
|
|
158
|
-
"
|
|
159
|
-
"
|
|
162
|
+
"summarySource": "model",
|
|
163
|
+
"summary": "Rust 语言主仓库,社区活跃。",
|
|
164
|
+
"summaryLang": "zh"
|
|
160
165
|
},
|
|
161
166
|
{
|
|
162
167
|
"fullName": "tokio-rs/tokio",
|
|
@@ -168,13 +173,14 @@ export const fixtures = {
|
|
|
168
173
|
"forks": 2650,
|
|
169
174
|
"rank": 6,
|
|
170
175
|
"source": "trending-html",
|
|
171
|
-
"
|
|
172
|
-
"
|
|
176
|
+
"summarySource": "model",
|
|
177
|
+
"summary": "Rust 异步运行时,性能方向关注度高。",
|
|
178
|
+
"summaryLang": "zh"
|
|
173
179
|
}
|
|
174
180
|
]
|
|
175
181
|
},
|
|
176
182
|
"degraded": {
|
|
177
|
-
"schema":
|
|
183
|
+
"schema": 3,
|
|
178
184
|
"date": "2026-10-30",
|
|
179
185
|
"period": "daily",
|
|
180
186
|
"languages": [
|
|
@@ -183,7 +189,7 @@ export const fixtures = {
|
|
|
183
189
|
],
|
|
184
190
|
"count": 2,
|
|
185
191
|
"degraded": true,
|
|
186
|
-
"contentHash": "sha256:
|
|
192
|
+
"contentHash": "sha256:67501a6f9b03d663dfa379c005d146d912ba2aa32a40f5ba0800b2cf62588701",
|
|
187
193
|
"contentHashAlgo": "jcs-sha256-v1",
|
|
188
194
|
"coreVersion": "0.1.0",
|
|
189
195
|
"generatedAt": "2026-10-30T00:05:00Z",
|
|
@@ -198,8 +204,9 @@ export const fixtures = {
|
|
|
198
204
|
"forks": 17800,
|
|
199
205
|
"rank": 1,
|
|
200
206
|
"source": "search-api",
|
|
201
|
-
"
|
|
202
|
-
"
|
|
207
|
+
"summarySource": "original",
|
|
208
|
+
"summary": "[原文] The Go programming language",
|
|
209
|
+
"summaryLang": "zh"
|
|
203
210
|
},
|
|
204
211
|
{
|
|
205
212
|
"fullName": "gin-gonic/gin",
|
|
@@ -211,13 +218,14 @@ export const fixtures = {
|
|
|
211
218
|
"forks": 8100,
|
|
212
219
|
"rank": 2,
|
|
213
220
|
"source": "search-api",
|
|
214
|
-
"
|
|
215
|
-
"
|
|
221
|
+
"summarySource": "original",
|
|
222
|
+
"summary": "[原文] HTTP web framework written in Go",
|
|
223
|
+
"summaryLang": "zh"
|
|
216
224
|
}
|
|
217
225
|
]
|
|
218
226
|
},
|
|
219
227
|
"emptyLang": {
|
|
220
|
-
"schema":
|
|
228
|
+
"schema": 3,
|
|
221
229
|
"date": "2026-10-30",
|
|
222
230
|
"period": "daily",
|
|
223
231
|
"languages": [
|
|
@@ -226,7 +234,7 @@ export const fixtures = {
|
|
|
226
234
|
],
|
|
227
235
|
"count": 2,
|
|
228
236
|
"degraded": false,
|
|
229
|
-
"contentHash": "sha256:
|
|
237
|
+
"contentHash": "sha256:202e26aa26c1b1463e1d24274880a22a4d7c0531793cc4f6644e8e9d18a2383e",
|
|
230
238
|
"contentHashAlgo": "jcs-sha256-v1",
|
|
231
239
|
"coreVersion": "0.1.0",
|
|
232
240
|
"generatedAt": "2026-10-30T00:05:00Z",
|
|
@@ -241,8 +249,9 @@ export const fixtures = {
|
|
|
241
249
|
"forks": 30,
|
|
242
250
|
"rank": 1,
|
|
243
251
|
"source": "trending-html",
|
|
244
|
-
"
|
|
245
|
-
"
|
|
252
|
+
"summarySource": "model",
|
|
253
|
+
"summary": "语言未知的仓库,热度进入榜单。",
|
|
254
|
+
"summaryLang": "zh"
|
|
246
255
|
},
|
|
247
256
|
{
|
|
248
257
|
"fullName": "someorg/aggregate-only",
|
|
@@ -254,13 +263,14 @@ export const fixtures = {
|
|
|
254
263
|
"forks": 12,
|
|
255
264
|
"rank": 2,
|
|
256
265
|
"source": "trending-html",
|
|
257
|
-
"
|
|
258
|
-
"
|
|
266
|
+
"summarySource": "model",
|
|
267
|
+
"summary": "仅在全局榜单出现的仓库。",
|
|
268
|
+
"summaryLang": "zh"
|
|
259
269
|
}
|
|
260
270
|
]
|
|
261
271
|
},
|
|
262
272
|
"missingOptional": {
|
|
263
|
-
"schema":
|
|
273
|
+
"schema": 3,
|
|
264
274
|
"date": "2026-10-30",
|
|
265
275
|
"period": "daily",
|
|
266
276
|
"languages": [
|
|
@@ -271,7 +281,7 @@ export const fixtures = {
|
|
|
271
281
|
],
|
|
272
282
|
"count": 2,
|
|
273
283
|
"degraded": false,
|
|
274
|
-
"contentHash": "sha256:
|
|
284
|
+
"contentHash": "sha256:e4fd1d2d84cfaf9e6d97e4fe68297a7eac6f5e749fae50583050d1949b4bd80b",
|
|
275
285
|
"contentHashAlgo": "jcs-sha256-v1",
|
|
276
286
|
"coreVersion": "0.1.0",
|
|
277
287
|
"generatedAt": "2026-10-30T00:05:00Z",
|
|
@@ -284,8 +294,9 @@ export const fixtures = {
|
|
|
284
294
|
"starsInPeriod": 320,
|
|
285
295
|
"rank": 1,
|
|
286
296
|
"source": "trending-html",
|
|
287
|
-
"
|
|
288
|
-
"
|
|
297
|
+
"summarySource": "model",
|
|
298
|
+
"summary": "Go 官方仓库,今日新增 star 位居榜单前列。",
|
|
299
|
+
"summaryLang": "zh"
|
|
289
300
|
},
|
|
290
301
|
{
|
|
291
302
|
"fullName": "gin-gonic/gin",
|
|
@@ -295,16 +306,120 @@ export const fixtures = {
|
|
|
295
306
|
"starsInPeriod": 210,
|
|
296
307
|
"rank": 2,
|
|
297
308
|
"source": "trending-html",
|
|
298
|
-
"
|
|
299
|
-
"
|
|
309
|
+
"summarySource": "model",
|
|
310
|
+
"summary": "流行的 Go Web 框架,热度持续。",
|
|
311
|
+
"summaryLang": "zh"
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
},
|
|
315
|
+
"en": {
|
|
316
|
+
"schema": 3,
|
|
317
|
+
"date": "2026-10-30",
|
|
318
|
+
"period": "daily",
|
|
319
|
+
"languages": [
|
|
320
|
+
"all",
|
|
321
|
+
"go",
|
|
322
|
+
"python",
|
|
323
|
+
"rust"
|
|
324
|
+
],
|
|
325
|
+
"count": 6,
|
|
326
|
+
"degraded": false,
|
|
327
|
+
"contentHash": "sha256:6ac1eb001cba7559551d5884e4164ad6eeb52a7865fd96048dcc1153e17d3bc3",
|
|
328
|
+
"contentHashAlgo": "jcs-sha256-v1",
|
|
329
|
+
"coreVersion": "0.1.0",
|
|
330
|
+
"generatedAt": "2026-10-30T00:05:00Z",
|
|
331
|
+
"repos": [
|
|
332
|
+
{
|
|
333
|
+
"fullName": "golang/go",
|
|
334
|
+
"url": "https://github.com/golang/go",
|
|
335
|
+
"description": "The Go programming language",
|
|
336
|
+
"language": "go",
|
|
337
|
+
"stars": 126000,
|
|
338
|
+
"starsInPeriod": 320,
|
|
339
|
+
"forks": 17800,
|
|
340
|
+
"rank": 1,
|
|
341
|
+
"source": "trending-html",
|
|
342
|
+
"summarySource": "model",
|
|
343
|
+
"summary": "The official Go repository, among the top gainers today.",
|
|
344
|
+
"summaryLang": "en"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"fullName": "gin-gonic/gin",
|
|
348
|
+
"url": "https://github.com/gin-gonic/gin",
|
|
349
|
+
"description": "HTTP web framework written in Go",
|
|
350
|
+
"language": "go",
|
|
351
|
+
"stars": 80200,
|
|
352
|
+
"starsInPeriod": 210,
|
|
353
|
+
"forks": 8100,
|
|
354
|
+
"rank": 2,
|
|
355
|
+
"source": "trending-html",
|
|
356
|
+
"summarySource": "model",
|
|
357
|
+
"summary": "A popular Go web framework that keeps trending.",
|
|
358
|
+
"summaryLang": "en"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"fullName": "python/cpython",
|
|
362
|
+
"url": "https://github.com/python/cpython",
|
|
363
|
+
"description": "The Python programming language",
|
|
364
|
+
"language": "python",
|
|
365
|
+
"stars": 64500,
|
|
366
|
+
"starsInPeriod": 180,
|
|
367
|
+
"forks": 30500,
|
|
368
|
+
"rank": 3,
|
|
369
|
+
"source": "trending-html",
|
|
370
|
+
"summarySource": "model",
|
|
371
|
+
"summary": "The official CPython implementation, drawing more attention today.",
|
|
372
|
+
"summaryLang": "en"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"fullName": "psf/requests",
|
|
376
|
+
"url": "https://github.com/psf/requests",
|
|
377
|
+
"description": "A simple, yet elegant HTTP library",
|
|
378
|
+
"language": "python",
|
|
379
|
+
"stars": 52500,
|
|
380
|
+
"starsInPeriod": 95,
|
|
381
|
+
"forks": 9400,
|
|
382
|
+
"rank": 4,
|
|
383
|
+
"source": "trending-html",
|
|
384
|
+
"summarySource": "model",
|
|
385
|
+
"summary": "The classic Python HTTP library, a steady fixture on the charts.",
|
|
386
|
+
"summaryLang": "en"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"fullName": "rust-lang/rust",
|
|
390
|
+
"url": "https://github.com/rust-lang/rust",
|
|
391
|
+
"description": "Empowering everyone to build reliable and efficient software",
|
|
392
|
+
"language": "rust",
|
|
393
|
+
"stars": 102000,
|
|
394
|
+
"starsInPeriod": 260,
|
|
395
|
+
"forks": 13200,
|
|
396
|
+
"rank": 5,
|
|
397
|
+
"source": "trending-html",
|
|
398
|
+
"summarySource": "model",
|
|
399
|
+
"summary": "The main Rust repository, with an active community.",
|
|
400
|
+
"summaryLang": "en"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"fullName": "tokio-rs/tokio",
|
|
404
|
+
"url": "https://github.com/tokio-rs/tokio",
|
|
405
|
+
"description": "A runtime for writing reliable asynchronous applications with Rust",
|
|
406
|
+
"language": "rust",
|
|
407
|
+
"stars": 28600,
|
|
408
|
+
"starsInPeriod": 120,
|
|
409
|
+
"forks": 2650,
|
|
410
|
+
"rank": 6,
|
|
411
|
+
"source": "trending-html",
|
|
412
|
+
"summarySource": "model",
|
|
413
|
+
"summary": "The Rust async runtime, drawing strong interest for performance.",
|
|
414
|
+
"summaryLang": "en"
|
|
300
415
|
}
|
|
301
416
|
]
|
|
302
417
|
},
|
|
303
418
|
"releaseNormal": {
|
|
304
|
-
"schema":
|
|
419
|
+
"schema": 3,
|
|
305
420
|
"date": "2026-10-31",
|
|
306
421
|
"period": "weekly",
|
|
307
|
-
"contentHash": "sha256:
|
|
422
|
+
"contentHash": "sha256:bfbcf9cb9ff94b3452f79b2950ff6b84ae05b054247eeb4d116f6d0dbc8e5c7f",
|
|
308
423
|
"contentHashAlgo": "jcs-sha256-v1",
|
|
309
424
|
"coreVersion": "0.5.0",
|
|
310
425
|
"generatedAt": "2026-10-31T13:04:00Z",
|
|
@@ -327,13 +442,14 @@ export const fixtures = {
|
|
|
327
442
|
"prerelease": false,
|
|
328
443
|
"draft": false,
|
|
329
444
|
"bodyExcerpt": "1.0.0-rc3 fixes several issues found in rc2.",
|
|
330
|
-
"
|
|
331
|
-
"
|
|
445
|
+
"summarySource": "model",
|
|
446
|
+
"summary": "新增证据充分性决策模型与 Categorize 组件,兼容 rc2 schema,可直接升级。"
|
|
332
447
|
}
|
|
333
448
|
],
|
|
334
449
|
"periodStart": "2026-10-26",
|
|
335
450
|
"periodEnd": "2026-11-01",
|
|
336
|
-
"
|
|
451
|
+
"summary": "本周 1 个版本:v1.0.0-rc3。",
|
|
452
|
+
"summaryLang": "zh"
|
|
337
453
|
},
|
|
338
454
|
{
|
|
339
455
|
"fullName": "deepseek-ai/deepseek-harness",
|
|
@@ -349,21 +465,22 @@ export const fixtures = {
|
|
|
349
465
|
"url": "https://github.com/deepseek-ai/deepseek-harness/tree/dsh-v0.2.2-alpha.2",
|
|
350
466
|
"prerelease": false,
|
|
351
467
|
"draft": false,
|
|
352
|
-
"
|
|
353
|
-
"
|
|
468
|
+
"summarySource": "model",
|
|
469
|
+
"summary": "发布说明缺失,已回退到 commit 信息。"
|
|
354
470
|
}
|
|
355
471
|
],
|
|
356
472
|
"periodStart": "2026-10-26",
|
|
357
473
|
"periodEnd": "2026-11-01",
|
|
358
|
-
"
|
|
474
|
+
"summary": "本周 1 个版本:dsh-v0.2.2-alpha.2。",
|
|
475
|
+
"summaryLang": "zh"
|
|
359
476
|
}
|
|
360
477
|
]
|
|
361
478
|
},
|
|
362
479
|
"releaseDegraded": {
|
|
363
|
-
"schema":
|
|
480
|
+
"schema": 3,
|
|
364
481
|
"date": "2026-10-31",
|
|
365
482
|
"period": "weekly",
|
|
366
|
-
"contentHash": "sha256:
|
|
483
|
+
"contentHash": "sha256:8a2789f6f865e03bf4a1423d12e88bf99e992d9672f796bcebd874282ca8740d",
|
|
367
484
|
"contentHashAlgo": "jcs-sha256-v1",
|
|
368
485
|
"count": 1,
|
|
369
486
|
"degraded": true,
|
|
@@ -382,31 +499,32 @@ export const fixtures = {
|
|
|
382
499
|
"url": "https://github.com/acme/widget/releases/tag/v2.0.0",
|
|
383
500
|
"prerelease": false,
|
|
384
501
|
"draft": false,
|
|
385
|
-
"
|
|
386
|
-
"
|
|
502
|
+
"summarySource": "original",
|
|
503
|
+
"summary": "版本 v2.0.0(未获取到变更说明)"
|
|
387
504
|
}
|
|
388
505
|
],
|
|
389
506
|
"periodStart": "2026-10-26",
|
|
390
507
|
"periodEnd": "2026-11-01",
|
|
391
|
-
"
|
|
508
|
+
"summary": "本周 1 个版本:v2.0.0。",
|
|
509
|
+
"summaryLang": "zh"
|
|
392
510
|
}
|
|
393
511
|
]
|
|
394
512
|
},
|
|
395
513
|
"releaseEmpty": {
|
|
396
|
-
"schema":
|
|
514
|
+
"schema": 3,
|
|
397
515
|
"date": "2026-10-31",
|
|
398
516
|
"period": "weekly",
|
|
399
|
-
"contentHash": "sha256:
|
|
517
|
+
"contentHash": "sha256:73ca07a4b446a21356ebcbc1cb31281494b36c4bab1f9285106e37eddb71571b",
|
|
400
518
|
"contentHashAlgo": "jcs-sha256-v1",
|
|
401
519
|
"count": 0,
|
|
402
520
|
"degraded": false,
|
|
403
521
|
"repos": []
|
|
404
522
|
},
|
|
405
523
|
"releaseWeekly": {
|
|
406
|
-
"schema":
|
|
524
|
+
"schema": 3,
|
|
407
525
|
"date": "2026-11-01",
|
|
408
526
|
"period": "weekly",
|
|
409
|
-
"contentHash": "sha256:
|
|
527
|
+
"contentHash": "sha256:f3cf704e70c6e869200778198226db50c9f7827d6f1371a3bf436b3e11ac0c2e",
|
|
410
528
|
"contentHashAlgo": "jcs-sha256-v1",
|
|
411
529
|
"coreVersion": "0.7.0",
|
|
412
530
|
"generatedAt": "2026-11-01T00:30:00Z",
|
|
@@ -420,7 +538,6 @@ export const fixtures = {
|
|
|
420
538
|
"newCount": 2,
|
|
421
539
|
"periodStart": "2026-10-26",
|
|
422
540
|
"periodEnd": "2026-11-01",
|
|
423
|
-
"summaryZh": "本周发布 v15.2.0 与 v15.1.9:构建缓存命中率提升,修复 App Router 下动态段预渲染的回归。",
|
|
424
541
|
"releases": [
|
|
425
542
|
{
|
|
426
543
|
"id": 428974490,
|
|
@@ -445,7 +562,9 @@ export const fixtures = {
|
|
|
445
562
|
"draft": false,
|
|
446
563
|
"summarySource": "model"
|
|
447
564
|
}
|
|
448
|
-
]
|
|
565
|
+
],
|
|
566
|
+
"summary": "本周发布 v15.2.0 与 v15.1.9:构建缓存命中率提升,修复 App Router 下动态段预渲染的回归。",
|
|
567
|
+
"summaryLang": "zh"
|
|
449
568
|
}
|
|
450
569
|
]
|
|
451
570
|
},
|
|
@@ -890,8 +1009,8 @@ export const fixtures = {
|
|
|
890
1009
|
|
|
891
1010
|
const model = {
|
|
892
1011
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
893
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/model.
|
|
894
|
-
"title": "trendradar model
|
|
1012
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/model.v3.json",
|
|
1013
|
+
"title": "trendradar model v3",
|
|
895
1014
|
"description": "Domain model: a scraped repository snapshot (RepoSnapshot) and its digested form (RepoDigest). RepoDigest composes RepoSnapshot via allOf instead of flattening.",
|
|
896
1015
|
"$ref": "#/$defs/RepoDigest",
|
|
897
1016
|
"$defs": {
|
|
@@ -957,11 +1076,15 @@ const model = {
|
|
|
957
1076
|
"type": "object",
|
|
958
1077
|
"additionalProperties": true,
|
|
959
1078
|
"required": [
|
|
960
|
-
"
|
|
1079
|
+
"summary",
|
|
1080
|
+
"summaryLang",
|
|
961
1081
|
"summarySource"
|
|
962
1082
|
],
|
|
963
1083
|
"properties": {
|
|
964
|
-
"
|
|
1084
|
+
"summary": {
|
|
1085
|
+
"type": "string"
|
|
1086
|
+
},
|
|
1087
|
+
"summaryLang": {
|
|
965
1088
|
"type": "string"
|
|
966
1089
|
},
|
|
967
1090
|
"summarySource": {
|
|
@@ -979,9 +1102,9 @@ const model = {
|
|
|
979
1102
|
}
|
|
980
1103
|
const ipc = {
|
|
981
1104
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
982
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/ipc.
|
|
983
|
-
"title": "trendradar ipc
|
|
984
|
-
"description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields. ipcSchema is const
|
|
1105
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/ipc.v4.json",
|
|
1106
|
+
"title": "trendradar ipc v4",
|
|
1107
|
+
"description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields. ipcSchema is const 4.",
|
|
985
1108
|
"oneOf": [
|
|
986
1109
|
{
|
|
987
1110
|
"$ref": "#/$defs/RunRequest"
|
|
@@ -1096,7 +1219,7 @@ const ipc = {
|
|
|
1096
1219
|
],
|
|
1097
1220
|
"properties": {
|
|
1098
1221
|
"ipcSchema": {
|
|
1099
|
-
"const":
|
|
1222
|
+
"const": 4
|
|
1100
1223
|
},
|
|
1101
1224
|
"command": {
|
|
1102
1225
|
"type": "string",
|
|
@@ -1382,7 +1505,7 @@ const ipc = {
|
|
|
1382
1505
|
],
|
|
1383
1506
|
"properties": {
|
|
1384
1507
|
"ipcSchema": {
|
|
1385
|
-
"const":
|
|
1508
|
+
"const": 4
|
|
1386
1509
|
},
|
|
1387
1510
|
"ok": {
|
|
1388
1511
|
"type": "boolean"
|
|
@@ -1444,13 +1567,13 @@ const ipc = {
|
|
|
1444
1567
|
"$ref": "#/$defs/Usage"
|
|
1445
1568
|
},
|
|
1446
1569
|
"releases": {
|
|
1447
|
-
"$ref": "releases.
|
|
1570
|
+
"$ref": "releases.v3.json#/$defs/ReleasesReport"
|
|
1448
1571
|
},
|
|
1449
1572
|
"subscriptions": {
|
|
1450
|
-
"$ref": "releases.
|
|
1573
|
+
"$ref": "releases.v3.json#/$defs/SubscriptionList"
|
|
1451
1574
|
},
|
|
1452
1575
|
"subscriptionDoc": {
|
|
1453
|
-
"$ref": "releases.
|
|
1576
|
+
"$ref": "releases.v3.json#/$defs/SubscriptionDoc"
|
|
1454
1577
|
}
|
|
1455
1578
|
}
|
|
1456
1579
|
},
|
|
@@ -1503,6 +1626,14 @@ const ipc = {
|
|
|
1503
1626
|
"cacheHits": {
|
|
1504
1627
|
"type": "integer",
|
|
1505
1628
|
"minimum": 0
|
|
1629
|
+
},
|
|
1630
|
+
"usedModel": {
|
|
1631
|
+
"type": "string",
|
|
1632
|
+
"description": "The model that actually served this run. For a model.fallbacks chain this is the name of the member that produced the most recent successful completion (the primary when it worked, otherwise the first backup that did); empty when nothing is known (e.g. strict single-model runs that do not report it, or a run where no completion succeeded). Optional and additive: older consumers ignore it."
|
|
1633
|
+
},
|
|
1634
|
+
"usedProvider": {
|
|
1635
|
+
"type": "string",
|
|
1636
|
+
"description": "The provider (vendor) backing usedModel, when known. Optional and additive: older consumers ignore it."
|
|
1506
1637
|
}
|
|
1507
1638
|
}
|
|
1508
1639
|
},
|
|
@@ -1540,7 +1671,7 @@ const ipc = {
|
|
|
1540
1671
|
],
|
|
1541
1672
|
"properties": {
|
|
1542
1673
|
"ipcSchema": {
|
|
1543
|
-
"const":
|
|
1674
|
+
"const": 4
|
|
1544
1675
|
},
|
|
1545
1676
|
"stateSchema": {
|
|
1546
1677
|
"const": 3
|
|
@@ -1554,8 +1685,8 @@ const ipc = {
|
|
|
1554
1685
|
}
|
|
1555
1686
|
const digest = {
|
|
1556
1687
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1557
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/digest.
|
|
1558
|
-
"title": "trendradar digest
|
|
1688
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/digest.v3.json",
|
|
1689
|
+
"title": "trendradar digest v3",
|
|
1559
1690
|
"description": "One day's rendered digest document. contentHash is stable across runs (generatedAt/coreVersion excluded); contentHashAlgo records which algorithm produced it.",
|
|
1560
1691
|
"type": "object",
|
|
1561
1692
|
"additionalProperties": true,
|
|
@@ -1572,7 +1703,7 @@ const digest = {
|
|
|
1572
1703
|
],
|
|
1573
1704
|
"properties": {
|
|
1574
1705
|
"schema": {
|
|
1575
|
-
"const":
|
|
1706
|
+
"const": 3
|
|
1576
1707
|
},
|
|
1577
1708
|
"date": {
|
|
1578
1709
|
"type": "string",
|
|
@@ -1621,16 +1752,16 @@ const digest = {
|
|
|
1621
1752
|
"repos": {
|
|
1622
1753
|
"type": "array",
|
|
1623
1754
|
"items": {
|
|
1624
|
-
"$ref": "https://github.com/morehao/trendradar/contract/schema/model.
|
|
1755
|
+
"$ref": "https://github.com/morehao/trendradar/contract/schema/model.v3.json#/$defs/RepoDigest"
|
|
1625
1756
|
}
|
|
1626
1757
|
}
|
|
1627
1758
|
}
|
|
1628
1759
|
}
|
|
1629
1760
|
const releases = {
|
|
1630
1761
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1631
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/releases.
|
|
1632
|
-
"title": "trendradar releases
|
|
1633
|
-
"description": "Repo release subscription documents. ReleaseDigest is the rendered on-disk document; ReleasesReport is the per-run diagnostic carried in RunResult.releases. Token cost lives in ReleasesReport.usage (always present), never in ReleaseDigest, because cost is a property of one run and cannot be reproduced from a stored document. schema
|
|
1762
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/releases.v3.json",
|
|
1763
|
+
"title": "trendradar releases v3",
|
|
1764
|
+
"description": "Repo release subscription documents. ReleaseDigest is the rendered on-disk document; ReleasesReport is the per-run diagnostic carried in RunResult.releases. Token cost lives in ReleasesReport.usage (always present), never in ReleaseDigest, because cost is a property of one run and cannot be reproduced from a stored document. Older documents put one weekly summary per repo (repos[].summary); schema 3 cores write a per-version summary on each repos[].releases[].summary instead, and leave repos[].summary empty on new data (carrying summaryLang when non-empty). Both fields stay optional (readable old + new documents): consumers should prefer the per-item summary and fall back to the repo-level one for older documents.",
|
|
1634
1765
|
"type": "object",
|
|
1635
1766
|
"additionalProperties": true,
|
|
1636
1767
|
"required": [
|
|
@@ -1645,7 +1776,7 @@ const releases = {
|
|
|
1645
1776
|
],
|
|
1646
1777
|
"properties": {
|
|
1647
1778
|
"schema": {
|
|
1648
|
-
"const":
|
|
1779
|
+
"const": 3
|
|
1649
1780
|
},
|
|
1650
1781
|
"date": {
|
|
1651
1782
|
"type": "string",
|
|
@@ -1694,7 +1825,7 @@ const releases = {
|
|
|
1694
1825
|
"ReleaseItem": {
|
|
1695
1826
|
"type": "object",
|
|
1696
1827
|
"additionalProperties": true,
|
|
1697
|
-
"description": "One release or tag. kind distinguishes a GitHub release (has notes) from a tag fallback (commit message used as the summary basis).
|
|
1828
|
+
"description": "One release or tag. kind distinguishes a GitHub release (has notes) from a tag fallback (commit message used as the summary basis). summary is this version's own summary in the configured output language, written per version by current cores (incremental). It stays optional so old documents (which only carry the repo-level RepoReleases.summary) remain valid; consumers should prefer this field and fall back to RepoReleases.summary.",
|
|
1698
1829
|
"required": [
|
|
1699
1830
|
"id",
|
|
1700
1831
|
"tag",
|
|
@@ -1742,9 +1873,9 @@ const releases = {
|
|
|
1742
1873
|
"type": "string",
|
|
1743
1874
|
"description": "Truncated raw release notes. Untrusted text: display only, never execute."
|
|
1744
1875
|
},
|
|
1745
|
-
"
|
|
1876
|
+
"summary": {
|
|
1746
1877
|
"type": "string",
|
|
1747
|
-
"description": "
|
|
1878
|
+
"description": "This version's own summary in the configured output language (model or original text). Optional: older documents only carry the repo-level summary, and consumers should prefer this field and fall back to RepoReleases.summary."
|
|
1748
1879
|
},
|
|
1749
1880
|
"summarySource": {
|
|
1750
1881
|
"type": "string",
|
|
@@ -1758,7 +1889,7 @@ const releases = {
|
|
|
1758
1889
|
"RepoReleases": {
|
|
1759
1890
|
"type": "object",
|
|
1760
1891
|
"additionalProperties": true,
|
|
1761
|
-
"description": "One repo's release batch for one summary period.
|
|
1892
|
+
"description": "One repo's release batch for one summary period. periodStart/periodEnd bound the period (attributed to the versions' publish dates) so a consumer can label it without parsing dates. summary (repo-level, whole-week) plus optional summaryLang is kept for backward compatibility: current cores summarize per version (releases[].summary) and usually leave this empty on new data.",
|
|
1762
1893
|
"required": [
|
|
1763
1894
|
"fullName",
|
|
1764
1895
|
"url",
|
|
@@ -1790,9 +1921,13 @@ const releases = {
|
|
|
1790
1921
|
"type": "string",
|
|
1791
1922
|
"format": "date"
|
|
1792
1923
|
},
|
|
1793
|
-
"
|
|
1924
|
+
"summary": {
|
|
1925
|
+
"type": "string",
|
|
1926
|
+
"description": "Optional repo-level summary for the whole period. Current cores summarize per version (releases[].summary) and usually leave this empty. Kept optional for older documents; consumers should prefer releases[].summary and fall back to this."
|
|
1927
|
+
},
|
|
1928
|
+
"summaryLang": {
|
|
1794
1929
|
"type": "string",
|
|
1795
|
-
"description": "
|
|
1930
|
+
"description": "BCP47 language of the repo-level summary above; present only when summary is. Item-level summaries inherit this / the configured output language."
|
|
1796
1931
|
},
|
|
1797
1932
|
"releases": {
|
|
1798
1933
|
"type": "array",
|
|
@@ -1868,7 +2003,7 @@ const releases = {
|
|
|
1868
2003
|
"minimum": 0
|
|
1869
2004
|
},
|
|
1870
2005
|
"usage": {
|
|
1871
|
-
"$ref": "https://github.com/morehao/trendradar/contract/schema/ipc.
|
|
2006
|
+
"$ref": "https://github.com/morehao/trendradar/contract/schema/ipc.v4.json#/$defs/Usage"
|
|
1872
2007
|
}
|
|
1873
2008
|
}
|
|
1874
2009
|
},
|
|
@@ -2046,7 +2181,7 @@ const versionInfo = {
|
|
|
2046
2181
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2047
2182
|
"$id": "https://github.com/morehao/trendradar/contract/schema/version-info.v2.json",
|
|
2048
2183
|
"title": "trendradar version info v2",
|
|
2049
|
-
"description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===
|
|
2184
|
+
"description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===4 && digestSchema===3 && contractVersion major===0.",
|
|
2050
2185
|
"type": "object",
|
|
2051
2186
|
"additionalProperties": true,
|
|
2052
2187
|
"required": [
|
|
@@ -2065,10 +2200,10 @@ const versionInfo = {
|
|
|
2065
2200
|
"type": "string"
|
|
2066
2201
|
},
|
|
2067
2202
|
"ipcSchema": {
|
|
2068
|
-
"const":
|
|
2203
|
+
"const": 4
|
|
2069
2204
|
},
|
|
2070
2205
|
"digestSchema": {
|
|
2071
|
-
"const":
|
|
2206
|
+
"const": 3
|
|
2072
2207
|
},
|
|
2073
2208
|
"contractVersion": {
|
|
2074
2209
|
"type": "string"
|
|
@@ -2422,7 +2557,7 @@ const errors = {
|
|
|
2422
2557
|
}
|
|
2423
2558
|
}
|
|
2424
2559
|
}
|
|
2425
|
-
const api = "openapi: 3.1.0\ninfo:\n title: trendradar serve API\n version: 0.
|
|
2560
|
+
const api = "openapi: 3.1.0\ninfo:\n title: trendradar serve API\n version: 0.7.1\n description: |\n Read-only HTTP surface exposed by `trendradar serve`. All payloads reuse the\n contract schemas, so the plugin and any web UI consume the same shapes\n whether data comes from the filesystem or over HTTP. Historical v1 digests\n read from disk are normalized to the v2 shape with\n contentHashAlgo=legacy-struct-marshal-v1.\n\n Release endpoints are read-only. Token cost for a releases run is NOT part of\n a stored document (it describes one run and cannot be reproduced); it is\n reported in `releases.usage` of `trendradar run --json` and appended to\n `<repo>/.git/trendradar-usage.jsonl` with stage=\"releases\".\nservers:\n - url: http://127.0.0.1:8787\npaths:\n /api/v2/digests/{date}:\n get:\n operationId: getDigest\n summary: Fetch one day's digest\n parameters:\n - name: date\n in: path\n required: true\n schema:\n type: string\n format: date\n responses:\n \"200\":\n description: The digest document\n content:\n application/json:\n schema:\n $ref: \"./digest.v2.json\"\n \"404\":\n description: No digest for that date\n /api/v2/manifest:\n get:\n operationId: getManifest\n summary: List available dates and their content identity\n responses:\n \"200\":\n description: Manifest of available digests\n content:\n application/json:\n schema:\n type: object\n required: [entries]\n properties:\n coreVersion:\n type: string\n entries:\n type: array\n items:\n type: object\n required: [date, contentHash, schema, contentHashAlgo]\n properties:\n date:\n type: string\n format: date\n contentHash:\n type: string\n schema:\n type: integer\n contentHashAlgo:\n type: string\n enum: [jcs-sha256-v1, legacy-struct-marshal-v1]\n degraded:\n type: boolean\n /api/v2/releases:\n get:\n operationId: listReleases\n summary: List available release digests (newest first)\n description: |\n Returns an empty array (not 404) when no release digest exists yet.\n Entries carry no token cost because stored documents do not record it.\n parameters:\n - name: period\n in: query\n required: false\n schema:\n type: string\n enum: [daily, weekly, monthly]\n responses:\n \"200\":\n description: Manifest of release digests\n content:\n application/json:\n schema:\n type: array\n items:\n $ref: \"./releases.v2.json#/$defs/ReleaseManifestEntry\"\n /api/v2/releases/{date}:\n get:\n operationId: getReleases\n summary: Fetch one period's release digest\n parameters:\n - name: date\n in: path\n required: true\n schema:\n type: string\n format: date\n - name: period\n in: query\n required: false\n schema:\n type: string\n enum: [daily, weekly, monthly]\n responses:\n \"200\":\n description: The release digest document\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json\"\n \"404\":\n description: No release digest for that date\n /api/v2/subscriptions:\n get:\n operationId: listSubscriptions\n summary: List the repo subscriptions the core will poll\n description: |\n Read-only mirror of the IPC `subscribe list` command: both return the\n same SubscriptionList. `repos` is the legacy field; `items` adds the\n per-repo row detail (latest tag, last summary date, check status) and is\n optional, so an older core still satisfies this schema. Writing\n subscriptions stays on the CLI / IPC subscribe command and is never\n exposed over HTTP.\n responses:\n \"200\":\n description: Current subscription list\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json#/$defs/SubscriptionList\"\n /api/v2/repos/{owner}/{repo}/releases:\n get:\n operationId: getSubscriptionDoc\n summary: Read one repo's release document\n description: |\n Read-only mirror of the IPC `subscribe releases` command. Returns the\n exact markdown file content (plus the volume index) so a client renders\n what the data repo stores instead of re-summarizing it. `volume`\n defaults to the newest volume. Only repos matching\n ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ are served: the path is resolved\n inside the releases document root and never escapes it.\n parameters:\n - name: owner\n in: path\n required: true\n schema:\n type: string\n pattern: \"^[A-Za-z0-9_.-]+$\"\n - name: repo\n in: path\n required: true\n schema:\n type: string\n pattern: \"^[A-Za-z0-9_.-]+$\"\n - name: volume\n in: query\n required: false\n schema:\n type: integer\n minimum: 1\n responses:\n \"200\":\n description: The repo's release document\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json#/$defs/SubscriptionDoc\"\n \"400\":\n description: Malformed owner/repo or non-positive volume\n \"404\":\n description: The repo has no release document, or that volume is absent\n /feed.xml:\n get:\n operationId: getFeed\n summary: RSS feed of the most recent digests\n responses:\n \"200\":\n description: RSS 2.0 feed\n content:\n application/rss+xml:\n schema:\n type: string\n"
|
|
2426
2561
|
|
|
2427
2562
|
export const rawSchema = { model, ipc, digest, releases, errors, versionInfo, api }
|
|
2428
2563
|
|