aion_server/update_check/mod.rs
1//! The built-in update check: "does a newer `aion-cli` exist?" — slice one,
2//! know and show.
3//!
4//! Four parts, one contract:
5//!
6//! - [`document`] — the embedded AWL document whose declared `curl` command
7//! the server executes through the declared-body spine, with its output on
8//! the transcript. The binary's default build keeps ZERO outbound-HTTP
9//! dependencies; the transfer is runtime `curl` in a declared command.
10//! - [`install`] — boot-time installation of that document into the engine
11//! catalog, claiming only a catalog that holds no version of it. Installing
12//! makes the check STARTABLE; it never starts one.
13//! - `observer` + `index`/`semver` (crate-internal) — the server half: when
14//! the check's own dispatch completes, parse the fetched sparse-index lines
15//! (skipping yanked releases and prereleases — the versions a plain
16//! `cargo install` refuses) and record the greatest installable version.
17//! - `status` (crate-internal) — the recorded last check, served by
18//! `GET /update-status` beside the installed version from
19//! [`crate::build_identity`].
20//!
21//! # Manual-only is the design, not a default
22//!
23//! There is no cadence configuration key, no timer, no check-on-startup.
24//! Every check is one explicit operator act — the ops console's "check now"
25//! or a plain workflow start. And knowing is ALL this slice does: no install,
26//! no upgrade, and no restart machinery exists here.
27//!
28//! # Visibility: only the document and its install are API
29//!
30//! The parser, the SemVer implementation, the observer, and the status slot
31//! are implementation detail behind `GET /update-status`, and publishing them
32//! would make a hand-rolled SemVer part of `aion-server`'s public API — a
33//! surface that could never be retired. They are `pub(crate)`; the embedded
34//! document and its boot install are the exported face (the CLI and the e2e
35//! suites drive the feature through them, exactly as with the assistant).
36
37/// The embedded AWL document, its compiled identity, and the verified names
38/// the server half keys on.
39pub mod document;
40/// The crates.io sparse-index line parse (crate-internal).
41pub(crate) mod index;
42/// Boot-time installation of the embedded document into the engine catalog.
43pub mod install;
44/// The dispatch decorator that records completed checks (crate-internal).
45pub(crate) mod observer;
46/// Strict SemVer 2.0.0 parsing and precedence (crate-internal).
47pub(crate) mod semver;
48/// The server's memory of its last completed check (crate-internal).
49pub(crate) mod status;
50
51pub use document::{
52 EMBEDDED_UPDATE_CHECK_DOCUMENT, EMBEDDED_UPDATE_CHECK_FILENAME, EmbeddedUpdateCheck,
53 EmbeddedUpdateCheckError, FETCH_ACTION, FETCH_COMMAND, UPDATE_CHECK_QUEUE,
54 UPDATE_CHECK_WORKFLOW_TYPE, embedded_update_check,
55};
56pub use install::{
57 UpdateCheckInstall, install_embedded_update_check, install_embedded_update_check_for_server,
58};
59pub(crate) use observer::UpdateCheckObserver;
60pub(crate) use status::UpdateStatusState;