Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/probes-in-d1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelschemas/client': patch
---

Adds `listProbeObservations` (`GET /v1/admin/probes/{provider}`, admin only, read-only): the Worker's live probe observations with their evidence and whether each is served. The `staleProbes` and schema `probe-verified` descriptions now say probed facts are re-verified by the Worker, not by a committed record.
89 changes: 0 additions & 89 deletions .source/workflows/probe.ts

This file was deleted.

42 changes: 29 additions & 13 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,23 +243,39 @@ ones).
entry. A stored row's first `releasedAt`, `providerMetadata` or `maker`
is written with no `model.updated`. Migration `0014` is a drizzle custom
migration that converted the stored lists. A fact the provider's docs do not state can
still come from a live API check: one file per provider under
`src/server/providers/probes/`, derivation `probe-verified`, dated
`verifiedAt`. The adapter binds that fact only for the exact model and
route the record names. A record older than 90 days stays served;
`GET /v1/status` counts it on `staleProbes`. Re-run with
`pnpm run probe -- <provider> [--write]` (not the 15-minute
poll). The script reads the provider key from the environment or Doppler
and never prints it. The generic `chat/completions` probe
(`probes/chat-completions.ts`, #717) states `maxOutput`,
still come from a live API check, derivation `probe-verified`, dated
`verifiedAt`, bound only to the exact model and route observed. Probed
facts live in D1, never in source (#717): the Worker's own probe cron
(`PROBE_CRON`, hourly at :07, `src/server/ingest/probe-facts.ts`)
appends one `probe_observations` row per request it sent (value null
when the response stated nothing). Per invocation, under
`PROBE_REQUEST_BUDGET` (12) and `PROBE_PROVIDER_BUDGET` (4), it first
confirms a decided but unserved value, then probes a chat row of an
enabled provider (`chatProbes` in `probes/index.ts`) whose probeable
fact is empty and unobserved, then re-verifies anything
`REVERIFY_AFTER_DAYS` (7) old. A value is served only when the two
newest decided observations, at least `PROBE_RUN_GAP_SECONDS` (one cron
interval) apart, agree; the poll fills only empty facts from them
(`loadServedProbeFacts` → `withProbedFacts`). A failed run is reported
as `ingest_failed` (job `probe`). A missing key is a logged skip; a
`gateway` entry is never probed. Each provider lists its `checks`: only
checks a rule reads in its own wording (openai `limits`+`off`, groq
`limits`+`replay`+`off`, mistral `replay`), so every request is an
expected 400, never a billed completion. "Probe everything new" means
every new model of a listed provider. Add a provider in its own PR:
capture its responses with the dry run below, add a rule and the
fixture, then list only the checks that decide. Audit with
`GET /v1/admin/probes/{provider}[?model=]`. A served fact older than 90
days stays served; `GET /v1/status` counts it on `staleProbes`.
`pnpm run probe -- <provider> <rawId…>` is a read-only local dry run.
The classifier (`probes/chat-completions.ts`) states `maxOutput`,
`replayReasoningContent` and `reasoning.mandatory` only from a 400/422
whose message a rule reads (fixtures of real bodies); a 2xx, auth, 429,
5xx or unread message records nothing. `reasoning.mandatory` needs the
provider's `mandatoryRule` opt-in (per-model level list, no other
reasoning control). No rule writes `contextWindow` yet. `--write` writes
`probes/records/<provider>.ts` (never by hand); the poller fills only
empty facts from it (`withProbedFacts`). `.source/workflows/probe.ts`
runs it weekly and opens a PR on `probe/weekly` when a record changed.
reasoning control). No rule writes `contextWindow` yet. LEGACY: the
hand-written OpenCode Go route records (`probes/opencode-go.ts`) still
bind two routes; nothing re-dates them.
- **sameAs links** (issues #199, #719, `src/server/ingest/model-identity.ts`):
a row links to the row at another provider it is the same model as;
never a copied fact. A stated link wins: adapters state the upstream
Expand Down
15 changes: 15 additions & 0 deletions drizzle/0022_probe_observations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE `probe_observations` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`run_id` text NOT NULL,
`provider_id` text NOT NULL,
`raw_id` text NOT NULL,
`route` text NOT NULL,
`fact` text NOT NULL,
`value` text,
`status` integer NOT NULL,
`message` text NOT NULL,
`observed_at` integer NOT NULL,
FOREIGN KEY (`provider_id`) REFERENCES `providers`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `probe_observations_provider_model_idx` ON `probe_observations` (`provider_id`,`raw_id`,`fact`);
Loading
Loading