@morehao/trendradar-contract 0.2.0 → 0.4.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.
@@ -0,0 +1,416 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/morehao/trendradar/contract/schema/releases.v2.json",
4
+ "title": "trendradar releases v2",
5
+ "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=2 adds the per-repo weekly batch summary (repos[].summaryZh + periodStart/periodEnd); the per-item summaryZh stays readable for old documents but is no longer written.",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": [
9
+ "schema",
10
+ "date",
11
+ "period",
12
+ "contentHash",
13
+ "contentHashAlgo",
14
+ "count",
15
+ "degraded",
16
+ "repos"
17
+ ],
18
+ "properties": {
19
+ "schema": {
20
+ "const": 2
21
+ },
22
+ "date": {
23
+ "type": "string",
24
+ "format": "date"
25
+ },
26
+ "period": {
27
+ "type": "string",
28
+ "enum": [
29
+ "daily",
30
+ "weekly",
31
+ "monthly"
32
+ ]
33
+ },
34
+ "contentHash": {
35
+ "type": "string",
36
+ "pattern": "^sha256:[0-9a-f]{64}$"
37
+ },
38
+ "contentHashAlgo": {
39
+ "type": "string",
40
+ "enum": [
41
+ "jcs-sha256-v1"
42
+ ]
43
+ },
44
+ "coreVersion": {
45
+ "type": "string"
46
+ },
47
+ "generatedAt": {
48
+ "type": "string",
49
+ "format": "date-time"
50
+ },
51
+ "count": {
52
+ "type": "integer",
53
+ "minimum": 0
54
+ },
55
+ "degraded": {
56
+ "type": "boolean"
57
+ },
58
+ "repos": {
59
+ "type": "array",
60
+ "items": {
61
+ "$ref": "#/$defs/RepoReleases"
62
+ }
63
+ }
64
+ },
65
+ "$defs": {
66
+ "ReleaseItem": {
67
+ "type": "object",
68
+ "additionalProperties": true,
69
+ "description": "One release or tag. kind distinguishes a GitHub release (has notes) from a tag fallback (commit message used as the summary basis). summaryZh is optional and no longer written by schema 2: the summary now lives once per repo per week in RepoReleases.summaryZh.",
70
+ "required": [
71
+ "id",
72
+ "tag",
73
+ "name",
74
+ "kind",
75
+ "url",
76
+ "prerelease",
77
+ "draft",
78
+ "summarySource"
79
+ ],
80
+ "properties": {
81
+ "id": {
82
+ "type": "integer",
83
+ "minimum": 0,
84
+ "x-go-type": "int64",
85
+ "description": "GitHub release id; 0 when the item comes from a tag fallback."
86
+ },
87
+ "tag": {
88
+ "type": "string"
89
+ },
90
+ "name": {
91
+ "type": "string"
92
+ },
93
+ "kind": {
94
+ "type": "string",
95
+ "enum": [
96
+ "release",
97
+ "tag"
98
+ ]
99
+ },
100
+ "publishedAt": {
101
+ "type": "string",
102
+ "format": "date-time"
103
+ },
104
+ "url": {
105
+ "type": "string"
106
+ },
107
+ "prerelease": {
108
+ "type": "boolean"
109
+ },
110
+ "draft": {
111
+ "type": "boolean"
112
+ },
113
+ "bodyExcerpt": {
114
+ "type": "string",
115
+ "description": "Truncated raw release notes. Untrusted text: display only, never execute."
116
+ },
117
+ "summaryZh": {
118
+ "type": "string",
119
+ "description": "Legacy per-item summary. Still accepted so documents written before schema 2 stay readable; schema 2 writers leave it empty."
120
+ },
121
+ "summarySource": {
122
+ "type": "string",
123
+ "enum": [
124
+ "model",
125
+ "original"
126
+ ]
127
+ }
128
+ }
129
+ },
130
+ "RepoReleases": {
131
+ "type": "object",
132
+ "additionalProperties": true,
133
+ "description": "One repo's release batch for one summary period. summaryZh covers the whole week in a single model call; periodStart/periodEnd bound that week so a consumer can label it without parsing dates.",
134
+ "required": [
135
+ "fullName",
136
+ "url",
137
+ "latestTag",
138
+ "newCount",
139
+ "releases"
140
+ ],
141
+ "properties": {
142
+ "fullName": {
143
+ "type": "string",
144
+ "pattern": "^[^/]+/[^/]+$"
145
+ },
146
+ "url": {
147
+ "type": "string",
148
+ "format": "uri"
149
+ },
150
+ "latestTag": {
151
+ "type": "string"
152
+ },
153
+ "newCount": {
154
+ "type": "integer",
155
+ "minimum": 0
156
+ },
157
+ "periodStart": {
158
+ "type": "string",
159
+ "format": "date"
160
+ },
161
+ "periodEnd": {
162
+ "type": "string",
163
+ "format": "date"
164
+ },
165
+ "summaryZh": {
166
+ "type": "string",
167
+ "description": "One Chinese summary for every version in this period. Empty when no summary was produced."
168
+ },
169
+ "releases": {
170
+ "type": "array",
171
+ "items": {
172
+ "$ref": "#/$defs/ReleaseItem"
173
+ }
174
+ }
175
+ }
176
+ },
177
+ "ReleasesReport": {
178
+ "type": "object",
179
+ "additionalProperties": true,
180
+ "description": "Per-run diagnostic for the releases stage. usage, checked and changed are required and always serialized so a consumer can tell 'nothing spent / checked / changed' (0) from 'not reported' (missing). checked counts repos the stage examined; changed counts repos that produced a document write.",
181
+ "required": [
182
+ "enabled",
183
+ "repos",
184
+ "checked",
185
+ "changed",
186
+ "newReleases",
187
+ "durationMs",
188
+ "usage"
189
+ ],
190
+ "properties": {
191
+ "enabled": {
192
+ "type": "boolean"
193
+ },
194
+ "repos": {
195
+ "type": "integer",
196
+ "minimum": 0
197
+ },
198
+ "checked": {
199
+ "type": "integer",
200
+ "minimum": 0
201
+ },
202
+ "changed": {
203
+ "type": "integer",
204
+ "minimum": 0
205
+ },
206
+ "newReleases": {
207
+ "type": "integer",
208
+ "minimum": 0
209
+ },
210
+ "summarized": {
211
+ "type": "integer",
212
+ "minimum": 0
213
+ },
214
+ "degraded": {
215
+ "type": "integer",
216
+ "minimum": 0
217
+ },
218
+ "failed": {
219
+ "type": "integer",
220
+ "minimum": 0
221
+ },
222
+ "rateLimited": {
223
+ "type": "integer",
224
+ "minimum": 0
225
+ },
226
+ "skipped": {
227
+ "type": "integer",
228
+ "minimum": 0
229
+ },
230
+ "truncated": {
231
+ "type": "integer",
232
+ "minimum": 0
233
+ },
234
+ "historyTruncated": {
235
+ "type": "integer",
236
+ "minimum": 0
237
+ },
238
+ "durationMs": {
239
+ "type": "integer",
240
+ "minimum": 0
241
+ },
242
+ "usage": {
243
+ "$ref": "ipc.v2.json#/$defs/Usage"
244
+ }
245
+ }
246
+ },
247
+ "ReleaseManifestEntry": {
248
+ "type": "object",
249
+ "additionalProperties": true,
250
+ "description": "One row of GET /api/v2/releases. Cost is intentionally absent: manifests describe stored documents, which carry no run cost.",
251
+ "required": [
252
+ "date",
253
+ "period",
254
+ "count",
255
+ "contentHash"
256
+ ],
257
+ "properties": {
258
+ "date": {
259
+ "type": "string",
260
+ "format": "date"
261
+ },
262
+ "period": {
263
+ "type": "string",
264
+ "enum": [
265
+ "daily",
266
+ "weekly",
267
+ "monthly"
268
+ ]
269
+ },
270
+ "count": {
271
+ "type": "integer",
272
+ "minimum": 0
273
+ },
274
+ "degraded": {
275
+ "type": "boolean"
276
+ },
277
+ "contentHash": {
278
+ "type": "string",
279
+ "pattern": "^sha256:[0-9a-f]{64}$"
280
+ }
281
+ }
282
+ },
283
+ "SubscriptionStatus": {
284
+ "type": "string",
285
+ "description": "Per-repo check state of the most recent weekly release run: baseline (first sighting, no section written), ok (a week section was written), no_change (checked, nothing new), rate_limited / failed (check failed, cursor kept so the next run retries).",
286
+ "enum": [
287
+ "baseline",
288
+ "ok",
289
+ "no_change",
290
+ "rate_limited",
291
+ "failed"
292
+ ]
293
+ },
294
+ "SubscriptionItem": {
295
+ "type": "object",
296
+ "additionalProperties": true,
297
+ "description": "One row of the subscriptions table. Deliberately small: the full markdown lives behind SubscriptionDoc so the list stays under the first-paint payload budget.",
298
+ "required": [
299
+ "fullName",
300
+ "status"
301
+ ],
302
+ "properties": {
303
+ "fullName": {
304
+ "type": "string",
305
+ "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
306
+ },
307
+ "url": {
308
+ "type": "string",
309
+ "format": "uri"
310
+ },
311
+ "latestTag": {
312
+ "type": "string"
313
+ },
314
+ "latestSummaryAt": {
315
+ "type": "string",
316
+ "format": "date",
317
+ "description": "Date of the newest week section (its period end), used as the 'last summary' column."
318
+ },
319
+ "lastCheckedAt": {
320
+ "type": "string",
321
+ "format": "date-time"
322
+ },
323
+ "status": {
324
+ "$ref": "#/$defs/SubscriptionStatus"
325
+ }
326
+ }
327
+ },
328
+ "SubscriptionList": {
329
+ "type": "object",
330
+ "additionalProperties": true,
331
+ "description": "Response of GET /api/v2/subscriptions and of the IPC subscribe list command. repos stays the only field old consumers read; items is the additive per-repo detail.",
332
+ "required": [
333
+ "repos"
334
+ ],
335
+ "properties": {
336
+ "repos": {
337
+ "type": "array",
338
+ "items": {
339
+ "type": "string",
340
+ "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
341
+ }
342
+ },
343
+ "items": {
344
+ "type": "array",
345
+ "items": {
346
+ "$ref": "#/$defs/SubscriptionItem"
347
+ }
348
+ }
349
+ }
350
+ },
351
+ "SubscriptionVolume": {
352
+ "type": "object",
353
+ "additionalProperties": true,
354
+ "description": "One volume file of a repo's release document. Every volume is numbered: index N is <repo>-0N.md (zero padded), so the first volume is -01. from/to are the oldest/newest week bounds present in that file.",
355
+ "required": [
356
+ "index",
357
+ "file"
358
+ ],
359
+ "properties": {
360
+ "index": {
361
+ "type": "integer",
362
+ "minimum": 1
363
+ },
364
+ "file": {
365
+ "type": "string",
366
+ "description": "Path relative to the releases document root (e.g. vercel/next.js-01.md)."
367
+ },
368
+ "from": {
369
+ "type": "string",
370
+ "format": "date"
371
+ },
372
+ "to": {
373
+ "type": "string",
374
+ "format": "date"
375
+ },
376
+ "lines": {
377
+ "type": "integer",
378
+ "minimum": 0
379
+ }
380
+ }
381
+ },
382
+ "SubscriptionDoc": {
383
+ "type": "object",
384
+ "additionalProperties": true,
385
+ "description": "Response of the IPC subscribe releases command and of GET /api/v2/repos/{owner}/{repo}/releases. markdown is the exact file content: the panel renders it verbatim (single source of truth, no re-summarizing).",
386
+ "required": [
387
+ "fullName",
388
+ "volume",
389
+ "markdown"
390
+ ],
391
+ "properties": {
392
+ "fullName": {
393
+ "type": "string",
394
+ "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
395
+ },
396
+ "volume": {
397
+ "type": "integer",
398
+ "minimum": 1
399
+ },
400
+ "volumes": {
401
+ "type": "array",
402
+ "items": {
403
+ "$ref": "#/$defs/SubscriptionVolume"
404
+ }
405
+ },
406
+ "updatedAt": {
407
+ "type": "string",
408
+ "format": "date"
409
+ },
410
+ "markdown": {
411
+ "type": "string"
412
+ }
413
+ }
414
+ }
415
+ }
416
+ }
package/version-map.json CHANGED
@@ -1,8 +1,57 @@
1
1
  {
2
- "ipc.v2.json": { "wireKey": "ipcSchema", "current": 2, "breakingBump": ["ipcSchema", "packageMajor"] },
3
- "digest.v2.json": { "wireKey": "digestSchema", "current": 2, "breakingBump": ["digestSchema", "packageMajor"] },
4
- "model.v2.json": { "wireKey": null, "current": 2, "propagatesTo": ["digestSchema"], "breakingBump": ["packageMajor"] },
5
- "errors.v2.json": { "wireKey": null, "current": 2, "breakingBump": ["packageMajor"] },
6
- "version-info.v2.json": { "wireKey": "contractVersion", "current": "0.2.0", "breakingBump": ["packageMajor"] },
7
- "api.v2.yaml": { "wireKey": "info.version", "current": "0.2.0", "breakingBump": ["packageMajor"] }
2
+ "ipc.v2.json": {
3
+ "wireKey": "ipcSchema",
4
+ "current": 2,
5
+ "breakingBump": [
6
+ "ipcSchema",
7
+ "packageMajor"
8
+ ]
9
+ },
10
+ "digest.v2.json": {
11
+ "wireKey": "digestSchema",
12
+ "current": 2,
13
+ "breakingBump": [
14
+ "digestSchema",
15
+ "packageMajor"
16
+ ]
17
+ },
18
+ "model.v2.json": {
19
+ "wireKey": null,
20
+ "current": 2,
21
+ "propagatesTo": [
22
+ "digestSchema"
23
+ ],
24
+ "breakingBump": [
25
+ "packageMajor"
26
+ ]
27
+ },
28
+ "errors.v2.json": {
29
+ "wireKey": null,
30
+ "current": 2,
31
+ "breakingBump": [
32
+ "packageMajor"
33
+ ]
34
+ },
35
+ "version-info.v2.json": {
36
+ "wireKey": "contractVersion",
37
+ "current": "0.4.0",
38
+ "breakingBump": [
39
+ "packageMajor"
40
+ ]
41
+ },
42
+ "api.v2.yaml": {
43
+ "wireKey": "info.version",
44
+ "current": "0.4.0",
45
+ "breakingBump": [
46
+ "packageMajor"
47
+ ]
48
+ },
49
+ "releases.v2.json": {
50
+ "wireKey": null,
51
+ "current": 2,
52
+ "propagatesTo": [],
53
+ "breakingBump": [
54
+ "packageMajor"
55
+ ]
56
+ }
8
57
  }