gwk_kernel/lib.rs
1//! The GridWork kernel: the PostgreSQL implementation behind the `gwk`
2//! contract.
3//!
4//! `gwk-domain` says WHAT the contract is; this crate is one engine's answer to
5//! it. The split is load-bearing — everything backend-specific (this crate, the
6//! `gwk_internal` schema, the migrations beside it) stays on this side of the
7//! line, and `schema/0001_contract.sql` stays engine-neutral so a second
8//! backend has something to conform to.
9//!
10//! What is here so far: configuration, the embedded contract DDL and its
11//! fingerprint, the one-shot initializer, the fenced append store, the epoch
12//! that seals a fresh log until it is activated, the work lifecycle's command
13//! path and projections, and the blob spine — the encrypted container format
14//! and the store that dedups, pins, sweeps, rotates and shreds it, the
15//! projection snapshots, and the recovery that decides what a restart may claim
16//! about them. The wire server lands on top of them.
17
18pub mod admin;
19pub mod authority;
20pub mod blob;
21pub mod checkpoint;
22pub mod config;
23pub mod epoch;
24pub mod error;
25pub mod numeric;
26pub mod project;
27pub mod recover;
28pub mod store;
29pub mod submit;
30pub mod wire;
31pub mod writer;
32
33pub use admin::{InitOutcome, RoleAttributes, RuntimePrivileges, TargetState};
34pub use blob::store::{PgBlobStore, UPLOAD_EXPIRY_SECS};
35pub use config::{AdminConfig, BlobConfig, DEFAULT_SOCKET_PATH, KernelConfig};
36pub use epoch::{GENESIS_KEY, KERNEL_AGGREGATE, KERNEL_SINGLETON, SYSTEM_PROJECT};
37pub use error::{KernelError, Result};
38// The DDL is contract, so it is generated into `gwk-domain` and re-exported here
39// — the paths every caller already uses keep resolving, and the crate that
40// asserts the SQL matches its own state machines carries the bytes it asserts
41// against. See `xtask/src/schema.rs` for why a constant and not `include_str!`.
42pub use gwk_domain::contract_sql;
43pub use gwk_domain::contract_sql::{CONTRACT_SQL, CONTRACT_SQL_SHA256};
44pub use project::Refusal;
45pub use recover::{RebuildReport, RecoveryReport, Verdict};
46pub use store::{EVENT_CHANNEL, MAX_INFLIGHT_APPENDS, PgEventStore, connect_pool};
47pub use wire::WireError;
48pub use wire::hello::{OFFERED_CAPABILITIES, Readiness, Session};
49pub use writer::{WRITER_LOCK_KEY, WriterLock, claim_epoch};