jdx/mise · error
no baseline
Error message
no baseline
What it means
A test panic in src/system/history/checkpoint/preimages.rs asserting that creating a baseline via `store.attempt` with `Trigger::Baseline` yields `Outcome::Created`. Any other outcome (no checkpoint produced, e.g. because the draft matched nothing) triggers `panic!("no baseline")`. The baseline is required for subsequent preimage/journal operations in the test.
Source
Thrown at src/system/history/checkpoint/preimages.rs:280
tempfile::tempdir_in(crate::system::history::sync::layout::Roots::current().home)?;
let first = live.path().join("first");
let second = live.path().join("second");
let sibling = live.path().join("sibling");
for path in [&first, &second, &sibling] {
std::fs::write(path, "saved")?;
}
let mut policy = FilePolicy::for_mode(FileMode::Track);
policy.autosave = false;
let entry = TrackedEntry::new(live.path().to_owned(), "track", policy);
let tracked = TrackedSet {
entries: vec![entry.clone()],
..Default::default()
};
let store = Store::open_in(state.path())?;
let mut draft = Draft::new(Trigger::Baseline);
draft.explicit_paths.push(live.path().to_owned());
let Outcome::Created(baseline) = store.attempt(&tracked, draft)? else {
panic!("no baseline")
};
for path in [&first, &second, &sibling] {
std::fs::write(path, "unsaved")?;
}
let mut before = baseline.commit;
let mut journal = vec![];
for path in [&first, &second, &first] {
let prior = PathSnapshot::capture_with(state.path(), path, Capture::Full);
if let Some(commit) =
store.protect_manual_preimage(&before, &tracked, path, &prior, &journal)?
{
before = commit.commit;
}
journal.push(JournalEntry::PathChanged {
part: "dotfiles".into(),
item: "test".into(),
path: path.clone(),
prior,View on GitHub (pinned to afd2eddd3a)
Solutions
- Ensure the path pushed into `draft.explicit_paths` is covered by the `tracked` set used for the attempt.
- Print the returned `Outcome` in the else branch to identify which non-Created variant was returned.
- Verify the file at `live.path()` exists and has content before attempting the baseline.
- Check `Store::attempt` baseline handling for early returns when explicit_paths are set.
Example fix
// before
let Outcome::Created(baseline) = store.attempt(&tracked, draft)? else {
panic!("no baseline")
};
// after
let outcome = store.attempt(&tracked, draft)?;
let Outcome::Created(baseline) = outcome else {
panic!("no baseline, got {outcome:?}")
}; Defensive patterns
Strategy: validation
Validate before calling
// rust
for p in &draft.explicit_paths {
if !p.exists() {
return Err(format!("baseline path {} does not exist", p.display()));
}
}
if !tracked.covers(&draft.explicit_paths) {
return Err("baseline paths are not in the tracked set");
} Type guard
fn baseline_of(outcome: Outcome) -> Option<Created> {
match outcome {
Outcome::Created(c) => Some(c),
_ => None,
}
} Try / catch
// rust
let outcome = store.attempt(&tracked, draft)?;
let Outcome::Created(baseline) = outcome else {
return Err(anyhow!("no baseline, got {outcome:?}"));
}; Prevention
- Confirm explicit_paths are tracked and exist before baseline attempts.
- Exhaustively match Outcome variants; never assume the happy path.
- Include the actual outcome in error messages.
- Keep baseline-creation behavior covered by regression tests.
When it happens
Trigger: `store.attempt(&tracked, draft)` with a `Trigger::Baseline` draft whose `explicit_paths` do not produce a created checkpoint — e.g. path not tracked, empty diff, or attempt short-circuiting to a non-Created outcome.
Common situations: `explicit_paths` pointing at files outside the tracked set; `tracked` configuration filtering out the live path; regressions in baseline creation that treat the first attempt as a no-op.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- expected a checkpoint
- expected key file
- {other:?}
- notifications disabled
- expected dictionary, got {value:?}
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/94826b1b1b4ff024.
Report an issue: GitHub.