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:
2026-10-18 12:43:42 -07:00
parent f9613b1c32
commit 43b73f88cd
6 changed files with 609 additions and 3 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
[workspace]
members = ["tines-core", "tines-sim"]
members = ["tines-core", "tines-sim", "tines-store"]
resolver = "2"
[workspace.package]