jdx/mise · error

invalid dotfile declarations; correct them before publishing

Error message

invalid dotfile declarations; correct them before publishing

What it means

`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.

Source

Thrown at src/system/history/sync/share.rs:39

pub(crate) struct ShareReport {
    pub files: BTreeMap<String, SharedFile>,
    pub checkpoint: Option<String>,
}

impl ShareReport {
    pub(crate) fn objects(&self) -> BTreeMap<String, (String, String)> {
        self.files
            .iter()
            .map(|(path, file)| (path.clone(), (file.mode.clone(), file.oid.clone())))
            .collect()
    }
}

/// Read committed files, including manually saved files missing on disk.
/// Live directory enumeration is never the authority for a saved version.
pub(crate) fn current(repo: &HistoryRepo, tracked: &TrackedSet) -> Result<ShareReport> {
    if !tracked.invalid.is_empty() {
        eyre::bail!("invalid dotfile declarations; correct them before publishing");
    }
    let mut report = ShareReport::default();
    let Some(head) = repo.ref_oid(HistoryRepo::HISTORY_REF)? else {
        return Ok(report);
    };
    report.checkpoint = Some(head.clone());
    let roots = Roots::current();
    for file in repo.ls_tree(&head)? {
        let (local, variant) = match roots.locate(&file.path) {
            Located::Config(path) => (path, None),
            Located::Tracked { path, variant } => (path, variant),
            Located::Marker | Located::Unmapped => continue,
        };
        let Some(entry) = tracked.entry_for(&local) else {
            continue;
        };
        if entry.variant != variant {
            continue;

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Fix or remove the invalid declarations in your dotfiles tracking configuration, then retry the publish
  2. Run `mise bootstrap dotfiles status` to see which declarations are flagged invalid
  3. Untrack paths that no longer exist or are ineligible: `mise bootstrap dotfiles untrack <path>`

Example fix

// before (tracking config)
sources = ["~/.zshrc", "~/.bashr"]   # typo

// after
sources = ["~/.zshrc", "~/.bashrc"]
Defensive patterns

Strategy: validation

Validate before calling

mise bootstrap dotfiles status   # lists invalid declarations before publishing

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/8a75c6b746a21ef5. Report an issue: GitHub.