feat(store): add tines-store persistent append-only LogStore
Add the host-side std `tines-store` crate implementing the `tines_core::Store` trait over a durable, append-only single-file log so a robot's memory survives reboot. - Log format: length-prefixed `[u32 LE][postcard]` records (Obs/Trim/Meta). - On load the index is rebuilt by replaying the log, then every age is rebased to load time: elapsed time since the last persisted clock marker is folded into `age_ms` and `stored_at` reset to load `now`, so ages continue instead of freezing across a reboot. - Persisted state: released-id set, `next_seq`, and a clock marker in a `Meta` record; dedupe to the oldest Obs and let the last event per id win so a re-inserted id survives a trim. - Implements `next_seq` and `flush`; `trim` writes Trim records best-effort. - Registered as a workspace member; std-only, `#![forbid(unsafe_code)]`. - Adds persistence tests (append durability, rebase-on-load, released/seq persistence). Full gate (fmt, clippy, docs, tests, no_std thumb build) is green.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
//! tines-store — persistent append-only `LogStore` backend.
|
||||
//!
|
||||
//! This crate is the host-side (std) persistence layer for tines. The `Store`
|
||||
//! trait, `TrimPolicy`, and `StoreError` live in `tines-core` (which stays
|
||||
//! `no_std` and I/O-free); everything durable lives here.
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
pub mod log;
|
||||
|
||||
pub use log::LogStore;
|
||||
Reference in New Issue
Block a user