Skip to content

Take origin links out of the completeness score and serve a link count - #753

Merged
tombeckenham merged 3 commits into
mainfrom
fix/origin-link-score-matches-links
Nov 21, 2026
Merged

tombeckenham merged 3 commits into
mainfrom
fix/origin-link-score-matches-links

Conversation

@tombeckenham

@tombeckenham tombeckenham commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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

completeness.originLink asked a looser matcher of its own whether a row
needs a link, so regional twins, hosts with no maker row and stated
upstreams that resolve to nothing counted as gaps the service can never
close. It now reads the link reconcileSameAs wrote (served sameAs): need
and have are the same rows. originIdKeys and originIndex are gone.

A worker test runs one table of cases (regional twins, a three-hop chain,
a host-only model, a maker's own row, a stated upstream that resolves to
nothing, a variant suffix, a case-only difference) through
reconcileSameAs and the scorer and asserts they agree row by row.

The completeness cache_meta key moves to v4.
@changeset-bot

changeset-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c4f7764

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@modelschemas/client Minor
modelschemas Minor
@modelschemas/codegen Minor
@modelschemas/rate-card Minor
@modelschemas/vite Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f1f36f4c-8fdc-4b3c-b0a9-022b65707236
Commits

Reviewing files that changed from the base of the PR and between 41251c7 and c4f7764.

Files ignored due to path filters: 1

  • packages/client/src/generated/types.gen.ts is excluded by !**/generated/**
Files selected for processing: 17

  • .changeset/origin-link-score-matches-links.md
  • CLAUDE.md
  • docs/api-changes.md
  • docs/source-silent/README.md
  • openapi.json
  • scripts/gap-report.test.ts
  • scripts/gap-report.ts
  • skill/modelschemas/SKILL.md
  • src/lib/completeness.test.ts
  • src/lib/completeness.ts
  • src/routes/index.tsx
  • src/routes/models/index.tsx
  • src/server/ingest/origin-link-score.worker.test.ts
  • src/server/llms-txt.ts
  • src/server/openapi.ts
  • src/server/status.ts
  • src/server/status.worker.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

need always equalled have, so originLink only lifted the scores of
providers with links. Completeness drops the term, and /v1/status, the
gap report and the home page serve originLinks, the number of live
models with sameAs served. The stored-record validator rejects the old
originLink shape, and the ledger refuses an originLink entry.
@tombeckenham tombeckenham changed the title Score an origin link only where the link rules write one Take origin links out of the completeness score and serve a link count Nov 21, 2026
@tombeckenham
tombeckenham merged commit d92f37c into main Nov 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant