1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: Apache-2.0
//! The MicroVMs client's rules and values, with no I/O (ARCH-6).
//!
//! Every surface has to agree on these: the size classes, the cost engine and its rate table,
//! region parsing, the service constraints, VM name validation, the error kinds, and the
//! tunnel identity's derivation and pin. A rule that read ambient state would give different
//! answers on different machines, and it couldn't be tested without faking that state
//! globally. So nothing here reads the network, the filesystem, the environment, the clock
//! or the OS random pool, or starts a subprocess; each input a rule needs is a parameter.
//! [`region::Region::from_env`] takes a lookup, [`cost::CalendarDate::from_unix_secs`] takes
//! the time, and [`identity::LaunchIdentity::from_seeds`] takes the seeds.
//!
//! Two checks hold that. `clippy.toml` beside this crate's manifest bans the std calls and
//! the clock and entropy calls of the crates this one uses, and the crate root below forbids
//! both lints. The crates that could do I/O through a dependency (tokio, getrandom, reqwest)
//! are kept out by the exact dependency set in `verify/arch/placement.toml`, which
//! `crates/microvms-cli/tests/dependency_direction.rs` asserts along with each dependency's features.
//!
//! `microvms-core` re-exports every module here at its old path (ARCH-1), so a consumer names
//! these items as `microvms_core::cost::CalendarDate` and never depends on this crate. Core's
//! `prelude` supplies the clock and entropy reads these types used to do themselves.
// CLI-7: a print macro panics when its stream's reader has gone (#216). Every write goes
// through a checked writer instead.
// ARCH-6: `clippy.toml` beside this crate's manifest names the file, process, network,
// environment, clock and entropy items this crate may not touch. Forbidden rather than denied,
// so a hit fails the build and an inner `#[allow]` or `#[expect]` is itself an error (E0453):
// the adapters list each reviewed exception, and the domain has none to list.
pub use ;
pub use ;
pub use Region;
pub use SizeClass;