Skip to content
Source
Sign inSign up
TanStack/schemas

Infer origin links from a similar name, resolve variants and serve the root of the chain #719

Send to my agent
Closedtombeckenham opened this issue 2 comments
tombeckenhamcommented

Problem

reconcileSameAs (src/server/ingest/model-identity.ts) links a row only when its provider states an upstream. Three gaps remain after the stated links (#718):

  1. Hosts with bare ids state nothing: neon 0/16 Claude rows, opencode 0/15.
  2. Variant ids do not resolve: anthropic/claude-fable-5.2:batch, -fast, :free.
  3. A link is one hop. llmgateway's azure-anthropic/… rows point at Azure and never reach Anthropic.

Decision (2026-11-21): a link may be inferred from a similar name. This replaces the rule "never inferred from a similar name alone".

Ask

  • Add a last tier for rows with no stated upstream. Normalise the id (lowercase, drop a maker prefix, dots as hyphens, drop Bedrock's -v1:0) and link when every match leads to one root row. When the roots differ, write no link.
  • Label an inferred link derivation: "name-inferred" in factSources.sameAs. A stated link always wins.
  • Strip stated variant suffixes before matching and record the variant in the evidence.
  • Serve the root of the chain beside the direct link. This changes the row shape: bump MODEL_ROW_SHAPE, regenerate the client, add a changeset.
  • Update the sameAs paragraph in CLAUDE.md and the README.

A link is never a copied fact. That rule does not change.

Blocked by

#709. It links alias rows inside one provider and may use sameAs. Settle there that sameAs means the original provider's row and aliases holds -latest and snapshot links.

Out of scope

A model whose maker has no API row (Llama, Qwen, gpt-oss). That is the maker fact in #710.

Acceptance

  • Neon's claude-fable-5 links to Anthropic's row with name-inferred evidence.
  • A row three hops from the maker serves the maker's row as its root.
  • Llama on Groq, Together and Fireworks stays unlinked.
  1. tombeckenhamcommented

    Added scope: mark a row whose provider is the maker of the model

    Add firstParty to the model row, beside sameAs, the chain root and maker (#710). It answers one question: is this provider the maker of this model?

    Provider declaration

    Add one flag to ProviderConfig, mirrored to the providers table like modelNamespaces: the provider makes its own models. Set it on makers (anthropic, openai, grok, gemini, mistral, byteplus, elevenlabs, deepseek, cohere, and the like). Leave it unset on pure hosts and gateways (amazon-bedrock, openrouter, vercel, groq, together, replicate, novita, huggingface, fireworks, azure). This is a fact about the provider, stated once, not per-model data.

    Value

    • false: the row has a sameAs link to another provider's row, or its maker names a company that is not this provider. Evidence always wins over the declaration.
    • true: the provider is declared a maker and nothing says otherwise. On a maker that also hosts other companies' models (mistral, byteplus), 'nothing says otherwise' needs the maker source to have been READ for that row: maker null with an unstated source. A row the maker source does not list, or whose source was unavailable, is null, not true.
    • true also when another host's link resolves to this row as the root, whatever the declaration.
    • null: an undeclared provider with no link and no stated maker, or a mixed host's row that no source covers.

    Rules

    • Derived at read time from the declaration, links, maker and the namespace table. Not stored per row.
    • factSources.firstParty names what decided it: provider-declared, linked-from with the count, or maker with its source.
    • No id-shape rule and no per-model list.
    • Row shape change: same MODEL_ROW_SHAPE bump, client regeneration and changeset as the chain root.

    Acceptance

    • Every live Anthropic row serves firstParty: true, including a model no other host lists yet. Neon's and Bedrock's Claude rows serve false.
    • gemma-4-31b-it on Gemini serves true.
    • zai-glm-5-3 on Mistral serves false (Mistral names Z.ai); mistral-large-latest serves true.
    • gpt-oss-120b-250805 on BytePlus serves null (the maker source does not list it).
    • Llama on Groq serves false where Groq names Meta, and null where it names no maker.
  2. tombeckenham assignedtombeckenham

  3. tombeckenham linked this to #734

  4. Correction to the firstParty scope above, from the review of #734.

    The rule "true also when another host's link resolves to this row as the root, whatever the declaration" is wrong. Gateways link to host rows (LLM Gateway routes end at Together, Novita, DashScope, Cerebras, Fireworks, Bedrock rows), so 161 live rows at hosts are link targets and would all serve firstParty: true.

    Corrected rule: a link ending at a row is evidence for true only when the row's provider is a declared maker. A link target at an undeclared host serves null unless its own link or maker says false.

    Same reason, for the name tier: an inferred link is written only when its root is a declared maker's row that itself states no upstream. A host's row is not an origin.

  5. tombeckenham linked this to #736

  6. tombeckenham closed this

Sign in to join this conversation.