Issue #2603: Manifest reading uses the Nikaia TOML reader, not the Rust toml crate

Open and answer this issue on GitHub.

enhancement, selfhosting, ready · opened 2026-11-21 · updated 2026-11-22 · 0 comments

Owner, 2026-11-21: the manifest is read into a declared struct by Nikaia’s own TOML reader, so nikaia.toml holds exactly what the compiler expects and nothing it silently ignores; the Rust toml crate leaves manifest reading.

Part of #2505 Needs #2602 Found while #2460 (unblocks “A TOML reader for the trust manifest” #2484)

Where it stands

Governing decisions

ADR-grammar-typed-read-v1 (D1-D6, D13: a typed read; a payload enum is refused for now). Part III 13.3 (the manifest’s sections and the dependency forms). ADR-286 D15, D23, D24 (dependency by path, by version). ADR-002 D1 (a Rust crate is passed to Cargo as written).

To build

  1. manifest_read(text: String) -> ManifestFile throws Refused in manifest.nika: declares the manifest’s struct (one field per section above, Maybe where a section may be left out, collections::BTreeMap[String, …] for [dependencies], [build.<target>], [library.<name>], [features], [allow.packages.<name>]) and reads it with Toml::read[...], then builds the ManifestFile manifest_parse builds today, with the same refusals and notes. An unknown section or key is refused with line and column (today it depends on the arm). Test manifest_read_reads_every_section.nika (a manifest with every section, printing the ManifestFile’s fields) and manifest_read_refuses_an_unknown_key.nika.
  2. A dependency is a text or a table: name = "1.2" (by version) and name = { type = "rust", version = "…" } / { path = "…" }. A payload enum is refused by D13, so the grammar says it with a rule written for the dependency value ("\"" … "\"" gives a DependencyEntry with only version, { … } reads the struct { type: String?, version: String?, path: String?, … }); the struct names the Cargo keys a Rust dependency may carry (version, path, features, default-features, optional, package, git, branch, rev) and refuses others. If the grammar cannot give one rule two forms by its first byte, that is a Found: (gap of kind 2), not a workaround. Test manifest_read_a_dependency_by_text_or_table.nika.
  3. The switch: Manifest::parse calls manifest_read instead of toml::from_str + items_of + manifest_parse; items_of and value_of are removed, and dependency_of builds Dependency from the typed entry. Dependency::Rust / Dependency::Nikaia keep toml::Value only as the form handed to the Cargo writer (project.rs), built from the typed entry’s fields; that writer’s own move is not this issue. manifest_parse and ManifestItem go if nothing else calls them (scripts/where.nika), else the report names the caller. The it and compiler tests stay as they are: every tracked manifest reads (checked by nikaia build of three packages with [dependencies], [features] and [allow]).

Done when

Manifest::parse reads nikaia.toml through Toml::read into the declared struct, an unknown key in any section is refused with its line and column, items_of and value_of are gone, and the tests pass; the step that removes them carries Fixes #N, and the report has a Found: line per gap met.

Files and limits

Ruled out


Generated by Claude Code

Back to Open Issues