@morehao/trendradar-contract 0.5.0 → 0.7.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.
- package/CHANGELOG.md +42 -2
- package/README.md +22 -18
- 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 +23 -11
- package/gen/ts/index.js +245 -86
- package/package.json +1 -1
- package/schema/api.v2.yaml +1 -1
- package/schema/{digest.v2.json → digest.v3.json} +4 -4
- package/schema/errors.v2.json +1 -1
- package/schema/{ipc.v2.json → ipc.v4.json} +42 -10
- 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 +16 -16
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.0"
|
|
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"
|
|
@@ -1058,6 +1181,35 @@ const ipc = {
|
|
|
1058
1181
|
}
|
|
1059
1182
|
}
|
|
1060
1183
|
},
|
|
1184
|
+
"DigestArtifact": {
|
|
1185
|
+
"type": "object",
|
|
1186
|
+
"additionalProperties": true,
|
|
1187
|
+
"description": "The digest document rendered by this run, inlined so the caller never reads the output repository. bytes/sha256 describe the UTF-8 bytes of text exactly as written to path.",
|
|
1188
|
+
"required": [
|
|
1189
|
+
"path",
|
|
1190
|
+
"bytes",
|
|
1191
|
+
"sha256",
|
|
1192
|
+
"text"
|
|
1193
|
+
],
|
|
1194
|
+
"properties": {
|
|
1195
|
+
"path": {
|
|
1196
|
+
"type": "string"
|
|
1197
|
+
},
|
|
1198
|
+
"bytes": {
|
|
1199
|
+
"type": "integer",
|
|
1200
|
+
"minimum": 0,
|
|
1201
|
+
"maximum": 1048576
|
|
1202
|
+
},
|
|
1203
|
+
"sha256": {
|
|
1204
|
+
"type": "string",
|
|
1205
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
1206
|
+
},
|
|
1207
|
+
"text": {
|
|
1208
|
+
"type": "string",
|
|
1209
|
+
"maxLength": 1048576
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1061
1213
|
"RunRequest": {
|
|
1062
1214
|
"type": "object",
|
|
1063
1215
|
"additionalProperties": false,
|
|
@@ -1067,7 +1219,7 @@ const ipc = {
|
|
|
1067
1219
|
],
|
|
1068
1220
|
"properties": {
|
|
1069
1221
|
"ipcSchema": {
|
|
1070
|
-
"const":
|
|
1222
|
+
"const": 4
|
|
1071
1223
|
},
|
|
1072
1224
|
"command": {
|
|
1073
1225
|
"type": "string",
|
|
@@ -1353,7 +1505,7 @@ const ipc = {
|
|
|
1353
1505
|
],
|
|
1354
1506
|
"properties": {
|
|
1355
1507
|
"ipcSchema": {
|
|
1356
|
-
"const":
|
|
1508
|
+
"const": 4
|
|
1357
1509
|
},
|
|
1358
1510
|
"ok": {
|
|
1359
1511
|
"type": "boolean"
|
|
@@ -1385,6 +1537,9 @@ const ipc = {
|
|
|
1385
1537
|
"$ref": "#/$defs/FileArtifact"
|
|
1386
1538
|
}
|
|
1387
1539
|
},
|
|
1540
|
+
"digest": {
|
|
1541
|
+
"$ref": "#/$defs/DigestArtifact"
|
|
1542
|
+
},
|
|
1388
1543
|
"branch": {
|
|
1389
1544
|
"type": "string"
|
|
1390
1545
|
},
|
|
@@ -1412,13 +1567,13 @@ const ipc = {
|
|
|
1412
1567
|
"$ref": "#/$defs/Usage"
|
|
1413
1568
|
},
|
|
1414
1569
|
"releases": {
|
|
1415
|
-
"$ref": "releases.
|
|
1570
|
+
"$ref": "releases.v3.json#/$defs/ReleasesReport"
|
|
1416
1571
|
},
|
|
1417
1572
|
"subscriptions": {
|
|
1418
|
-
"$ref": "releases.
|
|
1573
|
+
"$ref": "releases.v3.json#/$defs/SubscriptionList"
|
|
1419
1574
|
},
|
|
1420
1575
|
"subscriptionDoc": {
|
|
1421
|
-
"$ref": "releases.
|
|
1576
|
+
"$ref": "releases.v3.json#/$defs/SubscriptionDoc"
|
|
1422
1577
|
}
|
|
1423
1578
|
}
|
|
1424
1579
|
},
|
|
@@ -1508,10 +1663,10 @@ const ipc = {
|
|
|
1508
1663
|
],
|
|
1509
1664
|
"properties": {
|
|
1510
1665
|
"ipcSchema": {
|
|
1511
|
-
"const":
|
|
1666
|
+
"const": 4
|
|
1512
1667
|
},
|
|
1513
1668
|
"stateSchema": {
|
|
1514
|
-
"const":
|
|
1669
|
+
"const": 3
|
|
1515
1670
|
},
|
|
1516
1671
|
"lastRun": {
|
|
1517
1672
|
"$ref": "#/$defs/StateRun"
|
|
@@ -1522,8 +1677,8 @@ const ipc = {
|
|
|
1522
1677
|
}
|
|
1523
1678
|
const digest = {
|
|
1524
1679
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1525
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/digest.
|
|
1526
|
-
"title": "trendradar digest
|
|
1680
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/digest.v3.json",
|
|
1681
|
+
"title": "trendradar digest v3",
|
|
1527
1682
|
"description": "One day's rendered digest document. contentHash is stable across runs (generatedAt/coreVersion excluded); contentHashAlgo records which algorithm produced it.",
|
|
1528
1683
|
"type": "object",
|
|
1529
1684
|
"additionalProperties": true,
|
|
@@ -1540,7 +1695,7 @@ const digest = {
|
|
|
1540
1695
|
],
|
|
1541
1696
|
"properties": {
|
|
1542
1697
|
"schema": {
|
|
1543
|
-
"const":
|
|
1698
|
+
"const": 3
|
|
1544
1699
|
},
|
|
1545
1700
|
"date": {
|
|
1546
1701
|
"type": "string",
|
|
@@ -1589,16 +1744,16 @@ const digest = {
|
|
|
1589
1744
|
"repos": {
|
|
1590
1745
|
"type": "array",
|
|
1591
1746
|
"items": {
|
|
1592
|
-
"$ref": "https://github.com/morehao/trendradar/contract/schema/model.
|
|
1747
|
+
"$ref": "https://github.com/morehao/trendradar/contract/schema/model.v3.json#/$defs/RepoDigest"
|
|
1593
1748
|
}
|
|
1594
1749
|
}
|
|
1595
1750
|
}
|
|
1596
1751
|
}
|
|
1597
1752
|
const releases = {
|
|
1598
1753
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1599
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/releases.
|
|
1600
|
-
"title": "trendradar releases
|
|
1601
|
-
"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
|
|
1754
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/releases.v3.json",
|
|
1755
|
+
"title": "trendradar releases v3",
|
|
1756
|
+
"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.",
|
|
1602
1757
|
"type": "object",
|
|
1603
1758
|
"additionalProperties": true,
|
|
1604
1759
|
"required": [
|
|
@@ -1613,7 +1768,7 @@ const releases = {
|
|
|
1613
1768
|
],
|
|
1614
1769
|
"properties": {
|
|
1615
1770
|
"schema": {
|
|
1616
|
-
"const":
|
|
1771
|
+
"const": 3
|
|
1617
1772
|
},
|
|
1618
1773
|
"date": {
|
|
1619
1774
|
"type": "string",
|
|
@@ -1662,7 +1817,7 @@ const releases = {
|
|
|
1662
1817
|
"ReleaseItem": {
|
|
1663
1818
|
"type": "object",
|
|
1664
1819
|
"additionalProperties": true,
|
|
1665
|
-
"description": "One release or tag. kind distinguishes a GitHub release (has notes) from a tag fallback (commit message used as the summary basis).
|
|
1820
|
+
"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.",
|
|
1666
1821
|
"required": [
|
|
1667
1822
|
"id",
|
|
1668
1823
|
"tag",
|
|
@@ -1710,9 +1865,9 @@ const releases = {
|
|
|
1710
1865
|
"type": "string",
|
|
1711
1866
|
"description": "Truncated raw release notes. Untrusted text: display only, never execute."
|
|
1712
1867
|
},
|
|
1713
|
-
"
|
|
1868
|
+
"summary": {
|
|
1714
1869
|
"type": "string",
|
|
1715
|
-
"description": "
|
|
1870
|
+
"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."
|
|
1716
1871
|
},
|
|
1717
1872
|
"summarySource": {
|
|
1718
1873
|
"type": "string",
|
|
@@ -1726,7 +1881,7 @@ const releases = {
|
|
|
1726
1881
|
"RepoReleases": {
|
|
1727
1882
|
"type": "object",
|
|
1728
1883
|
"additionalProperties": true,
|
|
1729
|
-
"description": "One repo's release batch for one summary period.
|
|
1884
|
+
"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.",
|
|
1730
1885
|
"required": [
|
|
1731
1886
|
"fullName",
|
|
1732
1887
|
"url",
|
|
@@ -1758,9 +1913,13 @@ const releases = {
|
|
|
1758
1913
|
"type": "string",
|
|
1759
1914
|
"format": "date"
|
|
1760
1915
|
},
|
|
1761
|
-
"
|
|
1916
|
+
"summary": {
|
|
1917
|
+
"type": "string",
|
|
1918
|
+
"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."
|
|
1919
|
+
},
|
|
1920
|
+
"summaryLang": {
|
|
1762
1921
|
"type": "string",
|
|
1763
|
-
"description": "
|
|
1922
|
+
"description": "BCP47 language of the repo-level summary above; present only when summary is. Item-level summaries inherit this / the configured output language."
|
|
1764
1923
|
},
|
|
1765
1924
|
"releases": {
|
|
1766
1925
|
"type": "array",
|
|
@@ -1836,7 +1995,7 @@ const releases = {
|
|
|
1836
1995
|
"minimum": 0
|
|
1837
1996
|
},
|
|
1838
1997
|
"usage": {
|
|
1839
|
-
"$ref": "https://github.com/morehao/trendradar/contract/schema/ipc.
|
|
1998
|
+
"$ref": "https://github.com/morehao/trendradar/contract/schema/ipc.v4.json#/$defs/Usage"
|
|
1840
1999
|
}
|
|
1841
2000
|
}
|
|
1842
2001
|
},
|
|
@@ -2014,7 +2173,7 @@ const versionInfo = {
|
|
|
2014
2173
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2015
2174
|
"$id": "https://github.com/morehao/trendradar/contract/schema/version-info.v2.json",
|
|
2016
2175
|
"title": "trendradar version info v2",
|
|
2017
|
-
"description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===
|
|
2176
|
+
"description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===4 && digestSchema===3 && contractVersion major===0.",
|
|
2018
2177
|
"type": "object",
|
|
2019
2178
|
"additionalProperties": true,
|
|
2020
2179
|
"required": [
|
|
@@ -2033,10 +2192,10 @@ const versionInfo = {
|
|
|
2033
2192
|
"type": "string"
|
|
2034
2193
|
},
|
|
2035
2194
|
"ipcSchema": {
|
|
2036
|
-
"const":
|
|
2195
|
+
"const": 4
|
|
2037
2196
|
},
|
|
2038
2197
|
"digestSchema": {
|
|
2039
|
-
"const":
|
|
2198
|
+
"const": 3
|
|
2040
2199
|
},
|
|
2041
2200
|
"contractVersion": {
|
|
2042
2201
|
"type": "string"
|
|
@@ -2053,7 +2212,7 @@ const errors = {
|
|
|
2053
2212
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2054
2213
|
"$id": "https://github.com/morehao/trendradar/contract/schema/errors.v2.json",
|
|
2055
2214
|
"title": "trendradar errors v2",
|
|
2056
|
-
"description": "Canonical error-code catalog. Each property is one error code whose retriable/description are consts, so this file is the single source of truth for retriability. ipc.
|
|
2215
|
+
"description": "Canonical error-code catalog. Each property is one error code whose retriable/description are consts, so this file is the single source of truth for retriability. ipc.v3.json ErrorCode enum must match these keys exactly.",
|
|
2057
2216
|
"type": "object",
|
|
2058
2217
|
"additionalProperties": false,
|
|
2059
2218
|
"required": [
|
|
@@ -2390,7 +2549,7 @@ const errors = {
|
|
|
2390
2549
|
}
|
|
2391
2550
|
}
|
|
2392
2551
|
}
|
|
2393
|
-
const api = "openapi: 3.1.0\ninfo:\n title: trendradar serve API\n version: 0.
|
|
2552
|
+
const api = "openapi: 3.1.0\ninfo:\n title: trendradar serve API\n version: 0.7.0\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"
|
|
2394
2553
|
|
|
2395
2554
|
export const rawSchema = { model, ipc, digest, releases, errors, versionInfo, api }
|
|
2396
2555
|
|