toml crateOpen 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)
Manifest::parse (crates/nikaia/src/manifest.rs) reads the text with toml::from_str into a dynamic toml::Value, flattens it with items_of into ManifestItems (every value as its text), and manifest_parse (crates/nikaia-std/src/compiler/manifest.nika) sorts them into a ManifestFile. value_of (same Rust file) turns a dependency’s text back into a toml::Value with toml::from_str(&format!("v = {text}")) for Dependency::Rust / Dependency::Nikaia.manifest_parse does not look at depends on how each section’s arm treats it.git ls-files '*nikaia.toml') use the headers [package] (44), [build] (19), [dependencies] (12), [rust-library] (7), [features] (3), [allow] (2), [directories] (2), [library.sqlite3] (1); dependency inline tables use only the keys path, type, version. Part III 13.3 (30-nikaia-tooling.md) also allows a dependency written as a bare version, http_server = "1.2".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).
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.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.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]).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.
crates/nikaia-std/src/compiler/manifest.nika (and its lowered .rs), crates/nikaia/src/manifest.rs (the Rust parse path removed; what is left is wiring a lowered function into Manifest, which the move into Nikaia allows: CLAUDE.md, Written in Nikaia only, a fix that moves code into Nikaia).Manifest::parse’s toml::from_str, items_of, value_of (manifest.rs). Its std counterpart: none (Part III 17 has no TOML reader; the grammar of the reader issue is it).toml users (describe.rs, project.rs writing Cargo.toml, run_fast.rs, the orchestrator crate); each moves with its own issue. The toml crate stays a dependency of crates/nikaia until they do.Cargo.toml of a project (the dependency entries Cargo is handed).toml::from_str and checking keys afterwards: the dynamic read the owner refused, and a second pass.Dependency { Version(String), Table(Entry) } read by match T::kind: refused by ADR-grammar-typed-read-v1 D13 for now.Generated by Claude Code