Files
ai-kit/scripts/check-catalog.mjs
79165471db chore: pnpm — the fleet has one package manager (#26)
* chore: pnpm — the fleet has one package manager

Convert from npm to pnpm (fleet standard, STACK.md):
- packageManager pin pnpm@11.25.0 (corepack SSOT)
- pnpm-lock.yaml via `pnpm import` from package-lock.json (resolutions
  preserved), then package-lock.json deleted
- CI + publish workflows: pnpm/action-setup@v6, cache: pnpm,
  `pnpm install --frozen-lockfile`, `pnpm run verify`
- package.json scripts and contributor docs use pnpm; consumer install
  lines stay npm — consumers choose their own package manager
- npm publish invocation unchanged (works from a pnpm-managed tree)

Clean-room proven: rm -rf node_modules && pnpm install --frozen-lockfile
&& tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

* fix(ci): node 22 — pnpm 11 requires >= 22.13

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-03 08:01:26 -07:00

43 lines
1.6 KiB
JavaScript

/**
* Are this package's DEFAULT pins still real?
*
* `freeChain()` ships a list of model ids, and vendors retire ids without
* notice. On 2026-08-25 four of the nine defaults were already gone — both Groq
* models, so the chain led with a vendor that could never answer, plus the
* preferred OpenRouter fallback. Every consumer inherited that.
*
* Zero tokens: one GET /models per provider. Cheap enough to run on a schedule,
* which is the only kind of check that catches rot without someone remembering.
*
* Run: node scripts/check-catalog.mjs (pnpm run check:catalog)
* Needs GROQ_API_KEY / OPENROUTER_API_KEY for the providers you want checked;
* a provider with no key is reported UNCHECKED, which is not a pass.
*
* Exit 1 only on CONFIRMED rot, so a keyless or offline run does not fail a
* pipeline for something it could not see.
*/
import { freeChain, checkCatalog, catalogReport, hasRot, deadProviders } from "../dist/index.js";
const verdicts = await checkCatalog(freeChain());
console.log(catalogReport(verdicts));
console.log("");
const dead = deadProviders(verdicts);
if (dead.length) {
console.error(
`A whole vendor is gone (${dead.join(", ")}) — the chain is back to a single point of failure.`,
);
}
if (hasRot(verdicts)) {
console.error(
"Retired model ids are still pinned. Re-probe replacements and update freeChain().",
);
process.exit(1);
}
const unchecked = verdicts.reduce((n, v) => n + v.unchecked.length, 0);
if (unchecked) {
console.log(`No rot found among the ids that could be checked; ${unchecked} were not checkable.`);
} else {
console.log("Every default pin still exists at its vendor.");
}