KeiSeiKit-1.0/_primitives/_rust/kei-diff/src/lib.rs
Parfii-bot a4e667de10 KeiSeiKit-public — clean state
Single-commit clean baseline after security scrub of niche-tells,
project codenames, internal jargon, and contributor-email leaks.

Contents:
- 100 Rust crates (_primitives/_rust/)
- 37 agent manifests (_manifests/) + generated specs (_generated/)
- 67 user-invocable skills (skills/)
- 33 hooks (hooks/)
- Composition blocks (_blocks/)
- Documentation (docs/, README.md)
- TS adapter packages (_ts_packages/)
- Assembler (_assembler/)
- Roles (_roles/)
- Templates (_templates/)
- Forgejo CI (.forgejo/)

Author: Denis Parfionovich <info@greendragon.info>

License: see LICENSE.
2026-05-01 12:09:03 +08:00

22 lines
731 B
Rust

//! kei-diff — structural JSON diff (RFC 6902 subset: add/remove/replace).
//!
//! ## Design
//! * Emits ONLY `add`, `remove`, `replace`. No `copy`/`move`/`test`.
//! * Arrays diffed by index (not LCS) — matches drift-detection semantics.
//! * Paths are RFC 6901 JSON Pointers (`~` → `~0`, `/` → `~1`).
//! * Correctness invariant: `apply(old, diff(old, new)) == new`.
//!
//! Consumed by `kei-replay` (drift detection between DNA-scoped agent runs)
//! and `kei-cache` (invalidation signals). Pure compute, zero sibling deps.
mod apply;
mod apply_error;
mod diff;
mod op;
mod path;
pub use apply::apply;
pub use apply_error::ApplyError;
pub use diff::diff;
pub use op::{Op, Patch};
pub use path::PathBuf as PointerBuf;