Skip to main content

Module update_check

Module update_check 

Source
Expand description

R5: know when the skill pack needs updating.

provenance answers “which pack am I on?”. This module answers the other half of R5: “is there a newer one?”

§The rule that shapes this module

A check that cannot reach the network reports UpdateStatus::Unknown, never UpdateStatus::UpToDate.

This is not defensive style, it is the whole point. “Up to date” is a claim about the remote; if the remote was never contacted, the claim is unsupported. Reporting UpToDate on a failed request produces a system that looks healthy precisely when it has stopped being able to tell — and a user who trusts a green check will never look again. An honest Unknown prompts a retry; a dishonest UpToDate ends the conversation.

The type makes the mistake hard to make: every failure path in compare_to_remote constructs Unknown with the reason attached, and there is no code path from an error to UpToDate.

Structs§

RemoteHead
What the remote reported. Separated from the HTTP call so the comparison logic is testable without a network.

Enums§

UpdateStatus
The result of an update check.

Functions§

check_for_update
Check the loaded pack against its published repository.
compare_to_remote
Compare local provenance against a remote head.
default_repo
Where the pack is published.
fetch_remote_head
Fetch the remote head for repo’s default branch.