Skip to content
Source
Sign inSign up
TanStack/schemas

Take origin links out of the completeness score and serve a link count #754 (GitHub #753)

Mergedtombeckenhammerged 3 commits intomain fromfix/origin-link-score-matches-linksmerged by tombeckenham View on GitHub

tombeckenhamcommented

This takes origin links out of the completeness score. GET /v1/status, the gap report and the home page now show a single count, originLinks: the number of live models whose sameAs is served.

Why

The old originLink fact used its own name matcher to decide which rows needed a link. It counted rows that no link rule can ever link: regional twins, hosts with no maker row, and stated upstreams that resolve to nothing. Those rows lowered a provider's score for a link that cannot exist.

The rules themselves (reconcileSameAs: the stated tiers, then the name tier inferLinks over originNameKey and isOwnRow) cannot be re-run from served rows. Three of their inputs are not served:

  • stated evidence that resolves to nothing (stored in upstream_*, never served);
  • the namespace table (provider_model_namespaces);
  • the maker declaration (providers.makes_own_models).

So the only exact answer to "does this row need a link" is whether the service wrote one. That is always have = need, which gave providers with links an unearned lift. On the snapshot below: lovable +3.8 points, azure +3.2, replicate +1.9.

Origin links are therefore information, not a scored fact. Scoring stated upstreams that fail to resolve, which would be the actionable version, is a separate follow-up issue.

Changes

  • src/lib/completeness.ts:
    • originLink is out of FACT_KEYS, FACTS, scoreRow and scoredFacts, and scoredRows starts at 0;
    • ProviderReport.originLinks counts rows with a served sameAs;
    • originIdKeys, originIndex and the aliases field on ModelRow are deleted;
    • the ledger parser refuses an originLink entry.
  • GET /v1/status and GET /v1/providers: completeness.originLink ({ have, need }) becomes completeness.originLinks (integer). The stored-record validator rejects the old shape, and the cache_meta key is status:completeness:v4.
  • Gap report: the table column is originLinks and shows the count, not a ratio.
  • Home page: the per-provider line reads "N origin links", with a tooltip saying it is a count, not part of the score. /models no longer filters originLink out of row scores, because no row carries it.
  • openapi.ts is updated; openapi.json, the generated client and SKILL.md are regenerated; llms.txt, CLAUDE.md, docs/source-silent/README.md and docs/api-changes.md (Breaking) are updated.
  • Changeset: @modelschemas/client minor.

Pinning test

src/server/ingest/origin-link-score.worker.test.ts runs one table of cases through reconcileSameAs and serves the rows via listModelsCatalog. For each row it asserts that the stored link and the served sameAs match the expected answer. For each provider it asserts that originLinks equals the stored link count, and that removing every sameAs leaves the score unchanged.

The cases:

  • regional twins with no maker
  • regional twins with two roots
  • a three-hop chain
  • a host-only model
  • a maker's own row
  • stated evidence that resolves to nothing
  • a variant suffix
  • a case-only difference

Before / after

Both runs score the same snapshot: one request to https://modelschemas.openstory.workers.dev/v1/models?pricing=1&limit=20000, 7,892 rows, fed to gap-report --base from a local copy. "Before" is main's scorer and "after" is this branch.

providerbefore originLinkbefore scoreafter originLinksafter score
dashscope0/1210.74000.819
dashscope-cn1/1830.09210.102
opencode44/880.914440.960
together15/550.458150.463
huggingface14/750.887140.942
anthropic0/01.00001.000
openai0/260.85300.882
lovable43/460.766430.728
azure66/670.721660.689
replicate47/900.268470.249
cloudflare-ai-gateway72/1570.534720.543
    1. tombeckenham pushedc4f7764

    2. tombeckenham changed the title

    3. tombeckenham merged thisd92f37c

    4. tombeckenham closed this

Sign in to join this conversation.