kcode-pending-object-store 0.1.0

Durable checksummed pending-object sidecar storage
Documentation
  • Coverage
  • 8.33%
    1 out of 12 items documented0 out of 8 items with examples
  • Size
  • Source code size: 31.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 443.6 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • DavidVorick

kcode-pending-object-store

kcode-pending-object-store provides durable, checksummed sidecar storage for objects that are pending a caller-owned lifecycle transition.

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 for the API and Specification.md for behavioral guarantees.