feat(prepare): add human-readable stale reasons to prepare output#8408
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the user experience of the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable enhancement by adding human-readable reasons for why a prepare step is considered stale. The core of the change is the refactoring from a boolean freshness check to a more descriptive FreshnessResult enum, which is a solid design choice. The implementation is well-executed across the affected files, and the e2e tests have been updated to cover the new output, ensuring the feature is verifiable. I've identified one minor issue where a fallback error message could be misleading, but overall, this is a great improvement to the user experience.
| (_, None) => Ok(FreshnessResult::OutputsMissing( | ||
| "outputs do not exist".to_string(), | ||
| )), |
There was a problem hiding this comment.
The message "outputs do not exist" is incorrect in this context. The loop at lines 440-447 has already verified that all output paths exist. If outputs_mtime is None at this point, it's likely due to an issue reading file metadata (e.g., permissions), not because the files are missing.
Using FreshnessResult::OutputsMissing is semantically incorrect. It would be more accurate to use FreshnessResult::Stale with a message that reflects the actual situation. This ensures the provider is correctly marked as stale while providing a non-misleading reason to the user.
| (_, None) => Ok(FreshnessResult::OutputsMissing( | |
| "outputs do not exist".to_string(), | |
| )), | |
| (_, None) => Ok(FreshnessResult::Stale( | |
| "could not determine modification time of outputs".to_string(), | |
| )), |
Greptile SummaryThis PR replaces boolean freshness checks with a
The refactoring maintains backward compatibility in behavior while adding valuable diagnostic information. The logic for determining freshness is sound, properly handling edge cases like empty directories and session-created outputs. Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 4b78806 |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.24 x -- echo |
28.3 ± 0.5 | 27.5 | 32.7 | 1.19 ± 0.06 |
mise x -- echo |
23.8 ± 1.1 | 22.9 | 44.0 | 1.00 |
✅ Performance improvement for x -- echo is 19% |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.24 env |
27.8 ± 0.6 | 27.1 | 32.6 | 1.20 ± 0.03 |
mise env |
23.1 ± 0.4 | 22.4 | 25.2 | 1.00 |
✅ Performance improvement for env is 20% |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.24 hook-env |
28.7 ± 0.5 | 27.9 | 33.4 | 1.20 ± 0.03 |
mise hook-env |
23.9 ± 0.4 | 23.1 | 25.8 | 1.00 |
✅ Performance improvement for hook-env is 20% |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.24 ls |
23.0 ± 0.4 | 22.4 | 24.9 | 1.06 ± 0.06 |
mise ls |
21.7 ± 1.1 | 21.0 | 42.1 | 1.00 |
xtasks/test/perf
| Command | mise-2026.2.24 | mise | Variance |
|---|---|---|---|
| install (cached) | 163ms | 149ms | +9% |
| ls (cached) | 88ms | 81ms | +8% |
| bin-paths (cached) | 96ms | ✅ 85ms | +12% |
| task-ls (cached) | 867ms | 848ms | +2% |
✅ Performance improvement: bin-paths cached is 12%
Replace boolean fresh/stale check with FreshnessResult enum that includes specific reasons like "package-lock.json is newer than outputs" or "node_modules does not exist". Reasons are shown in dry-run output and status bar notifications. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ures The (_, None) match arm fires when output files exist but their mtime couldn't be read (e.g., permissions). Using OutputsMissing was semantically incorrect since outputs were already verified to exist. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
77eb9d6 to
02a2faf
Compare
### 🚀 Features - **(hooks)** add task references to hooks and watch_files by @jdx in [#8400](#8400) - **(prepare)** add git-submodule built-in provider by @jdx in [#8407](#8407) - **(prepare)** add human-readable stale reasons to prepare output by @jdx in [#8408](#8408) - **(prepare)** add dependency ordering to prepare steps by @jdx in [#8401](#8401) - **(prepare)** add --explain flag for provider diagnostics by @jdx in [#8409](#8409) - **(prepare)** add per-provider timeout support by @jdx in [#8405](#8405) - **(prepare)** add blake3 content-hash freshness checking by @jdx in [#8404](#8404) - **(tasks)** monorepo vars and per-task vars by @halms in [#8248](#8248) ### 🐛 Bug Fixes - **(aqua)** restore bin_paths disk cache with fresh_file invalidation by @jdx in [#8398](#8398) - **(idiomatic)** use generic parser for idiomatic files by @risu729 in [#8171](#8171) - **(install)** apply precompiled options to all platforms in lockfile by @jdx in [#8396](#8396) - **(install)** normalize "v" prefix when matching lockfile versions by @jdx in [#8413](#8413) - **(prepare)** improve git submodule parser and fix check_staleness error handling by @jdx in [#8412](#8412) - **(python)** respect precompiled settings in lock file generation by @jdx in [#8399](#8399) - **(python)** clarify uv_venv_auto docs + prevent uv shim recursion in venv creation by @halms in [#8402](#8402) - **(task)** remove deprecated `# mise` task header syntax by @jdx in [#8403](#8403) - **(vfox)** avoid eager metadata loading during config file detection by @jdx in [#8397](#8397) - clarify GitHub attestations to be artifact ones by @scop in [#8394](#8394) - ignore comments in idiomatic version files by @iloveitaly in [#7682](#7682) ### 🚜 Refactor - unify archive detection by @risu729 in [#8137](#8137) ### 📚 Documentation - remove duplicated docs for npm.package_manager by @risu729 in [#8414](#8414)
Summary
FreshnessResultenum that carries human-readable reasons[dry-run] Would prepare: npm (node_modules does not exist)or[dry-run] Would prepare: codegen (schema.graphql is newer than outputs)prepare: npm (node_modules does not exist) — run 'mise prep'Test plan
🤖 Generated with Claude Code
Note
Medium Risk
Changes prepare freshness evaluation from a boolean to a reason-carrying enum and adjusts when steps are considered stale (e.g., missing outputs/session-created outputs), which could affect whether prepare runs or is skipped. Risk is limited to dependency-prep UX/logic and is covered by updated e2e assertions.
Overview
mise prepare --dry-runnow prints why a provider would run by attaching a human-readable staleness reason toPrepareStepResult::WouldRun(e.g., output missing, sources newer, forced).The prepare engine replaces the boolean freshness check with a
FreshnessResultenum, adding explicit handling for missing outputs, outputs created in the current session, no outputs, no sources, and forced runs; the status-bar stale warning now includes these reasons.E2E coverage is updated to assert the new reason strings for missing outputs and source-newer-than-output cases.
Written by Cursor Bugbot for commit 02a2faf. This will update automatically on new commits. Configure here.