fix(site): latest CID always comes from the indexer, never manifest.versions[last] (#30) - #31
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #30:
manifest.versions[last].cidis self-referential and does not resolve, so the catalog must take the current version's CID from the on-chaincontenthashas reported by the indexer.Audit result: the model page already did this.
NameDetail.versions[].cidand/v1/nameslatest.cidare both derived by the indexer fromContenthashChanged(decodeContenthashToCid), and the trust chain, lockfile entry and versions table all read fromdetail.versions, not frommanifest.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 tomanifest.versions[0]; a name with no indexer versions renders an error state instead of a made-up CID.manifest.versions[last].cidis a placeholder that differs from the indexer CID.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.