@grove-dev/core 0.12.0 → 0.14.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/dist/build-data.d.ts.map +1 -1
- package/dist/build-data.js +14 -7
- package/dist/build-data.js.map +1 -1
- package/dist/decisions.d.ts.map +1 -1
- package/dist/decisions.js +7 -1
- package/dist/decisions.js.map +1 -1
- package/dist/github-cache.d.ts +226 -0
- package/dist/github-cache.d.ts.map +1 -0
- package/dist/github-cache.js +460 -0
- package/dist/github-cache.js.map +1 -0
- package/dist/health-thresholds.d.ts +39 -0
- package/dist/health-thresholds.d.ts.map +1 -0
- package/dist/health-thresholds.js +68 -0
- package/dist/health-thresholds.js.map +1 -0
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +18 -34
- package/dist/health.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/repository-health.d.ts.map +1 -1
- package/dist/repository-health.js +9 -18
- package/dist/repository-health.js.map +1 -1
- package/dist/schema.d.ts +6 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +25 -0
- package/dist/schema.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +69 -19
- package/dist/validate.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { basename, join, resolve } from 'node:path';
|
|
3
|
+
import { parseDocument, parse as parseYaml } from 'yaml';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { DAY_MS } from './health-thresholds.js';
|
|
6
|
+
/**
|
|
7
|
+
* The GitHub sync cache: one JSON file per record, owned by
|
|
8
|
+
* `grove sync github`.
|
|
9
|
+
*
|
|
10
|
+
* Records (`paths.recordsDir`) belong to curators and
|
|
11
|
+
* `paths.decisions` to reviewers. What the sync bot observes on GitHub
|
|
12
|
+
* — repository metadata, the derived health block, when it last
|
|
13
|
+
* succeeded and what went wrong since — lives here instead, so the
|
|
14
|
+
* three layers never write into each other and a sync PR only ever
|
|
15
|
+
* touches this directory.
|
|
16
|
+
*
|
|
17
|
+
* Every reader (build, validate, cleanup, README) resolves a record's
|
|
18
|
+
* `github` / `health` through {@link resolveRecordGithub}, with
|
|
19
|
+
* precedence cache > inline (legacy) > `paths.health`.
|
|
20
|
+
*/
|
|
21
|
+
export const GITHUB_CACHE_SCHEMA_VERSION = 1;
|
|
22
|
+
/** How many failed or partial fetches a cache entry remembers. */
|
|
23
|
+
export const GITHUB_CACHE_MAX_FAILURES = 5;
|
|
24
|
+
/** Default for `sync.github.maxAgeDays`: older successful syncs are stale. */
|
|
25
|
+
export const GITHUB_SYNC_MAX_AGE_DAYS = 14;
|
|
26
|
+
/** `staleReason` of a health block resolved from a stale cache entry. */
|
|
27
|
+
export const SYNC_STALE_REASON = 'sync_stale';
|
|
28
|
+
const cacheSourceSchema = z.enum(['api', 'html']);
|
|
29
|
+
const githubCacheFailureSchema = z.object({
|
|
30
|
+
at: z.string(),
|
|
31
|
+
source: cacheSourceSchema,
|
|
32
|
+
reason: z.string(),
|
|
33
|
+
});
|
|
34
|
+
export const githubCacheEntrySchema = z.object({
|
|
35
|
+
schemaVersion: z.literal(GITHUB_CACHE_SCHEMA_VERSION),
|
|
36
|
+
slug: z.string().min(1),
|
|
37
|
+
repoUrl: z.string().optional(),
|
|
38
|
+
/** Which fetch path delivered the data currently in `github`. */
|
|
39
|
+
source: cacheSourceSchema.optional(),
|
|
40
|
+
/** When the GitHub API last delivered a full refresh. Never moved by a failure or HTML fallback. */
|
|
41
|
+
lastSuccessAt: z.string().nullable().default(null),
|
|
42
|
+
/** Most recent failed fetches, oldest first, capped at {@link GITHUB_CACHE_MAX_FAILURES}. */
|
|
43
|
+
partialFailures: z.array(githubCacheFailureSchema).default([]),
|
|
44
|
+
/** Repository description as GitHub reports it. Not merged into the record. */
|
|
45
|
+
sourceDescription: z.string().optional(),
|
|
46
|
+
github: z.record(z.string(), z.unknown()).optional(),
|
|
47
|
+
health: z.record(z.string(), z.unknown()).optional(),
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Absolute directory of the GitHub sync cache for a project. Falls
|
|
51
|
+
* back to the schema default for configs built by hand rather than
|
|
52
|
+
* through `defineConfig` / `loadConfig`.
|
|
53
|
+
*/
|
|
54
|
+
export function githubCacheDir(config, cwd = process.cwd()) {
|
|
55
|
+
return resolve(cwd, config.paths.githubCache ?? 'data/cache/github');
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Read every `<slug>.json` under `paths.githubCache`. A missing
|
|
59
|
+
* directory is an empty cache; an unreadable file is reported in
|
|
60
|
+
* `errors` and left out of `entries`, so readers fall back to inline
|
|
61
|
+
* data for that record instead of failing the build.
|
|
62
|
+
*/
|
|
63
|
+
export async function loadGithubCache(config, cwd = process.cwd()) {
|
|
64
|
+
const dir = githubCacheDir(config, cwd);
|
|
65
|
+
const entries = new Map();
|
|
66
|
+
const errors = [];
|
|
67
|
+
const files = (await readdir(dir).catch(() => []))
|
|
68
|
+
.filter((file) => file.endsWith('.json'))
|
|
69
|
+
.sort();
|
|
70
|
+
for (const file of files) {
|
|
71
|
+
const slug = basename(file, '.json');
|
|
72
|
+
try {
|
|
73
|
+
const entry = githubCacheEntrySchema.parse(JSON.parse(await readFile(join(dir, file), 'utf8')));
|
|
74
|
+
if (entry.slug !== slug) {
|
|
75
|
+
errors.push({ file, message: `slug "${entry.slug}" does not match the file name` });
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
entries.set(slug, entry);
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
const message = err instanceof z.ZodError
|
|
82
|
+
? err.issues
|
|
83
|
+
.map((issue) => `${issue.path.join('.') || '(root)'} ${issue.message}`)
|
|
84
|
+
.join('; ')
|
|
85
|
+
: err.message;
|
|
86
|
+
errors.push({ file, message });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return { dir, entries, errors };
|
|
90
|
+
}
|
|
91
|
+
/** Freshness options from a project config, for {@link resolveRecordGithub}. */
|
|
92
|
+
export function githubSyncFreshnessOptions(config) {
|
|
93
|
+
return { maxAgeDays: config.sync?.github?.maxAgeDays ?? GITHUB_SYNC_MAX_AGE_DAYS };
|
|
94
|
+
}
|
|
95
|
+
function day(iso) {
|
|
96
|
+
return iso.slice(0, 10);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Whether a cache entry's data can still be presented as current.
|
|
100
|
+
*
|
|
101
|
+
* A failed or partial sync keeps the previous values rather than
|
|
102
|
+
* blanking them, so the entry alone does not say whether they are
|
|
103
|
+
* fresh. It is stale when the newest `partialFailures[].at` is later
|
|
104
|
+
* than `lastSuccessAt`, when there is no `lastSuccessAt`, or when
|
|
105
|
+
* `lastSuccessAt` is older than `maxAgeDays`.
|
|
106
|
+
*/
|
|
107
|
+
export function githubSyncFreshness(entry, options = {}) {
|
|
108
|
+
const now = options.now ?? Date.now();
|
|
109
|
+
const maxAgeDays = options.maxAgeDays ?? GITHUB_SYNC_MAX_AGE_DAYS;
|
|
110
|
+
const success = entry.lastSuccessAt ? Date.parse(entry.lastSuccessAt) : Number.NaN;
|
|
111
|
+
const newestFailure = entry.partialFailures.reduce((newest, failure) => {
|
|
112
|
+
const at = Date.parse(failure.at);
|
|
113
|
+
if (Number.isNaN(at) || (newest && newest.at >= at))
|
|
114
|
+
return newest;
|
|
115
|
+
return { at, reason: failure.reason };
|
|
116
|
+
}, undefined);
|
|
117
|
+
if (newestFailure && (Number.isNaN(success) || newestFailure.at > success)) {
|
|
118
|
+
const since = Number.isNaN(success)
|
|
119
|
+
? 'no successful sync on record'
|
|
120
|
+
: `last success ${day(entry.lastSuccessAt)}`;
|
|
121
|
+
return {
|
|
122
|
+
stale: true,
|
|
123
|
+
cause: 'failed_since_success',
|
|
124
|
+
detail: `GitHub sync failed on ${day(new Date(newestFailure.at).toISOString())} (${newestFailure.reason}); ${since}`,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
if (Number.isNaN(success)) {
|
|
128
|
+
return {
|
|
129
|
+
stale: true,
|
|
130
|
+
cause: 'never_succeeded',
|
|
131
|
+
detail: 'GitHub sync has never completed a full API refresh for this record',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const ageDays = (now - success) / DAY_MS;
|
|
135
|
+
if (ageDays > maxAgeDays) {
|
|
136
|
+
return {
|
|
137
|
+
stale: true,
|
|
138
|
+
cause: 'too_old',
|
|
139
|
+
detail: `GitHub sync last succeeded ${Math.floor(ageDays)} days ago (${day(entry.lastSuccessAt)}), older than ${maxAgeDays} days`,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return { stale: false };
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The health block to present for a stale cache entry: `status:
|
|
146
|
+
* unknown`, `staleReason: sync_stale`, low confidence, with the stale
|
|
147
|
+
* detail and the last synced status in `reasons`. Visibility and tier
|
|
148
|
+
* are kept — a sync outage must not hide or promote records.
|
|
149
|
+
*/
|
|
150
|
+
function staleSyncHealth(health, detail) {
|
|
151
|
+
const previous = typeof health.status === 'string' ? health.status : 'unknown';
|
|
152
|
+
return {
|
|
153
|
+
...health,
|
|
154
|
+
status: 'unknown',
|
|
155
|
+
staleReason: SYNC_STALE_REASON,
|
|
156
|
+
confidence: 'low',
|
|
157
|
+
cleanupCandidate: false,
|
|
158
|
+
reasons: [detail, `Last synced status: ${previous}`],
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function asObject(value) {
|
|
162
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
163
|
+
? value
|
|
164
|
+
: undefined;
|
|
165
|
+
}
|
|
166
|
+
function sameInstant(a, b) {
|
|
167
|
+
if (typeof a === 'string' && typeof b === 'string') {
|
|
168
|
+
const ta = Date.parse(a);
|
|
169
|
+
const tb = Date.parse(b);
|
|
170
|
+
if (!Number.isNaN(ta) && !Number.isNaN(tb))
|
|
171
|
+
return ta === tb;
|
|
172
|
+
}
|
|
173
|
+
return a === b;
|
|
174
|
+
}
|
|
175
|
+
/** The observable GitHub signals a reader would show; sync bookkeeping is ignored. */
|
|
176
|
+
function githubSignals(github) {
|
|
177
|
+
const repository = asObject(github.repository) ?? {};
|
|
178
|
+
return {
|
|
179
|
+
stars: repository.stargazers_count ?? github.stars,
|
|
180
|
+
forks: repository.forks_count ?? github.forks,
|
|
181
|
+
pushed_at: repository.pushed_at ?? github.pushedAt,
|
|
182
|
+
archived: repository.archived ?? github.archived,
|
|
183
|
+
license: asObject(repository.license)?.spdx_id ?? github.license,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
const HEALTH_SIGNALS = ['status', 'tier', 'visibility'];
|
|
187
|
+
function describe(value) {
|
|
188
|
+
return value === undefined ? 'unset' : String(value);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Field-level differences between a record's inline `github` /
|
|
192
|
+
* `health` and its cache entry. Only fields both sides know are
|
|
193
|
+
* compared — a value missing on one side is not a disagreement.
|
|
194
|
+
*/
|
|
195
|
+
export function githubCacheConflicts(record, entry) {
|
|
196
|
+
const conflicts = [];
|
|
197
|
+
if (!entry)
|
|
198
|
+
return conflicts;
|
|
199
|
+
const inlineGithub = asObject(record.github);
|
|
200
|
+
if (inlineGithub && entry.github) {
|
|
201
|
+
const inline = githubSignals(inlineGithub);
|
|
202
|
+
const cached = githubSignals(entry.github);
|
|
203
|
+
for (const field of Object.keys(inline)) {
|
|
204
|
+
const a = inline[field];
|
|
205
|
+
const b = cached[field];
|
|
206
|
+
if (a === undefined || a === null || b === undefined || b === null)
|
|
207
|
+
continue;
|
|
208
|
+
const equal = field === 'pushed_at' ? sameInstant(a, b) : a === b;
|
|
209
|
+
if (!equal)
|
|
210
|
+
conflicts.push(`github ${field} ${describe(a)} (inline) vs ${describe(b)} (cache)`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
const inlineHealth = asObject(record.health);
|
|
214
|
+
if (inlineHealth && entry.health) {
|
|
215
|
+
for (const field of HEALTH_SIGNALS) {
|
|
216
|
+
const a = inlineHealth[field];
|
|
217
|
+
const b = entry.health[field];
|
|
218
|
+
if (a === undefined || b === undefined || a === b)
|
|
219
|
+
continue;
|
|
220
|
+
conflicts.push(`health ${field} ${describe(a)} (inline) vs ${describe(b)} (cache)`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return conflicts;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Resolve a raw record's `github` and `health` blocks: the cache entry
|
|
227
|
+
* wins for each block it carries, the record's own inline block is the
|
|
228
|
+
* legacy fallback. The input is not mutated.
|
|
229
|
+
*
|
|
230
|
+
* With `freshness`, a cached health block from a stale entry (see
|
|
231
|
+
* {@link githubSyncFreshness}) resolves as `status: unknown` with
|
|
232
|
+
* `staleReason: sync_stale`; the cache file itself keeps the old
|
|
233
|
+
* values as evidence. Every Grove reader passes it.
|
|
234
|
+
*/
|
|
235
|
+
export function resolveRecordGithub(record, entry, freshness) {
|
|
236
|
+
const out = { ...record };
|
|
237
|
+
let github = record.github === undefined ? 'none' : 'inline';
|
|
238
|
+
let health = record.health === undefined ? 'none' : 'inline';
|
|
239
|
+
let syncStale;
|
|
240
|
+
if (entry?.github) {
|
|
241
|
+
out.github = entry.github;
|
|
242
|
+
github = 'cache';
|
|
243
|
+
}
|
|
244
|
+
if (entry?.health) {
|
|
245
|
+
out.health = entry.health;
|
|
246
|
+
health = 'cache';
|
|
247
|
+
const fresh = freshness ? githubSyncFreshness(entry, freshness) : undefined;
|
|
248
|
+
if (fresh?.stale) {
|
|
249
|
+
syncStale = fresh;
|
|
250
|
+
out.health = staleSyncHealth(entry.health, fresh.detail);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
record: out,
|
|
255
|
+
github,
|
|
256
|
+
health,
|
|
257
|
+
conflicts: githubCacheConflicts(record, entry),
|
|
258
|
+
...(syncStale ? { syncStale } : {}),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
// ── Writing ────────────────────────────────────────────────────────
|
|
262
|
+
const ENTRY_KEY_ORDER = [
|
|
263
|
+
'schemaVersion',
|
|
264
|
+
'slug',
|
|
265
|
+
'repoUrl',
|
|
266
|
+
'source',
|
|
267
|
+
'lastSuccessAt',
|
|
268
|
+
'partialFailures',
|
|
269
|
+
'sourceDescription',
|
|
270
|
+
'github',
|
|
271
|
+
'health',
|
|
272
|
+
];
|
|
273
|
+
/**
|
|
274
|
+
* Serialize a cache entry: fixed top-level key order, two-space
|
|
275
|
+
* indent, trailing newline. Nested blocks keep the order sync builds
|
|
276
|
+
* them in, so re-running sync on unchanged data rewrites the same bytes
|
|
277
|
+
* apart from its timestamps.
|
|
278
|
+
*/
|
|
279
|
+
export function serializeGithubCacheEntry(entry) {
|
|
280
|
+
const ordered = {};
|
|
281
|
+
for (const key of ENTRY_KEY_ORDER) {
|
|
282
|
+
if (entry[key] !== undefined)
|
|
283
|
+
ordered[key] = entry[key];
|
|
284
|
+
}
|
|
285
|
+
return `${JSON.stringify(ordered, null, 2)}\n`;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Write one cache entry to `<dir>/<slug>.json`. Returns false when the
|
|
289
|
+
* file already held exactly these bytes and was left alone.
|
|
290
|
+
*/
|
|
291
|
+
export async function writeGithubCacheEntry(dir, entry) {
|
|
292
|
+
const path = join(dir, `${entry.slug}.json`);
|
|
293
|
+
const text = serializeGithubCacheEntry(entry);
|
|
294
|
+
const existing = await readFile(path, 'utf8').catch(() => undefined);
|
|
295
|
+
if (existing === text)
|
|
296
|
+
return false;
|
|
297
|
+
await mkdir(dir, { recursive: true });
|
|
298
|
+
await writeFile(path, text, 'utf8');
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Fold one sync attempt into the previous cache entry.
|
|
303
|
+
*
|
|
304
|
+
* - An API refresh replaces `github` (and `health` when given) and
|
|
305
|
+
* moves `lastSuccessAt`.
|
|
306
|
+
* - An HTML fallback replaces `github` but not `lastSuccessAt`: it is a
|
|
307
|
+
* partial refresh, and the API failure is recorded.
|
|
308
|
+
* - A failure keeps every previous value and only appends to
|
|
309
|
+
* `partialFailures`, so stale data is never presented as fresh —
|
|
310
|
+
* `lastSuccessAt` older than the newest failure says so.
|
|
311
|
+
*/
|
|
312
|
+
export function nextGithubCacheEntry(previous, attempt) {
|
|
313
|
+
const base = previous ?? {
|
|
314
|
+
schemaVersion: GITHUB_CACHE_SCHEMA_VERSION,
|
|
315
|
+
slug: attempt.slug,
|
|
316
|
+
lastSuccessAt: null,
|
|
317
|
+
partialFailures: [],
|
|
318
|
+
};
|
|
319
|
+
const partialFailures = [
|
|
320
|
+
...base.partialFailures,
|
|
321
|
+
...attempt.failures.map((failure) => ({ at: attempt.at, ...failure })),
|
|
322
|
+
].slice(-GITHUB_CACHE_MAX_FAILURES);
|
|
323
|
+
const next = {
|
|
324
|
+
...base,
|
|
325
|
+
schemaVersion: GITHUB_CACHE_SCHEMA_VERSION,
|
|
326
|
+
slug: attempt.slug,
|
|
327
|
+
...(attempt.repoUrl ? { repoUrl: attempt.repoUrl } : {}),
|
|
328
|
+
partialFailures,
|
|
329
|
+
};
|
|
330
|
+
if (!attempt.source)
|
|
331
|
+
return next;
|
|
332
|
+
next.source = attempt.source;
|
|
333
|
+
if (attempt.github)
|
|
334
|
+
next.github = attempt.github;
|
|
335
|
+
if (attempt.health)
|
|
336
|
+
next.health = attempt.health;
|
|
337
|
+
if (attempt.sourceDescription)
|
|
338
|
+
next.sourceDescription = attempt.sourceDescription;
|
|
339
|
+
if (attempt.source === 'api')
|
|
340
|
+
next.lastSuccessAt = attempt.at;
|
|
341
|
+
return next;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Build a cache entry from the `github` / `health` blocks a record
|
|
345
|
+
* still carries inline (written by Grove ≤ 0.12). `lastSuccessAt` is
|
|
346
|
+
* only set when the inline block records an API sync — an HTML-only
|
|
347
|
+
* sync was never a full refresh.
|
|
348
|
+
*/
|
|
349
|
+
export function seedGithubCacheEntry(slug, record) {
|
|
350
|
+
const github = asObject(record.github);
|
|
351
|
+
const health = asObject(record.health);
|
|
352
|
+
const sync = asObject(github?.sync);
|
|
353
|
+
const source = cacheSourceSchema.safeParse(sync?.source);
|
|
354
|
+
const links = asObject(record.links);
|
|
355
|
+
const repoUrl = typeof record.repoUrl === 'string'
|
|
356
|
+
? record.repoUrl
|
|
357
|
+
: typeof links?.github === 'string'
|
|
358
|
+
? links.github
|
|
359
|
+
: undefined;
|
|
360
|
+
return {
|
|
361
|
+
schemaVersion: GITHUB_CACHE_SCHEMA_VERSION,
|
|
362
|
+
slug,
|
|
363
|
+
...(repoUrl ? { repoUrl } : {}),
|
|
364
|
+
...(source.success ? { source: source.data } : {}),
|
|
365
|
+
lastSuccessAt: source.success && source.data === 'api' && typeof sync?.syncedAt === 'string'
|
|
366
|
+
? sync.syncedAt
|
|
367
|
+
: null,
|
|
368
|
+
partialFailures: [],
|
|
369
|
+
...(github ? { github } : {}),
|
|
370
|
+
...(health ? { health } : {}),
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
// ── Migration ──────────────────────────────────────────────────────
|
|
374
|
+
const MIGRATED_KEYS = ['github', 'health'];
|
|
375
|
+
const TOP_LEVEL_KEY = /^(?:"([^"]+)"|'([^']+)'|([^\s#:][^:]*?))\s*:(?:\s|$)/;
|
|
376
|
+
function withoutKeys(value, keys) {
|
|
377
|
+
const obj = asObject(value);
|
|
378
|
+
if (!obj)
|
|
379
|
+
return value;
|
|
380
|
+
const out = { ...obj };
|
|
381
|
+
for (const key of keys)
|
|
382
|
+
delete out[key];
|
|
383
|
+
return out;
|
|
384
|
+
}
|
|
385
|
+
function sameData(a, b) {
|
|
386
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Remove top-level mapping keys from a YAML document's text, leaving
|
|
390
|
+
* every other byte alone: a block runs from its key line through the
|
|
391
|
+
* indented (or blank) lines that follow it. Comments at column 0 belong
|
|
392
|
+
* to whatever comes next and are kept. Falls back to a comment-
|
|
393
|
+
* preserving document edit if the line cut would change any other
|
|
394
|
+
* value.
|
|
395
|
+
*/
|
|
396
|
+
export function removeTopLevelYamlKeys(text, keys) {
|
|
397
|
+
const lines = text.split('\n');
|
|
398
|
+
const kept = [];
|
|
399
|
+
let dropping = false;
|
|
400
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
401
|
+
const line = lines[i] ?? '';
|
|
402
|
+
const atColumnZero = line.length > 0 && !/^\s/.test(line);
|
|
403
|
+
if (atColumnZero) {
|
|
404
|
+
const match = TOP_LEVEL_KEY.exec(line);
|
|
405
|
+
const key = match ? (match[1] ?? match[2] ?? match[3]) : undefined;
|
|
406
|
+
dropping = key !== undefined && keys.includes(key);
|
|
407
|
+
if (dropping)
|
|
408
|
+
continue;
|
|
409
|
+
kept.push(line);
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
if (dropping) {
|
|
413
|
+
if (line.trim() !== '')
|
|
414
|
+
continue;
|
|
415
|
+
// A blank line inside a dropped block goes with it only when the
|
|
416
|
+
// block continues after it.
|
|
417
|
+
const nextContent = lines.slice(i + 1).find((next) => next.trim() !== '');
|
|
418
|
+
if (nextContent !== undefined && /^\s/.test(nextContent))
|
|
419
|
+
continue;
|
|
420
|
+
dropping = false;
|
|
421
|
+
}
|
|
422
|
+
kept.push(line);
|
|
423
|
+
}
|
|
424
|
+
const cut = kept.join('\n');
|
|
425
|
+
const expected = withoutKeys(parseYaml(text, { schema: 'core' }), keys);
|
|
426
|
+
if (sameData(parseYaml(cut, { schema: 'core' }), expected))
|
|
427
|
+
return cut;
|
|
428
|
+
const doc = parseDocument(text, { schema: 'core' });
|
|
429
|
+
for (const key of keys)
|
|
430
|
+
doc.delete(key);
|
|
431
|
+
return doc.toString({ lineWidth: 100, singleQuote: false, defaultStringType: 'PLAIN' });
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Codemod one record: move its inline `github` / `health` into a cache
|
|
435
|
+
* entry and strip them from the YAML text. An existing cache entry is
|
|
436
|
+
* newer than the inline copy, so it wins; inline blocks only fill what
|
|
437
|
+
* it lacks.
|
|
438
|
+
*/
|
|
439
|
+
export function migrateRecordGithub(slug, text, existing) {
|
|
440
|
+
const raw = asObject(parseYaml(text, { schema: 'core' })) ?? {};
|
|
441
|
+
const moved = MIGRATED_KEYS.filter((key) => raw[key] !== undefined);
|
|
442
|
+
if (moved.length === 0)
|
|
443
|
+
return { text, moved, conflicts: [] };
|
|
444
|
+
const seeded = seedGithubCacheEntry(slug, raw);
|
|
445
|
+
const entry = existing
|
|
446
|
+
? {
|
|
447
|
+
...existing,
|
|
448
|
+
...(existing.repoUrl || !seeded.repoUrl ? {} : { repoUrl: seeded.repoUrl }),
|
|
449
|
+
...(existing.github || !seeded.github ? {} : { github: seeded.github }),
|
|
450
|
+
...(existing.health || !seeded.health ? {} : { health: seeded.health }),
|
|
451
|
+
}
|
|
452
|
+
: seeded;
|
|
453
|
+
return {
|
|
454
|
+
text: removeTopLevelYamlKeys(text, moved),
|
|
455
|
+
entry,
|
|
456
|
+
moved,
|
|
457
|
+
conflicts: githubCacheConflicts(raw, existing),
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
//# sourceMappingURL=github-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-cache.js","sourceRoot":"","sources":["../src/github-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,KA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,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;SACxE;QACH,CAAC,CAAC,MAAM,CAAC;IACX,OAAO;QACL,IAAI,EAAE,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC;QACzC,KAAK;QACL,KAAK;QACL,SAAS,EAAE,oBAAoB,CAAC,GAAG,EAAE,QAAQ,CAAC;KAC/C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one table of push-age cutoffs every Grove health classifier
|
|
3
|
+
* reads, so "stale" means the same thing in `classifyHealth`,
|
|
4
|
+
* `classifyRepositoryHealth` and the docs.
|
|
5
|
+
*
|
|
6
|
+
* The signal is GitHub's `pushed_at`: the last time anything was
|
|
7
|
+
* pushed to any branch. It is not commit activity, and old pushes do
|
|
8
|
+
* not make a project dead — so the reasons say "push", and every band
|
|
9
|
+
* past `active` means "a person should look", not a verdict.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DAY_MS = 86400000;
|
|
12
|
+
export type PushAgeBandId = 'active' | 'stale' | 'needs_review' | 'inactive';
|
|
13
|
+
export interface PushAgeBand {
|
|
14
|
+
id: PushAgeBandId;
|
|
15
|
+
/** Inclusive upper bound in days since the last push. */
|
|
16
|
+
maxDays: number;
|
|
17
|
+
/** Stable machine-readable reason, `null` for the active band. */
|
|
18
|
+
staleReason: string | null;
|
|
19
|
+
/** Plain-language reason matching `staleReason`. */
|
|
20
|
+
reason: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Up to 6 months → active, 6–18 months → stale, 18–24 months →
|
|
24
|
+
* needs_review, over 24 months → inactive. Month edges are in days
|
|
25
|
+
* (183 / 548 / 730) and inclusive: a repo last pushed exactly 183 days
|
|
26
|
+
* ago is still active.
|
|
27
|
+
*/
|
|
28
|
+
export declare const PUSH_AGE_BANDS: readonly PushAgeBand[];
|
|
29
|
+
/** Cutoffs by band id, for callers that compare one edge directly. */
|
|
30
|
+
export declare const PUSH_AGE_MAX_DAYS: Readonly<Record<PushAgeBandId, number>>;
|
|
31
|
+
/** A release within this many days counts as a recent release. */
|
|
32
|
+
export declare const RECENT_RELEASE_WITHIN_DAYS = 365;
|
|
33
|
+
/** Star count from which a repository counts as popular. */
|
|
34
|
+
export declare const POPULAR_STARS = 500;
|
|
35
|
+
/** Days between `value` and `now`; `Infinity` for a missing or unparseable date. */
|
|
36
|
+
export declare function daysSince(value: string | null | undefined, now?: number): number;
|
|
37
|
+
/** The band a push `days` ago falls in. A missing push date is `inactive`. */
|
|
38
|
+
export declare function pushAgeBand(days: number): PushAgeBand;
|
|
39
|
+
//# sourceMappingURL=health-thresholds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-thresholds.d.ts","sourceRoot":"","sources":["../src/health-thresholds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,eAAO,MAAM,MAAM,WAAa,CAAC;AAEjC,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC;AAE7E,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,aAAa,CAAC;IAClB,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,WAAW,EAyBhD,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAEpC,CAAC;AAEnC,kEAAkE;AAClE,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,4DAA4D;AAC5D,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM,CAK5F;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAMrD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one table of push-age cutoffs every Grove health classifier
|
|
3
|
+
* reads, so "stale" means the same thing in `classifyHealth`,
|
|
4
|
+
* `classifyRepositoryHealth` and the docs.
|
|
5
|
+
*
|
|
6
|
+
* The signal is GitHub's `pushed_at`: the last time anything was
|
|
7
|
+
* pushed to any branch. It is not commit activity, and old pushes do
|
|
8
|
+
* not make a project dead — so the reasons say "push", and every band
|
|
9
|
+
* past `active` means "a person should look", not a verdict.
|
|
10
|
+
*/
|
|
11
|
+
export const DAY_MS = 86_400_000;
|
|
12
|
+
/**
|
|
13
|
+
* Up to 6 months → active, 6–18 months → stale, 18–24 months →
|
|
14
|
+
* needs_review, over 24 months → inactive. Month edges are in days
|
|
15
|
+
* (183 / 548 / 730) and inclusive: a repo last pushed exactly 183 days
|
|
16
|
+
* ago is still active.
|
|
17
|
+
*/
|
|
18
|
+
export const PUSH_AGE_BANDS = [
|
|
19
|
+
{
|
|
20
|
+
id: 'active',
|
|
21
|
+
maxDays: 183,
|
|
22
|
+
staleReason: null,
|
|
23
|
+
reason: 'Pushed to within the last 6 months',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'stale',
|
|
27
|
+
maxDays: 548,
|
|
28
|
+
staleReason: 'no_push_6_months',
|
|
29
|
+
reason: 'No push in the last 6 months',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'needs_review',
|
|
33
|
+
maxDays: 730,
|
|
34
|
+
staleReason: 'no_push_18_months',
|
|
35
|
+
reason: 'No push in the last 18 months',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'inactive',
|
|
39
|
+
maxDays: Number.POSITIVE_INFINITY,
|
|
40
|
+
staleReason: 'no_push_24_months',
|
|
41
|
+
reason: 'No push in the last 24 months',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
/** Cutoffs by band id, for callers that compare one edge directly. */
|
|
45
|
+
export const PUSH_AGE_MAX_DAYS = Object.fromEntries(PUSH_AGE_BANDS.map((band) => [band.id, band.maxDays]));
|
|
46
|
+
/** A release within this many days counts as a recent release. */
|
|
47
|
+
export const RECENT_RELEASE_WITHIN_DAYS = 365;
|
|
48
|
+
/** Star count from which a repository counts as popular. */
|
|
49
|
+
export const POPULAR_STARS = 500;
|
|
50
|
+
/** Days between `value` and `now`; `Infinity` for a missing or unparseable date. */
|
|
51
|
+
export function daysSince(value, now = Date.now()) {
|
|
52
|
+
if (!value)
|
|
53
|
+
return Number.POSITIVE_INFINITY;
|
|
54
|
+
const time = Date.parse(value);
|
|
55
|
+
if (Number.isNaN(time))
|
|
56
|
+
return Number.POSITIVE_INFINITY;
|
|
57
|
+
return (now - time) / DAY_MS;
|
|
58
|
+
}
|
|
59
|
+
/** The band a push `days` ago falls in. A missing push date is `inactive`. */
|
|
60
|
+
export function pushAgeBand(days) {
|
|
61
|
+
for (const band of PUSH_AGE_BANDS) {
|
|
62
|
+
if (days <= band.maxDays)
|
|
63
|
+
return band;
|
|
64
|
+
}
|
|
65
|
+
// Unreachable: the last band's bound is Infinity. NaN lands here.
|
|
66
|
+
return PUSH_AGE_BANDS[PUSH_AGE_BANDS.length - 1];
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=health-thresholds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-thresholds.js","sourceRoot":"","sources":["../src/health-thresholds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;AAcjC;;;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ED,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;QAClC,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;IACxC,CAAC;IACD,kEAAkE;IAClE,OAAO,cAAc,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAgB,CAAC;AAClE,CAAC"}
|
package/dist/health.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAA4B,MAAM,aAAa,CAAC;AAEzF,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,WAAW,CAqF/E"}
|