fix(guide): refresh installed state at startup so installed: matches before:#95
Conversation
The guide rendered "installed:" from a cached snapshot while the installers detect "before:" live, so a stale snapshot showed e.g. "installed: not installed" directly above "before: 10.5.0" (and "installed: 11.12.1" above "before: 11.17.0"). Refresh the snapshot's installed state, network-free, at guide startup so the two agree. The full `audit.py --update-local` path now refreshes installed_version + status from live detection but PRESERVES each tool's existing latest_version instead of rebuilding it from the older committed baseline. This keeps the refresh offline, avoids showing a target lower than installed, and keeps make-update and make-upgrade in agreement. Multi-version cycles are left to make update / per-cycle re-audit (no per-cycle local-only data). Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #95 +/- ##
=======================================
Coverage 69.68% 69.68%
=======================================
Files 22 22
Lines 3345 3345
=======================================
Hits 2331 2331
Misses 1014 1014
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request modifies the upgrade process to perform a network-free refresh of the local tools' installed state while preserving their cached latest_version in the snapshot. This ensures consistency between make update and make upgrade without clobbering upstream data. The changes include updates to audit.py, scripts/guide.sh, and the addition of a corresponding test suite. Feedback on the changes suggests safeguarding against potential None values when updating snapshot attributes to prevent serializing null into the JSON, which could cause downstream parsing issues.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…e (review) Coerce installed_version/method/path and latest to '' with 'or ""' so they never serialize as null (which guide.sh's json_field would render as the literal 'None'). Addresses gemini-code-assist review feedback. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
|



Summary
In
make upgrade, theinstalled:line (from the cached snapshot) could disagree with the installer's livebefore:line — e.g.installed: not installeddirectly abovebefore: v10.5.0, orinstalled: 11.12.1abovebefore: 11.17.0. They describe the same thing (the version present before the upgrade), so they must match.Root cause: the guide renders
installed:fromtools_snapshot.json, which goes stale (e.g. after tools change outside the tool), while the installers detect live.Fix
The guide now refreshes the snapshot's installed state at startup (network-free) so
installed:matchesbefore:.Crucially, the full
audit.py --update-localpath now refreshesinstalled_version+ status from live detection but PRESERVES each tool's existinglatest_version— instead of rebuildinglatestfrom the older committed baseline (which would show atargetlower thaninstalledand re-open themake updatevsmake upgradedivergence fixed in #94). Status is recomputed with the directionalcompute_statusfrom #94.Multi-version cycles (
node@24,python@3.12, …) are left tomake update/ the per-cycle re-audit, since--update-localhas no per-cycle local-only data.Verified
before:11.12.1, latest11.17.011.17.0, latest11.17.0(preserved) → UP-TO-DATE11.17.0✓—, latest3.8.43.8.4, latest3.8.4(preserved) → UP-TO-DATE3.8.4✓10.5.0, latest10.5.0v10.5.0✓Behavioral test added (
--update-localpreserves a seededlatestwhile refreshinginstalled). Full suite 630 passed;flake8/shellcheckclean on changed lines.Trade-off: adds a ~5s network-free local detection at guide startup — the accepted cost of an accurate
installed:before modifying the system.