{"record":{"id":"640e24ae9ca63a40","repo":"unicity-aos/aos-ce","slug":"embedded-distro-has-no-capsules","errorCode":null,"errorMessage":"embedded distro has no capsules","messagePattern":"embedded distro has no capsules","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/unicity-aos-bootstrap/src/lib.rs","lineNumber":652,"sourceCode":"}\n\nconst fn runtime_binary_name() -> &'static str {\n    RUNTIME_EXECUTABLE_NAMES[0]\n}\n\nconst fn runtime_daemon_binary_name() -> &'static str {\n    RUNTIME_EXECUTABLE_NAMES[1]\n}\n\nfn capsule_assets_from_manifest() -> io::Result<Vec<String>> {\n    let manifest = UNICITY_CE_MANIFEST\n        .parse::<toml::Value>()\n        .map_err(|error| io::Error::new(io::ErrorKind::InvalidData, error))?;\n    let capsules = manifest\n        .get(\"capsule\")\n        .and_then(toml::Value::as_array)\n        .ok_or_else(|| {\n            io::Error::new(\n                io::ErrorKind::InvalidData,\n                \"embedded distro has no capsules\",\n            )\n        })?;\n    let mut assets = Vec::with_capacity(capsules.len());\n    for capsule in capsules {\n        let package = capsule\n            .get(\"name\")\n            .and_then(toml::Value::as_str)\n            .ok_or_else(|| {\n                io::Error::new(io::ErrorKind::InvalidData, \"embedded capsule has no name\")\n            })?;\n        let source = capsule\n            .get(\"source\")\n            .and_then(toml::Value::as_str)\n            .ok_or_else(|| {\n                io::Error::new(io::ErrorKind::InvalidData, \"embedded capsule has no source\")\n            })?;","sourceCodeStart":634,"sourceCodeEnd":670,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/crates/unicity-aos-bootstrap/src/lib.rs#L634-L670","documentation":"capsule_assets_from_manifest parses the compile-time-embedded UNICITY_CE_MANIFEST TOML and extracts the `capsule` array. This error is thrown when the embedded manifest either has no top-level `capsule` key at all, or the key exists but is not a TOML array. It signals that the embedded distro manifest is malformed and no capsule assets can be enumerated.","triggerScenarios":"Calling capsule_assets_from_manifest (directly or via capsule_dir_with, prepare_unicity_ce_init, install_capsule_fixtures) when UNICITY_CE_MANIFEST lacks a `capsule = [...]` table array — e.g. the manifest only has other sections like [package], or `capsule` is declared as a plain table/string instead of an array of tables.","commonSituations":"Regenerating or hand-editing the embedded distro manifest and accidentally renaming or dropping the `[[capsule]]` section; a build script emitting a manifest template with no capsule entries; a schema/version change where the key was renamed (e.g. to `capsules`); committing an empty or placeholder manifest fixture.","solutions":["Add at least one `[[capsule]]` array-of-tables entry to the embedded manifest (UNICITY_CE_MANIFEST / the distro manifest file feeding it).","Check the key spelling and type: it must be exactly `capsule` and an array of tables (`[[capsule]]`), not `[capsule]` or `capsules`.","If the distro genuinely ships no capsules, treat that as a build-time failure: populate the manifest via the distro build script rather than stubbing it empty.","Regenerate the manifest from the canonical source with the project's build/embed tooling instead of editing it by hand."],"exampleFix":"// before (manifest has no capsule array)\n[distro]\nversion = \"1.0\"\n\n// after\n[distro]\nversion = \"1.0\"\n\n[[capsule]]\nname = \"my-package\"\nsource = \"capsules/my-package.capsule\"","handlingStrategy":"validation","validationCode":"// Rust: validate the embedded manifest shape before calling the API\nfn ensure_manifest_has_capsules(manifest_toml: &str) -> Result<(), String> {\n    let value: toml::Value =\n        toml::from_str(manifest_toml).map_err(|e| format!(\"manifest TOML invalid: {e}\"))?;\n    match value.get(\"capsule\").and_then(toml::Value::as_array) {\n        Some(arr) if !arr.is_empty() => Ok(()),\n        _ => Err(\"embedded manifest has no `capsule` array-of-tables\".into()),\n    }\n}","typeGuard":"fn has_capsule_array(manifest: &toml::Value) -> bool {\n    manifest.get(\"capsule\").map(toml::Value::is_array).unwrap_or(false)\n}","tryCatchPattern":"match prepare_unicity_ce_init(...) {\n    Err(e) if e.to_string().contains(\"embedded distro has no capsules\") => {\n        eprintln!(\"build bug: embedded CE manifest lacks [[capsule]] entries; regenerate manifest\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["Always emit `[[capsule]]` array-of-tables entries from the distro build script; never hand-edit the embedded manifest.","Add a unit test that parses UNICITY_CE_MANIFEST and asserts a non-empty `capsule` array exists.","Validate the manifest against a schema (e.g. serde struct with required Vec<Capsule>) at build time."],"tags":["toml","manifest","embedded-distro","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"}