Skip to content

fix(site): latest CID always comes from the indexer, never manifest.versions[last] (#30) - #31

Merged
cursor[bot] merged 1 commit into
masterfrom
cursor/site-latest-cid-from-indexer-0b31
Sep 15, 2026
Merged

cursor[bot] merged 1 commit into
masterfrom
cursor/site-latest-cid-from-indexer-0b31

Conversation

@jefflau

@jefflau jefflau commented Sep 15, 2026

Copy link
Copy Markdown
Owner

What

Follow-up to #30: manifest.versions[last].cid is self-referential and does not resolve, so the catalog must take the current version's CID from the on-chain contenthash as reported by the indexer.

Audit result: the model page already did this. NameDetail.versions[].cid and /v1/names latest.cid are both derived by the indexer from ContenthashChanged (decodeContenthashToCid), and the trust chain, lockfile entry and versions table all read from detail.versions, not from manifest.versions. The only path that touched the manifest's own list was a dead fallback for the impossible case of an indexer response with zero versions.

Changes:

  • latestVersion() no longer falls back to manifest.versions[0]; a name with no indexer versions renders an error state instead of a made-up CID.
  • Qwen fixture now models the live behaviour: manifest.versions[last].cid is a placeholder that differs from the indexer CID.
  • Regression test: the contenthash hop links the indexer CID, never the placeholder; the lockfile entry carries the indexer CID; the placeholder appears only inside the raw manifest JSON viewer. Plus a test for the no-versions error state.

No spec or schema changes; SPEC.md/schema/* untouched (that is the 0.2 diff in #30).

Verification

pnpm --filter @enspack/site typecheck|test (34 tests), biome clean.

Open in Web Open in Cursor 

The model page already took the latest CID from the indexer's on-chain
contenthash; drop the dead fallback to manifest.versions[0], fail visibly if the
indexer returns no versions, and model the self-referential placeholder in the
Qwen fixture so a regression test can prove the placeholder is never linked.

Co-authored-by: Jeff Lau <jefflau@users.noreply.github.com>
@cursor
cursor Bot merged commit b97e5c5 into master Sep 15, 2026
1 check 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