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§
- Remote
Head - What the remote reported. Separated from the HTTP call so the comparison logic is testable without a network.
Enums§
- Update
Status - 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.