{"record":{"id":"8a75c6b746a21ef5","repo":"jdx/mise","slug":"invalid-dotfile-declarations-correct-them-before","errorCode":null,"errorMessage":"invalid dotfile declarations; correct them before publishing","messagePattern":"invalid dotfile declarations; correct them before publishing","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/share.rs","lineNumber":39,"sourceCode":"pub(crate) struct ShareReport {\n    pub files: BTreeMap<String, SharedFile>,\n    pub checkpoint: Option<String>,\n}\n\nimpl ShareReport {\n    pub(crate) fn objects(&self) -> BTreeMap<String, (String, String)> {\n        self.files\n            .iter()\n            .map(|(path, file)| (path.clone(), (file.mode.clone(), file.oid.clone())))\n            .collect()\n    }\n}\n\n/// Read committed files, including manually saved files missing on disk.\n/// Live directory enumeration is never the authority for a saved version.\npub(crate) fn current(repo: &HistoryRepo, tracked: &TrackedSet) -> Result<ShareReport> {\n    if !tracked.invalid.is_empty() {\n        eyre::bail!(\"invalid dotfile declarations; correct them before publishing\");\n    }\n    let mut report = ShareReport::default();\n    let Some(head) = repo.ref_oid(HistoryRepo::HISTORY_REF)? else {\n        return Ok(report);\n    };\n    report.checkpoint = Some(head.clone());\n    let roots = Roots::current();\n    for file in repo.ls_tree(&head)? {\n        let (local, variant) = match roots.locate(&file.path) {\n            Located::Config(path) => (path, None),\n            Located::Tracked { path, variant } => (path, variant),\n            Located::Marker | Located::Unmapped => continue,\n        };\n        let Some(entry) = tracked.entry_for(&local) else {\n            continue;\n        };\n        if entry.variant != variant {\n            continue;","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/share.rs#L21-L57","documentation":"`ShareReport::current` reads committed files to build the publish report. Before doing so it validates the `TrackedSet`; if any tracked dotfile declarations are invalid (malformed or non-existent sources declared for tracking), publishing is blocked until they are corrected, because the share would commit an inconsistent manifest.","triggerScenarios":"Running a publish/share flow whose `current(repo, tracked)` sees `tracked.invalid` non-empty — e.g. a source entry in the tracked set points at a missing or misdeclared file.","commonSituations":"Hand-edited tracking configuration adding a file path with a typo or a path outside eligible roots; a declared file deleted from disk but still declared; declaring files that the eligibility rules reject (ignored/excluded paths).","solutions":["Fix or remove the invalid declarations in your dotfiles tracking configuration, then retry the publish","Run `mise bootstrap dotfiles status` to see which declarations are flagged invalid","Untrack paths that no longer exist or are ineligible: `mise bootstrap dotfiles untrack <path>`"],"exampleFix":"// before (tracking config)\nsources = [\"~/.zshrc\", \"~/.bashr\"]   # typo\n\n// after\nsources = [\"~/.zshrc\", \"~/.bashrc\"]","handlingStrategy":"validation","validationCode":"mise bootstrap dotfiles status   # lists invalid declarations before publishing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate paths in tracking configuration (existence, correct home expansion) after every edit","Remove declarations for deleted files promptly","Run `status` as a pre-publish habit to catch invalid entries early"],"tags":["validation","dotfiles","config","publish"],"backgroundTag":"schema-validation-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}