Skip to content

update and doctor compare versions as strings #718

Closed

Description

@drawmeanelephant

Suggested labels: bug, area: cli


Discovery audit finding L7 (low) — cooklang/cookcli @ 7c2f48b (v0.38.1), audited 2026-10-12. Code-verified only (latent — needs a future release to trigger).

Summary

cook update / cook doctor version checks compare versions as strings.

Where

src/update.rs:29-31,96-98 (current_version >= latest_version on &str).

Repro (latent)

At a 9→10 boundary (0.38.9 vs 0.38.10) it reports "already on the latest version" and offers no update, because "0.38.9" >= "0.38.10" as strings.

Expected

Semver-aware comparison.

Actual

Lexicographic string comparison.

Acceptance criteria (red → green)

Green when version comparison is semver-aware (e.g. via a semver crate): 0.38.10 is correctly detected as newer than 0.38.9.

Verification

Code-verified only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions