Issue #1429: A registry of Nikaia’s own instead of crates.io: a Git index fed by pull requests, a canonical SHA-256 archive, mirrors anyone runs (ADR-registry-1)

Open and answer this issue on GitHub.

decision · opened 2026-11-08 · updated 2026-11-08 · 0 comments

Where the question comes from

ADR-286 D23-D27 publish a Nikaia package on crates.io as the crate nikaia_<name>, carrying its .nika sources, its ledger and a stub Cargo.toml for Cargo’s resolver. ADR-286 §6 left the registry question open (“Reversible: the compiler reads a directory”).

Asked in the Rust community, part of it accepts this, but many do not want crates.io to carry packages that are not Rust: generated Rust there is fine, Nikaia sources are not. ADR-286 also names its own costs: no name space of Nikaia’s own (nikaia_foo can be squatted), and resolution by a tool (Cargo) that cannot read the ledger.

Blocked meanwhile: a dependency by version (#551 for its package part), nikaia publish, and every library written outside this repository.

The full decision paper is the record ADR-registry-1 (status Open), on develop: docs/specification/adr/adr-registry-1.md.

Alternatives

A — do nothing: crates.io as ADR-286 decides. For: nothing to build or run. Against: the community’s objection stands; no name space; Cargo resolves without the ledger; every package carries the prefix and a stub.

B — crates.io for the generated Rust (with ledger and proofs, no .nika), Git for the sources, crates.io as the mirror. For: crates.io carries Rust only; a free mirror. Against: a consumer without the sources cannot check the ledger (ADR-100 D3-D4), so a forged ledger is an unreported data race at the consumer; the build options are frozen at publication instead of being the consumer’s; generated Rust ties a package to one std version; the cross-package analysis stops; Cargo stays in the loop.

C — a registry server of our own, with upload and accounts. For: full control. Against: paid infrastructure the ecosystem stops at; an account system to run, which is exactly what was attacked at npm and PyPI.

D — a Git index fed by pull requests, sources from Git, a canonical archive, mirrors anyone runs (recommended). For: no running cost; a package is always built from its sources with the consumer’s options, the full analysis and --locked; ownership, semver compatibility and safe duplication are derived from the ledger, not declared; every check is a Nikaia tool (nikaia registry check) that any CI or a maintainer can run, and every mirror is plain files, so neither GitHub Actions nor any host is a lock-in. Against: everything listed under To build in the record’s §5 has to be written (in Nikaia); a first registration needs a human review.

Within D, resolution: Minimal Version Selection (simple, tests lower bounds, does not bring fixes, not what developers expect) or the newest compatible version (recommended: the usual behaviour; its risks are answered by a semver check over API and ledger, a cooling period and a minimal-versions test run; the SAT solver it needs exists, ADR-270 D24).

How others do it

Julia’s General registry (pull requests with metadata only, CI auto-merge, package servers as mirrors) is closest to D. winget and Homebrew accept manifests by pull request. Go: proxy plus checksum database, Minimal Version Selection. Cargo, npm, pip: a server with upload, newest compatible version, lockfile. Dart and uv: PubGrub for explained conflicts. Debian, CPAN, CTAN: volunteer mirrors trusted through checksums. Nix: a canonical archive format (NAR) for hashing a tree. (From memory, not checked; marked so in the record.)

Recommendation

D with the newest compatible version, as ADR-registry-1 D1-D17 state it, in short:

  1. The index is a Git repository, one file per package; a version arrives by pull request with metadata only (URL, commit, content hash, dependencies, minimum Nikaia version).
  2. The registry’s CI builds the pinned commit, tests it, compares the hash and keeps nothing but metadata; foreign code runs without secrets or write permission.
  3. A package is hashed as a canonical nkpkg archive (SHA-256, fixed-width length prefixes, entry count, no trailing bytes, strictly sorted paths, no case-only differences, one strict reader, size limits, never shortened); length extension does not apply because no secret is hashed.
  4. Ownership is proved by the registered commit and kept by a signing key held in the index, not by the GitHub login; key and owner changes wait and notify.
  5. Resolution: the newest compatible version as the lexicographic optimum, solved with the logic package, conflicts explained from the solver’s certificate; lockfile pins version, commit and hash; a cooling period; semver checked from API and ledger; --minimal-versions tested.
  6. Mirrors are a file layout (v1/sha256/<hash>.nkpkg) any static host serves; nikaia mirror sync, mirror serve, vendor; the foundation mirrors to GitHub and Codeberg release assets, the community adds more, Software Heritage archives the sources.
  7. Search: static package pages on the website, indexed with Pagefind.
  8. Two versions of one package may stand side by side where no public edge (derived from the ledger) joins them; a package with global state declares single = true.
  9. Generated Rust on crates.io stays the author’s choice for Rust users (ADR-393); the compiler itself stays on crates.io (ADR-336 D2).

If accepted: ADR-286 D23-D27 are rewritten with Changed by notes, ADR-336 D2 loses its package part, Part III 13.3 is rewritten, #551 is adjusted, and the build is filed as ready issues.

Open in the record (§6)

The cooling period’s length; a transparency log or TUF for the index; access control for private registries; the archive limits’ values; who keeps the registry; whether global state can be detected so single = true is derived.

Back to Open Issues