# kcode-pending-object-store
`kcode-pending-object-store` provides durable, checksummed sidecar storage for
objects that are pending a caller-owned lifecycle transition.
```rust
use kcode_pending_object_store::PendingObjectStore;
let store = PendingObjectStore::new("./data/sessions", "session-42", "0.2.1")?;
store.install(0, "notes.txt", "text/plain", b"durable bytes")?;
let object = store.read(0)?;
assert_eq!(object.file_name, "notes.txt");
assert_eq!(object.media_type, "text/plain");
assert_eq!(object.bytes, b"durable bytes");
# Ok::<(), anyhow::Error>(())
```
Installation synchronizes a same-directory temporary file, atomically renames
it to its canonical final name, and synchronizes the directory. Reads validate
the complete format and SHA-256 checksum. Reconciliation and deletion match
only exact canonical filenames for the configured namespace.
The binary format is byte-for-byte compatible with pending-object sidecars
written by `kcode-session-log` when the same namespace and format ID are used.
The caller owns directory creation, position assignment, lifecycle policy, and
concurrency control.
The crate directory is a conforming `kcode-rust-libs-v2` managed library. Its
manifest is standalone, its package version is literal, and root
`Documentation.md` supplies the agent-facing API reference. Generated Cargo
state must remain outside the crate directory.
See [Documentation.md](Documentation.md) for the API and
[Specification.md](Specification.md) for behavioral guarantees.