{"record":{"id":"ef18e9728524f758","repo":"jdx/mise","slug":"dotfile-target-encrypt-must-be-a-boolean","errorCode":null,"errorMessage":"dotfile {target}: encrypt must be a boolean","messagePattern":"dotfile (.+?): encrypt must be a boolean","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":639,"sourceCode":"        && (first.mode != FileMode::Template\n            || first.base == second.base\n                && config.bootstrap_tera_ctx(&first.origin.config)\n                    == config.bootstrap_tera_ctx(&second.origin.config))\n}\n\n/// Incoming configuration must fail preflight rather than silently dropping\n/// malformed declarations and applying the rest of the setup.\npub(crate) fn validate_incoming_files(config_files: &ConfigMap) -> Result<()> {\n    for (path, config) in config_files {\n        let Some(dotfiles) = config.dotfiles_config() else {\n            continue;\n        };\n        for (target, value) in dotfiles.0 {\n            if value.as_table().is_some_and(|t| {\n                t.contains_key(\"encrypt\")\n                    && t.get(\"encrypt\").and_then(toml::Value::as_bool).is_none()\n            }) {\n                bail!(\"dotfile {target}: encrypt must be a boolean\");\n            }\n            if value.as_table().is_some_and(|t| {\n                t.get(\"encrypt\").and_then(toml::Value::as_bool) == Some(true)\n                    && [\"content\", \"block\", \"line\", \"template\"]\n                        .iter()\n                        .any(|key| t.contains_key(*key))\n            }) {\n                bail!(\n                    \"encrypted dotfile {target} requires an external source, not inline content or edits\"\n                );\n            }\n            let Some(entry) = file_entry_from_toml(&target, value.clone()) else {\n                // Managed line/block edits are handled by the edit engine,\n                // not by this whole-file declaration parser.\n                if value.as_table().is_some_and(|table| {\n                    [\"block\", \"line\", \"template\", \"comment\", \"position\"]\n                        .iter()\n                        .any(|key| table.contains_key(*key))","sourceCodeStart":621,"sourceCodeEnd":657,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/files.rs#L621-L657","documentation":"`validate_incoming_files` checks each `[dotfiles]` entry's table fields before parsing. If an entry contains an `encrypt` key whose value cannot be parsed as a boolean (e.g. a string `\"true\"`, `\"yes\"`, or a number), the strict validation bails with this message.","triggerScenarios":"Writing `encrypt = \"true\"` or `encrypt = 1` in a dotfile entry table instead of a TOML boolean `encrypt = true`.","commonSituations":"Users familiar with env-var style configs quote booleans; hand-editing configs and copying the string form from documentation or scripts.","solutions":["Change the value to an unquoted TOML boolean: `encrypt = true` or `encrypt = false`","Remove the `encrypt` key if encryption is not intended"],"exampleFix":"// before\n\"~/.aws/credentials\" = { source = \"dotfiles/aws\", encrypt = \"true\" }\n// after\n\"~/.aws/credentials\" = { source = \"dotfiles/aws\", encrypt = true }","handlingStrategy":"validation","validationCode":"function encryptIsBool(entry) {\n  return entry && (entry.encrypt === undefined || typeof entry.encrypt === 'boolean');\n}","typeGuard":"const hasBooleanEncrypt = (e: unknown): e is { encrypt: boolean } => typeof (e as any)?.encrypt === 'boolean';","tryCatchPattern":null,"preventionTips":["Write TOML booleans unquoted: `encrypt = true`","Never quote boolean values in mise.toml dotfile entries"],"tags":["config","dotfiles","type-mismatch"],"backgroundTag":"config-type-mismatch","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"}