{"record":{"id":"d47f029920d649f6","repo":"jdx/mise","slug":"aube-lockfile-must-contain-a-mapping","errorCode":null,"errorMessage":"aube lockfile must contain a mapping","messagePattern":"aube lockfile must contain a mapping","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lockfile.rs","lineNumber":92,"sourceCode":"    pub graph: toml::Table,\n    #[serde(skip)]\n    pub graph_text: String,\n    #[serde(skip)]\n    pub project: Option<String>,\n}\n\nimpl PartialEq for AubeLock {\n    fn eq(&self, other: &Self) -> bool {\n        self.graph == other.graph\n    }\n}\nimpl Eq for AubeLock {}\n\nimpl AubeLock {\n    pub(crate) fn from_yaml(contents: &str) -> Result<Self> {\n        let value: serde_yaml::Value = serde_yaml::from_str(contents)?;\n        let toml::Value::Table(graph) = yaml_to_toml(value)? else {\n            bail!(\"aube lockfile must contain a mapping\");\n        };\n        Ok(Self {\n            graph,\n            graph_text: contents.to_owned(),\n            project: None,\n        })\n    }\n\n    pub(crate) fn to_yaml(&self) -> Result<String> {\n        if !self.graph_text.is_empty() {\n            return Ok(self.graph_text.clone());\n        }\n        let value = toml_to_yaml(toml::Value::Table(self.graph.clone()));\n        Ok(serde_yaml::to_string(&value)?)\n    }\n\n    pub(crate) fn legacy_identity(&self) -> Result<String> {\n        use sha2::{Digest, Sha256};","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/lockfile.rs#L74-L110","documentation":"Thrown by `AubeLock::from_yaml` when a mise.lock aube section parses as YAML but its top level is not a mapping (table). The lockfile graph must be a YAML map of package -> data; anything else (list, scalar) is rejected to prevent corrupt lock data being loaded.","triggerScenarios":"mise.lock's aube graph section was hand-edited or corrupted so its top-level structure is a sequence or scalar instead of a mapping; a bad merge or truncation produced invalid YAML structure.","commonSituations":"Manual editing of mise.lock; merge conflict resolved incorrectly leaving a list at top level; accidental deletion of mapping keys.","solutions":["Restore mise.lock from git (`git checkout -- mise.lock`)","Fix the aube section so its top level is a mapping (key: value pairs)","Regenerate the lockfile by deleting it and re-running the install/lock operation","Avoid hand-editing mise.lock; let mise manage it"],"exampleFix":"# before (invalid: top-level sequence)\n- node\n- 22.0.0\n# after (valid mapping)\nnode:\n  version: 22.0.0","handlingStrategy":"try-catch","validationCode":"# sanity check before use\nyq -e 'tag == \"!!map\"' mise.lock >/dev/null || git checkout -- mise.lock","typeGuard":null,"tryCatchPattern":"if let Err(e) = result {\n    if e.to_string().contains(\"must contain a mapping\") {\n        // restore or regenerate mise.lock\n    }\n}","preventionTips":["Do not hand-edit mise.lock","Resolve merge conflicts by regenerating the lock, not by hand-editing structure","Commit a known-good mise.lock and restore it when corrupt"],"tags":["lockfile","yaml","validation","schema"],"backgroundTag":"schema-validation-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}