Files
alkstore/alkstore-sqlite/src/substrate/mod.rs
T

76 lines
3.6 KiB
Rust

//! The substrate: the SQLite storage machinery forked from honker-core
//! (dual-licensed MIT OR Apache-2.0, third-party upstream —
//! github.com/russellromney/honker), carried in-tree as a bounded
//! module subtree of `alkstore-sqlite` per
//! ADR-013 (docs/architecture/decisions/013-fold-substrate-into-sqlite.md).
//!
//! Fork point: honker-core @ `f4e53c6` (`/workspace/honker`, package
//! `node-v0.5.1-10-gf4e53c6`; full commit
//! `f4e53c6b83ad2d6979c04098d576db024ce7e98d`). The reference checkout
//! remains the source for cherry-pick candidates and differential
//! testing — no dependency, no wiring (ADR-012 §6).
//!
//! Boundary (ADR-012 §2): this module is contract-blind storage
//! machinery. It depends on nothing of ours — no `alkstore` core
//! types, no contract traits, no error taxonomy. Its API takes and
//! returns primitives; the engine layer above resolves contract
//! semantics into primitive arguments and maps substrate outcomes into
//! the contract taxonomy. Nothing here is re-exported through the
//! engine crate's public API — the sole exception (register D-37): the
//! re-derived half's `@every` parser pair (`parse_every_interval`,
//! `skip_forward`) is re-exported to the engine crate root as a
//! `#[doc(hidden)]` fuzz/test-only surface. The fork point, every
//! deliberate divergence, and any future cherry-pick are recorded in
//! the provenance register (`PROVENANCE.md`, this directory; ADR-018).
//!
//! Fidelity posture (ADR-012 §3): where scope *keeps* upstream
//! machinery, upstream's module structure and internal function names
//! survive — lineage tokens included — so future cherry-picks from the
//! upstream fix train stay diffable. The re-derived half (the queue
//! ops) is new code with contract-derived names.
//!
//! Runtime posture (ADR-012 §4): the substrate stays sync. The bridged
//! seam at the engine layer remains the async story.
//!
//! License: upstream MIT OR Apache-2.0 — the bundled notice (`LICENSE`,
//! this directory) is the preservation obligation's carrier;
//! provenance register: [`PROVENANCE.md`](PROVENANCE.md).
//!
//! Scaffold state: the connection/watcher machinery (the kept half
//! of the fork, ported by `fork-port-connection-watcher`) lives under
//! this module below — `schema.rs`, `watcher.rs`, `ops.rs` in
//! upstream's `lib.rs` / `honker_ops.rs` order. The re-derived queue
//! ops (`fork-rederive-queue-ops`, register D-12) live in
//! `queue_ops.rs` — owned contract-v1 code, not lineage body.
//!
//! Port state (wave 3): the machinery below is ported and wired — the
//! engine layer reaches every substrate surface, so no dead-code
//! posture remains; genuinely unreachable ported code is cut, not
//! suppressed (any cut is a register entry in `PROVENANCE.md`).
mod ops;
mod queue_ops;
mod schema;
mod watcher;
#[cfg(test)]
pub(crate) use watcher::DEFAULT_WATCHER_POLL_INTERVAL;
pub(crate) use ops::{
lock_acquire, lock_release, lock_renew, stream_get_offset, stream_publish, stream_read_since,
stream_save_offset,
};
pub(crate) use queue_ops::{
FireOpts, Stamps, ack, ack_batch, cancel, claim_batch, enqueue, fail, get_job, heartbeat,
retry, scheduler_register, scheduler_soonest, scheduler_tick, scheduler_unregister,
sweep_expired,
};
/// The doc-hidden fuzz/test re-exports' substrate-side facade (the
/// engine's `lib.rs` republishes these under `#[doc(hidden)]`; register
/// D-37).
pub use queue_ops::{parse_every_interval, skip_forward};
pub(crate) use schema::Error as SchemaError;
pub(crate) use schema::open_conn_bootstrapped;
pub(crate) use schema::{Readers, Writer};
pub(crate) use watcher::{SharedUpdateWatcher, WatcherConfig};