Take origin links out of the completeness score and serve a link count #754 (GitHub #753)
main fromfix/origin-link-score-matches-links·merged by tombeckenham View on GitHubThis 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:originLinkis out ofFACT_KEYS,FACTS,scoreRowandscoredFacts, andscoredRowsstarts at 0;ProviderReport.originLinkscounts rows with a servedsameAs;originIdKeys,originIndexand thealiasesfield onModelRoware deleted;- the ledger parser refuses an
originLinkentry.
GET /v1/statusandGET /v1/providers:completeness.originLink({ have, need }) becomescompleteness.originLinks(integer). The stored-record validator rejects the old shape, and thecache_metakey isstatus:completeness:v4.- Gap report: the table column is
originLinksand 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.
/modelsno longer filtersoriginLinkout of row scores, because no row carries it. openapi.tsis updated;openapi.json, the generated client andSKILL.mdare regenerated;llms.txt, CLAUDE.md,docs/source-silent/README.mdanddocs/api-changes.md(Breaking) are updated.- Changeset:
@modelschemas/clientminor.
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.
| provider | before originLink | before score | after originLinks | after score |
|---|---|---|---|---|
| dashscope | 0/121 | 0.740 | 0 | 0.819 |
| dashscope-cn | 1/183 | 0.092 | 1 | 0.102 |
| opencode | 44/88 | 0.914 | 44 | 0.960 |
| together | 15/55 | 0.458 | 15 | 0.463 |
| huggingface | 14/75 | 0.887 | 14 | 0.942 |
| anthropic | 0/0 | 1.000 | 0 | 1.000 |
| openai | 0/26 | 0.853 | 0 | 0.882 |
| lovable | 43/46 | 0.766 | 43 | 0.728 |
| azure | 66/67 | 0.721 | 66 | 0.689 |
| replicate | 47/90 | 0.268 | 47 | 0.249 |
| cloudflare-ai-gateway | 72/157 | 0.534 | 72 | 0.543 |