Track week-over-week movement in the Intelligence Index
Deploy to Cloudflare Pages / deploy (push) Successful in 36s
Deploy to Cloudflare Pages / deploy (push) Successful in 36s
- sync-catalog keeps a rolling 52-week history of index scores - the matrix shows the delta since the previous refresh plus a biggest-mover card
This commit is contained in:
@@ -272,6 +272,27 @@ export const RAW = ${JSON.stringify(scores, null, 1)};
|
||||
|
||||
writeFileSync(resolve(ROOT, "site/assets/snapshot.json"), JSON.stringify(snapshot, null, 2) + "\n");
|
||||
|
||||
/* --- rolling history (one entry per refresh, last 52 weeks) ---------------- */
|
||||
let history = [];
|
||||
try {
|
||||
history = JSON.parse(await (await import("node:fs/promises")).readFile(resolve(ROOT, "site/assets/history.json"), "utf8"));
|
||||
} catch {
|
||||
/* first run */
|
||||
}
|
||||
const week = snapshot.generated.slice(0, 10);
|
||||
if (!history.length || history[0].date !== week) {
|
||||
history.unshift({
|
||||
date: week,
|
||||
scores: Object.fromEntries(scores.filter((s) => s.ii !== null).map((s) => [s.id, s.ii]))
|
||||
});
|
||||
history = history.slice(0, 52);
|
||||
}
|
||||
writeFileSync(resolve(ROOT, "site/assets/history.json"), JSON.stringify(history, null, 1) + "\n");
|
||||
writeFileSync(
|
||||
resolve(ROOT, "site/assets/history.js"),
|
||||
`// AUTO-GENERATED by scripts/sync-catalog.mjs — do not edit by hand.\n// Rolling week-over-week snapshot of the Intelligence Index.\nexport const HISTORY = ${JSON.stringify(history, null, 1)};\n`
|
||||
);
|
||||
|
||||
console.log("\nnew models:", newModels.length ? newModels.join(", ") : "none");
|
||||
console.log("removed models:", removedModels.length ? removedModels.join(", ") : "none");
|
||||
if (deltas.length) {
|
||||
@@ -280,4 +301,4 @@ if (deltas.length) {
|
||||
} else {
|
||||
console.log("score changes: none");
|
||||
}
|
||||
console.log("\nwrote site/assets/catalog.js, evals.js, snapshot.json");
|
||||
console.log("\nwrote site/assets/catalog.js, evals.js, snapshot.json, history.json");
|
||||
|
||||
Reference in New Issue
Block a user