unicity-aos/aos-ce · error

[package].name is missing or empty.

Error message

[package].name is missing or empty.

What it means

`check_package` extracts `[package].name` as a string; if the [package] table, the name key, or a non-empty string is absent (`is_none_or(str::is_empty)`), this error is emitted. Every capsule manifest must declare a package name for identification and artifact naming.

Solutions

  1. Add a [package] section with a non-empty `name`, e.g. `name = "my-capsule"`.
  2. If [package] exists, add the missing `name` key or fill in the empty string.
  3. Re-run the forge lints; version and component checks run independently.

Example fix

// before
[package]
version = "0.1.0"

// after
[package]
name = "my-capsule"
version = "0.1.0"
Defensive patterns

Strategy: validation

Validate before calling

// Rust
let name = root.get("package").and_then(|p| p.get("name")).and_then(|n| n.as_str());
if name.map_or(true, str::is_empty) { return Err("[package].name required"); }

Prevention

When it happens

Trigger: Capsule.toml missing a [package] section, having `[package]` with no `name` key, or `name = ""`.

Common situations: Creating a minimal manifest from scratch and forgetting [package], renaming a capsule and leaving the key deleted, or template files with a blank placeholder name.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of unicity-aos/aos-ce@f6f22024fb (2026-09-13). Data as JSON: /api/errors/187066de3dcb0138. Report an issue: GitHub.

Appendix: source

Thrown at capsules/capsule-forge/src/checks.rs:143

    }

    if capabilities
        .get("kv")
        .and_then(Toml::as_array)
        .is_some_and(|values| !values.is_empty())
    {
        out.push(Finding::info(
            "The `kv` capability field is reserved; ordinary capsule KV does not require it.",
            "Omit `kv` unless the pinned runtime contract specifically requires it.",
        ));
    }
}

fn check_package(root: &Toml, out: &mut Vec<Finding>) {
    let pkg = root.get("package");
    let name = pkg.and_then(|p| p.get("name")).and_then(Toml::as_str);
    if name.is_none_or(str::is_empty) {
        out.push(Finding::err(
            "[package].name is missing or empty.",
            "Add `name = \"my-capsule\"` under [package].",
        ));
    }
    match pkg.and_then(|p| p.get("version")).and_then(Toml::as_str) {
        Some(v) if is_semverish(v) => {}
        Some(v) => out.push(Finding::err(
            format!("[package].version = \"{v}\" is not MAJOR.MINOR.PATCH."),
            "Use a three-part numeric version like \"0.1.0\".",
        )),
        None => out.push(Finding::err(
            "[package].version is missing.",
            "Add `version = \"0.1.0\"` under [package].",
        )),
    }
}

fn check_component(root: &Toml, out: &mut Vec<Finding>) {

View on GitHub (pinned to f6f22024fb)