04-sparse-index


Chapter 4 — Sparse Index Parsing

The crates.io sparse index is a massive tree of directories where each file contains line-delimited JSON, one line per version.

Example Entry

{"name":"a-tui-tool","vers":"0.4.1","deps":[{"name":"ratatui"}],"yanked":false}

What ratcrate-core Extracts

  • Latest non-yanked version

  • Dependency list → look for "name": "ratatui"

Algorithm Summary

  • Walk the directory tree

  • For each file:

    • Read line by line
    • Parse as JSON
    • Skip yanked versions
    • If any version depends on ratatui → track latest version

Placeholder: Code snippet screenshot