feat(store): the read paths — get/stat/read_range/has/list on the fall-through rule
- Public `(len, stream)` shape: `Store::get` returns
`Option<(u64, Blob)>`; `Blob` (src/facade.rs) is a bounded, re-entrant
windowed reader over the new crate-internal `AnyCursor` tier dispatch
(mem materializing / local pread body families) — engine cursors
never leak onto the surface; no chunk-iterator machinery.
- Verification-on-get pinned against ADR-006: kv-tier materialized
reads whole-blob hash-check at get time (mismatch = Err(Verification),
never a further fall-through); the large tier's streaming open is
metadata + handle only (put-path verification + slice digests are its
story); `read_range` carries slice digests only, on both tiers.
- `stat` rides the trait's `size` probe (never a content load) into
`EntryMeta { len, algorithm }`; `has` is the pure existence probe;
both fall through kv -> large like every key-addressed op (ADR-012
§6.1) — consult order, not routing (never consults `tier_for`).
- Miss shapes enforced (the error module's behavioral note): both-tier
misses are Ok(None) on get/stat, false on has, Err(Missing) on
read_range; `src/error.rs` wave-2 deferral notes updated to enforced
state.
- `list` decided Vec<Key>: materialized, sorted total-order union of
both tiers (the sweep consumes the engines' enumeration directly);
malformed pool bytes are fatal `Err(KeyInvalid)`, never a silent
skip.
- `KeyInvalid` at the facade boundary: ops take opaque key bytes and
convert via `Key::from_bytes` once (`boundary_key`); engines never
see typed keys.
- Twelve read-path tests: virgin-store shapes per mode (dual-tier,
mem-only, kv-only), the `(len, stream)` windows, fall-through,
kv-first (decoy content in the large tier), both verification
postures, list union/sort/pool-fatality, and malformed-key
rejection on every op.
Task: tasks/store-read-paths.md (design points recorded in Notes for
the wave-2 review gate).
Verification: cargo test (default), cargo test --features mem, cargo
test --all-features green; cargo clippy --all-targets -- -D warnings
green in all three feature shapes; cargo fmt --check green; cargo doc
--no-deps clean beyond the pre-existing private-intra-doc-links class.
This commit is contained in:
1 parent
532adfa707
commit
f1f505a910
7 files changed
+935
-46
No files matched your search
+5
-2
@@ -21,8 +21,11 @@
|
||||
//! own modes.
|
||||
//!
|
||||
//! The `#![allow(dead_code)]` below marks the seam's scope: `route` is
|
||||
//! driven by the facade's write path (store-put-paths) and consulted by
|
||||
//! the facade's read paths; the allow shrinks as those land.
|
||||
//! driven by the facade's write-side tier selection (`Store::tier_for`),
|
||||
//! whose own caller is the put seam (store-put-paths); the allow shrinks
|
||||
//! as those land. Read-side ops do not consult `route` — the
|
||||
//! fall-through consult order is the facade's (kv first, then large;
|
||||
//! ADR-012 §6.1).
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
|
||||
Reference in new issue
Block a user