kernel/lib.rs
1// Copyright 2026 Mark AB (markik)
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! `kernel`: Portable identity, authority, and mutation kernel.
5//!
6//! This crate must compile to `wasm32-unknown-unknown` with zero errors.
7//! It contains no egui, wgpu, Servo, or platform I/O dependencies.
8//!
9//! Forbidden in this crate:
10//! - `Uuid::new_v4()` outside `#[cfg(not(target_arch = "wasm32"))]` (WASM hosts provide IDs)
11//! - `std::time::{Instant, SystemTime}::now()` (panics on browser WASM — use
12//! `PortableInstant` or the crate's `web_time`-backed wall-clock helpers)
13//! - `#[wasm_bindgen]` / UniFFI annotations (belong in wrapper crates)
14//! - any platform I/O (file, network, browser APIs)
15
16pub mod accessibility;
17pub mod actions;
18pub mod address;
19pub mod async_host;
20pub mod async_request;
21pub mod color;
22pub mod content;
23pub mod geometry;
24pub mod graph;
25pub mod host_event;
26pub mod host_toolkit;
27pub mod intents;
28pub mod overlay;
29pub mod paint;
30pub mod pane;
31/// Settings/permissions scope hierarchy + the narrowing rule (R0 invariant).
32pub mod permissions;
33pub mod persistence;
34/// Edge persistence types (`PersistedEdge` et al.), re-exported through
35/// [`persistence`]. Separate file to keep `persistence.rs` under the ceiling.
36pub mod persistence_edge;
37/// Field-layer persistence DTOs (`PersistedField`/`PersistedCoupling`),
38/// re-exported through [`persistence`]. Separate file to keep `persistence.rs`
39/// under the per-file ceiling.
40pub mod persistence_fields;
41pub mod signal_router;
42/// Native on-disk graph persistence. Gated by the `store` feature so the kernel
43/// stays portable-by-default; the native host enables it.
44#[cfg(feature = "store")]
45pub mod store;
46pub mod time;
47pub mod types;
48pub mod verso_address;
49
50#[cfg(test)]
51mod tests;