{"record":{"id":"a6f4475d40cdef50","repo":"jdx/mise","slug":"error-a6f447","errorCode":null,"errorMessage":"{}: {}","messagePattern":"\\{\\}: \\{\\}","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/preflight.rs","lineNumber":121,"sourceCode":"            excludes.extend(history.exclude);\n        }\n        files.insert(\n            path,\n            Arc::new(parsed) as Arc<dyn crate::config::config_file::ConfigFile>,\n        );\n    }\n    // File composition expects highest precedence first.\n    files.reverse();\n    crate::system::files::validate_incoming_files(&files)?;\n    let requests = crate::system::files::files_from_config_files(&files);\n    crate::system::files::validate_composed_file_footprints(&requests)?;\n    let mut declarations = TrackedSet {\n        exclude: excludes,\n        ..Default::default()\n    };\n    declarations.add_requests(requests);\n    if let Some(invalid) = declarations.invalid.first() {\n        bail!(\"{}: {}\", invalid.path, invalid.reason);\n    }\n    declarations.exclude_set()?;\n    // The repository inventory, not a source or output mentioned by incoming\n    // configuration, determines which files the batch may install.\n    let mut prospective = tracked.clone();\n    prospective.required_sources = declarations.required_sources;\n    Ok(prospective)\n}\n\n/// Required source files must exist in the complete proposed write set or\n/// already be available locally. A queued deletion is not an available source.\npub(super) fn sources(repo: &HistoryRepo, tracked: &TrackedSet, plans: &[PathPlan]) -> Result<()> {\n    let roots = Roots::current();\n    for source in &tracked.required_sources {\n        let planned = plans\n            .iter()\n            .find(|plan| roots.locate(&plan.branch_path).path() == Some(source.as_path()));\n        match planned.and_then(|plan| plan.apply.as_ref()) {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/preflight.rs#L103-L139","documentation":"After composing the incoming configuration into file declarations, mise validates the resulting TrackedSet. Any declaration that is invalid (bad path, malformed footprint, out-of-scope file, etc.) is collected in `declarations.invalid`; the first one is reported as `<path>: <reason>`. This is a wrapper: the actual cause is the per-path reason stored by the declaration validator.","triggerScenarios":"Incoming TOML configuration produces a file request that fails TrackedSet validation — e.g. a `[[files]]`/system-file declaration with an invalid path, a path outside allowed roots, or a footprint that fails `add_requests` validation. Raised when `declarations.invalid` is non-empty.","commonSituations":"A teammate hand-edited the managed-files section of the shared config and typoed a path; a declaration references a file outside the permitted roots; duplicated or overlapping declarations that the validator rejects.","solutions":["Read the reported `<path>: <reason>` message; it names the exact declaration and why it was rejected.","Fix or remove the offending declaration in the shared config, commit, and re-pull.","If the path is legitimately needed, move it inside the allowed roots/namespace supported by the tracked-file system."],"exampleFix":"// before (shared config)\n[[files]]\npath = \"/etc/anything-goes.conf\"   # outside managed roots\n// after\n[[files]]\npath = \"~/.config/mise/conf.d/tools.toml\"  # within allowed roots","handlingStrategy":"validation","validationCode":"const { invalid } = validateTrackedDeclarations(requests);\nif (invalid.length > 0) {\n  throw new Error(`${invalid[0].path}: ${invalid[0].reason}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await applyIncoming();\n} catch (e) {\n  const m = String(e.message).match(/^(.+?):\\s(.+)$/);\n  if (m && isDeclarationReason(m[2])) {\n    console.error(`Fix declaration at ${m[1]}: ${m[2]}`);\n  } else throw e;\n}","preventionTips":["Validate tracked-file declarations locally before pushing shared config changes.","Keep declaration paths inside the documented managed roots.","Use the schema/editor support for the tracked-files config section instead of hand-editing."],"tags":["config","validation","sync"],"backgroundTag":"invalid-config-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}