Skip to main content

Module policy

Module policy 

Source
Expand description

Self-update policy — synchronous, throttled pre-run update checks.

User-initiated update (the subcommand) is always available; this module governs the automatic check a tool may run at the start of an invocation, per its UpdatePolicy baseline. The check is throttled by a persisted last-check timestamp so it runs at most once per update_check_interval. This is not a background daemon — it is a single synchronous check before command dispatch.

The engine here is deliberately decoupled from the crate::Updater: it queries a ReleaseProvider and reports a PolicyDecision; the caller (the application pre-run hook) acts on it per policy — Enabled performs the update before running, Prompt notifies the user.

See docs/development/specs/2026-06-23-rtb-update-policy-v0.1.md.

Structs§

UpdateState
Persisted throttle state — when the last automatic check ran and the newest version it observed. Stored as TOML beside the tool’s consent.toml (the caller supplies the path).

Enums§

PolicyDecision
What the pre-run policy check determined.
UpdatePolicy
Author-set baseline for synchronous, pre-run self-update checks.

Functions§

evaluate
Run the synchronous, throttled pre-run update check.