proofsheet_core/lib.rs
1//! # proofsheet-core
2//!
3//! Local-first browser control for two jobs that turn out to be the same job:
4//! producing store-ready screenshots at exact dimensions, and running
5//! deterministic tests against a real browser.
6//!
7//! Both need the same three things — a driver, a way to make the page stop
8//! being nondeterministic, and a record of what happened that can be checked
9//! later. So they share one core.
10//!
11//! ## Design commitments
12//!
13//! - **The model never authors code or selectors.** Actions are typed; the
14//! runtime composes them. A free-text field in a tool schema is
15//! grammar-constrained to *any* text, so the field is removed rather than
16//! validated after the fact.
17//! - **Output pixels are the source of truth.** Stores specify pixels; the
18//! viewport is derived. See [`device`].
19//! - **Determinism is injected, not hoped for.** See [`determinism`].
20//! - **Nothing is claimed without a negative control.** A check that cannot
21//! fail on correct input is not evidence.
22//!
23//! ## Dependencies
24//!
25//! Deliberately small. No async runtime, no browser automation framework: a
26//! tool people install should not drag a dependency tree behind it.
27
28#![deny(rust_2018_idioms)]
29#![warn(missing_debug_implementations)]
30
31pub mod capture;
32pub mod cdp;
33pub mod determinism;
34pub mod device;
35pub mod error;
36pub mod install;
37pub mod png;
38pub mod progress;
39pub mod run;
40mod ws;
41
42pub use capture::{capture, Capture, CaptureRequest, Environment, Stability};
43pub use cdp::{find_browser, Browser, LaunchOptions};
44pub use determinism::Determinism;
45pub use device::{builtin, by_id, for_store, Device, Platform, Requirement, Store};
46pub use error::{Error, Result};
47pub use install::{install_browser, managed_root};
48pub use progress::{Collector, DeviceEvent, Outcome, Progress, Silent, Summary, Tally};
49pub use run::{run, DeviceResult, RunOptions, RunReport};
50
51/// The crate version, surfaced so receipts can record which build produced
52/// them.
53pub const VERSION: &str = env!("CARGO_PKG_VERSION");
54
55#[cfg(test)]
56mod tests {
57 #[test]
58 fn version_is_populated() {
59 assert!(!super::VERSION.is_empty());
60 }
61}