{"record":{"id":"187066de3dcb0138","repo":"unicity-aos/aos-ce","slug":"package-name-is-missing-or-empty","errorCode":null,"errorMessage":"[package].name is missing or empty.","messagePattern":"\\[package\\]\\.name is missing or empty\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"capsules/capsule-forge/src/checks.rs","lineNumber":143,"sourceCode":"    }\n\n    if capabilities\n        .get(\"kv\")\n        .and_then(Toml::as_array)\n        .is_some_and(|values| !values.is_empty())\n    {\n        out.push(Finding::info(\n            \"The `kv` capability field is reserved; ordinary capsule KV does not require it.\",\n            \"Omit `kv` unless the pinned runtime contract specifically requires it.\",\n        ));\n    }\n}\n\nfn check_package(root: &Toml, out: &mut Vec<Finding>) {\n    let pkg = root.get(\"package\");\n    let name = pkg.and_then(|p| p.get(\"name\")).and_then(Toml::as_str);\n    if name.is_none_or(str::is_empty) {\n        out.push(Finding::err(\n            \"[package].name is missing or empty.\",\n            \"Add `name = \\\"my-capsule\\\"` under [package].\",\n        ));\n    }\n    match pkg.and_then(|p| p.get(\"version\")).and_then(Toml::as_str) {\n        Some(v) if is_semverish(v) => {}\n        Some(v) => out.push(Finding::err(\n            format!(\"[package].version = \\\"{v}\\\" is not MAJOR.MINOR.PATCH.\"),\n            \"Use a three-part numeric version like \\\"0.1.0\\\".\",\n        )),\n        None => out.push(Finding::err(\n            \"[package].version is missing.\",\n            \"Add `version = \\\"0.1.0\\\"` under [package].\",\n        )),\n    }\n}\n\nfn check_component(root: &Toml, out: &mut Vec<Finding>) {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/capsules/capsule-forge/src/checks.rs#L125-L161","documentation":"`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.","triggerScenarios":"Capsule.toml missing a [package] section, having `[package]` with no `name` key, or `name = \"\"`.","commonSituations":"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.","solutions":["Add a [package] section with a non-empty `name`, e.g. `name = \"my-capsule\"`.","If [package] exists, add the missing `name` key or fill in the empty string.","Re-run the forge lints; version and component checks run independently."],"exampleFix":"// before\n[package]\nversion = \"0.1.0\"\n\n// after\n[package]\nname = \"my-capsule\"\nversion = \"0.1.0\"","handlingStrategy":"validation","validationCode":"// Rust\nlet name = root.get(\"package\").and_then(|p| p.get(\"name\")).and_then(|n| n.as_str());\nif name.map_or(true, str::is_empty) { return Err(\"[package].name required\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Start every Capsule.toml from a template containing [package] name and version.","Check manifests into CI with the forge lint as a required check.","Never leave name as an empty placeholder."],"tags":["toml","schema-validation","config","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"f6f22024fb1e8d122f28a1b4a9f75aee448ae839","analyzedAt":"2026-09-13T03:04:44.565Z","contentChangedAt":"2026-09-13T03:04:44.565Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}