Files
ai-kit/test
CatoandClaude Opus 5 23aaee1503 feat: complete() — the package makes the call, and a schedule watches the pins (#32)
ai-kit's modules are each correct and each written against a real outage.
Almost none of it reached the apps that were failing. Measured 2026-09-05:

  ai-kit (ships decisions)                 imported by 2 repos
  ai-forms (ships a working handler)       installed by 5 repos
  hand-rolled LLM clients still in service 8, ~1400-1700 lines each

Not a quality gap, a shape gap. The stated rule — "every app has its own
calling conventions, replacing them is a rewrite rather than an adoption" —
described the duplication accurately and then protected it. The conventions
differed because nothing offered to own them. Of those 8 clients, 2 tell the
three kinds of 429 apart; the other 6 treat a spent daily budget as a busy
minute, which limits.ts has warned against since 2026-08-14 from inside a
module they do not import.

complete() owns the fetch, and makes the three judgements every hand-rolled
client here got wrong:

  - an HTTP 200 with empty content is a FAILURE, not a success. Two models in
    the default chain do this; a res.ok check hands "" to the user, reports
    success, and keeps health green through a total outage.
  - a DAILY 429 condemns the whole vendor. The budget is org-wide, so the
    remaining links there are already dead — skip them instead of buying a
    dead round trip each.
  - a SIZE 429 ends the walk. The next model down has a smaller ceiling
    (12000 TPM vs 6000), so demoting is strictly worse.

tryChain stays for callers with an unusual request to make.

Also: scripts/check-catalog.mjs has said since it was written that it is
"cheap enough to run on a schedule, which is the only kind of check that
catches rot without someone remembering". Nothing ran it, and the rot came
anyway — 2026-08-25, four of nine pins retired, both Groq models, eight days
of silent FleetCrown downtime. It now runs daily. The script exits 0 when it
could not check (right for an offline dev run, wrong for a scheduled probe),
so the workflow fails when zero ids were verified rather than passing blind.

All three walk behaviours proven by mutation against dist/: each disabled
individually, each caught by exactly the test that names it, then restored.
verify green: format + lint + typecheck + build + 91 tests.

NOTE: bitbaum/ai-kit has no Actions secrets, so the new workflow will fail
on its first scheduled run until GROQ_API_KEY / OPENROUTER_API_KEY are set.
That failure is the intended signal, not a regression.


Claude-Session: https://claude.ai/code/session_01NHDLTKGirKU7He8q2YR2y4

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 16:38:45 +00:00
..